You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
372 lines
1.2 MiB
372 lines
1.2 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[64,3,5,6,7,8,9],{"+NIl":function($e,ke,F){(function(ee){ee(F("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function(X,k){"use strict";function Q(_,S){_.cmdState.push(S)}function N(_){return _.cmdState.length>0?_.cmdState[_.cmdState.length-1]:null}function O(_){var S=_.cmdState.pop();S&&S.closeBracket()}function U(_){for(var S=_.cmdState,y=S.length-1;y>=0;y--){var d=S[y];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function B(_,S,y){return function(){this.name=_,this.bracketNo=0,this.style=S,this.styles=y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var I={};I.importmodule=B("importmodule","tag",["string","builtin"]),I.documentclass=B("documentclass","tag",["","atom"]),I.usepackage=B("usepackage","tag",["atom"]),I.begin=B("begin","tag",["atom"]),I.end=B("end","tag",["atom"]),I.label=B("label","tag",["atom"]),I.ref=B("ref","tag",["atom"]),I.eqref=B("eqref","tag",["atom"]),I.cite=B("cite","tag",["atom"]),I.bibitem=B("bibitem","tag",["atom"]),I.Bibitem=B("Bibitem","tag",["atom"]),I.RBibitem=B("RBibitem","tag",["atom"]),I.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(_,S){_.f=S}function E(_,S){var y;if(_.match(/^\\[a-zA-Z@]+/)){var d=_.current().slice(1);return y=I.hasOwnProperty(d)?I[d]:I.DEFAULT,y=new y,Q(S,y),D(S,P),y.style}if(_.match(/^\\[$&%#{}_]/))return"tag";if(_.match(/^\\[,;!\/\\]/))return"tag";if(_.match("\\["))return D(S,function(u,h){return R(u,h,"\\]")}),"keyword";if(_.match("\\("))return D(S,function(u,h){return R(u,h,"\\)")}),"keyword";if(_.match("$$"))return D(S,function(u,h){return R(u,h,"$$")}),"keyword";if(_.match("$"))return D(S,function(u,h){return R(u,h,"$")}),"keyword";var s=_.next();if(s=="%")return _.skipToEnd(),"comment";if(s=="}"||s=="]"){if(y=N(S),y)y.closeBracket(s),D(S,P);else return"error";return"bracket"}else return s=="{"||s=="["?(y=I.DEFAULT,y=new y,Q(S,y),"bracket"):/\d/.test(s)?(_.eatWhile(/[\w.%]/),"atom"):(_.eatWhile(/[\w\-_]/),y=U(S),y.name=="begin"&&(y.argument=_.current()),y.styleIdentifier())}function R(_,S,y){if(_.eatSpace())return null;if(y&&_.match(y))return D(S,E),"keyword";if(_.match(/^\\[a-zA-Z@]+/))return"tag";if(_.match(/^[a-zA-Z]+/))return"variable-2";if(_.match(/^\\[$&%#{}_]/))return"tag";if(_.match(/^\\[,;!\/]/))return"tag";if(_.match(/^[\^_&]/))return"tag";if(_.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(_.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=_.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(_.skipToEnd(),"comment"):"error"}function P(_,S){var y=_.peek(),d;return y=="{"||y=="["?(d=N(S),d.openBracket(y),_.eat(y),D(S,E),"bracket"):/[ \t\r]/.test(y)?(_.eat(y),null):(D(S,E),O(S),E(_,S))}return{startState:function(){var _=k.inMathMode?function(S,y){return R(S,y)}:E;return{cmdState:[],f:_}},copyState:function(_){return{cmdState:_.cmdState.slice(),f:_.f}},token:function(_,S){return S.f(_,S)},blankLine:function(_){_.f=E,_.cmdState.length=0},lineComment:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"/GNS":function($e,ke,F){$e.exports=F.p+"static/search1.c4136dd4.png"},"19Vz":function($e,ke,F){(function(ee){ee(F("VrN/"))})(function(ee){ee.defineOption("placeholder","",function(B,I,D){var E=D&&D!=ee.Init;if(I&&!E)B.on("blur",N),B.on("change",O),B.on("swapDoc",O),ee.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){Q(B)}),O(B);else if(!I&&E){B.off("blur",N),B.off("change",O),B.off("swapDoc",O),ee.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),X(B);var R=B.getWrapperElement();R.className=R.className.replace(" CodeMirror-empty","")}I&&!B.hasFocus()&&N(B)});function X(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function k(B){X(B);var I=B.state.placeholder=document.createElement("pre");I.style.cssText="height: 0; overflow: visible",I.style.direction=B.getOption("direction"),I.className="CodeMirror-placeholder CodeMirror-line-like";var D=B.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),I.appendChild(D),B.display.lineSpace.insertBefore(I,B.display.lineSpace.firstChild)}function Q(B){setTimeout(function(){var I=!1,D=B.getInputField();D.nodeName=="TEXTAREA"?I=!D.value:B.lineCount()==1&&(I=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),I?k(B):X(B)},20)}function N(B){U(B)&&k(B)}function O(B){var I=B.getWrapperElement(),D=U(B);I.className=I.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?k(B):X(B)}function U(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function($e,ke,F){(function(ee){ee(F("VrN/"))})(function(ee){"use strict";var X={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ee.defineMode("xml",function(Q,N){var O=Q.indentUnit,U={},B=N.htmlMode?X:k;for(var I in B)U[I]=B[I];for(var I in N)U[I]=N[I];var D,E;function R(i,x){function b(C){return x.tokenize=C,C(i,x)}var m=i.next();if(m=="<")return i.eat("!")?i.eat("[")?i.match("CDATA[")?b(S("atom","]]>")):null:i.match("--")?b(S("comment","-->")):i.match("DOCTYPE",!0,!0)?(i.eatWhile(/[\w\._\-]/),b(y(1))):null:i.eat("?")?(i.eatWhile(/[\w\._\-]/),x.tokenize=S("meta","?>"),"meta"):(D=i.eat("/")?"closeTag":"openTag",x.tokenize=P,"tag bracket");if(m=="&"){var L;return i.eat("#")?i.eat("x")?L=i.eatWhile(/[a-fA-F\d]/)&&i.eat(";"):L=i.eatWhile(/[\d]/)&&i.eat(";"):L=i.eatWhile(/[\w\.\-:]/)&&i.eat(";"),L?"atom":"error"}else return i.eatWhile(/[^&<]/),null}R.isInText=!0;function P(i,x){var b=i.next();if(b==">"||b=="/"&&i.eat(">"))return x.tokenize=R,D=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return D="equals",null;if(b=="<"){x.tokenize=R,x.state=h,x.tagName=x.tagStart=null;var m=x.tokenize(i,x);return m?m+" tag error":"tag error"}else return/[\'\"]/.test(b)?(x.tokenize=_(b),x.stringStartCol=i.column(),x.tokenize(i,x)):(i.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function _(i){var x=function(b,m){for(;!b.eol();)if(b.next()==i){m.tokenize=P;break}return"string"};return x.isInAttribute=!0,x}function S(i,x){return function(b,m){for(;!b.eol();){if(b.match(x)){m.tokenize=R;break}b.next()}return i}}function y(i){return function(x,b){for(var m;(m=x.next())!=null;){if(m=="<")return b.tokenize=y(i+1),b.tokenize(x,b);if(m==">")if(i==1){b.tokenize=R;break}else return b.tokenize=y(i-1),b.tokenize(x,b)}return"meta"}}function d(i,x,b){this.prev=i.context,this.tagName=x,this.indent=i.indented,this.startOfLine=b,(U.doNotIndent.hasOwnProperty(x)||i.context&&i.context.noIndent)&&(this.noIndent=!0)}function s(i){i.context&&(i.context=i.context.prev)}function u(i,x){for(var b;;){if(!i.context)return;if(b=i.context.tagName,!U.contextGrabbers.hasOwnProperty(b)||!U.contextGrabbers[b].hasOwnProperty(x))return;s(i)}}function h(i,x,b){return i=="openTag"?(b.tagStart=x.column(),T):i=="closeTag"?g:h}function T(i,x,b){return i=="word"?(b.tagName=x.current(),E="tag",v):U.allowMissingTagName&&i=="endTag"?(E="tag bracket",v(i,x,b)):(E="error",T)}function g(i,x,b){if(i=="word"){var m=x.current();return b.context&&b.context.tagName!=m&&U.implicitlyClosed.hasOwnProperty(b.context.tagName)&&s(b),b.context&&b.context.tagName==m||U.matchClosing===!1?(E="tag",f):(E="tag error",w)}else return U.allowMissingTagName&&i=="endTag"?(E="tag bracket",f(i,x,b)):(E="error",w)}function f(i,x,b){return i!="endTag"?(E="error",f):(s(b),h)}function w(i,x,b){return E="error",f(i,x,b)}function v(i,x,b){if(i=="word")return E="attribute",c;if(i=="endTag"||i=="selfcloseTag"){var m=b.tagName,L=b.tagStart;return b.tagName=b.tagStart=null,i=="selfcloseTag"||U.autoSelfClosers.hasOwnProperty(m)?u(b,m):(u(b,m),b.context=new d(b,m,L==b.indented)),h}return E="error",v}function c(i,x,b){return i=="equals"?l:(U.allowMissing||(E="error"),v(i,x,b))}function l(i,x,b){return i=="string"?a:i=="word"&&U.allowUnquoted?(E="string",v):(E="error",v(i,x,b))}function a(i,x,b){return i=="string"?a:v(i,x,b)}return{startState:function(i){var x={tokenize:R,state:h,indented:i||0,tagName:null,tagStart:null,context:null};return i!=null&&(x.baseIndent=i),x},token:function(i,x){if(!x.tagName&&i.sol()&&(x.indented=i.indentation()),i.eatSpace())return null;D=null;var b=x.tokenize(i,x);return(b||D)&&b!="comment"&&(E=null,x.state=x.state(D||b,i,x),E&&(b=E=="error"?b+" error":E)),b},indent:function(i,x,b){var m=i.context;if(i.tokenize.isInAttribute)return i.tagStart==i.indented?i.stringStartCol+1:i.indented+O;if(m&&m.noIndent)return ee.Pass;if(i.tokenize!=P&&i.tokenize!=R)return b?b.match(/^(\s*)/)[0].length:0;if(i.tagName)return U.multilineTagIndentPastTag!==!1?i.tagStart+i.tagName.length+2:i.tagStart+O*(U.multilineTagIndentFactor||1);if(U.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var L=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(L&&L[1])for(;m;)if(m.tagName==L[2]){m=m.prev;break}else if(U.implicitlyClosed.hasOwnProperty(m.tagName))m=m.prev;else break;else if(L)for(;m;){var C=U.contextGrabbers[m.tagName];if(C&&C.hasOwnProperty(L[2]))m=m.prev;else break}for(;m&&m.prev&&!m.startOfLine;)m=m.prev;return m?m.indent+O:i.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:U.htmlMode?"html":"xml",helperType:U.htmlMode?"html":"xml",skipAttribute:function(i){i.state==l&&(i.state=v)},xmlCurrentTag:function(i){return i.tagName?{name:i.tagName,close:i.type=="closeTag"}:null},xmlCurrentContext:function(i){for(var x=[],b=i.context;b;b=b.prev)b.tagName&&x.push(b.tagName);return x.reverse()}}}),ee.defineMIME("text/xml","xml"),ee.defineMIME("application/xml","xml"),ee.mimeModes.hasOwnProperty("text/html")||ee.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function($e,ke,F){"use strict";F.d(ke,"d",function(){return ht}),F.d(ke,"b",function(){return Oe}),F.d(ke,"c",function(){return rt}),F.d(ke,"a",function(){return wt});var ee=F("VTBJ"),X=F("1OyB"),k=F("vuIU"),Q=F("JX7q"),N=F("Ji7U"),O=F("LK+K"),U=F("q1tI"),B=F("I8Z2"),I=F("BGR+"),D=F("wx14"),E=F("rePB"),R=F("4IlW"),P=F("2GS6"),_=F("Gytx"),S=F.n(_),y=F("TSYQ"),d=F.n(y),s=F("U8pU"),u=F("ODXe"),h=/iPhone/i,T=/iPod/i,g=/iPad/i,f=/\bAndroid(?:.+)Mobile\b/i,w=/Android/i,v=/\bAndroid(?:.+)SD4930UR\b/i,c=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,l=/Windows Phone/i,a=/\bWindows(?:.+)ARM\b/i,i=/BlackBerry/i,x=/BB10/i,b=/Opera Mini/i,m=/\b(CriOS|Chrome)(?:.+)Mobile/i,L=/Mobile(?:.+)Firefox\b/i;function C(pt,Qe){return pt.test(Qe)}function H(pt){var Qe=pt||(typeof navigator!="undefined"?navigator.userAgent:""),ze=Qe.split("[FBAN");if(typeof ze[1]!="undefined"){var De=ze,ae=Object(u.a)(De,1);Qe=ae[0]}if(ze=Qe.split("Twitter"),typeof ze[1]!="undefined"){var de=ze,Ye=Object(u.a)(de,1);Qe=Ye[0]}var Me={apple:{phone:C(h,Qe)&&!C(l,Qe),ipod:C(T,Qe),tablet:!C(h,Qe)&&C(g,Qe)&&!C(l,Qe),device:(C(h,Qe)||C(T,Qe)||C(g,Qe))&&!C(l,Qe)},amazon:{phone:C(v,Qe),tablet:!C(v,Qe)&&C(c,Qe),device:C(v,Qe)||C(c,Qe)},android:{phone:!C(l,Qe)&&C(v,Qe)||!C(l,Qe)&&C(f,Qe),tablet:!C(l,Qe)&&!C(v,Qe)&&!C(f,Qe)&&(C(c,Qe)||C(w,Qe)),device:!C(l,Qe)&&(C(v,Qe)||C(c,Qe)||C(f,Qe)||C(w,Qe))||C(/\bokhttp\b/i,Qe)},windows:{phone:C(l,Qe),tablet:C(a,Qe),device:C(l,Qe)||C(a,Qe)},other:{blackberry:C(i,Qe),blackberry10:C(x,Qe),opera:C(b,Qe),firefox:C(L,Qe),chrome:C(m,Qe),device:C(i,Qe)||C(x,Qe)||C(b,Qe)||C(L,Qe)||C(m,Qe)},any:null,phone:null,tablet:null};return Me.any=Me.apple.device||Me.android.device||Me.windows.device||Me.other.device,Me.phone=Me.apple.phone||Me.android.phone||Me.windows.phone,Me.tablet=Me.apple.tablet||Me.android.tablet||Me.windows.tablet,Me}var J=Object(ee.a)(Object(ee.a)({},H()),{},{isMobile:H}),W=J;function j(){}function $(pt,Qe,ze){var De=Qe||"";return pt.key||"".concat(De,"item_").concat(ze)}function se(pt){return"".concat(pt,"-menu-")}function me(pt,Qe){var ze=-1;U.Children.forEach(pt,function(De){ze+=1,De&&De.type&&De.type.isMenuItemGroup?U.Children.forEach(De.props.children,function(ae){ze+=1,Qe(ae,ze)}):Qe(De,ze)})}function Ee(pt,Qe,ze){if(!pt||ze.find)return;U.Children.forEach(pt,function(De){if(De){var ae=De.type;if(!ae||!(ae.isSubMenu||ae.isMenuItem||ae.isMenuItemGroup))return;Qe.indexOf(De.key)!==-1?ze.find=!0:De.props.children&&Ee(De.props.children,Qe,ze)}})}var We=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Be=function(Qe){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,De=Qe&&typeof Qe.getBoundingClientRect=="function"&&Qe.getBoundingClientRect().width;if(De){if(ze){var ae=getComputedStyle(Qe),de=ae.marginLeft,Ye=ae.marginRight;De+=+de.replace("px","")+ +Ye.replace("px","")}De=+De.toFixed(6)}return De||0},Ne=function(Qe,ze,De){Qe&&Object(s.a)(Qe.style)==="object"&&(Qe.style[ze]=De)},Le=function(){return W.any},Ue=F("KQm4"),ye=F("Ff2n"),ce=F("i8i4"),ne=F("bdgK"),ve=F("uciX"),le=F("8XRh"),Re={adjustX:1,adjustY:1},Ie={topLeft:{points:["bl","tl"],overflow:Re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Re,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Re,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Re,offset:[4,0]}},Ce={topLeft:{points:["bl","tl"],overflow:Re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Re,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Re,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Re,offset:[4,0]}},He=Ie,Ze=0,ot={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},et=function(Qe,ze,De){var ae=se(ze),de=Qe.getState();Qe.setState({defaultActiveFirst:Object(ee.a)(Object(ee.a)({},de.defaultActiveFirst),{},Object(E.a)({},ae,De))})},Ke=function(pt){Object(N.a)(ze,pt);var Qe=Object(O.a)(ze);function ze(De){var ae;Object(X.a)(this,ze),ae=Qe.call(this,De),ae.onDestroy=function(Pe){ae.props.onDestroy(Pe)},ae.onKeyDown=function(Pe){var at=Pe.keyCode,vt=ae.menuInstance,St=ae.props,Rt=St.isOpen,qt=St.store;if(at===R.a.ENTER)return ae.onTitleClick(Pe),et(qt,ae.props.eventKey,!0),!0;if(at===R.a.RIGHT)return Rt?vt.onKeyDown(Pe):(ae.triggerOpenChange(!0),et(qt,ae.props.eventKey,!0)),!0;if(at===R.a.LEFT){var sn;if(Rt)sn=vt.onKeyDown(Pe);else return;return sn||(ae.triggerOpenChange(!1),sn=!0),sn}return Rt&&(at===R.a.UP||at===R.a.DOWN)?vt.onKeyDown(Pe):void 0},ae.onOpenChange=function(Pe){ae.props.onOpenChange(Pe)},ae.onPopupVisibleChange=function(Pe){ae.triggerOpenChange(Pe,Pe?"mouseenter":"mouseleave")},ae.onMouseEnter=function(Pe){var at=ae.props,vt=at.eventKey,St=at.onMouseEnter,Rt=at.store;et(Rt,ae.props.eventKey,!1),St({key:vt,domEvent:Pe})},ae.onMouseLeave=function(Pe){var at=ae.props,vt=at.parentMenu,St=at.eventKey,Rt=at.onMouseLeave;vt.subMenuInstance=Object(Q.a)(ae),Rt({key:St,domEvent:Pe})},ae.onTitleMouseEnter=function(Pe){var at=ae.props,vt=at.eventKey,St=at.onItemHover,Rt=at.onTitleMouseEnter;St({key:vt,hover:!0}),Rt({key:vt,domEvent:Pe})},ae.onTitleMouseLeave=function(Pe){var at=ae.props,vt=at.parentMenu,St=at.eventKey,Rt=at.onItemHover,qt=at.onTitleMouseLeave;vt.subMenuInstance=Object(Q.a)(ae),Rt({key:St,hover:!1}),qt({key:St,domEvent:Pe})},ae.onTitleClick=function(Pe){var at=Object(Q.a)(ae),vt=at.props;if(vt.onTitleClick({key:vt.eventKey,domEvent:Pe}),vt.triggerSubMenuAction==="hover")return;ae.triggerOpenChange(!vt.isOpen,"click"),et(vt.store,ae.props.eventKey,!1)},ae.onSubMenuClick=function(Pe){typeof ae.props.onClick=="function"&&ae.props.onClick(ae.addKeyPath(Pe))},ae.onSelect=function(Pe){ae.props.onSelect(Pe)},ae.onDeselect=function(Pe){ae.props.onDeselect(Pe)},ae.getPrefixCls=function(){return"".concat(ae.props.rootPrefixCls,"-submenu")},ae.getActiveClassName=function(){return"".concat(ae.getPrefixCls(),"-active")},ae.getDisabledClassName=function(){return"".concat(ae.getPrefixCls(),"-disabled")},ae.getSelectedClassName=function(){return"".concat(ae.getPrefixCls(),"-selected")},ae.getOpenClassName=function(){return"".concat(ae.props.rootPrefixCls,"-submenu-open")},ae.saveMenuInstance=function(Pe){ae.menuInstance=Pe},ae.addKeyPath=function(Pe){return Object(ee.a)(Object(ee.a)({},Pe),{},{keyPath:(Pe.keyPath||[]).concat(ae.props.eventKey)})},ae.triggerOpenChange=function(Pe,at){var vt=ae.props.eventKey,St=function(){ae.onOpenChange({key:vt,item:Object(Q.a)(ae),trigger:at,open:Pe})};at==="mouseenter"?ae.mouseenterTimeout=setTimeout(function(){St()},0):St()},ae.isChildrenSelected=function(){var Pe={find:!1};return Ee(ae.props.children,ae.props.selectedKeys,Pe),Pe.find},ae.isOpen=function(){return ae.props.openKeys.indexOf(ae.props.eventKey)!==-1},ae.adjustWidth=function(){if(!ae.subMenuTitle||!ae.menuInstance)return;var Pe=ce.findDOMNode(ae.menuInstance);if(Pe.offsetWidth>=ae.subMenuTitle.offsetWidth)return;Pe.style.minWidth="".concat(ae.subMenuTitle.offsetWidth,"px")},ae.saveSubMenuTitle=function(Pe){ae.subMenuTitle=Pe},ae.getBaseProps=function(){var Pe=Object(Q.a)(ae),at=Pe.props;return{mode:at.mode==="horizontal"?"vertical":at.mode,visible:ae.props.isOpen,level:at.level+1,inlineIndent:at.inlineIndent,focusable:!1,onClick:ae.onSubMenuClick,onSelect:ae.onSelect,onDeselect:ae.onDeselect,onDestroy:ae.onDestroy,selectedKeys:at.selectedKeys,eventKey:"".concat(at.eventKey,"-menu-"),openKeys:at.openKeys,motion:at.motion,onOpenChange:ae.onOpenChange,subMenuOpenDelay:at.subMenuOpenDelay,parentMenu:Object(Q.a)(ae),subMenuCloseDelay:at.subMenuCloseDelay,forceSubMenuRender:at.forceSubMenuRender,triggerSubMenuAction:at.triggerSubMenuAction,builtinPlacements:at.builtinPlacements,defaultActiveFirst:at.store.getState().defaultActiveFirst[se(at.eventKey)],multiple:at.multiple,prefixCls:at.rootPrefixCls,id:ae.internalMenuId,manualRef:ae.saveMenuInstance,itemIcon:at.itemIcon,expandIcon:at.expandIcon,direction:at.direction}},ae.getMotion=function(Pe,at){var vt=Object(Q.a)(ae),St=vt.haveRendered,Rt=ae.props,qt=Rt.motion,sn=Rt.rootPrefixCls,Xt=Object(ee.a)(Object(ee.a)({},qt),{},{leavedClassName:"".concat(sn,"-hidden"),removeOnLeave:!1,motionAppear:St||!at||Pe!=="inline"});return Xt};var de=De.store,Ye=De.eventKey,Me=de.getState(),Xe=Me.defaultActiveFirst;ae.isRootMenu=!1;var dt=!1;return Xe&&(dt=Xe[Ye]),et(de,Ye,dt),ae}return Object(k.a)(ze,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ae=this,de=this.props,Ye=de.mode,Me=de.parentMenu,Xe=de.manualRef;if(Xe&&Xe(this),Ye!=="horizontal"||!Me.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ae.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ae=this.props,de=ae.onDestroy,Ye=ae.eventKey;de&&de(Ye),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ae){var de=this,Ye=this.getBaseProps(),Me=this.getMotion(Ye.mode,Ye.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ye.visible||Ye.forceSubMenuRender,!this.haveOpened)return U.createElement("div",null);var Xe=Ye.direction;return U.createElement(le.default,Object.assign({visible:Ye.visible},Me),function(dt){var Pe=dt.className,at=dt.style,vt=d()("".concat(Ye.prefixCls,"-sub"),Pe,Object(E.a)({},"".concat(Ye.prefixCls,"-rtl"),Xe==="rtl"));return U.createElement(xe,Object.assign({},Ye,{id:de.internalMenuId,className:vt,style:at}),ae)})}},{key:"render",value:function(){var ae,de=Object(ee.a)({},this.props),Ye=de.isOpen,Me=this.getPrefixCls(),Xe=de.mode==="inline",dt=d()(Me,"".concat(Me,"-").concat(de.mode),(ae={},Object(E.a)(ae,de.className,!!de.className),Object(E.a)(ae,this.getOpenClassName(),Ye),Object(E.a)(ae,this.getActiveClassName(),de.active||Ye&&!Xe),Object(E.a)(ae,this.getDisabledClassName(),de.disabled),Object(E.a)(ae,this.getSelectedClassName(),this.isChildrenSelected()),ae));this.internalMenuId||(de.eventKey?this.internalMenuId="".concat(de.eventKey,"$Menu"):(Ze+=1,this.internalMenuId="$__$".concat(Ze,"$Menu")));var Pe={},at={},vt={};de.disabled||(Pe={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},at={onClick:this.onTitleClick},vt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var St={},Rt=de.direction;Xe&&(Rt==="rtl"?St.paddingRight=de.inlineIndent*de.level:St.paddingLeft=de.inlineIndent*de.level);var qt={};this.props.isOpen&&(qt={"aria-owns":this.internalMenuId});var sn=null;de.mode!=="horizontal"&&(sn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(sn=U.createElement(this.props.expandIcon,Object(ee.a)({},this.props))));var Xt=U.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:St,className:"".concat(Me,"-title"),role:"button"},vt,at,{"aria-expanded":Ye},qt,{"aria-haspopup":"true",title:typeof de.title=="string"?de.title:void 0}),de.title,sn||U.createElement("i",{className:"".concat(Me,"-arrow")})),_t=this.renderChildren(de.children),cn=de.parentMenu.isRootMenu?de.parentMenu.props.getPopupContainer:function(kn){return kn.parentNode},zt=ot[de.mode],$t=de.popupOffset?{offset:de.popupOffset}:{},Nt=de.mode==="inline"?"":de.popupClassName;Nt+=Rt==="rtl"?" ".concat(Me,"-rtl"):"";var nn=de.disabled,An=de.triggerSubMenuAction,Tn=de.subMenuOpenDelay,ct=de.forceSubMenuRender,Gt=de.subMenuCloseDelay,Ln=de.builtinPlacements;We.forEach(function(kn){return delete de[kn]}),delete de.onClick;var Fn=Rt==="rtl"?Object.assign({},Ce,Ln):Object.assign({},Ie,Ln);return delete de.direction,U.createElement("li",Object.assign({},de,Pe,{className:dt,role:"menuitem"}),Xe&&Xt,Xe&&_t,!Xe&&U.createElement(ve.a,{prefixCls:Me,popupClassName:d()("".concat(Me,"-popup"),Nt),getPopupContainer:cn,builtinPlacements:Fn,popupPlacement:zt,popupVisible:Ye,popupAlign:$t,popup:_t,action:nn?[]:[An],mouseEnterDelay:Tn,mouseLeaveDelay:Gt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ct},Xt))}}]),ze}(U.Component);Ke.defaultProps={onMouseEnter:j,onMouseLeave:j,onTitleMouseEnter:j,onTitleMouseLeave:j,onTitleClick:j,manualRef:j,mode:"vertical",title:""};var Ve=Object(B.b)(function(pt,Qe){var ze=pt.openKeys,De=pt.activeKey,ae=pt.selectedKeys,de=Qe.eventKey,Ye=Qe.subMenuKey;return{isOpen:ze.indexOf(de)>-1,active:De[Ye]===de,selectedKeys:ae}})(Ke);Ve.isSubMenu=!0;var ht=Ve,mt="menuitem-overflowed",gt=.5,Et=function(pt){Object(N.a)(ze,pt);var Qe=Object(O.a)(ze);function ze(){var De;return Object(X.a)(this,ze),De=Qe.apply(this,arguments),De.resizeObserver=null,De.mutationObserver=null,De.originalTotalWidth=0,De.overflowedItems=[],De.menuItemSizes=[],De.cancelFrameId=null,De.state={lastVisibleIndex:void 0},De.getMenuItemNodes=function(){var ae=De.props.prefixCls,de=ce.findDOMNode(Object(Q.a)(De));return de?[].slice.call(de.children).filter(function(Ye){return Ye.className.split(" ").indexOf("".concat(ae,"-overflowed-submenu"))<0}):[]},De.getOverflowedSubMenuItem=function(ae,de,Ye){var Me=De.props,Xe=Me.overflowedIndicator,dt=Me.level,Pe=Me.mode,at=Me.prefixCls,vt=Me.theme;if(dt!==1||Pe!=="horizontal")return null;var St=De.props.children[0],Rt=St.props,qt=Rt.children,sn=Rt.title,Xt=Rt.style,_t=Object(ye.a)(Rt,["children","title","style"]),cn=Object(ee.a)({},Xt),zt="".concat(ae,"-overflowed-indicator"),$t="".concat(ae,"-overflowed-indicator");de.length===0&&Ye!==!0?cn=Object(ee.a)(Object(ee.a)({},cn),{},{display:"none"}):Ye&&(cn=Object(ee.a)(Object(ee.a)({},cn),{},{visibility:"hidden",position:"absolute"}),zt="".concat(zt,"-placeholder"),$t="".concat($t,"-placeholder"));var Nt=vt?"".concat(at,"-").concat(vt):"",nn={};return We.forEach(function(An){_t[An]!==void 0&&(nn[An]=_t[An])}),U.createElement(ht,Object.assign({title:Xe,className:"".concat(at,"-overflowed-submenu"),popupClassName:Nt},nn,{key:zt,eventKey:$t,disabled:!1,style:cn}),de)},De.setChildrenWidthAndResize=function(){if(De.props.mode!=="horizontal")return;var ae=ce.findDOMNode(Object(Q.a)(De));if(!ae)return;var de=ae.children;if(!de||de.length===0)return;var Ye=ae.children[de.length-1];Ne(Ye,"display","inline-block");var Me=De.getMenuItemNodes(),Xe=Me.filter(function(dt){return dt.className.split(" ").indexOf(mt)>=0});Xe.forEach(function(dt){Ne(dt,"display","inline-block")}),De.menuItemSizes=Me.map(function(dt){return Be(dt,!0)}),Xe.forEach(function(dt){Ne(dt,"display","none")}),De.overflowedIndicatorWidth=Be(ae.children[ae.children.length-1],!0),De.originalTotalWidth=De.menuItemSizes.reduce(function(dt,Pe){return dt+Pe},0),De.handleResize(),Ne(Ye,"display","none")},De.handleResize=function(){if(De.props.mode!=="horizontal")return;var ae=ce.findDOMNode(Object(Q.a)(De));if(!ae)return;var de=Be(ae);De.overflowedItems=[];var Ye=0,Me;De.originalTotalWidth>de+gt&&(Me=-1,De.menuItemSizes.forEach(function(Xe){Ye+=Xe,Ye+De.overflowedIndicatorWidth<=de&&(Me+=1)})),De.setState({lastVisibleIndex:Me})},De}return Object(k.a)(ze,[{key:"componentDidMount",value:function(){var ae=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var de=ce.findDOMNode(this);if(!de)return;this.resizeObserver=new ne.default(function(Ye){Ye.forEach(function(){var Me=ae.cancelFrameId;cancelAnimationFrame(Me),ae.cancelFrameId=requestAnimationFrame(ae.setChildrenWidthAndResize)})}),[].slice.call(de.children).concat(de).forEach(function(Ye){ae.resizeObserver.observe(Ye)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ae.resizeObserver.disconnect(),[].slice.call(de.children).concat(de).forEach(function(Ye){ae.resizeObserver.observe(Ye)}),ae.setChildrenWidthAndResize()}),this.mutationObserver.observe(de,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ae){var de=this,Ye=this.state.lastVisibleIndex;return(ae||[]).reduce(function(Me,Xe,dt){var Pe=Xe;if(de.props.mode==="horizontal"){var at=de.getOverflowedSubMenuItem(Xe.props.eventKey,[]);Ye!==void 0&&de.props.className.indexOf("".concat(de.props.prefixCls,"-root"))!==-1&&(dt>Ye&&(Pe=U.cloneElement(Xe,{style:{display:"none"},eventKey:"".concat(Xe.props.eventKey,"-hidden"),className:"".concat(mt)})),dt===Ye+1&&(de.overflowedItems=ae.slice(Ye+1).map(function(St){return U.cloneElement(St,{key:St.props.eventKey,mode:"vertical-left"})}),at=de.getOverflowedSubMenuItem(Xe.props.eventKey,de.overflowedItems)));var vt=[].concat(Object(Ue.a)(Me),[at,Pe]);return dt===ae.length-1&&vt.push(de.getOverflowedSubMenuItem(Xe.props.eventKey,[],!0)),vt}return[].concat(Object(Ue.a)(Me),[Pe])},[])}},{key:"render",value:function(){var ae=this.props,de=ae.visible,Ye=ae.prefixCls,Me=ae.overflowedIndicator,Xe=ae.mode,dt=ae.level,Pe=ae.tag,at=ae.children,vt=ae.theme,St=Object(ye.a)(ae,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Rt=Pe;return U.createElement(Rt,Object.assign({},St),this.renderChildren(at))}}]),ze}(U.Component);Et.defaultProps={tag:"div",className:""};var ft=Et;function Ct(pt){return pt.length?pt.every(function(Qe){return!!Qe.props.disabled}):!0}function _e(pt,Qe,ze){var De=pt.getState();pt.setState({activeKey:Object(ee.a)(Object(ee.a)({},De.activeKey),{},Object(E.a)({},Qe,ze))})}function Se(pt){return pt.eventKey||"0-menu-"}function Je(pt,Qe){var ze=Qe,De=pt.children,ae=pt.eventKey;if(ze){var de;if(me(De,function(Ye,Me){Ye&&Ye.props&&!Ye.props.disabled&&ze===$(Ye,ae,Me)&&(de=!0)}),de)return ze}return ze=null,pt.defaultActiveFirst&&me(De,function(Ye,Me){!ze&&Ye&&!Ye.props.disabled&&(ze=$(Ye,ae,Me))}),ze}function nt(pt){if(pt){var Qe=this.instanceArray.indexOf(pt);Qe!==-1?this.instanceArray[Qe]=pt:this.instanceArray.push(pt)}}var Fe=function(pt){Object(N.a)(ze,pt);var Qe=Object(O.a)(ze);function ze(De){var ae;return Object(X.a)(this,ze),ae=Qe.call(this,De),ae.onKeyDown=function(de,Ye){var Me=de.keyCode,Xe;if(ae.getFlatInstanceArray().forEach(function(Pe){Pe&&Pe.props.active&&Pe.onKeyDown&&(Xe=Pe.onKeyDown(de))}),Xe)return 1;var dt=null;return(Me===R.a.UP||Me===R.a.DOWN)&&(dt=ae.step(Me===R.a.UP?-1:1)),dt?(de.preventDefault(),_e(ae.props.store,Se(ae.props),dt.props.eventKey),typeof Ye=="function"&&Ye(dt),1):void 0},ae.onItemHover=function(de){var Ye=de.key,Me=de.hover;_e(ae.props.store,Se(ae.props),Me?Ye:null)},ae.onDeselect=function(de){ae.props.onDeselect(de)},ae.onSelect=function(de){ae.props.onSelect(de)},ae.onClick=function(de){ae.props.onClick(de)},ae.onOpenChange=function(de){ae.props.onOpenChange(de)},ae.onDestroy=function(de){ae.props.onDestroy(de)},ae.getFlatInstanceArray=function(){return ae.instanceArray},ae.step=function(de){var Ye=ae.getFlatInstanceArray(),Me=ae.props.store.getState().activeKey[Se(ae.props)],Xe=Ye.length;if(!Xe)return null;de<0&&(Ye=Ye.concat().reverse());var dt=-1;if(Ye.every(function(St,Rt){return St&&St.props.eventKey===Me?(dt=Rt,!1):!0}),!ae.props.defaultActiveFirst&&dt!==-1&&Ct(Ye.slice(dt,Xe-1)))return;var Pe=(dt+1)%Xe,at=Pe;do{var vt=Ye[at];if(!vt||vt.props.disabled)at=(at+1)%Xe;else return vt}while(at!==Pe);return null},ae.renderCommonMenuItem=function(de,Ye,Me){var Xe=ae.props.store.getState(),dt=Object(Q.a)(ae),Pe=dt.props,at=$(de,Pe.eventKey,Ye),vt=de.props;if(!vt||typeof de.type=="string")return de;var St=at===Xe.activeKey,Rt=Object(ee.a)(Object(ee.a)({mode:vt.mode||Pe.mode,level:Pe.level,inlineIndent:Pe.inlineIndent,renderMenuItem:ae.renderMenuItem,rootPrefixCls:Pe.prefixCls,index:Ye,parentMenu:Pe.parentMenu,manualRef:vt.disabled?void 0:Object(P.a)(de.ref,nt.bind(Object(Q.a)(ae))),eventKey:at,active:!vt.disabled&&St,multiple:Pe.multiple,onClick:function(sn){(vt.onClick||j)(sn),ae.onClick(sn)},onItemHover:ae.onItemHover,motion:Pe.motion,subMenuOpenDelay:Pe.subMenuOpenDelay,subMenuCloseDelay:Pe.subMenuCloseDelay,forceSubMenuRender:Pe.forceSubMenuRender,onOpenChange:ae.onOpenChange,onDeselect:ae.onDeselect,onSelect:ae.onSelect,builtinPlacements:Pe.builtinPlacements,itemIcon:vt.itemIcon||ae.props.itemIcon,expandIcon:vt.expandIcon||ae.props.expandIcon},Me),{},{direction:Pe.direction});return(Pe.mode==="inline"||Le())&&(Rt.triggerSubMenuAction="click"),U.cloneElement(de,Rt)},ae.renderMenuItem=function(de,Ye,Me){if(!de)return null;var Xe=ae.props.store.getState(),dt={openKeys:Xe.openKeys,selectedKeys:Xe.selectedKeys,triggerSubMenuAction:ae.props.triggerSubMenuAction,subMenuKey:Me};return ae.renderCommonMenuItem(de,Ye,dt)},De.store.setState({activeKey:Object(ee.a)(Object(ee.a)({},De.store.getState().activeKey),{},Object(E.a)({},De.eventKey,Je(De,De.activeKey)))}),ae.instanceArray=[],ae}return Object(k.a)(ze,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ae){return this.props.visible||ae.visible||this.props.className!==ae.className||!S()(this.props.style,ae.style)}},{key:"componentDidUpdate",value:function(ae){var de=this.props,Ye="activeKey"in de?de.activeKey:de.store.getState().activeKey[Se(de)],Me=Je(de,Ye);if(Me!==Ye)_e(de.store,Se(de),Me);else if("activeKey"in ae){var Xe=Je(ae,ae.activeKey);Me!==Xe&&_e(de.store,Se(de),Me)}}},{key:"render",value:function(){var ae=this,de=Object(D.a)({},this.props);this.instanceArray=[];var Ye=d()(de.prefixCls,de.className,"".concat(de.prefixCls,"-").concat(de.mode)),Me={className:Ye,role:de.role||"menu"};de.id&&(Me.id=de.id),de.focusable&&(Me.tabIndex=0,Me.onKeyDown=this.onKeyDown);var Xe=de.prefixCls,dt=de.eventKey,Pe=de.visible,at=de.level,vt=de.mode,St=de.overflowedIndicator,Rt=de.theme;return We.forEach(function(qt){return delete de[qt]}),delete de.onClick,U.createElement(ft,Object.assign({},de,{prefixCls:Xe,mode:vt,tag:"ul",level:at,theme:Rt,visible:Pe,overflowedIndicator:St},Me),U.Children.map(de.children,function(qt,sn){return ae.renderMenuItem(qt,sn,dt||"0-menu-")}))}}]),ze}(U.Component);Fe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:j};var qe=Object(B.b)()(Fe),xe=qe,he=F("Kwbf");function ge(pt,Qe,ze){var De=pt.prefixCls,ae=pt.motion,de=pt.defaultMotions,Ye=de===void 0?{}:de,Me=pt.openAnimation,Xe=pt.openTransitionName,dt=Qe.switchingModeFromInline;if(ae)return ae;if(Object(s.a)(Me)==="object"&&Me)Object(he.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Me=="string")return{motionName:"".concat(De,"-open-").concat(Me)};if(Xe)return{motionName:Xe};var Pe=Ye[ze];return Pe||(dt?null:Ye.other)}var re=function(pt){Object(N.a)(ze,pt);var Qe=Object(O.a)(ze);function ze(De){var ae;Object(X.a)(this,ze),ae=Qe.call(this,De),ae.inlineOpenKeys=[],ae.onSelect=function(Me){var Xe=Object(Q.a)(ae),dt=Xe.props;if(dt.selectable){var Pe=ae.store.getState(),at=Pe.selectedKeys,vt=Me.key;dt.multiple?at=at.concat([vt]):at=[vt],"selectedKeys"in dt||ae.store.setState({selectedKeys:at}),dt.onSelect(Object(ee.a)(Object(ee.a)({},Me),{},{selectedKeys:at}))}},ae.onClick=function(Me){var Xe=ae.getRealMenuMode(),dt=Object(Q.a)(ae),Pe=dt.store,at=dt.props.onOpenChange;Xe!=="inline"&&!("openKeys"in ae.props)&&(Pe.setState({openKeys:[]}),at([])),ae.props.onClick(Me)},ae.onKeyDown=function(Me,Xe){ae.innerMenu.getWrappedInstance().onKeyDown(Me,Xe)},ae.onOpenChange=function(Me){var Xe=Object(Q.a)(ae),dt=Xe.props,Pe=ae.store.getState().openKeys.concat(),at=!1,vt=function(Rt){var qt=!1;if(Rt.open)qt=Pe.indexOf(Rt.key)===-1,qt&&Pe.push(Rt.key);else{var sn=Pe.indexOf(Rt.key);qt=sn!==-1,qt&&Pe.splice(sn,1)}at=at||qt};Array.isArray(Me)?Me.forEach(vt):vt(Me),at&&("openKeys"in ae.props||ae.store.setState({openKeys:Pe}),dt.onOpenChange(Pe))},ae.onDeselect=function(Me){var Xe=Object(Q.a)(ae),dt=Xe.props;if(dt.selectable){var Pe=ae.store.getState().selectedKeys.concat(),at=Me.key,vt=Pe.indexOf(at);vt!==-1&&Pe.splice(vt,1),"selectedKeys"in dt||ae.store.setState({selectedKeys:Pe}),dt.onDeselect(Object(ee.a)(Object(ee.a)({},Me),{},{selectedKeys:Pe}))}},ae.onMouseEnter=function(Me){ae.restoreModeVerticalFromInline();var Xe=ae.props.onMouseEnter;Xe&&Xe(Me)},ae.onTransitionEnd=function(Me){var Xe=Me.propertyName==="width"&&Me.target===Me.currentTarget,dt=Me.target.className,Pe=Object.prototype.toString.call(dt)==="[object SVGAnimatedString]"?dt.animVal:dt,at=Me.propertyName==="font-size"&&Pe.indexOf("anticon")>=0;(Xe||at)&&ae.restoreModeVerticalFromInline()},ae.setInnerMenu=function(Me){ae.innerMenu=Me},ae.isRootMenu=!0;var de=De.defaultSelectedKeys,Ye=De.defaultOpenKeys;return"selectedKeys"in De&&(de=De.selectedKeys||[]),"openKeys"in De&&(Ye=De.openKeys||[]),ae.store=Object(B.c)({selectedKeys:de,openKeys:Ye,activeKey:{"0-menu-":Je(De,De.activeKey)}}),ae.state={switchingModeFromInline:!1},ae}return Object(k.a)(ze,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ae){this.updateOpentKeysWhenSwitchMode(ae),this.updateMiniStore();var de=this.props,Ye=de.siderCollapsed,Me=de.inlineCollapsed,Xe=de.onOpenChange;(!ae.inlineCollapsed&&Me||!ae.siderCollapsed&&Ye)&&Xe([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ae){var de=this.props,Ye=this.store,Me=this.inlineOpenKeys,Xe=Ye.getState(),dt={};ae.mode==="inline"&&de.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in de||((de.inlineCollapsed&&!ae.inlineCollapsed||de.siderCollapsed&&!ae.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Xe.openKeys.concat(),dt.openKeys=[]),(!de.inlineCollapsed&&ae.inlineCollapsed||!de.siderCollapsed&&ae.siderCollapsed)&&(dt.openKeys=Me,this.inlineOpenKeys=[])),Object.keys(dt).length&&Ye.setState(dt)}},{key:"updateMenuDisplay",value:function(){var ae=this.props.collapsedWidth,de=this.store,Ye=this.prevOpenKeys,Me=this.getInlineCollapsed()&&(ae===0||ae==="0"||ae==="0px");Me?(this.prevOpenKeys=de.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Ye&&(this.store.setState({openKeys:Ye}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ae=this.props.mode,de=this.state.switchingModeFromInline,Ye=this.getInlineCollapsed();return de&&Ye?"inline":Ye?"vertical":ae}},{key:"getInlineCollapsed",value:function(){var ae=this.props,de=ae.inlineCollapsed,Ye=ae.siderCollapsed;return Ye!==void 0?Ye:de}},{key:"restoreModeVerticalFromInline",value:function(){var ae=this.state.switchingModeFromInline;ae&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ae=Object(ee.a)({},Object(I.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),de=this.getRealMenuMode();return ae.className+=" ".concat(ae.prefixCls,"-root"),ae.direction==="rtl"&&(ae.className+=" ".concat(ae.prefixCls,"-rtl")),ae=Object(ee.a)(Object(ee.a)({},ae),{},{mode:de,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ge(this.props,this.state,de)}),delete ae.openAnimation,delete ae.openTransitionName,U.createElement(B.a,{store:this.store},U.createElement(xe,Object.assign({},ae,{ref:this.setInnerMenu}),this.props.children))}}]),ze}(U.Component);re.defaultProps={selectable:!0,onClick:j,onSelect:j,onOpenChange:j,onDeselect:j,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:U.createElement("span",null,"\xB7\xB7\xB7")};var ie=re,oe=function(pt){Object(N.a)(ze,pt);var Qe=Object(O.a)(ze);function ze(){var De;return Object(X.a)(this,ze),De=Qe.apply(this,arguments),De.onKeyDown=function(ae){var de=ae.keyCode;return de===R.a.ENTER?(De.onClick(ae),!0):void 0},De.onMouseLeave=function(ae){var de=De.props,Ye=de.eventKey,Me=de.onItemHover,Xe=de.onMouseLeave;Me({key:Ye,hover:!1}),Xe({key:Ye,domEvent:ae})},De.onMouseEnter=function(ae){var de=De.props,Ye=de.eventKey,Me=de.onItemHover,Xe=de.onMouseEnter;Me({key:Ye,hover:!0}),Xe({key:Ye,domEvent:ae})},De.onClick=function(ae){var de=De.props,Ye=de.eventKey,Me=de.multiple,Xe=de.onClick,dt=de.onSelect,Pe=de.onDeselect,at=de.isSelected,vt={key:Ye,keyPath:[Ye],item:Object(Q.a)(De),domEvent:ae};Xe(vt),Me?at?Pe(vt):dt(vt):at||dt(vt)},De.saveNode=function(ae){De.node=ae},De}return Object(k.a)(ze,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ae=this.props;ae.onDestroy&&ae.onDestroy(ae.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ae,de=Object(ee.a)({},this.props),Ye=d()(this.getPrefixCls(),de.className,(ae={},Object(E.a)(ae,this.getActiveClassName(),!de.disabled&&de.active),Object(E.a)(ae,this.getSelectedClassName(),de.isSelected),Object(E.a)(ae,this.getDisabledClassName(),de.disabled),ae)),Me=Object(ee.a)(Object(ee.a)({},de.attribute),{},{title:typeof de.title=="string"?de.title:void 0,className:Ye,role:de.role||"menuitem","aria-disabled":de.disabled});de.role==="option"?Me=Object(ee.a)(Object(ee.a)({},Me),{},{role:"option","aria-selected":de.isSelected}):(de.role===null||de.role==="none")&&(Me.role="none");var Xe={onClick:de.disabled?null:this.onClick,onMouseLeave:de.disabled?null:this.onMouseLeave,onMouseEnter:de.disabled?null:this.onMouseEnter},dt=Object(ee.a)({},de.style);de.mode==="inline"&&(de.direction==="rtl"?dt.paddingRight=de.inlineIndent*de.level:dt.paddingLeft=de.inlineIndent*de.level),We.forEach(function(at){return delete de[at]}),delete de.direction;var Pe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Pe=U.createElement(this.props.itemIcon,this.props)),U.createElement("li",Object.assign({},Object(I.default)(de,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Me,Xe,{style:dt,ref:this.saveNode}),de.children,Pe)}}]),ze}(U.Component);oe.isMenuItem=!0,oe.defaultProps={onSelect:j,onMouseEnter:j,onMouseLeave:j,manualRef:j};var ue=Object(B.b)(function(pt,Qe){var ze=pt.activeKey,De=pt.selectedKeys,ae=Qe.eventKey,de=Qe.subMenuKey;return{active:ze[de]===ae,isSelected:De.indexOf(ae)!==-1}})(oe),Oe=ue,we=function(pt){Object(N.a)(ze,pt);var Qe=Object(O.a)(ze);function ze(){var De;return Object(X.a)(this,ze),De=Qe.apply(this,arguments),De.renderInnerMenuItem=function(ae){var de=De.props,Ye=de.renderMenuItem,Me=de.index;return Ye(ae,Me,De.props.subMenuKey)},De}return Object(k.a)(ze,[{key:"render",value:function(){var ae=Object(D.a)({},this.props),de=ae.className,Ye=de===void 0?"":de,Me=ae.rootPrefixCls,Xe="".concat(Me,"-item-group-title"),dt="".concat(Me,"-item-group-list"),Pe=ae.title,at=ae.children;return We.forEach(function(vt){return delete ae[vt]}),delete ae.onClick,delete ae.direction,U.createElement("li",Object.assign({},ae,{className:"".concat(Ye," ").concat(Me,"-item-group")}),U.createElement("div",{className:Xe,title:typeof Pe=="string"?Pe:void 0},Pe),U.createElement("ul",{className:dt},U.Children.map(at,this.renderInnerMenuItem)))}}]),ze}(U.Component);we.isMenuItemGroup=!0,we.defaultProps={disabled:!0};var rt=we,yt=function(Qe){var ze=Qe.className,De=Qe.rootPrefixCls,ae=Qe.style;return U.createElement("li",{className:"".concat(ze," ").concat(De,"-item-divider"),style:ae})};yt.defaultProps={disabled:!0,className:"",style:{}};var wt=yt,xt=ke.e=ie},"4qgm":function($e,ke){$e.exports="data:image/png;base64,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"},"4u4S":function($e,ke){$e.exports="data:image/png;base64,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"},"55Ip":function($e,ke,F){"use strict";F.d(ke,"a",function(){return u}),F.d(ke,"b",function(){return v});var ee=F("Ty5D"),X=F("dI71"),k=F("q1tI"),Q=F.n(k),N=F("YS25"),O=F("17x9"),U=F.n(O),B=F("wx14"),I=F("zLVn"),D=F("9R94"),E=function(l){Object(X.a)(a,l);function a(){for(var x,b=arguments.length,m=new Array(b),L=0;L<b;L++)m[L]=arguments[L];return x=l.call.apply(l,[this].concat(m))||this,x.history=Object(N.a)(x.props),x}var i=a.prototype;return i.render=function(){return Q.a.createElement(ee.c,{history:this.history,children:this.props.children})},a}(Q.a.Component),R=function(l){Object(X.a)(a,l);function a(){for(var x,b=arguments.length,m=new Array(b),L=0;L<b;L++)m[L]=arguments[L];return x=l.call.apply(l,[this].concat(m))||this,x.history=Object(N.b)(x.props),x}var i=a.prototype;return i.render=function(){return Q.a.createElement(ee.c,{history:this.history,children:this.props.children})},a}(Q.a.Component),P=function(a,i){return typeof a=="function"?a(i):a},_=function(a,i){return typeof a=="string"?Object(N.c)(a,null,null,i):a},S=function(a){return a},y=Q.a.forwardRef;typeof y=="undefined"&&(y=S);function d(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}var s=y(function(l,a){var i=l.innerRef,x=l.navigate,b=l.onClick,m=Object(I.a)(l,["innerRef","navigate","onClick"]),L=m.target,C=Object(B.a)({},m,{onClick:function(J){try{b&&b(J)}catch(W){throw J.preventDefault(),W}!J.defaultPrevented&&J.button===0&&(!L||L==="_self")&&!d(J)&&(J.preventDefault(),x())}});return S!==y?C.ref=a||i:C.ref=i,Q.a.createElement("a",C)}),u=y(function(l,a){var i=l.component,x=i===void 0?s:i,b=l.replace,m=l.to,L=l.innerRef,C=Object(I.a)(l,["component","replace","to","innerRef"]);return Q.a.createElement(ee.e.Consumer,null,function(H){H||Object(D.a)(!1);var J=H.history,W=_(P(m,H.location),H.location),j=W?J.createHref(W):"",$=Object(B.a)({},C,{href:j,navigate:function(){var me=P(m,H.location),Ee=b?J.replace:J.push;Ee(me)}});return S!==y?$.ref=a||L:$.innerRef=L,Q.a.createElement(x,$)})});if(!1)var h,T;var g=function(a){return a},f=Q.a.forwardRef;typeof f=="undefined"&&(f=g);function w(){for(var l=arguments.length,a=new Array(l),i=0;i<l;i++)a[i]=arguments[i];return a.filter(function(x){return x}).join(" ")}var v=f(function(l,a){var i=l["aria-current"],x=i===void 0?"page":i,b=l.activeClassName,m=b===void 0?"active":b,L=l.activeStyle,C=l.className,H=l.exact,J=l.isActive,W=l.location,j=l.sensitive,$=l.strict,se=l.style,me=l.to,Ee=l.innerRef,We=Object(I.a)(l,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Q.a.createElement(ee.e.Consumer,null,function(Be){Be||Object(D.a)(!1);var Ne=W||Be.location,Le=_(P(me,Ne),Ne),Ue=Le.pathname,ye=Ue&&Ue.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ce=ye?Object(ee.f)(Ne.pathname,{path:ye,exact:H,sensitive:j,strict:$}):null,ne=!!(J?J(ce,Ne):ce),ve=ne?w(C,m):C,le=ne?Object(B.a)({},se,{},L):se,Re=Object(B.a)({"aria-current":ne&&x||null,className:ve,style:le,to:Le},We);return g!==f?Re.ref=a||Ee:Re.innerRef=Ee,Q.a.createElement(u,Re)})});if(!1)var c},"5D2P":function($e,ke){$e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"6+eU":function($e,ke,F){"use strict";F.d(ke,"a",function(){return f});var ee=F("wx14"),X=F("rePB"),k=F("VTBJ"),Q=F("1OyB"),N=F("vuIU"),O=F("Ji7U"),U=F("LK+K"),B=F("q1tI"),I=F.n(B),D=F("TSYQ"),E=F.n(D),R=function(v){var c,l="".concat(v.rootPrefixCls,"-item"),a=E()(l,"".concat(l,"-").concat(v.page),(c={},Object(X.a)(c,"".concat(l,"-active"),v.active),Object(X.a)(c,v.className,!!v.className),Object(X.a)(c,"".concat(l,"-disabled"),!v.page),c)),i=function(){v.onClick(v.page)},x=function(m){v.onKeyPress(m,v.onClick,v.page)};return I.a.createElement("li",{title:v.showTitle?v.page:null,className:a,onClick:i,onKeyPress:x,tabIndex:"0"},v.itemRender(v.page,"page",I.a.createElement("a",{rel:"nofollow"},v.page)))},P=R,_={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},S=function(w){Object(O.a)(c,w);var v=Object(U.a)(c);function c(){var l;Object(Q.a)(this,c);for(var a=arguments.length,i=new Array(a),x=0;x<a;x++)i[x]=arguments[x];return l=v.call.apply(v,[this].concat(i)),l.state={goInputText:""},l.buildOptionText=function(b){return"".concat(b," ").concat(l.props.locale.items_per_page)},l.changeSize=function(b){l.props.changeSize(Number(b))},l.handleChange=function(b){l.setState({goInputText:b.target.value})},l.handleBlur=function(b){var m=l.props,L=m.goButton,C=m.quickGo,H=m.rootPrefixCls,J=l.state.goInputText;if(L||J==="")return;if(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(H,"-prev"))>=0||b.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;l.setState({goInputText:""}),C(l.getValidValue())},l.go=function(b){var m=l.state.goInputText;if(m==="")return;(b.keyCode===_.ENTER||b.type==="click")&&(l.setState({goInputText:""}),l.props.quickGo(l.getValidValue()))},l}return Object(N.a)(c,[{key:"getValidValue",value:function(){var a=this.state,i=a.goInputText,x=a.current;return!i||isNaN(i)?x:Number(i)}},{key:"getPageSizeOptions",value:function(){var a=this.props,i=a.pageSize,x=a.pageSizeOptions;return x.some(function(b){return b.toString()===i.toString()})?x:x.concat([i.toString()]).sort(function(b,m){var L=isNaN(Number(b))?0:Number(b),C=isNaN(Number(m))?0:Number(m);return L-C})}},{key:"render",value:function(){var a=this,i=this.props,x=i.pageSize,b=i.locale,m=i.rootPrefixCls,L=i.changeSize,C=i.quickGo,H=i.goButton,J=i.selectComponentClass,W=i.buildOptionText,j=i.selectPrefixCls,$=i.disabled,se=this.state.goInputText,me="".concat(m,"-options"),Ee=J,We=null,Be=null,Ne=null;if(!L&&!C)return null;var Le=this.getPageSizeOptions();if(L&&Ee){var Ue=Le.map(function(ye,ce){return I.a.createElement(Ee.Option,{key:ce,value:ye.toString()},(W||a.buildOptionText)(ye))});We=I.a.createElement(Ee,{disabled:$,prefixCls:j,showSearch:!1,className:"".concat(me,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(x||Le[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ce){return ce.parentNode}},Ue)}return C&&(H&&(Ne=typeof H=="boolean"?I.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:$,className:"".concat(me,"-quick-jumper-button")},b.jump_to_confirm):I.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),Be=I.a.createElement("div",{className:"".concat(me,"-quick-jumper")},b.jump_to,I.a.createElement("input",{disabled:$,type:"text",value:se,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),b.page,Ne)),I.a.createElement("li",{className:"".concat(me)},We,Be)}}]),c}(I.a.Component);S.defaultProps={pageSizeOptions:["10","20","50","100"]};var y=S,d=F("N2Kk");function s(){}function u(w){return typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function h(w,v,c){return c}function T(w,v,c){var l=typeof w=="undefined"?v.pageSize:w;return Math.floor((c.total-1)/l)+1}var g=function(w){Object(O.a)(c,w);var v=Object(U.a)(c);function c(l){var a;Object(Q.a)(this,c),a=v.call(this,l),a.getJumpPrevPage=function(){return Math.max(1,a.state.current-(a.props.showLessItems?3:5))},a.getJumpNextPage=function(){return Math.min(T(void 0,a.state,a.props),a.state.current+(a.props.showLessItems?3:5))},a.getItemIcon=function(L,C){var H=a.props.prefixCls,J=L||I.a.createElement("button",{type:"button","aria-label":C,className:"".concat(H,"-item-link")});return typeof L=="function"&&(J=I.a.createElement(L,Object(k.a)({},a.props))),J},a.savePaginationNode=function(L){a.paginationNode=L},a.isValid=function(L){return u(L)&&L!==a.state.current},a.shouldDisplayQuickJumper=function(){var L=a.props,C=L.showQuickJumper,H=L.pageSize,J=L.total;return J<=H?!1:C},a.handleKeyDown=function(L){(L.keyCode===_.ARROW_UP||L.keyCode===_.ARROW_DOWN)&&L.preventDefault()},a.handleKeyUp=function(L){var C=a.getValidValue(L),H=a.state.currentInputValue;C!==H&&a.setState({currentInputValue:C}),L.keyCode===_.ENTER?a.handleChange(C):L.keyCode===_.ARROW_UP?a.handleChange(C-1):L.keyCode===_.ARROW_DOWN&&a.handleChange(C+1)},a.changePageSize=function(L){var C=a.state.current,H=T(L,a.state,a.props);C=C>H?H:C,H===0&&(C=a.state.current),typeof L=="number"&&("pageSize"in a.props||a.setState({pageSize:L}),"current"in a.props||a.setState({current:C,currentInputValue:C})),a.props.onShowSizeChange(C,L),"onChange"in a.props&&a.props.onChange&&a.props.onChange(C,L)},a.handleChange=function(L){var C=a.props.disabled,H=L;if(a.isValid(H)&&!C){var J=T(void 0,a.state,a.props);H>J?H=J:H<1&&(H=1),"current"in a.props||a.setState({current:H,currentInputValue:H});var W=a.state.pageSize;return a.props.onChange(H,W),H}return a.state.current},a.prev=function(){a.hasPrev()&&a.handleChange(a.state.current-1)},a.next=function(){a.hasNext()&&a.handleChange(a.state.current+1)},a.jumpPrev=function(){a.handleChange(a.getJumpPrevPage())},a.jumpNext=function(){a.handleChange(a.getJumpNextPage())},a.hasPrev=function(){return a.state.current>1},a.hasNext=function(){return a.state.current<T(void 0,a.state,a.props)},a.runIfEnter=function(L,C){if(L.key==="Enter"||L.charCode===13){for(var H=arguments.length,J=new Array(H>2?H-2:0),W=2;W<H;W++)J[W-2]=arguments[W];C.apply(void 0,J)}},a.runIfEnterPrev=function(L){a.runIfEnter(L,a.prev)},a.runIfEnterNext=function(L){a.runIfEnter(L,a.next)},a.runIfEnterJumpPrev=function(L){a.runIfEnter(L,a.jumpPrev)},a.runIfEnterJumpNext=function(L){a.runIfEnter(L,a.jumpNext)},a.handleGoTO=function(L){(L.keyCode===_.ENTER||L.type==="click")&&a.handleChange(a.state.currentInputValue)};var i=l.onChange!==s,x="current"in l;x&&!i&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var b=l.defaultCurrent;"current"in l&&(b=l.current);var m=l.defaultPageSize;return"pageSize"in l&&(m=l.pageSize),b=Math.min(b,T(m,void 0,l)),a.state={current:b,currentInputValue:b,pageSize:m},a}return Object(N.a)(c,[{key:"componentDidUpdate",value:function(a,i){var x=this.props.prefixCls;if(i.current!==this.state.current&&this.paginationNode){var b=this.paginationNode.querySelector(".".concat(x,"-item-").concat(i.current));b&&document.activeElement===b&&b.blur()}}},{key:"getValidValue",value:function(a){var i=a.target.value,x=T(void 0,this.state,this.props),b=this.state.currentInputValue,m;return i===""?m=i:isNaN(Number(i))?m=b:i>=x?m=x:m=Number(i),m}},{key:"getShowSizeChanger",value:function(){var a=this.props,i=a.showSizeChanger,x=a.total,b=a.totalBoundaryShowSizeChanger;return typeof i!="undefined"?i:x>b}},{key:"renderPrev",value:function(a){var i=this.props,x=i.prevIcon,b=i.itemRender,m=b(a,"prev",this.getItemIcon(x,"prev page")),L=!this.hasPrev();return Object(B.isValidElement)(m)?Object(B.cloneElement)(m,{disabled:L}):m}},{key:"renderNext",value:function(a){var i=this.props,x=i.nextIcon,b=i.itemRender,m=b(a,"next",this.getItemIcon(x,"next page")),L=!this.hasNext();return Object(B.isValidElement)(m)?Object(B.cloneElement)(m,{disabled:L}):m}},{key:"render",value:function(){var a=this,i=this.props,x=i.prefixCls,b=i.className,m=i.style,L=i.disabled,C=i.hideOnSinglePage,H=i.total,J=i.locale,W=i.showQuickJumper,j=i.showLessItems,$=i.showTitle,se=i.showTotal,me=i.simple,Ee=i.itemRender,We=i.showPrevNextJumpers,Be=i.jumpPrevIcon,Ne=i.jumpNextIcon,Le=i.selectComponentClass,Ue=i.selectPrefixCls,ye=i.pageSizeOptions,ce=this.state,ne=ce.current,ve=ce.pageSize,le=ce.currentInputValue;if(C===!0&&H<=ve)return null;var Re=T(void 0,this.state,this.props),Ie=[],Ce=null,He=null,Ze=null,ot=null,et=null,Ke=W&&W.goButton,Ve=j?1:2,ht=ne-1>0?ne-1:0,mt=ne+1<Re?ne+1:Re,gt=Object.keys(this.props).reduce(function(re,ie){return(ie.substr(0,5)==="data-"||ie.substr(0,5)==="aria-"||ie==="role")&&(re[ie]=a.props[ie]),re},{});if(me)return Ke&&(typeof Ke=="boolean"?et=I.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},J.jump_to_confirm):et=I.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ke),et=I.a.createElement("li",{title:$?"".concat(J.jump_to).concat(ne,"/").concat(Re):null,className:"".concat(x,"-simple-pager")},et)),I.a.createElement("ul",Object(ee.a)({className:E()(x,"".concat(x,"-simple"),Object(X.a)({},"".concat(x,"-disabled"),L),b),style:m,ref:this.savePaginationNode},gt),I.a.createElement("li",{title:$?J.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:E()("".concat(x,"-prev"),Object(X.a)({},"".concat(x,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ht)),I.a.createElement("li",{title:$?"".concat(ne,"/").concat(Re):null,className:"".concat(x,"-simple-pager")},I.a.createElement("input",{type:"text",value:le,disabled:L,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),I.a.createElement("span",{className:"".concat(x,"-slash")},"/"),Re),I.a.createElement("li",{title:$?J.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:E()("".concat(x,"-next"),Object(X.a)({},"".concat(x,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(mt)),et);if(Re<=3+Ve*2){var Et={locale:J,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:$,itemRender:Ee};Re||Ie.push(I.a.createElement(P,Object(ee.a)({},Et,{key:"noPager",page:Re,className:"".concat(x,"-disabled")})));for(var ft=1;ft<=Re;ft+=1){var Ct=ne===ft;Ie.push(I.a.createElement(P,Object(ee.a)({},Et,{key:ft,page:ft,active:Ct})))}}else{var _e=j?J.prev_3:J.prev_5,Se=j?J.next_3:J.next_5;We&&(Ce=I.a.createElement("li",{title:$?_e:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:E()("".concat(x,"-jump-prev"),Object(X.a)({},"".concat(x,"-jump-prev-custom-icon"),!!Be))},Ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Be,"prev page"))),He=I.a.createElement("li",{title:$?Se:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:E()("".concat(x,"-jump-next"),Object(X.a)({},"".concat(x,"-jump-next-custom-icon"),!!Ne))},Ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ne,"next page")))),ot=I.a.createElement(P,{locale:J,last:!0,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Re,page:Re,active:!1,showTitle:$,itemRender:Ee}),Ze=I.a.createElement(P,{locale:J,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:$,itemRender:Ee});var Je=Math.max(1,ne-Ve),nt=Math.min(ne+Ve,Re);ne-1<=Ve&&(nt=1+Ve*2),Re-ne<=Ve&&(Je=Re-Ve*2);for(var Fe=Je;Fe<=nt;Fe+=1){var qe=ne===Fe;Ie.push(I.a.createElement(P,{locale:J,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Fe,page:Fe,active:qe,showTitle:$,itemRender:Ee}))}ne-1>=Ve*2&&ne!==1+2&&(Ie[0]=Object(B.cloneElement)(Ie[0],{className:"".concat(x,"-item-after-jump-prev")}),Ie.unshift(Ce)),Re-ne>=Ve*2&&ne!==Re-2&&(Ie[Ie.length-1]=Object(B.cloneElement)(Ie[Ie.length-1],{className:"".concat(x,"-item-before-jump-next")}),Ie.push(He)),Je!==1&&Ie.unshift(Ze),nt!==Re&&Ie.push(ot)}var xe=null;se&&(xe=I.a.createElement("li",{className:"".concat(x,"-total-text")},se(H,[H===0?0:(ne-1)*ve+1,ne*ve>H?H:ne*ve])));var he=!this.hasPrev()||!Re,ge=!this.hasNext()||!Re;return I.a.createElement("ul",Object(ee.a)({className:E()(x,b,Object(X.a)({},"".concat(x,"-disabled"),L)),style:m,unselectable:"unselectable",ref:this.savePaginationNode},gt),xe,I.a.createElement("li",{title:$?J.prev_page:null,onClick:this.prev,tabIndex:he?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(x,"-prev"),Object(X.a)({},"".concat(x,"-disabled"),he)),"aria-disabled":he},this.renderPrev(ht)),Ie,I.a.createElement("li",{title:$?J.next_page:null,onClick:this.next,tabIndex:ge?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(x,"-next"),Object(X.a)({},"".concat(x,"-disabled"),ge)),"aria-disabled":ge},this.renderNext(mt)),I.a.createElement(y,{disabled:L,locale:J,rootPrefixCls:x,selectComponentClass:Le,selectPrefixCls:Ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:ve,pageSizeOptions:ye,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ke}))}}],[{key:"getDerivedStateFromProps",value:function(a,i){var x={};if("current"in a&&(x.current=a.current,a.current!==i.current&&(x.currentInputValue=x.current)),"pageSize"in a&&a.pageSize!==i.pageSize){var b=i.current,m=T(a.pageSize,i,a);b=b>m?m:b,"current"in a||(x.current=b,x.currentInputValue=b),x.pageSize=a.pageSize}return x}}]),c}(I.a.Component);g.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:d.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var f=g},"6RRn":function($e,ke,F){"use strict";var ee=F("wCXF"),X=F("n6Qo");F.d(ke,"b",function(){return X.a});var k=F("IBYe"),Q=F("6eGT"),N=F("hW8S");F.d(ke,"a",function(){return N.a}),ke.c=ee.b},"6eGT":function($e,ke,F){"use strict";function ee(X){return null}ke.a=ee},"7Cbv":function($e,ke,F){"use strict";var ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function k(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(X)}var Q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function N(P){return typeof P=="string"&&Q.test(P)}for(var O=N,U=[],B=0;B<256;++B)U.push((B+256).toString(16).substr(1));function I(P){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=(U[P[_+0]]+U[P[_+1]]+U[P[_+2]]+U[P[_+3]]+"-"+U[P[_+4]]+U[P[_+5]]+"-"+U[P[_+6]]+U[P[_+7]]+"-"+U[P[_+8]]+U[P[_+9]]+"-"+U[P[_+10]]+U[P[_+11]]+U[P[_+12]]+U[P[_+13]]+U[P[_+14]]+U[P[_+15]]).toLowerCase();if(!O(S))throw TypeError("Stringified UUID is invalid");return S}var D=I;function E(P,_,S){P=P||{};var y=P.random||(P.rng||k)();if(y[6]=y[6]&15|64,y[8]=y[8]&63|128,_){S=S||0;for(var d=0;d<16;++d)_[S+d]=y[d];return _}return D(y)}var R=ke.a=E},"7ZXX":function($e,ke,F){$e.exports=F.p+"static/err.6e7c5817.png"},"7ahc":function($e,ke,F){"use strict";F.d(ke,"a",function(){return T});var ee=F("k1fw"),X=F("0Owb"),k=F("+L6B"),Q=F("2/Rp"),N=F("y8nQ"),O=F("Vl3Y"),U=F("tJVT"),B=F("OaEy"),I=F("2fM7"),D=F("q1tI"),E=F.n(D),R=F("VrN/"),P=F.n(R),_=F("p77/"),S=F.n(_),y=F("c5Ni"),d=F.n(y),s=I.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},h={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};ke.b=function(g){var f=g.callback,w=g.onCancel,v=Object(D.useState)("python"),c=Object(U.a)(v,2),l=c[0],a=c[1];function i(b){a(h[b][1])}function x(b){f(b)}return E.a.createElement(O.a,Object(X.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),E.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(I.a,{onChange:i},Object.keys(h).map(function(b){return E.a.createElement(s,{key:b,value:b},h[b][0])}))),E.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(T,{mode:l})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Q.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function T(g){var f=g.value,w=g.onChange,v=g.mode,c=g.options,l=c===void 0?{}:c,a=Object(D.useRef)(),i=Object(D.useState)(),x=Object(U.a)(i,2),b=x[0],m=x[1];return Object(D.useEffect)(function(){if(b){function L(C){var H=C.getValue();w&&w(H)}return b.on("change",L),function(){b.off("change",L)}}},[b,w]),Object(D.useEffect)(function(){b&&b.setOption("mode",v)},[b,v]),Object(D.useEffect)(function(){b&&((f!==b.getValue()||f==="")&&setTimeout(function(){b.setValue(f||" ")},300))},[b,f]),Object(D.useEffect)(function(){if(a.current&&!b){var L=P.a.fromTextArea(a.current,Object(ee.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(L)}},[a.current,b]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:a}))}},"7ixt":function($e,ke,F){"use strict";F.d(ke,"a",function(){return k});var ee={adjustX:1,adjustY:1},X=[0,0],k={left:{points:["cr","cl"],overflow:ee,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:ee,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:ee,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:ee,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:ee,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:ee,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:ee,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:ee,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:ee,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:ee,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:ee,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:ee,offset:[-4,0],targetOffset:X}},Q=k},"7v3h":function($e,ke,F){$e.exports=F.p+"static/empty2.dd73f390.png"},"8/bI":function($e,ke,F){$e.exports=F.p+"static/empty.8918e228.png"},"815F":function($e,ke,F){"use strict";F.d(ke,"e",function(){return U}),F.d(ke,"c",function(){return I}),F.d(ke,"d",function(){return D}),F.d(ke,"a",function(){return R}),F.d(ke,"f",function(){return P}),F.d(ke,"b",function(){return _});var ee=F("KQm4"),X=F("VTBJ"),k=F("Ff2n"),Q=F("Zm9Q"),N=F("Kwbf"),O=F("OZM5");function U(S,y){return S!=null?S:y}function B(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function d(s){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(h){var T=h.key,g=h.children;Object(N.a)(T!=null,"Tree node must have a certain key: [".concat(u).concat(T,"]"));var f=String(T);Object(N.a)(!y.has(f)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(f)),y.set(f,!0),d(g,"".concat(u).concat(f," > "))})}d(S)}function I(S){function y(d){var s=Object(Q.a)(d);return s.map(function(u){if(!Object(O.i)(u))return Object(N.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var h=u.key,T=u.props,g=T.children,f=Object(k.a)(T,["children"]),w=Object(X.a)({key:h},f),v=y(g);return v.length&&(w.children=v),w}).filter(function(u){return u})}return y(S)}function D(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],d=new Set(y===!0?[]:y),s=[];function u(h){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(g,f){var w=Object(O.h)(T?T.pos:"0",f),v=U(g.key,w),c=Object(X.a)(Object(X.a)({},g),{},{parent:T,pos:w,children:null,data:g,isStart:[].concat(Object(ee.a)(T?T.isStart:[]),[f===0]),isEnd:[].concat(Object(ee.a)(T?T.isEnd:[]),[f===h.length-1])});return s.push(c),y===!0||d.has(v)?c.children=u(g.children||[],c):c.children=[],c})}return u(S),s}function E(S,y,d){var s;d?typeof d=="string"?s=function(T){return T[d]}:typeof d=="function"&&(s=function(T){return d(T)}):s=function(T,g){return U(T.key,g)};function u(h,T,g){var f=h?h.children:S,w=h?Object(O.h)(g.pos,T):"0";if(h){var v=s(h,w),c={node:h,index:T,pos:w,key:v,parentPos:g.node?g.pos:null,level:g.level+1};y(c)}f&&f.forEach(function(l,a){u(l,a,{node:h,pos:w,level:g?g.level+1:-1})})}u(null)}function R(S){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=y.initWrapper,s=y.processEntity,u=y.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,T={},g={},f={posEntities:T,keyEntities:g};return d&&(f=d(f)||f),E(S,function(w){var v=w.node,c=w.index,l=w.pos,a=w.key,i=w.parentPos,x=w.level,b={node:v,index:c,key:a,pos:l,level:x},m=U(a,l);T[l]=b,g[m]=b,b.parent=T[i],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),s&&s(b,f)},h),u&&u(f),f}function P(S,y){var d=y.expandedKeys,s=y.selectedKeys,u=y.loadedKeys,h=y.loadingKeys,T=y.checkedKeys,g=y.halfCheckedKeys,f=y.dragOverNodeKey,w=y.dropPosition,v=y.keyEntities,c=v[S],l={eventKey:S,expanded:d.indexOf(S)!==-1,selected:s.indexOf(S)!==-1,loaded:u.indexOf(S)!==-1,loading:h.indexOf(S)!==-1,checked:T.indexOf(S)!==-1,halfChecked:g.indexOf(S)!==-1,pos:String(c?c.pos:""),dragOver:f===S&&w===0,dragOverGapTop:f===S&&w===-1,dragOverGapBottom:f===S&&w===1};return l}function _(S){var y=S.data,d=S.expanded,s=S.selected,u=S.checked,h=S.loaded,T=S.loading,g=S.halfChecked,f=S.dragOver,w=S.dragOverGapTop,v=S.dragOverGapBottom,c=S.pos,l=S.active,a=Object(X.a)(Object(X.a)({},y),{},{expanded:d,selected:s,checked:u,loaded:h,loading:T,halfChecked:g,dragOver:f,dragOverGapTop:w,dragOverGapBottom:v,pos:c,active:l});return"props"in a||Object.defineProperty(a,"props",{get:function(){return Object(N.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),S}}),a}},"8EBN":function($e,ke,F){(function(ee){ee(F("VrN/"))})(function(ee){"use strict";ee.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var X=0;X<ee.modeInfo.length;X++){var k=ee.modeInfo[X];k.mimes&&(k.mime=k.mimes[0])}ee.findModeByMIME=function(Q){Q=Q.toLowerCase();for(var N=0;N<ee.modeInfo.length;N++){var O=ee.modeInfo[N];if(O.mime==Q)return O;if(O.mimes){for(var U=0;U<O.mimes.length;U++)if(O.mimes[U]==Q)return O}}if(/\+xml$/.test(Q))return ee.findModeByMIME("application/xml");if(/\+json$/.test(Q))return ee.findModeByMIME("application/json")},ee.findModeByExtension=function(Q){Q=Q.toLowerCase();for(var N=0;N<ee.modeInfo.length;N++){var O=ee.modeInfo[N];if(O.ext){for(var U=0;U<O.ext.length;U++)if(O.ext[U]==Q)return O}}},ee.findModeByFileName=function(Q){for(var N=0;N<ee.modeInfo.length;N++){var O=ee.modeInfo[N];if(O.file&&O.file.test(Q))return O}var U=Q.lastIndexOf("."),B=U>-1&&Q.substring(U+1,Q.length);if(B)return ee.findModeByExtension(B)},ee.findModeByName=function(Q){Q=Q.toLowerCase();for(var N=0;N<ee.modeInfo.length;N++){var O=ee.modeInfo[N];if(O.name.toLowerCase()==Q)return O;if(O.alias){for(var U=0;U<O.alias.length;U++)if(O.alias[U].toLowerCase()==Q)return O}}}})},"8hTe":function($e,ke,F){$e.exports={button:"button___1wy9m"}},"9Bee":function($e,ke,F){"use strict";var ee=F("DYRE"),X=F("zeV3"),k=F("+L6B"),Q=F("2/Rp"),N=F("k1fw"),O=F("9og8"),U=F("tJVT"),B=F("WmNS"),I=F.n(B),D=F("q1tI"),E=F.n(D),R=F("vg9a"),P=F("DlQD"),_=F.n(P),S=F("rUJ1");function y(G,p){var A=G.match(/^(\s+)(?:```)/);if(A===null)return p;var K=A[1];return p.split(`
|
|
`).map(function(Y){var V=Y.match(/^\s+/);if(V===null)return Y;var Ae=Object(U.a)(V,1),it=Ae[0];return it.length>=K.length?Y.slice(K.length):Y}).join(`
|
|
`)}var d=[],s=["<ul>"],u=new _.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){d.length=0,s=["<ul>"]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(G,p,A,K){if(p>=G.length||G[p].level<=A)return p;var Y=G[p];K.push("<li><a href='#"+Y.anchor+"'>"+Y.text+"</a>"),p++;var V=[];return p=f(G,p,Y.level,V),V.length>0&&(K.push("<ul>"),V.forEach(function(Ae){K.push(Ae)}),K.push("</ul>")),K.push("</li>"),p=f(G,p,A,K),p}function w(){return f(d,0,0,s),s.push("</ul>"),s.join("")}var v={heading:function(p){var A=h.exec(p);if(A)return{type:"heading",raw:A[0],depth:A[1].length,text:A[2]}},fences:function(p){var A=this.rules.block.fences.exec(p);if(A){var K=A[0],Y=y(K,A[3]||""),V=A[2]?A[2].trim():A[2];if(["latex","katex","math"].indexOf(V)>=0){var Ae=a(),it=Y;Y=Ae,i[Ae]={type:"block",expression:it}}return{type:"code",raw:K,lang:V,text:Y}}}},c=/(?:\${2})([^\n`]+?)(?:\${2})/gi,l=0,a=function(){return"__special_katext_id_".concat(l++,"__")},i={};function x(){return i}function b(){l=0,i={}}function m(G){return G=G.replace(c,function(p,A){var K=a();return i[K]={type:"inline",expression:A},K}),G}var L=u.listitem;u.listitem=function(G){return L(m(G))};var C=u.paragraph;u.paragraph=function(G){return C(m(G))};var H=u.tablecell;u.tablecell=function(G,p){return H(m(G),p)},u.code=function(G,p,A){var K=(p||"").match(/\S*/)[0];return K?["latex","katex","math"].indexOf(K)>=0?"<p class='editormd-tex'>".concat(G,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(p,'">').concat(A?G:Object(S.escape)(G,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(A?G:Object(S.escape)(G,!0))+"</code></pre>"},u.heading=function(G,p,A){var K=this.options.headerPrefix+A.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:K,level:p,text:G}),"<h"+p+' id="'+K+'">'+G+"</h"+p+">"},_.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),_.a.use({tokenizer:v,renderer:u});var J=_.a,W=F("SJMd"),j=F("ulZh"),$=F.n(j),se=F("m3rI"),me=F("Oy/b"),Ee=F("p5ED"),We=F("ErOA");/*! *****************************************************************************
|
|
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 Be=function(G,p){return(Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,K){A.__proto__=K}||function(A,K){for(var Y in K)Object.prototype.hasOwnProperty.call(K,Y)&&(A[Y]=K[Y])})(G,p)};function Ne(G,p){function A(){this.constructor=G}Be(G,p),G.prototype=p===null?Object.create(p):(A.prototype=p.prototype,new A)}function Le(G,p,A,K){return new(A||(A=Promise))(function(Y,V){function Ae(Bt){try{Tt(K.next(Bt))}catch(fe){V(fe)}}function it(Bt){try{Tt(K.throw(Bt))}catch(fe){V(fe)}}function Tt(Bt){var fe;Bt.done?Y(Bt.value):(fe=Bt.value,fe instanceof A?fe:new A(function(Ft){Ft(fe)})).then(Ae,it)}Tt((K=K.apply(G,p||[])).next())})}function Ue(G,p){var A,K,Y,V,Ae={label:0,sent:function(){if(1&Y[0])throw Y[1];return Y[1]},trys:[],ops:[]};return V={next:it(0),throw:it(1),return:it(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function it(Tt){return function(Bt){return function(fe){if(A)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(A=1,K&&(Y=2&fe[0]?K.return:fe[0]?K.throw||((Y=K.return)&&Y.call(K),0):K.next)&&!(Y=Y.call(K,fe[1])).done)return Y;switch(K=0,Y&&(fe=[2&fe[0],Y.value]),fe[0]){case 0:case 1:Y=fe;break;case 4:return Ae.label++,{value:fe[1],done:!1};case 5:Ae.label++,K=fe[1],fe=[0];continue;case 7:fe=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(Y=Ae.trys,(Y=Y.length>0&&Y[Y.length-1])||fe[0]!==6&&fe[0]!==2)){Ae=0;continue}if(fe[0]===3&&(!Y||fe[1]>Y[0]&&fe[1]<Y[3])){Ae.label=fe[1];break}if(fe[0]===6&&Ae.label<Y[1]){Ae.label=Y[1],Y=fe;break}if(Y&&Ae.label<Y[2]){Ae.label=Y[2],Ae.ops.push(fe);break}Y[2]&&Ae.ops.pop(),Ae.trys.pop();continue}fe=p.call(G,Ae)}catch(Ft){fe=[6,Ft],K=0}finally{A=Y=0}if(5&fe[0])throw fe[1];return{value:fe[0]?fe[1]:void 0,done:!0}}([Tt,Bt])}}}function ye(){for(var G=0,p=0,A=arguments.length;p<A;p++)G+=arguments[p].length;var K=Array(G),Y=0;for(p=0;p<A;p++)for(var V=arguments[p],Ae=0,it=V.length;Ae<it;Ae++,Y++)K[Y]=V[Ae];return K}var ce=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(p,A){for(var K=0,Y=A;K<Y.length;K++){var V=Y[K],Ae=V[0],it=V[1];p.setAttribute(Ae,it)}},G.createRect=function(p,A,K){var Y=document.createElementNS("http://www.w3.org/2000/svg","rect");return Y.setAttribute("width",p.toString()),Y.setAttribute("height",A.toString()),K&&G.setAttributes(Y,K),Y},G.createLine=function(p,A,K,Y,V){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",p.toString()),Ae.setAttribute("y1",A.toString()),Ae.setAttribute("x2",K.toString()),Ae.setAttribute("y2",Y.toString()),V&&G.setAttributes(Ae,V),Ae},G.createPolygon=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",p),A&&G.setAttributes(K,A),K},G.createCircle=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(p/2).toString()),K.setAttribute("cy",(p/2).toString()),K.setAttribute("r",p.toString()),A&&G.setAttributes(K,A),K},G.createEllipse=function(p,A,K){var Y=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Y.setAttribute("cx",(p/2).toString()),Y.setAttribute("cy",(A/2).toString()),Y.setAttribute("rx",(p/2).toString()),Y.setAttribute("ry",(A/2).toString()),K&&G.setAttributes(Y,K),Y},G.createGroup=function(p){var A=document.createElementNS("http://www.w3.org/2000/svg","g");return p&&G.setAttributes(A,p),A},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(p,A,K,Y,V,Ae,it){var Tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(Tt,[["id",p],["orient",A],["markerWidth",K.toString()],["markerHeight",Y.toString()],["refX",V.toString()],["refY",Ae.toString()]]),Tt.appendChild(it),Tt},G.createText=function(p){var A=document.createElementNS("http://www.w3.org/2000/svg","text");return A.setAttribute("x","0"),A.setAttribute("y","0"),p&&G.setAttributes(A,p),A},G.createTSpan=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=p,A&&G.setAttributes(K,A),K},G.createImage=function(p){var A=document.createElementNS("http://www.w3.org/2000/svg","image");return p&&G.setAttributes(A,p),A},G.createPoint=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=p,K.y=A,K},G.createPath=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",p),A&&G.setAttributes(K,A),K},G}(),ne=function(){function G(){}return G.addKey=function(p){G.key=p},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),ve=function(){function G(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return G.prototype.rasterize=function(p,A,K){var Y=this;return new Promise(function(V){var Ae=K!==void 0?K:document.createElement("canvas");p===null&&(Y.markersOnly=!0,Y.naturalSize=!1);var it=document.createElementNS("http://www.w3.org/2000/svg","svg");it.setAttribute("xmlns","http://www.w3.org/2000/svg"),it.setAttribute("width",A.width.baseVal.valueAsString),it.setAttribute("height",A.height.baseVal.valueAsString),it.setAttribute("viewBox","0 0 "+A.viewBox.baseVal.width.toString()+" "+A.viewBox.baseVal.height.toString()),it.innerHTML=A.innerHTML,Y.naturalSize===!0?(it.width.baseVal.value=p.naturalWidth,it.height.baseVal.value=p.naturalHeight):Y.width!==void 0&&Y.height!==void 0&&(it.width.baseVal.value=Y.width,it.height.baseVal.value=Y.height),Ae.width=it.width.baseVal.value,Ae.height=it.height.baseVal.value;var Tt=it.outerHTML,Bt=Ae.getContext("2d");Y.markersOnly!==!0&&Bt.drawImage(p,0,0,Ae.width,Ae.height);var fe=window.URL,Ft=new Image(Ae.width,Ae.height);Ft.setAttribute("crossOrigin","anonymous");var Qt=new Blob([Tt],{type:"image/svg+xml"}),xn=fe.createObjectURL(Qt);Ft.onload=function(){Bt.drawImage(Ft,0,0),fe.revokeObjectURL(xn);var Hn=Ae.toDataURL(Y.imageType,Y.imageQuality);V(Hn)},Ft.src=xn})},G}(),le=function(){},Re=function(){function G(p){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+p+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(p){return this.styleSheet===void 0&&this.addStyleSheet(),p.name=""+this.classNamePrefix+p.localName,this.classes.push(p),this.styleSheet.sheet.insertRule("."+p.name+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length),p},G.prototype.addRule=function(p){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(p),this.styleSheet.sheet.insertRule(p.selector+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var p;this.styleSheet=document.createElement("style"),((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).appendChild(this.styleSheet),this.addRule(new Ie("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ie("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ie("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ce("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ce("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},G.prototype.removeStyleSheet=function(){var p;this.styleSheet&&(((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),Ie=function(G,p){this.selector=G,this.style=p},Ce=function(G,p){this.localName=G,this.style=p},He=function(){function G(p,A,K,Y,V){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=p,this.displayMode=A,this.markerItems=K,this.uiStyleSettings=Y,this.styles=V,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return G.prototype.show=function(p){var A=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",this.uiContainer.appendChild(K),this.addActionButton(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(K,'<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(V){var Ae=document.createElement("div");Ae.className=""+A.toolbarButtonStyleClass.name,Ae.setAttribute("data-type-name",V.typeName),Ae.innerHTML=V.icon,Ae.addEventListener("click",function(){A.markerToolbarButtonClicked(Ae,V)}),A.buttons.push(Ae),A.markerButtons.push(Ae)}),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 Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",Y.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<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(Y,'<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()},G.prototype.addButtonClickListener=function(p){this.buttonClickListeners.push(p)},G.prototype.removeButtonClickListener=function(p){this.buttonClickListeners.indexOf(p)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(p),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var p=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var A=0;A<this.markerButtons.length;A++)A<p||A===p&&this.markerButtons.length-1===p?this.markerButtonBlock.appendChild(this.markerButtons[A]):(A===p&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[A]))}},G.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")},G.prototype.resetButtonStyles=function(){var p=this;this.buttons.forEach(function(A){A.className=A.className.replace(p.uiStyleSettings.toolbarButtonStyleColorsClassName?p.uiStyleSettings.toolbarButtonStyleColorsClassName:p.toolbarButtonStyleColorsClass.name,"").trim(),A.className=A.className.replace(p.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?p.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:p.toolbarActiveButtonStyleColorsClass.name,"").trim(),A.className+=" "+(p.uiStyleSettings.toolbarButtonStyleColorsClassName?p.uiStyleSettings.toolbarButtonStyleColorsClassName:p.toolbarButtonStyleColorsClass.name)})},G.prototype.addActionButton=function(p,A,K){var Y=this,V=document.createElement("div");switch(V.className=""+this.toolbarButtonStyleClass.name,V.innerHTML=A,V.setAttribute("data-action",K),V.addEventListener("click",function(){Y.actionToolbarButtonClicked(V,K)}),K){case"select":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":V.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":V.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":V.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":V.style.fill=this.uiStyleSettings.closeButtonColor}p.appendChild(V),this.buttons.push(V)},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ce("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 Ce("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ce("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ce("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 Ce("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ce("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ce("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ce("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ie("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ie("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},G.prototype.markerToolbarButtonClicked=function(p,A){this.setActiveButton(p),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("marker",A)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(p,A){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",A)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.prototype.setActiveButton=function(p){this.resetButtonStyles(),p.className=p.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),p.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},G.prototype.setActiveMarkerButton=function(p){var A=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===p});A&&this.setActiveButton(A)},G.prototype.setCurrentMarker=function(p){var A=this;this.currentMarker=p,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){A.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},G}(),Ze=function(){function G(p,A,K,Y){this.panels=[],this.panelButtons=[],this.markerjsContainer=p,this.displayMode=A,this.uiStyleSettings=K,this.styles=Y,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var p;this.toolboxStyleClass=this.styles.addClass(new Ce("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 Ce("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ce("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ce("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ce("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 Ce("toolbox-panel-row_colors",`
|
|
background-color: `+((p=this.uiStyleSettings.toolboxBackgroundColor)!==null&&p!==void 0?p:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ce("toolbox_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.toolboxButtonStyleColorsClass=this.styles.addClass(new Ce("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ce("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ie("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ie("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},G.prototype.show=function(p){var A;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolboxStyleClass.name+" "+((A=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(p){var A,K,Y=this;this.panels=p,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((A=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Ae;V.uiStyleSettings=Y.uiStyleSettings;var it=document.createElement("div");it.className=Y.toolboxButtonStyleClass.name+" "+((Ae=Y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:Y.toolboxButtonStyleColorsClass.name),it.innerHTML=V.icon,it.title=V.title,it.addEventListener("click",function(){Y.panelButtonClick(V)}),Y.panelButtons.push(it),Y.buttonRow.appendChild(it)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(p){var A=this,K=-1;if(p!==this.activePanel){K=this.panels.indexOf(p),this.panelRow.innerHTML="";var Y=p.getUi();Y.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Y),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=p}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){A.displayMode==="inline"?A.panelRow.style.display="none":A.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Ae){var it,Tt;V.className=A.toolboxButtonStyleClass.name+" "+(Ae===K?""+((it=A.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&it!==void 0?it:A.toolboxActiveButtonStyleColorsClass.name):""+((Tt=A.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Tt!==void 0?Tt:A.toolboxButtonStyleColorsClass.name))})},G}(),ot=function(G,p){this.title=G,this.icon=p},et=function(G){function p(A,K,Y,V){var Ae=G.call(this,A,V||'<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 Ae.colors=[],Ae.addTransparent=!1,Ae.colorBoxes=[],Ae.colors=K,Ae.currentColor=Y,Ae.setCurrentColor=Ae.setCurrentColor.bind(Ae),Ae.getColorBox=Ae.getColorBox.bind(Ae),Ae}return Ne(p,G),p.prototype.getUi=function(){var A=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function(Y){var V=A.getColorBox(Y);K.appendChild(V),A.colorBoxes.push(V)}),K},p.prototype.getColorBox=function(A){var K=this,Y=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-Y,Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.boxSizing="content-box",Ae.style.width=V-2+"px",Ae.style.height=V-2+"px",Ae.style.padding="1px",Ae.style.marginRight="2px",Ae.style.marginBottom="2px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderRadius=(V+2)/2+"px",Ae.style.borderColor=A===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){K.setCurrentColor(A,Ae)});var it=document.createElement("div");return it.style.display="inline-block",it.style.width=V-2+"px",it.style.height=V-2+"px",it.style.backgroundColor=A,it.style.borderRadius=V/2+"px",A==="transparent"&&(it.style.fill=this.uiStyleSettings.toolboxAccentColor,it.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>`),Ae.appendChild(it),Ae},p.prototype.setCurrentColor=function(A,K){var Y=this;this.currentColor=A,this.colorBoxes.forEach(function(V){V.style.borderColor=V===K?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(A)},p}(ot),Ke=function(){function G(p,A,K){this._state="new",this._isSelected=!1,this._container=p,this._overlayContainer=A,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(p){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(p,A){},G.prototype.dblClick=function(p,A){},G.prototype.manipulate=function(p){},G.prototype.pointerUp=function(p){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(p){this.container.childNodes.length>0?this.container.insertBefore(p,this.container.childNodes[0]):this.container.appendChild(p)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(p){this._state=p.state,this.notes=p.notes},G.prototype.scale=function(p,A){},G.prototype.colorChanged=function(p){this.onColorChanged&&this.onColorChanged(p),this.stateChanged()},G.prototype.fillColorChanged=function(p){this.onFillColorChanged&&this.onFillColorChanged(p),this.stateChanged()},G.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var p=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),p.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(p)&&this.onStateChanged(this)}},G.typeName="MarkerBase",G}(),Ve=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.prototype.findGripByVisual=function(p){return this.topLeft.ownsTarget(p)?this.topLeft:this.topCenter.ownsTarget(p)?this.topCenter:this.topRight.ownsTarget(p)?this.topRight:this.centerLeft.ownsTarget(p)?this.centerLeft:this.centerRight.ownsTarget(p)?this.centerRight:this.bottomLeft.ownsTarget(p)?this.bottomLeft:this.bottomCenter.ownsTarget(p)?this.bottomCenter:this.bottomRight.ownsTarget(p)?this.bottomRight:void 0},G}(),ht=function(){function G(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},G}(),mt=function(){function G(){}return G.toITransformMatrix=function(p){return{a:p.a,b:p.b,c:p.c,d:p.d,e:p.e,f:p.f}},G.toSVGMatrix=function(p,A){return p.a=A.a,p.b=A.b,p.c=A.c,p.d=A.d,p.e=A.e,p.f=A.f,p},G}(),gt=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(ce.createTransform()),V.setupControlBox(),V}return Ne(p,G),Object.defineProperty(p.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"visual",{get:function(){return this._visual},set:function(A){this._visual=A;var K=ce.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(A){return!!G.prototype.ownsTarget.call(this,A)||!!(this.controlGrips.findGripByVisual(A)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(A))},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.state==="new"&&(this.left=A.x,this.top=A.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Y=this.unrotatePoint(A);if(this.manipulationStartX=Y.x,this.manipulationStartY=Y.y,this.offsetX=Y.x-this.left,this.offsetY=Y.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ae=this.container.transform.baseVal.getItem(0);Ae.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ae,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},p.prototype.pointerUp=function(A){var K=this.state;G.prototype.pointerUp.call(this,A),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(A),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},p.prototype.moveVisual=function(A){this.visual.style.transform="translate("+A.x+"px, "+A.y+"px)"},p.prototype.manipulate=function(A){var K=this.unrotatePoint(A);this.state==="creating"?this.resize(A):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(A)},p.prototype.resize=function(A){var K=this.manipulationStartLeft,Y=this.manipulationStartWidth,V=this.manipulationStartTop,Ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+A.x-this.manipulationStartX,Y=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Y=this.manipulationStartWidth+A.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+A.y-this.manipulationStartY,Ae=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ae=this.manipulationStartHeight+A.y-this.manipulationStartY}Y>=0?(this.left=K,this.width=Y):(this.left=K+Y,this.width=-Y),Ae>=0?(this.top=V,this.height=Ae):(this.top=V+Ae,this.height=-Ae),this.setSize()},p.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},p.prototype.rotate=function(A){if(Math.abs(A.x-this.centerX)>.1){var K=Math.sign(A.x-this.centerX);this.rotationAngle=180*Math.atan((A.y-this.centerY)/(A.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},p.prototype.applyRotation=function(){var A=this.container.transform.baseVal.getItem(0);A.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(A,0)},p.prototype.rotatePoint=function(A){if(this.rotationAngle===0)return A;var K=this.container.getCTM(),Y=ce.createPoint(A.x,A.y);return{x:(Y=Y.matrixTransform(K)).x,y:Y.y}},p.prototype.unrotatePoint=function(A){if(this.rotationAngle===0)return A;var K=this.container.getCTM();K=K.inverse();var Y=ce.createPoint(A.x,A.y);return{x:(Y=Y.matrixTransform(K)).x,y:Y.y}},p.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var A=ce.createTransform();A.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(A),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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 Ve,this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){var A=this.controlBox.transform.baseVal.getItem(0);A.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(A,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()},p.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()},p.prototype.createGrip=function(){var A=new ht;return A.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(A.visual),A},p.prototype.positionGrips=function(){var A=this.controlGrips.topLeft.GRIP_SIZE,K=-A/2,Y=K,V=(this.width+this.CB_DISTANCE)/2-A/2,Ae=(this.height+this.CB_DISTANCE)/2-A/2,it=this.height+this.CB_DISTANCE-A/2,Tt=this.width+this.CB_DISTANCE-A/2;this.positionGrip(this.controlGrips.topLeft.visual,K,Y),this.positionGrip(this.controlGrips.topCenter.visual,V,Y),this.positionGrip(this.controlGrips.topRight.visual,Tt,Y),this.positionGrip(this.controlGrips.centerLeft.visual,K,Ae),this.positionGrip(this.controlGrips.centerRight.visual,Tt,Ae),this.positionGrip(this.controlGrips.bottomLeft.visual,K,it),this.positionGrip(this.controlGrips.bottomCenter.visual,V,it),this.positionGrip(this.controlGrips.bottomRight.visual,Tt,it),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,Y-3*this.CB_DISTANCE)},p.prototype.positionGrip=function(A,K,Y){var V=A.transform.baseVal.getItem(0);V.setTranslate(K,Y),A.transform.baseVal.replaceItem(V,0)},p.prototype.hideControlBox=function(){this.controlBox.style.display="none"},p.prototype.showControlBox=function(){this.controlBox.style.display=""},p.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:mt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:mt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},p.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var K=A;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(mt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(mt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K);var Y=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:Y.x*A,y:Y.y*K});this.left=V.x,this.top=V.y,this.width=this.width*A,this.height=this.height*K,this.adjustControlBox()},p}(Ke),Et=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual)},p.prototype.createVisual=function(){this.visual=ce.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)},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},p.prototype.manipulate=function(A){G.prototype.manipulate.call(this,A)},p.prototype.resize=function(A){G.prototype.resize.call(this,A),this.setSize()},p.prototype.setSize=function(){G.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(A){G.prototype.pointerUp.call(this,A),this.setSize()},p.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},p.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},p.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this))},p.prototype.restoreState=function(A){var K=A;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),G.prototype.restoreState.call(this,A),this.setSize()},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K),this.setSize()},p.title="Rectangle marker",p}(gt),ft=function(G){function p(A,K,Y,V){var Ae=G.call(this,A,V||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ae.widths=[],Ae.widthBoxes=[],Ae.widths=K,Ae.currentWidth=Y,Ae.setCurrentWidth=Ae.setCurrentWidth.bind(Ae),Ae}return Ne(p,G),p.prototype.getUi=function(){var A=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function(Y){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=Y===A.currentWidth?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentWidth(Y,V)}),K.appendChild(V);var Ae=document.createElement("div");Ae.innerText=Y.toString(),Ae.style.marginRight="5px",V.appendChild(Ae);var it=document.createElement("div");it.style.minHeight="20px",it.style.flexGrow="2",it.style.display="flex",it.style.alignItems="center";var Tt=document.createElement("hr");Tt.style.minWidth="20px",Tt.style.border="0px",Tt.style.borderTop=Y+"px solid "+A.uiStyleSettings.toolboxColor,Tt.style.flexGrow="2",it.appendChild(Tt),V.appendChild(it),A.widthBoxes.push(V)}),K},p.prototype.setCurrentWidth=function(A,K){var Y=this;this.currentWidth=A,this.widthBoxes.forEach(function(V){V.style.borderColor=V===K?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},p}(ot),Ct=function(G){function p(A,K,Y,V){var Ae=G.call(this,A,V||'<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 Ae.styles=[],Ae.styleBoxes=[],Ae.styles=K,Ae.currentStyle=Y,Ae.setCurrentStyle=Ae.setCurrentStyle.bind(Ae),Ae}return Ne(p,G),p.prototype.getUi=function(){var A=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function(Y){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/A.styles.length-5+"%",V.style.borderColor=Y===A.currentStyle?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentStyle(Y,V)}),K.appendChild(V);var Ae=document.createElement("div");Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.overflow="hidden";var it=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+A.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Y!==""?'stroke-dasharray="'+Y+'"':"")+` />
|
|
</svg>`;Ae.innerHTML=it,V.appendChild(Ae),A.styleBoxes.push(V)}),K},p.prototype.setCurrentStyle=function(A,K){var Y=this;this.currentStyle=A,this.styleBoxes.forEach(function(V){V.style.borderColor=V===K?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},p}(ot),_e=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.strokePanel=new et("Line color",Y.defaultColorSet,Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ft("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ct("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Ne(p,G),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=p.typeName,A},p.typeName="FrameMarker",p.title="Frame marker",p.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',p}(Et),Se=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},Je=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!!G.prototype.ownsTarget.call(this,A)||!(!this.grip1.ownsTarget(A)&&!this.grip2.ownsTarget(A))},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.manipulationStartX=A.x,this.manipulationStartY=A.y,this.state==="new"&&(this.x1=A.x,this.y1=A.y,this.x2=A.x,this.y2=A.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(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},p.prototype.pointerUp=function(A){var K=this.state;G.prototype.pointerUp.call(this,A),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(A),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},p.prototype.adjustVisual=function(){},p.prototype.manipulate=function(A){this.state==="creating"?this.resize(A):this.state==="move"?(this.x1=this.manipulationStartX1+A.x-this.manipulationStartX,this.y1=this.manipulationStartY1+A.y-this.manipulationStartY,this.x2=this.manipulationStartX2+A.x-this.manipulationStartX,this.y2=this.manipulationStartY2+A.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(A)},p.prototype.resize=function(A){switch(this.activeGrip){case this.grip1:this.x1=A.x,this.y1=A.y;break;case this.grip2:case void 0:this.x2=A.x,this.y2=A.y}this.adjustVisual(),this.adjustControlBox()},p.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){this.positionGrips()},p.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},p.prototype.createGrip=function(){var A=new ht;return A.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(A.visual),A},p.prototype.positionGrips=function(){var A=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-A/2,this.y1-A/2),this.positionGrip(this.grip2.visual,this.x2-A/2,this.y2-A/2)},p.prototype.positionGrip=function(A,K,Y){var V=A.transform.baseVal.getItem(0);V.setTranslate(K,Y),A.transform.baseVal.replaceItem(V,0)},p.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},p.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var K=A;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K),this.x1=this.x1*A,this.y1=this.y1*K,this.x2=this.x2*A,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},p}(Ke),nt=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.strokePanel=new et("Line color",Y.defaultColorSet,Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ft("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ct("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorLine&&A!==this.visibleLine)},p.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},p.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},p.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},p.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var K=A;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},p.typeName="LineMarker",p.title="Line marker",p.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',p}(Je),Fe=function(G){function p(A,K,Y,V){var Ae=G.call(this,A,V||'<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 Ae.fonts=[],Ae.fontBoxes=[],Ae.fonts=K,Ae.currentFont=Y,Ae.setCurrentFont=Ae.setCurrentFont.bind(Ae),Ae}return Ne(p,G),p.prototype.getUi=function(){var A=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function(Y){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/A.fonts.length-5+"%",V.style.borderColor=Y===A.currentFont?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentFont(Y,V)}),K.appendChild(V);var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.fontFamily=Y,Ae.style.overflow="hidden";var it=document.createElement("div");it.style.whiteSpace="nowrap",it.style.overflow="hidden",it.style.textOverflow="ellipsis",it.innerHTML="The quick brown fox jumps over the lazy dog",Ae.appendChild(it),V.appendChild(Ae),A.fontBoxes.push(V)}),K},p.prototype.setCurrentFont=function(A,K){var Y=this;this.currentFont=A,this.fontBoxes.forEach(function(V){V.style.borderColor=V===K?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},p}(ot),qe=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=Y.defaultColor,V.fontFamily=Y.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new et("Color",Y.defaultColorSet,Y.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new Fe("Font",Y.defaultFontFamilies,Y.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Ne(p,G),p.prototype.ownsTarget=function(A){if(G.prototype.ownsTarget.call(this,A)||A===this.visual||A===this.textElement||A===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function(Y){Y===A&&(K=!0)}),K},p.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.isMoved=!1,this.pointerDownPoint=A,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},p.prototype.renderText=function(){var A=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(K){A.textElement.appendChild(ce.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},p.prototype.getTextScale=function(){var A=this.textElement.getBBox(),K=1;if(A.width>0&&A.height>0){var Y=(1*this.width-this.width*this.padding*2/100)/A.width,V=(1*this.height-this.height*this.padding*2/100)/A.height;K=Math.min(Y,V)}return K},p.prototype.getTextPosition=function(A){var K=this.textElement.getBBox(),Y=0,V=0;return K.width>0&&K.height>0&&(Y=(this.width-K.width*A)/2,V=this.height/2-K.height*A/2),{x:Y,y:V}},p.prototype.sizeText=function(){var A=this.textElement.getBBox(),K=this.getTextScale(),Y=this.getTextPosition(K);Y.y-=A.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Y.x+"px, "+Y.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Y.x,Y.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},p.prototype.manipulate=function(A){G.prototype.manipulate.call(this,A),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(A.x-this.pointerDownPoint.x)>5||Math.abs(A.y-this.pointerDownPoint.y)>5)},p.prototype.resize=function(A){G.prototype.resize.call(this,A),this.isMoved=!0,this.setSize(),this.sizeText()},p.prototype.setSize=function(){G.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},p.prototype.pointerUp=function(A){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,A),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},p.prototype.showTextEditor=function(){var A=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(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(A.textEditor.style.fontSize);A.textEditor.clientWidth>=Number.parseInt(A.textEditor.style.maxWidth)&&K>.9;)K-=.1,A.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var Y=K.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(Y)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){A.textEditDivClicked(A.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},p.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var A=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Y=this.textElement.getBBox(),V={x:Y.width*A,y:Y.height*A};K.x-=V.x/2,K.y-=V.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*A,12)+"px",this.textElement.style.display="none"}},p.prototype.textEditDivClicked=function(A){this.text=A.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},p.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},p.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},p.prototype.dblClick=function(A,K){G.prototype.dblClick.call(this,A,K),this.showTextEditor()},p.prototype.setColor=function(A){this.textElement&&ce.setAttributes(this.textElement,[["fill",A]]),this.color=A,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(A)},p.prototype.setFont=function(A){this.textElement&&ce.setAttributes(this.textElement,[["font-family",A]]),this.fontFamily=A,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},p.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},p.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){var K=A;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),G.prototype.restoreState.call(this,A),this.setSize()},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K),this.setSize(),this.sizeText(),this.positionTextEditor()},p.typeName="TextMarker",p.title="Text marker",p.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>',p}(gt),xe=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=Y.defaultColor,V.lineWidth=Y.defaultStrokeWidth,V.pixelRatio=Y.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new et("Color",Y.defaultColorSet,Y.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new ft("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.drawingImage)},p.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var A=ce.createTransform();this.visual.transform.baseVal.appendItem(A),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(A,K){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(A.x,A.y),this.drawing=!0):G.prototype.pointerDown.call(this,A,K)},p.prototype.manipulate=function(A){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(A.x,A.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,A)},p.prototype.resize=function(A){G.prototype.resize.call(this,A),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(A){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,A)},p.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)},p.prototype.select=function(){this.state==="creating"&&this.finishCreation(),G.prototype.select.call(this)},p.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},p.prototype.finishCreation=function(){for(var A=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Y=K[0],V=K[1],Ae=K[2],it=K[3],Tt=!1,Bt=0;Bt<this.canvasElement.height;Bt++)for(var fe=0;fe<this.canvasElement.width;fe++)A.data[Bt*this.canvasElement.width*4+4*fe+3]>0&&(Tt=!0,Bt<V&&(V=Bt),fe<Y&&(Y=fe),Bt>it&&(it=Bt),fe>Ae&&(Ae=fe));if(Tt){this.left=Y/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Ae-Y)/this.pixelRatio,this.height=(it-V)/this.pixelRatio;var Ft=document.createElement("canvas");Ft.width=Ae-Y,Ft.height=it-V,Ft.getContext("2d").putImageData(this.canvasContext.getImageData(Y,V,Ae-Y,it-V),0,0),this.drawingImgUrl=Ft.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},p.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},p.prototype.setColor=function(A){this.color=A,this.colorChanged(A)},p.prototype.setLineWidth=function(A){this.lineWidth=A},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){this.createVisual(),G.prototype.restoreState.call(this,A),this.drawingImgUrl=A.drawingImgUrl,this.setDrawingImage()},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K),this.setDrawingImage()},p.typeName="FreehandMarker",p.title="Freehand marker",p.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>',p}(gt),he=function(G){function p(A,K,Y){var V=G.call(this,A,Y||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return V.typeBoxes=[],V.currentType=K,V.setCurrentType=V.setCurrentType.bind(V),V}return Ne(p,G),p.prototype.getUi=function(){var A=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var Y=function(it){var Tt="both";switch(it){case 0:Tt="both";break;case 1:Tt="start";break;case 2:Tt="end";break;case 3:Tt="none"}var Bt=document.createElement("div");if(Bt.style.display="flex",Bt.style.flexGrow="2",Bt.style.alignItems="center",Bt.style.justifyContent="space-between",Bt.style.padding="5px",Bt.style.borderWidth="2px",Bt.style.borderStyle="solid",Bt.style.borderColor=Tt===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",Bt.addEventListener("click",function(){A.setCurrentType(Tt,Bt)}),K.appendChild(Bt),Tt==="both"||Tt==="start"){var fe=document.createElement("div");fe.style.display="flex",fe.style.alignItems="center",fe.style.minHeight="20px",fe.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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,fe.style.marginLeft="5px",Bt.appendChild(fe)}var Ft=document.createElement("div");Ft.style.display="flex",Ft.style.alignItems="center",Ft.style.minHeight="20px",Ft.style.flexGrow="2";var Qt=document.createElement("hr");if(Qt.style.minWidth="20px",Qt.style.border="0px",Qt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),Qt.style.flexGrow="2",Ft.appendChild(Qt),Bt.appendChild(Ft),Tt==="both"||Tt==="end"){var xn=document.createElement("div");xn.style.display="flex",xn.style.alignItems="center",xn.style.minHeight="20px",xn.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="`+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,xn.style.marginRight="5px",Bt.appendChild(xn)}V.typeBoxes.push(Bt)},V=this,Ae=0;Ae<4;Ae++)Y(Ae);return K},p.prototype.setCurrentType=function(A,K){var Y=this;this.currentType=A,this.typeBoxes.forEach(function(V){V.style.borderColor=V===K?Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},p}(ot),ge=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new he("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.arrow1&&A!==this.arrow2)},p.prototype.getArrowPoints=function(A,K){var Y=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return A-Y/2+","+(K+V/2)+" "+A+","+(K-V/2)+" "+(A+Y/2)+","+(K+V/2)},p.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(G.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",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var A=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(A,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var Y=this.arrow2.transform.baseVal.getItem(0);Y.setRotate(A+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Y,0)}},p.prototype.setArrowType=function(A){this.arrowType=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var K=A;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},p.typeName="ArrowMarker",p.title="Arrow marker",p.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',p}(nt),re=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.fillColor=Y.defaultFillColor,V.strokeWidth=0,V.fillPanel=new et("Color",Y.defaultColorSet,Y.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Ne(p,G),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=p.typeName,A},p.typeName="CoverMarker",p.title="Cover marker",p.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',p}(Et),ie=function(G){function p(A,K,Y,V){var Ae=G.call(this,A,V||'<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 Ae.opacities=[],Ae.opacityBoxes=[],Ae.opacities=K,Ae.currentOpacity=Y,Ae.setCurrentOpacity=Ae.setCurrentOpacity.bind(Ae),Ae}return Ne(p,G),p.prototype.getUi=function(){var A=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function(Y){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=Y===A.currentOpacity?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentOpacity(Y,V)}),K.appendChild(V);var Ae=document.createElement("div");Ae.innerText=100*Y+"%",V.appendChild(Ae),A.opacityBoxes.push(V)}),K},p.prototype.setCurrentOpacity=function(A,K){var Y=this;this.currentOpacity=A,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===K?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},p}(ot),oe=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=Y.defaultHighlightColor,V.strokeWidth=0,V.opacity=Y.defaultHighlightOpacity,V.fillPanel=new et("Color",Y.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new ie("Opacity",Y.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Ne(p,G),p.prototype.setOpacity=function(A){this.opacity=A,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=p.typeName,A},p.typeName="HighlightMarker",p.title="Highlight marker",p.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>',p}(re),ue='<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>',Oe=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=Y.defaultStrokeColor,V.bgColor=Y.defaultFillColor,V.fontFamily=Y.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new et("Text color",Y.defaultColorSet,V.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>'),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new et("Fill color",Y.defaultColorSet,V.bgColor,ue),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new Fe("Font",Y.defaultFontFamilies,Y.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new ht,V.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Ne(p,G),p.prototype.ownsTarget=function(A){return G.prototype.ownsTarget.call(this,A)||this.tipGrip.ownsTarget(A)||this.tip===A},p.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},p.prototype.pointerDown=function(A,K){this.state==="new"&&G.prototype.pointerDown.call(this,A,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,A,K)},p.prototype.pointerUp=function(A){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,A);else{var K=this.state==="creating";G.prototype.pointerUp.call(this,A),this.setTipPoints(K),this.positionTip()}},p.prototype.manipulate=function(A){if(this.tipMoving){var K=this.unrotatePoint(A);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,A)},p.prototype.setBgColor=function(A){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",A]]),ce.setAttributes(this.tip,[["fill",A]])),this.bgColor=A,this.fillColorChanged(A)},p.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},p.prototype.setTipPoints=function(A){A===void 0&&(A=!1);var K=Math.min(this.height/2,15),Y=this.height/5;A&&(this.tipPosition={x:K+Y/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Y=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:0},this.tipBase2Position={x:K+Y,y:0}):(this.tipBase1Position={x:0,y:K},this.tipBase2Position={x:0,y:K+Y}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?V<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Y=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-Y,y:0},this.tipBase2Position={x:this.width-K,y:0}):(this.tipBase1Position={x:this.width,y:K},this.tipBase2Position={x:this.width,y:K+Y}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?V<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Y=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-Y,y:this.height},this.tipBase2Position={x:this.width-K,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-K-Y},this.tipBase2Position={x:this.width,y:this.height-K}):V<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Y=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:this.height},this.tipBase2Position={x:K+Y,y:this.height}):(this.tipBase1Position={x:0,y:this.height-K},this.tipBase2Position={x:0,y:this.height-K-Y})},p.prototype.resize=function(A){G.prototype.resize.call(this,A),this.positionTip()},p.prototype.positionTip=function(){ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var A=this.tipGrip.visual.transform.baseVal.getItem(0);A.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(A,0)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.select=function(){this.positionTip(),G.prototype.select.call(this)},p.prototype.getState=function(){var A=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){var K=A;this.bgColor=K.bgColor,this.tipPosition=K.tipPosition,G.prototype.restoreState.call(this,A),this.createTip(),this.setTipPoints()},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K),this.tipPosition={x:this.tipPosition.x*A,y:this.tipPosition.y*K},this.positionTip()},p.typeName="CalloutMarker",p.title="Callout marker",p.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>',p}(qe),we=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.fillColor=Y.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new et("Line color",ye(Y.defaultColorSet,["transparent"]),Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new et("Fill color",ye(Y.defaultColorSet,["transparent"]),V.fillColor,ue),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new ft("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ct("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new ie("Opacity",Y.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual)},p.prototype.createVisual=function(){this.visual=ce.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)},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},p.prototype.manipulate=function(A){G.prototype.manipulate.call(this,A)},p.prototype.resize=function(A){G.prototype.resize.call(this,A),this.setSize()},p.prototype.setSize=function(){G.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},p.prototype.pointerUp=function(A){G.prototype.pointerUp.call(this,A),this.setSize()},p.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},p.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(A),this.stateChanged()},p.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.setOpacity=function(A){this.opacity=A,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){var K=A;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),G.prototype.restoreState.call(this,A),this.setSize()},p.prototype.scale=function(A,K){G.prototype.scale.call(this,A,K),this.setSize()},p.typeName="EllipseMarker",p.title="Ellipse marker",p.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>',p}(gt),rt=function(G){function p(A,K,Y){return G.call(this,A,K,Y)||this}return Ne(p,G),Object.defineProperty(p.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.tip1&&A!==this.tip2)},p.prototype.createTips=function(){this.tip1=ce.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(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.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(ce.createTransform()),this.visual.appendChild(this.tip2)},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.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()]]),ce.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 A=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(A,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var Y=this.tip2.transform.baseVal.getItem(0);Y.setRotate(A+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Y,0)}},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A),this.createTips(),this.adjustVisual()},p.typeName="MeasurementMarker",p.title="Measurement marker",p.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>',p}(nt),yt=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.strokePanel.colors=Y.defaultColorSet,V.fillColor="transparent",V}return Ne(p,G),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=G.prototype.getState.call(this);return A.typeName=p.typeName,A},p.typeName="EllipseFrameMarker",p.title="Ellipse frame marker",p.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>',p}(we),wt=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.prototype.addUndoStep=function(p){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(p)||(this.undoStack.push(p),JSON.stringify(this.lastRedoStep)!==JSON.stringify(p)&&this.redoStack.splice(0,this.redoStack.length))},G.prototype.replaceLastUndoStep=function(p){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=p)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.prototype.undo=function(){if(this.undoStack.length>1){var p=this.undoStack.pop();return p!==void 0&&this.redoStack.push(p),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),xt=function(G){function p(A,K,Y){var V=G.call(this,A,K,Y)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.strokePanel=new et("Line color",Y.defaultColorSet,Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ft("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ct("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Ne(p,G),p.prototype.ownsTarget=function(A){return!(!G.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorCurve&&A!==this.visibleCurve&&!this.curveGrip.ownsTarget(A))},p.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},p.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},p.prototype.pointerDown=function(A,K){G.prototype.pointerDown.call(this,A,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=A.x,this.curveY=A.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},p.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setupControlBox=function(){G.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},p.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,G.prototype.addControlGrips.call(this)},p.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var A=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-A/2,this.curveY-A/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()))},p.prototype.manipulate=function(A){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+A.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+A.y-this.manipulationStartY),G.prototype.manipulate.call(this,A)},p.prototype.resize=function(A){this.activeGrip===this.curveGrip&&(this.curveX=A.x,this.curveY=A.y),G.prototype.resize.call(this,A),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},p.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},p.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},p.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual()},p.prototype.scale=function(A,K){this.curveX=this.curveX*A,this.curveY=this.curveY*K,G.prototype.scale.call(this,A,K)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return A.typeName=p.typeName,A},p.prototype.restoreState=function(A){G.prototype.restoreState.call(this,A);var K=A;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},p.typeName="CurveMarker",p.title="Curve marker",p.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>',p}(Je),pt=function(){function G(p,A){A===void 0&&(A=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=p,this.cancelable=A}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),Qe=function(G){function p(A,K,Y){var V=G.call(this,A,!1)||this;return V.dataUrl=K,V.state=Y,V}return Ne(p,G),p}(pt),ze=function(G){function p(A,K,Y){Y===void 0&&(Y=!1);var V=G.call(this,A,Y)||this;return V.marker=K,V}return Ne(p,G),p}(pt),De=function(){function G(){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 G.prototype.addEventListener=function(p,A){this[p].push(A)},G.prototype.removeEventListener=function(p,A){var K=this[p].indexOf(A);K>-1&&this[p].splice(K,1)},G}(),ae=function(){function G(p){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Se,this._isOpen=!1,this.undoRedoManager=new wt,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 De,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new Re(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=p,this.targetRoot=document.body,this.width=p.clientWidth,this.height=p.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(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[_e,xe,ge,qe,yt,we,oe,Oe,rt,re,nt,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[_e,xe,ge,qe,we,oe,Oe]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[_e,xe,ge,qe,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(p){var A=this;this._availableMarkerTypes.splice(0),p.forEach(function(K){if(typeof K=="string"){var Y=A.ALL_MARKER_TYPES.find(function(V){return V.typeName===K});Y!==void 0&&A._availableMarkerTypes.push(Y)}else A._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(p){this._zoomLevel=p,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var p=this;this.styles.styleSheetRoot===void 0&&le.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=le.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(A){return A(new pt(p))})},G.prototype.render=function(){return Le(this,void 0,void 0,function(){var p;return Ue(this,function(A){switch(A.label){case 0:return this.setCurrentMarker(),(p=new ve).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.markersOnly=this.renderMarkersOnly,p.width=this.renderWidth,p.height=this.renderHeight,[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return A.sent(),[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,A.sent()]}})})},G.prototype.close=function(p){var A=this;if(p===void 0&&(p=!1),this.isOpen){var K=!1;p||this.eventListeners.beforeclose.forEach(function(Y){var V=new pt(A,!0);Y(V),V.defaultPrevented&&(K=!0)}),K||(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(Y){return Y(new pt(A))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var p,A=[],K=0;K<arguments.length;K++)A[K]=arguments[K];(p=this._availableMarkerTypes).push.apply(p,A)},G.prototype.addRenderEventListener=function(p){this.addEventListener("render",function(A){p(A.dataUrl,A.state)})},G.prototype.removeRenderEventListener=function(p){},G.prototype.addCloseEventListener=function(p){this.addEventListener("close",function(){p()})},G.prototype.removeCloseEventListener=function(p){},G.prototype.setupResizeObserver=function(){var p=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return p.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},G.prototype.onPopupTargetResize=function(){var p=1*this.target.clientWidth/this.target.clientHeight,A=this.editorCanvas.clientWidth/p>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*p:this.editorCanvas.clientWidth,K=A<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/p;this.resize(A,K)},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.prototype.resize=function(p,A){this._isResizing=!0;var K=p/this.imageWidth,Y=A/this.imageHeight;this.imageWidth=Math.round(p),this.imageHeight=Math.round(A),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(K,Y),this._isResizing=!1},G.prototype.scaleMarkers=function(p,A){var K,Y=this;this._currentMarker&&this._currentMarker instanceof qe?this._currentMarker.scale(p,A):(K=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(V){V!==Y._currentMarker&&V.scale(p,A)}),K!==void 0&&this.setCurrentMarker(K)},G.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"},G.prototype.setTopLeft=function(){var p=this.editingTarget.getBoundingClientRect(),A=this.editorCanvas.getBoundingClientRect();this.left=p.left-A.left,this.top=p.top-A.top},G.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)},G.prototype.addDefs=function(){for(var p,A=[],K=0;K<arguments.length;K++)A[K]=arguments[K];this.defs=ce.createDefs(),this.addDefsToImage(),(p=this.defs).append.apply(p,A)},G.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},G.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)},G.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},G.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},G.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)},G.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},G.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)},G.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 p=document.createElement("a");p.href="https://markerjs.com/",p.target="_blank",p.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>',p.title="Powered by marker.js",p.style.display="grid",p.style.alignItems="center",p.style.justifyItems="center",p.style.padding="3px",p.style.width="20px",p.style.height="20px",this.logoUI.appendChild(p),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},G.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")},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"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 He(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 Ze(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},G.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.removeMarker=function(p){this.markerImage.removeChild(p.container),this.markers.indexOf(p)>-1&&this.markers.splice(this.markers.indexOf(p),1),p.dispose()},G.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())},G.prototype.toolbarButtonClicked=function(p,A){if(p==="marker"&&A!==void 0)this.createNewMarker(A);else if(p==="action")switch(A){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()}},G.prototype.deleteSelectedMarker=function(){var p=this;if(this._currentMarker!==void 0){var A=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Y){var V=new ze(p,p._currentMarker,!0);Y(V),V.defaultPrevented&&(A=!0)}),!A){var K=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(Y){return Y(new ze(p,K))})}}},G.prototype.clear=function(){var p=this,A=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ae){var it=new ze(p,void 0,!0);Ae(it),it.defaultPrevented&&(A=!0)}),!A)){this.setCurrentMarker();for(var K=function(Ae){var it=Y.markers[Ae];Y.setCurrentMarker(Y.markers[Ae]),Y._currentMarker.dispose(),Y.markerImage.removeChild(Y._currentMarker.container),Y.markers.splice(Y.markers.indexOf(Y._currentMarker),1),Y.eventListeners.markerdelete.forEach(function(Tt){return Tt(new ze(p,it))})},Y=this,V=this.markers.length-1;V>=0;V--)K(V);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.prototype.showNotesEditor=function(){var p;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=(p=this._currentMarker.notes)!==null&&p!==void 0?p:"",this.overlayContainer.appendChild(this.notesArea))},G.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)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var p=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var A=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===A.width&&K.height===A.height){var Y=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(A),Y<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(V){return V(new pt(p))})}else this.undoRedoManager.replaceLastUndoStep(A),this.eventListeners.statechange.forEach(function(V){return V(new pt(p))})}},G.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},G.prototype.undoStep=function(){var p=this,A=this.undoRedoManager.undo();A!==void 0&&(this.restoreState(A),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new pt(p))}))},G.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},G.prototype.redoStep=function(){var p=this,A=this.undoRedoManager.redo();A!==void 0&&(this.restoreState(A),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new pt(p))}))},G.prototype.stepZoom=function(){var p=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=p<this.zoomSteps.length-1?this.zoomSteps[p+1]:this.zoomSteps[0]},G.prototype.panTo=function(p){this.contentDiv.scrollBy({left:this.prevPanPoint.x-p.x,top:this.prevPanPoint.y-p.y}),this.prevPanPoint=p},G.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var p,A,K=this;return Ue(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return p=Y.sent(),A=this.getState(),this.eventListeners.render.forEach(function(V){return V(new Qe(K,p,A))}),this.close(!0),[2]}})})},G.prototype.getState=function(p){p===!0&&this.setCurrentMarker();var A={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(K){return A.markers.push(K.getState())}),A},G.prototype.restoreState=function(p){var A=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);p.markers.forEach(function(K){var Y=A._availableMarkerTypes.find(function(Ae){return Ae.typeName===K.typeName});if(Y!==void 0){var V=A.addNewMarker(Y);V.restoreState(K),A.markers.push(V)}}),p.width&&p.height&&(p.width!==this.imageWidth||p.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/p.width,this.imageHeight/p.height),this.eventListeners.restorestate.forEach(function(K){return K(new pt(A))})},G.prototype.addNewMarker=function(p){var A=ce.createGroup();return this.markerImage.appendChild(A),new p(A,this.overlayContainer,this.settings)},G.prototype.createNewMarker=function(p){var A,K=this;(A=typeof p=="string"?this._availableMarkerTypes.find(function(Y){return Y.typeName===p}):p)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(A),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(A.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Y){return Y(new ze(K,K._currentMarker))}))},G.prototype.markerCreated=function(p){var A=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(p),this.setCurrentMarker(p),p instanceof xe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(xe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(K){return K(new ze(A,A._currentMarker))})},G.prototype.colorChanged=function(p){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=p,this.settings.defaultStrokeColor=p)},G.prototype.fillColorChanged=function(p){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=p)},G.prototype.markerStateChanged=function(p){var A=this;this.eventListeners.markerchange.forEach(function(K){return K(new ze(A,p))})},G.prototype.setCurrentMarker=function(p){var A=this;this._currentMarker!==p&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(K){return K(new ze(A,A._currentMarker))})),this._currentMarker=p,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(K){return K(new ze(A,A._currentMarker))}))},G.prototype.onPointerDown=function(p){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||p.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var A=this.markers.find(function(K){return K.ownsTarget(p.target)});A!==void 0?(this.setCurrentMarker(A),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(p.clientX,p.clientY),p.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:p.clientX,y:p.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(p.clientX,p.clientY))},G.prototype.onDblClick=function(p){if(this._isFocused||this.focus(),this.mode==="select"){var A=this.markers.find(function(K){return K.ownsTarget(p.target)});A!==void 0&&A!==this._currentMarker&&this.setCurrentMarker(A),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(p.clientX,p.clientY),p.target):this.setCurrentMarker()}},G.prototype.onPointerMove=function(p){this.touchPoints!==1&&p.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||p.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(p.clientX,p.clientY)):this.zoomLevel>1&&this.panTo({x:p.clientX,y:p.clientY}))},G.prototype.onPointerUp=function(p){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(p.clientX,p.clientY)),this.isDragging=!1,this.addUndoStep()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(p){this._currentMarker===void 0||this.notesArea!==void 0||p.key!=="Delete"&&p.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(p,A){var K=this.markerImage.getBoundingClientRect();return{x:(p-K.left)/this.zoomLevel,y:(A-K.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"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()},G.prototype.addLicenseKey=function(p){ne.addKey(p)},G.prototype.addEventListener=function(p,A){this.eventListeners.addEventListener(p,A)},G.prototype.removeEventListener=function(p,A){this.eventListeners.removeEventListener(p,A)},G.prototype.renderState=function(p){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(p),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.prototype.focus=function(){var p=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(A){return A(new pt(p))}))},G.prototype.blur=function(){var p=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(A){return A(new pt(p))}))},G.instanceCounter=0,G}();/* **********************************
|
|
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 de=function(G,p){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,K){A.__proto__=K}||function(A,K){for(var Y in K)Object.prototype.hasOwnProperty.call(K,Y)&&(A[Y]=K[Y])})(G,p)};function Ye(G,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function A(){this.constructor=G}de(G,p),G.prototype=p===null?Object.create(p):(A.prototype=p.prototype,new A)}function Me(G,p,A,K){return new(A||(A=Promise))(function(Y,V){function Ae(Bt){try{Tt(K.next(Bt))}catch(fe){V(fe)}}function it(Bt){try{Tt(K.throw(Bt))}catch(fe){V(fe)}}function Tt(Bt){var fe;Bt.done?Y(Bt.value):(fe=Bt.value,fe instanceof A?fe:new A(function(Ft){Ft(fe)})).then(Ae,it)}Tt((K=K.apply(G,p||[])).next())})}function Xe(G,p){var A,K,Y,V,Ae={label:0,sent:function(){if(1&Y[0])throw Y[1];return Y[1]},trys:[],ops:[]};return V={next:it(0),throw:it(1),return:it(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function it(Tt){return function(Bt){return function(fe){if(A)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(A=1,K&&(Y=2&fe[0]?K.return:fe[0]?K.throw||((Y=K.return)&&Y.call(K),0):K.next)&&!(Y=Y.call(K,fe[1])).done)return Y;switch(K=0,Y&&(fe=[2&fe[0],Y.value]),fe[0]){case 0:case 1:Y=fe;break;case 4:return Ae.label++,{value:fe[1],done:!1};case 5:Ae.label++,K=fe[1],fe=[0];continue;case 7:fe=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(Y=Ae.trys,(Y=Y.length>0&&Y[Y.length-1])||fe[0]!==6&&fe[0]!==2)){Ae=0;continue}if(fe[0]===3&&(!Y||fe[1]>Y[0]&&fe[1]<Y[3])){Ae.label=fe[1];break}if(fe[0]===6&&Ae.label<Y[1]){Ae.label=Y[1],Y=fe;break}if(Y&&Ae.label<Y[2]){Ae.label=Y[2],Ae.ops.push(fe);break}Y[2]&&Ae.ops.pop(),Ae.trys.pop();continue}fe=p.call(G,Ae)}catch(Ft){fe=[6,Ft],K=0}finally{A=Y=0}if(5&fe[0])throw fe[1];return{value:fe[0]?fe[1]:void 0,done:!0}}([Tt,Bt])}}}var dt=function(){function G(){}return G.addKey=function(p){G.key=p},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),Pe=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(p,A){for(var K=0,Y=A;K<Y.length;K++){var V=Y[K],Ae=V[0],it=V[1];p.setAttribute(Ae,it)}},G.createRect=function(p,A,K){var Y=document.createElementNS("http://www.w3.org/2000/svg","rect");return Y.setAttribute("width",p.toString()),Y.setAttribute("height",A.toString()),K&&G.setAttributes(Y,K),Y},G.createLine=function(p,A,K,Y,V){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",p.toString()),Ae.setAttribute("y1",A.toString()),Ae.setAttribute("x2",K.toString()),Ae.setAttribute("y2",Y.toString()),V&&G.setAttributes(Ae,V),Ae},G.createPolygon=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",p),A&&G.setAttributes(K,A),K},G.createCircle=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(p/2).toString()),K.setAttribute("cy",(p/2).toString()),K.setAttribute("r",p.toString()),A&&G.setAttributes(K,A),K},G.createEllipse=function(p,A,K){var Y=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Y.setAttribute("cx",(p/2).toString()),Y.setAttribute("cy",(A/2).toString()),Y.setAttribute("rx",(p/2).toString()),Y.setAttribute("ry",(A/2).toString()),K&&G.setAttributes(Y,K),Y},G.createGroup=function(p){var A=document.createElementNS("http://www.w3.org/2000/svg","g");return p&&G.setAttributes(A,p),A},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(p,A,K,Y,V,Ae,it){var Tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(Tt,[["id",p],["orient",A],["markerWidth",K.toString()],["markerHeight",Y.toString()],["refX",V.toString()],["refY",Ae.toString()]]),Tt.appendChild(it),Tt},G.createText=function(p){var A=document.createElementNS("http://www.w3.org/2000/svg","text");return A.setAttribute("x","0"),A.setAttribute("y","0"),p&&G.setAttributes(A,p),A},G.createTSpan=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=p,A&&G.setAttributes(K,A),K},G.createImage=function(p){var A=document.createElementNS("http://www.w3.org/2000/svg","image");return p&&G.setAttributes(A,p),A},G.createPoint=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=p,K.y=A,K},G.createPath=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",p),A&&G.setAttributes(K,A),K},G.createElement=function(p,A){var K=document.createElementNS("http://www.w3.org/2000/svg",p);return A&&G.setAttributes(K,A),K},G.getHollowRectanglePath=function(p,A,K,Y,V,Ae,it,Tt){return"M"+p+","+A+"V"+(A+Y)+"H"+(p+K)+"V"+A+"H"+V+"V"+Ae+"H"+(V+it)+"V"+(Ae+Tt)+"H"+V+"V"+A+"Z"},G}(),at=function(){function G(p){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+p+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(p){return this.styleSheet===void 0&&this.addStyleSheet(),p.name=""+this.classNamePrefix+p.localName,this.classes.push(p),this.styleSheet.sheet.insertRule("."+p.name+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length),p},G.prototype.addRule=function(p){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(p),this.styleSheet.sheet.insertRule(p.selector+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var p;this.styleSheet=document.createElement("style"),((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).appendChild(this.styleSheet),this.addRule(new vt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new vt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new vt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new St("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new St("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},G.prototype.removeStyleSheet=function(){var p;this.styleSheet&&(((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),vt=function(G,p){this.selector=G,this.style=p},St=function(G,p){this.localName=G,this.style=p},Rt=function(){function G(){this.blocks=[],this.display=""}return G.prototype.addButtonBlock=function(p){p.className=this.blockClassName,p.buttonClassName=this.buttonClassName,p.buttonColorsClassName=this.buttonColorsClassName,p.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(p)},G.prototype.addElementBlock=function(p){p.className===void 0&&(p.className=this.blockClassName),this.blocks.push(p)},G.prototype.getUI=function(){var p=document.createElement("div");return p.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,p.style.display=this.display,this.blocks.forEach(function(A){return p.appendChild(A.getUI())}),p},G}(),qt=function(){function G(){}return G.prototype.getUI=function(){var p=document.createElement("div");if(p.className=this.className,this.minWidth!==void 0&&(p.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":p.style.justifyContent="flex-start";break;case"center":p.style.justifyContent="center";break;case"end":p.style.justifyContent="flex-end"}return p.style.whiteSpace="nowrap",p},G}(),sn=function(G){function p(){var A=G!==null&&G.apply(this,arguments)||this;return A.buttons=[],A}return Ye(p,G),p.prototype.addButton=function(A){A.className=this.buttonClassName,A.colorsClassName=this.buttonColorsClassName,A.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(A)},p.prototype.getUI=function(){var A=G.prototype.getUI.call(this);return this.buttons.forEach(function(K){return A.appendChild(K.getUI())}),A},p}(qt),Xt=function(){function G(p,A){this._isActive=!1,this._isHidden=!1,this._icon=p,this.title=A,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(G.prototype,"icon",{get:function(){return this._icon},set:function(p){this._icon=p,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isActive",{get:function(){return this._isActive},set:function(p){this._isActive=p,this.adjustClassName()},enumerable:!1,configurable:!0}),G.prototype.getUI=function(){var p=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 p.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},G.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,"")))},G.prototype.hide=function(){this._isHidden=!0},G}(),_t=function(G){function p(){var A=G!==null&&G.apply(this,arguments)||this;return A.elements=[],A}return Ye(p,G),p.prototype.addElement=function(A){this.elements.push(A)},p.prototype.getUI=function(){var A=G.prototype.getUI.call(this);return this.elements.forEach(function(K){return A.appendChild(K)}),A},p}(qt),cn=function(){function G(p,A){this.horizontal=p,this.vertical=A}return Object.defineProperty(G.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),G.prototype.getVerticalLength=function(p){return p/this.ratio},G.prototype.getHorizontalLength=function(p){return p*this.ratio},G}(),zt=function(){function G(){}return G.getIcon=function(p,A){if(p>0&&A>0){var K=new cn(p,A),Y=K.ratio>=1?20:K.getHorizontalLength(20),V=K.ratio<1?20:K.getVerticalLength(20),Ae=document.createElementNS("http://www.w3.org/2000/svg","svg");Ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ae);var it=Pe.createDefs();Ae.appendChild(it);var Tt=Pe.createElement("clipPath",[["id","text-bg-clip"]]);it.appendChild(Tt);var Bt=Pe.createPath(Pe.getHollowRectanglePath((24-Y)/2,(24-V)/2,Y,V,(24-Y)/2+2,(24-V)/2+2,Y-4,V-4));Ae.appendChild(Bt);var fe=Pe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);fe.appendChild(Pe.createTSpan(p+":"+A)),Ae.appendChild(fe);var Ft=fe.getBBox();Pe.setAttributes(fe,[["x",((24-Ft.width)/2).toString()],["y",((24-Ft.height)/2-Ft.y).toString()]]);var Qt=Pe.createPath(Pe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ft.width))/2,(24-Math.ceil(Ft.height))/2,Math.ceil(Ft.width),Math.ceil(Ft.height)));return Tt.appendChild(Qt),Pe.setAttributes(Bt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ae),Ae.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>'},G}(),$t=function(G){function p(A,K,Y){var V=G.call(this,A,K)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=Y,V}return Ye(p,G),p.prototype.setupDropdown=function(){var A=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(K){K.className=A.className,K.colorsClassName=A.colorsClassName,A.dropdownBlock.appendChild(K.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},p.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},p.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},p.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},p.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},p.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},p}(Xt),Nt=function(){function G(p,A){this.GRIP_SIZE=10,this.color=p,this.fillColor=A,this.visual=Pe.createGroup(),this.visual.appendChild(Pe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Pe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},G.prototype.setCenter=function(p,A){this.visual.childNodes.forEach(function(K){return Pe.setAttributes(K,[["cx",p.toString()],["cy",A.toString()]])})},G}(),nn=function(){function G(p,A,K,Y){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=p,this.canvasHeight=A,this.margin=K,this.container=Y,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(G.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(p){this._aspectRatio=p,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.gridContainer&&Pe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(p){this._zoomFactor=p,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var p=this;this.cropShadeElement=Pe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Pe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var A=0;A<this.numberOfGridLines;A++)this.horizontalGridLines.push(Pe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Pe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(K){return p.gridContainer.appendChild(K)}),this.verticalGridLines.forEach(function(K){return p.gridContainer.appendChild(K)}),this.cropRectElement=Pe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},G.prototype.setCropRectangle=function(p){this.cropRect=p;var A=Object.assign({},this.cropRect);this.zoomFactor!==1&&(A.width=this.cropRect.width*this.zoomFactor,A.height=this.cropRect.height*this.zoomFactor,A.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-A.width/2,A.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-A.height/2),Pe.setAttributes(this.cropRectElement,[["x",A.x.toString()],["y",A.y.toString()],["width",A.width.toString()],["height",A.height.toString()]]);var K=A.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Ae){var it=A.y+K*(Ae+1);Pe.setAttributes(V,[["x1",""+A.x],["y1",""+it],["x2",""+(A.x+A.width)],["y2",""+it]])});var Y=A.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Ae){var it=A.x+Y*(Ae+1);Pe.setAttributes(V,[["x1",""+it],["y1",""+A.y],["x2",""+it],["y2",""+(A.y+A.height)]])}),Pe.setAttributes(this.cropShadeElement,[["d",Pe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,A.x,A.y,A.width,A.height)]]),this.topLeftGrip.setCenter(A.x,A.y),this.topRightGrip.setCenter(A.x+A.width,A.y),this.bottomLeftGrip.setCenter(A.x,A.y+A.height),this.bottomRightGrip.setCenter(A.x+A.width,A.y+A.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.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)},G.prototype.clientToLocalCoordinates=function(p,A){var K=this.container.getBoundingClientRect();return{x:p-K.left+this.margin,y:A-K.top+this.margin}},G.prototype.onPointerDown=function(p){this.container.setPointerCapture(p.pointerId),this.previousPoint=this.clientToLocalCoordinates(p.clientX,p.clientY),this.cropRectElement===p.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(p.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(p.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(p.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(p.target)&&(this.activeGrip=this.bottomRightGrip)},G.prototype.onPointerMove=function(p){if(this.isMoving)this.move(this.clientToLocalCoordinates(p.clientX,p.clientY));else if(this.activeGrip){var A=this.clientToLocalCoordinates(p.clientX,p.clientY);this.resize(A)}p.preventDefault()},G.prototype.onPointerUp=function(p){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(p.pointerId)},G.prototype.move=function(p){var A=p.x-this.previousPoint.x,K=p.y-this.previousPoint.y;this.zoomFactor!==1&&(A=-A/this.zoomFactor,K=-K/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+A),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+K),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=p},G.prototype.resize=function(p){var A=Object.assign({},this.cropRect),K=p.x-this.previousPoint.x,Y=p.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:A.x+K<this.margin&&(K=this.margin-A.x),A.x+=K,A.width=this.cropRect.x+this.cropRect.width-A.x;break;case this.bottomRightGrip:case this.topRightGrip:A.width+K>this.canvasWidth*this.zoomFactor&&(K=this.canvasWidth*this.zoomFactor-A.width),A.width+=K}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(A.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(K),A.height=this.aspectRatio.getVerticalLength(A.width)):(A.y+=Y,A.height=this.cropRect.y+this.cropRect.height-A.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?A.height=this.aspectRatio.getVerticalLength(A.width):A.height+=Y}A.width<10&&(A.x=this.cropRect.x,A.width=10),A.height<10&&(A.y=this.cropRect.y,A.height=10),this.previousPoint=p,A.x>=this.margin&&A.y>=this.margin&&A.x-this.margin+A.width<=this.canvasWidth&&A.y-this.margin+A.height<=this.canvasHeight&&(this.cropRect=A,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var p=this.cropRect.x+this.cropRect.width/2,A=this.cropRect.y+this.cropRect.height/2,K=this.aspectRatio.getHorizontalLength(this.cropRect.height),Y=this.aspectRatio.getVerticalLength(this.cropRect.width);K/this.canvasWidth<Y/this.canvasHeight?this.cropRect.width=K:this.cropRect.height=Y,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=p-this.cropRect.width/2,this.cropRect.y=A-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)}},G.prototype.getRescaledRect=function(p,A,K,Y,V,Ae){var it=K/p,Tt=Y/A;return{x:(V.x-Ae)*it+Ae,y:(V.y-Ae)*Tt+Ae,width:V.width*it,height:V.height*Tt}},G.prototype.scaleCanvas=function(p,A){var K=this.getRescaledRect(this.canvasWidth,this.canvasHeight,p,A,this.cropRect,this.margin);this.canvasWidth=p,this.canvasHeight=A,this.onCropChange&&this.onCropChange(K),this.setCropRectangle(K)},G}(),An=function(){function G(p){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=p,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(G.prototype,"angle",{get:function(){return this._angle},set:function(p){this._angle=p,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.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},G.prototype.onPointerDown=function(p){this.controlContainer.setPointerCapture(p.pointerId),this.isDragging=!0,this.previousPoint={x:p.clientX,y:p.clientY}},G.prototype.onPointerMove=function(p){this.isDragging&&(this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.previousPoint.x=p.clientX)},G.prototype.onPointerUp=function(p){this.isDragging&&this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(p.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var p=this.angleLabelText.getBBox();Pe.setAttributes(this.angleLabelElement,[["x",((this.width-p.width)/2).toString()],["y",(this.height/2).toString()]])}},G.prototype.positionScaleShape=function(){if(this.scaleShape){var p=this.scaleShape.transform.baseVal.getItem(0);p.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(p,0)}},G.prototype.getVisual=function(){var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("width",this.width+"px"),p.setAttribute("height",this.height+"px"),p.setAttribute("viewBox","0 0 "+this.width+" "+this.height),p.style.flexShrink="0",document.body.appendChild(p);for(var A="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,K=1;K<=this.width/5+10;K++){var Y=K%5==0?this.height/3:this.height/6;A+="h4v"+-Y+"h1v"+Y}A+="v1H0Z",this.scaleShape=Pe.createPath(A);var V=Pe.createTransform();this.scaleShape.transform.baseVal.appendItem(V),p.appendChild(this.scaleShape),this.angleLabelElement=Pe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Pe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ae=Pe.createTSpan("");return Ae.innerHTML="°",this.angleLabelElement.appendChild(Ae),p.appendChild(this.angleLabelElement),document.body.removeChild(p),p},G}(),Tn=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(p,A,K,Y,V,Ae,it){var Tt=this;return new Promise(function(Bt){var fe=document.createElement("canvas");fe.width=p.width.baseVal.value-2*Y,fe.height=p.height.baseVal.value-2*Y;var Ft=1,Qt=1;Tt.naturalSize===!0?(Ft=A.naturalWidth/(p.width.baseVal.value-2*Y)/Ae,Qt=A.naturalHeight/(p.height.baseVal.value-2*Y)/it,fe.width=A.naturalWidth/Ae,fe.height=A.naturalHeight/it):Tt.width!==void 0&&Tt.height!==void 0&&(Ft=Tt.width/K.width,Qt=Tt.height/K.height,fe.width*=Ft,fe.height*=Qt);var xn=fe.getContext("2d");xn.translate(fe.width/2,fe.height/2),xn.rotate(V*Math.PI/180),xn.scale(Ae,it),xn.translate(-fe.width/2,-fe.height/2),xn.drawImage(A,0,0,fe.width,fe.height);var Hn=document.createElement("canvas");Hn.width=K.width*Ft,Hn.height=K.height*Qt,Hn.getContext("2d").putImageData(xn.getImageData((K.x-Y)*Ft,(K.y-Y)*Qt,K.width*Ft,K.height*Qt),0,0),Bt(Hn.toDataURL(Tt.imageType,Tt.imageQuality))})},G}(),ct=function(){function G(p){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=G.instanceCounter++,this.styles=new at(this.instanceNo),this.target=p,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(p){this._zoomToCropEnabled=p,p?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gridLines",{get:function(){return this._gridLines},set:function(p){this._gridLines=p,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(p){this._rotationAngle=p,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"aspectRatio",{get:function(){var p;return(p=this._aspectRatio)!==null&&p!==void 0?p:this.aspectRatios[0]},set:function(p){this._aspectRatio=p},enumerable:!1,configurable:!0}),G.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},G.prototype.show=function(){this.showUI(),this.open()},G.prototype.close=function(p){p===void 0&&(p=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),p||this.closeEventListeners.forEach(function(A){return A()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(p){this.renderEventListeners.push(p)},G.prototype.removeRenderEventListener=function(p){this.renderEventListeners.indexOf(p)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(p),1)},G.prototype.addCloseEventListener=function(p){this.closeEventListeners.push(p)},G.prototype.removeCloseEventListener=function(p){this.closeEventListeners.indexOf(p)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(p),1)},G.prototype.setupResizeObserver=function(){var p=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.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))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var p=1*this.target.clientWidth/this.target.clientHeight,A=this.contentDiv.clientWidth/p>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*p:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,K=A+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/p;this.resize(A,K)}},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.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",Pe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},G.prototype.resize=function(p,A){this.imageWidth=Math.round(p),this.imageHeight=Math.round(A),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()},G.prototype.setEditingTarget=function(){var p=document.createElement("canvas");p.width=this.target.naturalWidth,p.height=this.target.naturalHeight,p.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var A=p.toDataURL();Pe.setAttributes(this.editingTarget,[["href",A]]),this.setEditingTargetSize()},G.prototype.setTopLeft=function(){var p=this.target.getBoundingClientRect(),A=this.editorCanvas.getBoundingClientRect();this.left=p.left-A.left-this.CANVAS_MARGIN,this.top=p.top-A.top-this.CANVAS_MARGIN},G.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=Pe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Pe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Pe.createGroup(),this.editingTargetRotationScaleContainer=Pe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var p=Pe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(p);var A=Pe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(A),this.editingTargetContainer=Pe.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)},G.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},G.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Pe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new nn(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()},G.prototype.zoomToCrop=function(){if(this.cropRect){var p=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,A=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=p+"px "+A+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-p+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-A+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},G.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)},G.prototype.cropRectChanged=function(p){this.cropRect=p,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},G.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 p=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,A=this.target.offsetTop>p+this.CANVAS_MARGIN?this.target.offsetTop-(p+this.CANVAS_MARGIN):0;this.coverDiv.style.top=A+"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},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var p=this;this.topToolbar=new Rt,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 A=new sn;A.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(A);var K=[];this.aspectRatios.forEach(function(Qt){var xn=new Xt(zt.getIcon(Qt.horizontal,Qt.vertical),Qt.horizontal===0&&Qt.vertical===0?"FREE":Qt.horizontal+":"+Qt.vertical);xn.onClick=function(){return p.ratioButtonClicked(Qt)},K.push(xn)}),this.aspectRatioButton=new $t(zt.getIcon(0,0),"Aspect ratio",K),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,A.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Y=new Xt('<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");Y.isActive=this.isGridVisible,Y.onClick=function(){p.isGridVisible=!p.isGridVisible,Y.isActive=p.isGridVisible},A.addButton(Y);var V=new Xt('<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(V.isActive=this.zoomToCropEnabled,V.onClick=function(){p.zoomToCropEnabled=!p.zoomToCropEnabled,V.isActive=p.zoomToCropEnabled},A.addButton(V),!dt.isLicensed){var Ae=new _t;this.topToolbar.addElementBlock(Ae);var it=document.createElement("div");it.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Tt=document.createElement("a");Tt.style.color="currentColor",Tt.href="https://markerjs.com/products/cropro",Tt.target="_blank",Tt.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>',it.appendChild(Tt),Ae.addElement(it)}var Bt=new sn;Bt.minWidth=3*this.toolbarHeight+"px",Bt.contentAlign="end",this.topToolbar.addButtonBlock(Bt);var fe=new Xt('<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");fe.onClick=this.startRenderAndClose,Bt.addButton(fe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(fe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ft=new Xt('<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");Ft.onClick=this.close,Bt.addButton(Ft),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ft.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var p=this;this.bottomToolbar=new Rt,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 A=new sn;A.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(A);var K=new Xt('<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");K.onClick=this.rotateLeftButtonClicked,A.addButton(K);var Y=new Xt('<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");Y.onClick=this.rotateRightButtonClicked,A.addButton(Y);var V=new _t;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new An("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(Bt){p.rotateBy(Bt),p.straightener.angle=p.rotationAngle},V.addElement(this.straightener.getUI());var Ae=new sn;Ae.minWidth=2*this.toolbarHeight+"px",Ae.contentAlign="end",this.bottomToolbar.addButtonBlock(Ae);var it=new Xt('<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");it.onClick=this.flipHorizontallyButtonClicked,Ae.addButton(it);var Tt=new Xt('<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");Tt.onClick=this.flipVerticallyButtonClicked,Ae.addButton(Tt)},G.prototype.ratioButtonClicked=function(p){this.aspectRatio=p,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=zt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new cn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(p){if(p){var A=this.cropLayer.getRescaledRect(p.width,p.height,this.imageWidth,this.imageHeight,p.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(A),this.cropRectChanged(A),this.flippedHorizontally=p.flippedHorizontally,this.flippedVertically=p.flippedVertically,this.applyFlip(),this.rotationAngle=p.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(p,A){var K=this.cropImage.getBoundingClientRect();return{x:p-K.left,y:A-K.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var p=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=p+"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()},G.prototype.rotateLeftButtonClicked=function(){var p=this.rotationAngle-90;this.rotationAngle%90!=0&&(p+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(p)},G.prototype.rotateRightButtonClicked=function(){var p=this.rotationAngle+90;this.rotationAngle%90!=0&&(p-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(p)},G.prototype.rotateTo=function(p){p=(p=p>180?p-360:p)<=-180?p+360:p,this.rotationAngle=p,this.applyRotation()},G.prototype.rotateBy=function(p){this.rotateTo((this.rotationAngle+p)%360)},G.prototype.applyRotation=function(){var p=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var A=this.editingTargetRotationContainer.transform.baseVal.getItem(0);A.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(A,0);var K=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/K.width,this.imageHeight/K.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=p},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return Me(this,void 0,void 0,function(){var p,A;return Xe(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return p=K.sent(),A=this.getState(),this.renderEventListeners.forEach(function(Y){return Y(p,A)}),this.close(!0),[2]}})})},G.prototype.render=function(){return Me(this,void 0,void 0,function(){var p;return Xe(this,function(A){switch(A.label){case 0:return(p=new Tn).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.width=this.renderWidth,p.height=this.renderHeight,this.unzoomFromCrop(),Pe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,p.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 A.sent(),[4,p.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,A.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new St("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 St("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new St("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var p=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new St("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*p)+`px;
|
|
height: `+(this.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new St("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new St("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new vt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new vt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new St("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 St("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new St("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 St("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new St("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},G.instanceCounter=0,G}(),Gt=F("8hTe"),Ln=F.n(Gt),Fn=/<pre[^>]*>/g;function kn(G){var p=document.createElement("div");return p.innerHTML=G,p.childNodes.length===0?"":p.childNodes[0].nodeValue}var Xn=ke.a=function(G){var p=G.value,A=p===void 0?"":p,K=G.edit,Y=K===void 0?!1:K,V=G.className,Ae=G.showTextOnly,it=G.showLines,Tt=G.replaces,Bt=G.zoomImg,fe=G.hasMask,Ft=G.style,Qt=Ft===void 0?{}:Ft,xn=G.stylesPrev,Hn=xn===void 0?{}:xn,ir=String(A),Rn=Object(D.useRef)(),cr=Object(D.useRef)(),gr=Object(D.useState)(""),Qn=Object(U.a)(gr,2),hr=Qn[0],$n=Qn[1],kr=Object(D.useState)("office"),ar=Object(U.a)(kr,2),Ir=ar[0],Er=ar[1],Rr=function(){var on=new ct(cr.current);on.displayMode="popup",on.addRenderEventListener(function(){var Mn=Object(O.a)(I.a.mark(function hn(On){var fn;return I.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return Rn.current.style.display="none",In.next=3,Object(We.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:On}});case 3:fn=In.sent,fn!=null&&fn.id&&Tt(cr.current.getAttribute("src").replace(se.a.API_SERVER,""),"/api/attachments/".concat(fn==null?void 0:fn.id,"?type=").concat(fn.content_type));case 5:case"end":return In.stop()}},hn)}));return function(hn){return Mn.apply(this,arguments)}}()),on.show()},Qr=function(){var on=new ae(cr.current);on.settings.displayMode="popup",on.addEventListener("render",function(){var Mn=Object(O.a)(I.a.mark(function hn(On){var fn;return I.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(Rn.current.style.display="none",!cr.current){In.next=6;break}return In.next=4,Object(We.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:On.dataUrl}});case 4:fn=In.sent,fn!=null&&fn.id&&Tt(cr.current.getAttribute("src").replace(se.a.API_SERVER,""),"/api/attachments/".concat(fn==null?void 0:fn.id,"?type=").concat(fn.content_type));case 6:case"end":return In.stop()}},hn)}));return function(hn){return Mn.apply(this,arguments)}}()),on.show(),window.markerArea=on},xr=Object(D.useMemo)(function(){try{var En=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,on=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Mn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ir=ir.replace(En,"("+se.a.API_SERVER+"/api/attachments/").replace(on,'"'+se.a.API_SERVER+"/api/attachments/").replace(Mn,'"'+se.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,`
|
|
`),ir=ir.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(_r){}var hn=J(ir),On=x();if(ir.match(/\[TOC\]/)&&(hn=hn.replace("<p>[TOC]</p>",w()),T()),hn=hn.replace(/(__special_katext_id_\d+__)/g,function(_r,In){var Yn=On[In],zr=Yn.type,Wr=Yn.expression;return Object(me.renderToString)(kn(Wr)||"",{displayMode:zr==="block",throwOnError:!1,output:"html"})}),hn=hn.replace(/▁/g,"\u2581\u2581\u2581"),b(),Ae){var fn=document.createElement("div");return fn.innerHTML=hn,fn.innerText}return setTimeout(function(){return Pr()},500),hn},[ir]),or=Object(D.useRef)();g.WebkitLineClamp=it,it&&(Qt=Object(N.a)(Object(N.a)({},Qt),g));function Fr(En){var on=En.target;if(on.tagName.toUpperCase()==="IMG"){if(Bt){var Mn=on.getAttribute("src");$n(Mn),Er("image")}}else if(on.tagName.toUpperCase()==="A"){var hn=on.getAttribute("href");if(hn.indexOf("office")>-1)En.preventDefault(),$n(hn),Er("office");else if(hn.indexOf("application/pdf")>-1)En.preventDefault(),$n(hn),Er("pdf");else if(hn.indexOf("type=text")>-1)En.preventDefault(),$n(hn),Er("html");else if(hn.startsWith("#")){En.preventDefault();var On=document.getElementById(hn.replace("#",""));On&&On.scrollIntoView(!0)}}}var Pr=function(){var on,Mn=(on=or.current)===null||on===void 0?void 0:on.querySelectorAll("video");Mn==null||Mn.forEach(function(hn){if(hn.oncontextmenu=function(){return!1},hn.src.indexOf(".m3u8")>-1&&!hn.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var On=new $.a;On.loadSource(hn.src),On.attachMedia(hn)}}})};Object(D.useEffect)(function(){if(or.current&&xr&&(xr.match(Fn)&&window.PR.prettyPrint()),or.current)return or.current.addEventListener("click",Fr),function(){or.current.removeEventListener("click",Fr),b(),T()}},[xr,or.current,Fr]);var jr=function(on){if(!Y)return;on.target.nodeName==="IMG"?(Rn.current.style.display="flex",Rn.current.style.width=on.target.clientWidth+"px",Rn.current.style.height=on.target.clientHeight+"px",Rn.current.style.top=on.target.offsetTop+"px",Rn.current.style.left=on.target.offsetLeft+"px",cr.current.src=on.target.getAttribute("src")):Rn.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:or,style:Object(N.a)({},Qt),className:"".concat(V||""," markdown-body ").concat(Ln.a.mdBody),onMouseOver:jr,dangerouslySetInnerHTML:{__html:xr}}),E.a.createElement("div",{ref:Rn,className:Ln.a.button},E.a.createElement(X.a,null,E.a.createElement(Q.a,{onClick:function(){return Rr()}},"\u88C1\u526A"),E.a.createElement(Q.a,{onClick:function(){return Qr()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:cr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(Ee.a,{close:!0,data:hr,hasMask:fe,type:hr!=null&&hr.length?Ir:"",style:Object(N.a)({},Hn),onClose:function(){return $n("")}}))}},"9GDu":function($e,ke,F){$e.exports={flex_box_center:"flex_box_center___2Dduc",flex_space_between:"flex_space_between___2Le2r",flex_box_vertical_center:"flex_box_vertical_center___2KZsK",flex_box_center_end:"flex_box_center_end___1aosz",flex_box_column:"flex_box_column___cFN2D",bg:"bg___ka_0p",title:"title___3M9-E",questionIcons:"questionIcons___VjWTs",green:"green___2q3Jn",orange:"orange___KXt8o",greenTip:"greenTip___1nV5h",redTip:"redTip___3QDm4",orangeTip:"orangeTip___3F21W",pollDesc:"pollDesc___3Jb8Y",answered:"answered___1tbR8",unanswer:"unanswer___2Jts9",anchor:"anchor___3_nBp",answerFlag:"answerFlag___32KcB",flagActive:"flagActive___3ac8b",flagHalf:"flagHalf___1AvT6",answerStudentFlag:"answerStudentFlag___UbvlB",answerStudentActive:"answerStudentActive___27het",questionItem:"questionItem___3nBk4",itemType:"itemType___3NNh-",itemFlag:"itemFlag___2fz1F",answerWrap:"answerWrap___23vJg",answerSubjective:"answerSubjective___1i3N-",otherInput:"otherInput___gQ5U6",submitButton:"submitButton___RAvWu",randomFlag:"randomFlag___1J_UJ",answerTrue:"answerTrue___1cUgp",answerFalse:"answerFalse___Q16xV",answerHalf:"answerHalf___2I-fp",renderHtml:"renderHtml___1O15z",simpleText:"simpleText___1-h1E",answerYes:"answerYes___3w-7A",answerNo:"answerNo___2TuuH",answerInfo:"answerInfo___3KPDJ",answerSheet:"answerSheet___1UuGf",active:"active___2njWQ",countDown:"countDown___ViVY-",red:"red___RmODq",fold:"fold___ZVRBm",cardList:"cardList___1KJD0",iframe:"iframe___8V6GW"}},"9VGf":function($e,ke,F){"use strict";F.d(ke,"a",function(){return k});var ee=F("q1tI"),X=F.n(ee);function k(Q,N){var O=Object(ee.useRef)();Object(ee.useEffect)(function(){O.current=Q}),Object(ee.useEffect)(function(){function U(){O.current()}if(N!==null){var B=setInterval(U,N);return function(){return clearInterval(B)}}},[N])}},"A/g1":function($e,ke){$e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjEtMDctMDJUMTk6Mzg6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmVkYzRhODM0LTVjNWQtNDQ1My04MDYzLWNkNzcwODQyODg5ZSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjQ4MTE0OTVlLTVkMDctZTk0YS1iNWEwLWYxOWJmZmM0NGUyNyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmMwNjQyYzA1LTg5MzQtNDdlYy04MTFiLTlkYjdhZGNkYjFiMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YzA2NDJjMDUtODkzNC00N2VjLTgxMWItOWRiN2FkY2RiMWIwIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjM4OjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWRjNGE4MzQtNWM1ZC00NDUzLTgwNjMtY2Q3NzA4NDI4ODllIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5fJkpyAAAGoElEQVRogc2abWxbVxnH/8+59/rdTpx2GW3UNWJJV7Ylaxp3LUFsWgJDiI5R8bK2GppAmsgQLKQthS8IEJ9okibrREf3gX2Y1K2bxAoDtog60RBSVxKnWUO7kpSppXJZK2ja2HFi33vPw4cmpbN9r++1k8Lv2znnf577f+zje95Mhw4dQqUkwljpF7kuv0EdHkm1HklRr6TQq2tn5xcklwhIMnMSQJIJxykTiSce+1am0mer5XacqM7uDJjiqbAuWlvSygrBnmKyxcoI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"},BU3w:function($e,ke,F){"use strict";F.d(ke,"a",function(){return O});var ee=F("MNnm"),X="rc-util-key";function k(U){if(U.attachTo)return U.attachTo;var B=document.querySelector("head");return B||document.body}function Q(U){var B,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var D=document.createElement("style");if((B=I.csp)===null||B===void 0?void 0:B.nonce){var E;D.nonce=(E=I.csp)===null||E===void 0?void 0:E.nonce}D.innerHTML=U;var R=k(I),P=R.firstChild;return I.prepend&&R.prepend?R.prepend(D):I.prepend&&P?R.insertBefore(D,P):R.appendChild(D),D}var N=new Map;function O(U,B){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=k(I);if(!N.has(D)){var E=Q("",I),R=E.parentNode;N.set(D,R),R.removeChild(E)}var P=Array.from(N.get(D).children).find(function(s){return s.tagName==="STYLE"&&s[X]===B});if(P){var _,S;if(((_=I.csp)===null||_===void 0?void 0:_.nonce)&&P.nonce!==((S=I.csp)===null||S===void 0?void 0:S.nonce)){var y;P.nonce=(y=I.csp)===null||y===void 0?void 0:y.nonce}return P.innerHTML!==U&&(P.innerHTML=U),P}var d=Q(U,I);return d[X]=B,d}},Bd2K:function($e,ke,F){(function(ee){ee(F("VrN/"),F("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(I,D,E){if(E!=ee.Init&&E&&I.removeKeyMap("autoCloseTags"),!D)return;var R={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(R["'/'"]=function(P){return O(P)}),(typeof D!="object"||D.whenOpening!==!1)&&(R["'>'"]=function(P){return Q(P)}),I.addKeyMap(R)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Q(I){if(I.getOption("disableInput"))return ee.Pass;for(var D=I.listSelections(),E=[],R=I.getOption("autoCloseTags"),P=0;P<D.length;P++){if(!D[P].empty())return ee.Pass;var _=D[P].head,S=I.getTokenAt(_),y=ee.innerMode(I.getMode(),S.state),d=y.state,s=y.mode.xmlCurrentTag&&y.mode.xmlCurrentTag(d),u=s&&s.name;if(!u)return ee.Pass;var h=y.mode.configuration=="html",T=typeof R=="object"&&R.dontCloseTags||h&&X,g=typeof R=="object"&&R.indentTags||h&&k;S.end>_.ch&&(u=u.slice(0,u.length-S.end+_.ch));var f=u.toLowerCase();if(!u||S.type=="string"&&(S.end!=_.ch||!/[\"\']/.test(S.string.charAt(S.string.length-1))||S.string.length==1)||S.type=="tag"&&s.close||S.string.indexOf("/")==_.ch-S.start-1||T&&U(T,f)>-1||B(I,y.mode.xmlCurrentContext&&y.mode.xmlCurrentContext(d)||[],u,_,!0))return ee.Pass;var w=typeof R=="object"&&R.emptyTags;if(w&&U(w,u)>-1){E[P]={text:"/>",newPos:ee.Pos(_.line,_.ch+2)};continue}var v=g&&U(g,f)>-1;E[P]={indent:v,text:">"+(v?`
|
|
|
|
`:"")+"</"+u+">",newPos:v?ee.Pos(_.line+1,0):ee.Pos(_.line,_.ch+1)}}for(var c=typeof R=="object"&&R.dontIndentOnAutoClose,P=D.length-1;P>=0;P--){var l=E[P];I.replaceRange(l.text,D[P].head,D[P].anchor,"+insert");var a=I.listSelections().slice(0);a[P]={head:l.newPos,anchor:l.newPos},I.setSelections(a),!c&&l.indent&&(I.indentLine(l.newPos.line,null,!0),I.indentLine(l.newPos.line+1,null,!0))}}function N(I,D){for(var E=I.listSelections(),R=[],P=D?"/":"</",_=I.getOption("autoCloseTags"),S=typeof _=="object"&&_.dontIndentOnSlash,y=0;y<E.length;y++){if(!E[y].empty())return ee.Pass;var d=E[y].head,s=I.getTokenAt(d),u=ee.innerMode(I.getMode(),s.state),h=u.state;if(D&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=d.ch-1))return ee.Pass;var T,g=u.mode.name!="xml"&&I.getMode().name=="htmlmixed";if(g&&u.mode.name=="javascript")T=P+"script";else if(g&&u.mode.name=="css")T=P+"style";else{var f=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(h);if(!f||f.length&&B(I,f,f[f.length-1],d))return ee.Pass;T=P+f[f.length-1]}I.getLine(d.line).charAt(s.end)!=">"&&(T+=">"),R[y]=T}if(I.replaceSelections(R),E=I.listSelections(),!S)for(var y=0;y<E.length;y++)(y==E.length-1||E[y].head.line<E[y+1].head.line)&&I.indentLine(E[y].head.line)}function O(I){return I.getOption("disableInput")?ee.Pass:N(I,!0)}ee.commands.closeTag=function(I){return N(I)};function U(I,D){if(I.indexOf)return I.indexOf(D);for(var E=0,R=I.length;E<R;++E)if(I[E]==D)return E;return-1}function B(I,D,E,R,P){if(!ee.scanForClosingTag)return!1;var _=Math.min(I.lastLine()+1,R.line+500),S=ee.scanForClosingTag(I,R,null,_);if(!S||S.tag!=E)return!1;for(var y=P?1:0,d=D.length-1;d>=0&&D[d]==E;d--)++y;R=S.to;for(var d=1;d<y;d++){var s=ee.scanForClosingTag(I,R,null,_);if(!s||s.tag!=E)return!1;R=s.to}return!0}})},BjJ7:function($e,ke,F){"use strict";F.d(ke,"d",function(){return X}),F.d(ke,"c",function(){return k}),F.d(ke,"e",function(){return Q}),F.d(ke,"b",function(){return N}),F.d(ke,"a",function(){return U});var ee=F("m3rI");function X(B){var I=!0;if(B.length>0){for(var D=0;D<B.length;D++)if(B[D].compile_success==0||!B[D].compile_success){I=!1;break}}else I=!1;return I}function k(B){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],E=0;E<B.length;E++){var R=B[E],P=I?"".concat(I,"/").concat(R.name):"".concat(R.name);D.push({title:R.name,isLeaf:!(R.type==="tree"),key:P})}return D}function Q(B,I,D){for(var E=0;E<B.length;E++){var R=B[E];if(R.key===I){R.children=D;break}R.children&&Q(R.children,I,D)}return B}function N(B,I,D){var E;return function(){var R=this,P=arguments,_=function(){E=null,D||B.apply(R,P)},S=D&&!E;clearTimeout(E),E=setTimeout(_,I),S&&B.apply(R,P)}}var O=!0,U=ee.a.API_SERVER},BlwA:function($e,ke,F){"use strict";var ee=F("9og8"),X=F("miYZ"),k=F("tsqr"),Q=F("tJVT"),N=F("WmNS"),O=F.n(N),U=F("q1tI"),B=F.n(U),I=F("Ty5D"),D=F("ErOA"),E=F("m3rI"),R=F("DR4n"),P=F.n(R),_=function(d,s){for(var u=d.split(","),h=u[0].match(/:(.*?);/)[1],T=atob(u[1]),g=T.length,f=new Uint8Array(g);g--;)f[g]=T.charCodeAt(g);return new Blob([f],{type:h})},S=Object(U.forwardRef)(function(y,d){var s=y.time,u=y.number,h=y.supportCamera,T=y.take_photo,g=y.update,f=y.id,w=Object(U.useRef)(),v=Object(U.useRef)(),c=Object(I.i)(),l=Object(U.useState)([]),a=Object(Q.a)(l,2),i=a[0],x=a[1],b=Object(U.useState)(0),m=Object(Q.a)(b,2),L=m[0],C=m[1],H=Object(U.useState)(""),J=Object(Q.a)(H,2),W=J[0],j=J[1],$=Object(U.useState)(),se=Object(Q.a)($,2),me=se[0],Ee=se[1],We=Object(U.useState)(0),Be=Object(Q.a)(We,2),Ne=Be[0],Le=Be[1];Object(U.useEffect)(function(){return ce(),function(){ve(),Ue()}},[]),Object(U.useEffect)(function(){L===2&&s&&u>0&&(ye(),Le(1))},[s]),Object(U.useEffect)(function(){if(Ne===0)return;if(Ne===2)clearInterval(me);else{var Re=0,Ie=setInterval(function(){i.includes(Re)&&ne(),Re++},1e3);Ee(Ie)}return function(){return clearInterval(me)}},[Ne]),Object(U.useImperativeHandle)(d,function(){return{handlePhoto:ne}});var Ue=function(){Le(2)},ye=function(){var Ie=s/u,Ce=[];function He(Ze,ot){return parseInt(Math.floor(Math.random()*(ot-Ze+1))+Ze)}new Array(u).fill(0).map(function(Ze,ot){T?Ce.push(He(Ie*ot,Ie*(ot+1))):ot==0?Ce.push(0):Ce.push(He(Ie*ot,Ie*(ot+1)))}),i=Ce,x([].concat(Ce)),console.log(Ce)},ce=function(){navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(Ie){var Ce=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return Ce?new Promise(function(He,Ze){Ce.call(navigator,Ie,He,Ze)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({video:{width:640,height:480}}).then(function(Ie){h&&h(2),C(2),"srcObject"in w.current?w.current.srcObject=Ie:w.current.src=window.URL.createObjectURL(Ie),w.current.onloadedmetadata=function(Ce){w.current.play()},w.current.addEventListener("ended",function(){console.log("\u64AD\u653E\u7ED3\u675F"),Ue(),k.b.error({content:"\u60A8\u5DF2\u7ECF\u5173\u95ED\u4E86\u6444\u50CF\u5934\uFF0C\u8BF7\u572810\u79D2\u949F\u5185\u6062\u590D\u6444\u50CF\u5934\uFF0C\u5426\u5219\u5C06\u63A8\u51FA\u8003\u8BD5",duration:10,key:9998})},!1)}).catch(function(Ie){C(1),h&&h(1),Ie.message==="Permission denied"||Ie.name==="NotAllowedError"?k.b.error("\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"):k.b.error("\u6444\u50CF\u5934\u83B7\u53D6\u5931\u8D25\uFF0C\u6216\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"),console.log("errname: "+Ie.name),console.log("err: "+Ie.message)})},ne=function(){try{v.current.width=w.current.videoWidth,v.current.height=w.current.videoHeight;var Ie=v.current.getContext("2d");Ie.drawImage(w.current,0,0,v.current.width,v.current.height),j(v.current.toDataURL("image/png")),le(v.current.toDataURL("image/png"))}catch(Ce){}},ve=function(){try{var Ie=w.current.srcObject,Ce=Ie.getTracks();Ce.forEach(function(He){He.stop()}),w.current.srcObject=null}catch(He){}},le=function(){var Re=Object(ee.a)(O.a.mark(function Ie(Ce){var He,Ze;return O.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:He=new FormData,He.append("file",_(Ce,"1")),He.append("1","123"),Ze=new window.XMLHttpRequest,Ze.withCredentials=!0,Ze.addEventListener("load",function(Ke){var Ve=JSON.parse(Ke.target.responseText);Object(D.a)("/api/exercises/".concat(f,"/upload_photo.json"),{method:"post",body:{attachment_id:Ve.id}})},!1),Ze.addEventListener("error",function(Ke){console.error(Ke)},!1),Ze.open("POST","".concat(E.a.API_SERVER,"/api/attachments.json")),Ze.send(He);case 9:case"end":return et.stop()}},Ie)}));return function(Ce){return Re.apply(this,arguments)}}();return B.a.createElement(B.a.Fragment,null,L!==3&&B.a.createElement("aside",{className:P.a.video,id:"screenshot"},L===0&&B.a.createElement("span",null,"\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."),L===1&&B.a.createElement("span",null,"\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"),L===2&&B.a.createElement("div",null,B.a.createElement("video",{width:"288",ref:w,autoPlay:!0}),B.a.createElement("canvas",{style:{display:"none"},ref:v}))))});ke.a=S},"C+DQ":function($e,ke,F){},DR4n:function($e,ke,F){$e.exports={flex_box_center:"flex_box_center___2zmmW",flex_space_between:"flex_space_between___3nCIw",flex_box_vertical_center:"flex_box_vertical_center___1PFij",flex_box_center_end:"flex_box_center_end___2FA05",flex_box_column:"flex_box_column___2k0kx",video:"video___1mYnG"}},DlQD:function($e,ke,F){(function(ee,X){$e.exports=X()})(this,function(){"use strict";function ee(xe,he){for(var ge=0;ge<he.length;ge++){var re=he[ge];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(xe,re.key,re)}}function X(xe,he,ge){return he&&ee(xe.prototype,he),ge&&ee(xe,ge),xe}function k(xe,he){if(!xe)return;if(typeof xe=="string")return Q(xe,he);var ge=Object.prototype.toString.call(xe).slice(8,-1);if(ge==="Object"&&xe.constructor&&(ge=xe.constructor.name),ge==="Map"||ge==="Set")return Array.from(xe);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return Q(xe,he)}function Q(xe,he){(he==null||he>xe.length)&&(he=xe.length);for(var ge=0,re=new Array(he);ge<he;ge++)re[ge]=xe[ge];return re}function N(xe,he){var ge;if(typeof Symbol=="undefined"||xe[Symbol.iterator]==null){if(Array.isArray(xe)||(ge=k(xe))||he&&xe&&typeof xe.length=="number"){ge&&(xe=ge);var re=0;return function(){return re>=xe.length?{done:!0}:{done:!1,value:xe[re++]}}}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 ge=xe[Symbol.iterator](),ge.next.bind(ge)}function O(xe,he){return he={exports:{}},xe(he,he.exports),he.exports}var U=O(function(xe){function he(){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 ge(re){xe.exports.defaults=re}xe.exports={defaults:he(),getDefaults:he,changeDefaults:ge}}),B=U.defaults,I=U.getDefaults,D=U.changeDefaults,E=/[&<>"']/,R=/[&<>"']/g,P=/[<>"']|&(?!#?\w+;)/,_=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},y=function(he){return S[he]};function d(xe,he){if(he){if(E.test(xe))return xe.replace(R,y)}else if(P.test(xe))return xe.replace(_,y);return xe}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(xe){return xe.replace(s,function(he,ge){return ge=ge.toLowerCase(),ge==="colon"?":":ge.charAt(0)==="#"?ge.charAt(1)==="x"?String.fromCharCode(parseInt(ge.substring(2),16)):String.fromCharCode(+ge.substring(1)):""})}var h=/(^|[^\[])\^/g;function T(xe,he){xe=xe.source||xe,he=he||"";var ge={replace:function(ie,oe){return oe=oe.source||oe,oe=oe.replace(h,"$1"),xe=xe.replace(ie,oe),ge},getRegex:function(){return new RegExp(xe,he)}};return ge}var g=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(xe,he,ge){if(xe){var re;try{re=decodeURIComponent(u(ge)).replace(g,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}he&&!f.test(ge)&&(ge=i(he,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(ie){return null}return ge}var v={},c=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(xe,he){v[" "+xe]||(c.test(xe)?v[" "+xe]=xe+"/":v[" "+xe]=L(xe,"/",!0)),xe=v[" "+xe];var ge=xe.indexOf(":")===-1;return he.substring(0,2)==="//"?ge?he:xe.replace(l,"$1")+he:he.charAt(0)==="/"?ge?he:xe.replace(a,"$1")+he:xe+he}var x={exec:function(){}};function b(xe){for(var he=1,ge,re;he<arguments.length;he++){ge=arguments[he];for(re in ge)Object.prototype.hasOwnProperty.call(ge,re)&&(xe[re]=ge[re])}return xe}function m(xe,he){var ge=xe.replace(/\|/g,function(oe,ue,Oe){for(var we=!1,rt=ue;--rt>=0&&Oe[rt]==="\\";)we=!we;return we?"|":" |"}),re=ge.split(/ \|/),ie=0;if(re.length>he)re.splice(he);else for(;re.length<he;)re.push("");for(;ie<re.length;ie++)re[ie]=re[ie].trim().replace(/\\\|/g,"|");return re}function L(xe,he,ge){var re=xe.length;if(re===0)return"";for(var ie=0;ie<re;){var oe=xe.charAt(re-ie-1);if(oe===he&&!ge)ie++;else if(oe!==he&&ge)ie++;else break}return xe.substr(0,re-ie)}function C(xe,he){if(xe.indexOf(he[1])===-1)return-1;for(var ge=xe.length,re=0,ie=0;ie<ge;ie++)if(xe[ie]==="\\")ie++;else if(xe[ie]===he[0])re++;else if(xe[ie]===he[1]&&(re--,re<0))return ie;return-1}function H(xe){xe&&xe.sanitize&&!xe.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 J={escape:d,unescape:u,edit:T,cleanUrl:w,resolveUrl:i,noopTest:x,merge:b,splitCells:m,rtrim:L,findClosingBracket:C,checkSanitizeDeprecation:H},W=U.defaults,j=J.rtrim,$=J.splitCells,se=J.escape,me=J.findClosingBracket;function Ee(xe,he,ge){var re=he.href,ie=he.title?se(he.title):null,oe=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:ge,href:re,title:ie,text:oe}:{type:"image",raw:ge,href:re,title:ie,text:se(oe)}}function We(xe,he){var ge=xe.match(/^(\s+)(?:```)/);if(ge===null)return he;var re=ge[1];return he.split(`
|
|
`).map(function(ie){var oe=ie.match(/^\s+/);if(oe===null)return ie;var ue=oe[0];return ue.length>=re.length?ie.slice(re.length):ie}).join(`
|
|
`)}var Be=function(){function xe(ge){this.options=ge||W}var he=xe.prototype;return he.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},he.code=function(re,ie){var oe=this.rules.block.code.exec(re);if(oe){var ue=ie[ie.length-1];if(ue&&ue.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var Oe=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?Oe:j(Oe,`
|
|
`)}}},he.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var oe=ie[0],ue=We(oe,ie[3]||"");return{type:"code",raw:oe,lang:ie[2]?ie[2].trim():ie[2],text:ue}}},he.heading=function(re){var ie=this.rules.block.heading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},he.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var oe={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(oe.header.length===oe.align.length){var ue=oe.align.length,Oe;for(Oe=0;Oe<ue;Oe++)/^ *-+: *$/.test(oe.align[Oe])?oe.align[Oe]="right":/^ *:-+: *$/.test(oe.align[Oe])?oe.align[Oe]="center":/^ *:-+ *$/.test(oe.align[Oe])?oe.align[Oe]="left":oe.align[Oe]=null;for(ue=oe.cells.length,Oe=0;Oe<ue;Oe++)oe.cells[Oe]=$(oe.cells[Oe],oe.header.length);return oe}}},he.hr=function(re){var ie=this.rules.block.hr.exec(re);if(ie)return{type:"hr",raw:ie[0]}},he.blockquote=function(re){var ie=this.rules.block.blockquote.exec(re);if(ie){var oe=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:oe}}},he.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var oe=ie[0],ue=ie[2],Oe=ue.length>1,we=ue[ue.length-1]===")",rt={type:"list",raw:oe,ordered:Oe,start:Oe?+ue.slice(0,-1):"",loose:!1,items:[]},yt=ie[0].match(this.rules.block.item),wt=!1,xt,pt,Qe,ze,De,ae,de,Ye=yt.length,Me=0;Me<Ye;Me++)xt=yt[Me],oe=xt,pt=xt.length,xt=xt.replace(/^ *([*+-]|\d+[.)]) */,""),~xt.indexOf(`
|
|
`)&&(pt-=xt.length,xt=this.options.pedantic?xt.replace(/^ {1,4}/gm,""):xt.replace(new RegExp("^ {1,"+pt+"}","gm"),"")),Me!==Ye-1&&(Qe=this.rules.block.bullet.exec(yt[Me+1])[0],(Oe?Qe.length===1||!we&&Qe[Qe.length-1]===")":Qe.length>1||this.options.smartLists&&Qe!==ue)&&(ze=yt.slice(Me+1).join(`
|
|
`),rt.raw=rt.raw.substring(0,rt.raw.length-ze.length),Me=Ye-1)),De=wt||/\n\n(?!\s*$)/.test(xt),Me!==Ye-1&&(wt=xt.charAt(xt.length-1)===`
|
|
`,De||(De=wt)),De&&(rt.loose=!0),ae=/^\[[ xX]\] /.test(xt),de=void 0,ae&&(de=xt[1]!==" ",xt=xt.replace(/^\[[ xX]\] +/,"")),rt.items.push({type:"list_item",raw:oe,task:ae,checked:de,loose:De,text:xt});return rt}},he.html=function(re){var ie=this.rules.block.html.exec(re);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):se(ie[0]):ie[0]}},he.def=function(re){var ie=this.rules.block.def.exec(re);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var oe=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:ie[0],href:ie[2],title:ie[3]}}},he.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var oe={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(oe.header.length===oe.align.length){oe.raw=ie[0];var ue=oe.align.length,Oe;for(Oe=0;Oe<ue;Oe++)/^ *-+: *$/.test(oe.align[Oe])?oe.align[Oe]="right":/^ *:-+: *$/.test(oe.align[Oe])?oe.align[Oe]="center":/^ *:-+ *$/.test(oe.align[Oe])?oe.align[Oe]="left":oe.align[Oe]=null;for(ue=oe.cells.length,Oe=0;Oe<ue;Oe++)oe.cells[Oe]=$(oe.cells[Oe].replace(/^ *\| *| *\| *$/g,""),oe.header.length);return oe}}},he.lheading=function(re){var ie=this.rules.block.lheading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},he.paragraph=function(re){var ie=this.rules.block.paragraph.exec(re);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},he.text=function(re,ie){var oe=this.rules.block.text.exec(re);if(oe){var ue=ie[ie.length-1];return ue&&ue.type==="text"?{raw:oe[0],text:oe[0]}:{type:"text",raw:oe[0],text:oe[0]}}},he.escape=function(re){var ie=this.rules.inline.escape.exec(re);if(ie)return{type:"escape",raw:ie[0],text:se(ie[1])}},he.tag=function(re,ie,oe){var ue=this.rules.inline.tag.exec(re);if(ue)return!ie&&/^<a /i.test(ue[0])?ie=!0:ie&&/^<\/a>/i.test(ue[0])&&(ie=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:ie,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):se(ue[0]):ue[0]}},he.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var oe=me(ie[2],"()");if(oe>-1){var ue=ie[0].indexOf("!")===0?5:4,Oe=ue+ie[1].length+oe;ie[2]=ie[2].substring(0,oe),ie[0]=ie[0].substring(0,Oe).trim(),ie[3]=""}var we=ie[2],rt="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);yt?(we=yt[1],rt=yt[3]):rt=""}else rt=ie[3]?ie[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var wt=Ee(ie,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:rt&&rt.replace(this.rules.inline._escapes,"$1")},ie[0]);return wt}},he.reflink=function(re,ie){var oe;if((oe=this.rules.inline.reflink.exec(re))||(oe=this.rules.inline.nolink.exec(re))){var ue=(oe[2]||oe[1]).replace(/\s+/g," ");if(ue=ie[ue.toLowerCase()],!ue||!ue.href){var Oe=oe[0].charAt(0);return{type:"text",raw:Oe,text:Oe}}var we=Ee(oe,ue,oe[0]);return we}},he.strong=function(re,ie,oe){oe===void 0&&(oe="");var ue=this.rules.inline.strong.start.exec(re);if(ue&&(!ue[1]||ue[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*re.length);var Oe=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Oe.lastIndex=0;for(var we;(ue=Oe.exec(ie))!=null;)if(we=this.rules.inline.strong.middle.exec(ie.slice(0,ue.index+3)),we)return{type:"strong",raw:re.slice(0,we[0].length),text:re.slice(2,we[0].length-2)}}},he.em=function(re,ie,oe){oe===void 0&&(oe="");var ue=this.rules.inline.em.start.exec(re);if(ue&&(!ue[1]||ue[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*re.length);var Oe=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Oe.lastIndex=0;for(var we;(ue=Oe.exec(ie))!=null;)if(we=this.rules.inline.em.middle.exec(ie.slice(0,ue.index+2)),we)return{type:"em",raw:re.slice(0,we[0].length),text:re.slice(1,we[0].length-1)}}},he.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var oe=ie[2].replace(/\n/g," "),ue=/[^ ]/.test(oe),Oe=oe.startsWith(" ")&&oe.endsWith(" ");return ue&&Oe&&(oe=oe.substring(1,oe.length-1)),oe=se(oe,!0),{type:"codespan",raw:ie[0],text:oe}}},he.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},he.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},he.autolink=function(re,ie){var oe=this.rules.inline.autolink.exec(re);if(oe){var ue,Oe;return oe[2]==="@"?(ue=se(this.options.mangle?ie(oe[1]):oe[1]),Oe="mailto:"+ue):(ue=se(oe[1]),Oe=ue),{type:"link",raw:oe[0],text:ue,href:Oe,tokens:[{type:"text",raw:ue,text:ue}]}}},he.url=function(re,ie){var oe;if(oe=this.rules.inline.url.exec(re)){var ue,Oe;if(oe[2]==="@")ue=se(this.options.mangle?ie(oe[0]):oe[0]),Oe="mailto:"+ue;else{var we;do we=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(we!==oe[0]);ue=se(oe[0]),oe[1]==="www."?Oe="http://"+ue:Oe=ue}return{type:"link",raw:oe[0],text:ue,href:Oe,tokens:[{type:"text",raw:ue,text:ue}]}}},he.inlineText=function(re,ie,oe){var ue=this.rules.inline.text.exec(re);if(ue){var Oe;return ie?Oe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):se(ue[0]):ue[0]:Oe=se(this.options.smartypants?oe(ue[0]):ue[0]),{type:"text",raw:ue[0],text:Oe}}},xe}(),Ne=J.noopTest,Le=J.edit,Ue=J.merge,ye={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:Ne,table:Ne,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ye._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ye._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ye.def=Le(ye.def).replace("label",ye._label).replace("title",ye._title).getRegex(),ye.bullet=/(?:[*+-]|\d{1,9}[.)])/,ye.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ye.item=Le(ye.item,"gm").replace(/bull/g,ye.bullet).getRegex(),ye.list=Le(ye.list).replace(/bull/g,ye.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ye.def.source+")").getRegex(),ye._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",ye._comment=/<!--(?!-?>)[\s\S]*?-->/,ye.html=Le(ye.html,"i").replace("comment",ye._comment).replace("tag",ye._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye.paragraph=Le(ye._paragraph).replace("hr",ye.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",ye._tag).getRegex(),ye.blockquote=Le(ye.blockquote).replace("paragraph",ye.paragraph).getRegex(),ye.normal=Ue({},ye),ye.gfm=Ue({},ye.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*|$)"}),ye.gfm.nptable=Le(ye.gfm.nptable).replace("hr",ye.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",ye._tag).getRegex(),ye.gfm.table=Le(ye.gfm.table).replace("hr",ye.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",ye._tag).getRegex(),ye.pedantic=Ue({},ye.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ye._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:Ne,paragraph:Le(ye.normal._paragraph).replace("hr",ye.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ye.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ne,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:Ne,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ce._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ce.punctuation=Le(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=Le(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=Le(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=Le(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=Le(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=Le(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=Le(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=Le(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=Le(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=Le(ce._blockSkip,"g").getRegex(),ce.overlapSkip=Le(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=Le(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=Le(ce.tag).replace("comment",ye._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=Le(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=Le(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=Le(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=Ue({},ce),ce.pedantic=Ue({},ce.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=Ue({},ce.normal,{escape:Le(ce.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ce.gfm.url=Le(ce.gfm.url,"i").replace("email",ce.gfm._extended_email).getRegex(),ce.breaks=Ue({},ce.gfm,{br:Le(ce.br).replace("{2,}","*").getRegex(),text:Le(ce.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:ye,inline:ce},ve=U.defaults,le=ne.block,Re=ne.inline;function Ie(xe){return xe.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 Ce(xe){var he="",ge,re,ie=xe.length;for(ge=0;ge<ie;ge++)re=xe.charCodeAt(ge),Math.random()>.5&&(re="x"+re.toString(16)),he+="&#"+re+";";return he}var He=function(){function xe(ge){this.tokens=[],this.tokens.links=Object.create(null),this.options=ge||ve,this.options.tokenizer=this.options.tokenizer||new Be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:le.normal,inline:Re.normal};this.options.pedantic?(re.block=le.pedantic,re.inline=Re.pedantic):this.options.gfm&&(re.block=le.gfm,this.options.breaks?re.inline=Re.breaks:re.inline=Re.gfm),this.tokenizer.rules=re}xe.lex=function(re,ie){var oe=new xe(ie);return oe.lex(re)};var he=xe.prototype;return he.lex=function(re){return re=re.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},he.blockTokens=function(re,ie,oe){ie===void 0&&(ie=[]),oe===void 0&&(oe=!0),re=re.replace(/^ +$/gm,"");for(var ue,Oe,we,rt;re;){if(ue=this.tokenizer.space(re)){re=re.substring(ue.raw.length),ue.type&&ie.push(ue);continue}if(ue=this.tokenizer.code(re,ie)){re=re.substring(ue.raw.length),ue.type?ie.push(ue):(rt=ie[ie.length-1],rt.raw+=`
|
|
`+ue.raw,rt.text+=`
|
|
`+ue.text);continue}if(ue=this.tokenizer.fences(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.heading(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.nptable(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.hr(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.blockquote(re)){re=re.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],oe),ie.push(ue);continue}if(ue=this.tokenizer.list(re)){for(re=re.substring(ue.raw.length),we=ue.items.length,Oe=0;Oe<we;Oe++)ue.items[Oe].tokens=this.blockTokens(ue.items[Oe].text,[],!1);ie.push(ue);continue}if(ue=this.tokenizer.html(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(oe&&(ue=this.tokenizer.def(re))){re=re.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.lheading(re)){re=re.substring(ue.raw.length),ie.push(ue);continue}if(oe&&(ue=this.tokenizer.paragraph(re))){re=re.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.text(re,ie)){re=re.substring(ue.raw.length),ue.type?ie.push(ue):(rt=ie[ie.length-1],rt.raw+=`
|
|
`+ue.raw,rt.text+=`
|
|
`+ue.text);continue}if(re){var yt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return ie},he.inline=function(re){var ie,oe,ue,Oe,we,rt,yt=re.length;for(ie=0;ie<yt;ie++){rt=re[ie];switch(rt.type){case"paragraph":case"text":case"heading":{rt.tokens=[],this.inlineTokens(rt.text,rt.tokens);break}case"table":{for(rt.tokens={header:[],cells:[]},Oe=rt.header.length,oe=0;oe<Oe;oe++)rt.tokens.header[oe]=[],this.inlineTokens(rt.header[oe],rt.tokens.header[oe]);for(Oe=rt.cells.length,oe=0;oe<Oe;oe++)for(we=rt.cells[oe],rt.tokens.cells[oe]=[],ue=0;ue<we.length;ue++)rt.tokens.cells[oe][ue]=[],this.inlineTokens(we[ue],rt.tokens.cells[oe][ue]);break}case"blockquote":{this.inline(rt.tokens);break}case"list":{for(Oe=rt.items.length,oe=0;oe<Oe;oe++)this.inline(rt.items[oe].tokens);break}}}return re},he.inlineTokens=function(re,ie,oe,ue,Oe){ie===void 0&&(ie=[]),oe===void 0&&(oe=!1),ue===void 0&&(ue=!1),Oe===void 0&&(Oe="");var we,rt=re,yt;if(this.tokens.links){var wt=Object.keys(this.tokens.links);if(wt.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(rt))!=null;)wt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(rt=rt.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+rt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(rt))!=null;)rt=rt.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+rt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(we=this.tokenizer.escape(re)){re=re.substring(we.raw.length),ie.push(we);continue}if(we=this.tokenizer.tag(re,oe,ue)){re=re.substring(we.raw.length),oe=we.inLink,ue=we.inRawBlock,ie.push(we);continue}if(we=this.tokenizer.link(re)){re=re.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ue)),ie.push(we);continue}if(we=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ue)),ie.push(we);continue}if(we=this.tokenizer.strong(re,rt,Oe)){re=re.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],oe,ue),ie.push(we);continue}if(we=this.tokenizer.em(re,rt,Oe)){re=re.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],oe,ue),ie.push(we);continue}if(we=this.tokenizer.codespan(re)){re=re.substring(we.raw.length),ie.push(we);continue}if(we=this.tokenizer.br(re)){re=re.substring(we.raw.length),ie.push(we);continue}if(we=this.tokenizer.del(re)){re=re.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],oe,ue),ie.push(we);continue}if(we=this.tokenizer.autolink(re,Ce)){re=re.substring(we.raw.length),ie.push(we);continue}if(!oe&&(we=this.tokenizer.url(re,Ce))){re=re.substring(we.raw.length),ie.push(we);continue}if(we=this.tokenizer.inlineText(re,ue,Ie)){re=re.substring(we.raw.length),Oe=we.raw.slice(-1),ie.push(we);continue}if(re){var xt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(xt);break}else throw new Error(xt)}}return ie},X(xe,null,[{key:"rules",get:function(){return{block:le,inline:Re}}}]),xe}(),Ze=U.defaults,ot=J.cleanUrl,et=J.escape,Ke=function(){function xe(ge){this.options=ge||Ze}var he=xe.prototype;return he.code=function(re,ie,oe){var ue=(ie||"").match(/\S*/)[0];if(this.options.highlight){var Oe=this.options.highlight(re,ue);Oe!=null&&Oe!==re&&(oe=!0,re=Oe)}return ue?'<pre><code class="'+this.options.langPrefix+et(ue,!0)+'">'+(oe?re:et(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(oe?re:et(re,!0))+`</code></pre>
|
|
`},he.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},he.html=function(re){return re},he.heading=function(re,ie,oe,ue){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+ue.slug(oe)+'">'+re+"</h"+ie+`>
|
|
`:"<h"+ie+">"+re+"</h"+ie+`>
|
|
`},he.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},he.list=function(re,ie,oe){var ue=ie?"ol":"ul",Oe=ie&&oe!==1?' start="'+oe+'"':"";return"<"+ue+Oe+`>
|
|
`+re+"</"+ue+`>
|
|
`},he.listitem=function(re){return"<li>"+re+`</li>
|
|
`},he.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},he.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},he.table=function(re,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+ie+`</table>
|
|
`},he.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},he.tablecell=function(re,ie){var oe=ie.header?"th":"td",ue=ie.align?"<"+oe+' align="'+ie.align+'">':"<"+oe+">";return ue+re+"</"+oe+`>
|
|
`},he.strong=function(re){return"<strong>"+re+"</strong>"},he.em=function(re){return"<em>"+re+"</em>"},he.codespan=function(re){return"<code>"+re+"</code>"},he.br=function(){return this.options.xhtml?"<br/>":"<br>"},he.del=function(re){return"<del>"+re+"</del>"},he.link=function(re,ie,oe){if(re=ot(this.options.sanitize,this.options.baseUrl,re),re===null)return oe;var ue='<a href="'+et(re)+'"';return ie&&(ue+=' title="'+ie+'"'),ue+=">"+oe+"</a>",ue},he.image=function(re,ie,oe){if(re=ot(this.options.sanitize,this.options.baseUrl,re),re===null)return oe;var ue='<img src="'+re+'" alt="'+oe+'"';return ie&&(ue+=' title="'+ie+'"'),ue+=this.options.xhtml?"/>":">",ue},he.text=function(re){return re},xe}(),Ve=function(){function xe(){}var he=xe.prototype;return he.strong=function(re){return re},he.em=function(re){return re},he.codespan=function(re){return re},he.del=function(re){return re},he.html=function(re){return re},he.text=function(re){return re},he.link=function(re,ie,oe){return""+oe},he.image=function(re,ie,oe){return""+oe},he.br=function(){return""},xe}(),ht=function(){function xe(){this.seen={}}var he=xe.prototype;return he.slug=function(re){var ie=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var oe=ie;do this.seen[oe]++,ie=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},xe}(),mt=U.defaults,gt=J.unescape,Et=function(){function xe(ge){this.options=ge||mt,this.options.renderer=this.options.renderer||new Ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ve,this.slugger=new ht}xe.parse=function(re,ie){var oe=new xe(ie);return oe.parse(re)};var he=xe.prototype;return he.parse=function(re,ie){ie===void 0&&(ie=!0);var oe="",ue,Oe,we,rt,yt,wt,xt,pt,Qe,ze,De,ae,de,Ye,Me,Xe,dt,Pe,at=re.length;for(ue=0;ue<at;ue++){ze=re[ue];switch(ze.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline(ze.tokens),ze.depth,gt(this.parseInline(ze.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code(ze.text,ze.lang,ze.escaped);continue}case"table":{for(pt="",xt="",rt=ze.header.length,Oe=0;Oe<rt;Oe++)xt+=this.renderer.tablecell(this.parseInline(ze.tokens.header[Oe]),{header:!0,align:ze.align[Oe]});for(pt+=this.renderer.tablerow(xt),Qe="",rt=ze.cells.length,Oe=0;Oe<rt;Oe++){for(wt=ze.tokens.cells[Oe],xt="",yt=wt.length,we=0;we<yt;we++)xt+=this.renderer.tablecell(this.parseInline(wt[we]),{header:!1,align:ze.align[we]});Qe+=this.renderer.tablerow(xt)}oe+=this.renderer.table(pt,Qe);continue}case"blockquote":{Qe=this.parse(ze.tokens),oe+=this.renderer.blockquote(Qe);continue}case"list":{for(De=ze.ordered,ae=ze.start,de=ze.loose,rt=ze.items.length,Qe="",Oe=0;Oe<rt;Oe++)Me=ze.items[Oe],Xe=Me.checked,dt=Me.task,Ye="",Me.task&&(Pe=this.renderer.checkbox(Xe),de?Me.tokens.length>0&&Me.tokens[0].type==="text"?(Me.tokens[0].text=Pe+" "+Me.tokens[0].text,Me.tokens[0].tokens&&Me.tokens[0].tokens.length>0&&Me.tokens[0].tokens[0].type==="text"&&(Me.tokens[0].tokens[0].text=Pe+" "+Me.tokens[0].tokens[0].text)):Me.tokens.unshift({type:"text",text:Pe}):Ye+=Pe),Ye+=this.parse(Me.tokens,de),Qe+=this.renderer.listitem(Ye,dt,Xe);oe+=this.renderer.list(Qe,De,ae);continue}case"html":{oe+=this.renderer.html(ze.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(ze.tokens));continue}case"text":{for(Qe=ze.tokens?this.parseInline(ze.tokens):ze.text;ue+1<at&&re[ue+1].type==="text";)ze=re[++ue],Qe+=`
|
|
`+(ze.tokens?this.parseInline(ze.tokens):ze.text);oe+=ie?this.renderer.paragraph(Qe):Qe;continue}default:{var vt='Token with "'+ze.type+'" type was not found.';if(this.options.silent){console.error(vt);return}else throw new Error(vt)}}}return oe},he.parseInline=function(re,ie){ie=ie||this.renderer;var oe="",ue,Oe,we=re.length;for(ue=0;ue<we;ue++){Oe=re[ue];switch(Oe.type){case"escape":{oe+=ie.text(Oe.text);break}case"html":{oe+=ie.html(Oe.text);break}case"link":{oe+=ie.link(Oe.href,Oe.title,this.parseInline(Oe.tokens,ie));break}case"image":{oe+=ie.image(Oe.href,Oe.title,Oe.text);break}case"strong":{oe+=ie.strong(this.parseInline(Oe.tokens,ie));break}case"em":{oe+=ie.em(this.parseInline(Oe.tokens,ie));break}case"codespan":{oe+=ie.codespan(Oe.text);break}case"br":{oe+=ie.br();break}case"del":{oe+=ie.del(this.parseInline(Oe.tokens,ie));break}case"text":{oe+=ie.text(Oe.text);break}default:{var rt='Token with "'+Oe.type+'" type was not found.';if(this.options.silent){console.error(rt);return}else throw new Error(rt)}}}return oe},xe}(),ft=J.merge,Ct=J.checkSanitizeDeprecation,_e=J.escape,Se=U.getDefaults,Je=U.changeDefaults,nt=U.defaults;function Fe(xe,he,ge){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof he=="function"&&(ge=he,he=null),he=ft({},Fe.defaults,he||{}),Ct(he),ge){var re=he.highlight,ie;try{ie=He.lex(xe,he)}catch(we){return ge(we)}var oe=function(rt){var yt;if(!rt)try{yt=Et.parse(ie,he)}catch(wt){rt=wt}return he.highlight=re,rt?ge(rt):ge(null,yt)};if(!re||re.length<3)return oe();if(delete he.highlight,!ie.length)return oe();var ue=0;Fe.walkTokens(ie,function(we){we.type==="code"&&(ue++,setTimeout(function(){re(we.text,we.lang,function(rt,yt){if(rt)return oe(rt);yt!=null&&yt!==we.text&&(we.text=yt,we.escaped=!0),ue--,ue===0&&oe()})},0))}),ue===0&&oe();return}try{var Oe=He.lex(xe,he);return he.walkTokens&&Fe.walkTokens(Oe,he.walkTokens),Et.parse(Oe,he)}catch(we){if(we.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,he.silent)return"<p>An error occurred:</p><pre>"+_e(we.message+"",!0)+"</pre>";throw we}}Fe.options=Fe.setOptions=function(xe){return ft(Fe.defaults,xe),Je(Fe.defaults),Fe},Fe.getDefaults=Se,Fe.defaults=nt,Fe.use=function(xe){var he=ft({},xe);if(xe.renderer&&function(){var re=Fe.defaults.renderer||new Ke,ie=function(Oe){var we=re[Oe];re[Oe]=function(){for(var rt=arguments.length,yt=new Array(rt),wt=0;wt<rt;wt++)yt[wt]=arguments[wt];var xt=xe.renderer[Oe].apply(re,yt);return xt===!1&&(xt=we.apply(re,yt)),xt}};for(var oe in xe.renderer)ie(oe);he.renderer=re}(),xe.tokenizer&&function(){var re=Fe.defaults.tokenizer||new Be,ie=function(Oe){var we=re[Oe];re[Oe]=function(){for(var rt=arguments.length,yt=new Array(rt),wt=0;wt<rt;wt++)yt[wt]=arguments[wt];var xt=xe.tokenizer[Oe].apply(re,yt);return xt===!1&&(xt=we.apply(re,yt)),xt}};for(var oe in xe.tokenizer)ie(oe);he.tokenizer=re}(),xe.walkTokens){var ge=Fe.defaults.walkTokens;he.walkTokens=function(re){xe.walkTokens(re),ge&&ge(re)}}Fe.setOptions(he)},Fe.walkTokens=function(xe,he){for(var ge=N(xe),re;!(re=ge()).done;){var ie=re.value;he(ie);switch(ie.type){case"table":{for(var oe=N(ie.tokens.header),ue;!(ue=oe()).done;){var Oe=ue.value;Fe.walkTokens(Oe,he)}for(var we=N(ie.tokens.cells),rt;!(rt=we()).done;)for(var yt=rt.value,wt=N(yt),xt;!(xt=wt()).done;){var pt=xt.value;Fe.walkTokens(pt,he)}break}case"list":{Fe.walkTokens(ie.items,he);break}default:ie.tokens&&Fe.walkTokens(ie.tokens,he)}}},Fe.Parser=Et,Fe.parser=Et.parse,Fe.Renderer=Ke,Fe.TextRenderer=Ve,Fe.Lexer=He,Fe.lexer=He.lex,Fe.Tokenizer=Be,Fe.Slugger=ht,Fe.parse=Fe;var qe=Fe;return qe})},E7E6:function($e,ke){$e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHyq9cuaJZACHEJCklIOgHQUqZ0QIAACg/FB+//niPwxD/H3793QqwJkePHqW2tjaSUsKinCOibwWDwfVulcFIPgyIESm5FGfDhg0lBw8ehOM7qbe3dxIggCXAe58VgBOcts0AgP6XfwCACho2bBgNGTLEpZoYz6arq4vee2+PBooQosvv999y//33bzaegrMxGRBn5ZuQOpR77dq1dVB4BQCsQB8AgGB8JicY3RsAgNewYQO//EOHDnPdAtgttr1736cjR44g2VPl5eXXLF++HBYl74EBsbkJHnnkkZFQ/p6eHk3xdd2gpj6nuDxTlvAB8GufDAH+h+8Ga0A365133qHTp8/AkvwiGAx+3wt1ZUBMtsL69evLTpw4gZEfKH+THoC+z9WZkkQ3RwEQ7wLFf/2VY5yLE2yyKp6LfuHCBdq06W0A0j1kyJCG++6771S+C8mAJLUAukEPP/xw/ZUrVyb5/f4m+AAAgYia+iwCJsTSDuUMOMJD+7tB8e5Q3A/A9xzSS2DHjh0UiUQxWvY3zc3N/5VvWRUlIE888cSI9vZ2TfH7+v8AAD5A1m6QEKLPEcbIT/yl/AG8e9ERzreSmck/Go3S9u078MjOUCg018yzTsQdlIBgNOjw4cMTYAWSfv2VFcg4HBrvBsWdYLzHQYh3hWAJAAkHZyQQi8Xo1Vdfw4RirLKysvree++94ExOxlIt2JZes2bNmL5hUK37owehb6lE2r6M6gYpRxjKz90gYwpjNhac766uy9TRcYk6O7u09+7uborFpDYBWVVVRaNHj06YgNyyZSudPXsWP0S3BIPBN8zmaWd8zwICZzgSiUzs7e3VlL8PANUNwt+VRkaDBrpAcR8Af7s5IWZnY3k1LcxldHZ2UkdHh/bCZywxUf8DJNkGLhobJ9DUqVM1H+2DDz6kQ4cO4ZEfhUKhf81nvT0DyNq1a2+MxWJfIaIFRDSNiAKZJsVKS0v7h0KVBdDPChfzaJDdCnX5MixAJ3V2dmiK39UVB0DBgG5RuqB8tsrKSs1a4F11UzFq1draSqdPx5di4f9z5syhixcvaJOHRPRgKBS63+76mEkv74A8+OCDs7u7u39JRDfpC64mxdTSiEQIKtgZNtPKWeJeuXKlX/HjVgDW4FIfFJ39CwzTJQPFhuKPGDFCe1efhw8frv0v248VZtFbWlq02XRYkGuvvYY+/HAfulhvBIPBW2ysqumk8grImjVrvheLxf6DiEpgEcaPH081NWMIgmVn2HRbpn0AAMS7O3ErgPdLl+ATxLtFaoVtugQwQakUX1kCtJH6nA0AIzVBN2zTpk20f/9+gi7ATxFC7A8Gg58x8rxTcfIGyOrVq38gpQQcNG7cOLrhhhk8R2CxlaFMeuUf8AXiXaJsAMAnS7YA+r9LSkoslsz8Y6+++qpacoKHw6FQCBuy8hbyAsgDDzywuLe3dwPWHV133XU0eTIGojikkwD2Vaj+frIVwP/xfaaAYet0FgBdIPxieyXA4X/yySeVBTkfDAZH5rNsrgMCx3vNmjXvSSlnTJzYSDNmzMhn/T2RN37hVd9fdYGUD4D/w0IYAUD1+fUwAIBCm7zcunUr7dmjOek9oVAor/S6DsiaNWtui8ViL6HRliz5fME1nhWiAIDq7ytfYGA49BLBR8gU8Auv+vypukKDbREjRrZefPFF+CAyGAxa36FlpbGSnnEdkFWrVj1ARCumTZtGU6dOsaEK+U8Cw5z6ro8aDlXWAMOkmQL6+AoA/UiQsgQYsCimgB+Mhx9+uDgBWb169T4p5bTPfe6PtSHAQggAAL/8A5Nh8dEf9Tf6zZkChi4zWQAMZXNIlMDq1auLE5BVq1ZhM/KIW2/9U3JzdCSTAmKIMXkYVO8DGAEAs/T6OQC9H4DvOJiTAABBCIVCrvdy9CV1PfNVq1Zp6w5uv/3L5iSWQ+z4eiCsAxr41U+cGe7S9kWnCxjnzwQArAMHeyXAgNgMCIY6sXRBr/jKB4B1yAQAlkPoAUh2hAEAr+C1F4BsqTEgNgCC0aFjx47RsWPHNTjSBSg3+vnpukAAwI7Z4GyNzt8blwADkiMgODZm7969mu+AAEcYy6bVKFDyaBADYFw5vRCTAckBkMOHD9P773+gtWNtbS199rOfpQkTJrAV8IJm21QGBsQiIJhE+sMfdmnNcP3119PChQsZDJuU0kvJMCAWAMFI1IYNG7W1RwsWLKCZM2d6qU25LDZKgAGxAMiePXu14yrHjh1Ld955p43NwUl5TQIMiElA1GZ+vC9btkxzyDkMXgkwICYBuXjxIm3cuImtx+BlIqFmDIhJQM6cOUNbt/5e8zvgf3AY3BJgQEwCgnsl3n13Ozvng5uL/toxICYBiUZP0vbt22nRokU0ffr0IlGT4q0mA8KAFK/2G6g5A8KAGFCT4o3CgDAgxav9BmrOgDAgBtSkeKMwIAxI8Wq/gZozIAyIATUp3igMCANSvNpvoOYMCANiQE2KNwoDwoAUr/YbqDkDwoAYUJPijcKAMCDFq/0Gas6AMCAG1KR4ozAgDEjxar+BmjMgDIgBNSneKAwIA1K82m+g5gwIA2JATYo3CgPCgBSv9huoOQPCgBhQk+KNwoAwIMWr/QZqzoAwIAbUpHijMCAMSPFqv4GaMyAMiAE1Kd4oDAgDUrzab6DmDAgDYkBNijcKA8KAFK/2G6g5A8KAGFCT4o3CgDAgxav9BmrOgDAgBtTEu1FwrXZ3d7f2unLlivaO/6nbhHMtOQPCgOSqQ44/j8uKlPInw4Br8NKF6upqqqmpyal8DAgDkpMC2fUwFF0pv94a4DPuobcScC99U1OTdjW31cCAMCBWdcf0c+kAwP9hJZwIjY2NVFZWZjlpBoQBsaw8yQ+m8geUNYCFwPduBlgOWBBYEquBAWFATOmOVX/AVCY2RPb5fFRfX0/Dhg3LKTUGhAG5SoGc8Ady0tIMD8M6lJSUUGlpKQ0ZMqT/HaNYuVgOlSUDUqSA5MMfsAoJrAEgUAAABj0QVtM18hwDMkgB8Zo/kE0Z4S8oxU8GAHDkKzAgBQxIofgDSrlVV0j/669gyGUo1kl4GBCPA1Lo/oDeGtjhEzgJQ6q0GRCPAdLR0UHnz5/vnzl2an7AqqLl0x+wWuZcnmNAPATIxYsXKRqNuj5fkKxAgCCdQ5xPfyAXRbf6LAPiIUCOHDmiWQ43QiH6A27IJTkPBsRDgHzyySeW1x0lN2yq+YFC9wcYEBclsGrVKm3dw+0eAiQSiRC6WUYDIEg1IqS6R0bT4XjpJcAWxEOAYNVqa2srdXV19bcY+wP5xZcB8RAgShXgh2CiD36CV+cH8qu27uXOgHgQEPean3PKJgEGhAHJpiNF/T0DwoAUNQDZKs+AMCDZdKSov2dAGJCiBiBb5RkQBiSbjhT19wwIA1LUAGSrPAPCgGTTkaL+ngFhQIoagGyVZ0AYkGw6UlDfY/8MViHYtQKBAWFACgoAVVh13haW5ehf6hRGHBaHY3+wcDOXwIAwILnoj6PPqj336lxePQhGDqHDSudJkyblVEYGhAHJSYHseBj77pMtAf7OdDC10Xz56FGjkkqK58X9IBarUhCP4Rc/FQROnssLwcCCwJJYDWxB2IJY1Z2UzyVbA/1J7bZmZCCx4cOHUyAQMBAzfRQGhAExrUDKGqRylPN9Cgt2WcIxBxyjRo3K+fhRBoQBSQsIRoTS+QZGnGTT5Jl4AMO4ACH5lUt3KlX2DAgDchUEyjJYvbjGhJ5njKrfc68HARDYNc+RrawMSJEAAmVP1SVSd/plUxQnv9dbA3UIhQLCyXyNpM2ADDJAsk2gGVEKJ+KoY4hSdYvcsgZW6sWAFCAg+gk0vY/gBWugTmFJ5Rvw2bxWEI0/Y/2OLIt5FsI8iH6IVA+CHRNoFsUWb6y+S2sUBPpu0WA7mpQtiMcsCA6uVodX53vIFNYg2SdQUBSiNbDyo8CAeAiQc+fOUVtbm5V2zOkZdXtTcrdosFkDK0JiQDwEyOHDh7WRJieCmkBL1S2CpeCQWgIMiIcAsePwarcm0IoFKAbEQ4Cge4VuVraQbgIN1oGtQTbpmfueAfEQIFi+gQt02tvb+3fFubGcwpzKFFdsBsRDgCjVAyh4sTXIP4wMiAcByb9acAmUBBgQBoRpyCABBoQBYUAYkKslUAhLTVhz8y8BtiBsQfKvhR4uAQPCgHhYPZ0tGhaAYlj91KlT2vo3vDo6OrTVDGpFg9o0JoTYRkQHhRAfE9GOIUOGbFm+fHn2SSubqsCreW0SJCeTWQKAACsWDh06RGfOnNGG0y2GGBG9J4T4HRE9EwwGAY5jgQFxTLScMCSA24N37NhBuGrbiSCEaCGinwSDwTcdSd+JRDOlyU662xLPT37hcJi2b9/uGBgparXZ5/P9uLm5eYOdNWYLYqc0OS2t+7R161bNcmQKlZWVNGHCBKqpqaERI0YQ/sa5vmqpPzanXb58mS5evEgXLlzQtiMcP35c+ztTEEJsLCkp+cGKFSt22dEcDIgdUuQ0NAns27ePWlpaKN2pLA0NDRoUeFVXV1uS2qeffkrHjh3TXhkgvOzz+b7X3Ny81lImuocYkFwlWIDPY8ckfp3xwoiSesdqZfyajxkzxlSt8Gu/efNm+uijj1I+h2NI586dS6NHjzaVbrbIsFbwb7CfJ1UQQjwuhAg1Nzd3ZEsr3fcMiFXJFcBz6iTGZBiy7a3HyYhGIcHo1GuvvUZnz569SiITJ06kG2+80XYwkjMCKPB3jhw5kqpV3vf7/XetXLnygJUmY0CsSM2Dz2D+IBkEq6etwA9oamrKWkv4A88++6w2h6EP2CqwZMmSnK9AyFqApAiwJBs2bNCsYlKIEtGCUCiUkqBM+TAgZlshz/HVIdXJ3SM7D5owAgjyf+655wg+gT7A8txyyy1aVy0fAQ7966+/TqdPn07IXgixv6SkZOGKFSuuNnUZCsqA5KMVDeSp/AS9jwCldONY0mxdLJThpZdeumoId9q0abR48WLXjidNJ0aUDz7R/v37kyHZUlZW9sXly5d3GWgCLQoDYlRSDsXT39+h7yI5dYhEpmpgX31VVVVW/wO/0JgR14drrrmGbr75ZoekZC3Zt956iw4cSHQ9MAPf3Nz8Z0IIzMhnDQxIVhHZF0H5CcoqAAirfkIupVJ76zHvgBd8BrwbOaF97969tGXLloTsx48fT7feeqvndmLCCr/yyiva/Ik+CCG+HwwGf2FEhgyIESmZjAMTr/cR1Gc7/QSjRVIH0OlBABBWDqCDU75u3bqEI5Iw0XfHHXf0T/AZLZdb8eCzPf/889rCSBWEEJf8fv+M+++/P/X4sK5wDEgOLaXO6k2GwQ0/IbnY6tihZKtg5/56DOfq5xwA3ze+8Q0aNmxYDlJ0/tFLly7Rr3/96wSwhRDPB4PBr2bLnQHJJqG+7/XdIvU5H36C/pBqPQxOn8aIpR6/+x0W0A6E+fPn06xZswxKML/Rdu/eTe+8805CIfx+/x+tXLlye6aSMSBJ0lEHV+sdZgCRw/JsS5qh9xOUj2DUT7CUYZaH0Jc/evRofyw481//+tc953ekqwas/TPPPKPtPdF1tdYHg8HbGBADGoNxcwgvH90j/Pond42s+gkGqmo6CnyPp556KuFHYunSpdqaqkIKWL+1fv16fZExkjU50wQiWxAibVIp1VIJuxtf7yforYKdfoLdZUZ6WMaxc+fO/qQxGbhs2TInsnI8zd/85jfJk4g/DYVC/5wuYwaESBvTz7Y+yUzLqesLkq2C036CmTKaiYuuiX7GfN68eTR79mwzSXgm7q5du2jbNuzijQfMsAeDwc8wIBmayCog+rN69TDAOgyWgONYn3jiiYTq3HPPPXlbSpKrXLEUBd1FffD5fI3Nzc3HUqXNFoRI2+SDV6ag7vJItgpW5hNybWQ3n8cSdiwAVAHzHnfddZebRbA9r9/+9rcJ8yJ+v/87K1eufJgBySBqAAInHaNV6uBqPQxevvDSdg3SJYjdgXv27On/D5avz5kzx8ksHU8b/hT8Kl036xfBYPD7DIjjoh98Gbz88ssJSzW+9KUvub6M3W6pYrITk546QN4IBoO3MCB2S7oI0nv66acT5g4wcz5y5MiCrjnugsHMug6QT4LB4BQGpKCbNT+Ff+yxx6izs7M/829/+9tUXl6en8LYlGtXVxc9+uijekBOB4PBGgbEJgEXUzIPPPBAwuTpypUrC2b2PF07YVZ97dqB8xyEEFeCwWAZA1JMmm1TXRkQmwRpNBk+OM6opLwRj7tYLrcDA+KywHPMjp30HAVo5HEpZXk0Gv5mLEbffeGFF7Q1Crfz6e5GRJf3ODzM62ATnDlzZtzly50hIrFSSqmdRvbCCy9qOTIgDgrexqR5otBGYaqkotHopFis5ydE4h4pZYk+CwbEAYE7mCQvNbFRuKdOnQp0d3f/iCi2QkoqTZU0A2KjwF1Iihcr2iDkcDg8Rkr590TyL4moIlOSDIgNAnc5CV7ublHgUkpfJBL5KyL5MyllpZFkGBAjUvJWHN4wZaE9otHo9Fis50EpaZ6ZxxkQM9LyRlzecmuiHaSUQ8Lh8D8KIf8hnZ/BXSwTAi2QqHxog4GGiluN3nVSyrRbFLMlwxYkm4S8+f1gPPaHiOaFQqF3M0nc8I7CcDj8NSL5mJRyeC5NyIDkIr38PssHx6WQv5RSRCKRfyGSP8LnXJuIAclVgvl7frAcPVpSUiLnz5//y+nTp/+1ECLjfdQZFb6trW14d3f3k0TyK3Y1CwNilyTzk85gOLx6+vTr+y4IEi+UlpZ+q7a2tj2dNNMCgvVTkUjrK1LS5+1sCgbETmnmJ61Cvv6gvr6ebrxxbr/ghKCN9fUNtwohUt4ZkhIQLA8Jh8PPEskv290EDIjdEnU/vUK9QAcXAy1YMD/FBT/ipUAgcKcQoidZmlcBEp/8Cz8hpfymE6JnQJyQqvtp4uxi3E+I/d364NUr2IYPH0aLFi3STqxJFYQQT9fXB+5NvljnKkBaW1v/jUj+rVMiZ0Cckqz76RbKJZ44vmnx4kU0dOjQLEIS/97Q0PB3+kgJgLS2ti4SgjbBijglbgbEKcnmJ12vXwNdWVmpXUUNC5ItwHpISZ9raGhoUXH7AZFSVoTD4d1E8ppsCeXyPQOSi/S8+SzONX777bevug9QlXbSpEk0d+5c2+9Lx2F/O3bsSLjURy8hXA13ww0zTF4qKg4EAoFZQgjtKJd+QJzuWqmCMyDeVHI7SrVv3z5qaWlJe4VEQ0ODdmUCXtXV1ZayxCHauMYAr9bW1pRp4PDwGTOmU2Njo6U8iAa6WhogbW1tU3p6uvdLKf0WUzT8GANiWFQFGRG/6rjkMxwOZyw//AFYFpz1izvV0RWCr6BOwIdVwkAA/BwcOI07BgEF/s4URo8eTdOnT6eqKuv3tAshektKSqfV1tYe1AAJh8OrpIwF3WgRBsQNKec/DwCCZfKRSMSVwmAId9q0a7NeYW20MEL4VgcCgZCA7xGJhE9JKbN7MUZTzxCPAbFBiAWUBLpB8BOcAgVgXHvttVRTox15YFvATbj19YEaEQ6H75Qylng7o23ZXJ0QA+KgcD2aNEa6sCvRrmuw0X2qrw9QIFBPw4fntHY2o8SE8H1NtLa2/rJvq6wr4mVAXBGzpzJJXpqCa6MnT55M0WhUu5dFfy+kuo4O103AH8E5wIiP18iRVQSLgeun3QniVwBkK5Fc4E6GfOyPW3L2Qj6wGAcOHKCNGzdmLA4gaGpqokmTJpocknW6luL3IhxujUgp65zOSqXPFsQtSbubD0adcBkqLAJGnNTFqKm6Vcoa4CppLE3x6nUKQoioaG09gQkR186zZ0DcVVwncsO98QBA/8L8hJG75OfPn0+1tSlvGnCiqLmm2cWA5CrCQf487tJQICjLAKc7OcB3qKwcTrAKVVUjtbkN3Cjb0dHRHzV5qXkBiK6Lu1gF0EpuFRHKnAxDqok5ONAAAKNJAAJdJEz06e97P3jwE/rwww/7i47vliz5vOZsF0ro62Kxk14oDWZnOXFiorIIgAKf9b/2Ki+MJMVhiIMAKABDptt9r1zppjfffJO6u7v7iwwnHDv5CiuIrTzMW1gtZqm06BLpLQNgwDKO5IDh0zgI6CbFu0pGVsEmp7N37/sJCwiR7he+cHPavRiWKuXKQ+JXPFHoiqDdyQROMjYwKYugoIBTnRyw7ikOwQAQ2fdLZK8HLNPGjZsSJgWvv/56mjy5KfvDHoshhO9OXmrisUYxWhwMn2LkSHWT8I4hVgy3JoeKioo+fwFdJEAxgvA/J8L27YnLSgDdzTcvKbh7DfuXmkBIbi5WfPnl9drM6dKlt5qaFIpGT2qL37BtEqs1iylAXlB+vWU4e/ZsymXlUEjlK8Tfq1zr2qBMLS1bEppmzpw51NAQKLjm6l+siJK7udz9zTffokuXLmm/KmZGNIoFEDi2+sk2WAZ0m1JNuGEdkt55xmf3lmFcrfObN7doVk0F7PnAVtdCC1ctd0cF3Now9e677xKUfebMG7SNM0bDYAQEjnKqOYbkCTeMGGHkaMB5jvsOGG71SsCq3Z07/5BQHFj7UaOsbYzKb72SNkyhMG5tuT127Djt3r1b2355003Gl4DhbNht294lzMTOmjUrv/KzkHtnZ2dCFwmWIdUcA+YL1LAqfAV0k/C3fo7BQvaOPgLr9tZbGxKGiQOBAM2dO8fRfJ1JPM2W2z4r4vihDehCoJuFkRUc4FVXZ2wZGLodW7f+nmbMmEELFy50RjY2pYoupN55hpXA/5IDLEB8sm3AeQYMmeYYbCqirckMhklBCCTjoQ1KYm50tQ4fPkI4whJnFC1ceJOhNf1QMPxKYXHbsmXLbG3gXBLDdtDkYVVYi+Sg5hj0s89O7mXIpU5mnh08k4IaIpmP/enrajl6cJwSvhoOxHj87NmztL3JmQL65a+99ro2O3v33Xdr+wLcDnCWk4dVU024AfyBOYb47LOZAQm365VLfoNlUtDwwXF9kDh29KhqDAxdAhL4FghTpkymadOmZexefPDBh3To0CHCcS633XZbLu2a8Vk1x6B3oNHF0y+dUAlgL4PyFdTsc0WFa4ujHZOBkYQHz6SgiaNHlWCcOrw6WfAHDx6kffv2a0ulq6tH0nXXXZfWOij/Be84DAxj7LkG/RyDAiJ5l5vKA3MMybPPsIDFGgbDpKClw6tVgztx/UEqZTp79lPauXMnqb47xs+bmiYRlkcnO6zo4mA0C0DNnDmT5s2bZ3iER23q0VsGjNtn3tQz4ECnO9e1GAEZHJOCOVx/oLMktl6gk06ZYBUOHTqsLXJTa4fQfRk7dqw2lg6fQ60VOnGild577z1NsfGLPnv2bJo4caK2f1kF/aYe5TfAh0g1xzBkSCmNHFmtnYyhhlXV+UzFqPxG6vz225sTDq4upEnB+KU54mf19fU/zukCHb2g7LqCLZvw0eXBpBOGDtHH1Yd4f79KO2AM8WAJlJMMSwOA8B0sUaqRJKSFoVXEw2gYTsUAEF6acMsmHy98X8iTgkKIdiLx54FAwNBJPqauVLPjEk8zDYzuD7pf8Alg0lOtSs2UHqABVJhbqKsbq3XZuJtkpgWujgurjXks/Q9QoUwKCiH2+Xz+u+vq6t43KgVTgCBRXAMdiUR+RBT7oZVroI0WLFW89vZL1N5+kTD2DljQLevuxnuPZgUw2xyfbxhB1dWjqFhGk3KRqdlnjx8/Trt27e5/rBB2CgpB3US+n9fX1/9MCHH12v8MQjANiEorbk16HpSS5pkVMscvXAmoSV5VA6/vFBSCtvl8JSvMWA1961gGpM+a+CKRyHeJ5E+llJWF2+xccqMSgNXetm2b1vXFwMn8+fP6D5w2moYb8YQQF4nEP9XX1/9P8q1RZvLPCRCVUTgcHiOl/CGR/AsicmYnjplacVzHJYAhc4+O9HUSif8VQvw8EAiczlUQtgCiCnHq1KlAd3f3PxHFvuO2f5KrIPj5wpZAn5/xUGlp6U9ramoy371goqq2AqLyPXnyZFNvb/ePicQ9uDHXRHk4KkvAlATiN9PKp3y+kp/U1dUdNvWwgciOAKLyPXPmzLjLlztDRGKllNLe8+kNVI6jDF4JCCFOE8m1ZWUVq0aPHn3CqZo6CogqNNZ1RaPhb8Zi9D0iWXi7nZySPqdrQQJit89H/11XF3haCNFlIQFTj7gCiL5E4XB4MZEMEdEdUsps9/KaqgxHHpwSEELg/NLnicSqQCCw2c1aug6IqhwWQvb09HyVSH6LiL7Ivoqbze79vOK+Bf0fkXiypKTkudra2sR1Ry5VIW+A6OsXjUZre3t778DBmPAAAAI6SURBVO6DZb5LdedsvCmBdwCF3+9fV1dXF98slMfgCUCSumCNQsgvSymXSklLeF4lj9rhTtadQtAGIcR6KbWNS0fdydZYLp4DRF9snLQSjUZvjsViS4Wg26SUVi++NiYNjuWKBIQQR6Wkl30+3/q6urq3hBBXb+J3pSTZM/E0IMnFj0Qi10kp/4QotphILJJSjs1eRY6RbwkIIU4SyRYi32YhxBv19fUD9yLku3BZ8i8oQJLrcurUiWt6e8Wi3l7CyBiO8JvicXkXS/EOEokWv582+/2ypaZm3IFCrXhBA5Is9La2trqenp6biGi2lJhv0eZcxhVq4xRIuU8Qid1CCKyB31VSUrK1trY2WiBlz1rMQQVIqtpeuHBidEcHzZIy/iLSXtfyWrGsupEQIb7WiT4iot1CxF9Dh9LuESPGnTGXUmHFHvSApGoOzLm0tbU19vb2TpVSThGCphLJKVLSVCFoYrHCAwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function($e,ke,F){(function(ee){ee(F("VrN/"))})(function(ee){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(S,y,d){d&&d!=ee.Init&&(S.removeKeyMap(N),S.state.closeBrackets=null),y&&(O(Q(y,"pairs")),S.state.closeBrackets=y,S.addKeyMap(N))});function Q(S,y){return y=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[y]!=null?S[y]:X[y]}var N={Backspace:I,Enter:D};function O(S){for(var y=0;y<S.length;y++){var d=S.charAt(y),s="'"+d+"'";N[s]||(N[s]=U(d))}}O(X.pairs+"`");function U(S){return function(y){return R(y,S)}}function B(S){var y=S.state.closeBrackets;if(!y||y.override)return y;var d=S.getModeAt(S.getCursor());return d.closeBrackets||y}function I(S){var y=B(S);if(!y||S.getOption("disableInput"))return ee.Pass;for(var d=Q(y,"pairs"),s=S.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return ee.Pass;var h=P(S,s[u].head);if(!h||d.indexOf(h)%2!=0)return ee.Pass}for(var u=s.length-1;u>=0;u--){var T=s[u].head;S.replaceRange("",k(T.line,T.ch-1),k(T.line,T.ch+1),"+delete")}}function D(S){var y=B(S),d=y&&Q(y,"explode");if(!d||S.getOption("disableInput"))return ee.Pass;for(var s=S.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return ee.Pass;var h=P(S,s[u].head);if(!h||d.indexOf(h)%2!=0)return ee.Pass}S.operation(function(){var T=S.lineSeparator()||`
|
|
`;S.replaceSelection(T+T,null),S.execCommand("goCharLeft"),s=S.listSelections();for(var g=0;g<s.length;g++){var f=s[g].head.line;S.indentLine(f,null,!0),S.indentLine(f+1,null,!0)}})}function E(S){var y=ee.cmpPos(S.anchor,S.head)>0;return{anchor:new k(S.anchor.line,S.anchor.ch+(y?-1:1)),head:new k(S.head.line,S.head.ch+(y?1:-1))}}function R(S,y){var d=B(S);if(!d||S.getOption("disableInput"))return ee.Pass;var s=Q(d,"pairs"),u=s.indexOf(y);if(u==-1)return ee.Pass;for(var h=Q(d,"closeBefore"),T=Q(d,"triples"),g=s.charAt(u+1)==y,f=S.listSelections(),w=u%2==0,v,c=0;c<f.length;c++){var l=f[c],a=l.head,i,x=S.getRange(a,k(a.line,a.ch+1));if(w&&!l.empty())i="surround";else if((g||!w)&&x==y)g&&_(S,a)?i="both":T.indexOf(y)>=0&&S.getRange(a,k(a.line,a.ch+3))==y+y+y?i="skipThree":i="skip";else if(g&&a.ch>1&&T.indexOf(y)>=0&&S.getRange(k(a.line,a.ch-2),a)==y+y){if(a.ch>2&&/\bstring/.test(S.getTokenTypeAt(k(a.line,a.ch-2))))return ee.Pass;i="addFour"}else if(g){var b=a.ch==0?" ":S.getRange(k(a.line,a.ch-1),a);if(!ee.isWordChar(x)&&b!=y&&!ee.isWordChar(b))i="both";else return ee.Pass}else if(w&&(x.length===0||/\s/.test(x)||h.indexOf(x)>-1))i="both";else return ee.Pass;if(!v)v=i;else if(v!=i)return ee.Pass}var m=u%2?s.charAt(u-1):y,L=u%2?y:s.charAt(u+1);S.operation(function(){if(v=="skip")S.execCommand("goCharRight");else if(v=="skipThree")for(var C=0;C<3;C++)S.execCommand("goCharRight");else if(v=="surround"){for(var H=S.getSelections(),C=0;C<H.length;C++)H[C]=m+H[C]+L;S.replaceSelections(H,"around"),H=S.listSelections().slice();for(var C=0;C<H.length;C++)H[C]=E(H[C]);S.setSelections(H)}else v=="both"?(S.replaceSelection(m+L,null),S.triggerElectric(m+L),S.execCommand("goCharLeft")):v=="addFour"&&(S.replaceSelection(m+m+m+m,"before"),S.execCommand("goCharRight"))})}function P(S,y){var d=S.getRange(k(y.line,y.ch-1),k(y.line,y.ch+1));return d.length==2?d:null}function _(S,y){var d=S.getTokenAt(k(y.line,y.ch+1));return/\bstring/.test(d.type)&&d.start==y.ch&&(y.ch==0||!/\bstring/.test(S.getTokenTypeAt(y)))}})},FOrL:function($e,ke,F){$e.exports=F.p+"static/nodata.a6b3f948.png"},FPkq:function($e,ke,F){$e.exports=F.p+"static/qrCode.dd0fe9b2.png"},GABl:function($e,ke){$e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYcApx1xsV6XLt2nWl43kyQqyB38dQJPZ7MY56qdLsHGIL/iY3m24R0p2jc6BDZrkVHf3XTiBFfMy9PdbSgNotCYv6kDAPGVhCTT3vz3zCNT7o9PhHJsRoIwUJN518TS0qKrWI62q4xQ/H5uTsB+Q3I0521zrcfGf/KuTMDBrguXar7or2mSuCCRm1q4t6SN5sGOGZBTQ9DsRdgJEFpQeo8pRvRJe/MYeMUMe2lYlQczl4cBki7jT78DyCVTN32qfkuRJC8Mrd3nSGNzYoa5wYm+P5kvivv43kakBdbbWTk1zqRnlBa6jdt8j4UR1Fx9WQAUyG4aqtEUIHYBWJh4ay4dQ28ciBjJiAvR5Qx8jtEOROZsuliSFBCQc4LSvBs4xogLjmjolPLH156VLKyok4ePuKHyK1XOSN/0Bz6PUlFRaXmuzELLrmNYHCVQO6wEhjBT5zReHj99LiToUwdGPIYgNesYMPE8hDTtq0JCYovyD0KkVuaGZHvnfb6xpjPTnk8o5WS91qSNC2bo+fWZiqq1RDpZDOggMPhHPHuzKi99aIy8gHx2uQwJ9t69tr2IBPfyr3TqJPPwxE4dGScGp+//XKB2CIiQ6/YcXP3faUjGjITNII7IxBTT0eeitJjB6yfyUr5MrMrLtT6IXDZFHUWaTd0Y8LKieOVEb6JkjgwOCbTvTY726j0eFINwT4RcYRi0LVfJZeUfGqumeKimgNWp1kbQX7w/pxOmaEsHRw6BaKW2BRkBjWQCQUTFylR01td9ODjgRzfq6Gp18ezSEGmEyxJ3lfaz3w2en7VNKUQen+tQ9O0ezfMiv1QjmZcj1oJQGBvl09tKl0Fuf8Rkd+1Koj4NkqPS/lq3D+/PztoUNcLF6oOQ7AweV/p8yZm5LyqveGqWSTiSK4pnB33UH2WMtZAJMsWD7HIFHRQRFLbBnLR6Rzfk6G15PFM05R2NHFf8RazzwSDqs0Dl52ACJ6PuTm229psXhJ/xjQosZl5vs/4/NxKQNpegERQd7B3xVjfIcnK0iuPHYtOLC6uHjW/dqQoo9BO0O3ZRkfpt6+bEXNY/BmZUPJ+e/bN3pM76crPrRVIdHtAkpsDXl+oqjWMUfOrpoiC/cXbhjPqWnrhU7E75NB9dyFYt6+9uFq838/4gpwfILjOCpBkZsDr+6DBduTcmomAWmYFa9VGc3DQhplxn4h/aAqU+sIqLmRHfkZXQU6ZCG63AiRZlpQa1bu4/9K6UEGYXzMESm2zgrVqQ2i3FM6JPS7+jIEwT832xi668nN2CPBbqziN2lOV3uULTPusl6uTahTKIZFuKpt7JXGm36y4hDxSiX/YI1DG61bjupyhzaag1QJkWwfyrO6MSqkYu/QbEzNqXvV2EbnXOr51S2p4o3BWJ3Nja5btAohMsMfLV80qtxCQGXaAJJcEvL5pJmb0vJpxStRKO/hwtuYunE7ds+HJ6P1yfEwXVJ+vgCDWFi8xg64Vk7JFGattAg2nw9n35NjX92etEb32qxpzn3dNWSKxvHB2p0n12RkyHYJFtmIyjXUtnT3eye1Sc16+gUC3Q0CyJCk1aqBZIB6YKzfVsdrcMSTY4WiwJbC/C+J+vWIOq0TyHPDvNI8rKba4iBpERXUNHR9cBTkfi9j/LEJqLwW8y582OR6Ye7FXHYx3gTDnpjYiM8U4o5nZeCbyD50BpRbaEmMaE1uZtn3Y5fPQxGch6gXbJKDSdW1ExfhlW0zsmAXSxQjW+ARy1X1ZS+76k6vkd5G4J8zMhKZa2ahuqKs+DPOLn91BPsK0bctCghJXTLrDUMoPiO3PJAQvApwSyFme3xDD6PmXPCJ1MwA+KCI/axqbWZpBFFJ3LDYLQNN3cnDIEgim2NWC+unmYsqmc42XEq6C3FUiEtrpRjIIzBscm/mMeXZqih+9UOIhNbeFMhBkRb/ZMV+afaalDykb3gdBowRi/0cFtcVM2xqq1FcErZyYKoZ8FkmWGoMjjwGy6MaYTsv82a9eaOuHue2DJ6KP3P/KxQYbOThkB8R6g2/i8xwcsbfyjsJQX2x50XhNWboigGcBrKam7RKRMqce+vodYwiSIOihREYAPN5wJJGDGdkQsdc6Gpxp/AtTt/2t4c9mghIKJvcU1O0VQVQk084yhjgHxKac9i45I+VZsTj3/SGI/MIyvjF6VqBrbAoTC6vDCjIfulZM/KMo9YptchsAEk8HvPkvhdbVwYznIJJnA97EVBvLXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function($e,ke){$e.exports=function(ee,X,k,Q){var N=k?k.call(Q,ee,X):void 0;if(N!==void 0)return!!N;if(ee===X)return!0;if(typeof ee!="object"||!ee||typeof X!="object"||!X)return!1;var O=Object.keys(ee),U=Object.keys(X);if(O.length!==U.length)return!1;for(var B=Object.prototype.hasOwnProperty.bind(X),I=0;I<O.length;I++){var D=O[I];if(!B(D))return!1;var E=ee[D],R=X[D];if(N=k?k.call(Q,E,R,D):void 0,N===!1||N===void 0&&E!==R)return!1}return!0}},HmJG:function($e,ke,F){},HpTS:function($e,ke,F){$e.exports=F.p+"static/small_program.f74069ec.png"},I8Z2:function($e,ke,F){"use strict";F.d(ke,"a",function(){return Q}),F.d(ke,"b",function(){return P}),F.d(ke,"c",function(){return S});var ee=F("q1tI"),X=function(){var y=function(d,s){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var T in h)h.hasOwnProperty(T)&&(u[T]=h[T])},y(d,s)};return function(d,s){y(d,s);function u(){this.constructor=d}d.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),k=ee.createContext(null),Q=function(y){X(d,y);function d(){return y!==null&&y.apply(this,arguments)||this}return d.prototype.render=function(){return ee.createElement(k.Provider,{value:this.props.store},this.props.children)},d}(ee.Component),N=F("Gytx"),O=F.n(N),U=F("2mql"),B=F.n(U),I=function(){var y=function(d,s){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var T in h)h.hasOwnProperty(T)&&(u[T]=h[T])},y(d,s)};return function(d,s){y(d,s);function u(){this.constructor=d}d.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),D=function(){return D=Object.assign||function(y){for(var d,s=1,u=arguments.length;s<u;s++){d=arguments[s];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(y[h]=d[h])}return y},D.apply(this,arguments)};function E(y){return y.displayName||y.name||"Component"}var R=function(){return{}};function P(y,d){d===void 0&&(d={});var s=!!y,u=y||R;return function(T){var g=function(w){I(v,w);function v(c,l){var a=w.call(this,c,l)||this;return a.unsubscribe=null,a.handleChange=function(){if(!a.unsubscribe)return;var i=u(a.store.getState(),a.props);a.setState({subscribed:i})},a.store=a.context,a.state={subscribed:u(a.store.getState(),c),store:a.store,props:c},a}return v.getDerivedStateFromProps=function(c,l){return y&&y.length===2&&c!==l.props?{subscribed:u(l.store.getState(),c),props:c}:{props:c}},v.prototype.componentDidMount=function(){this.trySubscribe()},v.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},v.prototype.shouldComponentUpdate=function(c,l){return!O()(this.props,c)||!O()(this.state.subscribed,l.subscribed)},v.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},v.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},v.prototype.render=function(){var c=D(D(D({},this.props),this.state.subscribed),{store:this.store});return ee.createElement(T,D({},c,{ref:this.props.miniStoreForwardedRef}))},v.displayName="Connect("+E(T)+")",v.contextType=k,v}(ee.Component);if(d.forwardRef){var f=ee.forwardRef(function(w,v){return ee.createElement(g,D({},w,{miniStoreForwardedRef:v}))});return B()(f,T)}return B()(g,T)}}var _=function(){return _=Object.assign||function(y){for(var d,s=1,u=arguments.length;s<u;s++){d=arguments[s];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(y[h]=d[h])}return y},_.apply(this,arguments)};function S(y){var d=y,s=[];function u(g){d=_(_({},d),g);for(var f=0;f<s.length;f++)s[f]()}function h(){return d}function T(g){return s.push(g),function(){var w=s.indexOf(g);s.splice(w,1)}}return{setState:u,getState:h,subscribe:T}}},IBYe:function($e,ke,F){"use strict";function ee(X){return null}ke.a=ee},J66h:function($e,ke,F){(function(ee){var X,k;(function(Q,N){$e.exports=N(Q)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ee!="undefined"?ee:this,function(Q){"use strict";Q=Q||{};var N=Q.Base64,O="2.6.4",U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=function(m){for(var L={},C=0,H=m.length;C<H;C++)L[m.charAt(C)]=C;return L}(U),I=String.fromCharCode,D=function(m){if(m.length<2){var L=m.charCodeAt(0);return L<128?m:L<2048?I(192|L>>>6)+I(128|L&63):I(224|L>>>12&15)+I(128|L>>>6&63)+I(128|L&63)}else{var L=65536+(m.charCodeAt(0)-55296)*1024+(m.charCodeAt(1)-56320);return I(240|L>>>18&7)+I(128|L>>>12&63)+I(128|L>>>6&63)+I(128|L&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,R=function(m){return m.replace(E,D)},P=function(m){var L=[0,2,1][m.length%3],C=m.charCodeAt(0)<<16|(m.length>1?m.charCodeAt(1):0)<<8|(m.length>2?m.charCodeAt(2):0),H=[U.charAt(C>>>18),U.charAt(C>>>12&63),L>=2?"=":U.charAt(C>>>6&63),L>=1?"=":U.charAt(C&63)];return H.join("")},_=Q.btoa&&typeof Q.btoa=="function"?function(m){return Q.btoa(m)}:function(m){if(m.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return m.replace(/[\s\S]{1,3}/g,P)},S=function(m){return _(R(String(m)))},y=function(m){return m.replace(/[+\/]/g,function(L){return L=="+"?"-":"_"}).replace(/=/g,"")},d=function(m,L){return L?y(S(m)):S(m)},s=function(m){return d(m,!0)},u;Q.Uint8Array&&(u=function(m,L){for(var C="",H=0,J=m.length;H<J;H+=3){var W=m[H],j=m[H+1],$=m[H+2],se=W<<16|j<<8|$;C+=U.charAt(se>>>18)+U.charAt(se>>>12&63)+(typeof j!="undefined"?U.charAt(se>>>6&63):"=")+(typeof $!="undefined"?U.charAt(se&63):"=")}return L?y(C):C});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=function(m){switch(m.length){case 4:var L=(7&m.charCodeAt(0))<<18|(63&m.charCodeAt(1))<<12|(63&m.charCodeAt(2))<<6|63&m.charCodeAt(3),C=L-65536;return I((C>>>10)+55296)+I((C&1023)+56320);case 3:return I((15&m.charCodeAt(0))<<12|(63&m.charCodeAt(1))<<6|63&m.charCodeAt(2));default:return I((31&m.charCodeAt(0))<<6|63&m.charCodeAt(1))}},g=function(m){return m.replace(h,T)},f=function(m){var L=m.length,C=L%4,H=(L>0?B[m.charAt(0)]<<18:0)|(L>1?B[m.charAt(1)]<<12:0)|(L>2?B[m.charAt(2)]<<6:0)|(L>3?B[m.charAt(3)]:0),J=[I(H>>>16),I(H>>>8&255),I(H&255)];return J.length-=[0,0,2,1][C],J.join("")},w=Q.atob&&typeof Q.atob=="function"?function(m){return Q.atob(m)}:function(m){return m.replace(/\S{1,4}/g,f)},v=function(m){return w(String(m).replace(/[^A-Za-z0-9\+\/]/g,""))},c=function(m){return g(w(m))},l=function(m){return String(m).replace(/[-_]/g,function(L){return L=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},a=function(m){return c(l(m))},i;Q.Uint8Array&&(i=function(m){return Uint8Array.from(v(l(m)),function(L){return L.charCodeAt(0)})});var x=function(){var m=Q.Base64;return Q.Base64=N,m};if(Q.Base64={VERSION:O,atob:v,btoa:_,fromBase64:a,toBase64:d,utob:R,encode:d,encodeURI:s,btou:g,decode:a,noConflict:x,fromUint8Array:u,toUint8Array:i},typeof Object.defineProperty=="function"){var b=function(m){return{value:m,enumerable:!1,writable:!0,configurable:!0}};Q.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",b(function(){return a(this)})),Object.defineProperty(String.prototype,"toBase64",b(function(m){return d(this,m)})),Object.defineProperty(String.prototype,"toBase64URI",b(function(){return d(this,!0)}))}}return Q.Meteor&&(Base64=Q.Base64),$e.exports?$e.exports.Base64=Q.Base64:!(X=[],k=function(){return Q.Base64}.apply(ke,X),k!==void 0&&($e.exports=k)),{Base64:Q.Base64}})}).call(this,F("IyRk"))},JWDV:function($e,ke,F){$e.exports=F.p+"static/charpter-white.5fa14f93.svg"},JeFH:function($e,ke){$e.exports="data:image/png;base64,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"},Jq4h:function($e,ke,F){$e.exports=F.p+"static/qrcode.54870d9b.png"},LdHM:function($e,ke,F){"use strict";F.d(ke,"b",function(){return h}),F.d(ke,"a",function(){return g});var ee=F("1OyB"),X=F("vuIU"),k=F("Ji7U"),Q=F("LK+K"),N=F("q1tI"),O=F("rePB"),U=F("Ff2n"),B=F("ODXe"),I=F("4IlW"),D=F("bX4T"),E=F("YrtM"),R=F("TSYQ"),P=F.n(R),_=F("+nKL"),S=F("8OUc"),y=function($,se){var me=$.prefixCls,Ee=$.id,We=$.flattenOptions,Be=$.childrenAsData,Ne=$.values,Le=$.searchValue,Ue=$.multiple,ye=$.defaultActiveFirstOption,ce=$.height,ne=$.itemHeight,ve=$.notFoundContent,le=$.open,Re=$.menuItemSelectedIcon,Ie=$.virtual,Ce=$.onSelect,He=$.onToggleOpen,Ze=$.onActiveValue,ot=$.onScroll,et=$.onMouseEnter,Ke="".concat(me,"-item"),Ve=Object(E.a)(function(){return We},[le,We],function(qe,xe){return xe[0]&&qe[1]!==xe[1]}),ht=N.useRef(null),mt=function(xe){xe.preventDefault()},gt=function(xe){ht.current&&ht.current.scrollTo({index:xe})},Et=function(xe){for(var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=Ve.length,re=0;re<ge;re+=1){var ie=(xe+re*he+ge)%ge,oe=Ve[ie],ue=oe.group,Oe=oe.data;if(!ue&&!Oe.disabled)return ie}return-1},ft=N.useState(function(){return Et(0)}),Ct=Object(B.a)(ft,2),_e=Ct[0],Se=Ct[1],Je=function(xe){Se(xe);var he=Ve[xe];if(!he){Ze(null,-1);return}Ze(he.data.value,xe)};N.useEffect(function(){Je(ye!==!1?Et(0):-1)},[Ve.length,Le]),N.useEffect(function(){var qe=setTimeout(function(){if(!Ue&&le&&Ne.size===1){var xe=Array.from(Ne)[0],he=Ve.findIndex(function(ge){var re=ge.data;return re.value===xe});Je(he),gt(he)}});return function(){return clearTimeout(qe)}},[le]);var nt=function(xe){xe!==void 0&&Ce(xe,{selected:!Ne.has(xe)}),Ue||He(!1)};if(N.useImperativeHandle(se,function(){return{onKeyDown:function(xe){var he=xe.which;switch(he){case I.a.UP:case I.a.DOWN:{var ge=0;if(he===I.a.UP?ge=-1:he===I.a.DOWN&&(ge=1),ge!==0){var re=Et(_e+ge,ge);gt(re),Je(re)}break}case I.a.ENTER:{var ie=Ve[_e];ie&&!ie.data.disabled?nt(ie.data.value):nt(void 0),le&&xe.preventDefault();break}case I.a.ESC:He(!1)}},onKeyUp:function(){},scrollTo:function(xe){gt(xe)}}}),Ve.length===0)return N.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat(Ke,"-empty"),onMouseDown:mt},ve);function Fe(qe){var xe=Ve[qe];if(!xe)return null;var he=xe.data||{},ge=he.value,re=he.label,ie=he.children,oe=Object(D.a)(he,!0),ue=Be?ie:re;return xe?N.createElement("div",Object.assign({"aria-label":typeof ue=="string"?ue:null},oe,{key:qe,role:"option",id:"".concat(Ee,"_list_").concat(qe),"aria-selected":Ne.has(ge)}),ge):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},Fe(_e-1),Fe(_e),Fe(_e+1)),N.createElement(_.a,{itemKey:"key",ref:ht,data:Ve,height:ce,itemHeight:ne,fullHeight:!1,onMouseDown:mt,onScroll:ot,virtual:Ie,onMouseEnter:et},function(qe,xe){var he,ge=qe.group,re=qe.groupOption,ie=qe.data,oe=ie.label,ue=ie.key;if(ge)return N.createElement("div",{className:P()(Ke,"".concat(Ke,"-group"))},oe!==void 0?oe:ue);var Oe=ie.disabled,we=ie.value,rt=ie.title,yt=ie.children,wt=ie.style,xt=ie.className,pt=Object(U.a)(ie,["disabled","value","title","children","style","className"]),Qe=Ne.has(we),ze="".concat(Ke,"-option"),De=P()(Ke,ze,xt,(he={},Object(O.a)(he,"".concat(ze,"-grouped"),re),Object(O.a)(he,"".concat(ze,"-active"),_e===xe&&!Oe),Object(O.a)(he,"".concat(ze,"-disabled"),Oe),Object(O.a)(he,"".concat(ze,"-selected"),Qe),he)),ae=Be?yt:oe,de=!Re||typeof Re=="function"||Qe;return N.createElement("div",Object.assign({},pt,{"aria-selected":Qe,className:De,title:rt,onMouseMove:function(){if(_e===xe||Oe)return;Je(xe)},onClick:function(){Oe||nt(we)},style:wt}),N.createElement("div",{className:"".concat(ze,"-content")},ae||we),N.isValidElement(Re)||Qe,de&&N.createElement(S.a,{className:"".concat(Ke,"-option-state"),customizeIcon:Re,customizeIconProps:{isSelected:Qe}},Qe?"\u2713":null))}))},d=N.forwardRef(y);d.displayName="OptionList";var s=d,u=function(){return null};u.isSelectOption=!0;var h=u,T=function(){return null};T.isSelectOptGroup=!0;var g=T,f=F("VTBJ"),w=F("Zm9Q");function v(j){var $=j.key,se=j.props,me=se.children,Ee=se.value,We=Object(U.a)(se,["children","value"]);return Object(f.a)({key:$,value:Ee!==void 0?Ee:$,children:me},We)}function c(j){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(j).map(function(se,me){if(!N.isValidElement(se)||!se.type)return null;var Ee=se.type.isSelectOptGroup,We=se.key,Be=se.props,Ne=Be.children,Le=Object(U.a)(Be,["children"]);return $||!Ee?v(se):Object(f.a)(Object(f.a)({key:"__RC_SELECT_GRP__".concat(We===null?me:We,"__"),label:We},Le),{},{options:c(Ne)})}).filter(function(se){return se})}var l=F("2Qr1"),a=F("qNPg"),i=F("U8pU"),x=F("Kwbf"),b=F("WKfj");function m(j){var $=j.mode,se=j.options,me=j.children,Ee=j.backfill,We=j.allowClear,Be=j.placeholder,Ne=j.getInputElement,Le=j.showSearch,Ue=j.onSearch,ye=j.defaultOpen,ce=j.autoFocus,ne=j.labelInValue,ve=j.value,le=j.inputValue,Re=j.optionLabelProp,Ie=$==="multiple"||$==="tags",Ce=Le!==void 0?Le:Ie||$==="combobox",He=se||c(me);if(Object(x.a)($!=="tags"||He.every(function(Ke){return!Ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var Ze=He.some(function(Ke){return Ke.options?Ke.options.some(function(Ve){return typeof("value"in Ve?Ve.value:Ve.key)=="number"}):typeof("value"in Ke?Ke.value:Ke.key)=="number"});Object(x.a)(!Ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)($!=="combobox"||!Re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)($==="combobox"||!Ee,"`backfill` only works with `combobox` mode."),Object(x.a)($==="combobox"||!Ne,"`getInputElement` only work with `combobox` mode."),Object(x.b)($!=="combobox"||!Ne||!We||!Be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ue&&!Ce&&$!=="combobox"&&$!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!ye||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ve!=null){var ot=Object(b.d)(ve);Object(x.a)(!ne||ot.every(function(Ke){return Object(i.a)(Ke)==="object"&&("key"in Ke||"value"in Ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!Ie||Array.isArray(ve),"`value` should be array when `mode` is `multiple` or `tags`")}if(me){var et=null;Object(w.a)(me).some(function(Ke){if(!N.isValidElement(Ke)||!Ke.type)return!1;var Ve=Ke.type;if(Ve.isSelectOption)return!1;if(Ve.isSelectOptGroup){var ht=Object(w.a)(Ke.props.children).every(function(mt){return!N.isValidElement(mt)||!Ke.type||mt.type.isSelectOption?!0:(et=mt.type,!1)});return!ht}return et=Ve,!0}),et&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(et.displayName||et.name||et,"`.")),Object(x.a)(le===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var L=m,C=Object(a.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:c,flattenOptions:l.d,getLabeledValue:l.e,filterOptions:l.b,isValueDisabled:l.g,findValueOption:l.c,warningProps:L,fillOptionsWithMissingValue:l.a}),H=function(j){Object(k.a)(se,j);var $=Object(Q.a)(se);function se(){var me;return Object(ee.a)(this,se),me=$.apply(this,arguments),me.selectRef=N.createRef(),me.focus=function(){me.selectRef.current.focus()},me.blur=function(){me.selectRef.current.blur()},me}return Object(X.a)(se,[{key:"render",value:function(){return N.createElement(C,Object.assign({ref:this.selectRef},this.props))}}]),se}(N.Component);H.Option=h,H.OptGroup=g;var J=H,W=ke.c=J},M8RZ:function($e,ke,F){"use strict";F.d(ke,"a",function(){return I});var ee=F("fWQN"),X=F("mtLc"),k=F("yKVA"),Q=F("879j"),N=F("q1tI"),O=F.n(N),U=F("i8i4"),B=F.n(U),I=function(D){Object(k.a)(R,D);var E=Object(Q.a)(R);function R(P){var _;Object(ee.a)(this,R),_=E.call(this,P);var S=window.document;return _.node=S.createElement("div"),S.body.appendChild(_.node),_}return Object(X.a)(R,[{key:"render",value:function(){var _=this.props.children;return Object(U.createPortal)(_,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),R}(O.a.Component)},Nmxd:function($e,ke){$e.exports="data:image/png;base64,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"},NvD2:function($e,ke,F){"use strict";F.d(ke,"a",function(){return O});var ee=F("Kwbf");function X(U,B){var I=new Set;return U.forEach(function(D){B.has(D)||I.add(D)}),I}function k(U){var B=U||{},I=B.disabled,D=B.disableCheckbox,E=B.checkable;return!!(I||D)||E===!1}function Q(U,B,I,D){for(var E=new Set(U),R=new Set,P=0;P<=I;P+=1){var _=B.get(P)||new Set;_.forEach(function(s){var u=s.key,h=s.node,T=s.children,g=T===void 0?[]:T;E.has(u)&&!D(h)&&g.filter(function(f){return!D(f.node)}).forEach(function(f){E.add(f.key)})})}for(var S=new Set,y=I;y>=0;y-=1){var d=B.get(y)||new Set;d.forEach(function(s){var u=s.parent,h=s.node;if(D(h)||!s.parent||S.has(s.parent.key))return;if(D(s.parent.node)){S.add(u.key);return}var T=!0,g=!1;(u.children||[]).filter(function(f){return!D(f.node)}).forEach(function(f){var w=f.key,v=E.has(w);T&&!v&&(T=!1),!g&&(v||R.has(w))&&(g=!0)}),T&&E.add(u.key),g&&R.add(u.key),S.add(u.key)})}return{checkedKeys:Array.from(E),halfCheckedKeys:Array.from(X(R,E))}}function N(U,B,I,D,E){for(var R=new Set(U),P=new Set(B),_=0;_<=D;_+=1){var S=I.get(_)||new Set;S.forEach(function(u){var h=u.key,T=u.node,g=u.children,f=g===void 0?[]:g;!R.has(h)&&!P.has(h)&&!E(T)&&f.filter(function(w){return!E(w.node)}).forEach(function(w){R.delete(w.key)})})}P=new Set;for(var y=new Set,d=D;d>=0;d-=1){var s=I.get(d)||new Set;s.forEach(function(u){var h=u.parent,T=u.node;if(E(T)||!u.parent||y.has(u.parent.key))return;if(E(u.parent.node)){y.add(h.key);return}var g=!0,f=!1;(h.children||[]).filter(function(w){return!E(w.node)}).forEach(function(w){var v=w.key,c=R.has(v);g&&!c&&(g=!1),!f&&(c||P.has(v))&&(f=!0)}),g||R.delete(h.key),f&&P.add(h.key),y.add(h.key)})}return{checkedKeys:Array.from(R),halfCheckedKeys:Array.from(X(P,R))}}function O(U,B,I,D){var E=[],R;D?R=D:R=k;var P=new Set(U.filter(function(d){var s=!!I[d];return s||E.push(d),s})),_=new Map,S=0;Object.keys(I).forEach(function(d){var s=I[d],u=s.level,h=_.get(u);h||(h=new Set,_.set(u,h)),h.add(s),S=Math.max(S,u)}),Object(ee.a)(!E.length,"Tree missing follow keys: ".concat(E.slice(0,100).map(function(d){return"'".concat(d,"'")}).join(", ")));var y;return B===!0?y=Q(P,_,S,R):y=N(P,B.halfCheckedKeys,_,S,R),y}},OLES:function($e,ke,F){"use strict";var ee=F("U8pU"),X=F("VTBJ"),k=F("Ff2n"),Q=F("q1tI"),N=F("uciX"),O=F("7ixt"),U=function(P){var _=P.overlay,S=P.prefixCls,y=P.id,d=P.overlayInnerStyle;return Q.createElement("div",{className:"".concat(S,"-inner"),id:y,role:"tooltip",style:d},typeof _=="function"?_():_)},B=U,I=function(P,_){var S=P.overlayClassName,y=P.trigger,d=y===void 0?["hover"]:y,s=P.mouseEnterDelay,u=s===void 0?0:s,h=P.mouseLeaveDelay,T=h===void 0?.1:h,g=P.overlayStyle,f=P.prefixCls,w=f===void 0?"rc-tooltip":f,v=P.children,c=P.onVisibleChange,l=P.afterVisibleChange,a=P.transitionName,i=P.animation,x=P.placement,b=x===void 0?"right":x,m=P.align,L=m===void 0?{}:m,C=P.destroyTooltipOnHide,H=C===void 0?!1:C,J=P.defaultVisible,W=P.getTooltipContainer,j=P.overlayInnerStyle,$=Object(k.a)(P,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),se=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(_,function(){return se.current});var me=Object(X.a)({},$);"visible"in P&&(me.popupVisible=P.visible);var Ee=function(){var Ue=P.arrowContent,ye=Ue===void 0?null:Ue,ce=P.overlay,ne=P.id;return[Q.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},ye),Q.createElement(B,{key:"content",prefixCls:w,id:ne,overlay:ce,overlayInnerStyle:j})]},We=!1,Be=!1;if(typeof H=="boolean")We=H;else if(H&&Object(ee.a)(H)==="object"){var Ne=H.keepParent;We=Ne===!0,Be=Ne===!1}return Q.createElement(N.a,Object.assign({popupClassName:S,prefixCls:w,popup:Ee,action:d,builtinPlacements:O.a,popupPlacement:b,ref:se,popupAlign:L,getPopupContainer:W,onPopupVisibleChange:c,afterPopupVisibleChange:l,popupTransitionName:a,popupAnimation:i,defaultPopupVisible:J,destroyPopupOnHide:We,autoDestroy:Be,mouseLeaveDelay:T,popupStyle:g,mouseEnterDelay:u},me),v)},D=Object(Q.forwardRef)(I),E=ke.a=D},OZM5:function($e,ke,F){"use strict";F.d(ke,"b",function(){return D}),F.d(ke,"a",function(){return E}),F.d(ke,"k",function(){return R}),F.d(ke,"h",function(){return P}),F.d(ke,"i",function(){return _}),F.d(ke,"g",function(){return S}),F.d(ke,"c",function(){return y}),F.d(ke,"d",function(){return d}),F.d(ke,"j",function(){return h}),F.d(ke,"e",function(){return T}),F.d(ke,"f",function(){return g});var ee=F("KQm4"),X=F("U8pU"),k=F("Ff2n"),Q=F("q1tI"),N=F.n(Q),O=F("Kwbf"),U=F("WaYH"),B=.25,I=2;function D(f,w){var v=f.slice(),c=v.indexOf(w);return c>=0&&v.splice(c,1),v}function E(f,w){var v=f.slice();return v.indexOf(w)===-1&&v.push(w),v}function R(f){return f.split("-")}function P(f,w){return"".concat(f,"-").concat(w)}function _(f){return f&&f.type&&f.type.isTreeNode}function S(f,w){var v=[f],c=w[f];function l(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(i){var x=i.key,b=i.children;v.push(x),l(b)})}return l(c.children),v}function y(f,w){var v=f.clientY,c=w.selectHandle.getBoundingClientRect(),l=c.top,a=c.bottom,i=c.height,x=Math.max(i*B,I);return v<=l+x?-1:v>=a-x?1:0}function d(f,w){if(!f)return;var v=w.multiple;return v?f.slice():f.length?[f[0]]:f}var s=function(w){return w};function u(f,w){if(!f)return[];var v=w||{},c=v.processProps,l=c===void 0?s:c,a=Array.isArray(f)?f:[f];return a.map(function(i){var x=i.children,b=Object(k.a)(i,["children"]),m=u(x,w);return N.a.createElement(U.a,Object.assign({},l(b)),m)})}function h(f){if(!f)return null;var w;if(Array.isArray(f))w={checkedKeys:f,halfCheckedKeys:void 0};else if(Object(X.a)(f)==="object")w={checkedKeys:f.checked||void 0,halfCheckedKeys:f.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function T(f,w){var v=new Set;function c(l){if(v.has(l))return;var a=w[l];if(!a)return;v.add(l);var i=a.parent,x=a.node;if(x.disabled)return;i&&c(i.key)}return(f||[]).forEach(function(l){c(l)}),Object(ee.a)(v)}function g(f){var w={};return Object.keys(f).forEach(function(v){(v.startsWith("data-")||v.startsWith("aria-"))&&(w[v]=f[v])}),w}},Ohmc:function($e,ke,F){$e.exports=F.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function($e,ke,F){"use strict";var ee=F("2qtc"),X=F("kLXV"),k=F("rAM+"),Q=F("miYZ"),N=F("tsqr"),O=F("9og8"),U=F("tJVT"),B=F("jrin"),I=F("WmNS"),D=F.n(I),E=F("q1tI"),R=F.n(E),P=F("VrN/"),_=F.n(P),S=F("bdgK"),y=F("p77/"),d=F("Bd2K"),s=F("ELLl"),u=F("19Vz"),h=F("lZu9"),T=F("+NIl"),g=F("kSUc"),f=F("9Bee"),w=function(we){var rt=we.value,yt=rt===void 0?"":rt,wt=we.className,xt=we.showTextOnly,pt=we.showLines,Qe=we.style,ze=Qe===void 0?{}:Qe,De=Object(E.useMemo)(function(){return""},[yt]);return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{dangerouslySetInnerHTML:{__html:De}}))},v=F("0Owb"),c=F("dejd"),l=F("C+DQ"),a=F("1vsH"),i=F("m3rI"),x=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(we){var rt=we.onActionCallback,yt=we.title,wt=we.icon,xt=we.actionName,pt=we.className,Qe=pt===void 0?"":pt,ze=we.children;function De(){rt(xt)}return R.a.createElement("a",{title:yt,className:Qe,onClick:De},R.a.createElement("i",{className:"md-iconfont ".concat(wt)}),ze)}var m=function(we){var rt=we.watch,yt=we.showNullButton,wt=we.onActionCallback,xt=we.fullScreen,pt=we.insertTemp,Qe=we.hidetoolBar,ze=we.uuid,De=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(a.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(a.D)("_educoder_session"),"&key=").concat(ze,"&api=").concat(encodeURIComponent(i.a.PROXY_SERVER)));var ae=[].concat(x,[{title:"".concat(rt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(rt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return R.a.createElement("ul",{className:"markdown-toolbar-container"},!Qe&&ae.map(function(de,Ye){return R.a.createElement("li",{key:Ye},de.actionName?R.a.createElement(b,Object(v.a)({},de,{onActionCallback:wt})):R.a.createElement("span",{className:"v-line"}))}),yt?R.a.createElement("li",null,R.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:wt},R.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pt&&R.a.createElement("li",null,R.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pt),onActionCallback:wt},R.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),R.a.createElement("li",{className:"btn-full-screen"},R.a.createElement(b,{icon:"".concat(xt?"icon-shrink":"icon-enlarge"),title:xt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:wt})))},L=F("M8RZ"),C=F("+L6B"),H=F("2/Rp"),J=F("y8nQ"),W=F("Vl3Y"),j=F("5NDa"),$=F("5rEg"),se={labelCol:{span:4},wrapperCol:{span:20}},me=function(we){var rt=we.callback,yt=we.onCancel;function wt(xt){rt(xt)}return R.a.createElement(W.a,Object(v.a)({},se,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:wt}),R.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},R.a.createElement($.a,null)),R.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},R.a.createElement($.a,null)),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(H.a,{type:"ghost",onClick:yt},"\u53D6\u6D88")))},Ee=F("7ahc"),We=F("k1fw"),Be=F("HmJG"),Ne=F("BjJ7"),Le=W.a.useForm,Ue={width:280,marginRight:10},ye={labelCol:{span:5},wrapperCol:{span:19}},ce=function(we){var rt=we.callback,yt=we.onCancel,wt=Le(),xt=Object(U.a)(wt,1),pt=xt[0],Qe=Object(E.useRef)();function ze(de){rt(Object(We.a)(Object(We.a)({},de),{},{name:Qe.current}))}function De(de,Ye){pt.setFieldsValue({src:"/api/attachments/".concat(de.id,"?type=").concat(de.content_type),type:Ye.type})}function ae(de){var Ye=de.target.files[0];Qe.current=Ye.name,ve(Ye,De)}return R.a.createElement(W.a,Object(v.a)({form:pt},ye,{className:"upload-image-panel",onFinish:ze}),R.a.createElement(W.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},R.a.createElement("div",{className:"flex-container"},R.a.createElement(W.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},R.a.createElement($.a,{style:Ue})),R.a.createElement(ne,{onFileChange:ae}))),R.a.createElement(W.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},R.a.createElement($.a,{style:{width:264}})),R.a.createElement(W.a.Item,{style:{textAlign:"right"}},R.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(H.a,{type:"ghost",onClick:yt},"\u53D6\u6D88")))};function ne(we){var rt=we.onFileChange;return R.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",R.a.createElement("input",{type:"file",onChange:rt}))}function ve(we,rt){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var yt=new FormData;yt.append("editormd-image-file",we),yt.append("file_param_name","editormd-image-file"),yt.append("byxhr","true");var wt=new window.XMLHttpRequest;wt.withCredentials=!0,wt.addEventListener("load",function(xt){rt(JSON.parse(xt.target.responseText),we)},!1),wt.addEventListener("error",function(xt){console.error(xt)},!1),wt.open("POST","".concat(Ne.a,"/api/attachments.json")),wt.send(yt)}var le=F("giR+"),Re=F("fyUT"),Ie=F("7Kak"),Ce=F("9yH6"),He=Ce.a.Group,Ze={margin:"0 8px"},ot=function(we){var rt=we.callback,yt=we.onCancel;function wt(xt){rt(xt)}return R.a.createElement(W.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:wt},R.a.createElement("div",{className:"flex-container"},R.a.createElement("span",{style:Ze},"\u5355\u5143\u683C\u6570\uFF1A"),R.a.createElement("span",{style:Ze},"\u884C\u6570"),R.a.createElement(W.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},R.a.createElement(Re.a,null)),R.a.createElement("span",{style:Ze},"\u5217\u6570"),R.a.createElement(W.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},R.a.createElement(Re.a,null))),R.a.createElement("div",{className:"flex-container",style:{marginTop:12}},R.a.createElement("span",{style:Ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),R.a.createElement(W.a.Item,{name:"align"},R.a.createElement(He,null,R.a.createElement(Ce.a,{value:"default"},R.a.createElement("i",{className:"fa fa-align-justify"})),R.a.createElement(Ce.a,{value:"left"},R.a.createElement("i",{className:"fa fa-align-left"})),R.a.createElement(Ce.a,{value:"center"},R.a.createElement("i",{className:"fa fa-align-center"})),R.a.createElement(Ce.a,{value:"right"},R.a.createElement("i",{className:"fa fa-align-right"}))))),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(H.a,{type:"ghost",onClick:yt},"\u53D6\u6D88")))},et=F("ErOA"),Ke=F("7Cbv"),Ve="link",ht="upload-image",mt="code-block",gt="add-table",Et="------------",ft={default:Et,left:":".concat(Et),center:":".concat(Et,":"),right:"".concat(Et,":")},Ct=F("9VGf"),_e,Se;function Je(){}var nt=0,Fe=1e4,qe="\u2581",xe=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function he(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var ge=navigator.platform.toUpperCase().indexOf("MAC")>=0,re=ge?"Cmd":"Ctrl",ie=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],oe=(_e={},Object(B.a)(_e,re+"-B","bold"),Object(B.a)(_e,re+"-I","italic"),_e),ue=(Se={},Object(B.a)(Se,Ve,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(Se,mt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(Se,ht,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(Se,gt,"\u6DFB\u52A0\u8868\u683C"),Se),Oe=ke.a=function(we){var rt=we.defaultValue,yt=rt===void 0?"":rt,wt=we.onChange,xt=we.width,pt=xt===void 0?"100%":xt,Qe=we.height,ze=Qe===void 0?400:Qe,De=we.miniToolbar,ae=De===void 0?!1:De,de=we.isFocus,Ye=de===void 0?!1:de,Me=we.watch,Xe=we.insertTemp,dt=we.mode,Pe=dt===void 0?"markdown":dt,at=we.id,vt=at===void 0?"markdown-editor-id":at,St=we.showResizeBar,Rt=St===void 0?!1:St,qt=we.noStorage,sn=qt===void 0?!1:qt,Xt=we.showNullButton,_t=Xt===void 0?!1:Xt,cn=we.hidetoolBar,zt=cn===void 0?!1:cn,$t=we.fullScreen,Nt=$t===void 0?!1:$t,nn=we.onBlur,An=we.onCMBeforeChange,Tn=we.onFullScreen,ct=we.className,Gt=ct===void 0?"":ct,Ln=we.disablePaste,Fn=Ln===void 0?!1:Ln,kn=we.placeholder,Xn=kn===void 0?"":kn,G=we.values,p=G===void 0?"":G,A=Object(E.useState)(null),K=Object(U.a)(A,2),Y=K[0],V=K[1],Ae=Object(E.useState)(yt),it=Object(U.a)(Ae,2),Tt=it[0],Bt=it[1],fe=Object(E.useState)(Me),Ft=Object(U.a)(fe,2),Qt=Ft[0],xn=Ft[1],Hn=Object(E.useState)(Nt),ir=Object(U.a)(Hn,2),Rn=ir[0],cr=ir[1],gr=Object(E.useState)(""),Qn=Object(U.a)(gr,2),hr=Qn[0],$n=Qn[1],kr=Object(E.useState)(0),ar=Object(U.a)(kr,2),Ir=ar[0],Er=ar[1],Rr=Object(E.useState)(ze),Qr=Object(U.a)(Rr,2),xr=Qr[0],or=Qr[1],Fr=Object(E.useState)(!1),Pr=Object(U.a)(Fr,2),jr=Pr[0],En=Pr[1],on=Object(E.useRef)(Object(Ke.a)()),Mn=Object(E.useRef)(!1),hn=Object(E.useRef)(),On=Object(E.useRef)(),fn=Object(E.useRef)(),_r=Object(E.useRef)(),In=Object(E.useRef)(),Yn=function(){var Ht=Object(O.a)(D.a.mark(function en(){var Vt,an;return D.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Object(et.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:on.current}});case 2:an=Cn.sent,an!=null&&(Vt=an.attachments)!==null&&Vt!==void 0&&Vt.length&&(console.log("cm:",Y,On),an.attachments.map(function(un){un.content_type.indexOf("image")>-1?Y.replaceSelection(".concat(un.content_type,")")):un.content_type.indexOf("video")>-1?Y.replaceSelection('<video width="100%" controls src="'.concat(i.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):un.content_type.indexOf("pdf")>-1?Y.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,'&disposition=inline" target="_blank">').concat(un.name,"</a>")):Y.replaceSelection("[".concat(un.name,"](").concat(i.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}));case 4:case"end":return Cn.stop()}},en)}));return function(){return Ht.apply(this,arguments)}}();Object(E.useEffect)(function(){Bt(p),Y==null||Y.setValue(p)},[p]),Object(E.useEffect)(function(){Tn==null||Tn(Rn)},[Rn]),Object(E.useEffect)(function(){if(On.current){var Ht=_.a.fromTextArea(On.current,{mode:Pe,lineNumbers:!ae,lineWrapping:!0,value:yt,autoCloseTags:!0,autoCloseBrackets:!0});Ye&&Ht.focus();function en(Vt,an){if(Fn){an.preventDefault();return}var pn=an.clipboardData;if(pn){var Cn=pn.types.toString(),un=pn.items;if(Cn==="Files"||pn.types.indexOf("Files")>-1){if(an.preventDefault(),Pe=="stex")return;try{var Pn,Kn=un[1];((Pn=un[0])===null||Pn===void 0?void 0:Pn.kind)==="file"&&(Kn=un[0]);var It=Kn.getAsFile(),fr=It.name.split(".").pop();ve(It,function(gn){if(gn.id){var Bn,rn,zn;(It==null||((Bn=It.type)===null||Bn===void 0)?void 0:Bn.indexOf("image"))>-1?Ht.replaceSelection(".concat(gn.content_type,")")):(It==null||((rn=It.type)===null||rn===void 0)?void 0:rn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,'"></video>')):(It==null||((zn=It.type)===null||zn===void 0)?void 0:zn.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(It.type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):ie.includes(fr)?Ht.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,'?type=office&disposition=inline" target="_blank">').concat(It.name,"</a>")):Ht.replaceSelection("[".concat(It.name,"](").concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(gn.content_type,")"))}else(gn==null?void 0:gn.status)===401&&(document.location.href="/user/login")})}catch(gn){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ht.on("paste",en),Ht.on("dragleave",function(Vt,an){fn.current.classList.remove("mouse-hover-md")}),Ht.on("dragover",function(Vt,an){fn.current.classList.add("mouse-hover-md")}),Ht.on("drop",function(Vt,an){fn.current.classList.add("mouse-hover-md");var pn;if(pn=an.dataTransfer.files,pn.length>0){an.preventDefault(),an.stopPropagation();for(var Cn=function(Kn){var It=pn[Kn],fr=It.name.split(".").pop();ve(It,function(gn){if(gn.id){var Bn,rn,zn;(It==null||((Bn=It.type)===null||Bn===void 0)?void 0:Bn.indexOf("image"))>-1?Ht.replaceSelection(".concat(gn.content_type,")")):(It==null||((rn=It.type)===null||rn===void 0)?void 0:rn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,'"></video>')):(It==null||((zn=It.type)===null||zn===void 0)?void 0:zn.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(It.type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):ie.includes(fr)?Ht.replaceSelection('<a href="'.concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,'?type=office&disposition=inline" target="_blank">').concat(It.name,"</a>")):Ht.replaceSelection("[".concat(It.name,"](").concat(i.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(gn.content_type,")"))}else(gn==null?void 0:gn.status)===401&&(document.location.href="/user/login")})},un=0;un<pn.length;un++)Cn(un)}}),V(Ht),function(){Ht.off("paste",en)}}},[]);var zr=Object(E.useCallback)(function(){if(fn.current)try{}catch(Ht){console.log(Ht,"---- to set md editor body height")}},[xr,fn,Rn]);Object(E.useEffect)(function(){function Ht(){var Vt=new S.default(function(an){var pn=Object(k.a)(an),Cn;try{for(pn.s();!(Cn=pn.n()).done;){var un=Cn.value;(un.target.offsetHeight>0||un.target.offsetWidth>0)&&(zr(),Y.setSize("100%","100%"),Y.refresh())}}catch(Pn){pn.e(Pn)}finally{pn.f()}});return Vt.observe(On.current.parentElement),Vt}if(Y){var en=Ht();return function(){en.unobserve(On.current.parentElement)}}},[Y,zr]),Object(E.useEffect)(function(){if(Y){for(var Ht=[],en=function(){var un=an[Vt];pn=Object(U.a)(un,2);var Pn=pn[0],Kn=pn[1],It=Object(B.a)({},Pn,function(){Wr(Kn)});Ht.push(It),Y.addKeyMap(It)},Vt=0,an=Object.entries(oe);Vt<an.length;Vt++){var pn;en()}return hn.current=setInterval(function(){Mn.current&&Yn()},4e3),function(){clearInterval(hn.current);var Cn=Object(k.a)(Ht),un;try{for(Cn.s();!(un=Cn.n()).done;){var Pn=un.value;Y.removeKeyMap(Pn)}}catch(Kn){Cn.e(Kn)}finally{Cn.f()}}}},[Y]),Object(E.useEffect)(function(){Nt!==Rn&&cr(Nt)},[Nt]),Object(Ct.a)(function(){if(!sn&&Ir>0){var Ht=new Date().getTime(),en=window.sessionStorage.getItem(vt);Ht>=Ir+Fe&&(!en||en!==Tt)&&(window.sessionStorage.setItem(vt,Tt),En(!0))}},Fe),Object(E.useEffect)(function(){xn(Me)},[Y,Me]),Object(E.useEffect)(function(){Y&&(Ye&&Y.focus())},[Y,Ye]),Object(E.useEffect)(function(){if(Qt&&Y){var Ht=Y.getScrollerElement();function en(Vt){var an=Vt.target;if(In.current){var pn=an.scrollTop/an.scrollHeight;In.current.scrollTop=In.current.scrollHeight*pn}}return Ht.addEventListener("scroll",en),function(){Ht.removeEventListener("scroll",en)}}},[Y,Qt]),Object(E.useEffect)(function(){if(Y&&An){function Ht(en,Vt){An(en,Vt)}return Y.on("beforeChange",Ht),function(){Y.off("beforeChange",Ht)}}},[Y,An]),Object(E.useEffect)(function(){if(Y&&nn){function Ht(){nn(Y.getValue())}return Y.on("blur",Ht),function(){Y.off("blur",Ht)}}},[Y,nn]),Object(E.useEffect)(function(){if(Y){function Ht(en){var Vt=en.getValue();Bt(Vt),Er(new Date().getTime()),en.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),wt&&wt(Vt)}return Y.on("change",Ht),function(){Y.off("change",Ht)}}},[Y,wt]),Object(E.useEffect)(function(){Y&&(yt==null?(Y.setValue(""),Bt("")):yt!==Y.getValue()&&(Y.setValue(yt),Bt(yt),Y.setCursor(Y.lineCount(),0)))},[Y,yt]);var Wr=Object(E.useCallback)(function(Ht){var en=Y.getCursor(),Vt=Y.getSelection(),an=Vt.split(`
|
|
`);switch(Ht){case"bold":return Y.replaceSelection("**"+Vt+"**"),Vt===""&&Y.setCursor(en.line,en.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+Vt+"*"),Vt===""&&Y.setCursor(en.line,en.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+Vt+"`"),Vt===""&&Y.setCursor(en.line,en.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+Vt+"$$`"),Vt===""&&Y.setCursor(en.line,en.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+Vt+"\n```"),Y.setCursor(en.line+1,Vt.length+1),Y.focus();case"line-break":return Y.replaceSelection(`<br/>
|
|
`),Y.focus();case"list-ul":return Vt===""?Y.replaceSelection("- "+Vt):Y.replaceSelection(an.map(function(pn){return pn===""?"":"- ".concat(pn)}).join(`
|
|
`)),Y.focus();case"list-ol":return Vt===""?Y.replaceSelection("1. "+Vt):Y.replaceSelection(an.map(function(pn,Cn){return pn===""?"":"".concat(Cn+1,". ").concat(pn)}).join(`
|
|
`)),Y.focus();case"add-null-ch":return Vt===""&&Y.setCursor(en.line,en.ch+1),Y.replaceSelection(qe),Y.focus();case"inster-template-1":return Vt===""&&Y.setCursor(en.line,en.ch),Y.replaceSelection(xe),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return xn(!Qt),Y.focus();case"trigger-full-screen":return cr(!Rn),Y.focus();case Ve:$n(Ve);return;case mt:$n(mt);return;case ht:$n(ht);return;case gt:$n(gt);return;default:throw new Error}},[Y,Qt,Rn]),Or=Object(E.useCallback)(function(Ht){$n("");switch(hr){case Ve:var en=Ht.title,Vt=Ht.link;return Y.replaceSelection("[".concat(en,"](").concat(Vt,")")),Y.focus();case mt:var an=Ht.language,pn=Ht.content;return Y.replaceSelection(["```"+an,pn,"```"].join(`
|
|
`)),Y.focus();case ht:var Cn=Ht.src,un=Ht.alt,Pn=Ht.name;return Cn.indexOf("type=image")>-1?Y.replaceSelection(".concat(Cn,' "').concat(un||"",'" )')):Cn.indexOf("type=application/pdf")>-1?Y.replaceSelection('<a href="'.concat(Cn,'&disposition=inline" target="_blank">').concat(Pn,"</a>")):Y.replaceSelection('<a href="'.concat(Cn,'" target="_blank">').concat(Pn,"</a>")),Y.focus();case gt:for(var Kn=Ht.row,It=Ht.col,fr=Ht.align,gn=`
|
|
`,Bn=0;Bn<Kn;Bn++){for(var rn=[],zn=[],vn=0;vn<It;vn++)Bn===1&&zn.push(ft[fr]),rn.push(" ");Bn===1&&(gn+="| ".concat(zn.join(" | "),` |
|
|
`)),gn+="| ".concat(rn.join(It===1?"":" | "),` |
|
|
`)}return Y.replaceSelection(gn+`
|
|
`),Y.focus();default:throw new Error}},[Y,hr]),Yr=Object(E.useMemo)(function(){switch(hr){case Ve:return R.a.createElement(me,{callback:Or,onCancel:sr});case mt:return R.a.createElement(Ee.b,{callback:Or,onCancel:sr});case ht:return R.a.createElement(ce,{callback:Or,onCancel:sr});case gt:return R.a.createElement(ot,{callback:Or,onCancel:sr});default:return null}},[hr]);function sr(){$n("")}Object(E.useEffect)(function(){if(_r.current){var Ht=_r.current,en=!1,Vt=0;function an(un){en=!0,Vt=un.pageY}function pn(){en=!1}function Cn(un){if(en){var Pn=un.pageY-Vt;Pn<0&&(Pn=0),Pn>300&&(Pn=300);var Kn=ze+Pn+"px";or(Kn)}}return Ht.addEventListener("mousedown",an),document.addEventListener("mousemove",Cn),document.addEventListener("mouseup",pn),function(){Ht.removeEventListener("mousedown",an),document.removeEventListener("mousemove",Cn),document.removeEventListener("mouseup",pn)}}},[Y,_r]),Object(E.useEffect)(function(){or(ze)},[ze]);var Hr=he(pt),Cr=he(xr),Kr={width:Hr,height:Cr},Jr=Object(E.useMemo)(function(){if(Ir){var Ht=new Date(Ir),en=Ht.getHours(),Vt=Ht.getMinutes(),an=Ht.getSeconds();return en=en<10?"0"+en:en,Vt=Vt<10?"0"+Vt:Vt,an=an<10?"0"+an:an,"".concat(en,":").concat(Vt,":").concat(an)}return 0},[Ir]);function lr(){window.sessionStorage.removeItem(vt),En(!1),Er(0)}function oi(){En(!1),Er(0),Y.setValue(window.sessionStorage.getItem(vt))}function si(Ht,en){var Vt=Y.getValue();Vt=Vt.replace(Ht,en),Bt(Vt),Y==null||Y.setValue(Vt)}return R.a.createElement(E.Fragment,null,R.a.createElement("div",{className:"markdown-editor-wrapper",ref:fn},R.a.createElement("div",{className:"markdown-editor-container ".concat(Gt," ").concat(Qt?"on-preview":""," ").concat(ae?"mini":""," ").concat(Rn?"full-screen":""),style:Kr},R.a.createElement(m,{insertTemp:Xe,watch:Qt,fullScreen:Rn,showNullButton:_t,onActionCallback:Wr,hidetoolBar:zt,uuid:on.current,setOpenPhones:function(){Mn.current=!0}}),R.a.createElement("div",{className:"markdown-editor-body"},R.a.createElement("div",{className:"codemirror-container"},R.a.createElement("textarea",{ref:On,placeholder:Xn})),Qt?R.a.createElement("div",{ref:In,className:"preview-container"},Pe==="stex"&&R.a.createElement(w,{value:Tt}),Pe!=="stex"&&R.a.createElement(f.a,{edit:!0,value:Tt,replaces:si})):null))),Rt?R.a.createElement("a",{ref:_r,className:"editor-resize"}):null,R.a.createElement(L.a,null,ue[hr]?R.a.createElement(X.a,{centered:!0,title:ue[hr],visible:!0,onCancel:sr,footer:null},Yr):null))}},RMFE:function($e,ke){$e.exports="data:image/png;base64,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"},"SA+Z":function($e,ke,F){var ee=F("wTVA"),X=F("EbDI"),k=F("ZhPi"),Q=F("wkBT");function N(O){return ee(O)||X(O)||k(O)||Q()}$e.exports=N,$e.exports.__esModule=!0,$e.exports.default=$e.exports},SJMd:function($e,ke){/**
|
|
* @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 F,ee,X,k=!1,Q,N;window.PR_SHOULD_USE_CONTINUATION=!0;var O,U;(function(){var B=window,I=["break,continue,do,else,for,if,return,while"],D=[I,"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"],E=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],R=[E,"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"],P=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],_=[E,"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"],S="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",y=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="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",s=[I,"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"],u=[I,"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"],h=[I,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[R,_,P,y,d,s,u,h],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,f="str",w="kwd",v="com",c="typ",l="lit",a="pun",i="pln",x="tag",b="dec",m="src",L="atn",C="atv",H="nocode",J="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(Ce){for(var He=0,Ze=!1,ot=!1,et=0,Ke=Ce.length;et<Ke;++et){var Ve=Ce[et];if(Ve.ignoreCase)ot=!0;else if(/[a-z]/i.test(Ve.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ze=!0,ot=!1;break}}var ht={b:8,t:9,n:10,v:11,f:12,r:13};function mt(_e){var Se=_e.charCodeAt(0);if(Se!==92)return Se;var Je=_e.charAt(1);return Se=ht[Je],Se||("0"<=Je&&Je<="7"?parseInt(_e.substring(1),8):Je==="u"||Je==="x"?parseInt(_e.substring(2),16):_e.charCodeAt(1))}function gt(_e){if(_e<32)return(_e<16?"\\x0":"\\x")+_e.toString(16);var Se=String.fromCharCode(_e);return Se==="\\"||Se==="-"||Se==="]"||Se==="^"?"\\"+Se:Se}function Et(_e){var Se=_e.substring(1,_e.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")),Je=[],nt=Se[0]==="^",Fe=["["];nt&&Fe.push("^");for(var qe=nt?1:0,xe=Se.length;qe<xe;++qe){var he=Se[qe];if(/\\[bdsw]/i.test(he))Fe.push(he);else{var ge=mt(he),re;qe+2<xe&&Se[qe+1]==="-"?(re=mt(Se[qe+2]),qe+=2):re=ge,Je.push([ge,re]),re<65||ge>122||(re<65||ge>90||Je.push([Math.max(65,ge)|32,Math.min(re,90)|32]),re<97||ge>122||Je.push([Math.max(97,ge)&~32,Math.min(re,122)&~32]))}}Je.sort(function(Oe,we){return Oe[0]-we[0]||we[1]-Oe[1]});for(var ie=[],oe=[],qe=0;qe<Je.length;++qe){var ue=Je[qe];ue[0]<=oe[1]+1?oe[1]=Math.max(oe[1],ue[1]):ie.push(oe=ue)}for(var qe=0;qe<ie.length;++qe){var ue=ie[qe];Fe.push(gt(ue[0])),ue[1]>ue[0]&&(ue[1]+1>ue[0]&&Fe.push("-"),Fe.push(gt(ue[1])))}return Fe.push("]"),Fe.join("")}function ft(_e){for(var Se=_e.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")),Je=Se.length,nt=[],Fe=0,qe=0;Fe<Je;++Fe){var xe=Se[Fe];if(xe==="(")++qe;else if(xe.charAt(0)==="\\"){var he=+xe.substring(1);he&&(he<=qe?nt[he]=-1:Se[Fe]=gt(he))}}for(var Fe=1;Fe<nt.length;++Fe)nt[Fe]===-1&&(nt[Fe]=++He);for(var Fe=0,qe=0;Fe<Je;++Fe){var xe=Se[Fe];if(xe==="(")++qe,nt[qe]||(Se[Fe]="(?:");else if(xe.charAt(0)==="\\"){var he=+xe.substring(1);he&&he<=qe&&(Se[Fe]="\\"+nt[he])}}for(var Fe=0;Fe<Je;++Fe)Se[Fe]==="^"&&Se[Fe+1]!=="^"&&(Se[Fe]="");if(_e.ignoreCase&&Ze)for(var Fe=0;Fe<Je;++Fe){var xe=Se[Fe],ge=xe.charAt(0);xe.length>=2&&ge==="["?Se[Fe]=Et(xe):ge!=="\\"&&(Se[Fe]=xe.replace(/[a-zA-Z]/g,function(oe){var ue=oe.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Se.join("")}for(var Ct=[],et=0,Ke=Ce.length;et<Ke;++et){var Ve=Ce[et];if(Ve.global||Ve.multiline)throw new Error(""+Ve);Ct.push("(?:"+ft(Ve)+")")}return new RegExp(Ct.join("|"),ot?"gi":"g")}function j(Ce,He){var Ze=/(?:^|\s)nocode(?:\s|$)/,ot=[],et=0,Ke=[],Ve=0;function ht(mt){var gt=mt.nodeType;if(gt==1){if(Ze.test(mt.className))return;for(var Et=mt.firstChild;Et;Et=Et.nextSibling)ht(Et);var ft=mt.nodeName.toLowerCase();(ft==="br"||ft==="li")&&(ot[Ve]=`
|
|
`,Ke[Ve<<1]=et++,Ke[Ve++<<1|1]=mt)}else if(gt==3||gt==4){var Ct=mt.nodeValue;Ct.length&&(He?Ct=Ct.replace(/\r\n?/g,`
|
|
`):Ct=Ct.replace(/[ \t\r\n]+/g," "),ot[Ve]=Ct,Ke[Ve<<1]=et,et+=Ct.length,Ke[Ve++<<1|1]=mt)}}return ht(Ce),{sourceCode:ot.join("").replace(/\n$/,""),spans:Ke}}function $(Ce,He,Ze,ot,et){if(!Ze)return;var Ke={sourceNode:Ce,pre:1,langExtension:null,numberLines:null,sourceCode:Ze,spans:null,basePos:He,decorations:null};ot(Ke),et.push.apply(et,Ke.decorations)}var se=/\S/;function me(Ce){for(var He=void 0,Ze=Ce.firstChild;Ze;Ze=Ze.nextSibling){var ot=Ze.nodeType;He=ot===1?He?Ce:Ze:ot===3&&se.test(Ze.nodeValue)?Ce:He}return He===Ce?void 0:He}function Ee(Ce,He){var Ze={},ot;(function(){for(var Ve=Ce.concat(He),ht=[],mt={},gt=0,Et=Ve.length;gt<Et;++gt){var ft=Ve[gt],Ct=ft[3];if(Ct)for(var _e=Ct.length;--_e>=0;)Ze[Ct.charAt(_e)]=ft;var Se=ft[1],Je=""+Se;mt.hasOwnProperty(Je)||(ht.push(Se),mt[Je]=null)}ht.push(/[\0-\uffff]/),ot=W(ht)})();var et=He.length,Ke=function(Ve){for(var ht=Ve.sourceCode,mt=Ve.basePos,gt=Ve.sourceNode,Et=[mt,i],ft=0,Ct=ht.match(ot)||[],_e={},Se=0,Je=Ct.length;Se<Je;++Se){var nt=Ct[Se],Fe=_e[nt],qe=void 0,xe;if(typeof Fe=="string")xe=!1;else{var he=Ze[nt.charAt(0)];if(he)qe=nt.match(he[1]),Fe=he[0];else{for(var ge=0;ge<et;++ge)if(he=He[ge],qe=nt.match(he[1]),qe){Fe=he[0];break}qe||(Fe=i)}xe=Fe.length>=5&&Fe.substring(0,5)==="lang-",xe&&!(qe&&typeof qe[1]=="string")&&(xe=!1,Fe=m),xe||(_e[nt]=Fe)}var re=ft;if(ft+=nt.length,!xe)Et.push(mt+re,Fe);else{var ie=qe[1],oe=nt.indexOf(ie),ue=oe+ie.length;qe[2]&&(ue=nt.length-qe[2].length,oe=ue-ie.length);var Oe=Fe.substring(5);$(gt,mt+re,nt.substring(0,oe),Ke,Et),$(gt,mt+re+oe,ie,ce(Oe,ie),Et),$(gt,mt+re+ue,nt.substring(ue),Ke,Et)}}Ve.decorations=Et};return Ke}function We(Ce){var He=[],Ze=[];Ce.tripleQuotedStrings?He.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ce.multiLineStrings?He.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):He.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ce.verbatimStrings&&Ze.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ot=Ce.hashComments;ot&&(Ce.cStyleComments?(ot>1?He.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):He.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ze.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):He.push([v,/^#[^\r\n]*/,null,"#"])),Ce.cStyleComments&&(Ze.push([v,/^\/\/[^\r\n]*/,null]),Ze.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var et=Ce.regexLiterals;if(et){var Ke=et>1?"":`
|
|
\r`,Ve=Ke?".":"[\\S\\s]",ht="/(?=[^/*"+Ke+"])(?:[^/\\x5B\\x5C"+Ke+"]|\\x5C"+Ve+"|\\x5B(?:[^\\x5C\\x5D"+Ke+"]|\\x5C"+Ve+")*(?:\\x5D|$))+/";Ze.push(["lang-regex",RegExp("^"+J+"("+ht+")")])}var mt=Ce.types;mt&&Ze.push([c,mt]);var gt=(""+Ce.keywords).replace(/^ | $/g,"");gt.length&&Ze.push([w,new RegExp("^(?:"+gt.replace(/[\s,]+/g,"|")+")\\b"),null]),He.push([i,/^\s+/,null,` \r
|
|
\xA0`]);var Et="^.[^\\s\\w.$@'\"`/\\\\]*";return Ce.regexLiterals&&(Et+="(?!s*/)"),Ze.push([l,/^@[a-z_$][a-z_$@0-9]*/i,null],[c,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[i,/^[a-z_$][a-z_$@0-9]*/i,null],[l,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[i,/^\\[\s\S]?/,null],[a,new RegExp(Et),null]),Ee(He,Ze)}var Be=We({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ne(Ce,He,Ze){for(var ot=/(?:^|\s)nocode(?:\s|$)/,et=/\r\n?|\n/,Ke=Ce.ownerDocument,Ve=Ke.createElement("li");Ce.firstChild;)Ve.appendChild(Ce.firstChild);var ht=[Ve];function mt(Se){var Je=Se.nodeType;if(Je==1&&!ot.test(Se.className))if(Se.nodeName==="br")gt(Se),Se.parentNode&&Se.parentNode.removeChild(Se);else for(var nt=Se.firstChild;nt;nt=nt.nextSibling)mt(nt);else if((Je==3||Je==4)&&Ze){var Fe=Se.nodeValue,qe=Fe.match(et);if(qe){var xe=Fe.substring(0,qe.index);Se.nodeValue=xe;var he=Fe.substring(qe.index+qe[0].length);if(he){var ge=Se.parentNode;ge.insertBefore(Ke.createTextNode(he),Se.nextSibling)}gt(Se),xe||Se.parentNode.removeChild(Se)}}}function gt(Se){for(;!Se.nextSibling;)if(Se=Se.parentNode,!Se)return;function Je(qe,xe){var he=xe?qe.cloneNode(!1):qe,ge=qe.parentNode;if(ge){var re=Je(ge,1),ie=qe.nextSibling;re.appendChild(he);for(var oe=ie;oe;oe=ie)ie=oe.nextSibling,re.appendChild(oe)}return he}for(var nt=Je(Se.nextSibling,0),Fe;(Fe=nt.parentNode)&&Fe.nodeType===1;)nt=Fe;ht.push(nt)}for(var Et=0;Et<ht.length;++Et)mt(ht[Et]);He===(He|0)&&ht[0].setAttribute("value",He);var ft=Ke.createElement("ol");ft.className="linenums";for(var Ct=Math.max(0,He-1|0)||0,Et=0,_e=ht.length;Et<_e;++Et)Ve=ht[Et],Ve.className="L"+(Et+Ct)%10,Ve.firstChild||Ve.appendChild(Ke.createTextNode("\xA0")),ft.appendChild(Ve);Ce.appendChild(ft)}function Le(Ce){var He=/\bMSIE\s(\d+)/.exec(navigator.userAgent);He=He&&+He[1]<=8;var Ze=/\n/g,ot=Ce.sourceCode,et=ot.length,Ke=0,Ve=Ce.spans,ht=Ve.length,mt=0,gt=Ce.decorations,Et=gt.length,ft=0;gt[Et]=et;var Ct,_e;for(_e=Ct=0;_e<Et;)gt[_e]!==gt[_e+2]?(gt[Ct++]=gt[_e++],gt[Ct++]=gt[_e++]):_e+=2;for(Et=Ct,_e=Ct=0;_e<Et;){for(var Se=gt[_e],Je=gt[_e+1],nt=_e+2;nt+2<=Et&>[nt+1]===Je;)nt+=2;gt[Ct++]=Se,gt[Ct++]=Je,_e=nt}Et=gt.length=Ct;var Fe=Ce.sourceNode,qe="";Fe&&(qe=Fe.style.display,Fe.style.display="none");try{for(var xe=null;mt<ht;){var he=Ve[mt],ge=Ve[mt+2]||et,re=gt[ft+2]||et,nt=Math.min(ge,re),ie=Ve[mt+1],oe;if(ie.nodeType!==1&&(oe=ot.substring(Ke,nt))){He&&(oe=oe.replace(Ze,"\r")),ie.nodeValue=oe;var ue=ie.ownerDocument,Oe=ue.createElement("span");Oe.className=gt[ft+1];var we=ie.parentNode;we.replaceChild(Oe,ie),Oe.appendChild(ie),Ke<ge&&(Ve[mt+1]=ie=ue.createTextNode(ot.substring(nt,ge)),we.insertBefore(ie,Oe.nextSibling))}Ke=nt,Ke>=ge&&(mt+=2),Ke>=re&&(ft+=2)}}finally{Fe&&(Fe.style.display=qe)}}var Ue={};function ye(Ce,He){for(var Ze=He.length;--Ze>=0;){var ot=He[Ze];Ue.hasOwnProperty(ot)?B.console&&console.warn("cannot override language handler %s",ot):Ue[ot]=Ce}}function ce(Ce,He){return Ce&&Ue.hasOwnProperty(Ce)||(Ce=/^\s*</.test(He)?"default-markup":"default-code"),Ue[Ce]}ye(Be,["default-code"]),ye(Ee([],[[i,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[a,/^(?:<[%?]|[%?]>)/],["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"]),ye(Ee([[i,/^[\s]+/,null,` \r
|
|
`],[C,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[L,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[a,/^[=<>\/]+/],["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"]),ye(Ee([],[[C,/^[\s\S]+/]]),["uq.val"]),ye(We({keywords:R,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),ye(We({keywords:"null,true,false"}),["json"]),ye(We({keywords:_,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),ye(We({keywords:P,cStyleComments:!0}),["java"]),ye(We({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ye(We({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ye(We({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ye(We({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ye(We({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ye(We({keywords:S,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ye(Ee([],[[f,/^[\s\S]+/]]),["regex"]);function ne(Ce){var He=Ce.langExtension;try{var Ze=j(Ce.sourceNode,Ce.pre),ot=Ze.sourceCode;Ce.sourceCode=ot,Ce.spans=Ze.spans,Ce.basePos=0,ce(He,ot)(Ce),Le(Ce)}catch(et){B.console&&console.log(et&&et.stack||et)}}function ve(Ce,He,Ze){var ot=Ze||!1,et=He||null,Ke=document.createElement("div");Ke.innerHTML="<pre>"+Ce+"</pre>",Ke=Ke.firstChild,ot&&Ne(Ke,ot,!0);var Ve={langExtension:et,numberLines:ot,sourceNode:Ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Ve),Ke.innerHTML}function le(Ce,He){var Ze=He||document.body,ot=Ze.ownerDocument||document;function et(he){return Ze.getElementsByTagName(he)}for(var Ke=[et("pre"),et("code"),et("xmp")],Ve=[],ht=0;ht<Ke.length;++ht)for(var mt=0,gt=Ke[ht].length;mt<gt;++mt)Ve.push(Ke[ht][mt]);Ke=null;var Et=Date;Et.now||(Et={now:function(){return+new Date}});var ft=0,Ct=/\blang(?:uage)?-([\w.]+)(?!\S)/,_e=/\bprettyprint\b/,Se=/\bprettyprinted\b/,Je=/pre|xmp/i,nt=/^code$/i,Fe=/^(?:pre|code|xmp)$/i,qe={};function xe(){for(var he=B.PR_SHOULD_USE_CONTINUATION?Et.now()+250:Infinity;ft<Ve.length&&Et.now()<he;ft++){for(var ge=Ve[ft],re=qe,ie=ge;ie=ie.previousSibling;){var oe=ie.nodeType,ue=(oe===7||oe===8)&&ie.nodeValue;if(ue?!/^\??prettify\b/.test(ue):oe!==3||/\S/.test(ie.nodeValue))break;if(ue){re={},ue.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ye,Me,Xe){re[Me]=Xe});break}}var Oe=ge.className;if((re!==qe||_e.test(Oe))&&!Se.test(Oe)){for(var we=!1,rt=ge.parentNode;rt;rt=rt.parentNode){var yt=rt.tagName;if(Fe.test(yt)&&rt.className&&_e.test(rt.className)){we=!0;break}}if(!we){ge.className+=" prettyprinted";var wt=re.lang;if(!wt){wt=Oe.match(Ct);var xt;!wt&&(xt=me(ge))&&nt.test(xt.tagName)&&(wt=xt.className.match(Ct)),wt&&(wt=wt[1])}var pt;if(Je.test(ge.tagName))pt=1;else{var Qe=ge.currentStyle,ze=ot.defaultView,De=Qe?Qe.whiteSpace:ze&&ze.getComputedStyle?ze.getComputedStyle(ge,null).getPropertyValue("white-space"):0;pt=De&&De.substring(0,3)==="pre"}var ae=re.linenums;(ae=ae==="true"||+ae)||(ae=Oe.match(/\blinenums\b(?::(\d+))?/),ae=ae?ae[1]&&ae[1].length?+ae[1]:!0:!1),ae&&Ne(ge,ae,pt);var de={langExtension:wt,sourceNode:ge,numberLines:ae,pre:pt,sourceCode:null,basePos:null,spans:null,decorations:null};ne(de)}}}ft<Ve.length?B.setTimeout(xe,250):typeof Ce=="function"&&Ce()}xe()}var Re=B.PR={createSimpleLexer:Ee,registerLangHandler:ye,sourceDecorator:We,PR_ATTRIB_NAME:L,PR_ATTRIB_VALUE:C,PR_COMMENT:v,PR_DECLARATION:b,PR_KEYWORD:w,PR_LITERAL:l,PR_NOCODE:H,PR_PLAIN:i,PR_PUNCTUATION:a,PR_SOURCE:m,PR_STRING:f,PR_TAG:x,PR_TYPE:c,prettyPrintOne:k?B.prettyPrintOne=ve:O=ve,prettyPrint:U=k?B.prettyPrint=le:U=le},Ie=B.define;typeof Ie=="function"&&Ie.amd&&Ie("google-code-prettify",[],function(){return Re})})()},SMhR:function($e,ke){$e.exports="data:image/png;base64,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"},TGq3:function($e,ke,F){$e.exports=F.p+"static/lockclose.365036e8.svg"},"VrN/":function($e,ke,F){(function(ee,X){$e.exports=X()})(this,function(){"use strict";var ee=navigator.userAgent,X=navigator.platform,k=/gecko\/\d/i.test(ee),Q=/MSIE \d/.test(ee),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee),O=/Edge\/(\d+)/.exec(ee),U=Q||N||O,B=U&&(Q?document.documentMode||6:+(O||N)[1]),I=!O&&/WebKit\//.test(ee),D=I&&/Qt\/\d+\.\d+/.test(ee),E=!O&&/Chrome\//.test(ee),R=/Opera\//.test(ee),P=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ee),S=/PhantomJS/.test(ee),y=!O&&/AppleWebKit/.test(ee)&&/Mobile\/\w+/.test(ee),d=/Android/.test(ee),s=y||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ee),u=y||/Mac/.test(X),h=/\bCrOS\b/.test(ee),T=/win/i.test(X),g=R&&ee.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(R=!1,I=!0);var f=u&&(D||R&&(g==null||g<12.11)),w=k||U&&B>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var c=function(e,t){var r=e.className,n=v(t).exec(r);if(n){var o=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(o?n[1]+o:"")}};function l(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function a(e,t){return l(e).appendChild(t)}function i(e,t,r,n){var o=document.createElement(e);if(r&&(o.className=r),n&&(o.style.cssText=n),typeof t=="string")o.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)o.appendChild(t[M]);return o}function x(e,t,r,n){var o=i(e,t,r,n);return o.setAttribute("role","presentation"),o}var b;document.createRange?b=function(e,t,r,n){var o=document.createRange();return o.setEnd(n||e,r),o.setStart(e,t),o}:b=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(o){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function m(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function C(e,t){var r=e.className;v(t).test(r)||(e.className+=(r?" ":"")+t)}function H(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!v(r[n]).test(t)&&(t+=" "+r[n]);return t}var J=function(e){e.select()};y?J=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:U&&(J=function(e){try{e.select()}catch(t){}});function W(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function j(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function $(e,t,r,n,o){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=n||0,z=o||0;;){var Z=e.indexOf(" ",M);if(Z<0||Z>=t)return z+(t-M);z+=Z-M,z+=r-z%r,M=Z+1}}var se=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};se.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},se.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function me(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var Ee=50,We={toString:function(){return"CodeMirror.Pass"}},Be={scroll:!1},Ne={origin:"*mouse"},Le={origin:"+move"};function Ue(e,t,r){for(var n=0,o=0;;){var M=e.indexOf(" ",n);M==-1&&(M=e.length);var z=M-n;if(M==e.length||o+z>=t)return n+Math.min(z,t-o);if(o+=M-n,o+=r-o%r,n=M+1,o>=t)return n}}var ye=[""];function ce(e){for(;ye.length<=e;)ye.push(ne(ye)+" ");return ye[e]}function ne(e){return e[e.length-1]}function ve(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function le(e,t,r){for(var n=0,o=r(t);n<e.length&&r(e[n])<=o;)n++;e.splice(n,0,t)}function Re(){}function Ie(e,t){var r;return Object.create?r=Object.create(e):(Re.prototype=e,r=new Re),t&&j(t,r),r}var Ce=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function He(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ce.test(e))}function Ze(e,t){return t?t.source.indexOf("\\w")>-1&&He(e)?!0:t.test(e):He(e)}function ot(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var et=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ke(e){return e.charCodeAt(0)>=768&&et.test(e)}function Ve(e,t,r){for(;(r<0?t>0:t<e.length)&&Ke(e.charAt(t));)t+=r;return t}function ht(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var o=(t+r)/2,M=n<0?Math.ceil(o):Math.floor(o);if(M==t)return e(M)?t:r;e(M)?r=M:t=M+n}}function mt(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var o=!1,M=0;M<e.length;++M){var z=e[M];(z.from<r&&z.to>t||t==r&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,r),z.level==1?"rtl":"ltr",M),o=!0)}o||n(t,r,"ltr")}var gt=null;function Et(e,t,r){var n;gt=null;for(var o=0;o<e.length;++o){var M=e[o];if(M.from<t&&M.to>t)return o;M.to==t&&(M.from!=M.to&&r=="before"?n=o:gt=o),M.from==t&&(M.from!=M.to&&r!="before"?n=o:gt=o)}return n!=null?n:gt}var ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,M=/[LRr]/,z=/[Lb1n]/,Z=/[1n]/;function q(te,be,Te){this.level=te,this.from=be,this.to=Te}return function(te,be){var Te=be=="ltr"?"L":"R";if(te.length==0||be=="ltr"&&!n.test(te))return!1;for(var Ge=te.length,je=[],st=0;st<Ge;++st)je.push(r(te.charCodeAt(st)));for(var bt=0,At=Te;bt<Ge;++bt){var Dt=je[bt];Dt=="m"?je[bt]=At:At=Dt}for(var Ut=0,Lt=Te;Ut<Ge;++Ut){var Wt=je[Ut];Wt=="1"&&Lt=="r"?je[Ut]="n":M.test(Wt)&&(Lt=Wt,Wt=="r"&&(je[Ut]="R"))}for(var tn=1,Zt=je[0];tn<Ge-1;++tn){var dn=je[tn];dn=="+"&&Zt=="1"&&je[tn+1]=="1"?je[tn]="1":dn==","&&Zt==je[tn+1]&&(Zt=="1"||Zt=="n")&&(je[tn]=Zt),Zt=dn}for(var Dn=0;Dn<Ge;++Dn){var nr=je[Dn];if(nr==",")je[Dn]="N";else if(nr=="%"){var Un=void 0;for(Un=Dn+1;Un<Ge&&je[Un]=="%";++Un);for(var Mr=Dn&&je[Dn-1]=="!"||Un<Ge&&je[Un]=="1"?"1":"N",Ar=Dn;Ar<Un;++Ar)je[Ar]=Mr;Dn=Un-1}}for(var Gn=0,Tr=Te;Gn<Ge;++Gn){var dr=je[Gn];Tr=="L"&&dr=="1"?je[Gn]="L":M.test(dr)&&(Tr=dr)}for(var qn=0;qn<Ge;++qn)if(o.test(je[qn])){var Vn=void 0;for(Vn=qn+1;Vn<Ge&&o.test(je[Vn]);++Vn);for(var jn=(qn?je[qn-1]:Te)=="L",wr=(Vn<Ge?je[Vn]:Te)=="L",Hi=jn==wr?jn?"L":"R":Te,vi=qn;vi<Vn;++vi)je[vi]=Hi;qn=Vn-1}for(var mr=[],ti,rr=0;rr<Ge;)if(z.test(je[rr])){var Oo=rr;for(++rr;rr<Ge&&z.test(je[rr]);++rr);mr.push(new q(0,Oo,rr))}else{var ai=rr,Ai=mr.length,Ti=be=="rtl"?1:0;for(++rr;rr<Ge&&je[rr]!="L";++rr);for(var br=ai;br<rr;)if(Z.test(je[br])){ai<br&&(mr.splice(Ai,0,new q(1,ai,br)),Ai+=Ti);var Ki=br;for(++br;br<rr&&Z.test(je[br]);++br);mr.splice(Ai,0,new q(2,Ki,br)),Ai+=Ti,ai=br}else++br;ai<rr&&mr.splice(Ai,0,new q(1,ai,rr))}return be=="ltr"&&(mr[0].level==1&&(ti=te.match(/^\s+/))&&(mr[0].from=ti[0].length,mr.unshift(new q(0,0,ti[0].length))),ne(mr).level==1&&(ti=te.match(/\s+$/))&&(ne(mr).to-=ti[0].length,mr.push(new q(0,Ge-ti[0].length,Ge)))),be=="rtl"?mr.reverse():mr}}();function Ct(e,t){var r=e.order;return r==null&&(r=e.order=ft(e.text,t)),r}var _e=[],Se=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||_e).concat(r)}};function Je(e,t){return e._handlers&&e._handlers[t]||_e}function nt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,o=n&&n[t];if(o){var M=me(o,r);M>-1&&(n[t]=o.slice(0,M).concat(o.slice(M+1)))}}}function Fe(e,t){var r=Je(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),o=0;o<r.length;++o)r[o].apply(null,n)}function qe(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Fe(e,r||t.type,e,t),oe(t)||t.codemirrorIgnore}function xe(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)me(r,t[n])==-1&&r.push(t[n])}function he(e,t){return Je(e,t).length>0}function ge(e){e.prototype.on=function(t,r){Se(this,t,r)},e.prototype.off=function(t,r){nt(this,t,r)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ue(e){re(e),ie(e)}function Oe(e){return e.target||e.srcElement}function we(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var rt=function(){if(U&&B<9)return!1;var e=i("div");return"draggable"in e||"dragDrop"in e}(),yt;function wt(e){if(yt==null){var t=i("span","\u200B");a(e,i("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(U&&B<8))}var r=yt?i("span","\u200B"):i("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var xt;function pt(e){if(xt!=null)return xt;var t=a(e,document.createTextNode("A\u062EA")),r=b(t,0,1).getBoundingClientRect(),n=b(t,1,2).getBoundingClientRect();return l(e),!r||r.left==r.right?!1:xt=n.right-r.right<3}var Qe=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var o=e.indexOf(`
|
|
`,t);o==-1&&(o=e.length);var M=e.slice(t,e.charAt(o-1)=="\r"?o-1:o),z=M.indexOf("\r");z!=-1?(r.push(M.slice(0,z)),t+=z+1):(r.push(M),t=o+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ze=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},De=function(){var e=i("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ae=null;function de(e){if(ae!=null)return ae;var t=a(e,i("span","x")),r=t.getBoundingClientRect(),n=b(t,0,1).getBoundingClientRect();return ae=Math.abs(r.left-n.left)>1}var Ye={},Me={};function Xe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ye[e]=t}function dt(e,t){Me[e]=t}function Pe(e){if(typeof e=="string"&&Me.hasOwnProperty(e))e=Me[e];else if(e&&typeof e.name=="string"&&Me.hasOwnProperty(e.name)){var t=Me[e.name];typeof t=="string"&&(t={name:t}),e=Ie(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function at(e,t){t=Pe(t);var r=Ye[t.name];if(!r)return at(e,"text/plain");var n=r(e,t);if(vt.hasOwnProperty(t.name)){var o=vt[t.name];for(var M in o){if(!o.hasOwnProperty(M))continue;n.hasOwnProperty(M)&&(n["_"+M]=n[M]),n[M]=o[M]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var vt={};function St(e,t){var r=vt.hasOwnProperty(e)?vt[e]:vt[e]={};j(t,r)}function Rt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),r[n]=o}return r}function qt(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function sn(e,t,r){return e.startState?e.startState(t,r):!0}var Xt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Xt.prototype.eol=function(){return this.pos>=this.string.length},Xt.prototype.sol=function(){return this.pos==this.lineStart},Xt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xt.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Xt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xt.prototype.skipToEnd=function(){this.pos=this.string.length},Xt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xt.prototype.backUp=function(e){this.pos-=e},Xt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=$(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?$(this.string,this.lineStart,this.tabSize):0)},Xt.prototype.indentation=function(){return $(this.string,null,this.tabSize)-(this.lineStart?$(this.string,this.lineStart,this.tabSize):0)},Xt.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(z){return r?z.toLowerCase():z},o=this.string.substr(this.pos,e.length);if(n(o)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},Xt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function _t(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var o=r.children[n],M=o.chunkSize();if(t<M){r=o;break}t-=M}return r.lines[t]}function cn(e,t,r){var n=[],o=t.line;return e.iter(t.line,r.line+1,function(M){var z=M.text;o==r.line&&(z=z.slice(0,r.ch)),o==t.line&&(z=z.slice(t.ch)),n.push(z),++o}),n}function zt(e,t,r){var n=[];return e.iter(t,r,function(o){n.push(o.text)}),n}function $t(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Nt(e){if(e.parent==null)return null;for(var t=e.parent,r=me(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var o=0;!(n.children[o]==t);++o)r+=n.children[o].chunkSize();return r+t.first}function nn(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var o=e.children[n],M=o.height;if(t<M){e=o;continue e}t-=M,r+=o.chunkSize()}return r}while(!e.lines);for(var z=0;z<e.lines.length;++z){var Z=e.lines[z],q=Z.height;if(t<q)break;t-=q}return r+z}function An(e,t){return t>=e.first&&t<e.first+e.size}function Tn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ct(e,t,r){if(r===void 0&&(r=null),!(this instanceof ct))return new ct(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Gt(e,t){return e.line-t.line||e.ch-t.ch}function Ln(e,t){return e.sticky==t.sticky&&Gt(e,t)==0}function Fn(e){return ct(e.line,e.ch)}function kn(e,t){return Gt(e,t)<0?t:e}function Xn(e,t){return Gt(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function p(e,t){if(t.line<e.first)return ct(e.first,0);var r=e.first+e.size-1;return t.line>r?ct(r,_t(e,r).text.length):A(t,_t(e,t.line).text.length)}function A(e,t){var r=e.ch;return r==null||r>t?ct(e.line,t):r<0?ct(e.line,0):e}function K(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=p(e,t[n]);return r}var Y=function(e,t){this.state=e,this.lookAhead=t},V=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};V.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},V.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,r){return t instanceof Y?new V(e,Rt(e.mode,t.state),r,t.lookAhead):new V(e,Rt(e.mode,t),r)},V.prototype.save=function(e){var t=e!==!1?Rt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Y(t,this.maxLookAhead):t};function Ae(e,t,r,n){var o=[e.state.modeGen],M={};ir(e,t.text,e.doc.mode,r,function(te,be){return o.push(te,be)},M,n);for(var z=r.state,Z=function(te){r.baseTokens=o;var be=e.state.overlays[te],Te=1,Ge=0;r.state=!0,ir(e,t.text,be.mode,r,function(je,st){for(var bt=Te;Ge<je;){var At=o[Te];At>je&&o.splice(Te,1,je,o[Te+1],At),Te+=2,Ge=Math.min(je,At)}if(!st)return;if(be.opaque)o.splice(bt,Te-bt,je,"overlay "+st),Te=bt+2;else for(;bt<Te;bt+=2){var Dt=o[bt+1];o[bt+1]=(Dt?Dt+" ":"")+"overlay "+st}},M),r.state=z,r.baseTokens=null,r.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Z(q);return{styles:o,classes:M.bgClass||M.textClass?M:null}}function it(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Tt(e,Nt(t)),o=t.text.length>e.options.maxHighlightLength&&Rt(e.doc.mode,n.state),M=Ae(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Tt(e,t,r){var n=e.doc,o=e.display;if(!n.mode.startState)return new V(n,!0,t);var M=Rn(e,t,r),z=M>n.first&&_t(n,M-1).stateAfter,Z=z?V.fromSaved(n,z,M):new V(n,sn(n.mode),M);return n.iter(M,t,function(q){Bt(e,q.text,Z);var te=Z.line;q.stateAfter=te==t-1||te%5==0||te>=o.viewFrom&&te<o.viewTo?Z.save():null,Z.nextLine()}),r&&(n.modeFrontier=Z.line),Z}function Bt(e,t,r,n){var o=e.doc.mode,M=new Xt(t,e.options.tabSize,r);for(M.start=M.pos=n||0,t==""&&fe(o,r.state);!M.eol();)Ft(o,M,r.state),M.start=M.pos}function fe(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=qt(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function Ft(e,t,r,n){for(var o=0;o<10;o++){n&&(n[0]=qt(e,r).mode);var M=e.token(t,r);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var Qt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function xn(e,t,r,n){var o=e.doc,M=o.mode,z;t=p(o,t);var Z=_t(o,t.line),q=Tt(e,t.line,r),te=new Xt(Z.text,e.options.tabSize,q),be;for(n&&(be=[]);(n||te.pos<t.ch)&&!te.eol();)te.start=te.pos,z=Ft(M,te,q.state),n&&be.push(new Qt(te,z,Rt(o.mode,q.state)));return n?be:new Qt(te,z,q.state)}function Hn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function ir(e,t,r,n,o,M,z){var Z=r.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var q=0,te=null,be=new Xt(t,e.options.tabSize,n),Te,Ge=e.options.addModeClass&&[null];for(t==""&&Hn(fe(r,n.state),M);!be.eol();){if(be.pos>e.options.maxHighlightLength?(Z=!1,z&&Bt(e,t,n,be.pos),be.pos=t.length,Te=null):Te=Hn(Ft(r,be,n.state,Ge),M),Ge){var je=Ge[0].name;je&&(Te="m-"+(Te?je+" "+Te:je))}if(!Z||te!=Te){for(;q<be.start;)q=Math.min(be.start,q+5e3),o(q,te);te=Te}be.start=be.pos}for(;q<be.pos;){var st=Math.min(be.pos,q+5e3);o(st,te),q=st}}function Rn(e,t,r){for(var n,o,M=e.doc,z=r?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>z;--Z){if(Z<=M.first)return M.first;var q=_t(M,Z-1),te=q.stateAfter;if(te&&(!r||Z+(te instanceof Y?te.lookAhead:0)<=M.modeFrontier))return Z;var be=$(q.text,null,e.options.tabSize);(o==null||n>be)&&(o=Z-1,n=be)}return o}function cr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var o=_t(e,n).stateAfter;if(o&&(!(o instanceof Y)||n+o.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var gr=!1,Qn=!1;function hr(){gr=!0}function $n(){Qn=!0}function kr(e,t,r){this.marker=e,this.from=t,this.to=r}function ar(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ir(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Er(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Rr(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var M=e[o],z=M.marker,Z=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);if(Z||M.from==t&&z.type=="bookmark"&&(!r||!M.marker.insertLeft)){var q=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);(n||(n=[])).push(new kr(z,M.from,q?null:M.to))}}return n}function Qr(e,t,r){var n;if(e)for(var o=0;o<e.length;++o){var M=e[o],z=M.marker,Z=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);if(Z||M.from==t&&z.type=="bookmark"&&(!r||M.marker.insertLeft)){var q=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);(n||(n=[])).push(new kr(z,q?null:M.from-t,M.to==null?null:M.to-t))}}return n}function xr(e,t){if(t.full)return null;var r=An(e,t.from.line)&&_t(e,t.from.line).markedSpans,n=An(e,t.to.line)&&_t(e,t.to.line).markedSpans;if(!r&&!n)return null;var o=t.from.ch,M=t.to.ch,z=Gt(t.from,t.to)==0,Z=Rr(r,o,z),q=Qr(n,M,z),te=t.text.length==1,be=ne(t.text).length+(te?o:0);if(Z)for(var Te=0;Te<Z.length;++Te){var Ge=Z[Te];if(Ge.to==null){var je=ar(q,Ge.marker);je?te&&(Ge.to=je.to==null?null:je.to+be):Ge.to=o}}if(q)for(var st=0;st<q.length;++st){var bt=q[st];if(bt.to!=null&&(bt.to+=be),bt.from==null){var At=ar(Z,bt.marker);At||(bt.from=be,te&&(Z||(Z=[])).push(bt))}else bt.from+=be,te&&(Z||(Z=[])).push(bt)}Z&&(Z=or(Z)),q&&q!=Z&&(q=or(q));var Dt=[Z];if(!te){var Ut=t.text.length-2,Lt;if(Ut>0&&Z)for(var Wt=0;Wt<Z.length;++Wt)Z[Wt].to==null&&(Lt||(Lt=[])).push(new kr(Z[Wt].marker,null,null));for(var tn=0;tn<Ut;++tn)Dt.push(Lt);Dt.push(q)}return Dt}function or(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Fr(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(je){if(je.markedSpans)for(var st=0;st<je.markedSpans.length;++st){var bt=je.markedSpans[st].marker;bt.readOnly&&(!n||me(n,bt)==-1)&&(n||(n=[])).push(bt)}}),!n)return null;for(var o=[{from:t,to:r}],M=0;M<n.length;++M)for(var z=n[M],Z=z.find(0),q=0;q<o.length;++q){var te=o[q];if(Gt(te.to,Z.from)<0||Gt(te.from,Z.to)>0)continue;var be=[q,1],Te=Gt(te.from,Z.from),Ge=Gt(te.to,Z.to);(Te<0||!z.inclusiveLeft&&!Te)&&be.push({from:te.from,to:Z.from}),(Ge>0||!z.inclusiveRight&&!Ge)&&be.push({from:Z.to,to:te.to}),o.splice.apply(o,be),q+=be.length-3}return o}function Pr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function jr(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function En(e){return e.inclusiveLeft?-1:0}function on(e){return e.inclusiveRight?1:0}function Mn(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),o=t.find(),M=Gt(n.from,o.from)||En(e)-En(t);if(M)return-M;var z=Gt(n.to,o.to)||on(e)-on(t);return z||t.id-e.id}function hn(e,t){var r=Qn&&e.markedSpans,n;if(r)for(var o=void 0,M=0;M<r.length;++M)o=r[M],o.marker.collapsed&&(t?o.from:o.to)==null&&(!n||Mn(n,o.marker)<0)&&(n=o.marker);return n}function On(e){return hn(e,!0)}function fn(e){return hn(e,!1)}function _r(e,t){var r=Qn&&e.markedSpans,n;if(r)for(var o=0;o<r.length;++o){var M=r[o];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!n||Mn(n,M.marker)<0)&&(n=M.marker)}return n}function In(e,t,r,n,o){var M=_t(e,t),z=Qn&&M.markedSpans;if(z)for(var Z=0;Z<z.length;++Z){var q=z[Z];if(!q.marker.collapsed)continue;var te=q.marker.find(0),be=Gt(te.from,r)||En(q.marker)-En(o),Te=Gt(te.to,n)||on(q.marker)-on(o);if(be>=0&&Te<=0||be<=0&&Te>=0)continue;if(be<=0&&(q.marker.inclusiveRight&&o.inclusiveLeft?Gt(te.to,r)>=0:Gt(te.to,r)>0)||be>=0&&(q.marker.inclusiveRight&&o.inclusiveLeft?Gt(te.from,n)<=0:Gt(te.from,n)<0))return!0}}function Yn(e){for(var t;t=On(e);)e=t.find(-1,!0).line;return e}function zr(e){for(var t;t=fn(e);)e=t.find(1,!0).line;return e}function Wr(e){for(var t,r;t=fn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Or(e,t){var r=_t(e,t),n=Yn(r);return r==n?t:Nt(n)}function Yr(e,t){if(t>e.lastLine())return t;var r=_t(e,t),n;if(!sr(e,r))return t;for(;n=fn(r);)r=n.find(1,!0).line;return Nt(r)+1}function sr(e,t){var r=Qn&&t.markedSpans;if(r)for(var n=void 0,o=0;o<r.length;++o){if(n=r[o],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Hr(e,t,n))return!0}}function Hr(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return Hr(e,n.line,ar(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var o=void 0,M=0;M<t.markedSpans.length;++M)if(o=t.markedSpans[M],o.marker.collapsed&&!o.marker.widgetNode&&o.from==r.to&&(o.to==null||o.to!=r.from)&&(o.marker.inclusiveLeft||r.marker.inclusiveRight)&&Hr(e,t,o))return!0}function Cr(e){e=Yn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var o=r.lines[n];if(o==e)break;t+=o.height}for(var M=r.parent;M;r=M,M=r.parent)for(var z=0;z<M.children.length;++z){var Z=M.children[z];if(Z==r)break;t+=Z.height}return t}function Kr(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=On(n);){var o=r.find(0,!0);n=o.from.line,t+=o.from.ch-o.to.ch}for(n=e;r=fn(n);){var M=r.find(0,!0);t-=n.text.length-M.from.ch,n=M.to.line,t+=n.text.length-M.to.ch}return t}function Jr(e){var t=e.display,r=e.doc;t.maxLine=_t(r,r.first),t.maxLineLength=Kr(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var o=Kr(n);o>t.maxLineLength&&(t.maxLineLength=o,t.maxLine=n)})}var lr=function(e,t,r){this.text=e,jr(this,t),this.height=r?r(this):1};lr.prototype.lineNo=function(){return Nt(this)},ge(lr);function oi(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Pr(e),jr(e,r);var o=n?n(e):1;o!=e.height&&$t(e,o)}function si(e){e.parent=null,Pr(e)}var Ht={},en={};function Vt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?en:Ht;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function an(e,t){var r=x("span",null,null,I?"padding-right: .1px":null),n={pre:x("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var M=o?t.rest[o-1]:t.line,z=void 0;n.pos=0,n.addToken=Cn,pt(e.display.measure)&&(z=Ct(M,e.doc.direction))&&(n.addToken=Pn(n.addToken,z)),n.map=[];var Z=t!=e.display.externalMeasured&&Nt(M);It(M,n,it(e,M,Z)),M.styleClasses&&(M.styleClasses.bgClass&&(n.bgClass=H(M.styleClasses.bgClass,n.bgClass||"")),M.styleClasses.textClass&&(n.textClass=H(M.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(wt(e.display.measure))),o==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(I){var q=n.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Fe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=H(n.pre.className,n.textClass||"")),n}function pn(e){var t=i("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Cn(e,t,r,n,o,M,z){if(!t)return;var Z=e.splitSpaces?un(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,be;if(!q.test(t))e.col+=t.length,be=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,be),U&&B<9&&(te=!0),e.pos+=t.length;else{be=document.createDocumentFragment();for(var Te=0;;){q.lastIndex=Te;var Ge=q.exec(t),je=Ge?Ge.index-Te:t.length-Te;if(je){var st=document.createTextNode(Z.slice(Te,Te+je));U&&B<9?be.appendChild(i("span",[st])):be.appendChild(st),e.map.push(e.pos,e.pos+je,st),e.col+=je,e.pos+=je}if(!Ge)break;Te+=je+1;var bt=void 0;if(Ge[0]==" "){var At=e.cm.options.tabSize,Dt=At-e.col%At;bt=be.appendChild(i("span",ce(Dt),"cm-tab")),bt.setAttribute("role","presentation"),bt.setAttribute("cm-text"," "),e.col+=Dt}else Ge[0]=="\r"||Ge[0]==`
|
|
`?(bt=be.appendChild(i("span",Ge[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),bt.setAttribute("cm-text",Ge[0]),e.col+=1):(bt=e.cm.options.specialCharPlaceholder(Ge[0]),bt.setAttribute("cm-text",Ge[0]),U&&B<9?be.appendChild(i("span",[bt])):be.appendChild(bt),e.col+=1);e.map.push(e.pos,e.pos+1,bt),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,r||n||o||te||M||z){var Ut=r||"";n&&(Ut+=n),o&&(Ut+=o);var Lt=i("span",[be],Ut,M);if(z)for(var Wt in z)z.hasOwnProperty(Wt)&&Wt!="style"&&Wt!="class"&&Lt.setAttribute(Wt,z[Wt]);return e.content.appendChild(Lt)}e.content.appendChild(be)}function un(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",o=0;o<e.length;o++){var M=e.charAt(o);M==" "&&r&&(o==e.length-1||e.charCodeAt(o+1)==32)&&(M="\xA0"),n+=M,r=M==" "}return n}function Pn(e,t){return function(r,n,o,M,z,Z,q){o=o?o+" cm-force-border":"cm-force-border";for(var te=r.pos,be=te+n.length;;){for(var Te=void 0,Ge=0;Ge<t.length&&!(Te=t[Ge],Te.to>te&&Te.from<=te);Ge++);if(Te.to>=be)return e(r,n,o,M,z,Z,q);e(r,n.slice(0,Te.to-te),o,M,null,Z,q),M=null,n=n.slice(Te.to-te),te=Te.to}}}function Kn(e,t,r,n){var o=!n&&r.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",r.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function It(e,t,r){var n=e.markedSpans,o=e.text,M=0;if(!n){for(var z=1;z<r.length;z+=2)t.addToken(t,o.slice(M,M=r[z]),Vt(r[z+1],t.cm.options));return}for(var Z=o.length,q=0,te=1,be="",Te,Ge,je=0,st,bt,At,Dt,Ut;;){if(je==q){st=bt=At=Ge="",Ut=null,Dt=null,je=Infinity;for(var Lt=[],Wt=void 0,tn=0;tn<n.length;++tn){var Zt=n[tn],dn=Zt.marker;if(dn.type=="bookmark"&&Zt.from==q&&dn.widgetNode)Lt.push(dn);else if(Zt.from<=q&&(Zt.to==null||Zt.to>q||dn.collapsed&&Zt.to==q&&Zt.from==q)){if(Zt.to!=null&&Zt.to!=q&&je>Zt.to&&(je=Zt.to,bt=""),dn.className&&(st+=" "+dn.className),dn.css&&(Ge=(Ge?Ge+";":"")+dn.css),dn.startStyle&&Zt.from==q&&(At+=" "+dn.startStyle),dn.endStyle&&Zt.to==je&&(Wt||(Wt=[])).push(dn.endStyle,Zt.to),dn.title&&((Ut||(Ut={})).title=dn.title),dn.attributes)for(var Dn in dn.attributes)(Ut||(Ut={}))[Dn]=dn.attributes[Dn];dn.collapsed&&(!Dt||Mn(Dt.marker,dn)<0)&&(Dt=Zt)}else Zt.from>q&&je>Zt.from&&(je=Zt.from)}if(Wt)for(var nr=0;nr<Wt.length;nr+=2)Wt[nr+1]==je&&(bt+=" "+Wt[nr]);if(!Dt||Dt.from==q)for(var Un=0;Un<Lt.length;++Un)Kn(t,0,Lt[Un]);if(Dt&&(Dt.from||0)==q){if(Kn(t,(Dt.to==null?Z+1:Dt.to)-q,Dt.marker,Dt.from==null),Dt.to==null)return;Dt.to==q&&(Dt=!1)}}if(q>=Z)break;for(var Mr=Math.min(Z,je);;){if(be){var Ar=q+be.length;if(!Dt){var Gn=Ar>Mr?be.slice(0,Mr-q):be;t.addToken(t,Gn,Te?Te+st:st,At,q+Gn.length==je?bt:"",Ge,Ut)}if(Ar>=Mr){be=be.slice(Mr-q),q=Mr;break}q=Ar,At=""}be=o.slice(M,M=r[te++]),Te=Vt(r[te++],t.cm.options)}}}function fr(e,t,r){this.line=t,this.rest=Wr(t),this.size=this.rest?Nt(ne(this.rest))-r+1:1,this.node=this.text=null,this.hidden=sr(e,t)}function gn(e,t,r){for(var n=[],o,M=t;M<r;M=o){var z=new fr(e.doc,_t(e.doc,M),M);o=M+z.size,n.push(z)}return n}var Bn=null;function rn(e){Bn?Bn.ops.push(e):e.ownsGroup=Bn={ops:[e],delayedCallbacks:[]}}function zn(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var o=e.ops[n];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(r<t.length)}function vn(e,t){var r=e.ownsGroup;if(!r)return;try{zn(r)}finally{Bn=null,t(r)}}var mn=null;function bn(e,t){var r=Je(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),o;Bn?o=Bn.delayedCallbacks:mn?o=mn:(o=mn=[],setTimeout(Jn,0));for(var M=function(Z){o.push(function(){return r[Z].apply(null,n)})},z=0;z<r.length;++z)M(z)}function Jn(){var e=mn;mn=null;for(var t=0;t<e.length;++t)e[t]()}function Zr(e,t,r,n){for(var o=0;o<t.changes.length;o++){var M=t.changes[o];M=="text"?zi(e,t):M=="gutter"?Gi(e,t,r,n):M=="class"?Ri(e,t):M=="widget"&&Vi(e,t,n)}t.changes=null}function Gr(e){return e.node==e.text&&(e.node=i("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),U&&B<8&&(e.node.style.zIndex=2)),e.node}function qr(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=Gr(t);t.background=n.insertBefore(i("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function wi(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):an(e,t)}function zi(e,t){var r=t.text.className,n=wi(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ri(e,t)):r&&(t.text.className=r)}function Ri(e,t){qr(e,t),t.line.wrapClass?Gr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Gi(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Gr(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var z=Gr(t),Z=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),z.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(i("div",Tn(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var q=0;q<e.display.gutterSpecs.length;++q){var te=e.display.gutterSpecs[q].className,be=M.hasOwnProperty(te)&&M[te];be&&Z.appendChild(i("div",[be],"CodeMirror-gutter-elt","left: "+n.gutterLeft[te]+"px; width: "+n.gutterWidth[te]+"px"))}}}function Vi(e,t,r){t.alignable&&(t.alignable=null);for(var n=v("CodeMirror-linewidget"),o=t.node.firstChild,M=void 0;o;o=M)M=o.nextSibling,n.test(o.className)&&t.node.removeChild(o);Xi(e,t,r)}function Ja(e,t,r,n){var o=wi(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),Ri(e,t),Gi(e,t,r,n),Xi(e,t,n),t.node}function Xi(e,t,r){if(Qi(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Qi(e,t.rest[n],t,r,!1)}function Qi(e,t,r,n,o){if(!t.widgets)return;for(var M=Gr(r),z=0,Z=t.widgets;z<Z.length;++z){var q=Z[z],te=i("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Za(q,te,r,n),e.display.input.setUneditable(te),o&&q.above?M.insertBefore(te,r.gutter||r.text):M.appendChild(te),bn(q,"redraw")}}function Za(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var o=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(o-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function li(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!m(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),a(t.display.measure,i("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function $r(e,t){for(var r=Oe(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function _i(e){return e.lineSpace.offsetTop}function ei(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=a(e.measure,i("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function vr(e){return Ee-e.display.nativeBarWidth}function ni(e){return e.display.scroller.clientWidth-vr(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-vr(e)-e.display.barHeight}function $a(e,t,r){var n=e.options.lineWrapping,o=n&&ni(e);if(!t.measure.heights||n&&t.measure.width!=o){var M=t.measure.heights=[];if(n){t.measure.width=o;for(var z=t.text.firstChild.getClientRects(),Z=0;Z<z.length-1;Z++){var q=z[Z],te=z[Z+1];Math.abs(q.bottom-te.bottom)>2&&M.push((q.bottom+te.top)/2-r.top)}}M.push(r.bottom-r.top)}}function Yi(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var o=0;o<e.rest.length;o++)if(Nt(e.rest[o])>r)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function eo(e,t){t=Yn(t);var r=Nt(t),n=e.display.externalMeasured=new fr(e.doc,t,r);n.lineN=r;var o=n.built=an(e,n);return n.text=o.pre,a(e.display.lineMeasure,o.pre),n}function xa(e,t,r,n){return Nr(e,ui(e,t),r,n)}function ri(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sn(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function ui(e,t){var r=Nt(t),n=ri(e,r);n&&!n.text?n=null:n&&n.changes&&(Zr(e,n,r,kt(e)),e.curOp.forceUpdate=!0),n||(n=eo(e,t));var o=Yi(n,t,r);return{line:t,view:n,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Nr(e,t,r,n,o){t.before&&(r=-1);var M=r+(n||""),z;return t.cache.hasOwnProperty(M)?z=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($a(e,t.view,t.rect),t.hasHeights=!0),z=no(e,t,r,n),z.bogus||(t.cache[M]=z)),{left:z.left,right:z.right,top:o?z.rtop:z.top,bottom:o?z.rbottom:z.bottom}}var Ca={left:0,right:0,top:0,bottom:0};function bi(e,t,r){for(var n,o,M,z,Z,q,te=0;te<e.length;te+=3)if(Z=e[te],q=e[te+1],t<Z?(o=0,M=1,z="left"):t<q?(o=t-Z,M=o+1):(te==e.length-3||t==q&&e[te+3]>t)&&(M=q-Z,o=M-1,t>=q&&(z="right")),o!=null){if(n=e[te+2],Z==q&&r==(n.insertLeft?"left":"right")&&(z=r),r=="left"&&o==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],z="left";if(r=="right"&&o==q-Z)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)n=e[(te+=3)+2],z="right";break}return{node:n,start:o,end:M,collapse:z,coverStart:Z,coverEnd:q}}function to(e,t){var r=Ca;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var o=e.length-1;o>=0&&!((r=e[o]).left!=r.right);o--);return r}function no(e,t,r,n){var o=bi(t.map,r,n),M=o.node,z=o.start,Z=o.end,q=o.collapse,te;if(M.nodeType==3){for(var be=0;be<4;be++){for(;z&&Ke(t.line.text.charAt(o.coverStart+z));)--z;for(;o.coverStart+Z<o.coverEnd&&Ke(t.line.text.charAt(o.coverStart+Z));)++Z;if(U&&B<9&&z==0&&Z==o.coverEnd-o.coverStart?te=M.parentNode.getBoundingClientRect():te=to(b(M,z,Z).getClientRects(),n),te.left||te.right||z==0)break;Z=z,z=z-1,q="right"}U&&B<11&&(te=ro(e.display.measure,te))}else{z>0&&(q=n="right");var Te;e.options.lineWrapping&&(Te=M.getClientRects()).length>1?te=Te[n=="right"?Te.length-1:0]:te=M.getBoundingClientRect()}if(U&&B<9&&!z&&(!te||!te.left&&!te.right)){var Ge=M.parentNode.getClientRects()[0];Ge?te={left:Ge.left,right:Ge.left+Pt(e.display),top:Ge.top,bottom:Ge.bottom}:te=Ca}for(var je=te.top-t.rect.top,st=te.bottom-t.rect.top,bt=(je+st)/2,At=t.view.measure.heights,Dt=0;Dt<At.length-1&&!(bt<At[Dt]);Dt++);var Ut=Dt?At[Dt-1]:0,Lt=At[Dt],Wt={left:(q=="right"?te.right:te.left)-t.rect.left,right:(q=="left"?te.left:te.right)-t.rect.left,top:Ut,bottom:Lt};return!te.left&&!te.right&&(Wt.bogus=!0),e.options.singleCursorHeightPerLine||(Wt.rtop=je,Wt.rbottom=st),Wt}function ro(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!de(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function Sa(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Aa(e){e.display.externalMeasure=null,l(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Sa(e.display.view[t])}function di(e){Aa(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ta(){return E&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function wa(){return E&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ji(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=li(e.widgets[r]));return t}function Oi(e,t,r,n,o){if(!o){var M=Ji(t);r.top+=M,r.bottom+=M}if(n=="line")return r;n||(n="local");var z=Cr(t);if(n=="local"?z+=_i(e.display):z-=e.display.viewOffset,n=="page"||n=="window"){var Z=e.display.lineSpace.getBoundingClientRect();z+=Z.top+(n=="window"?0:wa());var q=Z.left+(n=="window"?0:Ta());r.left+=q,r.right+=q}return r.top+=z,r.bottom+=z,r}function Ra(e,t,r){if(r=="div")return t;var n=t.left,o=t.top;if(r=="page")n-=Ta(),o-=wa();else if(r=="local"||!r){var M=e.display.sizer.getBoundingClientRect();n+=M.left,o+=M.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:n-z.left,top:o-z.top}}function Zi(e,t,r,n,o){return n||(n=_t(e.doc,t.line)),Oi(e,n,xa(e,n,t.ch,o),r)}function Zn(e,t,r,n,o,M){n=n||_t(e.doc,t.line),o||(o=ui(e,n));function z(st,bt){var At=Nr(e,o,st,bt?"right":"left",M);return bt?At.left=At.right:At.right=At.left,Oi(e,n,At,r)}var Z=Ct(n,e.doc.direction),q=t.ch,te=t.sticky;if(q>=n.text.length?(q=n.text.length,te="before"):q<=0&&(q=0,te="after"),!Z)return z(te=="before"?q-1:q,te=="before");function be(st,bt,At){var Dt=Z[bt],Ut=Dt.level==1;return z(At?st-1:st,Ut!=At)}var Te=Et(Z,q,te),Ge=gt,je=be(q,Te,te=="before");return Ge!=null&&(je.other=be(q,Ge,te!="before")),je}function _a(e,t){var r=0;t=p(e.doc,t),e.options.lineWrapping||(r=Pt(e.display)*t.ch);var n=_t(e.doc,t.line),o=Cr(n)+_i(e.display);return{left:r,right:r,top:o,bottom:o+n.height}}function qi(e,t,r,n,o){var M=ct(e,t,r);return M.xRel=o,n&&(M.outside=n),M}function $i(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return qi(n.first,0,null,-1,-1);var o=nn(n,r),M=n.first+n.size-1;if(o>M)return qi(n.first+n.size-1,_t(n,M).text.length,null,1,1);t<0&&(t=0);for(var z=_t(n,o);;){var Z=lt(e,z,o,t,r),q=_r(z,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!q)return Z;var te=q.find(1);if(te.line==o)return te;z=_t(n,o=te.line)}}function Oa(e,t,r,n){n-=Ji(t);var o=t.text.length,M=ht(function(z){return Nr(e,r,z-1).bottom<=n},o,0);return o=ht(function(z){return Nr(e,r,z).top>n},M,o),{begin:M,end:o}}function jt(e,t,r,n){r||(r=ui(e,t));var o=Oi(e,t,Nr(e,r,n),"line").top;return Oa(e,t,r,o)}function pe(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function lt(e,t,r,n,o){o-=Cr(t);var M=ui(e,t),z=Ji(t),Z=0,q=t.text.length,te=!0,be=Ct(t,e.doc.direction);if(be){var Te=(e.options.lineWrapping?Mt:tt)(e,t,r,M,be,n,o);te=Te.level!=1,Z=te?Te.from:Te.to-1,q=te?Te.to:Te.from-1}var Ge=null,je=null,st=ht(function(tn){var Zt=Nr(e,M,tn);return Zt.top+=z,Zt.bottom+=z,pe(Zt,n,o,!1)?(Zt.top<=o&&Zt.left<=n&&(Ge=tn,je=Zt),!0):!1},Z,q),bt,At,Dt=!1;if(je){var Ut=n-je.left<je.right-n,Lt=Ut==te;st=Ge+(Lt?0:1),At=Lt?"after":"before",bt=Ut?je.left:je.right}else{!te&&(st==q||st==Z)&&st++,At=st==0?"after":st==t.text.length?"before":Nr(e,M,st-(te?1:0)).bottom+z<=o==te?"after":"before";var Wt=Zn(e,ct(r,st,At),"line",t,M);bt=Wt.left,Dt=o<Wt.top?-1:o>=Wt.bottom?1:0}return st=Ve(t.text,st,1),qi(r,st,At,Dt,n-bt)}function tt(e,t,r,n,o,M,z){var Z=ht(function(Te){var Ge=o[Te],je=Ge.level!=1;return pe(Zn(e,ct(r,je?Ge.to:Ge.from,je?"before":"after"),"line",t,n),M,z,!0)},0,o.length-1),q=o[Z];if(Z>0){var te=q.level!=1,be=Zn(e,ct(r,te?q.from:q.to,te?"after":"before"),"line",t,n);pe(be,M,z,!0)&&be.top>z&&(q=o[Z-1])}return q}function Mt(e,t,r,n,o,M,z){var Z=Oa(e,t,n,z),q=Z.begin,te=Z.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var be=null,Te=null,Ge=0;Ge<o.length;Ge++){var je=o[Ge];if(je.from>=te||je.to<=q)continue;var st=je.level!=1,bt=Nr(e,n,st?Math.min(te,je.to)-1:Math.max(q,je.from)).right,At=bt<M?M-bt+1e9:bt-M;(!be||Te>At)&&(be=je,Te=At)}return be||(be=o[o.length-1]),be.from<q&&(be={from:q,to:be.to,level:be.level}),be.to>te&&(be={from:be.from,to:te,level:be.level}),be}var ut;function Ot(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ut==null){ut=i("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ut.appendChild(document.createTextNode("x")),ut.appendChild(i("br"));ut.appendChild(document.createTextNode("x"))}a(e.measure,ut);var r=ut.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),l(e.measure),r||1}function Pt(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=i("span","xxxxxxxxxx"),r=i("pre",[t],"CodeMirror-line-like");a(e.measure,r);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function kt(e){for(var t=e.display,r={},n={},o=t.gutters.clientLeft,M=t.gutters.firstChild,z=0;M;M=M.nextSibling,++z){var Z=e.display.gutterSpecs[z].className;r[Z]=M.offsetLeft+M.clientLeft+o,n[Z]=M.clientWidth}return{fixedPos:Yt(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Yt(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Kt(e){var t=Ot(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Pt(e.display)-3);return function(o){if(sr(e.doc,o))return 0;var M=0;if(o.widgets)for(var z=0;z<o.widgets.length;z++)o.widgets[z].height&&(M+=o.widgets[z].height);return r?M+(Math.ceil(o.text.length/n)||1)*t:M+t}}function Jt(e){var t=e.doc,r=Kt(e);t.iter(function(n){var o=r(n);o!=n.height&&$t(n,o)})}function yn(e,t,r,n){var o=e.display;if(!r&&Oe(t).getAttribute("cm-not-content")=="true")return null;var M,z,Z=o.lineSpace.getBoundingClientRect();try{M=t.clientX-Z.left,z=t.clientY-Z.top}catch(Te){return null}var q=$i(e,M,z),te;if(n&&q.xRel>0&&(te=_t(e.doc,q.line).text).length==q.ch){var be=$(te,te.length,e.options.tabSize)-te.length;q=ct(q.line,Math.max(0,Math.round((M-qa(e.display).left)/Pt(e.display))-be))}return q}function Sn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function ln(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var o=e.display;if(n&&r<o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Qn&&Or(e.doc,t)<o.viewTo&&Dr(e);else if(r<=o.viewFrom)Qn&&Yr(e.doc,r+n)>o.viewFrom?Dr(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&r>=o.viewTo)Dr(e);else if(t<=o.viewFrom){var M=ci(e,r,r+n,1);M?(o.view=o.view.slice(M.index),o.viewFrom=M.lineN,o.viewTo+=n):Dr(e)}else if(r>=o.viewTo){var z=ci(e,t,t,-1);z?(o.view=o.view.slice(0,z.index),o.viewTo=z.lineN):Dr(e)}else{var Z=ci(e,t,t,-1),q=ci(e,r,r+n,1);Z&&q?(o.view=o.view.slice(0,Z.index).concat(gn(e,Z.lineN,q.lineN)).concat(o.view.slice(q.index)),o.viewTo+=n):Dr(e)}var te=o.externalMeasured;te&&(r<te.lineN?te.lineN+=n:t<te.lineN+te.size&&(o.externalMeasured=null))}function ur(e,t,r){e.curOp.viewChanged=!0;var n=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var M=n.view[Sn(e,t)];if(M.node==null)return;var z=M.changes||(M.changes=[]);me(z,r)==-1&&z.push(r)}function Dr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ci(e,t,r,n){var o=Sn(e,t),M,z=e.display.view;if(!Qn||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var Z=e.display.viewFrom,q=0;q<o;q++)Z+=z[q].size;if(Z!=t){if(n>0){if(o==z.length-1)return null;M=Z+z[o].size-t,o++}else M=Z-t;t+=M,r+=M}for(;Or(e.doc,r)!=r;){if(o==(n<0?0:z.length-1))return null;r+=n*z[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function Da(e,t,r){var n=e.display,o=n.view;o.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=gn(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=gn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Sn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(gn(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Sn(e,r)))),n.viewTo=r}function Lo(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var o=t[n];!o.hidden&&(!o.node||o.changes)&&++r}return r}function ea(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mo(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},o=n.cursors=document.createDocumentFragment(),M=n.selection=document.createDocumentFragment(),z=0;z<r.sel.ranges.length;z++){if(!t&&z==r.sel.primIndex)continue;var Z=r.sel.ranges[z];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var q=Z.empty();(q||e.options.showCursorWhenSelecting)&&ko(e,Z.head,o),q||Xs(e,Z,M)}return n}function ko(e,t,r){var n=Zn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(i("div","\xA0","CodeMirror-cursor"));if(o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var M=r.appendChild(i("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=n.other.left+"px",M.style.top=n.other.top+"px",M.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function La(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,r){var n=e.display,o=e.doc,M=document.createDocumentFragment(),z=qa(e.display),Z=z.left,q=Math.max(n.sizerWidth,ni(e)-n.sizer.offsetLeft)-z.right,te=o.direction=="ltr";function be(Lt,Wt,tn,Zt){Wt<0&&(Wt=0),Wt=Math.round(Wt),Zt=Math.round(Zt),M.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+Lt+`px;
|
|
top: `+Wt+"px; width: "+(tn==null?q-Lt:tn)+`px;
|
|
height: `+(Zt-Wt)+"px"))}function Te(Lt,Wt,tn){var Zt=_t(o,Lt),dn=Zt.text.length,Dn,nr;function Un(Gn,Tr){return Zi(e,ct(Lt,Gn),"div",Zt,Tr)}function Mr(Gn,Tr,dr){var qn=jt(e,Zt,null,Gn),Vn=Tr=="ltr"==(dr=="after")?"left":"right",jn=dr=="after"?qn.begin:qn.end-(/\s/.test(Zt.text.charAt(qn.end-1))?2:1);return Un(jn,Vn)[Vn]}var Ar=Ct(Zt,o.direction);return mt(Ar,Wt||0,tn==null?dn:tn,function(Gn,Tr,dr,qn){var Vn=dr=="ltr",jn=Un(Gn,Vn?"left":"right"),wr=Un(Tr-1,Vn?"right":"left"),Hi=Wt==null&&Gn==0,vi=tn==null&&Tr==dn,mr=qn==0,ti=!Ar||qn==Ar.length-1;if(wr.top-jn.top<=3){var rr=(te?Hi:vi)&&mr,Oo=(te?vi:Hi)&&ti,ai=rr?Z:(Vn?jn:wr).left,Ai=Oo?q:(Vn?wr:jn).right;be(ai,jn.top,Ai-ai,jn.bottom)}else{var Ti,br,Ki,Do;Vn?(Ti=te&&Hi&&mr?Z:jn.left,br=te?q:Mr(Gn,dr,"before"),Ki=te?Z:Mr(Tr,dr,"after"),Do=te&&vi&&ti?q:wr.right):(Ti=te?Mr(Gn,dr,"before"):Z,br=!te&&Hi&&mr?q:jn.right,Ki=!te&&vi&&ti?Z:wr.left,Do=te?Mr(Tr,dr,"after"):q),be(Ti,jn.top,br-Ti,jn.bottom),jn.bottom<wr.top&&be(Z,jn.bottom,null,wr.top),be(Ki,wr.top,Do-Ki,wr.bottom)}(!Dn||La(jn,Dn)<0)&&(Dn=jn),La(wr,Dn)<0&&(Dn=wr),(!nr||La(jn,nr)<0)&&(nr=jn),La(wr,nr)<0&&(nr=wr)}),{start:Dn,end:nr}}var Ge=t.from(),je=t.to();if(Ge.line==je.line)Te(Ge.line,Ge.ch,je.ch);else{var st=_t(o,Ge.line),bt=_t(o,je.line),At=Yn(st)==Yn(bt),Dt=Te(Ge.line,Ge.ch,At?st.text.length+1:null).end,Ut=Te(je.line,At?0:null,je.ch).start;At&&(Dt.top<Ut.top-2?(be(Dt.right,Dt.top,null,Dt.bottom),be(Z,Ut.top,Ut.left,Ut.bottom)):be(Dt.right,Dt.top,Ut.left-Dt.right,Dt.bottom)),Dt.bottom<Ut.top&&be(Z,Dt.bottom,null,Ut.top)}r.appendChild(M)}function io(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Di(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Io(e){e.state.focused||(e.display.input.focus(),ao(e))}function Po(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Di(e))},100)}function ao(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Fe(e,"focus",e,t),e.state.focused=!0,C(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),I&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),io(e)}function Di(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Fe(e,"blur",e,t),e.state.focused=!1,c(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ma(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var o=t.view[n],M=e.options.lineWrapping,z=void 0,Z=0;if(o.hidden)continue;if(U&&B<8){var q=o.node.offsetTop+o.node.offsetHeight;z=q-r,r=q}else{var te=o.node.getBoundingClientRect();z=te.bottom-te.top,!M&&o.text.firstChild&&(Z=o.text.firstChild.getBoundingClientRect().right-te.left-1)}var be=o.line.height-z;if((be>.005||be<-.005)&&($t(o.line,z),No(o.line),o.rest))for(var Te=0;Te<o.rest.length;Te++)No(o.rest[Te]);if(Z>e.display.sizerWidth){var Ge=Math.ceil(Z/Pt(e.display));Ge>e.display.maxLineLength&&(e.display.maxLineLength=Ge,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}function No(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function ka(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-_i(e));var o=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,M=nn(t,n),z=nn(t,o);if(r&&r.ensure){var Z=r.ensure.from.line,q=r.ensure.to.line;Z<M?(M=Z,z=nn(t,Cr(_t(t,Z))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=z&&(M=nn(t,Cr(_t(t,q))-e.wrapper.clientHeight),z=q)}return{from:M,to:Math.max(z,M+1)}}function Qs(e,t){if(qe(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),o=null;if(t.top+n.top<0?o=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),o!=null&&!S){var M=i("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-_i(e.display))+`px;
|
|
height: `+(t.bottom-t.top+vr(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(o),e.display.lineSpace.removeChild(M)}}function Ys(e,t,r,n){n==null&&(n=0);var o;!e.options.lineWrapping&&t==r&&(t=t.ch?ct(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?ct(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var z=!1,Z=Zn(e,t),q=!r||r==t?Z:Zn(e,r);o={left:Math.min(Z.left,q.left),top:Math.min(Z.top,q.top)-n,right:Math.max(Z.left,q.left),bottom:Math.max(Z.bottom,q.bottom)+n};var te=oo(e,o),be=e.doc.scrollTop,Te=e.doc.scrollLeft;if(te.scrollTop!=null&&(na(e,te.scrollTop),Math.abs(e.doc.scrollTop-be)>1&&(z=!0)),te.scrollLeft!=null&&(Ei(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-Te)>1&&(z=!0)),!z)break}return o}function Js(e,t){var r=oo(e,t);r.scrollTop!=null&&na(e,r.scrollTop),r.scrollLeft!=null&&Ei(e,r.scrollLeft)}function oo(e,t){var r=e.display,n=Ot(e.display);t.top<0&&(t.top=0);var o=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,M=yi(e),z={};t.bottom-t.top>M&&(t.bottom=t.top+M);var Z=e.doc.height+ei(r),q=t.top<n,te=t.bottom>Z-n;if(t.top<o)z.scrollTop=q?0:t.top;else if(t.bottom>o+M){var be=Math.min(t.top,(te?Z:t.bottom)-M);be!=o&&(z.scrollTop=be)}var Te=e.options.fixedGutter?0:r.gutters.offsetWidth,Ge=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-Te,je=ni(e)-r.gutters.offsetWidth,st=t.right-t.left>je;return st&&(t.right=t.left+je),t.left<10?z.scrollLeft=0:t.left<Ge?z.scrollLeft=Math.max(0,t.left+Te-(st?0:10)):t.right>je+Ge-3&&(z.scrollLeft=t.right+(st?0:10)-je),z}function so(e,t){if(t==null)return;Ia(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Li(e){Ia(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ta(e,t,r){(t!=null||r!=null)&&Ia(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Zs(e,t){Ia(e),e.curOp.scrollToPos=t}function Ia(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=_a(e,t.from),n=_a(e,t.to);Bo(e,r,n,t.margin)}}function Bo(e,t,r,n){var o=oo(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});ta(e,o.scrollLeft,o.scrollTop)}function na(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;k||uo(e,{top:t}),Uo(e,t,!0),k&&uo(e),aa(e,100)}function Uo(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ei(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ko(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ra(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ei(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+vr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var xi=function(e,t,r){this.cm=r;var n=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),Se(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Se(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,U&&B<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},xi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xi.prototype.zeroWidthHack=function(){var e=u&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new se,this.disableVert=new se},xi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var o=e.getBoundingClientRect(),M=r=="vert"?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},xi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ia=function(){};ia.prototype.update=function(){return{bottom:0,right:0}},ia.prototype.setScrollLeft=function(){},ia.prototype.setScrollTop=function(){},ia.prototype.clear=function(){};function Mi(e,t){t||(t=ra(e));var r=e.display.barWidth,n=e.display.barHeight;Fo(e,t);for(var o=0;o<4&&r!=e.display.barWidth||n!=e.display.barHeight;o++)r!=e.display.barWidth&&e.options.lineWrapping&&Ma(e),Fo(e,ra(e)),r=e.display.barWidth,n=e.display.barHeight}function Fo(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var jo={native:xi,null:ia};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&c(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new jo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Se(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Ei(e,t):na(e,t)},e),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Ci(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},rn(e.curOp)}function Si(e){var t=e.curOp;t&&vn(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;$s(r)})}function $s(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var o=0;o<t.length;o++)nl(t[o]);for(var M=0;M<t.length;M++)rl(t[M]);for(var z=0;z<t.length;z++)il(t[z])}function el(e){var t=e.cm,r=t.display;ol(t),e.updateMaxLine&&Jr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Pa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&lo(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ma(t),e.barMeasure=ra(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xa(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+vr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-ni(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ei(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Mi(t,e.barMeasure),e.updatedDisplay&&ho(t,e.barMeasure),e.selectionChanged&&io(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Io(e.cm)}function il(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Ho(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&Uo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ei(t,e.scrollLeft,!0,!0),e.scrollToPos){var o=Ys(t,p(n,e.scrollToPos.from),p(n,e.scrollToPos.to),e.scrollToPos.margin);Qs(t,o)}var M=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(M)for(var Z=0;Z<M.length;++Z)M[Z].lines.length||Fe(M[Z],"hide");if(z)for(var q=0;q<z.length;++q)z[q].lines.length&&Fe(z[q],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Lr(e,t){if(e.curOp)return t();Ci(e);try{return t()}finally{Si(e)}}function er(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ci(e);try{return t.apply(e,arguments)}finally{Si(e)}}}function yr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ci(this);try{return e.apply(this,arguments)}finally{Si(this)}}}function tr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ci(t);try{return e.apply(this,arguments)}finally{Si(t)}}}function aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,W(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=Tt(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(n.line>=e.display.viewFrom){var z=M.styles,Z=M.text.length>e.options.maxHighlightLength?Rt(t.mode,n.state):null,q=Ae(e,M,n,!0);Z&&(n.state=Z),M.styles=q.styles;var te=M.styleClasses,be=q.classes;be?M.styleClasses=be:te&&(M.styleClasses=null);for(var Te=!z||z.length!=M.styles.length||te!=be&&(!te||!be||te.bgClass!=be.bgClass||te.textClass!=be.textClass),Ge=0;!Te&&Ge<z.length;++Ge)Te=z[Ge]!=M.styles[Ge];Te&&o.push(n.line),M.stateAfter=n.save(),n.nextLine()}else M.text.length<=e.options.maxHighlightLength&&Bt(e,M.text,n),M.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return aa(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&Lr(e,function(){for(var M=0;M<o.length;M++)ur(e,o[M],"text")})}var Pa=function(e,t,r){var n=e.display;this.viewport=t,this.visible=ka(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=ni(e),this.force=r,this.dims=kt(e),this.events=[]};Pa.prototype.signal=function(e,t){he(e,t)&&this.events.push(arguments)},Pa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Fe.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=vr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=vr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=L();if(!t||!m(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&m(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==L())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&m(document.body,e.anchorNode)&&m(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function lo(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Dr(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&Lo(e)==0)return!1;zo(e)&&(Dr(e),t.dims=kt(e));var o=n.first+n.size,M=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(o,t.visible.to+e.options.viewportMargin);r.viewFrom<M&&M-r.viewFrom<20&&(M=Math.max(n.first,r.viewFrom)),r.viewTo>z&&r.viewTo-z<20&&(z=Math.min(o,r.viewTo)),Qn&&(M=Or(e.doc,M),z=Yr(e.doc,z));var Z=M!=r.viewFrom||z!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Da(e,M,z),r.viewOffset=Cr(_t(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var q=Lo(e);if(!Z&&q==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=sl(e);return q>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),q>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),l(r.cursorDiv),l(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,Z&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,aa(e,400)),r.updateLineNumbers=null,!0}function Ho(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==ni(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ei(e.display)-yi(e),r.top)}),t.visible=ka(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=ka(e.display,e.doc,r));if(!lo(e,t))break;Ma(e);var o=ra(e);ea(e),Mi(e,o),ho(e,o),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function uo(e,t){var r=new Pa(e,t);if(lo(e,r)){Ma(e),Ho(e,r);var n=ra(e);ea(e),Mi(e,n),ho(e,n),r.finish()}}function ul(e,t,r){var n=e.display,o=e.options.lineNumbers,M=n.lineDiv,z=M.firstChild;function Z(st){var bt=st.nextSibling;return I&&u&&e.display.currentWheelTarget==st?st.style.display="none":st.parentNode.removeChild(st),bt}for(var q=n.view,te=n.viewFrom,be=0;be<q.length;be++){var Te=q[be];if(!Te.hidden)if(!Te.node||Te.node.parentNode!=M){var Ge=Ja(e,Te,te,r);M.insertBefore(Ge,z)}else{for(;z!=Te.node;)z=Z(z);var je=o&&t!=null&&t<=te&&Te.lineNumber;Te.changes&&(me(Te.changes,"gutter")>-1&&(je=!1),Zr(e,Te,te,r)),je&&(l(Te.lineNumber),Te.lineNumber.appendChild(document.createTextNode(Tn(e.options,te)))),z=Te.node.nextSibling}te+=Te.size}for(;z;)z=Z(z)}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ho(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+vr(e)+"px"}function Ko(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Yt(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,M=n+"px",z=0;z<r.length;z++)if(!r[z].hidden){e.options.fixedGutter&&(r[z].gutter&&(r[z].gutter.style.left=M),r[z].gutterBackground&&(r[z].gutterBackground.style.left=M));var Z=r[z].alignable;if(Z)for(var q=0;q<Z.length;q++)Z[q].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=n+o+"px")}function zo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Tn(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var o=n.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=o.firstChild.offsetWidth,z=o.offsetWidth-M;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(M,n.lineGutter.offsetWidth-z)+1,n.lineNumWidth=n.lineNumInnerWidth+z,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",co(e.display),!0}return!1}function fo(e,t){for(var r=[],n=!1,o=0;o<e.length;o++){var M=e[o],z=null;if(typeof M!="string"&&(z=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:M,style:z})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function Go(e){var t=e.gutters,r=e.gutterSpecs;l(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var o=r[n],M=o.className,z=o.style,Z=t.appendChild(i("div",null,"CodeMirror-gutter "+M));z&&(Z.style.cssText=z),M=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",co(e)}function oa(e){Go(e.display),ln(e),Ko(e)}function dl(e,t,r,n){var o=this;this.input=r,o.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=x("div",null,"CodeMirror-code"),o.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=i("div",null,"CodeMirror-cursors"),o.measure=i("div",null,"CodeMirror-measure"),o.lineMeasure=i("div",null,"CodeMirror-measure"),o.lineSpace=x("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var M=x("div",[o.lineSpace],"CodeMirror-lines");o.mover=i("div",[M],null,"position: relative"),o.sizer=i("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=i("div",null,null,"position: absolute; height: "+Ee+"px; width: 1px;"),o.gutters=i("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=i("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=i("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),U&&B<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),!I&&!(k&&s)&&(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=fo(n.gutters,n.lineNumbers),Go(o),r.init(o)}var Na=0,Br=null;U?Br=-.53:k?Br=15:E?Br=-.7:P&&(Br=-1/3);function Vo(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function cl(e){var t=Vo(e);return t.x*=Br,t.y*=Br,t}function Xo(e,t){var r=Vo(t),n=r.x,o=r.y,M=e.display,z=M.scroller,Z=z.scrollWidth>z.clientWidth,q=z.scrollHeight>z.clientHeight;if(!(n&&Z||o&&q))return;if(o&&u&&I){e:for(var te=t.target,be=M.view;te!=z;te=te.parentNode)for(var Te=0;Te<be.length;Te++)if(be[Te].node==te){e.display.currentWheelTarget=te;break e}}if(n&&!k&&!R&&Br!=null){o&&q&&na(e,Math.max(0,z.scrollTop+o*Br)),Ei(e,Math.max(0,z.scrollLeft+n*Br)),(!o||o&&q)&&re(t),M.wheelStartX=null;return}if(o&&Br!=null){var Ge=o*Br,je=e.doc.scrollTop,st=je+M.wrapper.clientHeight;Ge<0?je=Math.max(0,je+Ge-50):st=Math.min(e.doc.height,st+Ge+50),uo(e,{top:je,bottom:st})}Na<20&&(M.wheelStartX==null?(M.wheelStartX=z.scrollLeft,M.wheelStartY=z.scrollTop,M.wheelDX=n,M.wheelDY=o,setTimeout(function(){if(M.wheelStartX==null)return;var bt=z.scrollLeft-M.wheelStartX,At=z.scrollTop-M.wheelStartY,Dt=At&&M.wheelDY&&At/M.wheelDY||bt&&M.wheelDX&&bt/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!Dt)return;Br=(Br*Na+Dt)/(Na+1),++Na},200)):(M.wheelDX+=n,M.wheelDY+=o))}var Ur=function(e,t){this.ranges=e,this.primIndex=t};Ur.prototype.primary=function(){return this.ranges[this.primIndex]},Ur.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!Ln(r.anchor,n.anchor)||!Ln(r.head,n.head))return!1}return!0},Ur.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(Fn(this.ranges[t].anchor),Fn(this.ranges[t].head));return new Ur(e,this.primIndex)},Ur.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ur.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Gt(t,n.from())>=0&&Gt(e,n.to())<=0)return r}return-1};var wn=function(e,t){this.anchor=e,this.head=t};wn.prototype.from=function(){return Xn(this.anchor,this.head)},wn.prototype.to=function(){return kn(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Vr(e,t,r){var n=e&&e.options.selectionsMayTouch,o=t[r];t.sort(function(Ge,je){return Gt(Ge.from(),je.from())}),r=me(t,o);for(var M=1;M<t.length;M++){var z=t[M],Z=t[M-1],q=Gt(Z.to(),z.from());if(n&&!z.empty()?q>0:q>=0){var te=Xn(Z.from(),z.from()),be=kn(Z.to(),z.to()),Te=Z.empty()?z.from()==z.head:Z.from()==Z.head;M<=r&&--r,t.splice(--M,2,new wn(Te?be:te,Te?te:be))}}return new Ur(t,r)}function hi(e,t){return new Ur([new wn(e,t||e)],0)}function fi(e){return e.text?ct(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Qo(e,t){if(Gt(e,t.from)<0)return e;if(Gt(e,t.to)<=0)return fi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=fi(t).ch-t.to.ch),ct(r,n)}function po(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var o=e.sel.ranges[n];r.push(new wn(Qo(o.anchor,t),Qo(o.head,t)))}return Vr(e.cm,r,e.sel.primIndex)}function Yo(e,t,r){return e.line==t.line?ct(r.line,e.ch-t.ch+r.ch):ct(r.line+(e.line-t.line),e.ch)}function hl(e,t,r){for(var n=[],o=ct(e.first,0),M=o,z=0;z<t.length;z++){var Z=t[z],q=Yo(Z.from,o,M),te=Yo(fi(Z),o,M);if(o=Z.to,M=te,r=="around"){var be=e.sel.ranges[z],Te=Gt(be.head,be.anchor)<0;n[z]=new wn(Te?te:q,Te?q:te)}else n[z]=new wn(q,q)}return new Ur(n,e.sel.primIndex)}function mo(e){e.doc.mode=at(e.options,e.doc.modeOption),sa(e)}function sa(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,aa(e,100),e.state.modeGen++,e.curOp&&ln(e)}function Jo(e,t){return t.from.ch==0&&t.to.ch==0&&ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,r,n){function o(Ut){return r?r[Ut]:null}function M(Ut,Lt,Wt){oi(Ut,Lt,Wt,n),bn(Ut,"change",Ut,t)}function z(Ut,Lt){for(var Wt=[],tn=Ut;tn<Lt;++tn)Wt.push(new lr(te[tn],o(tn),n));return Wt}var Z=t.from,q=t.to,te=t.text,be=_t(e,Z.line),Te=_t(e,q.line),Ge=ne(te),je=o(te.length-1),st=q.line-Z.line;if(t.full)e.insert(0,z(0,te.length)),e.remove(te.length,e.size-te.length);else if(Jo(e,t)){var bt=z(0,te.length-1);M(Te,Te.text,je),st&&e.remove(Z.line,st),bt.length&&e.insert(Z.line,bt)}else if(be==Te)if(te.length==1)M(be,be.text.slice(0,Z.ch)+Ge+be.text.slice(q.ch),je);else{var At=z(1,te.length-1);At.push(new lr(Ge+be.text.slice(q.ch),je,n)),M(be,be.text.slice(0,Z.ch)+te[0],o(0)),e.insert(Z.line+1,At)}else if(te.length==1)M(be,be.text.slice(0,Z.ch)+te[0]+Te.text.slice(q.ch),o(0)),e.remove(Z.line+1,st);else{M(be,be.text.slice(0,Z.ch)+te[0],o(0)),M(Te,Ge+Te.text.slice(q.ch),je);var Dt=z(1,te.length-1);st>1&&e.remove(Z.line+1,st-1),e.insert(Z.line+1,Dt)}bn(e,"change",e,t)}function pi(e,t,r){function n(o,M,z){if(o.linked)for(var Z=0;Z<o.linked.length;++Z){var q=o.linked[Z];if(q.doc==M)continue;var te=z&&q.sharedHist;if(r&&!te)continue;t(q.doc,te),n(q.doc,o,te)}}n(e,null,!0)}function Zo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Jt(e),mo(e),qo(e),e.options.lineWrapping||Jr(e),e.options.mode=t.modeOption,ln(e)}function qo(e){(e.doc.direction=="rtl"?C:c)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Lr(e,function(){qo(e),ln(e)})}function Ba(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function vo(e,t){var r={from:Fn(t.from),to:fi(t),text:cn(e,t.from,t.to)};return ts(e,r,t.from.line,t.to.line+1),pi(e,function(n){return ts(n,r,t.from.line,t.to.line+1)},!0),r}function $o(e){for(;e.length;){var t=ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return $o(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function es(e,t,r,n){var o=e.history;o.undone.length=0;var M=+new Date,z,Z;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&o.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(o,o.lastOp==n)))Z=ne(z.changes),Gt(t.from,t.to)==0&&Gt(t.from,Z.to)==0?Z.to=fi(t):z.changes.push(vo(e,t));else{var q=ne(o.done);for((!q||!q.ranges)&&Ua(e.sel,o.done),z={changes:[vo(e,t)],generation:o.generation},o.done.push(z);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(r),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=M,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,Z||Fe(e,"historyAdded")}function ml(e,t,r,n){var o=t.charAt(0);return o=="*"||o=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var o=e.history,M=n&&n.origin;r==o.lastSelOp||M&&o.lastSelOrigin==M&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==M||ml(e,M,ne(o.done),t))?o.done[o.done.length-1]=t:Ua(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=M,o.lastSelOp=r,n&&n.clearRedo!==!1&&$o(o.undone)}function Ua(e,t){var r=ne(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ts(e,t,r,n){var o=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((o||(o=t["spans_"+e.id]={}))[M]=z.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function yl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],o=0;o<t.text.length;++o)n.push(vl(r[o]));return n}function ns(e,t){var r=yl(e,t),n=xr(e,t);if(!r)return n;if(!n)return r;for(var o=0;o<r.length;++o){var M=r[o],z=n[o];if(M&&z){e:for(var Z=0;Z<z.length;++Z){for(var q=z[Z],te=0;te<M.length;++te)if(M[te].marker==q.marker)continue e;M.push(q)}}else z&&(r[o]=z)}return r}function ki(e,t,r){for(var n=[],o=0;o<e.length;++o){var M=e[o];if(M.ranges){n.push(r?Ur.prototype.deepCopy.call(M):M);continue}var z=M.changes,Z=[];n.push({changes:Z});for(var q=0;q<z.length;++q){var te=z[q],be=void 0;if(Z.push({from:te.from,to:te.to,text:te.text}),t)for(var Te in te)(be=Te.match(/^spans_(\d+)$/))&&(me(t,Number(be[1]))>-1&&(ne(Z)[Te]=te[Te],delete te[Te]))}}return n}function yo(e,t,r,n){if(n){var o=e.anchor;if(r){var M=Gt(t,o)<0;M!=Gt(r,o)<0?(o=t,t=r):M!=Gt(t,r)<0&&(t=r)}return new wn(o,t)}else return new wn(r||t,t)}function Fa(e,t,r,n,o){o==null&&(o=e.cm&&(e.cm.display.shift||e.extend)),pr(e,new Ur([yo(e.sel.primary(),t,r,o)],0),n)}function rs(e,t,r){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)n[M]=yo(e.sel.ranges[M],t[M],null,o);var z=Vr(e.cm,n,e.sel.primIndex);pr(e,z,r)}function bo(e,t,r,n){var o=e.sel.ranges.slice(0);o[t]=r,pr(e,Vr(e.cm,o,e.sel.primIndex),n)}function is(e,t,r,n){pr(e,hi(t,r),n)}function bl(e,t,r){var n={ranges:t.ranges,update:function(o){this.ranges=[];for(var M=0;M<o.length;M++)this.ranges[M]=new wn(p(e,o[M].anchor),p(e,o[M].head))},origin:r&&r.origin};return Fe(e,"beforeSelectionChange",e,n),e.cm&&Fe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Vr(e.cm,n.ranges,n.ranges.length-1):t}function as(e,t,r){var n=e.history.done,o=ne(n);o&&o.ranges?(n[n.length-1]=t,ja(e,t,r)):pr(e,t,r)}function pr(e,t,r){ja(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ja(e,t,r){(he(e,"beforeSelectionChange")||e.cm&&he(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,r));var n=r&&r.bias||(Gt(t.primary().head,e.sel.primary().head)<0?-1:1);os(e,ls(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Li(e.cm)}function os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),bn(e,"cursorActivity",e)}function ss(e){os(e,ls(e,e.sel,null,!1))}function ls(e,t,r,n){for(var o,M=0;M<t.ranges.length;M++){var z=t.ranges[M],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],q=Wa(e,z.anchor,Z&&Z.anchor,r,n),te=Wa(e,z.head,Z&&Z.head,r,n);(o||q!=z.anchor||te!=z.head)&&(o||(o=t.ranges.slice(0,M)),o[M]=new wn(q,te))}return o?Vr(e.cm,o,t.primIndex):t}function Ii(e,t,r,n,o){var M=_t(e,t.line);if(M.markedSpans)for(var z=0;z<M.markedSpans.length;++z){var Z=M.markedSpans[z],q=Z.marker,te="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,be="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Z.from==null||(te?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(be?Z.to>=t.ch:Z.to>t.ch))){if(o&&(Fe(q,"beforeCursorEnter"),q.explicitlyCleared))if(M.markedSpans){--z;continue}else break;if(!q.atomic)continue;if(r){var Te=q.find(n<0?1:-1),Ge=void 0;if((n<0?be:te)&&(Te=us(e,Te,-n,Te&&Te.line==t.line?M:null)),Te&&Te.line==t.line&&(Ge=Gt(Te,r))&&(n<0?Ge<0:Ge>0))return Ii(e,Te,t,n,o)}var je=q.find(n<0?-1:1);return(n<0?te:be)&&(je=us(e,je,n,je.line==t.line?M:null)),je?Ii(e,je,t,n,o):null}}return t}function Wa(e,t,r,n,o){var M=n||1,z=Ii(e,t,r,M,o)||!o&&Ii(e,t,r,M,!0)||Ii(e,t,r,-M,o)||!o&&Ii(e,t,r,-M,!0);return z||(e.cantEdit=!0,ct(e.first,0))}function us(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?p(e,ct(t.line-1)):null:r>0&&t.ch==(n||_t(e,t.line)).text.length?t.line<e.first+e.size-1?ct(t.line+1,0):null:new ct(t.line,t.ch+r)}function ds(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),Be)}function cs(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(o,M,z,Z){o&&(n.from=p(e,o)),M&&(n.to=p(e,M)),z&&(n.text=z),Z!==void 0&&(n.origin=Z)}),Fe(e,"beforeChange",e,n),e.cm&&Fe(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Pi(e,t,r){if(e.cm){if(!e.cm.curOp)return er(e.cm,Pi)(e,t,r);if(e.cm.state.suppressEdits)return}if((he(e,"beforeChange")||e.cm&&he(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var n=gr&&!r&&Fr(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)hs(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else hs(e,t)}function hs(e,t){if(t.text.length==1&&t.text[0]==""&&Gt(t.from,t.to)==0)return;var r=po(e,t);es(e,t,r,e.cm?e.cm.curOp.id:NaN),la(e,t,r,xr(e,t));var n=[];pi(e,function(o,M){!M&&me(n,o.history)==-1&&(gs(o.history,t),n.push(o.history)),la(o,t,null,xr(o,t))})}function Ha(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var o=e.history,M,z=e.sel,Z=t=="undo"?o.done:o.undone,q=t=="undo"?o.undone:o.done,te=0;te<Z.length&&!(M=Z[te],r?M.ranges&&!M.equals(e.sel):!M.ranges);te++);if(te==Z.length)return;for(o.lastOrigin=o.lastSelOrigin=null;;)if(M=Z.pop(),M.ranges){if(Ua(M,q),r&&!M.equals(e.sel)){pr(e,M,{clearRedo:!1});return}z=M}else if(n){Z.push(M);return}else break;var be=[];Ua(z,q),q.push({changes:be,generation:o.generation}),o.generation=M.generation||++o.maxGeneration;for(var Te=he(e,"beforeChange")||e.cm&&he(e.cm,"beforeChange"),Ge=function(bt){var At=M.changes[bt];if(At.origin=t,Te&&!cs(e,At,!1))return Z.length=0,{};be.push(vo(e,At));var Dt=bt?po(e,At):ne(Z);la(e,At,Dt,ns(e,At)),!bt&&e.cm&&e.cm.scrollIntoView({from:At.from,to:fi(At)});var Ut=[];pi(e,function(Lt,Wt){!Wt&&me(Ut,Lt.history)==-1&&(gs(Lt.history,At),Ut.push(Lt.history)),la(Lt,At,null,ns(Lt,At))})},je=M.changes.length-1;je>=0;--je){var st=Ge(je);if(st)return st.v}}function fs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ur(ve(e.sel.ranges,function(o){return new wn(ct(o.anchor.line+t,o.anchor.ch),ct(o.head.line+t,o.head.ch))}),e.sel.primIndex),e.cm){ln(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)ur(e.cm,n,"gutter")}}function la(e,t,r,n){if(e.cm&&!e.cm.curOp)return er(e.cm,la)(e,t,r,n);if(t.to.line<e.first){fs(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);fs(e,o),t={from:ct(e.first,0),to:ct(t.to.line+o,t.to.ch),text:[ne(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:ct(M,_t(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=cn(e,t.from,t.to),r||(r=po(e,t)),e.cm?El(e.cm,t,n):go(e,t,n),ja(e,r,Be),e.cantEdit&&Wa(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,r){var n=e.doc,o=e.display,M=t.from,z=t.to,Z=!1,q=M.line;e.options.lineWrapping||(q=Nt(Yn(_t(n,M.line))),n.iter(q,z.line+1,function(je){if(je==o.maxLine)return Z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&xe(e),go(n,t,r,Kt(e)),e.options.lineWrapping||(n.iter(q,M.line+t.text.length,function(je){var st=Kr(je);st>o.maxLineLength&&(o.maxLine=je,o.maxLineLength=st,o.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),cr(n,M.line),aa(e,400);var te=t.text.length-(z.line-M.line)-1;t.full?ln(e):M.line==z.line&&t.text.length==1&&!Jo(e.doc,t)?ur(e,M.line,"text"):ln(e,M.line,z.line+1,te);var be=he(e,"changes"),Te=he(e,"change");if(Te||be){var Ge={from:M,to:z,text:t.text,removed:t.removed,origin:t.origin};Te&&bn(e,"change",e,Ge),be&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ge)}e.display.selForContextMenu=null}function Ni(e,t,r,n,o){var M;n||(n=r),Gt(n,r)<0&&(M=[n,r],r=M[0],n=M[1]),typeof t=="string"&&(t=e.splitLines(t)),Pi(e,{from:r,to:n,text:t,origin:o})}function ps(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ms(e,t,r,n){for(var o=0;o<e.length;++o){var M=e[o],z=!0;if(M.ranges){M.copied||(M=e[o]=M.deepCopy(),M.copied=!0);for(var Z=0;Z<M.ranges.length;Z++)ps(M.ranges[Z].anchor,t,r,n),ps(M.ranges[Z].head,t,r,n);continue}for(var q=0;q<M.changes.length;++q){var te=M.changes[q];if(r<te.from.line)te.from=ct(te.from.line+n,te.from.ch),te.to=ct(te.to.line+n,te.to.ch);else if(t<=te.to.line){z=!1;break}}z||(e.splice(0,o+1),o=0)}}function gs(e,t){var r=t.from.line,n=t.to.line,o=t.text.length-(n-r)-1;ms(e.done,r,n,o),ms(e.undone,r,n,o)}function ua(e,t,r,n){var o=t,M=t;return typeof t=="number"?M=_t(e,G(e,t)):o=Nt(t),o==null?null:(n(M,o)&&e.cm&&ur(e.cm,o,r),M)}function da(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var o=this.lines[r];this.height-=o.height,si(o),bn(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function ca(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var o=e[n];t+=o.chunkSize(),r+=o.height,o.parent=this}this.size=t,this.height=r,this.parent=null}ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var M=Math.min(t,o-e),z=n.height;if(n.removeInner(e,M),this.height-=z-n.height,o==M&&(this.children.splice(r--,1),n.parent=null),(t-=M)==0)break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof da))){var Z=[];this.collapse(Z),this.children=[new da(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var o=this.children[n],M=o.chunkSize();if(e<=M){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var z=o.lines.length%25+25,Z=z;Z<o.lines.length;){var q=new da(o.lines.slice(Z,Z+=25));o.height-=q.height,this.children.splice(++n,0,q),q.parent=this}o.lines=o.lines.slice(0,z),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ca(t);if(e.parent){e.size-=r.size,e.height-=r.height;var o=me(e.parent.children,e);e.parent.children.splice(o+1,0,r)}else{var n=new ca(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var o=this.children[n],M=o.chunkSize();if(e<M){var z=Math.min(t,M-e);if(o.iterN(e,z,r))return!0;if((t-=z)==0)break;e=0}else e-=M}}};var ha=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Nt(r);if(n==null||!t)return;for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(r.widgets=null);var M=li(this);$t(r,Math.max(0,r.height-M)),e&&(Lr(e,function(){vs(e,r,-M),ur(e,n,"widget")}),bn(e,"lineWidgetCleared",e,this,n))},ha.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var o=li(this)-t;if(!o)return;sr(this.doc,n)||$t(n,n.height+o),r&&Lr(r,function(){r.curOp.forceUpdate=!0,vs(r,n,o),bn(r,"lineWidgetChanged",r,e,Nt(n))})},ge(ha);function vs(e,t,r){Cr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&so(e,r)}function xl(e,t,r,n){var o=new ha(e,r,n),M=e.cm;return M&&o.noHScroll&&(M.display.alignWidgets=!0),ua(e,t,"widget",function(z){var Z=z.widgets||(z.widgets=[]);if(o.insertAt==null?Z.push(o):Z.splice(Math.min(Z.length-1,Math.max(0,o.insertAt)),0,o),o.line=z,M&&!sr(e,z)){var q=Cr(z)<e.scrollTop;$t(z,z.height+li(o)),q&&so(M,o.height),M.curOp.forceUpdate=!0}return!0}),M&&bn(M,"lineWidgetAdded",M,o,typeof t=="number"?t:Nt(t)),o}var ys=0,mi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ys};mi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ci(e),he(this,"clear")){var r=this.find();r&&bn(this,"clear",r.from,r.to)}for(var n=null,o=null,M=0;M<this.lines.length;++M){var z=this.lines[M],Z=ar(z.markedSpans,this);e&&!this.collapsed?ur(e,Nt(z),"text"):e&&(Z.to!=null&&(o=Nt(z)),Z.from!=null&&(n=Nt(z))),z.markedSpans=Ir(z.markedSpans,Z),Z.from==null&&this.collapsed&&!sr(this.doc,z)&&e&&$t(z,Ot(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var te=Yn(this.lines[q]),be=Kr(te);be>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=be,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&ln(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ss(e.doc)),e&&bn(e,"markerCleared",e,this,n,o),t&&Si(e),this.parent&&this.parent.clear()},mi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,o=0;o<this.lines.length;++o){var M=this.lines[o],z=ar(M.markedSpans,this);if(z.from!=null&&(r=ct(t?M:Nt(M),z.from),e==-1))return r;if(z.to!=null&&(n=ct(t?M:Nt(M),z.to),e==1))return n}return r&&{from:r,to:n}},mi.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;Lr(n,function(){var o=t.line,M=Nt(t.line),z=ri(n,M);if(z&&(Sa(z),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!sr(r.doc,o)&&r.height!=null){var Z=r.height;r.height=null;var q=li(r)-Z;q&&$t(o,o.height+q)}bn(n,"markerChanged",n,e)})},mi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||me(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},mi.prototype.detachLine=function(e){if(this.lines.splice(me(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ge(mi);function Bi(e,t,r,n,o){if(n&&n.shared)return Cl(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return er(e.cm,Bi)(e,t,r,n,o);var M=new mi(e,o),z=Gt(t,r);if(n&&j(n,M,!1),z>0||z==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=x("span",[M.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(In(e,t.line,t,r,M)||t.line!=r.line&&In(e,r.line,t,r,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");$n()}M.addToHistory&&es(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var Z=t.line,q=e.cm,te;if(e.iter(Z,r.line+1,function(Te){q&&M.collapsed&&!q.options.lineWrapping&&Yn(Te)==q.display.maxLine&&(te=!0),M.collapsed&&Z!=t.line&&$t(Te,0),Er(Te,new kr(M,Z==t.line?t.ch:null,Z==r.line?r.ch:null)),++Z}),M.collapsed&&e.iter(t.line,r.line+1,function(Te){sr(e,Te)&&$t(Te,0)}),M.clearOnEnter&&Se(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(hr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++ys,M.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),M.collapsed)ln(q,t.line,r.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var be=t.line;be<=r.line;be++)ur(q,be,"text");M.atomic&&ss(q.doc),bn(q,"markerAdded",q,M)}return M}var fa=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};fa.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();bn(this,"clear")},fa.prototype.find=function(e,t){return this.primary.find(e,t)},ge(fa);function Cl(e,t,r,n,o){n=j(n),n.shared=!1;var M=[Bi(e,t,r,n,o)],z=M[0],Z=n.widgetNode;return pi(e,function(q){Z&&(n.widgetNode=Z.cloneNode(!0)),M.push(Bi(q,p(q,t),p(q,r),n,o));for(var te=0;te<q.linked.length;++te)if(q.linked[te].isParent)return;z=ne(M)}),new fa(M,z)}function bs(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var r=0;r<t.length;r++){var n=t[r],o=n.find(),M=e.clipPos(o.from),z=e.clipPos(o.to);if(Gt(M,z)){var Z=Bi(e,M,z,n.primary,n.primary.type);n.markers.push(Z),Z.parent=n}}}function Al(e){for(var t=function(n){var o=e[n],M=[o.primary.doc];pi(o.primary.doc,function(q){return M.push(q)});for(var z=0;z<o.markers.length;z++){var Z=o.markers[z];me(M,Z.doc)==-1&&(Z.parent=null,o.markers.splice(z--,1))}},r=0;r<e.length;r++)t(r)}var Tl=0,Sr=function(e,t,r,n,o){if(!(this instanceof Sr))return new Sr(e,t,r,n,o);r==null&&(r=0),ca.call(this,[new da([new lr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var M=ct(r,0);this.sel=hi(M),this.history=new Ba(null),this.id=++Tl,this.modeOption=t,this.lineSep=n,this.direction=o=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),go(this,{from:M,to:M,text:e}),pr(this,hi(M),Be)};Sr.prototype=Ie(ca.prototype,{constructor:Sr,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=zt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:tr(function(e){var t=ct(this.first,0),r=this.first+this.size-1;Pi(this,{from:t,to:ct(r,_t(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ta(this.cm,0,0),pr(this,hi(t),Be)}),replaceRange:function(e,t,r,n){t=p(this,t),r=r?p(this,r):t,Ni(this,e,t,r,n)},getRange:function(e,t,r){var n=cn(this,p(this,e),p(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(An(this,e))return _t(this,e)},getLineNumber:function(e){return Nt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=_t(this,e)),Yn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return p(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tr(function(e,t,r){is(this,p(this,typeof e=="number"?ct(e,t||0):e),null,r)}),setSelection:tr(function(e,t,r){is(this,p(this,e),p(this,t||e),r)}),extendSelection:tr(function(e,t,r){Fa(this,p(this,e),t&&p(this,t),r)}),extendSelections:tr(function(e,t){rs(this,K(this,e),t)}),extendSelectionsBy:tr(function(e,t){var r=ve(this.sel.ranges,e);rs(this,K(this,r),t)}),setSelections:tr(function(e,t,r){if(!e.length)return;for(var n=[],o=0;o<e.length;o++)n[o]=new wn(p(this,e[o].anchor),p(this,e[o].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),pr(this,Vr(this.cm,n,t),r)}),addSelection:tr(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new wn(p(this,e),p(this,t||e))),pr(this,Vr(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var o=cn(this,t[n].from(),t[n].to());r=r?r.concat(o):o}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var o=cn(this,r[n].from(),r[n].to());e!==!1&&(o=o.join(e||this.lineSeparator())),t[n]=o}return t},replaceSelection:function(e,t,r){for(var n=[],o=0;o<this.sel.ranges.length;o++)n[o]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:tr(function(e,t,r){for(var n=[],o=this.sel,M=0;M<o.ranges.length;M++){var z=o.ranges[M];n[M]={from:z.from(),to:z.to(),text:this.splitLines(e[M]),origin:r}}for(var Z=t&&t!="end"&&hl(this,n,t),q=n.length-1;q>=0;q--)Pi(this,n[q]);Z?as(this,Z):this.cm&&Li(this.cm)}),undo:tr(function(){Ha(this,"undo")}),redo:tr(function(){Ha(this,"redo")}),undoSelection:tr(function(){Ha(this,"undo",!0)}),redoSelection:tr(function(){Ha(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ba(this.history.maxGeneration),pi(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ki(this.history.done),undone:ki(this.history.undone)}},setHistory:function(e){var t=this.history=new Ba(this.history.maxGeneration);t.done=ki(e.done.slice(0),null,!0),t.undone=ki(e.undone.slice(0),null,!0)},setGutterMarker:tr(function(e,t,r){return ua(this,e,"gutter",function(n){var o=n.gutterMarkers||(n.gutterMarkers={});return o[t]=r,!r&&ot(o)&&(n.gutterMarkers=null),!0})}),clearGutter:tr(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&ua(t,r,"gutter",function(){return r.gutterMarkers[e]=null,ot(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!An(this,e))return null;if(t=e,e=_t(this,e),!e)return null}else if(t=Nt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:tr(function(e,t,r){return ua(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[o])n[o]=r;else{if(v(r).test(n[o]))return!1;n[o]+=" "+r}return!0})}),removeLineClass:tr(function(e,t,r){return ua(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=n[o];if(M)if(r==null)n[o]=null;else{var z=M.match(v(r));if(!z)return!1;var Z=z.index+z[0].length;n[o]=M.slice(0,z.index)+(!z.index||Z==M.length?"":" ")+M.slice(Z)||null}else return!1;return!0})}),addLineWidget:tr(function(e,t,r){return xl(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Bi(this,p(this,e),p(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=p(this,e),Bi(this,e,e,r,"bookmark")},findMarksAt:function(e){e=p(this,e);var t=[],r=_t(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var o=r[n];(o.from==null||o.from<=e.ch)&&(o.to==null||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,r){e=p(this,e),t=p(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,function(M){var z=M.markedSpans;if(z)for(var Z=0;Z<z.length;Z++){var q=z[Z];!(q.to!=null&&o==e.line&&e.ch>=q.to||q.from==null&&o!=e.line||q.from!=null&&o==t.line&&q.from>=t.ch)&&(!r||r(q.marker))&&n.push(q.marker.parent||q.marker)}++o}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(o){var M=o.text.length+n;if(M>e)return t=e,!0;e-=M,++r}),p(this,ct(r,t))},indexFromPos:function(e){e=p(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new Sr(zt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Sr(zt(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(n,bs(this)),n},unlinkDoc:function(e){if(e instanceof Nn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Al(bs(this));break}if(e.history==this.history){var n=[e.id];pi(e,function(o){return n.push(o.id)},!0),e.history=new Ba(null),e.history.done=ki(this.history.done,n),e.history.undone=ki(this.history.undone,n)}},iterLinkedDocs:function(e){pi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Qe(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:tr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Sr.prototype.eachLine=Sr.prototype.iter;var Es=0;function wl(e){var t=this;if(xs(t),qe(t,e)||$r(t.display,e))return;re(e),U&&(Es=+new Date);var r=yn(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,M=Array(o),z=0,Z=function(){++z==o&&er(t,function(){r=p(t.doc,r);var je={from:r,to:r,text:t.doc.splitLines(M.filter(function(st){return st!=null}).join(t.doc.lineSeparator())),origin:"paste"};Pi(t.doc,je),as(t.doc,hi(p(t.doc,r),p(t.doc,fi(je))))})()},q=function(je,st){if(t.options.allowDropFileTypes&&me(t.options.allowDropFileTypes,je.type)==-1){Z();return}var bt=new FileReader;bt.onerror=function(){return Z()},bt.onload=function(){var At=bt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(At)){Z();return}M[st]=At,Z()},bt.readAsText(je)},te=0;te<n.length;te++)q(n[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var be=e.dataTransfer.getData("Text");if(be){var Te;if(t.state.draggingText&&!t.state.draggingText.copy&&(Te=t.listSelections()),ja(t.doc,hi(r,r)),Te)for(var Ge=0;Ge<Te.length;++Ge)Ni(t.doc,"",Te[Ge].anchor,Te[Ge].head,"drag");t.replaceSelection(be,"around","paste"),t.display.input.focus()}}catch(je){}}}function Rl(e,t){if(U&&(!e.state.draggingText||+new Date-Es<100)){ue(t);return}if(qe(e,t)||$r(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!P){var r=i("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",R&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),R&&r.parentNode.removeChild(r)}}function _l(e,t){var r=yn(e,t);if(!r)return;var n=document.createDocumentFragment();ko(e,r,n),e.display.dragCursor||(e.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),a(e.display.dragCursor,n)}function xs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Cs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var o=t[n].CodeMirror;o&&r.push(o)}r.length&&r[0].operation(function(){for(var M=0;M<r.length;M++)e(r[M])})}var Ss=!1;function Ol(){if(Ss)return;Dl(),Ss=!0}function Dl(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Cs(Ll)},100))}),Se(window,"blur",function(){return Cs(Di)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var gi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},pa=0;pa<10;pa++)gi[pa+48]=gi[pa+96]=String(pa);for(var Ka=65;Ka<=90;Ka++)gi[Ka]=String.fromCharCode(Ka);for(var ma=1;ma<=12;ma++)gi[ma+111]=gi[ma+63235]="F"+ma;var ii={};ii.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ii.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ii.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ii.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ii.default=u?ii.macDefault:ii.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,o,M,z=0;z<t.length-1;z++){var Z=t[z];if(/^(cmd|meta|m)$/i.test(Z))M=!0;else if(/^a(lt)?$/i.test(Z))r=!0;else if(/^(c|ctrl|control)$/i.test(Z))n=!0;else if(/^s(hift)?$/i.test(Z))o=!0;else throw new Error("Unrecognized modifier name: "+Z)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),o&&(e="Shift-"+e),e}function kl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var o=ve(r.split(" "),Ml),M=0;M<o.length;M++){var z=void 0,Z=void 0;M==o.length-1?(Z=o.join(" "),z=n):(Z=o.slice(0,M+1).join(" "),z="...");var q=t[Z];if(!q)t[Z]=z;else if(q!=z)throw new Error("Inconsistent bindings for "+Z)}delete e[r]}for(var te in t)e[te]=t[te];return e}function Ui(e,t,r,n){t=za(t);var o=t.call?t.call(e,n):t[e];if(o===!1)return"nothing";if(o==="...")return"multi";if(o!=null&&r(o))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ui(e,t.fallthrough,r,n);for(var M=0;M<t.fallthrough.length;M++){var z=Ui(e,t.fallthrough[M],r,n);if(z)return z}}}function As(e){var t=typeof e=="string"?e:gi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ts(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(f?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(f?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ws(e,t){if(R&&e.keyCode==34&&e.char)return!1;var r=gi[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),Ts(r,e,t))}function za(e){return typeof e=="string"?ii[e]:e}function Fi(e,t){for(var r=e.doc.sel.ranges,n=[],o=0;o<r.length;o++){for(var M=t(r[o]);n.length&&Gt(M.from,ne(n).to)<=0;){var z=n.pop();if(Gt(z.from,M.from)<0){M.from=z.from;break}}n.push(M)}Lr(e,function(){for(var Z=n.length-1;Z>=0;Z--)Ni(e.doc,"",n[Z].from,n[Z].to,"+delete");Li(e)})}function Eo(e,t,r){var n=Ve(e.text,t+r,r);return n<0||n>e.text.length?null:n}function xo(e,t,r){var n=Eo(e,t.ch,r);return n==null?null:new ct(t.line,n,r<0?"after":"before")}function Co(e,t,r,n,o){if(e){t.doc.direction=="rtl"&&(o=-o);var M=Ct(r,t.doc.direction);if(M){var z=o<0?ne(M):M[0],Z=o<0==(z.level==1),q=Z?"after":"before",te;if(z.level>0||t.doc.direction=="rtl"){var be=ui(t,r);te=o<0?r.text.length-1:0;var Te=Nr(t,be,te).top;te=ht(function(Ge){return Nr(t,be,Ge).top==Te},o<0==(z.level==1)?z.from:z.to-1,te),q=="before"&&(te=Eo(r,te,1))}else te=o<0?z.to:z.from;return new ct(n,te,q)}}return new ct(n,o<0?r.text.length:0,o<0?"before":"after")}function Il(e,t,r,n){var o=Ct(t,e.doc.direction);if(!o)return xo(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var M=Et(o,r.ch,r.sticky),z=o[M];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>r.ch:z.from<r.ch))return xo(t,r,n);var Z=function(Dt,Ut){return Eo(t,Dt instanceof ct?Dt.ch:Dt,Ut)},q,te=function(Dt){return e.options.lineWrapping?(q=q||ui(e,t),jt(e,t,q,Dt)):{begin:0,end:t.text.length}},be=te(r.sticky=="before"?Z(r,-1):r.ch);if(e.doc.direction=="rtl"||z.level==1){var Te=z.level==1==n<0,Ge=Z(r,Te?1:-1);if(Ge!=null&&(Te?Ge<=z.to&&Ge<=be.end:Ge>=z.from&&Ge>=be.begin)){var je=Te?"before":"after";return new ct(r.line,Ge,je)}}var st=function(Dt,Ut,Lt){for(var Wt=function(Dn,nr){return nr?new ct(r.line,Z(Dn,1),"before"):new ct(r.line,Dn,"after")};Dt>=0&&Dt<o.length;Dt+=Ut){var tn=o[Dt],Zt=Ut>0==(tn.level!=1),dn=Zt?Lt.begin:Z(Lt.end,-1);if(tn.from<=dn&&dn<tn.to)return Wt(dn,Zt);if(dn=Zt?tn.from:Z(tn.to,-1),Lt.begin<=dn&&dn<Lt.end)return Wt(dn,Zt)}},bt=st(M+n,n,be);if(bt)return bt;var At=n>0?be.end:Z(be.begin,-1);return At!=null&&!(n>0&&At==t.text.length)&&(bt=st(n>0?0:o.length-1,n,te(At)),bt)?bt:null}var ga={selectAll:ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Be)},killLine:function(e){return Fi(e,function(t){if(t.empty()){var r=_t(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ct(t.head.line+1,0)}:{from:t.head,to:ct(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Fi(e,function(t){return{from:ct(t.from().line,0),to:p(e.doc,ct(t.to().line+1,0))}})},delLineLeft:function(e){return Fi(e,function(t){return{from:ct(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Fi(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Fi(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Rs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return _s(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Le)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Le)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?_s(e,t.head):n},Le)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,o=0;o<r.length;o++){var M=r[o].from(),z=$(e.getLine(M.line),M.ch,n);t.push(ce(n-z%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Lr(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var o=t[n].head,M=_t(e.doc,o.line).text;if(M){if(o.ch==M.length&&(o=new ct(o.line,o.ch-1)),o.ch>0)o=new ct(o.line,o.ch+1),e.replaceRange(M.charAt(o.ch-1)+M.charAt(o.ch-2),ct(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var z=_t(e.doc,o.line-1).text;z&&(o=new ct(o.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),ct(o.line-1,z.length-1),o,"+transpose"))}}r.push(new wn(o,o))}e.setSelections(r)})},newlineAndIndent:function(e){return Lr(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Li(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Rs(e,t){var r=_t(e.doc,t),n=Yn(r);return n!=r&&(t=Nt(n)),Co(!0,e,n,t,1)}function Pl(e,t){var r=_t(e.doc,t),n=zr(r);return n!=r&&(t=Nt(n)),Co(!0,e,r,t,-1)}function _s(e,t){var r=Rs(e,t.line),n=_t(e.doc,r.line),o=Ct(n,e.doc.direction);if(!o||o[0].level==0){var M=Math.max(r.ch,n.text.search(/\S/)),z=t.line==r.line&&t.ch<=M&&t.ch;return ct(r.line,z?0:M,r.sticky)}return r}function Ga(e,t,r){if(typeof t=="string"&&(t=ga[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),o=t(e)!=We}finally{e.display.shift=n,e.state.suppressEdits=!1}return o}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var o=Ui(t,e.state.keyMaps[n],r,e);if(o)return o}return e.options.extraKeys&&Ui(t,e.options.extraKeys,r,e)||Ui(t,e.options.keyMap,r,e)}var Bl=new se;function va(e,t,r,n){var o=e.state.keySeq;if(o){if(As(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())}),Os(e,o+" "+t,r,n))return!0}return Os(e,t,r,n)}function Os(e,t,r,n){var o=Nl(e,t,n);return o=="multi"&&(e.state.keySeq=t),o=="handled"&&bn(e,"keyHandled",e,t,r),(o=="handled"||o=="multi")&&(re(r),io(e)),!!o}function Ds(e,t){var r=ws(t,!0);return r?t.shiftKey&&!e.state.keySeq?va(e,"Shift-"+r,t,function(n){return Ga(e,n,!0)})||va(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Ga(e,n)}):va(e,r,t,function(n){return Ga(e,n)}):!1}function Ul(e,t,r){return va(e,"'"+r+"'",t,function(n){return Ga(e,n,!0)})}var So=null;function Ls(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=L(),qe(t,e))return;U&&B<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=Ds(t,e);R&&(So=n?r:null,!n&&r==88&&!De&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),k&&!u&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;C(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(c(t,"CodeMirror-crosshair"),nt(document,"keyup",r),nt(document,"mouseover",r))}Se(document,"keyup",r),Se(document,"mouseover",r)}function Ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),qe(this,e)}function ks(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if($r(t.display,e)||qe(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(R&&r==So){So=null,re(e);return}if(R&&(!e.which||e.which<10)&&Ds(t,e))return;var o=String.fromCharCode(n==null?r:n);if(o=="\b")return;if(Ul(t,e,o))return;t.display.input.onKeyPress(e)}var jl=400,Ao=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ao.prototype.compare=function(e,t,r){return this.time+jl>e&&Gt(t,this.pos)==0&&r==this.button};var ya,ba;function Wl(e,t){var r=+new Date;return ba&&ba.compare(r,e,t)?(ya=ba=null,"triple"):ya&&ya.compare(r,e,t)?(ba=new Ao(r,e,t),ya=null,"double"):(ya=new Ao(r,e,t),ba=null,"single")}function Is(e){var t=this,r=t.display;if(qe(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,$r(r,e)){I||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(To(t,e))return;var n=yn(t,e),o=we(e),M=n?Wl(n,o):"single";if(window.focus(),o==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,o,n,M,e))return;o==1?n?zl(t,n,M,e):Oe(e)==r.scroller&&re(e):o==2?(n&&Fa(t.doc,n),setTimeout(function(){return r.input.focus()},20)):o==3&&(w?t.display.input.onContextMenu(e):Po(t))}function Hl(e,t,r,n,o){var M="Click";return n=="double"?M="Double"+M:n=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,va(e,Ts(M,o),o,function(z){if(typeof z=="string"&&(z=ga[z]),!z)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=z(e,r)!=We}finally{e.state.suppressEdits=!1}return Z})}function Kl(e,t,r){var n=e.getOption("configureMouse"),o=n?n(e,t,r):{};if(o.unit==null){var M=h?r.shiftKey&&r.metaKey:r.altKey;o.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(o.extend==null||e.doc.extend)&&(o.extend=e.doc.extend||r.shiftKey),o.addNew==null&&(o.addNew=u?r.metaKey:r.ctrlKey),o.moveOnDrag==null&&(o.moveOnDrag=!(u?r.altKey:r.ctrlKey)),o}function zl(e,t,r,n){U?setTimeout(W(Io,e),0):e.curOp.focus=L();var o=Kl(e,r,n),M=e.doc.sel,z;e.options.dragDrop&&rt&&!e.isReadOnly()&&r=="single"&&(z=M.contains(t))>-1&&(Gt((z=M.ranges[z]).from(),t)<0||t.xRel>0)&&(Gt(z.to(),t)>0||t.xRel<0)?Gl(e,n,t,o):Vl(e,n,t,o)}function Gl(e,t,r,n){var o=e.display,M=!1,z=er(e,function(te){I&&(o.scroller.draggable=!1),e.state.draggingText=!1,nt(o.wrapper.ownerDocument,"mouseup",z),nt(o.wrapper.ownerDocument,"mousemove",Z),nt(o.scroller,"dragstart",q),nt(o.scroller,"drop",z),M||(re(te),n.addNew||Fa(e.doc,r,null,null,n.extend),I&&!P||U&&B==9?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),Z=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return M=!0};I&&(o.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),Se(o.wrapper.ownerDocument,"mouseup",z),Se(o.wrapper.ownerDocument,"mousemove",Z),Se(o.scroller,"dragstart",q),Se(o.scroller,"drop",z),Po(e),setTimeout(function(){return o.input.focus()},20)}function Ps(e,t,r){if(r=="char")return new wn(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new wn(ct(t.line,0),p(e.doc,ct(t.line+1,0)));var n=r(e,t);return new wn(n.from,n.to)}function Vl(e,t,r,n){var o=e.display,M=e.doc;re(t);var z,Z,q=M.sel,te=q.ranges;if(n.addNew&&!n.extend?(Z=M.sel.contains(r),Z>-1?z=te[Z]:z=new wn(r,r)):(z=M.sel.primary(),Z=M.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new wn(r,r)),r=yn(e,t,!0,!0),Z=-1;else{var be=Ps(e,r,n.unit);n.extend?z=yo(z,be.anchor,be.head,n.extend):z=be}n.addNew?Z==-1?(Z=te.length,pr(M,Vr(e,te.concat([z]),Z),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Z].empty()&&n.unit=="char"&&!n.extend?(pr(M,Vr(e,te.slice(0,Z).concat(te.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),q=M.sel):bo(M,Z,z,Ne):(Z=0,pr(M,new Ur([z],0),Ne),q=M.sel);var Te=r;function Ge(Lt){if(Gt(Te,Lt)==0)return;if(Te=Lt,n.unit=="rectangle"){for(var Wt=[],tn=e.options.tabSize,Zt=$(_t(M,r.line).text,r.ch,tn),dn=$(_t(M,Lt.line).text,Lt.ch,tn),Dn=Math.min(Zt,dn),nr=Math.max(Zt,dn),Un=Math.min(r.line,Lt.line),Mr=Math.min(e.lastLine(),Math.max(r.line,Lt.line));Un<=Mr;Un++){var Ar=_t(M,Un).text,Gn=Ue(Ar,Dn,tn);Dn==nr?Wt.push(new wn(ct(Un,Gn),ct(Un,Gn))):Ar.length>Gn&&Wt.push(new wn(ct(Un,Gn),ct(Un,Ue(Ar,nr,tn))))}Wt.length||Wt.push(new wn(r,r)),pr(M,Vr(e,q.ranges.slice(0,Z).concat(Wt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Lt)}else{var Tr=z,dr=Ps(e,Lt,n.unit),qn=Tr.anchor,Vn;Gt(dr.anchor,qn)>0?(Vn=dr.head,qn=Xn(Tr.from(),dr.anchor)):(Vn=dr.anchor,qn=kn(Tr.to(),dr.head));var jn=q.ranges.slice(0);jn[Z]=Xl(e,new wn(p(M,qn),Vn)),pr(M,Vr(e,jn,Z),Ne)}}var je=o.wrapper.getBoundingClientRect(),st=0;function bt(Lt){var Wt=++st,tn=yn(e,Lt,!0,n.unit=="rectangle");if(!tn)return;if(Gt(tn,Te)!=0){e.curOp.focus=L(),Ge(tn);var Zt=ka(o,M);(tn.line>=Zt.to||tn.line<Zt.from)&&setTimeout(er(e,function(){st==Wt&&bt(Lt)}),150)}else{var dn=Lt.clientY<je.top?-20:Lt.clientY>je.bottom?20:0;dn&&setTimeout(er(e,function(){if(st!=Wt)return;o.scroller.scrollTop+=dn,bt(Lt)}),50)}}function At(Lt){e.state.selectingText=!1,st=Infinity,Lt&&(re(Lt),o.input.focus()),nt(o.wrapper.ownerDocument,"mousemove",Dt),nt(o.wrapper.ownerDocument,"mouseup",Ut),M.history.lastSelOrigin=null}var Dt=er(e,function(Lt){Lt.buttons===0||!we(Lt)?At(Lt):bt(Lt)}),Ut=er(e,At);e.state.selectingText=Ut,Se(o.wrapper.ownerDocument,"mousemove",Dt),Se(o.wrapper.ownerDocument,"mouseup",Ut)}function Xl(e,t){var r=t.anchor,n=t.head,o=_t(e.doc,r.line);if(Gt(r,n)==0&&r.sticky==n.sticky)return t;var M=Ct(o);if(!M)return t;var z=Et(M,r.ch,r.sticky),Z=M[z];if(Z.from!=r.ch&&Z.to!=r.ch)return t;var q=z+(Z.from==r.ch==(Z.level!=1)?0:1);if(q==0||q==M.length)return t;var te;if(n.line!=r.line)te=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var be=Et(M,n.ch,n.sticky),Te=be-z||(n.ch-r.ch)*(Z.level==1?-1:1);be==q-1||be==q?te=Te<0:te=Te>0}var Ge=M[q+(te?-1:0)],je=te==(Ge.level==1),st=je?Ge.from:Ge.to,bt=je?"after":"before";return r.ch==st&&r.sticky==bt?t:new wn(new ct(r.line,st,bt),n)}function Ns(e,t,r,n){var o,M;if(t.touches)o=t.touches[0].clientX,M=t.touches[0].clientY;else try{o=t.clientX,M=t.clientY}catch(Ge){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var z=e.display,Z=z.lineDiv.getBoundingClientRect();if(M>Z.bottom||!he(e,r))return oe(t);M-=Z.top-z.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var te=z.gutters.childNodes[q];if(te&&te.getBoundingClientRect().right>=o){var be=nn(e.doc,M),Te=e.display.gutterSpecs[q];return Fe(e,r,e,be,Te.className,t),oe(t)}}}function To(e,t){return Ns(e,t,"gutterClick",!0)}function Bs(e,t){if($r(e.display,t)||Ql(e,t))return;if(qe(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Ql(e,t){return he(e,"gutterContextMenu")?Ns(e,t,"gutterContextMenu",!1):!1}function Us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),di(e)}var ji={toString:function(){return"CodeMirror.Init"}},Fs={},Va={};function Yl(e){var t=e.optionHandlers;function r(n,o,M,z){e.defaults[n]=o,M&&(t[n]=z?function(Z,q,te){te!=ji&&M(Z,q,te)}:M)}e.defineOption=r,e.Init=ji,r("value","",function(n,o){return n.setValue(o)},!0),r("mode",null,function(n,o){n.doc.modeOption=o,mo(n)},!0),r("indentUnit",2,mo,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){sa(n),di(n),ln(n)},!0),r("lineSeparator",null,function(n,o){if(n.doc.lineSep=o,!o)return;var M=[],z=n.doc.first;n.doc.iter(function(q){for(var te=0;;){var be=q.text.indexOf(o,te);if(be==-1)break;te=be+o.length,M.push(ct(z,be))}z++});for(var Z=M.length-1;Z>=0;Z--)Ni(n.doc,o,M[Z],ct(M[Z].line,M[Z].ch+o.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,o,M){n.state.specialChars=new RegExp(o.source+(o.test(" ")?"":"| "),"g"),M!=ji&&n.refresh()}),r("specialCharPlaceholder",pn,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,o){return n.getInputField().spellcheck=o},!0),r("autocorrect",!1,function(n,o){return n.getInputField().autocorrect=o},!0),r("autocapitalize",!1,function(n,o){return n.getInputField().autocapitalize=o},!0),r("rtlMoveVisually",!T),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Us(n),oa(n)},!0),r("keyMap","default",function(n,o,M){var z=za(o),Z=M!=ji&&za(M);Z&&Z.detach&&Z.detach(n,z),z.attach&&z.attach(n,Z||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,o){n.display.gutterSpecs=fo(o,n.options.lineNumbers),oa(n)},!0),r("fixedGutter",!0,function(n,o){n.display.gutters.style.left=o?Yt(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Mi(n)},!0),r("scrollbarStyle","native",function(n){Wo(n),Mi(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,o){n.display.gutterSpecs=fo(n.options.gutters,o),oa(n)},!0),r("firstLineNumber",1,oa,!0),r("lineNumberFormatter",function(n){return n},oa,!0),r("showCursorWhenSelecting",!1,ea,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,o){o=="nocursor"&&(Di(n),n.display.input.blur()),n.display.input.readOnlyChanged(o)}),r("screenReaderLabel",null,function(n,o){o=o===""?null:o,n.display.input.screenReaderLabelChanged(o)}),r("disableInput",!1,function(n,o){o||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,ea,!0),r("singleCursorHeightPerLine",!0,ea,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,sa,!0),r("addModeClass",!1,sa,!0),r("pollInterval",100),r("undoDepth",200,function(n,o){return n.doc.history.undoDepth=o}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,sa,!0),r("moveInputWithCursor",!0,function(n,o){o||n.display.input.resetPosition()}),r("tabindex",null,function(n,o){return n.display.input.getField().tabIndex=o||""}),r("autofocus",null),r("direction","ltr",function(n,o){return n.doc.setDirection(o)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=ji;if(!t!=!n){var o=e.display.dragFunctions,M=t?Se:nt;M(e.display.scroller,"dragstart",o.start),M(e.display.scroller,"dragenter",o.enter),M(e.display.scroller,"dragover",o.over),M(e.display.scroller,"dragleave",o.leave),M(e.display.scroller,"drop",o.drop)}}function Zl(e){e.options.lineWrapping?(C(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(c(e.display.wrapper,"CodeMirror-wrap"),Jr(e)),Jt(e),ln(e),di(e),setTimeout(function(){return Mi(e)},100)}function Nn(e,t){var r=this;if(!(this instanceof Nn))return new Nn(e,t);this.options=t=t?j(t):{},j(Fs,t,!1);var n=t.value;typeof n=="string"?n=new Sr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new Nn.inputStyles[t.inputStyle](this),M=this.display=new dl(e,n,o,t);M.wrapper.CodeMirror=this,Us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new se,keySeq:null,specialChars:null},t.autofocus&&!s&&M.input.focus(),U&&B<11&&setTimeout(function(){return r.display.input.reset(!0)},20),ql(this),Ol(),Ci(this),this.curOp.forceUpdate=!0,Zo(this,n),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&ao(r)},20):Di(this);for(var z in Va)Va.hasOwnProperty(z)&&Va[z](this,t[z],ji);zo(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<wo.length;++Z)wo[Z](this);Si(this),I&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}Nn.defaults=Fs,Nn.optionHandlers=Va;function ql(e){var t=e.display;Se(t.scroller,"mousedown",er(e,Is)),U&&B<11?Se(t.scroller,"dblclick",er(e,function(q){if(qe(e,q))return;var te=yn(e,q);if(!te||To(e,q)||$r(e.display,q))return;re(q);var be=e.findWordAt(te);Fa(e.doc,be.anchor,be.head)})):Se(t.scroller,"dblclick",function(q){return qe(e,q)||re(q)}),Se(t.scroller,"contextmenu",function(q){return Bs(e,q)}),Se(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||Bs(e,q)});var r,n={end:0};function o(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function M(q){if(q.touches.length!=1)return!1;var te=q.touches[0];return te.radiusX<=1&&te.radiusY<=1}function z(q,te){if(te.left==null)return!0;var be=te.left-q.left,Te=te.top-q.top;return be*be+Te*Te>20*20}Se(t.scroller,"touchstart",function(q){if(!qe(e,q)&&!M(q)&&!To(e,q)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Se(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Se(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!$r(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var be=e.coordsChar(t.activeTouch,"page"),Te;!te.prev||z(te,te.prev)?Te=new wn(be,be):!te.prev.prev||z(te,te.prev.prev)?Te=e.findWordAt(be):Te=new wn(ct(be.line,0),p(e.doc,ct(be.line+1,0))),e.setSelection(Te.anchor,Te.head),e.focus(),re(q)}o()}),Se(t.scroller,"touchcancel",o),Se(t.scroller,"scroll",function(){t.scroller.clientHeight&&(na(e,t.scroller.scrollTop),Ei(e,t.scroller.scrollLeft,!0),Fe(e,"scroll",e))}),Se(t.scroller,"mousewheel",function(q){return Xo(e,q)}),Se(t.scroller,"DOMMouseScroll",function(q){return Xo(e,q)}),Se(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){qe(e,q)||ue(q)},over:function(q){qe(e,q)||(_l(e,q),ue(q))},start:function(q){return Rl(e,q)},drop:er(e,wl),leave:function(q){qe(e,q)||xs(e)}};var Z=t.input.getField();Se(Z,"keyup",function(q){return Ms.call(e,q)}),Se(Z,"keydown",er(e,Ls)),Se(Z,"keypress",er(e,ks)),Se(Z,"focus",function(q){return ao(e,q)}),Se(Z,"blur",function(q){return Di(e,q)})}var wo=[];Nn.defineInitHook=function(e){return wo.push(e)};function Ea(e,t,r,n){var o=e.doc,M;r==null&&(r="add"),r=="smart"&&(o.mode.indent?M=Tt(e,t).state:r="prev");var z=e.options.tabSize,Z=_t(o,t),q=$(Z.text,null,z);Z.stateAfter&&(Z.stateAfter=null);var te=Z.text.match(/^\s*/)[0],be;if(!n&&!/\S/.test(Z.text))be=0,r="not";else if(r=="smart"&&(be=o.mode.indent(M,Z.text.slice(te.length),Z.text),be==We||be>150)){if(!n)return;r="prev"}r=="prev"?t>o.first?be=$(_t(o,t-1).text,null,z):be=0:r=="add"?be=q+e.options.indentUnit:r=="subtract"?be=q-e.options.indentUnit:typeof r=="number"&&(be=q+r),be=Math.max(0,be);var Te="",Ge=0;if(e.options.indentWithTabs)for(var je=Math.floor(be/z);je;--je)Ge+=z,Te+=" ";if(Ge<be&&(Te+=ce(be-Ge)),Te!=te)return Ni(o,Te,ct(t,0),ct(t,te.length),"+input"),Z.stateAfter=null,!0;for(var st=0;st<o.sel.ranges.length;st++){var bt=o.sel.ranges[st];if(bt.head.line==t&&bt.head.ch<te.length){var At=ct(t,te.length);bo(o,st,new wn(At,At));break}}}var Xr=null;function Xa(e){Xr=e}function Ro(e,t,r,n,o){var M=e.doc;e.display.shift=!1,n||(n=M.sel);var z=+new Date-200,Z=o=="paste"||e.state.pasteIncoming>z,q=Qe(t),te=null;if(Z&&n.ranges.length>1)if(Xr&&Xr.text.join(`
|
|
`)==t){if(n.ranges.length%Xr.text.length==0){te=[];for(var be=0;be<Xr.text.length;be++)te.push(M.splitLines(Xr.text[be]))}}else q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(te=ve(q,function(Dt){return[Dt]}));for(var Te=e.curOp.updateInput,Ge=n.ranges.length-1;Ge>=0;Ge--){var je=n.ranges[Ge],st=je.from(),bt=je.to();je.empty()&&(r&&r>0?st=ct(st.line,st.ch-r):e.state.overwrite&&!Z?bt=ct(bt.line,Math.min(_t(M,bt.line).text.length,bt.ch+ne(q).length)):Z&&Xr&&Xr.lineWise&&Xr.text.join(`
|
|
`)==q.join(`
|
|
`)&&(st=bt=ct(st.line,0)));var At={from:st,to:bt,text:te?te[Ge%te.length]:q,origin:o||(Z?"paste":e.state.cutIncoming>z?"cut":"+input")};Pi(e.doc,At),bn(e,"inputRead",e,At)}t&&!Z&&Ws(e,t),Li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Te),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function js(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Lr(t,function(){return Ro(t,r,0,null,"paste")}),!0}function Ws(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var o=r.ranges[n];if(o.head.ch>100||n&&r.ranges[n-1].head.line==o.head.line)continue;var M=e.getModeAt(o.head),z=!1;if(M.electricChars){for(var Z=0;Z<M.electricChars.length;Z++)if(t.indexOf(M.electricChars.charAt(Z))>-1){z=Ea(e,o.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(_t(e.doc,o.head.line).text.slice(0,o.head.ch))&&(z=Ea(e,o.head.line,"smart")));z&&bn(e,"electricInput",e,o.head.line)}}function Hs(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,M={anchor:ct(o,0),head:ct(o+1,0)};r.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:r}}function Ks(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function zs(){var e=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return I?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),Ks(e),t}function $l(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,o){var M=this.options,z=M[n];if(M[n]==o&&n!="mode")return;M[n]=o,t.hasOwnProperty(n)&&er(this,t[n])(this,o,z),Fe(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,o){this.state.keyMaps[o?"push":"unshift"](za(n))},removeKeyMap:function(n){for(var o=this.state.keyMaps,M=0;M<o.length;++M)if(o[M]==n||o[M].name==n)return o.splice(M,1),!0},addOverlay:yr(function(n,o){var M=n.token?n:e.getMode(this.options,n);if(M.startState)throw new Error("Overlays may not be stateful.");le(this.state.overlays,{mode:M,modeSpec:n,opaque:o&&o.opaque,priority:o&&o.priority||0},function(z){return z.priority}),this.state.modeGen++,ln(this)}),removeOverlay:yr(function(n){for(var o=this.state.overlays,M=0;M<o.length;++M){var z=o[M].modeSpec;if(z==n||typeof n=="string"&&z.name==n){o.splice(M,1),this.state.modeGen++,ln(this);return}}}),indentLine:yr(function(n,o,M){typeof o!="string"&&typeof o!="number"&&(o==null?o=this.options.smartIndent?"smart":"prev":o=o?"add":"subtract"),An(this.doc,n)&&Ea(this,n,o,M)}),indentSelection:yr(function(n){for(var o=this.doc.sel.ranges,M=-1,z=0;z<o.length;z++){var Z=o[z];if(Z.empty())Z.head.line>M&&(Ea(this,Z.head.line,n,!0),M=Z.head.line,z==this.doc.sel.primIndex&&Li(this));else{var q=Z.from(),te=Z.to(),be=Math.max(M,q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var Te=be;Te<M;++Te)Ea(this,Te,n);var Ge=this.doc.sel.ranges;q.ch==0&&o.length==Ge.length&&Ge[z].from().ch>0&&bo(this.doc,z,new wn(q,Ge[z].to()),Be)}}}),getTokenAt:function(n,o){return xn(this,n,o)},getLineTokens:function(n,o){return xn(this,ct(n),o,!0)},getTokenTypeAt:function(n){n=p(this.doc,n);var o=it(this,_t(this.doc,n.line)),M=0,z=(o.length-1)/2,Z=n.ch,q;if(Z==0)q=o[2];else for(;;){var te=M+z>>1;if((te?o[te*2-1]:0)>=Z)z=te;else if(o[te*2+1]<Z)M=te+1;else{q=o[te*2+2];break}}var be=q?q.indexOf("overlay "):-1;return be<0?q:be==0?null:q.slice(0,be-1)},getModeAt:function(n){var o=this.doc.mode;return o.innerMode?e.innerMode(o,this.getTokenAt(n).state).mode:o},getHelper:function(n,o){return this.getHelpers(n,o)[0]},getHelpers:function(n,o){var M=[];if(!r.hasOwnProperty(o))return M;var z=r[o],Z=this.getModeAt(n);if(typeof Z[o]=="string")z[Z[o]]&&M.push(z[Z[o]]);else if(Z[o])for(var q=0;q<Z[o].length;q++){var te=z[Z[o][q]];te&&M.push(te)}else Z.helperType&&z[Z.helperType]?M.push(z[Z.helperType]):z[Z.name]&&M.push(z[Z.name]);for(var be=0;be<z._global.length;be++){var Te=z._global[be];Te.pred(Z,this)&&me(M,Te.val)==-1&&M.push(Te.val)}return M},getStateAfter:function(n,o){var M=this.doc;return n=G(M,n==null?M.first+M.size-1:n),Tt(this,n+1,o).state},cursorCoords:function(n,o){var M,z=this.doc.sel.primary();return n==null?M=z.head:typeof n=="object"?M=p(this.doc,n):M=n?z.from():z.to(),Zn(this,M,o||"page")},charCoords:function(n,o){return Zi(this,p(this.doc,n),o||"page")},coordsChar:function(n,o){return n=Ra(this,n,o||"page"),$i(this,n.left,n.top)},lineAtHeight:function(n,o){return n=Ra(this,{top:n,left:0},o||"page").top,nn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,o,M){var z=!1,Z;if(typeof n=="number"){var q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>q&&(n=q,z=!0),Z=_t(this.doc,n)}else Z=n;return Oi(this,Z,{top:0,left:0},o||"page",M||z).top+(z?this.doc.height-Cr(Z):0)},defaultTextHeight:function(){return Ot(this.display)},defaultCharWidth:function(){return Pt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,o,M,z,Z){var q=this.display;n=Zn(this,p(this.doc,n));var te=n.bottom,be=n.left;if(o.style.position="absolute",o.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(o),q.sizer.appendChild(o),z=="over")te=n.top;else if(z=="above"||z=="near"){var Te=Math.max(q.wrapper.clientHeight,this.doc.height),Ge=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(z=="above"||n.bottom+o.offsetHeight>Te)&&n.top>o.offsetHeight?te=n.top-o.offsetHeight:n.bottom+o.offsetHeight<=Te&&(te=n.bottom),be+o.offsetWidth>Ge&&(be=Ge-o.offsetWidth)}o.style.top=te+"px",o.style.left=o.style.right="",Z=="right"?(be=q.sizer.clientWidth-o.offsetWidth,o.style.right="0px"):(Z=="left"?be=0:Z=="middle"&&(be=(q.sizer.clientWidth-o.offsetWidth)/2),o.style.left=be+"px"),M&&Js(this,{left:be,top:te,right:be+o.offsetWidth,bottom:te+o.offsetHeight})},triggerOnKeyDown:yr(Ls),triggerOnKeyPress:yr(ks),triggerOnKeyUp:Ms,triggerOnMouseDown:yr(Is),execCommand:function(n){if(ga.hasOwnProperty(n))return ga[n].call(null,this)},triggerElectric:yr(function(n){Ws(this,n)}),findPosH:function(n,o,M,z){var Z=1;o<0&&(Z=-1,o=-o);for(var q=p(this.doc,n),te=0;te<o&&!(q=_o(this.doc,q,Z,M,z),q.hitSide);++te);return q},moveH:yr(function(n,o){var M=this;this.extendSelectionsBy(function(z){return M.display.shift||M.doc.extend||z.empty()?_o(M.doc,z.head,n,o,M.options.rtlMoveVisually):n<0?z.from():z.to()},Le)}),deleteH:yr(function(n,o){var M=this.doc.sel,z=this.doc;M.somethingSelected()?z.replaceSelection("",null,"+delete"):Fi(this,function(Z){var q=_o(z,Z.head,n,o,!1);return n<0?{from:q,to:Z.head}:{from:Z.head,to:q}})}),findPosV:function(n,o,M,z){var Z=1,q=z;o<0&&(Z=-1,o=-o);for(var te=p(this.doc,n),be=0;be<o;++be){var Te=Zn(this,te,"div");if(q==null?q=Te.left:Te.left=q,te=Gs(this,Te,Z,M),te.hitSide)break}return te},moveV:yr(function(n,o){var M=this,z=this.doc,Z=[],q=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(be){if(q)return n<0?be.from():be.to();var Te=Zn(M,be.head,"div");be.goalColumn!=null&&(Te.left=be.goalColumn),Z.push(Te.left);var Ge=Gs(M,Te,n,o);return o=="page"&&be==z.sel.primary()&&so(M,Zi(M,Ge,"div").top-Te.top),Ge},Le),Z.length)for(var te=0;te<z.sel.ranges.length;te++)z.sel.ranges[te].goalColumn=Z[te]}),findWordAt:function(n){var o=this.doc,M=_t(o,n.line).text,z=n.ch,Z=n.ch;if(M){var q=this.getHelper(n,"wordChars");(n.sticky=="before"||Z==M.length)&&z?--z:++Z;for(var te=M.charAt(z),be=Ze(te,q)?function(Te){return Ze(Te,q)}:/\s/.test(te)?function(Te){return/\s/.test(Te)}:function(Te){return!/\s/.test(Te)&&!Ze(Te)};z>0&&be(M.charAt(z-1));)--z;for(;Z<M.length&&be(M.charAt(Z));)++Z}return new wn(ct(n.line,z),ct(n.line,Z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?C(this.display.cursorDiv,"CodeMirror-overwrite"):c(this.display.cursorDiv,"CodeMirror-overwrite"),Fe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:yr(function(n,o){ta(this,n,o)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-vr(this)-this.display.barHeight,width:n.scrollWidth-vr(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:ni(this)}},scrollIntoView:yr(function(n,o){n==null?(n={from:this.doc.sel.primary().head,to:null},o==null&&(o=this.options.cursorScrollMargin)):typeof n=="number"?n={from:ct(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=o||0,n.from.line!=null?Zs(this,n):Bo(this,n.from,n.to,n.margin)}),setSize:yr(function(n,o){var M=this,z=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};n!=null&&(this.display.wrapper.style.width=z(n)),o!=null&&(this.display.wrapper.style.height=z(o)),this.options.lineWrapping&&Aa(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function(q){if(q.widgets){for(var te=0;te<q.widgets.length;te++)if(q.widgets[te].noHScroll){ur(M,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,Fe(this,"refresh",this)}),operation:function(n){return Lr(this,n)},startOperation:function(){return Ci(this)},endOperation:function(){return Si(this)},refresh:yr(function(){var n=this.display.cachedTextHeight;ln(this),this.curOp.forceUpdate=!0,di(this),ta(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(n==null||Math.abs(n-Ot(this.display))>.5||this.options.lineWrapping)&&Jt(this),Fe(this,"refresh",this)}),swapDoc:yr(function(n){var o=this.doc;return o.cm=null,this.state.selectingText&&this.state.selectingText(),Zo(this,n),di(this),this.display.input.reset(),ta(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,bn(this,"swapDoc",this,o),o}),phrase:function(n){var o=this.options.phrases;return o&&Object.prototype.hasOwnProperty.call(o,n)?o[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ge(e),e.registerHelper=function(n,o,M){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][o]=M},e.registerGlobalHelper=function(n,o,M,z){e.registerHelper(n,o,z),r[n]._global.push({pred:M,val:z})}}function _o(e,t,r,n,o){var M=t,z=r,Z=_t(e,t.line),q=o&&e.direction=="rtl"?-r:r;function te(){var Ut=t.line+q;return Ut<e.first||Ut>=e.first+e.size?!1:(t=new ct(Ut,t.ch,t.sticky),Z=_t(e,Ut))}function be(Ut){var Lt;if(n=="codepoint"){var Wt=Z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Wt)?Lt=null:Lt=new ct(t.line,Math.max(0,Math.min(Z.text.length,t.ch+r*(Wt>=55296&&Wt<56320?2:1))),-r)}else o?Lt=Il(e.cm,Z,t,r):Lt=xo(Z,t,r);if(Lt==null)if(!Ut&&te())t=Co(o,e.cm,Z,t.line,q);else return!1;else t=Lt;return!0}if(n=="char"||n=="codepoint")be();else if(n=="column")be(!0);else if(n=="word"||n=="group")for(var Te=null,Ge=n=="group",je=e.cm&&e.cm.getHelper(t,"wordChars"),st=!0;!(r<0&&!be(!st));st=!1){var bt=Z.text.charAt(t.ch)||`
|
|
`,At=Ze(bt,je)?"w":Ge&&bt==`
|
|
`?"n":!Ge||/\s/.test(bt)?null:"p";if(Ge&&!st&&!At&&(At="s"),Te&&Te!=At){r<0&&(r=1,be(),t.sticky="after");break}if(At&&(Te=At),r>0&&!be(!st))break}var Dt=Wa(e,t,M,z,!0);return Ln(M,Dt)&&(Dt.hitSide=!0),Dt}function Gs(e,t,r,n){var o=e.doc,M=t.left,z;if(n=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Z-.5*Ot(e.display),3);z=(r>0?t.bottom:t.top)+r*q}else n=="line"&&(z=r>0?t.bottom+3:t.top-3);for(var te;!(te=$i(e,M,z),!te.outside);){if(r<0?z<=0:z>=o.height){te.hitSide=!0;break}z+=r*5}return te}var _n=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new se,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_n.prototype.init=function(e){var t=this,r=this,n=r.cm,o=r.div=e.lineDiv;Ks(o,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function M(Z){for(var q=Z.target;q;q=q.parentNode){if(q==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Se(o,"paste",function(Z){if(!M(Z)||qe(n,Z)||js(Z,n))return;B<=11&&setTimeout(er(n,function(){return t.updateFromDOM()}),20)}),Se(o,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Se(o,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Se(o,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(o,"touchstart",function(){return r.forceCompositionEnd()}),Se(o,"input",function(){t.composing||t.readFromDOMSoon()});function z(Z){if(!M(Z)||qe(n,Z))return;if(n.somethingSelected())Xa({lineWise:!1,text:n.getSelections()}),Z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var q=Hs(n);Xa({lineWise:!0,text:q.text}),Z.type=="cut"&&n.operation(function(){n.setSelections(q.ranges,0,Be),n.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var te=Xr.text.join(`
|
|
`);if(Z.clipboardData.setData("Text",te),Z.clipboardData.getData("Text")==te){Z.preventDefault();return}}var be=zs(),Te=be.firstChild;n.display.lineSpace.insertBefore(be,n.display.lineSpace.firstChild),Te.value=Xr.text.join(`
|
|
`);var Ge=document.activeElement;J(Te),setTimeout(function(){n.display.lineSpace.removeChild(be),Ge.focus(),Ge==o&&r.showPrimarySelection()},50)}Se(o,"copy",z),Se(o,"cut",z)},_n.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},_n.prototype.prepareSelection=function(){var e=Mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},_n.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},_n.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},_n.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){e.removeAllRanges();return}var M=Qa(t,e.anchorNode,e.anchorOffset),z=Qa(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&z&&!z.bad&&Gt(Xn(M,z),n)==0&&Gt(kn(M,z),o)==0)return;var Z=t.display.view,q=n.line>=t.display.viewFrom&&Vs(t,n)||{node:Z[0].measure.map[2],offset:0},te=o.line<t.display.viewTo&&Vs(t,o);if(!te){var be=Z[Z.length-1].measure,Te=be.maps?be.maps[be.maps.length-1]:be.map;te={node:Te[Te.length-1],offset:Te[Te.length-2]-Te[Te.length-3]}}if(!q||!te){e.removeAllRanges();return}var Ge=e.rangeCount&&e.getRangeAt(0),je;try{je=b(q.node,q.offset,te.offset,te.node)}catch(st){}je&&(!k&&t.state.focused?(e.collapse(q.node,q.offset),je.collapsed||(e.removeAllRanges(),e.addRange(je))):(e.removeAllRanges(),e.addRange(je)),Ge&&e.anchorNode==null?e.addRange(Ge):k&&this.startGracePeriod()),this.rememberSelection()},_n.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},_n.prototype.showMultipleSelections=function(e){a(this.cm.display.cursorDiv,e.cursors),a(this.cm.display.selectionDiv,e.selection)},_n.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},_n.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return m(this.div,t)},_n.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},_n.prototype.blur=function(){this.div.blur()},_n.prototype.getField=function(){return this.div},_n.prototype.supportsTouch=function(){return!0},_n.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Lr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},_n.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},_n.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(d&&E&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=Qa(t,e.anchorNode,e.anchorOffset),n=Qa(t,e.focusNode,e.focusOffset);r&&n&&Lr(t,function(){pr(t.doc,hi(r,n),Be),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},_n.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),o=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=ct(n.line-1,_t(e.doc,n.line-1).length)),o.ch==_t(e.doc,o.line).text.length&&o.line<e.lastLine()&&(o=ct(o.line+1,0)),n.line<t.viewFrom||o.line>t.viewTo-1)return!1;var M,z,Z;n.line==t.viewFrom||(M=Sn(e,n.line))==0?(z=Nt(t.view[0].line),Z=t.view[0].node):(z=Nt(t.view[M].line),Z=t.view[M-1].node.nextSibling);var q=Sn(e,o.line),te,be;if(q==t.view.length-1?(te=t.viewTo-1,be=t.lineDiv.lastChild):(te=Nt(t.view[q+1].line)-1,be=t.view[q+1].node.previousSibling),!Z)return!1;for(var Te=e.doc.splitLines(tu(e,Z,be,z,te)),Ge=cn(e.doc,ct(z,0),ct(te,_t(e.doc,te).text.length));Te.length>1&&Ge.length>1;)if(ne(Te)==ne(Ge))Te.pop(),Ge.pop(),te--;else if(Te[0]==Ge[0])Te.shift(),Ge.shift(),z++;else break;for(var je=0,st=0,bt=Te[0],At=Ge[0],Dt=Math.min(bt.length,At.length);je<Dt&&bt.charCodeAt(je)==At.charCodeAt(je);)++je;for(var Ut=ne(Te),Lt=ne(Ge),Wt=Math.min(Ut.length-(Te.length==1?je:0),Lt.length-(Ge.length==1?je:0));st<Wt&&Ut.charCodeAt(Ut.length-st-1)==Lt.charCodeAt(Lt.length-st-1);)++st;if(Te.length==1&&Ge.length==1&&z==n.line)for(;je&&je>n.ch&&Ut.charCodeAt(Ut.length-st-1)==Lt.charCodeAt(Lt.length-st-1);)je--,st++;Te[Te.length-1]=Ut.slice(0,Ut.length-st).replace(/^\u200b+/,""),Te[0]=Te[0].slice(je).replace(/\u200b+$/,"");var tn=ct(z,je),Zt=ct(te,Ge.length?ne(Ge).length-st:0);if(Te.length>1||Te[0]||Gt(tn,Zt))return Ni(e.doc,Te,tn,Zt,"+input"),!0},_n.prototype.ensurePolled=function(){this.forceCompositionEnd()},_n.prototype.reset=function(){this.forceCompositionEnd()},_n.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},_n.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},_n.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Lr(this.cm,function(){return ln(e.cm)})},_n.prototype.setUneditable=function(e){e.contentEditable="false"},_n.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ro)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},_n.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},_n.prototype.onContextMenu=function(){},_n.prototype.resetPosition=function(){},_n.prototype.needsContentAttribute=!0;function Vs(e,t){var r=ri(e,t.line);if(!r||r.hidden)return null;var n=_t(e.doc,t.line),o=Yi(r,n,t.line),M=Ct(n,e.doc.direction),z="left";if(M){var Z=Et(M,t.ch);z=Z%2?"right":"left"}var q=bi(o.map,t.ch,z);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Wi(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,o){var M="",z=!1,Z=e.doc.lineSeparator(),q=!1;function te(je){return function(st){return st.id==je}}function be(){z&&(M+=Z,q&&(M+=Z),z=q=!1)}function Te(je){je&&(be(),M+=je)}function Ge(je){if(je.nodeType==1){var st=je.getAttribute("cm-text");if(st){Te(st);return}var bt=je.getAttribute("cm-marker"),At;if(bt){var Dt=e.findMarks(ct(n,0),ct(o+1,0),te(+bt));Dt.length&&(At=Dt[0].find(0))&&Te(cn(e.doc,At.from,At.to).join(Z));return}if(je.getAttribute("contenteditable")=="false")return;var Ut=/^(pre|div|p|li|table|br)$/i.test(je.nodeName);if(!/^br$/i.test(je.nodeName)&&je.textContent.length==0)return;Ut&&be();for(var Lt=0;Lt<je.childNodes.length;Lt++)Ge(je.childNodes[Lt]);/^(pre|p)$/i.test(je.nodeName)&&(q=!0),Ut&&(z=!0)}else je.nodeType==3&&Te(je.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ge(t),t==r);)t=t.nextSibling,q=!1;return M}function Qa(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Wi(e.clipPos(ct(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var M=e.display.view[o];if(M.node==n)return nu(M,t,r)}}function nu(e,t,r){var n=e.text.firstChild,o=!1;if(!t||!m(n,t))return Wi(ct(Nt(e.line),0),!0);if(t==n&&(o=!0,t=n.childNodes[r],r=0,!t)){var M=e.rest?ne(e.rest):e.line;return Wi(ct(Nt(M),M.text.length),o)}var z=t.nodeType==3?t:null,Z=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,r&&(r=z.nodeValue.length));Z.parentNode!=n;)Z=Z.parentNode;var q=e.measure,te=q.maps;function be(At,Dt,Ut){for(var Lt=-1;Lt<(te?te.length:0);Lt++)for(var Wt=Lt<0?q.map:te[Lt],tn=0;tn<Wt.length;tn+=3){var Zt=Wt[tn+2];if(Zt==At||Zt==Dt){var dn=Nt(Lt<0?e.line:e.rest[Lt]),Dn=Wt[tn]+Ut;return(Ut<0||Zt!=At)&&(Dn=Wt[tn+(Ut?1:0)]),ct(dn,Dn)}}}var Te=be(z,Z,r);if(Te)return Wi(Te,o);for(var Ge=Z.nextSibling,je=z?z.nodeValue.length-r:0;Ge;Ge=Ge.nextSibling){if(Te=be(Ge,Ge.firstChild,0),Te)return Wi(ct(Te.line,Te.ch-je),o);je+=Ge.textContent.length}for(var st=Z.previousSibling,bt=r;st;st=st.previousSibling){if(Te=be(st,st.firstChild,-1),Te)return Wi(ct(Te.line,Te.ch+bt),o);bt+=st.textContent.length}}var Wn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new se,this.hasSelection=!1,this.composing=null};Wn.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),y&&(o.style.width="0px"),Se(o,"input",function(){U&&B>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Se(o,"paste",function(z){if(qe(n,z)||js(z,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function M(z){if(qe(n,z))return;if(n.somethingSelected())Xa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Z=Hs(n);Xa({lineWise:!0,text:Z.text}),z.type=="cut"?n.setSelections(Z.ranges,null,Be):(r.prevInput="",o.value=Z.text.join(`
|
|
`),J(o))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}Se(o,"cut",M),Se(o,"copy",M),Se(e.scroller,"paste",function(z){if($r(e,z)||qe(n,z))return;if(!o.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var Z=new Event("paste");Z.clipboardData=z.clipboardData,o.dispatchEvent(Z)}),Se(e.lineSpace,"selectstart",function(z){$r(e,z)||re(z)}),Se(o,"compositionstart",function(){var z=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Wn.prototype.createField=function(e){this.wrapper=zs(),this.textarea=this.wrapper.firstChild},Wn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Wn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mo(e);if(e.options.moveInputWithCursor){var o=Zn(e,r.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+z.top-M.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+z.left-M.left))}return n},Wn.prototype.showSelection=function(e){var t=this.cm,r=t.display;a(r.cursorDiv,e.cursors),a(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&J(this.textarea),U&&B>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",U&&B>=9&&(this.hasSelection=null))},Wn.prototype.getField=function(){return this.textarea},Wn.prototype.supportsTouch=function(){return!1},Wn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wn.prototype.blur=function(){this.textarea.blur()},Wn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wn.prototype.receivedFocus=function(){this.slowPoll()},Wn.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Wn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},Wn.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ze(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=r.value;if(o==n&&!t.somethingSelected())return!1;if(U&&B>=9&&this.hasSelection===o||u&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=o.charCodeAt(0);if(M==8203&&!n&&(n="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Z=Math.min(n.length,o.length);z<Z&&n.charCodeAt(z)==o.charCodeAt(z);)++z;return Lr(t,function(){Ro(t,o.slice(z),n.length-z,null,e.composing?"*compose":null),o.length>1e3||o.indexOf(`
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Wn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wn.prototype.onKeyPress=function(){U&&B>=9&&(this.hasSelection=null),this.fastPoll()},Wn.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=yn(r,e),z=n.scroller.scrollTop;if(!M||R)return;var Z=r.options.resetSelectionOnContextMenu;Z&&r.doc.sel.contains(M)==-1&&er(r,pr)(r.doc,hi(M),Be);var q=o.style.cssText,te=t.wrapper.style.cssText,be=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-be.top-5)+"px; left: "+(e.clientX-be.left-5)+`px;
|
|
z-index: 1000; background: `+(U?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Te;I&&(Te=window.scrollY),n.input.focus(),I&&window.scrollTo(null,Te),n.input.reset(),r.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=je,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Ge(){if(o.selectionStart!=null){var bt=r.somethingSelected(),At="\u200B"+(bt?o.value:"");o.value="\u21DA",o.value=At,t.prevInput=bt?"":"\u200B",o.selectionStart=1,o.selectionEnd=At.length,n.selForContextMenu=r.doc.sel}}function je(){if(t.contextMenuPending!=je)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,o.style.cssText=q,U&&B<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),o.selectionStart!=null){(!U||U&&B<9)&&Ge();var bt=0,At=function(){n.selForContextMenu==r.doc.sel&&o.selectionStart==0&&o.selectionEnd>0&&t.prevInput=="\u200B"?er(r,ds)(r):bt++<10?n.detectingSelectAll=setTimeout(At,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(At,200)}}if(U&&B>=9&&Ge(),w){ue(e);var st=function(){nt(window,"mouseup",st),setTimeout(je,20)};Se(window,"mouseup",st)}else setTimeout(je,50)},Wn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Wn.prototype.setUneditable=function(){},Wn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?j(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=L();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=Z.getValue()}var o;if(e.form&&(Se(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var M=e.form;o=M.submit;try{var z=M.submit=function(){n(),M.submit=o,M.submit(),M.submit=z}}catch(q){}}t.finishInit=function(q){q.save=n,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,n(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=o))}},e.style.display="none";var Z=Nn(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Z}function iu(e){e.off=nt,e.on=Se,e.wheelEventPixels=cl,e.Doc=Sr,e.splitLines=Qe,e.countColumn=$,e.findColumn=Ue,e.isWordChar=He,e.Pass=We,e.signal=Fe,e.Line=lr,e.changeEnd=fi,e.scrollbarModel=jo,e.Pos=ct,e.cmpPos=Gt,e.modes=Ye,e.mimeModes=Me,e.resolveMode=Pe,e.getMode=at,e.modeExtensions=vt,e.extendMode=St,e.copyState=Rt,e.startState=sn,e.innerMode=qt,e.commands=ga,e.keyMap=ii,e.keyName=ws,e.isModifierKey=As,e.lookupKey=Ui,e.normalizeKeyMap=kl,e.StringStream=Xt,e.SharedTextMarker=fa,e.TextMarker=mi,e.LineWidget=ha,e.e_preventDefault=re,e.e_stopPropagation=ie,e.e_stop=ue,e.addClass=C,e.contains=m,e.rmClass=c,e.keyNames=gi}Yl(Nn),$l(Nn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ya in Sr.prototype)Sr.prototype.hasOwnProperty(Ya)&&me(au,Ya)<0&&(Nn.prototype[Ya]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sr.prototype[Ya]));return ge(Sr),Nn.inputStyles={textarea:Wn,contenteditable:_n},Nn.defineMode=function(e){!Nn.defaults.mode&&e!="null"&&(Nn.defaults.mode=e),Xe.apply(this,arguments)},Nn.defineMIME=dt,Nn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nn.defineMIME("text/plain","null"),Nn.defineExtension=function(e,t){Nn.prototype[e]=t},Nn.defineDocExtension=function(e,t){Sr.prototype[e]=t},Nn.fromTextArea=ru,iu(Nn),Nn.version="5.58.2",Nn})},W6BS:function($e,ke){$e.exports="data:image/png;base64,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"},WaYH:function($e,ke,F){"use strict";var ee=F("rePB"),X=F("Ff2n"),k=F("VTBJ"),Q=F("1OyB"),N=F("vuIU"),O=F("JX7q"),U=F("Ji7U"),B=F("LK+K"),I=F("q1tI"),D=F("TSYQ"),E=F.n(D),R=F("sboe"),P=F("OZM5"),_=function(w){var v=w.prefixCls,c=w.level,l=w.isStart,a=w.isEnd;if(!c)return null;for(var i="".concat(v,"-indent-unit"),x=[],b=0;b<c;b+=1){var m;x.push(I.createElement("span",{key:b,className:E()(i,(m={},Object(ee.a)(m,"".concat(i,"-start"),l[b+1]),Object(ee.a)(m,"".concat(i,"-end"),a[b+1]),Object(ee.a)(m,"".concat(i,"-end-first-level"),!b&&a[0]),m))}))}return I.createElement("span",{"aria-hidden":"true",className:"".concat(v,"-indent")},x)},S=_,y=F("815F"),d="open",s="close",u="---",h=function(f){Object(U.a)(v,f);var w=Object(B.a)(v);function v(){var c;return Object(Q.a)(this,v),c=w.apply(this,arguments),c.state={dragNodeHighlight:!1},c.onSelectorClick=function(l){var a=c.props.context.onNodeClick;a(l,Object(y.b)(c.props)),c.isSelectable()?c.onSelect(l):c.onCheck(l)},c.onSelectorDoubleClick=function(l){var a=c.props.context.onNodeDoubleClick;a(l,Object(y.b)(c.props))},c.onSelect=function(l){if(c.isDisabled())return;var a=c.props.context.onNodeSelect;l.preventDefault(),a(l,Object(y.b)(c.props))},c.onCheck=function(l){if(c.isDisabled())return;var a=c.props,i=a.disableCheckbox,x=a.checked,b=c.props.context.onNodeCheck;if(!c.isCheckable()||i)return;l.preventDefault();var m=!x;b(l,Object(y.b)(c.props),m)},c.onMouseEnter=function(l){var a=c.props.context.onNodeMouseEnter;a(l,Object(y.b)(c.props))},c.onMouseLeave=function(l){var a=c.props.context.onNodeMouseLeave;a(l,Object(y.b)(c.props))},c.onContextMenu=function(l){var a=c.props.context.onNodeContextMenu;a(l,Object(y.b)(c.props))},c.onDragStart=function(l){var a=c.props.context.onNodeDragStart;l.stopPropagation(),c.setState({dragNodeHighlight:!0}),a(l,Object(O.a)(c));try{l.dataTransfer.setData("text/plain","")}catch(i){}},c.onDragEnter=function(l){var a=c.props.context.onNodeDragEnter;l.preventDefault(),l.stopPropagation(),a(l,Object(O.a)(c))},c.onDragOver=function(l){var a=c.props.context.onNodeDragOver;l.preventDefault(),l.stopPropagation(),a(l,Object(O.a)(c))},c.onDragLeave=function(l){var a=c.props.context.onNodeDragLeave;l.stopPropagation(),a(l,Object(O.a)(c))},c.onDragEnd=function(l){var a=c.props.context.onNodeDragEnd;l.stopPropagation(),c.setState({dragNodeHighlight:!1}),a(l,Object(O.a)(c))},c.onDrop=function(l){var a=c.props.context.onNodeDrop;l.preventDefault(),l.stopPropagation(),c.setState({dragNodeHighlight:!1}),a(l,Object(O.a)(c))},c.onExpand=function(l){var a=c.props.context.onNodeExpand;a(l,Object(y.b)(c.props))},c.setSelectHandle=function(l){c.selectHandle=l},c.getNodeState=function(){var l=c.props.expanded;return c.isLeaf()?null:l?d:s},c.hasChildren=function(){var l=c.props.eventKey,a=c.props.context.keyEntities,i=a[l]||{},x=i.children;return!!(x||[]).length},c.isLeaf=function(){var l=c.props,a=l.isLeaf,i=l.loaded,x=c.props.context.loadData,b=c.hasChildren();return a===!1?!1:a||!x&&!b||x&&i&&!b},c.isDisabled=function(){var l=c.props.disabled,a=c.props.context.disabled;return!!(a||l)},c.isCheckable=function(){var l=c.props.checkable,a=c.props.context.checkable;return!a||l===!1?!1:a},c.syncLoadData=function(l){var a=l.expanded,i=l.loading,x=l.loaded,b=c.props.context,m=b.loadData,L=b.onNodeLoad;if(i)return;m&&a&&!c.isLeaf()&&(!c.hasChildren()&&!x&&L(Object(y.b)(c.props)))},c.renderSwitcher=function(){var l=c.props,a=l.expanded,i=l.switcherIcon,x=c.props.context,b=x.prefixCls,m=x.switcherIcon,L=i||m;if(c.isLeaf())return I.createElement("span",{className:E()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof L=="function"?L(Object(k.a)(Object(k.a)({},c.props),{},{isLeaf:!0})):L);var C=E()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(a?d:s));return I.createElement("span",{onClick:c.onExpand,className:C},typeof L=="function"?L(Object(k.a)(Object(k.a)({},c.props),{},{isLeaf:!1})):L)},c.renderCheckbox=function(){var l=c.props,a=l.checked,i=l.halfChecked,x=l.disableCheckbox,b=c.props.context.prefixCls,m=c.isDisabled(),L=c.isCheckable();if(!L)return null;var C=typeof L!="boolean"?L:null;return I.createElement("span",{className:E()("".concat(b,"-checkbox"),a&&"".concat(b,"-checkbox-checked"),!a&&i&&"".concat(b,"-checkbox-indeterminate"),(m||x)&&"".concat(b,"-checkbox-disabled")),onClick:c.onCheck},C)},c.renderIcon=function(){var l=c.props.loading,a=c.props.context.prefixCls;return I.createElement("span",{className:E()("".concat(a,"-iconEle"),"".concat(a,"-icon__").concat(c.getNodeState()||"docu"),l&&"".concat(a,"-icon_loading"))})},c.renderSelector=function(){var l=c.state.dragNodeHighlight,a=c.props,i=a.title,x=a.selected,b=a.icon,m=a.loading,L=a.data,C=c.props.context,H=C.prefixCls,J=C.showIcon,W=C.icon,j=C.draggable,$=C.loadData,se=C.titleRender,me=c.isDisabled(),Ee="".concat(H,"-node-content-wrapper"),We;if(J){var Be=b||W;We=Be?I.createElement("span",{className:E()("".concat(H,"-iconEle"),"".concat(H,"-icon__customize"))},typeof Be=="function"?Be(c.props):Be):c.renderIcon()}else $&&m&&(We=c.renderIcon());var Ne;typeof i=="function"?Ne=i(L):se?Ne=se(L):Ne=i;var Le=I.createElement("span",{className:"".concat(H,"-title")},Ne);return I.createElement("span",{ref:c.setSelectHandle,title:typeof i=="string"?i:"",className:E()("".concat(Ee),"".concat(Ee,"-").concat(c.getNodeState()||"normal"),!me&&(x||l)&&"".concat(H,"-node-selected"),!me&&j&&"draggable"),draggable:!me&&j||void 0,"aria-grabbed":!me&&j||void 0,onMouseEnter:c.onMouseEnter,onMouseLeave:c.onMouseLeave,onContextMenu:c.onContextMenu,onClick:c.onSelectorClick,onDoubleClick:c.onSelectorDoubleClick,onDragStart:j?c.onDragStart:void 0},We,Le)},c}return Object(N.a)(v,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var l=this.props.selectable,a=this.props.context.selectable;return typeof l=="boolean"?l:a}},{key:"render",value:function(){var l,a=this.props,i=a.eventKey,x=a.className,b=a.style,m=a.dragOver,L=a.dragOverGapTop,C=a.dragOverGapBottom,H=a.isLeaf,J=a.isStart,W=a.isEnd,j=a.expanded,$=a.selected,se=a.checked,me=a.halfChecked,Ee=a.loading,We=a.domRef,Be=a.active,Ne=a.onMouseMove,Le=Object(X.a)(a,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ue=this.props.context,ye=Ue.prefixCls,ce=Ue.filterTreeNode,ne=Ue.draggable,ve=Ue.keyEntities,le=this.isDisabled(),Re=Object(P.f)(Le),Ie=ve[i]||{},Ce=Ie.level,He=W[W.length-1];return I.createElement("div",Object.assign({ref:We,className:E()(x,"".concat(ye,"-treenode"),(l={},Object(ee.a)(l,"".concat(ye,"-treenode-disabled"),le),Object(ee.a)(l,"".concat(ye,"-treenode-switcher-").concat(j?"open":"close"),!H),Object(ee.a)(l,"".concat(ye,"-treenode-checkbox-checked"),se),Object(ee.a)(l,"".concat(ye,"-treenode-checkbox-indeterminate"),me),Object(ee.a)(l,"".concat(ye,"-treenode-selected"),$),Object(ee.a)(l,"".concat(ye,"-treenode-loading"),Ee),Object(ee.a)(l,"".concat(ye,"-treenode-active"),Be),Object(ee.a)(l,"".concat(ye,"-treenode-leaf-last"),He),Object(ee.a)(l,"drag-over",!le&&m),Object(ee.a)(l,"drag-over-gap-top",!le&&L),Object(ee.a)(l,"drag-over-gap-bottom",!le&&C),Object(ee.a)(l,"filter-node",ce&&ce(Object(y.b)(this.props))),l)),style:b,onDragEnter:ne?this.onDragEnter:void 0,onDragOver:ne?this.onDragOver:void 0,onDragLeave:ne?this.onDragLeave:void 0,onDrop:ne?this.onDrop:void 0,onDragEnd:ne?this.onDragEnd:void 0,onMouseMove:Ne},Re),I.createElement(S,{prefixCls:ye,level:Ce,isStart:J,isEnd:W}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),v}(I.Component),T=function(w){return I.createElement(R.a.Consumer,null,function(v){return I.createElement(h,Object.assign({},w,{context:v}))})};T.displayName="TreeNode",T.defaultProps={title:u},T.isTreeNode=1;var g=ke.a=T},Xsq0:function($e,ke,F){$e.exports=F.p+"static/mainbanner.0a951716.jpg"},Y1PL:function($e,ke,F){"use strict";F.r(ke),F.d(ke,"ResizableTextArea",function(){return me});var ee=F("wx14"),X=F("1OyB"),k=F("vuIU"),Q=F("Ji7U"),N=F("LK+K"),O=F("q1tI"),U=F("VTBJ"),B=F("rePB"),I=F("Zm9Q"),D=F("Kwbf"),E=F("c+Xe"),R=F("m+aA"),P=F("bdgK"),_=new Map;function S(Be){Be.forEach(function(Ne){var Le,Ue=Ne.target;(Le=_.get(Ue))===null||Le===void 0||Le.forEach(function(ye){return ye(Ue)})})}var y=new P.default(S),d=null,s=null;function u(Be,Ne){_.has(Be)||(_.set(Be,new Set),y.observe(Be)),_.get(Be).add(Ne)}function h(Be,Ne){_.has(Be)&&(_.get(Be).delete(Ne),_.get(Be).size||(y.unobserve(Be),_.delete(Be)))}var T=function(Be){Object(Q.a)(Le,Be);var Ne=Object(N.a)(Le);function Le(){return Object(X.a)(this,Le),Ne.apply(this,arguments)}return Object(k.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(O.Component),g=O.createContext(null);function f(Be){var Ne=Be.children,Le=Be.onBatchResize,Ue=O.useRef(0),ye=O.useRef([]),ce=O.useContext(g),ne=O.useCallback(function(ve,le,Re){Ue.current+=1;var Ie=Ue.current;ye.current.push({size:ve,element:le,data:Re}),Promise.resolve().then(function(){Ie===Ue.current&&(Le==null||Le(ye.current),ye.current=[])}),ce==null||ce(ve,le,Re)},[Le,ce]);return O.createElement(g.Provider,{value:ne},Ne)}function w(Be){var Ne=Be.children,Le=Be.disabled,Ue=O.useRef(null),ye=O.useRef(null),ce=O.useContext(g),ne=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ve=O.isValidElement(Ne)&&Object(E.c)(Ne),le=ve?Ne.ref:null,Re=O.useMemo(function(){return Object(E.a)(le,Ue)},[le,Ue]),Ie=O.useRef(Be);Ie.current=Be;var Ce=O.useCallback(function(He){var Ze=Ie.current,ot=Ze.onResize,et=Ze.data,Ke=He.getBoundingClientRect(),Ve=Ke.width,ht=Ke.height,mt=He.offsetWidth,gt=He.offsetHeight,Et=Math.floor(Ve),ft=Math.floor(ht);if(ne.current.width!==Et||ne.current.height!==ft||ne.current.offsetWidth!==mt||ne.current.offsetHeight!==gt){var Ct={width:Et,height:ft,offsetWidth:mt,offsetHeight:gt};ne.current=Ct;var _e=mt===Math.round(Ve)?Ve:mt,Se=gt===Math.round(ht)?ht:gt,Je=Object(U.a)(Object(U.a)({},Ct),{},{offsetWidth:_e,offsetHeight:Se});ce==null||ce(Je,He,et),ot&&Promise.resolve().then(function(){ot(Je,He)})}},[]);return O.useEffect(function(){var He=Object(R.a)(Ue.current)||Object(R.a)(ye.current);return He&&!Le&&u(He,Ce),function(){return h(He,Ce)}},[Ue.current,Le]),O.createElement(T,{ref:ye},ve?O.cloneElement(Ne,{ref:Re}):Ne)}var v="rc-observer-key";function c(Be){var Ne=Be.children,Le=Object(I.a)(Ne);return Le.map(function(Ue,ye){var ce=(Ue==null?void 0:Ue.key)||"".concat(v,"-").concat(ye);return O.createElement(w,Object(ee.a)({},Be,{key:ce}),Ue)})}c.Collection=f;var l=c,a=F("bT9E"),i=F("TSYQ"),x=F.n(i),b=`
|
|
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
|
|
`,m=["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"],L={},C;function H(Be){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=Be.getAttribute("id")||Be.getAttribute("data-reactid")||Be.getAttribute("name");if(Ne&&L[Le])return L[Le];var Ue=window.getComputedStyle(Be),ye=Ue.getPropertyValue("box-sizing")||Ue.getPropertyValue("-moz-box-sizing")||Ue.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(Ue.getPropertyValue("padding-bottom"))+parseFloat(Ue.getPropertyValue("padding-top")),ne=parseFloat(Ue.getPropertyValue("border-bottom-width"))+parseFloat(Ue.getPropertyValue("border-top-width")),ve=m.map(function(Re){return"".concat(Re,":").concat(Ue.getPropertyValue(Re))}).join(";"),le={sizingStyle:ve,paddingSize:ce,borderSize:ne,boxSizing:ye};return Ne&&Le&&(L[Le]=le),le}function J(Be){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;C||(C=document.createElement("textarea"),C.setAttribute("tab-index","-1"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C)),Be.getAttribute("wrap")?C.setAttribute("wrap",Be.getAttribute("wrap")):C.removeAttribute("wrap");var ye=H(Be,Ne),ce=ye.paddingSize,ne=ye.borderSize,ve=ye.boxSizing,le=ye.sizingStyle;C.setAttribute("style","".concat(le,";").concat(b)),C.value=Be.value||Be.placeholder||"";var Re=Number.MIN_SAFE_INTEGER,Ie=Number.MAX_SAFE_INTEGER,Ce=C.scrollHeight,He;if(ve==="border-box"?Ce+=ne:ve==="content-box"&&(Ce-=ce),Le!==null||Ue!==null){C.value=" ";var Ze=C.scrollHeight-ce;Le!==null&&(Re=Ze*Le,ve==="border-box"&&(Re=Re+ce+ne),Ce=Math.max(Re,Ce)),Ue!==null&&(Ie=Ze*Ue,ve==="border-box"&&(Ie=Ie+ce+ne),He=Ce>Ie?"":"hidden",Ce=Math.min(Ie,Ce))}return{height:Ce,minHeight:Re,maxHeight:Ie,overflowY:He,resize:"none"}}var W=F("Gytx"),j=F.n(W),$;(function(Be){Be[Be.NONE=0]="NONE",Be[Be.RESIZING=1]="RESIZING",Be[Be.RESIZED=2]="RESIZED"})($||($={}));var se=function(Be){Object(Q.a)(Le,Be);var Ne=Object(N.a)(Le);function Le(Ue){var ye;return Object(X.a)(this,Le),ye=Ne.call(this,Ue),ye.nextFrameActionId=void 0,ye.resizeFrameId=void 0,ye.textArea=void 0,ye.saveTextArea=function(ce){ye.textArea=ce},ye.handleResize=function(ce){var ne=ye.state.resizeStatus,ve=ye.props,le=ve.autoSize,Re=ve.onResize;if(ne!==$.NONE)return;typeof Re=="function"&&Re(ce),le&&ye.resizeOnNextFrame()},ye.resizeOnNextFrame=function(){cancelAnimationFrame(ye.nextFrameActionId),ye.nextFrameActionId=requestAnimationFrame(ye.resizeTextarea)},ye.resizeTextarea=function(){var ce=ye.props.autoSize;if(!ce||!ye.textArea)return;var ne=ce.minRows,ve=ce.maxRows,le=J(ye.textArea,!1,ne,ve);ye.setState({textareaStyles:le,resizeStatus:$.RESIZING},function(){cancelAnimationFrame(ye.resizeFrameId),ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:$.RESIZED},function(){ye.resizeFrameId=requestAnimationFrame(function(){ye.setState({resizeStatus:$.NONE}),ye.fixFirefoxAutoScroll()})})})})},ye.renderTextArea=function(){var ce=ye.props,ne=ce.prefixCls,ve=ne===void 0?"rc-textarea":ne,le=ce.autoSize,Re=ce.onResize,Ie=ce.className,Ce=ce.disabled,He=ye.state,Ze=He.textareaStyles,ot=He.resizeStatus,et=Object(a.a)(ye.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ke=x()(ve,Ie,Object(B.a)({},"".concat(ve,"-disabled"),Ce));"value"in et&&(et.value=et.value||"");var Ve=Object(U.a)(Object(U.a)(Object(U.a)({},ye.props.style),Ze),ot===$.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(l,{onResize:ye.handleResize,disabled:!(le||Re)},O.createElement("textarea",Object(ee.a)({},et,{className:Ke,style:Ve,ref:ye.saveTextArea})))},ye.state={textareaStyles:{},resizeStatus:$.NONE},ye}return Object(k.a)(Le,[{key:"componentDidUpdate",value:function(ye){(ye.value!==this.props.value||!j()(ye.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 ye=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(ye,ce)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(O.Component),me=se,Ee=function(Be){Object(Q.a)(Le,Be);var Ne=Object(N.a)(Le);function Le(Ue){var ye;Object(X.a)(this,Le),ye=Ne.call(this,Ue),ye.resizableTextArea=void 0,ye.focus=function(){ye.resizableTextArea.textArea.focus()},ye.saveTextArea=function(ne){ye.resizableTextArea=ne},ye.handleChange=function(ne){var ve=ye.props.onChange;ye.setValue(ne.target.value,function(){ye.resizableTextArea.resizeTextarea()}),ve&&ve(ne)},ye.handleKeyDown=function(ne){var ve=ye.props,le=ve.onPressEnter,Re=ve.onKeyDown;ne.keyCode===13&&le&&le(ne),Re&&Re(ne)};var ce=typeof Ue.value=="undefined"||Ue.value===null?Ue.defaultValue:Ue.value;return ye.state={value:ce},ye}return Object(k.a)(Le,[{key:"setValue",value:function(ye,ce){"value"in this.props||this.setState({value:ye},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(me,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ye){return"value"in ye?{value:ye.value}:null}}]),Le}(O.Component),We=ke.default=Ee},ZW9T:function($e,ke,F){"use strict";F.d(ke,"a",function(){return T});var ee=F("k1fw"),X=F("miYZ"),k=F("tsqr"),Q=F("rAM+"),N=F("tJVT"),O=F("PpiC"),U=F("q1tI"),B=F.n(U),I=F("bdgK");function D(g,f,w,v,c){var l=f.getWordUntilPosition(w),a={startLineNumber:w.lineNumber,endLineNumber:w.lineNumber,startColumn:l.startColumn,endColumn:l.endColumn},i=v.map(function(x){return{label:x,kind:g.languages.CompletionItemKind.Keyword,insertText:x,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a}});return c.map(function(x){i.push(Object(ee.a)(Object(ee.a)({},x),{},{range:a}))}),i}var E=function(g){var f={label:"ifelse",kind:g.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet},w=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(a,i){var x=D(g,a,i,w,[f]);return{suggestions:x}}});var v=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(a,i){var x=[{label:"print",kind:g.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}],b=D(g,a,i,v,x);return{suggestions:b}}});var c=["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","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(a,i){var x=[f,{label:"main",kind:g.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:g.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}],b=D(g,a,i,c,x);return{suggestions:b}}})},R="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",P=F("LvDl");function _(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function S(){}var y=!1,d={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function s(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=g;if(Array.isArray(g)){for(var w=0;w<g.length;w++){var v=d[g[w]];if(v)return v}return f[0]}return d[f]||f}var u=null,h=ke.b=function(g){var f=g.width,w=f===void 0?"100%":f,v=g.height,c=v===void 0?"100%":v,l=g.value,a=g.language,i=a===void 0?"javascript":a,x=g.style,b=x===void 0?{}:x,m=g.options,L=m===void 0?{}:m,C=g.overrideServices,H=C===void 0?{}:C,J=g.theme,W=J===void 0?"vs-dark":J,j=g.onEditBlur,$=g.onSave,se=g.autoHeight,me=se===void 0?!1:se,Ee=g.forbidCopy,We=Ee===void 0?!1:Ee,Be=g.onChange,Ne=Be===void 0?S:Be,Le=g.editorDidMount,Ue=Le===void 0?S:Le,ye=g.onFocus,ce=ye===void 0?S:ye,ne=g.filename,ve=ne===void 0?"educoder.txt":ne,le=Object(O.a)(g,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Re=Object(U.useRef)(),Ie=Object(U.useRef)({}),Ce=Object(U.useRef)(),He=Object(U.useRef)(!1),Ze=Object(U.useRef)(),ot=Object(U.useState)(!1),et=Object(N.a)(ot,2),Ke=et[0],Ve=et[1];function ht(){var oe;return Re.current&&(oe=new I.default(function(ue){var Oe=Object(Q.a)(ue),we;try{for(Oe.s();!(we=Oe.n()).done;){var rt=we.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&Ie.current.instance.layout()}}catch(yt){Oe.e(yt)}finally{Oe.f()}}),oe.observe(Re.current)),oe}function mt(){k.b.warn(decodeURIComponent(R))}var gt=function(){var ue=Ie.current.instance;if(l!=null&&ue&&Ke){var Oe=ue.getModel();Oe&&l!==Oe.getValue()&&(y=!0,Oe.setValue(l),ue.layout(),y=!1)}};Object(U.useEffect)(function(){Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(function(){gt()},500)},[l,Ke,Ie.current]);function Et(){var oe=Ie.current.instance;if(oe){var ue=oe.getSelection(),Oe=Ie.current.pastePos||{},we=new u.Range(Oe.startLineNumber||ue.endLineNumber,Oe.startColumn||ue.endColumn,Oe.endLineNumber||ue.endLineNumber,Oe.endColumn||ue.endColumn);setTimeout(function(){oe.executeEdits("",[{range:we,text:""}])},300)}}function ft(oe){(window.navigator.platform.match("Mac")?oe.metaKey:oe.ctrlKey)&&oe.keyCode==83&&(oe.preventDefault(),$())}var Ct=function(){if(me&&Ie.current.instance){var ue=Ie.current.instance.getContentHeight();re(ue<c?c:ue)}else re(c)};function _e(oe){var ue=document.createEvent("MouseEvents");ue.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),oe.dispatchEvent(ue)}function Se(oe,ue){var Oe=window.URL||window.webkitURL||window,we=new Blob([ue]),rt=document.createElementNS("http://www.w3.org/1999/xhtml","a");rt.href=Oe.createObjectURL(we),rt.download=oe,_e(rt)}Object(U.useEffect)(function(){Ct()},[Ct]),Object(U.useEffect)(function(){Re.current&&!Ke&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(oe){try{u=oe,Ie.current.instance=u.editor.create(Re.current,{value:l,language:s(i),theme:W,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},H);var ue=Ie.current.instance;if(Ue(ue,u),setTimeout(function(){Ct(),Ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Se(ve||"educoder.txt",ue.getValue())}})},500),Ie.current.subscription=ue.onDidChangeModelContent(function(we){He.current?clearTimeout(Ze.current):(Ct(),Ne(ue.getValue(),we)),Ze.current=setTimeout(function(){He.current=!1},500)}),window.Monaco||E(u),We&&(ue.addCommand(u.KeyMod.CtrlCmd|u.KeyMod.Shift|u.KeyCode.KEY_V,function(){return mt(),null}),ue.addCommand(u.KeyMod.CtrlCmd|u.KeyCode.KEY_C,function(){return mt(),null})),window.Monaco=u,j&&ue.onDidBlurEditorWidget(function(){j(ue.getValue())}),ce&&ue.onDidFocusEditorText(function(){ce(ue.getValue())}),We){ue.addCommand(u.KeyMod.CtrlCmd|u.KeyCode.KEY_V,function(){return mt(),null}),ue.onDidPaste(function(we){Ie.current.pastePos=we});try{window.addEventListener("paste",Et)}catch(we){}}var Oe=ht();return Ve(!0),function(){var we=Ie.current.instance;we.dispose();var rt=we.getModel();rt&&rt.dispose(),Ie.current.subscription&&Ie.current.subscription.dispose(),We&&window.removeEventListener("paste",Et),Oe.unobserve(Re.current)}}catch(we){}})},[]),Object(U.useEffect)(function(){var oe=Ie.current.instance;if(oe&&Ke)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[$,Ke]),Object(U.useEffect)(function(){var oe=Ie.current.instance;if(oe&&Ke){var ue=s(i);u.editor.setModelLanguage(oe.getModel(),ue),console.log("language:",i,oe.getModel(),ue)}},[i,Ke]),Object(U.useEffect)(function(){var oe=Ie.current.instance;oe&&Ke&&u.editor.setTheme(W)},[W,Ke]),Object(U.useEffect)(function(){var oe=Ie.current.instance;oe&&Ke&&(oe.updateOptions(Object(ee.a)({},L)),setTimeout(function(){oe.getModel().updateOptions(Object(ee.a)({},L))},200))},[JSON.stringify(L),Ke]),Object(U.useEffect)(function(){var oe=Ie.current.instance;oe&&Ke&&oe.layout()},[w,c,Ke]);var Je=Object(U.useState)(_(w)),nt=Object(N.a)(Je,2),Fe=nt[0],qe=nt[1],xe=Object(U.useState)(_(c)),he=Object(N.a)(xe,2),ge=he[0],re=he[1],ie=Object(ee.a)(Object(ee.a)({},b),{},{width:Fe,height:ge});return B.a.createElement("div",{className:"my-monaco-editor",ref:Re,style:ie})};function T(g){var f=g.width,w=f===void 0?"100%":f,v=g.height,c=v===void 0?"100%":v,l=g.original,a=g.modified,i=g.language,x=g.options,b=x===void 0?{}:x,m=Object(U.useRef)(),L=Object(U.useState)(null),C=Object(N.a)(L,2),H=C[0],J=C[1];function W(me){var Ee;return m.current&&(Ee=new I.default(function(We){var Be=Object(Q.a)(We),Ne;try{for(Be.s();!(Ne=Be.n()).done;){var Le=Ne.value;(Le.target.offsetHeight>0||Le.target.offsetWidth>0)&&me.layout()}}catch(Ue){Be.e(Ue)}finally{Be.f()}}),Ee.observe(m.current)),Ee}Object(U.useEffect)(function(){m.current&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(me){u=me;var Ee=u.editor.createDiffEditor(m.current,Object(ee.a)(Object(ee.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},b),{},{wordWrap:!0}));J(Ee);var We=W(Ee);return function(){Ee.dispose();var Be=Ee.getModel();Be&&Be.dispose(),We.unobserve(m.current)}})},[]),Object(U.useEffect)(function(){H&&H.setModel({original:u.editor.createModel(l,i),modified:u.editor.createModel(a,i)})},[l,a,i,H]);var j=_(w),$=_(c),se={width:j,height:$};return B.a.createElement("div",{className:"my-diff-editor",ref:m,style:se})}},ZpRC:function($e,ke,F){"use strict";function ee(E){return typeof E=="object"&&E!=null&&E.nodeType===1}function X(E,R){return(!R||E!=="hidden")&&E!=="visible"&&E!=="clip"}function k(E,R){if(E.clientHeight<E.scrollHeight||E.clientWidth<E.scrollWidth){var P=getComputedStyle(E,null);return X(P.overflowY,R)||X(P.overflowX,R)||function(_){var S=function(y){if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(d){return null}}(_);return!!S&&(S.clientHeight<_.scrollHeight||S.clientWidth<_.scrollWidth)}(E)}return!1}function Q(E,R,P,_,S,y,d,s){return y<E&&d>R||y>E&&d<R?0:y<=E&&s<=P||d>=R&&s>=P?y-E-_:d>R&&s<P||y<E&&s>P?d-R+S:0}var N=function(E,R){var P=window,_=R.scrollMode,S=R.block,y=R.inline,d=R.boundary,s=R.skipOverflowHiddenElements,u=typeof d=="function"?d:function(Ze){return Ze!==d};if(!ee(E))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,T=[],g=E;ee(g)&&u(g);){if((g=g.parentElement)===h){T.push(g);break}g!=null&&g===document.body&&k(g)&&!k(document.documentElement)||g!=null&&k(g,s)&&T.push(g)}for(var f=P.visualViewport?P.visualViewport.width:innerWidth,w=P.visualViewport?P.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,c=window.scrollY||pageYOffset,l=E.getBoundingClientRect(),a=l.height,i=l.width,x=l.top,b=l.right,m=l.bottom,L=l.left,C=S==="start"||S==="nearest"?x:S==="end"?m:x+a/2,H=y==="center"?L+i/2:y==="end"?b:L,J=[],W=0;W<T.length;W++){var j=T[W],$=j.getBoundingClientRect(),se=$.height,me=$.width,Ee=$.top,We=$.right,Be=$.bottom,Ne=$.left;if(_==="if-needed"&&x>=0&&L>=0&&m<=w&&b<=f&&x>=Ee&&m<=Be&&L>=Ne&&b<=We)return J;var Le=getComputedStyle(j),Ue=parseInt(Le.borderLeftWidth,10),ye=parseInt(Le.borderTopWidth,10),ce=parseInt(Le.borderRightWidth,10),ne=parseInt(Le.borderBottomWidth,10),ve=0,le=0,Re="offsetWidth"in j?j.offsetWidth-j.clientWidth-Ue-ce:0,Ie="offsetHeight"in j?j.offsetHeight-j.clientHeight-ye-ne:0;if(h===j)ve=S==="start"?C:S==="end"?C-w:S==="nearest"?Q(c,c+w,w,ye,ne,c+C,c+C+a,a):C-w/2,le=y==="start"?H:y==="center"?H-f/2:y==="end"?H-f:Q(v,v+f,f,Ue,ce,v+H,v+H+i,i),ve=Math.max(0,ve+c),le=Math.max(0,le+v);else{ve=S==="start"?C-Ee-ye:S==="end"?C-Be+ne+Ie:S==="nearest"?Q(Ee,Be,se,ye,ne+Ie,C,C+a,a):C-(Ee+se/2)+Ie/2,le=y==="start"?H-Ne-Ue:y==="center"?H-(Ne+me/2)+Re/2:y==="end"?H-We+ce+Re:Q(Ne,We,me,Ue,ce+Re,H,H+i,i);var Ce=j.scrollLeft,He=j.scrollTop;C+=He-(ve=Math.max(0,Math.min(He+ve,j.scrollHeight-se+Ie))),H+=Ce-(le=Math.max(0,Math.min(Ce+le,j.scrollWidth-me+Re)))}J.push({el:j,top:ve,left:le})}return J};function O(E){return E===Object(E)&&Object.keys(E).length!==0}function U(E,R){R===void 0&&(R="auto");var P="scrollBehavior"in document.body.style;E.forEach(function(_){var S=_.el,y=_.top,d=_.left;S.scroll&&P?S.scroll({top:y,left:d,behavior:R}):(S.scrollTop=y,S.scrollLeft=d)})}function B(E){return E===!1?{block:"end",inline:"nearest"}:O(E)?E:{block:"start",inline:"nearest"}}function I(E,R){var P=!E.ownerDocument.documentElement.contains(E);if(O(R)&&typeof R.behavior=="function")return R.behavior(P?[]:N(E,R));if(P)return;var _=B(R);return U(N(E,_),_.behavior)}var D=ke.a=I},Zss7:function($e,ke,F){var ee;(function(X){var k=/^\s+/,Q=/\s+$/,N=0,O=X.round,U=X.min,B=X.max,I=X.random;function D(ne,ve){if(ne=ne||"",ve=ve||{},ne instanceof D)return ne;if(!(this instanceof D))return new D(ne,ve);var le=E(ne);this._originalInput=ne,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=O(100*this._a)/100,this._format=ve.format||le.format,this._gradientType=ve.gradientType,this._r<1&&(this._r=O(this._r)),this._g<1&&(this._g=O(this._g)),this._b<1&&(this._b=O(this._b)),this._ok=le.ok,this._tc_id=N++}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),ve,le,Re,Ie,Ce,He;return ve=ne.r/255,le=ne.g/255,Re=ne.b/255,ve<=.03928?Ie=ve/12.92:Ie=X.pow((ve+.055)/1.055,2.4),le<=.03928?Ce=le/12.92:Ce=X.pow((le+.055)/1.055,2.4),Re<=.03928?He=Re/12.92:He=X.pow((Re+.055)/1.055,2.4),.2126*Ie+.7152*Ce+.0722*He},setAlpha:function(ne){return this._a=J(ne),this._roundA=O(100*this._a)/100,this},toHsv:function(){var ne=S(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=S(this._r,this._g,this._b),ve=O(ne.h*360),le=O(ne.s*100),Re=O(ne.v*100);return this._a==1?"hsv("+ve+", "+le+"%, "+Re+"%)":"hsva("+ve+", "+le+"%, "+Re+"%, "+this._roundA+")"},toHsl:function(){var ne=P(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=P(this._r,this._g,this._b),ve=O(ne.h*360),le=O(ne.s*100),Re=O(ne.l*100);return this._a==1?"hsl("+ve+", "+le+"%, "+Re+"%)":"hsla("+ve+", "+le+"%, "+Re+"%, "+this._roundA+")"},toHex:function(ne){return d(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return s(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:O(this._r),g:O(this._g),b:O(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+O(this._r)+", "+O(this._g)+", "+O(this._b)+")":"rgba("+O(this._r)+", "+O(this._g)+", "+O(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:O(W(this._r,255)*100)+"%",g:O(W(this._g,255)*100)+"%",b:O(W(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+O(W(this._r,255)*100)+"%, "+O(W(this._g,255)*100)+"%, "+O(W(this._b,255)*100)+"%)":"rgba("+O(W(this._r,255)*100)+"%, "+O(W(this._g,255)*100)+"%, "+O(W(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:C[d(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var ve="#"+u(this._r,this._g,this._b,this._a),le=ve,Re=this._gradientType?"GradientType = 1, ":"";if(ne){var Ie=D(ne);le="#"+u(Ie._r,Ie._g,Ie._b,Ie._a)}return"progid:DXImageTransform.Microsoft.gradient("+Re+"startColorstr="+ve+",endColorstr="+le+")"},toString:function(ne){var ve=!!ne;ne=ne||this._format;var le=!1,Re=this._a<1&&this._a>=0,Ie=!ve&&Re&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return Ie?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(le=this.toRgbString()),ne==="prgb"&&(le=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(le=this.toHexString()),ne==="hex3"&&(le=this.toHexString(!0)),ne==="hex4"&&(le=this.toHex8String(!0)),ne==="hex8"&&(le=this.toHex8String()),ne==="name"&&(le=this.toName()),ne==="hsl"&&(le=this.toHslString()),ne==="hsv"&&(le=this.toHsvString()),le||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(ne,ve){var le=ne.apply(null,[this].concat([].slice.call(ve)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(T,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(c,arguments)},_applyCombination:function(ne,ve){return ne.apply(null,[this].concat([].slice.call(ve)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(l,arguments)},monochromatic:function(){return this._applyCombination(m,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(a,arguments)},tetrad:function(){return this._applyCombination(i,arguments)}},D.fromRatio=function(ne,ve){if(typeof ne=="object"){var le={};for(var Re in ne)ne.hasOwnProperty(Re)&&(Re==="a"?le[Re]=ne[Re]:le[Re]=We(ne[Re]));ne=le}return D(ne,ve)};function E(ne){var ve={r:0,g:0,b:0},le=1,Re=null,Ie=null,Ce=null,He=!1,Ze=!1;return typeof ne=="string"&&(ne=ye(ne)),typeof ne=="object"&&(Ue(ne.r)&&Ue(ne.g)&&Ue(ne.b)?(ve=R(ne.r,ne.g,ne.b),He=!0,Ze=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):Ue(ne.h)&&Ue(ne.s)&&Ue(ne.v)?(Re=We(ne.s),Ie=We(ne.v),ve=y(ne.h,Re,Ie),He=!0,Ze="hsv"):Ue(ne.h)&&Ue(ne.s)&&Ue(ne.l)&&(Re=We(ne.s),Ce=We(ne.l),ve=_(ne.h,Re,Ce),He=!0,Ze="hsl"),ne.hasOwnProperty("a")&&(le=ne.a)),le=J(le),{ok:He,format:ne.format||Ze,r:U(255,B(ve.r,0)),g:U(255,B(ve.g,0)),b:U(255,B(ve.b,0)),a:le}}function R(ne,ve,le){return{r:W(ne,255)*255,g:W(ve,255)*255,b:W(le,255)*255}}function P(ne,ve,le){ne=W(ne,255),ve=W(ve,255),le=W(le,255);var Re=B(ne,ve,le),Ie=U(ne,ve,le),Ce,He,Ze=(Re+Ie)/2;if(Re==Ie)Ce=He=0;else{var ot=Re-Ie;He=Ze>.5?ot/(2-Re-Ie):ot/(Re+Ie);switch(Re){case ne:Ce=(ve-le)/ot+(ve<le?6:0);break;case ve:Ce=(le-ne)/ot+2;break;case le:Ce=(ne-ve)/ot+4;break}Ce/=6}return{h:Ce,s:He,l:Ze}}function _(ne,ve,le){var Re,Ie,Ce;ne=W(ne,360),ve=W(ve,100),le=W(le,100);function He(et,Ke,Ve){return Ve<0&&(Ve+=1),Ve>1&&(Ve-=1),Ve<1/6?et+(Ke-et)*6*Ve:Ve<1/2?Ke:Ve<2/3?et+(Ke-et)*(2/3-Ve)*6:et}if(ve===0)Re=Ie=Ce=le;else{var Ze=le<.5?le*(1+ve):le+ve-le*ve,ot=2*le-Ze;Re=He(ot,Ze,ne+1/3),Ie=He(ot,Ze,ne),Ce=He(ot,Ze,ne-1/3)}return{r:Re*255,g:Ie*255,b:Ce*255}}function S(ne,ve,le){ne=W(ne,255),ve=W(ve,255),le=W(le,255);var Re=B(ne,ve,le),Ie=U(ne,ve,le),Ce,He,Ze=Re,ot=Re-Ie;if(He=Re===0?0:ot/Re,Re==Ie)Ce=0;else{switch(Re){case ne:Ce=(ve-le)/ot+(ve<le?6:0);break;case ve:Ce=(le-ne)/ot+2;break;case le:Ce=(ne-ve)/ot+4;break}Ce/=6}return{h:Ce,s:He,v:Ze}}function y(ne,ve,le){ne=W(ne,360)*6,ve=W(ve,100),le=W(le,100);var Re=X.floor(ne),Ie=ne-Re,Ce=le*(1-ve),He=le*(1-Ie*ve),Ze=le*(1-(1-Ie)*ve),ot=Re%6,et=[le,He,Ce,Ce,Ze,le][ot],Ke=[Ze,le,le,He,Ce,Ce][ot],Ve=[Ce,Ce,Ze,le,le,He][ot];return{r:et*255,g:Ke*255,b:Ve*255}}function d(ne,ve,le,Re){var Ie=[Ee(O(ne).toString(16)),Ee(O(ve).toString(16)),Ee(O(le).toString(16))];return Re&&Ie[0].charAt(0)==Ie[0].charAt(1)&&Ie[1].charAt(0)==Ie[1].charAt(1)&&Ie[2].charAt(0)==Ie[2].charAt(1)?Ie[0].charAt(0)+Ie[1].charAt(0)+Ie[2].charAt(0):Ie.join("")}function s(ne,ve,le,Re,Ie){var Ce=[Ee(O(ne).toString(16)),Ee(O(ve).toString(16)),Ee(O(le).toString(16)),Ee(Be(Re))];return Ie&&Ce[0].charAt(0)==Ce[0].charAt(1)&&Ce[1].charAt(0)==Ce[1].charAt(1)&&Ce[2].charAt(0)==Ce[2].charAt(1)&&Ce[3].charAt(0)==Ce[3].charAt(1)?Ce[0].charAt(0)+Ce[1].charAt(0)+Ce[2].charAt(0)+Ce[3].charAt(0):Ce.join("")}function u(ne,ve,le,Re){var Ie=[Ee(Be(Re)),Ee(O(ne).toString(16)),Ee(O(ve).toString(16)),Ee(O(le).toString(16))];return Ie.join("")}D.equals=function(ne,ve){return!ne||!ve?!1:D(ne).toRgbString()==D(ve).toRgbString()},D.random=function(){return D.fromRatio({r:I(),g:I(),b:I()})};function h(ne,ve){ve=ve===0?0:ve||10;var le=D(ne).toHsl();return le.s-=ve/100,le.s=j(le.s),D(le)}function T(ne,ve){ve=ve===0?0:ve||10;var le=D(ne).toHsl();return le.s+=ve/100,le.s=j(le.s),D(le)}function g(ne){return D(ne).desaturate(100)}function f(ne,ve){ve=ve===0?0:ve||10;var le=D(ne).toHsl();return le.l+=ve/100,le.l=j(le.l),D(le)}function w(ne,ve){ve=ve===0?0:ve||10;var le=D(ne).toRgb();return le.r=B(0,U(255,le.r-O(255*-(ve/100)))),le.g=B(0,U(255,le.g-O(255*-(ve/100)))),le.b=B(0,U(255,le.b-O(255*-(ve/100)))),D(le)}function v(ne,ve){ve=ve===0?0:ve||10;var le=D(ne).toHsl();return le.l-=ve/100,le.l=j(le.l),D(le)}function c(ne,ve){var le=D(ne).toHsl(),Re=(le.h+ve)%360;return le.h=Re<0?360+Re:Re,D(le)}function l(ne){var ve=D(ne).toHsl();return ve.h=(ve.h+180)%360,D(ve)}function a(ne){var ve=D(ne).toHsl(),le=ve.h;return[D(ne),D({h:(le+120)%360,s:ve.s,l:ve.l}),D({h:(le+240)%360,s:ve.s,l:ve.l})]}function i(ne){var ve=D(ne).toHsl(),le=ve.h;return[D(ne),D({h:(le+90)%360,s:ve.s,l:ve.l}),D({h:(le+180)%360,s:ve.s,l:ve.l}),D({h:(le+270)%360,s:ve.s,l:ve.l})]}function x(ne){var ve=D(ne).toHsl(),le=ve.h;return[D(ne),D({h:(le+72)%360,s:ve.s,l:ve.l}),D({h:(le+216)%360,s:ve.s,l:ve.l})]}function b(ne,ve,le){ve=ve||6,le=le||30;var Re=D(ne).toHsl(),Ie=360/le,Ce=[D(ne)];for(Re.h=(Re.h-(Ie*ve>>1)+720)%360;--ve;)Re.h=(Re.h+Ie)%360,Ce.push(D(Re));return Ce}function m(ne,ve){ve=ve||6;for(var le=D(ne).toHsv(),Re=le.h,Ie=le.s,Ce=le.v,He=[],Ze=1/ve;ve--;)He.push(D({h:Re,s:Ie,v:Ce})),Ce=(Ce+Ze)%1;return He}D.mix=function(ne,ve,le){le=le===0?0:le||50;var Re=D(ne).toRgb(),Ie=D(ve).toRgb(),Ce=le/100,He={r:(Ie.r-Re.r)*Ce+Re.r,g:(Ie.g-Re.g)*Ce+Re.g,b:(Ie.b-Re.b)*Ce+Re.b,a:(Ie.a-Re.a)*Ce+Re.a};return D(He)},D.readability=function(ne,ve){var le=D(ne),Re=D(ve);return(X.max(le.getLuminance(),Re.getLuminance())+.05)/(X.min(le.getLuminance(),Re.getLuminance())+.05)},D.isReadable=function(ne,ve,le){var Re=D.readability(ne,ve),Ie,Ce;Ce=!1,Ie=ce(le);switch(Ie.level+Ie.size){case"AAsmall":case"AAAlarge":Ce=Re>=4.5;break;case"AAlarge":Ce=Re>=3;break;case"AAAsmall":Ce=Re>=7;break}return Ce},D.mostReadable=function(ne,ve,le){var Re=null,Ie=0,Ce,He,Ze,ot;le=le||{},He=le.includeFallbackColors,Ze=le.level,ot=le.size;for(var et=0;et<ve.length;et++)Ce=D.readability(ne,ve[et]),Ce>Ie&&(Ie=Ce,Re=D(ve[et]));return D.isReadable(ne,Re,{level:Ze,size:ot})||!He?Re:(le.includeFallbackColors=!1,D.mostReadable(ne,["#fff","#000"],le))};var L=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=D.hexNames=H(L);function H(ne){var ve={};for(var le in ne)ne.hasOwnProperty(le)&&(ve[ne[le]]=le);return ve}function J(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function W(ne,ve){se(ne)&&(ne="100%");var le=me(ne);return ne=U(ve,B(0,parseFloat(ne))),le&&(ne=parseInt(ne*ve,10)/100),X.abs(ne-ve)<1e-6?1:ne%ve/parseFloat(ve)}function j(ne){return U(1,B(0,ne))}function $(ne){return parseInt(ne,16)}function se(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function me(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function Ee(ne){return ne.length==1?"0"+ne:""+ne}function We(ne){return ne<=1&&(ne=ne*100+"%"),ne}function Be(ne){return X.round(parseFloat(ne)*255).toString(16)}function Ne(ne){return $(ne)/255}var Le=function(){var ne="[-\\+]?\\d+%?",ve="[-\\+]?\\d*\\.\\d+%?",le="(?:"+ve+")|(?:"+ne+")",Re="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?",Ie="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?";return{CSS_UNIT:new RegExp(le),rgb:new RegExp("rgb"+Re),rgba:new RegExp("rgba"+Ie),hsl:new RegExp("hsl"+Re),hsla:new RegExp("hsla"+Ie),hsv:new RegExp("hsv"+Re),hsva:new RegExp("hsva"+Ie),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ue(ne){return!!Le.CSS_UNIT.exec(ne)}function ye(ne){ne=ne.replace(k,"").replace(Q,"").toLowerCase();var ve=!1;if(L[ne])ne=L[ne],ve=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var le;return(le=Le.rgb.exec(ne))?{r:le[1],g:le[2],b:le[3]}:(le=Le.rgba.exec(ne))?{r:le[1],g:le[2],b:le[3],a:le[4]}:(le=Le.hsl.exec(ne))?{h:le[1],s:le[2],l:le[3]}:(le=Le.hsla.exec(ne))?{h:le[1],s:le[2],l:le[3],a:le[4]}:(le=Le.hsv.exec(ne))?{h:le[1],s:le[2],v:le[3]}:(le=Le.hsva.exec(ne))?{h:le[1],s:le[2],v:le[3],a:le[4]}:(le=Le.hex8.exec(ne))?{r:$(le[1]),g:$(le[2]),b:$(le[3]),a:Ne(le[4]),format:ve?"name":"hex8"}:(le=Le.hex6.exec(ne))?{r:$(le[1]),g:$(le[2]),b:$(le[3]),format:ve?"name":"hex"}:(le=Le.hex4.exec(ne))?{r:$(le[1]+""+le[1]),g:$(le[2]+""+le[2]),b:$(le[3]+""+le[3]),a:Ne(le[4]+""+le[4]),format:ve?"name":"hex8"}:(le=Le.hex3.exec(ne))?{r:$(le[1]+""+le[1]),g:$(le[2]+""+le[2]),b:$(le[3]+""+le[3]),format:ve?"name":"hex"}:!1}function ce(ne){var ve,le;return ne=ne||{level:"AA",size:"small"},ve=(ne.level||"AA").toUpperCase(),le=(ne.size||"small").toLowerCase(),ve!=="AA"&&ve!=="AAA"&&(ve="AA"),le!=="small"&&le!=="large"&&(le="small"),{level:ve,size:le}}$e.exports?$e.exports=D:!(ee=function(){return D}.call(ke,F,ke,$e),ee!==void 0&&($e.exports=ee))})(Math)},bPs0:function($e,ke,F){"use strict";F.d(ke,"b",function(){return h});var ee=F("k1fw"),X=F("9og8"),k=F("2qtc"),Q=F("kLXV"),N=F("tJVT"),O=F("PpiC"),U=F("aHsQ"),B=F("sGsY"),I=F("WmNS"),D=F.n(I),E=F("q1tI"),R=F.n(E),P=F("bntm"),_=F("V0Rq"),S=F("wd/R"),y=F.n(S),d=F("Ty5D"),s=F("9kvl"),u=B.a.Countdown,h=["fullscreenchange","msfullscreenchange","webkitfullscreenchange","mozfullscreenchange"],T=function(f){var w=f.globalSetting,v=f.loading,c=f.user,l=f.exercise,a=f.dispatch,i=f.isclick,x=f.setisclick,b=Object(O.a)(f,["globalSetting","loading","user","exercise","dispatch","isclick","setisclick"]),m=Object(E.useState)({}),L=Object(N.a)(m,2),C=L[0],H=L[1],J=Q.a.useModal(),W=Object(N.a)(J,2),j=W[0],$=W[1],se=Object(E.useRef)(),me=Object(E.useRef)(null),Ee=Object(E.useRef)(null),We=Object(E.useState)(!0),Be=Object(N.a)(We,2),Ne=Be[0],Le=Be[1],Ue=Object(d.h)().query,ye=Object(d.i)();Object(E.useEffect)(function(){var et,Ke,Ve,ht,mt;if(clearTimeout(me.current),document.addEventListener(Object(P.c)(),ot,!1),window.addEventListener("blur",He,!1),(et=l.exerciseUserInfo)!==null&&et!==void 0&&et.screen_open&&Object(P.a)()&&(a({type:"globalSetting/headerFooterToggle",payload:!1}),Le(!1)),(Ke=l.exerciseUserInfo)!==null&&Ke!==void 0&&Ke.screen_at&&y()().diff(y()((Ve=l.exerciseUserInfo)===null||Ve===void 0?void 0:Ve.screen_at),"seconds")>0)ce();else if((ht=l.exerciseUserInfo)!==null&&ht!==void 0&&ht.screen_open&&!Object(P.a)()){var gt=document.domain==="kepukehuan.educoder.net"?30:l.exerciseUserInfo.screen_sec+10+1;se.current=Q.a.info({icon:null,content:R.a.createElement("div",{className:"tc font16"},"\u672C\u573A\u8003\u8BD5\u5DF2\u5F00\u542F\u9632\u5207\u5C4F\u9650\u5236\uFF0C",R.a.createElement("br",null),"\u5207\u6362\u9875\u9762 ",l.exerciseUserInfo.screen_num-l.exerciseUserInfo.used_screen_num," \u6B21\u540E\u5C06\u8FDB\u884C\u5F3A\u5236\u4EA4\u5377\uFF0C",R.a.createElement("br",null),"\u8BF7\u52FF\u5207\u5C4F\u53CA\u5237\u65B0\u9875\u9762"),okText:R.a.createElement("span",null,"\u5F00\u59CB\u8003\u8BD5\uFF08",R.a.createElement("span",{style:{display:"inline-block"}},R.a.createElement(u,{onFinish:function(){var ft;ce(),(ft=se.current)===null||ft===void 0||ft.destroy()},valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+gt*1e3})),"S\uFF09"),onOk:function(){var ft;(ft=se.current)===null||ft===void 0||ft.destroy(),Le(!1),Object(P.d)(document.body),document.getElementById("root").addEventListener("click",ne,!1)}})}return(mt=l.exerciseUserInfo)!==null&&mt!==void 0&&mt.screen_open&&!Object(P.a)()||document.getElementById("root").addEventListener("click",ne,!1),function(){document.getElementById("root").removeEventListener("click",ne,!1),document.removeEventListener(Object(P.c)(),ot,!1),window.removeEventListener("blur",He,!1),clearTimeout(me.current)}},[]),Object(E.useEffect)(function(){setTimeout(function(){l.actionTabs.removeEventListenerExitScreen&&(clearTimeout(me.current),document.getElementById("root").removeEventListener("click",ne,!1),document.removeEventListener(Object(P.c)(),ot,!1))},500),ve()},[l.actionTabs]),Object(E.useEffect)(function(){setTimeout(function(){l.exerciseUserInfo.used_screen_num>l.exerciseUserInfo.screen_num?Ie():!Ne},500)},[l.exerciseUserInfo]);var ce=function(){var et=Object(X.a)(D.a.mark(function Ke(){var Ve;return D.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Ze();case 2:Ve=mt.sent,setTimeout(function(){var gt,Et;(gt=se.current)===null||gt===void 0||gt.destroy(),se.current=Q.a.info({okText:R.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:R.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",R.a.createElement("span",{className:"c-red"},Ve.used_screen_num),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",R.a.createElement("span",{className:"c-red"},(Et=l.exerciseUserInfo)===null||Et===void 0?void 0:Et.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377"),onOk:function(){var ft=Object(X.a)(D.a.mark(function _e(){return D.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:Object(P.d)(document.body);case 1:case"end":return Je.stop()}},_e)}));function Ct(){return ft.apply(this,arguments)}return Ct}()})},1e3);case 4:case"end":return mt.stop()}},Ke)}));return function(){return et.apply(this,arguments)}}(),ne=function(Ke){!Object(P.a)()&&Ke.target.nodeName!=="A"&&Ke.target.nodeName!=="BUTTON"&&Ke.target.innerHTML!=="\u786E \u5B9A"&&(Object(P.d)(document.body),console.log("documentClick.full"))},ve=function(){var et=Object(X.a)(D.a.mark(function Ke(){return D.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.abrupt("return",new Promise(function(){var mt=Object(X.a)(D.a.mark(function gt(Et){var ft;return D.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,a({type:"exercise/getExerciseUserInfo",payload:Object(ee.a)({},ye)});case 2:return ft=_e.sent,Et(ft==null?void 0:ft.data),_e.abrupt("return",ft==null?void 0:ft.data);case 5:case"end":return _e.stop()}},gt)}));return function(gt){return mt.apply(this,arguments)}}()));case 1:case"end":return ht.stop()}},Ke)}));return function(){return et.apply(this,arguments)}}(),le=function(){var et=Object(X.a)(D.a.mark(function Ke(Ve){var ht,mt,gt;return D.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:(ht=se.current)===null||ht===void 0||((mt=ht.destroyAll)===null||mt===void 0)||mt.call(ht),se.current=Q.a.info({maskClosable:!1,keyboard:!1,okText:R.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5\uFF08",R.a.createElement("span",{style:{display:"inline-block"}},R.a.createElement(u,{onFinish:Ze,valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+(l.exerciseUserInfo.screen_sec+1)*1e3})),"S\uFF09"),content:R.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",R.a.createElement("span",{className:"c-red"},Ve),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",R.a.createElement("span",{className:"c-red"},(gt=l.exerciseUserInfo)===null||gt===void 0?void 0:gt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377,",R.a.createElement("span",{className:"c-red"},l.exerciseUserInfo.screen_sec),"\u79D2\u5185\u56DE\u5230",R.a.createElement("br",null),R.a.createElement("span",{style:{marginLeft:38}},"\u8003\u8BD5\u4E0D\u8BA1\u5207\u5C4F\u6B21\u6570\u3002")),onOk:function(){var Ct=Object(X.a)(D.a.mark(function Se(){return D.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:clearTimeout(Ee.current),Object(P.d)(document.body),se.current.destroy();case 3:case"end":return nt.stop()}},Se)}));function _e(){return Ct.apply(this,arguments)}return _e}()}),Ee.current=setTimeout(function(){var Ct;se.current.update({okText:R.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:R.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",R.a.createElement("span",{className:"c-red"},Ve+1),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",R.a.createElement("span",{className:"c-red"},(Ct=l.exerciseUserInfo)===null||Ct===void 0?void 0:Ct.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377")})},(l.exerciseUserInfo.screen_sec+1)*1e3);case 3:case"end":return ft.stop()}},Ke)}));return function(Ve){return et.apply(this,arguments)}}(),Re=function(){location.href="/classrooms/".concat(ye.coursesId,"/exercise/").concat(ye.categoryId,"/detail")},Ie=function(){var et=Object(X.a)(D.a.mark(function Ke(){var Ve,ht,mt;return D.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return(Ve=se.current)===null||Ve===void 0||((ht=Ve.destroyAll)===null||ht===void 0)||ht.call(Ve),Et.next=3,Object(_.Z)({categoryId:ye.categoryId,commit_method:1});case 3:mt=Et.sent,mt&&Ce();case 5:case"end":return Et.stop()}},Ke)}));return function(){return et.apply(this,arguments)}}(),Ce=function(){var Ke,Ve;document.removeEventListener(Object(P.c)(),ot,!1),Object(P.b)(),(Ke=se.current)===null||Ke===void 0||((Ve=Ke.destroyAll)===null||Ve===void 0)||Ve.call(Ke),j.info({content:R.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",R.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){Re()}})},He=function(Ke){if(i){setTimeout(function(){x(!1)},500);return}Object(P.a)()&&document.getElementById("iframeShixuns").style.display=="none"&&Object(P.b)()},Ze=function(){var et=Object(X.a)(D.a.mark(function Ke(){return D.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.abrupt("return",new Promise(function(){var mt=Object(X.a)(D.a.mark(function gt(Et){var ft,Ct,_e;return D.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(!((ft=l.exerciseUserInfo)!==null&&ft!==void 0&&ft.screen_at)){Je.next=3;break}return Je.next=3,Object(_.g)(Object(ee.a)(Object(ee.a)({},ye),{},{reset:!0}));case 3:return Je.next=5,Object(_.Q)({id:ye.categoryId});case 5:if(Ct=Je.sent,!(Ct!=null&&Ct.is_commit)){Je.next=9;break}return Ce(),Je.abrupt("return");case 9:return Je.next=11,ve();case 11:_e=Je.sent,Et(_e);case 13:case"end":return Je.stop()}},gt)}));return function(gt){return mt.apply(this,arguments)}}()));case 1:case"end":return ht.stop()}},Ke)}));return function(){return et.apply(this,arguments)}}(),ot=function(){var et=Object(X.a)(D.a.mark(function Ke(){var Ve,ht,mt,gt;return D.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:if(Ve=!1,console.log("fullscreen change"),!Object(P.a)()){ft.next=7;break}(ht=l.exerciseUserInfo)!==null&&ht!==void 0&&ht.screen_at&&Object(_.g)(Object(ee.a)(Object(ee.a)({},ye),{},{reset:!0})),clearTimeout(me.current),ft.next=17;break;case 7:return Ve=!0,ft.next=10,Object(_.g)(Object(ee.a)({},ye));case 10:return ft.next=12,ve();case 12:mt=ft.sent,le(mt.used_screen_num),gt=setTimeout(Object(X.a)(D.a.mark(function Ct(){return D.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:case"end":return Se.stop()}},Ct)})),l.exerciseUserInfo.screen_sec*1e3),window.frames.length!=parent.frames.length&&window.parent.postMessage("backExercise","*"),me.current=gt;case 17:a({type:"globalSetting/headerFooterToggle",payload:Ve});case 18:case"end":return ft.stop()}},Ke)}));return function(){return et.apply(this,arguments)}}();return R.a.createElement("div",null,$)};ke.a=Object(s.a)(function(g){var f=g.loading,w=g.user,v=g.exercise,c=g.globalSetting;return{globalSetting:c,user:w,exercise:v,loading:f.effects}})(T)},bT9E:function($e,ke,F){"use strict";F.d(ke,"a",function(){return X});var ee=F("VTBJ");function X(k,Q){var N=Object(ee.a)({},k);return Array.isArray(Q)&&Q.forEach(function(O){delete N[O]}),N}},biw7:function($e,ke,F){"use strict";var ee=F("q1tI"),X=F.n(ee),k=ee.createContext(null);ke.a=k},c5Ni:function($e,ke,F){},cQPA:function($e,ke,F){"use strict";F.r(ke);var ee=F("T2oS"),X=F("W9HT"),k=F("sPJy"),Q=F("bE4q"),N=F("+L6B"),O=F("2/Rp"),U=F("14J3"),B=F("BMrR"),I=F("jCWc"),D=F("kPKH"),E=F("5Dmo"),R=F("3S7+"),P=F("sRBo"),_=F("kaz8"),S=F("7Kak"),y=F("9yH6"),d=F("MXD1"),s=F("CFYs"),u=F("miYZ"),h=F("tsqr"),T=F("2qtc"),g=F("kLXV"),f=F("k1fw"),w=F("9og8"),v=F("tJVT"),c=F("PpiC"),l=F("5NDa"),a=F("5rEg"),i=F("aHsQ"),x=F("sGsY"),b=F("WmNS"),m=F.n(b),L=F("q1tI"),C=F.n(L),H=F("Ty5D"),J=F("55Ip"),W=F("9kvl"),j=F("gUdW"),$=F("xGfz"),se=F("jhfD"),me=F("BlwA"),Ee=F("bPs0"),We=F("wd/R"),Be=F.n(We),Ne=F("9GDu"),Le=F.n(Ne),Ue=F("1vsH"),ye=F("s8TD"),ce=F("xKgJ"),ne=F("bntm"),ve=F("V0Rq"),le=F("HBuW"),Re=F("9Bee"),Ie=F("Ot1p"),Ce=function(ze){var De,ae,de,Ye,Me,Xe=ze.item,dt=ze.answerData,Pe=ze.onBlur,at=Pe===void 0?function(){}:Pe,vt=Object(L.useState)(),St=Object(v.a)(vt,2),Rt=St[0],qt=St[1],sn=Object(L.useState)(),Xt=Object(v.a)(sn,2),_t=Xt[0],cn=Xt[1],zt=Object(L.useState)(),$t=Object(v.a)(zt,2),Nt=$t[0],nn=$t[1];return Object(L.useEffect)(function(){cn(Xe==null?void 0:Xe.a_flag)},[Xe==null?void 0:Xe.a_flag]),C.a.createElement("div",null,(dt==null||((De=dt.exercise)===null||De===void 0)?void 0:De.commit_status)===1?C.a.createElement("div",null,C.a.createElement("p",{className:"mt10 mb0"},"\u6211\u7684\u7B54\u6848\uFF1A"),C.a.createElement("div",{className:Le.a.simpleText},C.a.createElement(Re.a,{value:Xe==null||((ae=Xe.user_answer)===null||ae===void 0)?void 0:ae[0]}))):C.a.createElement("div",{className:Xe.user_score&&(Xe.user_score===Xe.question_score?"c-green":"c-red")},Nt?C.a.createElement(Ie.a,{height:150,isFocus:!0,defaultValue:Xe==null||((de=Xe.user_answer)===null||de===void 0)?void 0:de[0],id:Xe==null?void 0:Xe.question_id,onChange:function(Tn){return qt(Tn)},onBlur:function(){return at(Rt)}}):C.a.createElement("div",{onClick:function(){var Tn;if(!Xe.repeat_answer&&(Xe==null||((Tn=Xe.user_answer)===null||Tn===void 0)?void 0:Tn.length)>0)return;nn(!0)}},C.a.createElement(a.a,{disabled:!Xe.repeat_answer&&(Xe==null||((Ye=Xe.user_answer)===null||Ye===void 0)?void 0:Ye.length)>0&&!Xe.israp,size:"large",className:"current",placeholder:"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54",readOnly:!0}))),(Xe==null?void 0:Xe.standard_answer)&&C.a.createElement("div",null,C.a.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),C.a.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},C.a.createElement(Re.a,{value:Xe==null||((Me=Xe.standard_answer)===null||Me===void 0)?void 0:Me[0]}))))},He=Ce,Ze=F("g9YV"),ot=F("wCAj"),et=F("5GOC"),Ke=F("JsLm"),Ve=F("ZW9T"),ht=F("o/qq"),mt=F.n(ht),gt=function(ze){var De,ae,de,Ye,Me=ze.item,Xe=ze.answerData,dt=Object(L.useState)([]),Pe=Object(v.a)(dt,2),at=Pe[0],vt=Pe[1],St=Object(L.useState)([]),Rt=Object(v.a)(St,2),qt=Rt[0],sn=Rt[1];Object(L.useEffect)(function(){var zt;if(!(Me!=null&&(zt=Me.shixun_details)!==null&&zt!==void 0&&zt.length))return;for(var $t=[],Nt=[],nn=0;nn<(Me==null||((An=Me.shixun_details)===null||An===void 0)?void 0:An.length);nn++){for(var An,Tn,ct,Gt=0;Gt<(Me==null?void 0:Me.shixun_details[nn].stage_list.length);Gt++){var Ln,Fn,kn,Xn,G=Me==null?void 0:Me.shixun_details[nn].stage_list[Gt];$t.push(Object(f.a)(Object(f.a)({},G),{operation:Me==null||((Ln=Me.shixun_details)===null||Ln===void 0||((Fn=Ln[nn])===null||Fn===void 0||((kn=Fn.shixun_detail)===null||kn===void 0||((Xn=kn[0])===null||Xn===void 0))))?void 0:Xn.game_identifier}))}if(Me!=null&&(Tn=Me.shixun_details)!==null&&Tn!==void 0&&(ct=Tn[nn])!==null&&ct!==void 0&&ct.shixun_detail){var p,A,K;Nt.push(Me==null||((p=Me.shixun_details)===null||p===void 0||((A=p[nn])===null||A===void 0||((K=A.shixun_detail)===null||K===void 0)))?void 0:K[0])}}sn(Nt),vt($t)},[Me==null?void 0:Me.shixun_details]);var Xt=[{title:"\u5173\u5361",dataIndex:"position",key:"position",align:"center"},{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:function($t){return C.a.createElement("span",{className:"overflowHidden1",style:{maxWidth:"400px"},title:$t&&$t.length>25?$t:""},$t)}},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",key:"evaluate_count",align:"center",render:function($t,Nt){return C.a.createElement("span",null,Nt.evaluate_count?Nt.evaluate_count:C.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u5B8C\u6210\u65F6\u95F4",key:"endTime",dataIndex:"endTime",align:"center",render:function($t,Nt){var nn=!1;return Nt.finished_time&&Xe!==null&&Xe!==void 0&&Xe.exercise&&Xe!==null&&Xe!==void 0&&Xe.exercise_answer_user&&((Xe==null?void 0:Xe.exercise.time)===-1?nn=Be()(Xe==null?void 0:Xe.exercise.end_time).isBefore(Nt.finished_time):nn=Be()(Xe==null?void 0:Xe.exercise_answer_user.start_at).add(Xe==null?void 0:Xe.exercise.time,"m").isBefore(Nt.finished_time)),C.a.createElement("span",null,Nt.finished_time||C.a.createElement("span",{className:"c-grey-999"},"--"),C.a.createElement("span",{className:"c-orange-ff9 "},nn?"\uFF08\u5DF2\u8D85\u65F6\uFF09":""))}},{title:"\u8017\u65F6",dataIndex:"time_consuming",key:"time_consuming",align:"center",render:function($t,Nt){return C.a.createElement("span",null,Nt.time_consuming||C.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u67E5\u770B\u7B54\u6848",dataIndex:"view_answer",key:"view_answer",align:"center",render:function($t,Nt){return C.a.createElement("span",null,Nt.view_answer?"\u5DF2\u67E5\u770B":"\u672A\u67E5\u770B")}},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",align:"center",render:function($t,Nt,nn){return $t?C.a.createElement(Ke.a,{affix:!1,className:"mt10"},C.a.createElement(Ke.a.Link,{href:"#challenge_".concat(Me==null?void 0:Me.question_id).concat(nn),title:C.a.createElement("span",{style:{color:"#0152d9"}},"\u67E5\u770B")})):C.a.createElement("span",{className:"c-grey-999"},"--")}}],_t=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function($t,Nt){return C.a.createElement("span",null,Nt.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function($t,Nt){return C.a.createElement("span",null,Nt.error_msg?Nt.error_msg:"--")}}],cn={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return C.a.createElement("div",{className:"mt15 mb15"},(Xe==null||((De=Xe.exercise)===null||De===void 0)?void 0:De.commit_status)===0&&C.a.createElement("div",null,Me.shixun.map(function(zt,$t){return C.a.createElement(B.a,{className:"font16",gutter:[0,20]},C.a.createElement(D.a,{flex:"1"},zt.challenge_name," (",zt.challenge_score,"\u5206)"),C.a.createElement(D.a,{flex:"100px",className:"tr"},zt.answer_status===0&&C.a.createElement("span",{className:"font12 tag-style-border border-orange c-orange "},"\u672A\u5B8C\u6210"),zt.answer_status===1&&C.a.createElement("span",{className:"font12 tag-style-border border-green c-green "},"\u5DF2\u5B8C\u6210")))})),(Xe==null||((ae=Xe.exercise)===null||ae===void 0)?void 0:ae.commit_status)!==0||(Xe==null||((de=Xe.exercise)===null||de===void 0)?void 0:de.user_exercise_status)!==0?C.a.createElement(C.a.Fragment,null,!!(at!=null&&at.length)&&C.a.createElement("div",null,C.a.createElement("p",{className:"font16 c-grey-666"},"\u9636\u6BB5\u6210\u7EE9"),C.a.createElement(ot.a,{columns:Xt,dataSource:at,pagination:!1})),!!(qt!=null&&qt.length)&&C.a.createElement("div",null,C.a.createElement("p",{className:"font16 c-grey-666 mt10"},"\u5B9E\u8BAD\u8BE6\u60C5"),qt==null?void 0:qt.map(function(zt,$t){return C.a.createElement("div",{id:"challenge_".concat(Me==null?void 0:Me.question_id).concat($t),className:"mt5"},C.a.createElement("div",null,C.a.createElement("span",{className:"font16 mr15"}," \u7B2C",zt.position,"\u5173"),C.a.createElement(J.a,{className:"current c-black font16",to:"/tasks/".concat(zt.game_identifier)},zt.name)),(zt==null?void 0:zt.st)===0&&zt.passed_code&&C.a.createElement("aside",{className:mt.a.shixunWrp},C.a.createElement("h2",null,"\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09",C.a.createElement("span",{className:"c-light-black"},zt.path)),C.a.createElement(Ve.b,{height:300,language:"python",theme:"default",value:zt.passed_code,options:cn})))}))):C.a.createElement(C.a.Fragment,null,C.a.createElement(Re.a,{className:"c-grey-999 mt20 mb20",value:Me==null?void 0:Me.question_title}),Me==null||((Ye=Me.shixun)===null||Ye===void 0)?void 0:Ye.map(function(zt,$t){return C.a.createElement("p",{className:"font16 c-grey-666 mb5",key:$t},C.a.createElement("span",{className:"mr20"},"\u7B2C",zt==null?void 0:zt.challenge_position,"\u5173 ",zt==null?void 0:zt.challenge_name),C.a.createElement("span",null,zt==null?void 0:zt.challenge_score,"\u5206"))})))},Et=gt,ft=F("J66h"),Ct=function(ze){var De=ze.item,ae=ze.answerData,de=Object(L.useState)([]),Ye=Object(v.a)(de,2),Me=Ye[0],Xe=Ye[1];Object(L.useEffect)(function(){var at;if((De==null||((at=De.evaluate_codes)===null||at===void 0)?void 0:at.length)>0){var vt;Xe(De==null||((vt=De.evaluate_codes)===null||vt===void 0)?void 0:vt.map(function(St,Rt){return{key:Rt+1,error_msg:St!=null&&St.error_msg?ft.Base64.decode(St==null?void 0:St.error_msg):""}}))}else Xe([{key:"--",error_msg:"--"}])},[De==null?void 0:De.evaluate_codes]);var dt=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(vt,St){return C.a.createElement("span",null,St.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(vt,St){return C.a.createElement("span",null,St.error_msg?St.error_msg:"--")}}],Pe={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{className:"mt15 mb15"},C.a.createElement(Re.a,{value:De==null?void 0:De.description})),!!(De!=null&&De.user_answer.length)&&(De==null?void 0:De.passed_code)&&C.a.createElement("aside",{className:mt.a.shixunWrp},C.a.createElement("h3",null,"\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"),C.a.createElement(Ve.b,{style:{border:"1px solid #ccc"},height:300,language:"python",theme:"vs-light",value:De!=null&&De.passed_code?ft.Base64.decode(De==null?void 0:De.passed_code):"",options:Pe})))},_e=Ct,Se=F("oBTY"),Je=a.a.TextArea,nt=function(ze){var De,ae,de=ze.item,Ye=ze.answerData,Me=ze.onBlur,Xe=Me===void 0?function(){}:Me,dt=Object(L.useState)([]),Pe=Object(v.a)(dt,2),at=Pe[0],vt=Pe[1];return Object(L.useEffect)(function(){for(var St=[],Rt=function(Xt){var _t,cn=(de==null||((_t=de.user_answer)===null||_t===void 0)?void 0:_t.find(function(zt){return zt.choice_id===Xt+1}))||{choice_id:Xt+1,answer_text:""};St.push(Object(f.a)({},cn))},qt=0;qt<(de==null?void 0:de.multi_count);qt++)Rt(qt);vt(St)},[de==null?void 0:de.user_answer]),C.a.createElement("div",null,at==null?void 0:at.map(function(St,Rt){var qt;return C.a.createElement("div",{className:"mt10"},C.a.createElement("span",null,"\u6211\u7684\u7B54\u6848\uFF08\u586B\u7A7A",Rt+1,"\uFF09:"),C.a.createElement("div",null,C.a.createElement(Je,{autoSize:!0,rows:4,disabled:!de.repeat_answer&&(de==null||((qt=de.user_answer)===null||qt===void 0)?void 0:qt.length)>0&&!de.israp||!!(Ye!=null&&Ye.exercise.commit_status),value:St==null?void 0:St.answer_text,onChange:function(Xt){at[Rt].answer_text=Xt.target.value,vt(Object(Se.a)(at))},onBlur:function(Xt){return Xe(St==null?void 0:St.answer_text,Rt+1,at)},className:"overflow_hidden ".concat(de.user_score&&(de.user_score===de.question_score?"c-green":"c-red"))})))}),!!(de!=null&&(De=de.standard_answer)!==null&&De!==void 0&&De.length)&&C.a.createElement("div",null,de==null||((ae=de.standard_answer)===null||ae===void 0)?void 0:ae.map(function(St,Rt){return C.a.createElement("div",null,C.a.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",Rt+1,"\uFF09:"),C.a.createElement("div",null,C.a.createElement(Je,{autoSize:!0,disabled:!0,value:St==null?void 0:St.answer_text[0]})))})))},Fe=nt,qe=F("lzim"),xe=a.a.TextArea,he=function(ze){var De=ze.data;return C.a.createElement("div",{className:"tc mt80"},C.a.createElement("img",{width:"486",src:qe.n})," ",C.a.createElement("br",null),De.status===-1&&C.a.createElement("div",{className:"c-grey-999 mt60"},"\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"),De.status===-2&&C.a.createElement("div",{className:" c-grey-999 mt60"},"\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A",C.a.createElement("span",{className:"c-red"},De.ip),"\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"),C.a.createElement(O.a,{className:"mt40 pl20 pr20",type:"primary"},C.a.createElement("a",{href:"/"},"\u56DE\u5230\u9996\u9875")))},ge=he,re=F("m3rI"),ie=F("LvDl"),oe=x.a.Countdown,ue=a.a.TextArea,Oe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],we={1:"\u672A\u53D1\u5E03",2:"\u5DF2\u53D1\u5E03",3:"\u5DF2\u622A\u6B62"},rt={1:Le.a.flagActive,2:Le.a.flagHalf},yt={0:"c-red-ee4",1:"c-green"},wt=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898","\u7F16\u7A0B\u9898"],xt=function(ze){var De,ae,de,Ye,Me,Xe,dt,Pe,at,vt,St,Rt,qt,sn,Xt,_t,cn,zt,$t,Nt,nn,An,Tn,ct,Gt,Ln,Fn,kn,Xn,G,p,A=ze.globalSetting,K=ze.loading,Y=ze.user,V=ze.dispatch,Ae=Object(c.a)(ze,["globalSetting","loading","user","dispatch"]),it=Object(H.i)(),Tt=Object(L.useState)({}),Bt=Object(v.a)(Tt,2),fe=Bt[0],Ft=Bt[1],Qt=Object(L.useState)({}),xn=Object(v.a)(Qt,2),Hn=xn[0],ir=xn[1],Rn=Object(L.useState)({}),cr=Object(v.a)(Rn,2),gr=cr[0],Qn=cr[1],hr=Object(L.useState)(!1),$n=Object(v.a)(hr,2),kr=$n[0],ar=$n[1],Ir=Object(L.useState)(!0),Er=Object(v.a)(Ir,2),Rr=Er[0],Qr=Er[1],xr=Object(L.useState)(!1),or=Object(v.a)(xr,2),Fr=or[0],Pr=or[1],jr=Object(L.useState)(!1),En=Object(v.a)(jr,2),on=En[0],Mn=En[1],hn=Object(L.useState)(),On=Object(v.a)(hn,2),fn=On[0],_r=On[1],In=Object(L.useState)(0),Yn=Object(v.a)(In,2),zr=Yn[0],Wr=Yn[1],Or=Object(L.useState)(""),Yr=Object(v.a)(Or,2),sr=Yr[0],Hr=Yr[1],Cr=Object(L.useState)("none"),Kr=Object(v.a)(Cr,2),Jr=Kr[0],lr=Kr[1],oi=Object(L.useState)(""),si=Object(v.a)(oi,2),Ht=si[0],en=si[1],Vt=Object(L.useState)({status:0}),an=Object(v.a)(Vt,2),pn=an[0],Cn=an[1],un=Object(L.useRef)(),Pn=Object(L.useState)(0),Kn=Object(v.a)(Pn,2),It=Kn[0],fr=Kn[1],gn=Object(L.useState)(0),Bn=Object(v.a)(gn,2),rn=Bn[0],zn=Bn[1],vn=Object(L.useState)(!1),mn=Object(v.a)(vn,2),bn=mn[0],Jn=mn[1],Zr=Object(L.useState)(!1),Gr=Object(v.a)(Zr,2),qr=Gr[0],wi=Gr[1],zi=Object(L.useState)(),Ri=Object(v.a)(zi,2),Gi=Ri[0],Vi=Ri[1],Ja=Object(L.useState)(),Xi=Object(v.a)(Ja,2),Qi=Xi[0],Za=Xi[1];Object(L.useEffect)(function(){return(Object(ce.c)()||Object(ce.l)())&&ei(),window.addEventListener("message",li),function(){window.removeEventListener("message",li),window.removeEventListener("beforeunload",_i),location.pathname.indexOf("/detail")>-1&&Object(ne.b)()}},[it.categoryId,Y.userInfo.login]);var li=function(pe){pe.data==="backExercise"&&(lr("none"),Hr(""),ei())},$r=function(){var jt=Object(w.a)(m.a.mark(function pe(){var lt,tt,Mt,ut,Ot,Pt,kt,Yt,Kt,Jt,yn;return m.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,V({type:"exercise/getExerciseUserInfo",payload:Object(f.a)({},it)});case 2:if(tt=ln.sent,ir(Object(f.a)({},tt.data)),!((tt==null||((lt=tt.data)===null||lt===void 0)?void 0:lt.ip_limit)!=="no")){ln.next=11;break}if(!((tt==null||((Mt=tt.data)===null||Mt===void 0)?void 0:Mt.ip_limit)==="inner")){ln.next=9;break}return ln.next=8,Object(ye.a)({ip_limit:tt==null||((ut=tt.data)===null||ut===void 0)?void 0:ut.ip_limit});case 8:Pt=ln.sent;case 9:return ln.next=11,Object(Ue.q)({exerciseId:it.categoryId,ip:Pt,errmsgHide:!0,ip_limit:tt==null||((Ot=tt.data)===null||Ot===void 0)?void 0:Ot.ip_limit}).catch(function(ur){Cn(ur)});case 11:if(!((tt==null?void 0:tt.status)==0)){ln.next=18;break}if(!((tt==null||((kt=tt.data)===null||kt===void 0)?void 0:kt.used_screen_num)>(tt==null||((Yt=tt.data)===null||Yt===void 0)?void 0:Yt.screen_num)&&tt!==null&&tt!==void 0&&(Kt=tt.data)!==null&&Kt!==void 0&&Kt.screen_open)){ln.next=15;break}return bi(),ln.abrupt("return",!1);case 15:Pr(tt==null?void 0:tt.data.check_camera),Mn(tt==null||((Jt=tt.data)===null||Jt===void 0)?void 0:Jt.screen_open),tt!=null&&(yn=tt.data)!==null&&yn!==void 0&&yn.check_camera||ei();case 18:case"end":return ln.stop()}},pe)}));return function(){return jt.apply(this,arguments)}}(),_i=function(pe){var lt="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(pe||window.event).returnValue=lt,lt},ei=function(){var jt=Object(w.a)(m.a.mark(function pe(){var lt,tt,Mt,ut,Ot;return m.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return ar(!0),kt.next=3,Object(ve.Y)(Object(f.a)({},it)).catch(function(){return ar(!1)});case 3:tt=kt.sent,((lt=tt)===null||lt===void 0?void 0:lt.exercise)&&(tt.exercise.user_exercise_status=1),ar(!1),tt&&(tt.exercise_types=((Mt=tt)===null||Mt===void 0?void 0:Mt.exercise_types)||((ut=tt)===null||ut===void 0||((Ot=ut.exercise_scores)===null||Ot===void 0)?void 0:Ot.exercise_types),Ft(tt));case 7:case"end":return kt.stop()}},pe)}));return function(){return jt.apply(this,arguments)}}();Object(L.useEffect)(function(){var jt,pe,lt;((jt=fe.exercise)===null||jt===void 0?void 0:jt.time)===0&&bi(),((pe=fe.exercise)===null||pe===void 0?void 0:pe.time)&&_r(Date.now()+(fe==null||((lt=fe.exercise)===null||lt===void 0)?void 0:lt.time)*1e3*60)},[(De=fe.exercise)===null||De===void 0?void 0:De.time]);var qa=function(){var pe;(fe==null||((pe=fe.exercise)===null||pe===void 0)?void 0:pe.exercise_status)===3?g.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377",C.a.createElement("br",null),"\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")}):g.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u5B66\u751F\u5C06\u5F97\u5230\u4E00\u6B21\u91CD\u65B0\u7B54\u9898\u7684\u673A\u4F1A\uFF0C\u73B0\u6709\u7684\u7B54\u9898\u60C5\u51B5\u5C06\u88AB\u6E05\u7A7A",C.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),onOk:function(){var lt=Object(w.a)(m.a.mark(function Mt(){var ut,Ot;return m.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(ve.R)({categoryId:it.categoryId,user_ids:[fe==null||((ut=fe.exercise_answer_user)===null||ut===void 0)?void 0:ut.user_id]});case 2:Ot=kt.sent,Ot&&(h.b.info(Ot==null?void 0:Ot.message),vr());case 4:case"end":return kt.stop()}},Mt)}));function tt(){return lt.apply(this,arguments)}return tt}()})},vr=function(){ei()},ni=function(){var jt=Object(w.a)(m.a.mark(function pe(){var lt,tt;return m.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(ve.ab)({categoryId:it.categoryId,commit_method:2});case 2:lt=ut.sent,(lt==null?void 0:lt.status)===0&&(g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:C.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",C.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Ot=Object(w.a)(m.a.mark(function kt(){return m.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:vr();case 1:case"end":return Kt.stop()}},kt)}));function Pt(){return Ot.apply(this,arguments)}return Pt}()}),h.b.info(lt==null?void 0:lt.message)),(lt==null?void 0:lt.status)===-3&&(tt=parseInt(lt==null?void 0:lt.message),fe.exercise.time=tt,Ft(Object(f.a)({},fe)));case 5:case"end":return ut.stop()}},pe)}));return function(){return jt.apply(this,arguments)}}(),yi=function(){var jt=Object(w.a)(m.a.mark(function pe(lt){var tt;return m.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.next=2,Object(le.D)({id:lt.shixun_identifier});case 2:tt=ut.sent,tt!=null&&tt.game_identifier&&(Hr("/tasks/".concat(tt.game_identifier,"?type=exercises&exercisesId=").concat(it.categoryId,"&coursesId=").concat(it.coursesId,"&login=").concat(it.login,"&questionId=").concat(lt.question_id)),lr("block")),(tt==null?void 0:tt.status)===-3?Object(Ue.o)():(tt==null?void 0:tt.status)===2?$a(tt==null?void 0:tt.message,lt.question_id):(tt==null?void 0:tt.status)===3&&Yi(tt==null?void 0:tt.message);case 5:case"end":return ut.stop()}},pe)}));return function(lt){return jt.apply(this,arguments)}}(),$a=function jt(pe,lt){var tt;pe=(tt=pe)!==null&&tt!==void 0&&tt.includes(".json")?pe:"".concat(pe,".json"),g.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Mt=Object(w.a)(m.a.mark(function Ot(){var Pt,kt;return m.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(ve.S)({url:pe});case 2:if(Pt=Kt.sent,Pt){Kt.next=5;break}return Kt.abrupt("return");case 5:return h.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Kt.next=8,Object(le.D)({id:Pt.shixun_identifier});case 8:if(kt=Kt.sent,!(kt!=null&&kt.game_identifier)){Kt.next=12;break}return yi({shixun_identifier:kt==null?void 0:kt.game_identifier,question_id:lt}),Kt.abrupt("return");case 12:(kt==null?void 0:kt.status)===2?jt(kt==null?void 0:kt.message,lt):(kt==null?void 0:kt.status)===3&&Yi(kt==null?void 0:kt.message);case 13:case"end":return Kt.stop()}},Ot)}));function ut(){return Mt.apply(this,arguments)}return ut}()})},Yi=function(pe){g.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",pe,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},eo=function(pe){pe.redo?g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:C.a.createElement("div",{className:"tc font16"},"\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"),onOk:function(){var lt=Object(w.a)(m.a.mark(function Mt(){var ut,Ot,Pt,kt;return m.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(ve.S)({id:pe.myshixun_identifier,url:pe.url});case 2:ut=Kt.sent,ut&&(Ot=Object(ie.cloneDeep)(fe==null?void 0:fe.exercise_question_types),Pt=Ot==null?void 0:Ot.findIndex(function(Jt){return Jt.question_type===5}),Ot[Pt].items.find(function(Jt){return Jt.question_id===pe.question_id}).redo=!1,Ot[Pt].items.find(function(Jt){return Jt.question_id===pe.question_id}).shixun_identifier=ut.shixun_identifier,fe.exercise_question_types=Ot,Ft(fe),kt=Object(f.a)(Object(f.a)({},pe),{},{shixun_identifier:ut.shixun_identifier}),yi(kt));case 4:case"end":return Kt.stop()}},Mt)}));function tt(){return lt.apply(this,arguments)}return tt}()}):yi(pe)},xa=function(){var jt=Object(w.a)(m.a.mark(function pe(lt){var tt;return m.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:if(!lt.hack_identifier){ut.next=5;break}return ut.next=3,Object(ve.X)({id:lt.hack_identifier});case 3:tt=ut.sent,(tt==null?void 0:tt.status)===0&&(Hr("/myproblems/".concat(tt.identifier,"?type=exercises&exercisesId=").concat(it.categoryId,"&coursesId=").concat(it.coursesId,"&login=").concat(it.login,"&questionId=").concat(lt.question_id)),lr("block"));case 5:case"end":return ut.stop()}},pe)}));return function(lt){return jt.apply(this,arguments)}}(),ri=function(){var jt=Object(w.a)(m.a.mark(function pe(lt,tt,Mt,ut){var Ot,Pt;return m.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(lt){Yt.next=3;break}return console.error("handleSave no questionId params"),Yt.abrupt("return");case 3:return Yt.next=5,Object(ve.cb)({questionId:lt,exercise_choice_id:tt,answer_text:Mt});case 5:Pt=Yt.sent,(Pt==null?void 0:Pt.status)===0&&(ut&&ut());case 7:case"end":return Yt.stop()}},pe)}));return function(lt,tt,Mt,ut){return jt.apply(this,arguments)}}(),ui=function(){var jt=Object(w.a)(m.a.mark(function pe(lt){var tt,Mt;return m.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return Ot.next=2,Object(ve.V)({id:it.categoryId});case 2:if(tt=Ot.sent,tt){Ot.next=5;break}return Ot.abrupt("return");case 5:tt.question_undo!==0||tt.oj_undo!==0?(Mt="",tt.question_undo!==0&&tt.oj_undo!==0?Mt="\u6709 ".concat(tt.question_undo," \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(tt.oj_undo," \u4E2A\u7F16\u7A0B\u9898"):tt.question_undo!==0&&tt.oj_undo===0?Mt="\u6709 ".concat(tt.question_undo," \u9898\u672A\u5B8C\u6210"):tt.question_undo===0&&tt.oj_undo!==0&&(Mt="\u6709 ".concat(tt.oj_undo," \u7F16\u7A0B\u9898\u672A\u5B8C\u6210")),g.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},Mt,C.a.createElement("br",null),lt?"\u5728".concat(Be()(tt.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var Pt=Object(w.a)(m.a.mark(function Yt(){return m.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:lt?vr():bi();case 1:case"end":return Jt.stop()}},Yt)}));function kt(){return Pt.apply(this,arguments)}return kt}()})):g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u77E5\u9053\u5566",content:C.a.createElement("div",{className:"tc font16"},lt?"\u5728".concat(Be()(tt.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var Pt=Object(w.a)(m.a.mark(function Yt(){return m.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:lt?vr():bi();case 1:case"end":return Jt.stop()}},Yt)}));function kt(){return Pt.apply(this,arguments)}return kt}()});case 6:case"end":return Ot.stop()}},pe)}));return function(lt){return jt.apply(this,arguments)}}(),Nr=function(pe){return C.a.createElement("div",null,C.a.createElement(s.a,{strokeColor:{from:"#108ee9",to:"#87d068"},status:"active",percent:pe}),C.a.createElement("div",{className:"c-grey-c tc mt10 mb20"},"\u6B63\u5728\u5224\u5206\u4E2D\u2026"))},Ca=function(){var pe=0,lt=g.a.info({title:"\u4EA4\u5377\u4E2D",icon:null,className:"modal-footer-none",content:Nr(pe)}),tt=setInterval(function(){pe<=100?(pe+=2,lt.update({content:Nr(pe)})):(lt.destroy(),clearInterval(tt))},50)},bi=function(){var jt=Object(w.a)(m.a.mark(function pe(){var lt;return m.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Ca(),Mt.next=3,Object(ve.ab)({categoryId:it.categoryId,commit_method:1});case 3:lt=Mt.sent,Object(ne.b)(),V({type:"exercise/setActionTabs",payload:Object(f.a)({},{removeEventListenerExitScreen:!0})}),(lt==null?void 0:lt.status)===0&&(h.b.success(lt==null?void 0:lt.message),Pr(!1),setTimeout(function(){g.a.info({title:"\u4EA4\u5377\u6210\u529F\uFF01",okText:"\u786E\u5B9A",onOk:function(){vr()}})},3e3));case 7:case"end":return Mt.stop()}},pe)}));return function(){return jt.apply(this,arguments)}}(),to=function(){var jt=Object(w.a)(m.a.mark(function pe(lt,tt,Mt,ut){return m.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:ri(tt,lt,null,function(){fe.question_status.find(function(kt){return kt.ques_id===tt}).ques_status=lt?1:0,ut.user_answer=[],ut.user_answer.push(lt),ut.repeat_answer||(ut.israp=!0),Ft(Object(f.a)({},fe))});case 1:case"end":return Pt.stop()}},pe)}));return function(lt,tt,Mt,ut){return jt.apply(this,arguments)}}(),no=function(){var jt=Object(w.a)(m.a.mark(function pe(lt,tt,Mt,ut,Ot){return m.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:ri(ut.question_id,lt,null,function(){var Yt,Kt,Jt;ut.user_answer=[],ut.user_answer.push(lt);var yn=Ot==null||((Yt=Ot.sub_exercise_questions)===null||Yt===void 0)?void 0:Yt.filter(function(Sn){var ln;return((ln=Sn.user_answer)===null||ln===void 0?void 0:ln.length)===0});fe.question_status.find(function(Sn){return Sn.ques_id===tt}).ques_status=(yn==null?void 0:yn.length)===(Ot==null||((Kt=Ot.sub_exercise_questions)===null||Kt===void 0)?void 0:Kt.length)?0:(yn==null?void 0:yn.length)>0&&(yn==null?void 0:yn.length)<(Ot==null||((Jt=Ot.sub_exercise_questions)===null||Jt===void 0)?void 0:Jt.length)?2:1,Ft(Object(f.a)({},fe))});case 1:case"end":return kt.stop()}},pe)}));return function(lt,tt,Mt,ut,Ot){return jt.apply(this,arguments)}}(),ro=function(pe,lt,tt){ri(lt,pe,null,function(){tt.user_answer=pe,tt.repeat_answer||(tt.israp=!0),fe.question_status.find(function(Mt){return Mt.ques_id===lt}).ques_status=pe!=null&&pe.length?1:0,Ft(Object(f.a)({},fe))})},Sa=function(pe,lt,tt,Mt,ut){ri(tt,lt,pe,function(){fe.question_status.find(function(Pt){return Pt.ques_id===tt}).ques_status=Mt.every(function(Pt){return!!Pt.answer_text})?1:fe.question_status.find(function(Pt){return Pt.ques_id===tt}).ques_status=Mt.some(function(Pt){return!!Pt.answer_text})?2:0;var Ot={choice_id:lt,answer_text:pe};ut.user_answer.filter(function(Pt){return Pt.choice_id!=lt})?ut.user_answer.splice(lt-1,1,Ot):ut.user_answer.push(Ot),ut.repeat_answer||(ut.israp=!0),Ft(Object(f.a)({},fe))})},Aa=function(pe,lt,tt){ri(lt,null,pe,function(){fe.question_status.find(function(Mt){return Mt.ques_id===lt}).ques_status=pe?1:0,tt.user_answer=[],tt.user_answer.push(pe),tt.repeat_answer||(tt.israp=!0),Ft(Object(f.a)({},fe))})},di=function(pe,lt){var tt,Mt,ut,Ot,Pt,kt;return C.a.createElement("div",null,C.a.createElement(y.a.Group,{disabled:!!(fe!=null&&fe.exercise.commit_status),defaultValue:pe==null||((tt=pe.user_answer)===null||tt===void 0)?void 0:tt[0],onChange:function(Kt){return to(Kt.target.value,pe==null?void 0:pe.question_id,lt,pe)},className:pe.user_score&&"edu-radio-".concat(pe.user_score===pe.question_score?"green":"red")},pe==null||((Mt=pe.question_choices)===null||Mt===void 0)?void 0:Mt.map(function(Yt,Kt){var Jt,yn=pe.question_type==2,Sn=yn?"":"".concat(Oe[Kt],".");return C.a.createElement("div",{className:Le.a.answerWrap,key:Kt},C.a.createElement(y.a,{disabled:!pe.repeat_answer&&(pe==null||((Jt=pe.user_answer)===null||Jt===void 0)?void 0:Jt.length)>0&&!pe.israp,value:Yt==null?void 0:Yt.choice_id},C.a.createElement("span",{className:"mr3"},Sn),C.a.createElement(Re.a,{className:Le.a.renderHtml,value:Yt==null?void 0:Yt.choice_text})))})),Object(ce.s)()&&(fe==null||((ut=fe.exercise)===null||ut===void 0)?void 0:ut.answer_open)&&((fe==null||((Ot=fe.exercise)===null||Ot===void 0)?void 0:Ot.exercise_status)==3||(fe==null||((Pt=fe.exercise)===null||Pt===void 0)?void 0:Pt.user_exercise_status)==1)&&C.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",pe==null||((kt=pe.standard_answer)===null||kt===void 0)?void 0:kt.map(function(Yt,Kt){return C.a.createElement("span",null,Oe[Number(Yt)-1])})))},Ta=function(pe,lt,tt){var Mt;return C.a.createElement("div",null,pe==null||((Mt=pe.sub_exercise_questions)===null||Mt===void 0)?void 0:Mt.map(function(ut,Ot){var Pt,kt,Yt,Kt,Jt,yn;return C.a.createElement("div",null,C.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},C.a.createElement("span",{style:{flexShrink:0},className:"font18"},tt+1+"."+(Ot+1),"\uFF08\u5355\u9009\u9898\uFF09"),C.a.createElement(Re.a,{value:ut==null?void 0:ut.question_title}),C.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ut==null?void 0:ut.question_score,"\u5206\uFF09")),C.a.createElement(y.a.Group,{disabled:!!(fe!=null&&fe.exercise.commit_status),defaultValue:ut==null||((Pt=ut.user_answer)===null||Pt===void 0)?void 0:Pt[0],onChange:function(ln){return no(ln.target.value,pe==null?void 0:pe.question_id,Ot,ut,pe)},className:ut.user_score&&"edu-radio-".concat(ut.user_score===ut.question_score?"green":"red")},ut==null||((kt=ut.question_choices)===null||kt===void 0)?void 0:kt.map(function(Sn,ln){var ur,Dr=ut.question_type==2,ci=Dr?"":"".concat(Oe[ln],".");return C.a.createElement("div",{className:Le.a.answerWrap,key:ln},C.a.createElement(y.a,{disabled:!ut.repeat_answer&&(ut==null||((ur=ut.user_answer)===null||ur===void 0)?void 0:ur.length)>0,value:Sn==null?void 0:Sn.choice_id},C.a.createElement("span",{className:"mr3"},ci),C.a.createElement(Re.a,{className:Le.a.renderHtml,value:Sn==null?void 0:Sn.choice_text})))})),Object(ce.s)()&&(fe==null||((Yt=fe.exercise)===null||Yt===void 0)?void 0:Yt.answer_open)&&((fe==null||((Kt=fe.exercise)===null||Kt===void 0)?void 0:Kt.exercise_status)==3||(fe==null||((Jt=fe.exercise)===null||Jt===void 0)?void 0:Jt.user_exercise_status)==1)&&C.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",ut==null||((yn=ut.standard_answer)===null||yn===void 0)?void 0:yn.map(function(Sn,ln){return C.a.createElement("span",null,Oe[Number(Sn)-1])})))}))},wa=function(pe,lt){var tt,Mt,ut,Ot;return C.a.createElement("div",null,C.a.createElement(_.a.Group,{disabled:!!(fe!=null&&fe.exercise.commit_status),defaultValue:pe==null?void 0:pe.user_answer,onChange:function(kt){return ro(kt,pe==null?void 0:pe.question_id,pe)},className:pe.user_score&&"edu-checkbox-".concat(pe.user_score===pe.question_score?"green":"red")},pe==null||((tt=pe.question_choices)===null||tt===void 0)?void 0:tt.map(function(Pt,kt){var Yt,Kt="".concat(Oe[kt],".");return C.a.createElement("div",{className:Le.a.answerWrap},C.a.createElement(_.a,{disabled:!pe.repeat_answer&&(pe==null||((Yt=pe.user_answer)===null||Yt===void 0)?void 0:Yt.length)>0&&!pe.israp,value:Pt==null?void 0:Pt.choice_id},C.a.createElement("span",{className:"mr3"},Kt),C.a.createElement(Re.a,{className:Le.a.renderHtml,value:Pt==null?void 0:Pt.choice_text})))})),Object(ce.s)()&&(fe==null||((Mt=fe.exercise)===null||Mt===void 0)?void 0:Mt.answer_open)&&(fe==null||((ut=fe.exercise)===null||ut===void 0)?void 0:ut.exercise_status)==3&&C.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",pe==null||((Ot=pe.standard_answer)===null||Ot===void 0)?void 0:Ot.map(function(Pt,kt){return C.a.createElement("span",null,Oe[Number(Pt)-1])})))},Ji=function(pe,lt){return C.a.createElement(Fe,{item:pe,answerData:fe,onBlur:function(Mt,ut,Ot){return Sa(Mt,ut,pe==null?void 0:pe.question_id,Ot,pe)}})},Oi=function(pe,lt){return C.a.createElement(He,{item:pe,answerData:fe,onBlur:function(Mt){return Aa(Mt,pe==null?void 0:pe.question_id,pe)}})},Ra=function(pe,lt){return C.a.createElement(Et,{item:pe,answerData:fe})},Zi=function(pe,lt){return C.a.createElement(_e,{item:pe,answerData:fe})},Zn=function(pe,lt,tt){var Mt,ut,Ot=fe==null||((Mt=fe.exercise_question_types)===null||Mt===void 0)?void 0:Mt.find(function(Pt){return Pt.question_type===lt});return C.a.createElement(C.a.Fragment,null,C.a.createElement("h1",{className:"font14 current",onClick:function(){gr[lt]=!gr[lt],Qn(Object(f.a)({},gr))}},!gr[lt]&&C.a.createElement(j.a,null),gr[lt]&&C.a.createElement($.a,null),C.a.createElement("span",{className:"ml5 c-grey-666"},pe)),C.a.createElement("ul",{className:Le.a.answerSheet,key:lt},!gr[lt]&&(Ot==null||((ut=Ot.items)===null||ut===void 0)?void 0:ut.map(function(Pt,kt){if(Pt.question_type===lt){var Yt,Kt;return C.a.createElement("li",{onClick:function(){var yn;if(fe.exercise_question_types[It].items[rn].israp=!1,Ft(Object(f.a)({},fe)),!qr&&(fe==null||((yn=fe.exercise)===null||yn===void 0)?void 0:yn.user_exercise_status)===0&&Object(ce.s)()){var Sn,ln,ur,Dr;if(!((Sn=fe.exercise_question_types)!==null&&Sn!==void 0&&(ln=Sn[It])!==null&&ln!==void 0&&(ur=ln.items)!==null&&ur!==void 0&&(Dr=ur[rn])!==null&&Dr!==void 0&&Dr.repeat_answer)){Jn(!0),Vi(3),Za({oneindex:tt,twoindex:kt});return}}fr(tt),zn(kt);var ci="Anchor_".concat(lt,"_").concat(kt),Da=document.getElementById(ci);Da&&setTimeout(function(){return Da.scrollIntoView({block:"start",behavior:"smooth"})})},key:kt,className:(fe==null||((Yt=fe.question_status)===null||Yt===void 0)?void 0:Yt.some(function(Jt){return Jt.ques_id===Pt.question_id&&(Jt==null?void 0:Jt.ques_status)===1}))&&Le.a.active},kt+1,(fe==null||((Kt=fe.question_status)===null||Kt===void 0)?void 0:Kt.some(function(Jt){return Jt.ques_id===Pt.question_id&&(Jt==null?void 0:Jt.ques_status)===2}))&&C.a.createElement("div",{style:{height:3,background:"#0152d9",position:"absolute",width:26,bottom:0}}))}}))))},_a=function(pe,lt){var tt,Mt,ut,Ot,Pt,kt,Yt=(pe==null?void 0:pe.question_type)==5?pe==null?void 0:pe.shixun_name:pe==null?void 0:pe.question_title;return C.a.createElement("div",{className:Le.a.questionItem,id:"Anchor_".concat(pe==null?void 0:pe.question_type,"_").concat(lt)},C.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},C.a.createElement("span",{style:{flexShrink:0},className:"font18"},lt+1,"."),C.a.createElement(Re.a,{value:pe==null?void 0:pe.question_title}),C.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",(pe==null?void 0:pe.question_type)===7?"\u5171".concat(pe==null||((tt=pe.sub_exercise_questions)===null||tt===void 0)?void 0:tt.length,"\u5C0F\u9898\uFF0C"):"",pe==null?void 0:pe.question_score,"\u5206\uFF09"),!(pe!=null&&pe.repeat_answer)&&C.a.createElement("span",{style:{color:"#FA6400 ",marginLeft:10,fontSize:16}},"\u6CE8\u610F\uFF1A\u8BE5\u9898\u4E0D\u5141\u8BB8\u91CD\u590D\u7B54\u9898"),!!(pe!=null&&(Mt=pe.schools)!==null&&Mt!==void 0&&Mt.length)&&C.a.createElement(R.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},C.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 line24 font18 c-orange"}))),(pe==null?void 0:pe.question_type)==0&&di(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==2&&di(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==1&&wa(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==3&&Ji(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==4&&Oi(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==5&&Ra(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==6&&Zi(pe,pe==null?void 0:pe.question_type),(pe==null?void 0:pe.question_type)==7&&Ta(pe,pe==null?void 0:pe.question_type,lt),!!(pe!=null&&(ut=pe.answer_comments)!==null&&ut!==void 0&&ut.length)&&C.a.createElement("div",{className:"mt30"},pe==null||((Ot=pe.answer_comments)===null||Ot===void 0)?void 0:Ot.map(function(Kt,Jt){var yn,Sn;return C.a.createElement("div",null,C.a.createElement(B.a,{align:"middle",gutter:[0,10]},C.a.createElement(D.a,{flex:"50px"},C.a.createElement("img",{src:re.a.API_SERVER+"/images/"+((yn=Kt.user)===null||yn===void 0?void 0:yn.image_url),width:"40",style:{borderRadius:40}})),C.a.createElement(D.a,{flex:"1"},Kt.updated_at,C.a.createElement("br",null),(Sn=Kt.user)===null||Sn===void 0?void 0:Sn.name),C.a.createElement(D.a,{className:"c-grey-c"},Kt.shixun_chanllge_position&&C.a.createElement("span",null,"\u7B2C",Kt.shixun_chanllge_position,"\u5173"),pe.question_type!==4&&C.a.createElement("span",null,"\u539F\u59CB\u5F97\u5206",Kt.origin_score,"\u5206 \uFF0C")," \u4FEE\u6B63\u4E3A",Kt.score,"\u5206")),Kt.comment&&C.a.createElement(B.a,{align:"middle",gutter:[0,10]},C.a.createElement(D.a,{flex:"50px"}),C.a.createElement(D.a,{flex:"1"},C.a.createElement(ue,{autoSize:!0,value:Kt.comment,disabled:!0}))))})),C.a.createElement("div",{className:Le.a.itemType},C.a.createElement(B.a,null,C.a.createElement(D.a,{flex:"1"}),C.a.createElement(D.a,null,(pe==null?void 0:pe.question_type)<3&&(pe==null?void 0:pe.standard_answer_show)&&C.a.createElement("span",{className:"font16 ml20"},"\u6B63\u786E\u7B54\u6848\uFF1A",pe==null?void 0:pe.standard_answer_show),C.a.createElement("span",{className:"font16 ml20"},(pe==null?void 0:pe.user_score)!==null&&(pe==null?void 0:pe.user_score)>=0&&C.a.createElement("span",null,C.a.createElement("span",{className:yt[Number(pe==null?void 0:pe.answer_status)]||"c-orange-ff9"},pe==null?void 0:pe.user_score)," \u5206")),(pe==null?void 0:pe.question_type)==5&&!((Pt=fe.exercise)!==null&&Pt!==void 0&&Pt.commit_status)&&C.a.createElement(O.a,{type:"primary",className:"font16 ml20",onClick:function(){return eo(pe)}},"\u8FDB\u5165\u7B54\u9898"),(pe==null?void 0:pe.question_type)==6&&!((kt=fe.exercise)!==null&&kt!==void 0&&kt.commit_status)&&C.a.createElement(O.a,{type:"primary",className:"font16 ml20",onClick:function(){return xa(pe)}},"\u8FDB\u5165\u7B54\u9898")))))},qi=function(pe,lt){return C.a.createElement(L.Fragment,null,pe.question_type===0&&Zn("\u5355\u9009\u9898",0,lt),pe.question_type===1&&Zn("\u591A\u9009\u9898",1,lt),pe.question_type===2&&Zn("\u5224\u65AD\u9898",2,lt),pe.question_type===3&&Zn("\u586B\u7A7A\u9898",3,lt),pe.question_type===4&&Zn("\u7B80\u7B54\u9898",4,lt),pe.question_type===5&&Zn("\u5B9E\u8BAD\u9898",5,lt),pe.question_type===6&&Zn("\u7F16\u7A0B\u9898",6,lt),pe.question_type===7&&Zn("\u7EC4\u5408\u9898",7,lt))},$i=function(pe){var lt=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],tt=["","\u5341","\u767E","\u5343","\u4E07"];pe=parseInt(pe);var Mt=function(kt){for(var Yt=kt.toString().split("").reverse(),Kt="",Jt=0;Jt<Yt.length;Jt++)Kt=(Jt==0&&Yt[Jt]==0||Jt>0&&Yt[Jt]==0&&Yt[Jt-1]==0?"":lt[Yt[Jt]]+(Yt[Jt]==0?tt[0]:tt[Jt]))+Kt;return Kt},ut=Math.floor(pe/1e4),Ot=pe%1e4;return Ot.toString().length<4&&(Ot="0"+Ot),ut?Mt(ut)+"\u4E07"+Mt(Ot):Mt(pe)},Oa=function(){var pe,lt,tt,Mt,ut,Ot,Pt,kt,Yt,Kt,Jt,yn,Sn;return C.a.createElement(L.Fragment,{key:It},C.a.createElement("div",{className:"pt20"},C.a.createElement("span",{className:"font16 c-light-primary"},$i(It+1),"\u3001",fe==null||((pe=fe.exercise_question_types)===null||pe===void 0||((lt=pe[It])===null||lt===void 0))?void 0:lt.name),C.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",fe==null||((tt=fe.exercise_question_types)===null||tt===void 0||((Mt=tt[It])===null||Mt===void 0))?void 0:Mt.count,"\u9898\uFF1B",(fe==null||((ut=fe.exercise_question_types)===null||ut===void 0||((Ot=ut[It])===null||Ot===void 0))?void 0:Ot.question_type)===7?"\u5305\u542B".concat(fe==null||((Pt=fe.exercise_question_types)===null||Pt===void 0||((kt=Pt[It])===null||kt===void 0))?void 0:kt.sub_questions_count,"\u5C0F\u9898"):""," \u5171",fe==null||((Yt=fe.exercise_question_types)===null||Yt===void 0||((Kt=Yt[It])===null||Kt===void 0))?void 0:Kt.score,"\u5206\uFF09")),C.a.createElement(L.Fragment,{key:rn},_a(fe==null||((Jt=fe.exercise_question_types)===null||Jt===void 0||((yn=Jt[It])===null||yn===void 0||((Sn=yn.items)===null||Sn===void 0)))?void 0:Sn[rn],rn)))};return C.a.createElement(X.a,{size:"large",spinning:kr},on&&C.a.createElement(Ee.a,{iframe:un}),C.a.createElement("iframe",{style:{display:Jr},id:"iframeShixuns",className:Le.a.iframe,src:sr,ref:un,frameBorder:"0"}),C.a.createElement("section",{className:"edu-container"},C.a.createElement("section",{className:"animated fadeIn"},C.a.createElement("aside",{className:"mt10"},A.showHeaderFooter&&it.coursesId!=="coursesId"&&C.a.createElement(Q.a,{separator:">"},C.a.createElement(Q.a.Item,null,C.a.createElement(J.a,{to:"/classrooms/".concat(it.coursesId,"/exercise")},(ae=Y.userInfo)===null||ae===void 0||((de=ae.course)===null||de===void 0)?void 0:de.course_name)),C.a.createElement(Q.a.Item,null,C.a.createElement(J.a,{to:"/classrooms/".concat(it.coursesId,"/exercise")},"\u8BD5\u5377")),C.a.createElement(Q.a.Item,null,C.a.createElement(J.a,{to:"/classrooms/".concat(it.coursesId,"/exercise/").concat(it.categoryId,"/detail")},"\u8BD5\u5377\u8BE6\u60C5")),C.a.createElement(Q.a.Item,null,(Ye=Y.userInfo)===null||Ye===void 0?void 0:Ye.real_name)),A.showHeaderFooter&&it.coursesId==="coursesId"&&C.a.createElement(Q.a,{separator:">"},C.a.createElement(Q.a.Item,null,C.a.createElement(J.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),C.a.createElement(Q.a.Item,null,(Me=Y.userInfo)===null||Me===void 0?void 0:Me.real_name))),C.a.createElement("aside",{className:[Le.a.title,"mt10"].join(" ")},C.a.createElement(B.a,{style:{width:"100%"},align:"middle"},C.a.createElement(D.a,{flex:"1"},C.a.createElement("div",{className:Le.a.title},(A==null?void 0:A.showHeaderFooter)&&C.a.createElement(J.a,{to:it.coursesId==="coursesId"?"/paperlibrary":"/classrooms/".concat(it.coursesId,"/exercise/").concat(it.categoryId,"/detail")},C.a.createElement(se.a,{className:"font16 c-black"})),C.a.createElement("strong",{className:"font24 ml5"},fe==null||((Xe=fe.exercise)===null||Xe===void 0)?void 0:Xe.exercise_name),(fe==null||((dt=fe.exercise)===null||dt===void 0)?void 0:dt.is_random)&&C.a.createElement("span",{className:Le.a.randomFlag},"\u968F\u673A"),C.a.createElement(Ue.k,{status:[Ue.c[99]]}))),C.a.createElement(D.a,{style:{display:"flex"}},(fe==null||((Pe=fe.user_score)===null||Pe===void 0)?void 0:Pe.length)&&C.a.createElement("div",null,"\u6A21\u62DF\u8003\u8BD5\u603B\u5F97\u5206\uFF1A",C.a.createElement("span",{className:"c-red"},fe==null?void 0:fe.user_score)," \u5206"),!!(fe!=null&&(at=fe.exercise)!==null&&at!==void 0&&at.time)&&!(fe!=null&&(vt=fe.exercise)!==null&&vt!==void 0&&vt.commit_status)&&C.a.createElement("aside",{className:"".concat(Le.a.countDown," ").concat(Ht)},"\u5269\u4F59\u65F6\u95F4:",C.a.createElement(oe,{value:fn,onFinish:ni})),!(fe!=null&&(St=fe.exercise)!==null&&St!==void 0&&St.commit_status)&&C.a.createElement(O.a,{className:Le.a.submitButton,style:{marginLeft:20},type:"primary",onClick:function(){return ui(!1)}},"\u4EA4\u5377"))))),pn.status===0&&C.a.createElement(B.a,{className:"mt10"},C.a.createElement(D.a,{flex:Rr?"316px":"16px"},C.a.createElement("section",{style:{position:"sticky",top:0,zIndex:1}},Fr&&C.a.createElement(me.a,{number:(fe==null||((Rt=fe.exercise)===null||Rt===void 0)?void 0:Rt.photo_count)-(fe==null||((qt=fe.exercise)===null||qt===void 0)?void 0:qt.take_photo),time:(sn=fe.exercise)===null||sn===void 0?void 0:sn.left_time,update:ei,supportCamera:function(pe){pe===2?(ei(),Mn(Hn==null?void 0:Hn.screen_open)):pe===1&&setTimeout(function(){return Ae.history.push("/")},3e3)}}),C.a.createElement("div",{className:"relative",style:{minHeight:236}},Rr&&C.a.createElement("aside",{className:"bg-white p16"},C.a.createElement(B.a,null,C.a.createElement(D.a,{span:8},C.a.createElement("span",{className:"font16 blod"},"\u7B54\u9898\u5361")),C.a.createElement(D.a,{span:16},C.a.createElement("div",{className:"tr",style:{display:"flex",alignItems:"center",justifyContent:"end"}},C.a.createElement("span",{className:Le.a.answerYes}),"\u5DF2\u7B54",C.a.createElement("span",{style:{width:13,height:13,display:"flex",flexDirection:"column-reverse"},className:"".concat(Le.a.answerNo," ml10")},C.a.createElement("div",{style:{height:"10%",background:"#0152d9"}})),"\u90E8\u5206\u7B54\u9898",C.a.createElement("span",{className:"".concat(Le.a.answerNo," ml10")}),"\u672A\u7B54"))),C.a.createElement("aside",{className:Le.a.answerInfo},C.a.createElement(B.a,null,C.a.createElement(C.a.Fragment,null,C.a.createElement(D.a,{span:12},"\u7B54\u9898\u8FDB\u5EA6"),C.a.createElement(D.a,{span:12,className:"tr c-blue"},fe==null||((Xt=fe.question_status)===null||Xt===void 0||((_t=Xt.filter(function(jt){return(jt==null?void 0:jt.ques_status)===1}))===null||_t===void 0))?void 0:_t.length," / ",fe==null||((cn=fe.exercise_types)===null||cn===void 0)?void 0:cn.q_counts),C.a.createElement(D.a,{span:24},C.a.createElement(s.a,{trailColor:"#c3ced2",percent:(fe==null||((zt=fe.question_status)===null||zt===void 0||(($t=zt.filter(function(jt){return(jt==null?void 0:jt.ques_status)===1}))===null||$t===void 0))?void 0:$t.length)/(fe==null||((Nt=fe.exercise_types)===null||Nt===void 0)?void 0:Nt.q_counts)*100,showInfo:!1}))),C.a.createElement(D.a,null,C.a.createElement("span",{className:"c-grey-333"},"\u5171 ",C.a.createElement("span",{className:"c-blue-4ca"},(fe==null||((nn=fe.exercise_types)===null||nn===void 0)?void 0:nn.q_counts)||(fe==null||((An=fe.exercise_scores)===null||An===void 0||((Tn=An.exercise_types)===null||Tn===void 0))?void 0:Tn.q_counts))," \u9898\uFF1A"),C.a.createElement("span",{className:"c-grey-333"},"\u6EE1\u5206 ",C.a.createElement("span",{className:"c-blue-4ca"},(fe==null||((ct=fe.exercise_types)===null||ct===void 0)?void 0:ct.q_scores)||(fe==null||((Gt=fe.exercise_scores)===null||Gt===void 0||((Ln=Gt.exercise_types)===null||Ln===void 0))?void 0:Ln.q_scores))," \u5206")))),C.a.createElement(B.a,null,C.a.createElement(D.a,{flex:"1"},C.a.createElement("aside",{className:Le.a.cardList},fe==null||((Fn=fe.exercise_question_types)===null||Fn===void 0)?void 0:Fn.map(function(jt,pe){return C.a.createElement(L.Fragment,{key:jt.question_type},qi(jt,pe))}))))),C.a.createElement("div",{className:Le.a.fold,onClick:function(){return Qr(!Rr)}},Rr&&C.a.createElement("span",{className:"icon-zuojiantou iconfont c-grey-c"}),!Rr&&C.a.createElement("span",{className:"icon-youjiantou iconfont c-grey-c"}))))),C.a.createElement(D.a,{flex:"1"},C.a.createElement("section",{className:[Le.a.bg,"pl30","pr30","pb30","mb50","ml20"].join(" ")},C.a.createElement("div",{style:{maxHeight:600,overflow:"hidden auto"}},Oa()),C.a.createElement("div",{style:{marginTop:60,textAlign:"center"}},(It!=0||rn!=0)&&C.a.createElement(O.a,{className:"".concat(Le.a.submitButton," mr10"),type:"default",onClick:function(){var pe;if(fe.exercise_question_types[It].items[rn].israp=!1,Ft(Object(f.a)({},fe)),!qr&&(fe==null||((pe=fe.exercise)===null||pe===void 0)?void 0:pe.user_exercise_status)===0&&Object(ce.s)()){var lt,tt,Mt,ut;if(!((lt=fe.exercise_question_types)!==null&<!==void 0&&(tt=lt[It])!==null&&tt!==void 0&&(Mt=tt.items)!==null&&Mt!==void 0&&(ut=Mt[rn])!==null&&ut!==void 0&&ut.repeat_answer)){Jn(!0),Vi(1);return}}rn===0?(It-=1,rn=fe.exercise_question_types[It].items.length-1):rn-=1,fr(It),zn(rn)}},"\u4E0A\u4E00\u9898"),!(It===(fe==null||((kn=fe.exercise_question_types)===null||kn===void 0)?void 0:kn.length)-1&&rn===(fe==null||((Xn=fe.exercise_question_types)===null||Xn===void 0||((G=Xn[It])===null||G===void 0||((p=G.items)===null||p===void 0)))?void 0:p.length)-1)&&C.a.createElement(O.a,{className:Le.a.submitButton,type:"primary",onClick:function(){var pe;if(fe.exercise_question_types[It].items[rn].israp=!1,Ft(Object(f.a)({},fe)),!qr&&(fe==null||((pe=fe.exercise)===null||pe===void 0)?void 0:pe.user_exercise_status)===0&&Object(ce.s)()){var lt,tt,Mt,ut;if(!((lt=fe.exercise_question_types)!==null&<!==void 0&&(tt=lt[It])!==null&&tt!==void 0&&(Mt=tt.items)!==null&&Mt!==void 0&&(ut=Mt[rn])!==null&&ut!==void 0&&ut.repeat_answer)){Jn(!0),Vi(2);return}}fe.exercise_question_types[It].items.length-1===rn?(It=It+1,rn=0):rn=rn+1,fr(It),zn(rn)}},"\u4E0B\u4E00\u9898")))),C.a.createElement(g.a,{title:"\u6CE8\u610F",visible:bn,onCancel:function(){return Jn(!1)},footer:!1},C.a.createElement("div",null,C.a.createElement("p",{style:{marginBottom:0}},"\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"),C.a.createElement("div",{style:{marginTop:60,display:"flex",justifyContent:"space-between"}},C.a.createElement(_.a,{checked:qr,onChange:function(pe){wi(pe.target.checked)}},"\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"),C.a.createElement("div",null,C.a.createElement(O.a,{onClick:function(){fe.exercise_question_types[It].items[rn].israp?(fe.exercise_question_types[It].items[rn].israp=!0,Ft(Object(f.a)({},fe))):fe.exercise_question_types[It].items[rn].israp===""&&(fe.exercise_question_types[It].items[rn].israp=!0,Ft(Object(f.a)({},fe)))}},"\u6211\u518D\u60F3\u60F3"),C.a.createElement(O.a,{onClick:function(){fe.exercise_question_types[It].items[rn].israp=!1,Ft(Object(f.a)({},fe)),Gi===1?(rn===0?(It-=1,rn=fe.exercise_question_types[It].items.length-1):rn-=1,console.log(fe.exercise_question_types[It].items[rn],"-----"),fr(It),zn(rn)):Gi===2?(fe.exercise_question_types[It].items.length-1===rn?(It=It+1,rn=0):rn=rn+1,fr(It),zn(rn)):(fr(Qi.oneindex),zn(Qi.twoindex)),Jn(!1)},type:"primary",style:{marginLeft:30}},"\u786E\u8BA4")))))),pn.status!==0&&C.a.createElement(ge,{data:pn})))},pt=ke.default=Object(W.a)(function(Qe){var ze=Qe.loading,De=Qe.user,ae=Qe.globalSetting;return{globalSetting:ae,user:De,loading:ze.effects}})(xt)},cRFk:function($e,ke,F){$e.exports=F.p+"static/RepositoryNoneData.828085a8.png"},csWT:function($e,ke,F){$e.exports=F.p+"static/choose.4ad1045f.svg"},dejd:function($e,ke,F){},djh8:function($e,ke,F){$e.exports=F.p+"static/qrCode.42927872.png"},dmUQ:function($e,ke,F){"use strict";var ee=F("Ff2n"),X=F("rePB"),k=F("1OyB"),Q=F("vuIU"),N=F("Ji7U"),O=F("md7G"),U=F("foSv"),B=F("q1tI"),I=F.n(B),D=F("TSYQ"),E=F.n(D),R=F("4IlW");function P(a,i){var x=Object.keys(a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(a);i&&(b=b.filter(function(m){return Object.getOwnPropertyDescriptor(a,m).enumerable})),x.push.apply(x,b)}return x}function _(a){for(var i=1;i<arguments.length;i++){var x=arguments[i]!=null?arguments[i]:{};i%2?P(Object(x),!0).forEach(function(b){Object(X.a)(a,b,x[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(x)):P(Object(x)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(x,b))})}return a}function S(a){var i=y();return function(){var b=Object(U.a)(a),m;if(i){var L=Object(U.a)(this).constructor;m=Reflect.construct(b,arguments,L)}else m=b.apply(this,arguments);return Object(O.a)(this,m)}}function y(){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(a){return!1}}function d(){}function s(a){a.preventDefault()}var u=function(i){return i.replace(/[^\w.-]+/g,"")},h=200,T=600,g=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,f=function(i){return i!=null},w=function(i,x){return x===i||typeof x=="number"&&typeof i=="number"&&isNaN(x)&&isNaN(i)},v=function(a){Object(N.a)(x,a);var i=S(x);function x(b){var m;Object(k.a)(this,x),m=i.call(this,b),m.onKeyDown=function(H){var J=m.props,W=J.onKeyDown,j=J.onPressEnter;if(H.keyCode===R.a.UP){var $=m.getRatio(H);m.up(H,$,null),m.stop()}else if(H.keyCode===R.a.DOWN){var se=m.getRatio(H);m.down(H,se,null),m.stop()}else H.keyCode===R.a.ENTER&&j&&j(H);if(m.recordCursorPosition(),m.lastKeyCode=H.keyCode,W){for(var me=arguments.length,Ee=new Array(me>1?me-1:0),We=1;We<me;We++)Ee[We-1]=arguments[We];W.apply(void 0,[H].concat(Ee))}},m.onKeyUp=function(H){var J=m.props.onKeyUp;if(m.stop(),m.recordCursorPosition(),J){for(var W=arguments.length,j=new Array(W>1?W-1:0),$=1;$<W;$++)j[$-1]=arguments[$];J.apply(void 0,[H].concat(j))}},m.onChange=function(H){var J=m.props.onChange;m.state.focused&&(m.inputting=!0),m.rawInput=m.props.parser(m.getValueFromEvent(H)),m.setState({inputValue:m.rawInput}),J(m.toNumber(m.rawInput))},m.onMouseUp=function(){var H=m.props.onMouseUp;m.recordCursorPosition(),H&&H.apply(void 0,arguments)},m.onFocus=function(){var H;m.setState({focused:!0}),(H=m.props).onFocus.apply(H,arguments)},m.onBlur=function(){var H=m.props.onBlur;m.inputting=!1,m.setState({focused:!1});var J=m.getCurrentValidValue(m.state.inputValue),W=m.setValue(J,d);if(H){var j=m.input.value,$=m.getInputDisplayValue({focus:!1,value:W});m.input.value=$&&Number($),H.apply(void 0,arguments),m.input.value=j}},m.getRatio=function(H){var J=1;return H.metaKey||H.ctrlKey?J=.1:H.shiftKey&&(J=10),J},m.getFullNum=function(H){return isNaN(H)?H:/e/i.test(String(H))?Number(H).toFixed(18).replace(/\.?0+$/,""):H},m.getPrecision=function(H){if(f(m.props.precision))return m.props.precision;var J=String(H);if(J.indexOf("e-")>=0)return parseInt(J.slice(J.indexOf("e-")+2),10);var W=0;return J.indexOf(".")>=0&&(W=J.length-J.indexOf(".")-1),W},m.getInputDisplayValue=function(H){var J=H||m.state,W=J.focused,j=J.inputValue,$=J.value,se;W?se=j:se=m.toPrecisionAsStep($),se==null&&(se="");var me=m.formatWrapper(se);return f(m.props.decimalSeparator)&&(me=me.toString().replace(".",m.props.decimalSeparator)),me},m.recordCursorPosition=function(){try{m.cursorStart=m.input.selectionStart,m.cursorEnd=m.input.selectionEnd,m.currentValue=m.input.value,m.cursorBefore=m.input.value.substring(0,m.cursorStart),m.cursorAfter=m.input.value.substring(m.cursorEnd)}catch(H){}},m.restoreByAfter=function(H){if(H===void 0)return!1;var J=m.input.value,W=J.lastIndexOf(H);if(W===-1)return!1;var j=m.cursorBefore.length;return m.lastKeyCode===R.a.DELETE&&m.cursorBefore.charAt(j-1)===H[0]?(m.fixCaret(j,j),!0):W+H.length===J.length?(m.fixCaret(W,W),!0):!1},m.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(J,W){var j=H.substring(W);return m.restoreByAfter(j)})},m.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},m.stop=function(){m.autoStepTimer&&clearTimeout(m.autoStepTimer)},m.down=function(H,J,W){m.pressingUpOrDown=!0,m.step("down",H,J,W)},m.up=function(H,J,W){m.pressingUpOrDown=!0,m.step("up",H,J,W)},m.saveInput=function(H){m.input=H};var L=b.value;L===void 0&&(L=b.defaultValue),m.state={focused:b.autoFocus};var C=m.getValidValue(m.toNumber(L));return m.state=_(_({},m.state),{},{inputValue:m.toPrecisionAsStep(C),value:C}),m}return Object(Q.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(m){var L=this.props,C=L.value,H=L.onChange,J=L.max,W=L.min,j=this.state.focused;if(m){if(!w(m.value,C)||!w(m.max,J)||!w(m.min,W)){var $=j?C:this.getValidValue(C),se;this.pressingUpOrDown?se=$:this.inputting?se=this.rawInput:se=this.toPrecisionAsStep($),this.setState({value:$,inputValue:se})}var me="value"in this.props?C:this.state.value;"max"in this.props&&m.max!==J&&typeof me=="number"&&me>J&&H&&H(J),"min"in this.props&&m.min!==W&&typeof me=="number"&&me<W&&H&&H(W)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===R.a.BACKSPACE?Ee=this.cursorStart-1:this.lastKeyCode===R.a.DELETE&&(Ee=this.cursorStart):Ee=this.input.value.length,this.fixCaret(Ee,Ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case R.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case R.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(We){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(m){var L=m;return L===""?L="":this.isNotCompleteNumber(parseFloat(L))?L=this.state.value:L=this.getValidValue(L),this.toNumber(L)}},{key:"getValueFromEvent",value:function(m){var L=m.target.value.trim().replace(/。/g,".");return f(this.props.decimalSeparator)&&(L=L.replace(this.props.decimalSeparator,".")),L}},{key:"getValidValue",value:function(m){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(m);return isNaN(H)?m:(H<L&&(H=L),H>C&&(H=C),H)}},{key:"setValue",value:function(m,L){var C=this.props.precision,H=this.isNotCompleteNumber(parseFloat(m))?null:parseFloat(m),J=this.state.value,W=J===void 0?null:J,j=this.state.inputValue,$=j===void 0?null:j,se=typeof H=="number"?H.toFixed(C):"".concat(H),me=H!==W||se!=="".concat($);return"value"in this.props?($=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:$},L)):this.setState({value:H,inputValue:this.toPrecisionAsStep(m)},L),me&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(m){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,C=this.props,H=C.precision,J=C.step;if(f(H))return H;var W=this.getPrecision(L),j=this.getPrecision(J),$=this.getPrecision(m);return m?Math.max($,W+j):W+j}},{key:"getPrecisionFactor",value:function(m){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,C=this.getMaxPrecision(m,L);return Math.pow(10,C)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(m){return this.props.formatter?this.props.formatter(m):m}},{key:"toPrecisionAsStep",value:function(m){if(this.isNotCompleteNumber(m)||m==="")return m;var L=Math.abs(this.getMaxPrecision(m));return isNaN(L)?m.toString():Number(m).toFixed(L)}},{key:"toNumber",value:function(m){var L=this.props.precision,C=this.state.focused,H=m&&m.length>16&&C;return this.isNotCompleteNumber(m)||H?m:f(L)?Math.round(m*Math.pow(10,L))/Math.pow(10,L):Number(m)}},{key:"upStep",value:function(m,L){var C=this.props.step,H=this.getPrecisionFactor(m,L),J=Math.abs(this.getMaxPrecision(m,L)),W=((H*m+H*C*L)/H).toFixed(J);return this.toNumber(W)}},{key:"downStep",value:function(m,L){var C=this.props.step,H=this.getPrecisionFactor(m,L),J=Math.abs(this.getMaxPrecision(m,L)),W=((H*m-H*C*L)/H).toFixed(J);return this.toNumber(W)}},{key:"step",value:function(m,L){var C=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,J=arguments.length>3?arguments[3]:void 0;this.stop(),L&&(L.persist(),L.preventDefault());var W=this.props;if(W.disabled)return;var j=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(j))return;var $=this["".concat(m,"Step")](j,H),se=$>W.max||$<W.min;if($>W.max?$=W.max:$<W.min&&($=W.min),this.setValue($,null),this.setState({focused:!0},function(){C.pressingUpOrDown=!1}),se)return;this.autoStepTimer=setTimeout(function(){C[m](L,H,!0)},J?h:T)}},{key:"fixCaret",value:function(m,L){if(m===void 0||L===void 0||!this.input||!this.input.value)return;try{var C=this.input.selectionStart,H=this.input.selectionEnd;(m!==C||L!==H)&&this.input.setSelectionRange(m,L)}catch(J){}}},{key:"render",value:function(){var m,L=this.props,C=L.prefixCls,H=L.disabled,J=L.readOnly,W=L.useTouch,j=L.autoComplete,$=L.upHandler,se=L.downHandler,me=L.className,Ee=L.max,We=L.min,Be=L.style,Ne=L.title,Le=L.onMouseEnter,Ue=L.onMouseLeave,ye=L.onMouseOver,ce=L.onMouseOut,ne=L.required,ve=L.onClick,le=L.tabIndex,Re=L.type,Ie=L.placeholder,Ce=L.id,He=L.inputMode,Ze=L.pattern,ot=L.step,et=L.maxLength,Ke=L.autoFocus,Ve=L.name,ht=L.onPaste,mt=L.onInput,gt=Object(ee.a)(L,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Et=this.state,ft=Et.value,Ct=Et.focused,_e=E()(C,(m={},Object(X.a)(m,me,!!me),Object(X.a)(m,"".concat(C,"-disabled"),H),Object(X.a)(m,"".concat(C,"-focused"),Ct),m)),Se={};Object.keys(gt).forEach(function(ue){(ue.substr(0,5)==="data-"||ue.substr(0,5)==="aria-"||ue==="role")&&(Se[ue]=gt[ue])});var Je=!J&&!H,nt=this.getInputDisplayValue(null),Fe=(ft||ft===0)&&(isNaN(ft)||Number(ft)>=Ee),qe=(ft||ft===0)&&(isNaN(ft)||Number(ft)<=We),xe=Fe||H||J,he=qe||H||J,ge=E()("".concat(C,"-handler"),"".concat(C,"-handler-up"),Object(X.a)({},"".concat(C,"-handler-up-disabled"),xe)),re=E()("".concat(C,"-handler"),"".concat(C,"-handler-down"),Object(X.a)({},"".concat(C,"-handler-down-disabled"),he)),ie=W?{onTouchStart:xe?d:this.up,onTouchEnd:this.stop}:{onMouseDown:xe?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},oe=W?{onTouchStart:he?d:this.down,onTouchEnd:this.stop}:{onMouseDown:he?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return I.a.createElement("div",{className:_e,style:Be,title:Ne,onMouseEnter:Le,onMouseLeave:Ue,onMouseOver:ye,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},I.a.createElement("div",{className:"".concat(C,"-handler-wrap")},I.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":xe,className:ge}),$||I.a.createElement("span",{unselectable:"on",className:"".concat(C,"-handler-up-inner"),onClick:s})),I.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Decrease Value","aria-disabled":he,className:re}),se||I.a.createElement("span",{unselectable:"on",className:"".concat(C,"-handler-down-inner"),onClick:s}))),I.a.createElement("div",{className:"".concat(C,"-input-wrap")},I.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":We,"aria-valuemax":Ee,"aria-valuenow":ft,required:ne,type:Re,placeholder:Ie,onPaste:ht,onClick:ve,onMouseUp:this.onMouseUp,className:"".concat(C,"-input"),tabIndex:le,autoComplete:j,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Je?this.onKeyDown:d,onKeyUp:Je?this.onKeyUp:d,autoFocus:Ke,maxLength:et,readOnly:J,disabled:H,max:Ee,min:We,step:ot,name:Ve,title:Ne,id:Ce,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(nt),pattern:Ze,inputMode:He,onInput:mt},Se))))}}]),x}(I.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:g,min:-g,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:u,required:!1,autoComplete:"off"};var c=v,l=ke.a=c},fyJ8:function($e,ke,F){"use strict";var ee=F("rePB"),X=F("VTBJ"),k=F("Ff2n"),Q=F("U8pU"),N=F("q1tI"),O=F.n(N),U=F("TSYQ"),B=F.n(U),I=F("c+Xe"),D=F("sR1s");function E(y){return y&&Object(Q.a)(y)==="object"&&!Array.isArray(y)&&!N.isValidElement(y)}function R(y){return typeof y=="string"?!0:Object(I.c)(y)}function P(y,d){var s,u=y.prefixCls,h=y.className,T=y.record,g=y.index,f=y.dataIndex,w=y.render,v=y.children,c=y.component,l=c===void 0?"td":c,a=y.colSpan,i=y.rowSpan,x=y.fixLeft,b=y.fixRight,m=y.firstFixLeft,L=y.lastFixLeft,C=y.firstFixRight,H=y.lastFixRight,J=y.appendNode,W=y.additionalProps,j=W===void 0?{}:W,$=y.ellipsis,se=y.align,me=y.rowType,Ee=y.isSticky,We="".concat(u,"-cell"),Be,Ne;if(v)Ne=v;else{var Le=Object(D.b)(T,f);if(Ne=Le,w){var Ue=w(Le,T,g);E(Ue)?(Ne=Ue.children,Be=Ue.props):Ne=Ue}}Object(Q.a)(Ne)==="object"&&!Array.isArray(Ne)&&!N.isValidElement(Ne)&&(Ne=null),$&&(L||C)&&(Ne=N.createElement("span",{className:"".concat(We,"-content")},Ne));var ye=Be||{},ce=ye.colSpan,ne=ye.rowSpan,ve=ye.style,le=ye.className,Re=Object(k.a)(ye,["colSpan","rowSpan","style","className"]),Ie=ce!==void 0?ce:a,Ce=ne!==void 0?ne:i;if(Ie===0||Ce===0)return null;var He={},Ze=typeof x=="number",ot=typeof b=="number";Ze&&(He.position="sticky",He.left=x),ot&&(He.position="sticky",He.right=b);var et={};se&&(et.textAlign=se);var Ke,Ve=$===!0?{showTitle:!0}:$;Ve&&(Ve.showTitle||me==="header")&&(typeof Ne=="string"||typeof Ne=="number"?Ke=Ne.toString():N.isValidElement(Ne)&&typeof Ne.props.children=="string"&&(Ke=Ne.props.children));var ht=Object(X.a)(Object(X.a)(Object(X.a)({title:Ke},Re),j),{},{colSpan:Ie&&Ie!==1?Ie:null,rowSpan:Ce&&Ce!==1?Ce:null,className:B()(We,h,(s={},Object(ee.a)(s,"".concat(We,"-fix-left"),Ze),Object(ee.a)(s,"".concat(We,"-fix-left-first"),m),Object(ee.a)(s,"".concat(We,"-fix-left-last"),L),Object(ee.a)(s,"".concat(We,"-fix-right"),ot),Object(ee.a)(s,"".concat(We,"-fix-right-first"),C),Object(ee.a)(s,"".concat(We,"-fix-right-last"),H),Object(ee.a)(s,"".concat(We,"-ellipsis"),$),Object(ee.a)(s,"".concat(We,"-with-append"),J),Object(ee.a)(s,"".concat(We,"-fix-sticky"),(Ze||ot)&&Ee),s),j.className,le),style:Object(X.a)(Object(X.a)(Object(X.a)(Object(X.a)({},j.style),et),He),ve),ref:R(l)?d:null});return N.createElement(l,Object.assign({},ht),J,Ne)}var _=N.forwardRef(P);_.displayName="Cell";var S=N.memo(_,function(y,d){return d.shouldCellUpdate?!d.shouldCellUpdate(d.record,y.record):!1});ke.a=S},h78n:function($e,ke,F){"use strict";F.d(ke,"a",function(){return m});var ee=F("q1tI"),X=F.n(ee),k=F("TSYQ"),Q=F.n(k),N={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},O=function(H){var J=H.map(function(){return Object(ee.useRef)()}),W=Object(ee.useRef)();return Object(ee.useEffect)(function(){var j=Date.now(),$=!1;Object.keys(J).forEach(function(se){var me=J[se].current;if(!me)return;$=!0;var Ee=me.style;Ee.transitionDuration=".3s, .3s, .3s, .06s",W.current&&j-W.current<100&&(Ee.transitionDuration="0s, 0s")}),$&&(W.current=Date.now())}),[J]};function U(){return U=Object.assign||function(C){for(var H=1;H<arguments.length;H++){var J=arguments[H];for(var W in J)Object.prototype.hasOwnProperty.call(J,W)&&(C[W]=J[W])}return C},U.apply(this,arguments)}function B(C,H){return P(C)||R(C,H)||D(C,H)||I()}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(C,H){if(!C)return;if(typeof C=="string")return E(C,H);var J=Object.prototype.toString.call(C).slice(8,-1);if(J==="Object"&&C.constructor&&(J=C.constructor.name),J==="Map"||J==="Set")return Array.from(C);if(J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J))return E(C,H)}function E(C,H){(H==null||H>C.length)&&(H=C.length);for(var J=0,W=new Array(H);J<H;J++)W[J]=C[J];return W}function R(C,H){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(C)))return;var J=[],W=!0,j=!1,$=void 0;try{for(var se=C[Symbol.iterator](),me;!(W=(me=se.next()).done)&&!(J.push(me.value),H&&J.length===H);W=!0);}catch(Ee){j=!0,$=Ee}finally{try{!W&&se.return!=null&&se.return()}finally{if(j)throw $}}return J}function P(C){if(Array.isArray(C))return C}function _(C,H){if(C==null)return{};var J=S(C,H),W,j;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(C);for(j=0;j<$.length;j++){if(W=$[j],H.indexOf(W)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,W))continue;J[W]=C[W]}}return J}function S(C,H){if(C==null)return{};var J={},W=Object.keys(C),j,$;for($=0;$<W.length;$++){if(j=W[$],H.indexOf(j)>=0)continue;J[j]=C[j]}return J}var y=function(H){var J=H.className,W=H.percent,j=H.prefixCls,$=H.strokeColor,se=H.strokeLinecap,me=H.strokeWidth,Ee=H.style,We=H.trailColor,Be=H.trailWidth,Ne=H.transition,Le=_(H,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Le.gapPosition;var Ue=Array.isArray(W)?W:[W],ye=Array.isArray($)?$:[$],ce=O(Ue),ne=B(ce,1),ve=ne[0],le=me/2,Re=100-me/2,Ie="M ".concat(se==="round"?le:0,",").concat(le,`
|
|
L `).concat(se==="round"?Re:100,",").concat(le),Ce="0 0 100 ".concat(me),He=0;return X.a.createElement("svg",U({className:Q()("".concat(j,"-line"),J),viewBox:Ce,preserveAspectRatio:"none",style:Ee},Le),X.a.createElement("path",{className:"".concat(j,"-line-trail"),d:Ie,strokeLinecap:se,stroke:We,strokeWidth:Be||me,fillOpacity:"0"}),Ue.map(function(Ze,ot){var et={strokeDasharray:"".concat(Ze,"px, 100px"),strokeDashoffset:"-".concat(He,"px"),transition:Ne||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ke=ye[ot]||ye[ye.length-1];return He+=Ze,X.a.createElement("path",{key:ot,className:"".concat(j,"-line-path"),d:Ie,strokeLinecap:se,stroke:Ke,strokeWidth:me,fillOpacity:"0",ref:ve[ot],style:et})}))};y.defaultProps=N;var d=y;function s(){return s=Object.assign||function(C){for(var H=1;H<arguments.length;H++){var J=arguments[H];for(var W in J)Object.prototype.hasOwnProperty.call(J,W)&&(C[W]=J[W])}return C},s.apply(this,arguments)}function u(C,H){return w(C)||f(C,H)||T(C,H)||h()}function h(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(C,H){if(!C)return;if(typeof C=="string")return g(C,H);var J=Object.prototype.toString.call(C).slice(8,-1);if(J==="Object"&&C.constructor&&(J=C.constructor.name),J==="Map"||J==="Set")return Array.from(C);if(J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J))return g(C,H)}function g(C,H){(H==null||H>C.length)&&(H=C.length);for(var J=0,W=new Array(H);J<H;J++)W[J]=C[J];return W}function f(C,H){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(C)))return;var J=[],W=!0,j=!1,$=void 0;try{for(var se=C[Symbol.iterator](),me;!(W=(me=se.next()).done)&&!(J.push(me.value),H&&J.length===H);W=!0);}catch(Ee){j=!0,$=Ee}finally{try{!W&&se.return!=null&&se.return()}finally{if(j)throw $}}return J}function w(C){if(Array.isArray(C))return C}function v(C,H){if(C==null)return{};var J=c(C,H),W,j;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(C);for(j=0;j<$.length;j++){if(W=$[j],H.indexOf(W)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,W))continue;J[W]=C[W]}}return J}function c(C,H){if(C==null)return{};var J={},W=Object.keys(C),j,$;for($=0;$<W.length;$++){if(j=W[$],H.indexOf(j)>=0)continue;J[j]=C[j]}return J}var l=0;function a(C){return+C.replace("%","")}function i(C){return Array.isArray(C)?C:[C]}function x(C,H,J,W){var j=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,$=arguments.length>5?arguments[5]:void 0,se=50-W/2,me=0,Ee=-se,We=0,Be=-2*se;switch($){case"left":me=-se,Ee=0,We=2*se,Be=0;break;case"right":me=se,Ee=0,We=-2*se,Be=0;break;case"bottom":Ee=se,Be=2*se;break;default:}var Ne="M 50,50 m ".concat(me,",").concat(Ee,`
|
|
a `).concat(se,",").concat(se," 0 1 1 ").concat(We,",").concat(-Be,`
|
|
a `).concat(se,",").concat(se," 0 1 1 ").concat(-We,",").concat(Be),Le=Math.PI*2*se,Ue={stroke:J,strokeDasharray:"".concat(H/100*(Le-j),"px ").concat(Le,"px"),strokeDashoffset:"-".concat(j/2+C/100*(Le-j),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ne,pathStyle:Ue}}var b=function(H){var J=H.prefixCls,W=H.strokeWidth,j=H.trailWidth,$=H.gapDegree,se=H.gapPosition,me=H.trailColor,Ee=H.strokeLinecap,We=H.style,Be=H.className,Ne=H.strokeColor,Le=H.percent,Ue=v(H,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ye=Object(ee.useMemo)(function(){return l+=1,l},[]),ce=x(0,100,me,W,$,se),ne=ce.pathString,ve=ce.pathStyle,le=i(Le),Re=i(Ne),Ie=Re.find(function(et){return Object.prototype.toString.call(et)==="[object Object]"}),Ce=O(le),He=u(Ce,1),Ze=He[0],ot=function(){var Ke=0;return le.map(function(Ve,ht){var mt=Re[ht]||Re[Re.length-1],gt=Object.prototype.toString.call(mt)==="[object Object]"?"url(#".concat(J,"-gradient-").concat(ye,")"):"",Et=x(Ke,Ve,mt,W,$,se);return Ke+=Ve,X.a.createElement("path",{key:ht,className:"".concat(J,"-circle-path"),d:Et.pathString,stroke:gt,strokeLinecap:Ee,strokeWidth:W,opacity:Ve===0?0:1,fillOpacity:"0",style:Et.pathStyle,ref:Ze[ht]})})};return X.a.createElement("svg",s({className:Q()("".concat(J,"-circle"),Be),viewBox:"0 0 100 100",style:We},Ue),Ie&&X.a.createElement("defs",null,X.a.createElement("linearGradient",{id:"".concat(J,"-gradient-").concat(ye),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ie).sort(function(et,Ke){return a(et)-a(Ke)}).map(function(et,Ke){return X.a.createElement("stop",{key:Ke,offset:et,stopColor:Ie[et]})}))),X.a.createElement("path",{className:"".concat(J,"-circle-trail"),d:ne,stroke:me,strokeLinecap:Ee,strokeWidth:j||W,fillOpacity:"0",style:ve}),ot().reverse())};b.defaultProps=N;var m=b,L={Line:d,Circle:m}},hW8S:function($e,ke,F){"use strict";F.d(ke,"a",function(){return Q}),F.d(ke,"c",function(){return N}),F.d(ke,"b",function(){return O});var ee=F("VTBJ"),X=F("Ff2n"),k=F("Kwbf"),Q="RC_TABLE_INTERNAL_COL_DEFINE";function N(U){var B=U.expandable,I=Object(X.a)(U,["expandable"]);return"expandable"in U?Object(ee.a)(Object(ee.a)({},I),B):I}function O(U){return Object.keys(U).reduce(function(B,I){return(I.substr(0,5)==="data-"||I.substr(0,5)==="aria-")&&(B[I]=U[I]),B},{})}},ji0R:function($e,ke,F){$e.exports=F.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function($e,ke,F){$e.exports=F.p+"static/question.cb52bef9.gif"},kPYp:function($e,ke){$e.exports="data:image/png;base64,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"},kSUc:function($e,ke,F){},l2Kq:function($e,ke,F){$e.exports=F.p+"static/match_ad.24dc22fd.jpg"},lZu9:function($e,ke,F){(function(ee){ee(F("VrN/"),F("1eCo"),F("8EBN"))})(function(ee){"use strict";ee.defineMode("markdown",function(X,k){var Q=ee.getMode(X,"text/html"),N=Q.name=="null";function O(W){if(ee.findModeByName){var j=ee.findModeByName(W);j&&(W=j.mime||j.mimes[0])}var $=ee.getMode(X,W);return $.name=="null"?null:$}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var U={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var B in U)U.hasOwnProperty(B)&&k.tokenTypeOverrides[B]&&(U[B]=k.tokenTypeOverrides[B]);var I=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,E=/^\[(x| )\](?=\s)/i,R=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,P=/^ {0,3}(?:\={1,}|-{2,})\s*$/,_=/^[^#!\[\]*_\\<>` "'(~:]+/,S=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\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\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\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]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,s=" ";function u(W,j,$){return j.f=j.inline=$,$(W,j)}function h(W,j,$){return j.f=j.block=$,$(W,j)}function T(W){return!W||!/\S/.test(W.string)}function g(W){if(W.linkTitle=!1,W.linkHref=!1,W.linkText=!1,W.em=!1,W.strong=!1,W.strikethrough=!1,W.quote=0,W.indentedCode=!1,W.f==w){var j=N;if(!j){var $=ee.innerMode(Q,W.htmlState);j=$.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText}j&&(W.f=a,W.block=f,W.htmlState=null)}return W.trailingSpace=0,W.trailingSpaceNewLine=!1,W.prevLine=W.thisLine,W.thisLine={stream:null},null}function f(W,j){var $=W.column()===j.indentation,se=T(j.prevLine.stream),me=j.indentedCode,Ee=j.prevLine.hr,We=j.list!==!1,Be=(j.listStack[j.listStack.length-1]||0)+3;j.indentedCode=!1;var Ne=j.indentation;if(j.indentationDiff===null&&(j.indentationDiff=j.indentation,We)){for(j.list=null;Ne<j.listStack[j.listStack.length-1];)j.listStack.pop(),j.listStack.length?j.indentation=j.listStack[j.listStack.length-1]:j.list=!1;j.list!==!1&&(j.indentationDiff=Ne-j.listStack[j.listStack.length-1])}var Le=!se&&!Ee&&!j.prevLine.header&&(!We||!me)&&!j.prevLine.fencedCodeEnd,Ue=(j.list===!1||Ee||se)&&j.indentation<=Be&&W.match(I),ye=null;if(j.indentationDiff>=4&&(me||j.prevLine.fencedCodeEnd||j.prevLine.header||se))return W.skipToEnd(),j.indentedCode=!0,U.code;if(W.eatSpace())return null;if($&&j.indentation<=Be&&(ye=W.match(R))&&ye[1].length<=6)return j.quote=0,j.header=ye[1].length,j.thisLine.header=!0,k.highlightFormatting&&(j.formatting="header"),j.f=j.inline,c(j);if(j.indentation<=Be&&W.eat(">"))return j.quote=$?1:j.quote+1,k.highlightFormatting&&(j.formatting="quote"),W.eatSpace(),c(j);if(!Ue&&!j.setext&&$&&j.indentation<=Be&&(ye=W.match(D))){var ce=ye[1]?"ol":"ul";return j.indentation=Ne+W.current().length,j.list=!0,j.quote=0,j.listStack.push(j.indentation),j.em=!1,j.strong=!1,j.code=!1,j.strikethrough=!1,k.taskLists&&W.match(E,!1)&&(j.taskList=!0),j.f=j.inline,k.highlightFormatting&&(j.formatting=["list","list-"+ce]),c(j)}else{if($&&j.indentation<=Be&&(ye=W.match(S,!0)))return j.quote=0,j.fencedEndRE=new RegExp(ye[1]+"+ *$"),j.localMode=k.fencedCodeBlockHighlighting&&O(ye[2]||k.fencedCodeBlockDefaultMode),j.localMode&&(j.localState=ee.startState(j.localMode)),j.f=j.block=v,k.highlightFormatting&&(j.formatting="code-block"),j.code=-1,c(j);if(j.setext||(!Le||!We)&&!j.quote&&j.list===!1&&!j.code&&!Ue&&!y.test(W.string)&&(ye=W.lookAhead(1))&&(ye=ye.match(P)))return j.setext?(j.header=j.setext,j.setext=0,W.skipToEnd(),k.highlightFormatting&&(j.formatting="header")):(j.header=ye[0].charAt(0)=="="?1:2,j.setext=j.header),j.thisLine.header=!0,j.f=j.inline,c(j);if(Ue)return W.skipToEnd(),j.hr=!0,j.thisLine.hr=!0,U.hr;if(W.peek()==="[")return u(W,j,L)}return u(W,j,j.inline)}function w(W,j){var $=Q.token(W,j.htmlState);if(!N){var se=ee.innerMode(Q,j.htmlState);(se.mode.name=="xml"&&se.state.tagStart===null&&!se.state.context&&se.state.tokenize.isInText||j.md_inside&&W.current().indexOf(">")>-1)&&(j.f=a,j.block=f,j.htmlState=null)}return $}function v(W,j){var $=j.listStack[j.listStack.length-1]||0,se=j.indentation<$,me=$+3;if(j.fencedEndRE&&j.indentation<=me&&(se||W.match(j.fencedEndRE))){k.highlightFormatting&&(j.formatting="code-block");var Ee;return se||(Ee=c(j)),j.localMode=j.localState=null,j.block=f,j.f=a,j.fencedEndRE=null,j.code=0,j.thisLine.fencedCodeEnd=!0,se?h(W,j,j.block):Ee}else return j.localMode?j.localMode.token(W,j.localState):(W.skipToEnd(),U.code)}function c(W){var j=[];if(W.formatting){j.push(U.formatting),typeof W.formatting=="string"&&(W.formatting=[W.formatting]);for(var $=0;$<W.formatting.length;$++)j.push(U.formatting+"-"+W.formatting[$]),W.formatting[$]==="header"&&j.push(U.formatting+"-"+W.formatting[$]+"-"+W.header),W.formatting[$]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=W.quote?j.push(U.formatting+"-"+W.formatting[$]+"-"+W.quote):j.push("error"))}if(W.taskOpen)return j.push("meta"),j.length?j.join(" "):null;if(W.taskClosed)return j.push("property"),j.length?j.join(" "):null;if(W.linkHref?j.push(U.linkHref,"url"):(W.strong&&j.push(U.strong),W.em&&j.push(U.em),W.strikethrough&&j.push(U.strikethrough),W.emoji&&j.push(U.emoji),W.linkText&&j.push(U.linkText),W.code&&j.push(U.code),W.image&&j.push(U.image),W.imageAltText&&j.push(U.imageAltText,"link"),W.imageMarker&&j.push(U.imageMarker)),W.header&&j.push(U.header,U.header+"-"+W.header),W.quote&&(j.push(U.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=W.quote?j.push(U.quote+"-"+W.quote):j.push(U.quote+"-"+k.maxBlockquoteDepth)),W.list!==!1){var se=(W.listStack.length-1)%3;se?se===1?j.push(U.list2):j.push(U.list3):j.push(U.list1)}return W.trailingSpaceNewLine?j.push("trailing-space-new-line"):W.trailingSpace&&j.push("trailing-space-"+(W.trailingSpace%2?"a":"b")),j.length?j.join(" "):null}function l(W,j){return W.match(_,!0)?c(j):void 0}function a(W,j){var $=j.text(W,j);if(typeof $!="undefined")return $;if(j.list)return j.list=null,c(j);if(j.taskList){var se=W.match(E,!0)[1]===" ";return se?j.taskOpen=!0:j.taskClosed=!0,k.highlightFormatting&&(j.formatting="task"),j.taskList=!1,c(j)}if(j.taskOpen=!1,j.taskClosed=!1,j.header&&W.match(/^#+$/,!0))return k.highlightFormatting&&(j.formatting="header"),c(j);var me=W.next();if(j.linkTitle){j.linkTitle=!1;var Ee=me;me==="("&&(Ee=")"),Ee=(Ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var We="^\\s*(?:[^"+Ee+"\\\\]+|\\\\\\\\|\\\\.)"+Ee;if(W.match(new RegExp(We),!0))return U.linkHref}if(me==="`"){var Be=j.formatting;k.highlightFormatting&&(j.formatting="code"),W.eatWhile("`");var Ne=W.current().length;if(j.code==0&&(!j.quote||Ne==1))return j.code=Ne,c(j);if(Ne==j.code){var Le=c(j);return j.code=0,Le}else return j.formatting=Be,c(j)}else if(j.code)return c(j);if(me==="\\"&&(W.next(),k.highlightFormatting)){var Ue=c(j),ye=U.formatting+"-escape";return Ue?Ue+" "+ye:ye}if(me==="!"&&W.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return j.imageMarker=!0,j.image=!0,k.highlightFormatting&&(j.formatting="image"),c(j);if(me==="["&&j.imageMarker&&W.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return j.imageMarker=!1,j.imageAltText=!0,k.highlightFormatting&&(j.formatting="image"),c(j);if(me==="]"&&j.imageAltText){k.highlightFormatting&&(j.formatting="image");var Ue=c(j);return j.imageAltText=!1,j.image=!1,j.inline=j.f=x,Ue}if(me==="["&&!j.image)return j.linkText&&W.match(/^.*?\]/)||(j.linkText=!0,k.highlightFormatting&&(j.formatting="link")),c(j);if(me==="]"&&j.linkText){k.highlightFormatting&&(j.formatting="link");var Ue=c(j);return j.linkText=!1,j.inline=j.f=W.match(/\(.*?\)| ?\[.*?\]/,!1)?x:a,Ue}if(me==="<"&&W.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){j.f=j.inline=i,k.highlightFormatting&&(j.formatting="link");var Ue=c(j);return Ue?Ue+=" ":Ue="",Ue+U.linkInline}if(me==="<"&&W.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){j.f=j.inline=i,k.highlightFormatting&&(j.formatting="link");var Ue=c(j);return Ue?Ue+=" ":Ue="",Ue+U.linkEmail}if(k.xml&&me==="<"&&W.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=W.string.indexOf(">",W.pos);if(ce!=-1){var ne=W.string.substring(W.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(j.md_inside=!0)}return W.backUp(1),j.htmlState=ee.startState(Q),h(W,j,w)}if(k.xml&&me==="<"&&W.match(/^\/\w*?>/))return j.md_inside=!1,"tag";if(me==="*"||me==="_"){for(var ve=1,le=W.pos==1?" ":W.string.charAt(W.pos-2);ve<3&&W.eat(me);)ve++;var Re=W.peek()||" ",Ie=!/\s/.test(Re)&&(!d.test(Re)||/\s/.test(le)||d.test(le)),Ce=!/\s/.test(le)&&(!d.test(le)||/\s/.test(Re)||d.test(Re)),He=null,Ze=null;if(ve%2&&(!j.em&&Ie&&(me==="*"||!Ce||d.test(le))?He=!0:j.em==me&&Ce&&(me==="*"||!Ie||d.test(Re))&&(He=!1)),ve>1&&(!j.strong&&Ie&&(me==="*"||!Ce||d.test(le))?Ze=!0:j.strong==me&&Ce&&(me==="*"||!Ie||d.test(Re))&&(Ze=!1)),Ze!=null||He!=null){k.highlightFormatting&&(j.formatting=He==null?"strong":Ze==null?"em":"strong em"),He===!0&&(j.em=me),Ze===!0&&(j.strong=me);var Le=c(j);return He===!1&&(j.em=!1),Ze===!1&&(j.strong=!1),Le}}else if(me===" "&&(W.eat("*")||W.eat("_"))){if(W.peek()===" ")return c(j);W.backUp(1)}if(k.strikethrough){if(me==="~"&&W.eatWhile(me)){if(j.strikethrough){k.highlightFormatting&&(j.formatting="strikethrough");var Le=c(j);return j.strikethrough=!1,Le}else if(W.match(/^[^\s]/,!1))return j.strikethrough=!0,k.highlightFormatting&&(j.formatting="strikethrough"),c(j)}else if(me===" "&&W.match(/^~~/,!0)){if(W.peek()===" ")return c(j);W.backUp(2)}}if(k.emoji&&me===":"&&W.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){j.emoji=!0,k.highlightFormatting&&(j.formatting="emoji");var ot=c(j);return j.emoji=!1,ot}return me===" "&&(W.match(/^ +$/,!1)?j.trailingSpace++:j.trailingSpace&&(j.trailingSpaceNewLine=!0)),c(j)}function i(W,j){var $=W.next();if($===">"){j.f=j.inline=a,k.highlightFormatting&&(j.formatting="link");var se=c(j);return se?se+=" ":se="",se+U.linkInline}return W.match(/^[^>]+/,!0),U.linkInline}function x(W,j){if(W.eatSpace())return null;var $=W.next();return $==="("||$==="["?(j.f=j.inline=m($==="("?")":"]"),k.highlightFormatting&&(j.formatting="link-string"),j.linkHref=!0,c(j)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function m(W){return function(j,$){var se=j.next();if(se===W){$.f=$.inline=a,k.highlightFormatting&&($.formatting="link-string");var me=c($);return $.linkHref=!1,me}return j.match(b[W]),$.linkHref=!0,c($)}}function L(W,j){return W.match(/^([^\]\\]|\\.)*\]:/,!1)?(j.f=C,W.next(),k.highlightFormatting&&(j.formatting="link"),j.linkText=!0,c(j)):u(W,j,a)}function C(W,j){if(W.match(/^\]:/,!0)){j.f=j.inline=H,k.highlightFormatting&&(j.formatting="link");var $=c(j);return j.linkText=!1,$}return W.match(/^([^\]\\]|\\.)+/,!0),U.linkText}function H(W,j){return W.eatSpace()?null:(W.match(/^[^\s]+/,!0),W.peek()===void 0?j.linkTitle=!0:W.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),j.f=j.inline=a,U.linkHref+" url")}var J={startState:function(){return{f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:a,text:l,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(W){return{f:W.f,prevLine:W.prevLine,thisLine:W.thisLine,block:W.block,htmlState:W.htmlState&&ee.copyState(Q,W.htmlState),indentation:W.indentation,localMode:W.localMode,localState:W.localMode?ee.copyState(W.localMode,W.localState):null,inline:W.inline,text:W.text,formatting:!1,linkText:W.linkText,linkTitle:W.linkTitle,linkHref:W.linkHref,code:W.code,em:W.em,strong:W.strong,strikethrough:W.strikethrough,emoji:W.emoji,header:W.header,setext:W.setext,hr:W.hr,taskList:W.taskList,list:W.list,listStack:W.listStack.slice(0),quote:W.quote,indentedCode:W.indentedCode,trailingSpace:W.trailingSpace,trailingSpaceNewLine:W.trailingSpaceNewLine,md_inside:W.md_inside,fencedEndRE:W.fencedEndRE}},token:function(W,j){if(j.formatting=!1,W!=j.thisLine.stream){if(j.header=0,j.hr=!1,W.match(/^\s*$/,!0))return g(j),null;if(j.prevLine=j.thisLine,j.thisLine={stream:W},j.taskList=!1,j.trailingSpace=0,j.trailingSpaceNewLine=!1,!j.localState&&(j.f=j.block,j.f!=w)){var $=W.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(j.indentation=$,j.indentationDiff=null,$>0)return null}}return j.f(W,j)},innerMode:function(W){return W.block==w?{state:W.htmlState,mode:Q}:W.localState?{state:W.localState,mode:W.localMode}:{state:W,mode:J}},indent:function(W,j,$){return W.block==w&&Q.indent?Q.indent(W.htmlState,j,$):W.localState&&W.localMode.indent?W.localMode.indent(W.localState,j,$):ee.Pass},blankLine:g,getType:c,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return J},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},lzim:function($e,ke,F){"use strict";var ee=F("E7E6"),X=F.n(ee);F.d(ke,"A",function(){return X.a});var k=F("/GNS"),Q=F.n(k);F.d(ke,"z",function(){return Q.a});var N=F("FOrL"),O=F.n(N);F.d(ke,"t",function(){return O.a});var U=F("HpTS"),B=F.n(U);F.d(ke,"B",function(){return B.a});var I=F("tWlo"),D=F.n(I);F.d(ke,"b",function(){return D.a});var E=F("7ZXX"),R=F.n(E);F.d(ke,"n",function(){return R.a});var P=F("GABl"),_=F.n(P);F.d(ke,"g",function(){return _.a});var S=F("onxn"),y=F.n(S);F.d(ke,"p",function(){return y.a});var d=F("nKGa"),s=F.n(d);F.d(ke,"o",function(){return s.a});var u=F("4qgm"),h=F.n(u);F.d(ke,"D",function(){return h.a});var T=F("JeFH"),g=F.n(T);F.d(ke,"c",function(){return g.a});var f=F("ji0R"),w=F.n(f);F.d(ke,"k",function(){return w.a});var v=F("W6BS"),c=F.n(v);F.d(ke,"E",function(){return c.a});var l=F("kPYp"),a=F.n(l);F.d(ke,"F",function(){return a.a});var i=F("nukY"),x=F.n(i),b=F("4u4S"),m=F.n(b),L=F("yslc"),C=F.n(L),H=F("l2Kq"),J=F.n(H),W=F("RMFE"),j=F.n(W);F.d(ke,"q",function(){return j.a});var $=F("TGq3"),se=F.n($);F.d(ke,"r",function(){return se.a});var me=F("SMhR"),Ee=F.n(me);F.d(ke,"C",function(){return Ee.a});var We=F("8/bI"),Be=F.n(We);F.d(ke,"l",function(){return Be.a});var Ne=F("JWDV"),Le=F.n(Ne);F.d(ke,"e",function(){return Le.a});var Ue=F("Xsq0"),ye=F.n(Ue);F.d(ke,"s",function(){return ye.a});var ce=F("Ohmc"),ne=F.n(ce);F.d(ke,"d",function(){return ne.a});var ve=F("csWT"),le=F.n(ve);F.d(ke,"f",function(){return le.a});var Re=F("7v3h"),Ie=F.n(Re);F.d(ke,"m",function(){return Ie.a});var Ce=F("cRFk"),He=F.n(Ce);F.d(ke,"y",function(){return He.a});var Ze=F("kPWJ"),ot=F.n(Ze);F.d(ke,"x",function(){return ot.a});var et=F("qgvg"),Ke=F.n(et);F.d(ke,"u",function(){return Ke.a});var Ve=F("FPkq"),ht=F.n(Ve);F.d(ke,"w",function(){return ht.a});var mt=F("A/g1"),gt=F.n(mt);F.d(ke,"h",function(){return gt.a});var Et=F("Nmxd"),ft=F.n(Et);F.d(ke,"i",function(){return ft.a});var Ct=F("5D2P"),_e=F.n(Ct);F.d(ke,"j",function(){return _e.a});var Se=F("djh8"),Je=F.n(Se);F.d(ke,"v",function(){return Je.a});var nt=F("Jq4h"),Fe=F.n(nt);F.d(ke,"a",function(){return Fe.a})},n6Qo:function($e,ke,F){"use strict";F.d(ke,"a",function(){return B});var ee=F("q1tI"),X=F("biw7"),k=F("fyJ8");function Q(I){var D=I.className,E=I.index,R=I.children,P=I.colSpan,_=I.rowSpan,S=ee.useContext(X.a),y=S.prefixCls,d=S.fixedInfoList,s=d[E];return ee.createElement(k.a,Object.assign({className:D,index:E,component:"td",prefixCls:y,record:null,dataIndex:null,render:function(){return{children:R,props:{colSpan:P,rowSpan:_}}}},s))}function N(I){return ee.createElement("tr",Object.assign({},I))}function O(I){var D=I.children,E=ee.useContext(X.a),R=E.prefixCls;return ee.createElement("tfoot",{className:"".concat(R,"-summary")},D)}var U=ke.b=O,B={Cell:Q,Row:N}},nKGa:function($e,ke,F){$e.exports=F.p+"static/export_exercise-template.f7655c19.png"},nukY:function($e,ke){$e.exports="data:image/png;base64,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"},"o/qq":function($e,ke,F){$e.exports={flex_box_center:"flex_box_center___1LYHS",flex_space_between:"flex_space_between___EmHgD",flex_box_vertical_center:"flex_box_vertical_center___8y-JO",flex_box_center_end:"flex_box_center_end___2Ow7E",flex_box_column:"flex_box_column___2_dIp",shixunWrp:"shixunWrp___2zw8A"}},onxn:function($e,ke){$e.exports="data:image/png;base64,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"},osHv:function($e,ke,F){(function(ee){ee(F("VrN/"))})(function(ee){"use strict";var X=ee.Pos;function k(d,s){return d.line-s.line||d.ch-s.ch}var Q="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",N=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=new RegExp("<(/?)(["+Q+"]["+N+"]*)","g");function U(d,s,u,h){this.line=s,this.ch=u,this.cm=d,this.text=d.getLine(s),this.min=h?Math.max(h.from,d.firstLine()):d.firstLine(),this.max=h?Math.min(h.to-1,d.lastLine()):d.lastLine()}function B(d,s){var u=d.cm.getTokenTypeAt(X(d.line,s));return u&&/\btag\b/.test(u)}function I(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function D(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function E(d){for(;;){var s=d.text.indexOf(">",d.ch);if(s==-1){if(I(d))continue;return}if(!B(d,s+1)){d.ch=s+1;continue}var u=d.text.lastIndexOf("/",s),h=u>-1&&!/\S/.test(d.text.slice(u+1,s));return d.ch=s+1,h?"selfClose":"regular"}}function R(d){for(;;){var s=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(s==-1){if(D(d))continue;return}if(!B(d,s+1)){d.ch=s;continue}O.lastIndex=s,d.ch=s;var u=O.exec(d.text);if(u&&u.index==s)return u}}function P(d){for(;;){O.lastIndex=d.ch;var s=O.exec(d.text);if(!s){if(I(d))continue;return}if(!B(d,s.index+1)){d.ch=s.index+1;continue}return d.ch=s.index+s[0].length,s}}function _(d){for(;;){var s=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(s==-1){if(D(d))continue;return}if(!B(d,s+1)){d.ch=s;continue}var u=d.text.lastIndexOf("/",s),h=u>-1&&!/\S/.test(d.text.slice(u+1,s));return d.ch=s+1,h?"selfClose":"regular"}}function S(d,s){for(var u=[];;){var h=P(d),T,g=d.line,f=d.ch-(h?h[0].length:0);if(!h||!(T=E(d)))return;if(T=="selfClose")continue;if(h[1]){for(var w=u.length-1;w>=0;--w)if(u[w]==h[2]){u.length=w;break}if(w<0&&(!s||s==h[2]))return{tag:h[2],from:X(g,f),to:X(d.line,d.ch)}}else u.push(h[2])}}function y(d,s){for(var u=[];;){var h=_(d);if(!h)return;if(h=="selfClose"){R(d);continue}var T=d.line,g=d.ch,f=R(d);if(!f)return;if(f[1])u.push(f[2]);else{for(var w=u.length-1;w>=0;--w)if(u[w]==f[2]){u.length=w;break}if(w<0&&(!s||s==f[2]))return{tag:f[2],from:X(d.line,d.ch),to:X(T,g)}}}}ee.registerHelper("fold","xml",function(d,s){for(var u=new U(d,s.line,0);;){var h=P(u);if(!h||u.line!=s.line)return;var T=E(u);if(!T)return;if(!h[1]&&T!="selfClose"){var g=X(u.line,u.ch),f=S(u,h[2]);return f&&k(f.from,g)>0?{from:g,to:f.from}:null}}}),ee.findMatchingTag=function(d,s,u){var h=new U(d,s.line,s.ch,u);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var T=E(h),g=T&&X(h.line,h.ch),f=T&&R(h);if(!T||!f||k(h,s)>0)return;var w={from:X(h.line,h.ch),to:g,tag:f[2]};return T=="selfClose"?{open:w,close:null,at:"open"}:f[1]?{open:y(h,f[2]),close:w,at:"close"}:(h=new U(d,g.line,g.ch,u),{open:w,close:S(h,f[2]),at:"open"})},ee.findEnclosingTag=function(d,s,u,h){for(var T=new U(d,s.line,s.ch,u);;){var g=y(T,h);if(!g)break;var f=new U(d,s.line,s.ch,u),w=S(f,g.tag);if(w)return{open:g,close:w}}},ee.scanForClosingTag=function(d,s,u,h){var T=new U(d,s.line,s.ch,h?{from:0,to:h}:null);return S(T,u)}})},p5ED:function($e,ke,F){"use strict";var ee=F("+L6B"),X=F("2/Rp"),k=F("5Dmo"),Q=F("3S7+"),N=F("k1fw"),O=F("9og8"),U=F("tJVT"),B=F("WmNS"),I=F.n(B),D=F("q1tI"),E=F.n(D),R=F("vHTk"),P=F.n(R),_=F("yEEn"),S=F("ZW9T"),y=F("1vsH"),d=F("V0Rq"),s=F("m3rI"),u=function(T){var g=T.name,f=T.data,w=T.theme,v=T.type,c=T.filename,l=T.monacoEditor,a=T.className,i=T.style,x=T.close,b=T.onClose,m=T.hasMask,L=T.otherData,C=L===void 0?{}:L,H=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),J=Object(U.a)(H,2),W=J[0],j=J[1],$=Object(D.useState)(""),se=Object(U.a)($,2),me=se[0],Ee=se[1],We=Object(D.useState)(),Be=Object(U.a)(We,2),Ne=Be[0],Le=Be[1],Ue=window.ENV==="build"?"/react/build/office.html":"/office.html",ye,ce=1024*1024,ne=10*ce,ve=Object(D.useRef)();v==="office"&&(ye=Object(y.P)(f).filesize,ye>ne&&(v="other")),c&&(l.filename=c),Object(D.useEffect)(function(){var Ce,He,Ze=(Ce=document.cookie)===null||Ce===void 0||((He=Ce.replace(/\s/g,""))===null||He===void 0)?void 0:He.split(";");Ze==null||Ze.map(function(ot){var et=ot.split("=");et[0]==="_educoder_session"&&Ee(et[1])})},[]),Object(D.useEffect)(function(){v==="office"&&le()},[v]);var le=function(){var Ce=Object(O.a)(I.a.mark(function He(){var Ze,ot,et;return I.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return console.log("data:",f),Ze=f,f.startsWith("http")||(Ze=location.origin+Ze),ot=new URL(Ze).pathname.split("/").pop(),Ve.next=6,Object(d.U)({attachment_id:ot});case 6:et=Ve.sent,Le(et);case 8:case"end":return Ve.stop()}},He)}));return function(){return Ce.apply(this,arguments)}}(),Re=function(){if(f.startsWith("http")||f.startsWith("blob:")){Ie();return}Object(y.x)(c||"educoder",f,c)},Ie=function(){Object(y.v)(c||"educoder",decodeURIComponent(f))};return E.a.createElement("div",{style:Object(N.a)({},i||{}),className:"".concat(m&&P.a.bgBlack," ").concat(v?P.a.wrp:"hide")},x&&E.a.createElement("div",{className:P.a.close,ref:ve},E.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ve.current}},E.a.createElement("span",{onClick:Ie},E.a.createElement("i",{className:"icon-quxiaozhiding"}))),E.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ve.current}},E.a.createElement("span",{className:"",onClick:function(){b(),Le(null)}},E.a.createElement("i",{className:"icon-guanbi1"})))),E.a.createElement("div",{className:"".concat(P.a[a]," ").concat(a," ").concat(P.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&E.a.createElement(S.b,l)),v==="audio"&&E.a.createElement("audio",{src:"".concat((f==null?void 0:f.indexOf("http://"))>-1||(f==null?void 0:f.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),v==="video"&&E.a.createElement(E.a.Fragment,null,(f==null?void 0:f.indexOf("/api"))>-1?E.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):E.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),v==="office"&&Ne&&E.a.createElement("iframe",{src:"".concat(Ue,"?key=").concat(Ne.key,"&url=").concat(s.a.API_SERVER+Ne.url,"&callbackUrl=").concat(s.a.API_SERVER+Ne.callbackUrl,"&fileType=").concat(Ne.fileType,"&title=").concat(Ne.title,"&model=view")}),(v==="xlsx"||v==="doc"||v==="pptx"||v==="docx")&&E.a.createElement("iframe",{src:"".concat(Ue,"?key=").concat(C.key,"&url=").concat(s.a.API_SERVER+C.url,"&callbackUrl=").concat(s.a.API_SERVER+C.callbackUrl,"&fileType=").concat(C.fileType,"&title=").concat(C.title,"&model=").concat(C.model)}),v==="html"&&E.a.createElement("iframe",{src:f+"&disposition=inline"}),v==="pdf"&&E.a.createElement("embed",{className:P.a.embed,src:f,type:"application/pdf"}),v==="image"&&E.a.createElement("img",{src:"".concat((f==null?void 0:f.indexOf("http://"))>-1||(f==null?void 0:f.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(f)}),v==="other"&&E.a.createElement("div",null,E.a.createElement(X.a,{type:"primary",size:"large",onClick:Re},E.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&E.a.createElement(X.a,{type:"primary",size:"large",onClick:Re},E.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};ke.a=u},"p77/":function($e,ke,F){},qgvg:function($e,ke){$e.exports="data:image/gif;base64,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"},"rAM+":function($e,ke,F){"use strict";F.d(ke,"a",function(){return X});var ee=F("Qw5x");function X(k,Q){var N;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(N=Object(ee.a)(k))||Q&&k&&typeof k.length=="number"){N&&(k=N);var O=0,U=function(){};return{s:U,n:function(){return O>=k.length?{done:!0}:{done:!1,value:k[O++]}},e:function(R){throw R},f:U}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B=!0,I=!1,D;return{s:function(){N=k[Symbol.iterator]()},n:function(){var R=N.next();return B=R.done,R},e:function(R){I=!0,D=R},f:function(){try{!B&&N.return!=null&&N.return()}finally{if(I)throw D}}}}},rUJ1:function($e,ke){const F=/[&<>"']/,ee=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},N=v=>Q[v];function O(v,c){if(c){if(F.test(v))return v.replace(ee,N)}else if(X.test(v))return v.replace(k,N);return v}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(v){return v.replace(U,(c,l)=>(l=l.toLowerCase(),l==="colon"?":":l.charAt(0)==="#"?l.charAt(1)==="x"?String.fromCharCode(parseInt(l.substring(2),16)):String.fromCharCode(+l.substring(1)):""))}const I=/(^|[^\[])\^/g;function D(v,c){v=v.source||v,c=c||"";const l={replace:(a,i)=>(i=i.source||i,i=i.replace(I,"$1"),v=v.replace(a,i),l),getRegex:()=>new RegExp(v,c)};return l}const E=/[^\w:]/g,R=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function P(v,c,l){if(v){let a;try{a=decodeURIComponent(B(l)).replace(E,"").toLowerCase()}catch(i){return null}if(a.indexOf("javascript:")===0||a.indexOf("vbscript:")===0||a.indexOf("data:")===0)return null}c&&!R.test(l)&&(l=s(c,l));try{l=encodeURI(l).replace(/%25/g,"%")}catch(a){return null}return l}const _={},S=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(v,c){_[" "+v]||(S.test(v)?_[" "+v]=v+"/":_[" "+v]=g(v,"/",!0)),v=_[" "+v];const l=v.indexOf(":")===-1;return c.substring(0,2)==="//"?l?c:v.replace(y,"$1")+c:c.charAt(0)==="/"?l?c:v.replace(d,"$1")+c:v+c}const u={exec:function(){}};function h(v){let c=1,l,a;for(;c<arguments.length;c++){l=arguments[c];for(a in l)Object.prototype.hasOwnProperty.call(l,a)&&(v[a]=l[a])}return v}function T(v,c){const l=v.replace(/\|/g,(x,b,m)=>{let L=!1,C=b;for(;--C>=0&&m[C]==="\\";)L=!L;return L?"|":" |"}),a=l.split(/ \|/);let i=0;if(a.length>c)a.splice(c);else for(;a.length<c;)a.push("");for(;i<a.length;i++)a[i]=a[i].trim().replace(/\\\|/g,"|");return a}function g(v,c,l){const a=v.length;if(a===0)return"";let i=0;for(;i<a;){const x=v.charAt(a-i-1);if(x===c&&!l)i++;else if(x!==c&&l)i++;else break}return v.substr(0,a-i)}function f(v,c){if(v.indexOf(c[1])===-1)return-1;const l=v.length;let a=0,i=0;for(;i<l;i++)if(v[i]==="\\")i++;else if(v[i]===c[0])a++;else if(v[i]===c[1]&&(a--,a<0))return i;return-1}function w(v){v&&v.sanitize&&!v.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")}$e.exports={escape:O,unescape:B,edit:D,cleanUrl:P,resolveUrl:s,noopTest:u,merge:h,splitCells:T,rtrim:g,findClosingBracket:f,checkSanitizeDeprecation:w}},sR1s:function($e,ke,F){"use strict";F.d(ke,"b",function(){return Q}),F.d(ke,"a",function(){return N}),F.d(ke,"c",function(){return O}),F.d(ke,"d",function(){return U});var ee=F("U8pU"),X="RC_TABLE_KEY";function k(B){return B==null?[]:Array.isArray(B)?B:[B]}function Q(B,I){if(!I&&typeof I!="number")return B;for(var D=k(I),E=B,R=0;R<D.length;R+=1){if(!E)return null;var P=D[R];E=E[P]}return E}function N(B){var I=[],D={};return B.forEach(function(E){for(var R=E||{},P=R.key,_=R.dataIndex,S=P||k(_).join("-")||X;D[S];)S="".concat(S,"_next");D[S]=!0,I.push(S)}),I}function O(){var B={};function I(P,_){_&&Object.keys(_).forEach(function(S){var y=_[S];y&&Object(ee.a)(y)==="object"?(P[S]=P[S]||{},I(P[S],y)):P[S]=y})}for(var D=arguments.length,E=new Array(D),R=0;R<D;R++)E[R]=arguments[R];return E.forEach(function(P){I(B,P)}),B}function U(B){return B!=null}},sboe:function($e,ke,F){"use strict";F.d(ke,"a",function(){return k});var ee=F("q1tI"),X=F.n(ee),k=ee.createContext(null)},t23M:function($e,ke,F){"use strict";var ee=F("VTBJ"),X=F("1OyB"),k=F("vuIU"),Q=F("Ji7U"),N=F("LK+K"),O=F("q1tI"),U=F.n(O),B=F("m+aA"),I=F("Zm9Q"),D=F("Kwbf"),E=F("c+Xe"),R=F("bdgK"),P="rc-observer-key",_=function(S){Object(Q.a)(d,S);var y=Object(N.a)(d);function d(){var s;return Object(X.a)(this,d),s=y.apply(this,arguments),s.resizeObserver=null,s.childNode=null,s.currentElement=null,s.state={width:0,height:0,offsetHeight:0,offsetWidth:0},s.onResize=function(u){var h=s.props.onResize,T=u[0].target,g=T.getBoundingClientRect(),f=g.width,w=g.height,v=T.offsetWidth,c=T.offsetHeight,l=Math.floor(f),a=Math.floor(w);if(s.state.width!==l||s.state.height!==a||s.state.offsetWidth!==v||s.state.offsetHeight!==c){var i={width:l,height:a,offsetWidth:v,offsetHeight:c};s.setState(i),h&&Promise.resolve().then(function(){h(Object(ee.a)(Object(ee.a)({},i),{},{offsetWidth:v,offsetHeight:c}))})}},s.setChildNode=function(u){s.childNode=u},s}return Object(k.a)(d,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var h=Object(B.a)(this.childNode||this),T=h!==this.currentElement;T&&(this.destroyObserver(),this.currentElement=h),!this.resizeObserver&&h&&(this.resizeObserver=new R.default(this.onResize),this.resizeObserver.observe(h))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,h=Object(I.a)(u);if(h.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(h.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var T=h[0];if(O.isValidElement(T)&&Object(E.c)(T)){var g=T.ref;h[0]=O.cloneElement(T,{ref:Object(E.a)(g,this.setChildNode)})}return h.length===1?h[0]:h.map(function(f,w){return!O.isValidElement(f)||"key"in f&&f.key!==null?f:O.cloneElement(f,{key:"".concat(P,"-").concat(w)})})}}]),d}(O.Component);_.displayName="ResizeObserver",ke.a=_},tWlo:function($e,ke){$e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkVCNENBMTM0OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkVCNENBMTM1OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RUI0Q0ExMzI4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RUI0Q0ExMzM4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7p3KzkAAAFvElEQVR42sRae0ybVRQ/peVRaFce8pwgj1Je5TFsEHGbMAkzmqiJyba4hYh/LJlxiRr9Z0aNGv8xvhKTGckM2zKWmGEgU7MsPnCZIrKBjMcKY9BCBMqjjEcLtFDwHPZVC12h934f8yS/P6Dfud/5nXvvueec+8neOPEuSCAxiDJEMSITkYKIRoQJv9sREwgTogfRjGhEjIt9sUKEbhSiEvEC4mGEbJNngxGRiAzEk8L/VhGtiPOIswgrjxEBHDrxiE8Qg4hPEYYtjPclMkGXxhhCfIFI2E4CNFtvIm4hXvdYHlJIKOIVRK/wjkCpCaQjWhAfIVSwfaIS3kHvypaKwLOI64hdcP+kAPEn4jmxBI4ivkXsgPsvNBt1gg1cBI4hvkLI4f8TuWDDMdYw+owQFdh3Y6gSCnL1oNOmQnxcHAQHB8HCwiLMzM7C8KgFjD23oN9khtXVVZZhyZZhxEV/CGQhalk9r1AoYO9jxfBokQGCgoK8SBHi42LBsCsfJq1TcOnHn+F2v4llJsimIoRx3Q8le0o9/6bwdRmRxGJ8ZEQ4vHjkEORkZYBcLvdrlvL0OeBwOuDv4RF/X0Ne2Y34GrHiaw+8ishnMT4tNRmOVlVCTPQDzKfY/vJ9kJWpY1Ej217ztYnpFHyH6UjGJXH4wPOgVIZw7VAi8XRFOSjkTKv1bc8T25PACdZDan95mV9LZjNRq1Wg02lZw+tbGwnQ/L/EMooyJASSkxIliZUp7ONUCTb/S+AI2cTqOZlMJgmBcI2GVUUp2LyOAJMwxvHN04EAnqQYDrsJUDFSyKrtdC5JRmDR4eBRoxokgQjs48nn5+fnJSNgt3ONRTaXEYFHeLSXlpd5Peclk1Yrr6ohQKhhuWR6ekYSAiOWMV7VDCKg5Z0/uwTLaNnlAssYd22fTgRieTRz9dmQlpIsmgCdwuWle3nVY4mAmkczLCxUsk0cEaHhVVUH8GqOT0xKRmB6ZpZX1UkE5ng0zeYhsNntkhBgqAs2yhwR4AoBrpUVaO/oEm38nelp6B/gJnCHCNzm1f79jxaWgsRLbDY7XKj/Dlb405I+ItDDqz2/sACnTp9DEqNc+qfO1MLwyKiYCewNEPov3EK+G59k39BOp3Nt+YiUViLQKNjBH8sV7EXNivhslgb4xb2J28SMtMSRmbrwBBYpZPOI+xw4J2aka23tzB4VETrdct6zoCECC7wjjWIy1tbewZT//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function($e,ke,F){typeof window!="undefined"&&function(X,k){$e.exports=k()}(this,function(){return function(ee){var X={};function k(Q){if(X[Q])return X[Q].exports;var N=X[Q]={i:Q,l:!1,exports:{}};return ee[Q].call(N.exports,N,N.exports,k),N.l=!0,N.exports}return k.m=ee,k.c=X,k.d=function(Q,N,O){k.o(Q,N)||Object.defineProperty(Q,N,{enumerable:!0,get:O})},k.r=function(Q){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})},k.t=function(Q,N){if(N&1&&(Q=k(Q)),N&8)return Q;if(N&4&&typeof Q=="object"&&Q&&Q.__esModule)return Q;var O=Object.create(null);if(k.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:Q}),N&2&&typeof Q!="string")for(var U in Q)k.d(O,U,function(B){return Q[B]}.bind(null,U));return O},k.n=function(Q){var N=Q&&Q.__esModule?function(){return Q.default}:function(){return Q};return k.d(N,"a",N),N},k.o=function(Q,N){return Object.prototype.hasOwnProperty.call(Q,N)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,X,k){"use strict";var Q=Object.prototype.hasOwnProperty,N="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(N=!1));function U(E,R,P){this.fn=E,this.context=R,this.once=P||!1}function B(E,R,P,_,S){if(typeof P!="function")throw new TypeError("The listener must be a function");var y=new U(P,_||E,S),d=N?N+R:R;return E._events[d]?E._events[d].fn?E._events[d]=[E._events[d],y]:E._events[d].push(y):(E._events[d]=y,E._eventsCount++),E}function I(E,R){--E._eventsCount===0?E._events=new O:delete E._events[R]}function D(){this._events=new O,this._eventsCount=0}D.prototype.eventNames=function(){var R=[],P,_;if(this._eventsCount===0)return R;for(_ in P=this._events)Q.call(P,_)&&R.push(N?_.slice(1):_);return Object.getOwnPropertySymbols?R.concat(Object.getOwnPropertySymbols(P)):R},D.prototype.listeners=function(R){var P=N?N+R:R,_=this._events[P];if(!_)return[];if(_.fn)return[_.fn];for(var S=0,y=_.length,d=new Array(y);S<y;S++)d[S]=_[S].fn;return d},D.prototype.listenerCount=function(R){var P=N?N+R:R,_=this._events[P];return _?_.fn?1:_.length:0},D.prototype.emit=function(R,P,_,S,y,d){var s=N?N+R:R;if(!this._events[s])return!1;var u=this._events[s],h=arguments.length,T,g;if(u.fn){u.once&&this.removeListener(R,u.fn,void 0,!0);switch(h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,P),!0;case 3:return u.fn.call(u.context,P,_),!0;case 4:return u.fn.call(u.context,P,_,S),!0;case 5:return u.fn.call(u.context,P,_,S,y),!0;case 6:return u.fn.call(u.context,P,_,S,y,d),!0}for(g=1,T=new Array(h-1);g<h;g++)T[g-1]=arguments[g];u.fn.apply(u.context,T)}else{var f=u.length,w;for(g=0;g<f;g++){u[g].once&&this.removeListener(R,u[g].fn,void 0,!0);switch(h){case 1:u[g].fn.call(u[g].context);break;case 2:u[g].fn.call(u[g].context,P);break;case 3:u[g].fn.call(u[g].context,P,_);break;case 4:u[g].fn.call(u[g].context,P,_,S);break;default:if(!T)for(w=1,T=new Array(h-1);w<h;w++)T[w-1]=arguments[w];u[g].fn.apply(u[g].context,T)}}}return!0},D.prototype.on=function(R,P,_){return B(this,R,P,_,!1)},D.prototype.once=function(R,P,_){return B(this,R,P,_,!0)},D.prototype.removeListener=function(R,P,_,S){var y=N?N+R:R;if(!this._events[y])return this;if(!P)return I(this,y),this;var d=this._events[y];if(d.fn)d.fn===P&&(!S||d.once)&&(!_||d.context===_)&&I(this,y);else{for(var s=0,u=[],h=d.length;s<h;s++)(d[s].fn!==P||S&&!d[s].once||_&&d[s].context!==_)&&u.push(d[s]);u.length?this._events[y]=u.length===1?u[0]:u:I(this,y)}return this},D.prototype.removeAllListeners=function(R){var P;return R?(P=N?N+R:R,this._events[P]&&I(this,P)):(this._events=new O,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=N,D.EventEmitter=D,ee.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ee,X,k){(function(Q){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,U=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(D,E,R){if(R=R||{},D=D.trim(),E=E.trim(),!E){if(!R.alwaysNormalize)return D;var P=I.parseURL(D);if(!P)throw new Error("Error trying to parse base URL.");return P.path=I.normalizePath(P.path),I.buildURLFromParts(P)}var _=I.parseURL(E);if(!_)throw new Error("Error trying to parse relative URL.");if(_.scheme)return R.alwaysNormalize?(_.path=I.normalizePath(_.path),I.buildURLFromParts(_)):E;var S=I.parseURL(D);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var y=O.exec(S.path);S.netLoc=y[1],S.path=y[2]}S.netLoc&&!S.path&&(S.path="/");var d={scheme:S.scheme,netLoc:_.netLoc,path:null,params:_.params,query:_.query,fragment:_.fragment};if(!_.netLoc&&(d.netLoc=S.netLoc,_.path[0]!=="/"))if(!_.path)d.path=S.path,_.params||(d.params=S.params,_.query||(d.query=S.query));else{var s=S.path,u=s.substring(0,s.lastIndexOf("/")+1)+_.path;d.path=I.normalizePath(u)}return d.path===null&&(d.path=R.alwaysNormalize?I.normalizePath(_.path):_.path),I.buildURLFromParts(d)},parseURL:function(D){var E=N.exec(D);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(U,"");D.length!==(D=D.replace(B,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ee.exports=I})(this)},"./node_modules/webworkify-webpack/index.js":function(ee,X,k){function Q(R){var P={};function _(y){if(P[y])return P[y].exports;var d=P[y]={i:y,l:!1,exports:{}};return R[y].call(d.exports,d,d.exports,_),d.l=!0,d.exports}_.m=R,_.c=P,_.i=function(y){return y},_.d=function(y,d,s){_.o(y,d)||Object.defineProperty(y,d,{configurable:!1,enumerable:!0,get:s})},_.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},_.n=function(y){var d=y&&y.__esModule?function(){return y.default}:function(){return y};return _.d(d,"a",d),d},_.o=function(y,d){return Object.prototype.hasOwnProperty.call(y,d)},_.p="/",_.oe=function(y){throw console.error(y),y};var S=_(_.s=ENTRY_MODULE);return S.default||S}var N="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function U(R){return(R+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function B(R){return!isNaN(1*R)}function I(R,P,_){var S={};S[_]=[];var y=P.toString(),d=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return S;for(var s=d[1],u=new RegExp("(\\\\n|\\W)"+U(s)+O,"g"),h;h=u.exec(y);){if(h[3]==="dll-reference")continue;S[_].push(h[3])}for(u=new RegExp("\\("+U(s)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+O,"g");h=u.exec(y);)R[h[2]]||(S[_].push(h[1]),R[h[2]]=k(h[1]).m),S[h[2]]=S[h[2]]||[],S[h[2]].push(h[4]);for(var T=Object.keys(S),g=0;g<T.length;g++)for(var f=0;f<S[T[g]].length;f++)B(S[T[g]][f])&&(S[T[g]][f]=1*S[T[g]][f]);return S}function D(R){var P=Object.keys(R);return P.reduce(function(_,S){return _||R[S].length>0},!1)}function E(R,P){for(var _={main:[P]},S={main:[]},y={main:{}};D(_);)for(var d=Object.keys(_),s=0;s<d.length;s++){var u=d[s],h=_[u],T=h.pop();if(y[u]=y[u]||{},y[u][T]||!R[u][T])continue;y[u][T]=!0,S[u]=S[u]||[],S[u].push(T);for(var g=I(R,R[u][T],u),f=Object.keys(g),w=0;w<f.length;w++)_[f[w]]=_[f[w]]||[],_[f[w]]=_[f[w]].concat(g[f[w]])}return S}ee.exports=function(R,P){P=P||{};var _={main:k.m},S=P.all?{main:Object.keys(_.main)}:E(_,R),y="";Object.keys(S).filter(function(T){return T!=="main"}).forEach(function(T){for(var g=0;S[T][g];)g++;S[T].push(g),_[T][g]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+T+" = ("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+S[T].map(function(f){return""+JSON.stringify(f)+": "+_[T][f].toString()}).join(",")+`});
|
|
`}),y=y+"new (("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(R))+")({"+S.main.map(function(T){return""+JSON.stringify(T)+": "+_.main[T].toString()}).join(",")+"}))(self);";var d=new window.Blob([y],{type:"text/javascript"});if(P.bare)return d;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,u=s.createObjectURL(d),h=new window.Worker(u);return h.objectURL=u,h}},"./src/config.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"hlsDefaultConfig",function(){return w}),k.d(X,"mergeConfig",function(){return c}),k.d(X,"enableStreamingMode",function(){return l});var Q=k("./src/controller/abr-controller.ts"),N=k("./src/controller/audio-stream-controller.ts"),O=k("./src/controller/audio-track-controller.ts"),U=k("./src/controller/subtitle-stream-controller.ts"),B=k("./src/controller/subtitle-track-controller.ts"),I=k("./src/controller/buffer-controller.ts"),D=k("./src/controller/timeline-controller.ts"),E=k("./src/controller/cap-level-controller.ts"),R=k("./src/controller/fps-controller.ts"),P=k("./src/controller/eme-controller.ts"),_=k("./src/controller/cmcd-controller.ts"),S=k("./src/utils/xhr-loader.ts"),y=k("./src/utils/fetch-loader.ts"),d=k("./src/utils/cues.ts"),s=k("./src/utils/mediakeys-helper.ts"),u=k("./src/utils/logger.ts");function h(){return h=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var x=arguments[i];for(var b in x)Object.prototype.hasOwnProperty.call(x,b)&&(a[b]=x[b])}return a},h.apply(this,arguments)}function T(a,i){var x=Object.keys(a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(a);i&&(b=b.filter(function(m){return Object.getOwnPropertyDescriptor(a,m).enumerable})),x.push.apply(x,b)}return x}function g(a){for(var i=1;i<arguments.length;i++){var x=arguments[i]!=null?arguments[i]:{};i%2?T(Object(x),!0).forEach(function(b){f(a,b,x[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(x)):T(Object(x)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(x,b))})}return a}function f(a,i,x){return i in a?Object.defineProperty(a,i,{value:x,enumerable:!0,configurable:!0,writable:!0}):a[i]=x,a}var w=g(g({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:S.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Q.default,bufferController:I.default,capLevelController:E.default,fpsController:R.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:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},v()),{},{subtitleStreamController:U.SubtitleStreamController,subtitleTrackController:B.default,timelineController:D.TimelineController,audioStreamController:N.default,audioTrackController:O.default,emeController:P.default,cmcdController:_.default});function v(){return{cueHandler:d.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 c(a,i){if((i.liveSyncDurationCount||i.liveMaxLatencyDurationCount)&&(i.liveSyncDuration||i.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(i.liveMaxLatencyDurationCount!==void 0&&(i.liveSyncDurationCount===void 0||i.liveMaxLatencyDurationCount<=i.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(i.liveMaxLatencyDuration!==void 0&&(i.liveSyncDuration===void 0||i.liveMaxLatencyDuration<=i.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},a,i)}function l(a){var i=a.loader;if(i!==y.default&&i!==S.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1;else{var x=Object(y.fetchSupported)();x&&(a.loader=y.default,a.progressive=!0,a.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/polyfills/number.ts"),N=k("./src/utils/ewma-bandwidth-estimator.ts"),O=k("./src/events.ts"),U=k("./src/utils/buffer-helper.ts"),B=k("./src/errors.ts"),I=k("./src/types/loader.ts"),D=k("./src/utils/logger.ts");function E(_,S){for(var y=0;y<S.length;y++){var d=S[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(_,d.key,d)}}function R(_,S,y){return S&&E(_.prototype,S),y&&E(_,y),_}var P=function(){function _(y){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=y;var d=y.config;this.bwEstimator=new N.default(d.abrEwmaSlowVoD,d.abrEwmaFastVoD,d.abrEwmaDefaultEstimate),this.registerListeners()}var S=_.prototype;return S.registerListeners=function(){var d=this.hls;d.on(O.Events.FRAG_LOADING,this.onFragLoading,this),d.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(O.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var d=this.hls;d.off(O.Events.FRAG_LOADING,this.onFragLoading,this),d.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(O.Events.ERROR,this.onError,this)},S.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},S.onFragLoading=function(d,s){var u=s.frag;if(u.type===I.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=u,this.partCurrent=(h=s.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},S.onLevelLoaded=function(d,s){var u=this.hls.config;s.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},S._abandonRulesCheck=function(){var d=this.fragCurrent,s=this.partCurrent,u=this.hls,h=u.autoLevelEnabled,T=u.config,g=u.media;if(!d||!g)return;var f=s?s.stats:d.stats,w=s?s.duration:d.duration;if(f.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!h||g.paused||!g.playbackRate||!g.readyState)return;var v=performance.now()-f.loading.start,c=Math.abs(g.playbackRate);if(v<=500*w/c)return;var l=u.levels,a=u.minAutoLevel,i=l[d.level],x=f.total||Math.max(f.loaded,Math.round(w*i.maxBitrate/8)),b=Math.max(1,f.bwEstimate?f.bwEstimate/8:f.loaded*1e3/v),m=(x-f.loaded)/b,L=g.currentTime,C=(U.BufferHelper.bufferInfo(g,L,T.maxBufferHole).end-L)/c;if(C>=2*w/c||m<=C)return;var H=Number.POSITIVE_INFINITY,J;for(J=d.level-1;J>a;J--){var W=l[J].maxBitrate;if(H=w*W/(8*.8*b),H<C)break}if(H>=m)return;var j=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+d.sn+(s?" part "+s.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+J+`
|
|
Current BW estimate: `+(Object(Q.isFiniteNumber)(j)?(j/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+m.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+H.toFixed(3)+` s
|
|
Time to underbuffer: `+C.toFixed(3)+" s"),u.nextLoadLevel=J,this.bwEstimator.sample(v,f.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),u.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:s,stats:f})},S.onFragLoaded=function(d,s){var u=s.frag,h=s.part;if(u.type===I.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(u.sn)){var T=h?h.stats:u.stats,g=h?h.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var f=this.hls.levels[u.level],w=(f.loaded?f.loaded.bytes:0)+T.loaded,v=(f.loaded?f.loaded.duration:0)+g;f.loaded={bytes:w,duration:v},f.realBitrate=Math.round(8*w/v)}if(u.bitrateTest){var c={stats:T,frag:u,part:h,id:u.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,c),u.bitrateTest=!1}}},S.onFragBuffered=function(d,s){var u=s.frag,h=s.part,T=h?h.stats:u.stats;if(T.aborted)return;if(u.type!==I.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var g=T.parsing.end-T.loading.start;this.bwEstimator.sample(g,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},S.onError=function(d,s){switch(s.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},S.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},S.getNextABRAutoLevel=function(){var d=this.fragCurrent,s=this.partCurrent,u=this.hls,h=u.maxAutoLevel,T=u.config,g=u.minAutoLevel,f=u.media,w=s?s.duration:d?d.duration:0,v=f?f.currentTime:0,c=f&&f.playbackRate!==0?Math.abs(f.playbackRate):1,l=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,a=(U.BufferHelper.bufferInfo(f,v,T.maxBufferHole).end-v)/c,i=this.findBestLevel(l,g,h,a,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(i>=0)return i;D.logger.trace((a?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=w?Math.min(w,T.maxStarvationDelay):T.maxStarvationDelay,b=T.abrBandWidthFactor,m=T.abrBandWidthUpFactor;if(!a){var L=this.bitrateTestDelay;if(L){var C=w?Math.min(w,T.maxLoadingDelay):T.maxLoadingDelay;x=C-L,D.logger.trace("bitrate test took "+Math.round(1e3*L)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),b=m=1}}return i=this.findBestLevel(l,g,h,a+x,b,m),Math.max(i,0)},S.findBestLevel=function(d,s,u,h,T,g){for(var f,w=this.fragCurrent,v=this.partCurrent,c=this.lastLoadedFragLevel,l=this.hls.levels,a=l[c],i=!!(a!=null&&(f=a.details)!==null&&f!==void 0&&f.live),x=a==null?void 0:a.codecSet,b=v?v.duration:w?w.duration:0,m=u;m>=s;m--){var L=l[m];if(!L||x&&L.codecSet!==x)continue;var C=L.details,H=(v?C==null?void 0:C.partTarget:C==null?void 0:C.averagetargetduration)||b,J=void 0;m<=c?J=T*d:J=g*d;var W=l[m].maxBitrate,j=W*H/J;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+m+"/"+Math.round(J)+"/"+W+"/"+H+"/"+h+"/"+j),J>W&&(!j||i&&!this.bitrateTestDelay||j<h))return m}return-1},R(_,[{key:"nextAutoLevel",get:function(){var d=this._nextAutoLevel,s=this.bwEstimator;if(d!==-1&&(!s||!s.canEstimate()))return d;var u=this.getNextABRAutoLevel();return d!==-1&&(u=Math.min(d,u)),u},set:function(d){this._nextAutoLevel=d}}]),_}();X.default=P},"./src/controller/audio-stream-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/polyfills/number.ts"),N=k("./src/controller/base-stream-controller.ts"),O=k("./src/events.ts"),U=k("./src/utils/buffer-helper.ts"),B=k("./src/controller/fragment-tracker.ts"),I=k("./src/types/level.ts"),D=k("./src/types/loader.ts"),E=k("./src/loader/fragment.ts"),R=k("./src/demux/chunk-cache.ts"),P=k("./src/demux/transmuxer-interface.ts"),_=k("./src/types/transmuxer.ts"),S=k("./src/controller/fragment-finders.ts"),y=k("./src/utils/discontinuities.ts"),d=k("./src/errors.ts"),s=k("./src/utils/logger.ts");function u(){return u=Object.assign||function(w){for(var v=1;v<arguments.length;v++){var c=arguments[v];for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(w[l]=c[l])}return w},u.apply(this,arguments)}function h(w,v){w.prototype=Object.create(v.prototype),w.prototype.constructor=w,T(w,v)}function T(w,v){return T=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},T(w,v)}var g=100,f=function(w){h(v,w);function v(l,a){var i;return i=w.call(this,l,a,"[audio-stream-controller]")||this,i.videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i._registerListeners(),i}var c=v.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var a=this.hls;a.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(O.Events.ERROR,this.onError,this),a.on(O.Events.BUFFER_RESET,this.onBufferReset,this),a.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c._unregisterListeners=function(){var a=this.hls;a.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),a.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(O.Events.ERROR,this.onError,this),a.off(O.Events.BUFFER_RESET,this.onBufferReset,this),a.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},c.onInitPtsFound=function(a,i){var x=i.frag,b=i.id,m=i.initPTS;if(b==="main"){var L=x.cc;this.initPTS[x.cc]=m,this.log("InitPTS for cc: "+L+" found from main: "+m),this.videoTrackCC=L,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},c.startLoad=function(a){if(!this.levels){this.startPosition=a,this.state=N.State.STOPPED;return}var i=this.lastCurrentTime;this.stopLoad(),this.setInterval(g),this.fragLoadError=0,i>0&&a===-1?(this.log("Override startPosition with lastCurrentTime @"+i.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()},c.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var a,i=this.levels,x=this.trackId,b=i==null||((a=i[x])===null||a===void 0)?void 0:a.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var m,L=performance.now(),C=this.retryDate;(!C||L>=C||(m=this.media)!==null&&m!==void 0&&m.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var J=H.frag,W=H.part,j=H.cache,$=H.complete;if(this.initPTS[J.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var se=j.flush(),me={frag:J,part:W,payload:se,networkDetails:null};this._handleFragmentLoadProgress(me),$&&w.prototype._handleFragmentLoadComplete.call(this,me)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+J.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ee=this.getLoadPosition(),We=U.BufferHelper.bufferInfo(this.mediaBuffer,Ee,this.config.maxBufferHole),Be=Object(S.fragmentWithinToleranceTest)(We.end,this.config.maxFragLookUpTolerance,J);Be<0&&(s.logger.log("Waiting fragment cc ("+J.cc+") @ "+J.start+" cancelled because another fragment at "+We.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},c.clearWaitingFragment=function(){var a=this.waitingData;a&&(this.fragmentTracker.removeFragment(a.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},c.onTickEnd=function(){var a=this.media;if(!a||!a.readyState)return;var i=this.mediaBuffer?this.mediaBuffer:a,x=i.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=a.currentTime},c.doTickIdle=function(){var a,i,x=this.hls,b=this.levels,m=this.media,L=this.trackId,C=x.config;if(!b||!b[L])return;if(!m&&(this.startFragRequested||!C.startFragPrefetch))return;var H=b[L],J=H.details;if(!J||J.live&&this.levelLastLoaded!==L||this.waitForCdnTuneIn(J)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(W===null)return;var j=W.len,$=this.getMaxBufferLength(),se=this.audioSwitch;if(j>=$&&!se)return;if(!se&&this._streamEnded(W,J)){x.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var me=J.fragments,Ee=me[0].start,We=W.end;if(se){var Be=this.getLoadPosition();We=Be,J.PTSKnown&&Be<Ee&&((W.end>Ee||W.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),m.currentTime=Ee+.05))}var Ne=this.getNextFragment(We,J);if(!Ne){this.bufferFlushed=!0;return}((a=Ne.decryptdata)===null||a===void 0?void 0:a.keyFormat)==="identity"&&!((i=Ne.decryptdata)!==null&&i!==void 0&&i.key)?this.loadKey(Ne,J):this.loadFragment(Ne,J,We)},c.getMaxBufferLength=function(){var a=w.prototype.getMaxBufferLength.call(this),i=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return i===null?a:Math.max(a,i.len)},c.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},c.onAudioTracksUpdated=function(a,i){var x=i.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(b){return new I.Level(b)})},c.onAudioTrackSwitching=function(a,i){var x=!!i.url;this.trackId=i.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(g):this.resetTransmuxer(),x?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},c.onLevelLoaded=function(a,i){this.mainDetails=i.details},c.onAudioTrackLoaded=function(a,i){var x,b=this.levels,m=i.details,L=i.id;if(!b){this.warn("Audio tracks were reset while loading level "+L);return}this.log("Track "+L+" loaded ["+m.startSN+","+m.endSN+"],duration:"+m.totalduration);var C=b[L],H=0;if(m.live||(x=C.details)!==null&&x!==void 0&&x.live){var J=this.mainDetails;if(m.fragments[0]||(m.deltaUpdateFailed=!0),m.deltaUpdateFailed||!J)return;!C.details&&m.hasProgramDateTime&&J.hasProgramDateTime?(Object(y.alignMediaPlaylistByPDT)(m,J),H=m.fragments[0].start):H=this.alignPlaylists(m,C.details)}C.details=m,this.levelLastLoaded=L,!this.startFragRequested&&(this.mainDetails||!m.live)&&this.setStartPosition(C.details,H),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(m)&&(this.state=N.State.IDLE),this.tick()},c._handleFragmentLoadProgress=function(a){var i,x=a.frag,b=a.part,m=a.payload,L=this.config,C=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var J=H[C];console.assert(J,"Audio track is defined on fragment load progress");var W=J.details;console.assert(W,"Audio track details are defined on fragment load progress");var j=L.defaultAudioCodec||J.audioCodec||"mp4a.40.2",$=this.transmuxer;$||($=this.transmuxer=new P.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var se=this.initPTS[x.cc],me=(i=x.initSegment)===null||i===void 0?void 0:i.data;if(se!==void 0){var Ee=!1,We=b?b.index:-1,Be=We!==-1,Ne=new _.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,m.byteLength,We,Be);$.push(m,me,j,"",x,b,W.totalduration,Ee,Ne,se)}else{s.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+W.startSN+" ,"+W.endSN+"],track "+C);var Le=this.waitingData=this.waitingData||{frag:x,part:b,cache:new R.default,complete:!1},Ue=Le.cache;Ue.push(new Uint8Array(m)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},c._handleFragmentLoadComplete=function(a){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,a)},c.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},c.onBufferCreated=function(a,i){var x=i.tracks.audio;x&&(this.mediaBuffer=x.buffer),i.tracks.video&&(this.videoBuffer=i.tracks.video.buffer)},c.onFragBuffered=function(a,i){var x=i.frag,b=i.part;if(x.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(b?" p: "+b.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}x.sn!=="initSegment"&&(this.fragPrevious=x,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,b)},c.onError=function(a,i){switch(i.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,i);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=i.fatal?N.State.ERROR:N.State.IDLE,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(i.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var x=!0,b=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);b&&b.len>.5&&(x=!this.reduceMaxBufferLength(b.len)),x&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},c.onBufferFlushed=function(a,i){var x=i.type;x===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},c._handleTransmuxComplete=function(a){var i,x="audio",b=this.hls,m=a.remuxResult,L=a.chunkMeta,C=this.getCurrentContext(L);if(!C){this.warn("The loading context changed while buffering fragment "+L.sn+" of level "+L.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(L.level);return}var H=C.frag,J=C.part,W=m.audio,j=m.text,$=m.id3,se=m.initSegment;if(this.fragContextChanged(H))return;if(this.state=N.State.PARSING,this.audioSwitch&&W&&this.completeAudioSwitch(),se!=null&&se.tracks&&(this._bufferInitSegment(se.tracks,H,L),b.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:x,tracks:se.tracks})),W){var me=W.startPTS,Ee=W.endPTS,We=W.startDTS,Be=W.endDTS;J&&(J.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:me,endPTS:Ee,startDTS:We,endDTS:Be}),H.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,me,Ee,We,Be),this.bufferFragmentData(W,H,J,L)}if($!=null&&(i=$.samples)!==null&&i!==void 0&&i.length){var Ne=u({frag:H,id:x},$);b.trigger(O.Events.FRAG_PARSING_METADATA,Ne)}if(j){var Le=u({frag:H,id:x},j);b.trigger(O.Events.FRAG_PARSING_USERDATA,Le)}},c._bufferInitSegment=function(a,i,x){if(this.state!==N.State.PARSING)return;a.video&&delete a.video;var b=a.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,a);var m=b.initSegment;if(m!=null&&m.byteLength){var L={type:"audio",frag:i,part:null,chunkMeta:x,parent:i.type,data:m};this.hls.trigger(O.Events.BUFFER_APPENDING,L)}this.tick()},c.loadFragment=function(a,i,x){var b=this.fragmentTracker.getState(a);this.fragCurrent=a,(this.audioSwitch||b===B.FragmentState.NOT_LOADED||b===B.FragmentState.PARTIAL)&&(a.sn==="initSegment"?this._loadInitSegment(a):i.live&&!Object(Q.isFiniteNumber)(this.initPTS[a.cc])?(this.log("Waiting for video PTS in continuity counter "+a.cc+" of live stream before loading audio fragment "+a.sn+" of level "+this.trackId),this.state=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,a,i,x)))},c.completeAudioSwitch=function(){var a=this.hls,i=this.media,x=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,a.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:x})},v}(N.default);X.default=f},"./src/controller/audio-track-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/events.ts"),N=k("./src/errors.ts"),O=k("./src/controller/base-playlist-controller.ts"),U=k("./src/types/loader.ts");function B(P,_){for(var S=0;S<_.length;S++){var y=_[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(P,y.key,y)}}function I(P,_,S){return _&&B(P.prototype,_),S&&B(P,S),P}function D(P,_){P.prototype=Object.create(_.prototype),P.prototype.constructor=P,E(P,_)}function E(P,_){return E=Object.setPrototypeOf||function(y,d){return y.__proto__=d,y},E(P,_)}var R=function(P){D(_,P);function _(y){var d;return d=P.call(this,y,"[audio-track-controller]")||this,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.trackName="",d.selectDefaultTrack=!0,d.registerListeners(),d}var S=_.prototype;return S.registerListeners=function(){var d=this.hls;d.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(Q.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var d=this.hls;d.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(Q.Events.ERROR,this.onError,this)},S.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,P.prototype.destroy.call(this)},S.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},S.onManifestParsed=function(d,s){this.tracks=s.audioTracks||[]},S.onAudioTrackLoaded=function(d,s){var u=s.id,h=s.details,T=this.tracksInGroup[u];if(!T){this.warn("Invalid audio track id "+u);return}var g=T.details;T.details=s.details,this.log("audioTrack "+u+" loaded ["+h.startSN+"-"+h.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,s,g))},S.onLevelLoading=function(d,s){this.switchLevel(s.level)},S.onLevelSwitching=function(d,s){this.switchLevel(s.level)},S.switchLevel=function(d){var s=this.hls.levels[d];if(!(s!=null&&s.audioGroupIds))return;var u=s.audioGroupIds[s.urlId];if(this.groupId!==u){this.groupId=u;var h=this.tracks.filter(function(g){return!u||g.groupId===u});this.selectDefaultTrack&&!h.some(function(g){return g.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=h;var T={audioTracks:h};this.log("Updating audio tracks, "+h.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(Q.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},S.onError=function(d,s){if(P.prototype.onError.call(this,d,s),s.fatal||!s.context)return;s.context.type===U.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},S.setAudioTrack=function(d){var s=this.tracksInGroup;if(d<0||d>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=s[this.trackId];this.log("Now switching to audio-track index "+d);var h=s[d],T=h.id,g=h.groupId,f=g===void 0?"":g,w=h.name,v=h.type,c=h.url;if(this.trackId=d,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:f,name:w,type:v,url:c}),h.details&&!h.details.live)return;var l=this.switchParams(h.url,u==null?void 0:u.details);this.loadPlaylist(l)},S.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,u=this.findTrackId(s)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},S.findTrackId=function(d){for(var s=this.tracksInGroup,u=0;u<s.length;u++){var h=s[u];if((!this.selectDefaultTrack||h.default)&&(!d||d===h.name))return h.id}return-1},S.loadPlaylist=function(d){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var u=s.id,h=s.groupId,T=s.url;if(d)try{T=d.addDirectives(T)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(Q.Events.AUDIO_TRACK_LOADING,{url:T,id:u,groupId:h,deliveryDirectives:d||null})}},I(_,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1,this.setAudioTrack(d)}}]),_}(O.default);X.default=R},"./src/controller/base-playlist-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return I});var Q=k("./src/polyfills/number.ts"),N=k("./src/types/level.ts"),O=k("./src/controller/level-helper.ts"),U=k("./src/utils/logger.ts"),B=k("./src/errors.ts"),I=function(){function D(R,P){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=U.logger.log.bind(U.logger,P+":"),this.warn=U.logger.warn.bind(U.logger,P+":"),this.hls=R}var E=D.prototype;return E.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},E.onError=function(P,_){_.fatal&&_.type===B.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},E.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},E.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},E.stopLoad=function(){this.canLoad=!1,this.clearTimer()},E.switchParams=function(P,_){var S=_==null?void 0:_.renditionReports;if(S)for(var y=0;y<S.length;y++){var d=S[y],s=""+d.URI;if(s===P.substr(-s.length)){var u=parseInt(d["LAST-MSN"]),h=parseInt(d["LAST-PART"]);if(_&&this.hls.config.lowLatencyMode){var T=Math.min(_.age-_.partTarget,_.targetduration);h!==void 0&&T>_.partTarget&&(h+=1)}if(Object(Q.isFiniteNumber)(u))return new N.HlsUrlParameters(u,Object(Q.isFiniteNumber)(h)?h:void 0,N.HlsSkip.No)}}},E.loadPlaylist=function(P){},E.shouldLoadTrack=function(P){return this.canLoad&&P&&!!P.url&&(!P.details||P.details.live)},E.playlistLoaded=function(P,_,S){var y=this,d=_.details,s=_.stats,u=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(d.advancedDateTime=Date.now()-u,d.live||S!=null&&S.live){if(d.reloaded(S),S&&this.log("live playlist "+P+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),S&&d.fragments.length>0&&Object(O.mergeDetails)(S,d),!this.canLoad||!d.live)return;var h,T=void 0,g=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var f=this.hls.config.lowLatencyMode,w=d.lastPartSn,v=d.endSN,c=d.lastPartIndex,l=c!==-1,a=w===v,i=f?0:c;l?(T=a?v+1:w,g=a?i:c+1):T=v+1;var x=d.age,b=x+d.ageHeader,m=Math.min(b-d.partTarget,d.targetduration*1.5);if(m>0){if(S&&m>S.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+S.tuneInGoal+" to: "+m+" with playlist age: "+d.age),m=0;else{var L=Math.floor(m/d.targetduration);if(T+=L,g!==void 0){var C=Math.round(m%d.targetduration/d.partTarget);g+=C}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+m+" skip sn "+L+" to part "+g)}d.tuneInGoal=m}if(h=this.getDeliveryDirectives(d,_.deliveryDirectives,T,g),f||!a){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(d,_.deliveryDirectives,T,g);var H=Object(O.computeReloadInterval)(d,s);T!==void 0&&d.canBlockReload&&(H-=d.partTarget||1),this.log("reload live playlist "+P+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return y.loadPlaylist(h)},H)}else this.clearTimer()},E.getDeliveryDirectives=function(P,_,S,y){var d=Object(N.getSkipValue)(P,S);return _!=null&&_.skip&&P.deltaUpdateFailed&&(S=_.msn,y=_.part,d=N.HlsSkip.No),new N.HlsUrlParameters(S,y,d)},E.retryLoadingOrFail=function(P){var _=this,S=this.hls.config,y=this.retryCount<S.levelLoadingMaxRetry;if(y){var d;if(this.retryCount++,P.details.indexOf("LoadTimeOut")>-1&&(d=P.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+P.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*S.levelLoadingRetryDelay,S.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return _.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+P.details+'"')}}else this.warn('cannot recover from error "'+P.details+'"'),this.clearTimer(),P.fatal=!0;return y},D}()},"./src/controller/base-stream-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"State",function(){return v}),k.d(X,"default",function(){return c});var Q=k("./src/polyfills/number.ts"),N=k("./src/task-loop.ts"),O=k("./src/controller/fragment-tracker.ts"),U=k("./src/utils/buffer-helper.ts"),B=k("./src/utils/logger.ts"),I=k("./src/events.ts"),D=k("./src/errors.ts"),E=k("./src/types/transmuxer.ts"),R=k("./src/utils/mp4-tools.ts"),P=k("./src/utils/discontinuities.ts"),_=k("./src/controller/fragment-finders.ts"),S=k("./src/controller/level-helper.ts"),y=k("./src/loader/fragment-loader.ts"),d=k("./src/crypt/decrypter.ts"),s=k("./src/utils/time-ranges.ts"),u=k("./src/types/loader.ts");function h(l,a){for(var i=0;i<a.length;i++){var x=a[i];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(l,x.key,x)}}function T(l,a,i){return a&&h(l.prototype,a),i&&h(l,i),l}function g(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function f(l,a){l.prototype=Object.create(a.prototype),l.prototype.constructor=l,w(l,a)}function w(l,a){return w=Object.setPrototypeOf||function(x,b){return x.__proto__=b,x},w(l,a)}var v={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"},c=function(l){f(a,l);function a(x,b,m){var L;return L=l.call(this)||this,L.hls=void 0,L.fragPrevious=null,L.fragCurrent=null,L.fragmentTracker=void 0,L.transmuxer=null,L._state=v.STOPPED,L.media=void 0,L.mediaBuffer=void 0,L.config=void 0,L.bitrateTest=!1,L.lastCurrentTime=0,L.nextLoadPosition=0,L.startPosition=0,L.loadedmetadata=!1,L.fragLoadError=0,L.retryDate=0,L.levels=null,L.fragmentLoader=void 0,L.levelLastLoaded=null,L.startFragRequested=!1,L.decrypter=void 0,L.initPTS=[],L.onvseeking=null,L.onvended=null,L.logPrefix="",L.log=void 0,L.warn=void 0,L.logPrefix=m,L.log=B.logger.log.bind(B.logger,m+":"),L.warn=B.logger.warn.bind(B.logger,m+":"),L.hls=x,L.fragmentLoader=new y.default(x.config),L.fragmentTracker=b,L.config=x.config,L.decrypter=new d.default(x,x.config),x.on(I.Events.KEY_LOADED,L.onKeyLoaded,g(L)),L}var i=a.prototype;return i.doTick=function(){this.onTickEnd()},i.onTickEnd=function(){},i.startLoad=function(b){},i.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},i._streamEnded=function(b,m){var L=this.fragCurrent,C=this.fragmentTracker;if(!m.live&&L&&L.sn===m.endSN&&!b.nextStart){var H=C.getState(L);return H===O.FragmentState.PARTIAL||H===O.FragmentState.OK}return!1},i.onMediaAttached=function(b,m){var L=this.media=this.mediaBuffer=m.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),L.addEventListener("seeking",this.onvseeking),L.addEventListener("ended",this.onvended);var C=this.config;this.levels&&C.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(C.startPosition)},i.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},i.onMediaSeeking=function(){var b=this.config,m=this.fragCurrent,L=this.media,C=this.mediaBuffer,H=this.state,J=L?L.currentTime:0,W=U.BufferHelper.bufferInfo(C||L,J,b.maxBufferHole);if(this.log("media seeking to "+(Object(Q.isFiniteNumber)(J)?J.toFixed(3):J)+", state: "+H),H===v.ENDED)this.resetLoadingState();else if(m&&!W.len){var j=b.maxFragLookUpTolerance,$=m.start-j,se=m.start+m.duration+j,me=J>se;(J<$||me)&&(me&&m.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),m.loader.abort()),this.resetLoadingState())}L&&(this.lastCurrentTime=J),!this.loadedmetadata&&!W.len&&(this.nextLoadPosition=this.startPosition=J),this.tickImmediate()},i.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},i.onKeyLoaded=function(b,m){if(this.state!==v.KEY_LOADING||m.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var L=this.levels[m.frag.level].details;L&&this.loadFragment(m.frag,L,m.frag.start)},i.onHandlerDestroying=function(){this.stopLoad(),l.prototype.onHandlerDestroying.call(this)},i.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(I.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,l.prototype.onHandlerDestroyed.call(this)},i.loadKey=function(b,m){this.log("Loading key for "+b.sn+" of ["+m.startSN+"-"+m.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=v.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(I.Events.KEY_LOADING,{frag:b})},i.loadFragment=function(b,m,L){this._loadFragForPlayback(b,m,L)},i._loadFragForPlayback=function(b,m,L){var C=this,H=function(W){if(C.fragContextChanged(b)){C.warn("Fragment "+b.sn+(W.part?" p: "+W.part.index:"")+" of level "+b.level+" was dropped during download."),C.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,C._handleFragmentLoadProgress(W)};this._doFragLoad(b,m,L,H).then(function(J){if(!J)return;C.fragLoadError=0;var W=C.state;if(C.fragContextChanged(b)){(W===v.FRAG_LOADING||W===v.BACKTRACKING||!C.fragCurrent&&W===v.PARSING)&&(C.fragmentTracker.removeFragment(b),C.state=v.IDLE);return}if("payload"in J&&(C.log("Loaded fragment "+b.sn+" of level "+b.level),C.hls.trigger(I.Events.FRAG_LOADED,J),C.state===v.BACKTRACKING)){C.fragmentTracker.backtrack(b,J),C.resetFragmentLoading(b);return}C._handleFragmentLoadComplete(J)}).catch(function(J){C.warn(J),C.resetFragmentLoading(b)})},i.flushMainBuffer=function(b,m,L){if(L===void 0&&(L=null),!(b-m))return;var C={startOffset:b,endOffset:m,type:L};this.fragLoadError=0,this.hls.trigger(I.Events.BUFFER_FLUSHING,C)},i._loadInitSegment=function(b){var m=this;this._doFragLoad(b).then(function(L){if(!L||m.fragContextChanged(b)||!m.levels)throw new Error("init load aborted");return L}).then(function(L){var C=m.hls,H=L.payload,J=b.decryptdata;if(H&&H.byteLength>0&&J&&J.key&&J.iv&&J.method==="AES-128"){var W=self.performance.now();return m.decrypter.webCryptoDecrypt(new Uint8Array(H),J.key.buffer,J.iv.buffer).then(function(j){var $=self.performance.now();return C.trigger(I.Events.FRAG_DECRYPTED,{frag:b,payload:j,stats:{tstart:W,tdecrypt:$}}),L.payload=j,L})}return L}).then(function(L){var C=m.fragCurrent,H=m.hls,J=m.levels;if(!J)throw new Error("init load aborted, missing levels");var W=J[b.level].details;console.assert(W,"Level details are defined when init segment is loaded");var j=b.stats;m.state=v.IDLE,m.fragLoadError=0,b.data=new Uint8Array(L.payload),j.parsing.start=j.buffering.start=self.performance.now(),j.parsing.end=j.buffering.end=self.performance.now(),L.frag===C&&H.trigger(I.Events.FRAG_BUFFERED,{stats:j,frag:C,part:null,id:b.type}),m.tick()}).catch(function(L){m.warn(L),m.resetFragmentLoading(b)})},i.fragContextChanged=function(b){var m=this.fragCurrent;return!b||!m||b.level!==m.level||b.sn!==m.sn||b.urlId!==m.urlId},i.fragBufferedComplete=function(b,m){var L=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(m?" part: "+m.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+s.default.toString(U.BufferHelper.getBuffered(L))),this.state=v.IDLE,this.tick()},i._handleFragmentLoadComplete=function(b){var m=this.transmuxer;if(!m)return;var L=b.frag,C=b.part,H=b.partsLoaded,J=!H||H.length===0||H.some(function(j){return!j}),W=new E.ChunkMetadata(L.level,L.sn,L.stats.chunkCount+1,0,C?C.index:-1,!J);m.flush(W)},i._handleFragmentLoadProgress=function(b){},i._doFragLoad=function(b,m,L,C){var H=this;if(L===void 0&&(L=null),!this.levels)throw new Error("frag load aborted, missing levels");if(L=Math.max(b.start,L||0),this.config.lowLatencyMode&&m){var J=m.partList;if(J&&C){L>b.end&&m.fragmentHint&&(b=m.fragmentHint);var W=this.getNextPart(J,b,L);if(W>-1){var j=J[W];return this.log("Loading part sn: "+b.sn+" p: "+j.index+" cc: "+b.cc+" of playlist ["+m.startSN+"-"+m.endSN+"] parts [0-"+W+"-"+(J.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(L.toFixed(3))),this.nextLoadPosition=j.start+j.duration,this.state=v.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:b,part:J[W],targetBufferTime:L}),this.doFragPartsLoad(b,J,W,C).catch(function($){return H.handleFragLoadError($)})}else if(!b.url||this.loadedEndOfParts(J,L))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(m?"of ["+m.startSN+"-"+m.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(L.toFixed(3))),Object(Q.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=v.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:b,targetBufferTime:L}),this.fragmentLoader.load(b,C).catch(function($){return H.handleFragLoadError($)})},i.doFragPartsLoad=function(b,m,L,C){var H=this;return new Promise(function(J,W){var j=[],$=function se(me){var Ee=m[me];H.fragmentLoader.loadPart(b,Ee,C).then(function(We){j[Ee.index]=We;var Be=We.part;H.hls.trigger(I.Events.FRAG_LOADED,We);var Ne=m[me+1];if(Ne&&Ne.fragment===b)se(me+1);else return J({frag:b,part:Be,partsLoaded:j})}).catch(W)};$(L)})},i.handleFragLoadError=function(b){var m=b.data;return m&&m.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(m.frag,m.part):this.hls.trigger(I.Events.ERROR,m),null},i._handleTransmuxerFlush=function(b){var m=this.getCurrentContext(b);if(!m||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var L=m.frag,C=m.part,H=m.level,J=self.performance.now();L.stats.parsing.end=J,C&&(C.stats.parsing.end=J),this.updateLevelTiming(L,C,H,b.partial)},i.getCurrentContext=function(b){var m=this.levels,L=b.level,C=b.sn,H=b.part;if(!m||!m[L])return this.warn("Levels object was unset while buffering fragment "+C+" of level "+L+". The current chunk will not be buffered."),null;var J=m[L],W=H>-1?Object(S.getPartWith)(J,C,H):null,j=W?W.fragment:Object(S.getFragmentWithSN)(J,C,this.fragCurrent);return j?{frag:j,part:W,level:J}:null},i.bufferFragmentData=function(b,m,L,C){if(!b||this.state!==v.PARSING)return;var H=b.data1,J=b.data2,W=H;if(H&&J&&(W=Object(R.appendUint8Array)(H,J)),!W||!W.length)return;var j={type:b.type,frag:m,part:L,chunkMeta:C,parent:m.type,data:W};this.hls.trigger(I.Events.BUFFER_APPENDING,j),b.dropped&&b.independent&&!L&&this.flushBufferGap(m)},i.flushBufferGap=function(b){var m=this.media;if(!m)return;if(!U.BufferHelper.isBuffered(m,m.currentTime)){this.flushMainBuffer(0,b.start);return}var L=m.currentTime,C=U.BufferHelper.bufferInfo(m,L,0),H=b.duration,J=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),W=Math.max(Math.min(b.start-J,C.end-J),L+J);b.start-W>J&&this.flushMainBuffer(W,b.start)},i.getFwdBufferInfo=function(b,m){var L=this.config,C=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(C))return null;var H=U.BufferHelper.bufferInfo(b,C,L.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var J=this.fragmentTracker.getBufferedFrag(C,m);if(J&&H.nextStart<J.end)return U.BufferHelper.bufferInfo(b,C,Math.max(H.nextStart,L.maxBufferHole))}return H},i.getMaxBufferLength=function(b){var m=this.config,L;return b?L=Math.max(8*m.maxBufferSize/b,m.maxBufferLength):L=m.maxBufferLength,Math.min(L,m.maxMaxBufferLength)},i.reduceMaxBufferLength=function(b){var m=this.config,L=b||m.maxBufferLength;return m.maxMaxBufferLength>=L?(m.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+m.maxMaxBufferLength+"s"),!0):!1},i.getNextFragment=function(b,m){var L,C,H=m.fragments,J=H.length;if(!J)return null;var W=this.config,j=H[0].start,$;if(m.live){var se=W.initialLiveManifestSize;if(J<se)return this.warn("Not enough fragments to start playback (have: "+J+", need: "+se+")"),null;!m.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&($=this.getInitialLiveFragment(m,H),this.startPosition=$?this.hls.liveSyncPosition||$.start:b)}else b<=j&&($=H[0]);if(!$){var me=W.lowLatencyMode?m.partEnd:m.fragmentEnd;$=this.getFragmentAtPosition(b,me,m)}return(L=$)!==null&&L!==void 0&&L.initSegment&&!((C=$)!==null&&C!==void 0&&C.initSegment.data)&&!this.bitrateTest&&($=$.initSegment),$},i.getNextPart=function(b,m,L){for(var C=-1,H=!1,J=!0,W=0,j=b.length;W<j;W++){var $=b[W];if(J=J&&!$.independent,C>-1&&L<$.start)break;var se=$.loaded;!se&&(H||$.independent||J)&&$.fragment===m&&(C=W),H=se}return C},i.loadedEndOfParts=function(b,m){var L=b[b.length-1];return L&&m>L.start&&L.loaded},i.getInitialLiveFragment=function(b,m){var L=this.fragPrevious,C=null;if(L){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+L.programDateTime),C=Object(_.findFragmentByPDT)(m,L.endProgramDateTime,this.config.maxFragLookUpTolerance)),!C){var H=L.sn+1;if(H>=b.startSN&&H<=b.endSN){var J=m[H-b.startSN];L.cc===J.cc&&(C=J,this.log("Live playlist, switching playlist, load frag with next SN: "+C.sn))}C||(C=Object(_.findFragWithCC)(m,L.cc),C&&this.log("Live playlist, switching playlist, load frag with same CC: "+C.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(C=this.getFragmentAtPosition(W,this.bitrateTest?b.fragmentEnd:b.edge,b))}return C},i.getFragmentAtPosition=function(b,m,L){var C=this.config,H=this.fragPrevious,J=L.fragments,W=L.endSN,j=L.fragmentHint,$=C.maxFragLookUpTolerance,se=!!(C.lowLatencyMode&&L.partList&&j);se&&j&&!this.bitrateTest&&(J=J.concat(j),W=j.sn);var me;if(b<m){var Ee=b>m-$?0:$;me=Object(_.findFragmentByPTS)(H,J,b,Ee)}else me=J[J.length-1];if(me){var We=me.sn-L.startSN,Be=H&&me.level===H.level,Ne=J[We+1],Le=this.fragmentTracker.getState(me);if(Le===O.FragmentState.BACKTRACKED){me=null;for(var Ue=We;J[Ue]&&this.fragmentTracker.getState(J[Ue])===O.FragmentState.BACKTRACKED;)H?me=J[Ue--]:me=J[--Ue];me||(me=Ne)}else H&&me.sn===H.sn&&!se&&(Be&&(me.sn<W&&this.fragmentTracker.getState(Ne)!==O.FragmentState.OK?(this.log("SN "+me.sn+" just loaded, load next one: "+Ne.sn),me=Ne):me=null))}return me},i.synchronizeToLiveEdge=function(b){var m=this.config,L=this.media;if(!L)return;var C=this.hls.liveSyncPosition,H=L.currentTime,J=b.fragments[0].start,W=b.edge,j=H>=J-m.maxFragLookUpTolerance&&H<=W;if(C!==null&&L.duration>C&&(H<C||!j)){var $=m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:m.liveMaxLatencyDurationCount*b.targetduration;(!j&&L.readyState<4||H<W-$)&&(this.loadedmetadata||(this.nextLoadPosition=C),L.readyState&&(this.warn("Playback: "+H.toFixed(3)+" is located too far from the end of live sliding playlist: "+W+", reset currentTime to : "+C.toFixed(3)),L.currentTime=C))}},i.alignPlaylists=function(b,m){var L=this.levels,C=this.levelLastLoaded,H=this.fragPrevious,J=C!==null?L[C]:null,W=b.fragments.length;if(!W)return this.warn("No fragments in live playlist"),0;var j=b.fragments[0].start,$=!m,se=b.alignedSliding&&Object(Q.isFiniteNumber)(j);if($||!se&&!j){Object(P.alignStream)(H,J,b);var me=b.fragments[0].start;return this.log("Live playlist sliding: "+me.toFixed(2)+" start-sn: "+(m?m.startSN:"na")+"->"+b.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+W),me}return j},i.waitForCdnTuneIn=function(b){var m=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*m)},i.setStartPosition=function(b,m){var L=this.startPosition;if(L<m&&(L=-1),L===-1||this.lastCurrentTime===-1){var C=b.startTimeOffset;Object(Q.isFiniteNumber)(C)?(L=m+C,C<0&&(L+=b.totalduration),L=Math.min(Math.max(m,L),m+b.totalduration),this.log("Start time offset "+C+" found in playlist, adjust startPosition to "+L),this.startPosition=L):b.live?L=this.hls.liveSyncPosition||m:this.startPosition=L=0,this.lastCurrentTime=L}this.nextLoadPosition=L},i.getLoadPosition=function(){var b=this.media,m=0;return this.loadedmetadata&&b?m=b.currentTime:this.nextLoadPosition&&(m=this.nextLoadPosition),m},i.handleFragLoadAborted=function(b,m){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(m?" part"+m.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},i.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=v.IDLE)},i.onFragmentOrKeyLoadError=function(b,m){if(m.fatal)return;var L=m.frag;if(!L||L.type!==b)return;var C=this.fragCurrent;console.assert(C&&L.sn===C.sn&&L.level===C.level&&L.urlId===C.urlId,"Frag load error must match current frag to retry");var H=this.config;if(this.fragLoadError+1<=H.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(L.level))return;var J=Math.min(Math.pow(2,this.fragLoadError)*H.fragLoadingRetryDelay,H.fragLoadingMaxRetryTimeout);this.warn("Fragment "+L.sn+" of "+b+" "+L.level+" failed to load, retrying in "+J+"ms"),this.retryDate=self.performance.now()+J,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else m.levelRetry?(b===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(B.logger.error(m.details+" reaches max retry, redispatch as fatal ..."),m.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},i.afterBufferFlushed=function(b,m,L){if(!b)return;var C=U.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(m,C,L),this.state===v.ENDED&&this.resetLoadingState()},i.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},i.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var m=this.levels?this.levels[b].details:null;if(m!=null&&m.live)return this.startPosition=-1,this.setStartPosition(m,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},i.updateLevelTiming=function(b,m,L,C){var H=this,J=L.details;console.assert(!!J,"level.details must be defined");var W=Object.keys(b.elementaryStreams).reduce(function(j,$){var se=b.elementaryStreams[$];if(se){var me=se.endPTS-se.startPTS;if(me<=0)return H.warn("Could not parse fragment "+b.sn+" "+$+" duration reliably ("+me+") resetting transmuxer to fallback to playlist timing"),H.resetTransmuxer(),j||!1;var Ee=C?0:Object(S.updateFragPTSDTS)(J,b,se.startPTS,se.endPTS,se.startDTS,se.endDTS);return H.hls.trigger(I.Events.LEVEL_PTS_UPDATED,{details:J,level:L,drift:Ee,type:$,frag:b,start:se.startPTS,end:se.endPTS}),!0}return j},!1);W?(this.state=v.PARSED,this.hls.trigger(I.Events.FRAG_PARSED,{frag:b,part:m})):this.resetLoadingState()},i.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(a,[{key:"state",get:function(){return this._state},set:function(b){var m=this._state;m!==b&&(this._state=b,this.log(m+"->"+b))}}]),a}(N.default)},"./src/controller/buffer-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return _});var Q=k("./src/polyfills/number.ts"),N=k("./src/events.ts"),O=k("./src/utils/logger.ts"),U=k("./src/errors.ts"),B=k("./src/utils/buffer-helper.ts"),I=k("./src/utils/mediasource-helper.ts"),D=k("./src/loader/fragment.ts"),E=k("./src/controller/buffer-operation-queue.ts"),R=Object(I.getMediaSource)(),P=/([ha]vc.)(?:\.[^.,]+)+/,_=function(){function S(d){var s=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 u=s.hls,h=s.media,T=s.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),h&&(s.updateMediaElementDuration(),u.trigger(N.Events.MEDIA_ATTACHED,{media:h})),T&&T.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=d,this._initSourceBuffer(),this.registerListeners()}var y=S.prototype;return y.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},y.destroy=function(){this.unregisterListeners(),this.details=null},y.registerListeners=function(){var s=this.hls;s.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(N.Events.BUFFER_RESET,this.onBufferReset,this),s.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(N.Events.BUFFER_EOS,this.onBufferEos,this),s.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(N.Events.FRAG_PARSED,this.onFragParsed,this),s.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},y.unregisterListeners=function(){var s=this.hls;s.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(N.Events.BUFFER_RESET,this.onBufferReset,this),s.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(N.Events.BUFFER_EOS,this.onBufferEos,this),s.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(N.Events.FRAG_PARSED,this.onFragParsed,this),s.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},y._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},y.onManifestParsed=function(s,u){var h=2;(u.audio&&!u.video||!u.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},y.onMediaAttaching=function(s,u){var h=this.media=u.media;if(h&&R){var T=this.mediaSource=new R;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(T),this._objectUrl=h.src}},y.onMediaDetaching=function(){var s=this.media,u=this.mediaSource,h=this._objectUrl;if(u){if(O.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(T){O.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(h&&self.URL.revokeObjectURL(h),s.src===h?(s.removeAttribute("src"),s.load()):O.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(N.Events.MEDIA_DETACHED,void 0)},y.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(u){var h=s.sourceBuffer[u];try{h&&(s.removeBufferListeners(u),s.mediaSource&&s.mediaSource.removeSourceBuffer(h),s.sourceBuffer[u]=void 0)}catch(T){O.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",T)}}),this._initSourceBuffer()},y.onBufferCodecs=function(s,u){var h=this,T=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(g){if(T){var f=h.tracks[g];if(f&&typeof f.buffer.changeType=="function"){var w=u[g],v=w.codec,c=w.levelCodec,l=w.container,a=(f.levelCodec||f.codec).replace(P,"$1"),i=(c||v).replace(P,"$1");if(a!==i){var x=l+";codecs="+(c||v);h.appendChangeType(g,x)}}}else h.pendingTracks[g]=u[g]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},y.appendChangeType=function(s,u){var h=this,T=this.operationQueue,g={execute:function(){var w=h.sourceBuffer[s];w&&(O.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+u),w.changeType(u)),T.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(w){O.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",w)}};T.append(g,s)},y.onBufferAppending=function(s,u){var h=this,T=this.hls,g=this.operationQueue,f=this.tracks,w=u.data,v=u.type,c=u.frag,l=u.part,a=u.chunkMeta,i=a.buffering[v],x=self.performance.now();i.start=x;var b=c.stats.buffering,m=l?l.stats.buffering:null;b.start===0&&(b.start=x),m&&m.start===0&&(m.start=x);var L=f.audio,C=v==="audio"&&a.id===1&&(L==null?void 0:L.container)==="audio/mpeg",H={execute:function(){if(i.executeStart=self.performance.now(),C){var W=h.sourceBuffer[v];if(W){var j=c.start-W.timestampOffset;Math.abs(j)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+c.start+" (delta: "+j+") sn: "+c.sn+")"),W.timestampOffset=c.start)}}h.appendExecutor(w,v)},onStart:function(){},onComplete:function(){var W=self.performance.now();i.executeEnd=i.end=W,b.first===0&&(b.first=W),m&&m.first===0&&(m.first=W);var j=h.sourceBuffer,$={};for(var se in j)$[se]=B.BufferHelper.getBuffered(j[se]);h.appendError=0,h.hls.trigger(N.Events.BUFFER_APPENDED,{type:v,frag:c,part:l,chunkMeta:a,parent:c.type,timeRanges:$})},onError:function(W){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",W);var j={type:U.ErrorTypes.MEDIA_ERROR,parent:c.type,details:U.ErrorDetails.BUFFER_APPEND_ERROR,err:W,fatal:!1};W.code===DOMException.QUOTA_EXCEEDED_ERR?j.details=U.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,j.details=U.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>T.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),j.fatal=!0)),T.trigger(N.Events.ERROR,j)}};g.append(H,v)},y.onBufferFlushing=function(s,u){var h=this,T=this.operationQueue,g=function(w){return{execute:h.removeExecutor.bind(h,w,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(N.Events.BUFFER_FLUSHED,{type:w})},onError:function(c){O.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",c)}}};u.type?T.append(g(u.type),u.type):this.getSourceBufferTypes().forEach(function(f){T.append(g(f),f)})},y.onFragParsed=function(s,u){var h=this,T=u.frag,g=u.part,f=[],w=g?g.elementaryStreams:T.elementaryStreams;w[D.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(w[D.ElementaryStreamTypes.AUDIO]&&f.push("audio"),w[D.ElementaryStreamTypes.VIDEO]&&f.push("video"));var v=function(){var l=self.performance.now();T.stats.buffering.end=l,g&&(g.stats.buffering.end=l);var a=g?g.stats:T.stats;h.hls.trigger(N.Events.FRAG_BUFFERED,{frag:T,part:g,stats:a,id:T.type})};f.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(v,f)},y.onFragChanged=function(s,u){this.flushBackBuffer()},y.onBufferEos=function(s,u){var h=this,T=this.getSourceBufferTypes().reduce(function(g,f){var w=h.sourceBuffer[f];return(!u.type||u.type===f)&&(w&&!w.ended&&(w.ended=!0,O.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),g&&!!(!w||w.ended)},!0);T&&this.blockBuffers(function(){var g=h.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},y.onLevelUpdated=function(s,u){var h=u.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},y.flushBackBuffer=function(){var s=this.hls,u=this.details,h=this.media,T=this.sourceBuffer;if(!h||u===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var f=u.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(Q.isFiniteNumber)(f)||f<0)return;var w=h.currentTime,v=u.levelTargetDuration,c=Math.max(f,v),l=Math.floor(w/v)*v-c;g.forEach(function(a){var i=T[a];if(i){var x=B.BufferHelper.getBuffered(i);x.length>0&&l>x.start(0)&&(s.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:l}),u.live&&s.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:l}),s.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:l,type:a}))}})},y.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,u=this.hls,h=this.media,T=this.mediaSource,g=s.fragments[0].start+s.totalduration,f=h.duration,w=Object(Q.isFiniteNumber)(T.duration)?T.duration:0;s.live&&u.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(s)):(g>w&&g>f||!Object(Q.isFiniteNumber)(f))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),T.duration=g)},y.updateSeekableRange=function(s){var u=this.mediaSource,h=s.fragments,T=h.length;if(T&&s.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var g=Math.max(0,h[0].start),f=Math.max(g,g+s.totalduration);u.setLiveSeekableRange(g,f)}},y.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,u=this.operationQueue,h=this.pendingTracks,T=Object.keys(h).length;if(T&&!s||T===2){this.createSourceBuffers(h),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(N.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}g.forEach(function(f){u.executeNext(f)})}},y.createSourceBuffers=function(s){var u=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var g in s)if(!u[g]){var f=s[g];if(!f)throw Error("source buffer exists for track "+g+", however track does not");var w=f.levelCodec||f.codec,v=f.container+";codecs="+w;O.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var c=u[g]=h.addSourceBuffer(v),l=g;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[g]={buffer:c,codec:w,container:f.container,levelCodec:f.levelCodec,id:f.id},T++}catch(a){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+a.message),this.hls.trigger(N.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:a,mimeType:v})}}T&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},y._onSBUpdateStart=function(s){var u=this.operationQueue,h=u.current(s);h.onStart()},y._onSBUpdateEnd=function(s){var u=this.operationQueue,h=u.current(s);h.onComplete(),u.shiftAndExecuteNext(s)},y._onSBUpdateError=function(s,u){O.logger.error("[buffer-controller]: "+s+" SourceBuffer error",u),this.hls.trigger(N.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(s);h&&h.onError(u)},y.removeExecutor=function(s,u,h){var T=this.media,g=this.mediaSource,f=this.operationQueue,w=this.sourceBuffer,v=w[s];if(!T||!g||!v){O.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(s);return}var c=Object(Q.isFiniteNumber)(T.duration)?T.duration:Infinity,l=Object(Q.isFiniteNumber)(g.duration)?g.duration:Infinity,a=Math.max(0,u),i=Math.min(h,c,l);i>a?(O.logger.log("[buffer-controller]: Removing ["+a+","+i+"] from the "+s+" SourceBuffer"),console.assert(!v.updating,s+" sourceBuffer must not be updating"),v.remove(a,i)):f.shiftAndExecuteNext(s)},y.appendExecutor=function(s,u){var h=this.operationQueue,T=this.sourceBuffer,g=T[u];if(!g){O.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(u);return}g.ended=!1,console.assert(!g.updating,u+" sourceBuffer must not be updating"),g.appendBuffer(s)},y.blockBuffers=function(s,u){var h=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var T=this.operationQueue,g=u.map(function(f){return T.appendBlocker(f)});Promise.all(g).then(function(){s(),u.forEach(function(f){var w=h.sourceBuffer[f];(!w||!w.updating)&&T.shiftAndExecuteNext(f)})})},y.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},y.addBufferListener=function(s,u,h){var T=this.sourceBuffer[s];if(!T)return;var g=h.bind(this,s);this.listeners[s].push({event:u,listener:g}),T.addEventListener(u,g)},y.removeBufferListeners=function(s){var u=this.sourceBuffer[s];if(!u)return;this.listeners[s].forEach(function(h){u.removeEventListener(h.event,h.listener)})},S}()},"./src/controller/buffer-operation-queue.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return N});var Q=k("./src/utils/logger.ts"),N=function(){function O(B){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=B}var U=O.prototype;return U.append=function(I,D){var E=this.queues[D];E.push(I),E.length===1&&this.buffers[D]&&this.executeNext(D)},U.insertAbort=function(I,D){var E=this.queues[D];E.unshift(I),this.executeNext(D)},U.appendBlocker=function(I){var D,E=new Promise(function(P){D=P}),R={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(R,I),E},U.executeNext=function(I){var D=this.buffers,E=this.queues,R=D[I],P=E[I];if(P.length){var _=P[0];try{_.execute()}catch(S){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),_.onError(S),(!R||!R.updating)&&(P.shift(),this.executeNext(I))}}},U.shiftAndExecuteNext=function(I){this.queues[I].shift(),this.executeNext(I)},U.current=function(I){return this.queues[I][0]},O}()},"./src/controller/cap-level-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/events.ts");function N(B,I){for(var D=0;D<I.length;D++){var E=I[D];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(B,E.key,E)}}function O(B,I,D){return I&&N(B.prototype,I),D&&N(B,D),B}var U=function(){function B(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var I=B.prototype;return I.setStreamController=function(E){this.streamController=E},I.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},I.registerListeners=function(){var E=this.hls;E.on(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.unregisterListener=function(){var E=this.hls;E.off(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.onFpsDropLevelCapping=function(E,R){B.isLevelAllowed(R.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(R.droppedLevel)},I.onMediaAttaching=function(E,R){this.media=R.media instanceof HTMLVideoElement?R.media:null},I.onManifestParsed=function(E,R){var P=this.hls;this.restrictedLevels=[],this.firstLevel=R.firstLevel,P.config.capLevelToPlayerSize&&R.video&&this.startCapping()},I.onBufferCodecs=function(E,R){var P=this.hls;P.config.capLevelToPlayerSize&&R.video&&this.startCapping()},I.onMediaDetaching=function(){this.stopCapping()},I.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var R=this.hls;R.autoLevelCapping=this.getMaxLevel(E.length-1),R.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=R.autoLevelCapping}}},I.getMaxLevel=function(E){var R=this,P=this.hls.levels;if(!P.length)return-1;var _=P.filter(function(S,y){return B.isLevelAllowed(y,R.restrictedLevels)&&y<=E});return this.clientRect=null,B.getMaxLevelByMediaSize(_,this.mediaWidth,this.mediaHeight)},I.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()},I.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},I.getDimensions=function(){if(this.clientRect)return this.clientRect;var E=this.media,R={width:0,height:0};if(E){var P=E.getBoundingClientRect();R.width=P.width,R.height=P.height,!R.width&&!R.height&&(R.width=P.right-P.left||E.width||0,R.height=P.bottom-P.top||E.height||0)}return this.clientRect=R,R},B.isLevelAllowed=function(E,R){return R===void 0&&(R=[]),R.indexOf(E)===-1},B.getMaxLevelByMediaSize=function(E,R,P){if(!E||!E.length)return-1;for(var _=function(u,h){return h?u.width!==h.width||u.height!==h.height:!0},S=E.length-1,y=0;y<E.length;y+=1){var d=E[y];if((d.width>=R||d.height>=P)&&_(d,E[y+1])){S=y;break}}return S},O(B,[{key:"mediaWidth",get:function(){return this.getDimensions().width*B.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*B.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var E=1;try{E=self.devicePixelRatio}catch(R){}return E}}]),B}();X.default=U},"./src/controller/cmcd-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return _});var Q=k("./src/events.ts"),N=k("./src/types/cmcd.ts"),O=k("./src/utils/buffer-helper.ts"),U=k("./src/utils/logger.ts");function B(S,y){for(var d=0;d<y.length;d++){var s=y[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(S,s.key,s)}}function I(S,y,d){return y&&B(S.prototype,y),d&&B(S,d),S}function D(S,y){var d=typeof Symbol!="undefined"&&S[Symbol.iterator]||S["@@iterator"];if(d)return(d=d.call(S)).next.bind(d);if(Array.isArray(S)||(d=E(S))||y&&S&&typeof S.length=="number"){d&&(S=d);var s=0;return function(){return s>=S.length?{done:!0}:{done:!1,value:S[s++]}}}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 E(S,y){if(!S)return;if(typeof S=="string")return R(S,y);var d=Object.prototype.toString.call(S).slice(8,-1);if(d==="Object"&&S.constructor&&(d=S.constructor.name),d==="Map"||d==="Set")return Array.from(S);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return R(S,y)}function R(S,y){(y==null||y>S.length)&&(y=S.length);for(var d=0,s=new Array(y);d<y;d++)s[d]=S[d];return s}function P(){return P=Object.assign||function(S){for(var y=1;y<arguments.length;y++){var d=arguments[y];for(var s in d)Object.prototype.hasOwnProperty.call(d,s)&&(S[s]=d[s])}return S},P.apply(this,arguments)}var _=function(){function S(d){var s=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(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(T){try{s.apply(T,{ot:N.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(g){U.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=function(T){try{var g=T.frag,f=s.hls.levels[g.level],w=s.getObjectType(g),v={d:g.duration*1e3,ot:w};(w===N.CMCDObjectType.VIDEO||w===N.CMCDObjectType.AUDIO||w==N.CMCDObjectType.MUXED)&&(v.br=f.bitrate/1e3,v.tb=s.getTopBandwidth(w),v.bl=s.getBufferLength(w)),s.apply(T,v)}catch(c){U.logger.warn("Could not generate segment CMCD data.",c)}},this.hls=d;var u=this.config=d.config,h=u.cmcd;h!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=h.sessionId||S.uuid(),this.cid=h.contentId,this.useHeaders=h.useHeaders===!0,this.registerListeners())}var y=S.prototype;return y.registerListeners=function(){var s=this.hls;s.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(Q.Events.BUFFER_CREATED,this.onBufferCreated,this)},y.unregisterListeners=function(){var s=this.hls;s.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(Q.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},y.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},y.onMediaAttached=function(s,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},y.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},y.onBufferCreated=function(s,u){var h,T;this.audioBuffer=(h=u.tracks.audio)===null||h===void 0?void 0:h.buffer,this.videoBuffer=(T=u.tracks.video)===null||T===void 0?void 0:T.buffer},y.createData=function(){var s;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},y.apply=function(s,u){u===void 0&&(u={}),P(u,this.createData());var h=u.ot===N.CMCDObjectType.INIT||u.ot===N.CMCDObjectType.VIDEO||u.ot===N.CMCDObjectType.MUXED;if(this.starved&&h&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var T=S.toHeaders(u);if(!Object.keys(T).length)return;s.headers||(s.headers={}),P(s.headers,T)}else{var g=S.toQuery(u);if(!g)return;s.url=S.appendQueryToUri(s.url,g)}},y.getObjectType=function(s){var u=s.type;return u==="subtitle"?N.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?N.CMCDObjectType.INIT:u==="audio"?N.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},y.getTopBandwidth=function(s){for(var u=0,h=s===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=D(h),g;!(g=T()).done;){var f=g.value;f.bitrate>u&&(u=f.bitrate)}return u>0?u:NaN},y.getBufferLength=function(s){var u=this.hls.media,h=s===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!u)return NaN;var T=O.BufferHelper.bufferInfo(h,u.currentTime,this.config.maxBufferHole);return T.len*1e3},y.createPlaylistLoader=function(){var s=this.config.pLoader,u=this.applyPlaylistData,h=s||this.config.loader;return function(){function T(f){this.loader=void 0,this.loader=new h(f)}var g=T.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(w,v,c){u(w),this.loader.load(w,v,c)},I(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},y.createFragmentLoader=function(){var s=this.config.fLoader,u=this.applyFragmentData,h=s||this.config.loader;return function(){function T(f){this.loader=void 0,this.loader=new h(f)}var g=T.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(w,v,c){u(w),this.loader.load(w,v,c)},I(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},S.uuid=function(){var s=URL.createObjectURL(new Blob),u=s.toString();return URL.revokeObjectURL(s),u.substr(u.lastIndexOf("/")+1)},S.serialize=function(s){for(var u=[],h=function(C){return!Number.isNaN(C)&&C!=null&&C!==""&&C!==!1},T=function(C){return Math.round(C)},g=function(C){return T(C/100)*100},f=function(C){return encodeURIComponent(C)},w={br:T,d:T,bl:g,dl:g,mtp:g,nor:f,rtp:g,tb:T},v=Object.keys(s||{}).sort(),c=D(v),l;!(l=c()).done;){var a=l.value,i=s[a];if(!h(i))continue;if(a==="v"&&i===1)continue;if(a=="pr"&&i===1)continue;var x=w[a];x&&(i=x(i));var b=typeof i,m=void 0;a==="ot"||a==="sf"||a==="st"?m=a+"="+i:b==="boolean"?m=a:b==="number"?m=a+"="+i:m=a+"="+JSON.stringify(i),u.push(m)}return u.join(",")},S.toHeaders=function(s){for(var u=Object.keys(s),h={},T=["Object","Request","Session","Status"],g=[{},{},{},{}],f={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},w=0,v=u;w<v.length;w++){var c=v[w],l=f[c]!=null?f[c]:1;g[l][c]=s[c]}for(var a=0;a<g.length;a++){var i=S.serialize(g[a]);i&&(h["CMCD-"+T[a]]=i)}return h},S.toQuery=function(s){return"CMCD="+encodeURIComponent(S.serialize(s))},S.appendQueryToUri=function(s,u){if(!u)return s;var h=s.includes("?")?"&":"?";return""+s+h+u},S}()},"./src/controller/eme-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/events.ts"),N=k("./src/errors.ts"),O=k("./src/utils/logger.ts"),U=k("./src/utils/mediakeys-helper.ts");function B(_,S){for(var y=0;y<S.length;y++){var d=S[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(_,d.key,d)}}function I(_,S,y){return S&&B(_.prototype,S),y&&B(_,y),_}var D=3,E=function(S,y,d){var s={audioCapabilities:[],videoCapabilities:[]};return S.forEach(function(u){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:d.audioRobustness||""})}),y.forEach(function(u){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:d.videoRobustness||""})}),[s]},R=function(S,y,d,s){switch(S){case U.KeySystems.WIDEVINE:return E(y,d,s);default:throw new Error("Unknown key-system: "+S)}},P=function(){function _(y){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=y,this._config=y.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 S=_.prototype;return S.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},S._registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},S._unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},S.getLicenseServerUrl=function(d){switch(d){case U.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+d+'"')},S._attemptKeySystemAccess=function(d,s,u){var h=this,T=R(d,s,u,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var g=this.requestMediaKeySystemAccess(d,T);this.mediaKeysPromise=g.then(function(f){return h._onMediaKeySystemAccessObtained(d,f)}),g.catch(function(f){O.logger.error('Failed to obtain key-system "'+d+'" access:',f)})},S._onMediaKeySystemAccessObtained=function(d,s){var u=this;O.logger.log('Access for key-system "'+d+'" obtained');var h={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:d};this._mediaKeysList.push(h);var T=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(g){return h.mediaKeys=g,O.logger.log('Media-keys created for key-system "'+d+'"'),u._onMediaKeysCreated(),g});return T.catch(function(g){O.logger.error("Failed to create media-keys:",g)}),T},S._onMediaKeysCreated=function(){var d=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),d._onNewMediaKeySession(s.mediaKeysSession))})},S._onNewMediaKeySession=function(d){var s=this;O.logger.log("New key-system session "+d.sessionId),d.addEventListener("message",function(u){s._onKeySessionMessage(d,u.message)},!1)},S._onKeySessionMessage=function(d,s){O.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(u){O.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),d.update(u)})},S.onMediaEncrypted=function(d){var s=this;if(O.logger.log('Media is encrypted using "'+d.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(T){if(!s._media)return;s._attemptSetMediaKeys(T),s._generateRequestWithPreferredKeySession(d.initDataType,d.initData)};this.mediaKeysPromise.then(u).catch(u)},S._attemptSetMediaKeys=function(d){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},S._generateRequestWithPreferredKeySession=function(d,s){var u=this,h=this._mediaKeysList[0];if(!h){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(h.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var T=h.mediaKeysSession;if(!T){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+d+'" init data type'),h.mediaKeysSessionInitialized=!0,T.generateRequest(d,s).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(g){O.logger.error("Error generating key-session request:",g),u.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},S._createLicenseXhr=function(d,s,u){var h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,h,d,s,u);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,h,d),T=void 0}catch(g){O.logger.error(g)}try{h.readyState||h.open("POST",d,!0),T&&T.call(this.hls,h,d)}catch(g){throw new Error("issue setting up KeySystem license XHR "+g)}return h},S._onLicenseRequestReadyStageChange=function(d,s,u,h){switch(d.readyState){case 4:if(d.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var T=d.response,g=this._licenseResponseCallback;if(g)try{T=g.call(this.hls,d,s)}catch(w){O.logger.error(w)}h(T)}else{if(O.logger.error("License Request XHR failed ("+s+"). Status: "+d.status+" ("+d.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var f=D-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+f+" attempts left"),this._requestLicense(u,h)}break}},S._generateLicenseRequestChallenge=function(d,s){switch(d.mediaKeySystemDomain){case U.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},S._requestLicense=function(d,s){O.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(u.mediaKeySystemDomain),T=this._createLicenseXhr(h,d,s);O.logger.log("Sending license request to URL: "+h);var g=this._generateLicenseRequestChallenge(u,d);T.send(g)}catch(f){O.logger.error("Failure requesting DRM license: "+f),this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},S.onMediaAttached=function(d,s){if(!this._emeEnabled)return;var u=s.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},S.onMediaDetached=function(){var d=this._media,s=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},S.onManifestParsed=function(d,s){if(!this._emeEnabled)return;var u=s.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),h=s.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(U.KeySystems.WIDEVINE,u,h)},I(_,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),_}();X.default=P},"./src/controller/fps-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/events.ts"),N=k("./src/utils/logger.ts"),O=function(){function U(I){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=I,this.registerListeners()}var B=U.prototype;return B.setStreamController=function(D){this.streamController=D},B.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},B.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},B.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},B.onMediaAttaching=function(D,E){var R=this.hls.config;if(R.capLevelOnFPSDrop){var P=E.media instanceof self.HTMLVideoElement?E.media:null;this.media=P,P&&typeof P.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),R.fpsDroppedMonitoringPeriod)}},B.checkFPS=function(D,E,R){var P=performance.now();if(E){if(this.lastTime){var _=P-this.lastTime,S=R-this.lastDroppedFrames,y=E-this.lastDecodedFrames,d=1e3*S/_,s=this.hls;if(s.trigger(Q.Events.FPS_DROP,{currentDropped:S,currentDecoded:y,totalDroppedFrames:R}),d>0&&S>s.config.fpsDroppedMonitoringThreshold*y){var u=s.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=u)&&(u=u-1,s.trigger(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:s.currentLevel}),s.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=P,this.lastDroppedFrames=R,this.lastDecodedFrames=E}},B.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var E=D.getVideoPlaybackQuality();this.checkFPS(D,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},U}();X.default=O},"./src/controller/fragment-finders.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"findFragmentByPDT",function(){return O}),k.d(X,"findFragmentByPTS",function(){return U}),k.d(X,"fragmentWithinToleranceTest",function(){return B}),k.d(X,"pdtWithinToleranceTest",function(){return I}),k.d(X,"findFragWithCC",function(){return D});var Q=k("./src/polyfills/number.ts"),N=k("./src/utils/binary-search.ts");function O(E,R,P){if(R===null||!Array.isArray(E)||!E.length||!Object(Q.isFiniteNumber)(R))return null;var _=E[0].programDateTime;if(R<(_||0))return null;var S=E[E.length-1].endProgramDateTime;if(R>=(S||0))return null;P=P||0;for(var y=0;y<E.length;++y){var d=E[y];if(I(R,P,d))return d}return null}function U(E,R,P,_){P===void 0&&(P=0),_===void 0&&(_=0);var S=null;if(E?S=R[E.sn-R[0].sn+1]||null:P===0&&R[0].start===0&&(S=R[0]),S&&B(P,_,S)===0)return S;var y=N.default.search(R,B.bind(null,P,_));return y||S}function B(E,R,P){E===void 0&&(E=0),R===void 0&&(R=0);var _=Math.min(R,P.duration+(P.deltaPTS?P.deltaPTS:0));return P.start+P.duration-_<=E?1:P.start-_>E&&P.start?-1:0}function I(E,R,P){var _=Math.min(R,P.duration+(P.deltaPTS?P.deltaPTS:0))*1e3,S=P.endProgramDateTime||0;return S-_>E}function D(E,R){return N.default.search(E,function(P){return P.cc<R?1:P.cc>R?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"FragmentState",function(){return O}),k.d(X,"FragmentTracker",function(){return U});var Q=k("./src/events.ts"),N=k("./src/types/loader.ts"),O;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(O||(O={}));var U=function(){function D(R){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=R,this._registerListeners()}var E=D.prototype;return E._registerListeners=function(){var P=this.hls;P.on(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),P.on(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),P.on(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var P=this.hls;P.off(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),P.off(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),P.off(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(P,_){if(_===N.PlaylistLevelType.MAIN){var S=this.activeFragment,y=this.activeParts;if(!S)return null;if(y)for(var d=y.length;d--;){var s=y[d],u=s?s.end:S.appendedPTS;if(s.start<=P&&u!==void 0&&P<=u)return d>9&&(this.activeParts=y.slice(d-9)),s}else if(S.start<=P&&S.appendedPTS!==void 0&&P<=S.appendedPTS)return S}return this.getBufferedFrag(P,_)},E.getBufferedFrag=function(P,_){for(var S=this.fragments,y=Object.keys(S),d=y.length;d--;){var s=S[y[d]];if((s==null?void 0:s.body.type)===_&&s.buffered){var u=s.body;if(u.start<=P&&P<=u.end)return u}}return null},E.detectEvictedFragments=function(P,_,S){var y=this;Object.keys(this.fragments).forEach(function(d){var s=y.fragments[d];if(!s)return;if(!s.buffered){s.body.type===S&&y.removeFragment(s.body);return}var u=s.range[P];if(!u)return;u.time.some(function(h){var T=!y.isTimeBuffered(h.startPTS,h.endPTS,_);return T&&y.removeFragment(s.body),T})})},E.detectPartialFragments=function(P){var _=this,S=this.timeRanges,y=P.frag,d=P.part;if(!S||y.sn==="initSegment")return;var s=I(y),u=this.fragments[s];if(!u)return;Object.keys(S).forEach(function(h){var T=y.elementaryStreams[h];if(!T)return;var g=S[h],f=d!==null||T.partial===!0;u.range[h]=_.getBufferedTimes(y,d,f,g)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},E.fragBuffered=function(P){var _=I(P),S=this.fragments[_];S&&(S.backtrack=S.loaded=null,S.buffered=!0)},E.getBufferedTimes=function(P,_,S,y){for(var d={time:[],partial:S},s=_?_.start:P.start,u=_?_.end:P.end,h=P.minEndPTS||u,T=P.maxStartPTS||s,g=0;g<y.length;g++){var f=y.start(g)-this.bufferPadding,w=y.end(g)+this.bufferPadding;if(T>=f&&h<=w){d.time.push({startPTS:Math.max(s,y.start(g)),endPTS:Math.min(u,y.end(g))});break}else if(s<w&&u>f)d.partial=!0,d.time.push({startPTS:Math.max(s,y.start(g)),endPTS:Math.min(u,y.end(g))});else if(u<=f)break}return d},E.getPartialFragment=function(P){var _=null,S,y,d,s=0,u=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(T){var g=h[T];if(!g)return;B(g)&&(y=g.body.start-u,d=g.body.end+u,P>=y&&P<=d&&(S=Math.min(P-y,d-P),s<=S&&(_=g.body,s=S)))}),_},E.getState=function(P){var _=I(P),S=this.fragments[_];return S?S.buffered?B(S)?O.PARTIAL:O.OK:S.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},E.backtrack=function(P,_){var S=I(P),y=this.fragments[S];if(!y||y.backtrack)return null;var d=y.backtrack=_||y.loaded;return y.loaded=null,d},E.getBacktrackData=function(P){var _=I(P),S=this.fragments[_];if(S){var y,d=S.backtrack;if(d!=null&&(y=d.payload)!==null&&y!==void 0&&y.byteLength)return d;this.removeFragment(P)}return null},E.isTimeBuffered=function(P,_,S){for(var y,d,s=0;s<S.length;s++){if(y=S.start(s)-this.bufferPadding,d=S.end(s)+this.bufferPadding,P>=y&&_<=d)return!0;if(_<=y)return!1}return!1},E.onFragLoaded=function(P,_){var S=_.frag,y=_.part;if(S.sn==="initSegment"||S.bitrateTest||y)return;var d=I(S);this.fragments[d]={body:S,loaded:_,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(P,_){var S=this,y=_.frag,d=_.part,s=_.timeRanges;if(y.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=y,d){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(d)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(h){var T=s[h];if(S.detectEvictedFragments(h,T),!d)for(var g=0;g<T.length;g++)y.appendedPTS=Math.max(T.end(g),y.appendedPTS||0)})},E.onFragBuffered=function(P,_){this.detectPartialFragments(_)},E.hasFragment=function(P){var _=I(P);return!!this.fragments[_]},E.removeFragmentsInRange=function(P,_,S){var y=this;Object.keys(this.fragments).forEach(function(d){var s=y.fragments[d];if(!s)return;if(s.buffered){var u=s.body;u.type===S&&u.start<_&&u.end>P&&y.removeFragment(u)}})},E.removeFragment=function(P){var _=I(P);P.stats.loaded=0,P.clearElementaryStreamInfo(),delete this.fragments[_]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function B(D){var E,R;return D.buffered&&(((E=D.range.video)===null||E===void 0?void 0:E.partial)||((R=D.range.audio)===null||R===void 0?void 0:R.partial))}function I(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"STALL_MINIMUM_DURATION_MS",function(){return B}),k.d(X,"MAX_START_GAP_JUMP",function(){return I}),k.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),k.d(X,"SKIP_BUFFER_RANGE_START",function(){return E}),k.d(X,"default",function(){return R});var Q=k("./src/utils/buffer-helper.ts"),N=k("./src/errors.ts"),O=k("./src/events.ts"),U=k("./src/utils/logger.ts"),B=250,I=2,D=.1,E=.05,R=function(){function P(S,y,d,s){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=S,this.media=y,this.fragmentTracker=d,this.hls=s}var _=P.prototype;return _.destroy=function(){this.hls=this.fragmentTracker=this.media=null},_.poll=function(y){var d=this.config,s=this.media,u=this.stalled,h=s.currentTime,T=s.seeking,g=this.seeking&&!T,f=!this.seeking&&T;if(this.seeking=T,h!==y){if(this.moved=!0,u!==null){if(this.stallReported){var w=self.performance.now()-u;U.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((f||g)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!Q.BufferHelper.getBuffered(s).length)return;var v=Q.BufferHelper.bufferInfo(s,h,0),c=v.len>0,l=v.nextStart||0;if(!c&&!l)return;if(T){var a=v.len>I,i=!l||l-h>I&&!this.fragmentTracker.getPartialFragment(h);if(a||i)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,b=Math.max(l,v.start||0)-h,m=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,L=m==null||((x=m.details)===null||x===void 0)?void 0:x.live,C=L?m.details.targetduration*2:I;if(b>0&&b<=C){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(u===null){this.stalled=H;return}var J=H-u;!T&&J>=B&&this._reportStall(v.len);var W=Q.BufferHelper.bufferInfo(s,h,d.maxBufferHole);this._tryFixBufferStall(W,J)},_._tryFixBufferStall=function(y,d){var s=this.config,u=this.fragmentTracker,h=this.media,T=h.currentTime,g=u.getPartialFragment(T);if(g){var f=this._trySkipBufferHole(g);if(f)return}y.len>s.maxBufferHole&&d>s.highBufferWatchdogPeriod*1e3&&(U.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},_._reportStall=function(y){var d=this.hls,s=this.media,u=this.stallReported;u||(this.stallReported=!0,U.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+y+")"),d.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:y}))},_._trySkipBufferHole=function(y){for(var d=this.config,s=this.hls,u=this.media,h=u.currentTime,T=0,g=Q.BufferHelper.getBuffered(u),f=0;f<g.length;f++){var w=g.start(f);if(h+d.maxBufferHole>=T&&h<w){var v=Math.max(w+E,u.currentTime+D);return U.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+v),this.moved=!0,this.stalled=null,u.currentTime=v,y&&s.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+v,frag:y}),v}T=g.end(f)}return 0},_._tryNudgeBuffer=function(){var y=this.config,d=this.hls,s=this.media,u=s.currentTime,h=(this.nudgeRetry||0)+1;if(this.nudgeRetry=h,h<y.nudgeMaxRetry){var T=u+h*y.nudgeOffset;U.logger.warn("Nudging 'currentTime' from "+u+" to "+T),s.currentTime=T,d.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else U.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+y.nudgeMaxRetry+" nudges"),d.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},P}()},"./src/controller/id3-track-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/events.ts"),N=k("./src/utils/texttrack-utils.ts"),O=k("./src/demux/id3.ts"),U=.25,B=function(){function I(E){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=E,this._registerListeners()}var D=I.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var R=this.hls;R.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),R.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var R=this.hls;R.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),R.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(R,P){this.media=P.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(R){if(!this.media)return;for(var P=0;P<R.length;P++){var _=R[P];if(_.kind==="metadata"&&_.label==="id3")return Object(N.sendAddTrackEvent)(_,this.media),_}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(R,P){if(!this.media)return;var _=P.frag,S=P.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var y=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,d=0;d<S.length;d++){var s=O.getID3Frames(S[d].data);if(s){var u=S[d].pts,h=d<S.length-1?S[d+1].pts:_.end,T=h-u;T<=0&&(h=u+U);for(var g=0;g<s.length;g++){var f=s[g];if(!O.isTimeStampFrame(f)){var w=new y(u,h,"");w.value=f,this.id3Track.addCue(w)}}}}},D.onBufferFlushing=function(R,P){var _=P.startOffset,S=P.endOffset,y=P.type;if(!y||y==="audio"){var d=this.id3Track;d&&Object(N.removeCuesInRange)(d,_,S)}},I}();X.default=B},"./src/controller/latency-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return I});var Q=k("./src/errors.ts"),N=k("./src/events.ts"),O=k("./src/utils/logger.ts");function U(D,E){for(var R=0;R<E.length;R++){var P=E[R];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(D,P.key,P)}}function B(D,E,R){return E&&U(D.prototype,E),R&&U(D,R),D}var I=function(){function D(R){var P=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 P.timeupdate()},this.hls=R,this.config=R.config,this.registerListeners()}var E=D.prototype;return E.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},E.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},E.onMediaAttached=function(P,_){this.media=_.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},E.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},E.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},E.onLevelUpdated=function(P,_){var S=_.details;this.levelDetails=S,S.advanced&&this.timeupdate(),!S.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},E.onError=function(P,_){if(_.details!==Q.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},E.timeupdate=function(){var P=this.media,_=this.levelDetails;if(!P||!_)return;this.currentTime=P.currentTime;var S=this.computeLatency();if(S===null)return;this._latency=S;var y=this.config,d=y.lowLatencyMode,s=y.maxLiveSyncPlaybackRate;if(!d||s===1)return;var u=this.targetLatency;if(u===null)return;var h=S-u,T=Math.min(this.maxLatency,u+_.targetduration),g=h<T;if(_.live&&g&&h>.05&&this.forwardBufferLength>1){var f=Math.min(2,Math.max(1,s)),w=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;P.playbackRate=Math.min(f,Math.max(1,w))}else P.playbackRate!==1&&P.playbackRate!==0&&(P.playbackRate=1)},E.estimateLiveEdge=function(){var P=this.levelDetails;return P===null?null:P.edge+P.age},E.computeLatency=function(){var P=this.estimateLiveEdge();return P===null?null:P-this.currentTime},B(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var P=this.config,_=this.levelDetails;return P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:_?P.liveMaxLatencyDurationCount*_.targetduration:0}},{key:"targetLatency",get:function(){var P=this.levelDetails;if(P===null)return null;var _=P.holdBack,S=P.partHoldBack,y=P.targetduration,d=this.config,s=d.liveSyncDuration,u=d.liveSyncDurationCount,h=d.lowLatencyMode,T=this.hls.userConfig,g=h&&S||_;(T.liveSyncDuration||T.liveSyncDurationCount||g===0)&&(g=s!==void 0?s:u*y);var f=y,w=1;return g+Math.min(this.stallCount*w,f)}},{key:"liveSyncPosition",get:function(){var P=this.estimateLiveEdge(),_=this.targetLatency,S=this.levelDetails;if(P===null||_===null||S===null)return null;var y=S.edge,d=P-_-this.edgeStalled,s=y-S.totalduration,u=y-(this.config.lowLatencyMode&&S.partTarget||S.targetduration);return Math.min(Math.max(s,d),u)}},{key:"drift",get:function(){var P=this.levelDetails;return P===null?1:P.drift}},{key:"edgeStalled",get:function(){var P=this.levelDetails;if(P===null)return 0;var _=(this.config.lowLatencyMode&&P.partTarget||P.targetduration)*3;return Math.max(P.age-_,0)}},{key:"forwardBufferLength",get:function(){var P=this.media,_=this.levelDetails;if(!P||!_)return 0;var S=P.buffered.length;return S?P.buffered.end(S-1):_.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return d});var Q=k("./src/types/level.ts"),N=k("./src/events.ts"),O=k("./src/errors.ts"),U=k("./src/utils/codecs.ts"),B=k("./src/controller/level-helper.ts"),I=k("./src/controller/base-playlist-controller.ts"),D=k("./src/types/loader.ts");function E(){return E=Object.assign||function(s){for(var u=1;u<arguments.length;u++){var h=arguments[u];for(var T in h)Object.prototype.hasOwnProperty.call(h,T)&&(s[T]=h[T])}return s},E.apply(this,arguments)}function R(s,u){for(var h=0;h<u.length;h++){var T=u[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function P(s,u,h){return u&&R(s.prototype,u),h&&R(s,h),s}function _(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,S(s,u)}function S(s,u){return S=Object.setPrototypeOf||function(T,g){return T.__proto__=g,T},S(s,u)}var y=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(s){_(u,s);function u(T){var g;return g=s.call(this,T,"[level-controller]")||this,g._levels=[],g._firstLevel=-1,g._startLevel=void 0,g.currentLevelIndex=-1,g.manualLevelIndex=-1,g.onParsedComplete=void 0,g._registerListeners(),g}var h=u.prototype;return h._registerListeners=function(){var g=this.hls;g.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),g.on(N.Events.ERROR,this.onError,this)},h._unregisterListeners=function(){var g=this.hls;g.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(N.Events.ERROR,this.onError,this)},h.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},h.startLoad=function(){var g=this._levels;g.forEach(function(f){f.loadError=0}),s.prototype.startLoad.call(this)},h.onManifestLoaded=function(g,f){var w=[],v=[],c=[],l,a={},i,x=!1,b=!1,m=!1;if(f.levels.forEach(function(J){var W=J.attrs;x=x||!!(J.width&&J.height),b=b||!!J.videoCodec,m=m||!!J.audioCodec,y&&J.audioCodec&&J.audioCodec.indexOf("mp4a.40.34")!==-1&&(J.audioCodec=void 0);var j=J.bitrate+"-"+J.attrs.RESOLUTION+"-"+J.attrs.CODECS;i=a[j],i?i.url.push(J.url):(i=new Q.Level(J),a[j]=i,w.push(i)),W&&(W.AUDIO&&Object(B.addGroupId)(i,"audio",W.AUDIO),W.SUBTITLES&&Object(B.addGroupId)(i,"text",W.SUBTITLES))}),(x||b)&&m&&(w=w.filter(function(J){var W=J.videoCodec,j=J.width,$=J.height;return!!W||!!(j&&$)})),w=w.filter(function(J){var W=J.audioCodec,j=J.videoCodec;return(!W||Object(U.isCodecSupportedInMp4)(W,"audio"))&&(!j||Object(U.isCodecSupportedInMp4)(j,"video"))}),f.audioTracks&&(v=f.audioTracks.filter(function(J){return!J.audioCodec||Object(U.isCodecSupportedInMp4)(J.audioCodec,"audio")}),Object(B.assignTrackIdsByGroup)(v)),f.subtitles&&(c=f.subtitles,Object(B.assignTrackIdsByGroup)(c)),w.length>0){l=w[0].bitrate,w.sort(function(J,W){return J.bitrate-W.bitrate}),this._levels=w;for(var L=0;L<w.length;L++)if(w[L].bitrate===l){this._firstLevel=L,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+l);break}var C=m&&!b,H={levels:w,audioTracks:v,subtitleTracks:c,firstLevel:this._firstLevel,stats:f.stats,audio:m,video:b,altAudio:!C&&v.some(function(J){return!!J.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,H),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:f.url,reason:"no level with compatible codecs found in manifest"})},h.onError=function(g,f){if(s.prototype.onError.call(this,g,f),f.fatal)return;var w=f.context,v=this._levels[this.currentLevelIndex];if(w&&(w.type===D.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&w.groupId===v.audioGroupIds[v.urlId]||w.type===D.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&w.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var c=!1,l=!0,a;switch(f.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:case O.ErrorDetails.KEY_LOAD_ERROR:case O.ErrorDetails.KEY_LOAD_TIMEOUT:if(f.frag){var i=this._levels[f.frag.level];i?(i.fragmentError++,i.fragmentError>this.hls.config.fragLoadingMaxRetry&&(a=f.frag.level)):a=f.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(l=!1),a=w.level),c=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:a=f.level,c=!0;break}a!==void 0&&this.recoverLevel(f,a,c,l)},h.recoverLevel=function(g,f,w,v){var c=g.details,l=this._levels[f];if(l.loadError++,w){var a=this.retryLoadingOrFail(g);if(a)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var i=l.url.length;if(i>1&&l.loadError<i)g.levelRetry=!0,this.redundantFailover(f);else if(this.manualLevelIndex===-1){var x=f===0?this._levels.length-1:f-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(c+": switch to "+x),g.levelRetry=!0,this.hls.nextAutoLevel=x)}}},h.redundantFailover=function(g){var f=this._levels[g],w=f.url.length;if(w>1){var v=(f.urlId+1)%w;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(c){c.urlId=v}),this.level=g}},h.onFragLoaded=function(g,f){var w=f.frag;if(w!==void 0&&w.type===D.PlaylistLevelType.MAIN){var v=this._levels[w.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},h.onLevelLoaded=function(g,f){var w,v=f.level,c=f.details,l=this._levels[v];if(!l){var a;this.warn("Invalid level index "+v),(a=f.deliveryDirectives)!==null&&a!==void 0&&a.skip&&(c.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(l.fragmentError===0&&(l.loadError=0,this.retryCount=0),this.playlistLoaded(v,f,l.details)):(w=f.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(c.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(g,f){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var v=-1,c=this.hls.audioTracks[f.id].groupId,l=0;l<w.audioGroupIds.length;l++)if(w.audioGroupIds[l]===c){v=l;break}v!==w.urlId&&(w.urlId=v,this.startLoad())}},h.loadPlaylist=function(g){var f=this.currentLevelIndex,w=this._levels[f];if(this.canLoad&&w&&w.url.length>0){var v=w.urlId,c=w.url[v];if(g)try{c=g.addDirectives(c)}catch(l){this.warn("Could not construct new URL with HLS Delivery Directives: "+l)}this.log("Attempt loading level index "+f+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+v+" "+c),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:c,level:f,id:v,deliveryDirectives:g||null})}},h.removeLevel=function(g,f){var w=function(l,a){return a!==f},v=this._levels.filter(function(c,l){return l!==g?!0:c.url.length>1&&f!==void 0?(c.url=c.url.filter(w),c.audioGroupIds&&(c.audioGroupIds=c.audioGroupIds.filter(w)),c.textGroupIds&&(c.textGroupIds=c.textGroupIds.filter(w)),c.urlId=0,!0):!1}).map(function(c,l){var a=c.details;return a!=null&&a.fragments&&a.fragments.forEach(function(i){i.level=l}),c});this._levels=v,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:v})},P(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var f,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===g&&(f=w[g])!==null&&f!==void 0&&f.details)return;if(g<0||g>=w.length){var v=g<0;if(this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:v,reason:"invalid level idx"}),v)return;g=Math.min(g,w.length-1)}this.clearTimer();var c=this.currentLevelIndex,l=w[c],a=w[g];this.log("switching to level "+g+" from "+c),this.currentLevelIndex=g;var i=E({},a,{level:g,maxBitrate:a.maxBitrate,uri:a.uri,urlId:a.urlId});delete i._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,i);var x=a.details;if(!x||x.live){var b=this.switchParams(a.uri,l==null?void 0:l.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),u}(I.default)},"./src/controller/level-helper.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"addGroupId",function(){return O}),k.d(X,"assignTrackIdsByGroup",function(){return U}),k.d(X,"updatePTS",function(){return B}),k.d(X,"updateFragPTSDTS",function(){return D}),k.d(X,"mergeDetails",function(){return E}),k.d(X,"mapPartIntersection",function(){return R}),k.d(X,"mapFragmentIntersection",function(){return P}),k.d(X,"adjustSliding",function(){return _}),k.d(X,"addSliding",function(){return S}),k.d(X,"computeReloadInterval",function(){return y}),k.d(X,"getFragmentWithSN",function(){return d}),k.d(X,"getPartWith",function(){return s});var Q=k("./src/polyfills/number.ts"),N=k("./src/utils/logger.ts");function O(u,h,T){switch(h){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(T);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(T);break}}function U(u){var h={};u.forEach(function(T){var g=T.groupId||"";T.id=h[g]=h[g]||0,h[g]++})}function B(u,h,T){var g=u[h],f=u[T];I(g,f)}function I(u,h){var T=h.startPTS;if(Object(Q.isFiniteNumber)(T)){var g=0,f;h.sn>u.sn?(g=T-u.start,f=u):(g=u.start-T,f=h),f.duration!==g&&(f.duration=g)}else if(h.sn>u.sn){var w=u.cc===h.cc;w&&u.minEndPTS?h.start=u.start+(u.minEndPTS-u.start):h.start=u.start+u.duration}else h.start=Math.max(u.start-h.duration,0)}function D(u,h,T,g,f,w){var v=g-T;v<=0&&(N.logger.warn("Fragment should have a positive duration",h),g=T+h.duration,w=f+h.duration);var c=T,l=g,a=h.startPTS,i=h.endPTS;if(Object(Q.isFiniteNumber)(a)){var x=Math.abs(a-T);Object(Q.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(x,h.deltaPTS):h.deltaPTS=x,c=Math.max(T,a),T=Math.min(T,a),f=Math.min(f,h.startDTS),l=Math.min(g,i),g=Math.max(g,i),w=Math.max(w,h.endDTS)}h.duration=g-T;var b=T-h.start;h.appendedPTS=g,h.start=h.startPTS=T,h.maxStartPTS=c,h.startDTS=f,h.endPTS=g,h.minEndPTS=l,h.endDTS=w;var m=h.sn;if(!u||m<u.startSN||m>u.endSN)return 0;var L,C=m-u.startSN,H=u.fragments;for(H[C]=h,L=C;L>0;L--)I(H[L],H[L-1]);for(L=C;L<H.length-1;L++)I(H[L],H[L+1]);return u.fragmentHint&&I(H[H.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,b}function E(u,h){for(var T=null,g=u.fragments,f=g.length-1;f>=0;f--){var w=g[f].initSegment;if(w){T=w;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var v=0,c;if(P(u,h,function(L,C){L.relurl&&(v=L.cc-C.cc),Object(Q.isFiniteNumber)(L.startPTS)&&Object(Q.isFiniteNumber)(L.endPTS)&&(C.start=C.startPTS=L.startPTS,C.startDTS=L.startDTS,C.appendedPTS=L.appendedPTS,C.maxStartPTS=L.maxStartPTS,C.endPTS=L.endPTS,C.endDTS=L.endDTS,C.minEndPTS=L.minEndPTS,C.duration=L.endPTS-L.startPTS,C.duration&&(c=C),h.PTSKnown=h.alignedSliding=!0),C.elementaryStreams=L.elementaryStreams,C.loader=L.loader,C.stats=L.stats,C.urlId=L.urlId,L.initSegment&&(C.initSegment=L.initSegment,T=L.initSegment)}),T){var l=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;l.forEach(function(L){var C;(!L.initSegment||L.initSegment.relurl===((C=T)===null||C===void 0?void 0:C.relurl))&&(L.initSegment=T)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(L){return!L}),h.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var a=h.skippedSegments;a--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var i=h.fragments;if(v){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<i.length;x++)i[x].cc+=v}h.skippedSegments&&(h.startCC=h.fragments[0].cc),R(u.partList,h.partList,function(L,C){C.elementaryStreams=L.elementaryStreams,C.stats=L.stats}),c?D(h,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS):_(u,h),i.length&&(h.totalduration=h.edge-i[0].start),h.driftStartTime=u.driftStartTime,h.driftStart=u.driftStart;var b=h.advancedDateTime;if(h.advanced&&b){var m=h.edge;h.driftStart||(h.driftStartTime=b,h.driftStart=m),h.driftEndTime=b,h.driftEnd=m}else h.driftEndTime=u.driftEndTime,h.driftEnd=u.driftEnd,h.advancedDateTime=u.advancedDateTime}function R(u,h,T){if(u&&h)for(var g=0,f=0,w=u.length;f<=w;f++){var v=u[f],c=h[f+g];v&&c&&v.index===c.index&&v.fragment.sn===c.fragment.sn?T(v,c):g--}}function P(u,h,T){for(var g=h.skippedSegments,f=Math.max(u.startSN,h.startSN)-h.startSN,w=(u.fragmentHint?1:0)+(g?h.endSN:Math.min(u.endSN,h.endSN))-h.startSN,v=h.startSN-u.startSN,c=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,l=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,a=f;a<=w;a++){var i=l[v+a],x=c[a];g&&!x&&a<g&&(x=h.fragments[a]=i),i&&x&&T(i,x)}}function _(u,h){var T=h.startSN+h.skippedSegments-u.startSN,g=u.fragments;if(T<0||T>=g.length)return;S(h,g[T].start)}function S(u,h){if(h){for(var T=u.fragments,g=u.skippedSegments;g<T.length;g++)T[g].start+=h;u.fragmentHint&&(u.fragmentHint.start+=h)}}function y(u,h){var T=1e3*u.levelTargetDuration,g=T/2,f=u.age,w=f>0&&f<T*3,v=h.loading.end-h.loading.start,c,l=u.availabilityDelay;if(u.updated===!1)if(w){var a=333*u.misses;c=Math.max(Math.min(g,v*2),a),u.availabilityDelay=(u.availabilityDelay||0)+c}else c=g;else w?(l=Math.min(l||T/2,f),u.availabilityDelay=l,c=l+T-f):c=T-v;return Math.round(c)}function d(u,h,T){if(!u||!u.details)return null;var g=u.details,f=g.fragments[h-g.startSN];return f||(f=g.fragmentHint,f&&f.sn===h?f:h<g.startSN&&T&&T.sn===h?T:null)}function s(u,h,T){if(!u||!u.details)return null;var g=u.details.partList;if(g)for(var f=g.length;f--;){var w=g[f];if(w.index===T&&w.fragment.sn===h)return w}return null}},"./src/controller/stream-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return g});var Q=k("./src/polyfills/number.ts"),N=k("./src/controller/base-stream-controller.ts"),O=k("./src/is-supported.ts"),U=k("./src/events.ts"),B=k("./src/utils/buffer-helper.ts"),I=k("./src/controller/fragment-tracker.ts"),D=k("./src/types/loader.ts"),E=k("./src/loader/fragment.ts"),R=k("./src/demux/transmuxer-interface.ts"),P=k("./src/types/transmuxer.ts"),_=k("./src/controller/gap-controller.ts"),S=k("./src/errors.ts"),y=k("./src/utils/logger.ts");function d(f,w){for(var v=0;v<w.length;v++){var c=w[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(f,c.key,c)}}function s(f,w,v){return w&&d(f.prototype,w),v&&d(f,v),f}function u(f,w){f.prototype=Object.create(w.prototype),f.prototype.constructor=f,h(f,w)}function h(f,w){return h=Object.setPrototypeOf||function(c,l){return c.__proto__=l,c},h(f,w)}var T=100,g=function(f){u(w,f);function w(c,l){var a;return a=f.call(this,c,l,"[stream-controller]")||this,a.audioCodecSwap=!1,a.gapController=null,a.level=-1,a._forceStartLoad=!1,a.altAudio=!1,a.audioOnly=!1,a.fragPlaying=null,a.onvplaying=null,a.onvseeked=null,a.fragLastKbps=0,a.stalled=!1,a.couldBacktrack=!1,a.audioCodecSwitch=!1,a.videoBuffer=null,a._registerListeners(),a}var v=w.prototype;return v._registerListeners=function(){var l=this.hls;l.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.on(U.Events.ERROR,this.onError,this),l.on(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.on(U.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.on(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var l=this.hls;l.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.off(U.Events.ERROR,this.onError,this),l.off(U.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.off(U.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(U.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(U.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.off(U.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(l){if(this.levels){var a=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var x=i.startLevel;x===-1&&(i.config.testBandwidth?(x=0,this.bitrateTest=!0):x=i.nextAutoLevel),this.level=i.nextLoadLevel=x,this.loadedmetadata=!1}a>0&&l===-1&&(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),l=a),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,f.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var l,a=this.levels,i=this.level,x=a==null||((l=a[i])===null||l===void 0)?void 0:l.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var b,m=self.performance.now(),L=this.retryDate;(!L||m>=L||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){f.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var l,a,i=this.hls,x=this.levelLastLoaded,b=this.levels,m=this.media,L=i.config,C=i.nextLoadLevel;if(x===null||!m&&(this.startFragRequested||!L.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[C])return;var H=b[C];this.level=i.nextLoadLevel=C;var J=H.details;if(!J||this.state===N.State.WAITING_LEVEL||J.live&&this.levelLastLoaded!==C){this.state=N.State.WAITING_LEVEL;return}var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:m,D.PlaylistLevelType.MAIN);if(W===null)return;var j=W.len,$=this.getMaxBufferLength(H.maxBitrate);if(j>=$)return;if(this._streamEnded(W,J)){var se={};this.altAudio&&(se.type="video"),this.hls.trigger(U.Events.BUFFER_EOS,se),this.state=N.State.ENDED;return}var me=W.end,Ee=this.getNextFragment(me,J);if(this.couldBacktrack&&!this.fragPrevious&&Ee&&Ee.sn!=="initSegment"){var We=Ee.sn-J.startSN;We>1&&(Ee=J.fragments[We-1],this.fragmentTracker.removeFragment(Ee))}if(Ee&&this.fragmentTracker.getState(Ee)===I.FragmentState.OK&&this.nextLoadPosition>me){var Be=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(m,Be,D.PlaylistLevelType.MAIN),Ee=this.getNextFragment(this.nextLoadPosition,J)}if(!Ee)return;Ee.initSegment&&!Ee.initSegment.data&&!this.bitrateTest&&(Ee=Ee.initSegment),((l=Ee.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((a=Ee.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Ee,J):this.loadFragment(Ee,J,me)},v.loadFragment=function(l,a,i){var x,b=this.fragmentTracker.getState(l);if(this.fragCurrent=l,b===I.FragmentState.BACKTRACKED){var m=this.fragmentTracker.getBacktrackData(l);if(m){this._handleFragmentLoadProgress(m),this._handleFragmentLoadComplete(m);return}else b=I.FragmentState.NOT_LOADED}b===I.FragmentState.NOT_LOADED||b===I.FragmentState.PARTIAL?l.sn==="initSegment"?this._loadInitSegment(l):this.bitrateTest?(l.bitrateTest=!0,this.log("Fragment "+l.sn+" of level "+l.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(l)):(this.startFragRequested=!0,f.prototype.loadFragment.call(this,l,a,i)):b===I.FragmentState.APPENDING?this.reduceMaxBufferLength(l.duration)&&this.fragmentTracker.removeFragment(l):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(l){var a=this.fragmentTracker.getAppendedFrag(l,D.PlaylistLevelType.MAIN);return a&&"fragment"in a?a.fragment:a},v.getBufferedFrag=function(l){return this.fragmentTracker.getBufferedFrag(l,D.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(l){return l?this.getBufferedFrag(l.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var l=this.levels,a=this.media;if(a!=null&&a.readyState){var i,x=this.getAppendedFrag(a.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!a.paused&&l){var b=this.hls.nextLoadLevel,m=l[b],L=this.fragLastKbps;L&&this.fragCurrent?i=this.fragCurrent.duration*m.maxBitrate/(1e3*L)+1:i=0}else i=0;var C=this.getBufferedFrag(a.currentTime+i);if(C){var H=this.followingBufferedFrag(C);if(H){this.abortCurrentFrag();var J=H.maxStartPTS?H.maxStartPTS:H.start,W=H.duration,j=Math.max(C.end,J+Math.min(Math.max(W-this.config.maxFragLookUpTolerance,W*.5),W*.75));this.flushMainBuffer(j,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var l=this.fragCurrent;this.fragCurrent=null,l!=null&&l.loader&&l.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(l,a){f.prototype.flushMainBuffer.call(this,l,a,this.altAudio?"video":null)},v.onMediaAttached=function(l,a){f.prototype.onMediaAttached.call(this,l,a);var i=a.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new _.default(this.config,i,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var l=this.media;l&&(l.removeEventListener("playing",this.onvplaying),l.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),f.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var l=this.media,a=l?l.currentTime:null;Object(Q.isFiniteNumber)(a)&&this.log("Media seeked to "+a.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(U.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(l,a){var i=!1,x=!1,b;a.levels.forEach(function(m){b=m.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(i=!0),b.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=i&&x&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=a.levels,this.startFragRequested=!1},v.onLevelLoading=function(l,a){var i=this.levels;if(!i||this.state!==N.State.IDLE)return;var x=i[a.level];(!x.details||x.details.live&&this.levelLastLoaded!==a.level||this.waitForCdnTuneIn(x.details))&&(this.state=N.State.WAITING_LEVEL)},v.onLevelLoaded=function(l,a){var i,x=this.levels,b=a.level,m=a.details,L=m.totalduration;if(!x){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+m.startSN+","+m.endSN+"], cc ["+m.startCC+", "+m.endCC+"] duration:"+L);var C=this.fragCurrent;C&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(C.level!==a.level&&C.loader&&(this.state=N.State.IDLE,C.loader.abort()));var H=x[b],J=0;if(m.live||(i=H.details)!==null&&i!==void 0&&i.live){if(m.fragments[0]||(m.deltaUpdateFailed=!0),m.deltaUpdateFailed)return;J=this.alignPlaylists(m,H.details)}if(H.details=m,this.levelLastLoaded=b,this.hls.trigger(U.Events.LEVEL_UPDATED,{details:m,level:b}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(m))return;this.state=N.State.IDLE}this.startFragRequested?m.live&&this.synchronizeToLiveEdge(m):this.setStartPosition(m,J),this.tick()},v._handleFragmentLoadProgress=function(l){var a,i=l.frag,x=l.part,b=l.payload,m=this.levels;if(!m){this.warn("Levels were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered");return}var L=m[i.level],C=L.details;if(!C){this.warn("Dropping fragment "+i.sn+" of level "+i.level+" after level details were reset");return}var H=L.videoCodec,J=C.PTSKnown||!C.live,W=(a=i.initSegment)===null||a===void 0?void 0:a.data,j=this._getAudioCodec(L),$=this.transmuxer=this.transmuxer||new R.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),se=x?x.index:-1,me=se!==-1,Ee=new P.ChunkMetadata(i.level,i.sn,i.stats.chunkCount,b.byteLength,se,me),We=this.initPTS[i.cc];$.push(b,W,j,H,i,x,C.totalduration,J,Ee,We)},v.onAudioTrackSwitching=function(l,a){var i=this.altAudio,x=!!a.url,b=a.id;if(!x){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var m=this.fragCurrent;m!=null&&m.loader&&(this.log("Switching to main audio track, cancel main fragment load"),m.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var L=this.hls;i&&L.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),L.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:b})}},v.onAudioTrackSwitched=function(l,a){var i=a.id,x=!!this.hls.audioTracks[i].url;if(x){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=x,this.tick()},v.onBufferCreated=function(l,a){var i=a.tracks,x,b,m=!1;for(var L in i){var C=i[L];if(C.id==="main"){if(b=L,x=C,L==="video"){var H=i[L];H&&(this.videoBuffer=H.buffer)}}else m=!0}m&&x?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(l,a){var i=a.frag,x=a.part;if(i&&i.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(i)){this.warn("Fragment "+i.sn+(x?" p: "+x.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var b=x?x.stats:i.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),i.sn!=="initSegment"&&(this.fragPrevious=i),this.fragBufferedComplete(i,x)},v.onError=function(l,a){switch(a.details){case S.ErrorDetails.FRAG_LOAD_ERROR:case S.ErrorDetails.FRAG_LOAD_TIMEOUT:case S.ErrorDetails.KEY_LOAD_ERROR:case S.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,a);break;case S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(a.fatal?(this.warn(""+a.details),this.state=N.State.ERROR):!a.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case S.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var i=!0,x=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);x&&x.len>.5&&(i=!this.reduceMaxBufferLength(x.len)),i&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var l=this.media,a=this.gapController;if(!l||!a||!l.readyState)return;var i=B.BufferHelper.getBuffered(l);!this.loadedmetadata&&i.length?(this.loadedmetadata=!0,this.seekToStartPos()):a.poll(this.lastCurrentTime),this.lastCurrentTime=l.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(l,a){var i=a.type;if(i!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(i===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,i,D.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(l,a){this.levels=a.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var l=this.media,a=l.currentTime,i=this.startPosition;if(i>=0&&a<i){if(l.seeking){y.logger.log("could not seek to "+i+", already seeking at "+a);return}var x=B.BufferHelper.getBuffered(l),b=x.length?x.start(0):0,m=b-i;m>0&&(m<this.config.maxBufferHole||m<this.config.maxFragLookUpTolerance)&&(y.logger.log("adjusting start position by "+m+" to match buffer start"),i+=m,this.startPosition=i),this.log("seek to target start position "+i+" from current time "+a),l.currentTime=i}},v._getAudioCodec=function(l){var a=this.config.defaultAudioCodec||l.audioCodec;return this.audioCodecSwap&&a&&(this.log("Swapping audio codec"),a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5"),a},v._loadBitrateTestFrag=function(l){var a=this;this._doFragLoad(l).then(function(i){var x=a.hls;if(!i||x.nextLoadLevel||a.fragContextChanged(l))return;a.fragLoadError=0,a.state=N.State.IDLE,a.startFragRequested=!1,a.bitrateTest=!1;var b=l.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),x.trigger(U.Events.FRAG_LOADED,i)})},v._handleTransmuxComplete=function(l){var a,i="main",x=this.hls,b=l.remuxResult,m=l.chunkMeta,L=this.getCurrentContext(m);if(!L){this.warn("The loading context changed while buffering fragment "+m.sn+" of level "+m.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(m.level);return}var C=L.frag,H=L.part,J=L.level,W=b.video,j=b.text,$=b.id3,se=b.initSegment,me=this.altAudio?void 0:b.audio;if(this.fragContextChanged(C))return;if(this.state=N.State.PARSING,se){se.tracks&&(this._bufferInitSegment(J,se.tracks,C,m),x.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:C,id:i,tracks:se.tracks}));var Ee=se.initPTS,We=se.timescale;Object(Q.isFiniteNumber)(Ee)&&(this.initPTS[C.cc]=Ee,x.trigger(U.Events.INIT_PTS_FOUND,{frag:C,id:i,initPTS:Ee,timescale:We}))}if(W&&b.independent!==!1){if(J.details){var Be=W.startPTS,Ne=W.endPTS,Le=W.startDTS,Ue=W.endDTS;if(H)H.elementaryStreams[W.type]={startPTS:Be,endPTS:Ne,startDTS:Le,endDTS:Ue};else if(W.firstKeyFrame&&W.independent&&(this.couldBacktrack=!0),W.dropped&&W.independent){var ye=this.getLoadPosition()+this.config.maxBufferHole;if(ye<Be){this.backtrack(C);return}C.setElementaryStreamInfo(W.type,C.start,Ne,C.start,Ue,!0)}C.setElementaryStreamInfo(W.type,Be,Ne,Le,Ue),this.bufferFragmentData(W,C,H,m)}}else if(b.independent===!1){this.backtrack(C);return}if(me){var ce=me.startPTS,ne=me.endPTS,ve=me.startDTS,le=me.endDTS;H&&(H.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:ne,startDTS:ve,endDTS:le}),C.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ce,ne,ve,le),this.bufferFragmentData(me,C,H,m)}if($!=null&&(a=$.samples)!==null&&a!==void 0&&a.length){var Re={frag:C,id:i,samples:$.samples};x.trigger(U.Events.FRAG_PARSING_METADATA,Re)}if(j){var Ie={frag:C,id:i,samples:j.samples};x.trigger(U.Events.FRAG_PARSING_USERDATA,Ie)}},v._bufferInitSegment=function(l,a,i,x){var b=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!a.audio&&!a.video,this.altAudio&&!this.audioOnly&&delete a.audio;var m=a.audio,L=a.video,C=a.audiovideo;if(m){var H=l.audioCodec,J=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(H&&(H.indexOf("mp4a.40.5")!==-1?H="mp4a.40.2":H="mp4a.40.5"),m.metadata.channelCount!==1&&J.indexOf("firefox")===-1&&(H="mp4a.40.5")),J.indexOf("android")!==-1&&m.container!=="audio/mpeg"&&(H="mp4a.40.2",this.log("Android: force audio codec to "+H)),l.audioCodec&&l.audioCodec!==H&&this.log('Swapping manifest audio codec "'+l.audioCodec+'" for "'+H+'"'),m.levelCodec=H,m.id="main",this.log("Init audio buffer, container:"+m.container+", codecs[selected/level/parsed]=["+(H||"")+"/"+(l.audioCodec||"")+"/"+m.codec+"]")}L&&(L.levelCodec=l.videoCodec,L.id="main",this.log("Init video buffer, container:"+L.container+", codecs[level/parsed]=["+(l.videoCodec||"")+"/"+L.codec+"]")),C&&this.log("Init audiovideo buffer, container:"+C.container+", codecs[level/parsed]=["+(l.attrs.CODECS||"")+"/"+C.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,a),Object.keys(a).forEach(function(W){var j=a[W],$=j.initSegment;$!=null&&$.byteLength&&b.hls.trigger(U.Events.BUFFER_APPENDING,{type:W,data:$,frag:i,part:null,chunkMeta:x,parent:i.type})}),this.tick()},v.backtrack=function(l){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(l);var a=this.fragmentTracker.backtrack(l);this.fragPrevious=null,this.nextLoadPosition=l.start,a?this.resetFragmentLoading(l):this.state=N.State.BACKTRACKING},v.checkFragmentChanged=function(){var l=this.media,a=null;if(l&&l.readyState>1&&l.seeking===!1){var i=l.currentTime;if(B.BufferHelper.isBuffered(l,i)?a=this.getAppendedFrag(i):B.BufferHelper.isBuffered(l,i+.1)&&(a=this.getAppendedFrag(i+.1)),a){var x=this.fragPlaying,b=a.level;(!x||a.sn!==x.sn||x.level!==b||a.urlId!==x.urlId)&&(this.hls.trigger(U.Events.FRAG_CHANGED,{frag:a}),(!x||x.level!==b)&&this.hls.trigger(U.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=a)}}},s(w,[{key:"nextLevel",get:function(){var l=this.nextBufferedFrag;return l?l.level:-1}},{key:"currentLevel",get:function(){var l=this.media;if(l){var a=this.getAppendedFrag(l.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var l=this.media;if(l){var a=this.getAppendedFrag(l.currentTime);return this.followingBufferedFrag(a)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"SubtitleStreamController",function(){return u});var Q=k("./src/events.ts"),N=k("./src/utils/logger.ts"),O=k("./src/utils/buffer-helper.ts"),U=k("./src/controller/fragment-finders.ts"),B=k("./src/utils/discontinuities.ts"),I=k("./src/controller/level-helper.ts"),D=k("./src/controller/fragment-tracker.ts"),E=k("./src/controller/base-stream-controller.ts"),R=k("./src/types/loader.ts"),P=k("./src/types/level.ts");function _(h,T){for(var g=0;g<T.length;g++){var f=T[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}function S(h,T,g){return T&&_(h.prototype,T),g&&_(h,g),h}function y(h,T){h.prototype=Object.create(T.prototype),h.prototype.constructor=h,d(h,T)}function d(h,T){return d=Object.setPrototypeOf||function(f,w){return f.__proto__=w,f},d(h,T)}var s=500,u=function(h){y(T,h);function T(f,w){var v;return v=h.call(this,f,w,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var g=T.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var w=this.hls;w.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(Q.Events.ERROR,this.onError,this),w.on(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g._unregisterListeners=function(){var w=this.hls;w.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(Q.Events.ERROR,this.onError,this),w.off(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},g.startLoad=function(){this.stopLoad(),this.state=E.State.IDLE,this.setInterval(s),this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},g.onLevelLoaded=function(w,v){this.mainDetails=v.details},g.onSubtitleFragProcessed=function(w,v){var c=v.frag,l=v.success;if(this.fragPrevious=c,this.state=E.State.IDLE,!l)return;var a=this.tracksBuffered[this.currentTrackId];if(!a)return;for(var i,x=c.start,b=0;b<a.length;b++)if(x>=a[b].start&&x<=a[b].end){i=a[b];break}var m=c.start+c.duration;i?i.end=m:(i={start:x,end:m},a.push(i)),this.fragmentTracker.fragBuffered(c)},g.onBufferFlushing=function(w,v){var c=v.startOffset,l=v.endOffset;if(c===0&&l!==Number.POSITIVE_INFINITY){var a=this.currentTrackId,i=this.levels;if(!i.length||!i[a]||!i[a].details)return;var x=i[a].details,b=x.targetduration,m=l-b;if(m<=0)return;v.endOffsetSubtitles=Math.max(0,m),this.tracksBuffered.forEach(function(L){for(var C=0;C<L.length;){if(L[C].end<=m){L.shift();continue}else if(L[C].start<m)L[C].start=m;else break;C++}}),this.fragmentTracker.removeFragmentsInRange(c,m,R.PlaylistLevelType.SUBTITLE)}},g.onError=function(w,v){var c,l=v.frag;if(!l||l.type!==R.PlaylistLevelType.SUBTITLE)return;(c=this.fragCurrent)!==null&&c!==void 0&&c.loader&&this.fragCurrent.loader.abort(),this.state=E.State.IDLE},g.onSubtitleTracksUpdated=function(w,v){var c=this,l=v.subtitleTracks;this.tracksBuffered=[],this.levels=l.map(function(a){return new P.Level(a)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(a){c.tracksBuffered[a.id]=[]}),this.mediaBuffer=null},g.onSubtitleTrackSwitch=function(w,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var c=this.levels[this.currentTrackId];c!=null&&c.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,c&&this.setInterval(s)},g.onSubtitleTrackLoaded=function(w,v){var c,l=v.details,a=v.id,i=this.currentTrackId,x=this.levels;if(!x.length)return;var b=x[i];if(a>=x.length||a!==i||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,l.live||(c=b.details)!==null&&c!==void 0&&c.live){var m=this.mainDetails;if(l.deltaUpdateFailed||!m)return;var L=m.fragments[0];if(!b.details)l.hasProgramDateTime&&m.hasProgramDateTime?Object(B.alignMediaPlaylistByPDT)(l,m):L&&Object(I.addSliding)(l,L.start);else{var C=this.alignPlaylists(l,b.details);C===0&&L&&Object(I.addSliding)(l,L.start)}}if(b.details=l,this.levelLastLoaded=a,this.tick(),l.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var H=Object(U.findFragmentByPTS)(null,l.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},g._handleFragmentLoadComplete=function(w){var v=w.frag,c=w.payload,l=v.decryptdata,a=this.hls;if(this.fragContextChanged(v))return;if(c&&c.byteLength>0&&l&&l.key&&l.iv&&l.method==="AES-128"){var i=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(c),l.key.buffer,l.iv.buffer).then(function(x){var b=performance.now();a.trigger(Q.Events.FRAG_DECRYPTED,{frag:v,payload:x,stats:{tstart:i,tdecrypt:b}})})}},g.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var w,v=this.currentTrackId,c=this.levels;if(!c.length||!c[v]||!c[v].details)return;var l=c[v].details,a=l.targetduration,i=this.config,x=this.media,b=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-a,i.maxBufferHole),m=b.end,L=b.len,C=this.getMaxBufferLength()+a;if(L>C)return;console.assert(l,"Subtitle track details are defined on idle subtitle stream controller tick");var H=l.fragments,J=H.length,W=l.edge,j,$=this.fragPrevious;if(m<W){var se=i.maxFragLookUpTolerance;$&&l.hasProgramDateTime&&(j=Object(U.findFragmentByPDT)(H,$.endProgramDateTime,se)),j||(j=Object(U.findFragmentByPTS)($,H,m,se),!j&&$&&$.start<H[0].start&&(j=H[0]))}else j=H[J-1];(w=j)!==null&&w!==void 0&&w.encrypted?(N.logger.log("Loading key for "+j.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(Q.Events.KEY_LOADING,{frag:j})):j&&this.fragmentTracker.getState(j)===D.FragmentState.NOT_LOADED&&this.loadFragment(j,l,m)}},g.loadFragment=function(w,v,c){this.fragCurrent=w,h.prototype.loadFragment.call(this,w,v,c)},S(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(E.default)},"./src/controller/subtitle-track-controller.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/events.ts"),N=k("./src/utils/texttrack-utils.ts"),O=k("./src/controller/base-playlist-controller.ts"),U=k("./src/types/loader.ts");function B(_,S){for(var y=0;y<S.length;y++){var d=S[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(_,d.key,d)}}function I(_,S,y){return S&&B(_.prototype,S),y&&B(_,y),_}function D(_,S){_.prototype=Object.create(S.prototype),_.prototype.constructor=_,E(_,S)}function E(_,S){return E=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},E(_,S)}var R=function(_){D(S,_);function S(d){var s;return s=_.call(this,d,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var y=S.prototype;return y.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,_.prototype.destroy.call(this)},y.registerListeners=function(){var s=this.hls;s.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(Q.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){var s=this.hls;s.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(Q.Events.ERROR,this.onError,this)},y.onMediaAttached=function(s,u){if(this.media=u.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)},y.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},y.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 s=P(this.media.textTracks);s.forEach(function(u){Object(N.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},y.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},y.onManifestParsed=function(s,u){this.tracks=u.subtitleTracks},y.onSubtitleTrackLoaded=function(s,u){var h=u.id,T=u.details,g=this.trackId,f=this.tracksInGroup[g];if(!f){this.warn("Invalid subtitle track id "+h);return}var w=f.details;f.details=u.details,this.log("subtitle track "+h+" loaded ["+T.startSN+"-"+T.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,u,w))},y.onLevelLoading=function(s,u){this.switchLevel(u.level)},y.onLevelSwitching=function(s,u){this.switchLevel(u.level)},y.switchLevel=function(s){var u=this.hls.levels[s];if(!(u!=null&&u.textGroupIds))return;var h=u.textGroupIds[u.urlId];if(this.groupId!==h){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(v){return!h||v.groupId===h});this.tracksInGroup=g;var f=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=h;var w={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,w),f!==-1&&this.setSubtitleTrack(f,T)}},y.findTrackId=function(s){for(var u=this.tracksInGroup,h=0;h<u.length;h++){var T=u[h];if((!this.selectDefaultTrack||T.default)&&(!s||s===T.name))return T.id}return-1},y.onError=function(s,u){if(_.prototype.onError.call(this,s,u),u.fatal||!u.context)return;u.context.type===U.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},y.loadPlaylist=function(s){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var h=u.id,T=u.groupId,g=u.url;if(s)try{g=s.addDirectives(g)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Loading subtitle playlist for id "+h),this.hls.trigger(Q.Events.SUBTITLE_TRACK_LOADING,{url:g,id:h,groupId:T,deliveryDirectives:s||null})}},y.toggleTrackModes=function(s){var u=this,h=this.media,T=this.subtitleDisplay,g=this.trackId;if(!h)return;var f=P(h.textTracks),w=f.filter(function(l){return l.groupId===u.groupId});if(s===-1)[].slice.call(f).forEach(function(l){l.mode="disabled"});else{var v=w[g];v&&(v.mode="disabled")}var c=w[s];c&&(c.mode=T?"showing":"hidden")},y.setSubtitleTrack=function(s,u){var h,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(h=T[s])!==null&&h!==void 0&&h.details)||s<-1||s>=T.length)return;this.clearTimer();var g=T[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,g){var f=g.id,w=g.groupId,v=w===void 0?"":w,c=g.name,l=g.type,a=g.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:f,groupId:v,name:c,type:l,url:a});var i=this.switchParams(g.url,u==null?void 0:u.details);this.loadPlaylist(i)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:s})},y.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,u=P(this.media.textTracks),h=0;h<u.length;h++)if(u[h].mode==="hidden")s=h;else if(u[h].mode==="showing"){s=h;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},I(S,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,u)}}]),S}(O.default);function P(_){for(var S=[],y=0;y<_.length;y++){var d=_[y];d.kind==="subtitles"&&d.label&&S.push(_[y])}return S}X.default=R},"./src/controller/timeline-controller.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"TimelineController",function(){return P});var Q=k("./src/polyfills/number.ts"),N=k("./src/events.ts"),O=k("./src/utils/cea-608-parser.ts"),U=k("./src/utils/output-filter.ts"),B=k("./src/utils/webvtt-parser.ts"),I=k("./src/utils/texttrack-utils.ts"),D=k("./src/utils/imsc1-ttml-parser.ts"),E=k("./src/types/loader.ts"),R=k("./src/utils/logger.ts"),P=function(){function d(u){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=y(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.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 h=new U.default(this,"textTrack1"),T=new U.default(this,"textTrack2"),g=new U.default(this,"textTrack3"),f=new U.default(this,"textTrack4");this.cea608Parser1=new O.default(1,h,T),this.cea608Parser2=new O.default(3,g,f)}u.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(N.Events.FRAG_LOADING,this.onFragLoading,this),u.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=d.prototype;return s.destroy=function(){var h=this.hls;h.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.off(N.Events.FRAG_LOADING,this.onFragLoading,this),h.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(h,T,g,f,w){for(var v=!1,c=w.length;c--;){var l=w[c],a=S(l[0],l[1],T,g);if(a>=0&&(l[0]=Math.min(l[0],T),l[1]=Math.max(l[1],g),v=!0,a/(g-T)>.5))return}if(v||w.push([T,g]),this.config.renderTextTracksNatively){var i=this.captionsTracks[h];this.Cues.newCue(i,T,g,f)}else{var x=this.Cues.newCue(null,T,g,f);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:x,track:h})}},s.onInitPtsFound=function(h,T){var g=this,f=T.frag,w=T.id,v=T.initPTS,c=T.timescale,l=this.unparsedVttFrags;w==="main"&&(this.initPTS[f.cc]=v,this.timescale[f.cc]=c),l.length&&(this.unparsedVttFrags=[],l.forEach(function(a){g.onFragLoaded(N.Events.FRAG_LOADED,a)}))},s.getExistingTrack=function(h){var T=this.media;if(T)for(var g=0;g<T.textTracks.length;g++){var f=T.textTracks[g];if(f[h])return f}return null},s.createCaptionsTrack=function(h){this.config.renderTextTracksNatively?this.createNativeTrack(h):this.createNonNativeTrack(h)},s.createNativeTrack=function(h){if(this.captionsTracks[h])return;var T=this.captionsProperties,g=this.captionsTracks,f=this.media,w=T[h],v=w.label,c=w.languageCode,l=this.getExistingTrack(h);if(l)g[h]=l,Object(I.clearCurrentCues)(g[h]),Object(I.sendAddTrackEvent)(g[h],f);else{var a=this.createTextTrack("captions",v,c);a&&(a[h]=!0,g[h]=a)}},s.createNonNativeTrack=function(h){if(this.nonNativeCaptionsTracks[h])return;var T=this.captionsProperties[h];if(!T)return;var g=T.label,f={_id:h,label:g,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[h]=f,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[f]})},s.createTextTrack=function(h,T,g){var f=this.media;return f?f.addTextTrack(h,T,g):void 0},s.onMediaAttaching=function(h,T){this.media=T.media,this._cleanTracks()},s.onMediaDetaching=function(){var h=this.captionsTracks;Object.keys(h).forEach(function(T){Object(I.clearCurrentCues)(h[T]),delete h[T]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=y(),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())},s._cleanTracks=function(){var h=this.media;if(!h)return;var T=h.textTracks;if(T)for(var g=0;g<T.length;g++)Object(I.clearCurrentCues)(T[g])},s.onSubtitleTracksUpdated=function(h,T){var g=this;this.textTracks=[];var f=T.subtitleTracks||[],w=f.some(function(a){return a.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var v=this.tracks&&f&&this.tracks.length===f.length;if(this.tracks=f||[],this.config.renderTextTracksNatively){var c=this.media?this.media.textTracks:[];this.tracks.forEach(function(a,i){var x;if(i<c.length){for(var b=null,m=0;m<c.length;m++)if(_(c[m],a)){b=c[m];break}b&&(x=b)}x?Object(I.clearCurrentCues)(x):(x=g.createTextTrack("subtitles",a.name,a.lang),x&&(x.mode="disabled")),x&&(x.groupId=a.groupId,g.textTracks.push(x))})}else if(!v&&this.tracks&&this.tracks.length){var l=this.tracks.map(function(a){return{label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},s.onManifestLoaded=function(h,T){var g=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(f){var w=/(?:CC|SERVICE)([1-4])/.exec(f.instreamId);if(!w)return;var v="textTrack"+w[1],c=g.captionsProperties[v];if(!c)return;c.label=f.name,f.lang&&(c.languageCode=f.lang),c.media=f})},s.onFragLoading=function(h,T){var g=this.cea608Parser1,f=this.cea608Parser2,w=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(g&&f))return;if(T.frag.type===E.PlaylistLevelType.MAIN){var c,l,a=T.frag.sn,i=(c=T==null||((l=T.part)===null||l===void 0)?void 0:l.index)!=null?c:-1;a===w+1||a===w&&i===v+1||(g.reset(),f.reset()),this.lastSn=a,this.lastPartIndex=i}},s.onFragLoaded=function(h,T){var g=T.frag,f=T.payload,w=this.initPTS,v=this.unparsedVttFrags;if(g.type===E.PlaylistLevelType.SUBTITLE)if(f.byteLength){if(!Object(Q.isFiniteNumber)(w[g.cc])){v.push(T),w.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Missing initial subtitle PTS")});return}var c=g.decryptdata;if(c==null||c.key==null||c.method!=="AES-128"){var l=this.tracks[g.level],a=this.vttCCs;a[g.cc]||(a[g.cc]={start:g.start,prevCC:this.prevCC,new:!0},this.prevCC=g.cc),l&&l.textCodec===D.IMSC1_CODEC?this._parseIMSC1(g,f):this._parseVTTs(g,f,a)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(h,T){var g=this,f=this.hls;Object(D.parseIMSC1)(T,this.initPTS[h.cc],this.timescale[h.cc],function(w){g._appendCues(w,h.level),f.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(w){R.logger.log("Failed to parse IMSC1: "+w),f.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:w})})},s._parseVTTs=function(h,T,g){var f=this,w=this.hls;Object(B.parseWebVTT)(T,this.initPTS[h.cc],this.timescale[h.cc],g,h.cc,h.start,function(v){f._appendCues(v,h.level),w.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(v){f._fallbackToIMSC1(h,T),R.logger.log("Failed to parse VTT cue: "+v),w.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:v})})},s._fallbackToIMSC1=function(h,T){var g=this,f=this.tracks[h.level];f.textCodec||Object(D.parseIMSC1)(T,this.initPTS[h.cc],this.timescale[h.cc],function(){f.textCodec=D.IMSC1_CODEC,g._parseIMSC1(h,T)},function(){f.textCodec="wvtt"})},s._appendCues=function(h,T){var g=this.hls;if(this.config.renderTextTracksNatively){var f=this.textTracks[T];if(f.mode==="disabled")return;h.forEach(function(c){return Object(I.addCueToTrack)(f,c)})}else{var w=this.tracks[T],v=w.default?"default":"subtitles"+T;g.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:h,track:v})}},s.onFragDecrypted=function(h,T){var g=T.frag;if(g.type===E.PlaylistLevelType.SUBTITLE){if(!Object(Q.isFiniteNumber)(this.initPTS[g.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(N.Events.FRAG_LOADED,T)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(h,T){var g=this.cea608Parser1,f=this.cea608Parser2;if(!this.enabled||!(g&&f))return;for(var w=0;w<T.samples.length;w++){var v=T.samples[w].bytes;if(v){var c=this.extractCea608Data(v);g.addData(T.samples[w].pts,c[0]),f.addData(T.samples[w].pts,c[1])}}},s.onBufferFlushing=function(h,T){var g=T.startOffset,f=T.endOffset,w=T.endOffsetSubtitles,v=T.type,c=this.media;if(!c||c.currentTime<f)return;if(!v||v==="video"){var l=this.captionsTracks;Object.keys(l).forEach(function(i){return Object(I.removeCuesInRange)(l[i],g,f)})}if(this.config.renderTextTracksNatively&&(g===0&&w!==void 0)){var a=this.textTracks;Object.keys(a).forEach(function(i){return Object(I.removeCuesInRange)(a[i],g,w)})}},s.extractCea608Data=function(h){for(var T=h[0]&31,g=2,f=[[],[]],w=0;w<T;w++){var v=h[g++],c=127&h[g++],l=127&h[g++],a=(4&v)!==0,i=3&v;if(c===0&&l===0)continue;a&&((i===0||i===1)&&(f[i].push(c),f[i].push(l)))}return f},d}();function _(d,s){return d&&d.label===s.name&&!(d.textTrack1||d.textTrack2)}function S(d,s,u,h){return Math.min(s,h)-Math.max(d,u)}function y(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return Q});var Q=function(){function N(U,B){this.subtle=void 0,this.aesIV=void 0,this.subtle=U,this.aesIV=B}var O=N.prototype;return O.decrypt=function(B,I){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},I,B)},N}()},"./src/crypt/aes-decryptor.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"removePadding",function(){return N}),k.d(X,"default",function(){return O});var Q=k("./src/utils/typed-array.ts");function N(U){var B=U.byteLength,I=B&&new DataView(U.buffer).getUint8(B-1);return I?Object(Q.sliceUint8)(U,0,B-I):U}var O=function(){function U(){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 B=U.prototype;return B.uint8ArrayToUint32Array_=function(D){for(var E=new DataView(D),R=new Uint32Array(4),P=0;P<4;P++)R[P]=E.getUint32(P*4);return R},B.initTable=function(){var D=this.sBox,E=this.invSBox,R=this.subMix,P=R[0],_=R[1],S=R[2],y=R[3],d=this.invSubMix,s=d[0],u=d[1],h=d[2],T=d[3],g=new Uint32Array(256),f=0,w=0,v=0;for(v=0;v<256;v++)v<128?g[v]=v<<1:g[v]=v<<1^283;for(v=0;v<256;v++){var c=w^w<<1^w<<2^w<<3^w<<4;c=c>>>8^c&255^99,D[f]=c,E[c]=f;var l=g[f],a=g[l],i=g[a],x=g[c]*257^c*16843008;P[f]=x<<24|x>>>8,_[f]=x<<16|x>>>16,S[f]=x<<8|x>>>24,y[f]=x,x=i*16843009^a*65537^l*257^f*16843008,s[c]=x<<24|x>>>8,u[c]=x<<16|x>>>16,h[c]=x<<8|x>>>24,T[c]=x,f?(f=l^g[g[g[i^l]]],w^=g[g[w]]):f=w=1}},B.expandKey=function(D){for(var E=this.uint8ArrayToUint32Array_(D),R=!0,P=0;P<E.length&&R;)R=E[P]===this.key[P],P++;if(R)return;this.key=E;var _=this.keySize=E.length;if(_!==4&&_!==6&&_!==8)throw new Error("Invalid aes key size="+_);var S=this.ksRows=(_+6+1)*4,y,d,s=this.keySchedule=new Uint32Array(S),u=this.invKeySchedule=new Uint32Array(S),h=this.sBox,T=this.rcon,g=this.invSubMix,f=g[0],w=g[1],v=g[2],c=g[3],l,a;for(y=0;y<S;y++){if(y<_){l=s[y]=E[y];continue}a=l,y%_===0?(a=a<<8|a>>>24,a=h[a>>>24]<<24|h[a>>>16&255]<<16|h[a>>>8&255]<<8|h[a&255],a^=T[y/_|0]<<24):_>6&&y%_===4&&(a=h[a>>>24]<<24|h[a>>>16&255]<<16|h[a>>>8&255]<<8|h[a&255]),s[y]=l=(s[y-_]^a)>>>0}for(d=0;d<S;d++)y=S-d,d&3?a=s[y]:a=s[y-4],d<4||y<=4?u[d]=a:u[d]=f[h[a>>>24]]^w[h[a>>>16&255]]^v[h[a>>>8&255]]^c[h[a&255]],u[d]=u[d]>>>0},B.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},B.decrypt=function(D,E,R){for(var P=this.keySize+6,_=this.invKeySchedule,S=this.invSBox,y=this.invSubMix,d=y[0],s=y[1],u=y[2],h=y[3],T=this.uint8ArrayToUint32Array_(R),g=T[0],f=T[1],w=T[2],v=T[3],c=new Int32Array(D),l=new Int32Array(c.length),a,i,x,b,m,L,C,H,J,W,j,$,se,me,Ee=this.networkToHostOrderSwap;E<c.length;){for(J=Ee(c[E]),W=Ee(c[E+1]),j=Ee(c[E+2]),$=Ee(c[E+3]),m=J^_[0],L=$^_[1],C=j^_[2],H=W^_[3],se=4,me=1;me<P;me++)a=d[m>>>24]^s[L>>16&255]^u[C>>8&255]^h[H&255]^_[se],i=d[L>>>24]^s[C>>16&255]^u[H>>8&255]^h[m&255]^_[se+1],x=d[C>>>24]^s[H>>16&255]^u[m>>8&255]^h[L&255]^_[se+2],b=d[H>>>24]^s[m>>16&255]^u[L>>8&255]^h[C&255]^_[se+3],m=a,L=i,C=x,H=b,se=se+4;a=S[m>>>24]<<24^S[L>>16&255]<<16^S[C>>8&255]<<8^S[H&255]^_[se],i=S[L>>>24]<<24^S[C>>16&255]<<16^S[H>>8&255]<<8^S[m&255]^_[se+1],x=S[C>>>24]<<24^S[H>>16&255]<<16^S[m>>8&255]<<8^S[L&255]^_[se+2],b=S[H>>>24]<<24^S[m>>16&255]<<16^S[L>>8&255]<<8^S[C&255]^_[se+3],l[E]=Ee(a^g),l[E+1]=Ee(b^f),l[E+2]=Ee(x^w),l[E+3]=Ee(i^v),g=J,f=W,w=j,v=$,E=E+4}return l.buffer},U}()},"./src/crypt/decrypter.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return E});var Q=k("./src/crypt/aes-crypto.ts"),N=k("./src/crypt/fast-aes-key.ts"),O=k("./src/crypt/aes-decryptor.ts"),U=k("./src/utils/logger.ts"),B=k("./src/utils/mp4-tools.ts"),I=k("./src/utils/typed-array.ts"),D=16,E=function(){function R(_,S,y){var d=y===void 0?{}:y,s=d.removePKCS7Padding,u=s===void 0?!0:s;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=_,this.config=S,this.removePKCS7Padding=u,u)try{var h=self.crypto;h&&(this.subtle=h.subtle||h.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var P=R.prototype;return P.destroy=function(){this.observer=null},P.isSync=function(){return this.config.enableSoftwareAES},P.flush=function(){var S=this.currentResult;if(!S){this.reset();return}var y=new Uint8Array(S);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(y):y},P.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},P.decrypt=function(S,y,d,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(S),y,d);var u=this.flush();u&&s(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(S),y,d).then(s)},P.softwareDecrypt=function(S,y,d){var s=this.currentIV,u=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(S=Object(B.appendUint8Array)(h,S),this.remainderData=null);var T=this.getValidChunk(S);if(!T.length)return null;s&&(d=s);var g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new O.default),g.expandKey(y);var f=u;return this.currentResult=g.decrypt(T.buffer,0,d),this.currentIV=Object(I.sliceUint8)(T,-16).buffer,f||null},P.webCryptoDecrypt=function(S,y,d){var s=this,u=this.subtle;return(this.key!==y||!this.fastAesKey)&&(this.key=y,this.fastAesKey=new N.default(u,y)),this.fastAesKey.expandKey().then(function(h){if(!u)return Promise.reject(new Error("web crypto not initialized"));var T=new Q.default(u,d);return T.decrypt(S.buffer,h)}).catch(function(h){return s.onWebCryptoError(h,S,y,d)})},P.onWebCryptoError=function(S,y,d,s){return U.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",S),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(y,d,s)},P.getValidChunk=function(S){var y=S,d=S.length-S.length%D;return d!==S.length&&(y=Object(I.sliceUint8)(S,0,d),this.remainderData=Object(I.sliceUint8)(S,d)),y},P.logOnce=function(S){if(!this.logEnabled)return;U.logger.log("[decrypter.ts]: "+S),this.logEnabled=!1},R}()},"./src/crypt/fast-aes-key.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return Q});var Q=function(){function N(U,B){this.subtle=void 0,this.key=void 0,this.subtle=U,this.key=B}var O=N.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/demux/base-audio-demuxer.ts"),N=k("./src/demux/adts.ts"),O=k("./src/utils/logger.ts"),U=k("./src/demux/id3.ts");function B(E,R){E.prototype=Object.create(R.prototype),E.prototype.constructor=E,I(E,R)}function I(E,R){return I=Object.setPrototypeOf||function(_,S){return _.__proto__=S,_},I(E,R)}var D=function(E){B(R,E);function R(_,S){var y;return y=E.call(this)||this,y.observer=void 0,y.config=void 0,y.observer=_,y.config=S,y}var P=R.prototype;return P.resetInitSegment=function(S,y,d){E.prototype.resetInitSegment.call(this,S,y,d),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:S,duration:d,inputTimeScale:9e4,dropped:0}},R.probe=function(S){if(!S)return!1;for(var y=U.getID3Data(S,0)||[],d=y.length,s=S.length;d<s;d++)if(N.probe(S,d))return O.logger.log("ADTS sync word found !"),!0;return!1},P.canParse=function(S,y){return N.canParse(S,y)},P.appendFrame=function(S,y,d){N.initTrackConfig(S,this.observer,y,d,S.manifestCodec);var s=N.appendFrame(S,y,d,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},R}(Q.default);D.minProbeByteLength=9,X.default=D},"./src/demux/adts.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"getAudioConfig",function(){return U}),k.d(X,"isHeaderPattern",function(){return B}),k.d(X,"getHeaderLength",function(){return I}),k.d(X,"getFullFrameLength",function(){return D}),k.d(X,"canGetFrameLength",function(){return E}),k.d(X,"isHeader",function(){return R}),k.d(X,"canParse",function(){return P}),k.d(X,"probe",function(){return _}),k.d(X,"initTrackConfig",function(){return S}),k.d(X,"getFrameDuration",function(){return y}),k.d(X,"parseFrameHeader",function(){return d}),k.d(X,"appendFrame",function(){return s});var Q=k("./src/utils/logger.ts"),N=k("./src/errors.ts"),O=k("./src/events.ts");function U(u,h,T,g){var f,w,v,c,l=navigator.userAgent.toLowerCase(),a=g,i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((h[T+2]&192)>>>6)+1;var x=(h[T+2]&60)>>>2;if(x>i.length-1){u.trigger(O.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+x});return}return v=(h[T+2]&1)<<2,v|=(h[T+3]&192)>>>6,Q.logger.log("manifest codec:"+g+", ADTS type:"+f+", samplingIndex:"+x),/firefox/i.test(l)?x>=6?(f=5,c=new Array(4),w=x-3):(f=2,c=new Array(2),w=x):l.indexOf("android")!==-1?(f=2,c=new Array(2),w=x):(f=5,c=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&x>=6?w=x-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(x>=6&&v===1||/vivaldi/i.test(l))||!g&&v===1)&&(f=2,c=new Array(2)),w=x)),c[0]=f<<3,c[0]|=(x&14)>>1,c[1]|=(x&1)<<7,c[1]|=v<<3,f===5&&(c[1]|=(w&14)>>1,c[2]=(w&1)<<7,c[2]|=2<<2,c[3]=0),{config:c,samplerate:i[x],channelCount:v,codec:"mp4a.40."+f,manifestCodec:a}}function B(u,h){return u[h]===255&&(u[h+1]&246)===240}function I(u,h){return u[h+1]&1?7:9}function D(u,h){return(u[h+3]&3)<<11|u[h+4]<<3|(u[h+5]&224)>>>5}function E(u,h){return h+5<u.length}function R(u,h){return h+1<u.length&&B(u,h)}function P(u,h){return E(u,h)&&B(u,h)&&D(u,h)<=u.length-h}function _(u,h){if(R(u,h)){var T=I(u,h);if(h+T>=u.length)return!1;var g=D(u,h);if(g<=T)return!1;var f=h+g;return f===u.length||R(u,f)}return!1}function S(u,h,T,g,f){if(!u.samplerate){var w=U(h,T,g,f);if(!w)return;u.config=w.config,u.samplerate=w.samplerate,u.channelCount=w.channelCount,u.codec=w.codec,u.manifestCodec=w.manifestCodec,Q.logger.log("parsed codec:"+u.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function y(u){return 1024*9e4/u}function d(u,h,T,g,f){var w=I(u,h),v=D(u,h);if(v-=w,v>0){var c=T+g*f;return{headerLength:w,frameLength:v,stamp:c}}}function s(u,h,T,g,f){var w=y(u.samplerate),v=d(h,T,g,f,w);if(v){var c=v.frameLength,l=v.headerLength,a=v.stamp,i=l+c,x=Math.max(0,T+i-h.length),b;x?(b=new Uint8Array(i-l),b.set(h.subarray(T+l,h.length),0)):b=h.subarray(T+l,T+i);var m={unit:b,pts:a};return x||u.samples.push(m),{sample:m,length:i,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"initPTSFn",function(){return D});var Q=k("./src/polyfills/number.ts"),N=k("./src/demux/id3.ts"),O=k("./src/demux/dummy-demuxed-track.ts"),U=k("./src/utils/mp4-tools.ts"),B=k("./src/utils/typed-array.ts"),I=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var R=E.prototype;return R.resetInitSegment=function(_,S,y){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},R.resetTimeStamp=function(){},R.resetContiguity=function(){},R.canParse=function(_,S){return!1},R.appendFrame=function(_,S,y){},R.demux=function(_,S){this.cachedData&&(_=Object(U.appendUint8Array)(this.cachedData,_),this.cachedData=null);var y=N.getID3Data(_,0),d=y?y.length:0,s,u,h=this._audioTrack,T=this._id3Track,g=y?N.getTimeStamp(y):void 0,f=_.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(g,S)),y&&y.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:y}),u=this.initPTS;d<f;){if(this.canParse(_,d)){var w=this.appendFrame(h,_,d);w?(this.frameIndex++,u=w.sample.pts,d+=w.length,s=d):d=f}else N.canParse(_,d)?(y=N.getID3Data(_,d),T.samples.push({pts:u,dts:u,data:y}),d+=y.length,s=d):d++;if(d===f&&s!==f){var v=Object(B.sliceUint8)(_,s);this.cachedData?this.cachedData=Object(U.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:h,avcTrack:Object(O.dummyTrack)(),id3Track:T,textTrack:Object(O.dummyTrack)()}},R.demuxSampleAes=function(_,S,y){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},R.flush=function(_){var S=this.cachedData;return S&&(this.cachedData=null,this.demux(S,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},R.destroy=function(){},E}(),D=function(R,P){return Object(Q.isFiniteNumber)(R)?R*90:P*9e4};X.default=I},"./src/demux/chunk-cache.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return Q});var Q=function(){function O(){this.chunks=[],this.dataLength=0}var U=O.prototype;return U.push=function(I){this.chunks.push(I),this.dataLength+=I.length},U.flush=function(){var I=this.chunks,D=this.dataLength,E;if(I.length)I.length===1?E=I[0]:E=N(I,D);else return new Uint8Array(0);return this.reset(),E},U.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function N(O,U){for(var B=new Uint8Array(U),I=0,D=0;D<O.length;D++){var E=O[D];B.set(E,I),I+=E.length}return B}},"./src/demux/dummy-demuxed-track.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"dummyTrack",function(){return Q});function Q(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/utils/logger.ts"),N=function(){function O(B){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=B,this.bytesAvailable=B.byteLength,this.word=0,this.bitsAvailable=0}var U=O.prototype;return U.loadWord=function(){var I=this.data,D=this.bytesAvailable,E=I.byteLength-D,R=new Uint8Array(4),P=Math.min(4,D);if(P===0)throw new Error("no bytes available");R.set(I.subarray(E,E+P)),this.word=new DataView(R.buffer).getUint32(0),this.bitsAvailable=P*8,this.bytesAvailable-=P},U.skipBits=function(I){var D;this.bitsAvailable>I?(this.word<<=I,this.bitsAvailable-=I):(I-=this.bitsAvailable,D=I>>3,I-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=I,this.bitsAvailable-=I)},U.readBits=function(I){var D=Math.min(this.bitsAvailable,I),E=this.word>>>32-D;return I>32&&Q.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=I-D,D>0&&this.bitsAvailable?E<<D|this.readBits(D):E},U.skipLZ=function(){var I;for(I=0;I<this.bitsAvailable;++I)if((this.word&2147483648>>>I)!==0)return this.word<<=I,this.bitsAvailable-=I,I;return this.loadWord(),I+this.skipLZ()},U.skipUEG=function(){this.skipBits(1+this.skipLZ())},U.skipEG=function(){this.skipBits(1+this.skipLZ())},U.readUEG=function(){var I=this.skipLZ();return this.readBits(I+1)-1},U.readEG=function(){var I=this.readUEG();return 1&I?1+I>>>1:-1*(I>>>1)},U.readBoolean=function(){return this.readBits(1)===1},U.readUByte=function(){return this.readBits(8)},U.readUShort=function(){return this.readBits(16)},U.readUInt=function(){return this.readBits(32)},U.skipScalingList=function(I){for(var D=8,E=8,R,P=0;P<I;P++)E!==0&&(R=this.readEG(),E=(D+R+256)%256),D=E===0?D:E},U.readSPS=function(){var I=0,D=0,E=0,R=0,P,_,S,y=this.readUByte.bind(this),d=this.readBits.bind(this),s=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),T=this.skipEG.bind(this),g=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);y();var w=y();if(d(5),h(3),y(),g(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var v=s();if(v===3&&h(1),g(),g(),h(1),u())for(_=v!==3?8:12,S=0;S<_;S++)u()&&(S<6?f(16):f(64))}g();var c=s();if(c===0)s();else if(c===1)for(h(1),T(),T(),P=s(),S=0;S<P;S++)T();g(),h(1);var l=s(),a=s(),i=d(1);i===0&&h(1),h(1),u()&&(I=s(),D=s(),E=s(),R=s());var x=[1,1];if(u()&&u()){var b=y();switch(b){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[y()<<8|y(),y()<<8|y()];break}}}return{width:Math.ceil((l+1)*16-I*2-D*2),height:(2-i)*(a+1)*16-(i?2:4)*(E+R),pixelRatio:x}},U.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();X.default=N},"./src/demux/id3.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"isHeader",function(){return Q}),k.d(X,"isFooter",function(){return N}),k.d(X,"getID3Data",function(){return O}),k.d(X,"canParse",function(){return B}),k.d(X,"getTimeStamp",function(){return I}),k.d(X,"isTimeStampFrame",function(){return D}),k.d(X,"getID3Frames",function(){return R}),k.d(X,"decodeFrame",function(){return P}),k.d(X,"utf8ArrayToStr",function(){return s}),k.d(X,"testables",function(){return u});var Q=function(f,w){return w+10<=f.length&&(f[w]===73&&f[w+1]===68&&f[w+2]===51&&(f[w+3]<255&&f[w+4]<255&&(f[w+6]<128&&f[w+7]<128&&f[w+8]<128&&f[w+9]<128)))},N=function(f,w){return w+10<=f.length&&(f[w]===51&&f[w+1]===68&&f[w+2]===73&&(f[w+3]<255&&f[w+4]<255&&(f[w+6]<128&&f[w+7]<128&&f[w+8]<128&&f[w+9]<128)))},O=function(f,w){for(var v=w,c=0;Q(f,w);){c+=10;var l=U(f,w+6);c+=l,N(f,w+10)&&(c+=10),w+=c}return c>0?f.subarray(v,v+c):void 0},U=function(f,w){var v=0;return v=(f[w]&127)<<21,v|=(f[w+1]&127)<<14,v|=(f[w+2]&127)<<7,v|=f[w+3]&127,v},B=function(f,w){return Q(f,w)&&U(f,w+6)+10<=f.length-w},I=function(f){for(var w=R(f),v=0;v<w.length;v++){var c=w[v];if(D(c))return d(c)}return},D=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},E=function(f){var w=String.fromCharCode(f[0],f[1],f[2],f[3]),v=U(f,4),c=10;return{type:w,size:v,data:f.subarray(c,c+v)}},R=function(f){for(var w=0,v=[];Q(f,w);){var c=U(f,w+6);w+=10;for(var l=w+c;w+8<l;){var a=E(f.subarray(w)),i=P(a);i&&v.push(i),w+=a.size+10}N(f,w)&&(w+=10)}return v},P=function(f){return f.type==="PRIV"?_(f):f.type[0]==="W"?y(f):S(f)},_=function(f){if(f.size<2)return;var w=s(f.data,!0),v=new Uint8Array(f.data.subarray(w.length+1));return{key:f.type,info:w,data:v.buffer}},S=function(f){if(f.size<2)return;if(f.type==="TXXX"){var w=1,v=s(f.data.subarray(w),!0);w+=v.length+1;var c=s(f.data.subarray(w));return{key:f.type,info:v,data:c}}var l=s(f.data.subarray(1));return{key:f.type,data:l}},y=function(f){if(f.type==="WXXX"){if(f.size<2)return;var w=1,v=s(f.data.subarray(w),!0);w+=v.length+1;var c=s(f.data.subarray(w));return{key:f.type,info:v,data:c}}var l=s(f.data);return{key:f.type,data:l}},d=function(f){if(f.data.byteLength===8){var w=new Uint8Array(f.data),v=w[3]&1,c=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return c/=45,v&&(c+=4772185884e-2),Math.round(c)}return},s=function(f,w){w===void 0&&(w=!1);var v=T();if(v){var c=v.decode(f);if(w){var l=c.indexOf("\0");return l!==-1?c.substring(0,l):c}return c.replace(/\0/g,"")}for(var a=f.length,i,x,b,m="",L=0;L<a;){if(i=f[L++],i===0&&w)return m;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:m+=String.fromCharCode(i);break;case 12:case 13:x=f[L++],m+=String.fromCharCode((i&31)<<6|x&63);break;case 14:x=f[L++],b=f[L++],m+=String.fromCharCode((i&15)<<12|(x&63)<<6|(b&63)<<0);break;default:}}return m},u={decodeTextFrame:S},h;function T(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/demux/base-audio-demuxer.ts"),N=k("./src/demux/id3.ts"),O=k("./src/utils/logger.ts"),U=k("./src/demux/mpegaudio.ts");function B(E,R){E.prototype=Object.create(R.prototype),E.prototype.constructor=E,I(E,R)}function I(E,R){return I=Object.setPrototypeOf||function(_,S){return _.__proto__=S,_},I(E,R)}var D=function(E){B(R,E);function R(){return E.apply(this,arguments)||this}var P=R.prototype;return P.resetInitSegment=function(S,y,d){E.prototype.resetInitSegment.call(this,S,y,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:S,duration:d,inputTimeScale:9e4,dropped:0}},R.probe=function(S){if(!S)return!1;for(var y=N.getID3Data(S,0)||[],d=y.length,s=S.length;d<s;d++)if(U.probe(S,d))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},P.canParse=function(S,y){return U.canParse(S,y)},P.appendFrame=function(S,y,d){return this.initPTS===null?void 0:U.appendFrame(S,y,d,this.initPTS,this.frameIndex)},R}(Q.default);D.minProbeByteLength=4,X.default=D},"./src/demux/mp4demuxer.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/utils/mp4-tools.ts"),N=k("./src/demux/dummy-demuxed-track.ts"),O=function(){function U(I,D){this.remainderData=null,this.config=void 0,this.config=D}var B=U.prototype;return B.resetTimeStamp=function(){},B.resetInitSegment=function(){},B.resetContiguity=function(){},U.probe=function(D){return Object(Q.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},B.demux=function(D){var E=D,R=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(Q.appendUint8Array)(this.remainderData,D));var P=Object(Q.segmentValidRange)(E);this.remainderData=P.remainder,R.samples=P.valid||new Uint8Array}else R.samples=E;return{audioTrack:Object(N.dummyTrack)(),avcTrack:R,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},B.flush=function(){var D=Object(N.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:D,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},B.demuxSampleAes=function(D,E,R){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},B.destroy=function(){},U}();O.minProbeByteLength=1024,X.default=O},"./src/demux/mpegaudio.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"appendFrame",function(){return I}),k.d(X,"parseHeader",function(){return D}),k.d(X,"isHeaderPattern",function(){return E}),k.d(X,"isHeader",function(){return R}),k.d(X,"canParse",function(){return P}),k.d(X,"probe",function(){return _});var Q=null,N=[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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],U=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],B=[0,1,1,4];function I(S,y,d,s,u){if(d+24>y.length)return;var h=D(y,d);if(h&&d+h.frameLength<=y.length){var T=h.samplesPerFrame*9e4/h.sampleRate,g=s+u*T,f={unit:y.subarray(d,d+h.frameLength),pts:g,dts:g};return S.config=[],S.channelCount=h.channelCount,S.samplerate=h.sampleRate,S.samples.push(f),{sample:f,length:h.frameLength,missing:0}}}function D(S,y){var d=S[y+1]>>3&3,s=S[y+1]>>1&3,u=S[y+2]>>4&15,h=S[y+2]>>2&3;if(d!==1&&u!==0&&u!==15&&h!==3){var T=S[y+2]>>1&1,g=S[y+3]>>6,f=d===3?3-s:s===3?3:4,w=N[f*14+u-1]*1e3,v=d===3?0:d===2?1:2,c=O[v*3+h],l=g===3?1:2,a=U[d][s],i=B[s],x=a*8*i,b=Math.floor(a*w/c+T)*i;if(Q===null){var m=navigator.userAgent||"",L=m.match(/Chrome\/(\d+)/i);Q=L?parseInt(L[1]):0}var C=!!Q&&Q<=87;return C&&s===2&&w>=224e3&&g===0&&(S[y+3]=S[y+3]|128),{sampleRate:c,channelCount:l,frameLength:b,samplesPerFrame:x}}}function E(S,y){return S[y]===255&&(S[y+1]&224)===224&&(S[y+1]&6)!==0}function R(S,y){return y+1<S.length&&E(S,y)}function P(S,y){var d=4;return E(S,y)&&d<=S.length-y}function _(S,y){if(y+1<S.length&&E(S,y)){var d=4,s=D(S,y),u=d;s!=null&&s.frameLength&&(u=s.frameLength);var h=y+u;return h===S.length||R(S,h)}return!1}},"./src/demux/sample-aes.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/crypt/decrypter.ts"),N=k("./src/demux/tsdemuxer.ts"),O=function(){function U(I,D,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new Q.default(I,D,{removePKCS7Padding:!1})}var B=U.prototype;return B.decryptBuffer=function(D,E){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,E)},B.decryptAacSample=function(D,E,R,P){var _=D[E].unit,S=_.subarray(16,_.length-_.length%16),y=S.buffer.slice(S.byteOffset,S.byteOffset+S.length),d=this;this.decryptBuffer(y,function(s){var u=new Uint8Array(s);_.set(u,16),P||d.decryptAacSamples(D,E+1,R)})},B.decryptAacSamples=function(D,E,R){for(;;E++){if(E>=D.length){R();return}if(D[E].unit.length<32)continue;var P=this.decrypter.isSync();if(this.decryptAacSample(D,E,R,P),!P)return}},B.getAvcEncryptedData=function(D){for(var E=Math.floor((D.length-48)/160)*16+16,R=new Int8Array(E),P=0,_=32;_<=D.length-16;_+=160,P+=16)R.set(D.subarray(_,_+16),P);return R},B.getAvcDecryptedUnit=function(D,E){for(var R=new Uint8Array(E),P=0,_=32;_<=D.length-16;_+=160,P+=16)D.set(R.subarray(P,P+16),_);return D},B.decryptAvcSample=function(D,E,R,P,_,S){var y=Object(N.discardEPB)(_.data),d=this.getAvcEncryptedData(y),s=this;this.decryptBuffer(d.buffer,function(u){_.data=s.getAvcDecryptedUnit(y,u),S||s.decryptAvcSamples(D,E,R+1,P)})},B.decryptAvcSamples=function(D,E,R,P){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,R=0){if(E>=D.length){P();return}for(var _=D[E].units;!(R>=_.length);R++){var S=_[R];if(S.data.length<=48||S.type!==1&&S.type!==5)continue;var y=this.decrypter.isSync();if(this.decryptAvcSample(D,E,R,P,S,y),!y)return}}},U}();X.default=O},"./src/demux/transmuxer-interface.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return _});var Q=k("./node_modules/webworkify-webpack/index.js"),N=k.n(Q),O=k("./src/events.ts"),U=k("./src/demux/transmuxer.ts"),B=k("./src/utils/logger.ts"),I=k("./src/errors.ts"),D=k("./src/utils/mediasource-helper.ts"),E=k("./node_modules/eventemitter3/index.js"),R=k.n(E),P=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},_=function(){function S(d,s,u,h){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=d,this.id=s,this.onTransmuxComplete=u,this.onFlush=h;var g=d.config,f=function(a,i){i=i||{},i.frag=T.frag,i.id=T.id,d.trigger(a,i)};this.observer=new E.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,f),this.observer.on(O.Events.ERROR,f);var w={mp4:P.isTypeSupported("video/mp4"),mpeg:P.isTypeSupported("audio/mpeg"),mp3:P.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){B.logger.log("demuxing in webworker");var c;try{c=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(l){d.trigger(O.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(l.message+" ("+l.filename+":"+l.lineno+")")})},c.postMessage({cmd:"init",typeSupported:w,vendor:v,id:s,config:JSON.stringify(g)})}catch(l){B.logger.warn("Error in worker:",l),B.logger.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new U.default(this.observer,w,g,v,s),this.worker=null}}else this.transmuxer=new U.default(this.observer,w,g,v,s)}var y=S.prototype;return y.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},y.push=function(s,u,h,T,g,f,w,v,c,l){var a=this;c.transmuxing.start=self.performance.now();var i=this.transmuxer,x=this.worker,b=f?f.start:g.start,m=g.decryptdata,L=this.frag,C=!(L&&g.cc===L.cc),H=!(L&&c.level===L.level),J=L?c.sn-L.sn:-1,W=this.part?c.part-this.part.index:1,j=!H&&(J===1||J===0&&W===1),$=self.performance.now();(H||J||g.stats.parsing.start===0)&&(g.stats.parsing.start=$),f&&(W||!j)&&(f.stats.parsing.start=$);var se=new U.TransmuxState(C,j,v,H,b);if(!j||C){B.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+`
|
|
discontinuity: `+C+`
|
|
trackSwitch: `+H+`
|
|
contiguous: `+j+`
|
|
accurateTimeOffset: `+v+`
|
|
timeOffset: `+b);var me=new U.TransmuxConfig(h,T,u,w,l);this.configureTransmuxer(me)}if(this.frag=g,this.part=f,x)x.postMessage({cmd:"demux",data:s,decryptdata:m,chunkMeta:c,state:se},s instanceof ArrayBuffer?[s]:[]);else if(i){var Ee=i.push(s,m,c,se);Object(U.isPromise)(Ee)?Ee.then(function(We){a.handleTransmuxComplete(We)}):this.handleTransmuxComplete(Ee)}},y.flush=function(s){var u=this;s.transmuxing.start=self.performance.now();var h=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:s});else if(h){var g=h.flush(s);Object(U.isPromise)(g)?g.then(function(f){u.handleFlushResult(f,s)}):this.handleFlushResult(g,s)}},y.handleFlushResult=function(s,u){var h=this;s.forEach(function(T){h.handleTransmuxComplete(T)}),this.onFlush(u)},y.onWorkerMessage=function(s){var u=s.data,h=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,h.trigger(u.event,u.data);break}}},y.configureTransmuxer=function(s){var u=this.worker,h=this.transmuxer;u?u.postMessage({cmd:"configure",config:s}):h&&h.configure(s)},y.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},S}()},"./src/demux/transmuxer-worker.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return I});var Q=k("./src/demux/transmuxer.ts"),N=k("./src/events.ts"),O=k("./src/utils/logger.ts"),U=k("./node_modules/eventemitter3/index.js"),B=k.n(U);function I(_){var S=new U.EventEmitter,y=function(s,u){_.postMessage({event:s,data:u})};S.on(N.Events.FRAG_DECRYPTED,y),S.on(N.Events.ERROR,y),_.addEventListener("message",function(d){var s=d.data;switch(s.cmd){case"init":{var u=JSON.parse(s.config);_.transmuxer=new Q.default(S,s.typeSupported,u,s.vendor,s.id),Object(O.enableLogs)(u.debug),y("init",null);break}case"configure":{_.transmuxer.configure(s.config);break}case"demux":{var h=_.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(Q.isPromise)(h)?h.then(function(f){D(_,f)}):D(_,h);break}case"flush":{var T=s.chunkMeta,g=_.transmuxer.flush(T);Object(Q.isPromise)(g)?g.then(function(f){R(_,f,T)}):R(_,g,T);break}default:break}})}function D(_,S){if(P(S.remuxResult))return;var y=[],d=S.remuxResult,s=d.audio,u=d.video;s&&E(y,s),u&&E(y,u),_.postMessage({event:"transmuxComplete",data:S},y)}function E(_,S){S.data1&&_.push(S.data1.buffer),S.data2&&_.push(S.data2.buffer)}function R(_,S,y){S.forEach(function(d){D(_,d)}),_.postMessage({event:"flush",data:y})}function P(_){return!_.audio&&!_.video&&!_.text&&!_.id3&&!_.initSegment}},"./src/demux/transmuxer.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return u}),k.d(X,"isPromise",function(){return g}),k.d(X,"TransmuxConfig",function(){return f}),k.d(X,"TransmuxState",function(){return w});var Q=k("./src/events.ts"),N=k("./src/errors.ts"),O=k("./src/crypt/decrypter.ts"),U=k("./src/demux/aacdemuxer.ts"),B=k("./src/demux/mp4demuxer.ts"),I=k("./src/demux/tsdemuxer.ts"),D=k("./src/demux/mp3demuxer.ts"),E=k("./src/remux/mp4-remuxer.ts"),R=k("./src/remux/passthrough-remuxer.ts"),P=k("./src/demux/chunk-cache.ts"),_=k("./src/utils/mp4-tools.ts"),S=k("./src/utils/logger.ts"),y;try{y=self.performance.now.bind(self.performance)}catch(v){S.logger.debug("Unable to use Performance API on this environment"),y=self.Date.now}var d=[{demux:I.default,remux:E.default},{demux:B.default,remux:R.default},{demux:U.default,remux:E.default},{demux:D.default,remux:E.default}],s=1024;d.forEach(function(v){var c=v.demux;s=Math.max(s,c.minProbeByteLength)});var u=function(){function v(l,a,i,x,b){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 P.default,this.observer=l,this.typeSupported=a,this.config=i,this.vendor=x,this.id=b}var c=v.prototype;return c.configure=function(a){this.transmuxConfig=a,this.decrypter&&this.decrypter.reset()},c.push=function(a,i,x,b){var m=this,L=x.transmuxing;L.executeStart=y();var C=new Uint8Array(a),H=this.cache,J=this.config,W=this.currentTransmuxState,j=this.transmuxConfig;b&&(this.currentTransmuxState=b);var $=h(C,i);if($&&$.method==="AES-128"){var se=this.getDecrypter();if(J.enableSoftwareAES){var me=se.softwareDecrypt(C,$.key.buffer,$.iv.buffer);if(!me)return L.executeEnd=y(),T(x);C=new Uint8Array(me)}else return this.decryptionPromise=se.webCryptoDecrypt(C,$.key.buffer,$.iv.buffer).then(function(He){var Ze=m.push(He,null,x);return m.decryptionPromise=null,Ze}),this.decryptionPromise}var Ee=b||W,We=Ee.contiguous,Be=Ee.discontinuity,Ne=Ee.trackSwitch,Le=Ee.accurateTimeOffset,Ue=Ee.timeOffset,ye=j.audioCodec,ce=j.videoCodec,ne=j.defaultInitPts,ve=j.duration,le=j.initSegmentData;if((Be||Ne)&&this.resetInitSegment(le,ye,ce,ve),Be&&this.resetInitialTimestamp(ne),We||this.resetContiguity(),this.needsProbing(C,Be,Ne)){if(H.dataLength){var Re=H.flush();C=Object(_.appendUint8Array)(Re,C)}this.configureTransmuxer(C,j)}var Ie=this.transmux(C,$,Ue,Le,x),Ce=this.currentTransmuxState;return Ce.contiguous=!0,Ce.discontinuity=!1,Ce.trackSwitch=!1,L.executeEnd=y(),Ie},c.flush=function(a){var i=this,x=a.transmuxing;x.executeStart=y();var b=this.decrypter,m=this.cache,L=this.currentTransmuxState,C=this.decryptionPromise;if(C)return C.then(function(){return i.flush(a)});var H=[],J=L.timeOffset;if(b){var W=b.flush();W&&H.push(this.push(W,null,a))}var j=m.dataLength;m.reset();var $=this.demuxer,se=this.remuxer;if(!$||!se)return j>=s&&this.observer.emit(Q.Events.ERROR,Q.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=y(),[T(a)];var me=$.flush(J);return g(me)?me.then(function(Ee){return i.flushRemux(H,Ee,a),H}):(this.flushRemux(H,me,a),H)},c.flushRemux=function(a,i,x){var b=i.audioTrack,m=i.avcTrack,L=i.id3Track,C=i.textTrack,H=this.currentTransmuxState,J=H.accurateTimeOffset,W=H.timeOffset;S.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var j=this.remuxer.remux(b,m,L,C,W,J,!0,this.id);a.push({remuxResult:j,chunkMeta:x}),x.transmuxing.executeEnd=y()},c.resetInitialTimestamp=function(a){var i=this.demuxer,x=this.remuxer;if(!i||!x)return;i.resetTimeStamp(a),x.resetTimeStamp(a)},c.resetContiguity=function(){var a=this.demuxer,i=this.remuxer;if(!a||!i)return;a.resetContiguity(),i.resetNextTimestamp()},c.resetInitSegment=function(a,i,x,b){var m=this.demuxer,L=this.remuxer;if(!m||!L)return;m.resetInitSegment(i,x,b),L.resetInitSegment(a,i,x)},c.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},c.transmux=function(a,i,x,b,m){var L;return i&&i.method==="SAMPLE-AES"?L=this.transmuxSampleAes(a,i,x,b,m):L=this.transmuxUnencrypted(a,x,b,m),L},c.transmuxUnencrypted=function(a,i,x,b){var m=this.demuxer.demux(a,i,!1,!this.config.progressive),L=m.audioTrack,C=m.avcTrack,H=m.id3Track,J=m.textTrack,W=this.remuxer.remux(L,C,H,J,i,x,!1,this.id);return{remuxResult:W,chunkMeta:b}},c.transmuxSampleAes=function(a,i,x,b,m){var L=this;return this.demuxer.demuxSampleAes(a,i,x).then(function(C){var H=L.remuxer.remux(C.audioTrack,C.avcTrack,C.id3Track,C.textTrack,x,b,!1,L.id);return{remuxResult:H,chunkMeta:m}})},c.configureTransmuxer=function(a,i){for(var x=this.config,b=this.observer,m=this.typeSupported,L=this.vendor,C=i.audioCodec,H=i.defaultInitPts,J=i.duration,W=i.initSegmentData,j=i.videoCodec,$,se=0,me=d.length;se<me;se++)if(d[se].demux.probe(a)){$=d[se];break}$||(S.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),$={demux:B.default,remux:R.default});var Ee=this.demuxer,We=this.remuxer,Be=$.remux,Ne=$.demux;(!We||!(We instanceof Be))&&(this.remuxer=new Be(b,x,m,L)),(!Ee||!(Ee instanceof Ne))&&(this.demuxer=new Ne(b,x,m),this.probe=Ne.probe),this.resetInitSegment(W,C,j,J),this.resetInitialTimestamp(H)},c.needsProbing=function(a,i,x){return!this.demuxer||!this.remuxer||i||x},c.getDecrypter=function(){var a=this.decrypter;return a||(a=this.decrypter=new O.default(this.observer,this.config)),a},v}();function h(v,c){var l=null;return v.byteLength>0&&c!=null&&c.key!=null&&c.iv!==null&&c.method!=null&&(l=c),l}var T=function(c){return{remuxResult:{},chunkMeta:c}};function g(v){return"then"in v&&v.then instanceof Function}var f=function(c,l,a,i,x){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=c,this.videoCodec=l,this.initSegmentData=a,this.duration=i,this.defaultInitPts=x},w=function(c,l,a,i,x){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=c,this.contiguous=l,this.accurateTimeOffset=a,this.trackSwitch=i,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"discardEPB",function(){return T});var Q=k("./src/demux/adts.ts"),N=k("./src/demux/mpegaudio.ts"),O=k("./src/demux/exp-golomb.ts"),U=k("./src/demux/id3.ts"),B=k("./src/demux/sample-aes.ts"),I=k("./src/events.ts"),D=k("./src/utils/mp4-tools.ts"),E=k("./src/utils/logger.ts"),R=k("./src/errors.ts"),P={video:1,audio:2,id3:3,text:4},_=function(){function g(w,v,c){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=w,this.config=v,this.typeSupported=c}g.probe=function(v){var c=g.syncOffset(v);return c<0?!1:(c&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+c+", junk ahead ?"),!0)},g.syncOffset=function(v){for(var c=Math.min(1e3,v.length-3*188),l=0;l<c;){if(v[l]===71&&v[l+188]===71&&v[l+2*188]===71)return l;l++}return-1},g.createTrack=function(v,c){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:P[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?c:void 0}};var f=g.prototype;return f.resetInitSegment=function(v,c,l){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=g.createTrack("video",l),this._audioTrack=g.createTrack("audio",l),this._id3Track=g.createTrack("id3",l),this._txtTrack=g.createTrack("text",l),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=c,this._duration=l},f.resetTimeStamp=function(){},f.resetContiguity=function(){var v=this._audioTrack,c=this._avcTrack,l=this._id3Track;v&&(v.pesData=null),c&&(c.pesData=null),l&&(l.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},f.demux=function(v,c,l,a){l===void 0&&(l=!1),a===void 0&&(a=!1),l||(this.sampleAes=null);var i,x=this._avcTrack,b=this._audioTrack,m=this._id3Track,L=x.pid,C=x.pesData,H=b.pid,J=m.pid,W=b.pesData,j=m.pesData,$=!1,se=this.pmtParsed,me=this._pmtId,Ee=v.length;if(this.remainderData&&(v=Object(D.appendUint8Array)(this.remainderData,v),Ee=v.length,this.remainderData=null),Ee<188&&!a)return this.remainderData=v,{audioTrack:b,avcTrack:x,id3Track:m,textTrack:this._txtTrack};var We=Math.max(0,g.syncOffset(v));Ee-=(Ee+We)%188,Ee<v.byteLength&&!a&&(this.remainderData=new Uint8Array(v.buffer,Ee,v.buffer.byteLength-Ee));for(var Be=We;Be<Ee;Be+=188)if(v[Be]===71){var Ne=!!(v[Be+1]&64),Le=((v[Be+1]&31)<<8)+v[Be+2],Ue=(v[Be+3]&48)>>4,ye=void 0;if(Ue>1){if(ye=Be+5+v[Be+4],ye===Be+188)continue}else ye=Be+4;switch(Le){case L:Ne&&(C&&(i=s(C))&&this.parseAVCPES(i,!1),C={data:[],size:0}),C&&(C.data.push(v.subarray(ye,Be+188)),C.size+=Be+188-ye);break;case H:Ne&&(W&&(i=s(W))&&(b.isAAC?this.parseAACPES(i):this.parseMPEGPES(i)),W={data:[],size:0}),W&&(W.data.push(v.subarray(ye,Be+188)),W.size+=Be+188-ye);break;case J:Ne&&(j&&(i=s(j))&&this.parseID3PES(i),j={data:[],size:0}),j&&(j.data.push(v.subarray(ye,Be+188)),j.size+=Be+188-ye);break;case 0:Ne&&(ye+=v[ye]+1),me=this._pmtId=y(v,ye);break;case me:{Ne&&(ye+=v[ye]+1);var ce=d(v,ye,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,l);L=ce.avc,L>0&&(x.pid=L),H=ce.audio,H>0&&(b.pid=H,b.isAAC=ce.isAAC),J=ce.id3,J>0&&(m.pid=J),$&&!se&&(E.logger.log("reparse from beginning"),$=!1,Be=We-188),se=this.pmtParsed=!0;break}case 17:case 8191:break;default:$=!0;break}}else this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=C,b.pesData=W,m.pesData=j;var ne={audioTrack:b,avcTrack:x,id3Track:m,textTrack:this._txtTrack};return a&&this.extractRemainingSamples(ne),ne},f.flush=function(){var v=this.remainderData;this.remainderData=null;var c;return v?c=this.demux(v,-1,!1,!0):c={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(c),this.sampleAes?this.decrypt(c,this.sampleAes):c},f.extractRemainingSamples=function(v){var c=v.audioTrack,l=v.avcTrack,a=v.id3Track,i=l.pesData,x=c.pesData,b=a.pesData,m;i&&(m=s(i))?(this.parseAVCPES(m,!0),l.pesData=null):l.pesData=i,x&&(m=s(x))?(c.isAAC?this.parseAACPES(m):this.parseMPEGPES(m),c.pesData=null):(x!=null&&x.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),c.pesData=x),b&&(m=s(b))?(this.parseID3PES(m),a.pesData=null):a.pesData=b},f.demuxSampleAes=function(v,c,l){var a=this.demux(v,l,!0,!this.config.progressive),i=this.sampleAes=new B.default(this.observer,this.config,c);return this.decrypt(a,i)},f.decrypt=function(v,c){return new Promise(function(l){var a=v.audioTrack,i=v.avcTrack;a.samples&&a.isAAC?c.decryptAacSamples(a.samples,0,function(){i.samples?c.decryptAvcSamples(i.samples,0,0,function(){l(v)}):l(v)}):i.samples&&c.decryptAvcSamples(i.samples,0,0,function(){l(v)})})},f.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},f.parseAVCPES=function(v,c){var l=this,a=this._avcTrack,i=this.parseAVCNALu(v.data),x=!1,b=this.avcSample,m,L=!1;v.data=null,b&&i.length&&!a.audFound&&(u(b,a),b=this.avcSample=S(!1,v.pts,v.dts,"")),i.forEach(function(C){switch(C.type){case 1:{m=!0,b||(b=l.avcSample=S(!0,v.pts,v.dts,"")),x&&(b.debug+="NDR "),b.frame=!0;var H=C.data;if(L&&H.length>4){var J=new O.default(H).readSliceType();(J===2||J===4||J===7||J===9)&&(b.key=!0)}break}case 5:m=!0,b||(b=l.avcSample=S(!0,v.pts,v.dts,"")),x&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{m=!0,x&&b&&(b.debug+="SEI ");var W=new O.default(T(C.data));W.readUByte();for(var j=0,$=0,se=!1,me=0;!se&&W.bytesAvailable>1;){j=0;do me=W.readUByte(),j+=me;while(me===255);$=0;do me=W.readUByte(),$+=me;while(me===255);if(j===4&&W.bytesAvailable!==0){se=!0;var Ee=W.readUByte();if(Ee===181){var We=W.readUShort();if(We===49){var Be=W.readUInt();if(Be===1195456820){var Ne=W.readUByte();if(Ne===3){for(var Le=W.readUByte(),Ue=W.readUByte(),ye=31&Le,ce=[Le,Ue],ne=0;ne<ye;ne++)ce.push(W.readUByte()),ce.push(W.readUByte()),ce.push(W.readUByte());h(l._txtTrack.samples,{type:3,pts:v.pts,bytes:ce})}}}}}else if(j===5&&W.bytesAvailable!==0){if(se=!0,$>16){for(var ve=[],le=0;le<16;le++)ve.push(W.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&ve.push("-");for(var Re=$-16,Ie=new Uint8Array(Re),Ce=0;Ce<Re;Ce++)Ie[Ce]=W.readUByte();h(l._txtTrack.samples,{pts:v.pts,payloadType:j,uuid:ve.join(""),userData:Object(U.utf8ArrayToStr)(Ie),userDataBytes:Ie})}}else if($<W.bytesAvailable)for(var He=0;He<$;He++)W.readUByte()}break}case 7:if(m=!0,L=!0,x&&b&&(b.debug+="SPS "),!a.sps){var Ze=new O.default(C.data),ot=Ze.readSPS();a.width=ot.width,a.height=ot.height,a.pixelRatio=ot.pixelRatio,a.sps=[C.data],a.duration=l._duration;for(var et=C.data.subarray(1,4),Ke="avc1.",Ve=0;Ve<3;Ve++){var ht=et[Ve].toString(16);ht.length<2&&(ht="0"+ht),Ke+=ht}a.codec=Ke}break;case 8:m=!0,x&&b&&(b.debug+="PPS "),a.pps||(a.pps=[C.data]);break;case 9:m=!1,a.audFound=!0,b&&u(b,a),b=l.avcSample=S(!1,v.pts,v.dts,x?"AUD ":"");break;case 12:m=!1;break;default:m=!1,b&&(b.debug+="unknown NAL "+C.type+" ");break}if(b&&m){var mt=b.units;mt.push(C)}}),c&&b&&(u(b,a),this.avcSample=null)},f.getLastNalUnit=function(){var v,c=this.avcSample,l;if(!c||c.units.length===0){var a=this._avcTrack.samples;c=a[a.length-1]}if((v=c)!==null&&v!==void 0&&v.units){var i=c.units;l=i[i.length-1]}return l},f.parseAVCNALu=function(v){var c=v.byteLength,l=this._avcTrack,a=l.naluState||0,i=a,x=[],b=0,m,L,C,H=-1,J=0;for(a===-1&&(H=0,J=v[0]&31,a=0,b=1);b<c;){if(m=v[b++],!a){a=m?0:1;continue}if(a===1){a=m?0:2;continue}if(!m)a=3;else if(m===1){if(H>=0){var W={data:v.subarray(H,b-a-1),type:J};x.push(W)}else{var j=this.getLastNalUnit();if(j&&(i&&b<=4-i&&(j.state&&(j.data=j.data.subarray(0,j.data.byteLength-i))),L=b-a-1,L>0)){var $=new Uint8Array(j.data.byteLength+L);$.set(j.data,0),$.set(v.subarray(0,L),j.data.byteLength),j.data=$,j.state=0}}b<c?(C=v[b]&31,H=b,J=C,a=0):a=-1}else a=0}if(H>=0&&a>=0){var se={data:v.subarray(H,c),type:J,state:a};x.push(se)}if(x.length===0){var me=this.getLastNalUnit();if(me){var Ee=new Uint8Array(me.data.byteLength+v.byteLength);Ee.set(me.data,0),Ee.set(v,me.data.byteLength),me.data=Ee}}return l.naluState=a,x},f.parseAACPES=function(v){var c=0,l=this._audioTrack,a=this.aacOverFlow,i=v.data;if(a){this.aacOverFlow=null;var x=a.sample.unit.byteLength,b=Math.min(a.missing,x),m=x-b;a.sample.unit.set(i.subarray(0,b),m),l.samples.push(a.sample),c=a.missing}var L,C;for(L=c,C=i.length;L<C-1&&!Q.isHeader(i,L);L++);if(L!==c){var H,J;if(L<C-1?(H="AAC PES did not start with ADTS header,offset:"+L,J=!1):(H="no ADTS header found in AAC PES",J=!0),E.logger.warn("parsing error:"+H),this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.FRAG_PARSING_ERROR,fatal:J,reason:H}),J)return}Q.initTrackConfig(l,this.observer,i,L,this.audioCodec);var W;if(v.pts!==void 0)W=v.pts;else if(a){var j=Q.getFrameDuration(l.samplerate);W=a.sample.pts+j}else{E.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var $=0;L<C;)if(Q.isHeader(i,L)){if(L+5<C){var se=Q.appendFrame(l,i,L,W,$);if(se)if(se.missing)this.aacOverFlow=se;else{L+=se.length,$++;continue}}break}else L++},f.parseMPEGPES=function(v){var c=v.data,l=c.length,a=0,i=0,x=v.pts;if(x===void 0){E.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;i<l;)if(N.isHeader(c,i)){var b=N.appendFrame(this._audioTrack,c,i,x,a);if(b)i+=b.length,a++;else break}else i++},f.parseID3PES=function(v){if(v.pts===void 0){E.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},g}();_.minProbeByteLength=188;function S(g,f,w,v){return{key:g,frame:!1,pts:f,dts:w,units:[],debug:v,length:0}}function y(g,f){return(g[f+10]&31)<<8|g[f+11]}function d(g,f,w,v){var c={audio:-1,avc:-1,id3:-1,isAAC:!0},l=(g[f+1]&15)<<8|g[f+2],a=f+3+l-4,i=(g[f+10]&15)<<8|g[f+11];for(f+=12+i;f<a;){var x=(g[f+1]&31)<<8|g[f+2];switch(g[f]){case 207:if(!v){E.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:c.audio===-1&&(c.audio=x);break;case 21:c.id3===-1&&(c.id3=x);break;case 219:if(!v){E.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:c.avc===-1&&(c.avc=x);break;case 3:case 4:w?c.audio===-1&&(c.audio=x,c.isAAC=!1):E.logger.log("MPEG audio found, not supported in this browser");break;case 36:E.logger.warn("Unsupported HEVC stream type found");break;default:break}f+=((g[f+3]&15)<<8|g[f+4])+5}return c}function s(g){var f=0,w,v,c,l,a,i=g.data;if(!g||g.size===0)return null;for(;i[0].length<19&&i.length>1;){var x=new Uint8Array(i[0].length+i[1].length);x.set(i[0]),x.set(i[1],i[0].length),i[0]=x,i.splice(1,1)}w=i[0];var b=(w[0]<<16)+(w[1]<<8)+w[2];if(b===1){if(v=(w[4]<<8)+w[5],v&&v>g.size-6)return null;var m=w[7];m&192&&(l=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,m&64?(a=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,l-a>60*9e4&&(E.logger.warn(Math.round((l-a)/9e4)+"s delta between PTS and DTS, align them"),l=a)):a=l),c=w[8];var L=c+9;if(g.size<=L)return null;g.size-=L;for(var C=new Uint8Array(g.size),H=0,J=i.length;H<J;H++){w=i[H];var W=w.byteLength;if(L)if(L>W){L-=W;continue}else w=w.subarray(L),W-=L,L=0;C.set(w,f),f+=W}return v&&(v-=c+3),{data:C,pts:l,dts:a,len:v}}return null}function u(g,f){if(g.units.length&&g.frame){if(g.pts===void 0){var w=f.samples,v=w.length;if(v){var c=w[v-1];g.pts=c.pts,g.dts=c.dts}else{f.dropped++;return}}f.samples.push(g)}g.debug.length&&E.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function h(g,f){var w=g.length;if(w>0){if(f.pts>=g[w-1].pts)g.push(f);else for(var v=w-1;v>=0;v--)if(f.pts<g[v].pts){g.splice(v,0,f);break}}else g.push(f)}function T(g){for(var f=g.byteLength,w=[],v=1;v<f-2;)g[v]===0&&g[v+1]===0&&g[v+2]===3?(w.push(v+2),v+=2):v++;if(w.length===0)return g;var c=f-w.length,l=new Uint8Array(c),a=0;for(v=0;v<c;a++,v++)a===w[0]&&(a++,w.shift()),l[v]=g[a];return l}X.default=_},"./src/errors.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"ErrorTypes",function(){return Q}),k.d(X,"ErrorDetails",function(){return N});var Q;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(Q||(Q={}));var N;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"Events",function(){return Q});var Q;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Q||(Q={}))},"./src/hls.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return g});var Q=k("./node_modules/url-toolkit/src/url-toolkit.js"),N=k.n(Q),O=k("./src/loader/playlist-loader.ts"),U=k("./src/loader/key-loader.ts"),B=k("./src/controller/id3-track-controller.ts"),I=k("./src/controller/latency-controller.ts"),D=k("./src/controller/level-controller.ts"),E=k("./src/controller/fragment-tracker.ts"),R=k("./src/controller/stream-controller.ts"),P=k("./src/is-supported.ts"),_=k("./src/utils/logger.ts"),S=k("./src/config.ts"),y=k("./node_modules/eventemitter3/index.js"),d=k.n(y),s=k("./src/events.ts"),u=k("./src/errors.ts");function h(f,w){for(var v=0;v<w.length;v++){var c=w[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(f,c.key,c)}}function T(f,w,v){return w&&h(f.prototype,w),v&&h(f,v),f}var g=function(){f.isSupported=function(){return Object(P.isSupported)()};function f(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new y.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 c=this.config=Object(S.mergeConfig)(f.DefaultConfig,v);this.userConfig=v,Object(_.enableLogs)(c.debug),this._autoLevelCapping=-1,c.progressive&&Object(S.enableStreamingMode)(c);var l=c.abrController,a=c.bufferController,i=c.capLevelController,x=c.fpsController,b=this.abrController=new l(this),m=this.bufferController=new a(this),L=this.capLevelController=new i(this),C=new x(this),H=new O.default(this),J=new U.default(this),W=new B.default(this),j=this.levelController=new D.default(this),$=new E.FragmentTracker(this),se=this.streamController=new R.default(this,$);L.setStreamController(se),C.setStreamController(se);var me=[j,se];this.networkControllers=me;var Ee=[H,J,b,m,L,C,W,$];this.audioTrackController=this.createController(c.audioTrackController,null,me),this.createController(c.audioStreamController,$,me),this.subtitleTrackController=this.createController(c.subtitleTrackController,null,me),this.createController(c.subtitleStreamController,$,me),this.createController(c.timelineController,null,Ee),this.emeController=this.createController(c.emeController,null,Ee),this.cmcdController=this.createController(c.cmcdController,null,Ee),this.latencyController=this.createController(I.default,null,Ee),this.coreComponents=Ee}var w=f.prototype;return w.createController=function(c,l,a){if(c){var i=l?new c(this,l):new c(this);return a&&a.push(i),i}return null},w.on=function(c,l,a){a===void 0&&(a=this),this._emitter.on(c,l,a)},w.once=function(c,l,a){a===void 0&&(a=this),this._emitter.once(c,l,a)},w.removeAllListeners=function(c){this._emitter.removeAllListeners(c)},w.off=function(c,l,a,i){a===void 0&&(a=this),this._emitter.off(c,l,a,i)},w.listeners=function(c){return this._emitter.listeners(c)},w.emit=function(c,l,a){return this._emitter.emit(c,l,a)},w.trigger=function(c,l){if(this.config.debug)return this.emit(c,c,l);try{return this.emit(c,c,l)}catch(a){_.logger.error("An internal error happened while handling event "+c+'. Error message: "'+a.message+'". Here is a stacktrace:',a),this.trigger(s.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:c,error:a})}return!1},w.listenerCount=function(c){return this._emitter.listenerCount(c)},w.destroy=function(){_.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(c){return c.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(c){return c.destroy()}),this.coreComponents.length=0},w.attachMedia=function(c){_.logger.log("attachMedia"),this._media=c,this.trigger(s.Events.MEDIA_ATTACHING,{media:c})},w.detachMedia=function(){_.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(c){this.stopLoad();var l=this.media,a=this.url,i=this.url=Q.buildAbsoluteURL(self.location.href,c,{alwaysNormalize:!0});_.logger.log("loadSource:"+i),l&&a&&a!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(l)),this.trigger(s.Events.MANIFEST_LOADING,{url:c})},w.startLoad=function(c){c===void 0&&(c=-1),_.logger.log("startLoad("+c+")"),this.networkControllers.forEach(function(l){l.startLoad(c)})},w.stopLoad=function(){_.logger.log("stopLoad"),this.networkControllers.forEach(function(c){c.stopLoad()})},w.swapAudioCodec=function(){_.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){_.logger.log("recoverMediaError");var c=this._media;this.detachMedia(),c&&this.attachMedia(c)},w.removeLevel=function(c,l){l===void 0&&(l=0),this.levelController.removeLevel(c,l)},T(f,[{key:"levels",get:function(){var c=this.levelController.levels;return c||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(c){_.logger.log("set currentLevel:"+c),this.loadLevel=c,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(c){_.logger.log("set nextLevel:"+c),this.levelController.manualLevel=c,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(c){_.logger.log("set loadLevel:"+c),this.levelController.manualLevel=c}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(c){this.levelController.nextLoadLevel=c}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(c){_.logger.log("set firstLevel:"+c),this.levelController.firstLevel=c}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(c){_.logger.log("set startLevel:"+c),c!==-1&&(c=Math.max(c,this.minAutoLevel)),this.levelController.startLevel=c}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(c){var l=!!c;l!==this.config.capLevelToPlayerSize&&(l?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=l)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(c){this._autoLevelCapping!==c&&(_.logger.log("set autoLevelCapping:"+c),this._autoLevelCapping=c)}},{key:"bandwidthEstimate",get:function(){var c=this.abrController.bwEstimator;return c?c.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var c=this.levels,l=this.config.minAutoBitrate;if(!c)return 0;for(var a=c.length,i=0;i<a;i++)if(c[i].maxBitrate>l)return i;return 0}},{key:"maxAutoLevel",get:function(){var c=this.levels,l=this.autoLevelCapping,a;return l===-1&&c&&c.length?a=c.length-1:a=l,a}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(c){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,c)}},{key:"audioTracks",get:function(){var c=this.audioTrackController;return c?c.audioTracks:[]}},{key:"audioTrack",get:function(){var c=this.audioTrackController;return c?c.audioTrack:-1},set:function(c){var l=this.audioTrackController;l&&(l.audioTrack=c)}},{key:"subtitleTracks",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var c=this.subtitleTrackController;return c?c.subtitleTrack:-1},set:function(c){var l=this.subtitleTrackController;l&&(l.subtitleTrack=c)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var c=this.subtitleTrackController;return c?c.subtitleDisplay:!1},set:function(c){var l=this.subtitleTrackController;l&&(l.subtitleDisplay=c)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(c){this.config.lowLatencyMode=c}},{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 s.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return f.defaultConfig?f.defaultConfig:S.hlsDefaultConfig},set:function(c){f.defaultConfig=c}}]),f}();g.defaultConfig=void 0},"./src/is-supported.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"isSupported",function(){return O}),k.d(X,"changeTypeSupported",function(){return U});var Q=k("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var B=Object(Q.getMediaSource)();if(!B)return!1;var I=N(),D=B&&typeof B.isTypeSupported=="function"&&B.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!I||I.prototype&&typeof I.prototype.appendBuffer=="function"&&typeof I.prototype.remove=="function";return!!D&&!!E}function U(){var B,I=N();return typeof(I==null||((B=I.prototype)===null||B===void 0)?void 0:B.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return _}),k.d(X,"LoadError",function(){return y});var Q=k("./src/polyfills/number.ts"),N=k("./src/errors.ts");function O(d,s){d.prototype=Object.create(s.prototype),d.prototype.constructor=d,E(d,s)}function U(d){var s=typeof Map=="function"?new Map:void 0;return U=function(h){if(h===null||!D(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(h))return s.get(h);s.set(h,T)}function T(){return B(h,arguments,R(this).constructor)}return T.prototype=Object.create(h.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),E(T,h)},U(d)}function B(d,s,u){return I()?B=Reflect.construct:B=function(T,g,f){var w=[null];w.push.apply(w,g);var v=Function.bind.apply(T,w),c=new v;return f&&E(c,f.prototype),c},B.apply(null,arguments)}function I(){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(d){return!1}}function D(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function E(d,s){return E=Object.setPrototypeOf||function(h,T){return h.__proto__=T,h},E(d,s)}function R(d){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},R(d)}var P=Math.pow(2,17),_=function(){function d(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var s=d.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(h,T){var g=this,f=h.url;if(!f)return Promise.reject(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(f?"part list":"url")));this.abort();var w=this.config,v=w.fLoader,c=w.loader;return new Promise(function(l,a){g.loader&&g.loader.destroy();var i=g.loader=h.loader=v?new v(w):new c(w),x=S(h),b={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:P};h.stats=i.stats,i.load(x,b,{onSuccess:function(L,C,H,J){g.resetLoader(h,i),l({frag:h,part:null,payload:L.data,networkDetails:J})},onError:function(L,C,H){g.resetLoader(h,i),a(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:L,networkDetails:H}))},onAbort:function(L,C,H){g.resetLoader(h,i),a(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:H}))},onTimeout:function(L,C,H){g.resetLoader(h,i),a(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:H}))},onProgress:function(L,C,H,J){T&&T({frag:h,part:null,payload:H,networkDetails:J})}})})},s.loadPart=function(h,T,g){var f=this;this.abort();var w=this.config,v=w.fLoader,c=w.loader;return new Promise(function(l,a){f.loader&&f.loader.destroy();var i=f.loader=h.loader=v?new v(w):new c(w),x=S(h,T),b={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:P};T.stats=i.stats,i.load(x,b,{onSuccess:function(L,C,H,J){f.resetLoader(h,i),f.updateStatsFromPart(h,T);var W={frag:h,part:T,payload:L.data,networkDetails:J};g(W),l(W)},onError:function(L,C,H){f.resetLoader(h,i),a(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:T,response:L,networkDetails:H}))},onAbort:function(L,C,H){h.stats.aborted=T.stats.aborted,f.resetLoader(h,i),a(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:T,networkDetails:H}))},onTimeout:function(L,C,H){f.resetLoader(h,i),a(new y({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:T,networkDetails:H}))}})})},s.updateStatsFromPart=function(h,T){var g=h.stats,f=T.stats,w=f.total;if(g.loaded+=f.loaded,w){var v=Math.round(h.duration/T.duration),c=Math.min(Math.round(g.loaded/w),v),l=v-c,a=l*Math.round(g.loaded/c);g.total=g.loaded+a}else g.total=Math.max(g.loaded,g.total);var i=g.loading,x=f.loading;i.start?i.first+=x.first-x.start:(i.start=x.start,i.first=x.first),i.end=x.end},s.resetLoader=function(h,T){h.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},d}();function S(d,s){s===void 0&&(s=null);var u=s||d,h={frag:d,part:s,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},T=u.byteRangeStartOffset,g=u.byteRangeEndOffset;return Object(Q.isFiniteNumber)(T)&&Object(Q.isFiniteNumber)(g)&&(h.rangeStart=T,h.rangeEnd=g),h}var y=function(d){O(s,d);function s(u){for(var h,T=arguments.length,g=new Array(T>1?T-1:0),f=1;f<T;f++)g[f-1]=arguments[f];return h=d.call.apply(d,[this].concat(g))||this,h.data=void 0,h.data=u,h}return s}(U(Error))},"./src/loader/fragment.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"ElementaryStreamTypes",function(){return _}),k.d(X,"BaseSegment",function(){return S}),k.d(X,"Fragment",function(){return y}),k.d(X,"Part",function(){return d});var Q=k("./src/polyfills/number.ts"),N=k("./node_modules/url-toolkit/src/url-toolkit.js"),O=k.n(N),U=k("./src/utils/logger.ts"),B=k("./src/loader/level-key.ts"),I=k("./src/loader/load-stats.ts");function D(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,E(s,u)}function E(s,u){return E=Object.setPrototypeOf||function(T,g){return T.__proto__=g,T},E(s,u)}function R(s,u){for(var h=0;h<u.length;h++){var T=u[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function P(s,u,h){return u&&R(s.prototype,u),h&&R(s,h),s}var _;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(_||(_={}));var S=function(){function s(h){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[_.AUDIO]=null,T[_.VIDEO]=null,T[_.AUDIOVIDEO]=null,T),this.baseurl=h}var u=s.prototype;return u.setByteRange=function(T,g){var f=T.split("@",2),w=[];f.length===1?w[0]=g?g.byteRangeEndOffset:0:w[0]=parseInt(f[1]),w[1]=parseInt(f[0])+w[0],this._byteRange=w},P(s,[{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(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),s}(),y=function(s){D(u,s);function u(T,g){var f;return f=s.call(this,g)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkey=void 0,f.type=void 0,f.loader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new I.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.type=T,f}var h=u.prototype;return h.createInitializationVector=function(g){for(var f=new Uint8Array(16),w=12;w<16;w++)f[w]=g>>8*(15-w)&255;return f},h.setDecryptDataFromLevelKey=function(g,f){var w=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(w=B.LevelKey.fromURI(g.uri),w.method=g.method,w.iv=this.createInitializationVector(f),w.keyFormat="identity"),w},h.setElementaryStreamInfo=function(g,f,w,v,c,l){l===void 0&&(l=!1);var a=this.elementaryStreams,i=a[g];if(!i){a[g]={startPTS:f,endPTS:w,startDTS:v,endDTS:c,partial:l};return}i.startPTS=Math.min(i.startPTS,f),i.endPTS=Math.max(i.endPTS,w),i.startDTS=Math.min(i.startDTS,v),i.endDTS=Math.max(i.endDTS,c)},h.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[_.AUDIO]=null,g[_.VIDEO]=null,g[_.AUDIOVIDEO]=null},P(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&U.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Q.isFiniteNumber)(this.programDateTime))return null;var g=Object(Q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),u}(S),d=function(s){D(u,s);function u(h,T,g,f,w){var v;v=s.call(this,g)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new I.LoadStats,v.duration=h.decimalFloatingPoint("DURATION"),v.gap=h.bool("GAP"),v.independent=h.bool("INDEPENDENT"),v.relurl=h.enumeratedString("URI"),v.fragment=T,v.index=f;var c=h.enumeratedString("BYTERANGE");return c&&v.setByteRange(c,w),w&&(v.fragOffset=w.fragOffset+w.duration),v}return P(u,[{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)}}]),u}(S)},"./src/loader/key-loader.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return U});var Q=k("./src/events.ts"),N=k("./src/errors.ts"),O=k("./src/utils/logger.ts"),U=function(){function B(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var I=B.prototype;return I._registerListeners=function(){this.hls.on(Q.Events.KEY_LOADING,this.onKeyLoading,this)},I._unregisterListeners=function(){this.hls.off(Q.Events.KEY_LOADING,this.onKeyLoading)},I.destroy=function(){this._unregisterListeners();for(var E in this.loaders){var R=this.loaders[E];R&&R.destroy()}this.loaders={}},I.onKeyLoading=function(E,R){var P=R.frag,_=P.type,S=this.loaders[_];if(!P.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var y=P.decryptdata.uri;if(y!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(S&&(O.logger.warn("abort previous key loader for type:"+_),S.abort()),!y){O.logger.warn("key uri is falsy");return}var s=d.loader,u=P.loader=this.loaders[_]=new s(d);this.decrypturl=y,this.decryptkey=null;var h={url:y,frag:P,responseType:"arraybuffer"},T={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(h,T,g)}else this.decryptkey&&(P.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:P}))},I.loadsuccess=function(E,R,P){var _=P.frag;if(!_.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(E.data),_.loader=null,delete this.loaders[_.type],this.hls.trigger(Q.Events.KEY_LOADED,{frag:_})},I.loaderror=function(E,R){var P=R.frag,_=P.loader;_&&_.abort(),delete this.loaders[P.type],this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:P,response:E})},I.loadtimeout=function(E,R){var P=R.frag,_=P.loader;_&&_.abort(),delete this.loaders[P.type],this.hls.trigger(Q.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:P})},B}()},"./src/loader/level-details.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"LevelDetails",function(){return B});var Q=k("./src/polyfills/number.ts");function N(I,D){for(var E=0;E<D.length;E++){var R=D[E];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,R.key,R)}}function O(I,D,E){return D&&N(I.prototype,D),E&&N(I,E),I}var U=10,B=function(){function I(E){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=E}var D=I.prototype;return D.reloaded=function(R){if(!R){this.advanced=!0,this.updated=!0;return}var P=this.lastPartSn-R.lastPartSn,_=this.lastPartIndex-R.lastPartIndex;this.updated=this.endSN!==R.endSN||!!_||!!P,this.advanced=this.endSN>R.endSN||P>0||P===0&&_>0,this.updated||this.advanced?this.misses=Math.floor(R.misses*.6):this.misses=R.misses+1,this.availabilityDelay=R.availabilityDelay},O(I,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||U}},{key:"drift",get:function(){var R=this.driftEndTime-this.driftStartTime;if(R>0){var P=this.driftEnd-this.driftStart;return P*1e3/R}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var R;return(R=this.partList)!==null&&R!==void 0&&R.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var R;return(R=this.fragments)!==null&&R!==void 0&&R.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 R;return(R=this.partList)!==null&&R!==void 0&&R.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var R;return(R=this.partList)!==null&&R!==void 0&&R.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),I}()},"./src/loader/level-key.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"LevelKey",function(){return B});var Q=k("./node_modules/url-toolkit/src/url-toolkit.js"),N=k.n(Q);function O(I,D){for(var E=0;E<D.length;E++){var R=D[E];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,R.key,R)}}function U(I,D,E){return D&&O(I.prototype,D),E&&O(I,E),I}var B=function(){I.fromURL=function(E,R){return new I(E,R)},I.fromURI=function(E){return new I(E)};function I(D,E){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,E?this._uri=Object(Q.buildAbsoluteURL)(D,E,{alwaysNormalize:!0}):this._uri=D}return U(I,[{key:"uri",get:function(){return this._uri}}]),I}()},"./src/loader/load-stats.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"LoadStats",function(){return Q});var Q=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(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return u});var Q=k("./src/polyfills/number.ts"),N=k("./node_modules/url-toolkit/src/url-toolkit.js"),O=k.n(N),U=k("./src/loader/fragment.ts"),B=k("./src/loader/level-details.ts"),I=k("./src/loader/level-key.ts"),D=k("./src/utils/attr-list.ts"),E=k("./src/utils/logger.ts"),R=k("./src/utils/codecs.ts"),P=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,_=/#EXT-X-MEDIA:(.*)/g,S=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),y=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("|")),d=/\.(mp4|m4s|m4v|m4a)$/i;function s(w){var v,c;return d.test((v=(c=N.parseURL(w))===null||c===void 0?void 0:c.path)!=null?v:"")}var u=function(){function w(){}return w.findGroup=function(c,l){for(var a=0;a<c.length;a++){var i=c[a];if(i.id===l)return i}},w.convertAVC1ToAVCOTI=function(c){var l=c.split(".");if(l.length>2){var a=l.shift()+".";return a+=parseInt(l.shift()).toString(16),a+=("000"+parseInt(l.shift()).toString(16)).substr(-4),a}return c},w.resolve=function(c,l){return N.buildAbsoluteURL(l,c,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(c,l){var a=[],i={},x=!1;P.lastIndex=0;for(var b;(b=P.exec(c))!=null;)if(b[1]){var m=new D.AttrList(b[1]),L={attrs:m,bitrate:m.decimalInteger("AVERAGE-BANDWIDTH")||m.decimalInteger("BANDWIDTH"),name:m.NAME,url:w.resolve(b[2],l)},C=m.decimalResolution("RESOLUTION");C&&(L.width=C.width,L.height=C.height),h((m.CODECS||"").split(/[ ,]+/).filter(function(J){return J}),L),L.videoCodec&&L.videoCodec.indexOf("avc1")!==-1&&(L.videoCodec=w.convertAVC1ToAVCOTI(L.videoCodec)),a.push(L)}else if(b[3]){var H=new D.AttrList(b[3]);H["DATA-ID"]&&(x=!0,i[H["DATA-ID"]]=H)}return{levels:a,sessionData:x?i:null}},w.parseMasterPlaylistMedia=function(c,l,a,i){i===void 0&&(i=[]);var x,b=[],m=0;for(_.lastIndex=0;(x=_.exec(c))!==null;){var L=new D.AttrList(x[1]);if(L.TYPE===a){var C={attrs:L,bitrate:0,id:m++,groupId:L["GROUP-ID"],instreamId:L["INSTREAM-ID"],name:L.NAME||L.LANGUAGE||"",type:a,default:L.bool("DEFAULT"),autoselect:L.bool("AUTOSELECT"),forced:L.bool("FORCED"),lang:L.LANGUAGE,url:L.URI?w.resolve(L.URI,l):""};if(i.length){var H=w.findGroup(i,C.groupId)||i[0];T(C,H,"audioCodec"),T(C,H,"textCodec")}b.push(C)}}return b},w.parseLevelPlaylist=function(c,l,a,i,x){var b=new B.LevelDetails(l),m=b.fragments,L=null,C=0,H=0,J=0,W=0,j=null,$=new U.Fragment(i,l),se,me,Ee,We=-1,Be=!1;for(S.lastIndex=0,b.m3u8=c;(se=S.exec(c))!==null;){Be&&(Be=!1,$=new U.Fragment(i,l),$.start=J,$.sn=C,$.cc=W,$.level=a,L&&($.initSegment=L,$.rawProgramDateTime=L.rawProgramDateTime));var Ne=se[1];if(Ne){$.duration=parseFloat(Ne);var Le=(" "+se[2]).slice(1);$.title=Le||null,$.tagList.push(Le?["INF",Ne,Le]:["INF",Ne])}else if(se[3])Object(Q.isFiniteNumber)($.duration)&&($.start=J,Ee&&($.levelkey=Ee),$.sn=C,$.level=a,$.cc=W,$.urlId=x,m.push($),$.relurl=(" "+se[3]).slice(1),f($,j),j=$,J+=$.duration,C++,H=0,Be=!0);else if(se[4]){var Ue=(" "+se[4]).slice(1);j?$.setByteRange(Ue,j):$.setByteRange(Ue)}else if(se[5])$.rawProgramDateTime=(" "+se[5]).slice(1),$.tagList.push(["PROGRAM-DATE-TIME",$.rawProgramDateTime]),We===-1&&(We=m.length);else{if(se=se[0].match(y),!se){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(me=1;me<se.length&&!(typeof se[me]!="undefined");me++);var ye=(" "+se[me]).slice(1),ce=(" "+se[me+1]).slice(1),ne=se[me+2]?(" "+se[me+2]).slice(1):"";switch(ye){case"PLAYLIST-TYPE":b.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":C=b.startSN=parseInt(ce);break;case"SKIP":{var ve=new D.AttrList(ce),le=ve.decimalInteger("SKIPPED-SEGMENTS");if(Object(Q.isFiniteNumber)(le)){b.skippedSegments=le;for(var Re=le;Re--;)m.unshift(null);C+=le}var Ie=ve.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ie&&(b.recentlyRemovedDateranges=Ie.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(ce);break;case"VERSION":b.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(ce||ne)&&$.tagList.push(ne?[ce,ne]:[ce]);break;case"DIS":W++;case"GAP":$.tagList.push([ye]);break;case"BITRATE":$.tagList.push([ye,ce]);break;case"DISCONTINUITY-SEQ":W=parseInt(ce);break;case"KEY":{var Ce,He=new D.AttrList(ce),Ze=He.enumeratedString("METHOD"),ot=He.URI,et=He.hexadecimalInteger("IV"),Ke=He.enumeratedString("KEYFORMATVERSIONS"),Ve=He.enumeratedString("KEYID"),ht=(Ce=He.enumeratedString("KEYFORMAT"))!=null?Ce:"identity",mt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(mt.indexOf(ht)>-1){E.logger.warn("Keyformat "+ht+" is not supported from the manifest");continue}else if(ht!=="identity")continue;Ze&&(Ee=I.LevelKey.fromURL(l,ot),ot&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ze)>=0&&(Ee.method=Ze,Ee.keyFormat=ht,Ve&&(Ee.keyID=Ve),Ke&&(Ee.keyFormatVersions=Ke),Ee.iv=et));break}case"START":{var gt=new D.AttrList(ce),Et=gt.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(Et)&&(b.startTimeOffset=Et);break}case"MAP":{var ft=new D.AttrList(ce);$.relurl=ft.URI,ft.BYTERANGE&&$.setByteRange(ft.BYTERANGE),$.level=a,$.sn="initSegment",Ee&&($.levelkey=Ee),$.initSegment=null,L=$,Be=!0;break}case"SERVER-CONTROL":{var Ct=new D.AttrList(ce);b.canBlockReload=Ct.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=Ct.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&Ct.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=Ct.optionalFloat("PART-HOLD-BACK",0),b.holdBack=Ct.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var _e=new D.AttrList(ce);b.partTarget=_e.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Se=b.partList;Se||(Se=b.partList=[]);var Je=H>0?Se[Se.length-1]:void 0,nt=H++,Fe=new U.Part(new D.AttrList(ce),$,l,nt,Je);Se.push(Fe),$.duration+=Fe.duration;break}case"PRELOAD-HINT":{var qe=new D.AttrList(ce);b.preloadHint=qe;break}case"RENDITION-REPORT":{var xe=new D.AttrList(ce);b.renditionReports=b.renditionReports||[],b.renditionReports.push(xe);break}default:E.logger.warn("line parsed but not handled: "+se);break}}}j&&!j.relurl?(m.pop(),J-=j.duration,b.partList&&(b.fragmentHint=j)):b.partList&&(f($,j),$.cc=W,b.fragmentHint=$);var he=m.length,ge=m[0],re=m[he-1];if(J+=b.skippedSegments*b.targetduration,J>0&&he&&re){b.averagetargetduration=J/he;var ie=re.sn;b.endSN=ie!=="initSegment"?ie:0,ge&&(b.startCC=ge.cc,ge.initSegment||b.fragments.every(function(oe){return oe.relurl&&s(oe.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),$=new U.Fragment(i,l),$.relurl=re.relurl,$.level=a,$.sn="initSegment",ge.initSegment=$,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(J+=b.fragmentHint.duration),b.totalduration=J,b.endCC=W,We>0&&g(m,We),b},w}();function h(w,v){["video","audio","text"].forEach(function(c){var l=w.filter(function(i){return Object(R.isCodecType)(i,c)});if(l.length){var a=l.filter(function(i){return i.lastIndexOf("avc1",0)===0||i.lastIndexOf("mp4a",0)===0});v[c+"Codec"]=a.length>0?a[0]:l[0],w=w.filter(function(i){return l.indexOf(i)===-1})}}),v.unknownCodecs=w}function T(w,v,c){var l=v[c];l&&(w[c]=l)}function g(w,v){for(var c=w[v],l=v;l--;){var a=w[l];if(!a)return;a.programDateTime=c.programDateTime-a.duration*1e3,c=a}}function f(w,v){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):v!=null&&v.programDateTime&&(w.programDateTime=v.endProgramDateTime),Object(Q.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/polyfills/number.ts"),N=k("./src/events.ts"),O=k("./src/errors.ts"),U=k("./src/utils/logger.ts"),B=k("./src/utils/mp4-tools.ts"),I=k("./src/loader/m3u8-parser.ts"),D=k("./src/types/loader.ts"),E=k("./src/utils/attr-list.ts");function R(S){var y=S.type;switch(y){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function P(S,y){var d=S.url;return(d===void 0||d.indexOf("data:")===0)&&(d=y.url),d}var _=function(){function S(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var y=S.prototype;return y.registerListeners=function(){var s=this.hls;s.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.unregisterListeners=function(){var s=this.hls;s.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},y.createInternalLoader=function(s){var u=this.hls.config,h=u.pLoader,T=u.loader,g=h||T,f=new g(u);return s.loader=f,this.loaders[s.type]=f,f},y.getInternalLoader=function(s){return this.loaders[s.type]},y.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},y.destroyInternalLoaders=function(){for(var s in this.loaders){var u=this.loaders[s];u&&u.destroy(),this.resetInternalLoader(s)}},y.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},y.onManifestLoading=function(s,u){var h=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},y.onLevelLoading=function(s,u){var h=u.id,T=u.level,g=u.url,f=u.deliveryDirectives;this.load({id:h,groupId:null,level:T,responseType:"text",type:D.PlaylistContextType.LEVEL,url:g,deliveryDirectives:f})},y.onAudioTrackLoading=function(s,u){var h=u.id,T=u.groupId,g=u.url,f=u.deliveryDirectives;this.load({id:h,groupId:T,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:f})},y.onSubtitleTrackLoading=function(s,u){var h=u.id,T=u.groupId,g=u.url,f=u.deliveryDirectives;this.load({id:h,groupId:T,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:f})},y.load=function(s){var u,h=this.hls.config,T=this.getInternalLoader(s);if(T){var g=T.context;if(g&&g.url===s.url){U.logger.trace("[playlist-loader]: playlist request ongoing");return}U.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),T.abort()}var f,w,v,c;switch(s.type){case D.PlaylistContextType.MANIFEST:f=h.manifestLoadingMaxRetry,w=h.manifestLoadingTimeOut,v=h.manifestLoadingRetryDelay,c=h.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:f=0,w=h.levelLoadingTimeOut;break;default:f=h.levelLoadingMaxRetry,w=h.levelLoadingTimeOut,v=h.levelLoadingRetryDelay,c=h.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(s),(u=s.deliveryDirectives)!==null&&u!==void 0&&u.part){var l;if(s.type===D.PlaylistContextType.LEVEL&&s.level!==null?l=this.hls.levels[s.level].details:s.type===D.PlaylistContextType.AUDIO_TRACK&&s.id!==null?l=this.hls.audioTracks[s.id].details:s.type===D.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(l=this.hls.subtitleTracks[s.id].details),l){var a=l.partTarget,i=l.targetduration;a&&i&&(w=Math.min(Math.max(a*3,i*.8)*1e3,w))}}var x={timeout:w,maxRetry:f,retryDelay:v,maxRetryDelay:c,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(s,x,b)},y.loadsuccess=function(s,u,h,T){if(T===void 0&&(T=null),h.isSidxRequest){this.handleSidxRequest(s,h),this.handlePlaylistLoaded(s,u,h,T);return}this.resetInternalLoader(h.type);var g=s.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,h,"no EXTM3U delimiter",T);return}u.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,u,h,T):this.handleMasterPlaylist(s,u,h,T)},y.loaderror=function(s,u,h){h===void 0&&(h=null),this.handleNetworkError(u,h,!1,s)},y.loadtimeout=function(s,u,h){h===void 0&&(h=null),this.handleNetworkError(u,h,!0)},y.handleMasterPlaylist=function(s,u,h,T){var g=this.hls,f=s.data,w=P(s,h),v=I.default.parseMasterPlaylist(f,w),c=v.levels,l=v.sessionData;if(!c.length){this.handleManifestParsingError(s,h,"no level found in manifest",T);return}var a=c.map(function(C){return{id:C.attrs.AUDIO,audioCodec:C.audioCodec}}),i=c.map(function(C){return{id:C.attrs.SUBTITLES,textCodec:C.textCodec}}),x=I.default.parseMasterPlaylistMedia(f,w,"AUDIO",a),b=I.default.parseMasterPlaylistMedia(f,w,"SUBTITLES",i),m=I.default.parseMasterPlaylistMedia(f,w,"CLOSED-CAPTIONS");if(x.length){var L=x.some(function(C){return!C.url});!L&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(U.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),x.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new E.AttrList({}),bitrate:0,url:""}))}g.trigger(N.Events.MANIFEST_LOADED,{levels:c,audioTracks:x,subtitles:b,captions:m,url:w,stats:u,networkDetails:T,sessionData:l})},y.handleTrackOrLevelPlaylist=function(s,u,h,T){var g=this.hls,f=h.id,w=h.level,v=h.type,c=P(s,h),l=Object(Q.isFiniteNumber)(f)?f:0,a=Object(Q.isFiniteNumber)(w)?w:l,i=R(h),x=I.default.parseLevelPlaylist(s.data,c,a,i,l);if(!x.fragments.length){g.trigger(N.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:c,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(v===D.PlaylistContextType.MANIFEST){var b={attrs:new E.AttrList({}),bitrate:0,details:x,name:"",url:c};g.trigger(N.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:c,stats:u,networkDetails:T,sessionData:null})}if(u.parsing.end=performance.now(),x.needSidxRanges){var m,L=(m=x.fragments[0].initSegment)===null||m===void 0?void 0:m.url;this.load({url:L,isSidxRequest:!0,type:v,level:w,levelDetails:x,id:f,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=x,this.handlePlaylistLoaded(s,u,h,T)},y.handleSidxRequest=function(s,u){var h=Object(B.parseSegmentIndex)(new Uint8Array(s.data));if(!h)return;var T=h.references,g=u.levelDetails;T.forEach(function(f,w){var v=f.info,c=g.fragments[w];c.byteRange.length===0&&c.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),c.initSegment&&c.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},y.handleManifestParsingError=function(s,u,h,T){this.hls.trigger(N.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===D.PlaylistContextType.MANIFEST,url:s.url,reason:h,response:s,context:u,networkDetails:T})},y.handleNetworkError=function(s,u,h,T){h===void 0&&(h=!1),U.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var g=O.ErrorDetails.UNKNOWN,f=!1,w=this.getInternalLoader(s);switch(s.type){case D.PlaylistContextType.MANIFEST:g=h?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case D.PlaylistContextType.LEVEL:g=h?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case D.PlaylistContextType.AUDIO_TRACK:g=h?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:g=h?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}w&&this.resetInternalLoader(s.type);var v={type:O.ErrorTypes.NETWORK_ERROR,details:g,fatal:f,url:s.url,loader:w,context:s,networkDetails:u};T&&(v.response=T),this.hls.trigger(N.Events.ERROR,v)},y.handlePlaylistLoaded=function(s,u,h,T){var g=h.type,f=h.level,w=h.id,v=h.groupId,c=h.loader,l=h.levelDetails,a=h.deliveryDirectives;if(!(l!=null&&l.targetduration)){this.handleManifestParsingError(s,h,"invalid target duration",T);return}if(!c)return;l.live&&(c.getCacheAge&&(l.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(l.ageHeader))&&(l.ageHeader=0));switch(g){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:l,level:f||0,id:w||0,stats:u,networkDetails:T,deliveryDirectives:a});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:l,id:w||0,groupId:v||"",stats:u,networkDetails:T,deliveryDirectives:a});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:l,id:w||0,groupId:v||"",stats:u,networkDetails:T,deliveryDirectives:a});break}},S}();X.default=_},"./src/polyfills/number.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"isFiniteNumber",function(){return Q}),k.d(X,"MAX_SAFE_INTEGER",function(){return N});var Q=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,X,k){"use strict";k.r(X);var Q=function(){function N(){}return N.getSilentFrame=function(U,B){switch(U){case"mp4a.40.2":if(B===1)return new Uint8Array([0,200,0,128,35,128]);if(B===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(B===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(B===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(B===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(B===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(B===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(B===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(B===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},N}();X.default=Q},"./src/remux/mp4-generator.ts":function(ee,X,k){"use strict";k.r(X);var Q=Math.pow(2,32)-1,N=function(){function O(){}return O.init=function(){O.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 B;for(B in O.types)O.types.hasOwnProperty(B)&&(O.types[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.charCodeAt(3)]);var I=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]),D=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]);O.HDLR_TYPES={video:I,audio:D};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),R=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=R,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var P=new Uint8Array([105,115,111,109]),_=new Uint8Array([97,118,99,49]),S=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,P,S,P,_),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,E))},O.box=function(B){for(var I=8,D=arguments.length,E=new Array(D>1?D-1:0),R=1;R<D;R++)E[R-1]=arguments[R];for(var P=E.length,_=P;P--;)I+=E[P].byteLength;var S=new Uint8Array(I);for(S[0]=I>>24&255,S[1]=I>>16&255,S[2]=I>>8&255,S[3]=I&255,S.set(B,4),P=0,I=8;P<_;P++)S.set(E[P],I),I+=E[P].byteLength;return S},O.hdlr=function(B){return O.box(O.types.hdlr,O.HDLR_TYPES[B])},O.mdat=function(B){return O.box(O.types.mdat,B)},O.mdhd=function(B,I){I*=B;var D=Math.floor(I/(Q+1)),E=Math.floor(I%(Q+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,D>>24,D>>16&255,D>>8&255,D&255,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},O.mdia=function(B){return O.box(O.types.mdia,O.mdhd(B.timescale,B.duration),O.hdlr(B.type),O.minf(B))},O.mfhd=function(B){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,B>>24,B>>16&255,B>>8&255,B&255]))},O.minf=function(B){return B.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(B)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(B))},O.moof=function(B,I,D){return O.box(O.types.moof,O.mfhd(B),O.traf(D,I))},O.moov=function(B){for(var I=B.length,D=[];I--;)D[I]=O.trak(B[I]);return O.box.apply(null,[O.types.moov,O.mvhd(B[0].timescale,B[0].duration)].concat(D).concat(O.mvex(B)))},O.mvex=function(B){for(var I=B.length,D=[];I--;)D[I]=O.trex(B[I]);return O.box.apply(null,[O.types.mvex].concat(D))},O.mvhd=function(B,I){I*=B;var D=Math.floor(I/(Q+1)),E=Math.floor(I%(Q+1)),R=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,B>>24&255,B>>16&255,B>>8&255,B&255,D>>24,D>>16&255,D>>8&255,D&255,E>>24,E>>16&255,E>>8&255,E&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 O.box(O.types.mvhd,R)},O.sdtp=function(B){var I=B.samples||[],D=new Uint8Array(4+I.length),E,R;for(E=0;E<I.length;E++)R=I[E].flags,D[E+4]=R.dependsOn<<4|R.isDependedOn<<2|R.hasRedundancy;return O.box(O.types.sdtp,D)},O.stbl=function(B){return O.box(O.types.stbl,O.stsd(B),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(B){var I=[],D=[],E,R,P;for(E=0;E<B.sps.length;E++)R=B.sps[E],P=R.byteLength,I.push(P>>>8&255),I.push(P&255),I=I.concat(Array.prototype.slice.call(R));for(E=0;E<B.pps.length;E++)R=B.pps[E],P=R.byteLength,D.push(P>>>8&255),D.push(P&255),D=D.concat(Array.prototype.slice.call(R));var _=O.box(O.types.avcC,new Uint8Array([1,I[3],I[4],I[5],252|3,224|B.sps.length].concat(I).concat([B.pps.length]).concat(D))),S=B.width,y=B.height,d=B.pixelRatio[0],s=B.pixelRatio[1];return O.box(O.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,S>>8&255,S&255,y>>8&255,y&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]),_,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,s>>24,s>>16&255,s>>8&255,s&255])))},O.esds=function(B){var I=B.config.length;return new Uint8Array([0,0,0,0,3,23+I,0,1,0,4,15+I,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([I]).concat(B.config).concat([6,1,2]))},O.mp4a=function(B){var I=B.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]),O.box(O.types.esds,O.esds(B)))},O.mp3=function(B){var I=B.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,B.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]))},O.stsd=function(B){return B.type==="audio"?!B.isAAC&&B.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(B)):O.box(O.types.stsd,O.STSD,O.mp4a(B)):O.box(O.types.stsd,O.STSD,O.avc1(B))},O.tkhd=function(B){var I=B.id,D=B.duration*B.timescale,E=B.width,R=B.height,P=Math.floor(D/(Q+1)),_=Math.floor(D%(Q+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,_>>24,_>>16&255,_>>8&255,_&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,E>>8&255,E&255,0,0,R>>8&255,R&255,0,0]))},O.traf=function(B,I){var D=O.sdtp(B),E=B.id,R=Math.floor(I/(Q+1)),P=Math.floor(I%(Q+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,R>>24,R>>16&255,R>>8&255,R&255,P>>24,P>>16&255,P>>8&255,P&255])),O.trun(B,D.length+16+20+8+16+8+8),D)},O.trak=function(B){return B.duration=B.duration||4294967295,O.box(O.types.trak,O.tkhd(B),O.mdia(B))},O.trex=function(B){var I=B.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(B,I){var D=B.samples||[],E=D.length,R=12+16*E,P=new Uint8Array(R),_,S,y,d,s,u;for(I+=8+R,P.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255],0),_=0;_<E;_++)S=D[_],y=S.duration,d=S.size,s=S.flags,u=S.cts,P.set([y>>>24&255,y>>>16&255,y>>>8&255,y&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*_);return O.box(O.types.trun,P)},O.initSegment=function(B){O.types||O.init();var I=O.moov(B),D=new Uint8Array(O.FTYP.byteLength+I.byteLength);return D.set(O.FTYP),D.set(I,O.FTYP.byteLength),D},O}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,X.default=N},"./src/remux/mp4-remuxer.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return u}),k.d(X,"normalizePts",function(){return h});var Q=k("./src/polyfills/number.ts"),N=k("./src/remux/aac-helper.ts"),O=k("./src/remux/mp4-generator.ts"),U=k("./src/events.ts"),B=k("./src/errors.ts"),I=k("./src/utils/logger.ts"),D=k("./src/types/loader.ts"),E=k("./src/utils/timescale-conversion.ts");function R(){return R=Object.assign||function(w){for(var v=1;v<arguments.length;v++){var c=arguments[v];for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(w[l]=c[l])}return w},R.apply(this,arguments)}var P=10*1e3,_=1024,S=1152,y=null,d=null,s=!1,u=function(){function w(c,l,a,i){if(i===void 0&&(i=""),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=c,this.config=l,this.typeSupported=a,this.ISGenerated=!1,y===null){var x=navigator.userAgent||"",b=x.match(/Chrome\/(\d+)/i);y=b?parseInt(b[1]):0}if(d===null){var m=navigator.userAgent.match(/Safari\/(\d+)/i);d=m?parseInt(m[1]):0}s=!!y&&y<75||!!d&&d<600}var v=w.prototype;return v.destroy=function(){},v.resetTimeStamp=function(l){I.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=l},v.resetNextTimestamp=function(){I.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){I.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(l){var a=!1,i=l.reduce(function(x,b){var m=b.pts-x;return m<-4294967296?(a=!0,h(x,b.pts)):m>0?x:b.pts},l[0].pts);return a&&I.logger.debug("PTS rollover detected"),i},v.remux=function(l,a,i,x,b,m,L,C){var H,J,W,j,$,se,me=b,Ee=b,We=l.pid>-1,Be=a.pid>-1,Ne=a.samples.length,Le=l.samples.length>0,Ue=Ne>1,ye=(!We||Le)&&(!Be||Ue)||this.ISGenerated||L;if(ye){this.ISGenerated||(W=this.generateIS(l,a,b));var ce=this.isVideoContiguous,ne=-1;if(Ue&&(ne=T(a.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if(se=!0,ne>0){I.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Ne+" video samples due to a missing keyframe");var ve=this.getVideoStartPts(a.samples);a.samples=a.samples.slice(ne),a.dropped+=ne,Ee+=(a.samples[0].pts-ve)/(a.timescale||9e4)}else ne===-1&&(I.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ne+" video samples"),se=!1);if(this.ISGenerated){if(Le&&Ue){var le=this.getVideoStartPts(a.samples),Re=h(l.samples[0].pts,le)-le,Ie=Re/a.inputTimeScale;me+=Math.max(0,Ie),Ee+=Math.max(0,-Ie)}if(Le){if(l.samplerate||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),W=this.generateIS(l,a,b)),J=this.remuxAudio(l,me,this.isAudioContiguous,m,Be||Ue||C===D.PlaylistLevelType.AUDIO?Ee:void 0),Ue){var Ce=J?J.endPTS-J.startPTS:0;a.inputTimeScale||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),W=this.generateIS(l,a,b)),H=this.remuxVideo(a,Ee,ce,Ce)}}else Ue&&(H=this.remuxVideo(a,Ee,ce,0));H&&(H.firstKeyFrame=ne,H.independent=ne!==-1)}}return this.ISGenerated&&(i.samples.length&&($=this.remuxID3(i,b)),x.samples.length&&(j=this.remuxText(x,b))),{audio:J,video:H,initSegment:W,independent:se,text:j,id3:$}},v.generateIS=function(l,a,i){var x=l.samples,b=a.samples,m=this.typeSupported,L={},C=!Object(Q.isFiniteNumber)(this._initPTS),H="audio/mp4",J,W,j;if(C&&(J=W=Infinity),l.config&&x.length&&(l.timescale=l.samplerate,l.isAAC||(m.mpeg?(H="audio/mpeg",l.codec=""):m.mp3&&(l.codec="mp3")),L.audio={id:"audio",container:H,codec:l.codec,initSegment:!l.isAAC&&m.mpeg?new Uint8Array(0):O.default.initSegment([l]),metadata:{channelCount:l.channelCount}},C&&(j=l.inputTimeScale,J=W=x[0].pts-Math.round(j*i))),a.sps&&a.pps&&b.length&&(a.timescale=a.inputTimeScale,L.video={id:"main",container:"video/mp4",codec:a.codec,initSegment:O.default.initSegment([a]),metadata:{width:a.width,height:a.height}},C)){j=a.inputTimeScale;var $=this.getVideoStartPts(b),se=Math.round(j*i);W=Math.min(W,h(b[0].dts,$)-se),J=Math.min(J,$-se)}if(Object.keys(L).length)return this.ISGenerated=!0,C&&(this._initPTS=J,this._initDTS=W),{tracks:L,initPTS:J,timescale:j}},v.remuxVideo=function(l,a,i,x){var b=l.inputTimeScale,m=l.samples,L=[],C=m.length,H=this._initPTS,J=this.nextAvcDts,W=8,j,$,se,me=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,We=0,Be=!1;if(!i||J===null){var Ne=a*b,Le=m[0].pts-h(m[0].dts,m[0].pts);J=Ne-Le}for(var Ue=0;Ue<C;Ue++){var ye=m[Ue];if(ye.pts=h(ye.pts-H,J),ye.dts=h(ye.dts-H,J),ye.dts>ye.pts){var ce=9e4*.2;We=Math.max(Math.min(We,ye.pts-ye.dts),-1*ce)}ye.dts<m[Ue>0?Ue-1:Ue].dts&&(Be=!0)}Be&&m.sort(function(pt,Qe){var ze=pt.dts-Qe.dts,De=pt.pts-Qe.pts;return ze||De}),$=m[0].dts,se=m[m.length-1].dts;var ne=Math.round((se-$)/(C-1));if(We<0){if(We<ne*-2){I.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(E.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var ve=We,le=0;le<C;le++)m[le].dts=ve=Math.max(ve,m[le].pts-ne),m[le].pts=Math.max(ve,m[le].pts)}else{I.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(E.toMsFromMpegTsClock)(We,!0)+" ms to overcome this issue");for(var Re=0;Re<C;Re++)m[Re].dts=m[Re].dts+We}$=m[0].dts}if(i){var Ie=$-J,Ce=Ie>ne,He=Ie<-1;if(Ce||He){Ce?I.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(Ie,!0)+" ms ("+Ie+"dts) hole between fragments detected, filling it"):I.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-Ie,!0)+" ms ("+Ie+"dts) overlapping between fragments detected"),$=J;var Ze=m[0].pts-Ie;m[0].dts=$,m[0].pts=Ze,I.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(Ze,!0)+"/"+Object(E.toMsFromMpegTsClock)($,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(Ie,!0)+" ms")}}s&&($=Math.max(0,$));for(var ot=0,et=0,Ke=0;Ke<C;Ke++){for(var Ve=m[Ke],ht=Ve.units,mt=ht.length,gt=0,Et=0;Et<mt;Et++)gt+=ht[Et].data.length;et+=gt,ot+=mt,Ve.length=gt,Ve.dts=Math.max(Ve.dts,$),Ve.pts=Math.max(Ve.pts,Ve.dts,0),me=Math.min(Ve.pts,me),Ee=Math.max(Ve.pts,Ee)}se=m[C-1].dts;var ft=et+4*ot+8,Ct;try{Ct=new Uint8Array(ft)}catch(pt){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ft,reason:"fail allocating video mdat "+ft});return}var _e=new DataView(Ct.buffer);_e.setUint32(0,ft),Ct.set(O.default.types.mdat,4);for(var Se=0;Se<C;Se++){for(var Je=m[Se],nt=Je.units,Fe=0,qe=0,xe=nt.length;qe<xe;qe++){var he=nt[qe],ge=he.data,re=he.data.byteLength;_e.setUint32(W,re),W+=4,Ct.set(ge,W),W+=re,Fe+=4+re}if(Se<C-1)j=m[Se+1].dts-Je.dts;else{var ie=this.config,oe=Je.dts-m[Se>0?Se-1:Se].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(ie.maxBufferHole*b),Oe=(x?me+x*b:this.nextAudioPts)-Je.pts;Oe>ue?(j=Oe-oe,j<0&&(j=oe),I.logger.log("[mp4-remuxer]: It is approximately "+Oe/90+" ms to the next segment; using duration "+j/90+" ms for the last video frame.")):j=oe}else j=oe}var we=Math.round(Je.pts-Je.dts);L.push(new g(Je.key,j,Fe,we))}if(L.length&&y&&y<70){var rt=L[0].flags;rt.dependsOn=2,rt.isNonSync=0}console.assert(j!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=J=se+j,this.isVideoContiguous=!0;var yt=O.default.moof(l.sequenceNumber++,$,R({},l,{samples:L})),wt="video",xt={data1:yt,data2:Ct,startPTS:me/b,endPTS:(Ee+j)/b,startDTS:$/b,endDTS:J/b,type:wt,hasAudio:!1,hasVideo:!0,nb:L.length,dropped:l.dropped};return l.samples=[],l.dropped=0,console.assert(Ct.length,"MDAT length must not be zero"),xt},v.remuxAudio=function(l,a,i,x,b){var m=l.inputTimeScale,L=l.samplerate?l.samplerate:m,C=m/L,H=l.isAAC?_:S,J=H*C,W=this._initPTS,j=!l.isAAC&&this.typeSupported.mpeg,$=[],se=l.samples,me=j?0:8,Ee=this.nextAudioPts||-1,We=a*m;if(this.isAudioContiguous=i=i||se.length&&Ee>0&&(x&&Math.abs(We-Ee)<9e3||Math.abs(h(se[0].pts-W,We)-Ee)<20*J),se.forEach(function(ge){ge.pts=h(ge.pts-W,We)}),!i||Ee<0){if(se=se.filter(function(ge){return ge.pts>=0}),!se.length)return;b===0?Ee=0:x?Ee=Math.max(0,We):Ee=se[0].pts}if(l.isAAC)for(var Be=b!==void 0,Ne=this.config.maxAudioFramesDrift,Le=0,Ue=Ee;Le<se.length;Le++){var ye=se[Le],ce=ye.pts,ne=ce-Ue,ve=Math.abs(1e3*ne/m);if(ne<=-Ne*J&&Be)Le===0&&(I.logger.warn("Audio frame @ "+(ce/m).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/m)+" ms."),this.nextAudioPts=Ee=Ue=ce);else if(ne>=Ne*J&&ve<P&&Be){var le=Math.round(ne/J);Ue=ce-le*J,Ue<0&&(le--,Ue+=J),Le===0&&(this.nextAudioPts=Ee=Ue),I.logger.warn("[mp4-remuxer]: Injecting "+le+" audio frame @ "+(Ue/m).toFixed(3)+"s due to "+Math.round(1e3*ne/m)+" ms gap.");for(var Re=0;Re<le;Re++){var Ie=Math.max(Ue,0),Ce=N.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);Ce||(I.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ce=ye.unit.subarray()),se.splice(Le,0,{unit:Ce,pts:Ie}),Ue+=J,Le++}}ye.pts=Ue,Ue+=J}for(var He=null,Ze=null,ot,et=0,Ke=se.length;Ke--;)et+=se[Ke].unit.byteLength;for(var Ve=0,ht=se.length;Ve<ht;Ve++){var mt=se[Ve],gt=mt.unit,Et=mt.pts;if(Ze!==null){var ft=$[Ve-1];ft.duration=Math.round((Et-Ze)/C)}else if(i&&l.isAAC&&(Et=Ee),He=Et,et>0){et+=me;try{ot=new Uint8Array(et)}catch(ge){this.observer.emit(U.Events.ERROR,U.Events.ERROR,{type:B.ErrorTypes.MUX_ERROR,details:B.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:et,reason:"fail allocating audio mdat "+et});return}if(!j){var Ct=new DataView(ot.buffer);Ct.setUint32(0,et),ot.set(O.default.types.mdat,4)}}else return;ot.set(gt,me);var _e=gt.byteLength;me+=_e,$.push(new g(!0,H,_e,0)),Ze=Et}var Se=$.length;if(!Se)return;var Je=$[$.length-1];this.nextAudioPts=Ee=Ze+C*Je.duration;var nt=j?new Uint8Array(0):O.default.moof(l.sequenceNumber++,He/C,R({},l,{samples:$}));l.samples=[];var Fe=He/m,qe=Ee/m,xe="audio",he={data1:nt,data2:ot,startPTS:Fe,endPTS:qe,startDTS:Fe,endDTS:qe,type:xe,hasAudio:!0,hasVideo:!1,nb:Se};return this.isAudioContiguous=!0,console.assert(ot.length,"MDAT length must not be zero"),he},v.remuxEmptyAudio=function(l,a,i,x){var b=l.inputTimeScale,m=l.samplerate?l.samplerate:b,L=b/m,C=this.nextAudioPts,H=(C!==null?C:x.startDTS*b)+this._initDTS,J=x.endDTS*b+this._initDTS,W=L*_,j=Math.ceil((J-H)/W),$=N.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);if(I.logger.warn("[mp4-remuxer]: remux empty Audio"),!$){I.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var se=[],me=0;me<j;me++){var Ee=H+me*W;se.push({unit:$,pts:Ee,dts:Ee})}return l.samples=se,this.remuxAudio(l,a,i,!1)},v.remuxID3=function(l,a){var i=l.samples.length;if(!i)return;for(var x=l.inputTimeScale,b=this._initPTS,m=this._initDTS,L=0;L<i;L++){var C=l.samples[L];C.pts=h(C.pts-b,a*x)/x,C.dts=h(C.dts-m,a*x)/x}var H=l.samples;return l.samples=[],{samples:H}},v.remuxText=function(l,a){var i=l.samples.length;if(!i)return;for(var x=l.inputTimeScale,b=this._initPTS,m=0;m<i;m++){var L=l.samples[m];L.pts=h(L.pts-b,a*x)/x}l.samples.sort(function(H,J){return H.pts-J.pts});var C=l.samples;return l.samples=[],{samples:C}},w}();function h(w,v){var c;if(v===null)return w;for(v<w?c=-8589934592:c=8589934592;Math.abs(w-v)>4294967296;)w+=c;return w}function T(w){for(var v=0;v<w.length;v++)if(w[v].key)return v;return-1}var g=function(v,c,l,a){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=c,this.size=l,this.cts=a,this.flags=new f(v)},f=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/polyfills/number.ts"),N=k("./src/utils/mp4-tools.ts"),O=k("./src/loader/fragment.ts"),U=k("./src/utils/logger.ts"),B=function(){function E(){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 R=E.prototype;return R.destroy=function(){},R.resetTimeStamp=function(_){this.initPTS=_,this.lastEndDTS=null},R.resetNextTimestamp=function(){this.lastEndDTS=null},R.resetInitSegment=function(_,S,y){this.audioCodec=S,this.videoCodec=y,this.generateInitSegment(_),this.emitInitSegment=!0},R.generateInitSegment=function(_){var S=this.audioCodec,y=this.videoCodec;if(!_||!_.byteLength){this.initTracks=void 0,this.initData=void 0;return}var d=this.initData=Object(N.parseInitSegment)(_);S||(S=D(d.audio,O.ElementaryStreamTypes.AUDIO)),y||(y=D(d.video,O.ElementaryStreamTypes.VIDEO));var s={};d.audio&&d.video?s.audiovideo={container:"video/mp4",codec:S+","+y,initSegment:_,id:"main"}:d.audio?s.audio={container:"audio/mp4",codec:S,initSegment:_,id:"audio"}:d.video?s.video={container:"video/mp4",codec:y,initSegment:_,id:"main"}:U.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},R.remux=function(_,S,y,d,s){var u=this.initPTS,h=this.lastEndDTS,T={audio:void 0,video:void 0,text:d,id3:y,initSegment:void 0};Object(Q.isFiniteNumber)(h)||(h=this.lastEndDTS=s||0);var g=S.samples;if(!g||!g.length)return T;var f={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(g),w=this.initData),!w||!w.length)return U.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(Q.isFiniteNumber)(u)||(this.initPTS=f.initPTS=u=I(w,g,h));var v=Object(N.getDuration)(g,w),c=h,l=v+c;Object(N.offsetStartDTS)(w,g,u),v>0?this.lastEndDTS=l:(U.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var a=!!w.audio,i=!!w.video,x="";a&&(x+="audio"),i&&(x+="video");var b={data1:g,startPTS:c,startDTS:c,endPTS:l,endDTS:l,type:x,hasAudio:a,hasVideo:i,nb:1,dropped:0};return T.audio=b.type==="audio"?b:void 0,T.video=b.type!=="audio"?b:void 0,T.text=d,T.id3=y,T.initSegment=f,T},E}(),I=function(R,P,_){return Object(N.getStartDTS)(R,P)-_};function D(E,R){var P=E==null?void 0:E.codec;return P&&P.length>4?P:P==="hvc1"?"hvc1.1.c.L120.90":P==="av01"?"av01.0.04M.08":P==="avc1"||R===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=B},"./src/task-loop.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return Q});var Q=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=N.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(B){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,B),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},N}()},"./src/types/cmcd.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"CMCDVersion",function(){return Q}),k.d(X,"CMCDObjectType",function(){return N}),k.d(X,"CMCDStreamingFormat",function(){return O}),k.d(X,"CMCDStreamType",function(){return U});var Q=1,N;(function(B){B.MANIFEST="m",B.AUDIO="a",B.VIDEO="v",B.MUXED="av",B.INIT="i",B.CAPTION="c",B.TIMED_TEXT="tt",B.KEY="k",B.OTHER="o"})(N||(N={}));var O;(function(B){B.DASH="d",B.HLS="h",B.SMOOTH="s",B.OTHER="o"})(O||(O={}));var U;(function(B){B.VOD="v",B.LIVE="l"})(U||(U={}))},"./src/types/level.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"HlsSkip",function(){return O}),k.d(X,"getSkipValue",function(){return U}),k.d(X,"HlsUrlParameters",function(){return B}),k.d(X,"Level",function(){return I});function Q(D,E){for(var R=0;R<E.length;R++){var P=E[R];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(D,P.key,P)}}function N(D,E,R){return E&&Q(D.prototype,E),R&&Q(D,R),D}var O;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(O||(O={}));function U(D,E){var R=D.canSkipUntil,P=D.canSkipDateRanges,_=D.endSN,S=E!==void 0?E-_:0;return R&&S<R?P?O.v2:O.Yes:O.No}var B=function(){function D(R,P,_){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=R,this.part=P,this.skip=_}var E=D.prototype;return E.addDirectives=function(P){var _=new self.URL(P);return this.msn!==void 0&&_.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&_.searchParams.set("_HLS_part",this.part.toString()),this.skip&&_.searchParams.set("_HLS_skip",this.skip),_.toString()},D}(),I=function(){function D(E){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=[E.url],this.attrs=E.attrs,this.bitrate=E.bitrate,E.details&&(this.details=E.details),this.id=E.id||0,this.name=E.name,this.width=E.width||0,this.height=E.height||0,this.audioCodec=E.audioCodec,this.videoCodec=E.videoCodec,this.unknownCodecs=E.unknownCodecs,this.codecSet=[E.videoCodec,E.audioCodec].filter(function(R){return R}).join(",").replace(/\.[^.,]+/g,"")}return N(D,[{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(R){var P=R%this.url.length;this._urlId!==P&&(this.details=void 0,this._urlId=P)}}]),D}()},"./src/types/loader.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"PlaylistContextType",function(){return Q}),k.d(X,"PlaylistLevelType",function(){return N});var Q;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(Q||(Q={}));var N;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"ChunkMetadata",function(){return Q});var Q=function(U,B,I,D,E,R){D===void 0&&(D=0),E===void 0&&(E=-1),R===void 0&&(R=!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=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=U,this.sn=B,this.id=I,this.size=D,this.part=E,this.partial=R};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"AttrList",function(){return O});var Q=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function U(I){typeof I=="string"&&(I=U.parseAttrList(I));for(var D in I)I.hasOwnProperty(D)&&(this[D]=I[D])}var B=U.prototype;return B.decimalInteger=function(D){var E=parseInt(this[D],10);return E>Number.MAX_SAFE_INTEGER?Infinity:E},B.hexadecimalInteger=function(D){if(this[D]){var E=(this[D]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var R=new Uint8Array(E.length/2),P=0;P<E.length/2;P++)R[P]=parseInt(E.slice(P*2,P*2+2),16);return R}else return null},B.hexadecimalIntegerAsNumber=function(D){var E=parseInt(this[D],16);return E>Number.MAX_SAFE_INTEGER?Infinity:E},B.decimalFloatingPoint=function(D){return parseFloat(this[D])},B.optionalFloat=function(D,E){var R=this[D];return R?parseFloat(R):E},B.enumeratedString=function(D){return this[D]},B.bool=function(D){return this[D]==="YES"},B.decimalResolution=function(D){var E=Q.exec(this[D]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},U.parseAttrList=function(D){var E,R={},P='"';for(N.lastIndex=0;(E=N.exec(D))!==null;){var _=E[2];_.indexOf(P)===0&&_.lastIndexOf(P)===_.length-1&&(_=_.slice(1,-1)),R[E[1]]=_}return R},U}()},"./src/utils/binary-search.ts":function(ee,X,k){"use strict";k.r(X);var Q={search:function(O,U){for(var B=0,I=O.length-1,D=null,E=null;B<=I;){D=(B+I)/2|0,E=O[D];var R=U(E);if(R>0)B=D+1;else if(R<0)I=D-1;else return E}return null}};X.default=Q},"./src/utils/buffer-helper.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"BufferHelper",function(){return O});var Q=k("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function U(){}return U.isBuffered=function(I,D){try{if(I){for(var E=U.getBuffered(I),R=0;R<E.length;R++)if(D>=E.start(R)&&D<=E.end(R))return!0}}catch(P){}return!1},U.bufferInfo=function(I,D,E){try{if(I){var R=U.getBuffered(I),P=[],_;for(_=0;_<R.length;_++)P.push({start:R.start(_),end:R.end(_)});return this.bufferedInfo(P,D,E)}}catch(S){}return{len:0,start:D,end:D,nextStart:void 0}},U.bufferedInfo=function(I,D,E){D=Math.max(0,D),I.sort(function(f,w){var v=f.start-w.start;return v||w.end-f.end});var R=[];if(E)for(var P=0;P<I.length;P++){var _=R.length;if(_){var S=R[_-1].end;I[P].start-S<E?I[P].end>S&&(R[_-1].end=I[P].end):R.push(I[P])}else R.push(I[P])}else R=I;for(var y=0,d,s=D,u=D,h=0;h<R.length;h++){var T=R[h].start,g=R[h].end;if(D+E>=T&&D<g)s=T,u=g,y=u-D;else if(D+E<T){d=T;break}}return{len:y,start:s||0,end:u||0,nextStart:d}},U.getBuffered=function(I){try{return I.buffered}catch(D){return Q.logger.log("failed to get media.buffered",D),N}},U}()},"./src/utils/cea-608-parser.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"Row",function(){return u}),k.d(X,"CaptionScreen",function(){return h});var Q=k("./src/utils/logger.ts"),N={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},O=function(l){var a=l;return N.hasOwnProperty(l)&&(a=N[l]),String.fromCharCode(a)},U=15,B=100,I={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},R={25:2,26:4,29:6,30:8,31:10,27:13,28:15},P=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],_;(function(c){c[c.ERROR=0]="ERROR",c[c.TEXT=1]="TEXT",c[c.WARNING=2]="WARNING",c[c.INFO=2]="INFO",c[c.DEBUG=3]="DEBUG",c[c.DATA=3]="DATA"})(_||(_={}));var S=function(){function c(){this.time=null,this.verboseLevel=_.ERROR}var l=c.prototype;return l.log=function(i,x){this.verboseLevel>=i&&Q.logger.log(this.time+" ["+i+"] "+x)},c}(),y=function(l){for(var a=[],i=0;i<l.length;i++)a.push(l[i].toString(16));return a},d=function(){function c(a,i,x,b,m){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=a||"white",this.underline=i||!1,this.italics=x||!1,this.background=b||"black",this.flash=m||!1}var l=c.prototype;return l.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},l.setStyles=function(i){for(var x=["foreground","underline","italics","background","flash"],b=0;b<x.length;b++){var m=x[b];i.hasOwnProperty(m)&&(this[m]=i[m])}},l.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},l.equals=function(i){return this.foreground===i.foreground&&this.underline===i.underline&&this.italics===i.italics&&this.background===i.background&&this.flash===i.flash},l.copy=function(i){this.foreground=i.foreground,this.underline=i.underline,this.italics=i.italics,this.background=i.background,this.flash=i.flash},l.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},c}(),s=function(){function c(a,i,x,b,m,L){this.uchar=void 0,this.penState=void 0,this.uchar=a||" ",this.penState=new d(i,x,b,m,L)}var l=c.prototype;return l.reset=function(){this.uchar=" ",this.penState.reset()},l.setChar=function(i,x){this.uchar=i,this.penState.copy(x)},l.setPenState=function(i){this.penState.copy(i)},l.equals=function(i){return this.uchar===i.uchar&&this.penState.equals(i.penState)},l.copy=function(i){this.uchar=i.uchar,this.penState.copy(i.penState)},l.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},c}(),u=function(){function c(a){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var i=0;i<B;i++)this.chars.push(new s);this.logger=a,this.pos=0,this.currPenState=new d}var l=c.prototype;return l.equals=function(i){for(var x=!0,b=0;b<B;b++)if(!this.chars[b].equals(i.chars[b])){x=!1;break}return x},l.copy=function(i){for(var x=0;x<B;x++)this.chars[x].copy(i.chars[x])},l.isEmpty=function(){for(var i=!0,x=0;x<B;x++)if(!this.chars[x].isEmpty()){i=!1;break}return i},l.setCursor=function(i){this.pos!==i&&(this.pos=i),this.pos<0?(this.logger.log(_.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>B&&(this.logger.log(_.DEBUG,"Too large cursor position "+this.pos),this.pos=B)},l.moveCursor=function(i){var x=this.pos+i;if(i>1)for(var b=this.pos+1;b<x+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(x)},l.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},l.insertChar=function(i){i>=144&&this.backSpace();var x=O(i);if(this.pos>=B){this.logger.log(_.ERROR,"Cannot insert "+i.toString(16)+" ("+x+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},l.clearFromPos=function(i){var x;for(x=i;x<B;x++)this.chars[x].reset()},l.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},l.clearToEndOfRow=function(){this.clearFromPos(this.pos)},l.getTextString=function(){for(var i=[],x=!0,b=0;b<B;b++){var m=this.chars[b].uchar;m!==" "&&(x=!1),i.push(m)}return x?"":i.join("")},l.setPenStyles=function(i){this.currPenState.setStyles(i);var x=this.chars[this.pos];x.setPenState(this.currPenState)},c}(),h=function(){function c(a){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var i=0;i<U;i++)this.rows.push(new u(a));this.logger=a,this.currRow=U-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var l=c.prototype;return l.reset=function(){for(var i=0;i<U;i++)this.rows[i].clear();this.currRow=U-1},l.equals=function(i){for(var x=!0,b=0;b<U;b++)if(!this.rows[b].equals(i.rows[b])){x=!1;break}return x},l.copy=function(i){for(var x=0;x<U;x++)this.rows[x].copy(i.rows[x])},l.isEmpty=function(){for(var i=!0,x=0;x<U;x++)if(!this.rows[x].isEmpty()){i=!1;break}return i},l.backSpace=function(){var i=this.rows[this.currRow];i.backSpace()},l.clearToEndOfRow=function(){var i=this.rows[this.currRow];i.clearToEndOfRow()},l.insertChar=function(i){var x=this.rows[this.currRow];x.insertChar(i)},l.setPen=function(i){var x=this.rows[this.currRow];x.setPenStyles(i)},l.moveCursor=function(i){var x=this.rows[this.currRow];x.moveCursor(i)},l.setCursor=function(i){this.logger.log(_.INFO,"setCursor: "+i);var x=this.rows[this.currRow];x.setCursor(i)},l.setPAC=function(i){this.logger.log(_.INFO,"pacData = "+JSON.stringify(i));var x=i.row-1;if(this.nrRollUpRows&&x<this.nrRollUpRows-1&&(x=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==x){for(var b=0;b<U;b++)this.rows[b].clear();var m=this.currRow+1-this.nrRollUpRows,L=this.lastOutputScreen;if(L){var C=L.rows[m].cueStartTime,H=this.logger.time;if(C&&H!==null&&C<H)for(var J=0;J<this.nrRollUpRows;J++)this.rows[x-this.nrRollUpRows+J+1].copy(L.rows[m+J])}}this.currRow=x;var W=this.rows[this.currRow];if(i.indent!==null){var j=i.indent,$=Math.max(j-1,0);W.setCursor(i.indent),i.color=W.chars[$].penState.foreground}var se={foreground:i.color,underline:i.underline,italics:i.italics,background:"black",flash:!1};this.setPen(se)},l.setBkgData=function(i){this.logger.log(_.INFO,"bkgData = "+JSON.stringify(i)),this.backSpace(),this.setPen(i),this.insertChar(32)},l.setRollUpRows=function(i){this.nrRollUpRows=i},l.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(_.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(_.TEXT,this.getDisplayText());var i=this.currRow+1-this.nrRollUpRows,x=this.rows.splice(i,1)[0];x.clear(),this.rows.splice(this.currRow,0,x),this.logger.log(_.INFO,"Rolling up")},l.getDisplayText=function(i){i=i||!1;for(var x=[],b="",m=-1,L=0;L<U;L++){var C=this.rows[L].getTextString();C&&(m=L+1,i?x.push("Row "+m+": '"+C+"'"):x.push(C.trim()))}return x.length>0&&(i?b="["+x.join(" | ")+"]":b=x.join(`
|
|
`)),b},l.getTextAndFormat=function(){return this.rows},c}(),T=function(){function c(a,i,x){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=a,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new h(x),this.nonDisplayedMemory=new h(x),this.lastOutputScreen=new h(x),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}var l=c.prototype;return l.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[U-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},l.getHandler=function(){return this.outputFilter},l.setHandler=function(i){this.outputFilter=i},l.setPAC=function(i){this.writeScreen.setPAC(i)},l.setBkgData=function(i){this.writeScreen.setBkgData(i)},l.setMode=function(i){if(i===this.mode)return;this.mode=i,this.logger.log(_.INFO,"MODE="+i),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=i},l.insertChars=function(i){for(var x=0;x<i.length;x++)this.writeScreen.insertChar(i[x]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(_.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(_.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},l.ccRCL=function(){this.logger.log(_.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},l.ccBS=function(){if(this.logger.log(_.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},l.ccAOF=function(){},l.ccAON=function(){},l.ccDER=function(){this.logger.log(_.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},l.ccRU=function(i){this.logger.log(_.INFO,"RU("+i+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(i)},l.ccFON=function(){this.logger.log(_.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},l.ccRDC=function(){this.logger.log(_.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},l.ccTR=function(){this.logger.log(_.INFO,"TR"),this.setMode("MODE_TEXT")},l.ccRTD=function(){this.logger.log(_.INFO,"RTD"),this.setMode("MODE_TEXT")},l.ccEDM=function(){this.logger.log(_.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},l.ccCR=function(){this.logger.log(_.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},l.ccENM=function(){this.logger.log(_.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},l.ccEOC=function(){if(this.logger.log(_.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var i=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=i,this.writeScreen=this.nonDisplayedMemory,this.logger.log(_.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},l.ccTO=function(i){this.logger.log(_.INFO,"TO("+i+") - Tab Offset"),this.writeScreen.moveCursor(i)},l.ccMIDROW=function(i){var x={flash:!1};if(x.underline=i%2===1,x.italics=i>=46,x.italics)x.foreground="white";else{var b=Math.floor(i/2)-16,m=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=m[b]}this.logger.log(_.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},l.outputDataUpdate=function(i){i===void 0&&(i=!1);var x=this.logger.time;if(x===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=x:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,x,this.lastOutputScreen),i&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:x),this.lastOutputScreen.copy(this.displayedMemory))},l.cueSplitAtTime=function(i){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,i,this.displayedMemory),this.cueStartTime=i))},c}(),g=function(){function c(a,i,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new S;this.channels=[null,new T(a,i,b),new T(a+1,x,b)],this.cmdHistory=v(),this.logger=b}var l=c.prototype;return l.getHandler=function(i){return this.channels[i].getHandler()},l.setHandler=function(i,x){this.channels[i].setHandler(x)},l.addData=function(i,x){var b,m,L,C=!1;this.logger.time=i;for(var H=0;H<x.length;H+=2){if(m=x[H]&127,L=x[H+1]&127,m===0&&L===0)continue;if(this.logger.log(_.DATA,"["+y([x[H],x[H+1]])+"] -> ("+y([m,L])+")"),b=this.parseCmd(m,L),b||(b=this.parseMidrow(m,L)),b||(b=this.parsePAC(m,L)),b||(b=this.parseBackgroundAttributes(m,L)),!b&&(C=this.parseChars(m,L),C)){var J=this.currentChannel;if(J&&J>0){var W=this.channels[J];W.insertChars(C)}else this.logger.log(_.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!C&&this.logger.log(_.WARNING,"Couldn't parse cleaned data "+y([m,L])+" orig: "+y([x[H],x[H+1]]))}},l.parseCmd=function(i,x){var b=this.cmdHistory,m=(i===20||i===28||i===21||i===29)&&x>=32&&x<=47,L=(i===23||i===31)&&x>=33&&x<=35;if(!(m||L))return!1;if(w(i,x,b))return f(null,null,b),this.logger.log(_.DEBUG,"Repeated command ("+y([i,x])+") is dropped"),!0;var C=i===20||i===21||i===23?1:2,H=this.channels[C];return i===20||i===21||i===28||i===29?x===32?H.ccRCL():x===33?H.ccBS():x===34?H.ccAOF():x===35?H.ccAON():x===36?H.ccDER():x===37?H.ccRU(2):x===38?H.ccRU(3):x===39?H.ccRU(4):x===40?H.ccFON():x===41?H.ccRDC():x===42?H.ccTR():x===43?H.ccRTD():x===44?H.ccEDM():x===45?H.ccCR():x===46?H.ccENM():x===47&&H.ccEOC():H.ccTO(x-32),f(i,x,b),this.currentChannel=C,!0},l.parseMidrow=function(i,x){var b=0;if((i===17||i===25)&&x>=32&&x<=47){if(i===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(_.ERROR,"Mismatch channel in midrow parsing"),!1;var m=this.channels[b];return m?(m.ccMIDROW(x),this.logger.log(_.DEBUG,"MIDROW ("+y([i,x])+")"),!0):!1}return!1},l.parsePAC=function(i,x){var b,m=this.cmdHistory,L=(i>=17&&i<=23||i>=25&&i<=31)&&x>=64&&x<=127,C=(i===16||i===24)&&x>=64&&x<=95;if(!(L||C))return!1;if(w(i,x,m))return f(null,null,m),!0;var H=i<=23?1:2;x>=64&&x<=95?b=H===1?I[i]:E[i]:b=H===1?D[i]:R[i];var J=this.channels[H];return J?(J.setPAC(this.interpretPAC(b,x)),f(i,x,m),this.currentChannel=H,!0):!1},l.interpretPAC=function(i,x){var b,m={color:null,italics:!1,indent:null,underline:!1,row:i};return x>95?b=x-96:b=x-64,m.underline=(b&1)===1,b<=13?m.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(m.italics=!0,m.color="white"):m.indent=Math.floor((b-16)/2)*4,m},l.parseChars=function(i,x){var b,m=null,L=null;if(i>=25?(b=2,L=i-8):(b=1,L=i),L>=17&&L<=19){var C;L===17?C=x+80:L===18?C=x+112:C=x+144,this.logger.log(_.INFO,"Special char '"+O(C)+"' in channel "+b),m=[C]}else i>=32&&i<=127&&(m=x===0?[i]:[i,x]);if(m){var H=y(m);this.logger.log(_.DEBUG,"Char codes = "+H.join(",")),f(i,x,this.cmdHistory)}return m},l.parseBackgroundAttributes=function(i,x){var b=(i===16||i===24)&&x>=32&&x<=47,m=(i===23||i===31)&&x>=45&&x<=47;if(!(b||m))return!1;var L,C={};i===16||i===24?(L=Math.floor((x-32)/2),C.background=P[L],x%2===1&&(C.background=C.background+"_semi")):x===45?C.background="transparent":(C.foreground="black",x===47&&(C.underline=!0));var H=i<=23?1:2,J=this.channels[H];return J.setBkgData(C),f(i,x,this.cmdHistory),!0},l.reset=function(){for(var i=0;i<Object.keys(this.channels).length;i++){var x=this.channels[i];x&&x.reset()}this.cmdHistory=v()},l.cueSplitAtTime=function(i){for(var x=0;x<this.channels.length;x++){var b=this.channels[x];b&&b.cueSplitAtTime(i)}},c}();function f(c,l,a){a.a=c,a.b=l}function w(c,l,a){return a.a===c&&a.b===l}function v(){return{a:null,b:null}}X.default=g},"./src/utils/codecs.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"isCodecType",function(){return N}),k.d(X,"isCodecSupportedInMp4",function(){return O});var Q={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 N(U,B){var I=Q[B];return!!I&&I[U.slice(0,4)]===!0}function O(U,B){return MediaSource.isTypeSupported((B||"video")+'/mp4;codecs="'+U+'"')}},"./src/utils/cues.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/utils/vttparser.ts"),N=k("./src/utils/webvtt-parser.ts"),O=k("./src/utils/texttrack-utils.ts"),U=/\s/,B={newCue:function(D,E,R,P){for(var _=[],S,y,d,s,u,h=self.VTTCue||self.TextTrackCue,T=0;T<P.rows.length;T++)if(S=P.rows[T],d=!0,s=0,u="",!S.isEmpty()){for(var g=0;g<S.chars.length;g++)U.test(S.chars[g].uchar)&&d?s++:(u+=S.chars[g].uchar,d=!1);S.cueStartTime=E,E===R&&(R+=1e-4),s>=16?s--:s++;var f=Object(Q.fixLineBreaks)(u.trim()),w=Object(N.generateCueId)(E,R,f);(!D||!D.cues||!D.cues.getCueById(w))&&(y=new h(E,R,f),y.id=w,y.line=T+1,y.align="left",y.position=10+Math.min(80,Math.floor(s*8/32)*10),_.push(y))}return D&&_.length&&(_.sort(function(v,c){return v.line==="auto"||c.line==="auto"?0:v.line>8&&c.line>8?c.line-v.line:v.line-c.line}),_.forEach(function(v){return Object(O.addCueToTrack)(D,v)})),_}};X.default=B},"./src/utils/discontinuities.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"findFirstFragWithCC",function(){return U}),k.d(X,"shouldAlignOnDiscontinuities",function(){return B}),k.d(X,"findDiscontinuousReferenceFrag",function(){return I}),k.d(X,"adjustSlidingStart",function(){return E}),k.d(X,"alignStream",function(){return R}),k.d(X,"alignPDT",function(){return _}),k.d(X,"alignFragmentByPDTDelta",function(){return S}),k.d(X,"alignMediaPlaylistByPDT",function(){return y});var Q=k("./src/polyfills/number.ts"),N=k("./src/utils/logger.ts"),O=k("./src/controller/level-helper.ts");function U(d,s){for(var u=null,h=0,T=d.length;h<T;h++){var g=d[h];if(g&&g.cc===s){u=g;break}}return u}function B(d,s,u){return!!(s.details&&(u.endCC>u.startCC||d&&d.cc<u.startCC))}function I(d,s){var u=d.fragments,h=s.fragments;if(!h.length||!u.length){N.logger.log("No fragments to align");return}var T=U(u,h[0].cc);if(!T||T&&!T.startPTS){N.logger.log("No frag in previous level to align on");return}return T}function D(d,s){if(d){var u=d.start+s;d.start=d.startPTS=u,d.endPTS=u+d.duration}}function E(d,s){for(var u=s.fragments,h=0,T=u.length;h<T;h++)D(u[h],d);s.fragmentHint&&D(s.fragmentHint,d),s.alignedSliding=!0}function R(d,s,u){if(!s)return;P(d,u,s),!u.alignedSliding&&s.details&&_(u,s.details),!u.alignedSliding&&s.details&&!u.skippedSegments&&Object(O.adjustSliding)(s.details,u)}function P(d,s,u){if(B(d,u,s)){var h=I(u.details,s);h&&Object(Q.isFiniteNumber)(h.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),E(h.start,s))}}function _(d,s){if(!s.fragments.length||!d.hasProgramDateTime||!s.hasProgramDateTime)return;var u=s.fragments[0].programDateTime,h=d.fragments[0].programDateTime,T=(h-u)/1e3+s.fragments[0].start;T&&Object(Q.isFiniteNumber)(T)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(h-u)+"ms, sliding:"+T.toFixed(3)+" "+d.url+" "),E(T,d))}function S(d,s){var u=d.programDateTime;if(!u)return;var h=(u-s)/1e3;d.start=d.startPTS=h,d.endPTS=h+d.duration}function y(d,s){if(!s.fragments.length||!d.hasProgramDateTime||!s.hasProgramDateTime)return;var u=s.fragments[0].programDateTime,h=s.fragments[0].start,T=u-h*1e3;d.fragments.forEach(function(g){S(g,T)}),d.fragmentHint&&S(d.fragmentHint,T),d.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/utils/ewma.ts"),N=function(){function O(B,I,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Q.default(B),this.fast_=new Q.default(I)}var U=O.prototype;return U.update=function(I,D){var E=this.slow_,R=this.fast_;this.slow_.halfLife!==I&&(this.slow_=new Q.default(I,E.getEstimate(),E.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new Q.default(D,R.getEstimate(),R.getTotalWeight()))},U.sample=function(I,D){I=Math.max(I,this.minDelayMs_);var E=8*D,R=I/1e3,P=E/R;this.fast_.sample(R,P),this.slow_.sample(R,P)},U.canEstimate=function(){var I=this.fast_;return I&&I.getTotalWeight()>=this.minWeight_},U.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},U.destroy=function(){},O}();X.default=N},"./src/utils/ewma.ts":function(ee,X,k){"use strict";k.r(X);var Q=function(){function N(U,B,I){B===void 0&&(B=0),I===void 0&&(I=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=U,this.alpha_=U?Math.exp(Math.log(.5)/U):0,this.estimate_=B,this.totalWeight_=I}var O=N.prototype;return O.sample=function(B,I){var D=Math.pow(this.alpha_,B);this.estimate_=I*(1-D)+D*this.estimate_,this.totalWeight_+=B},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var B=1-Math.pow(this.alpha_,this.totalWeight_);if(B)return this.estimate_/B}return this.estimate_},N}();X.default=Q},"./src/utils/fetch-loader.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"fetchSupported",function(){return S});var Q=k("./src/polyfills/number.ts"),N=k("./src/loader/load-stats.ts"),O=k("./src/demux/chunk-cache.ts");function U(h,T){h.prototype=Object.create(T.prototype),h.prototype.constructor=h,R(h,T)}function B(h){var T=typeof Map=="function"?new Map:void 0;return B=function(f){if(f===null||!E(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(f))return T.get(f);T.set(f,w)}function w(){return I(f,arguments,P(this).constructor)}return w.prototype=Object.create(f.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),R(w,f)},B(h)}function I(h,T,g){return D()?I=Reflect.construct:I=function(w,v,c){var l=[null];l.push.apply(l,v);var a=Function.bind.apply(w,l),i=new a;return c&&R(i,c.prototype),i},I.apply(null,arguments)}function D(){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(h){return!1}}function E(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function R(h,T){return R=Object.setPrototypeOf||function(f,w){return f.__proto__=w,f},R(h,T)}function P(h){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},P(h)}function _(){return _=Object.assign||function(h){for(var T=1;T<arguments.length;T++){var g=arguments[T];for(var f in g)Object.prototype.hasOwnProperty.call(g,f)&&(h[f]=g[f])}return h},_.apply(this,arguments)}function S(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}var y=function(){function h(g){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=g.fetchSetup||s,this.controller=new self.AbortController,this.stats=new N.LoadStats}var T=h.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var f=this.response;(!f||!f.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(f,w,v){var c=this,l=this.stats;if(l.loading.start)throw new Error("Loader can only be used once.");l.loading.start=self.performance.now();var a=d(f,this.controller.signal),i=v.onProgress,x=f.responseType==="arraybuffer",b=x?"byteLength":"length";this.context=f,this.config=w,this.callbacks=v,this.request=this.fetchSetup(f,a),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){c.abortInternal(),v.onTimeout(l,f,c.response)},w.timeout),self.fetch(this.request).then(function(m){if(c.response=c.loader=m,!m.ok){var L=m.status,C=m.statusText;throw new u(C||"fetch, bad network response",L,m)}return l.loading.first=Math.max(self.performance.now(),l.loading.start),l.total=parseInt(m.headers.get("Content-Length")||"0"),i&&Object(Q.isFiniteNumber)(w.highWaterMark)?c.loadProgressively(m,l,f,w.highWaterMark,i):x?m.arrayBuffer():m.text()}).then(function(m){var L=c.response;self.clearTimeout(c.requestTimeout),l.loading.end=Math.max(self.performance.now(),l.loading.first),l.loaded=l.total=m[b];var C={url:L.url,data:m};i&&!Object(Q.isFiniteNumber)(w.highWaterMark)&&i(l,f,m,L),v.onSuccess(C,l,f,L)}).catch(function(m){if(self.clearTimeout(c.requestTimeout),l.aborted)return;var L=m.code||0;v.onError({code:L,text:m.message},f,m.details)})},T.getCacheAge=function(){var f=null;if(this.response){var w=this.response.headers.get("age");f=w?parseFloat(w):null}return f},T.loadProgressively=function(f,w,v,c,l){c===void 0&&(c=0);var a=new O.default,i=f.body.getReader(),x=function b(){return i.read().then(function(m){if(m.done)return a.dataLength&&l(w,v,a.flush(),f),Promise.resolve(new ArrayBuffer(0));var L=m.value,C=L.length;return w.loaded+=C,C<c||a.dataLength?(a.push(L),a.dataLength>=c&&l(w,v,a.flush(),f)):l(w,v,L,f),b()}).catch(function(){return Promise.reject()})};return x()},h}();function d(h,T){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(_({},h.headers))};return h.rangeEnd&&g.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),g}function s(h,T){return new self.Request(h.url,T)}var u=function(h){U(T,h);function T(g,f,w){var v;return v=h.call(this,g)||this,v.code=void 0,v.details=void 0,v.code=f,v.details=w,v}return T}(B(Error));X.default=y},"./src/utils/imsc1-ttml-parser.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"IMSC1_CODEC",function(){return E}),k.d(X,"parseIMSC1",function(){return S});var Q=k("./src/utils/mp4-tools.ts"),N=k("./src/utils/vttparser.ts"),O=k("./src/utils/vttcue.ts"),U=k("./src/demux/id3.ts"),B=k("./src/utils/timescale-conversion.ts"),I=k("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(c){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(c[i]=a[i])}return c},D.apply(this,arguments)}var E="stpp.ttml.im1t",R=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,P=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,_={left:"start",center:"center",right:"end",start:"start",end:"end"};function S(c,l,a,i,x){var b=Object(Q.findBox)(new Uint8Array(c),["mdat"]);if(b.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var m=b[0],L=Object(U.utf8ArrayToStr)(new Uint8Array(c,m.start,m.end-m.start)),C=Object(B.toTimescaleFromScale)(l,1,a);try{i(y(L,C))}catch(H){x(H)}}function y(c,l){var a=new DOMParser,i=a.parseFromString(c,"text/xml"),x=i.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},m=Object.keys(b).reduce(function(W,j){return W[j]=x.getAttribute("ttp:"+j)||b[j],W},{}),L=x.getAttribute("xml:space")!=="preserve",C=s(d(x,"styling","style")),H=s(d(x,"layout","region")),J=d(x,"body","[begin]");return[].map.call(J,function(W){var j=u(W,L);if(!j||!W.hasAttribute("begin"))return null;var $=f(W.getAttribute("begin"),m),se=f(W.getAttribute("dur"),m),me=f(W.getAttribute("end"),m);if($===null)throw g(W);if(me===null){if(se===null)throw g(W);me=$+se}var Ee=new O.default($-l,me-l,j);Ee.id=Object(I.generateCueId)(Ee.startTime,Ee.endTime,Ee.text);var We=H[W.getAttribute("region")],Be=C[W.getAttribute("style")];Ee.position=10,Ee.size=80;var Ne=h(We,Be),Le=Ne.textAlign;if(Le){var Ue=_[Le];Ue&&(Ee.lineAlign=Ue),Ee.align=Le}return D(Ee,Ne),Ee}).filter(function(W){return W!==null})}function d(c,l,a){var i=c.getElementsByTagName(l)[0];return i?[].slice.call(i.querySelectorAll(a)):[]}function s(c){return c.reduce(function(l,a){var i=a.getAttribute("xml:id");return i&&(l[i]=a),l},{})}function u(c,l){return[].slice.call(c.childNodes).reduce(function(a,i,x){var b;return i.nodeName==="br"&&x?a+`
|
|
`:(b=i.childNodes)!==null&&b!==void 0&&b.length?u(i,l):l?a+i.textContent.trim().replace(/\s+/g," "):a+i.textContent},"")}function h(c,l){var a="http://www.w3.org/ns/ttml#styling",i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return i.reduce(function(x,b){var m=T(l,a,b)||T(c,a,b);return m&&(x[b]=m),x},{})}function T(c,l,a){return c.hasAttributeNS(l,a)?c.getAttributeNS(l,a):null}function g(c){return new Error("Could not parse ttml timestamp "+c)}function f(c,l){if(!c)return null;var a=Object(N.parseTimeStamp)(c);return a===null&&(R.test(c)?a=w(c,l):P.test(c)&&(a=v(c,l))),a}function w(c,l){var a=R.exec(c),i=(a[4]|0)+(a[5]|0)/l.subFrameRate;return(a[1]|0)*3600+(a[2]|0)*60+(a[3]|0)+i/l.frameRate}function v(c,l){var a=P.exec(c),i=Number(a[1]),x=a[2];switch(x){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/l.frameRate;case"t":return i/l.tickRate}return i}},"./src/utils/logger.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"enableLogs",function(){return I}),k.d(X,"logger",function(){return D});var Q=function(){},N={trace:Q,debug:Q,log:Q,warn:Q,info:Q,error:Q},O=N;function U(E){var R=self.console[E];return R?R.bind(self.console,"["+E+"] >"):Q}function B(E){for(var R=arguments.length,P=new Array(R>1?R-1:0),_=1;_<R;_++)P[_-1]=arguments[_];P.forEach(function(S){O[S]=E[S]?E[S].bind(E):U(S)})}function I(E){if(self.console&&E===!0||typeof E=="object"){B(E,"debug","log","info","warn","error");try{O.log()}catch(R){O=N}}else O=N}var D=O},"./src/utils/mediakeys-helper.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"KeySystems",function(){return Q}),k.d(X,"requestMediaKeySystemAccess",function(){return N});var Q;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(Q||(Q={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"getMediaSource",function(){return Q});function Q(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"bin2str",function(){return B}),k.d(X,"readUint16",function(){return I}),k.d(X,"readUint32",function(){return D}),k.d(X,"writeUint32",function(){return E}),k.d(X,"findBox",function(){return R}),k.d(X,"parseSegmentIndex",function(){return P}),k.d(X,"parseInitSegment",function(){return _}),k.d(X,"getStartDTS",function(){return S}),k.d(X,"getDuration",function(){return y}),k.d(X,"computeRawDurationFromSamples",function(){return d}),k.d(X,"offsetStartDTS",function(){return s}),k.d(X,"segmentValidRange",function(){return u}),k.d(X,"appendUint8Array",function(){return h});var Q=k("./src/utils/typed-array.ts"),N=k("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,U=[].push;function B(T){return String.fromCharCode.apply(null,T)}function I(T,g){"data"in T&&(g+=T.start,T=T.data);var f=T[g]<<8|T[g+1];return f<0?65536+f:f}function D(T,g){"data"in T&&(g+=T.start,T=T.data);var f=T[g]<<24|T[g+1]<<16|T[g+2]<<8|T[g+3];return f<0?4294967296+f:f}function E(T,g,f){"data"in T&&(g+=T.start,T=T.data),T[g]=f>>24,T[g+1]=f>>16&255,T[g+2]=f>>8&255,T[g+3]=f&255}function R(T,g){var f=[];if(!g.length)return f;var w,v,c;"data"in T?(w=T.data,v=T.start,c=T.end):(w=T,v=0,c=w.byteLength);for(var l=v;l<c;){var a=D(w,l),i=B(w.subarray(l+4,l+8)),x=a>1?l+a:c;if(i===g[0])if(g.length===1)f.push({data:w,start:l+8,end:x});else{var b=R({data:w,start:l+8,end:x},g.slice(1));b.length&&U.apply(f,b)}l=x}return f}function P(T){var g=R(T,["moov"]),f=g[0],w=f?f.end:null,v=R(T,["sidx"]);if(!v||!v[0])return null;var c=[],l=v[0],a=l.data[0],i=a===0?8:16,x=D(l,i);i+=4;var b=0,m=0;a===0?i+=8:i+=16,i+=2;var L=l.end+m,C=I(l,i);i+=2;for(var H=0;H<C;H++){var J=i,W=D(l,J);J+=4;var j=W&2147483647,$=(W&2147483648)>>>31;if($===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var se=D(l,J);J+=4,c.push({referenceSize:j,subsegmentDuration:se,info:{duration:se/x,start:L,end:L+j-1}}),L+=j,J+=4,i=J}return{earliestPresentationTime:b,timescale:x,version:a,referencesCount:C,references:c,moovEndOffset:w}}function _(T){for(var g=[],f=R(T,["moov","trak"]),w=0;w<f.length;w++){var v=f[w],c=R(v,["tkhd"])[0];if(c){var l=c.data[c.start],a=l===0?12:20,i=D(c,a),x=R(v,["mdia","mdhd"])[0];if(x){l=x.data[x.start],a=l===0?12:20;var b=D(x,a),m=R(v,["mdia","hdlr"])[0];if(m){var L=B(m.data.subarray(m.start+8,m.start+12)),C={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[L];if(C){var H=R(v,["mdia","minf","stbl","stsd"])[0],J=void 0;H&&(J=B(H.data.subarray(H.start+12,H.start+16))),g[i]={timescale:b,type:C},g[C]={timescale:b,id:i,codec:J}}}}}}var W=R(T,["moov","mvex","trex"]);return W.forEach(function(j){var $=D(j,4),se=g[$];se&&(se.default={duration:D(j,12),flags:D(j,20)})}),g}function S(T,g){return R(g,["moof","traf"]).reduce(function(f,w){var v=R(w,["tfdt"])[0],c=v.data[v.start],l=R(w,["tfhd"]).reduce(function(a,i){var x=D(i,4),b=T[x];if(b){var m=D(v,4);c===1&&(m*=Math.pow(2,32),m+=D(v,8));var L=b.timescale||9e4,C=m/L;if(isFinite(C)&&(a===null||C<a))return C}return a},null);return l!==null&&isFinite(l)&&(f===null||l<f)?l:f},null)||0}function y(T,g){for(var f=0,w=0,v=0,c=R(T,["moof","traf"]),l=0;l<c.length;l++){var a=c[l],i=R(a,["tfhd"])[0],x=D(i,4),b=g[x];if(!b)continue;var m=b.default,L=D(i,0)|(m==null?void 0:m.flags),C=m==null?void 0:m.duration;L&8&&(L&2?C=D(i,12):C=D(i,8));for(var H=b.timescale||9e4,J=R(a,["trun"]),W=0;W<J.length;W++){if(C){var j=D(J[W],4);f=C*j}else f=d(J[W]);b.type===N.ElementaryStreamTypes.VIDEO?w+=f/H:b.type===N.ElementaryStreamTypes.AUDIO&&(v+=f/H)}}if(w===0&&v===0){var $=P(T);if($!=null&&$.references)return $.references.reduce(function(se,me){return se+me.info.duration||0},0)}return w||v}function d(T){var g=D(T,0),f=8;g&1&&(f+=4),g&4&&(f+=4);for(var w=0,v=D(T,4),c=0;c<v;c++){if(g&256){var l=D(T,f);w+=l,f+=4}g&512&&(f+=4),g&1024&&(f+=4),g&2048&&(f+=4)}return w}function s(T,g,f){R(g,["moof","traf"]).forEach(function(w){R(w,["tfhd"]).forEach(function(v){var c=D(v,4),l=T[c];if(!l)return;var a=l.timescale||9e4;R(w,["tfdt"]).forEach(function(i){var x=i.data[i.start],b=D(i,4);if(x===0)E(i,4,b-f*a);else{b*=Math.pow(2,32),b+=D(i,8),b-=f*a,b=Math.max(b,0);var m=Math.floor(b/(O+1)),L=Math.floor(b%(O+1));E(i,4,m),E(i,8,L)}})})})}function u(T){var g={valid:null,remainder:null},f=R(T,["moof"]);if(f){if(f.length<2)return g.remainder=T,g}else return g;var w=f[f.length-1];return g.valid=Object(Q.sliceUint8)(T,0,w.start-8),g.remainder=Object(Q.sliceUint8)(T,w.start-8),g}function h(T,g){var f=new Uint8Array(T.length+g.length);return f.set(T),f.set(g,T.length),f}},"./src/utils/output-filter.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"default",function(){return Q});var Q=function(){function N(U,B){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=U,this.trackName=B}var O=N.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(B,I,D){(this.startTime===null||this.startTime>B)&&(this.startTime=B),this.endTime=I,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"sendAddTrackEvent",function(){return N}),k.d(X,"addCueToTrack",function(){return O}),k.d(X,"clearCurrentCues",function(){return U}),k.d(X,"removeCuesInRange",function(){return B}),k.d(X,"getCuesInRange",function(){return D});var Q=k("./src/utils/logger.ts");function N(E,R){var P;try{P=new Event("addtrack")}catch(_){P=document.createEvent("Event"),P.initEvent("addtrack",!1,!1)}P.track=E,R.dispatchEvent(P)}function O(E,R){var P=E.mode;if(P==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(R.id))try{if(E.addCue(R),!E.cues.getCueById(R.id))throw new Error("addCue is failed for: "+R)}catch(S){Q.logger.debug("[texttrack-utils]: "+S);var _=new self.TextTrackCue(R.startTime,R.endTime,R.text);_.id=R.id,E.addCue(_)}P==="disabled"&&(E.mode=P)}function U(E){var R=E.mode;if(R==="disabled"&&(E.mode="hidden"),E.cues)for(var P=E.cues.length;P--;)E.removeCue(E.cues[P]);R==="disabled"&&(E.mode=R)}function B(E,R,P){var _=E.mode;if(_==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var S=D(E.cues,R,P),y=0;y<S.length;y++)E.removeCue(S[y]);_==="disabled"&&(E.mode=_)}function I(E,R){if(R<E[0].startTime)return 0;var P=E.length-1;if(R>E[P].endTime)return-1;for(var _=0,S=P;_<=S;){var y=Math.floor((S+_)/2);if(R<E[y].startTime)S=y-1;else if(R>E[y].startTime&&_<P)_=y+1;else return y}return E[_].startTime-R<R-E[S].startTime?_:S}function D(E,R,P){var _=[],S=I(E,R);if(S>-1)for(var y=S,d=E.length;y<d;y++){var s=E[y];if(s.startTime>=R&&s.endTime<=P)_.push(s);else if(s.startTime>P)return _}return _}},"./src/utils/time-ranges.ts":function(ee,X,k){"use strict";k.r(X);var Q={toString:function(O){for(var U="",B=O.length,I=0;I<B;I++)U+="["+O.start(I).toFixed(3)+","+O.end(I).toFixed(3)+"]";return U}};X.default=Q},"./src/utils/timescale-conversion.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"toTimescaleFromBase",function(){return N}),k.d(X,"toTimescaleFromScale",function(){return O}),k.d(X,"toMsFromMpegTsClock",function(){return U}),k.d(X,"toMpegTsClockFromTimescale",function(){return B});var Q=9e4;function N(I,D,E,R){E===void 0&&(E=1),R===void 0&&(R=!1);var P=I*D*E;return R?Math.round(P):P}function O(I,D,E,R){return E===void 0&&(E=1),R===void 0&&(R=!1),N(I,D,1/E,R)}function U(I,D){return D===void 0&&(D=!1),N(I,1e3,1/Q,D)}function B(I,D){return D===void 0&&(D=1),N(I,Q,1/D)}},"./src/utils/typed-array.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"sliceUint8",function(){return Q});function Q(N,O,U){return Uint8Array.prototype.slice?N.slice(O,U):new Uint8Array(Array.prototype.slice.call(N,O,U))}},"./src/utils/vttcue.ts":function(ee,X,k){"use strict";k.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Q=["","lr","rl"],N=["start","middle","end","left","right"];function O(E,R){if(typeof R!="string")return!1;if(!Array.isArray(E))return!1;var P=R.toLowerCase();return~E.indexOf(P)?P:!1}function U(E){return O(Q,E)}function B(E){return O(N,E)}function I(E){for(var R=arguments.length,P=new Array(R>1?R-1:0),_=1;_<R;_++)P[_-1]=arguments[_];for(var S=1;S<arguments.length;S++){var y=arguments[S];for(var d in y)E[d]=y[d]}return E}function D(E,R,P){var _=this,S={enumerable:!0};_.hasBeenReset=!1;var y="",d=!1,s=E,u=R,h=P,T=null,g="",f=!0,w="auto",v="start",c=50,l="middle",a=50,i="middle";Object.defineProperty(_,"id",I({},S,{get:function(){return y},set:function(b){y=""+b}})),Object.defineProperty(_,"pauseOnExit",I({},S,{get:function(){return d},set:function(b){d=!!b}})),Object.defineProperty(_,"startTime",I({},S,{get:function(){return s},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");s=b,this.hasBeenReset=!0}})),Object.defineProperty(_,"endTime",I({},S,{get:function(){return u},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");u=b,this.hasBeenReset=!0}})),Object.defineProperty(_,"text",I({},S,{get:function(){return h},set:function(b){h=""+b,this.hasBeenReset=!0}})),Object.defineProperty(_,"region",I({},S,{get:function(){return T},set:function(b){T=b,this.hasBeenReset=!0}})),Object.defineProperty(_,"vertical",I({},S,{get:function(){return g},set:function(b){var m=U(b);if(m===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=m,this.hasBeenReset=!0}})),Object.defineProperty(_,"snapToLines",I({},S,{get:function(){return f},set:function(b){f=!!b,this.hasBeenReset=!0}})),Object.defineProperty(_,"line",I({},S,{get:function(){return w},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=b,this.hasBeenReset=!0}})),Object.defineProperty(_,"lineAlign",I({},S,{get:function(){return v},set:function(b){var m=B(b);if(!m)throw new SyntaxError("An invalid or illegal string was specified.");v=m,this.hasBeenReset=!0}})),Object.defineProperty(_,"position",I({},S,{get:function(){return c},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");c=b,this.hasBeenReset=!0}})),Object.defineProperty(_,"positionAlign",I({},S,{get:function(){return l},set:function(b){var m=B(b);if(!m)throw new SyntaxError("An invalid or illegal string was specified.");l=m,this.hasBeenReset=!0}})),Object.defineProperty(_,"size",I({},S,{get:function(){return a},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");a=b,this.hasBeenReset=!0}})),Object.defineProperty(_,"align",I({},S,{get:function(){return i},set:function(b){var m=B(b);if(!m)throw new SyntaxError("An invalid or illegal string was specified.");i=m,this.hasBeenReset=!0}})),_.displayState=void 0}return D.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"parseTimeStamp",function(){return O}),k.d(X,"fixLineBreaks",function(){return R}),k.d(X,"VTTParser",function(){return P});var Q=k("./src/utils/vttcue.ts"),N=function(){function _(){}var S=_.prototype;return S.decode=function(d,s){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},_}();function O(_){function S(d,s,u,h){return(d|0)*3600+(s|0)*60+(u|0)+parseFloat(h||0)}var y=_.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return y?parseFloat(y[2])>59?S(y[2],y[3],0,y[4]):S(y[1],y[2],y[3],y[4]):null}var U=function(){function _(){this.values=Object.create(null)}var S=_.prototype;return S.set=function(d,s){!this.get(d)&&s!==""&&(this.values[d]=s)},S.get=function(d,s,u){return u?this.has(d)?this.values[d]:s[u]:this.has(d)?this.values[d]:s},S.has=function(d){return d in this.values},S.alt=function(d,s,u){for(var h=0;h<u.length;++h)if(s===u[h]){this.set(d,s);break}},S.integer=function(d,s){/^-?\d+$/.test(s)&&this.set(d,parseInt(s,10))},S.percent=function(d,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var u=parseFloat(s);if(u>=0&&u<=100)return this.set(d,u),!0}return!1},_}();function B(_,S,y,d){var s=d?_.split(d):[_];for(var u in s){if(typeof s[u]!="string")continue;var h=s[u].split(y);if(h.length!==2)continue;var T=h[0],g=h[1];S(T,g)}}var I=new Q.default(0,0,""),D=I.align==="middle"?"middle":"center";function E(_,S,y){var d=_;function s(){var T=O(_);if(T===null)throw new Error("Malformed timestamp: "+d);return _=_.replace(/^[^\sa-zA-Z-]+/,""),T}function u(T,g){var f=new U;B(T,function(c,l){var a;switch(c){case"region":for(var i=y.length-1;i>=0;i--)if(y[i].id===l){f.set(c,y[i].region);break}break;case"vertical":f.alt(c,l,["rl","lr"]);break;case"line":a=l.split(","),f.integer(c,a[0]),f.percent(c,a[0])&&f.set("snapToLines",!1),f.alt(c,a[0],["auto"]),a.length===2&&f.alt("lineAlign",a[1],["start",D,"end"]);break;case"position":a=l.split(","),f.percent(c,a[0]),a.length===2&&f.alt("positionAlign",a[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":f.percent(c,l);break;case"align":f.alt(c,l,["start",D,"end","left","right"]);break}},/:/,/\s/),g.region=f.get("region",null),g.vertical=f.get("vertical","");var w=f.get("line","auto");w==="auto"&&I.line===-1&&(w=-1),g.line=w,g.lineAlign=f.get("lineAlign","start"),g.snapToLines=f.get("snapToLines",!0),g.size=f.get("size",100),g.align=f.get("align",D);var v=f.get("position","auto");v==="auto"&&I.position===50&&(v=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=v}function h(){_=_.replace(/^\s+/,"")}if(h(),S.startTime=s(),h(),_.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);_=_.substr(3),h(),S.endTime=s(),h(),u(_,S)}function R(_){return _.replace(/<br(?: \/)?>/gi,`
|
|
`)}var P=function(){function _(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var S=_.prototype;return S.parse=function(d){var s=this;d&&(s.buffer+=s.decoder.decode(d,{stream:!0}));function u(){var v=s.buffer,c=0;for(v=R(v);c<v.length&&v[c]!=="\r"&&v[c]!==`
|
|
`;)++c;var l=v.substr(0,c);return v[c]==="\r"&&++c,v[c]===`
|
|
`&&++c,s.buffer=v.substr(c),l}function h(v){B(v,function(c,l){},/:/)}try{var T="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;T=u();var g=T.match(/^()?WEBVTT([ \t].*)?$/);if(!g||!g[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var f=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;f?f=!1:T=u();switch(s.state){case"HEADER":/:/.test(T)?h(T):T||(s.state="ID");continue;case"NOTE":T||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){s.state="NOTE";break}if(!T)continue;if(s.cue=new Q.default(0,0,""),s.state="CUE",T.indexOf("-->")===-1){s.cue.id=T;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{E(T,s.cue,s.regionList)}catch(v){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var w=T.indexOf("-->")!==-1;if(!T||w&&(f=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
|
|
`),s.cue.text+=T}continue;case"BADCUE":T||(s.state="ID")}}}catch(v){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},S.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=`
|
|
|
|
`,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){d.onparsingerror&&d.onparsingerror(s)}return d.onflush&&d.onflush(),this},_}()},"./src/utils/webvtt-parser.ts":function(ee,X,k){"use strict";k.r(X),k.d(X,"generateCueId",function(){return P}),k.d(X,"parseWebVTT",function(){return S});var Q=k("./src/polyfills/number.ts"),N=k("./src/utils/vttparser.ts"),O=k("./src/demux/id3.ts"),U=k("./src/utils/timescale-conversion.ts"),B=k("./src/remux/mp4-remuxer.ts"),I=/\r\n|\n\r|\n|\r/g,D=function(d,s,u){return u===void 0&&(u=0),d.substr(u,s.length)===s},E=function(d){var s=parseInt(d.substr(-3)),u=parseInt(d.substr(-6,2)),h=parseInt(d.substr(-9,2)),T=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(Q.isFiniteNumber)(s)||!Object(Q.isFiniteNumber)(u)||!Object(Q.isFiniteNumber)(h)||!Object(Q.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return s+=1e3*u,s+=60*1e3*h,s+=60*60*1e3*T,s},R=function(d){for(var s=5381,u=d.length;u;)s=s*33^d.charCodeAt(--u);return(s>>>0).toString()};function P(y,d,s){return R(y.toString())+R(d.toString())+R(s)}var _=function(d,s,u){var h=d[s],T=d[h.prevCC];if(!T||!T.new&&h.new){d.ccOffset=d.presentationOffset=h.start,h.new=!1;return}for(;(g=T)!==null&&g!==void 0&&g.new;){var g;d.ccOffset+=h.start-T.start,h.new=!1,h=T,T=d[h.prevCC]}d.presentationOffset=u};function S(y,d,s,u,h,T,g,f){var w=new N.VTTParser,v=Object(O.utf8ArrayToStr)(new Uint8Array(y)).trim().replace(I,`
|
|
`).split(`
|
|
`),c=[],l=Object(U.toMpegTsClockFromTimescale)(d,s),a="00:00.000",i=0,x=0,b,m=!0,L=!1;w.oncue=function(C){var H=u[h],J=u.ccOffset,W=(i-l)/9e4;if(H!=null&&H.new&&(x!==void 0?J=u.ccOffset=H.start:_(u,h,W)),W&&(J=W-u.presentationOffset),L){var j=C.endTime-C.startTime,$=Object(B.normalizePts)((C.startTime+J-x)*9e4,T*9e4)/9e4;C.startTime=$,C.endTime=$+j}var se=C.text.trim();C.text=decodeURIComponent(encodeURIComponent(se)),C.id||(C.id=P(C.startTime,C.endTime,se)),C.endTime>0&&c.push(C)},w.onparsingerror=function(C){b=C},w.onflush=function(){if(b){f(b);return}g(c)},v.forEach(function(C){if(m)if(D(C,"X-TIMESTAMP-MAP=")){m=!1,L=!0,C.substr(16).split(",").forEach(function(H){D(H,"LOCAL:")?a=H.substr(6):D(H,"MPEGTS:")&&(i=parseInt(H.substr(7)))});try{x=E(a)/1e3}catch(H){L=!1,b=H}return}else C===""&&(m=!1);w.parse(C+`
|
|
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(ee,X,k){"use strict";k.r(X);var Q=k("./src/utils/logger.ts"),N=k("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,U=function(){function B(D){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=D?D.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var I=B.prototype;return I.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},I.abortInternal=function(){var E=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),E&&(E.onreadystatechange=null,E.onprogress=null,E.readyState!==4&&(this.stats.aborted=!0,E.abort()))},I.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},I.load=function(E,R,P){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=E,this.config=R,this.callbacks=P,this.retryDelay=R.retryDelay,this.loadInternal()},I.loadInternal=function(){var E=this.config,R=this.context;if(!E)return;var P=this.loader=new self.XMLHttpRequest,_=this.stats;_.loading.first=0,_.loaded=0;var S=this.xhrSetup;try{if(S)try{S(P,R.url)}catch(s){P.open("GET",R.url,!0),S(P,R.url)}P.readyState||P.open("GET",R.url,!0);var y=this.context.headers;if(y)for(var d in y)P.setRequestHeader(d,y[d])}catch(s){this.callbacks.onError({code:P.status,text:s.message},R,P);return}R.rangeEnd&&P.setRequestHeader("Range","bytes="+R.rangeStart+"-"+(R.rangeEnd-1)),P.onreadystatechange=this.readystatechange.bind(this),P.onprogress=this.loadprogress.bind(this),P.responseType=R.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),P.send()},I.readystatechange=function(){var E=this.context,R=this.loader,P=this.stats;if(!E||!R)return;var _=R.readyState,S=this.config;if(P.aborted)return;if(_>=2)if(self.clearTimeout(this.requestTimeout),P.loading.first===0&&(P.loading.first=Math.max(self.performance.now(),P.loading.start)),_===4){R.onreadystatechange=null,R.onprogress=null;var y=R.status;if(y>=200&&y<300){P.loading.end=Math.max(self.performance.now(),P.loading.first);var d,s;if(E.responseType==="arraybuffer"?(d=R.response,s=d.byteLength):(d=R.responseText,s=d.length),P.loaded=P.total=s,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(P,E,d,R),!this.callbacks)return;var h={url:R.responseURL,data:d};this.callbacks.onSuccess(h,P,E,R)}else P.retry>=S.maxRetry||y>=400&&y<499?(Q.logger.error(y+" while loading "+E.url),this.callbacks.onError({code:y,text:R.statusText},E,R)):(Q.logger.warn(y+" while loading "+E.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,S.maxRetryDelay),P.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),S.timeout)},I.loadtimeout=function(){Q.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},I.loadprogress=function(E){var R=this.stats;R.loaded=E.loaded,E.lengthComputable&&(R.total=E.total)},I.getCacheAge=function(){var E=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var R=this.loader.getResponseHeader("age");E=R?parseFloat(R):null}return E},B}();X.default=U}}).default})},vHTk:function($e,ke,F){$e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function($e,ke,F){"use strict";F.d(ke,"a",function(){return gt});var ee=F("rePB"),X=F("VTBJ"),k=F("KQm4"),Q=F("U8pU"),N=F("ODXe"),O=F("q1tI"),U=F("TSYQ"),B=F.n(U),I=F("Gytx"),D=F.n(I),E=F("Kwbf"),R=F("t23M"),P=F("qx4F"),_=F("6eGT"),S=F("IBYe"),y=F("Ff2n"),d=F("c+Xe"),s=F("fyJ8"),u=F("biw7");function h(_e,Se,Je,nt,Fe){var qe=Je[_e]||{},xe=Je[Se]||{},he,ge;qe.fixed==="left"?he=nt.left[_e]:xe.fixed==="right"&&(ge=nt.right[Se]);var re=!1,ie=!1,oe=!1,ue=!1,Oe=Je[Se+1],we=Je[_e-1];if(Fe==="rtl"){if(he!==void 0){var rt=we&&we.fixed==="left";ue=!rt}else if(ge!==void 0){var yt=Oe&&Oe.fixed==="right";oe=!yt}}else if(he!==void 0){var wt=Oe&&Oe.fixed==="left";re=!wt}else if(ge!==void 0){var xt=we&&we.fixed==="right";ie=!xt}return{fixLeft:he,fixRight:ge,lastFixLeft:re,firstFixRight:ie,lastFixRight:oe,firstFixLeft:ue,isSticky:nt.isSticky}}var T=F("sR1s");function g(_e){var Se=_e.cells,Je=_e.stickyOffsets,nt=_e.flattenColumns,Fe=_e.rowComponent,qe=_e.cellComponent,xe=_e.onHeaderRow,he=_e.index,ge=O.useContext(u.a),re=ge.prefixCls,ie=ge.direction,oe;xe&&(oe=xe(Se.map(function(Oe){return Oe.column}),he));var ue=Object(T.a)(Se.map(function(Oe){return Oe.column}));return O.createElement(Fe,Object.assign({},oe),Se.map(function(Oe,we){var rt=Oe.column,yt=h(Oe.colStart,Oe.colEnd,nt,Je,ie),wt;return rt&&rt.onHeaderCell&&(wt=Oe.column.onHeaderCell(rt)),O.createElement(s.a,Object.assign({},Oe,{ellipsis:rt.ellipsis,align:rt.align,component:qe,prefixCls:re,key:ue[we]},yt,{additionalProps:wt,rowType:"header"}))}))}g.displayName="HeaderRow";var f=g;function w(_e){var Se=[];function Je(xe,he){var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Se[ge]=Se[ge]||[];var re=he,ie=xe.filter(Boolean).map(function(oe){var ue={key:oe.key,className:oe.className||"",children:oe.title,column:oe,colStart:re},Oe=1,we=oe.children;return we&&we.length>0&&(Oe=Je(we,re,ge+1).reduce(function(rt,yt){return rt+yt},0),ue.hasSubColumns=!0),"colSpan"in oe&&(Oe=oe.colSpan),"rowSpan"in oe&&(ue.rowSpan=oe.rowSpan),ue.colSpan=Oe,ue.colEnd=ue.colStart+Oe-1,Se[ge].push(ue),re+=Oe,Oe});return ie}Je(_e,0);for(var nt=Se.length,Fe=function(he){Se[he].forEach(function(ge){!("rowSpan"in ge)&&!ge.hasSubColumns&&(ge.rowSpan=nt-he)})},qe=0;qe<nt;qe+=1)Fe(qe);return Se}function v(_e){var Se=_e.stickyOffsets,Je=_e.columns,nt=_e.flattenColumns,Fe=_e.onHeaderRow,qe=O.useContext(u.a),xe=qe.prefixCls,he=qe.getComponent,ge=O.useMemo(function(){return w(Je)},[Je]),re=he(["header","wrapper"],"thead"),ie=he(["header","row"],"tr"),oe=he(["header","cell"],"th");return O.createElement(re,{className:"".concat(xe,"-thead")},ge.map(function(ue,Oe){var we=O.createElement(f,{key:Oe,flattenColumns:nt,cells:ue,stickyOffsets:Se,rowComponent:ie,cellComponent:oe,onHeaderRow:Fe,index:Oe});return we}))}var c=v,l=F("hW8S");function a(_e){for(var Se=_e.colWidths,Je=_e.columns,nt=_e.columCount,Fe=[],qe=nt||Je.length,xe=!1,he=qe-1;he>=0;he-=1){var ge=Se[he],re=Je&&Je[he],ie=re&&re[l.a];(ge||ie||xe)&&(Fe.unshift(O.createElement("col",Object.assign({key:he,style:{width:ge,minWidth:ge}},ie))),xe=!0)}return O.createElement("colgroup",null,Fe)}var i=a;function x(_e,Se){return Object(O.useMemo)(function(){for(var Je=[],nt=0;nt<Se;nt+=1){var Fe=_e[nt];if(Fe!==void 0)Je[nt]=Fe;else return null}return Je},[_e.join("_"),Se])}var b=O.forwardRef(function(_e,Se){var Je=_e.noData,nt=_e.columns,Fe=_e.flattenColumns,qe=_e.colWidths,xe=_e.columCount,he=_e.stickyOffsets,ge=_e.direction,re=_e.fixHeader,ie=_e.offsetHeader,oe=_e.stickyClassName,ue=_e.onScroll,Oe=Object(y.a)(_e,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),we=O.useContext(u.a),rt=we.prefixCls,yt=we.scrollbarSize,wt=we.isSticky,xt=wt&&!re?0:yt,pt=O.useRef(null),Qe=O.useCallback(function(Xe){Object(d.b)(Se,Xe),Object(d.b)(pt,Xe)},[]);O.useEffect(function(){var Xe;function dt(Pe){var at=Pe.currentTarget,vt=Pe.deltaX;vt&&(ue({currentTarget:at,scrollLeft:at.scrollLeft+vt}),Pe.preventDefault())}return(Xe=pt.current)===null||Xe===void 0||Xe.addEventListener("wheel",dt),function(){var Pe;(Pe=pt.current)===null||Pe===void 0||Pe.removeEventListener("wheel",dt)}},[]);var ze=Fe[Fe.length-1],De={fixed:ze?ze.fixed:null,onHeaderCell:function(){return{className:"".concat(rt,"-cell-scrollbar")}}},ae=Object(O.useMemo)(function(){return xt?[].concat(Object(k.a)(nt),[De]):nt},[xt,nt]),de=Object(O.useMemo)(function(){return xt?[].concat(Object(k.a)(Fe),[De]):Fe},[xt,Fe]),Ye=Object(O.useMemo)(function(){var Xe=he.right,dt=he.left;return Object(X.a)(Object(X.a)({},he),{},{left:ge==="rtl"?[].concat(Object(k.a)(dt.map(function(Pe){return Pe+xt})),[0]):dt,right:ge==="rtl"?Xe:[].concat(Object(k.a)(Xe.map(function(Pe){return Pe+xt})),[0]),isSticky:wt})},[xt,he,wt]),Me=x(qe,xe);return O.createElement("div",{style:Object(X.a)({overflow:"hidden"},wt?{top:ie}:{}),ref:Qe,className:B()("".concat(rt,"-header"),Object(ee.a)({},oe,!!oe))},O.createElement("table",{style:{tableLayout:"fixed",visibility:Je||Me?null:"hidden"}},O.createElement(i,{colWidths:Me?[].concat(Object(k.a)(Me),[xt]):[],columCount:xe+1,columns:de}),O.createElement(c,Object.assign({},Oe,{stickyOffsets:Ye,columns:ae,flattenColumns:de}))))});b.displayName="FixedHeader";var m=b,L=O.createContext(null),C=L;function H(_e){var Se=_e.prefixCls,Je=_e.children,nt=_e.component,Fe=_e.cellComponent,qe=_e.fixHeader,xe=_e.fixColumn,he=_e.horizonScroll,ge=_e.className,re=_e.expanded,ie=_e.componentWidth,oe=_e.colSpan,ue=O.useContext(u.a),Oe=ue.scrollbarSize;return O.useMemo(function(){var we=Je;return xe&&(we=O.createElement("div",{style:{width:ie-(qe?Oe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Se,"-expanded-row-fixed")},we)),O.createElement(nt,{className:ge,style:{display:re?null:"none"}},O.createElement(s.a,{component:Fe,prefixCls:Se,colSpan:oe},we))},[Je,nt,qe,he,ge,re,ie,oe,Oe])}var J=H;function W(_e){var Se=_e.className,Je=_e.style,nt=_e.record,Fe=_e.index,qe=_e.rowKey,xe=_e.getRowKey,he=_e.rowExpandable,ge=_e.expandedKeys,re=_e.onRow,ie=_e.indent,oe=ie===void 0?0:ie,ue=_e.rowComponent,Oe=_e.cellComponent,we=_e.childrenColumnName,rt=O.useContext(u.a),yt=rt.prefixCls,wt=rt.fixedInfoList,xt=O.useContext(C),pt=xt.fixHeader,Qe=xt.fixColumn,ze=xt.horizonScroll,De=xt.componentWidth,ae=xt.flattenColumns,de=xt.expandableType,Ye=xt.expandRowByClick,Me=xt.onTriggerExpand,Xe=xt.rowClassName,dt=xt.expandedRowClassName,Pe=xt.indentSize,at=xt.expandIcon,vt=xt.expandedRowRender,St=xt.expandIconColumnIndex,Rt=O.useState(!1),qt=Object(N.a)(Rt,2),sn=qt[0],Xt=qt[1],_t=ge&&ge.has(_e.recordKey);O.useEffect(function(){_t&&Xt(!0)},[_t]);var cn=de==="row"&&(!he||he(nt)),zt=de==="nest",$t=we&&nt&&nt[we],Nt=cn||zt,nn;re&&(nn=re(nt,Fe));var An=function(p){if(Ye&&Nt&&Me(nt,p),nn&&nn.onClick){for(var A,K=arguments.length,Y=new Array(K>1?K-1:0),V=1;V<K;V++)Y[V-1]=arguments[V];(A=nn).onClick.apply(A,[p].concat(Y))}},Tn;typeof Xe=="string"?Tn=Xe:typeof Xe=="function"&&(Tn=Xe(nt,Fe,oe));var ct=Object(T.a)(ae),Gt=O.createElement(ue,Object.assign({},nn,{"data-row-key":qe,className:B()(Se,"".concat(yt,"-row"),"".concat(yt,"-row-level-").concat(oe),Tn,nn&&nn.className),style:Object(X.a)(Object(X.a)({},Je),nn?nn.style:null),onClick:An}),ae.map(function(G,p){var A=G.render,K=G.dataIndex,Y=G.className,V=ct[p],Ae=wt[p],it;p===(St||0)&&zt&&(it=O.createElement(O.Fragment,null,O.createElement("span",{style:{paddingLeft:"".concat(Pe*oe,"px")},className:"".concat(yt,"-row-indent indent-level-").concat(oe)}),at({prefixCls:yt,expanded:_t,expandable:$t,record:nt,onExpand:Me})));var Tt;return G.onCell&&(Tt=G.onCell(nt,Fe)),O.createElement(s.a,Object.assign({className:Y,ellipsis:G.ellipsis,align:G.align,component:Oe,prefixCls:yt,key:V,record:nt,index:Fe,dataIndex:K,render:A,shouldCellUpdate:G.shouldCellUpdate},Ae,{appendNode:it,additionalProps:Tt}))})),Ln;if(cn&&(sn||_t)){var Fn=vt(nt,Fe,oe+1,_t),kn=dt&&dt(nt,Fe,oe);Ln=O.createElement(J,{expanded:_t,className:B()("".concat(yt,"-expanded-row"),"".concat(yt,"-expanded-row-level-").concat(oe+1),kn),prefixCls:yt,fixHeader:pt,fixColumn:Qe,horizonScroll:ze,component:ue,componentWidth:De,cellComponent:Oe,colSpan:ae.length},Fn)}var Xn;return $t&&_t&&(Xn=(nt[we]||[]).map(function(G,p){var A=xe(G,p);return O.createElement(W,Object.assign({},_e,{key:A,rowKey:A,record:G,recordKey:A,index:p,indent:oe+1}))})),O.createElement(O.Fragment,null,Gt,Ln,Xn)}W.displayName="BodyRow";var j=W,$=O.createContext(null),se=$;function me(_e){var Se=_e.columnKey,Je=_e.onColumnResize,nt=O.useRef();return O.useEffect(function(){nt.current&&Je(Se,nt.current.offsetWidth)},[]),O.createElement(R.a,{onResize:function(qe){var xe=qe.offsetWidth;Je(Se,xe)}},O.createElement("td",{ref:nt,style:{padding:0,border:0,height:0}},O.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Ee(_e){var Se=_e.data,Je=_e.getRowKey,nt=_e.measureColumnWidth,Fe=_e.expandedKeys,qe=_e.onRow,xe=_e.rowExpandable,he=_e.emptyNode,ge=_e.childrenColumnName,re=O.useContext(se),ie=re.onColumnResize,oe=O.useContext(u.a),ue=oe.prefixCls,Oe=oe.getComponent,we=O.useContext(C),rt=we.fixHeader,yt=we.horizonScroll,wt=we.flattenColumns,xt=we.componentWidth;return O.useMemo(function(){var pt=Oe(["body","wrapper"],"tbody"),Qe=Oe(["body","row"],"tr"),ze=Oe(["body","cell"],"td"),De;Se.length?De=Se.map(function(de,Ye){var Me=Je(de,Ye);return O.createElement(j,{key:Me,rowKey:Me,record:de,recordKey:Me,index:Ye,rowComponent:Qe,cellComponent:ze,expandedKeys:Fe,onRow:qe,getRowKey:Je,rowExpandable:xe,childrenColumnName:ge})}):De=O.createElement(J,{expanded:!0,className:"".concat(ue,"-placeholder"),prefixCls:ue,fixHeader:rt,fixColumn:yt,horizonScroll:yt,component:Qe,componentWidth:xt,cellComponent:ze,colSpan:wt.length},he);var ae=Object(T.a)(wt);return O.createElement(pt,{className:"".concat(ue,"-tbody")},nt&&O.createElement("tr",{"aria-hidden":"true",className:"".concat(ue,"-measure-row"),style:{height:0}},ae.map(function(de){return O.createElement(me,{key:de,columnKey:de,onColumnResize:ie})})),De)},[Se,ue,qe,nt,Fe,Je,Oe,xt,he,wt])}var We=O.memo(Ee);We.displayName="Body";var Be=We,Ne=F("wRmb"),Le=F("xEkU"),Ue=F.n(Le);function ye(_e){var Se=Object(O.useRef)(_e),Je=Object(O.useState)({}),nt=Object(N.a)(Je,2),Fe=nt[1],qe=Object(O.useRef)(null),xe=Object(O.useRef)([]);function he(ge){qe.current===null&&(xe.current=[],qe.current=Ue()(function(){xe.current.forEach(function(re){Se.current=re(Se.current)}),qe.current=null,Fe({})})),xe.current.push(ge)}return Object(O.useEffect)(function(){return function(){Ue.a.cancel(qe.current)}},[]),[Se.current,he]}function ce(_e){var Se=Object(O.useRef)(_e),Je=Object(O.useRef)(null);function nt(){window.clearTimeout(Je.current)}function Fe(xe){Se.current=xe,nt(),Je.current=window.setTimeout(function(){Se.current=null,Je.current=null},100)}function qe(){return Se.current}return Object(O.useEffect)(function(){return nt},[]),[Fe,qe]}function ne(_e,Se,Je){var nt=Object(O.useMemo)(function(){for(var Fe=[],qe=[],xe=0,he=0,ge=0;ge<Se;ge+=1)if(Je==="rtl"){qe[ge]=he,he+=_e[ge]||0;var re=Se-ge-1;Fe[re]=xe,xe+=_e[re]||0}else{Fe[ge]=xe,xe+=_e[ge]||0;var ie=Se-ge-1;qe[ie]=he,he+=_e[ie]||0}return{left:Fe,right:qe}},[_e,Se,Je]);return nt}var ve=ne;function le(_e){var Se=_e.className,Je=_e.children;return O.createElement("div",{className:Se},Je)}var Re=le,Ie=F("n6Qo");function Ce(_e){var Se,Je=_e.prefixCls,nt=_e.record,Fe=_e.onExpand,qe=_e.expanded,xe=_e.expandable,he="".concat(Je,"-row-expand-icon");if(!xe)return O.createElement("span",{className:B()(he,"".concat(Je,"-row-spaced"))});var ge=function(ie){Fe(nt,ie),ie.stopPropagation()};return O.createElement("span",{className:B()(he,(Se={},Object(ee.a)(Se,"".concat(Je,"-row-expanded"),qe),Object(ee.a)(Se,"".concat(Je,"-row-collapsed"),!qe),Se)),onClick:ge})}function He(_e,Se,Je){var nt=[];function Fe(qe){(qe||[]).forEach(function(xe,he){nt.push(Se(xe,he)),Fe(xe[Je])})}return Fe(_e),nt}var Ze=F("zT1h"),ot=F("y0+3"),et=function(Se,Je){var nt,Fe,qe=Se.scrollBodyRef,xe=Se.onScroll,he=Se.offsetScroll,ge=O.useContext(u.a),re=ge.prefixCls,ie=((nt=qe.current)===null||nt===void 0?void 0:nt.scrollWidth)||0,oe=((Fe=qe.current)===null||Fe===void 0?void 0:Fe.clientWidth)||0,ue=ie&&oe*(oe/ie),Oe=O.useRef(),we=ye({scrollLeft:0,isHiddenScrollBar:!1}),rt=Object(N.a)(we,2),yt=rt[0],wt=rt[1],xt=O.useRef({delta:0,x:0}),pt=O.useState(!1),Qe=Object(N.a)(pt,2),ze=Qe[0],De=Qe[1],ae=function(){De(!1)},de=function(Pe){Pe.persist(),xt.current.delta=Pe.pageX-yt.scrollLeft,xt.current.x=0,De(!0),Pe.preventDefault()},Ye=function(Pe){var at,vt=Pe||((at=window)===null||at===void 0?void 0:at.event),St=vt.buttons;if(!ze||St===0){ze&&De(!1);return}var Rt=xt.current.x+Pe.pageX-xt.current.x-xt.current.delta;Rt<=0&&(Rt=0),Rt+ue>=oe&&(Rt=oe-ue),xe({scrollLeft:Rt/oe*(ie+2)}),xt.current.x=Pe.pageX},Me=function(){var Pe=Object(ot.b)(qe.current).top,at=Pe+qe.current.offsetHeight,vt=document.documentElement.scrollTop+window.innerHeight;at-Object(P.a)()<=vt||Pe>=vt-he?wt(function(St){return Object(X.a)(Object(X.a)({},St),{},{isHiddenScrollBar:!0})}):wt(function(St){return Object(X.a)(Object(X.a)({},St),{},{isHiddenScrollBar:!1})})},Xe=function(Pe){wt(function(at){return Object(X.a)(Object(X.a)({},at),{},{scrollLeft:Pe/ie*oe||0})})};return O.useImperativeHandle(Je,function(){return{setScrollLeft:Xe}}),O.useEffect(function(){var dt=Object(Ze.a)(document.body,"mouseup",ae,!1),Pe=Object(Ze.a)(document.body,"mousemove",Ye,!1);return Me(),function(){dt.remove(),Pe.remove()}},[ue,ze]),O.useEffect(function(){var dt=Object(Ze.a)(window,"scroll",Me,!1),Pe=Object(Ze.a)(window,"resize",Me,!1);return function(){dt.remove(),Pe.remove()}},[]),O.useEffect(function(){yt.isHiddenScrollBar||wt(function(dt){var Pe,at;return Object(X.a)(Object(X.a)({},dt),{},{scrollLeft:qe.current.scrollLeft/((Pe=qe.current)===null||Pe===void 0?void 0:Pe.scrollWidth)*((at=qe.current)===null||at===void 0?void 0:at.clientWidth)})})},[yt.isHiddenScrollBar]),ie<=oe||!ue||yt.isHiddenScrollBar?null:O.createElement("div",{style:{height:Object(P.a)(),width:oe,bottom:he},className:"".concat(re,"-sticky-scroll")},O.createElement("div",{onMouseDown:de,ref:Oe,className:B()("".concat(re,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(re,"-sticky-scroll-bar-active"),ze)),style:{width:"".concat(ue,"px"),transform:"translate3d(".concat(yt.scrollLeft,"px, 0, 0)")}}))},Ke=O.forwardRef(et);function Ve(_e,Se){return O.useMemo(function(){var Je=!!_e;return{isSticky:Je,stickyClassName:Je?"".concat(Se,"-sticky-header"):"",offsetHeader:Object(Q.a)(_e)==="object"&&_e.offsetHeader||0,offsetScroll:Object(Q.a)(_e)==="object"&&_e.offsetScroll||0}},[_e,Se])}var ht=[],mt={},gt="rc-table-internal-hook",Et=O.memo(function(_e){var Se=_e.children;return Se},function(_e,Se){return D()(_e.props,Se.props)?_e.pingLeft!==Se.pingLeft||_e.pingRight!==Se.pingRight:!1});function ft(_e){var Se,Je=_e.prefixCls,nt=_e.className,Fe=_e.rowClassName,qe=_e.style,xe=_e.data,he=_e.rowKey,ge=_e.scroll,re=_e.tableLayout,ie=_e.direction,oe=_e.title,ue=_e.footer,Oe=_e.summary,we=_e.id,rt=_e.showHeader,yt=_e.components,wt=_e.emptyText,xt=_e.onRow,pt=_e.onHeaderRow,Qe=_e.internalHooks,ze=_e.transformColumns,De=_e.internalRefs,ae=_e.sticky,de=xe||ht,Ye=!!de.length,Me=O.useState(0),Xe=Object(N.a)(Me,2),dt=Xe[0],Pe=Xe[1];O.useEffect(function(){Pe(Object(P.a)())});var at=O.useMemo(function(){return Object(T.c)(yt,{})},[yt]),vt=O.useCallback(function(vn,mn){return Object(T.b)(at,vn)||mn},[at]),St=O.useMemo(function(){return typeof he=="function"?he:function(vn){var mn=vn&&vn[he];return mn}},[he]),Rt=Object(l.c)(_e),qt=Rt.expandIcon,sn=Rt.expandedRowKeys,Xt=Rt.defaultExpandedRowKeys,_t=Rt.defaultExpandAllRows,cn=Rt.expandedRowRender,zt=Rt.onExpand,$t=Rt.onExpandedRowsChange,Nt=Rt.expandRowByClick,nn=Rt.rowExpandable,An=Rt.expandIconColumnIndex,Tn=Rt.expandedRowClassName,ct=Rt.childrenColumnName,Gt=Rt.indentSize,Ln=qt||Ce,Fn=ct||"children",kn=O.useMemo(function(){return cn?"row":_e.expandable&&Qe===gt&&_e.expandable.__PARENT_RENDER_ICON__||de.some(function(vn){return vn&&Object(Q.a)(vn)==="object"&&vn[Fn]})?"nest":!1},[!!cn,de]),Xn=O.useState(function(){return Xt||(_t?He(de,St,Fn):[])}),G=Object(N.a)(Xn,2),p=G[0],A=G[1],K=O.useMemo(function(){return new Set(sn||p||[])},[sn,p]),Y=O.useCallback(function(vn){var mn=St(vn,de.indexOf(vn)),bn,Jn=K.has(mn);Jn?(K.delete(mn),bn=Object(k.a)(K)):bn=[].concat(Object(k.a)(K),[mn]),A(bn),zt&&zt(!Jn,vn),$t&&$t(bn)},[St,K,de,zt,$t]),V=O.useState(0),Ae=Object(N.a)(V,2),it=Ae[0],Tt=Ae[1],Bt=Object(Ne.b)(Object(X.a)(Object(X.a)(Object(X.a)({},_e),Rt),{},{expandable:!!cn,expandedKeys:K,getRowKey:St,onTriggerExpand:Y,expandIcon:Ln,expandIconColumnIndex:An,direction:ie}),Qe===gt?ze:null),fe=Object(N.a)(Bt,2),Ft=fe[0],Qt=fe[1],xn=O.useMemo(function(){return{columns:Ft,flattenColumns:Qt}},[Ft,Qt]),Hn=O.useRef(),ir=O.useRef(),Rn=O.useRef(),cr=O.useState(!1),gr=Object(N.a)(cr,2),Qn=gr[0],hr=gr[1],$n=O.useState(!1),kr=Object(N.a)($n,2),ar=kr[0],Ir=kr[1],Er=ye(new Map),Rr=Object(N.a)(Er,2),Qr=Rr[0],xr=Rr[1],or=Object(T.a)(Qt),Fr=or.map(function(vn){return Qr.get(vn)}),Pr=O.useMemo(function(){return Fr},[Fr.join("_")]),jr=ve(Pr,Qt.length,ie),En=ge&&Object(T.d)(ge.y),on=ge&&Object(T.d)(ge.x),Mn=on&&Qt.some(function(vn){var mn=vn.fixed;return mn}),hn=O.useRef(),On=Ve(ae,Je),fn=On.isSticky,_r=On.offsetHeader,In=On.offsetScroll,Yn=On.stickyClassName,zr,Wr,Or;En&&(Wr={overflowY:"scroll",maxHeight:ge.y}),on&&(zr={overflowX:"auto"},En||(Wr={overflowY:"hidden"}),Or={width:ge.x===!0?"auto":ge.x,minWidth:"100%"});var Yr=O.useCallback(function(vn,mn){xr(function(bn){var Jn=new Map(bn);return Jn.set(vn,mn),Jn})},[]),sr=ce(null),Hr=Object(N.a)(sr,2),Cr=Hr[0],Kr=Hr[1];function Jr(vn,mn){if(!mn)return;typeof mn=="function"?mn(vn):mn.scrollLeft!==vn&&(mn.scrollLeft=vn)}var lr=function(mn){var bn=mn.currentTarget,Jn=mn.scrollLeft,Zr=typeof Jn=="number"?Jn:bn.scrollLeft,Gr=bn||mt;if(!Kr()||Kr()===Gr){var qr;Cr(Gr),Jr(Zr,ir.current),Jr(Zr,Rn.current),Jr(Zr,(qr=hn.current)===null||qr===void 0?void 0:qr.setScrollLeft)}if(bn){var wi=bn.scrollWidth,zi=bn.clientWidth;hr(Zr>0),Ir(Zr<wi-zi)}},oi=function(){Rn.current&&lr({currentTarget:Rn.current})},si=function(mn){var bn=mn.width;oi(),Tt(Hn.current?Hn.current.offsetWidth:bn)};O.useEffect(function(){return oi},[]),O.useEffect(function(){on&&oi()},[on]),O.useEffect(function(){Qe===gt&&De&&(De.body.current=Rn.current)});var Ht=vt(["table"],"table"),en=O.useMemo(function(){return re||(Mn?ge.x==="max-content"?"auto":"fixed":En||Qt.some(function(vn){var mn=vn.ellipsis;return mn})?"fixed":"auto")},[En,Mn,Qt,re]),Vt,an={colWidths:Pr,columCount:Qt.length,stickyOffsets:jr,onHeaderRow:pt,fixHeader:En},pn=O.useMemo(function(){return Ye?null:typeof wt=="function"?wt():wt},[Ye,wt]),Cn=O.createElement(Be,{data:de,measureColumnWidth:En||on||fn,expandedKeys:K,rowExpandable:nn,getRowKey:St,onRow:xt,emptyNode:pn,childrenColumnName:Fn}),un=O.createElement(i,{colWidths:Qt.map(function(vn){var mn=vn.width;return mn}),columns:Qt}),Pn=Oe&&O.createElement(Ie.b,null,Oe(de)),Kn=vt(["body"]);if(En||fn){var It;typeof Kn=="function"?(It=Kn(de,{scrollbarSize:dt,ref:Rn,onScroll:lr}),an.colWidths=Qt.map(function(vn,mn){var bn=vn.width,Jn=mn===Ft.length-1?bn-dt:bn;return typeof Jn=="number"&&!Number.isNaN(Jn)?Jn:(Object(E.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):It=O.createElement("div",{style:Object(X.a)(Object(X.a)({},zr),Wr),onScroll:lr,ref:Rn,className:B()("".concat(Je,"-body"))},O.createElement(Ht,{style:Object(X.a)(Object(X.a)({},Or),{},{tableLayout:en})},un,Cn,Pn),fn&&O.createElement(Ke,{ref:hn,offsetScroll:In,scrollBodyRef:Rn,onScroll:lr})),Vt=O.createElement(O.Fragment,null,rt!==!1&&O.createElement(m,Object.assign({noData:!de.length},an,xn,{direction:ie,offsetHeader:_r,stickyClassName:Yn,ref:ir,onScroll:lr})),It)}else Vt=O.createElement("div",{style:Object(X.a)(Object(X.a)({},zr),Wr),className:B()("".concat(Je,"-content")),onScroll:lr,ref:Rn},O.createElement(Ht,{style:Object(X.a)(Object(X.a)({},Or),{},{tableLayout:en})},un,rt!==!1&&O.createElement(c,Object.assign({},an,xn)),Cn,Pn));var fr=Object(l.b)(_e),gn=O.createElement("div",Object.assign({className:B()(Je,nt,(Se={},Object(ee.a)(Se,"".concat(Je,"-rtl"),ie==="rtl"),Object(ee.a)(Se,"".concat(Je,"-ping-left"),Qn),Object(ee.a)(Se,"".concat(Je,"-ping-right"),ar),Object(ee.a)(Se,"".concat(Je,"-layout-fixed"),re==="fixed"),Object(ee.a)(Se,"".concat(Je,"-fixed-header"),En),Object(ee.a)(Se,"".concat(Je,"-fixed-column"),Mn),Object(ee.a)(Se,"".concat(Je,"-scroll-horizontal"),on),Object(ee.a)(Se,"".concat(Je,"-has-fix-left"),Qt[0]&&Qt[0].fixed),Object(ee.a)(Se,"".concat(Je,"-has-fix-right"),Qt[Qt.length-1]&&Qt[Qt.length-1].fixed==="right"),Se)),style:qe,id:we,ref:Hn},fr),O.createElement(Et,{pingLeft:Qn,pingRight:ar,props:Object(X.a)(Object(X.a)({},_e),{},{stickyOffsets:jr,mergedExpandedKeys:K})},oe&&O.createElement(Re,{className:"".concat(Je,"-title")},oe(de)),O.createElement("div",{className:"".concat(Je,"-container")},Vt),ue&&O.createElement(Re,{className:"".concat(Je,"-footer")},ue(de))));on&&(gn=O.createElement(R.a,{onResize:si},gn));var Bn=O.useMemo(function(){return{prefixCls:Je,getComponent:vt,scrollbarSize:dt,direction:ie,fixedInfoList:Qt.map(function(vn,mn){return h(mn,mn,Qt,jr,ie)}),isSticky:fn}},[Je,vt,dt,ie,Qt,jr,ie,fn]),rn=O.useMemo(function(){return Object(X.a)(Object(X.a)({},xn),{},{tableLayout:en,rowClassName:Fe,expandedRowClassName:Tn,componentWidth:it,fixHeader:En,fixColumn:Mn,horizonScroll:on,expandIcon:Ln,expandableType:kn,expandRowByClick:Nt,expandedRowRender:cn,onTriggerExpand:Y,expandIconColumnIndex:An,indentSize:Gt})},[xn,en,Fe,Tn,it,En,Mn,on,Ln,kn,Nt,cn,Y,An,Gt]),zn=O.useMemo(function(){return{onColumnResize:Yr}},[Yr]);return O.createElement(u.a.Provider,{value:Bn},O.createElement(C.Provider,{value:rn},O.createElement(se.Provider,{value:zn},gn)))}ft.Column=S.a,ft.ColumnGroup=_.a,ft.Summary=Ie.a,ft.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Ct=ke.b=ft},wRmb:function($e,ke,F){"use strict";F.d(ke,"a",function(){return D});var ee=F("rePB"),X=F("KQm4"),k=F("VTBJ"),Q=F("Ff2n"),N=F("q1tI"),O=F.n(N),U=F("Kwbf"),B=F("Zm9Q"),I=F("hW8S");function D(S){return Object(B.a)(S).filter(function(y){return N.isValidElement(y)}).map(function(y){var d=y.key,s=y.props,u=s.children,h=Object(Q.a)(s,["children"]),T=Object(k.a)({key:d},h);return u&&(T.children=D(u)),T})}function E(S){return S.reduce(function(y,d){var s=d.fixed,u=s===!0?"left":s,h=d.children;return h&&h.length>0?[].concat(Object(X.a)(y),Object(X.a)(E(h).map(function(T){return Object(k.a)({fixed:u},T)}))):[].concat(Object(X.a)(y),[Object(k.a)(Object(k.a)({},d),{},{fixed:u})])},[])}function R(S){for(var y=!0,d=0;d<S.length;d+=1){var s=S[d];if(y&&s.fixed!=="left")y=!1;else if(!y&&s.fixed==="left"){Object(U.a)(!1,"Index ".concat(d-1," of `columns` missing `fixed='left'` prop."));break}}for(var u=!0,h=S.length-1;h>=0;h-=1){var T=S[h];if(u&&T.fixed!=="right")u=!1;else if(!u&&T.fixed==="right"){Object(U.a)(!1,"Index ".concat(h+1," of `columns` missing `fixed='right'` prop."));break}}}function P(S){return S.map(function(y){var d=y.fixed,s=Object(Q.a)(y,["fixed"]),u=d;return d==="left"?u="right":d==="right"&&(u="left"),Object(k.a)({fixed:u},s)})}function _(S,y){var d=S.prefixCls,s=S.columns,u=S.children,h=S.expandable,T=S.expandedKeys,g=S.getRowKey,f=S.onTriggerExpand,w=S.expandIcon,v=S.rowExpandable,c=S.expandIconColumnIndex,l=S.direction,a=S.expandRowByClick,i=N.useMemo(function(){return s||D(u)},[s,u]),x=N.useMemo(function(){if(h){var L,C=c||0,H=i[C],J=(L={},Object(ee.a)(L,I.a,{className:"".concat(d,"-expand-icon-col")}),Object(ee.a)(L,"title",""),Object(ee.a)(L,"fixed",H?H.fixed:null),Object(ee.a)(L,"className","".concat(d,"-row-expand-icon-cell")),Object(ee.a)(L,"render",function($,se,me){var Ee=g(se,me),We=T.has(Ee),Be=v?v(se):!0,Ne=w({prefixCls:d,expanded:We,expandable:Be,record:se,onExpand:f});return a?N.createElement("span",{onClick:function(Ue){return Ue.stopPropagation()}},Ne):Ne}),L),W=i.slice();return C>=0&&W.splice(C,0,J),W}return i},[h,i,g,T,w,l]),b=N.useMemo(function(){var L=x;return y&&(L=y(L)),L.length||(L=[{render:function(){return null}}]),L},[y,x,l]),m=N.useMemo(function(){return l==="rtl"?P(E(b)):E(b)},[b,l]);return[b,m]}ke.b=_},"y0+3":function($e,ke,F){"use strict";F.d(ke,"a",function(){return E}),F.d(ke,"b",function(){return P});var ee=/margin|padding|width|height|max|min|offset/,X={left:!0,top:!0},k={cssFloat:1,styleFloat:1,float:1};function Q(_){return _.nodeType===1?_.ownerDocument.defaultView.getComputedStyle(_,null):{}}function N(_,S,y){if(S=S.toLowerCase(),y==="auto"){if(S==="height")return _.offsetHeight;if(S==="width")return _.offsetWidth}return S in X||(X[S]=ee.test(S)),X[S]?parseFloat(y)||0:y}function O(_,S){var y=arguments.length,d=Q(_);return S=k[S]?"cssFloat"in _.style?"cssFloat":"styleFloat":S,y===1?d:N(_,S,d[S]||_.style[S])}function U(_,S,y){var d=arguments.length;if(S=k[S]?"cssFloat"in _.style?"cssFloat":"styleFloat":S,d===3)return typeof y=="number"&&ee.test(S)&&(y="".concat(y,"px")),_.style[S]=y,y;for(var s in S)S.hasOwnProperty(s)&&U(_,s,S[s]);return Q(_)}function B(_){return _===document.body?document.documentElement.clientWidth:_.offsetWidth}function I(_){return _===document.body?window.innerHeight||document.documentElement.clientHeight:_.offsetHeight}function D(){var _=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),S=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:_,height:S}}function E(){var _=document.documentElement.clientWidth,S=window.innerHeight||document.documentElement.clientHeight;return{width:_,height:S}}function R(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function P(_){var S=_.getBoundingClientRect(),y=document.documentElement;return{left:S.left+(window.pageXOffset||y.scrollLeft)-(y.clientLeft||document.body.clientLeft||0),top:S.top+(window.pageYOffset||y.scrollTop)-(y.clientTop||document.body.clientTop||0)}}},yslc:function($e,ke){$e.exports="data:image/png;base64,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"}}]);
|