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.
NewEduCoderBuild/p__Classrooms__Lists__Exerc...

436 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[62,3,5,6,7,8,9,16],{"+NIl":function(Ke,Me,K){(function(q){q(K("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(z,N){"use strict";function V(d,r){d.cmdState.push(r)}function W(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function D(d){var r=d.cmdState.pop();r&&r.closeBracket()}function H(d){for(var r=d.cmdState,s=r.length-1;s>=0;s--){var o=r[s];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function F(d,r,s){return function(){this.name=d,this.bracketNo=0,this.style=r,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=F("importmodule","tag",["string","builtin"]),k.documentclass=F("documentclass","tag",["","atom"]),k.usepackage=F("usepackage","tag",["atom"]),k.begin=F("begin","tag",["atom"]),k.end=F("end","tag",["atom"]),k.label=F("label","tag",["atom"]),k.ref=F("ref","tag",["atom"]),k.eqref=F("eqref","tag",["atom"]),k.cite=F("cite","tag",["atom"]),k.bibitem=F("bibitem","tag",["atom"]),k.Bibitem=F("Bibitem","tag",["atom"]),k.RBibitem=F("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function T(d,r){d.f=r}function v(d,r){var s;if(d.match(/^\\[a-zA-Z@]+/)){var o=d.current().slice(1);return s=k.hasOwnProperty(o)?k[o]:k.DEFAULT,s=new s,V(r,s),T(r,c),s.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return T(r,function(l,h){return m(l,h,"\\]")}),"keyword";if(d.match("\\("))return T(r,function(l,h){return m(l,h,"\\)")}),"keyword";if(d.match("$$"))return T(r,function(l,h){return m(l,h,"$$")}),"keyword";if(d.match("$"))return T(r,function(l,h){return m(l,h,"$")}),"keyword";var a=d.next();if(a=="%")return d.skipToEnd(),"comment";if(a=="}"||a=="]"){if(s=W(r),s)s.closeBracket(a),T(r,c);else return"error";return"bracket"}else return a=="{"||a=="["?(s=k.DEFAULT,s=new s,V(r,s),"bracket"):/\d/.test(a)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),s=H(r),s.name=="begin"&&(s.argument=d.current()),s.styleIdentifier())}function m(d,r,s){if(d.eatSpace())return null;if(s&&d.match(s))return T(r,v),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=d.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(d.skipToEnd(),"comment"):"error"}function c(d,r){var s=d.peek(),o;return s=="{"||s=="["?(o=W(r),o.openBracket(s),d.eat(s),T(r,v),"bracket"):/[ \t\r]/.test(s)?(d.eat(s),null):(T(r,v),D(r),v(d,r))}return{startState:function(){var d=N.inMathMode?function(r,s){return m(r,s)}:v;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,r){return r.f(d,r)},blankLine:function(d){d.f=v,d.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+ua5":function(Ke,Me,K){},"/GNS":function(Ke,Me,K){Ke.exports=K.p+"static/search1.c4136dd4.png"},"19Vz":function(Ke,Me,K){(function(q){q(K("VrN/"))})(function(q){q.defineOption("placeholder","",function(F,k,T){var v=T&&T!=q.Init;if(k&&!v)F.on("blur",W),F.on("change",D),F.on("swapDoc",D),q.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){V(F)}),D(F);else if(!k&&v){F.off("blur",W),F.off("change",D),F.off("swapDoc",D),q.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),z(F);var m=F.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}k&&!F.hasFocus()&&W(F)});function z(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function N(F){z(F);var k=F.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=F.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var T=F.getOption("placeholder");typeof T=="string"&&(T=document.createTextNode(T)),k.appendChild(T),F.display.lineSpace.insertBefore(k,F.display.lineSpace.firstChild)}function V(F){setTimeout(function(){var k=!1,T=F.getInputField();T.nodeName=="TEXTAREA"?k=!T.value:F.lineCount()==1&&(k=!/[^\u200b]/.test(T.querySelector(".CodeMirror-line").textContent)),k?N(F):z(F)},20)}function W(F){H(F)&&N(F)}function D(F){var k=F.getWrapperElement(),T=H(F);k.className=k.className.replace(" CodeMirror-empty","")+(T?" CodeMirror-empty":""),T?N(F):z(F)}function H(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(Ke,Me,K){(function(q){q(K("VrN/"))})(function(q){"use strict";var z={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},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(V,W){var D=V.indentUnit,H={},F=W.htmlMode?z:N;for(var k in F)H[k]=F[k];for(var k in W)H[k]=W[k];var T,v;function m(u,E){function b(R){return E.tokenize=R,R(u,E)}var y=u.next();if(y=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?b(r("atom","]]>")):null:u.match("--")?b(r("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),b(s(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),E.tokenize=r("meta","?>"),"meta"):(T=u.eat("/")?"closeTag":"openTag",E.tokenize=c,"tag bracket");if(y=="&"){var P;return u.eat("#")?u.eat("x")?P=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):P=u.eatWhile(/[\d]/)&&u.eat(";"):P=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),P?"atom":"error"}else return u.eatWhile(/[^&<]/),null}m.isInText=!0;function c(u,E){var b=u.next();if(b==">"||b=="/"&&u.eat(">"))return E.tokenize=m,T=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return T="equals",null;if(b=="<"){E.tokenize=m,E.state=h,E.tagName=E.tagStart=null;var y=E.tokenize(u,E);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(b)?(E.tokenize=d(b),E.stringStartCol=u.column(),E.tokenize(u,E)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(u){var E=function(b,y){for(;!b.eol();)if(b.next()==u){y.tokenize=c;break}return"string"};return E.isInAttribute=!0,E}function r(u,E){return function(b,y){for(;!b.eol();){if(b.match(E)){y.tokenize=m;break}b.next()}return u}}function s(u){return function(E,b){for(var y;(y=E.next())!=null;){if(y=="<")return b.tokenize=s(u+1),b.tokenize(E,b);if(y==">")if(u==1){b.tokenize=m;break}else return b.tokenize=s(u-1),b.tokenize(E,b)}return"meta"}}function o(u,E,b){this.prev=u.context,this.tagName=E,this.indent=u.indented,this.startOfLine=b,(H.doNotIndent.hasOwnProperty(E)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function a(u){u.context&&(u.context=u.context.prev)}function l(u,E){for(var b;;){if(!u.context)return;if(b=u.context.tagName,!H.contextGrabbers.hasOwnProperty(b)||!H.contextGrabbers[b].hasOwnProperty(E))return;a(u)}}function h(u,E,b){return u=="openTag"?(b.tagStart=E.column(),I):u=="closeTag"?w:h}function I(u,E,b){return u=="word"?(b.tagName=E.current(),v="tag",S):H.allowMissingTagName&&u=="endTag"?(v="tag bracket",S(u,E,b)):(v="error",I)}function w(u,E,b){if(u=="word"){var y=E.current();return b.context&&b.context.tagName!=y&&H.implicitlyClosed.hasOwnProperty(b.context.tagName)&&a(b),b.context&&b.context.tagName==y||H.matchClosing===!1?(v="tag",x):(v="tag error",O)}else return H.allowMissingTagName&&u=="endTag"?(v="tag bracket",x(u,E,b)):(v="error",O)}function x(u,E,b){return u!="endTag"?(v="error",x):(a(b),h)}function O(u,E,b){return v="error",x(u,E,b)}function S(u,E,b){if(u=="word")return v="attribute",_;if(u=="endTag"||u=="selfcloseTag"){var y=b.tagName,P=b.tagStart;return b.tagName=b.tagStart=null,u=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(y)?l(b,y):(l(b,y),b.context=new o(b,y,P==b.indented)),h}return v="error",S}function _(u,E,b){return u=="equals"?g:(H.allowMissing||(v="error"),S(u,E,b))}function g(u,E,b){return u=="string"?f:u=="word"&&H.allowUnquoted?(v="string",S):(v="error",S(u,E,b))}function f(u,E,b){return u=="string"?f:S(u,E,b)}return{startState:function(u){var E={tokenize:m,state:h,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(E.baseIndent=u),E},token:function(u,E){if(!E.tagName&&u.sol()&&(E.indented=u.indentation()),u.eatSpace())return null;T=null;var b=E.tokenize(u,E);return(b||T)&&b!="comment"&&(v=null,E.state=E.state(T||b,u,E),v&&(b=v=="error"?b+" error":v)),b},indent:function(u,E,b){var y=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+D;if(y&&y.noIndent)return q.Pass;if(u.tokenize!=c&&u.tokenize!=m)return b?b.match(/^(\s*)/)[0].length:0;if(u.tagName)return H.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+D*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var P=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(P&&P[1])for(;y;)if(y.tagName==P[2]){y=y.prev;break}else if(H.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(P)for(;y;){var R=H.contextGrabbers[y.tagName];if(R&&R.hasOwnProperty(P[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+D:u.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(u){u.state==g&&(u.state=S)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var E=[],b=u.context;b;b=b.prev)b.tagName&&E.push(b.tagName);return E.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ke,Me,K){"use strict";K.d(Me,"d",function(){return yt}),K.d(Me,"b",function(){return _e}),K.d(Me,"c",function(){return at}),K.d(Me,"a",function(){return Lt});var q=K("VTBJ"),z=K("1OyB"),N=K("vuIU"),V=K("JX7q"),W=K("Ji7U"),D=K("LK+K"),H=K("q1tI"),F=K("I8Z2"),k=K("BGR+"),T=K("wx14"),v=K("rePB"),m=K("4IlW"),c=K("2GS6"),d=K("Gytx"),r=K.n(d),s=K("TSYQ"),o=K.n(s),a=K("U8pU"),l=K("ODXe"),h=/iPhone/i,I=/iPod/i,w=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,O=/Android/i,S=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,g=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,u=/BlackBerry/i,E=/BB10/i,b=/Opera Mini/i,y=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function R(mt,Ze){return mt.test(Ze)}function U(mt){var Ze=mt||(typeof navigator!="undefined"?navigator.userAgent:""),$e=Ze.split("[FBAN");if(typeof $e[1]!="undefined"){var He=$e,le=Object(l.a)(He,1);Ze=le[0]}if($e=Ze.split("Twitter"),typeof $e[1]!="undefined"){var be=$e,rt=Object(l.a)(be,1);Ze=rt[0]}var Ye={apple:{phone:R(h,Ze)&&!R(g,Ze),ipod:R(I,Ze),tablet:!R(h,Ze)&&R(w,Ze)&&!R(g,Ze),device:(R(h,Ze)||R(I,Ze)||R(w,Ze))&&!R(g,Ze)},amazon:{phone:R(S,Ze),tablet:!R(S,Ze)&&R(_,Ze),device:R(S,Ze)||R(_,Ze)},android:{phone:!R(g,Ze)&&R(S,Ze)||!R(g,Ze)&&R(x,Ze),tablet:!R(g,Ze)&&!R(S,Ze)&&!R(x,Ze)&&(R(_,Ze)||R(O,Ze)),device:!R(g,Ze)&&(R(S,Ze)||R(_,Ze)||R(x,Ze)||R(O,Ze))||R(/\bokhttp\b/i,Ze)},windows:{phone:R(g,Ze),tablet:R(f,Ze),device:R(g,Ze)||R(f,Ze)},other:{blackberry:R(u,Ze),blackberry10:R(E,Ze),opera:R(b,Ze),firefox:R(P,Ze),chrome:R(y,Ze),device:R(u,Ze)||R(E,Ze)||R(b,Ze)||R(P,Ze)||R(y,Ze)},any:null,phone:null,tablet:null};return Ye.any=Ye.apple.device||Ye.android.device||Ye.windows.device||Ye.other.device,Ye.phone=Ye.apple.phone||Ye.android.phone||Ye.windows.phone,Ye.tablet=Ye.apple.tablet||Ye.android.tablet||Ye.windows.tablet,Ye}var L=Object(q.a)(Object(q.a)({},U()),{},{isMobile:U}),j=L;function A(){}function X(mt,Ze,$e){var He=Ze||"";return mt.key||"".concat(He,"item_").concat($e)}function ee(mt){return"".concat(mt,"-menu-")}function se(mt,Ze){var $e=-1;H.Children.forEach(mt,function(He){$e+=1,He&&He.type&&He.type.isMenuItemGroup?H.Children.forEach(He.props.children,function(le){$e+=1,Ze(le,$e)}):Ze(He,$e)})}function ce(mt,Ze,$e){if(!mt||$e.find)return;H.Children.forEach(mt,function(He){if(He){var le=He.type;if(!le||!(le.isSubMenu||le.isMenuItem||le.isMenuItemGroup))return;Ze.indexOf(He.key)!==-1?$e.find=!0:He.props.children&&ce(He.props.children,Ze,$e)}})}var Le=["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"],Ce=function(Ze){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=Ze&&typeof Ze.getBoundingClientRect=="function"&&Ze.getBoundingClientRect().width;if(He){if($e){var le=getComputedStyle(Ze),be=le.marginLeft,rt=le.marginRight;He+=+be.replace("px","")+ +rt.replace("px","")}He=+He.toFixed(6)}return He||0},Ae=function(Ze,$e,He){Ze&&Object(a.a)(Ze.style)==="object"&&(Ze.style[$e]=He)},Pe=function(){return j.any},Ie=K("KQm4"),pe=K("Ff2n"),de=K("i8i4"),ne=K("bdgK"),ge=K("uciX"),oe=K("8XRh"),De={adjustX:1,adjustY:1},Ue={topLeft:{points:["bl","tl"],overflow:De,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:De,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:De,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:De,offset:[4,0]}},we={topLeft:{points:["bl","tl"],overflow:De,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:De,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:De,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:De,offset:[4,0]}},Ge=Ue,Qe=0,et={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ze=function(Ze,$e,He){var le=ee($e),be=Ze.getState();Ze.setState({defaultActiveFirst:Object(q.a)(Object(q.a)({},be.defaultActiveFirst),{},Object(v.a)({},le,He))})},Je=function(mt){Object(W.a)($e,mt);var Ze=Object(D.a)($e);function $e(He){var le;Object(z.a)(this,$e),le=Ze.call(this,He),le.onDestroy=function(Ee){le.props.onDestroy(Ee)},le.onKeyDown=function(Ee){var Be=Ee.keyCode,st=le.menuInstance,ct=le.props,Ct=ct.isOpen,lt=ct.store;if(Be===m.a.ENTER)return le.onTitleClick(Ee),ze(lt,le.props.eventKey,!0),!0;if(Be===m.a.RIGHT)return Ct?st.onKeyDown(Ee):(le.triggerOpenChange(!0),ze(lt,le.props.eventKey,!0)),!0;if(Be===m.a.LEFT){var jt;if(Ct)jt=st.onKeyDown(Ee);else return;return jt||(le.triggerOpenChange(!1),jt=!0),jt}return Ct&&(Be===m.a.UP||Be===m.a.DOWN)?st.onKeyDown(Ee):void 0},le.onOpenChange=function(Ee){le.props.onOpenChange(Ee)},le.onPopupVisibleChange=function(Ee){le.triggerOpenChange(Ee,Ee?"mouseenter":"mouseleave")},le.onMouseEnter=function(Ee){var Be=le.props,st=Be.eventKey,ct=Be.onMouseEnter,Ct=Be.store;ze(Ct,le.props.eventKey,!1),ct({key:st,domEvent:Ee})},le.onMouseLeave=function(Ee){var Be=le.props,st=Be.parentMenu,ct=Be.eventKey,Ct=Be.onMouseLeave;st.subMenuInstance=Object(V.a)(le),Ct({key:ct,domEvent:Ee})},le.onTitleMouseEnter=function(Ee){var Be=le.props,st=Be.eventKey,ct=Be.onItemHover,Ct=Be.onTitleMouseEnter;ct({key:st,hover:!0}),Ct({key:st,domEvent:Ee})},le.onTitleMouseLeave=function(Ee){var Be=le.props,st=Be.parentMenu,ct=Be.eventKey,Ct=Be.onItemHover,lt=Be.onTitleMouseLeave;st.subMenuInstance=Object(V.a)(le),Ct({key:ct,hover:!1}),lt({key:ct,domEvent:Ee})},le.onTitleClick=function(Ee){var Be=Object(V.a)(le),st=Be.props;if(st.onTitleClick({key:st.eventKey,domEvent:Ee}),st.triggerSubMenuAction==="hover")return;le.triggerOpenChange(!st.isOpen,"click"),ze(st.store,le.props.eventKey,!1)},le.onSubMenuClick=function(Ee){typeof le.props.onClick=="function"&&le.props.onClick(le.addKeyPath(Ee))},le.onSelect=function(Ee){le.props.onSelect(Ee)},le.onDeselect=function(Ee){le.props.onDeselect(Ee)},le.getPrefixCls=function(){return"".concat(le.props.rootPrefixCls,"-submenu")},le.getActiveClassName=function(){return"".concat(le.getPrefixCls(),"-active")},le.getDisabledClassName=function(){return"".concat(le.getPrefixCls(),"-disabled")},le.getSelectedClassName=function(){return"".concat(le.getPrefixCls(),"-selected")},le.getOpenClassName=function(){return"".concat(le.props.rootPrefixCls,"-submenu-open")},le.saveMenuInstance=function(Ee){le.menuInstance=Ee},le.addKeyPath=function(Ee){return Object(q.a)(Object(q.a)({},Ee),{},{keyPath:(Ee.keyPath||[]).concat(le.props.eventKey)})},le.triggerOpenChange=function(Ee,Be){var st=le.props.eventKey,ct=function(){le.onOpenChange({key:st,item:Object(V.a)(le),trigger:Be,open:Ee})};Be==="mouseenter"?le.mouseenterTimeout=setTimeout(function(){ct()},0):ct()},le.isChildrenSelected=function(){var Ee={find:!1};return ce(le.props.children,le.props.selectedKeys,Ee),Ee.find},le.isOpen=function(){return le.props.openKeys.indexOf(le.props.eventKey)!==-1},le.adjustWidth=function(){if(!le.subMenuTitle||!le.menuInstance)return;var Ee=de.findDOMNode(le.menuInstance);if(Ee.offsetWidth>=le.subMenuTitle.offsetWidth)return;Ee.style.minWidth="".concat(le.subMenuTitle.offsetWidth,"px")},le.saveSubMenuTitle=function(Ee){le.subMenuTitle=Ee},le.getBaseProps=function(){var Ee=Object(V.a)(le),Be=Ee.props;return{mode:Be.mode==="horizontal"?"vertical":Be.mode,visible:le.props.isOpen,level:Be.level+1,inlineIndent:Be.inlineIndent,focusable:!1,onClick:le.onSubMenuClick,onSelect:le.onSelect,onDeselect:le.onDeselect,onDestroy:le.onDestroy,selectedKeys:Be.selectedKeys,eventKey:"".concat(Be.eventKey,"-menu-"),openKeys:Be.openKeys,motion:Be.motion,onOpenChange:le.onOpenChange,subMenuOpenDelay:Be.subMenuOpenDelay,parentMenu:Object(V.a)(le),subMenuCloseDelay:Be.subMenuCloseDelay,forceSubMenuRender:Be.forceSubMenuRender,triggerSubMenuAction:Be.triggerSubMenuAction,builtinPlacements:Be.builtinPlacements,defaultActiveFirst:Be.store.getState().defaultActiveFirst[ee(Be.eventKey)],multiple:Be.multiple,prefixCls:Be.rootPrefixCls,id:le.internalMenuId,manualRef:le.saveMenuInstance,itemIcon:Be.itemIcon,expandIcon:Be.expandIcon,direction:Be.direction}},le.getMotion=function(Ee,Be){var st=Object(V.a)(le),ct=st.haveRendered,Ct=le.props,lt=Ct.motion,jt=Ct.rootPrefixCls,qt=Object(q.a)(Object(q.a)({},lt),{},{leavedClassName:"".concat(jt,"-hidden"),removeOnLeave:!1,motionAppear:ct||!Be||Ee!=="inline"});return qt};var be=He.store,rt=He.eventKey,Ye=be.getState(),bt=Ye.defaultActiveFirst;le.isRootMenu=!1;var pt=!1;return bt&&(pt=bt[rt]),ze(be,rt,pt),le}return Object(N.a)($e,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this,be=this.props,rt=be.mode,Ye=be.parentMenu,bt=be.manualRef;if(bt&&bt(this),rt!=="horizontal"||!Ye.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return le.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var le=this.props,be=le.onDestroy,rt=le.eventKey;be&&be(rt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(le){var be=this,rt=this.getBaseProps(),Ye=this.getMotion(rt.mode,rt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||rt.visible||rt.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var bt=rt.direction;return H.createElement(oe.default,Object.assign({visible:rt.visible},Ye),function(pt){var Ee=pt.className,Be=pt.style,st=o()("".concat(rt.prefixCls,"-sub"),Ee,Object(v.a)({},"".concat(rt.prefixCls,"-rtl"),bt==="rtl"));return H.createElement(Te,Object.assign({},rt,{id:be.internalMenuId,className:st,style:Be}),le)})}},{key:"render",value:function(){var le,be=Object(q.a)({},this.props),rt=be.isOpen,Ye=this.getPrefixCls(),bt=be.mode==="inline",pt=o()(Ye,"".concat(Ye,"-").concat(be.mode),(le={},Object(v.a)(le,be.className,!!be.className),Object(v.a)(le,this.getOpenClassName(),rt),Object(v.a)(le,this.getActiveClassName(),be.active||rt&&!bt),Object(v.a)(le,this.getDisabledClassName(),be.disabled),Object(v.a)(le,this.getSelectedClassName(),this.isChildrenSelected()),le));this.internalMenuId||(be.eventKey?this.internalMenuId="".concat(be.eventKey,"$Menu"):(Qe+=1,this.internalMenuId="$__$".concat(Qe,"$Menu")));var Ee={},Be={},st={};be.disabled||(Ee={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Be={onClick:this.onTitleClick},st={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var ct={},Ct=be.direction;bt&&(Ct==="rtl"?ct.paddingRight=be.inlineIndent*be.level:ct.paddingLeft=be.inlineIndent*be.level);var lt={};this.props.isOpen&&(lt={"aria-owns":this.internalMenuId});var jt=null;be.mode!=="horizontal"&&(jt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(jt=H.createElement(this.props.expandIcon,Object(q.a)({},this.props))));var qt=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:ct,className:"".concat(Ye,"-title"),role:"button"},st,Be,{"aria-expanded":rt},lt,{"aria-haspopup":"true",title:typeof be.title=="string"?be.title:void 0}),be.title,jt||H.createElement("i",{className:"".concat(Ye,"-arrow")})),Ot=this.renderChildren(be.children),Zt=be.parentMenu.isRootMenu?be.parentMenu.props.getPopupContainer:function(en){return en.parentNode},un=et[be.mode],sn=be.popupOffset?{offset:be.popupOffset}:{},Xt=be.mode==="inline"?"":be.popupClassName;Xt+=Ct==="rtl"?" ".concat(Ye,"-rtl"):"";var mn=be.disabled,kn=be.triggerSubMenuAction,Un=be.subMenuOpenDelay,ft=be.forceSubMenuRender,Wt=be.subMenuCloseDelay,Qt=be.builtinPlacements;Le.forEach(function(en){return delete be[en]}),delete be.onClick;var $t=Ct==="rtl"?Object.assign({},we,Qt):Object.assign({},Ue,Qt);return delete be.direction,H.createElement("li",Object.assign({},be,Ee,{className:pt,role:"menuitem"}),bt&&qt,bt&&Ot,!bt&&H.createElement(ge.a,{prefixCls:Ye,popupClassName:o()("".concat(Ye,"-popup"),Xt),getPopupContainer:Zt,builtinPlacements:$t,popupPlacement:un,popupVisible:rt,popupAlign:sn,popup:Ot,action:mn?[]:[kn],mouseEnterDelay:Un,mouseLeaveDelay:Wt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ft},qt))}}]),$e}(H.Component);Je.defaultProps={onMouseEnter:A,onMouseLeave:A,onTitleMouseEnter:A,onTitleMouseLeave:A,onTitleClick:A,manualRef:A,mode:"vertical",title:""};var Xe=Object(F.b)(function(mt,Ze){var $e=mt.openKeys,He=mt.activeKey,le=mt.selectedKeys,be=Ze.eventKey,rt=Ze.subMenuKey;return{isOpen:$e.indexOf(be)>-1,active:He[rt]===be,selectedKeys:le}})(Je);Xe.isSubMenu=!0;var yt=Xe,xt="menuitem-overflowed",vt=.5,ht=function(mt){Object(W.a)($e,mt);var Ze=Object(D.a)($e);function $e(){var He;return Object(z.a)(this,$e),He=Ze.apply(this,arguments),He.resizeObserver=null,He.mutationObserver=null,He.originalTotalWidth=0,He.overflowedItems=[],He.menuItemSizes=[],He.cancelFrameId=null,He.state={lastVisibleIndex:void 0},He.getMenuItemNodes=function(){var le=He.props.prefixCls,be=de.findDOMNode(Object(V.a)(He));return be?[].slice.call(be.children).filter(function(rt){return rt.className.split(" ").indexOf("".concat(le,"-overflowed-submenu"))<0}):[]},He.getOverflowedSubMenuItem=function(le,be,rt){var Ye=He.props,bt=Ye.overflowedIndicator,pt=Ye.level,Ee=Ye.mode,Be=Ye.prefixCls,st=Ye.theme;if(pt!==1||Ee!=="horizontal")return null;var ct=He.props.children[0],Ct=ct.props,lt=Ct.children,jt=Ct.title,qt=Ct.style,Ot=Object(pe.a)(Ct,["children","title","style"]),Zt=Object(q.a)({},qt),un="".concat(le,"-overflowed-indicator"),sn="".concat(le,"-overflowed-indicator");be.length===0&&rt!==!0?Zt=Object(q.a)(Object(q.a)({},Zt),{},{display:"none"}):rt&&(Zt=Object(q.a)(Object(q.a)({},Zt),{},{visibility:"hidden",position:"absolute"}),un="".concat(un,"-placeholder"),sn="".concat(sn,"-placeholder"));var Xt=st?"".concat(Be,"-").concat(st):"",mn={};return Le.forEach(function(kn){Ot[kn]!==void 0&&(mn[kn]=Ot[kn])}),H.createElement(yt,Object.assign({title:bt,className:"".concat(Be,"-overflowed-submenu"),popupClassName:Xt},mn,{key:un,eventKey:sn,disabled:!1,style:Zt}),be)},He.setChildrenWidthAndResize=function(){if(He.props.mode!=="horizontal")return;var le=de.findDOMNode(Object(V.a)(He));if(!le)return;var be=le.children;if(!be||be.length===0)return;var rt=le.children[be.length-1];Ae(rt,"display","inline-block");var Ye=He.getMenuItemNodes(),bt=Ye.filter(function(pt){return pt.className.split(" ").indexOf(xt)>=0});bt.forEach(function(pt){Ae(pt,"display","inline-block")}),He.menuItemSizes=Ye.map(function(pt){return Ce(pt,!0)}),bt.forEach(function(pt){Ae(pt,"display","none")}),He.overflowedIndicatorWidth=Ce(le.children[le.children.length-1],!0),He.originalTotalWidth=He.menuItemSizes.reduce(function(pt,Ee){return pt+Ee},0),He.handleResize(),Ae(rt,"display","none")},He.handleResize=function(){if(He.props.mode!=="horizontal")return;var le=de.findDOMNode(Object(V.a)(He));if(!le)return;var be=Ce(le);He.overflowedItems=[];var rt=0,Ye;He.originalTotalWidth>be+vt&&(Ye=-1,He.menuItemSizes.forEach(function(bt){rt+=bt,rt+He.overflowedIndicatorWidth<=be&&(Ye+=1)})),He.setState({lastVisibleIndex:Ye})},He}return Object(N.a)($e,[{key:"componentDidMount",value:function(){var le=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var be=de.findDOMNode(this);if(!be)return;this.resizeObserver=new ne.default(function(rt){rt.forEach(function(){var Ye=le.cancelFrameId;cancelAnimationFrame(Ye),le.cancelFrameId=requestAnimationFrame(le.setChildrenWidthAndResize)})}),[].slice.call(be.children).concat(be).forEach(function(rt){le.resizeObserver.observe(rt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){le.resizeObserver.disconnect(),[].slice.call(be.children).concat(be).forEach(function(rt){le.resizeObserver.observe(rt)}),le.setChildrenWidthAndResize()}),this.mutationObserver.observe(be,{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(le){var be=this,rt=this.state.lastVisibleIndex;return(le||[]).reduce(function(Ye,bt,pt){var Ee=bt;if(be.props.mode==="horizontal"){var Be=be.getOverflowedSubMenuItem(bt.props.eventKey,[]);rt!==void 0&&be.props.className.indexOf("".concat(be.props.prefixCls,"-root"))!==-1&&(pt>rt&&(Ee=H.cloneElement(bt,{style:{display:"none"},eventKey:"".concat(bt.props.eventKey,"-hidden"),className:"".concat(xt)})),pt===rt+1&&(be.overflowedItems=le.slice(rt+1).map(function(ct){return H.cloneElement(ct,{key:ct.props.eventKey,mode:"vertical-left"})}),Be=be.getOverflowedSubMenuItem(bt.props.eventKey,be.overflowedItems)));var st=[].concat(Object(Ie.a)(Ye),[Be,Ee]);return pt===le.length-1&&st.push(be.getOverflowedSubMenuItem(bt.props.eventKey,[],!0)),st}return[].concat(Object(Ie.a)(Ye),[Ee])},[])}},{key:"render",value:function(){var le=this.props,be=le.visible,rt=le.prefixCls,Ye=le.overflowedIndicator,bt=le.mode,pt=le.level,Ee=le.tag,Be=le.children,st=le.theme,ct=Object(pe.a)(le,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ct=Ee;return H.createElement(Ct,Object.assign({},ct),this.renderChildren(Be))}}]),$e}(H.Component);ht.defaultProps={tag:"div",className:""};var Rt=ht;function At(mt){return mt.length?mt.every(function(Ze){return!!Ze.props.disabled}):!0}function ke(mt,Ze,$e){var He=mt.getState();mt.setState({activeKey:Object(q.a)(Object(q.a)({},He.activeKey),{},Object(v.a)({},Ze,$e))})}function Oe(mt){return mt.eventKey||"0-menu-"}function tt(mt,Ze){var $e=Ze,He=mt.children,le=mt.eventKey;if($e){var be;if(se(He,function(rt,Ye){rt&&rt.props&&!rt.props.disabled&&$e===X(rt,le,Ye)&&(be=!0)}),be)return $e}return $e=null,mt.defaultActiveFirst&&se(He,function(rt,Ye){!$e&&rt&&!rt.props.disabled&&($e=X(rt,le,Ye))}),$e}function it(mt){if(mt){var Ze=this.instanceArray.indexOf(mt);Ze!==-1?this.instanceArray[Ze]=mt:this.instanceArray.push(mt)}}var Ne=function(mt){Object(W.a)($e,mt);var Ze=Object(D.a)($e);function $e(He){var le;return Object(z.a)(this,$e),le=Ze.call(this,He),le.onKeyDown=function(be,rt){var Ye=be.keyCode,bt;if(le.getFlatInstanceArray().forEach(function(Ee){Ee&&Ee.props.active&&Ee.onKeyDown&&(bt=Ee.onKeyDown(be))}),bt)return 1;var pt=null;return(Ye===m.a.UP||Ye===m.a.DOWN)&&(pt=le.step(Ye===m.a.UP?-1:1)),pt?(be.preventDefault(),ke(le.props.store,Oe(le.props),pt.props.eventKey),typeof rt=="function"&&rt(pt),1):void 0},le.onItemHover=function(be){var rt=be.key,Ye=be.hover;ke(le.props.store,Oe(le.props),Ye?rt:null)},le.onDeselect=function(be){le.props.onDeselect(be)},le.onSelect=function(be){le.props.onSelect(be)},le.onClick=function(be){le.props.onClick(be)},le.onOpenChange=function(be){le.props.onOpenChange(be)},le.onDestroy=function(be){le.props.onDestroy(be)},le.getFlatInstanceArray=function(){return le.instanceArray},le.step=function(be){var rt=le.getFlatInstanceArray(),Ye=le.props.store.getState().activeKey[Oe(le.props)],bt=rt.length;if(!bt)return null;be<0&&(rt=rt.concat().reverse());var pt=-1;if(rt.every(function(ct,Ct){return ct&&ct.props.eventKey===Ye?(pt=Ct,!1):!0}),!le.props.defaultActiveFirst&&pt!==-1&&At(rt.slice(pt,bt-1)))return;var Ee=(pt+1)%bt,Be=Ee;do{var st=rt[Be];if(!st||st.props.disabled)Be=(Be+1)%bt;else return st}while(Be!==Ee);return null},le.renderCommonMenuItem=function(be,rt,Ye){var bt=le.props.store.getState(),pt=Object(V.a)(le),Ee=pt.props,Be=X(be,Ee.eventKey,rt),st=be.props;if(!st||typeof be.type=="string")return be;var ct=Be===bt.activeKey,Ct=Object(q.a)(Object(q.a)({mode:st.mode||Ee.mode,level:Ee.level,inlineIndent:Ee.inlineIndent,renderMenuItem:le.renderMenuItem,rootPrefixCls:Ee.prefixCls,index:rt,parentMenu:Ee.parentMenu,manualRef:st.disabled?void 0:Object(c.a)(be.ref,it.bind(Object(V.a)(le))),eventKey:Be,active:!st.disabled&&ct,multiple:Ee.multiple,onClick:function(jt){(st.onClick||A)(jt),le.onClick(jt)},onItemHover:le.onItemHover,motion:Ee.motion,subMenuOpenDelay:Ee.subMenuOpenDelay,subMenuCloseDelay:Ee.subMenuCloseDelay,forceSubMenuRender:Ee.forceSubMenuRender,onOpenChange:le.onOpenChange,onDeselect:le.onDeselect,onSelect:le.onSelect,builtinPlacements:Ee.builtinPlacements,itemIcon:st.itemIcon||le.props.itemIcon,expandIcon:st.expandIcon||le.props.expandIcon},Ye),{},{direction:Ee.direction});return(Ee.mode==="inline"||Pe())&&(Ct.triggerSubMenuAction="click"),H.cloneElement(be,Ct)},le.renderMenuItem=function(be,rt,Ye){if(!be)return null;var bt=le.props.store.getState(),pt={openKeys:bt.openKeys,selectedKeys:bt.selectedKeys,triggerSubMenuAction:le.props.triggerSubMenuAction,subMenuKey:Ye};return le.renderCommonMenuItem(be,rt,pt)},He.store.setState({activeKey:Object(q.a)(Object(q.a)({},He.store.getState().activeKey),{},Object(v.a)({},He.eventKey,tt(He,He.activeKey)))}),le.instanceArray=[],le}return Object(N.a)($e,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(le){return this.props.visible||le.visible||this.props.className!==le.className||!r()(this.props.style,le.style)}},{key:"componentDidUpdate",value:function(le){var be=this.props,rt="activeKey"in be?be.activeKey:be.store.getState().activeKey[Oe(be)],Ye=tt(be,rt);if(Ye!==rt)ke(be.store,Oe(be),Ye);else if("activeKey"in le){var bt=tt(le,le.activeKey);Ye!==bt&&ke(be.store,Oe(be),Ye)}}},{key:"render",value:function(){var le=this,be=Object(T.a)({},this.props);this.instanceArray=[];var rt=o()(be.prefixCls,be.className,"".concat(be.prefixCls,"-").concat(be.mode)),Ye={className:rt,role:be.role||"menu"};be.id&&(Ye.id=be.id),be.focusable&&(Ye.tabIndex=0,Ye.onKeyDown=this.onKeyDown);var bt=be.prefixCls,pt=be.eventKey,Ee=be.visible,Be=be.level,st=be.mode,ct=be.overflowedIndicator,Ct=be.theme;return Le.forEach(function(lt){return delete be[lt]}),delete be.onClick,H.createElement(Rt,Object.assign({},be,{prefixCls:bt,mode:st,tag:"ul",level:Be,theme:Ct,visible:Ee,overflowedIndicator:ct},Ye),H.Children.map(be.children,function(lt,jt){return le.renderMenuItem(lt,jt,pt||"0-menu-")}))}}]),$e}(H.Component);Ne.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:A};var qe=Object(F.b)()(Ne),Te=qe,fe=K("Kwbf");function me(mt,Ze,$e){var He=mt.prefixCls,le=mt.motion,be=mt.defaultMotions,rt=be===void 0?{}:be,Ye=mt.openAnimation,bt=mt.openTransitionName,pt=Ze.switchingModeFromInline;if(le)return le;if(Object(a.a)(Ye)==="object"&&Ye)Object(fe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ye=="string")return{motionName:"".concat(He,"-open-").concat(Ye)};if(bt)return{motionName:bt};var Ee=rt[$e];return Ee||(pt?null:rt.other)}var re=function(mt){Object(W.a)($e,mt);var Ze=Object(D.a)($e);function $e(He){var le;Object(z.a)(this,$e),le=Ze.call(this,He),le.inlineOpenKeys=[],le.onSelect=function(Ye){var bt=Object(V.a)(le),pt=bt.props;if(pt.selectable){var Ee=le.store.getState(),Be=Ee.selectedKeys,st=Ye.key;pt.multiple?Be=Be.concat([st]):Be=[st],"selectedKeys"in pt||le.store.setState({selectedKeys:Be}),pt.onSelect(Object(q.a)(Object(q.a)({},Ye),{},{selectedKeys:Be}))}},le.onClick=function(Ye){var bt=le.getRealMenuMode(),pt=Object(V.a)(le),Ee=pt.store,Be=pt.props.onOpenChange;bt!=="inline"&&!("openKeys"in le.props)&&(Ee.setState({openKeys:[]}),Be([])),le.props.onClick(Ye)},le.onKeyDown=function(Ye,bt){le.innerMenu.getWrappedInstance().onKeyDown(Ye,bt)},le.onOpenChange=function(Ye){var bt=Object(V.a)(le),pt=bt.props,Ee=le.store.getState().openKeys.concat(),Be=!1,st=function(Ct){var lt=!1;if(Ct.open)lt=Ee.indexOf(Ct.key)===-1,lt&&Ee.push(Ct.key);else{var jt=Ee.indexOf(Ct.key);lt=jt!==-1,lt&&Ee.splice(jt,1)}Be=Be||lt};Array.isArray(Ye)?Ye.forEach(st):st(Ye),Be&&("openKeys"in le.props||le.store.setState({openKeys:Ee}),pt.onOpenChange(Ee))},le.onDeselect=function(Ye){var bt=Object(V.a)(le),pt=bt.props;if(pt.selectable){var Ee=le.store.getState().selectedKeys.concat(),Be=Ye.key,st=Ee.indexOf(Be);st!==-1&&Ee.splice(st,1),"selectedKeys"in pt||le.store.setState({selectedKeys:Ee}),pt.onDeselect(Object(q.a)(Object(q.a)({},Ye),{},{selectedKeys:Ee}))}},le.onMouseEnter=function(Ye){le.restoreModeVerticalFromInline();var bt=le.props.onMouseEnter;bt&&bt(Ye)},le.onTransitionEnd=function(Ye){var bt=Ye.propertyName==="width"&&Ye.target===Ye.currentTarget,pt=Ye.target.className,Ee=Object.prototype.toString.call(pt)==="[object SVGAnimatedString]"?pt.animVal:pt,Be=Ye.propertyName==="font-size"&&Ee.indexOf("anticon")>=0;(bt||Be)&&le.restoreModeVerticalFromInline()},le.setInnerMenu=function(Ye){le.innerMenu=Ye},le.isRootMenu=!0;var be=He.defaultSelectedKeys,rt=He.defaultOpenKeys;return"selectedKeys"in He&&(be=He.selectedKeys||[]),"openKeys"in He&&(rt=He.openKeys||[]),le.store=Object(F.c)({selectedKeys:be,openKeys:rt,activeKey:{"0-menu-":tt(He,He.activeKey)}}),le.state={switchingModeFromInline:!1},le}return Object(N.a)($e,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(le){this.updateOpentKeysWhenSwitchMode(le),this.updateMiniStore();var be=this.props,rt=be.siderCollapsed,Ye=be.inlineCollapsed,bt=be.onOpenChange;(!le.inlineCollapsed&&Ye||!le.siderCollapsed&&rt)&&bt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(le){var be=this.props,rt=this.store,Ye=this.inlineOpenKeys,bt=rt.getState(),pt={};le.mode==="inline"&&be.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in be||((be.inlineCollapsed&&!le.inlineCollapsed||be.siderCollapsed&&!le.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=bt.openKeys.concat(),pt.openKeys=[]),(!be.inlineCollapsed&&le.inlineCollapsed||!be.siderCollapsed&&le.siderCollapsed)&&(pt.openKeys=Ye,this.inlineOpenKeys=[])),Object.keys(pt).length&&rt.setState(pt)}},{key:"updateMenuDisplay",value:function(){var le=this.props.collapsedWidth,be=this.store,rt=this.prevOpenKeys,Ye=this.getInlineCollapsed()&&(le===0||le==="0"||le==="0px");Ye?(this.prevOpenKeys=be.getState().openKeys.concat(),this.store.setState({openKeys:[]})):rt&&(this.store.setState({openKeys:rt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var le=this.props.mode,be=this.state.switchingModeFromInline,rt=this.getInlineCollapsed();return be&&rt?"inline":rt?"vertical":le}},{key:"getInlineCollapsed",value:function(){var le=this.props,be=le.inlineCollapsed,rt=le.siderCollapsed;return rt!==void 0?rt:be}},{key:"restoreModeVerticalFromInline",value:function(){var le=this.state.switchingModeFromInline;le&&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 le=Object(q.a)({},Object(k.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),be=this.getRealMenuMode();return le.className+=" ".concat(le.prefixCls,"-root"),le.direction==="rtl"&&(le.className+=" ".concat(le.prefixCls,"-rtl")),le=Object(q.a)(Object(q.a)({},le),{},{mode:be,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:me(this.props,this.state,be)}),delete le.openAnimation,delete le.openTransitionName,H.createElement(F.a,{store:this.store},H.createElement(Te,Object.assign({},le,{ref:this.setInnerMenu}),this.props.children))}}]),$e}(H.Component);re.defaultProps={selectable:!0,onClick:A,onSelect:A,onOpenChange:A,onDeselect:A,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var ae=re,he=function(mt){Object(W.a)($e,mt);var Ze=Object(D.a)($e);function $e(){var He;return Object(z.a)(this,$e),He=Ze.apply(this,arguments),He.onKeyDown=function(le){var be=le.keyCode;return be===m.a.ENTER?(He.onClick(le),!0):void 0},He.onMouseLeave=function(le){var be=He.props,rt=be.eventKey,Ye=be.onItemHover,bt=be.onMouseLeave;Ye({key:rt,hover:!1}),bt({key:rt,domEvent:le})},He.onMouseEnter=function(le){var be=He.props,rt=be.eventKey,Ye=be.onItemHover,bt=be.onMouseEnter;Ye({key:rt,hover:!0}),bt({key:rt,domEvent:le})},He.onClick=function(le){var be=He.props,rt=be.eventKey,Ye=be.multiple,bt=be.onClick,pt=be.onSelect,Ee=be.onDeselect,Be=be.isSelected,st={key:rt,keyPath:[rt],item:Object(V.a)(He),domEvent:le};bt(st),Ye?Be?Ee(st):pt(st):Be||pt(st)},He.saveNode=function(le){He.node=le},He}return Object(N.a)($e,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var le=this.props;le.onDestroy&&le.onDestroy(le.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 le,be=Object(q.a)({},this.props),rt=o()(this.getPrefixCls(),be.className,(le={},Object(v.a)(le,this.getActiveClassName(),!be.disabled&&be.active),Object(v.a)(le,this.getSelectedClassName(),be.isSelected),Object(v.a)(le,this.getDisabledClassName(),be.disabled),le)),Ye=Object(q.a)(Object(q.a)({},be.attribute),{},{title:typeof be.title=="string"?be.title:void 0,className:rt,role:be.role||"menuitem","aria-disabled":be.disabled});be.role==="option"?Ye=Object(q.a)(Object(q.a)({},Ye),{},{role:"option","aria-selected":be.isSelected}):(be.role===null||be.role==="none")&&(Ye.role="none");var bt={onClick:be.disabled?null:this.onClick,onMouseLeave:be.disabled?null:this.onMouseLeave,onMouseEnter:be.disabled?null:this.onMouseEnter},pt=Object(q.a)({},be.style);be.mode==="inline"&&(be.direction==="rtl"?pt.paddingRight=be.inlineIndent*be.level:pt.paddingLeft=be.inlineIndent*be.level),Le.forEach(function(Be){return delete be[Be]}),delete be.direction;var Ee=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ee=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(k.default)(be,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ye,bt,{style:pt,ref:this.saveNode}),be.children,Ee)}}]),$e}(H.Component);he.isMenuItem=!0,he.defaultProps={onSelect:A,onMouseEnter:A,onMouseLeave:A,manualRef:A};var ve=Object(F.b)(function(mt,Ze){var $e=mt.activeKey,He=mt.selectedKeys,le=Ze.eventKey,be=Ze.subMenuKey;return{active:$e[be]===le,isSelected:He.indexOf(le)!==-1}})(he),_e=ve,je=function(mt){Object(W.a)($e,mt);var Ze=Object(D.a)($e);function $e(){var He;return Object(z.a)(this,$e),He=Ze.apply(this,arguments),He.renderInnerMenuItem=function(le){var be=He.props,rt=be.renderMenuItem,Ye=be.index;return rt(le,Ye,He.props.subMenuKey)},He}return Object(N.a)($e,[{key:"render",value:function(){var le=Object(T.a)({},this.props),be=le.className,rt=be===void 0?"":be,Ye=le.rootPrefixCls,bt="".concat(Ye,"-item-group-title"),pt="".concat(Ye,"-item-group-list"),Ee=le.title,Be=le.children;return Le.forEach(function(st){return delete le[st]}),delete le.onClick,delete le.direction,H.createElement("li",Object.assign({},le,{className:"".concat(rt," ").concat(Ye,"-item-group")}),H.createElement("div",{className:bt,title:typeof Ee=="string"?Ee:void 0},Ee),H.createElement("ul",{className:pt},H.Children.map(Be,this.renderInnerMenuItem)))}}]),$e}(H.Component);je.isMenuItemGroup=!0,je.defaultProps={disabled:!0};var at=je,Et=function(Ze){var $e=Ze.className,He=Ze.rootPrefixCls,le=Ze.style;return H.createElement("li",{className:"".concat($e," ").concat(He,"-item-divider"),style:le})};Et.defaultProps={disabled:!0,className:"",style:{}};var Lt=Et,Tt=Me.e=ae},"4qgm":function(Ke,Me){Ke.exports="data:image/png;base64,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"},"4u4S":function(Ke,Me){Ke.exports="data:image/png;base64,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"},"55Ip":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return l});var q=K("Ty5D"),z=K("dI71"),N=K("q1tI"),V=K.n(N),W=K("YS25"),D=K("17x9"),H=K.n(D),F=K("wx14"),k=K("zLVn"),T=K("9R94"),v=function(g){Object(z.a)(f,g);function f(){for(var E,b=arguments.length,y=new Array(b),P=0;P<b;P++)y[P]=arguments[P];return E=g.call.apply(g,[this].concat(y))||this,E.history=Object(W.a)(E.props),E}var u=f.prototype;return u.render=function(){return V.a.createElement(q.c,{history:this.history,children:this.props.children})},f}(V.a.Component),m=function(g){Object(z.a)(f,g);function f(){for(var E,b=arguments.length,y=new Array(b),P=0;P<b;P++)y[P]=arguments[P];return E=g.call.apply(g,[this].concat(y))||this,E.history=Object(W.b)(E.props),E}var u=f.prototype;return u.render=function(){return V.a.createElement(q.c,{history:this.history,children:this.props.children})},f}(V.a.Component),c=function(f,u){return typeof f=="function"?f(u):f},d=function(f,u){return typeof f=="string"?Object(W.c)(f,null,null,u):f},r=function(f){return f},s=V.a.forwardRef;typeof s=="undefined"&&(s=r);function o(g){return!!(g.metaKey||g.altKey||g.ctrlKey||g.shiftKey)}var a=s(function(g,f){var u=g.innerRef,E=g.navigate,b=g.onClick,y=Object(k.a)(g,["innerRef","navigate","onClick"]),P=y.target,R=Object(F.a)({},y,{onClick:function(L){try{b&&b(L)}catch(j){throw L.preventDefault(),j}!L.defaultPrevented&&L.button===0&&(!P||P==="_self")&&!o(L)&&(L.preventDefault(),E())}});return r!==s?R.ref=f||u:R.ref=u,V.a.createElement("a",R)}),l=s(function(g,f){var u=g.component,E=u===void 0?a:u,b=g.replace,y=g.to,P=g.innerRef,R=Object(k.a)(g,["component","replace","to","innerRef"]);return V.a.createElement(q.e.Consumer,null,function(U){U||Object(T.a)(!1);var L=U.history,j=d(c(y,U.location),U.location),A=j?L.createHref(j):"",X=Object(F.a)({},R,{href:A,navigate:function(){var se=c(y,U.location),ce=b?L.replace:L.push;ce(se)}});return r!==s?X.ref=f||P:X.innerRef=P,V.a.createElement(E,X)})});if(!1)var h,I;var w=function(f){return f},x=V.a.forwardRef;typeof x=="undefined"&&(x=w);function O(){for(var g=arguments.length,f=new Array(g),u=0;u<g;u++)f[u]=arguments[u];return f.filter(function(E){return E}).join(" ")}var S=x(function(g,f){var u=g["aria-current"],E=u===void 0?"page":u,b=g.activeClassName,y=b===void 0?"active":b,P=g.activeStyle,R=g.className,U=g.exact,L=g.isActive,j=g.location,A=g.sensitive,X=g.strict,ee=g.style,se=g.to,ce=g.innerRef,Le=Object(k.a)(g,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(q.e.Consumer,null,function(Ce){Ce||Object(T.a)(!1);var Ae=j||Ce.location,Pe=d(c(se,Ae),Ae),Ie=Pe.pathname,pe=Ie&&Ie.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),de=pe?Object(q.f)(Ae.pathname,{path:pe,exact:U,sensitive:A,strict:X}):null,ne=!!(L?L(de,Ae):de),ge=ne?O(R,y):R,oe=ne?Object(F.a)({},ee,{},P):ee,De=Object(F.a)({"aria-current":ne&&E||null,className:ge,style:oe,to:Pe},Le);return w!==x?De.ref=f||ce:De.innerRef=ce,V.a.createElement(l,De)})});if(!1)var _},"5D2P":function(Ke,Me){Ke.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="},"5VLF":function(Ke,Me,K){"use strict";var q,z;function N(V,W,D){var H=function(F,k){return V.js_beautify(F,k)};return H.js=V.js_beautify,H.css=W.css_beautify,H.html=D.html_beautify,H.js_beautify=V.js_beautify,H.css_beautify=W.css_beautify,H.html_beautify=D.html_beautify,H}!(q=[K("6UM0"),K("TXwP"),K("psGv")],z=function(V,W,D){return N(V,W,D)}.apply(Me,q),z!==void 0&&(Ke.exports=z))},"6+eU":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return x});var q=K("wx14"),z=K("rePB"),N=K("VTBJ"),V=K("1OyB"),W=K("vuIU"),D=K("Ji7U"),H=K("LK+K"),F=K("q1tI"),k=K.n(F),T=K("TSYQ"),v=K.n(T),m=function(S){var _,g="".concat(S.rootPrefixCls,"-item"),f=v()(g,"".concat(g,"-").concat(S.page),(_={},Object(z.a)(_,"".concat(g,"-active"),S.active),Object(z.a)(_,S.className,!!S.className),Object(z.a)(_,"".concat(g,"-disabled"),!S.page),_)),u=function(){S.onClick(S.page)},E=function(y){S.onKeyPress(y,S.onClick,S.page)};return k.a.createElement("li",{title:S.showTitle?S.page:null,className:f,onClick:u,onKeyPress:E,tabIndex:"0"},S.itemRender(S.page,"page",k.a.createElement("a",{rel:"nofollow"},S.page)))},c=m,d={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},r=function(O){Object(D.a)(_,O);var S=Object(H.a)(_);function _(){var g;Object(V.a)(this,_);for(var f=arguments.length,u=new Array(f),E=0;E<f;E++)u[E]=arguments[E];return g=S.call.apply(S,[this].concat(u)),g.state={goInputText:""},g.buildOptionText=function(b){return"".concat(b," ").concat(g.props.locale.items_per_page)},g.changeSize=function(b){g.props.changeSize(Number(b))},g.handleChange=function(b){g.setState({goInputText:b.target.value})},g.handleBlur=function(b){var y=g.props,P=y.goButton,R=y.quickGo,U=y.rootPrefixCls,L=g.state.goInputText;if(P||L==="")return;if(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(U,"-prev"))>=0||b.relatedTarget.className.indexOf("".concat(U,"-next"))>=0))return;g.setState({goInputText:""}),R(g.getValidValue())},g.go=function(b){var y=g.state.goInputText;if(y==="")return;(b.keyCode===d.ENTER||b.type==="click")&&(g.setState({goInputText:""}),g.props.quickGo(g.getValidValue()))},g}return Object(W.a)(_,[{key:"getValidValue",value:function(){var f=this.state,u=f.goInputText,E=f.current;return!u||isNaN(u)?E:Number(u)}},{key:"getPageSizeOptions",value:function(){var f=this.props,u=f.pageSize,E=f.pageSizeOptions;return E.some(function(b){return b.toString()===u.toString()})?E:E.concat([u.toString()]).sort(function(b,y){var P=isNaN(Number(b))?0:Number(b),R=isNaN(Number(y))?0:Number(y);return P-R})}},{key:"render",value:function(){var f=this,u=this.props,E=u.pageSize,b=u.locale,y=u.rootPrefixCls,P=u.changeSize,R=u.quickGo,U=u.goButton,L=u.selectComponentClass,j=u.buildOptionText,A=u.selectPrefixCls,X=u.disabled,ee=this.state.goInputText,se="".concat(y,"-options"),ce=L,Le=null,Ce=null,Ae=null;if(!P&&!R)return null;var Pe=this.getPageSizeOptions();if(P&&ce){var Ie=Pe.map(function(pe,de){return k.a.createElement(ce.Option,{key:de,value:pe.toString()},(j||f.buildOptionText)(pe))});Le=k.a.createElement(ce,{disabled:X,prefixCls:A,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||Pe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(de){return de.parentNode}},Ie)}return R&&(U&&(Ae=typeof U=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:X,className:"".concat(se,"-quick-jumper-button")},b.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},U)),Ce=k.a.createElement("div",{className:"".concat(se,"-quick-jumper")},b.jump_to,k.a.createElement("input",{disabled:X,type:"text",value:ee,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),b.page,Ae)),k.a.createElement("li",{className:"".concat(se)},Le,Ce)}}]),_}(k.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=r,o=K("N2Kk");function a(){}function l(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function h(O,S,_){return _}function I(O,S,_){var g=typeof O=="undefined"?S.pageSize:O;return Math.floor((_.total-1)/g)+1}var w=function(O){Object(D.a)(_,O);var S=Object(H.a)(_);function _(g){var f;Object(V.a)(this,_),f=S.call(this,g),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(I(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(P,R){var U=f.props.prefixCls,L=P||k.a.createElement("button",{type:"button","aria-label":R,className:"".concat(U,"-item-link")});return typeof P=="function"&&(L=k.a.createElement(P,Object(N.a)({},f.props))),L},f.savePaginationNode=function(P){f.paginationNode=P},f.isValid=function(P){return l(P)&&P!==f.state.current},f.shouldDisplayQuickJumper=function(){var P=f.props,R=P.showQuickJumper,U=P.pageSize,L=P.total;return L<=U?!1:R},f.handleKeyDown=function(P){(P.keyCode===d.ARROW_UP||P.keyCode===d.ARROW_DOWN)&&P.preventDefault()},f.handleKeyUp=function(P){var R=f.getValidValue(P),U=f.state.currentInputValue;R!==U&&f.setState({currentInputValue:R}),P.keyCode===d.ENTER?f.handleChange(R):P.keyCode===d.ARROW_UP?f.handleChange(R-1):P.keyCode===d.ARROW_DOWN&&f.handleChange(R+1)},f.changePageSize=function(P){var R=f.state.current,U=I(P,f.state,f.props);R=R>U?U:R,U===0&&(R=f.state.current),typeof P=="number"&&("pageSize"in f.props||f.setState({pageSize:P}),"current"in f.props||f.setState({current:R,currentInputValue:R})),f.props.onShowSizeChange(R,P),"onChange"in f.props&&f.props.onChange&&f.props.onChange(R,P)},f.handleChange=function(P){var R=f.props.disabled,U=P;if(f.isValid(U)&&!R){var L=I(void 0,f.state,f.props);U>L?U=L:U<1&&(U=1),"current"in f.props||f.setState({current:U,currentInputValue:U});var j=f.state.pageSize;return f.props.onChange(U,j),U}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<I(void 0,f.state,f.props)},f.runIfEnter=function(P,R){if(P.key==="Enter"||P.charCode===13){for(var U=arguments.length,L=new Array(U>2?U-2:0),j=2;j<U;j++)L[j-2]=arguments[j];R.apply(void 0,L)}},f.runIfEnterPrev=function(P){f.runIfEnter(P,f.prev)},f.runIfEnterNext=function(P){f.runIfEnter(P,f.next)},f.runIfEnterJumpPrev=function(P){f.runIfEnter(P,f.jumpPrev)},f.runIfEnterJumpNext=function(P){f.runIfEnter(P,f.jumpNext)},f.handleGoTO=function(P){(P.keyCode===d.ENTER||P.type==="click")&&f.handleChange(f.state.currentInputValue)};var u=g.onChange!==a,E="current"in g;E&&!u&&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=g.defaultCurrent;"current"in g&&(b=g.current);var y=g.defaultPageSize;return"pageSize"in g&&(y=g.pageSize),b=Math.min(b,I(y,void 0,g)),f.state={current:b,currentInputValue:b,pageSize:y},f}return Object(W.a)(_,[{key:"componentDidUpdate",value:function(f,u){var E=this.props.prefixCls;if(u.current!==this.state.current&&this.paginationNode){var b=this.paginationNode.querySelector(".".concat(E,"-item-").concat(u.current));b&&document.activeElement===b&&b.blur()}}},{key:"getValidValue",value:function(f){var u=f.target.value,E=I(void 0,this.state,this.props),b=this.state.currentInputValue,y;return u===""?y=u:isNaN(Number(u))?y=b:u>=E?y=E:y=Number(u),y}},{key:"getShowSizeChanger",value:function(){var f=this.props,u=f.showSizeChanger,E=f.total,b=f.totalBoundaryShowSizeChanger;return typeof u!="undefined"?u:E>b}},{key:"renderPrev",value:function(f){var u=this.props,E=u.prevIcon,b=u.itemRender,y=b(f,"prev",this.getItemIcon(E,"prev page")),P=!this.hasPrev();return Object(F.isValidElement)(y)?Object(F.cloneElement)(y,{disabled:P}):y}},{key:"renderNext",value:function(f){var u=this.props,E=u.nextIcon,b=u.itemRender,y=b(f,"next",this.getItemIcon(E,"next page")),P=!this.hasNext();return Object(F.isValidElement)(y)?Object(F.cloneElement)(y,{disabled:P}):y}},{key:"render",value:function(){var f=this,u=this.props,E=u.prefixCls,b=u.className,y=u.style,P=u.disabled,R=u.hideOnSinglePage,U=u.total,L=u.locale,j=u.showQuickJumper,A=u.showLessItems,X=u.showTitle,ee=u.showTotal,se=u.simple,ce=u.itemRender,Le=u.showPrevNextJumpers,Ce=u.jumpPrevIcon,Ae=u.jumpNextIcon,Pe=u.selectComponentClass,Ie=u.selectPrefixCls,pe=u.pageSizeOptions,de=this.state,ne=de.current,ge=de.pageSize,oe=de.currentInputValue;if(R===!0&&U<=ge)return null;var De=I(void 0,this.state,this.props),Ue=[],we=null,Ge=null,Qe=null,et=null,ze=null,Je=j&&j.goButton,Xe=A?1:2,yt=ne-1>0?ne-1:0,xt=ne+1<De?ne+1:De,vt=Object.keys(this.props).reduce(function(re,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(re[ae]=f.props[ae]),re},{});if(se)return Je&&(typeof Je=="boolean"?ze=k.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},L.jump_to_confirm):ze=k.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Je),ze=k.a.createElement("li",{title:X?"".concat(L.jump_to).concat(ne,"/").concat(De):null,className:"".concat(E,"-simple-pager")},ze)),k.a.createElement("ul",Object(q.a)({className:v()(E,"".concat(E,"-simple"),Object(z.a)({},"".concat(E,"-disabled"),P),b),style:y,ref:this.savePaginationNode},vt),k.a.createElement("li",{title:X?L.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:v()("".concat(E,"-prev"),Object(z.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(yt)),k.a.createElement("li",{title:X?"".concat(ne,"/").concat(De):null,className:"".concat(E,"-simple-pager")},k.a.createElement("input",{type:"text",value:oe,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),k.a.createElement("span",{className:"".concat(E,"-slash")},"/"),De),k.a.createElement("li",{title:X?L.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:v()("".concat(E,"-next"),Object(z.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(xt)),ze);if(De<=3+Xe*2){var ht={locale:L,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:X,itemRender:ce};De||Ue.push(k.a.createElement(c,Object(q.a)({},ht,{key:"noPager",page:De,className:"".concat(E,"-disabled")})));for(var Rt=1;Rt<=De;Rt+=1){var At=ne===Rt;Ue.push(k.a.createElement(c,Object(q.a)({},ht,{key:Rt,page:Rt,active:At})))}}else{var ke=A?L.prev_3:L.prev_5,Oe=A?L.next_3:L.next_5;Le&&(we=k.a.createElement("li",{title:X?ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:v()("".concat(E,"-jump-prev"),Object(z.a)({},"".concat(E,"-jump-prev-custom-icon"),!!Ce))},ce(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ce,"prev page"))),Ge=k.a.createElement("li",{title:X?Oe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:v()("".concat(E,"-jump-next"),Object(z.a)({},"".concat(E,"-jump-next-custom-icon"),!!Ae))},ce(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ae,"next page")))),et=k.a.createElement(c,{locale:L,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:De,page:De,active:!1,showTitle:X,itemRender:ce}),Qe=k.a.createElement(c,{locale:L,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:X,itemRender:ce});var tt=Math.max(1,ne-Xe),it=Math.min(ne+Xe,De);ne-1<=Xe&&(it=1+Xe*2),De-ne<=Xe&&(tt=De-Xe*2);for(var Ne=tt;Ne<=it;Ne+=1){var qe=ne===Ne;Ue.push(k.a.createElement(c,{locale:L,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:qe,showTitle:X,itemRender:ce}))}ne-1>=Xe*2&&ne!==1+2&&(Ue[0]=Object(F.cloneElement)(Ue[0],{className:"".concat(E,"-item-after-jump-prev")}),Ue.unshift(we)),De-ne>=Xe*2&&ne!==De-2&&(Ue[Ue.length-1]=Object(F.cloneElement)(Ue[Ue.length-1],{className:"".concat(E,"-item-before-jump-next")}),Ue.push(Ge)),tt!==1&&Ue.unshift(Qe),it!==De&&Ue.push(et)}var Te=null;ee&&(Te=k.a.createElement("li",{className:"".concat(E,"-total-text")},ee(U,[U===0?0:(ne-1)*ge+1,ne*ge>U?U:ne*ge])));var fe=!this.hasPrev()||!De,me=!this.hasNext()||!De;return k.a.createElement("ul",Object(q.a)({className:v()(E,b,Object(z.a)({},"".concat(E,"-disabled"),P)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},vt),Te,k.a.createElement("li",{title:X?L.prev_page:null,onClick:this.prev,tabIndex:fe?null:0,onKeyPress:this.runIfEnterPrev,className:v()("".concat(E,"-prev"),Object(z.a)({},"".concat(E,"-disabled"),fe)),"aria-disabled":fe},this.renderPrev(yt)),Ue,k.a.createElement("li",{title:X?L.next_page:null,onClick:this.next,tabIndex:me?null:0,onKeyPress:this.runIfEnterNext,className:v()("".concat(E,"-next"),Object(z.a)({},"".concat(E,"-disabled"),me)),"aria-disabled":me},this.renderNext(xt)),k.a.createElement(s,{disabled:P,locale:L,rootPrefixCls:E,selectComponentClass:Pe,selectPrefixCls:Ie,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:ge,pageSizeOptions:pe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Je}))}}],[{key:"getDerivedStateFromProps",value:function(f,u){var E={};if("current"in f&&(E.current=f.current,f.current!==u.current&&(E.currentInputValue=E.current)),"pageSize"in f&&f.pageSize!==u.pageSize){var b=u.current,y=I(f.pageSize,u,f);b=b>y?y:b,"current"in f||(E.current=b,E.currentInputValue=b),E.pageSize=f.pageSize}return E}}]),_}(k.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:o.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var x=w},"6RRn":function(Ke,Me,K){"use strict";var q=K("wCXF"),z=K("n6Qo");K.d(Me,"b",function(){return z.a});var N=K("IBYe"),V=K("6eGT"),W=K("hW8S");K.d(Me,"a",function(){return W.a}),Me.c=q.b},"6UM0":function(Ke,Me,K){var q,z;(function(){var N;(function(){"use strict";var W=[function(k,T,v){var m=v(1).Beautifier,c=v(5).Options;function d(r,s){var o=new m(r,s);return o.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new c}},function(k,T,v){var m=v(2).Output,c=v(3).Token,d=v(4),r=v(5).Options,s=v(7).Tokenizer,o=v(7).line_starters,a=v(7).positionable_operators,l=v(7).TOKEN;function h(A,X){return X.indexOf(A)!==-1}function I(A){return A.replace(/^\s+/g,"")}function w(A){for(var X={},ee=0;ee<A.length;ee++)X[A[ee].replace(/-/g,"_")]=A[ee];return X}function x(A,X){return A&&A.type===l.RESERVED&&A.text===X}function O(A,X){return A&&A.type===l.RESERVED&&h(A.text,X)}var S=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],g=w(_),f=[g.before_newline,g.preserve_newline],u={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(A,X){if(X.multiline_frame||X.mode===u.ForInitializer||X.mode===u.Conditional)return;A.remove_indent(X.start_line_index)}function b(A){A=A.replace(d.allLineBreaks,`
`);for(var X=[],ee=A.indexOf(`
`);ee!==-1;)X.push(A.substring(0,ee)),A=A.substring(ee+1),ee=A.indexOf(`
`);return A.length&&X.push(A),X}function y(A){return A===u.ArrayLiteral}function P(A){return h(A,[u.Expression,u.ForInitializer,u.Conditional])}function R(A,X){for(var ee=0;ee<A.length;ee++){var se=A[ee].trim();if(se.charAt(0)!==X)return!1}return!0}function U(A,X){for(var ee=0,se=A.length,ce;ee<se;ee++)if(ce=A[ee],ce&&ce.indexOf(X)!==0)return!1;return!0}function L(A,X){X=X||{},this._source_text=A||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(X)}L.prototype.create_flags=function(A,X){var ee=0;A&&(ee=A.indentation_level,!this._output.just_added_newline()&&A.line_indent_level>ee&&(ee=A.line_indent_level));var se={mode:X,parent:A,last_token:A?A.last_token:new c(l.START_BLOCK,""),last_word:A?A.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ee,alignment:0,line_indent_level:A?A.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},L.prototype._reset=function(A){var X=A.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,X),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var ee=new s(A,this._options);return this._tokens=ee.tokenize(),A},L.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A,X=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
`,X&&d.lineBreak.test(X||"")&&(ee=X.match(d.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return A=this._output.get_code(ee),A},L.prototype.handle_token=function(A,X){A.type===l.START_EXPR?this.handle_start_expr(A):A.type===l.END_EXPR?this.handle_end_expr(A):A.type===l.START_BLOCK?this.handle_start_block(A):A.type===l.END_BLOCK?this.handle_end_block(A):A.type===l.WORD?this.handle_word(A):A.type===l.RESERVED?this.handle_word(A):A.type===l.SEMICOLON?this.handle_semicolon(A):A.type===l.STRING?this.handle_string(A):A.type===l.EQUALS?this.handle_equals(A):A.type===l.OPERATOR?this.handle_operator(A):A.type===l.COMMA?this.handle_comma(A):A.type===l.BLOCK_COMMENT?this.handle_block_comment(A,X):A.type===l.COMMENT?this.handle_comment(A,X):A.type===l.DOT?this.handle_dot(A):A.type===l.EOF?this.handle_eof(A):A.type===l.UNKNOWN?this.handle_unknown(A,X):this.handle_unknown(A,X)},L.prototype.handle_whitespace_and_comments=function(A,X){var ee=A.newlines,se=this._options.keep_array_indentation&&y(this._flags.mode);if(A.comments_before)for(var ce=A.comments_before.next();ce;)this.handle_whitespace_and_comments(ce,X),this.handle_token(ce,X),ce=A.comments_before.next();if(se)for(var Le=0;Le<ee;Le+=1)this.print_newline(Le>0,X);else if(this._options.max_preserve_newlines&&ee>this._options.max_preserve_newlines&&(ee=this._options.max_preserve_newlines),this._options.preserve_newlines&&ee>1){this.print_newline(!1,X);for(var Ce=1;Ce<ee;Ce+=1)this.print_newline(!0,X)}};var j=["async","break","continue","return","throw","yield"];L.prototype.allow_wrap_or_preserved_newline=function(A,X){if(X=X===void 0?!1:X,this._output.just_added_newline())return;var ee=this._options.preserve_newlines&&A.newlines||X,se=h(this._flags.last_token.text,a)||h(A.text,a);if(se){var ce=h(this._flags.last_token.text,a)&&h(this._options.operator_position,f)||h(A.text,a);ee=ee&&ce}if(ee)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,j))return;this._output.set_wrap_point()}},L.prototype.print_newline=function(A,X){if(!X&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==l.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ee=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&x(ee,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(A)&&(this._flags.multiline_frame=!0)},L.prototype.print_token_line_indentation=function(A){this._output.just_added_newline()&&(this._options.keep_array_indentation&&A.newlines&&(A.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(A.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},L.prototype.print_token=function(A){if(this._output.raw){this._output.add_raw_token(A);return}if(this._options.comma_first&&A.previous&&A.previous.type===l.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var X=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(X),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(A),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(A),this._output.non_breaking_space=!0,this._output.add_token(A.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},L.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.set_mode=function(A){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,A),this._flags=this.create_flags(this._previous_flags,A),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===u.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.start_of_object_property=function(){return this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},L.prototype.start_of_statement=function(A){var X=!1;return X=X||O(this._flags.last_token,["var","let","const"])&&A.type===l.WORD,X=X||x(this._flags.last_token,"do"),X=X||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&O(this._flags.last_token,j)&&!A.newlines,X=X||x(this._flags.last_token,"else")&&!(x(A,"if")&&!A.comments_before),X=X||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),X=X||this._flags.last_token.type===l.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(A.text==="--"||A.text==="++")&&this._last_last_text!=="function"&&A.type!==l.WORD&&A.type!==l.RESERVED,X=X||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),X?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(A,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A,O(A,["do","for","if","while"])),!0):!1},L.prototype.handle_start_expr=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A);var X=u.Expression;if(A.text==="["){if(this._flags.last_token.type===l.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(A),this.set_mode(X),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}X=u.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),h(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,X=u.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,X=u.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&A.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var se=this._tokens.peek(-4);O(ee,["async","function"])||ee.text==="*"&&O(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(se.text==="{"||se.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(A);(this._flags.last_token.type===l.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&h(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===l.START_BLOCK?this.print_newline():(this._flags.last_token.type===l.END_EXPR||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===l.COMMA)&&this.allow_wrap_or_preserved_newline(A,A.newlines),this.print_token(A),this.set_mode(X),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},L.prototype.handle_end_expr=function(A){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(A,A.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===l.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(A),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},L.prototype.handle_start_block=function(A){this.handle_whitespace_and_comments(A);var X=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):ee&&(h(ee.text,[":",","])&&h(X.type,[l.STRING,l.WORD,l.RESERVED])||h(X.text,["get","set","..."])&&h(ee.type,[l.WORD,l.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(ee.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===l.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):h(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!X.comments_before&&X.text==="}",ce=se&&this._flags.last_word==="function"&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var Le=0,Ce=null;this._flags.inline_frame=!0;do if(Le+=1,Ce=this._tokens.peek(Le-1),Ce.newlines){this._flags.inline_frame=!1;break}while(Ce.type!==l.EOF&&!(Ce.type===l.END_BLOCK&&Ce.opened===A))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(ce||this._flags.last_token.type===l.EQUALS||O(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.COMMA)&&((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(A),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(this._flags.last_token.type===l.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(A),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},L.prototype.handle_end_block=function(A){for(this.handle_whitespace_and_comments(A);this._flags.mode===u.Statement;)this.restore_mode();var X=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!X?this._output.space_before_token=!0:this._options.brace_style==="expand"?X||this.print_newline():X||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(A)},L.prototype.handle_word=function(A){if(A.type===l.RESERVED){if(h(A.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)A.type=l.WORD;else if(A.text==="import"&&h(this._tokens.peek().text,["(","."]))A.type=l.WORD;else if(h(A.text,["as","from"])&&!this._flags.import_block)A.type=l.WORD;else if(this._flags.mode===u.ObjectLiteral){var X=this._tokens.peek();X.text===":"&&(A.type=l.WORD)}}if(this.start_of_statement(A)?O(this._flags.last_token,["var","let","const"])&&A.type===l.WORD&&(this._flags.declaration_statement=!0):A.newlines&&!P(this._flags.mode)&&(this._flags.last_token.type!==l.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==l.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(A),this.print_newline()):this.handle_whitespace_and_comments(A),this._flags.do_block&&!this._flags.do_while)if(x(A,"while")){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(A,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(A,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(A),this._flags.in_case=!0;return}if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A)),x(A,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===l.OPERATOR))&&(!this._output.just_added_blankline()&&!A.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,j)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(P(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(A),this._flags.last_word=A.text;return}var ee="NONE";if(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":O(A,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===u.BlockStatement?ee="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&P(this._flags.mode)?ee="SPACE":this._flags.last_token.type===l.STRING?ee="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&h(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===l.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),O(A,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ee="SPACE":ee="NEWLINE"),O(A,["else","catch","finally"]))if((!(this._flags.last_token.type===l.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ee==="NEWLINE"?O(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(A,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?(this._flags.last_token.type!==l.START_EXPR||!O(A,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(A,"if")&&x(A.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(A,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);A.previous&&(A.previous.type===l.WORD||A.previous.type===l.RESERVED)&&(this._output.space_before_token=!0),this.print_token(A),this._flags.last_word=A.text,A.type===l.RESERVED&&(A.text==="do"?this._flags.do_block=!0:A.text==="if"?this._flags.if_block=!0:A.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(A,"from")&&(this._flags.import_block=!1))},L.prototype.handle_semicolon=function(A){this.start_of_statement(A)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(A);for(var X=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&x(X,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(A)},L.prototype.handle_string=function(A){A.text.startsWith("`")&&A.newlines===0&&A.whitespace_before===""&&(A.previous.text===")"||this._flags.last_token.type===l.WORD)||(this.start_of_statement(A)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(A),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A):A.text.startsWith("`")&&this._flags.last_token.type===l.END_EXPR&&(A.previous.text==="]"||A.previous.text===")")&&A.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(A)},L.prototype.handle_equals=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0},L.prototype.handle_comma=function(A){this.handle_whitespace_and_comments(A,!0),this.print_token(A),this._output.space_before_token=!0,this._flags.declaration_statement?(P(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)},L.prototype.handle_operator=function(A){var X=A.text==="*"&&(O(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),ee=h(A.text,["-","+"])&&(h(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||h(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(A)){var se=!X;this.handle_whitespace_and_comments(A,se)}if(A.text==="*"&&this._flags.last_token.type===l.DOT){this.print_token(A);return}if(A.text==="::"){this.print_token(A);return}if(this._flags.last_token.type===l.OPERATOR&&h(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(A),A.text===":"&&this._flags.in_case){this.print_token(A),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ce=!0,Le=!0,Ce=!1;if(A.text===":"?this._flags.ternary_depth===0?ce=!1:(this._flags.ternary_depth-=1,Ce=!0):A.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!X&&this._options.preserve_newlines&&h(A.text,a)){var Ae=A.text===":",Pe=Ae&&Ce,Ie=Ae&&!Ce;switch(this._options.operator_position){case g.before_newline:this._output.space_before_token=!Ie,this.print_token(A),(!Ae||Pe)&&this.allow_wrap_or_preserved_newline(A),this._output.space_before_token=!0;return;case g.after_newline:this._output.space_before_token=!0,!Ae||Pe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(A):this._output.space_before_token=!1,this.print_token(A),this._output.space_before_token=!0;return;case g.preserve_newline:Ie||this.allow_wrap_or_preserved_newline(A),ce=!(this._output.just_added_newline()||Ie),this._output.space_before_token=ce,this.print_token(A),this._output.space_before_token=!0;return}}if(X){this.allow_wrap_or_preserved_newline(A),ce=!1;var pe=this._tokens.peek();Le=pe&&h(pe.type,[l.WORD,l.RESERVED])}else if(A.text==="...")this.allow_wrap_or_preserved_newline(A),ce=this._flags.last_token.type===l.START_BLOCK,Le=!1;else if(h(A.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR)&&this.allow_wrap_or_preserved_newline(A),ce=!1,Le=!1,A.newlines&&(A.text==="--"||A.text==="++"||A.text==="~")){var de=O(this._flags.last_token,S)&&A.newlines;de&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(de,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(ce=!0),this._flags.last_token.type===l.RESERVED?ce=!0:this._flags.last_token.type===l.END_EXPR?ce=!(this._flags.last_token.text==="]"&&(A.text==="--"||A.text==="++")):this._flags.last_token.type===l.OPERATOR&&(ce=h(A.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(A.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(Le=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ce,this.print_token(A),this._output.space_before_token=Le},L.prototype.handle_block_comment=function(A,X){if(this._output.raw){this._output.add_raw_token(A),A.directives&&A.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(A.directives){this.print_newline(!1,X),this.print_token(A),A.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(A.text)&&!A.newlines){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0;return}else this.print_block_commment(A,X)},L.prototype.print_block_commment=function(A,X){var ee=b(A.text),se,ce=!1,Le=!1,Ce=A.whitespace_before,Ae=Ce.length;if(this.print_newline(!1,X),this.print_token_line_indentation(A),this._output.add_token(ee[0]),this.print_newline(!1,X),ee.length>1){for(ee=ee.slice(1),ce=R(ee,"*"),Le=U(ee,Ce),ce&&(this._flags.alignment=1),se=0;se<ee.length;se++)ce?(this.print_token_line_indentation(A),this._output.add_token(I(ee[se]))):Le&&ee[se]?(this.print_token_line_indentation(A),this._output.add_token(ee[se].substring(Ae))):(this._output.current_line.set_indent(-1),this._output.add_token(ee[se])),this.print_newline(!1,X);this._flags.alignment=0}},L.prototype.handle_comment=function(A,X){A.newlines?this.print_newline(!1,X):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(A),this.print_newline(!1,X)},L.prototype.handle_dot=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(A,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(A)},L.prototype.handle_unknown=function(A,X){this.print_token(A),A.text[A.text.length-1]===`
`&&this.print_newline(!1,X)},L.prototype.handle_eof=function(A){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A)},k.exports.Beautifier=L},function(k){function T(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}T.prototype.clone_empty=function(){var c=new T(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},T.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},T.prototype.has_match=function(c){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(c))return!0;return!1},T.prototype.set_indent=function(c,d){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},T.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},T.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},T.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},T.prototype.is_empty=function(){return this.__items.length===0},T.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},T.prototype.push=function(c){this.__items.push(c);var d=c.lastIndexOf(`
`);d!==-1?this.__character_count=c.length-d:this.__character_count+=c.length},T.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},T.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},T.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},T.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},T.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function v(c,d){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),d=d||"",c.indent_level>0&&(d=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}v.prototype.get_indent_size=function(c,d){var r=this.__base_string_length;return d=d||0,c<0&&(r=0),r+=c*this.__indent_size,r+=d,r},v.prototype.get_indent_string=function(c,d){var r=this.__base_string;return d=d||0,c<0&&(c=0,r=""),d+=c*this.__indent_size,this.__ensure_cache(d),r+=this.__cache[d],r},v.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var c=this.__cache.length,d=0,r="";this.__indent_size&&c>=this.__indent_size&&(d=Math.floor(c/this.__indent_size),c-=d*this.__indent_size,r=new Array(d+1).join(this.__indent_string)),c&&(r+=new Array(c+1).join(" ")),this.__cache.push(r)};function m(c,d){this.__indent_cache=new v(c,d),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new T(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(c,d){return this.__indent_cache.get_indent_string(c,d)},m.prototype.get_indent_size=function(c,d){return this.__indent_cache.get_indent_size(c,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(c){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return c!==`
`&&(r=r.replace(/[\n]/g,c)),r},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(c,d){return c=c||0,d=d||0,this.next_line.set_indent(c,d),this.__lines.length>1?(this.current_line.set_indent(c,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(c){for(var d=0;d<c.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(c){for(var d=this.__lines.length;c<d;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(c,d){for(var r=this.__lines.length-2;r>=0;){var s=this.__lines[r];if(s.is_empty())break;if(s.item(0).indexOf(c)!==0&&s.item(-1)!==d){this.__lines.splice(r+1,0,new T(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},k.exports.Output=m},function(k){function T(v,m,c,d){this.type=v,this.text=m,this.comments_before=null,this.newlines=c||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=T},function(k,T){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",d="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",r="(?:\\\\u[0-9a-fA-F]{4}|["+v+c+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+m+c+d+"])*";T.identifier=new RegExp(r+s,"g"),T.identifierStart=new RegExp(r),T.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+c+d+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;T.newline=/[\n\r\u2028\u2029]/,T.lineBreak=new RegExp(`\r
|`+T.newline.source),T.allLineBreaks=new RegExp(T.lineBreak.source,"g")},function(k,T,v){var m=v(6).Options,c=["before-newline","after-newline","preserve-newline"];function d(r){m.call(this,r,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<o.length;a++)o[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",c),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}d.prototype=new m,k.exports.Options=d},function(k){function T(c,d){this.raw_options=v(c,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}T.prototype._get_array=function(c,d){var r=this.raw_options[c],s=d||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(s=r.concat()):typeof r=="string"&&(s=r.split(/[^a-zA-Z0-9_\/\-]+/)),s},T.prototype._get_boolean=function(c,d){var r=this.raw_options[c],s=r===void 0?!!d:!!r;return s},T.prototype._get_characters=function(c,d){var r=this.raw_options[c],s=d||"";return typeof r=="string"&&(s=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},T.prototype._get_number=function(c,d){var r=this.raw_options[c];d=parseInt(d,10),isNaN(d)&&(d=0);var s=parseInt(r,10);return isNaN(s)&&(s=d),s},T.prototype._get_selection=function(c,d,r){var s=this._get_selection_list(c,d,r);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[c]+"'");return s[0]},T.prototype._get_selection_list=function(c,d,r){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[d[0]],!this._is_valid_selection(r,d))throw new Error("Invalid Default Value!");var s=this._get_array(c,r);if(!this._is_valid_selection(s,d))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[c]+"'");return s},T.prototype._is_valid_selection=function(c,d){return c.length&&d.length&&!c.some(function(r){return d.indexOf(r)===-1})};function v(c,d){var r={};c=m(c);var s;for(s in c)s!==d&&(r[s]=c[s]);if(d&&c[d])for(s in c[d])r[s]=c[d][s];return r}function m(c){var d={},r;for(r in c){var s=r.replace(/-/g,"_");d[s]=c[r]}return d}k.exports.Options=T,k.exports.normalizeOpts=m,k.exports.mergeOpts=v},function(k,T,v){var m=v(8).InputScanner,c=v(9).Tokenizer,d=v(9).TOKEN,r=v(13).Directives,s=v(4),o=v(12).Pattern,a=v(14).TemplatablePattern;function l(R,U){return U.indexOf(R)!==-1}var h={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:d.START,RAW:d.RAW,EOF:d.EOF},I=new r(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,O=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var g=new RegExp(_),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),u=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+u.join("|")+")$"),b,y=function(R,U){c.call(this,R,U),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var L=new o(this._input),j=new a(this._input).read_options(this._options);this.__patterns={template:j,identifier:j.starting_with(s.identifier).matching(s.identifierMatch),number:L.matching(w),punct:L.matching(g),comment:L.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:L.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:L.matching(/<!--/),html_comment_end:L.matching(/-->/),include:L.starting_with(/#include/).until_after(s.lineBreak),shebang:L.starting_with(/#!/).until_after(s.lineBreak),xml:L.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:j.until(/['\\\n\r\u2028\u2029]/),double_quote:j.until(/["\\\n\r\u2028\u2029]/),template_text:j.until(/[`\\$]/),template_expression:j.until(/[`}\\]/)}};y.prototype=new c,y.prototype._is_comment=function(R){return R.type===h.COMMENT||R.type===h.BLOCK_COMMENT||R.type===h.UNKNOWN},y.prototype._is_opening=function(R){return R.type===h.START_BLOCK||R.type===h.START_EXPR},y.prototype._is_closing=function(R,U){return(R.type===h.END_BLOCK||R.type===h.END_EXPR)&&U&&(R.text==="]"&&U.text==="["||R.text===")"&&U.text==="("||R.text==="}"&&U.text==="{")},y.prototype._reset=function(){b=!1},y.prototype._get_next_token=function(R,U){var L=null;this._readWhitespace();var j=this._input.peek();return j===null?this._create_token(h.EOF,""):(L=L||this._read_non_javascript(j),L=L||this._read_string(j),L=L||this._read_word(R),L=L||this._read_singles(j),L=L||this._read_comment(j),L=L||this._read_regexp(j,R),L=L||this._read_xml(j,R),L=L||this._read_punctuation(),L=L||this._create_token(h.UNKNOWN,this._input.next()),L)},y.prototype._read_word=function(R){var U;if(U=this.__patterns.identifier.read(),U!=="")return U=U.replace(s.allLineBreaks,`
`),!(R.type===h.DOT||R.type===h.RESERVED&&(R.text==="set"||R.text==="get"))&&E.test(U)?(U==="in"||U==="of")&&(R.type===h.WORD||R.type===h.STRING)?this._create_token(h.OPERATOR,U):this._create_token(h.RESERVED,U):this._create_token(h.WORD,U);if(U=this.__patterns.number.read(),U!=="")return this._create_token(h.WORD,U)},y.prototype._read_singles=function(R){var U=null;return R==="("||R==="["?U=this._create_token(h.START_EXPR,R):R===")"||R==="]"?U=this._create_token(h.END_EXPR,R):R==="{"?U=this._create_token(h.START_BLOCK,R):R==="}"?U=this._create_token(h.END_BLOCK,R):R===";"?U=this._create_token(h.SEMICOLON,R):R==="."&&O.test(this._input.peek(1))?U=this._create_token(h.DOT,R):R===","&&(U=this._create_token(h.COMMA,R)),U&&this._input.next(),U},y.prototype._read_punctuation=function(){var R=this.__patterns.punct.read();if(R!=="")return R==="="?this._create_token(h.EQUALS,R):R==="?."?this._create_token(h.DOT,R):this._create_token(h.OPERATOR,R)},y.prototype._read_non_javascript=function(R){var U="";if(R==="#"){if(this._is_first_token()&&(U=this.__patterns.shebang.read(),U))return this._create_token(h.UNKNOWN,U.trim()+`
`);if(U=this.__patterns.include.read(),U)return this._create_token(h.UNKNOWN,U.trim()+`
`);R=this._input.next();var L="#";if(this._input.hasNext()&&this._input.testChar(x)){do R=this._input.next(),L+=R;while(this._input.hasNext()&&R!=="#"&&R!=="=");return R==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(L+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(L+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,L)}this._input.back()}else if(R==="<"&&this._is_first_token()){if(U=this.__patterns.html_comment_start.read(),U){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)U+=this._input.next();return b=!0,this._create_token(h.COMMENT,U)}}else if(b&&R==="-"&&(U=this.__patterns.html_comment_end.read(),U))return b=!1,this._create_token(h.COMMENT,U);return null},y.prototype._read_comment=function(R){var U=null;if(R==="/"){var L="";if(this._input.peek(1)==="*"){L=this.__patterns.block_comment.read();var j=I.get_directives(L);j&&j.ignore==="start"&&(L+=I.readIgnored(this._input)),L=L.replace(s.allLineBreaks,`
`),U=this._create_token(h.BLOCK_COMMENT,L),U.directives=j}else this._input.peek(1)==="/"&&(L=this.__patterns.comment.read(),U=this._create_token(h.COMMENT,L))}return U},y.prototype._read_string=function(R){if(R==="`"||R==="'"||R==='"'){var U=this._input.next();return this.has_char_escapes=!1,R==="`"?U+=this._read_string_recursive("`",!0,"${"):U+=this._read_string_recursive(R),this.has_char_escapes&&this._options.unescape_strings&&(U=P(U)),this._input.peek()===R&&(U+=this._input.next()),U=U.replace(s.allLineBreaks,`
`),this._create_token(h.STRING,U)}return null},y.prototype._allow_regexp_or_xml=function(R){return R.type===h.RESERVED&&l(R.text,["return","case","throw","else","do","typeof","yield"])||R.type===h.END_EXPR&&R.text===")"&&R.opened.previous.type===h.RESERVED&&l(R.opened.previous.text,["if","while","for"])||l(R.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},y.prototype._read_regexp=function(R,U){if(R==="/"&&this._allow_regexp_or_xml(U)){for(var L=this._input.next(),j=!1,A=!1;this._input.hasNext()&&(j||A||this._input.peek()!==R)&&!this._input.testChar(s.newline);)L+=this._input.peek(),j?j=!1:(j=this._input.peek()==="\\",this._input.peek()==="["?A=!0:this._input.peek()==="]"&&(A=!1)),this._input.next();return this._input.peek()===R&&(L+=this._input.next(),L+=this._input.read(s.identifier)),this._create_token(h.STRING,L)}return null},y.prototype._read_xml=function(R,U){if(this._options.e4x&&R==="<"&&this._allow_regexp_or_xml(U)){var L="",j=this.__patterns.xml.read_match();if(j){for(var A=j[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),X=A.indexOf("{")===0,ee=0;j;){var se=!!j[1],ce=j[2],Le=!!j[j.length-1]||ce.slice(0,8)==="![CDATA[";if(!Le&&(ce===A||X&&ce.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--ee:++ee),L+=j[0],ee<=0)break;j=this.__patterns.xml.read_match()}return j||(L+=this._input.match(/[\s\S]*/g)[0]),L=L.replace(s.allLineBreaks,`
`),this._create_token(h.STRING,L)}}return null};function P(R){for(var U="",L=0,j=new m(R),A=null;j.hasNext();)if(A=j.match(/([\s]|[^\\]|\\\\)+/g),A&&(U+=A[0]),j.peek()==="\\"){if(j.next(),j.peek()==="x")A=j.match(/x([0-9A-Fa-f]{2})/g);else if(j.peek()==="u")A=j.match(/u([0-9A-Fa-f]{4})/g);else{U+="\\",j.hasNext()&&(U+=j.next());continue}if(!A)return R;if(L=parseInt(A[1],16),L>126&&L<=255&&A[0].indexOf("x")===0)return R;if(L>=0&&L<32){U+="\\"+A[0];continue}else L===34||L===39||L===92?U+="\\"+String.fromCharCode(L):U+=String.fromCharCode(L)}return U}y.prototype._read_string_recursive=function(R,U,L){var j,A;R==="'"?A=this.__patterns.single_quote:R==='"'?A=this.__patterns.double_quote:R==="`"?A=this.__patterns.template_text:R==="}"&&(A=this.__patterns.template_expression);for(var X=A.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===R||!U&&s.newline.test(ee)){this._input.back();break}else ee==="\\"&&this._input.hasNext()?(j=this._input.peek(),j==="x"||j==="u"?this.has_char_escapes=!0:j==="\r"&&this._input.peek(1)===`
`&&this._input.next(),ee+=this._input.next()):L&&(L==="${"&&ee==="$"&&this._input.peek()==="{"&&(ee+=this._input.next()),L===ee&&(R==="`"?ee+=this._read_string_recursive("}",U,"`"):ee+=this._read_string_recursive("`",U,"${"),this._input.hasNext()&&(ee+=this._input.next())));ee+=A.read(),X+=ee}return X},k.exports.Tokenizer=y,k.exports.TOKEN=h,k.exports.positionable_operators=S.slice(),k.exports.line_starters=f.slice()},function(k){var T=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var c=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(c=this.__input.charAt(m)),c},v.prototype.__match=function(m,c){m.lastIndex=c;var d=m.exec(this.__input);return d&&!(T&&m.sticky)&&(d.index!==c&&(d=null)),d},v.prototype.test=function(m,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(m,c):!1},v.prototype.testChar=function(m,c){var d=this.peek(c);return m.lastIndex=0,d!==null&&m.test(d)},v.prototype.match=function(m){var c=this.__match(m,this.__position);return c?this.__position+=c[0].length:c=null,c},v.prototype.read=function(m,c,d){var r="",s;return m&&(s=this.match(m),s&&(r+=s[0])),c&&(s||!m)&&(r+=this.readUntil(c,d)),r},v.prototype.readUntil=function(m,c){var d="",r=this.__position;m.lastIndex=this.__position;var s=m.exec(this.__input);return s?(r=s.index,c&&(r+=s[0].length)):r=this.__input_length,d=this.__input.substring(this.__position,r),this.__position=r,d},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,c){var d=null,r="g";return c&&T&&(r="y"),typeof m=="string"&&m!==""?d=new RegExp(m,r):m&&(d=new RegExp(m.source,r)),d},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var c=this.__position,d=this.readUntilAfter(m);return this.__position=c,d},v.prototype.lookBack=function(m){var c=this.__position-1;return c>=m.length&&this.__input.substring(c-m.length,c).toLowerCase()===m},k.exports.InputScanner=v},function(k,T,v){var m=v(8).InputScanner,c=v(3).Token,d=v(10).TokenStream,r=v(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(a,l){this._input=new m(a),this._options=l||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,l=new c(s.START,""),h=null,I=[],w=new d;l.type!==s.EOF;){for(a=this._get_next_token(l,h);this._is_comment(a);)w.add(a),a=this._get_next_token(l,h);w.isEmpty()||(a.comments_before=w,w=new d),a.parent=h,this._is_opening(a)?(I.push(h),h=a):h&&this._is_closing(a,h)&&(a.opened=h,h.closed=a,h=I.pop(),a.parent=h),a.previous=l,l.next=a,this.__tokens.add(a),l=a}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(a,l){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(s.RAW,h):this._create_token(s.EOF,"")},o.prototype._is_comment=function(a){return!1},o.prototype._is_opening=function(a){return!1},o.prototype._is_closing=function(a,l){return!1},o.prototype._create_token=function(a,l){var h=new c(a,l,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=o,k.exports.TOKEN=s},function(k){function T(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}T.prototype.restart=function(){this.__position=0},T.prototype.isEmpty=function(){return this.__tokens_length===0},T.prototype.hasNext=function(){return this.__position<this.__tokens_length},T.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},T.prototype.peek=function(v){var m=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(m=this.__tokens[v]),m},T.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},k.exports.TokenStream=T},function(k,T,v){var m=v(12).Pattern;function c(d,r){m.call(this,d,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}c.prototype=new m,c.prototype.__set_whitespace_patterns=function(d,r){d+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},c.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var r=this.__split(this._newline_regexp,d);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return d},c.prototype.matching=function(d,r){var s=this._create();return s.__set_whitespace_patterns(d,r),s._update(),s},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(d,r){d.lastIndex=0;for(var s=0,o=[],a=d.exec(r);a;)o.push(r.substring(s,a.index)),s=a.index+a[0].length,a=d.exec(r);return s<r.length?o.push(r.substring(s,r.length)):o.push(""),o},k.exports.WhitespacePattern=c},function(k){function T(v,m){this._input=v,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}T.prototype.read=function(){var v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},T.prototype.read_match=function(){return this._input.match(this._match_pattern)},T.prototype.until_after=function(v){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(v),m._update(),m},T.prototype.until=function(v){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(v),m._update(),m},T.prototype.starting_with=function(v){var m=this._create();return m._starting_pattern=this._input.get_regexp(v,!0),m._update(),m},T.prototype.matching=function(v){var m=this._create();return m._match_pattern=this._input.get_regexp(v,!0),m._update(),m},T.prototype._create=function(){return new T(this._input,this)},T.prototype._update=function(){},k.exports.Pattern=T},function(k){function T(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}T.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(v);c;)m[c[1]]=c[2],c=this.__directive_pattern.exec(v);return m},T.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=T},function(k,T,v){var m=v(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(r,s){m.call(this,r,s),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var o=new m(r);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new m,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(r){var s=this._create();return s._disabled[r]=!0,s._update(),s},d.prototype.read_options=function(r){var s=this._create();for(var o in c)s._disabled[o]=r.templating.indexOf(o)===-1;return s._update(),s},d.prototype.exclude=function(r){var s=this._create();return s._excluded[r]=!0,s._update(),s},d.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),r+=s,s=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},d.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},d.prototype._read_template=function(){var r="",s=this._input.peek();if(s==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(r=r||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},k.exports.TemplatablePattern=d}],D={};function H(k){var T=D[k];if(T!==void 0)return T.exports;var v=D[k]={exports:{}};return W[k](v,v.exports,H),v.exports}var F=H(0);N=F})();var V=N;!(q=[],z=function(){return{js_beautify:V}}.apply(Me,q),z!==void 0&&(Ke.exports=z))})()},"6eGT":function(Ke,Me,K){"use strict";function q(z){return null}Me.a=q},"7Cbv":function(Ke,Me,K){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function N(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(z)}var V=/^(?:[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 W(c){return typeof c=="string"&&V.test(c)}for(var D=W,H=[],F=0;F<256;++F)H.push((F+256).toString(16).substr(1));function k(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(H[c[d+0]]+H[c[d+1]]+H[c[d+2]]+H[c[d+3]]+"-"+H[c[d+4]]+H[c[d+5]]+"-"+H[c[d+6]]+H[c[d+7]]+"-"+H[c[d+8]]+H[c[d+9]]+"-"+H[c[d+10]]+H[c[d+11]]+H[c[d+12]]+H[c[d+13]]+H[c[d+14]]+H[c[d+15]]).toLowerCase();if(!D(r))throw TypeError("Stringified UUID is invalid");return r}var T=k;function v(c,d,r){c=c||{};var s=c.random||(c.rng||N)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,d){r=r||0;for(var o=0;o<16;++o)d[r+o]=s[o];return d}return T(s)}var m=Me.a=v},"7ZXX":function(Ke,Me,K){Ke.exports=K.p+"static/err.6e7c5817.png"},"7ahc":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return I});var q=K("k1fw"),z=K("0Owb"),N=K("+L6B"),V=K("2/Rp"),W=K("y8nQ"),D=K("Vl3Y"),H=K("tJVT"),F=K("OaEy"),k=K("2fM7"),T=K("q1tI"),v=K.n(T),m=K("VrN/"),c=K.n(m),d=K("p77/"),r=K.n(d),s=K("c5Ni"),o=K.n(s),a=k.a.Option,l={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"]};Me.b=function(w){var x=w.callback,O=w.onCancel,S=Object(T.useState)("python"),_=Object(H.a)(S,2),g=_[0],f=_[1];function u(b){f(h[b][1])}function E(b){x(b)}return v.a.createElement(D.a,Object(z.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),v.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(k.a,{onChange:u},Object.keys(h).map(function(b){return v.a.createElement(a,{key:b,value:b},h[b][0])}))),v.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(I,{mode:g})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(V.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function I(w){var x=w.value,O=w.onChange,S=w.mode,_=w.options,g=_===void 0?{}:_,f=Object(T.useRef)(),u=Object(T.useState)(),E=Object(H.a)(u,2),b=E[0],y=E[1];return Object(T.useEffect)(function(){if(b){function P(R){var U=R.getValue();O&&O(U)}return b.on("change",P),function(){b.off("change",P)}}},[b,O]),Object(T.useEffect)(function(){b&&b.setOption("mode",S)},[b,S]),Object(T.useEffect)(function(){b&&((x!==b.getValue()||x==="")&&setTimeout(function(){b.setValue(x||" ")},300))},[b,x]),Object(T.useEffect)(function(){if(f.current&&!b){var P=c.a.fromTextArea(f.current,Object(q.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},g));y(P)}},[f.current,b]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:f}))}},"7ixt":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return N});var q={adjustX:1,adjustY:1},z=[0,0],N={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:z}},V=N},"7v3h":function(Ke,Me,K){Ke.exports=K.p+"static/empty2.dd73f390.png"},"8/bI":function(Ke,Me,K){Ke.exports=K.p+"static/empty.8918e228.png"},"815F":function(Ke,Me,K){"use strict";K.d(Me,"e",function(){return H}),K.d(Me,"c",function(){return k}),K.d(Me,"d",function(){return T}),K.d(Me,"a",function(){return m}),K.d(Me,"f",function(){return c}),K.d(Me,"b",function(){return d});var q=K("KQm4"),z=K("VTBJ"),N=K("Ff2n"),V=K("Zm9Q"),W=K("Kwbf"),D=K("OZM5");function H(r,s){return r!=null?r:s}function F(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function o(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(h){var I=h.key,w=h.children;Object(W.a)(I!=null,"Tree node must have a certain key: [".concat(l).concat(I,"]"));var x=String(I);Object(W.a)(!s.has(x)||I===null||I===void 0,"Same 'key' exist in the Tree: ".concat(x)),s.set(x,!0),o(w,"".concat(l).concat(x," > "))})}o(r)}function k(r){function s(o){var a=Object(V.a)(o);return a.map(function(l){if(!Object(D.i)(l))return Object(W.a)(!l,"Tree/TreeNode can only accept TreeNode as children."),null;var h=l.key,I=l.props,w=I.children,x=Object(N.a)(I,["children"]),O=Object(z.a)({key:h},x),S=s(w);return S.length&&(O.children=S),O}).filter(function(l){return l})}return s(r)}function T(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=new Set(s===!0?[]:s),a=[];function l(h){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(w,x){var O=Object(D.h)(I?I.pos:"0",x),S=H(w.key,O),_=Object(z.a)(Object(z.a)({},w),{},{parent:I,pos:O,children:null,data:w,isStart:[].concat(Object(q.a)(I?I.isStart:[]),[x===0]),isEnd:[].concat(Object(q.a)(I?I.isEnd:[]),[x===h.length-1])});return a.push(_),s===!0||o.has(S)?_.children=l(w.children||[],_):_.children=[],_})}return l(r),a}function v(r,s,o){var a;o?typeof o=="string"?a=function(I){return I[o]}:typeof o=="function"&&(a=function(I){return o(I)}):a=function(I,w){return H(I.key,w)};function l(h,I,w){var x=h?h.children:r,O=h?Object(D.h)(w.pos,I):"0";if(h){var S=a(h,O),_={node:h,index:I,pos:O,key:S,parentPos:w.node?w.pos:null,level:w.level+1};s(_)}x&&x.forEach(function(g,f){l(g,f,{node:h,pos:O,level:w?w.level+1:-1})})}l(null)}function m(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.initWrapper,a=s.processEntity,l=s.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,I={},w={},x={posEntities:I,keyEntities:w};return o&&(x=o(x)||x),v(r,function(O){var S=O.node,_=O.index,g=O.pos,f=O.key,u=O.parentPos,E=O.level,b={node:S,index:_,key:f,pos:g,level:E},y=H(f,g);I[g]=b,w[y]=b,b.parent=I[u],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),a&&a(b,x)},h),l&&l(x),x}function c(r,s){var o=s.expandedKeys,a=s.selectedKeys,l=s.loadedKeys,h=s.loadingKeys,I=s.checkedKeys,w=s.halfCheckedKeys,x=s.dragOverNodeKey,O=s.dropPosition,S=s.keyEntities,_=S[r],g={eventKey:r,expanded:o.indexOf(r)!==-1,selected:a.indexOf(r)!==-1,loaded:l.indexOf(r)!==-1,loading:h.indexOf(r)!==-1,checked:I.indexOf(r)!==-1,halfChecked:w.indexOf(r)!==-1,pos:String(_?_.pos:""),dragOver:x===r&&O===0,dragOverGapTop:x===r&&O===-1,dragOverGapBottom:x===r&&O===1};return g}function d(r){var s=r.data,o=r.expanded,a=r.selected,l=r.checked,h=r.loaded,I=r.loading,w=r.halfChecked,x=r.dragOver,O=r.dragOverGapTop,S=r.dragOverGapBottom,_=r.pos,g=r.active,f=Object(z.a)(Object(z.a)({},s),{},{expanded:o,selected:a,checked:l,loaded:h,loading:I,halfChecked:w,dragOver:x,dragOverGapTop:O,dragOverGapBottom:S,pos:_,active:g});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(W.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),r}}),f}},"8EBN":function(Ke,Me,K){(function(q){q(K("VrN/"))})(function(q){"use strict";q.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 z=0;z<q.modeInfo.length;z++){var N=q.modeInfo[z];N.mimes&&(N.mime=N.mimes[0])}q.findModeByMIME=function(V){V=V.toLowerCase();for(var W=0;W<q.modeInfo.length;W++){var D=q.modeInfo[W];if(D.mime==V)return D;if(D.mimes){for(var H=0;H<D.mimes.length;H++)if(D.mimes[H]==V)return D}}if(/\+xml$/.test(V))return q.findModeByMIME("application/xml");if(/\+json$/.test(V))return q.findModeByMIME("application/json")},q.findModeByExtension=function(V){V=V.toLowerCase();for(var W=0;W<q.modeInfo.length;W++){var D=q.modeInfo[W];if(D.ext){for(var H=0;H<D.ext.length;H++)if(D.ext[H]==V)return D}}},q.findModeByFileName=function(V){for(var W=0;W<q.modeInfo.length;W++){var D=q.modeInfo[W];if(D.file&&D.file.test(V))return D}var H=V.lastIndexOf("."),F=H>-1&&V.substring(H+1,V.length);if(F)return q.findModeByExtension(F)},q.findModeByName=function(V){V=V.toLowerCase();for(var W=0;W<q.modeInfo.length;W++){var D=q.modeInfo[W];if(D.name.toLowerCase()==V)return D;if(D.alias){for(var H=0;H<D.alias.length;H++)if(D.alias[H].toLowerCase()==V)return D}}}})},"8hTe":function(Ke,Me,K){Ke.exports={button:"button___1wy9m"}},"9Bee":function(Ke,Me,K){"use strict";var q=K("DYRE"),z=K("zeV3"),N=K("+L6B"),V=K("2/Rp"),W=K("k1fw"),D=K("9og8"),H=K("tJVT"),F=K("WmNS"),k=K.n(F),T=K("q1tI"),v=K.n(T),m=K("vg9a"),c=K("DlQD"),d=K.n(c),r=K("rUJ1");function s(Y,C){var M=Y.match(/^(\s+)(?:```)/);if(M===null)return C;var G=M[1];return C.split(`
`).map(function(te){var Q=te.match(/^\s+/);if(Q===null)return te;var Se=Object(H.a)(Q,1),ot=Se[0];return ot.length>=G.length?te.slice(G.length):te}).join(`
`)}var o=[],a=["<ul>"],l=new d.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function I(){o.length=0,a=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(Y,C,M,G){if(C>=Y.length||Y[C].level<=M)return C;var te=Y[C];G.push("<li><a href='#"+te.anchor+"'>"+te.text+"</a>"),C++;var Q=[];return C=x(Y,C,te.level,Q),Q.length>0&&(G.push("<ul>"),Q.forEach(function(Se){G.push(Se)}),G.push("</ul>")),G.push("</li>"),C=x(Y,C,M,G),C}function O(){return x(o,0,0,a),a.push("</ul>"),a.join("")}var S={heading:function(C){var M=h.exec(C);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},fences:function(C){var M=this.rules.block.fences.exec(C);if(M){var G=M[0],te=s(G,M[3]||""),Q=M[2]?M[2].trim():M[2];if(["latex","katex","math"].indexOf(Q)>=0){var Se=f(),ot=te;te=Se,u[Se]={type:"block",expression:ot}}return{type:"code",raw:G,lang:Q,text:te}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,f=function(){return"__special_katext_id_".concat(g++,"__")},u={};function E(){return u}function b(){g=0,u={}}function y(Y){return Y=Y.replace(_,function(C,M){var G=f();return u[G]={type:"inline",expression:M},G}),Y}var P=l.listitem;l.listitem=function(Y){return P(y(Y))};var R=l.paragraph;l.paragraph=function(Y){return R(y(Y))};var U=l.tablecell;l.tablecell=function(Y,C){return U(y(Y),C)},l.code=function(Y,C,M){var G=(C||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"<p class='editormd-tex'>".concat(Y,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(C,'">').concat(M?Y:Object(r.escape)(Y,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(M?Y:Object(r.escape)(Y,!0))+"</code></pre>"},l.heading=function(Y,C,M){var G=this.options.headerPrefix+M.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:G,level:C,text:Y}),"<h"+C+' id="'+G+'">'+Y+"</h"+C+">"},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:S,renderer:l});var L=d.a,j=K("SJMd"),A=K("ulZh"),X=K.n(A),ee=K("m3rI"),se=K("Oy/b"),ce=K("p5ED"),Le=K("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 Ce=function(Y,C){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,G){M.__proto__=G}||function(M,G){for(var te in G)Object.prototype.hasOwnProperty.call(G,te)&&(M[te]=G[te])})(Y,C)};function Ae(Y,C){function M(){this.constructor=Y}Ce(Y,C),Y.prototype=C===null?Object.create(C):(M.prototype=C.prototype,new M)}function Pe(Y,C,M,G){return new(M||(M=Promise))(function(te,Q){function Se(Pt){try{St(G.next(Pt))}catch(ut){Q(ut)}}function ot(Pt){try{St(G.throw(Pt))}catch(ut){Q(ut)}}function St(Pt){var ut;Pt.done?te(Pt.value):(ut=Pt.value,ut instanceof M?ut:new M(function(Vt){Vt(ut)})).then(Se,ot)}St((G=G.apply(Y,C||[])).next())})}function Ie(Y,C){var M,G,te,Q,Se={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return Q={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ot(St){return function(Pt){return function(ut){if(M)throw new TypeError("Generator is already executing.");for(;Se;)try{if(M=1,G&&(te=2&ut[0]?G.return:ut[0]?G.throw||((te=G.return)&&te.call(G),0):G.next)&&!(te=te.call(G,ut[1])).done)return te;switch(G=0,te&&(ut=[2&ut[0],te.value]),ut[0]){case 0:case 1:te=ut;break;case 4:return Se.label++,{value:ut[1],done:!1};case 5:Se.label++,G=ut[1],ut=[0];continue;case 7:ut=Se.ops.pop(),Se.trys.pop();continue;default:if(!(te=Se.trys,(te=te.length>0&&te[te.length-1])||ut[0]!==6&&ut[0]!==2)){Se=0;continue}if(ut[0]===3&&(!te||ut[1]>te[0]&&ut[1]<te[3])){Se.label=ut[1];break}if(ut[0]===6&&Se.label<te[1]){Se.label=te[1],te=ut;break}if(te&&Se.label<te[2]){Se.label=te[2],Se.ops.push(ut);break}te[2]&&Se.ops.pop(),Se.trys.pop();continue}ut=C.call(Y,Se)}catch(Vt){ut=[6,Vt],G=0}finally{M=te=0}if(5&ut[0])throw ut[1];return{value:ut[0]?ut[1]:void 0,done:!0}}([St,Pt])}}}function pe(){for(var Y=0,C=0,M=arguments.length;C<M;C++)Y+=arguments[C].length;var G=Array(Y),te=0;for(C=0;C<M;C++)for(var Q=arguments[C],Se=0,ot=Q.length;Se<ot;Se++,te++)G[te]=Q[Se];return G}var de=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(C,M){for(var G=0,te=M;G<te.length;G++){var Q=te[G],Se=Q[0],ot=Q[1];C.setAttribute(Se,ot)}},Y.createRect=function(C,M,G){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",C.toString()),te.setAttribute("height",M.toString()),G&&Y.setAttributes(te,G),te},Y.createLine=function(C,M,G,te,Q){var Se=document.createElementNS("http://www.w3.org/2000/svg","line");return Se.setAttribute("x1",C.toString()),Se.setAttribute("y1",M.toString()),Se.setAttribute("x2",G.toString()),Se.setAttribute("y2",te.toString()),Q&&Y.setAttributes(Se,Q),Se},Y.createPolygon=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",C),M&&Y.setAttributes(G,M),G},Y.createCircle=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(C/2).toString()),G.setAttribute("cy",(C/2).toString()),G.setAttribute("r",C.toString()),M&&Y.setAttributes(G,M),G},Y.createEllipse=function(C,M,G){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(C/2).toString()),te.setAttribute("cy",(M/2).toString()),te.setAttribute("rx",(C/2).toString()),te.setAttribute("ry",(M/2).toString()),G&&Y.setAttributes(te,G),te},Y.createGroup=function(C){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return C&&Y.setAttributes(M,C),M},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(C,M,G,te,Q,Se,ot){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(St,[["id",C],["orient",M],["markerWidth",G.toString()],["markerHeight",te.toString()],["refX",Q.toString()],["refY",Se.toString()]]),St.appendChild(ot),St},Y.createText=function(C){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),C&&Y.setAttributes(M,C),M},Y.createTSpan=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=C,M&&Y.setAttributes(G,M),G},Y.createImage=function(C){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return C&&Y.setAttributes(M,C),M},Y.createPoint=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=C,G.y=M,G},Y.createPath=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",C),M&&Y.setAttributes(G,M),G},Y}(),ne=function(){function Y(){}return Y.addKey=function(C){Y.key=C},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),ge=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(C,M,G){var te=this;return new Promise(function(Q){var Se=G!==void 0?G:document.createElement("canvas");C===null&&(te.markersOnly=!0,te.naturalSize=!1);var ot=document.createElementNS("http://www.w3.org/2000/svg","svg");ot.setAttribute("xmlns","http://www.w3.org/2000/svg"),ot.setAttribute("width",M.width.baseVal.valueAsString),ot.setAttribute("height",M.height.baseVal.valueAsString),ot.setAttribute("viewBox","0 0 "+M.viewBox.baseVal.width.toString()+" "+M.viewBox.baseVal.height.toString()),ot.innerHTML=M.innerHTML,te.naturalSize===!0?(ot.width.baseVal.value=C.naturalWidth,ot.height.baseVal.value=C.naturalHeight):te.width!==void 0&&te.height!==void 0&&(ot.width.baseVal.value=te.width,ot.height.baseVal.value=te.height),Se.width=ot.width.baseVal.value,Se.height=ot.height.baseVal.value;var St=ot.outerHTML,Pt=Se.getContext("2d");te.markersOnly!==!0&&Pt.drawImage(C,0,0,Se.width,Se.height);var ut=window.URL,Vt=new Image(Se.width,Se.height);Vt.setAttribute("crossOrigin","anonymous");var tn=new Blob([St],{type:"image/svg+xml"}),Sn=ut.createObjectURL(tn);Vt.onload=function(){Pt.drawImage(Vt,0,0),ut.revokeObjectURL(Sn);var wn=Se.toDataURL(te.imageType,te.imageQuality);Q(wn)},Vt.src=Sn})},Y}(),oe=function(){},De=function(){function Y(C){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+C+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(C){return this.styleSheet===void 0&&this.addStyleSheet(),C.name=""+this.classNamePrefix+C.localName,this.classes.push(C),this.styleSheet.sheet.insertRule("."+C.name+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length),C},Y.prototype.addRule=function(C){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(C),this.styleSheet.sheet.insertRule(C.selector+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var C;this.styleSheet=document.createElement("style"),((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).appendChild(this.styleSheet),this.addRule(new Ue("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new we("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new we("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var C;this.styleSheet&&(((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),Ue=function(Y,C){this.selector=Y,this.style=C},we=function(Y,C){this.localName=Y,this.style=C},Ge=function(){function Y(C,M,G,te,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=C,this.displayMode=M,this.markerItems=G,this.uiStyleSettings=te,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Y.prototype.show=function(C){var M=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",this.uiContainer.appendChild(G),this.addActionButton(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(G,'<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(Q){var Se=document.createElement("div");Se.className=""+M.toolbarButtonStyleClass.name,Se.setAttribute("data-type-name",Q.typeName),Se.innerHTML=Q.icon,Se.addEventListener("click",function(){M.markerToolbarButtonClicked(Se,Q)}),M.buttons.push(Se),M.markerButtons.push(Se)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var te=document.createElement("div");te.className=this.toolbarBlockStyleClass.name,te.style.whiteSpace="nowrap",te.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(te),this.addActionButton(te,'<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(te,'<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()},Y.prototype.addButtonClickListener=function(C){this.buttonClickListeners.push(C)},Y.prototype.removeButtonClickListener=function(C){this.buttonClickListeners.indexOf(C)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(C),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var C=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var M=0;M<this.markerButtons.length;M++)M<C||M===C&&this.markerButtons.length-1===C?this.markerButtonBlock.appendChild(this.markerButtons[M]):(M===C&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[M]))}},Y.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")},Y.prototype.resetButtonStyles=function(){var C=this;this.buttons.forEach(function(M){M.className=M.className.replace(C.uiStyleSettings.toolbarButtonStyleColorsClassName?C.uiStyleSettings.toolbarButtonStyleColorsClassName:C.toolbarButtonStyleColorsClass.name,"").trim(),M.className=M.className.replace(C.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?C.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:C.toolbarActiveButtonStyleColorsClass.name,"").trim(),M.className+=" "+(C.uiStyleSettings.toolbarButtonStyleColorsClassName?C.uiStyleSettings.toolbarButtonStyleColorsClassName:C.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(C,M,G){var te=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=M,Q.setAttribute("data-action",G),Q.addEventListener("click",function(){te.actionToolbarButtonClicked(Q,G)}),G){case"select":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Q.style.fill=this.uiStyleSettings.closeButtonColor}C.appendChild(Q),this.buttons.push(Q)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new we("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 we("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new we("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new we("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 we("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new we("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
padding: `+C+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new we("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new we("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ue("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ue("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Y.prototype.markerToolbarButtonClicked=function(C,M){this.setActiveButton(C),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("marker",M)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(C,M){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",M)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(C){this.resetButtonStyles(),C.className=C.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),C.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(C){var M=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===C});M&&this.setActiveButton(M)},Y.prototype.setCurrentMarker=function(C){var M=this;this.currentMarker=C,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){M.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},Y}(),Qe=function(){function Y(C,M,G,te){this.panels=[],this.panelButtons=[],this.markerjsContainer=C,this.displayMode=M,this.uiStyleSettings=G,this.styles=te,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var C;this.toolboxStyleClass=this.styles.addClass(new we("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 we("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new we("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new we("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new we("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 we("toolbox-panel-row_colors",`
background-color: `+((C=this.uiStyleSettings.toolboxBackgroundColor)!==null&&C!==void 0?C:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new we("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
padding: `+M+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new we("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new we("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ue("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ue("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Y.prototype.show=function(C){var M;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolboxStyleClass.name+" "+((M=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(C){var M,G,te=this;this.panels=C,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((G=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&G!==void 0?G:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var Se;Q.uiStyleSettings=te.uiStyleSettings;var ot=document.createElement("div");ot.className=te.toolboxButtonStyleClass.name+" "+((Se=te.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Se!==void 0?Se:te.toolboxButtonStyleColorsClass.name),ot.innerHTML=Q.icon,ot.title=Q.title,ot.addEventListener("click",function(){te.panelButtonClick(Q)}),te.panelButtons.push(ot),te.buttonRow.appendChild(ot)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(C){var M=this,G=-1;if(C!==this.activePanel){G=this.panels.indexOf(C),this.panelRow.innerHTML="";var te=C.getUi();te.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(te),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=C}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){M.displayMode==="inline"?M.panelRow.style.display="none":M.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,Se){var ot,St;Q.className=M.toolboxButtonStyleClass.name+" "+(Se===G?""+((ot=M.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ot!==void 0?ot:M.toolboxActiveButtonStyleColorsClass.name):""+((St=M.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:M.toolboxButtonStyleColorsClass.name))})},Y}(),et=function(Y,C){this.title=Y,this.icon=C},ze=function(Y){function C(M,G,te,Q){var Se=Y.call(this,M,Q||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Se.colors=[],Se.addTransparent=!1,Se.colorBoxes=[],Se.colors=G,Se.currentColor=te,Se.setCurrentColor=Se.setCurrentColor.bind(Se),Se.getColorBox=Se.getColorBox.bind(Se),Se}return Ae(C,Y),C.prototype.getUi=function(){var M=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(te){var Q=M.getColorBox(te);G.appendChild(Q),M.colorBoxes.push(Q)}),G},C.prototype.getColorBox=function(M){var G=this,te=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-te,Se=document.createElement("div");Se.style.display="inline-block",Se.style.boxSizing="content-box",Se.style.width=Q-2+"px",Se.style.height=Q-2+"px",Se.style.padding="1px",Se.style.marginRight="2px",Se.style.marginBottom="2px",Se.style.borderWidth="2px",Se.style.borderStyle="solid",Se.style.borderRadius=(Q+2)/2+"px",Se.style.borderColor=M===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Se.addEventListener("click",function(){G.setCurrentColor(M,Se)});var ot=document.createElement("div");return ot.style.display="inline-block",ot.style.width=Q-2+"px",ot.style.height=Q-2+"px",ot.style.backgroundColor=M,ot.style.borderRadius=Q/2+"px",M==="transparent"&&(ot.style.fill=this.uiStyleSettings.toolboxAccentColor,ot.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Se.appendChild(ot),Se},C.prototype.setCurrentColor=function(M,G){var te=this;this.currentColor=M,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(M)},C}(et),Je=function(){function Y(C,M,G){this._state="new",this._isSelected=!1,this._container=C,this._overlayContainer=M,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(C){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(C,M){},Y.prototype.dblClick=function(C,M){},Y.prototype.manipulate=function(C){},Y.prototype.pointerUp=function(C){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(C){this.container.childNodes.length>0?this.container.insertBefore(C,this.container.childNodes[0]):this.container.appendChild(C)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(C){this._state=C.state,this.notes=C.notes},Y.prototype.scale=function(C,M){},Y.prototype.colorChanged=function(C){this.onColorChanged&&this.onColorChanged(C),this.stateChanged()},Y.prototype.fillColorChanged=function(C){this.onFillColorChanged&&this.onFillColorChanged(C),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var C=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),C.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(C)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Xe=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(C){return this.topLeft.ownsTarget(C)?this.topLeft:this.topCenter.ownsTarget(C)?this.topCenter:this.topRight.ownsTarget(C)?this.topRight:this.centerLeft.ownsTarget(C)?this.centerLeft:this.centerRight.ownsTarget(C)?this.centerRight:this.bottomLeft.ownsTarget(C)?this.bottomLeft:this.bottomCenter.ownsTarget(C)?this.bottomCenter:this.bottomRight.ownsTarget(C)?this.bottomRight:void 0},Y}(),yt=function(){function Y(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},Y}(),xt=function(){function Y(){}return Y.toITransformMatrix=function(C){return{a:C.a,b:C.b,c:C.c,d:C.d,e:C.e,f:C.f}},Y.toSVGMatrix=function(C,M){return C.a=M.a,C.b=M.b,C.c=M.c,C.d=M.d,C.e=M.e,C.f=M.f,C},Y}(),vt=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(de.createTransform()),Q.setupControlBox(),Q}return Ae(C,Y),Object.defineProperty(C.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"visual",{get:function(){return this._visual},set:function(M){this._visual=M;var G=de.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(M){return!!Y.prototype.ownsTarget.call(this,M)||!!(this.controlGrips.findGripByVisual(M)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M))},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.state==="new"&&(this.left=M.x,this.top=M.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var te=this.unrotatePoint(M);if(this.manipulationStartX=te.x,this.manipulationStartY=te.y,this.offsetX=te.x-this.left,this.offsetY=te.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Se=this.container.transform.baseVal.getItem(0);Se.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Se,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},C.prototype.pointerUp=function(M){var G=this.state;Y.prototype.pointerUp.call(this,M),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(M),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},C.prototype.moveVisual=function(M){this.visual.style.transform="translate("+M.x+"px, "+M.y+"px)"},C.prototype.manipulate=function(M){var G=this.unrotatePoint(M);this.state==="creating"?this.resize(M):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(M)},C.prototype.resize=function(M){var G=this.manipulationStartLeft,te=this.manipulationStartWidth,Q=this.manipulationStartTop,Se=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+M.x-this.manipulationStartX,te=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:te=this.manipulationStartWidth+M.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+M.y-this.manipulationStartY,Se=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Se=this.manipulationStartHeight+M.y-this.manipulationStartY}te>=0?(this.left=G,this.width=te):(this.left=G+te,this.width=-te),Se>=0?(this.top=Q,this.height=Se):(this.top=Q+Se,this.height=-Se),this.setSize()},C.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},C.prototype.rotate=function(M){if(Math.abs(M.x-this.centerX)>.1){var G=Math.sign(M.x-this.centerX);this.rotationAngle=180*Math.atan((M.y-this.centerY)/(M.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},C.prototype.applyRotation=function(){var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0)},C.prototype.rotatePoint=function(M){if(this.rotationAngle===0)return M;var G=this.container.getCTM(),te=de.createPoint(M.x,M.y);return{x:(te=te.matrixTransform(G)).x,y:te.y}},C.prototype.unrotatePoint=function(M){if(this.rotationAngle===0)return M;var G=this.container.getCTM();G=G.inverse();var te=de.createPoint(M.x,M.y);return{x:(te=te.matrixTransform(G)).x,y:te.y}},C.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var M=de.createTransform();M.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(M),this.container.appendChild(this.controlBox),this.controlRect=de.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=de.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 Xe,this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){var M=this.controlBox.transform.baseVal.getItem(0);M.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(M,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()},C.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()},C.prototype.createGrip=function(){var M=new yt;return M.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(M.visual),M},C.prototype.positionGrips=function(){var M=this.controlGrips.topLeft.GRIP_SIZE,G=-M/2,te=G,Q=(this.width+this.CB_DISTANCE)/2-M/2,Se=(this.height+this.CB_DISTANCE)/2-M/2,ot=this.height+this.CB_DISTANCE-M/2,St=this.width+this.CB_DISTANCE-M/2;this.positionGrip(this.controlGrips.topLeft.visual,G,te),this.positionGrip(this.controlGrips.topCenter.visual,Q,te),this.positionGrip(this.controlGrips.topRight.visual,St,te),this.positionGrip(this.controlGrips.centerLeft.visual,G,Se),this.positionGrip(this.controlGrips.centerRight.visual,St,Se),this.positionGrip(this.controlGrips.bottomLeft.visual,G,ot),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,ot),this.positionGrip(this.controlGrips.bottomRight.visual,St,ot),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,te-3*this.CB_DISTANCE)},C.prototype.positionGrip=function(M,G,te){var Q=M.transform.baseVal.getItem(0);Q.setTranslate(G,te),M.transform.baseVal.replaceItem(Q,0)},C.prototype.hideControlBox=function(){this.controlBox.style.display="none"},C.prototype.showControlBox=function(){this.controlBox.style.display=""},C.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:xt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:xt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},C.prototype.restoreState=function(M){Y.prototype.restoreState.call(this,M);var G=M;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(xt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(xt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G);var te=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:te.x*M,y:te.y*G});this.left=Q.x,this.top=Q.y,this.width=this.width*M,this.height=this.height*G,this.adjustControlBox()},C}(Je),ht=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.visual)},C.prototype.createVisual=function(){this.visual=de.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)},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},C.prototype.manipulate=function(M){Y.prototype.manipulate.call(this,M)},C.prototype.resize=function(M){Y.prototype.resize.call(this,M),this.setSize()},C.prototype.setSize=function(){Y.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(M){Y.prototype.pointerUp.call(this,M),this.setSize()},C.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},C.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},C.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},C.prototype.restoreState=function(M){var G=M;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),Y.prototype.restoreState.call(this,M),this.setSize()},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G),this.setSize()},C.title="Rectangle marker",C}(vt),Rt=function(Y){function C(M,G,te,Q){var Se=Y.call(this,M,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Se.widths=[],Se.widthBoxes=[],Se.widths=G,Se.currentWidth=te,Se.setCurrentWidth=Se.setCurrentWidth.bind(Se),Se}return Ae(C,Y),C.prototype.getUi=function(){var M=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(te){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=te===M.currentWidth?M.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){M.setCurrentWidth(te,Q)}),G.appendChild(Q);var Se=document.createElement("div");Se.innerText=te.toString(),Se.style.marginRight="5px",Q.appendChild(Se);var ot=document.createElement("div");ot.style.minHeight="20px",ot.style.flexGrow="2",ot.style.display="flex",ot.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=te+"px solid "+M.uiStyleSettings.toolboxColor,St.style.flexGrow="2",ot.appendChild(St),Q.appendChild(ot),M.widthBoxes.push(Q)}),G},C.prototype.setCurrentWidth=function(M,G){var te=this;this.currentWidth=M,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},C}(et),At=function(Y){function C(M,G,te,Q){var Se=Y.call(this,M,Q||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Se.styles=[],Se.styleBoxes=[],Se.styles=G,Se.currentStyle=te,Se.setCurrentStyle=Se.setCurrentStyle.bind(Se),Se}return Ae(C,Y),C.prototype.getUi=function(){var M=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(te){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/M.styles.length-5+"%",Q.style.borderColor=te===M.currentStyle?M.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){M.setCurrentStyle(te,Q)}),G.appendChild(Q);var Se=document.createElement("div");Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.overflow="hidden";var ot=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+M.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(te!==""?'stroke-dasharray="'+te+'"':"")+` />
</svg>`;Se.innerHTML=ot,Q.appendChild(Se),M.styleBoxes.push(Q)}),G},C.prototype.setCurrentStyle=function(M,G){var te=this;this.currentStyle=M,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},C}(et),ke=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.strokeColor=te.defaultColor,Q.strokeWidth=te.defaultStrokeWidth,Q.strokeDasharray=te.defaultStrokeDasharray,Q.strokePanel=new ze("Line color",te.defaultColorSet,te.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new At("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ae(C,Y),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Y.prototype.getState.call(this);return M.typeName=C.typeName,M},C.typeName="FrameMarker",C.title="Frame marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',C}(ht),Oe=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},tt=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!!Y.prototype.ownsTarget.call(this,M)||!(!this.grip1.ownsTarget(M)&&!this.grip2.ownsTarget(M))},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.manipulationStartX=M.x,this.manipulationStartY=M.y,this.state==="new"&&(this.x1=M.x,this.y1=M.y,this.x2=M.x,this.y2=M.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(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},C.prototype.pointerUp=function(M){var G=this.state;Y.prototype.pointerUp.call(this,M),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(M),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},C.prototype.adjustVisual=function(){},C.prototype.manipulate=function(M){this.state==="creating"?this.resize(M):this.state==="move"?(this.x1=this.manipulationStartX1+M.x-this.manipulationStartX,this.y1=this.manipulationStartY1+M.y-this.manipulationStartY,this.x2=this.manipulationStartX2+M.x-this.manipulationStartX,this.y2=this.manipulationStartY2+M.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(M)},C.prototype.resize=function(M){switch(this.activeGrip){case this.grip1:this.x1=M.x,this.y1=M.y;break;case this.grip2:case void 0:this.x2=M.x,this.y2=M.y}this.adjustVisual(),this.adjustControlBox()},C.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){this.positionGrips()},C.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},C.prototype.createGrip=function(){var M=new yt;return M.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(M.visual),M},C.prototype.positionGrips=function(){var M=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-M/2,this.y1-M/2),this.positionGrip(this.grip2.visual,this.x2-M/2,this.y2-M/2)},C.prototype.positionGrip=function(M,G,te){var Q=M.transform.baseVal.getItem(0);Q.setTranslate(G,te),M.transform.baseVal.replaceItem(Q,0)},C.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},C.prototype.restoreState=function(M){Y.prototype.restoreState.call(this,M);var G=M;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G),this.x1=this.x1*M,this.y1=this.y1*G,this.x2=this.x2*M,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},C}(Je),it=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=te.defaultColor,Q.strokeWidth=te.defaultStrokeWidth,Q.strokeDasharray=te.defaultStrokeDasharray,Q.strokePanel=new ze("Line color",te.defaultColorSet,te.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new At("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorLine&&M!==this.visibleLine)},C.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.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)},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},C.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()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},C.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},C.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){Y.prototype.restoreState.call(this,M);var G=M;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},C.typeName="LineMarker",C.title="Line marker",C.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',C}(tt),Ne=function(Y){function C(M,G,te,Q){var Se=Y.call(this,M,Q||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Se.fonts=[],Se.fontBoxes=[],Se.fonts=G,Se.currentFont=te,Se.setCurrentFont=Se.setCurrentFont.bind(Se),Se}return Ae(C,Y),C.prototype.getUi=function(){var M=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(te){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/M.fonts.length-5+"%",Q.style.borderColor=te===M.currentFont?M.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){M.setCurrentFont(te,Q)}),G.appendChild(Q);var Se=document.createElement("div");Se.style.display="flex",Se.style.minHeight="20px",Se.style.flexGrow="2",Se.style.fontFamily=te,Se.style.overflow="hidden";var ot=document.createElement("div");ot.style.whiteSpace="nowrap",ot.style.overflow="hidden",ot.style.textOverflow="ellipsis",ot.innerHTML="The quick brown fox jumps over the lazy dog",Se.appendChild(ot),Q.appendChild(Se),M.fontBoxes.push(Q)}),G},C.prototype.setCurrentFont=function(M,G){var te=this;this.currentFont=M,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},C}(et),qe=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=te.defaultColor,Q.fontFamily=te.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new ze("Color",te.defaultColorSet,te.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new Ne("Font",te.defaultFontFamilies,te.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){if(Y.prototype.ownsTarget.call(this,M)||M===this.visual||M===this.textElement||M===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(te){te===M&&(G=!0)}),G},C.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.isMoved=!1,this.pointerDownPoint=M,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},C.prototype.renderText=function(){var M=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(G){M.textElement.appendChild(de.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},C.prototype.getTextScale=function(){var M=this.textElement.getBBox(),G=1;if(M.width>0&&M.height>0){var te=(1*this.width-this.width*this.padding*2/100)/M.width,Q=(1*this.height-this.height*this.padding*2/100)/M.height;G=Math.min(te,Q)}return G},C.prototype.getTextPosition=function(M){var G=this.textElement.getBBox(),te=0,Q=0;return G.width>0&&G.height>0&&(te=(this.width-G.width*M)/2,Q=this.height/2-G.height*M/2),{x:te,y:Q}},C.prototype.sizeText=function(){var M=this.textElement.getBBox(),G=this.getTextScale(),te=this.getTextPosition(G);te.y-=M.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+te.x+"px, "+te.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(te.x,te.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},C.prototype.manipulate=function(M){Y.prototype.manipulate.call(this,M),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(M.x-this.pointerDownPoint.x)>5||Math.abs(M.y-this.pointerDownPoint.y)>5)},C.prototype.resize=function(M){Y.prototype.resize.call(this,M),this.isMoved=!0,this.setSize(),this.sizeText()},C.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},C.prototype.pointerUp=function(M){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,M),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},C.prototype.showTextEditor=function(){var M=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(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(M.textEditor.style.fontSize);M.textEditor.clientWidth>=Number.parseInt(M.textEditor.style.maxWidth)&&G>.9;)G-=.1,M.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var te=G.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(te)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){M.textEditDivClicked(M.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},C.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var M=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),te=this.textElement.getBBox(),Q={x:te.width*M,y:te.height*M};G.x-=Q.x/2,G.y-=Q.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*M,12)+"px",this.textElement.style.display="none"}},C.prototype.textEditDivClicked=function(M){this.text=M.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},C.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},C.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},C.prototype.dblClick=function(M,G){Y.prototype.dblClick.call(this,M,G),this.showTextEditor()},C.prototype.setColor=function(M){this.textElement&&de.setAttributes(this.textElement,[["fill",M]]),this.color=M,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(M)},C.prototype.setFont=function(M){this.textElement&&de.setAttributes(this.textElement,[["font-family",M]]),this.fontFamily=M,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},C.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},C.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){var G=M;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),Y.prototype.restoreState.call(this,M),this.setSize()},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G),this.setSize(),this.sizeText(),this.positionTextEditor()},C.typeName="TextMarker",C.title="Text marker",C.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>',C}(vt),Te=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=te.defaultColor,Q.lineWidth=te.defaultStrokeWidth,Q.pixelRatio=te.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new ze("Color",te.defaultColorSet,te.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.drawingImage)},C.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var M=de.createTransform();this.visual.transform.baseVal.appendItem(M),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(M,G){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(M.x,M.y),this.drawing=!0):Y.prototype.pointerDown.call(this,M,G)},C.prototype.manipulate=function(M){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(M.x,M.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,M)},C.prototype.resize=function(M){Y.prototype.resize.call(this,M),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(M){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,M)},C.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)},C.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},C.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},C.prototype.finishCreation=function(){for(var M=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],te=G[0],Q=G[1],Se=G[2],ot=G[3],St=!1,Pt=0;Pt<this.canvasElement.height;Pt++)for(var ut=0;ut<this.canvasElement.width;ut++)M.data[Pt*this.canvasElement.width*4+4*ut+3]>0&&(St=!0,Pt<Q&&(Q=Pt),ut<te&&(te=ut),Pt>ot&&(ot=Pt),ut>Se&&(Se=ut));if(St){this.left=te/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Se-te)/this.pixelRatio,this.height=(ot-Q)/this.pixelRatio;var Vt=document.createElement("canvas");Vt.width=Se-te,Vt.height=ot-Q,Vt.getContext("2d").putImageData(this.canvasContext.getImageData(te,Q,Se-te,ot-Q),0,0),this.drawingImgUrl=Vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},C.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},C.prototype.setColor=function(M){this.color=M,this.colorChanged(M)},C.prototype.setLineWidth=function(M){this.lineWidth=M},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){this.createVisual(),Y.prototype.restoreState.call(this,M),this.drawingImgUrl=M.drawingImgUrl,this.setDrawingImage()},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G),this.setDrawingImage()},C.typeName="FreehandMarker",C.title="Freehand marker",C.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>',C}(vt),fe=function(Y){function C(M,G,te){var Q=Y.call(this,M,te||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Q.typeBoxes=[],Q.currentType=G,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return Ae(C,Y),C.prototype.getUi=function(){var M=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var te=function(ot){var St="both";switch(ot){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Pt=document.createElement("div");if(Pt.style.display="flex",Pt.style.flexGrow="2",Pt.style.alignItems="center",Pt.style.justifyContent="space-between",Pt.style.padding="5px",Pt.style.borderWidth="2px",Pt.style.borderStyle="solid",Pt.style.borderColor=St===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",Pt.addEventListener("click",function(){M.setCurrentType(St,Pt)}),G.appendChild(Pt),St==="both"||St==="start"){var ut=document.createElement("div");ut.style.display="flex",ut.style.alignItems="center",ut.style.minHeight="20px",ut.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ut.style.marginLeft="5px",Pt.appendChild(ut)}var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.style.flexGrow="2";var tn=document.createElement("hr");if(tn.style.minWidth="20px",tn.style.border="0px",tn.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),tn.style.flexGrow="2",Vt.appendChild(tn),Pt.appendChild(Vt),St==="both"||St==="end"){var Sn=document.createElement("div");Sn.style.display="flex",Sn.style.alignItems="center",Sn.style.minHeight="20px",Sn.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Sn.style.marginRight="5px",Pt.appendChild(Sn)}Q.typeBoxes.push(Pt)},Q=this,Se=0;Se<4;Se++)te(Se);return G},C.prototype.setCurrentType=function(M,G){var te=this;this.currentType=M,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===G?te.uiStyleSettings!==void 0?te.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},C}(et),me=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new fe("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.arrow1&&M!==this.arrow2)},C.prototype.getArrowPoints=function(M,G){var te=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return M-te/2+","+(G+Q/2)+" "+M+","+(G-Q/2)+" "+(M+te/2)+","+(G+Q/2)},C.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if(Y.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",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(M,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var te=this.arrow2.transform.baseVal.getItem(0);te.setRotate(M+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(te,0)}},C.prototype.setArrowType=function(M){this.arrowType=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){Y.prototype.restoreState.call(this,M);var G=M;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},C.typeName="ArrowMarker",C.title="Arrow marker",C.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',C}(it),re=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.fillColor=te.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new ze("Color",te.defaultColorSet,te.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return Ae(C,Y),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Y.prototype.getState.call(this);return M.typeName=C.typeName,M},C.typeName="CoverMarker",C.title="Cover marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',C}(ht),ae=function(Y){function C(M,G,te,Q){var Se=Y.call(this,M,Q||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Se.opacities=[],Se.opacityBoxes=[],Se.opacities=G,Se.currentOpacity=te,Se.setCurrentOpacity=Se.setCurrentOpacity.bind(Se),Se}return Ae(C,Y),C.prototype.getUi=function(){var M=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function(te){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=te===M.currentOpacity?M.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){M.setCurrentOpacity(te,Q)}),G.appendChild(Q);var Se=document.createElement("div");Se.innerText=100*te+"%",Q.appendChild(Se),M.opacityBoxes.push(Q)}),G},C.prototype.setCurrentOpacity=function(M,G){var te=this;this.currentOpacity=M,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===G?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},C}(et),he=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=te.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=te.defaultHighlightOpacity,Q.fillPanel=new ze("Color",te.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new ae("Opacity",te.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ae(C,Y),C.prototype.setOpacity=function(M){this.opacity=M,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Y.prototype.getState.call(this);return M.typeName=C.typeName,M},C.typeName="HighlightMarker",C.title="Highlight marker",C.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>',C}(re),ve='<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>',_e=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=te.defaultStrokeColor,Q.bgColor=te.defaultFillColor,Q.fontFamily=te.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new ze("Text color",te.defaultColorSet,Q.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>'),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new ze("Fill color",te.defaultColorSet,Q.bgColor,ve),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new Ne("Font",te.defaultFontFamilies,te.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new yt,Q.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return Y.prototype.ownsTarget.call(this,M)||this.tipGrip.ownsTarget(M)||this.tip===M},C.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},C.prototype.pointerDown=function(M,G){this.state==="new"&&Y.prototype.pointerDown.call(this,M,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,M,G)},C.prototype.pointerUp=function(M){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,M);else{var G=this.state==="creating";Y.prototype.pointerUp.call(this,M),this.setTipPoints(G),this.positionTip()}},C.prototype.manipulate=function(M){if(this.tipMoving){var G=this.unrotatePoint(M);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,M)},C.prototype.setBgColor=function(M){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",M]]),de.setAttributes(this.tip,[["fill",M]])),this.bgColor=M,this.fillColorChanged(M)},C.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},C.prototype.setTipPoints=function(M){M===void 0&&(M=!1);var G=Math.min(this.height/2,15),te=this.height/5;M&&(this.tipPosition={x:G+te/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:0},this.tipBase2Position={x:G+te,y:0}):(this.tipBase1Position={x:0,y:G},this.tipBase2Position={x:0,y:G+te}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-te,y:0},this.tipBase2Position={x:this.width-G,y:0}):(this.tipBase1Position={x:this.width,y:G},this.tipBase2Position={x:this.width,y:G+te}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-G-te,y:this.height},this.tipBase2Position={x:this.width-G,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-G-te},this.tipBase2Position={x:this.width,y:this.height-G}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(te=this.width/5,G=Math.min(this.width/2,15),this.tipBase1Position={x:G,y:this.height},this.tipBase2Position={x:G+te,y:this.height}):(this.tipBase1Position={x:0,y:this.height-G},this.tipBase2Position={x:0,y:this.height-G-te})},C.prototype.resize=function(M){Y.prototype.resize.call(this,M),this.positionTip()},C.prototype.positionTip=function(){de.setAttributes(this.tip,[["points",this.getTipPoints()]]);var M=this.tipGrip.visual.transform.baseVal.getItem(0);M.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(M,0)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},C.prototype.getState=function(){var M=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){var G=M;this.bgColor=G.bgColor,this.tipPosition=G.tipPosition,Y.prototype.restoreState.call(this,M),this.createTip(),this.setTipPoints()},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G),this.tipPosition={x:this.tipPosition.x*M,y:this.tipPosition.y*G},this.positionTip()},C.typeName="CalloutMarker",C.title="Callout marker",C.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>',C}(qe),je=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=te.defaultColor,Q.strokeWidth=te.defaultStrokeWidth,Q.strokeDasharray=te.defaultStrokeDasharray,Q.fillColor=te.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new ze("Line color",pe(te.defaultColorSet,["transparent"]),te.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new ze("Fill color",pe(te.defaultColorSet,["transparent"]),Q.fillColor,ve),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new At("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new ae("Opacity",te.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.visual)},C.prototype.createVisual=function(){this.visual=de.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)},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},C.prototype.manipulate=function(M){Y.prototype.manipulate.call(this,M)},C.prototype.resize=function(M){Y.prototype.resize.call(this,M),this.setSize()},C.prototype.setSize=function(){Y.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},C.prototype.pointerUp=function(M){Y.prototype.pointerUp.call(this,M),this.setSize()},C.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},C.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(M),this.stateChanged()},C.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.setOpacity=function(M){this.opacity=M,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){var G=M;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),Y.prototype.restoreState.call(this,M),this.setSize()},C.prototype.scale=function(M,G){Y.prototype.scale.call(this,M,G),this.setSize()},C.typeName="EllipseMarker",C.title="Ellipse marker",C.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>',C}(vt),at=function(Y){function C(M,G,te){return Y.call(this,M,G,te)||this}return Ae(C,Y),Object.defineProperty(C.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.tip1&&M!==this.tip2)},C.prototype.createTips=function(){this.tip1=de.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(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.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(de.createTransform()),this.visual.appendChild(this.tip2)},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.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()]]),de.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 M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(M,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var te=this.tip2.transform.baseVal.getItem(0);te.setRotate(M+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(te,0)}},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Y.prototype.getState.call(this);return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){Y.prototype.restoreState.call(this,M),this.createTips(),this.adjustVisual()},C.typeName="MeasurementMarker",C.title="Measurement marker",C.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>',C}(it),Et=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.strokePanel.colors=te.defaultColorSet,Q.fillColor="transparent",Q}return Ae(C,Y),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Y.prototype.getState.call(this);return M.typeName=C.typeName,M},C.typeName="EllipseFrameMarker",C.title="Ellipse frame marker",C.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>',C}(je),Lt=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(C){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(C)||(this.undoStack.push(C),JSON.stringify(this.lastRedoStep)!==JSON.stringify(C)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(C){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=C)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var C=this.undoStack.pop();return C!==void 0&&this.redoStack.push(C),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),Tt=function(Y){function C(M,G,te){var Q=Y.call(this,M,G,te)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=te.defaultColor,Q.strokeWidth=te.defaultStrokeWidth,Q.strokeDasharray=te.defaultStrokeDasharray,Q.strokePanel=new ze("Line color",te.defaultColorSet,te.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new At("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ae(C,Y),C.prototype.ownsTarget=function(M){return!(!Y.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorCurve&&M!==this.visibleCurve&&!this.curveGrip.ownsTarget(M))},C.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},C.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.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)},C.prototype.pointerDown=function(M,G){Y.prototype.pointerDown.call(this,M,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=M.x,this.curveY=M.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},C.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.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)},C.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},C.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var M=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-M/2,this.curveY-M/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()))},C.prototype.manipulate=function(M){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+M.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+M.y-this.manipulationStartY),Y.prototype.manipulate.call(this,M)},C.prototype.resize=function(M){this.activeGrip===this.curveGrip&&(this.curveX=M.x,this.curveY=M.y),Y.prototype.resize.call(this,M),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},C.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},C.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},C.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual()},C.prototype.scale=function(M,G){this.curveX=this.curveX*M,this.curveY=this.curveY*G,Y.prototype.scale.call(this,M,G)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return M.typeName=C.typeName,M},C.prototype.restoreState=function(M){Y.prototype.restoreState.call(this,M);var G=M;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},C.typeName="CurveMarker",C.title="Curve marker",C.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>',C}(tt),mt=function(){function Y(C,M){M===void 0&&(M=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=C,this.cancelable=M}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),Ze=function(Y){function C(M,G,te){var Q=Y.call(this,M,!1)||this;return Q.dataUrl=G,Q.state=te,Q}return Ae(C,Y),C}(mt),$e=function(Y){function C(M,G,te){te===void 0&&(te=!1);var Q=Y.call(this,M,te)||this;return Q.marker=G,Q}return Ae(C,Y),C}(mt),He=function(){function Y(){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 Y.prototype.addEventListener=function(C,M){this[C].push(M)},Y.prototype.removeEventListener=function(C,M){var G=this[C].indexOf(M);G>-1&&this[C].splice(G,1)},Y}(),le=function(){function Y(C){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Oe,this._isOpen=!1,this.undoRedoManager=new Lt,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 He,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=C,this.targetRoot=document.body,this.width=C.clientWidth,this.height=C.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[ke,Te,me,qe,Et,je,he,_e,at,re,it,Tt]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ke,Te,me,qe,je,he,_e]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ke,Te,me,qe,he]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(C){var M=this;this._availableMarkerTypes.splice(0),C.forEach(function(G){if(typeof G=="string"){var te=M.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===G});te!==void 0&&M._availableMarkerTypes.push(te)}else M._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(C){this._zoomLevel=C,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.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},Y.prototype.show=function(){var C=this;this.styles.styleSheetRoot===void 0&&oe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=oe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(M){return M(new mt(C))})},Y.prototype.render=function(){return Pe(this,void 0,void 0,function(){var C;return Ie(this,function(M){switch(M.label){case 0:return this.setCurrentMarker(),(C=new ge).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.markersOnly=this.renderMarkersOnly,C.width=this.renderWidth,C.height=this.renderHeight,[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return M.sent(),[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,M.sent()]}})})},Y.prototype.close=function(C){var M=this;if(C===void 0&&(C=!1),this.isOpen){var G=!1;C||this.eventListeners.beforeclose.forEach(function(te){var Q=new mt(M,!0);te(Q),Q.defaultPrevented&&(G=!0)}),G||(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(te){return te(new mt(M))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var C,M=[],G=0;G<arguments.length;G++)M[G]=arguments[G];(C=this._availableMarkerTypes).push.apply(C,M)},Y.prototype.addRenderEventListener=function(C){this.addEventListener("render",function(M){C(M.dataUrl,M.state)})},Y.prototype.removeRenderEventListener=function(C){},Y.prototype.addCloseEventListener=function(C){this.addEventListener("close",function(){C()})},Y.prototype.removeCloseEventListener=function(C){},Y.prototype.setupResizeObserver=function(){var C=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return C.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var C=1*this.target.clientWidth/this.target.clientHeight,M=this.editorCanvas.clientWidth/C>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*C:this.editorCanvas.clientWidth,G=M<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/C;this.resize(M,G)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(C,M){this._isResizing=!0;var G=C/this.imageWidth,te=M/this.imageHeight;this.imageWidth=Math.round(C),this.imageHeight=Math.round(M),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(G,te),this._isResizing=!1},Y.prototype.scaleMarkers=function(C,M){var G,te=this;this._currentMarker&&this._currentMarker instanceof qe?this._currentMarker.scale(C,M):(G=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==te._currentMarker&&Q.scale(C,M)}),G!==void 0&&this.setCurrentMarker(G)},Y.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"},Y.prototype.setTopLeft=function(){var C=this.editingTarget.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=C.left-M.left,this.top=C.top-M.top},Y.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)},Y.prototype.addDefs=function(){for(var C,M=[],G=0;G<arguments.length;G++)M[G]=arguments[G];this.defs=de.createDefs(),this.addDefsToImage(),(C=this.defs).append.apply(C,M)},Y.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Y.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)},Y.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Y.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Y.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)},Y.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Y.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)},Y.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 C=document.createElement("a");C.href="https://markerjs.com/",C.target="_blank",C.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>',C.title="Powered by marker.js",C.style.display="grid",C.style.alignItems="center",C.style.justifyItems="center",C.style.padding="3px",C.style.width="20px",C.style.height="20px",this.logoUI.appendChild(C),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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 Ge(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 Qe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Y.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.removeMarker=function(C){this.markerImage.removeChild(C.container),this.markers.indexOf(C)>-1&&this.markers.splice(this.markers.indexOf(C),1),C.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(C,M){if(C==="marker"&&M!==void 0)this.createNewMarker(M);else if(C==="action")switch(M){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()}},Y.prototype.deleteSelectedMarker=function(){var C=this;if(this._currentMarker!==void 0){var M=!1;if(this.eventListeners.markerbeforedelete.forEach(function(te){var Q=new $e(C,C._currentMarker,!0);te(Q),Q.defaultPrevented&&(M=!0)}),!M){var G=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(te){return te(new $e(C,G))})}}},Y.prototype.clear=function(){var C=this,M=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Se){var ot=new $e(C,void 0,!0);Se(ot),ot.defaultPrevented&&(M=!0)}),!M)){this.setCurrentMarker();for(var G=function(Se){var ot=te.markers[Se];te.setCurrentMarker(te.markers[Se]),te._currentMarker.dispose(),te.markerImage.removeChild(te._currentMarker.container),te.markers.splice(te.markers.indexOf(te._currentMarker),1),te.eventListeners.markerdelete.forEach(function(St){return St(new $e(C,ot))})},te=this,Q=this.markers.length-1;Q>=0;Q--)G(Q);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var C;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=(C=this._currentMarker.notes)!==null&&C!==void 0?C:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var C=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var M=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===M.width&&G.height===M.height){var te=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(M),te<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new mt(C))})}else this.undoRedoManager.replaceLastUndoStep(M),this.eventListeners.statechange.forEach(function(Q){return Q(new mt(C))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var C=this,M=this.undoRedoManager.undo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new mt(C))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var C=this,M=this.undoRedoManager.redo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(G){return G(new mt(C))}))},Y.prototype.stepZoom=function(){var C=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=C<this.zoomSteps.length-1?this.zoomSteps[C+1]:this.zoomSteps[0]},Y.prototype.panTo=function(C){this.contentDiv.scrollBy({left:this.prevPanPoint.x-C.x,top:this.prevPanPoint.y-C.y}),this.prevPanPoint=C},Y.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,function(){var C,M,G=this;return Ie(this,function(te){switch(te.label){case 0:return[4,this.render()];case 1:return C=te.sent(),M=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new Ze(G,C,M))}),this.close(!0),[2]}})})},Y.prototype.getState=function(C){C===!0&&this.setCurrentMarker();var M={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(G){return M.markers.push(G.getState())}),M},Y.prototype.restoreState=function(C){var M=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);C.markers.forEach(function(G){var te=M._availableMarkerTypes.find(function(Se){return Se.typeName===G.typeName});if(te!==void 0){var Q=M.addNewMarker(te);Q.restoreState(G),M.markers.push(Q)}}),C.width&&C.height&&(C.width!==this.imageWidth||C.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/C.width,this.imageHeight/C.height),this.eventListeners.restorestate.forEach(function(G){return G(new mt(M))})},Y.prototype.addNewMarker=function(C){var M=de.createGroup();return this.markerImage.appendChild(M),new C(M,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(C){var M,G=this;(M=typeof C=="string"?this._availableMarkerTypes.find(function(te){return te.typeName===C}):C)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(M),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(M.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(te){return te(new $e(G,G._currentMarker))}))},Y.prototype.markerCreated=function(C){var M=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(C),this.setCurrentMarker(C),C instanceof Te&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Te):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(G){return G(new $e(M,M._currentMarker))})},Y.prototype.colorChanged=function(C){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=C,this.settings.defaultStrokeColor=C)},Y.prototype.fillColorChanged=function(C){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=C)},Y.prototype.markerStateChanged=function(C){var M=this;this.eventListeners.markerchange.forEach(function(G){return G(new $e(M,C))})},Y.prototype.setCurrentMarker=function(C){var M=this;this._currentMarker!==C&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(G){return G(new $e(M,M._currentMarker))})),this._currentMarker=C,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(G){return G(new $e(M,M._currentMarker))}))},Y.prototype.onPointerDown=function(C){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||C.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var M=this.markers.find(function(G){return G.ownsTarget(C.target)});M!==void 0?(this.setCurrentMarker(M),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(C.clientX,C.clientY),C.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:C.clientX,y:C.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(C.clientX,C.clientY))},Y.prototype.onDblClick=function(C){if(this._isFocused||this.focus(),this.mode==="select"){var M=this.markers.find(function(G){return G.ownsTarget(C.target)});M!==void 0&&M!==this._currentMarker&&this.setCurrentMarker(M),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(C.clientX,C.clientY),C.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(C){this.touchPoints!==1&&C.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||C.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(C.clientX,C.clientY)):this.zoomLevel>1&&this.panTo({x:C.clientX,y:C.clientY}))},Y.prototype.onPointerUp=function(C){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(C.clientX,C.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(C){this._currentMarker===void 0||this.notesArea!==void 0||C.key!=="Delete"&&C.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(C,M){var G=this.markerImage.getBoundingClientRect();return{x:(C-G.left)/this.zoomLevel,y:(M-G.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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()},Y.prototype.addLicenseKey=function(C){ne.addKey(C)},Y.prototype.addEventListener=function(C,M){this.eventListeners.addEventListener(C,M)},Y.prototype.removeEventListener=function(C,M){this.eventListeners.removeEventListener(C,M)},Y.prototype.renderState=function(C){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(C),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var C=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(M){return M(new mt(C))}))},Y.prototype.blur=function(){var C=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(M){return M(new mt(C))}))},Y.instanceCounter=0,Y}();/* **********************************
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 be=function(Y,C){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,G){M.__proto__=G}||function(M,G){for(var te in G)Object.prototype.hasOwnProperty.call(G,te)&&(M[te]=G[te])})(Y,C)};function rt(Y,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function M(){this.constructor=Y}be(Y,C),Y.prototype=C===null?Object.create(C):(M.prototype=C.prototype,new M)}function Ye(Y,C,M,G){return new(M||(M=Promise))(function(te,Q){function Se(Pt){try{St(G.next(Pt))}catch(ut){Q(ut)}}function ot(Pt){try{St(G.throw(Pt))}catch(ut){Q(ut)}}function St(Pt){var ut;Pt.done?te(Pt.value):(ut=Pt.value,ut instanceof M?ut:new M(function(Vt){Vt(ut)})).then(Se,ot)}St((G=G.apply(Y,C||[])).next())})}function bt(Y,C){var M,G,te,Q,Se={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return Q={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ot(St){return function(Pt){return function(ut){if(M)throw new TypeError("Generator is already executing.");for(;Se;)try{if(M=1,G&&(te=2&ut[0]?G.return:ut[0]?G.throw||((te=G.return)&&te.call(G),0):G.next)&&!(te=te.call(G,ut[1])).done)return te;switch(G=0,te&&(ut=[2&ut[0],te.value]),ut[0]){case 0:case 1:te=ut;break;case 4:return Se.label++,{value:ut[1],done:!1};case 5:Se.label++,G=ut[1],ut=[0];continue;case 7:ut=Se.ops.pop(),Se.trys.pop();continue;default:if(!(te=Se.trys,(te=te.length>0&&te[te.length-1])||ut[0]!==6&&ut[0]!==2)){Se=0;continue}if(ut[0]===3&&(!te||ut[1]>te[0]&&ut[1]<te[3])){Se.label=ut[1];break}if(ut[0]===6&&Se.label<te[1]){Se.label=te[1],te=ut;break}if(te&&Se.label<te[2]){Se.label=te[2],Se.ops.push(ut);break}te[2]&&Se.ops.pop(),Se.trys.pop();continue}ut=C.call(Y,Se)}catch(Vt){ut=[6,Vt],G=0}finally{M=te=0}if(5&ut[0])throw ut[1];return{value:ut[0]?ut[1]:void 0,done:!0}}([St,Pt])}}}var pt=function(){function Y(){}return Y.addKey=function(C){Y.key=C},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),Ee=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(C,M){for(var G=0,te=M;G<te.length;G++){var Q=te[G],Se=Q[0],ot=Q[1];C.setAttribute(Se,ot)}},Y.createRect=function(C,M,G){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",C.toString()),te.setAttribute("height",M.toString()),G&&Y.setAttributes(te,G),te},Y.createLine=function(C,M,G,te,Q){var Se=document.createElementNS("http://www.w3.org/2000/svg","line");return Se.setAttribute("x1",C.toString()),Se.setAttribute("y1",M.toString()),Se.setAttribute("x2",G.toString()),Se.setAttribute("y2",te.toString()),Q&&Y.setAttributes(Se,Q),Se},Y.createPolygon=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","polygon");return G.setAttribute("points",C),M&&Y.setAttributes(G,M),G},Y.createCircle=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","circle");return G.setAttribute("cx",(C/2).toString()),G.setAttribute("cy",(C/2).toString()),G.setAttribute("r",C.toString()),M&&Y.setAttributes(G,M),G},Y.createEllipse=function(C,M,G){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(C/2).toString()),te.setAttribute("cy",(M/2).toString()),te.setAttribute("rx",(C/2).toString()),te.setAttribute("ry",(M/2).toString()),G&&Y.setAttributes(te,G),te},Y.createGroup=function(C){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return C&&Y.setAttributes(M,C),M},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(C,M,G,te,Q,Se,ot){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(St,[["id",C],["orient",M],["markerWidth",G.toString()],["markerHeight",te.toString()],["refX",Q.toString()],["refY",Se.toString()]]),St.appendChild(ot),St},Y.createText=function(C){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),C&&Y.setAttributes(M,C),M},Y.createTSpan=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","tspan");return G.textContent=C,M&&Y.setAttributes(G,M),G},Y.createImage=function(C){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return C&&Y.setAttributes(M,C),M},Y.createPoint=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return G.x=C,G.y=M,G},Y.createPath=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg","path");return G.setAttribute("d",C),M&&Y.setAttributes(G,M),G},Y.createElement=function(C,M){var G=document.createElementNS("http://www.w3.org/2000/svg",C);return M&&Y.setAttributes(G,M),G},Y.getHollowRectanglePath=function(C,M,G,te,Q,Se,ot,St){return"M"+C+","+M+"V"+(M+te)+"H"+(C+G)+"V"+M+"H"+Q+"V"+Se+"H"+(Q+ot)+"V"+(Se+St)+"H"+Q+"V"+M+"Z"},Y}(),Be=function(){function Y(C){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+C+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(C){return this.styleSheet===void 0&&this.addStyleSheet(),C.name=""+this.classNamePrefix+C.localName,this.classes.push(C),this.styleSheet.sheet.insertRule("."+C.name+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length),C},Y.prototype.addRule=function(C){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(C),this.styleSheet.sheet.insertRule(C.selector+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var C;this.styleSheet=document.createElement("style"),((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).appendChild(this.styleSheet),this.addRule(new st("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ct("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ct("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Y.prototype.removeStyleSheet=function(){var C;this.styleSheet&&(((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),st=function(Y,C){this.selector=Y,this.style=C},ct=function(Y,C){this.localName=Y,this.style=C},Ct=function(){function Y(){this.blocks=[],this.display=""}return Y.prototype.addButtonBlock=function(C){C.className=this.blockClassName,C.buttonClassName=this.buttonClassName,C.buttonColorsClassName=this.buttonColorsClassName,C.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(C)},Y.prototype.addElementBlock=function(C){C.className===void 0&&(C.className=this.blockClassName),this.blocks.push(C)},Y.prototype.getUI=function(){var C=document.createElement("div");return C.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,C.style.display=this.display,this.blocks.forEach(function(M){return C.appendChild(M.getUI())}),C},Y}(),lt=function(){function Y(){}return Y.prototype.getUI=function(){var C=document.createElement("div");if(C.className=this.className,this.minWidth!==void 0&&(C.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":C.style.justifyContent="flex-start";break;case"center":C.style.justifyContent="center";break;case"end":C.style.justifyContent="flex-end"}return C.style.whiteSpace="nowrap",C},Y}(),jt=function(Y){function C(){var M=Y!==null&&Y.apply(this,arguments)||this;return M.buttons=[],M}return rt(C,Y),C.prototype.addButton=function(M){M.className=this.buttonClassName,M.colorsClassName=this.buttonColorsClassName,M.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(M)},C.prototype.getUI=function(){var M=Y.prototype.getUI.call(this);return this.buttons.forEach(function(G){return M.appendChild(G.getUI())}),M},C}(lt),qt=function(){function Y(C,M){this._isActive=!1,this._isHidden=!1,this._icon=C,this.title=M,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Y.prototype,"icon",{get:function(){return this._icon},set:function(C){this._icon=C,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isActive",{get:function(){return this._isActive},set:function(C){this._isActive=C,this.adjustClassName()},enumerable:!1,configurable:!0}),Y.prototype.getUI=function(){var C=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 C.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Y.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,"")))},Y.prototype.hide=function(){this._isHidden=!0},Y}(),Ot=function(Y){function C(){var M=Y!==null&&Y.apply(this,arguments)||this;return M.elements=[],M}return rt(C,Y),C.prototype.addElement=function(M){this.elements.push(M)},C.prototype.getUI=function(){var M=Y.prototype.getUI.call(this);return this.elements.forEach(function(G){return M.appendChild(G)}),M},C}(lt),Zt=function(){function Y(C,M){this.horizontal=C,this.vertical=M}return Object.defineProperty(Y.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Y.prototype.getVerticalLength=function(C){return C/this.ratio},Y.prototype.getHorizontalLength=function(C){return C*this.ratio},Y}(),un=function(){function Y(){}return Y.getIcon=function(C,M){if(C>0&&M>0){var G=new Zt(C,M),te=G.ratio>=1?20:G.getHorizontalLength(20),Q=G.ratio<1?20:G.getVerticalLength(20),Se=document.createElementNS("http://www.w3.org/2000/svg","svg");Se.setAttribute("xmlns","http://www.w3.org/2000/svg"),Se.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Se);var ot=Ee.createDefs();Se.appendChild(ot);var St=Ee.createElement("clipPath",[["id","text-bg-clip"]]);ot.appendChild(St);var Pt=Ee.createPath(Ee.getHollowRectanglePath((24-te)/2,(24-Q)/2,te,Q,(24-te)/2+2,(24-Q)/2+2,te-4,Q-4));Se.appendChild(Pt);var ut=Ee.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ut.appendChild(Ee.createTSpan(C+":"+M)),Se.appendChild(ut);var Vt=ut.getBBox();Ee.setAttributes(ut,[["x",((24-Vt.width)/2).toString()],["y",((24-Vt.height)/2-Vt.y).toString()]]);var tn=Ee.createPath(Ee.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Vt.width))/2,(24-Math.ceil(Vt.height))/2,Math.ceil(Vt.width),Math.ceil(Vt.height)));return St.appendChild(tn),Ee.setAttributes(Pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Se),Se.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>'},Y}(),sn=function(Y){function C(M,G,te){var Q=Y.call(this,M,G)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=te,Q}return rt(C,Y),C.prototype.setupDropdown=function(){var M=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(G){G.className=M.className,G.colorsClassName=M.colorsClassName,M.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},C.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},C.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},C.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},C.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},C.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},C}(qt),Xt=function(){function Y(C,M){this.GRIP_SIZE=10,this.color=C,this.fillColor=M,this.visual=Ee.createGroup(),this.visual.appendChild(Ee.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ee.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},Y.prototype.setCenter=function(C,M){this.visual.childNodes.forEach(function(G){return Ee.setAttributes(G,[["cx",C.toString()],["cy",M.toString()]])})},Y}(),mn=function(){function Y(C,M,G,te){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=C,this.canvasHeight=M,this.margin=G,this.container=te,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(Y.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(C){this._aspectRatio=C,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.gridContainer&&Ee.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(C){this._zoomFactor=C,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var C=this;this.cropShadeElement=Ee.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ee.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var M=0;M<this.numberOfGridLines;M++)this.horizontalGridLines.push(Ee.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ee.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(G){return C.gridContainer.appendChild(G)}),this.verticalGridLines.forEach(function(G){return C.gridContainer.appendChild(G)}),this.cropRectElement=Ee.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Y.prototype.setCropRectangle=function(C){this.cropRect=C;var M=Object.assign({},this.cropRect);this.zoomFactor!==1&&(M.width=this.cropRect.width*this.zoomFactor,M.height=this.cropRect.height*this.zoomFactor,M.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-M.width/2,M.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-M.height/2),Ee.setAttributes(this.cropRectElement,[["x",M.x.toString()],["y",M.y.toString()],["width",M.width.toString()],["height",M.height.toString()]]);var G=M.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,Se){var ot=M.y+G*(Se+1);Ee.setAttributes(Q,[["x1",""+M.x],["y1",""+ot],["x2",""+(M.x+M.width)],["y2",""+ot]])});var te=M.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,Se){var ot=M.x+te*(Se+1);Ee.setAttributes(Q,[["x1",""+ot],["y1",""+M.y],["x2",""+ot],["y2",""+(M.y+M.height)]])}),Ee.setAttributes(this.cropShadeElement,[["d",Ee.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,M.x,M.y,M.width,M.height)]]),this.topLeftGrip.setCenter(M.x,M.y),this.topRightGrip.setCenter(M.x+M.width,M.y),this.bottomLeftGrip.setCenter(M.x,M.y+M.height),this.bottomRightGrip.setCenter(M.x+M.width,M.y+M.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Y.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)},Y.prototype.clientToLocalCoordinates=function(C,M){var G=this.container.getBoundingClientRect();return{x:C-G.left+this.margin,y:M-G.top+this.margin}},Y.prototype.onPointerDown=function(C){this.container.setPointerCapture(C.pointerId),this.previousPoint=this.clientToLocalCoordinates(C.clientX,C.clientY),this.cropRectElement===C.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(C.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(C.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(C.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(C.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(C){if(this.isMoving)this.move(this.clientToLocalCoordinates(C.clientX,C.clientY));else if(this.activeGrip){var M=this.clientToLocalCoordinates(C.clientX,C.clientY);this.resize(M)}C.preventDefault()},Y.prototype.onPointerUp=function(C){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(C.pointerId)},Y.prototype.move=function(C){var M=C.x-this.previousPoint.x,G=C.y-this.previousPoint.y;this.zoomFactor!==1&&(M=-M/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+M),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+G),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=C},Y.prototype.resize=function(C){var M=Object.assign({},this.cropRect),G=C.x-this.previousPoint.x,te=C.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:M.x+G<this.margin&&(G=this.margin-M.x),M.x+=G,M.width=this.cropRect.x+this.cropRect.width-M.x;break;case this.bottomRightGrip:case this.topRightGrip:M.width+G>this.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-M.width),M.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(M.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),M.height=this.aspectRatio.getVerticalLength(M.width)):(M.y+=te,M.height=this.cropRect.y+this.cropRect.height-M.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?M.height=this.aspectRatio.getVerticalLength(M.width):M.height+=te}M.width<10&&(M.x=this.cropRect.x,M.width=10),M.height<10&&(M.y=this.cropRect.y,M.height=10),this.previousPoint=C,M.x>=this.margin&&M.y>=this.margin&&M.x-this.margin+M.width<=this.canvasWidth&&M.y-this.margin+M.height<=this.canvasHeight&&(this.cropRect=M,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Y.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var C=this.cropRect.x+this.cropRect.width/2,M=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),te=this.aspectRatio.getVerticalLength(this.cropRect.width);G/this.canvasWidth<te/this.canvasHeight?this.cropRect.width=G:this.cropRect.height=te,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=C-this.cropRect.width/2,this.cropRect.y=M-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)}},Y.prototype.getRescaledRect=function(C,M,G,te,Q,Se){var ot=G/C,St=te/M;return{x:(Q.x-Se)*ot+Se,y:(Q.y-Se)*St+Se,width:Q.width*ot,height:Q.height*St}},Y.prototype.scaleCanvas=function(C,M){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,C,M,this.cropRect,this.margin);this.canvasWidth=C,this.canvasHeight=M,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},Y}(),kn=function(){function Y(C){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=C,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(Y.prototype,"angle",{get:function(){return this._angle},set:function(C){this._angle=C,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Y.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},Y.prototype.onPointerDown=function(C){this.controlContainer.setPointerCapture(C.pointerId),this.isDragging=!0,this.previousPoint={x:C.clientX,y:C.clientY}},Y.prototype.onPointerMove=function(C){this.isDragging&&(this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.previousPoint.x=C.clientX)},Y.prototype.onPointerUp=function(C){this.isDragging&&this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(C.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var C=this.angleLabelText.getBBox();Ee.setAttributes(this.angleLabelElement,[["x",((this.width-C.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var C=this.scaleShape.transform.baseVal.getItem(0);C.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(C,0)}},Y.prototype.getVisual=function(){var C=document.createElementNS("http://www.w3.org/2000/svg","svg");C.setAttribute("xmlns","http://www.w3.org/2000/svg"),C.setAttribute("width",this.width+"px"),C.setAttribute("height",this.height+"px"),C.setAttribute("viewBox","0 0 "+this.width+" "+this.height),C.style.flexShrink="0",document.body.appendChild(C);for(var M="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var te=G%5==0?this.height/3:this.height/6;M+="h4v"+-te+"h1v"+te}M+="v1H0Z",this.scaleShape=Ee.createPath(M);var Q=Ee.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),C.appendChild(this.scaleShape),this.angleLabelElement=Ee.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ee.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Se=Ee.createTSpan("");return Se.innerHTML="&deg;",this.angleLabelElement.appendChild(Se),C.appendChild(this.angleLabelElement),document.body.removeChild(C),C},Y}(),Un=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(C,M,G,te,Q,Se,ot){var St=this;return new Promise(function(Pt){var ut=document.createElement("canvas");ut.width=C.width.baseVal.value-2*te,ut.height=C.height.baseVal.value-2*te;var Vt=1,tn=1;St.naturalSize===!0?(Vt=M.naturalWidth/(C.width.baseVal.value-2*te)/Se,tn=M.naturalHeight/(C.height.baseVal.value-2*te)/ot,ut.width=M.naturalWidth/Se,ut.height=M.naturalHeight/ot):St.width!==void 0&&St.height!==void 0&&(Vt=St.width/G.width,tn=St.height/G.height,ut.width*=Vt,ut.height*=tn);var Sn=ut.getContext("2d");Sn.translate(ut.width/2,ut.height/2),Sn.rotate(Q*Math.PI/180),Sn.scale(Se,ot),Sn.translate(-ut.width/2,-ut.height/2),Sn.drawImage(M,0,0,ut.width,ut.height);var wn=document.createElement("canvas");wn.width=G.width*Vt,wn.height=G.height*tn,wn.getContext("2d").putImageData(Sn.getImageData((G.x-te)*Vt,(G.y-te)*tn,G.width*Vt,G.height*tn),0,0),Pt(wn.toDataURL(St.imageType,St.imageQuality))})},Y}(),ft=function(){function Y(C){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=Y.instanceCounter++,this.styles=new Be(this.instanceNo),this.target=C,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(C){this._zoomToCropEnabled=C,C?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(C){this._gridLines=C,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(C){this._rotationAngle=C,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){var C;return(C=this._aspectRatio)!==null&&C!==void 0?C:this.aspectRatios[0]},set:function(C){this._aspectRatio=C},enumerable:!1,configurable:!0}),Y.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},Y.prototype.show=function(){this.showUI(),this.open()},Y.prototype.close=function(C){C===void 0&&(C=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),C||this.closeEventListeners.forEach(function(M){return M()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(C){this.renderEventListeners.push(C)},Y.prototype.removeRenderEventListener=function(C){this.renderEventListeners.indexOf(C)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(C),1)},Y.prototype.addCloseEventListener=function(C){this.closeEventListeners.push(C)},Y.prototype.removeCloseEventListener=function(C){this.closeEventListeners.indexOf(C)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(C),1)},Y.prototype.setupResizeObserver=function(){var C=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.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))},Y.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var C=1*this.target.clientWidth/this.target.clientHeight,M=this.contentDiv.clientWidth/C>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*C:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=M+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/C;this.resize(M,G)}},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.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",Ee.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Y.prototype.resize=function(C,M){this.imageWidth=Math.round(C),this.imageHeight=Math.round(M),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()},Y.prototype.setEditingTarget=function(){var C=document.createElement("canvas");C.width=this.target.naturalWidth,C.height=this.target.naturalHeight,C.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var M=C.toDataURL();Ee.setAttributes(this.editingTarget,[["href",M]]),this.setEditingTargetSize()},Y.prototype.setTopLeft=function(){var C=this.target.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=C.left-M.left-this.CANVAS_MARGIN,this.top=C.top-M.top-this.CANVAS_MARGIN},Y.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=Ee.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ee.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ee.createGroup(),this.editingTargetRotationScaleContainer=Ee.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var C=Ee.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(C);var M=Ee.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(M),this.editingTargetContainer=Ee.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)},Y.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Y.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ee.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new mn(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()},Y.prototype.zoomToCrop=function(){if(this.cropRect){var C=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,M=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=C+"px "+M+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-C+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-M+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Y.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)},Y.prototype.cropRectChanged=function(C){this.cropRect=C,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Y.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 C=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,M=this.target.offsetTop>C+this.CANVAS_MARGIN?this.target.offsetTop-(C+this.CANVAS_MARGIN):0;this.coverDiv.style.top=M+"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},Y.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Y.prototype.addTopToolbar=function(){var C=this;this.topToolbar=new Ct,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 M=new jt;M.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(M);var G=[];this.aspectRatios.forEach(function(tn){var Sn=new qt(un.getIcon(tn.horizontal,tn.vertical),tn.horizontal===0&&tn.vertical===0?"FREE":tn.horizontal+":"+tn.vertical);Sn.onClick=function(){return C.ratioButtonClicked(tn)},G.push(Sn)}),this.aspectRatioButton=new sn(un.getIcon(0,0),"Aspect ratio",G),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,M.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var te=new qt('<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");te.isActive=this.isGridVisible,te.onClick=function(){C.isGridVisible=!C.isGridVisible,te.isActive=C.isGridVisible},M.addButton(te);var Q=new qt('<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(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){C.zoomToCropEnabled=!C.zoomToCropEnabled,Q.isActive=C.zoomToCropEnabled},M.addButton(Q),!pt.isLicensed){var Se=new Ot;this.topToolbar.addElementBlock(Se);var ot=document.createElement("div");ot.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.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>',ot.appendChild(St),Se.addElement(ot)}var Pt=new jt;Pt.minWidth=3*this.toolbarHeight+"px",Pt.contentAlign="end",this.topToolbar.addButtonBlock(Pt);var ut=new qt('<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");ut.onClick=this.startRenderAndClose,Pt.addButton(ut),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ut.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Vt=new qt('<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");Vt.onClick=this.close,Pt.addButton(Vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Y.prototype.addBottomToolbar=function(){var C=this;this.bottomToolbar=new Ct,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 M=new jt;M.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(M);var G=new qt('<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");G.onClick=this.rotateLeftButtonClicked,M.addButton(G);var te=new qt('<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");te.onClick=this.rotateRightButtonClicked,M.addButton(te);var Q=new Ot;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new kn("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(Pt){C.rotateBy(Pt),C.straightener.angle=C.rotationAngle},Q.addElement(this.straightener.getUI());var Se=new jt;Se.minWidth=2*this.toolbarHeight+"px",Se.contentAlign="end",this.bottomToolbar.addButtonBlock(Se);var ot=new qt('<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");ot.onClick=this.flipHorizontallyButtonClicked,Se.addButton(ot);var St=new qt('<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");St.onClick=this.flipVerticallyButtonClicked,Se.addButton(St)},Y.prototype.ratioButtonClicked=function(C){this.aspectRatio=C,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=un.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Y.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Zt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Y.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Y.prototype.restoreState=function(C){if(C){var M=this.cropLayer.getRescaledRect(C.width,C.height,this.imageWidth,this.imageHeight,C.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(M),this.cropRectChanged(M),this.flippedHorizontally=C.flippedHorizontally,this.flippedVertically=C.flippedVertically,this.applyFlip(),this.rotationAngle=C.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(C,M){var G=this.cropImage.getBoundingClientRect();return{x:C-G.left,y:M-G.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var C=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=C+"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()},Y.prototype.rotateLeftButtonClicked=function(){var C=this.rotationAngle-90;this.rotationAngle%90!=0&&(C+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(C)},Y.prototype.rotateRightButtonClicked=function(){var C=this.rotationAngle+90;this.rotationAngle%90!=0&&(C-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(C)},Y.prototype.rotateTo=function(C){C=(C=C>180?C-360:C)<=-180?C+360:C,this.rotationAngle=C,this.applyRotation()},Y.prototype.rotateBy=function(C){this.rotateTo((this.rotationAngle+C)%360)},Y.prototype.applyRotation=function(){var C=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var M=this.editingTargetRotationContainer.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(M,0);var G=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/G.width,this.imageHeight/G.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=C},Y.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Y.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Y.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Y.prototype.startRenderAndClose=function(){return Ye(this,void 0,void 0,function(){var C,M;return bt(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return C=G.sent(),M=this.getState(),this.renderEventListeners.forEach(function(te){return te(C,M)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return Ye(this,void 0,void 0,function(){var C;return bt(this,function(M){switch(M.label){case 0:return(C=new Un).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.width=this.renderWidth,C.height=this.renderHeight,this.unzoomFromCrop(),Ee.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,C.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 M.sent(),[4,C.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,M.sent()]}})})},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ct("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 ct("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ct("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var C=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ct("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*C)+`px;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ct("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ct("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ct("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 ct("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ct("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 ct("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ct("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Y.instanceCounter=0,Y}(),Wt=K("8hTe"),Qt=K.n(Wt),$t=/<pre[^>]*>/g;function en(Y){var C=document.createElement("div");return C.innerHTML=Y,C.childNodes.length===0?"":C.childNodes[0].nodeValue}var fn=Me.a=function(Y){var C=Y.value,M=C===void 0?"":C,G=Y.edit,te=G===void 0?!1:G,Q=Y.className,Se=Y.showTextOnly,ot=Y.showLines,St=Y.replaces,Pt=Y.zoomImg,ut=Y.hasMask,Vt=Y.style,tn=Vt===void 0?{}:Vt,Sn=Y.stylesPrev,wn=Sn===void 0?{}:Sn,_n=String(M),Fn=Object(T.useRef)(),mi=Object(T.useRef)(),ki=Object(T.useState)(""),Kn=Object(H.a)(ki,2),si=Kn[0],Ai=Kn[1],_i=Object(T.useState)("office"),ni=Object(H.a)(_i,2),Ki=ni[0],Pi=ni[1],Gi=function(){var Ft=new ft(mi.current);Ft.displayMode="popup",Ft.addRenderEventListener(function(){var Gn=Object(D.a)(k.a.mark(function pn(xe){var dn;return k.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Fn.current.style.display="none",Qn.next=3,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xe}});case 3:dn=Qn.sent,dn!=null&&dn.id&&St(mi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(dn==null?void 0:dn.id,"?type=").concat(dn.content_type));case 5:case"end":return Qn.stop()}},pn)}));return function(pn){return Gn.apply(this,arguments)}}()),Ft.show()},zi=function(){var Ft=new le(mi.current);Ft.settings.displayMode="popup",Ft.addEventListener("render",function(){var Gn=Object(D.a)(k.a.mark(function pn(xe){var dn;return k.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:if(Fn.current.style.display="none",!mi.current){Qn.next=6;break}return Qn.next=4,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:xe.dataUrl}});case 4:dn=Qn.sent,dn!=null&&dn.id&&St(mi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(dn==null?void 0:dn.id,"?type=").concat(dn.content_type));case 6:case"end":return Qn.stop()}},pn)}));return function(pn){return Gn.apply(this,arguments)}}()),Ft.show(),window.markerArea=Ft},Ni=Object(T.useMemo)(function(){Fn.current&&(Fn.current.style.zIndex=-1);try{var Ln=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Gn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;_n=_n.replace(Ln,"("+ee.a.API_SERVER+"/api/attachments/").replace(Ft,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Gn,'"'+ee.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Bi){}var pn=L(_n),xe=E();if(_n.match(/\[TOC\]/)&&(pn=pn.replace("<p>[TOC]</p>",O()),I()),pn=pn.replace(/(__special_katext_id_\d+__)/g,function(Bi,Qn){var gn=xe[Qn],Zi=gn.type,Oi=gn.expression;return Object(se.renderToString)(en(Oi)||"",{displayMode:Zi==="block",throwOnError:!1,output:"html"})}),pn=pn.replace(/▁/g,"\u2581\u2581\u2581"),b(),Se){var dn=document.createElement("div");return dn.innerHTML=pn,dn.innerText}return setTimeout(function(){return Ji()},500),pn},[_n]),$n=Object(T.useRef)();w.WebkitLineClamp=ot,ot&&(tn=Object(W.a)(Object(W.a)({},tn),w));function Ui(Ln){var Ft=Ln.target;if(Ft.tagName.toUpperCase()==="IMG"){if(Pt){var Gn=Ft.getAttribute("src");Ai(Gn),Pi("image")}}else if(Ft.tagName.toUpperCase()==="A"){var pn=Ft.getAttribute("href");if(pn.indexOf("office")>-1)Ln.preventDefault(),Ai(pn),Pi("office");else if(pn.indexOf("application/pdf")>-1)Ln.preventDefault(),Ai(pn),Pi("pdf");else if(pn.indexOf("text/html")>-1)Ln.preventDefault(),Ai(pn),Pi("html");else if(pn.startsWith("#")){Ln.preventDefault();var xe=document.getElementById(pn.replace("#",""));xe&&xe.scrollIntoView(!0)}}}var Ji=function(){var Ft,Gn=(Ft=$n.current)===null||Ft===void 0?void 0:Ft.querySelectorAll("video");Gn==null||Gn.forEach(function(pn){if(pn.oncontextmenu=function(){return!1},pn.src.indexOf(".m3u8")>-1&&!pn.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var xe=new X.a;xe.loadSource(pn.src),xe.attachMedia(pn)}}})};Object(T.useEffect)(function(){if($n.current&&Ni&&(Ni.match($t)&&window.PR.prettyPrint()),$n.current)return $n.current.addEventListener("click",Ui),function(){$n.current.removeEventListener("click",Ui),b(),I()}},[Ni,$n.current,Ui]);var di=function(Ft){if(!te)return;Ft.target.nodeName==="IMG"?(Fn.current.style.zIndex=1,Fn.current.style.display="flex",Fn.current.style.width=Ft.target.clientWidth+"px",Fn.current.style.height=Ft.target.clientHeight+"px",Fn.current.style.top=Ft.target.offsetTop+"px",Fn.current.style.left=Ft.target.offsetLeft+"px",mi.current.src=Ft.target.getAttribute("src")):Fn.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$n,style:Object(W.a)({},tn),className:"".concat(Q||""," markdown-body ").concat(Qt.a.mdBody),onMouseOver:di,dangerouslySetInnerHTML:{__html:Ni}}),v.a.createElement("div",{ref:Fn,className:Qt.a.button},v.a.createElement(z.a,null,v.a.createElement(V.a,{onClick:function(){return Gi()}},"\u88C1\u526A"),v.a.createElement(V.a,{onClick:function(){return zi()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:mi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ce.a,{close:!0,data:si,type:si!=null&&si.length?Ki:"",style:Object(W.a)({},wn),onClose:function(){return Ai("")}}))}},"9VGf":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return N});var q=K("q1tI"),z=K.n(q);function N(V,W){var D=Object(q.useRef)();Object(q.useEffect)(function(){D.current=V}),Object(q.useEffect)(function(){function H(){D.current()}if(W!==null){var F=setInterval(H,W);return function(){return clearInterval(F)}}},[W])}},"A/g1":function(Ke,Me){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjEtMDctMDJUMTk6Mzg6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmVkYzRhODM0LTVjNWQtNDQ1My04MDYzLWNkNzcwODQyODg5ZSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjQ4MTE0OTVlLTVkMDctZTk0YS1iNWEwLWYxOWJmZmM0NGUyNyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmMwNjQyYzA1LTg5MzQtNDdlYy04MTFiLTlkYjdhZGNkYjFiMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YzA2NDJjMDUtODkzNC00N2VjLTgxMWItOWRiN2FkY2RiMWIwIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjM4OjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWRjNGE4MzQtNWM1ZC00NDUzLTgwNjMtY2Q3NzA4NDI4ODllIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5fJkpyAAAGoElEQVRogc2abWxbVxnH/8+59/rdTpx2GW3UNWJJV7Ylaxp3LUFsWgJDiI5R8bK2GppAmsgQLKQthS8IEJ9okibrREf3gX2Y1K2bxAoDtog60RBSVxKnWUO7kpSppXJZK2ja2HFi33vPw4cmpbN9r++1k8Lv2znnf577f+zje95Mhw4dQqUkwljpF7kuv0EdHkm1HklRr6TQq2tn5xcklwhIMnMSQJIJxykTiSce+1am0mer5XacqM7uDJjiqbAuWlvSygrBnmKyxcoI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"},BU3w:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return D});var q=K("MNnm"),z="rc-util-key";function N(H){if(H.attachTo)return H.attachTo;var F=document.querySelector("head");return F||document.body}function V(H){var F,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var T=document.createElement("style");if((F=k.csp)===null||F===void 0?void 0:F.nonce){var v;T.nonce=(v=k.csp)===null||v===void 0?void 0:v.nonce}T.innerHTML=H;var m=N(k),c=m.firstChild;return k.prepend&&m.prepend?m.prepend(T):k.prepend&&c?m.insertBefore(T,c):m.appendChild(T),T}var W=new Map;function D(H,F){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},T=N(k);if(!W.has(T)){var v=V("",k),m=v.parentNode;W.set(T,m),m.removeChild(v)}var c=Array.from(W.get(T).children).find(function(a){return a.tagName==="STYLE"&&a[z]===F});if(c){var d,r;if(((d=k.csp)===null||d===void 0?void 0:d.nonce)&&c.nonce!==((r=k.csp)===null||r===void 0?void 0:r.nonce)){var s;c.nonce=(s=k.csp)===null||s===void 0?void 0:s.nonce}return c.innerHTML!==H&&(c.innerHTML=H),c}var o=V(H,k);return o[z]=F,o}},Bd2K:function(Ke,Me,K){(function(q){q(K("VrN/"),K("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(k,T,v){if(v!=q.Init&&v&&k.removeKeyMap("autoCloseTags"),!T)return;var m={name:"autoCloseTags"};(typeof T!="object"||T.whenClosing!==!1)&&(m["'/'"]=function(c){return D(c)}),(typeof T!="object"||T.whenOpening!==!1)&&(m["'>'"]=function(c){return V(c)}),k.addKeyMap(m)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["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 V(k){if(k.getOption("disableInput"))return q.Pass;for(var T=k.listSelections(),v=[],m=k.getOption("autoCloseTags"),c=0;c<T.length;c++){if(!T[c].empty())return q.Pass;var d=T[c].head,r=k.getTokenAt(d),s=q.innerMode(k.getMode(),r.state),o=s.state,a=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(o),l=a&&a.name;if(!l)return q.Pass;var h=s.mode.configuration=="html",I=typeof m=="object"&&m.dontCloseTags||h&&z,w=typeof m=="object"&&m.indentTags||h&&N;r.end>d.ch&&(l=l.slice(0,l.length-r.end+d.ch));var x=l.toLowerCase();if(!l||r.type=="string"&&(r.end!=d.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&a.close||r.string.indexOf("/")==d.ch-r.start-1||I&&H(I,x)>-1||F(k,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(o)||[],l,d,!0))return q.Pass;var O=typeof m=="object"&&m.emptyTags;if(O&&H(O,l)>-1){v[c]={text:"/>",newPos:q.Pos(d.line,d.ch+2)};continue}var S=w&&H(w,x)>-1;v[c]={indent:S,text:">"+(S?`
`:"")+"</"+l+">",newPos:S?q.Pos(d.line+1,0):q.Pos(d.line,d.ch+1)}}for(var _=typeof m=="object"&&m.dontIndentOnAutoClose,c=T.length-1;c>=0;c--){var g=v[c];k.replaceRange(g.text,T[c].head,T[c].anchor,"+insert");var f=k.listSelections().slice(0);f[c]={head:g.newPos,anchor:g.newPos},k.setSelections(f),!_&&g.indent&&(k.indentLine(g.newPos.line,null,!0),k.indentLine(g.newPos.line+1,null,!0))}}function W(k,T){for(var v=k.listSelections(),m=[],c=T?"/":"</",d=k.getOption("autoCloseTags"),r=typeof d=="object"&&d.dontIndentOnSlash,s=0;s<v.length;s++){if(!v[s].empty())return q.Pass;var o=v[s].head,a=k.getTokenAt(o),l=q.innerMode(k.getMode(),a.state),h=l.state;if(T&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=o.ch-1))return q.Pass;var I,w=l.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(w&&l.mode.name=="javascript")I=c+"script";else if(w&&l.mode.name=="css")I=c+"style";else{var x=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(h);if(!x||x.length&&F(k,x,x[x.length-1],o))return q.Pass;I=c+x[x.length-1]}k.getLine(o.line).charAt(a.end)!=">"&&(I+=">"),m[s]=I}if(k.replaceSelections(m),v=k.listSelections(),!r)for(var s=0;s<v.length;s++)(s==v.length-1||v[s].head.line<v[s+1].head.line)&&k.indentLine(v[s].head.line)}function D(k){return k.getOption("disableInput")?q.Pass:W(k,!0)}q.commands.closeTag=function(k){return W(k)};function H(k,T){if(k.indexOf)return k.indexOf(T);for(var v=0,m=k.length;v<m;++v)if(k[v]==T)return v;return-1}function F(k,T,v,m,c){if(!q.scanForClosingTag)return!1;var d=Math.min(k.lastLine()+1,m.line+500),r=q.scanForClosingTag(k,m,null,d);if(!r||r.tag!=v)return!1;for(var s=c?1:0,o=T.length-1;o>=0&&T[o]==v;o--)++s;m=r.to;for(var o=1;o<s;o++){var a=q.scanForClosingTag(k,m,null,d);if(!a||a.tag!=v)return!1;m=a.to}return!0}})},BjJ7:function(Ke,Me,K){"use strict";K.d(Me,"d",function(){return z}),K.d(Me,"c",function(){return N}),K.d(Me,"e",function(){return V}),K.d(Me,"b",function(){return W}),K.d(Me,"a",function(){return H});var q=K("m3rI");function z(F){var k=!0;if(F.length>0){for(var T=0;T<F.length;T++)if(F[T].compile_success==0||!F[T].compile_success){k=!1;break}}else k=!1;return k}function N(F){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",T=[],v=0;v<F.length;v++){var m=F[v],c=k?"".concat(k,"/").concat(m.name):"".concat(m.name);T.push({title:m.name,isLeaf:!(m.type==="tree"),key:c})}return T}function V(F,k,T){for(var v=0;v<F.length;v++){var m=F[v];if(m.key===k){m.children=T;break}m.children&&V(m.children,k,T)}return F}function W(F,k,T){var v;return function(){var m=this,c=arguments,d=function(){v=null,T||F.apply(m,c)},r=T&&!v;clearTimeout(v),v=setTimeout(d,k),r&&F.apply(m,c)}}var D=!0,H=q.a.API_SERVER},BlwA:function(Ke,Me,K){"use strict";var q=K("9og8"),z=K("miYZ"),N=K("tsqr"),V=K("tJVT"),W=K("WmNS"),D=K.n(W),H=K("q1tI"),F=K.n(H),k=K("Ty5D"),T=K("ErOA"),v=K("m3rI"),m=K("DR4n"),c=K.n(m),d=function(o,a){for(var l=o.split(","),h=l[0].match(/:(.*?);/)[1],I=atob(l[1]),w=I.length,x=new Uint8Array(w);w--;)x[w]=I.charCodeAt(w);return new Blob([x],{type:h})},r=Object(H.forwardRef)(function(s,o){var a=s.time,l=s.number,h=s.supportCamera,I=s.take_photo,w=s.update,x=s.id,O=Object(H.useRef)(),S=Object(H.useRef)(),_=Object(k.i)(),g=Object(H.useState)([]),f=Object(V.a)(g,2),u=f[0],E=f[1],b=Object(H.useState)(0),y=Object(V.a)(b,2),P=y[0],R=y[1],U=Object(H.useState)(""),L=Object(V.a)(U,2),j=L[0],A=L[1],X=Object(H.useState)(),ee=Object(V.a)(X,2),se=ee[0],ce=ee[1],Le=Object(H.useState)(0),Ce=Object(V.a)(Le,2),Ae=Ce[0],Pe=Ce[1];Object(H.useEffect)(function(){return de(),function(){ge(),Ie()}},[]),Object(H.useEffect)(function(){P===2&&a&&l>0&&(pe(),Pe(1))},[a]),Object(H.useEffect)(function(){if(Ae===0)return;if(Ae===2)clearInterval(se);else{var De=0,Ue=setInterval(function(){u.includes(De)&&ne(),De++},1e3);ce(Ue)}return function(){return clearInterval(se)}},[Ae]),Object(H.useImperativeHandle)(o,function(){return{handlePhoto:ne}});var Ie=function(){Pe(2)},pe=function(){var Ue=a/l,we=[];function Ge(Qe,et){return parseInt(Math.floor(Math.random()*(et-Qe+1))+Qe)}new Array(l).fill(0).map(function(Qe,et){I?we.push(Ge(Ue*et,Ue*(et+1))):et==0?we.push(0):we.push(Ge(Ue*et,Ue*(et+1)))}),u=we,E([].concat(we)),console.log(we)},de=function(){navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(Ue){var we=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return we?new Promise(function(Ge,Qe){we.call(navigator,Ue,Ge,Qe)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({video:{width:640,height:480}}).then(function(Ue){h&&h(2),R(2),"srcObject"in O.current?O.current.srcObject=Ue:O.current.src=window.URL.createObjectURL(Ue),O.current.onloadedmetadata=function(we){O.current.play()},O.current.addEventListener("ended",function(){console.log("\u64AD\u653E\u7ED3\u675F"),Ie(),N.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(Ue){R(1),h&&h(1),Ue.message==="Permission denied"||Ue.name==="NotAllowedError"?N.b.error("\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"):N.b.error("\u6444\u50CF\u5934\u83B7\u53D6\u5931\u8D25\uFF0C\u6216\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"),console.log("errname: "+Ue.name),console.log("err: "+Ue.message)})},ne=function(){try{S.current.width=O.current.videoWidth,S.current.height=O.current.videoHeight;var Ue=S.current.getContext("2d");Ue.drawImage(O.current,0,0,S.current.width,S.current.height),A(S.current.toDataURL("image/png")),oe(S.current.toDataURL("image/png"))}catch(we){}},ge=function(){try{var Ue=O.current.srcObject,we=Ue.getTracks();we.forEach(function(Ge){Ge.stop()}),O.current.srcObject=null}catch(Ge){}},oe=function(){var De=Object(q.a)(D.a.mark(function Ue(we){var Ge,Qe;return D.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:Ge=new FormData,Ge.append("file",d(we,"1")),Ge.append("1","123"),Qe=new window.XMLHttpRequest,Qe.withCredentials=!0,Qe.addEventListener("load",function(Je){var Xe=JSON.parse(Je.target.responseText);Object(T.a)("/api/exercises/".concat(x,"/upload_photo.json"),{method:"post",body:{attachment_id:Xe.id}})},!1),Qe.addEventListener("error",function(Je){console.error(Je)},!1),Qe.open("POST","".concat(v.a.API_SERVER,"/api/attachments.json")),Qe.send(Ge);case 9:case"end":return ze.stop()}},Ue)}));return function(we){return De.apply(this,arguments)}}();return F.a.createElement(F.a.Fragment,null,P!==3&&F.a.createElement("aside",{className:c.a.video,id:"screenshot"},P===0&&F.a.createElement("span",null,"\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."),P===1&&F.a.createElement("span",null,"\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"),P===2&&F.a.createElement("div",null,F.a.createElement("video",{width:"288",ref:O,autoPlay:!0}),F.a.createElement("canvas",{style:{display:"none"},ref:S}))))});Me.a=r},"C+DQ":function(Ke,Me,K){},D1Df:function(Ke,Me,K){"use strict";function q(y){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?q=function(R){return typeof R}:q=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},q(y)}function z(){return z=Object.assign||function(y){for(var P=1;P<arguments.length;P++){var R=arguments[P];for(var U in R)Object.prototype.hasOwnProperty.call(R,U)&&(y[U]=R[U])}return y},z.apply(this,arguments)}function N(y,P){var R=Object.keys(y);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(y);P&&(U=U.filter(function(L){return Object.getOwnPropertyDescriptor(y,L).enumerable})),R.push.apply(R,U)}return R}function V(y){for(var P=1;P<arguments.length;P++){var R=arguments[P]!=null?arguments[P]:{};P%2?N(R,!0).forEach(function(U){r(y,U,R[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(R)):N(R).forEach(function(U){Object.defineProperty(y,U,Object.getOwnPropertyDescriptor(R,U))})}return y}function W(y,P){if(y==null)return{};var R=D(y,P),U,L;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(y);for(L=0;L<j.length;L++){if(U=j[L],P.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(y,U))continue;R[U]=y[U]}}return R}function D(y,P){if(y==null)return{};var R={},U=Object.keys(y),L,j;for(j=0;j<U.length;j++){if(L=U[j],P.indexOf(L)>=0)continue;R[L]=y[L]}return R}function H(y,P){if(!(y instanceof P))throw new TypeError("Cannot call a class as a function")}function F(y,P){for(var R=0;R<P.length;R++){var U=P[R];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(y,U.key,U)}}function k(y,P,R){return P&&F(y.prototype,P),R&&F(y,R),y}function T(y,P){return P&&(q(P)==="object"||typeof P=="function")?P:m(y)}function v(y){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},v(y)}function m(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function c(y,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(P&&P.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),P&&d(y,P)}function d(y,P){return d=Object.setPrototypeOf||function(U,L){return U.__proto__=L,U},d(y,P)}function r(y,P,R){return P in y?Object.defineProperty(y,P,{value:R,enumerable:!0,configurable:!0,writable:!0}):y[P]=R,y}var s=K("q1tI"),o=K("17x9"),a=K("H38U"),l=K("aRTE");function h(y){for(var P="",R=0;R<y.length;R++){var U=y.charCodeAt(R);U<128?P+=String.fromCharCode(U):U<2048?(P+=String.fromCharCode(192|U>>6),P+=String.fromCharCode(128|U&63)):U<55296||U>=57344?(P+=String.fromCharCode(224|U>>12),P+=String.fromCharCode(128|U>>6&63),P+=String.fromCharCode(128|U&63)):(R++,U=65536+((U&1023)<<10|y.charCodeAt(R)&1023),P+=String.fromCharCode(240|U>>18),P+=String.fromCharCode(128|U>>12&63),P+=String.fromCharCode(128|U>>6&63),P+=String.fromCharCode(128|U&63))}return P}var I={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},w={},x=4,O=.1;function S(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=[];return y.forEach(function(U,L){var j=null;U.forEach(function(A,X){if(!A&&j!==null){R.push("M".concat(j+P," ").concat(L+P,"h").concat(X-j,"v1H").concat(j+P,"z")),j=null;return}if(X===U.length-1){if(!A)return;j===null?R.push("M".concat(X+P,",").concat(L+P," h1v1H").concat(X+P,"z")):R.push("M".concat(j+P,",").concat(L+P," h").concat(X+1-j,"v1H").concat(j+P,"z"));return}A&&j===null&&(j=X)})}),R.join("")}function _(y,P){return y.slice().map(function(R,U){return U<P.y||U>=P.y+P.h?R:R.map(function(L,j){return j<P.x||j>=P.x+P.w?L:!1})})}function g(y,P){var R=y.imageSettings,U=y.size,L=y.includeMargin;if(R==null)return null;var j=L?x:0,A=P.length+j*2,X=Math.floor(U*O),ee=A/U,se=(R.width||X)*ee,ce=(R.height||X)*ee,Le=R.x==null?P.length/2-se/2:R.x*ee,Ce=R.y==null?P.length/2-ce/2:R.y*ee,Ae=null;if(R.excavate){var Pe=Math.floor(Le),Ie=Math.floor(Ce),pe=Math.ceil(se+Le-Pe),de=Math.ceil(ce+Ce-Ie);Ae={x:Pe,y:Ie,w:pe,h:de}}return{x:Le,y:Ce,h:ce,w:se,excavation:Ae}}var f=function(){try{new Path2D().addPath(new Path2D)}catch(y){return!1}return!0}(),u=function(y){c(P,y);function P(){var R,U;H(this,P);for(var L=arguments.length,j=new Array(L),A=0;A<L;A++)j[A]=arguments[A];return U=T(this,(R=v(P)).call.apply(R,[this].concat(j))),r(m(U),"_canvas",void 0),r(m(U),"_image",void 0),r(m(U),"state",{imgLoaded:!1}),r(m(U),"handleImageLoad",function(){U.setState({imgLoaded:!0})}),U}return k(P,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var U=this.props,L=U.value,j=U.size,A=U.level,X=U.bgColor,ee=U.fgColor,se=U.includeMargin,ce=U.imageSettings,Le=new a(-1,l[A]);if(Le.addData(h(L)),Le.make(),this._canvas!=null){var Ce=this._canvas,Ae=Ce.getContext("2d");if(!Ae)return;var Pe=Le.modules;if(Pe===null)return;var Ie=se?x:0,pe=Pe.length+Ie*2,de=g(this.props,Pe);ce!=null&&de!=null&&(de.excavation!=null&&(Pe=_(Pe,de.excavation)));var ne=window.devicePixelRatio||1;Ce.height=Ce.width=j*ne;var ge=j/pe*ne;Ae.scale(ge,ge),Ae.fillStyle=X,Ae.fillRect(0,0,pe,pe),Ae.fillStyle=ee,f?Ae.fill(new Path2D(S(Pe,Ie))):Pe.forEach(function(oe,De){oe.forEach(function(Ue,we){Ue&&Ae.fillRect(we+Ie,De+Ie,1,1)})}),this.state.imgLoaded&&this._image&&de!=null&&Ae.drawImage(this._image,de.x+Ie,de.y+Ie,de.w,de.h)}}},{key:"render",value:function(){var U=this,L=this.props,j=L.value,A=L.size,X=L.level,ee=L.bgColor,se=L.fgColor,ce=L.style,Le=L.includeMargin,Ce=L.imageSettings,Ae=W(L,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),Pe=V({height:A,width:A},ce),Ie=null,pe=Ce&&Ce.src;return Ce!=null&&pe!=null&&(Ie=s.createElement("img",{src:pe,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(ne){return U._image=ne}})),s.createElement(s.Fragment,null,s.createElement("canvas",z({style:Pe,height:A,width:A,ref:function(ne){return U._canvas=ne}},Ae)),Ie)}}]),P}(s.PureComponent);r(u,"defaultProps",I);var E=function(y){c(P,y);function P(){return H(this,P),T(this,v(P).apply(this,arguments))}return k(P,[{key:"render",value:function(){var U=this.props,L=U.value,j=U.size,A=U.level,X=U.bgColor,ee=U.fgColor,se=U.includeMargin,ce=U.imageSettings,Le=W(U,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),Ce=new a(-1,l[A]);Ce.addData(h(L)),Ce.make();var Ae=Ce.modules;if(Ae===null)return null;var Pe=se?x:0,Ie=Ae.length+Pe*2,pe=g(this.props,Ae),de=null;ce!=null&&pe!=null&&(pe.excavation!=null&&(Ae=_(Ae,pe.excavation)),de=s.createElement("image",{xlinkHref:ce.src,height:pe.h,width:pe.w,x:pe.x+Pe,y:pe.y+Pe,preserveAspectRatio:"none"}));var ne=S(Ae,Pe);return s.createElement("svg",z({shapeRendering:"crispEdges",height:j,width:j,viewBox:"0 0 ".concat(Ie," ").concat(Ie)},Le),s.createElement("path",{fill:X,d:"M0,0 h".concat(Ie,"v").concat(Ie,"H0z")}),s.createElement("path",{fill:ee,d:ne}),de)}}]),P}(s.PureComponent);r(E,"defaultProps",I);var b=function(P){var R=P.renderAs,U=W(P,["renderAs"]),L=R==="svg"?E:u;return s.createElement(L,U)};b.defaultProps=V({renderAs:"canvas"},I),Ke.exports=b},DR4n:function(Ke,Me,K){Ke.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(Ke,Me,K){(function(q,z){Ke.exports=z()})(this,function(){"use strict";function q(Te,fe){for(var me=0;me<fe.length;me++){var re=fe[me];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Te,re.key,re)}}function z(Te,fe,me){return fe&&q(Te.prototype,fe),me&&q(Te,me),Te}function N(Te,fe){if(!Te)return;if(typeof Te=="string")return V(Te,fe);var me=Object.prototype.toString.call(Te).slice(8,-1);if(me==="Object"&&Te.constructor&&(me=Te.constructor.name),me==="Map"||me==="Set")return Array.from(Te);if(me==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(me))return V(Te,fe)}function V(Te,fe){(fe==null||fe>Te.length)&&(fe=Te.length);for(var me=0,re=new Array(fe);me<fe;me++)re[me]=Te[me];return re}function W(Te,fe){var me;if(typeof Symbol=="undefined"||Te[Symbol.iterator]==null){if(Array.isArray(Te)||(me=N(Te))||fe&&Te&&typeof Te.length=="number"){me&&(Te=me);var re=0;return function(){return re>=Te.length?{done:!0}:{done:!1,value:Te[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 me=Te[Symbol.iterator](),me.next.bind(me)}function D(Te,fe){return fe={exports:{}},Te(fe,fe.exports),fe.exports}var H=D(function(Te){function fe(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function me(re){Te.exports.defaults=re}Te.exports={defaults:fe(),getDefaults:fe,changeDefaults:me}}),F=H.defaults,k=H.getDefaults,T=H.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=function(fe){return r[fe]};function o(Te,fe){if(fe){if(v.test(Te))return Te.replace(m,s)}else if(c.test(Te))return Te.replace(d,s);return Te}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Te){return Te.replace(a,function(fe,me){return me=me.toLowerCase(),me==="colon"?":":me.charAt(0)==="#"?me.charAt(1)==="x"?String.fromCharCode(parseInt(me.substring(2),16)):String.fromCharCode(+me.substring(1)):""})}var h=/(^|[^\[])\^/g;function I(Te,fe){Te=Te.source||Te,fe=fe||"";var me={replace:function(ae,he){return he=he.source||he,he=he.replace(h,"$1"),Te=Te.replace(ae,he),me},getRegex:function(){return new RegExp(Te,fe)}};return me}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Te,fe,me){if(Te){var re;try{re=decodeURIComponent(l(me)).replace(w,"").toLowerCase()}catch(ae){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}fe&&!x.test(me)&&(me=u(fe,me));try{me=encodeURI(me).replace(/%25/g,"%")}catch(ae){return null}return me}var S={},_=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(Te,fe){S[" "+Te]||(_.test(Te)?S[" "+Te]=Te+"/":S[" "+Te]=P(Te,"/",!0)),Te=S[" "+Te];var me=Te.indexOf(":")===-1;return fe.substring(0,2)==="//"?me?fe:Te.replace(g,"$1")+fe:fe.charAt(0)==="/"?me?fe:Te.replace(f,"$1")+fe:Te+fe}var E={exec:function(){}};function b(Te){for(var fe=1,me,re;fe<arguments.length;fe++){me=arguments[fe];for(re in me)Object.prototype.hasOwnProperty.call(me,re)&&(Te[re]=me[re])}return Te}function y(Te,fe){var me=Te.replace(/\|/g,function(he,ve,_e){for(var je=!1,at=ve;--at>=0&&_e[at]==="\\";)je=!je;return je?"|":" |"}),re=me.split(/ \|/),ae=0;if(re.length>fe)re.splice(fe);else for(;re.length<fe;)re.push("");for(;ae<re.length;ae++)re[ae]=re[ae].trim().replace(/\\\|/g,"|");return re}function P(Te,fe,me){var re=Te.length;if(re===0)return"";for(var ae=0;ae<re;){var he=Te.charAt(re-ae-1);if(he===fe&&!me)ae++;else if(he!==fe&&me)ae++;else break}return Te.substr(0,re-ae)}function R(Te,fe){if(Te.indexOf(fe[1])===-1)return-1;for(var me=Te.length,re=0,ae=0;ae<me;ae++)if(Te[ae]==="\\")ae++;else if(Te[ae]===fe[0])re++;else if(Te[ae]===fe[1]&&(re--,re<0))return ae;return-1}function U(Te){Te&&Te.sanitize&&!Te.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 L={escape:o,unescape:l,edit:I,cleanUrl:O,resolveUrl:u,noopTest:E,merge:b,splitCells:y,rtrim:P,findClosingBracket:R,checkSanitizeDeprecation:U},j=H.defaults,A=L.rtrim,X=L.splitCells,ee=L.escape,se=L.findClosingBracket;function ce(Te,fe,me){var re=fe.href,ae=fe.title?ee(fe.title):null,he=Te[1].replace(/\\([\[\]])/g,"$1");return Te[0].charAt(0)!=="!"?{type:"link",raw:me,href:re,title:ae,text:he}:{type:"image",raw:me,href:re,title:ae,text:ee(he)}}function Le(Te,fe){var me=Te.match(/^(\s+)(?:```)/);if(me===null)return fe;var re=me[1];return fe.split(`
`).map(function(ae){var he=ae.match(/^\s+/);if(he===null)return ae;var ve=he[0];return ve.length>=re.length?ae.slice(re.length):ae}).join(`
`)}var Ce=function(){function Te(me){this.options=me||j}var fe=Te.prototype;return fe.space=function(re){var ae=this.rules.block.newline.exec(re);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
`}},fe.code=function(re,ae){var he=this.rules.block.code.exec(re);if(he){var ve=ae[ae.length-1];if(ve&&ve.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var _e=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:A(_e,`
`)}}},fe.fences=function(re){var ae=this.rules.block.fences.exec(re);if(ae){var he=ae[0],ve=Le(he,ae[3]||"");return{type:"code",raw:he,lang:ae[2]?ae[2].trim():ae[2],text:ve}}},fe.heading=function(re){var ae=this.rules.block.heading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},fe.nptable=function(re){var ae=this.rules.block.nptable.exec(re);if(ae){var he={type:"table",header:X(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[],raw:ae[0]};if(he.header.length===he.align.length){var ve=he.align.length,_e;for(_e=0;_e<ve;_e++)/^ *-+: *$/.test(he.align[_e])?he.align[_e]="right":/^ *:-+: *$/.test(he.align[_e])?he.align[_e]="center":/^ *:-+ *$/.test(he.align[_e])?he.align[_e]="left":he.align[_e]=null;for(ve=he.cells.length,_e=0;_e<ve;_e++)he.cells[_e]=X(he.cells[_e],he.header.length);return he}}},fe.hr=function(re){var ae=this.rules.block.hr.exec(re);if(ae)return{type:"hr",raw:ae[0]}},fe.blockquote=function(re){var ae=this.rules.block.blockquote.exec(re);if(ae){var he=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:he}}},fe.list=function(re){var ae=this.rules.block.list.exec(re);if(ae){for(var he=ae[0],ve=ae[2],_e=ve.length>1,je=ve[ve.length-1]===")",at={type:"list",raw:he,ordered:_e,start:_e?+ve.slice(0,-1):"",loose:!1,items:[]},Et=ae[0].match(this.rules.block.item),Lt=!1,Tt,mt,Ze,$e,He,le,be,rt=Et.length,Ye=0;Ye<rt;Ye++)Tt=Et[Ye],he=Tt,mt=Tt.length,Tt=Tt.replace(/^ *([*+-]|\d+[.)]) */,""),~Tt.indexOf(`
`)&&(mt-=Tt.length,Tt=this.options.pedantic?Tt.replace(/^ {1,4}/gm,""):Tt.replace(new RegExp("^ {1,"+mt+"}","gm"),"")),Ye!==rt-1&&(Ze=this.rules.block.bullet.exec(Et[Ye+1])[0],(_e?Ze.length===1||!je&&Ze[Ze.length-1]===")":Ze.length>1||this.options.smartLists&&Ze!==ve)&&($e=Et.slice(Ye+1).join(`
`),at.raw=at.raw.substring(0,at.raw.length-$e.length),Ye=rt-1)),He=Lt||/\n\n(?!\s*$)/.test(Tt),Ye!==rt-1&&(Lt=Tt.charAt(Tt.length-1)===`
`,He||(He=Lt)),He&&(at.loose=!0),le=/^\[[ xX]\] /.test(Tt),be=void 0,le&&(be=Tt[1]!==" ",Tt=Tt.replace(/^\[[ xX]\] +/,"")),at.items.push({type:"list_item",raw:he,task:le,checked:be,loose:He,text:Tt});return at}},fe.html=function(re){var ae=this.rules.block.html.exec(re);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):ee(ae[0]):ae[0]}},fe.def=function(re){var ae=this.rules.block.def.exec(re);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var he=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:ae[0],href:ae[2],title:ae[3]}}},fe.table=function(re){var ae=this.rules.block.table.exec(re);if(ae){var he={type:"table",header:X(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[]};if(he.header.length===he.align.length){he.raw=ae[0];var ve=he.align.length,_e;for(_e=0;_e<ve;_e++)/^ *-+: *$/.test(he.align[_e])?he.align[_e]="right":/^ *:-+: *$/.test(he.align[_e])?he.align[_e]="center":/^ *:-+ *$/.test(he.align[_e])?he.align[_e]="left":he.align[_e]=null;for(ve=he.cells.length,_e=0;_e<ve;_e++)he.cells[_e]=X(he.cells[_e].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},fe.lheading=function(re){var ae=this.rules.block.lheading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},fe.paragraph=function(re){var ae=this.rules.block.paragraph.exec(re);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
`?ae[1].slice(0,-1):ae[1]}},fe.text=function(re,ae){var he=this.rules.block.text.exec(re);if(he){var ve=ae[ae.length-1];return ve&&ve.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},fe.escape=function(re){var ae=this.rules.inline.escape.exec(re);if(ae)return{type:"escape",raw:ae[0],text:ee(ae[1])}},fe.tag=function(re,ae,he){var ve=this.rules.inline.tag.exec(re);if(ve)return!ae&&/^<a /i.test(ve[0])?ae=!0:ae&&/^<\/a>/i.test(ve[0])&&(ae=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:ae,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):ee(ve[0]):ve[0]}},fe.link=function(re){var ae=this.rules.inline.link.exec(re);if(ae){var he=se(ae[2],"()");if(he>-1){var ve=ae[0].indexOf("!")===0?5:4,_e=ve+ae[1].length+he;ae[2]=ae[2].substring(0,he),ae[0]=ae[0].substring(0,_e).trim(),ae[3]=""}var je=ae[2],at="";if(this.options.pedantic){var Et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(je);Et?(je=Et[1],at=Et[3]):at=""}else at=ae[3]?ae[3].slice(1,-1):"";je=je.trim().replace(/^<([\s\S]*)>$/,"$1");var Lt=ce(ae,{href:je&&je.replace(this.rules.inline._escapes,"$1"),title:at&&at.replace(this.rules.inline._escapes,"$1")},ae[0]);return Lt}},fe.reflink=function(re,ae){var he;if((he=this.rules.inline.reflink.exec(re))||(he=this.rules.inline.nolink.exec(re))){var ve=(he[2]||he[1]).replace(/\s+/g," ");if(ve=ae[ve.toLowerCase()],!ve||!ve.href){var _e=he[0].charAt(0);return{type:"text",raw:_e,text:_e}}var je=ce(he,ve,he[0]);return je}},fe.strong=function(re,ae,he){he===void 0&&(he="");var ve=this.rules.inline.strong.start.exec(re);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*re.length);var _e=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var je;(ve=_e.exec(ae))!=null;)if(je=this.rules.inline.strong.middle.exec(ae.slice(0,ve.index+3)),je)return{type:"strong",raw:re.slice(0,je[0].length),text:re.slice(2,je[0].length-2)}}},fe.em=function(re,ae,he){he===void 0&&(he="");var ve=this.rules.inline.em.start.exec(re);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*re.length);var _e=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var je;(ve=_e.exec(ae))!=null;)if(je=this.rules.inline.em.middle.exec(ae.slice(0,ve.index+2)),je)return{type:"em",raw:re.slice(0,je[0].length),text:re.slice(1,je[0].length-1)}}},fe.codespan=function(re){var ae=this.rules.inline.code.exec(re);if(ae){var he=ae[2].replace(/\n/g," "),ve=/[^ ]/.test(he),_e=he.startsWith(" ")&&he.endsWith(" ");return ve&&_e&&(he=he.substring(1,he.length-1)),he=ee(he,!0),{type:"codespan",raw:ae[0],text:he}}},fe.br=function(re){var ae=this.rules.inline.br.exec(re);if(ae)return{type:"br",raw:ae[0]}},fe.del=function(re){var ae=this.rules.inline.del.exec(re);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},fe.autolink=function(re,ae){var he=this.rules.inline.autolink.exec(re);if(he){var ve,_e;return he[2]==="@"?(ve=ee(this.options.mangle?ae(he[1]):he[1]),_e="mailto:"+ve):(ve=ee(he[1]),_e=ve),{type:"link",raw:he[0],text:ve,href:_e,tokens:[{type:"text",raw:ve,text:ve}]}}},fe.url=function(re,ae){var he;if(he=this.rules.inline.url.exec(re)){var ve,_e;if(he[2]==="@")ve=ee(this.options.mangle?ae(he[0]):he[0]),_e="mailto:"+ve;else{var je;do je=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(je!==he[0]);ve=ee(he[0]),he[1]==="www."?_e="http://"+ve:_e=ve}return{type:"link",raw:he[0],text:ve,href:_e,tokens:[{type:"text",raw:ve,text:ve}]}}},fe.inlineText=function(re,ae,he){var ve=this.rules.inline.text.exec(re);if(ve){var _e;return ae?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):ee(ve[0]):ve[0]:_e=ee(this.options.smartypants?he(ve[0]):ve[0]),{type:"text",raw:ve[0],text:_e}}},Te}(),Ae=L.noopTest,Pe=L.edit,Ie=L.merge,pe={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:Ae,table:Ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Pe(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Pe(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Pe(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=Pe(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Pe(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Pe(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Ie({},pe),pe.gfm=Ie({},pe.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*|$)"}),pe.gfm.nptable=Pe(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Pe(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Ie({},pe.normal,{html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Ae,paragraph:Pe(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ae,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:Ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};de._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",de.punctuation=Pe(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Pe(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Pe(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Pe(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Pe(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Pe(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Pe(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Pe(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Pe(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Pe(de._blockSkip,"g").getRegex(),de.overlapSkip=Pe(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Pe(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Pe(de.tag).replace("comment",pe._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Pe(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Pe(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Pe(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Ie({},de),de.pedantic=Ie({},de.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:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Ie({},de.normal,{escape:Pe(de.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),de.gfm.url=Pe(de.gfm.url,"i").replace("email",de.gfm._extended_email).getRegex(),de.breaks=Ie({},de.gfm,{br:Pe(de.br).replace("{2,}","*").getRegex(),text:Pe(de.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:pe,inline:de},ge=H.defaults,oe=ne.block,De=ne.inline;function Ue(Te){return Te.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 we(Te){var fe="",me,re,ae=Te.length;for(me=0;me<ae;me++)re=Te.charCodeAt(me),Math.random()>.5&&(re="x"+re.toString(16)),fe+="&#"+re+";";return fe}var Ge=function(){function Te(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||ge,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:oe.normal,inline:De.normal};this.options.pedantic?(re.block=oe.pedantic,re.inline=De.pedantic):this.options.gfm&&(re.block=oe.gfm,this.options.breaks?re.inline=De.breaks:re.inline=De.gfm),this.tokenizer.rules=re}Te.lex=function(re,ae){var he=new Te(ae);return he.lex(re)};var fe=Te.prototype;return fe.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},fe.blockTokens=function(re,ae,he){ae===void 0&&(ae=[]),he===void 0&&(he=!0),re=re.replace(/^ +$/gm,"");for(var ve,_e,je,at;re;){if(ve=this.tokenizer.space(re)){re=re.substring(ve.raw.length),ve.type&&ae.push(ve);continue}if(ve=this.tokenizer.code(re,ae)){re=re.substring(ve.raw.length),ve.type?ae.push(ve):(at=ae[ae.length-1],at.raw+=`
`+ve.raw,at.text+=`
`+ve.text);continue}if(ve=this.tokenizer.fences(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.heading(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.nptable(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.hr(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.blockquote(re)){re=re.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],he),ae.push(ve);continue}if(ve=this.tokenizer.list(re)){for(re=re.substring(ve.raw.length),je=ve.items.length,_e=0;_e<je;_e++)ve.items[_e].tokens=this.blockTokens(ve.items[_e].text,[],!1);ae.push(ve);continue}if(ve=this.tokenizer.html(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(he&&(ve=this.tokenizer.def(re))){re=re.substring(ve.raw.length),this.tokens.links[ve.tag]||(this.tokens.links[ve.tag]={href:ve.href,title:ve.title});continue}if(ve=this.tokenizer.table(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.lheading(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(he&&(ve=this.tokenizer.paragraph(re))){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.text(re,ae)){re=re.substring(ve.raw.length),ve.type?ae.push(ve):(at=ae[ae.length-1],at.raw+=`
`+ve.raw,at.text+=`
`+ve.text);continue}if(re){var Et="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return ae},fe.inline=function(re){var ae,he,ve,_e,je,at,Et=re.length;for(ae=0;ae<Et;ae++){at=re[ae];switch(at.type){case"paragraph":case"text":case"heading":{at.tokens=[],this.inlineTokens(at.text,at.tokens);break}case"table":{for(at.tokens={header:[],cells:[]},_e=at.header.length,he=0;he<_e;he++)at.tokens.header[he]=[],this.inlineTokens(at.header[he],at.tokens.header[he]);for(_e=at.cells.length,he=0;he<_e;he++)for(je=at.cells[he],at.tokens.cells[he]=[],ve=0;ve<je.length;ve++)at.tokens.cells[he][ve]=[],this.inlineTokens(je[ve],at.tokens.cells[he][ve]);break}case"blockquote":{this.inline(at.tokens);break}case"list":{for(_e=at.items.length,he=0;he<_e;he++)this.inline(at.items[he].tokens);break}}}return re},fe.inlineTokens=function(re,ae,he,ve,_e){ae===void 0&&(ae=[]),he===void 0&&(he=!1),ve===void 0&&(ve=!1),_e===void 0&&(_e="");var je,at=re,Et;if(this.tokens.links){var Lt=Object.keys(this.tokens.links);if(Lt.length>0)for(;(Et=this.tokenizer.rules.inline.reflinkSearch.exec(at))!=null;)Lt.includes(Et[0].slice(Et[0].lastIndexOf("[")+1,-1))&&(at=at.slice(0,Et.index)+"["+"a".repeat(Et[0].length-2)+"]"+at.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Et=this.tokenizer.rules.inline.blockSkip.exec(at))!=null;)at=at.slice(0,Et.index)+"["+"a".repeat(Et[0].length-2)+"]"+at.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(je=this.tokenizer.escape(re)){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.tag(re,he,ve)){re=re.substring(je.raw.length),he=je.inLink,ve=je.inRawBlock,ae.push(je);continue}if(je=this.tokenizer.link(re)){re=re.substring(je.raw.length),je.type==="link"&&(je.tokens=this.inlineTokens(je.text,[],!0,ve)),ae.push(je);continue}if(je=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(je.raw.length),je.type==="link"&&(je.tokens=this.inlineTokens(je.text,[],!0,ve)),ae.push(je);continue}if(je=this.tokenizer.strong(re,at,_e)){re=re.substring(je.raw.length),je.tokens=this.inlineTokens(je.text,[],he,ve),ae.push(je);continue}if(je=this.tokenizer.em(re,at,_e)){re=re.substring(je.raw.length),je.tokens=this.inlineTokens(je.text,[],he,ve),ae.push(je);continue}if(je=this.tokenizer.codespan(re)){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.br(re)){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.del(re)){re=re.substring(je.raw.length),je.tokens=this.inlineTokens(je.text,[],he,ve),ae.push(je);continue}if(je=this.tokenizer.autolink(re,we)){re=re.substring(je.raw.length),ae.push(je);continue}if(!he&&(je=this.tokenizer.url(re,we))){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.inlineText(re,ve,Ue)){re=re.substring(je.raw.length),_e=je.raw.slice(-1),ae.push(je);continue}if(re){var Tt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Tt);break}else throw new Error(Tt)}}return ae},z(Te,null,[{key:"rules",get:function(){return{block:oe,inline:De}}}]),Te}(),Qe=H.defaults,et=L.cleanUrl,ze=L.escape,Je=function(){function Te(me){this.options=me||Qe}var fe=Te.prototype;return fe.code=function(re,ae,he){var ve=(ae||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(re,ve);_e!=null&&_e!==re&&(he=!0,re=_e)}return ve?'<pre><code class="'+this.options.langPrefix+ze(ve,!0)+'">'+(he?re:ze(re,!0))+`</code></pre>
`:"<pre><code>"+(he?re:ze(re,!0))+`</code></pre>
`},fe.blockquote=function(re){return`<blockquote>
`+re+`</blockquote>
`},fe.html=function(re){return re},fe.heading=function(re,ae,he,ve){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+ve.slug(he)+'">'+re+"</h"+ae+`>
`:"<h"+ae+">"+re+"</h"+ae+`>
`},fe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},fe.list=function(re,ae,he){var ve=ae?"ol":"ul",_e=ae&&he!==1?' start="'+he+'"':"";return"<"+ve+_e+`>
`+re+"</"+ve+`>
`},fe.listitem=function(re){return"<li>"+re+`</li>
`},fe.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},fe.paragraph=function(re){return"<p>"+re+`</p>
`},fe.table=function(re,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
<thead>
`+re+`</thead>
`+ae+`</table>
`},fe.tablerow=function(re){return`<tr>
`+re+`</tr>
`},fe.tablecell=function(re,ae){var he=ae.header?"th":"td",ve=ae.align?"<"+he+' align="'+ae.align+'">':"<"+he+">";return ve+re+"</"+he+`>
`},fe.strong=function(re){return"<strong>"+re+"</strong>"},fe.em=function(re){return"<em>"+re+"</em>"},fe.codespan=function(re){return"<code>"+re+"</code>"},fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},fe.del=function(re){return"<del>"+re+"</del>"},fe.link=function(re,ae,he){if(re=et(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var ve='<a href="'+ze(re)+'"';return ae&&(ve+=' title="'+ae+'"'),ve+=">"+he+"</a>",ve},fe.image=function(re,ae,he){if(re=et(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var ve='<img src="'+re+'" alt="'+he+'"';return ae&&(ve+=' title="'+ae+'"'),ve+=this.options.xhtml?"/>":">",ve},fe.text=function(re){return re},Te}(),Xe=function(){function Te(){}var fe=Te.prototype;return fe.strong=function(re){return re},fe.em=function(re){return re},fe.codespan=function(re){return re},fe.del=function(re){return re},fe.html=function(re){return re},fe.text=function(re){return re},fe.link=function(re,ae,he){return""+he},fe.image=function(re,ae,he){return""+he},fe.br=function(){return""},Te}(),yt=function(){function Te(){this.seen={}}var fe=Te.prototype;return fe.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var he=ae;do this.seen[he]++,ae=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Te}(),xt=H.defaults,vt=L.unescape,ht=function(){function Te(me){this.options=me||xt,this.options.renderer=this.options.renderer||new Je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new yt}Te.parse=function(re,ae){var he=new Te(ae);return he.parse(re)};var fe=Te.prototype;return fe.parse=function(re,ae){ae===void 0&&(ae=!0);var he="",ve,_e,je,at,Et,Lt,Tt,mt,Ze,$e,He,le,be,rt,Ye,bt,pt,Ee,Be=re.length;for(ve=0;ve<Be;ve++){$e=re[ve];switch($e.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,vt(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(mt="",Tt="",at=$e.header.length,_e=0;_e<at;_e++)Tt+=this.renderer.tablecell(this.parseInline($e.tokens.header[_e]),{header:!0,align:$e.align[_e]});for(mt+=this.renderer.tablerow(Tt),Ze="",at=$e.cells.length,_e=0;_e<at;_e++){for(Lt=$e.tokens.cells[_e],Tt="",Et=Lt.length,je=0;je<Et;je++)Tt+=this.renderer.tablecell(this.parseInline(Lt[je]),{header:!1,align:$e.align[je]});Ze+=this.renderer.tablerow(Tt)}he+=this.renderer.table(mt,Ze);continue}case"blockquote":{Ze=this.parse($e.tokens),he+=this.renderer.blockquote(Ze);continue}case"list":{for(He=$e.ordered,le=$e.start,be=$e.loose,at=$e.items.length,Ze="",_e=0;_e<at;_e++)Ye=$e.items[_e],bt=Ye.checked,pt=Ye.task,rt="",Ye.task&&(Ee=this.renderer.checkbox(bt),be?Ye.tokens.length>0&&Ye.tokens[0].type==="text"?(Ye.tokens[0].text=Ee+" "+Ye.tokens[0].text,Ye.tokens[0].tokens&&Ye.tokens[0].tokens.length>0&&Ye.tokens[0].tokens[0].type==="text"&&(Ye.tokens[0].tokens[0].text=Ee+" "+Ye.tokens[0].tokens[0].text)):Ye.tokens.unshift({type:"text",text:Ee}):rt+=Ee),rt+=this.parse(Ye.tokens,be),Ze+=this.renderer.listitem(rt,pt,bt);he+=this.renderer.list(Ze,He,le);continue}case"html":{he+=this.renderer.html($e.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(Ze=$e.tokens?this.parseInline($e.tokens):$e.text;ve+1<Be&&re[ve+1].type==="text";)$e=re[++ve],Ze+=`
`+($e.tokens?this.parseInline($e.tokens):$e.text);he+=ae?this.renderer.paragraph(Ze):Ze;continue}default:{var st='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(st);return}else throw new Error(st)}}}return he},fe.parseInline=function(re,ae){ae=ae||this.renderer;var he="",ve,_e,je=re.length;for(ve=0;ve<je;ve++){_e=re[ve];switch(_e.type){case"escape":{he+=ae.text(_e.text);break}case"html":{he+=ae.html(_e.text);break}case"link":{he+=ae.link(_e.href,_e.title,this.parseInline(_e.tokens,ae));break}case"image":{he+=ae.image(_e.href,_e.title,_e.text);break}case"strong":{he+=ae.strong(this.parseInline(_e.tokens,ae));break}case"em":{he+=ae.em(this.parseInline(_e.tokens,ae));break}case"codespan":{he+=ae.codespan(_e.text);break}case"br":{he+=ae.br();break}case"del":{he+=ae.del(this.parseInline(_e.tokens,ae));break}case"text":{he+=ae.text(_e.text);break}default:{var at='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(at);return}else throw new Error(at)}}}return he},Te}(),Rt=L.merge,At=L.checkSanitizeDeprecation,ke=L.escape,Oe=H.getDefaults,tt=H.changeDefaults,it=H.defaults;function Ne(Te,fe,me){if(typeof Te=="undefined"||Te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Te)+", string expected");if(typeof fe=="function"&&(me=fe,fe=null),fe=Rt({},Ne.defaults,fe||{}),At(fe),me){var re=fe.highlight,ae;try{ae=Ge.lex(Te,fe)}catch(je){return me(je)}var he=function(at){var Et;if(!at)try{Et=ht.parse(ae,fe)}catch(Lt){at=Lt}return fe.highlight=re,at?me(at):me(null,Et)};if(!re||re.length<3)return he();if(delete fe.highlight,!ae.length)return he();var ve=0;Ne.walkTokens(ae,function(je){je.type==="code"&&(ve++,setTimeout(function(){re(je.text,je.lang,function(at,Et){if(at)return he(at);Et!=null&&Et!==je.text&&(je.text=Et,je.escaped=!0),ve--,ve===0&&he()})},0))}),ve===0&&he();return}try{var _e=Ge.lex(Te,fe);return fe.walkTokens&&Ne.walkTokens(_e,fe.walkTokens),ht.parse(_e,fe)}catch(je){if(je.message+=`
Please report this to https://github.com/markedjs/marked.`,fe.silent)return"<p>An error occurred:</p><pre>"+ke(je.message+"",!0)+"</pre>";throw je}}Ne.options=Ne.setOptions=function(Te){return Rt(Ne.defaults,Te),tt(Ne.defaults),Ne},Ne.getDefaults=Oe,Ne.defaults=it,Ne.use=function(Te){var fe=Rt({},Te);if(Te.renderer&&function(){var re=Ne.defaults.renderer||new Je,ae=function(_e){var je=re[_e];re[_e]=function(){for(var at=arguments.length,Et=new Array(at),Lt=0;Lt<at;Lt++)Et[Lt]=arguments[Lt];var Tt=Te.renderer[_e].apply(re,Et);return Tt===!1&&(Tt=je.apply(re,Et)),Tt}};for(var he in Te.renderer)ae(he);fe.renderer=re}(),Te.tokenizer&&function(){var re=Ne.defaults.tokenizer||new Ce,ae=function(_e){var je=re[_e];re[_e]=function(){for(var at=arguments.length,Et=new Array(at),Lt=0;Lt<at;Lt++)Et[Lt]=arguments[Lt];var Tt=Te.tokenizer[_e].apply(re,Et);return Tt===!1&&(Tt=je.apply(re,Et)),Tt}};for(var he in Te.tokenizer)ae(he);fe.tokenizer=re}(),Te.walkTokens){var me=Ne.defaults.walkTokens;fe.walkTokens=function(re){Te.walkTokens(re),me&&me(re)}}Ne.setOptions(fe)},Ne.walkTokens=function(Te,fe){for(var me=W(Te),re;!(re=me()).done;){var ae=re.value;fe(ae);switch(ae.type){case"table":{for(var he=W(ae.tokens.header),ve;!(ve=he()).done;){var _e=ve.value;Ne.walkTokens(_e,fe)}for(var je=W(ae.tokens.cells),at;!(at=je()).done;)for(var Et=at.value,Lt=W(Et),Tt;!(Tt=Lt()).done;){var mt=Tt.value;Ne.walkTokens(mt,fe)}break}case"list":{Ne.walkTokens(ae.items,fe);break}default:ae.tokens&&Ne.walkTokens(ae.tokens,fe)}}},Ne.Parser=ht,Ne.parser=ht.parse,Ne.Renderer=Je,Ne.TextRenderer=Xe,Ne.Lexer=Ge,Ne.lexer=Ge.lex,Ne.Tokenizer=Ce,Ne.Slugger=yt,Ne.parse=Ne;var qe=Ne;return qe})},E7E6:function(Ke,Me){Ke.exports="data:image/png;base64,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"},ELLl:function(Ke,Me,K){(function(q){q(K("VrN/"))})(function(q){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=q.Pos;q.defineOption("autoCloseBrackets",!1,function(r,s,o){o&&o!=q.Init&&(r.removeKeyMap(W),r.state.closeBrackets=null),s&&(D(V(s,"pairs")),r.state.closeBrackets=s,r.addKeyMap(W))});function V(r,s){return s=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[s]!=null?r[s]:z[s]}var W={Backspace:k,Enter:T};function D(r){for(var s=0;s<r.length;s++){var o=r.charAt(s),a="'"+o+"'";W[a]||(W[a]=H(o))}}D(z.pairs+"`");function H(r){return function(s){return m(s,r)}}function F(r){var s=r.state.closeBrackets;if(!s||s.override)return s;var o=r.getModeAt(r.getCursor());return o.closeBrackets||s}function k(r){var s=F(r);if(!s||r.getOption("disableInput"))return q.Pass;for(var o=V(s,"pairs"),a=r.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return q.Pass;var h=c(r,a[l].head);if(!h||o.indexOf(h)%2!=0)return q.Pass}for(var l=a.length-1;l>=0;l--){var I=a[l].head;r.replaceRange("",N(I.line,I.ch-1),N(I.line,I.ch+1),"+delete")}}function T(r){var s=F(r),o=s&&V(s,"explode");if(!o||r.getOption("disableInput"))return q.Pass;for(var a=r.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return q.Pass;var h=c(r,a[l].head);if(!h||o.indexOf(h)%2!=0)return q.Pass}r.operation(function(){var I=r.lineSeparator()||`
`;r.replaceSelection(I+I,null),r.execCommand("goCharLeft"),a=r.listSelections();for(var w=0;w<a.length;w++){var x=a[w].head.line;r.indentLine(x,null,!0),r.indentLine(x+1,null,!0)}})}function v(r){var s=q.cmpPos(r.anchor,r.head)>0;return{anchor:new N(r.anchor.line,r.anchor.ch+(s?-1:1)),head:new N(r.head.line,r.head.ch+(s?1:-1))}}function m(r,s){var o=F(r);if(!o||r.getOption("disableInput"))return q.Pass;var a=V(o,"pairs"),l=a.indexOf(s);if(l==-1)return q.Pass;for(var h=V(o,"closeBefore"),I=V(o,"triples"),w=a.charAt(l+1)==s,x=r.listSelections(),O=l%2==0,S,_=0;_<x.length;_++){var g=x[_],f=g.head,u,E=r.getRange(f,N(f.line,f.ch+1));if(O&&!g.empty())u="surround";else if((w||!O)&&E==s)w&&d(r,f)?u="both":I.indexOf(s)>=0&&r.getRange(f,N(f.line,f.ch+3))==s+s+s?u="skipThree":u="skip";else if(w&&f.ch>1&&I.indexOf(s)>=0&&r.getRange(N(f.line,f.ch-2),f)==s+s){if(f.ch>2&&/\bstring/.test(r.getTokenTypeAt(N(f.line,f.ch-2))))return q.Pass;u="addFour"}else if(w){var b=f.ch==0?" ":r.getRange(N(f.line,f.ch-1),f);if(!q.isWordChar(E)&&b!=s&&!q.isWordChar(b))u="both";else return q.Pass}else if(O&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))u="both";else return q.Pass;if(!S)S=u;else if(S!=u)return q.Pass}var y=l%2?a.charAt(l-1):s,P=l%2?s:a.charAt(l+1);r.operation(function(){if(S=="skip")r.execCommand("goCharRight");else if(S=="skipThree")for(var R=0;R<3;R++)r.execCommand("goCharRight");else if(S=="surround"){for(var U=r.getSelections(),R=0;R<U.length;R++)U[R]=y+U[R]+P;r.replaceSelections(U,"around"),U=r.listSelections().slice();for(var R=0;R<U.length;R++)U[R]=v(U[R]);r.setSelections(U)}else S=="both"?(r.replaceSelection(y+P,null),r.triggerElectric(y+P),r.execCommand("goCharLeft")):S=="addFour"&&(r.replaceSelection(y+y+y+y,"before"),r.execCommand("goCharRight"))})}function c(r,s){var o=r.getRange(N(s.line,s.ch-1),N(s.line,s.ch+1));return o.length==2?o:null}function d(r,s){var o=r.getTokenAt(N(s.line,s.ch+1));return/\bstring/.test(o.type)&&o.start==s.ch&&(s.ch==0||!/\bstring/.test(r.getTokenTypeAt(s)))}})},FOrL:function(Ke,Me,K){Ke.exports=K.p+"static/nodata.a6b3f948.png"},FPkq:function(Ke,Me,K){Ke.exports=K.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Ke,Me){Ke.exports="data:image/png;base64,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"},Gytx:function(Ke,Me){Ke.exports=function(q,z,N,V){var W=N?N.call(V,q,z):void 0;if(W!==void 0)return!!W;if(q===z)return!0;if(typeof q!="object"||!q||typeof z!="object"||!z)return!1;var D=Object.keys(q),H=Object.keys(z);if(D.length!==H.length)return!1;for(var F=Object.prototype.hasOwnProperty.bind(z),k=0;k<D.length;k++){var T=D[k];if(!F(T))return!1;var v=q[T],m=z[T];if(W=N?N.call(V,v,m,T):void 0,W===!1||W===void 0&&v!==m)return!1}return!0}},H38U:function(Ke,Me,K){var q=K("f4xo"),z=K("rcnY"),N=K("wU8J"),V=K("Iq15"),W=K("dWSS");function D(F,k){this.typeNumber=F,this.errorCorrectLevel=k,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var H=D.prototype;H.addData=function(F){var k=new q(F);this.dataList.push(k),this.dataCache=null},H.isDark=function(F,k){if(F<0||this.moduleCount<=F||k<0||this.moduleCount<=k)throw new Error(F+","+k);return this.modules[F][k]},H.getModuleCount=function(){return this.moduleCount},H.make=function(){if(this.typeNumber<1){var F=1;for(F=1;F<40;F++){for(var k=z.getRSBlocks(F,this.errorCorrectLevel),T=new N,v=0,m=0;m<k.length;m++)v+=k[m].dataCount;for(var m=0;m<this.dataList.length;m++){var c=this.dataList[m];T.put(c.mode,4),T.put(c.getLength(),V.getLengthInBits(c.mode,F)),c.write(T)}if(T.getLengthInBits()<=v*8)break}this.typeNumber=F}this.makeImpl(!1,this.getBestMaskPattern())},H.makeImpl=function(F,k){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var T=0;T<this.moduleCount;T++){this.modules[T]=new Array(this.moduleCount);for(var v=0;v<this.moduleCount;v++)this.modules[T][v]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(F,k),this.typeNumber>=7&&this.setupTypeNumber(F),this.dataCache==null&&(this.dataCache=D.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,k)},H.setupPositionProbePattern=function(F,k){for(var T=-1;T<=7;T++){if(F+T<=-1||this.moduleCount<=F+T)continue;for(var v=-1;v<=7;v++){if(k+v<=-1||this.moduleCount<=k+v)continue;0<=T&&T<=6&&(v==0||v==6)||0<=v&&v<=6&&(T==0||T==6)||2<=T&&T<=4&&2<=v&&v<=4?this.modules[F+T][k+v]=!0:this.modules[F+T][k+v]=!1}}},H.getBestMaskPattern=function(){for(var F=0,k=0,T=0;T<8;T++){this.makeImpl(!0,T);var v=V.getLostPoint(this);(T==0||F>v)&&(F=v,k=T)}return k},H.createMovieClip=function(F,k,T){var v=F.createEmptyMovieClip(k,T),m=1;this.make();for(var c=0;c<this.modules.length;c++)for(var d=c*m,r=0;r<this.modules[c].length;r++){var s=r*m,o=this.modules[c][r];o&&(v.beginFill(0,100),v.moveTo(s,d),v.lineTo(s+m,d),v.lineTo(s+m,d+m),v.lineTo(s,d+m),v.endFill())}return v},H.setupTimingPattern=function(){for(var F=8;F<this.moduleCount-8;F++){if(this.modules[F][6]!=null)continue;this.modules[F][6]=F%2==0}for(var k=8;k<this.moduleCount-8;k++){if(this.modules[6][k]!=null)continue;this.modules[6][k]=k%2==0}},H.setupPositionAdjustPattern=function(){for(var F=V.getPatternPosition(this.typeNumber),k=0;k<F.length;k++)for(var T=0;T<F.length;T++){var v=F[k],m=F[T];if(this.modules[v][m]!=null)continue;for(var c=-2;c<=2;c++)for(var d=-2;d<=2;d++)c==-2||c==2||d==-2||d==2||c==0&&d==0?this.modules[v+c][m+d]=!0:this.modules[v+c][m+d]=!1}},H.setupTypeNumber=function(F){for(var k=V.getBCHTypeNumber(this.typeNumber),T=0;T<18;T++){var v=!F&&(k>>T&1)==1;this.modules[Math.floor(T/3)][T%3+this.moduleCount-8-3]=v}for(var T=0;T<18;T++){var v=!F&&(k>>T&1)==1;this.modules[T%3+this.moduleCount-8-3][Math.floor(T/3)]=v}},H.setupTypeInfo=function(F,k){for(var T=this.errorCorrectLevel<<3|k,v=V.getBCHTypeInfo(T),m=0;m<15;m++){var c=!F&&(v>>m&1)==1;m<6?this.modules[m][8]=c:m<8?this.modules[m+1][8]=c:this.modules[this.moduleCount-15+m][8]=c}for(var m=0;m<15;m++){var c=!F&&(v>>m&1)==1;m<8?this.modules[8][this.moduleCount-m-1]=c:m<9?this.modules[8][15-m-1+1]=c:this.modules[8][15-m-1]=c}this.modules[this.moduleCount-8][8]=!F},H.mapData=function(F,k){for(var T=-1,v=this.moduleCount-1,m=7,c=0,d=this.moduleCount-1;d>0;d-=2)for(d==6&&d--;;){for(var r=0;r<2;r++)if(this.modules[v][d-r]==null){var s=!1;c<F.length&&(s=(F[c]>>>m&1)==1);var o=V.getMask(k,v,d-r);o&&(s=!s),this.modules[v][d-r]=s,m--,m==-1&&(c++,m=7)}if(v+=T,v<0||this.moduleCount<=v){v-=T,T=-T;break}}},D.PAD0=236,D.PAD1=17,D.createData=function(F,k,T){for(var v=z.getRSBlocks(F,k),m=new N,c=0;c<T.length;c++){var d=T[c];m.put(d.mode,4),m.put(d.getLength(),V.getLengthInBits(d.mode,F)),d.write(m)}for(var r=0,c=0;c<v.length;c++)r+=v[c].dataCount;if(m.getLengthInBits()>r*8)throw new Error("code length overflow. ("+m.getLengthInBits()+">"+r*8+")");for(m.getLengthInBits()+4<=r*8&&m.put(0,4);m.getLengthInBits()%8!=0;)m.putBit(!1);for(;!(m.getLengthInBits()>=r*8);){if(m.put(D.PAD0,8),m.getLengthInBits()>=r*8)break;m.put(D.PAD1,8)}return D.createBytes(m,v)},D.createBytes=function(F,k){for(var T=0,v=0,m=0,c=new Array(k.length),d=new Array(k.length),r=0;r<k.length;r++){var s=k[r].dataCount,o=k[r].totalCount-s;v=Math.max(v,s),m=Math.max(m,o),c[r]=new Array(s);for(var a=0;a<c[r].length;a++)c[r][a]=255&F.buffer[a+T];T+=s;var l=V.getErrorCorrectPolynomial(o),h=new W(c[r],l.getLength()-1),I=h.mod(l);d[r]=new Array(l.getLength()-1);for(var a=0;a<d[r].length;a++){var w=a+I.getLength()-d[r].length;d[r][a]=w>=0?I.get(w):0}}for(var x=0,a=0;a<k.length;a++)x+=k[a].totalCount;for(var O=new Array(x),S=0,a=0;a<v;a++)for(var r=0;r<k.length;r++)a<c[r].length&&(O[S++]=c[r][a]);for(var a=0;a<m;a++)for(var r=0;r<k.length;r++)a<d[r].length&&(O[S++]=d[r][a]);return O},Ke.exports=D},HmJG:function(Ke,Me,K){},HpTS:function(Ke,Me,K){Ke.exports=K.p+"static/small_program.f74069ec.png"},I8Z2:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return V}),K.d(Me,"b",function(){return c}),K.d(Me,"c",function(){return r});var q=K("q1tI"),z=function(){var s=function(o,a){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var I in h)h.hasOwnProperty(I)&&(l[I]=h[I])},s(o,a)};return function(o,a){s(o,a);function l(){this.constructor=o}o.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),N=q.createContext(null),V=function(s){z(o,s);function o(){return s!==null&&s.apply(this,arguments)||this}return o.prototype.render=function(){return q.createElement(N.Provider,{value:this.props.store},this.props.children)},o}(q.Component),W=K("Gytx"),D=K.n(W),H=K("2mql"),F=K.n(H),k=function(){var s=function(o,a){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,h){l.__proto__=h}||function(l,h){for(var I in h)h.hasOwnProperty(I)&&(l[I]=h[I])},s(o,a)};return function(o,a){s(o,a);function l(){this.constructor=o}o.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),T=function(){return T=Object.assign||function(s){for(var o,a=1,l=arguments.length;a<l;a++){o=arguments[a];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(s[h]=o[h])}return s},T.apply(this,arguments)};function v(s){return s.displayName||s.name||"Component"}var m=function(){return{}};function c(s,o){o===void 0&&(o={});var a=!!s,l=s||m;return function(I){var w=function(O){k(S,O);function S(_,g){var f=O.call(this,_,g)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var u=l(f.store.getState(),f.props);f.setState({subscribed:u})},f.store=f.context,f.state={subscribed:l(f.store.getState(),_),store:f.store,props:_},f}return S.getDerivedStateFromProps=function(_,g){return s&&s.length===2&&_!==g.props?{subscribed:l(g.store.getState(),_),props:_}:{props:_}},S.prototype.componentDidMount=function(){this.trySubscribe()},S.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},S.prototype.shouldComponentUpdate=function(_,g){return!D()(this.props,_)||!D()(this.state.subscribed,g.subscribed)},S.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},S.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},S.prototype.render=function(){var _=T(T(T({},this.props),this.state.subscribed),{store:this.store});return q.createElement(I,T({},_,{ref:this.props.miniStoreForwardedRef}))},S.displayName="Connect("+v(I)+")",S.contextType=N,S}(q.Component);if(o.forwardRef){var x=q.forwardRef(function(O,S){return q.createElement(w,T({},O,{miniStoreForwardedRef:S}))});return F()(x,I)}return F()(w,I)}}var d=function(){return d=Object.assign||function(s){for(var o,a=1,l=arguments.length;a<l;a++){o=arguments[a];for(var h in o)Object.prototype.hasOwnProperty.call(o,h)&&(s[h]=o[h])}return s},d.apply(this,arguments)};function r(s){var o=s,a=[];function l(w){o=d(d({},o),w);for(var x=0;x<a.length;x++)a[x]()}function h(){return o}function I(w){return a.push(w),function(){var O=a.indexOf(w);a.splice(O,1)}}return{setState:l,getState:h,subscribe:I}}},IBYe:function(Ke,Me,K){"use strict";function q(z){return null}Me.a=q},Iq15:function(Ke,Me,K){var q=K("nVVt"),z=K("dWSS"),N=K("dQei"),V={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},W={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(D){for(var H=D<<10;W.getBCHDigit(H)-W.getBCHDigit(W.G15)>=0;)H^=W.G15<<W.getBCHDigit(H)-W.getBCHDigit(W.G15);return(D<<10|H)^W.G15_MASK},getBCHTypeNumber:function(D){for(var H=D<<12;W.getBCHDigit(H)-W.getBCHDigit(W.G18)>=0;)H^=W.G18<<W.getBCHDigit(H)-W.getBCHDigit(W.G18);return D<<12|H},getBCHDigit:function(D){for(var H=0;D!=0;)H++,D>>>=1;return H},getPatternPosition:function(D){return W.PATTERN_POSITION_TABLE[D-1]},getMask:function(D,H,F){switch(D){case V.PATTERN000:return(H+F)%2==0;case V.PATTERN001:return H%2==0;case V.PATTERN010:return F%3==0;case V.PATTERN011:return(H+F)%3==0;case V.PATTERN100:return(Math.floor(H/2)+Math.floor(F/3))%2==0;case V.PATTERN101:return H*F%2+H*F%3==0;case V.PATTERN110:return(H*F%2+H*F%3)%2==0;case V.PATTERN111:return(H*F%3+(H+F)%2)%2==0;default:throw new Error("bad maskPattern:"+D)}},getErrorCorrectPolynomial:function(D){for(var H=new z([1],0),F=0;F<D;F++)H=H.multiply(new z([1,N.gexp(F)],0));return H},getLengthInBits:function(D,H){if(1<=H&&H<10)switch(D){case q.MODE_NUMBER:return 10;case q.MODE_ALPHA_NUM:return 9;case q.MODE_8BIT_BYTE:return 8;case q.MODE_KANJI:return 8;default:throw new Error("mode:"+D)}else if(H<27)switch(D){case q.MODE_NUMBER:return 12;case q.MODE_ALPHA_NUM:return 11;case q.MODE_8BIT_BYTE:return 16;case q.MODE_KANJI:return 10;default:throw new Error("mode:"+D)}else if(H<41)switch(D){case q.MODE_NUMBER:return 14;case q.MODE_ALPHA_NUM:return 13;case q.MODE_8BIT_BYTE:return 16;case q.MODE_KANJI:return 12;default:throw new Error("mode:"+D)}else throw new Error("type:"+H)},getLostPoint:function(D){for(var H=D.getModuleCount(),F=0,k=0;k<H;k++)for(var T=0;T<H;T++){for(var v=0,m=D.isDark(k,T),c=-1;c<=1;c++){if(k+c<0||H<=k+c)continue;for(var d=-1;d<=1;d++){if(T+d<0||H<=T+d)continue;if(c==0&&d==0)continue;m==D.isDark(k+c,T+d)&&v++}}v>5&&(F+=3+v-5)}for(var k=0;k<H-1;k++)for(var T=0;T<H-1;T++){var r=0;D.isDark(k,T)&&r++,D.isDark(k+1,T)&&r++,D.isDark(k,T+1)&&r++,D.isDark(k+1,T+1)&&r++,(r==0||r==4)&&(F+=3)}for(var k=0;k<H;k++)for(var T=0;T<H-6;T++)D.isDark(k,T)&&!D.isDark(k,T+1)&&D.isDark(k,T+2)&&D.isDark(k,T+3)&&D.isDark(k,T+4)&&!D.isDark(k,T+5)&&D.isDark(k,T+6)&&(F+=40);for(var T=0;T<H;T++)for(var k=0;k<H-6;k++)D.isDark(k,T)&&!D.isDark(k+1,T)&&D.isDark(k+2,T)&&D.isDark(k+3,T)&&D.isDark(k+4,T)&&!D.isDark(k+5,T)&&D.isDark(k+6,T)&&(F+=40);for(var s=0,T=0;T<H;T++)for(var k=0;k<H;k++)D.isDark(k,T)&&s++;var o=Math.abs(100*s/H/H-50)/5;return F+=o*10,F}};Ke.exports=W},J66h:function(Ke,Me,K){(function(q){var z,N;(function(V,W){Ke.exports=W(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof q!="undefined"?q:this,function(V){"use strict";V=V||{};var W=V.Base64,D="2.6.4",H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",F=function(y){for(var P={},R=0,U=y.length;R<U;R++)P[y.charAt(R)]=R;return P}(H),k=String.fromCharCode,T=function(y){if(y.length<2){var P=y.charCodeAt(0);return P<128?y:P<2048?k(192|P>>>6)+k(128|P&63):k(224|P>>>12&15)+k(128|P>>>6&63)+k(128|P&63)}else{var P=65536+(y.charCodeAt(0)-55296)*1024+(y.charCodeAt(1)-56320);return k(240|P>>>18&7)+k(128|P>>>12&63)+k(128|P>>>6&63)+k(128|P&63)}},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(y){return y.replace(v,T)},c=function(y){var P=[0,2,1][y.length%3],R=y.charCodeAt(0)<<16|(y.length>1?y.charCodeAt(1):0)<<8|(y.length>2?y.charCodeAt(2):0),U=[H.charAt(R>>>18),H.charAt(R>>>12&63),P>=2?"=":H.charAt(R>>>6&63),P>=1?"=":H.charAt(R&63)];return U.join("")},d=V.btoa&&typeof V.btoa=="function"?function(y){return V.btoa(y)}:function(y){if(y.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return y.replace(/[\s\S]{1,3}/g,c)},r=function(y){return d(m(String(y)))},s=function(y){return y.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},o=function(y,P){return P?s(r(y)):r(y)},a=function(y){return o(y,!0)},l;V.Uint8Array&&(l=function(y,P){for(var R="",U=0,L=y.length;U<L;U+=3){var j=y[U],A=y[U+1],X=y[U+2],ee=j<<16|A<<8|X;R+=H.charAt(ee>>>18)+H.charAt(ee>>>12&63)+(typeof A!="undefined"?H.charAt(ee>>>6&63):"=")+(typeof X!="undefined"?H.charAt(ee&63):"=")}return P?s(R):R});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,I=function(y){switch(y.length){case 4:var P=(7&y.charCodeAt(0))<<18|(63&y.charCodeAt(1))<<12|(63&y.charCodeAt(2))<<6|63&y.charCodeAt(3),R=P-65536;return k((R>>>10)+55296)+k((R&1023)+56320);case 3:return k((15&y.charCodeAt(0))<<12|(63&y.charCodeAt(1))<<6|63&y.charCodeAt(2));default:return k((31&y.charCodeAt(0))<<6|63&y.charCodeAt(1))}},w=function(y){return y.replace(h,I)},x=function(y){var P=y.length,R=P%4,U=(P>0?F[y.charAt(0)]<<18:0)|(P>1?F[y.charAt(1)]<<12:0)|(P>2?F[y.charAt(2)]<<6:0)|(P>3?F[y.charAt(3)]:0),L=[k(U>>>16),k(U>>>8&255),k(U&255)];return L.length-=[0,0,2,1][R],L.join("")},O=V.atob&&typeof V.atob=="function"?function(y){return V.atob(y)}:function(y){return y.replace(/\S{1,4}/g,x)},S=function(y){return O(String(y).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(y){return w(O(y))},g=function(y){return String(y).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(y){return _(g(y))},u;V.Uint8Array&&(u=function(y){return Uint8Array.from(S(g(y)),function(P){return P.charCodeAt(0)})});var E=function(){var y=V.Base64;return V.Base64=W,y};if(V.Base64={VERSION:D,atob:S,btoa:d,fromBase64:f,toBase64:o,utob:m,encode:o,encodeURI:a,btou:w,decode:f,noConflict:E,fromUint8Array:l,toUint8Array:u},typeof Object.defineProperty=="function"){var b=function(y){return{value:y,enumerable:!1,writable:!0,configurable:!0}};V.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",b(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",b(function(y){return o(this,y)})),Object.defineProperty(String.prototype,"toBase64URI",b(function(){return o(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),Ke.exports?Ke.exports.Base64=V.Base64:!(z=[],N=function(){return V.Base64}.apply(Me,z),N!==void 0&&(Ke.exports=N)),{Base64:V.Base64}})}).call(this,K("IyRk"))},JWDV:function(Ke,Me,K){Ke.exports=K.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Ke,Me){Ke.exports="data:image/png;base64,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"},Jq4h:function(Ke,Me,K){Ke.exports=K.p+"static/qrcode.2267e4d5.png"},LdHM:function(Ke,Me,K){"use strict";K.d(Me,"b",function(){return h}),K.d(Me,"a",function(){return w});var q=K("1OyB"),z=K("vuIU"),N=K("Ji7U"),V=K("LK+K"),W=K("q1tI"),D=K("rePB"),H=K("Ff2n"),F=K("ODXe"),k=K("4IlW"),T=K("bX4T"),v=K("YrtM"),m=K("TSYQ"),c=K.n(m),d=K("+nKL"),r=K("8OUc"),s=function(X,ee){var se=X.prefixCls,ce=X.id,Le=X.flattenOptions,Ce=X.childrenAsData,Ae=X.values,Pe=X.searchValue,Ie=X.multiple,pe=X.defaultActiveFirstOption,de=X.height,ne=X.itemHeight,ge=X.notFoundContent,oe=X.open,De=X.menuItemSelectedIcon,Ue=X.virtual,we=X.onSelect,Ge=X.onToggleOpen,Qe=X.onActiveValue,et=X.onScroll,ze=X.onMouseEnter,Je="".concat(se,"-item"),Xe=Object(v.a)(function(){return Le},[oe,Le],function(qe,Te){return Te[0]&&qe[1]!==Te[1]}),yt=W.useRef(null),xt=function(Te){Te.preventDefault()},vt=function(Te){yt.current&&yt.current.scrollTo({index:Te})},ht=function(Te){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,me=Xe.length,re=0;re<me;re+=1){var ae=(Te+re*fe+me)%me,he=Xe[ae],ve=he.group,_e=he.data;if(!ve&&!_e.disabled)return ae}return-1},Rt=W.useState(function(){return ht(0)}),At=Object(F.a)(Rt,2),ke=At[0],Oe=At[1],tt=function(Te){Oe(Te);var fe=Xe[Te];if(!fe){Qe(null,-1);return}Qe(fe.data.value,Te)};W.useEffect(function(){tt(pe!==!1?ht(0):-1)},[Xe.length,Pe]),W.useEffect(function(){var qe=setTimeout(function(){if(!Ie&&oe&&Ae.size===1){var Te=Array.from(Ae)[0],fe=Xe.findIndex(function(me){var re=me.data;return re.value===Te});tt(fe),vt(fe)}});return function(){return clearTimeout(qe)}},[oe]);var it=function(Te){Te!==void 0&&we(Te,{selected:!Ae.has(Te)}),Ie||Ge(!1)};if(W.useImperativeHandle(ee,function(){return{onKeyDown:function(Te){var fe=Te.which;switch(fe){case k.a.UP:case k.a.DOWN:{var me=0;if(fe===k.a.UP?me=-1:fe===k.a.DOWN&&(me=1),me!==0){var re=ht(ke+me,me);vt(re),tt(re)}break}case k.a.ENTER:{var ae=Xe[ke];ae&&!ae.data.disabled?it(ae.data.value):it(void 0),oe&&Te.preventDefault();break}case k.a.ESC:Ge(!1)}},onKeyUp:function(){},scrollTo:function(Te){vt(Te)}}}),Xe.length===0)return W.createElement("div",{role:"listbox",id:"".concat(ce,"_list"),className:"".concat(Je,"-empty"),onMouseDown:xt},ge);function Ne(qe){var Te=Xe[qe];if(!Te)return null;var fe=Te.data||{},me=fe.value,re=fe.label,ae=fe.children,he=Object(T.a)(fe,!0),ve=Ce?ae:re;return Te?W.createElement("div",Object.assign({"aria-label":typeof ve=="string"?ve:null},he,{key:qe,role:"option",id:"".concat(ce,"_list_").concat(qe),"aria-selected":Ae.has(me)}),me):null}return W.createElement(W.Fragment,null,W.createElement("div",{role:"listbox",id:"".concat(ce,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(ke-1),Ne(ke),Ne(ke+1)),W.createElement(d.a,{itemKey:"key",ref:yt,data:Xe,height:de,itemHeight:ne,fullHeight:!1,onMouseDown:xt,onScroll:et,virtual:Ue,onMouseEnter:ze},function(qe,Te){var fe,me=qe.group,re=qe.groupOption,ae=qe.data,he=ae.label,ve=ae.key;if(me)return W.createElement("div",{className:c()(Je,"".concat(Je,"-group"))},he!==void 0?he:ve);var _e=ae.disabled,je=ae.value,at=ae.title,Et=ae.children,Lt=ae.style,Tt=ae.className,mt=Object(H.a)(ae,["disabled","value","title","children","style","className"]),Ze=Ae.has(je),$e="".concat(Je,"-option"),He=c()(Je,$e,Tt,(fe={},Object(D.a)(fe,"".concat($e,"-grouped"),re),Object(D.a)(fe,"".concat($e,"-active"),ke===Te&&!_e),Object(D.a)(fe,"".concat($e,"-disabled"),_e),Object(D.a)(fe,"".concat($e,"-selected"),Ze),fe)),le=Ce?Et:he,be=!De||typeof De=="function"||Ze;return W.createElement("div",Object.assign({},mt,{"aria-selected":Ze,className:He,title:at,onMouseMove:function(){if(ke===Te||_e)return;tt(Te)},onClick:function(){_e||it(je)},style:Lt}),W.createElement("div",{className:"".concat($e,"-content")},le||je),W.isValidElement(De)||Ze,be&&W.createElement(r.a,{className:"".concat(Je,"-option-state"),customizeIcon:De,customizeIconProps:{isSelected:Ze}},Ze?"\u2713":null))}))},o=W.forwardRef(s);o.displayName="OptionList";var a=o,l=function(){return null};l.isSelectOption=!0;var h=l,I=function(){return null};I.isSelectOptGroup=!0;var w=I,x=K("VTBJ"),O=K("Zm9Q");function S(A){var X=A.key,ee=A.props,se=ee.children,ce=ee.value,Le=Object(H.a)(ee,["children","value"]);return Object(x.a)({key:X,value:ce!==void 0?ce:X,children:se},Le)}function _(A){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(A).map(function(ee,se){if(!W.isValidElement(ee)||!ee.type)return null;var ce=ee.type.isSelectOptGroup,Le=ee.key,Ce=ee.props,Ae=Ce.children,Pe=Object(H.a)(Ce,["children"]);return X||!ce?S(ee):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Le===null?se:Le,"__"),label:Le},Pe),{},{options:_(Ae)})}).filter(function(ee){return ee})}var g=K("2Qr1"),f=K("qNPg"),u=K("U8pU"),E=K("Kwbf"),b=K("WKfj");function y(A){var X=A.mode,ee=A.options,se=A.children,ce=A.backfill,Le=A.allowClear,Ce=A.placeholder,Ae=A.getInputElement,Pe=A.showSearch,Ie=A.onSearch,pe=A.defaultOpen,de=A.autoFocus,ne=A.labelInValue,ge=A.value,oe=A.inputValue,De=A.optionLabelProp,Ue=X==="multiple"||X==="tags",we=Pe!==void 0?Pe:Ue||X==="combobox",Ge=ee||_(se);if(Object(E.a)(X!=="tags"||Ge.every(function(Je){return!Je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var Qe=Ge.some(function(Je){return Je.options?Je.options.some(function(Xe){return typeof("value"in Xe?Xe.value:Xe.key)=="number"}):typeof("value"in Je?Je.value:Je.key)=="number"});Object(E.a)(!Qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(X!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(X==="combobox"||!ce,"`backfill` only works with `combobox` mode."),Object(E.a)(X==="combobox"||!Ae,"`getInputElement` only work with `combobox` mode."),Object(E.b)(X!=="combobox"||!Ae||!Le||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ie&&!we&&X!=="combobox"&&X!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!pe||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ge!=null){var et=Object(b.d)(ge);Object(E.a)(!ne||et.every(function(Je){return Object(u.a)(Je)==="object"&&("key"in Je||"value"in Je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!Ue||Array.isArray(ge),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var ze=null;Object(O.a)(se).some(function(Je){if(!W.isValidElement(Je)||!Je.type)return!1;var Xe=Je.type;if(Xe.isSelectOption)return!1;if(Xe.isSelectOptGroup){var yt=Object(O.a)(Je.props.children).every(function(xt){return!W.isValidElement(xt)||!Je.type||xt.type.isSelectOption?!0:(ze=xt.type,!1)});return!yt}return ze=Xe,!0}),ze&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ze.displayName||ze.name||ze,"`.")),Object(E.a)(oe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=y,R=Object(f.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:_,flattenOptions:g.d,getLabeledValue:g.e,filterOptions:g.b,isValueDisabled:g.g,findValueOption:g.c,warningProps:P,fillOptionsWithMissingValue:g.a}),U=function(A){Object(N.a)(ee,A);var X=Object(V.a)(ee);function ee(){var se;return Object(q.a)(this,ee),se=X.apply(this,arguments),se.selectRef=W.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(z.a)(ee,[{key:"render",value:function(){return W.createElement(R,Object.assign({ref:this.selectRef},this.props))}}]),ee}(W.Component);U.Option=h,U.OptGroup=w;var L=U,j=Me.c=L},M8RZ:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return k});var q=K("fWQN"),z=K("mtLc"),N=K("yKVA"),V=K("879j"),W=K("q1tI"),D=K.n(W),H=K("i8i4"),F=K.n(H),k=function(T){Object(N.a)(m,T);var v=Object(V.a)(m);function m(c){var d;Object(q.a)(this,m),d=v.call(this,c);var r=window.document;return d.node=r.createElement("div"),r.body.appendChild(d.node),d}return Object(z.a)(m,[{key:"render",value:function(){var d=this.props.children;return Object(H.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(D.a.Component)},MvOs:function(Ke,Me,K){"use strict";K.r(Me);var q=K("/zsF"),z=K("PArb"),N=K("sPJy"),V=K("bE4q"),W=K("+L6B"),D=K("2/Rp"),H=K("14J3"),F=K("BMrR"),k=K("jCWc"),T=K("kPKH"),v=K("5Dmo"),m=K("3S7+"),c=K("sRBo"),d=K("kaz8"),r=K("T2oS"),s=K("W9HT"),o=K("7Kak"),a=K("9yH6"),l=K("MXD1"),h=K("CFYs"),I=K("miYZ"),w=K("tsqr"),x=K("k1fw"),O=K("9og8"),S=K("2qtc"),_=K("kLXV"),g=K("tJVT"),f=K("PpiC"),u=K("5NDa"),E=K("5rEg"),b=K("aHsQ"),y=K("sGsY"),P=K("WmNS"),R=K.n(P),U=K("q1tI"),L=K.n(U),j=K("Ty5D"),A=K("55Ip"),X=K("9kvl"),ee=K("D1Df"),se=K.n(ee),ce=K("Icgb"),Le=K("gUdW"),Ce=K("xGfz"),Ae=K("jhfD"),Pe=K("Llu2"),Ie=K("BlwA"),pe=K("bPs0"),de=K("wd/R"),ne=K.n(de),ge=K("V5fa"),oe=K.n(ge),De=K("1vsH"),Ue=K("s8TD"),we=K("xKgJ"),Ge=K("bntm"),Qe=K("V0Rq"),et=K("HBuW"),ze=K("9Bee"),Je=K("Ot1p"),Xe=function(Ee){var Be,st,ct,Ct,lt=Ee.item,jt=Ee.answerData,qt=Ee.isEducation,Ot=Ee.onBlur,Zt=Ot===void 0?function(){}:Ot,un=Object(U.useRef)(""),sn=Object(U.useState)(),Xt=Object(g.a)(sn,2),mn=Xt[0],kn=Xt[1],Un=Object(U.useState)(!1),ft=Object(g.a)(Un,2),Wt=ft[0],Qt=ft[1],$t=Object(U.useState)(qt||!1),en=Object(g.a)($t,2),fn=en[0],Y=en[1],C=Object(U.useRef)(),M=function(){clearInterval(C.current),C.current=setInterval(function(){Wt&&Zt(un.current)},10*1e3)},G=function(Q){Zt(un.current);var Se="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(Q||window.event).returnValue=Se,Se};return Object(U.useEffect)(function(){console.log("isFocus:",Wt),Wt&&M()},[Wt]),Object(U.useEffect)(function(){kn(lt==null?void 0:lt.a_flag)},[lt==null?void 0:lt.a_flag]),Object(U.useEffect)(function(){return function(){clearInterval(C.current)}},[]),L.a.createElement("div",null,(jt==null||((Be=jt.exercise)===null||Be===void 0)?void 0:Be.user_exercise_status)===1?L.a.createElement("div",null,L.a.createElement("p",{className:"mt10 mb0"},"\u6211\u7684\u7B54\u6848\uFF1A"),L.a.createElement("div",{className:oe.a.simpleText},L.a.createElement(ze.a,{value:lt==null||((st=lt.user_answer)===null||st===void 0)?void 0:st[0]}))):L.a.createElement("div",{className:lt.user_score&&(lt.user_score===lt.question_score?"c-green":"c-red")},fn?L.a.createElement(Je.a,{watch:!0,isFocus:!0,defaultValue:lt==null||((ct=lt.user_answer)===null||ct===void 0)?void 0:ct[0],id:lt==null?void 0:lt.question_id,onChange:function(Q){un.current=Q,Qt(!0)},onBlur:function(){Zt(un.current),clearInterval(C.current),Qt(!1)}}):L.a.createElement("div",{onClick:function(){var Q;if(!lt.repeat_answer&&(lt==null||((Q=lt.user_answer)===null||Q===void 0)?void 0:Q.length)>0&&!lt.israp)return;Y(!0)},className:oe.a.startAnswer},L.a.createElement("div",{className:"c-blue"},"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54"))),Object(we.s)()&&(lt==null?void 0:lt.standard_answer)&&L.a.createElement("div",null,L.a.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),L.a.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},L.a.createElement(ze.a,{value:lt==null||((Ct=lt.standard_answer)===null||Ct===void 0)?void 0:Ct[0]}))))},yt=Xe,xt=K("OaEy"),vt=K("2fM7"),ht=function(Ee){var Be,st,ct,Ct,lt=Ee.item,jt=Ee.answerData,qt=Ee.isEducation,Ot=Ee.onBlur,Zt=Ot===void 0?function(){}:Ot,un=Object(U.useRef)(""),sn=Object(U.useState)(),Xt=Object(g.a)(sn,2),mn=Xt[0],kn=Xt[1],Un=Object(U.useState)(!1),ft=Object(g.a)(Un,2),Wt=ft[0],Qt=ft[1],$t=Object(U.useState)(!1),en=Object(g.a)($t,2),fn=en[0],Y=en[1],C=Object(U.useState)(qt||!1),M=Object(g.a)(C,2),G=M[0],te=M[1],Q=Object(U.useState)(0),Se=Object(g.a)(Q,2),ot=Se[0],St=Se[1],Pt=Object(U.useRef)(lt.kp_content||""),ut=Object(U.useRef)(lt.kp_clazz),Vt=Object(U.useRef)(),tn=Object(U.useMemo)(function(){var wn,_n;return(wn=un.current)===null||wn===void 0||((_n=wn.replace(/[\n|\r|\t]/g,""))===null||_n===void 0)?void 0:_n.length},[un.current]),Sn=function(){clearInterval(Vt.current),Vt.current=setInterval(function(){fn&&Zt(un.current,Pt.current,ut.current)},30*1e3)};return Object(U.useEffect)(function(){console.log("isFocus:",fn),Sn()},[fn]),Object(U.useEffect)(function(){kn(lt==null?void 0:lt.a_flag)},[lt==null?void 0:lt.a_flag]),Object(U.useEffect)(function(){return function(){clearInterval(Vt.current)}},[]),L.a.createElement("div",null,(jt==null||((Be=jt.exercise)===null||Be===void 0)?void 0:Be.user_exercise_status)===1?L.a.createElement("div",null,L.a.createElement("div",{className:"mt30"},L.a.createElement("strong",null,"\u4F5C\u6587\u9898\u76EE\uFF1A"),L.a.createElement("br",null),L.a.createElement(E.a,{disabled:!0,className:"mt10",value:Pt.current,onChange:function(_n){Pt.current=_n.target.value,St(ot+1)},onBlur:function(){Zt(un.current,Pt.current,ut.current),Y(!1)}})),L.a.createElement("div",{className:"mt30"},L.a.createElement("strong",null,"\u4F5C\u54C1\u7C7B\u578B\uFF1A"),L.a.createElement("br",null),L.a.createElement(vt.a,{disabled:!0,className:"mt10 w100",placeholder:"\u8BF7\u9009\u62E9\u4F5C\u54C1\u7C7B\u578B",value:ut.current,onChange:function(_n){ut.current=_n,St(ot+1)},onBlur:function(){Zt(un.current,Pt.current,ut.current),Y(!1)}},L.a.createElement(vt.a.Option,{key:1,value:"\u79D1\u666E"},"\u79D1\u666E"),L.a.createElement(vt.a.Option,{key:2,value:"\u79D1\u5E7B"},"\u79D1\u5E7B"))),L.a.createElement("p",{className:"mt10 mb0"},"\u4F5C\u54C1\u5185\u5BB9\uFF1A"),L.a.createElement("div",{className:oe.a.simpleText},L.a.createElement(ze.a,{value:lt==null||((st=lt.user_answer)===null||st===void 0)?void 0:st[0]}))):L.a.createElement("div",null,L.a.createElement("div",{className:"mt30"},L.a.createElement("strong",null,"\u4F5C\u6587\u9898\u76EE\uFF1A"),L.a.createElement("br",null),L.a.createElement(E.a,{className:"mt10",maxLength:60,onBlur:function(){return Zt(un.current,Pt.current,ut.current)},placeholder:"\u8BF7\u8F93\u5165\u4F5C\u6587\u9898\u76EE(\u6700\u591A60\u4E2A\u5B57)",value:Pt.current,onChange:function(_n){Pt.current=_n.target.value,St(ot+1)}})),L.a.createElement("div",{className:"mt30"},L.a.createElement("strong",null,"\u4F5C\u6587\u7C7B\u578B\uFF1A"),L.a.createElement("br",null),L.a.createElement(vt.a,{className:"mt10 w100",placeholder:"\u8BF7\u9009\u62E9\u4F5C\u54C1\u7C7B\u578B",value:ut.current,onChange:function(_n){ut.current=_n,Zt(_n.current,Pt.current,ut.current),St(ot+1)}},L.a.createElement(vt.a.Option,{key:1,value:"\u79D1\u666E"},"\u79D1\u666E"),L.a.createElement(vt.a.Option,{key:2,value:"\u79D1\u5E7B"},"\u79D1\u5E7B"))),L.a.createElement("div",{className:"mt30 mb20"},L.a.createElement("div",{className:lt.user_score&&(lt.user_score===lt.question_score?"c-green":"c-red")},L.a.createElement("strong",null,"\u4F5C\u6587\u5185\u5BB9\uFF1A"),L.a.createElement("br",null),L.a.createElement("div",{className:"mt10 relative"},L.a.createElement("span",{className:"c-blue",style:{position:Wt?"fixed":"absolute",top:Wt?61:4,left:10,zIndex:106}},"\u5DF2\u8F93\u5165",tn,"\u5B57"),G?L.a.createElement(Je.a,{className:oe.a.simpleMd,disablePaste:!0,hidetoolBar:qt,height:qt?"60vh":150,isFocus:!0,defaultValue:lt==null||((ct=lt.user_answer)===null||ct===void 0)?void 0:ct[0],id:lt==null?void 0:lt.question_id,onFullScreen:function(_n){return Qt(_n)},onChange:function(_n){un.current=_n,Y(!0),St(ot+1)},onBlur:function(){Zt(un.current,Pt.current,ut.current),Y(!1)}}):L.a.createElement("div",{onClick:function(){return te(!0)},className:oe.a.startAnswer},L.a.createElement("div",{className:"c-blue"},"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54")))))),Object(we.s)()&&(lt==null?void 0:lt.standard_answer)&&L.a.createElement("div",null,L.a.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),L.a.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},L.a.createElement(ze.a,{value:lt==null||((Ct=lt.standard_answer)===null||Ct===void 0)?void 0:Ct[0]}))))},Rt=ht,At=K("g9YV"),ke=K("wCAj"),Oe=K("5GOC"),tt=K("JsLm"),it=K("ZW9T"),Ne=K("o5mm"),qe=K.n(Ne),Te=function(Ee){var Be,st,ct,Ct,lt=Ee.item,jt=Ee.answerData,qt=Object(U.useState)([]),Ot=Object(g.a)(qt,2),Zt=Ot[0],un=Ot[1],sn=Object(U.useState)([]),Xt=Object(g.a)(sn,2),mn=Xt[0],kn=Xt[1];Object(U.useEffect)(function(){var Qt;if(!(lt!=null&&(Qt=lt.shixun_details)!==null&&Qt!==void 0&&Qt.length))return;for(var $t=[],en=[],fn=0;fn<(lt==null||((Y=lt.shixun_details)===null||Y===void 0)?void 0:Y.length);fn++){for(var Y,C,M,G=0;G<(lt==null?void 0:lt.shixun_details[fn].stage_list.length);G++){var te,Q,Se,ot,St=lt==null?void 0:lt.shixun_details[fn].stage_list[G];$t.push(Object(x.a)(Object(x.a)({},St),{operation:lt==null||((te=lt.shixun_details)===null||te===void 0||((Q=te[fn])===null||Q===void 0||((Se=Q.shixun_detail)===null||Se===void 0||((ot=Se[0])===null||ot===void 0))))?void 0:ot.game_identifier}))}if(lt!=null&&(C=lt.shixun_details)!==null&&C!==void 0&&(M=C[fn])!==null&&M!==void 0&&M.shixun_detail){var Pt,ut,Vt;en.push(lt==null||((Pt=lt.shixun_details)===null||Pt===void 0||((ut=Pt[fn])===null||ut===void 0||((Vt=ut.shixun_detail)===null||Vt===void 0)))?void 0:Vt[0])}}kn(en),un($t)},[lt==null?void 0:lt.shixun_details]);var Un=[{title:"\u5173\u5361",dataIndex:"position",key:"position",align:"center"},{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:function($t){return L.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,en){return L.a.createElement("span",null,en.evaluate_count?en.evaluate_count:L.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u5B8C\u6210\u65F6\u95F4",key:"endTime",dataIndex:"endTime",align:"center",render:function($t,en){var fn=!1;return en.finished_time&&jt!==null&&jt!==void 0&&jt.exercise&&jt!==null&&jt!==void 0&&jt.exercise_answer_user&&((jt==null?void 0:jt.exercise.time)===-1?fn=ne()(jt==null?void 0:jt.exercise.end_time).isBefore(en.finished_time):fn=ne()(jt==null?void 0:jt.exercise_answer_user.start_at).add(jt==null?void 0:jt.exercise.time,"m").isBefore(en.finished_time)),L.a.createElement("span",null,en.finished_time||L.a.createElement("span",{className:"c-grey-999"},"--"),L.a.createElement("span",{className:"c-orange-ff9 "},fn?"\uFF08\u5DF2\u8D85\u65F6\uFF09":""))}},{title:"\u8017\u65F6",dataIndex:"time_consuming",key:"time_consuming",align:"center",render:function($t,en){return L.a.createElement("span",null,en.time_consuming||L.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u67E5\u770B\u7B54\u6848",dataIndex:"view_answer",key:"view_answer",align:"center",render:function($t,en){return L.a.createElement("span",null,en.view_answer?"\u5DF2\u67E5\u770B":"\u672A\u67E5\u770B")}},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",align:"center",render:function($t,en,fn){return $t?L.a.createElement(tt.a,{affix:!1,className:"mt10"},L.a.createElement(tt.a.Link,{href:"#challenge_".concat(lt==null?void 0:lt.question_id).concat(fn),title:L.a.createElement("span",{style:{color:"#0152d9"}},"\u67E5\u770B")})):L.a.createElement("span",{className:"c-grey-999"},"--")}}],ft=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function($t,en){return L.a.createElement("span",null,en.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function($t,en){return L.a.createElement("span",null,en.error_msg?en.error_msg:"--")}}],Wt={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return L.a.createElement("div",{className:"mt15 mb15"},L.a.createElement("div",null,lt==null||((Be=lt.shixun)===null||Be===void 0)?void 0:Be.map(function(Qt,$t){return L.a.createElement(F.a,{className:"font16",gutter:[0,20]},L.a.createElement(T.a,{flex:"1"},Qt.challenge_name," (",Qt.challenge_score,"\u5206)"),L.a.createElement(T.a,{flex:"100px",className:"tr"},!Qt.answer_status&&L.a.createElement("span",{className:"font12 tag-style-border border-orange c-orange "},"\u672A\u5B8C\u6210"),!!Qt.answer_status&&L.a.createElement("span",{className:"font12 tag-style-border border-green c-green "},"\u5DF2\u5B8C\u6210")))})),(jt==null||((st=jt.exercise)===null||st===void 0)?void 0:st.student_commit_status)!==0||(jt==null||((ct=jt.exercise)===null||ct===void 0)?void 0:ct.user_exercise_status)!==0?L.a.createElement(L.a.Fragment,null,!!(Zt!=null&&Zt.length)&&L.a.createElement("div",null,L.a.createElement("p",{className:"font16 c-grey-666"},"\u9636\u6BB5\u6210\u7EE9"),L.a.createElement(ke.a,{columns:Un,dataSource:Zt,pagination:!1})),!!(mn!=null&&mn.length)&&L.a.createElement("div",null,L.a.createElement("p",{className:"font16 c-grey-666 mt10"},"\u5B9E\u8BAD\u8BE6\u60C5"),mn==null?void 0:mn.map(function(Qt,$t){return L.a.createElement("div",{id:"challenge_".concat(lt==null?void 0:lt.question_id).concat($t),className:"mt5"},L.a.createElement("div",null,L.a.createElement("span",{className:"font16 mr15"}," \u7B2C",Qt.position,"\u5173"),L.a.createElement(A.a,{className:"current c-black font16",to:"/tasks/".concat(Qt.game_identifier)},Qt.name)),(Qt==null?void 0:Qt.st)===0&&Qt.passed_code&&L.a.createElement("aside",{className:qe.a.shixunWrp},L.a.createElement("h2",null,"\u7B2C\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",L.a.createElement("span",{className:"c-light-black"},Qt.path)),L.a.createElement(it.b,{height:300,language:"python",theme:"default",value:Qt.passed_code,options:Wt})))}))):L.a.createElement(L.a.Fragment,null,Object(we.s)()&&L.a.createElement(ze.a,{className:"c-grey-999 mt20 mb20",value:lt==null?void 0:lt.question_title}),lt==null||((Ct=lt.shixun)===null||Ct===void 0)?void 0:Ct.map(function(Qt,$t){return L.a.createElement("p",{className:"font16 c-grey-666 mb5",key:$t},L.a.createElement("span",{className:"mr20"},"\u7B2C",Qt==null?void 0:Qt.challenge_position,"\u5173 ",Qt==null?void 0:Qt.challenge_name),L.a.createElement("span",null,Qt==null?void 0:Qt.challenge_score,"\u5206"))})))},fe=Te,me=K("J66h"),re=function(Ee){var Be=Ee.item,st=Ee.answerData,ct=Object(U.useState)([]),Ct=Object(g.a)(ct,2),lt=Ct[0],jt=Ct[1];Object(U.useEffect)(function(){var Zt;if((Be==null||((Zt=Be.evaluate_codes)===null||Zt===void 0)?void 0:Zt.length)>0){var un;jt(Be==null||((un=Be.evaluate_codes)===null||un===void 0)?void 0:un.map(function(sn,Xt){return{key:Xt+1,error_msg:sn!=null&&sn.error_msg?me.Base64.decode(sn==null?void 0:sn.error_msg):""}}))}else jt([{key:"--",error_msg:"--"}])},[Be==null?void 0:Be.evaluate_codes]);var qt=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(un,sn){return L.a.createElement("span",null,sn.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(un,sn){return L.a.createElement("span",null,sn.error_msg?sn.error_msg:"--")}}],Ot={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return L.a.createElement(L.a.Fragment,null,L.a.createElement("div",{className:"mt15 mb15"},L.a.createElement(ze.a,{value:Be==null?void 0:Be.description})),(Be==null?void 0:Be.passed_code)&&L.a.createElement("aside",{className:qe.a.shixunWrp},L.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"),L.a.createElement(it.b,{style:{border:"1px solid #ccc"},height:300,language:"python",theme:"vs-light",value:Be!=null&&Be.passed_code?me.Base64.decode(Be==null?void 0:Be.passed_code):"",options:Ot})))},ae=re,he=K("oBTY"),ve=E.a.TextArea,_e=function(Ee){var Be,st,ct=Ee.item,Ct=Ee.answerData,lt=Ee.onBlur,jt=lt===void 0?function(){}:lt,qt=Object(U.useState)([]),Ot=Object(g.a)(qt,2),Zt=Ot[0],un=Ot[1],sn=Object(U.useState)(!1),Xt=Object(g.a)(sn,2),mn=Xt[0],kn=Xt[1],Un=Object(U.useRef)(),ft=Object(U.useRef)(),Wt=Object(U.useRef)(),Qt=function(){clearInterval(Un.current),Un.current=setInterval(function(){var en;ft.current>=0&&jt((en=Wt.current[ft.current])===null||en===void 0?void 0:en.answer_text,ft.current+1,Wt.current)},5*1e3)};return Object(U.useEffect)(function(){for(var $t=[],en=function(C){var M,G=(ct==null||((M=ct.user_answer)===null||M===void 0)?void 0:M.find(function(te){return te.choice_id===C+1}))||{choice_id:C+1,answer_text:""};$t.push(Object(x.a)({},G))},fn=0;fn<(ct==null?void 0:ct.multi_count);fn++)en(fn);Wt.current=$t,un($t)},[ct==null?void 0:ct.user_answer]),Object(U.useEffect)(function(){return Qt(),function(){window.clearInterval(Un.current)}},[]),L.a.createElement("div",null,Zt==null?void 0:Zt.map(function($t,en){var fn,Y;return L.a.createElement("div",{className:"mt10"},L.a.createElement("span",null,"\u6211\u7684\u7B54\u6848\uFF08\u586B\u7A7A",en+1,"\uFF09:"),L.a.createElement("div",null,L.a.createElement(ve,{autoSize:!0,rows:4,disabled:!ct.repeat_answer&&(ct==null||((fn=ct.user_answer)===null||fn===void 0)?void 0:fn.length)>0&&!ct.israp||(Ct==null||((Y=Ct.exercise)===null||Y===void 0)?void 0:Y.user_exercise_status)===1,value:$t==null?void 0:$t.answer_text,onFocus:function(){return ft.current=en},onChange:function(M){Zt[en].answer_text=M.target.value,un(Object(he.a)(Zt))},onBlur:function(M){jt($t==null?void 0:$t.answer_text,en+1,Zt),ft.current=null},className:"overflow_hidden ".concat(ct.user_score&&(ct.user_score===ct.question_score?"c-green":"c-red"))})))}),!!(ct!=null&&(Be=ct.standard_answer)!==null&&Be!==void 0&&Be.length)&&L.a.createElement("div",null,ct==null||((st=ct.standard_answer)===null||st===void 0)?void 0:st.map(function($t,en){return L.a.createElement("div",null,L.a.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",en+1,"\uFF09:"),L.a.createElement("div",null,L.a.createElement(ve,{autoSize:!0,disabled:!0,value:$t==null?void 0:$t.answer_text[0]})))})))},je=_e,at=K("lzim"),Et=E.a.TextArea,Lt=function(Ee){var Be=Ee.data;return L.a.createElement("div",{className:"tc mt80"},L.a.createElement("img",{width:"486",src:at.l})," ",L.a.createElement("br",null),Be.status===-1&&L.a.createElement("div",{className:"c-grey-999 mt60"},"\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"),Be.status===-2&&L.a.createElement("div",{className:" c-grey-999 mt60"},"\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A",L.a.createElement("span",{className:"c-red"},Be.ip),"\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"),L.a.createElement(D.a,{className:"mt40 pl20 pr20",type:"primary"},L.a.createElement("a",{href:"/"},"\u56DE\u5230\u9996\u9875")))},Tt=Lt,mt=K("m3rI"),Ze=K("LvDl"),$e=y.a.Countdown,He=E.a.TextArea,le=["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"],be={0:"c-red-ee4",1:"c-green"},rt=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898","\u7F16\u7A0B\u9898"],Ye=function(Ee){var Be,st,ct,Ct,lt,jt,qt,Ot,Zt,un,sn,Xt,mn,kn,Un,ft,Wt,Qt,$t,en,fn,Y,C,M,G,te,Q,Se,ot,St,Pt,ut,Vt,tn,Sn,wn,_n,Fn,mi,ki,Kn,si,Ai,_i,ni,Ki,Pi,Gi,zi=Ee.globalSetting,Ni=Ee.loading,$n=Ee.user,Ui=Ee.exercise,Ji=Ee.dispatch,di=Ee.location,Ln=Object(f.a)(Ee,["globalSetting","loading","user","exercise","dispatch","location"]),Ft=Object(j.i)(),Gn=Object(U.useState)({}),pn=Object(g.a)(Gn,2),xe=pn[0],dn=pn[1],Bi=Object(U.useState)({}),Qn=Object(g.a)(Bi,2),gn=Qn[0],Zi=Qn[1],Oi=Object(U.useState)({}),qi=Object(g.a)(Oi,2),ci=qi[0],Fi=qi[1],sr=Object(U.useState)(!1),Ei=Object(g.a)(sr,2),lr=Ei[0],ji=Ei[1],xi=Object(U.useState)(!0),ur=Object(g.a)(xi,2),Gt=ur[0],an=ur[1],Jt=Object(U.useState)(!1),cn=Object(g.a)(Jt,2),vn=cn[0],Pn=cn[1],yn=Object(U.useState)(!1),zn=Object(g.a)(yn,2),ai=zn[0],hn=zn[1],Ri=Object(U.useState)(),In=Object(g.a)(Ri,2),Vn=In[0],ei=In[1],Ti=Object(U.useState)(0),ea=Object(g.a)(Ti,2),Mn=ea[0],An=ea[1],On=Object(U.useState)(""),gi=Object(g.a)(On,2),dr=gi[0],$i=gi[1],Ur=Object(U.useState)("none"),Br=Object(g.a)(Ur,2),Ra=Br[0],Fr=Br[1],ho=Object(U.useState)(""),fo=Object(g.a)(ho,2),Go=fo[0],po=fo[1],mo=Object(U.useState)({status:0}),go=Object(g.a)(mo,2),gr=go[0],Vi=go[1],ta=Object(U.useState)(!1),na=Object(g.a)(ta,2),vo=na[0],Yi=na[1],vr=Object(U.useState)(!1),ia=Object(g.a)(vr,2),yo=ia[0],Ia=ia[1],zo=Object(U.useState)(window.document.domain==="kepukehuan.educoder.net"),La=Object(g.a)(zo,2),Ci=La[0],jr=La[1],Xi=Object(U.useRef)(),ra=Object(U.useRef)(),Or=Object(U.useRef)(),Wr=Object(U.useRef)(),bo=Object(U.useRef)(),Hr=Object(U.useMemo)(function(){return new WebSocket("ws://localhost:8082")},[]),_o=Object(U.useState)(0),Da=Object(g.a)(_o,2),En=Da[0],yr=Da[1],Eo=Object(U.useState)(0),aa=Object(g.a)(Eo,2),Rn=aa[0],br=aa[1],Ma=Object(U.useState)(!1),Wi=Object(g.a)(Ma,2),xo=Wi[0],cr=Wi[1],ka=Object(U.useState)(!1),Pa=Object(g.a)(ka,2),Kr=Pa[0],Na=Pa[1],Vo=Object(U.useState)(),To=Object(g.a)(Vo,2),Co=To[0],nr=To[1],Rr=Object(U.useState)(),_r=Object(g.a)(Rr,2),oa=_r[0],Ua=_r[1];Object(U.useEffect)(function(){return document.body.setAttribute("data-custom","auto"),function(){document.body.removeAttribute("data-custom")}},[]),Object(U.useEffect)(function(){var kt;return document.body.scrollIntoView(),(kt=$n.userInfo)!==null&&kt!==void 0&&kt.user_id&&(Object(we.c)()?Zn():$n.userInfo.login&&xr()),window.addEventListener("message",sa),function(){window.removeEventListener("message",sa),di.pathname.indexOf("/detail")>-1&&Object(Ge.b)()}},[Ft.categoryId,$n.userInfo.login]),Object(U.useEffect)(function(){return Ci&&Ji({type:"globalSetting/headerFooterToggle",payload:!1}),window.addEventListener("beforeunload",Ba),function(){clearTimeout(Or.current),clearTimeout(Wr.current),window.removeEventListener("beforeunload",Ba)}},[]),Object(U.useEffect)(function(){var kt;xe!=null&&(kt=xe.question_status)!==null&&kt!==void 0&&kt.every(function(ue){return!!ue.ques_status&&vo&&(gn==null?void 0:gn.used_screen_num)<(gn==null?void 0:gn.screen_num)})&&setTimeout(function(){var ue;(ue=ra.current)===null||ue===void 0||ue.handlePhoto()},1300)},[xe]),Object(U.useEffect)(function(){var kt;if(clearTimeout(Or.current),clearTimeout(Wr.current),xe!=null&&(kt=xe.exercise)!==null&&kt!==void 0&&kt.left_time&&Object(we.s)()){var ue,nt;if((xe==null||((ue=xe.exercise)===null||ue===void 0)?void 0:ue.left_time)>1800){var Fe;Wr.current=setTimeout(function(){_.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:L.a.createElement(ce.a,null),okText:"\u77E5\u9053\u4E86"})},((xe==null||((Fe=xe.exercise)===null||Fe===void 0)?void 0:Fe.left_time)-1800)*1e3)}if((xe==null||((nt=xe.exercise)===null||nt===void 0)?void 0:nt.left_time)>900){var wt;Or.current=setTimeout(function(){_.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:L.a.createElement(ce.a,null),okText:"\u77E5\u9053\u4E86"})},((xe==null||((wt=xe.exercise)===null||wt===void 0)?void 0:wt.left_time)-900)*1e3)}}},[xe==null||((Be=xe.exercise)===null||Be===void 0)?void 0:Be.left_time]);var Ba=function(){var ue;(ue=Ui.exerciseUserInfo)!==null&&ue!==void 0&&ue.screen_open&&window.navigator.sendBeacon("".concat(mt.a.API_SERVER,"/api/exercises/").concat(Ft.categoryId,"/commit_screen_at.json"),{})},sa=function(ue){ue.data==="backExercise"&&Er()},Er=function(){Fr("none"),$i(""),Zn()},xr=function(){var kt=Object(O.a)(R.a.mark(function ue(){var nt,Fe,wt,gt,Nt,zt,Dt,rn,Ht,Mt,Tn;return R.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Ji({type:"exercise/getExerciseUserInfo",payload:Object(x.a)({},Ft)});case 2:if(Fe=ln.sent,Zi(Object(x.a)({},Fe.data)),!((Fe==null||((nt=Fe.data)===null||nt===void 0)?void 0:nt.ip_limit)!=="no")){ln.next=11;break}if(!((Fe==null||((wt=Fe.data)===null||wt===void 0)?void 0:wt.ip_limit)==="inner")){ln.next=9;break}return ln.next=8,Object(Ue.a)({ip_limit:Fe==null||((gt=Fe.data)===null||gt===void 0)?void 0:gt.ip_limit});case 8:zt=ln.sent;case 9:return ln.next=11,Object(De.s)({exerciseId:Ft.categoryId,ip:zt,errmsgHide:!0,ip_limit:Fe==null||((Nt=Fe.data)===null||Nt===void 0)?void 0:Nt.ip_limit}).catch(function(Dn){Vi(Dn)});case 11:if(!((Fe==null?void 0:Fe.status)==0)){ln.next=18;break}if(!((Fe==null||((Dt=Fe.data)===null||Dt===void 0)?void 0:Dt.used_screen_num)>(Fe==null||((rn=Fe.data)===null||rn===void 0)?void 0:rn.screen_num)&&Fe!==null&&Fe!==void 0&&(Ht=Fe.data)!==null&&Ht!==void 0&&Ht.screen_open)){ln.next=15;break}return ir(),ln.abrupt("return",!1);case 15:Pn(Fe==null?void 0:Fe.data.check_camera),Fe!=null&&Fe.data.check_camera||hn(Fe==null||((Mt=Fe.data)===null||Mt===void 0)?void 0:Mt.screen_open),Fe!=null&&(Tn=Fe.data)!==null&&Tn!==void 0&&Tn.check_camera||Zn();case 18:case"end":return ln.stop()}},ue)}));return function(){return kt.apply(this,arguments)}}(),Zn=function(){var kt=Object(O.a)(R.a.mark(function ue(){var nt,Fe,wt,gt,Nt,zt,Dt,rn,Ht,Mt,Tn,Yn,ln,Dn,xn,Hn,Nn,Qi,za,Lr,Va,Ya,Xa,Yr,ha,Xr,Qa,Qr,Jr,fa,pa,Zr,ma,Sr,Ja,Dr,vi,ga;return R.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:if(document.body.scrollIntoView(),ji(!0),wt=(nt=$n.userInfo)===null||nt===void 0?void 0:nt.user_id,!Object(we.c)()){hi.next=11;break}return hi.next=6,Object(Qe.G)({exerciseId:Ft.categoryId,login:Ft.login}).catch(function(){return ji(!1)});case 6:Fe=hi.sent,((gt=Fe)===null||gt===void 0?void 0:gt.exercise)&&(Fe.exercise.user_exercise_status=1),wt=(Nt=Fe)===null||Nt===void 0||((zt=Nt.exercise_answer_user)===null||zt===void 0)?void 0:zt.user_id,hi.next=31;break;case 11:if(!(di!=null&&(Dt=di.query)!==null&&Dt!==void 0&&Dt.check)){hi.next=18;break}return hi.next=14,Object(Qe.z)(Object(x.a)({},Ft)).catch(function(){return ji(!1)});case 14:Fe=hi.sent,wt=(Qi=Fe)===null||Qi===void 0||((za=Qi.exercise)===null||za===void 0)?void 0:za.user_id,hi.next=25;break;case 18:return hi.next=20,Object(Qe.y)(Object(x.a)({},Ft)).catch(function(){return ji(!1)});case 20:Fe=hi.sent,Fe.status===-1&&er(),((Lr=Fe)===null||Lr===void 0?void 0:Lr.exercise)&&(Fe.exercise.user_exercise_status=0),((Va=Fe)===null||Va===void 0?void 0:Va.exercise)&&(Fe.exercise.exercise_status=2),(Ya=Fe)===null||Ya===void 0||((Xa=Ya.exercise_question_types)===null||Xa===void 0)||Xa.map(function(Bn){if((Bn==null?void 0:Bn.question_type)<3){var Cn;Bn==null||((Cn=Bn.items)===null||Cn===void 0)||Cn.map(function(fi){fi.user_answer=fi.question_choices.filter(function(Si){return Si.user_answer_boolean}).map(function(Si){return Si.choice_id})})}});case 25:if(!(!((rn=Fe)!==null&&rn!==void 0&&(Ht=rn.exercise)!==null&&Ht!==void 0&&Ht.can_start)&&(Mt=Fe)!==null&&Mt!==void 0&&Mt.exercise)){hi.next=28;break}return window.location.href="/classrooms/".concat(Ft.coursesId,"/exercise/").concat(Ft.categoryId,"/users/").concat(Ft.login,"/check"),hi.abrupt("return");case 28:if(((Tn=Fe.exercise)===null||Tn===void 0?void 0:Tn.commit_status)===0&&!bo.current)try{bo.current=!0,Hr.send(JSON.stringify({type:"toggleLockExit",data:!0})),Hr.send(JSON.stringify({type:"network-close",data:""}))}catch(Bn){}(Yn=Fe)!==null&&Yn!==void 0&&(ln=Yn.exercise)!==null&&ln!==void 0&&ln.left_time&&setTimeout(function(){po(oe.a.red)},(((Yr=Fe)===null||Yr===void 0||((ha=Yr.exercise)===null||ha===void 0)?void 0:ha.left_time)-300>0?((Xr=Fe)===null||Xr===void 0||((Qa=Xr.exercise)===null||Qa===void 0)?void 0:Qa.left_time)-300:0)*1e3),((Dn=Fe)===null||Dn===void 0||((xn=Dn.exercise)===null||xn===void 0)?void 0:xn.take_photo)>=((Hn=Fe)===null||Hn===void 0||((Nn=Hn.exercise)===null||Nn===void 0)?void 0:Nn.photo_count);case 31:ji(!1),Fe&&(((Qr=Fe)!==null&&Qr!==void 0&&(Jr=Qr.exercise)!==null&&Jr!==void 0&&Jr.question_random||(fa=Fe)!==null&&fa!==void 0&&(pa=fa.exercise)!==null&&pa!==void 0&&pa.choice_random)&&(ga=1,Fe.exercise.question_random=(Dr=Fe)===null||Dr===void 0||((vi=Dr.exercise_question_types)===null||vi===void 0)?void 0:vi.map(function(Bn){var Cn,fi,Si,tr;return(Cn=Fe)!==null&&Cn!==void 0&&(fi=Cn.exercise)!==null&&fi!==void 0&&fi.choice_random&&((Bn.question_type===0||Bn.question_type===1)&&Bn.items.map(function(ar){return ar.question_choices=Object(De.U)(ar.question_choices,wt),ar}),Bn.question_type===7&&Bn.items.forEach(function(ar){ar.sub_exercise_questions.forEach(function(va){va.question_choices=Object(De.U)(va.question_choices,wt)})})),(Si=Fe)!==null&&Si!==void 0&&(tr=Si.exercise)!==null&&tr!==void 0&&tr.question_random&&(Bn.items=Object(De.U)(Bn.items,wt)),Bn.items.map(function(ar){return ar.question_num=ga,ga++,ar}),Bn})),console.log("---",Fe),Fe.exercise_types=((Zr=Fe)===null||Zr===void 0?void 0:Zr.exercise_types)||((ma=Fe)===null||ma===void 0||((Sr=ma.exercise_scores)===null||Sr===void 0)?void 0:Sr.exercise_types),Fe.question_status=Fe.question_status||hr(((Ja=Fe)===null||Ja===void 0?void 0:Ja.exercise_question_types)||[]),dn(Fe));case 33:case"end":return hi.stop()}},ue)}));return function(){return kt.apply(this,arguments)}}(),hr=function(ue){var nt=[];return ue.forEach(function(Fe){nt=nt.concat(Fe.items)}),nt=nt.map(function(Fe){return{ques_status:Fe==null?void 0:Fe.ques_status,question_num:Fe==null?void 0:Fe.question_num,ques_id:Fe==null?void 0:Fe.question_id}}),nt};Object(U.useEffect)(function(){var kt,ue,nt;((kt=xe.exercise)===null||kt===void 0?void 0:kt.left_time)===0&&ir(),((ue=xe.exercise)===null||ue===void 0?void 0:ue.left_time)&&ei(Date.now()+(xe==null||((nt=xe.exercise)===null||nt===void 0)?void 0:nt.left_time)*1e3)},[(st=xe.exercise)===null||st===void 0?void 0:st.left_time]);var fr=function(){var ue;(xe==null||((ue=xe.exercise)===null||ue===void 0)?void 0:ue.exercise_status)===3?_.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:L.a.createElement("div",{className:"tc font16"},"\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377",L.a.createElement("br",null),"\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")}):_.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:L.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",L.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),onOk:function(){var nt=Object(O.a)(R.a.mark(function wt(){var gt,Nt;return R.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return Dt.next=2,Object(Qe.S)({categoryId:Ft.categoryId,user_ids:[xe==null||((gt=xe.exercise_answer_user)===null||gt===void 0)?void 0:gt.user_id]});case 2:Nt=Dt.sent,Nt&&(w.b.info(Nt==null?void 0:Nt.message),er());case 4:case"end":return Dt.stop()}},wt)}));function Fe(){return nt.apply(this,arguments)}return Fe}()})},er=function(){window.location.href=Object(De.r)()?"/":"/classrooms/".concat(Ft.coursesId,"/exercise/").concat(Ft.categoryId,"/detail")},Fa=function(){var kt=Object(O.a)(R.a.mark(function ue(){var nt;return R.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Qe.l)(Object(x.a)({},Ft));case 2:if(nt=wt.sent,!(nt!=null&&nt.has_time)){wt.next=10;break}return ei(Date.now()+(nt==null?void 0:nt.left_time)*1e3),xe.exercise.left_time=nt==null?void 0:nt.left_time,dn(Object(x.a)({},xe)),wt.abrupt("return",!0);case 10:return So(),wt.abrupt("return",!1);case 12:case"end":return wt.stop()}},ue)}));return function(){return kt.apply(this,arguments)}}(),So=function(){var kt=Object(O.a)(R.a.mark(function ue(){var nt,Fe;return R.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(Qe.Z)({categoryId:Ft.categoryId,commit_method:2});case 2:nt=gt.sent,(nt==null?void 0:nt.status)===0&&(_.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:L.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",L.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Nt=Object(O.a)(R.a.mark(function Dt(){return R.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:er();case 1:case"end":return Ht.stop()}},Dt)}));function zt(){return Nt.apply(this,arguments)}return zt}()}),w.b.info(nt==null?void 0:nt.message)),(nt==null?void 0:nt.status)===-3&&(Fe=parseInt(nt==null?void 0:nt.message),xe.exercise.left_time=Fe,dn(Object(x.a)({},xe)));case 5:case"end":return gt.stop()}},ue)}));return function(){return kt.apply(this,arguments)}}(),Tr=function(){var kt=Object(O.a)(R.a.mark(function ue(nt){var Fe;return R.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(et.E)({id:nt.shixun_identifier});case 2:Fe=gt.sent,Fe!=null&&Fe.game_identifier&&(clearTimeout(Or.current),clearTimeout(Wr.current),$i("/tasks/".concat(Fe.game_identifier,"?type=exercises&exercisesId=").concat(Ft.categoryId,"&coursesId=").concat(Ft.coursesId,"&login=").concat(Ft.login,"&questionId=").concat(nt.question_id,"&isFullScreen=").concat(Object(Ge.a)())),Fr("block")),(Fe==null?void 0:Fe.status)===-3?Object(De.q)():(Fe==null?void 0:Fe.status)===2?wo(Fe==null?void 0:Fe.message,nt.question_id):(Fe==null?void 0:Fe.status)===3&&ja(Fe==null?void 0:Fe.message);case 5:case"end":return gt.stop()}},ue)}));return function(nt){return kt.apply(this,arguments)}}(),wo=function kt(ue,nt){var Fe;ue=(Fe=ue)!==null&&Fe!==void 0&&Fe.includes(".json")?ue:"".concat(ue,".json"),_.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:L.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var wt=Object(O.a)(R.a.mark(function Nt(){var zt,Dt;return R.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Qe.T)({url:ue});case 2:if(zt=Ht.sent,zt){Ht.next=5;break}return Ht.abrupt("return");case 5:return w.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Ht.next=8,Object(et.E)({id:zt.shixun_identifier});case 8:if(Dt=Ht.sent,!(Dt!=null&&Dt.game_identifier)){Ht.next=12;break}return Tr({shixun_identifier:Dt==null?void 0:Dt.game_identifier,question_id:nt}),Ht.abrupt("return");case 12:(Dt==null?void 0:Dt.status)===2?kt(Dt==null?void 0:Dt.message,nt):(Dt==null?void 0:Dt.status)===3&&ja(Dt==null?void 0:Dt.message);case 13:case"end":return Ht.stop()}},Nt)}));function gt(){return wt.apply(this,arguments)}return gt}()})},ja=function(ue){_.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:L.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",ue,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},la=function(ue){ue.redo?_.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:L.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 nt=Object(O.a)(R.a.mark(function wt(){var gt,Nt,zt,Dt;return R.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Qe.T)({id:ue.myshixun_identifier,url:ue.url});case 2:gt=Ht.sent,gt&&(Nt=Object(Ze.cloneDeep)(xe==null?void 0:xe.exercise_question_types),zt=Nt==null?void 0:Nt.findIndex(function(Mt){return Mt.question_type===5}),Nt[zt].items.find(function(Mt){return Mt.question_id===ue.question_id}).redo=!1,Nt[zt].items.find(function(Mt){return Mt.question_id===ue.question_id}).shixun_identifier=gt.shixun_identifier,xe.exercise_question_types=Nt,dn(xe),Dt=Object(x.a)(Object(x.a)({},ue),{},{shixun_identifier:gt.shixun_identifier}),Tr(Dt));case 4:case"end":return Ht.stop()}},wt)}));function Fe(){return nt.apply(this,arguments)}return Fe}()}):Tr(ue)},Yo=function(){var kt=Object(O.a)(R.a.mark(function ue(nt){var Fe;return R.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(!nt.hack_identifier){gt.next=5;break}return gt.next=3,Object(Qe.X)({id:nt.hack_identifier});case 3:Fe=gt.sent,(Fe==null?void 0:Fe.status)===0&&(clearTimeout(Or.current),clearTimeout(Wr.current),$i("/myproblems/".concat(Fe.identifier,"?type=exercises&exercisesId=").concat(Ft.categoryId,"&coursesId=").concat(Ft.coursesId,"&login=").concat(Ft.login,"&questionId=").concat(nt.question_id)),Fr("block"));case 5:case"end":return gt.stop()}},ue)}));return function(nt){return kt.apply(this,arguments)}}(),pr=function(){var kt=Object(O.a)(R.a.mark(function ue(nt,Fe,wt,gt,Nt,zt){var Dt,rn,Ht,Mt,Tn;return R.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if(Ia(!0),Ht={questionId:nt,exercise_choice_id:Fe,answer_text:wt},!((gn==null?void 0:gn.ip_limit)==="inner"||gn.ip_bind)){ln.next=6;break}return ln.next=5,Object(Ue.a)({ip_limit:gn==null?void 0:gn.ip_limit});case 5:rn=ln.sent;case 6:if(Nt&&(Ht.kp_content=Nt),Nt&&(Ht.kp_clazz=zt),nt){ln.next=11;break}return console.error("handleSave no questionId params"),ln.abrupt("return");case 11:return Ht.ip=rn,ln.next=14,Object(Qe.cb)(Ht);case 14:Mt=ln.sent,Mt!=null&&(Dt=Mt.alert)!==null&&Dt!==void 0&&Dt.length&&(Mt==null||((Tn=Mt.alert)===null||Tn===void 0)||Tn.map(function(Dn){_.a.warn({title:"\u63D0\u793A",autoFocusButton:null,content:Dn})})),(Mt==null?void 0:Mt.status)===0?gt&&gt():(Mt==null?void 0:Mt.status)===-1?setTimeout(function(){er()},1e3):(Mt==null?void 0:Mt.status)===-2?Vi(Mt):(Mt==null?void 0:Mt.status)===-3?(Mt.status=-1,Vi(Mt)):w.b.warn(Mt.message||"\u8BD5\u5377\u5DF2\u622A\u6B62\uFF0C\u5DF2\u81EA\u52A8\u4EA4\u5377"),Ia(!1);case 18:case"end":return ln.stop()}},ue)}));return function(nt,Fe,wt,gt,Nt,zt){return kt.apply(this,arguments)}}(),Ao=function(){var kt=Object(O.a)(R.a.mark(function ue(nt){var Fe,wt;return R.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Fa();case 2:return Nt.next=4,Object(Qe.d)({id:Ft.categoryId});case 4:if(Fe=Nt.sent,Fe){Nt.next=7;break}return Nt.abrupt("return");case 7:Fe.question_undo!==0||Fe.oj_undo!==0?(wt="",Fe.question_undo!==0&&Fe.oj_undo!==0?wt="\u6709 ".concat(Fe.question_undo," \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(Fe.oj_undo," \u4E2A\u7F16\u7A0B\u9898"):Fe.question_undo!==0&&Fe.oj_undo===0?wt="\u6709 ".concat(Fe.question_undo," \u9898\u672A\u5B8C\u6210"):Fe.question_undo===0&&Fe.oj_undo!==0&&(wt="\u6709 ".concat(Fe.oj_undo," \u7F16\u7A0B\u9898\u672A\u5B8C\u6210")),_.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:nt?"\u77E5\u9053\u4E86":"\u786E\u8BA4\u4EA4\u5377",cancelText:"\u53D6\u6D88",content:L.a.createElement("div",{className:"tc font16"},wt,L.a.createElement("br",null),nt?"\u5728".concat(ne()(Fe.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):Vn?"\u4F60\u672C\u573A\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\u8FD8\u6709".concat(Object(De.bb)((Vn-new Date().getTime())/1e3)," \uFF0C\u786E\u8BA4\u63D0\u524D\u4EA4\u5377\u5417\uFF1F"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var zt=Object(O.a)(R.a.mark(function rn(){return R.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:nt?gn!=null&&gn.screen_open?w.b.success("\u4FDD\u5B58\u6210\u529F"):er():ir();case 1:case"end":return Mt.stop()}},rn)}));function Dt(){return zt.apply(this,arguments)}return Dt}()})):_.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:nt?"\u77E5\u9053\u4E86":"\u786E\u8BA4\u4EA4\u5377",cancelText:"\u53D6\u6D88",content:L.a.createElement("div",{className:"tc font16"},nt?"\u5728".concat(ne()(Fe.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):Vn?"\u4F60\u672C\u573A\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\u8FD8\u6709".concat(Object(De.bb)((Vn-new Date().getTime())/1e3)," \uFF0C\u786E\u8BA4\u63D0\u524D\u4EA4\u5377\u5417\uFF1F"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var zt=Object(O.a)(R.a.mark(function rn(){return R.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:nt?gn!=null&&gn.screen_open?w.b.success("\u4FDD\u5B58\u6210\u529F"):er():ir();case 1:case"end":return Mt.stop()}},rn)}));function Dt(){return zt.apply(this,arguments)}return Dt}()});case 8:case"end":return Nt.stop()}},ue)}));return function(nt){return kt.apply(this,arguments)}}(),Wa=function(ue){return L.a.createElement("div",null,L.a.createElement(h.a,{strokeColor:{from:"#108ee9",to:"#87d068"},status:"active",percent:ue}),L.a.createElement("div",{className:"c-grey-c tc mt10 mb20"},"\u6B63\u5728\u5224\u5206\u4E2D\u2026"))},Ha=function(){var ue=0,nt=_.a.info({title:"\u4EA4\u5377\u4E2D",icon:null,className:"modal-footer-none",content:Wa(ue)}),Fe=setInterval(function(){ue<=100?(ue+=2,nt.update({content:Wa(ue)})):(nt.destroy(),clearInterval(Fe))},50)},ir=function(){var kt=Object(O.a)(R.a.mark(function ue(){var nt;return R.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Qe.Z)({categoryId:Ft.categoryId,commit_method:1});case 2:return nt=wt.sent,wt.next=5,Ji({type:"exercise/setActionTabs",payload:Object(x.a)({},{removeEventListenerExitScreen:!0})});case 5:if((nt==null?void 0:nt.status)===0){Ha(),w.b.success(nt==null?void 0:nt.message),Pn(!1);try{Hr.send(JSON.stringify({type:"toggleLockExit",data:!1})),Hr.send(JSON.stringify({type:"network-open",data:""}))}catch(gt){}setTimeout(function(){_.a.info({title:"\u4EA4\u5377\u6210\u529F\uFF01",okText:"\u786E\u5B9A",maskClosable:!1,keyboard:!1,onOk:function(){Object(Ge.b)(),er()}})},3e3)}case 6:case"end":return wt.stop()}},ue)}));return function(){return kt.apply(this,arguments)}}(),ua=function(){var kt=Object(O.a)(R.a.mark(function ue(nt,Fe,wt,gt){return R.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:pr(Fe,nt,null,function(){xe.question_status.find(function(Dt){return Dt.ques_id===Fe}).ques_status=nt?1:0,gt.user_answer=[],gt.user_answer.push(nt),gt.repeat_answer||(gt.israp=!0),dn(Object(x.a)({},xe))});case 1:case"end":return zt.stop()}},ue)}));return function(nt,Fe,wt,gt){return kt.apply(this,arguments)}}(),Oo=function(){var kt=Object(O.a)(R.a.mark(function ue(nt,Fe,wt,gt,Nt){return R.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:pr(gt.question_id,nt,null,function(){var rn,Ht,Mt;gt.user_answer=[],gt.user_answer.push(nt);var Tn=Nt==null||((rn=Nt.sub_exercise_questions)===null||rn===void 0)?void 0:rn.filter(function(Yn){var ln;return((ln=Yn.user_answer)===null||ln===void 0?void 0:ln.length)===0});xe.question_status.find(function(Yn){return Yn.ques_id===Fe}).ques_status=(Tn==null?void 0:Tn.length)===(Nt==null||((Ht=Nt.sub_exercise_questions)===null||Ht===void 0)?void 0:Ht.length)?0:(Tn==null?void 0:Tn.length)>0&&(Tn==null?void 0:Tn.length)<(Nt==null||((Mt=Nt.sub_exercise_questions)===null||Mt===void 0)?void 0:Mt.length)?2:1,dn(Object(x.a)({},xe))});case 1:case"end":return Dt.stop()}},ue)}));return function(nt,Fe,wt,gt,Nt){return kt.apply(this,arguments)}}(),da=function(ue,nt,Fe){pr(nt,ue,null,function(){Fe.user_answer=ue,Fe.repeat_answer||(Fe.israp=!0),xe.question_status.find(function(wt){return wt.ques_id===nt}).ques_status=ue!=null&&ue.length?1:0,dn(Object(x.a)({},xe))})},Xo=function(ue,nt,Fe,wt,gt){if(!ue.replaceAll(" ","")){w.b.warning("\u56DE\u7B54\u4E0D\u80FD\u4E3A\u7A7A\u6216\u8005\u7EAF\u7A7A\u683C");return}pr(Fe,nt,ue,function(){xe.question_status.find(function(zt){return zt.ques_id===Fe}).ques_status=wt.every(function(zt){return!!zt.answer_text})?1:xe.question_status.find(function(zt){return zt.ques_id===Fe}).ques_status=wt.some(function(zt){return!!zt.answer_text})?2:0;var Nt={choice_id:nt,answer_text:ue};gt.user_answer.filter(function(zt){return zt.choice_id!=nt})?gt.user_answer.splice(nt-1,1,Nt):gt.user_answer.push(Nt),gt.repeat_answer||(gt.israp=!0),dn(Object(x.a)({},xe))})},Qo=function(ue,nt,Fe){if(!ue.replaceAll(" ","")){w.b.warning("\u56DE\u7B54\u4E0D\u80FD\u4E3A\u7A7A\u6216\u8005\u7EAF\u7A7A\u683C");return}pr(nt,null,ue,function(){xe.question_status.find(function(wt){return wt.ques_id===nt}).ques_status=ue?1:0,Fe.user_answer=[],Fe.user_answer.push(ue),Fe.repeat_answer||(Fe.israp=!0),dn(Object(x.a)({},xe))})},Ro=function(ue,nt){var Fe,wt,gt,Nt,zt,Dt,rn;return L.a.createElement("div",null,L.a.createElement(s.a,{spinning:yo},L.a.createElement(a.a.Group,{disabled:(xe==null||((Fe=xe.exercise)===null||Fe===void 0)?void 0:Fe.user_exercise_status)===1,defaultValue:ue==null||((wt=ue.user_answer)===null||wt===void 0)?void 0:wt[0],onChange:function(Mt){return ua(Mt.target.value,ue==null?void 0:ue.question_id,nt,ue)},className:ue.user_score&&"edu-radio-".concat(ue.user_score===ue.question_score?"green":"red")},ue==null||((gt=ue.question_choices)===null||gt===void 0)?void 0:gt.map(function(Ht,Mt){var Tn,Yn=ue.question_type==2,ln=Yn?"":"".concat(le[Mt],".");return L.a.createElement("div",{className:oe.a.answerWrap,key:Mt},L.a.createElement(a.a,{disabled:!ue.repeat_answer&&(ue==null||((Tn=ue.user_answer)===null||Tn===void 0)?void 0:Tn.length)>0&&!ue.israp,value:Ht==null?void 0:Ht.choice_id},L.a.createElement("span",{className:"mr3"},ln),L.a.createElement(ze.a,{style:{width:740},className:oe.a.renderHtml,value:Ht==null?void 0:Ht.choice_text})))}))),Object(we.s)()&&(xe==null||((Nt=xe.exercise)===null||Nt===void 0)?void 0:Nt.answer_open)&&((xe==null||((zt=xe.exercise)===null||zt===void 0)?void 0:zt.exercise_status)==3||(xe==null||((Dt=xe.exercise)===null||Dt===void 0)?void 0:Dt.user_exercise_status)==1)&&L.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",ue==null||((rn=ue.question_choices)===null||rn===void 0)?void 0:rn.map(function(Ht,Mt){return Ht.standard_boolean?le[Mt]:""}).join("")))},Ka=function(ue,nt,Fe){var wt;return L.a.createElement("div",null,ue==null||((wt=ue.sub_exercise_questions)===null||wt===void 0)?void 0:wt.map(function(gt,Nt){var zt,Dt,rn,Ht,Mt,Tn,Yn;return L.a.createElement("div",null,L.a.createElement("div",{style:{marginTop:20,userSelect:"none",alignItems:"center"}},L.a.createElement("span",{style:{flexShrink:0,fontSize:"14px",color:"#999"}},Fe+1+"."+(Nt+1),"\uFF08\u5355\u9009\u9898 ",gt==null?void 0:gt.question_score,"\u5206\uFF09"),L.a.createElement("br",null),L.a.createElement(ze.a,{style:{marginLeft:27},value:gt==null?void 0:gt.question_title})),L.a.createElement(a.a.Group,{disabled:(xe==null||((zt=xe.exercise)===null||zt===void 0)?void 0:zt.user_exercise_status)===1,style:{marginLeft:27},defaultValue:gt==null||((Dt=gt.user_answer)===null||Dt===void 0)?void 0:Dt[0],onChange:function(Dn){return Oo(Dn.target.value,ue==null?void 0:ue.question_id,Nt,gt,ue)},className:gt.user_score&&"edu-radio-".concat(gt.user_score===gt.question_score?"green":"red")},gt==null||((rn=gt.question_choices)===null||rn===void 0)?void 0:rn.map(function(ln,Dn){var xn,Hn=gt.question_type==2,Nn=Hn?"":"".concat(le[Dn],".");return L.a.createElement("div",{className:oe.a.answerWrap,key:Dn},L.a.createElement(a.a,{disabled:!gt.repeat_answer&&(gt==null||((xn=gt.user_answer)===null||xn===void 0)?void 0:xn.length)>0,value:ln==null?void 0:ln.choice_id},L.a.createElement("span",{className:"mr3"},Nn),L.a.createElement(ze.a,{style:{width:722},className:oe.a.renderHtml,value:ln==null?void 0:ln.choice_text})))})),Object(we.s)()&&(xe==null||((Ht=xe.exercise)===null||Ht===void 0)?void 0:Ht.answer_open)&&((xe==null||((Mt=xe.exercise)===null||Mt===void 0)?void 0:Mt.exercise_status)==3||(xe==null||((Tn=xe.exercise)===null||Tn===void 0)?void 0:Tn.user_exercise_status)==1)&&L.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",gt==null||((Yn=gt.standard_answer)===null||Yn===void 0)?void 0:Yn.map(function(ln,Dn){return L.a.createElement("span",null,le[Number(ln)-1])})))}))},Ga=function(ue,nt){var Fe,wt,gt,Nt,zt;return L.a.createElement("div",null,L.a.createElement(s.a,{spinning:yo},L.a.createElement(d.a.Group,{disabled:(xe==null||((Fe=xe.exercise)===null||Fe===void 0)?void 0:Fe.user_exercise_status)===1,defaultValue:ue==null?void 0:ue.user_answer,onChange:function(rn){return da(rn,ue==null?void 0:ue.question_id,ue)},className:ue.user_score&&"edu-checkbox-".concat(ue.user_score===ue.question_score?"green":"red")},ue==null||((wt=ue.question_choices)===null||wt===void 0)?void 0:wt.map(function(Dt,rn){var Ht,Mt="".concat(le[rn],".");return L.a.createElement("div",{className:oe.a.answerWrap},L.a.createElement(d.a,{disabled:!ue.repeat_answer&&(ue==null||((Ht=ue.user_answer)===null||Ht===void 0)?void 0:Ht.length)>0&&!ue.israp,value:Dt==null?void 0:Dt.choice_id},L.a.createElement("span",{className:"mr3"},Mt),L.a.createElement(ze.a,{className:oe.a.renderHtml,value:Dt==null?void 0:Dt.choice_text})))}))),Object(we.s)()&&(xe==null||((gt=xe.exercise)===null||gt===void 0)?void 0:gt.answer_open)&&(xe==null||((Nt=xe.exercise)===null||Nt===void 0)?void 0:Nt.exercise_status)==3&&L.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",ue==null||((zt=ue.question_choices)===null||zt===void 0)?void 0:zt.map(function(Dt,rn){return Dt.standard_boolean?le[rn]:""}).join("")))},Ir=function(ue,nt){return L.a.createElement(je,{item:ue,answerData:xe,onBlur:function(wt,gt,Nt){return Xo(wt,gt,ue==null?void 0:ue.question_id,Nt,ue)}})},Gr=function(ue,nt){return Ci?L.a.createElement(Rt,{item:ue,answerData:xe,onBlur:function(wt,gt,Nt){return pr(ue==null?void 0:ue.question_id,null,wt,void 0,gt,Nt)},isEducation:Ci}):L.a.createElement(yt,{item:ue,answerData:xe,onBlur:function(wt){return Qo(wt,ue==null?void 0:ue.question_id,ue)},isEducation:Ci})},Jo=function(ue,nt){return L.a.createElement(fe,{item:ue,answerData:xe})},ca=function(ue,nt){return L.a.createElement(ae,{item:ue,answerData:xe})},rr=function(ue,nt,Fe){var wt,gt,Nt=xe==null||((wt=xe.exercise_question_types)===null||wt===void 0)?void 0:wt.find(function(zt){return zt.question_type===nt});return L.a.createElement(L.a.Fragment,null,L.a.createElement("h1",{className:"font14 current",onClick:function(){ci[nt]=!ci[nt],Fi(Object(x.a)({},ci))}},!ci[nt]&&L.a.createElement(Le.a,null),ci[nt]&&L.a.createElement(Ce.a,null),L.a.createElement("span",{className:"ml5 c-grey-666"},ue)),L.a.createElement("ul",{className:oe.a.answerSheet,key:nt},!ci[nt]&&(Nt==null||((gt=Nt.items)===null||gt===void 0)?void 0:gt.map(function(zt,Dt){if(zt.question_type===nt){var rn,Ht;return L.a.createElement("li",{onClick:function(){var Tn;if(!Kr&&(xe==null||((Tn=xe.exercise)===null||Tn===void 0)?void 0:Tn.user_exercise_status)===0&&Object(we.s)()){var Yn,ln,Dn,xn;if(!((Yn=xe.exercise_question_types)!==null&&Yn!==void 0&&(ln=Yn[En])!==null&&ln!==void 0&&(Dn=ln.items)!==null&&Dn!==void 0&&(xn=Dn[Rn])!==null&&xn!==void 0&&xn.repeat_answer)){cr(!0),nr(3),Ua({oneindex:Fe,twoindex:Dt});return}}yr(Fe),br(Dt);var Hn="Anchor_".concat(nt,"_").concat(Dt),Nn=document.getElementById(Hn);Nn&&setTimeout(function(){return Nn.scrollIntoView({block:"start",behavior:"smooth"})})},key:Dt,className:(xe==null||((rn=xe.question_status)===null||rn===void 0)?void 0:rn.some(function(Mt){return Mt.ques_id===zt.question_id&&(Mt==null?void 0:Mt.ques_status)===1}))&&oe.a.active},Dt+1,(xe==null||((Ht=xe.question_status)===null||Ht===void 0)?void 0:Ht.some(function(Mt){return Mt.ques_id===zt.question_id&&(Mt==null?void 0:Mt.ques_status)===2}))&&L.a.createElement("div",{style:{height:3,background:"#0152d9",position:"absolute",width:26,bottom:0}}))}}))))},zr=function(ue,nt){var Fe,wt,gt,Nt,zt,Dt,rn,Ht,Mt,Tn=(ue==null?void 0:ue.question_type)==5?ue==null?void 0:ue.shixun_name:ue==null?void 0:ue.question_title,Yn="",ln=(ue==null?void 0:ue.question_type)===0||(ue==null?void 0:ue.question_type)===1;if(ln){var Dn;ue==null||((Dn=ue.question_choices)===null||Dn===void 0)||Dn.forEach(function(xn,Hn){xn.standard_boolean&&(Yn=Yn+le[Hn])})}return L.a.createElement("div",{className:oe.a.questionItem,id:"Anchor_".concat(ue==null?void 0:ue.question_type,"_").concat(nt)},L.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},L.a.createElement("span",{style:{flexShrink:0},className:"font18"},nt+1,"."),L.a.createElement(ze.a,{value:ue==null?void 0:ue.question_title}),L.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ue==null?void 0:ue.question_score,"\u5206\uFF09",(ue==null?void 0:ue.question_type)===7?"\u5171".concat(ue==null||((Fe=ue.sub_exercise_questions)===null||Fe===void 0)?void 0:Fe.length,"\u5C0F\u9898"):""," "),!(ue!=null&&ue.repeat_answer)&&L.a.createElement("span",{style:{color:"#FA6400 ",marginLeft:10,fontSize:16}},"\u6CE8\u610F\uFF1A\u8BE5\u9898\u4E0D\u5141\u8BB8\u91CD\u590D\u7B54\u9898"),!!(ue!=null&&(wt=ue.schools)!==null&&wt!==void 0&&wt.length)&&L.a.createElement(m.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},L.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 line24 font18 c-orange"}))),(ue==null?void 0:ue.question_type)==0&&Ro(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==2&&Ro(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==1&&Ga(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==3&&Ir(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==4&&Gr(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==5&&Jo(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==6&&ca(ue,ue==null?void 0:ue.question_type),(ue==null?void 0:ue.question_type)==7&&Ka(ue,ue==null?void 0:ue.question_type,nt),!!(ue!=null&&(gt=ue.answer_comments)!==null&&gt!==void 0&&gt.length)&&L.a.createElement("div",{className:"mt30"},ue==null||((Nt=ue.answer_comments)===null||Nt===void 0)?void 0:Nt.map(function(xn,Hn){var Nn,Qi;return xn.comment?L.a.createElement("div",null,L.a.createElement(F.a,{align:"middle",gutter:[0,10]},L.a.createElement(T.a,{flex:"50px"},L.a.createElement("img",{src:mt.a.API_SERVER+"/images/"+((Nn=xn.user)===null||Nn===void 0?void 0:Nn.image_url),width:"40",style:{borderRadius:40}})),L.a.createElement(T.a,{flex:"1"},(Qi=xn.user)===null||Qi===void 0?void 0:Qi.name,L.a.createElement("br",null),xn.updated_at)),L.a.createElement(F.a,{align:"middle",gutter:[0,10]},L.a.createElement(T.a,{flex:"50px"}),L.a.createElement(T.a,{flex:"1"},L.a.createElement(He,{autoSize:!0,value:xn.comment,disabled:!0})))):null})),L.a.createElement("div",{className:oe.a.itemType},L.a.createElement(F.a,null,L.a.createElement(T.a,{flex:"1"}),L.a.createElement(T.a,null,(ue==null?void 0:ue.question_type)<3&&(ue==null?void 0:ue.standard_answer_show)&&L.a.createElement("span",{className:"font16 ml20"},"\u6B63\u786E\u7B54\u6848\uFF1A",ln?Yn:ue==null?void 0:ue.standard_answer_show),(Object(we.c)()||Object(we.s)()&&(xe==null||((zt=xe.exercise)===null||zt===void 0)?void 0:zt.user_exercise_status)>0&&(xe==null||((Dt=xe.exercise)===null||Dt===void 0)?void 0:Dt.open_score))&&L.a.createElement("span",{className:"font16 ml20"},(ue==null?void 0:ue.user_score)&&L.a.createElement("span",null,L.a.createElement("span",{className:be[Number(ue==null?void 0:ue.answer_status)]||"c-orange-ff9"},ue==null?void 0:ue.user_score)," \u5206"),!(ue!=null&&ue.user_score)&&L.a.createElement("span",{className:"c-red"},"\u672A\u8BC4")),(ue==null?void 0:ue.question_type)==5&&(xe==null||((rn=xe.exercise)===null||rn===void 0)?void 0:rn.user_exercise_status)===0&&(ue==null?void 0:ue.answer_status)!=3&&L.a.createElement(D.a,{type:"primary",className:"font16 ml20",onClick:function(){return la(ue)}},"\u8FDB\u5165\u7B54\u9898"),Object(we.s)()&&(xe==null||((Ht=xe.exercise)===null||Ht===void 0)?void 0:Ht.user_exercise_status)===0&&(ue==null?void 0:ue.question_type)==6&&L.a.createElement(D.a,{type:"primary",className:"font16 ml20",onClick:function(){return Yo(ue)}},"\u8FDB\u5165\u7B54\u9898"))),(ue==null?void 0:ue.question_type)<=4&&((ue==null?void 0:ue.standard_answer_show)||(ue==null||((Mt=ue.standard_answer)===null||Mt===void 0)?void 0:Mt.length)>0)&&L.a.createElement(F.a,{style:{marginTop:14}},L.a.createElement("span",{className:"font16 ml20"},"\u89E3\u6790\uFF1A"),L.a.createElement(ze.a,{className:oe.a.renderHtml,value:ue==null?void 0:ue.analysis}))))},Io=function(ue,nt){return L.a.createElement(U.Fragment,null,ue.question_type===0&&rr("\u5355\u9009\u9898",0,nt),ue.question_type===1&&rr("\u591A\u9009\u9898",1,nt),ue.question_type===2&&rr("\u5224\u65AD\u9898",2,nt),ue.question_type===3&&rr("\u586B\u7A7A\u9898",3,nt),ue.question_type===4&&rr("\u7B80\u7B54\u9898",4,nt),ue.question_type===5&&rr("\u5B9E\u8BAD\u9898",5,nt),ue.question_type===6&&rr("\u7F16\u7A0B\u9898",6,nt),ue.question_type===7&&rr("\u7EC4\u5408\u9898",7,nt))},Cr=function(ue){var nt=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],Fe=["","\u5341","\u767E","\u5343","\u4E07"];ue=parseInt(ue);var wt=function(Dt){for(var rn=Dt.toString().split("").reverse(),Ht="",Mt=0;Mt<rn.length;Mt++)Ht=(Mt==0&&rn[Mt]==0||Mt>0&&rn[Mt]==0&&rn[Mt-1]==0?"":nt[rn[Mt]]+(rn[Mt]==0?Fe[0]:Fe[Mt]))+Ht;return Ht},gt=Math.floor(ue/1e4),Nt=ue%1e4;return Nt.toString().length<4&&(Nt="0"+Nt),gt?wt(gt)+"\u4E07"+wt(Nt):wt(ue)},Vr=function(){var ue,nt,Fe,wt,gt,Nt,zt,Dt,rn,Ht,Mt,Tn;return L.a.createElement(U.Fragment,{key:En},L.a.createElement("div",{className:"pt20"},L.a.createElement("span",{className:"font16 c-light-primary"},Cr(En+1),"\u3001",xe==null||((ue=xe.exercise_question_types)===null||ue===void 0||((nt=ue[En])===null||nt===void 0))?void 0:nt.name),L.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",xe==null||((Fe=xe.exercise_question_types)===null||Fe===void 0||((wt=Fe[En])===null||wt===void 0))?void 0:wt.count,"\u9898\uFF1B",(xe==null||((gt=xe.exercise_question_types)===null||gt===void 0||((Nt=gt[En])===null||Nt===void 0))?void 0:Nt.question_type)===7?"\u5305\u542B".concat(xe==null||((zt=xe.exercise_question_types)===null||zt===void 0||((Dt=zt[En])===null||Dt===void 0))?void 0:Dt.sub_questions_count,"\u5C0F\u9898"):""," \u5171",xe==null||((rn=xe.exercise_question_types)===null||rn===void 0||((Ht=rn[En])===null||Ht===void 0))?void 0:Ht.score,"\u5206\uFF09")),L.a.createElement(U.Fragment,{key:Rn},zr(xe==null||((Mt=xe.exercise_question_types)===null||Mt===void 0||((Tn=Mt[En].items)===null||Tn===void 0))?void 0:Tn[Rn],Rn)))};return L.a.createElement(s.a,{size:"large",spinning:lr},ai&&(xe==null||((ct=xe.exercise)===null||ct===void 0)?void 0:ct.user_exercise_status)===0&&L.a.createElement(pe.a,{exerciseUserInfo:Ui.exerciseUserInfo,iframe:Xi,socket:Hr}),L.a.createElement("iframe",{style:{display:Ra},id:"iframeShixuns",className:oe.a.iframe,src:dr,ref:Xi,frameBorder:"0"}),L.a.createElement("section",{className:"edu-container ".concat(Ci&&oe.a.wrpAnswer)},L.a.createElement("section",{className:"animated fadeIn ".concat(Ci&&oe.a.eduTitle)},L.a.createElement("aside",{className:"mt10"},Object(De.r)()&&L.a.createElement(V.a,{separator:">"},L.a.createElement(V.a.Item,null,L.a.createElement(A.a,{to:"/"},"\u8BD5\u5377")),L.a.createElement(V.a.Item,null,(Ct=$n.userInfo)===null||Ct===void 0?void 0:Ct.real_name)),!Object(De.r)()&&zi.showHeaderFooter&&L.a.createElement(V.a,{separator:">"},L.a.createElement(V.a.Item,null,L.a.createElement(A.a,{to:"/classrooms/".concat(Ft.coursesId,"/exercise")},(lt=$n.userInfo)===null||lt===void 0||((jt=lt.course)===null||jt===void 0)?void 0:jt.course_name)),L.a.createElement(V.a.Item,null,L.a.createElement(A.a,{to:"/classrooms/".concat(Ft.coursesId,"/exercise")},"\u8BD5\u5377")),L.a.createElement(V.a.Item,null,L.a.createElement(A.a,{to:"/classrooms/".concat(Ft.coursesId,"/exercise/").concat(Ft.categoryId,"/detail")},"\u8BD5\u5377\u8BE6\u60C5")),L.a.createElement(V.a.Item,null,(qt=$n.userInfo)===null||qt===void 0?void 0:qt.real_name))),L.a.createElement("aside",{className:[oe.a.title,"mt10"].join(" ")},L.a.createElement(F.a,{style:{width:"100%",flexFlow:"nowrap"},align:"middle"},L.a.createElement(T.a,{style:{flex:"1"}},L.a.createElement("div",{className:oe.a.title},(zi==null?void 0:zi.showHeaderFooter)&&L.a.createElement(A.a,{to:Object(De.r)()?"/":"/classrooms/".concat(Ft.coursesId,"/exercise/").concat(Ft.categoryId,"/detail")},L.a.createElement(Ae.a,{className:"font16 c-black"})),Object(De.A)(xe==null||((Ot=xe.exercise)===null||Ot===void 0)?void 0:Ot.exercise_status),L.a.createElement("strong",{className:"font24 ml5"},xe==null||((Zt=xe.exercise)===null||Zt===void 0)?void 0:Zt.exercise_name))),L.a.createElement(T.a,{style:{display:"flex"}},Object(we.c)()&&L.a.createElement(D.a,{type:"primary",onClick:fr},"\u6253\u56DE\u91CD\u505A"),L.a.createElement(T.a,null,((xe==null||((un=xe.exercise)===null||un===void 0)?void 0:un.commit_status)==2||(xe==null||((sn=xe.exercise)===null||sn===void 0)?void 0:sn.commit_status)==1)&&Object(we.c)()&&!Object(De.r)()&&L.a.createElement(D.a,{className:"ml10",type:"primary",onClick:function(){return X.d.push("/classrooms/".concat(Ft.coursesId,"/exercise/").concat(Ft.categoryId,"/export/").concat(Ft.login))}},L.a.createElement(Pe.a,null),"\u5BFC\u51FA")),!(Object(we.c)()||Object(we.s)()&&(xe==null||((Xt=xe.exercise)===null||Xt===void 0)?void 0:Xt.user_exercise_status)==1)&&!!(xe!=null&&(mn=xe.exercise)!==null&&mn!==void 0&&mn.left_time)&&L.a.createElement("aside",{className:"".concat(oe.a.countDown," ").concat(Go)},L.a.createElement("div",null,"\u5269\u4F59\u65F6\u95F4:",L.a.createElement($e,{value:Vn,onFinish:Fa})),L.a.createElement(D.a,{className:"ml10",type:"primary",onClick:Fa,ghost:!0},L.a.createElement("span",{className:"iconfont icon-shuaxin2 mr5"}),"\u5237\u65B0")),Object(we.s)()&&(xe==null||((kn=xe.exercise)===null||kn===void 0)?void 0:kn.user_exercise_status)===0&&L.a.createElement("aside",{className:Ci?oe.a.eduSubmit:""},L.a.createElement(D.a,{style:{width:"60px",height:"28px",marginLeft:10},type:"primary",onClick:function(){return Ao(!1)}},"\u4EA4\u5377")))))),gr.status===0&&L.a.createElement(F.a,{className:"".concat(Ci?"mt70":"mt10"," ").concat(oe.a.answerWrp)},L.a.createElement(T.a,{flex:Gt?"316px":"16px",className:Ci?"mb100":""},L.a.createElement("section",{style:{position:"sticky",top:0,zIndex:1}},!Ci&&vn&&L.a.createElement(Ie.a,{id:Ft.categoryId,number:(xe==null||((Un=xe.exercise)===null||Un===void 0)?void 0:Un.photo_count)-(xe==null||((ft=xe.exercise)===null||ft===void 0)?void 0:ft.take_photo),take_photo:xe==null||((Wt=xe.exercise)===null||Wt===void 0)?void 0:Wt.take_photo,ref:ra,time:(Qt=xe.exercise)===null||Qt===void 0?void 0:Qt.left_time,update:Zn,supportCamera:function(ue){ue===2?(Zn(),Yi(!0),hn(gn==null?void 0:gn.screen_open)):ue===1&&setTimeout(function(){return Ln.history.push("/")},3e3)}}),L.a.createElement("div",{className:"relative",style:{minHeight:236}},Ci&&L.a.createElement("section",null,vn&&L.a.createElement("div",{className:oe.a.eduVideo},L.a.createElement(Ie.a,{id:Ft.categoryId,number:(xe==null||(($t=xe.exercise)===null||$t===void 0)?void 0:$t.photo_count)-(xe==null||((en=xe.exercise)===null||en===void 0)?void 0:en.take_photo),take_photo:xe==null||((fn=xe.exercise)===null||fn===void 0)?void 0:fn.take_photo,ref:ra,time:(Y=xe.exercise)===null||Y===void 0?void 0:Y.left_time,update:Zn,supportCamera:function(ue){ue===2?(Zn(),Yi(!0),hn(gn==null?void 0:gn.screen_open)):ue===1&&setTimeout(function(){return Ln.history.push("/")},3e3)}})),Gt&&L.a.createElement(F.a,{className:oe.a.eduUsername,style:{background:"#fff",padding:"16px 20px"}},L.a.createElement(T.a,null,"\u59D3\u540D\uFF1A",(xe==null||((C=xe.exercise)===null||C===void 0)?void 0:C.user_name)||"- -"),L.a.createElement(T.a,null,L.a.createElement(z.a,{style:{margin:"0 25px"},type:"vertical"})),L.a.createElement(T.a,null,"\u5B66\u53F7\uFF1A",(xe==null||((M=xe.exercise)===null||M===void 0)?void 0:M.student_id)||"- -")),L.a.createElement("div",{className:oe.a.eduTip},L.a.createElement("div",{className:"c-grey-666 tc"},"\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u5982\u9047\u95EE\u9898\uFF0C\u8BF7\u62E8\u6253\u4EE5\u4E0B\u7535\u8BDD"),L.a.createElement("div",{className:"font16 tc blod"},"010-62781166"),L.a.createElement("div",{className:"font16 tc blod"},"010-62799826"),L.a.createElement("div",{className:"font16 tc blod"},"18910624893"),L.a.createElement("div",{className:"font16 tc blod"},"13366506792")),Object(we.s)()&&L.a.createElement(F.a,{className:oe.a.eduQrcode,align:"middle"},L.a.createElement(T.a,null,L.a.createElement(se.a,{value:"https://".concat(document.domain,"/live-push.html?id=").concat(Ft.categoryId,"&login=").concat(Ft.login,"&cookie=").concat(Object(De.F)("_educoder_session"))})),L.a.createElement(T.a,{className:"ml15"},"\u6253\u5F00\u5FAE\u4FE1\u626B\u4E00\u626B",L.a.createElement("br",null),"\u5F00\u542F\u624B\u673A\u89C6\u9891\u5F55\u5236"))),!Ci&&L.a.createElement("section",null,Gt&&L.a.createElement(T.a,{flex:"1",style:{background:"#fff",height:"90px",marginBottom:"10px",padding:"16px 20px"}},L.a.createElement("p",null,"\u59D3\u540D\uFF1A",(xe==null||((G=xe.exercise)===null||G===void 0)?void 0:G.user_name)||"- -"),L.a.createElement("p",null,"\u5B66\u53F7\uFF1A",(xe==null||((te=xe.exercise)===null||te===void 0)?void 0:te.student_id)||"- -")),Object(we.s)()&&((Q=xe.exercise)===null||Q===void 0?void 0:Q.user_exercise_status)===0&&((Se=xe.exercise)===null||Se===void 0?void 0:Se.open_phone_video_recording)&&L.a.createElement(F.a,{className:oe.a.eduQrcode,style:{marginTop:10},align:"middle"},L.a.createElement(T.a,null,L.a.createElement(se.a,{value:"https://".concat(document.domain,"/live-push.html?id=").concat(Ft.categoryId,"&login=").concat(Ft.login,"&cookie=").concat(Object(De.F)("_educoder_session"))})),L.a.createElement(T.a,{className:"ml15"},"\u6253\u5F00\u5FAE\u4FE1\u626B\u4E00\u626B",L.a.createElement("br",null),"\u5F00\u542F\u624B\u673A\u89C6\u9891\u5F55\u5236")),(xe==null||((ot=xe.exercise)===null||ot===void 0||((St=ot.exercise_description)===null||St===void 0))?void 0:St.length)>0&&Gt&&L.a.createElement(T.a,{flex:"1",style:{background:"#fff",marginBottom:"10px",padding:"16px 20px"}},L.a.createElement("p",{style:{fontWeight:500}},"\u8003\u8BD5\u987B\u77E5"),L.a.createElement("p",null,xe==null||((Pt=xe.exercise)===null||Pt===void 0)?void 0:Pt.exercise_description)),Gt&&L.a.createElement("aside",{className:"bg-white p16 mt10"},L.a.createElement(F.a,null,L.a.createElement(T.a,{span:8},L.a.createElement("span",{className:"font16 blod"},"\u7B54\u9898\u5361")),L.a.createElement(T.a,{span:16},Object(we.s)()&&L.a.createElement("div",{className:"tr",style:{display:"flex",alignItems:"center",justifyContent:"end"}},L.a.createElement("span",{className:oe.a.answerYes}),"\u5DF2\u7B54",L.a.createElement("span",{style:{width:13,height:13,display:"flex",flexDirection:"column-reverse"},className:"".concat(oe.a.answerNo," ml10")},L.a.createElement("div",{style:{height:"10%",background:"#0152d9"}})),"\u90E8\u5206\u7B54\u9898",L.a.createElement("span",{className:"".concat(oe.a.answerNo," ml10")}),"\u672A\u7B54"))),L.a.createElement("aside",{className:oe.a.answerInfo},L.a.createElement(F.a,null,Object(we.s)()&&L.a.createElement(L.a.Fragment,null,L.a.createElement(T.a,{span:12},"\u7B54\u9898\u8FDB\u5EA6"),L.a.createElement(T.a,{span:12,className:"tr c-blue"},xe==null||((ut=xe.question_status)===null||ut===void 0||((Vt=ut.filter(function(kt){return!!kt.ques_status}))===null||Vt===void 0))?void 0:Vt.length," / ",xe==null||((tn=xe.exercise_types)===null||tn===void 0)?void 0:tn.q_counts),L.a.createElement(T.a,{span:24},L.a.createElement(h.a,{trailColor:"#c3ced2",percent:(xe==null||((Sn=xe.question_status)===null||Sn===void 0||((wn=Sn.filter(function(kt){return!!kt.ques_status}))===null||wn===void 0))?void 0:wn.length)/(xe==null||((_n=xe.exercise_types)===null||_n===void 0)?void 0:_n.q_counts)*100,showInfo:!1}))),L.a.createElement(T.a,null,L.a.createElement("span",{className:"c-grey-333"},"\u5171 ",L.a.createElement("span",{className:"c-blue-4ca"},(xe==null||((Fn=xe.exercise_types)===null||Fn===void 0)?void 0:Fn.q_counts)||(xe==null||((mi=xe.exercise_scores)===null||mi===void 0||((ki=mi.exercise_types)===null||ki===void 0))?void 0:ki.q_counts))," \u9898\uFF1A"),L.a.createElement("span",{className:"c-grey-333"},"\u6EE1\u5206 ",L.a.createElement("span",{className:"c-blue-4ca"},(xe==null||((Kn=xe.exercise_types)===null||Kn===void 0)?void 0:Kn.q_scores)||(xe==null||((si=xe.exercise_scores)===null||si===void 0||((Ai=si.exercise_types)===null||Ai===void 0))?void 0:Ai.q_scores))," \u5206")))),L.a.createElement(F.a,null,L.a.createElement(T.a,{flex:"1"},L.a.createElement("aside",{className:oe.a.cardList},xe==null||((_i=xe.exercise_question_types)===null||_i===void 0)?void 0:_i.map(function(kt,ue){return L.a.createElement(U.Fragment,{key:kt.question_type},Io(kt,ue))}))))),L.a.createElement("div",{className:oe.a.fold,onClick:function(){return an(!Gt)}},Gt&&L.a.createElement("span",{className:"icon-zuojiantou iconfont c-grey-c"}),!Gt&&L.a.createElement("span",{className:"icon-youjiantou iconfont c-grey-c"})))))),L.a.createElement(T.a,{flex:"1"},L.a.createElement("section",{style:{minHeight:400,position:"relative"},className:[oe.a.bg,"pl30","pb30","mb50","ml20"].join(" ")},L.a.createElement("div",{style:{maxHeight:600,overflow:"hidden auto",paddingRight:30}},Vr()),L.a.createElement("div",{style:{marginTop:60,textAlign:"center",paddingRight:30}},(En!=0||Rn!=0)&&L.a.createElement(D.a,{className:"".concat(oe.a.submitButton," mr10"),type:"default",onClick:function(){var ue;if(!Kr&&(xe==null||((ue=xe.exercise)===null||ue===void 0)?void 0:ue.user_exercise_status)===0&&Object(we.s)()){var nt,Fe,wt,gt;if(!((nt=xe.exercise_question_types)!==null&&nt!==void 0&&(Fe=nt[En])!==null&&Fe!==void 0&&(wt=Fe.items)!==null&&wt!==void 0&&(gt=wt[Rn])!==null&&gt!==void 0&&gt.repeat_answer)){cr(!0),nr(1);return}}xe.exercise_question_types[En].items[Rn].israp=!1,dn(Object(x.a)({},xe)),Rn===0?(En-=1,Rn=xe.exercise_question_types[En].items.length-1):Rn-=1,yr(En),br(Rn)}},"\u4E0A\u4E00\u9898"),!(En===(xe==null||((ni=xe.exercise_question_types)===null||ni===void 0)?void 0:ni.length)-1&&Rn===(xe==null||((Ki=xe.exercise_question_types)===null||Ki===void 0||((Pi=Ki[En])===null||Pi===void 0||((Gi=Pi.items)===null||Gi===void 0)))?void 0:Gi.length)-1)&&L.a.createElement(D.a,{className:oe.a.submitButton,type:"primary",onClick:function(){var ue;if(!Kr&&(xe==null||((ue=xe.exercise)===null||ue===void 0)?void 0:ue.user_exercise_status)===0&&Object(we.s)()){var nt,Fe,wt,gt;if(!((nt=xe.exercise_question_types)!==null&&nt!==void 0&&(Fe=nt[En])!==null&&Fe!==void 0&&(wt=Fe.items)!==null&&wt!==void 0&&(gt=wt[Rn])!==null&&gt!==void 0&&gt.repeat_answer)){cr(!0),nr(2);return}}xe.exercise_question_types[En].items[Rn].israp=!1,dn(Object(x.a)({},xe)),xe.exercise_question_types[En].items.length-1===Rn?(En=En+1,Rn=0):Rn=Rn+1,yr(En),br(Rn)}},"\u4E0B\u4E00\u9898"))))),gr.status!==0&&L.a.createElement(Tt,{data:gr}),L.a.createElement(_.a,{title:"\u6CE8\u610F",visible:xo,onCancel:function(){return cr(!1)},footer:!1},L.a.createElement("div",null,L.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"),L.a.createElement("div",{style:{marginTop:60,display:"flex",justifyContent:"space-between"}},L.a.createElement(d.a,{checked:Kr,onChange:function(ue){Na(ue.target.checked)}},"\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"),L.a.createElement("div",null,L.a.createElement(D.a,{onClick:function(){xe.exercise_question_types[En].items[Rn].israp?(xe.exercise_question_types[En].items[Rn].israp=!0,dn(Object(x.a)({},xe))):xe.exercise_question_types[En].items[Rn].israp===""&&(xe.exercise_question_types[En].items[Rn].israp=!0,dn(Object(x.a)({},xe))),cr(!1)}},"\u6211\u518D\u60F3\u60F3"),L.a.createElement(D.a,{onClick:function(){xe.exercise_question_types[En].items[Rn].israp=!1,dn(Object(x.a)({},xe)),Co===1?(Rn===0?(En-=1,Rn=xe.exercise_question_types[En].items.length-1):Rn-=1,yr(En),br(Rn)):Co===2?(xe.exercise_question_types[En].items.length-1===Rn?(En=En+1,Rn=0):Rn=Rn+1,yr(En),br(Rn)):(yr(oa.oneindex),br(oa.twoindex)),cr(!1)},type:"primary",style:{marginLeft:30}},"\u786E\u8BA4")))))))},bt=Me.default=Object(X.a)(function(pt){var Ee=pt.loading,Be=pt.user,st=pt.exercise,ct=pt.globalSetting;return{globalSetting:ct,user:Be,exercise:st,loading:Ee.effects}})(Ye)},Nmxd:function(Ke,Me){Ke.exports="data:image/png;base64,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"},NvD2:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return D});var q=K("Kwbf");function z(H,F){var k=new Set;return H.forEach(function(T){F.has(T)||k.add(T)}),k}function N(H){var F=H||{},k=F.disabled,T=F.disableCheckbox,v=F.checkable;return!!(k||T)||v===!1}function V(H,F,k,T){for(var v=new Set(H),m=new Set,c=0;c<=k;c+=1){var d=F.get(c)||new Set;d.forEach(function(a){var l=a.key,h=a.node,I=a.children,w=I===void 0?[]:I;v.has(l)&&!T(h)&&w.filter(function(x){return!T(x.node)}).forEach(function(x){v.add(x.key)})})}for(var r=new Set,s=k;s>=0;s-=1){var o=F.get(s)||new Set;o.forEach(function(a){var l=a.parent,h=a.node;if(T(h)||!a.parent||r.has(a.parent.key))return;if(T(a.parent.node)){r.add(l.key);return}var I=!0,w=!1;(l.children||[]).filter(function(x){return!T(x.node)}).forEach(function(x){var O=x.key,S=v.has(O);I&&!S&&(I=!1),!w&&(S||m.has(O))&&(w=!0)}),I&&v.add(l.key),w&&m.add(l.key),r.add(l.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(z(m,v))}}function W(H,F,k,T,v){for(var m=new Set(H),c=new Set(F),d=0;d<=T;d+=1){var r=k.get(d)||new Set;r.forEach(function(l){var h=l.key,I=l.node,w=l.children,x=w===void 0?[]:w;!m.has(h)&&!c.has(h)&&!v(I)&&x.filter(function(O){return!v(O.node)}).forEach(function(O){m.delete(O.key)})})}c=new Set;for(var s=new Set,o=T;o>=0;o-=1){var a=k.get(o)||new Set;a.forEach(function(l){var h=l.parent,I=l.node;if(v(I)||!l.parent||s.has(l.parent.key))return;if(v(l.parent.node)){s.add(h.key);return}var w=!0,x=!1;(h.children||[]).filter(function(O){return!v(O.node)}).forEach(function(O){var S=O.key,_=m.has(S);w&&!_&&(w=!1),!x&&(_||c.has(S))&&(x=!0)}),w||m.delete(h.key),x&&c.add(h.key),s.add(h.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(z(c,m))}}function D(H,F,k,T){var v=[],m;T?m=T:m=N;var c=new Set(H.filter(function(o){var a=!!k[o];return a||v.push(o),a})),d=new Map,r=0;Object.keys(k).forEach(function(o){var a=k[o],l=a.level,h=d.get(l);h||(h=new Set,d.set(l,h)),h.add(a),r=Math.max(r,l)}),Object(q.a)(!v.length,"Tree missing follow keys: ".concat(v.slice(0,100).map(function(o){return"'".concat(o,"'")}).join(", ")));var s;return F===!0?s=V(c,d,r,m):s=W(c,F.halfCheckedKeys,d,r,m),s}},OLES:function(Ke,Me,K){"use strict";var q=K("U8pU"),z=K("VTBJ"),N=K("Ff2n"),V=K("q1tI"),W=K("uciX"),D=K("7ixt"),H=function(c){var d=c.overlay,r=c.prefixCls,s=c.id,o=c.overlayInnerStyle;return V.createElement("div",{className:"".concat(r,"-inner"),id:s,role:"tooltip",style:o},typeof d=="function"?d():d)},F=H,k=function(c,d){var r=c.overlayClassName,s=c.trigger,o=s===void 0?["hover"]:s,a=c.mouseEnterDelay,l=a===void 0?0:a,h=c.mouseLeaveDelay,I=h===void 0?.1:h,w=c.overlayStyle,x=c.prefixCls,O=x===void 0?"rc-tooltip":x,S=c.children,_=c.onVisibleChange,g=c.afterVisibleChange,f=c.transitionName,u=c.animation,E=c.placement,b=E===void 0?"right":E,y=c.align,P=y===void 0?{}:y,R=c.destroyTooltipOnHide,U=R===void 0?!1:R,L=c.defaultVisible,j=c.getTooltipContainer,A=c.overlayInnerStyle,X=Object(N.a)(c,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ee=Object(V.useRef)(null);Object(V.useImperativeHandle)(d,function(){return ee.current});var se=Object(z.a)({},X);"visible"in c&&(se.popupVisible=c.visible);var ce=function(){var Ie=c.arrowContent,pe=Ie===void 0?null:Ie,de=c.overlay,ne=c.id;return[V.createElement("div",{className:"".concat(O,"-arrow"),key:"arrow"},pe),V.createElement(F,{key:"content",prefixCls:O,id:ne,overlay:de,overlayInnerStyle:A})]},Le=!1,Ce=!1;if(typeof U=="boolean")Le=U;else if(U&&Object(q.a)(U)==="object"){var Ae=U.keepParent;Le=Ae===!0,Ce=Ae===!1}return V.createElement(W.a,Object.assign({popupClassName:r,prefixCls:O,popup:ce,action:o,builtinPlacements:D.a,popupPlacement:b,ref:ee,popupAlign:P,getPopupContainer:j,onPopupVisibleChange:_,afterPopupVisibleChange:g,popupTransitionName:f,popupAnimation:u,defaultPopupVisible:L,destroyPopupOnHide:Le,autoDestroy:Ce,mouseLeaveDelay:I,popupStyle:w,mouseEnterDelay:l},se),S)},T=Object(V.forwardRef)(k),v=Me.a=T},OZM5:function(Ke,Me,K){"use strict";K.d(Me,"b",function(){return T}),K.d(Me,"a",function(){return v}),K.d(Me,"k",function(){return m}),K.d(Me,"h",function(){return c}),K.d(Me,"i",function(){return d}),K.d(Me,"g",function(){return r}),K.d(Me,"c",function(){return s}),K.d(Me,"d",function(){return o}),K.d(Me,"j",function(){return h}),K.d(Me,"e",function(){return I}),K.d(Me,"f",function(){return w});var q=K("KQm4"),z=K("U8pU"),N=K("Ff2n"),V=K("q1tI"),W=K.n(V),D=K("Kwbf"),H=K("WaYH"),F=.25,k=2;function T(x,O){var S=x.slice(),_=S.indexOf(O);return _>=0&&S.splice(_,1),S}function v(x,O){var S=x.slice();return S.indexOf(O)===-1&&S.push(O),S}function m(x){return x.split("-")}function c(x,O){return"".concat(x,"-").concat(O)}function d(x){return x&&x.type&&x.type.isTreeNode}function r(x,O){var S=[x],_=O[x];function g(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(u){var E=u.key,b=u.children;S.push(E),g(b)})}return g(_.children),S}function s(x,O){var S=x.clientY,_=O.selectHandle.getBoundingClientRect(),g=_.top,f=_.bottom,u=_.height,E=Math.max(u*F,k);return S<=g+E?-1:S>=f-E?1:0}function o(x,O){if(!x)return;var S=O.multiple;return S?x.slice():x.length?[x[0]]:x}var a=function(O){return O};function l(x,O){if(!x)return[];var S=O||{},_=S.processProps,g=_===void 0?a:_,f=Array.isArray(x)?x:[x];return f.map(function(u){var E=u.children,b=Object(N.a)(u,["children"]),y=l(E,O);return W.a.createElement(H.a,Object.assign({},g(b)),y)})}function h(x){if(!x)return null;var O;if(Array.isArray(x))O={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(z.a)(x)==="object")O={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(D.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function I(x,O){var S=new Set;function _(g){if(S.has(g))return;var f=O[g];if(!f)return;S.add(g);var u=f.parent,E=f.node;if(E.disabled)return;u&&_(u.key)}return(x||[]).forEach(function(g){_(g)}),Object(q.a)(S)}function w(x){var O={};return Object.keys(x).forEach(function(S){(S.startsWith("data-")||S.startsWith("aria-"))&&(O[S]=x[S])}),O}},Ohmc:function(Ke,Me,K){Ke.exports=K.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ke,Me,K){"use strict";var q=K("2qtc"),z=K("kLXV"),N=K("rAM+"),V=K("miYZ"),W=K("tsqr"),D=K("9og8"),H=K("tJVT"),F=K("jrin"),k=K("WmNS"),T=K.n(k),v=K("q1tI"),m=K.n(v),c=K("VrN/"),d=K.n(c),r=K("bdgK"),s=K("p77/"),o=K("Bd2K"),a=K("ELLl"),l=K("19Vz"),h=K("lZu9"),I=K("+NIl"),w=K("kSUc"),x=K("9Bee"),O=function(_e){var je=_e.value,at=je===void 0?"":je,Et=_e.className,Lt=_e.showTextOnly,Tt=_e.showLines,mt=_e.style,Ze=mt===void 0?{}:mt,$e=Object(v.useMemo)(function(){return""},[at]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:$e}}))},S=K("0Owb"),_=K("dejd"),g=K("C+DQ"),f=K("1vsH"),u=K("m3rI"),E=[{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(_e){var je=_e.onActionCallback,at=_e.title,Et=_e.icon,Lt=_e.actionName,Tt=_e.className,mt=Tt===void 0?"":Tt,Ze=_e.children;function $e(){je(Lt)}return m.a.createElement("a",{title:at,className:mt,onClick:$e},m.a.createElement("i",{className:"md-iconfont ".concat(Et)}),Ze)}var y=function(_e){var je=_e.watch,at=_e.showNullButton,Et=_e.onActionCallback,Lt=_e.fullScreen,Tt=_e.insertTemp,mt=_e.hidetoolBar,Ze=_e.uuid,$e=_e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.F)("_educoder_session"),"&key=").concat(Ze,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var He=[].concat(E,[{title:"".concat(je?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(je?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!mt&&He.map(function(le,be){return m.a.createElement("li",{key:be},le.actionName?m.a.createElement(b,Object(S.a)({},le,{onActionCallback:Et})):m.a.createElement("span",{className:"v-line"}))}),at?m.a.createElement("li",null,m.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Et},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Tt&&m.a.createElement("li",null,m.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Tt),onActionCallback:Et},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(b,{icon:"".concat(Lt?"icon-shrink":"icon-enlarge"),title:Lt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Et})))},P=K("M8RZ"),R=K("+L6B"),U=K("2/Rp"),L=K("y8nQ"),j=K("Vl3Y"),A=K("5NDa"),X=K("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},se=function(_e){var je=_e.callback,at=_e.onCancel;function Et(Lt){je(Lt)}return m.a.createElement(j.a,Object(S.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Et}),m.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(X.a,null)),m.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(X.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(U.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},ce=K("7ahc"),Le=K("HmJG"),Ce=K("BjJ7"),Ae=j.a.useForm,Pe={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},pe=function(_e){var je=_e.callback,at=_e.onCancel,Et=Ae(),Lt=Object(H.a)(Et,1),Tt=Lt[0];function mt(He){je(He)}function Ze(He,le){if(He.status===-1){W.b.error(He.message);return}Tt.setFieldsValue({src:"/api/attachments/".concat(He.id),type:le.type})}function $e(He){var le=He.target.files[0];ne(le,Ze)}return m.a.createElement(j.a,Object(S.a)({form:Tt},Ie,{className:"upload-image-panel",onFinish:mt}),m.a.createElement(j.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(j.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(X.a,{style:Pe})),m.a.createElement(de,{onFileChange:$e}))),m.a.createElement(j.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(X.a,{style:{width:264}})),m.a.createElement(j.a.Item,{style:{textAlign:"right"}},m.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(U.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))};function de(_e){var je=_e.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:je}))}function ne(_e,je){if(!_e)throw new String("\u6CA1\u6709\u6587\u4EF6");var at=new FormData;at.append("editormd-image-file",_e),at.append("file_param_name","editormd-image-file"),at.append("byxhr","true");var Et=new window.XMLHttpRequest;Et.withCredentials=!0,Et.addEventListener("load",function(Lt){je(JSON.parse(Lt.target.responseText),_e)},!1),Et.addEventListener("error",function(Lt){console.error(Lt)},!1),Et.open("POST","".concat(Ce.a,"/api/attachments.json")),Et.send(at)}var ge=K("giR+"),oe=K("fyUT"),De=K("7Kak"),Ue=K("9yH6"),we=Ue.a.Group,Ge={margin:"0 8px"},Qe=function(_e){var je=_e.callback,at=_e.onCancel;function Et(Lt){je(Lt)}return m.a.createElement(j.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Et},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Ge},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Ge},"\u884C\u6570"),m.a.createElement(j.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(oe.a,null)),m.a.createElement("span",{style:Ge},"\u5217\u6570"),m.a.createElement(j.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(oe.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Ge},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(j.a.Item,{name:"align"},m.a.createElement(we,null,m.a.createElement(Ue.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ue.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ue.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ue.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(U.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},et=K("ErOA"),ze=K("7Cbv"),Je="link",Xe="upload-image",yt="code-block",xt="add-table",vt="------------",ht={default:vt,left:":".concat(vt),center:":".concat(vt,":"),right:"".concat(vt,":")},Rt=K("9VGf"),At,ke;function Oe(){}var tt=0,it=1e4,Ne="\u2581",qe=`
**\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 Te(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,me=fe?"Cmd":"Ctrl",re=["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"],ae=(At={},Object(F.a)(At,me+"-B","bold"),Object(F.a)(At,me+"-I","italic"),At),he=(ke={},Object(F.a)(ke,Je,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(ke,yt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(ke,Xe,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(ke,xt,"\u6DFB\u52A0\u8868\u683C"),ke),ve=Me.a=function(_e){var je=_e.defaultValue,at=je===void 0?"":je,Et=_e.onChange,Lt=_e.width,Tt=Lt===void 0?"100%":Lt,mt=_e.height,Ze=mt===void 0?400:mt,$e=_e.miniToolbar,He=$e===void 0?!1:$e,le=_e.isFocus,be=le===void 0?!1:le,rt=_e.watch,Ye=_e.insertTemp,bt=_e.mode,pt=bt===void 0?"markdown":bt,Ee=_e.id,Be=Ee===void 0?"markdown-editor-id":Ee,st=_e.showResizeBar,ct=st===void 0?!1:st,Ct=_e.noStorage,lt=Ct===void 0?!1:Ct,jt=_e.showNullButton,qt=jt===void 0?!1:jt,Ot=_e.hidetoolBar,Zt=Ot===void 0?!1:Ot,un=_e.fullScreen,sn=un===void 0?!1:un,Xt=_e.onBlur,mn=_e.onCMBeforeChange,kn=_e.onFullScreen,Un=_e.className,ft=Un===void 0?"":Un,Wt=_e.disablePaste,Qt=Wt===void 0?!1:Wt,$t=_e.placeholder,en=$t===void 0?"":$t,fn=_e.values,Y=fn===void 0?"":fn,C=Object(v.useState)(null),M=Object(H.a)(C,2),G=M[0],te=M[1],Q=Object(v.useState)(at),Se=Object(H.a)(Q,2),ot=Se[0],St=Se[1],Pt=Object(v.useState)(rt),ut=Object(H.a)(Pt,2),Vt=ut[0],tn=ut[1],Sn=Object(v.useState)(sn),wn=Object(H.a)(Sn,2),_n=wn[0],Fn=wn[1],mi=Object(v.useState)(""),ki=Object(H.a)(mi,2),Kn=ki[0],si=ki[1],Ai=Object(v.useState)(0),_i=Object(H.a)(Ai,2),ni=_i[0],Ki=_i[1],Pi=Object(v.useState)(Ze),Gi=Object(H.a)(Pi,2),zi=Gi[0],Ni=Gi[1],$n=Object(v.useState)(!1),Ui=Object(H.a)($n,2),Ji=Ui[0],di=Ui[1],Ln=Object(v.useRef)(Object(ze.a)()),Ft=Object(v.useRef)(!1),Gn=Object(v.useRef)(),pn=Object(v.useRef)(),xe=Object(v.useRef)(),dn=Object(v.useRef)(),Bi=Object(v.useRef)(),Qn=function(){var Gt=Object(D.a)(T.a.mark(function an(){var Jt,cn;return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(et.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ln.current}});case 2:cn=Pn.sent,cn!=null&&(Jt=cn.attachments)!==null&&Jt!==void 0&&Jt.length&&(console.log("cm:",G,pn),cn.attachments.map(function(yn){yn.content_type.indexOf("image")>-1?G.replaceSelection("![,](/api/attachments/".concat(yn.id,"?type=").concat(yn.content_type,")")):yn.content_type.indexOf("video")>-1?G.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):yn.content_type.indexOf("pdf")>-1?G.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,'&disposition=inline" target="_blank">').concat(yn.name,"</a>")):G.replaceSelection("[".concat(yn.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,")"))}));case 4:case"end":return Pn.stop()}},an)}));return function(){return Gt.apply(this,arguments)}}();Object(v.useEffect)(function(){St(Y),G==null||G.setValue(Y)},[Y]),Object(v.useEffect)(function(){kn==null||kn(_n)},[_n]),Object(v.useEffect)(function(){if(pn.current){var Gt=d.a.fromTextArea(pn.current,{mode:pt,lineNumbers:!He,lineWrapping:!0,value:at,autoCloseTags:!0,autoCloseBrackets:!0});be&&Gt.focus();function an(Jt,cn){if(Qt){cn.preventDefault();return}var vn=cn.clipboardData;if(vn){var Pn=vn.types.toString(),yn=vn.items;if(Pn==="Files"||vn.types.indexOf("Files")>-1){if(cn.preventDefault(),pt=="stex")return;try{var zn,ai=yn[1];((zn=yn[0])===null||zn===void 0?void 0:zn.kind)==="file"&&(ai=yn[0]);var hn=ai.getAsFile(),Ri=hn.name.split(".").pop();ne(hn,function(In){if(In.id){var Vn,ei,Ti;(hn==null||((Vn=hn.type)===null||Vn===void 0)?void 0:Vn.indexOf("image"))>-1?Gt.replaceSelection("![,](/api/attachments/".concat(In.id,"?type=").concat(In.content_type,")")):(hn==null||((ei=hn.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?Gt.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,'"></video>')):(hn==null||((Ti=hn.type)===null||Ti===void 0)?void 0:Ti.indexOf("pdf"))>-1?Gt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,"?type=").concat(hn.type,'&disposition=inline" target="_blank">').concat(hn.name,"</a>")):re.includes(Ri)?Gt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,'?type=office&disposition=inline" target="_blank">').concat(hn.name,"</a>")):Gt.replaceSelection("[".concat(hn.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,"?type=").concat(In.content_type,")"))}else(In==null?void 0:In.status)===401&&(document.location.href="/user/login")})}catch(In){W.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Gt.on("paste",an),Gt.on("dragleave",function(Jt,cn){xe.current.classList.remove("mouse-hover-md")}),Gt.on("dragover",function(Jt,cn){xe.current.classList.add("mouse-hover-md")}),Gt.on("drop",function(Jt,cn){xe.current.classList.add("mouse-hover-md");var vn;if(vn=cn.dataTransfer.files,vn.length>0){cn.preventDefault(),cn.stopPropagation();for(var Pn=function(ai){var hn=vn[ai],Ri=hn.name.split(".").pop();ne(hn,function(In){if(In.id){var Vn,ei,Ti;(hn==null||((Vn=hn.type)===null||Vn===void 0)?void 0:Vn.indexOf("image"))>-1?Gt.replaceSelection("![,](/api/attachments/".concat(In.id,"?type=").concat(In.content_type,")")):(hn==null||((ei=hn.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?Gt.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,'"></video>')):(hn==null||((Ti=hn.type)===null||Ti===void 0)?void 0:Ti.indexOf("pdf"))>-1?Gt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,"?type=").concat(hn.type,'&disposition=inline" target="_blank">').concat(hn.name,"</a>")):re.includes(Ri)?Gt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,'?type=office&disposition=inline" target="_blank">').concat(hn.name,"</a>")):Gt.replaceSelection("[".concat(hn.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(In.id,"?type=").concat(In.content_type,")"))}else(In==null?void 0:In.status)===401&&(document.location.href="/user/login")})},yn=0;yn<vn.length;yn++)Pn(yn)}}),te(Gt),function(){Gt.off("paste",an)}}},[]);var gn=Object(v.useCallback)(function(){if(xe.current)try{}catch(Gt){console.log(Gt,"---- to set md editor body height")}},[zi,xe,_n]);Object(v.useEffect)(function(){function Gt(){var Jt=new r.default(function(cn){var vn=Object(N.a)(cn),Pn;try{for(vn.s();!(Pn=vn.n()).done;){var yn=Pn.value;(yn.target.offsetHeight>0||yn.target.offsetWidth>0)&&(gn(),G.setSize("100%","100%"),G.refresh())}}catch(zn){vn.e(zn)}finally{vn.f()}});return Jt.observe(pn.current.parentElement),Jt}if(G){var an=Gt();return function(){an.unobserve(pn.current.parentElement)}}},[G,gn]),Object(v.useEffect)(function(){if(G){for(var Gt=[],an=function(){var yn=cn[Jt];vn=Object(H.a)(yn,2);var zn=vn[0],ai=vn[1],hn=Object(F.a)({},zn,function(){Zi(ai)});Gt.push(hn),G.addKeyMap(hn)},Jt=0,cn=Object.entries(ae);Jt<cn.length;Jt++){var vn;an()}return Gn.current=setInterval(function(){Ft.current&&Qn()},4e3),function(){clearInterval(Gn.current);var Pn=Object(N.a)(Gt),yn;try{for(Pn.s();!(yn=Pn.n()).done;){var zn=yn.value;G.removeKeyMap(zn)}}catch(ai){Pn.e(ai)}finally{Pn.f()}}}},[G]),Object(v.useEffect)(function(){sn!==_n&&Fn(sn)},[sn]),Object(Rt.a)(function(){if(!lt&&ni>0){var Gt=new Date().getTime(),an=window.sessionStorage.getItem(Be);Gt>=ni+it&&(!an||an!==ot)&&(window.sessionStorage.setItem(Be,ot),di(!0))}},it),Object(v.useEffect)(function(){tn(rt)},[G,rt]),Object(v.useEffect)(function(){G&&(be&&G.focus())},[G,be]),Object(v.useEffect)(function(){if(Vt&&G){var Gt=G.getScrollerElement();function an(Jt){var cn=Jt.target;if(Bi.current){var vn=cn.scrollTop/cn.scrollHeight;Bi.current.scrollTop=Bi.current.scrollHeight*vn}}return Gt.addEventListener("scroll",an),function(){Gt.removeEventListener("scroll",an)}}},[G,Vt]),Object(v.useEffect)(function(){if(G&&mn){function Gt(an,Jt){mn(an,Jt)}return G.on("beforeChange",Gt),function(){G.off("beforeChange",Gt)}}},[G,mn]),Object(v.useEffect)(function(){if(G&&Xt){function Gt(){Xt(G.getValue())}return G.on("blur",Gt),function(){G.off("blur",Gt)}}},[G,Xt]),Object(v.useEffect)(function(){if(G){function Gt(an){var Jt=an.getValue();St(Jt),Ki(new Date().getTime()),an.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Et&&Et(Jt)}return G.on("change",Gt),function(){G.off("change",Gt)}}},[G,Et]),Object(v.useEffect)(function(){G&&(at==null?(G.setValue(""),St("")):at!==G.getValue()&&(G.setValue(at),St(at),G.setCursor(G.lineCount(),0)))},[G,at]);var Zi=Object(v.useCallback)(function(Gt){var an=G.getCursor(),Jt=G.getSelection(),cn=Jt.split(`
`);switch(Gt){case"bold":return G.replaceSelection("**"+Jt+"**"),Jt===""&&G.setCursor(an.line,an.ch+2),G.focus();case"italic":return G.replaceSelection("*"+Jt+"*"),Jt===""&&G.setCursor(an.line,an.ch+1),G.focus();case"code":return G.replaceSelection("`"+Jt+"`"),Jt===""&&G.setCursor(an.line,an.ch+1),G.focus();case"inline-latex":return G.replaceSelection("`$$"+Jt+"$$`"),Jt===""&&G.setCursor(an.line,an.ch+3),G.focus();case"latex":return G.replaceSelection("```latex\n"+Jt+"\n```"),G.setCursor(an.line+1,Jt.length+1),G.focus();case"line-break":return G.replaceSelection(`<br/>
`),G.focus();case"list-ul":return Jt===""?G.replaceSelection("- "+Jt):G.replaceSelection(cn.map(function(vn){return vn===""?"":"- ".concat(vn)}).join(`
`)),G.focus();case"list-ol":return Jt===""?G.replaceSelection("1. "+Jt):G.replaceSelection(cn.map(function(vn,Pn){return vn===""?"":"".concat(Pn+1,". ").concat(vn)}).join(`
`)),G.focus();case"add-null-ch":return Jt===""&&G.setCursor(an.line,an.ch+1),G.replaceSelection(Ne),G.focus();case"inster-template-1":return Jt===""&&G.setCursor(an.line,an.ch),G.replaceSelection(qe),G.focus();case"eraser":return G.setValue(""),G.focus();case"trigger-watch":return tn(!Vt),G.focus();case"trigger-full-screen":return Fn(!_n),G.focus();case Je:si(Je);return;case yt:si(yt);return;case Xe:si(Xe);return;case xt:si(xt);return;default:throw new Error}},[G,Vt,_n]),Oi=Object(v.useCallback)(function(Gt){si("");switch(Kn){case Je:var an=Gt.title,Jt=Gt.link;return G.replaceSelection("[".concat(an,"](").concat(Jt,")")),G.focus();case yt:var cn=Gt.language,vn=Gt.content;return G.replaceSelection(["```"+cn,vn,"```"].join(`
`)),G.focus();case Xe:var Pn=Gt.src,yn=Gt.alt;return yn?G.replaceSelection("![ ".concat(yn," ]( ").concat(Pn,' "').concat(yn,'" )')):G.replaceSelection("![,](".concat(Pn,")")),G.focus();case xt:for(var zn=Gt.row,ai=Gt.col,hn=Gt.align,Ri=`
`,In=0;In<zn;In++){for(var Vn=[],ei=[],Ti=0;Ti<ai;Ti++)In===1&&ei.push(ht[hn]),Vn.push(" ");In===1&&(Ri+="| ".concat(ei.join(" | "),` |
`)),Ri+="| ".concat(Vn.join(ai===1?"":" | "),` |
`)}return G.replaceSelection(Ri+`
`),G.focus();default:throw new Error}},[G,Kn]),qi=Object(v.useMemo)(function(){switch(Kn){case Je:return m.a.createElement(se,{callback:Oi,onCancel:ci});case yt:return m.a.createElement(ce.b,{callback:Oi,onCancel:ci});case Xe:return m.a.createElement(pe,{callback:Oi,onCancel:ci});case xt:return m.a.createElement(Qe,{callback:Oi,onCancel:ci});default:return null}},[Kn]);function ci(){si("")}Object(v.useEffect)(function(){if(dn.current){var Gt=dn.current,an=!1,Jt=0;function cn(yn){an=!0,Jt=yn.pageY}function vn(){an=!1}function Pn(yn){if(an){var zn=yn.pageY-Jt;zn<0&&(zn=0),zn>300&&(zn=300);var ai=Ze+zn+"px";Ni(ai)}}return Gt.addEventListener("mousedown",cn),document.addEventListener("mousemove",Pn),document.addEventListener("mouseup",vn),function(){Gt.removeEventListener("mousedown",cn),document.removeEventListener("mousemove",Pn),document.removeEventListener("mouseup",vn)}}},[G,dn]),Object(v.useEffect)(function(){Ni(Ze)},[Ze]);var Fi=Te(Tt),sr=Te(zi),Ei={width:Fi,height:sr},lr=Object(v.useMemo)(function(){if(ni){var Gt=new Date(ni),an=Gt.getHours(),Jt=Gt.getMinutes(),cn=Gt.getSeconds();return an=an<10?"0"+an:an,Jt=Jt<10?"0"+Jt:Jt,cn=cn<10?"0"+cn:cn,"".concat(an,":").concat(Jt,":").concat(cn)}return 0},[ni]);function ji(){window.sessionStorage.removeItem(Be),di(!1),Ki(0)}function xi(){di(!1),Ki(0),G.setValue(window.sessionStorage.getItem(Be))}function ur(Gt,an){var Jt=G.getValue();Jt=Jt.replace(Gt,an),St(Jt),G==null||G.setValue(Jt)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:xe},m.a.createElement("div",{className:"markdown-editor-container ".concat(ft," ").concat(Vt?"on-preview":""," ").concat(He?"mini":""," ").concat(_n?"full-screen":""),style:Ei},m.a.createElement(y,{insertTemp:Ye,watch:Vt,fullScreen:_n,showNullButton:qt,onActionCallback:Zi,hidetoolBar:Zt,uuid:Ln.current,setOpenPhones:function(){Ft.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:pn,placeholder:en})),Vt?m.a.createElement("div",{ref:Bi,className:"preview-container"},pt==="stex"&&m.a.createElement(O,{value:ot}),pt!=="stex"&&m.a.createElement(x.a,{edit:!0,value:ot,replaces:ur})):null))),ct?m.a.createElement("a",{ref:dn,className:"editor-resize"}):null,m.a.createElement(P.a,null,he[Kn]?m.a.createElement(z.a,{centered:!0,title:he[Kn],visible:!0,onCancel:ci,footer:null,className:"markdown-popup-form"},qi):null))}},RMFE:function(Ke,Me){Ke.exports="data:image/png;base64,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"},"SA+Z":function(Ke,Me,K){var q=K("wTVA"),z=K("EbDI"),N=K("ZhPi"),V=K("wkBT");function W(D){return q(D)||z(D)||N(D)||V()}Ke.exports=W,Ke.exports.__esModule=!0,Ke.exports.default=Ke.exports},SJMd:function(Ke,Me){/**
* @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 K,q,z,N=!1,V,W;window.PR_SHOULD_USE_CONTINUATION=!0;var D,H;(function(){var F=window,k=["break,continue,do,else,for,if,return,while"],T=[k,"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"],v=[T,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"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"],c=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[v,"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"],r="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",s=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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",a=[k,"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"],l=[k,"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=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],I=[m,d,c,s,o,a,l,h],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",O="kwd",S="com",_="typ",g="lit",f="pun",u="pln",E="tag",b="dec",y="src",P="atn",R="atv",U="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(we){for(var Ge=0,Qe=!1,et=!1,ze=0,Je=we.length;ze<Je;++ze){var Xe=we[ze];if(Xe.ignoreCase)et=!0;else if(/[a-z]/i.test(Xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Qe=!0,et=!1;break}}var yt={b:8,t:9,n:10,v:11,f:12,r:13};function xt(ke){var Oe=ke.charCodeAt(0);if(Oe!==92)return Oe;var tt=ke.charAt(1);return Oe=yt[tt],Oe||("0"<=tt&&tt<="7"?parseInt(ke.substring(1),8):tt==="u"||tt==="x"?parseInt(ke.substring(2),16):ke.charCodeAt(1))}function vt(ke){if(ke<32)return(ke<16?"\\x0":"\\x")+ke.toString(16);var Oe=String.fromCharCode(ke);return Oe==="\\"||Oe==="-"||Oe==="]"||Oe==="^"?"\\"+Oe:Oe}function ht(ke){var Oe=ke.substring(1,ke.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")),tt=[],it=Oe[0]==="^",Ne=["["];it&&Ne.push("^");for(var qe=it?1:0,Te=Oe.length;qe<Te;++qe){var fe=Oe[qe];if(/\\[bdsw]/i.test(fe))Ne.push(fe);else{var me=xt(fe),re;qe+2<Te&&Oe[qe+1]==="-"?(re=xt(Oe[qe+2]),qe+=2):re=me,tt.push([me,re]),re<65||me>122||(re<65||me>90||tt.push([Math.max(65,me)|32,Math.min(re,90)|32]),re<97||me>122||tt.push([Math.max(97,me)&~32,Math.min(re,122)&~32]))}}tt.sort(function(_e,je){return _e[0]-je[0]||je[1]-_e[1]});for(var ae=[],he=[],qe=0;qe<tt.length;++qe){var ve=tt[qe];ve[0]<=he[1]+1?he[1]=Math.max(he[1],ve[1]):ae.push(he=ve)}for(var qe=0;qe<ae.length;++qe){var ve=ae[qe];Ne.push(vt(ve[0])),ve[1]>ve[0]&&(ve[1]+1>ve[0]&&Ne.push("-"),Ne.push(vt(ve[1])))}return Ne.push("]"),Ne.join("")}function Rt(ke){for(var Oe=ke.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")),tt=Oe.length,it=[],Ne=0,qe=0;Ne<tt;++Ne){var Te=Oe[Ne];if(Te==="(")++qe;else if(Te.charAt(0)==="\\"){var fe=+Te.substring(1);fe&&(fe<=qe?it[fe]=-1:Oe[Ne]=vt(fe))}}for(var Ne=1;Ne<it.length;++Ne)it[Ne]===-1&&(it[Ne]=++Ge);for(var Ne=0,qe=0;Ne<tt;++Ne){var Te=Oe[Ne];if(Te==="(")++qe,it[qe]||(Oe[Ne]="(?:");else if(Te.charAt(0)==="\\"){var fe=+Te.substring(1);fe&&fe<=qe&&(Oe[Ne]="\\"+it[fe])}}for(var Ne=0;Ne<tt;++Ne)Oe[Ne]==="^"&&Oe[Ne+1]!=="^"&&(Oe[Ne]="");if(ke.ignoreCase&&Qe)for(var Ne=0;Ne<tt;++Ne){var Te=Oe[Ne],me=Te.charAt(0);Te.length>=2&&me==="["?Oe[Ne]=ht(Te):me!=="\\"&&(Oe[Ne]=Te.replace(/[a-zA-Z]/g,function(he){var ve=he.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Oe.join("")}for(var At=[],ze=0,Je=we.length;ze<Je;++ze){var Xe=we[ze];if(Xe.global||Xe.multiline)throw new Error(""+Xe);At.push("(?:"+Rt(Xe)+")")}return new RegExp(At.join("|"),et?"gi":"g")}function A(we,Ge){var Qe=/(?:^|\s)nocode(?:\s|$)/,et=[],ze=0,Je=[],Xe=0;function yt(xt){var vt=xt.nodeType;if(vt==1){if(Qe.test(xt.className))return;for(var ht=xt.firstChild;ht;ht=ht.nextSibling)yt(ht);var Rt=xt.nodeName.toLowerCase();(Rt==="br"||Rt==="li")&&(et[Xe]=`
`,Je[Xe<<1]=ze++,Je[Xe++<<1|1]=xt)}else if(vt==3||vt==4){var At=xt.nodeValue;At.length&&(Ge?At=At.replace(/\r\n?/g,`
`):At=At.replace(/[ \t\r\n]+/g," "),et[Xe]=At,Je[Xe<<1]=ze,ze+=At.length,Je[Xe++<<1|1]=xt)}}return yt(we),{sourceCode:et.join("").replace(/\n$/,""),spans:Je}}function X(we,Ge,Qe,et,ze){if(!Qe)return;var Je={sourceNode:we,pre:1,langExtension:null,numberLines:null,sourceCode:Qe,spans:null,basePos:Ge,decorations:null};et(Je),ze.push.apply(ze,Je.decorations)}var ee=/\S/;function se(we){for(var Ge=void 0,Qe=we.firstChild;Qe;Qe=Qe.nextSibling){var et=Qe.nodeType;Ge=et===1?Ge?we:Qe:et===3&&ee.test(Qe.nodeValue)?we:Ge}return Ge===we?void 0:Ge}function ce(we,Ge){var Qe={},et;(function(){for(var Xe=we.concat(Ge),yt=[],xt={},vt=0,ht=Xe.length;vt<ht;++vt){var Rt=Xe[vt],At=Rt[3];if(At)for(var ke=At.length;--ke>=0;)Qe[At.charAt(ke)]=Rt;var Oe=Rt[1],tt=""+Oe;xt.hasOwnProperty(tt)||(yt.push(Oe),xt[tt]=null)}yt.push(/[\0-\uffff]/),et=j(yt)})();var ze=Ge.length,Je=function(Xe){for(var yt=Xe.sourceCode,xt=Xe.basePos,vt=Xe.sourceNode,ht=[xt,u],Rt=0,At=yt.match(et)||[],ke={},Oe=0,tt=At.length;Oe<tt;++Oe){var it=At[Oe],Ne=ke[it],qe=void 0,Te;if(typeof Ne=="string")Te=!1;else{var fe=Qe[it.charAt(0)];if(fe)qe=it.match(fe[1]),Ne=fe[0];else{for(var me=0;me<ze;++me)if(fe=Ge[me],qe=it.match(fe[1]),qe){Ne=fe[0];break}qe||(Ne=u)}Te=Ne.length>=5&&Ne.substring(0,5)==="lang-",Te&&!(qe&&typeof qe[1]=="string")&&(Te=!1,Ne=y),Te||(ke[it]=Ne)}var re=Rt;if(Rt+=it.length,!Te)ht.push(xt+re,Ne);else{var ae=qe[1],he=it.indexOf(ae),ve=he+ae.length;qe[2]&&(ve=it.length-qe[2].length,he=ve-ae.length);var _e=Ne.substring(5);X(vt,xt+re,it.substring(0,he),Je,ht),X(vt,xt+re+he,ae,de(_e,ae),ht),X(vt,xt+re+ve,it.substring(ve),Je,ht)}}Xe.decorations=ht};return Je}function Le(we){var Ge=[],Qe=[];we.tripleQuotedStrings?Ge.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):we.multiLineStrings?Ge.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ge.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),we.verbatimStrings&&Qe.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var et=we.hashComments;et&&(we.cStyleComments?(et>1?Ge.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ge.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ge.push([S,/^#[^\r\n]*/,null,"#"])),we.cStyleComments&&(Qe.push([S,/^\/\/[^\r\n]*/,null]),Qe.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ze=we.regexLiterals;if(ze){var Je=ze>1?"":`
\r`,Xe=Je?".":"[\\S\\s]",yt="/(?=[^/*"+Je+"])(?:[^/\\x5B\\x5C"+Je+"]|\\x5C"+Xe+"|\\x5B(?:[^\\x5C\\x5D"+Je+"]|\\x5C"+Xe+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+L+"("+yt+")")])}var xt=we.types;xt&&Qe.push([_,xt]);var vt=(""+we.keywords).replace(/^ | $/g,"");vt.length&&Qe.push([O,new RegExp("^(?:"+vt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ge.push([u,/^\s+/,null,` \r
\xA0`]);var ht="^.[^\\s\\w.$@'\"`/\\\\]*";return we.regexLiterals&&(ht+="(?!s*/)"),Qe.push([g,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[g,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[f,new RegExp(ht),null]),ce(Ge,Qe)}var Ce=Le({keywords:I,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ae(we,Ge,Qe){for(var et=/(?:^|\s)nocode(?:\s|$)/,ze=/\r\n?|\n/,Je=we.ownerDocument,Xe=Je.createElement("li");we.firstChild;)Xe.appendChild(we.firstChild);var yt=[Xe];function xt(Oe){var tt=Oe.nodeType;if(tt==1&&!et.test(Oe.className))if(Oe.nodeName==="br")vt(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var it=Oe.firstChild;it;it=it.nextSibling)xt(it);else if((tt==3||tt==4)&&Qe){var Ne=Oe.nodeValue,qe=Ne.match(ze);if(qe){var Te=Ne.substring(0,qe.index);Oe.nodeValue=Te;var fe=Ne.substring(qe.index+qe[0].length);if(fe){var me=Oe.parentNode;me.insertBefore(Je.createTextNode(fe),Oe.nextSibling)}vt(Oe),Te||Oe.parentNode.removeChild(Oe)}}}function vt(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function tt(qe,Te){var fe=Te?qe.cloneNode(!1):qe,me=qe.parentNode;if(me){var re=tt(me,1),ae=qe.nextSibling;re.appendChild(fe);for(var he=ae;he;he=ae)ae=he.nextSibling,re.appendChild(he)}return fe}for(var it=tt(Oe.nextSibling,0),Ne;(Ne=it.parentNode)&&Ne.nodeType===1;)it=Ne;yt.push(it)}for(var ht=0;ht<yt.length;++ht)xt(yt[ht]);Ge===(Ge|0)&&yt[0].setAttribute("value",Ge);var Rt=Je.createElement("ol");Rt.className="linenums";for(var At=Math.max(0,Ge-1|0)||0,ht=0,ke=yt.length;ht<ke;++ht)Xe=yt[ht],Xe.className="L"+(ht+At)%10,Xe.firstChild||Xe.appendChild(Je.createTextNode("\xA0")),Rt.appendChild(Xe);we.appendChild(Rt)}function Pe(we){var Ge=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ge=Ge&&+Ge[1]<=8;var Qe=/\n/g,et=we.sourceCode,ze=et.length,Je=0,Xe=we.spans,yt=Xe.length,xt=0,vt=we.decorations,ht=vt.length,Rt=0;vt[ht]=ze;var At,ke;for(ke=At=0;ke<ht;)vt[ke]!==vt[ke+2]?(vt[At++]=vt[ke++],vt[At++]=vt[ke++]):ke+=2;for(ht=At,ke=At=0;ke<ht;){for(var Oe=vt[ke],tt=vt[ke+1],it=ke+2;it+2<=ht&&vt[it+1]===tt;)it+=2;vt[At++]=Oe,vt[At++]=tt,ke=it}ht=vt.length=At;var Ne=we.sourceNode,qe="";Ne&&(qe=Ne.style.display,Ne.style.display="none");try{for(var Te=null;xt<yt;){var fe=Xe[xt],me=Xe[xt+2]||ze,re=vt[Rt+2]||ze,it=Math.min(me,re),ae=Xe[xt+1],he;if(ae.nodeType!==1&&(he=et.substring(Je,it))){Ge&&(he=he.replace(Qe,"\r")),ae.nodeValue=he;var ve=ae.ownerDocument,_e=ve.createElement("span");_e.className=vt[Rt+1];var je=ae.parentNode;je.replaceChild(_e,ae),_e.appendChild(ae),Je<me&&(Xe[xt+1]=ae=ve.createTextNode(et.substring(it,me)),je.insertBefore(ae,_e.nextSibling))}Je=it,Je>=me&&(xt+=2),Je>=re&&(Rt+=2)}}finally{Ne&&(Ne.style.display=qe)}}var Ie={};function pe(we,Ge){for(var Qe=Ge.length;--Qe>=0;){var et=Ge[Qe];Ie.hasOwnProperty(et)?F.console&&console.warn("cannot override language handler %s",et):Ie[et]=we}}function de(we,Ge){return we&&Ie.hasOwnProperty(we)||(we=/^\s*</.test(Ge)?"default-markup":"default-code"),Ie[we]}pe(Ce,["default-code"]),pe(ce([],[[u,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["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"]),pe(ce([[u,/^[\s]+/,null,` \r
`],[R,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["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"]),pe(ce([],[[R,/^[\s\S]+/]]),["uq.val"]),pe(Le({keywords:m,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),pe(Le({keywords:"null,true,false"}),["json"]),pe(Le({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),pe(Le({keywords:c,cStyleComments:!0}),["java"]),pe(Le({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Le({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Le({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Le({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Le({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Le({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(ce([],[[x,/^[\s\S]+/]]),["regex"]);function ne(we){var Ge=we.langExtension;try{var Qe=A(we.sourceNode,we.pre),et=Qe.sourceCode;we.sourceCode=et,we.spans=Qe.spans,we.basePos=0,de(Ge,et)(we),Pe(we)}catch(ze){F.console&&console.log(ze&&ze.stack||ze)}}function ge(we,Ge,Qe){var et=Qe||!1,ze=Ge||null,Je=document.createElement("div");Je.innerHTML="<pre>"+we+"</pre>",Je=Je.firstChild,et&&Ae(Je,et,!0);var Xe={langExtension:ze,numberLines:et,sourceNode:Je,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Xe),Je.innerHTML}function oe(we,Ge){var Qe=Ge||document.body,et=Qe.ownerDocument||document;function ze(fe){return Qe.getElementsByTagName(fe)}for(var Je=[ze("pre"),ze("code"),ze("xmp")],Xe=[],yt=0;yt<Je.length;++yt)for(var xt=0,vt=Je[yt].length;xt<vt;++xt)Xe.push(Je[yt][xt]);Je=null;var ht=Date;ht.now||(ht={now:function(){return+new Date}});var Rt=0,At=/\blang(?:uage)?-([\w.]+)(?!\S)/,ke=/\bprettyprint\b/,Oe=/\bprettyprinted\b/,tt=/pre|xmp/i,it=/^code$/i,Ne=/^(?:pre|code|xmp)$/i,qe={};function Te(){for(var fe=F.PR_SHOULD_USE_CONTINUATION?ht.now()+250:Infinity;Rt<Xe.length&&ht.now()<fe;Rt++){for(var me=Xe[Rt],re=qe,ae=me;ae=ae.previousSibling;){var he=ae.nodeType,ve=(he===7||he===8)&&ae.nodeValue;if(ve?!/^\??prettify\b/.test(ve):he!==3||/\S/.test(ae.nodeValue))break;if(ve){re={},ve.replace(/\b(\w+)=([\w:.%+-]+)/g,function(rt,Ye,bt){re[Ye]=bt});break}}var _e=me.className;if((re!==qe||ke.test(_e))&&!Oe.test(_e)){for(var je=!1,at=me.parentNode;at;at=at.parentNode){var Et=at.tagName;if(Ne.test(Et)&&at.className&&ke.test(at.className)){je=!0;break}}if(!je){me.className+=" prettyprinted";var Lt=re.lang;if(!Lt){Lt=_e.match(At);var Tt;!Lt&&(Tt=se(me))&&it.test(Tt.tagName)&&(Lt=Tt.className.match(At)),Lt&&(Lt=Lt[1])}var mt;if(tt.test(me.tagName))mt=1;else{var Ze=me.currentStyle,$e=et.defaultView,He=Ze?Ze.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(me,null).getPropertyValue("white-space"):0;mt=He&&He.substring(0,3)==="pre"}var le=re.linenums;(le=le==="true"||+le)||(le=_e.match(/\blinenums\b(?::(\d+))?/),le=le?le[1]&&le[1].length?+le[1]:!0:!1),le&&Ae(me,le,mt);var be={langExtension:Lt,sourceNode:me,numberLines:le,pre:mt,sourceCode:null,basePos:null,spans:null,decorations:null};ne(be)}}}Rt<Xe.length?F.setTimeout(Te,250):typeof we=="function"&&we()}Te()}var De=F.PR={createSimpleLexer:ce,registerLangHandler:pe,sourceDecorator:Le,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:R,PR_COMMENT:S,PR_DECLARATION:b,PR_KEYWORD:O,PR_LITERAL:g,PR_NOCODE:U,PR_PLAIN:u,PR_PUNCTUATION:f,PR_SOURCE:y,PR_STRING:x,PR_TAG:E,PR_TYPE:_,prettyPrintOne:N?F.prettyPrintOne=ge:D=ge,prettyPrint:H=N?F.prettyPrint=oe:H=oe},Ue=F.define;typeof Ue=="function"&&Ue.amd&&Ue("google-code-prettify",[],function(){return De})})()},SMhR:function(Ke,Me){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiB/s7a5AWTTNhsgN9pmA2TTNp8MyI22uQHkv7TNDSCbttkAudE2bwJyo22eBGTTNhsgf7O2ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTD9c2nwzIk9pmA2TTNjeAPAnIpm1uANm0zQbIDSBPAXIDyKZtPhmQG22zAfLN2uaTAflUJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGT74ckCe1zZOAbNpm0zYbIDfaZgPkRts8qW1utM0GyKZtntI2GyBPArJpmw2QTds8CcimbW4A+WRAntQ23+pEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0viJXtU2T2qbDZA3Adm0zZOAbNpm0zYbIJu2+VZtswGyaZsbbbMBsmmbDZBN29xoG32mE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjJ3oVkCe1zZPaZgNk0zYbIJu2eRKQJwF5S9vcAPIkIJu2uQFk0zY32kbf6USSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnS+MmXa5t/WdtsgGza5psB+WRt8xQgN4DcaJtv1jYbIDfa5pO1jf5/J5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGTz4ckH9Z22yAbNpmA2TTNhsgm7bZANm0zQbIpm02QDZtswFyA8h/aZsbbbMBsmmbDZBN22yAbNpmA2TTNhsgm7bZALkBZNM2N4Doz5xIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGiSRJGvRX9LGAvKltNkA2bXMDyJvaZgNk0zZPAfLN2mYD5EbbPAnIk9pG7ziRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7y4YBs2uYGkE3bbIBs2mYD5Ebb/Mva5klAbgB5S9tsgGza5gaQDZBN2zwJyJPaZgNkA2TTNhsgN9pmA2TTNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdKgv/IPA3KjbW4AeVLb3ADyzdrmBpAntc2nAnKjbTZANm1zA8gna5sNkH9Z27zlRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZcDcqNtbgDZtM2mbTZANm1zA8imbTZANm1zA8iTgGza5gaQpwDZtM2NttkAudE2b2qbDZAbbbMB8qa20f/vRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4ycuA3GibDZANkBttswHyJCA32uZJQDZt8yQgTwKyaZsNkD/VNk8CsmmbDZA3tc0GyI222QDZtM0NIJu2eRKQTdt8qxNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4yf/uLbZANkA2bTNDSBPAnKjbd7UNhsgN4Bs2uZG27wFyKZtbrTNBsimbW4AudE2N9pmA+RG29wAsmmbJwHZtM1bTiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNn3w5IJu2udE2N4DcaJsbQDZtswGyAfIvA7Jpmz8F5EbbPAnIpm1uANm0zZuAbNpm0zYbIBsgm7a5AeRJbfOpTiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNn3y4ttkAuQFk0zYbIDfa5gaQN7XNk4A8qW02QG4A+VNtswHyzdpmA+RJbfMkIJu2eVPbbIBs2uZvdSJJksaJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRp/ERX2kb/DcimbW4AuQFk0zYbIDfa5i1t8yYgm7a50TYbIN+sbW4A2bTNk4Bs2uYtJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGT/5yQDZtswHypLbZAHlT29xomw2QTdvcAHIDyKdqmze1zZuAvKltNkCeBOSTAflWJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZIG/ZUPBuRG22yAbNrmBpAbbbMBcqNtNkA2bbMBsmmbDZBN2zwJyFvaZgNk0zYbIDfaZgNk0zYbIG9qm08GZNM2GyCbttkA2bTNtzqRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7yMiBPAvIkIN8MyA0gm7bZALkB5Elt8yQgf6pt9N/aZgPkTUA2bbNpmycB+VedSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSxokkSRr0V/5iQDZt882AbNrmBpBN22yAbNpmA+RG2zwJyKZt/hSQTds8CcimbW4A2bTNk4B8s7bZALnRNhsgm7bZANm0zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI2ffDggm7bZtM0GyJvaZgPkBpBN2zypbTZAbrTNBsimbZ4E5ClAbrTNNwOyaZsbbXMDyI222QDZtM0GyAbIDSCbtvlUJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZIG/ZV/GJAbbbMB8qa22QDZtM0GyKZtbgDZtM0NIJu22QC50Tb/BciNttkAeVLbbIDcaJsNkE3bbIA8qW02QN7UNv+qE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjJy8DcqNt3gTkkwH5ZECeBOSTAXkKkE3bbIA8qW2e1DY32mYDZNM2GyD6TCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSxk++HJBN29xomycB2bTNm4Bs2mYD5JsBudE2TwGyaZsNkCcBudE2N4C8CciNtnkSkBtAbrTNpzqRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNH7ysrb5ZkA2bXMDyI22eRKQTds8CcimbTZANm2zAXIDyH9pmye1zQbIpm02QG4A+WRtswHyJCCbtnlT23yrE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0vjJy4A8qW2e1DZvapsbQDZtswFyA8imbTZtc6Nt3tQ2TwGyaZtN22yA3GibDZBN22yAPAnIm9rmSUA2bbMBcqNt3nIiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaJ5IkadBf+WBANm2zAfLN2mYD5Ebb3AByo202QPSOttkA2bTNm4Bs2uYGEP25tvlUJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpHEiSZIG/ZUXAbnRNjeA3GibG0ButM03A/LJ2mYDZNM2fwrIJ2ubG0A2bXMDyI22uQFk0zY3gNxomxtANm3zrU4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkDforLwKyaZsNkE3bPAnIpm02QJ7UNk8CcqNtNkButM0GyJPaZgPkT7XNBsiNttkA+Ze1zQ0gN9pmA+RNbbMBsmmbt5xIkqRxIkmSxokkSRonkiRpnEiSpHEiSZLGiSRJGvRX/mJANm3zzYDcaJsbQG60zQ0gm7a5AeRJbfMWIE9qmw2QG22zAXKjbTZANm2zAfKktrkB5E1t85YTSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeMnLwOyaZsbbbMB8qa2udE2GyBvapsNkE3bbNrmTW2zAbIB8l/a5kltswHypLZ5U9s8CciNtnkSkE3b/KtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI2fvKxtbgDZtM2NtvlmbbMB8iQgTwKyaZsNkG8F5Elt8yYgm7Z5EpBN2zwJyCcDcqNtPtWJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpPGTDwdk0zY32uYGkE3b3ACyaZtP1jZvArJpmw2QDZBN22yA/Bcgm7bZALkB5Ebb6L8B2bTNDSCbttkAudE2GyCbtnnLiSRJGieSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRBf+UvBmTTNhsgm7a5AeSTtc2TgNxomw2QG22zAbJpmz8F5EbbbIC8qW2+GZBN2zwJyKZtNkButM0GyI22ecuJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRpnEiSpEF/5UVAbrTNk4DcaJsNkG/WNk8C8qS22QDZtM0GyKZtPhWQN7XNk4Bs2mYD5Elt8yQgN9rmb3UiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaJ5IkadBfeRGQN7XNk4Bs2uabAdm0zQbIm9rmUwHZtM0GyI222QB5U9tsgDypbZ4EZNM2bwKyaZtvdSJJksaJJEkaJ5IkaZxIkqRxIkmSxokkSRonkiRp/OTDtc0GyJOA3GibDZAbbXMDyKZtntQ23wzIjbb5L21zo21uALnRNhsgn6xtNkA2bfMmIG8CsmmbT3UiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaJ5IkadBf+WBANm2zAbJpmw2QTdv8y4DcaJsbQDZtswFyo202QDZt8xQgm7a5AeRG23wzIDfa5k1ANm1zA8iNtnnLiSRJGieSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqTxk79c2zwJyI222QDZtM2TgGzaZgNkA+RNbbMBcqNtNkD+VNvcALJpmzcB2bTNBsimbT4ZkE3bvAnIpm2+1YkkSRonkiRpnEiSpHEiSZLGiSRJGieSJGmcSJKkQX/lgwF5Uts8CciNtrkB5EltcwPIjbbZANm0zQbIp2qbJwHZtM0NIG9qmzcB2bTNBsiNttkAeVLbfKoTSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSYP+youAPKltngRk0zY3gGza5klAntQ2N4A8qW02QL5V22yAfLK22QC50TYbIJu22QD5Zm2zAXKjbd5yIkmSxokkSRonkiRpnEiSpHEiSZLGiSRJGieSJGnQX9FrgGzaZgNk0zYbIDfaZgNk0zYbIJu22QDZtM0NIJu2eQqQG21zA8imbTZANm3zJiBvapsnAbnRNn+rE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjJy8D8jdrm03b3GibDZA3tc2NtnkSkDcB+S9tc6NtntQ2N9rmBpAbbXOjbW4AuQFk0zZPAnKjbT7ViSRJGieSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqTxkw/XNp8MyJOAbNrmRts8CcimbT5Z22yA3GibpwDZtM0NIJ+sbTZAbgB5U9s8qW02QDZt861OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI2ffDkgT2qbJwF5UttsgLwJyJPa5gaQG0De0jY3gGza5gaQG22zAXKjbZ4EZAPkTUBuANm0zac6kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjR+ole1zZvaZgPkRtvcAPIkIJu22QDZtM3fCsiNttkAudE2TwKyaZtN22yAbNrmBpAbbbMBsgGyaZu3nEiSpHEiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaP9FHA3KjbTZAngRk0zafDMiTgPyptrkB5Eltc6Nt3gTkTW1zA8imbZ7UNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(Ke,Me,K){Ke.exports=K.p+"static/lockclose.365036e8.svg"},TXwP:function(Ke,Me,K){var q,z;(function(){var N;(function(){"use strict";var W=[,,function(k){function T(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}T.prototype.clone_empty=function(){var c=new T(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},T.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},T.prototype.has_match=function(c){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(c))return!0;return!1},T.prototype.set_indent=function(c,d){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},T.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},T.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},T.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},T.prototype.is_empty=function(){return this.__items.length===0},T.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},T.prototype.push=function(c){this.__items.push(c);var d=c.lastIndexOf(`
`);d!==-1?this.__character_count=c.length-d:this.__character_count+=c.length},T.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},T.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},T.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},T.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},T.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function v(c,d){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),d=d||"",c.indent_level>0&&(d=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}v.prototype.get_indent_size=function(c,d){var r=this.__base_string_length;return d=d||0,c<0&&(r=0),r+=c*this.__indent_size,r+=d,r},v.prototype.get_indent_string=function(c,d){var r=this.__base_string;return d=d||0,c<0&&(c=0,r=""),d+=c*this.__indent_size,this.__ensure_cache(d),r+=this.__cache[d],r},v.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var c=this.__cache.length,d=0,r="";this.__indent_size&&c>=this.__indent_size&&(d=Math.floor(c/this.__indent_size),c-=d*this.__indent_size,r=new Array(d+1).join(this.__indent_string)),c&&(r+=new Array(c+1).join(" ")),this.__cache.push(r)};function m(c,d){this.__indent_cache=new v(c,d),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new T(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(c,d){return this.__indent_cache.get_indent_string(c,d)},m.prototype.get_indent_size=function(c,d){return this.__indent_cache.get_indent_size(c,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(c){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return c!==`
`&&(r=r.replace(/[\n]/g,c)),r},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(c,d){return c=c||0,d=d||0,this.next_line.set_indent(c,d),this.__lines.length>1?(this.current_line.set_indent(c,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(c){for(var d=0;d<c.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(c){for(var d=this.__lines.length;c<d;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(c,d){for(var r=this.__lines.length-2;r>=0;){var s=this.__lines[r];if(s.is_empty())break;if(s.item(0).indexOf(c)!==0&&s.item(-1)!==d){this.__lines.splice(r+1,0,new T(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},k.exports.Output=m},,,,function(k){function T(c,d){this.raw_options=v(c,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}T.prototype._get_array=function(c,d){var r=this.raw_options[c],s=d||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(s=r.concat()):typeof r=="string"&&(s=r.split(/[^a-zA-Z0-9_\/\-]+/)),s},T.prototype._get_boolean=function(c,d){var r=this.raw_options[c],s=r===void 0?!!d:!!r;return s},T.prototype._get_characters=function(c,d){var r=this.raw_options[c],s=d||"";return typeof r=="string"&&(s=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},T.prototype._get_number=function(c,d){var r=this.raw_options[c];d=parseInt(d,10),isNaN(d)&&(d=0);var s=parseInt(r,10);return isNaN(s)&&(s=d),s},T.prototype._get_selection=function(c,d,r){var s=this._get_selection_list(c,d,r);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[c]+"'");return s[0]},T.prototype._get_selection_list=function(c,d,r){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[d[0]],!this._is_valid_selection(r,d))throw new Error("Invalid Default Value!");var s=this._get_array(c,r);if(!this._is_valid_selection(s,d))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[c]+"'");return s},T.prototype._is_valid_selection=function(c,d){return c.length&&d.length&&!c.some(function(r){return d.indexOf(r)===-1})};function v(c,d){var r={};c=m(c);var s;for(s in c)s!==d&&(r[s]=c[s]);if(d&&c[d])for(s in c[d])r[s]=c[d][s];return r}function m(c){var d={},r;for(r in c){var s=r.replace(/-/g,"_");d[s]=c[r]}return d}k.exports.Options=T,k.exports.normalizeOpts=m,k.exports.mergeOpts=v},,function(k){var T=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},v.prototype.peek=function(m){var c=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(c=this.__input.charAt(m)),c},v.prototype.__match=function(m,c){m.lastIndex=c;var d=m.exec(this.__input);return d&&!(T&&m.sticky)&&(d.index!==c&&(d=null)),d},v.prototype.test=function(m,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(m,c):!1},v.prototype.testChar=function(m,c){var d=this.peek(c);return m.lastIndex=0,d!==null&&m.test(d)},v.prototype.match=function(m){var c=this.__match(m,this.__position);return c?this.__position+=c[0].length:c=null,c},v.prototype.read=function(m,c,d){var r="",s;return m&&(s=this.match(m),s&&(r+=s[0])),c&&(s||!m)&&(r+=this.readUntil(c,d)),r},v.prototype.readUntil=function(m,c){var d="",r=this.__position;m.lastIndex=this.__position;var s=m.exec(this.__input);return s?(r=s.index,c&&(r+=s[0].length)):r=this.__input_length,d=this.__input.substring(this.__position,r),this.__position=r,d},v.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},v.prototype.get_regexp=function(m,c){var d=null,r="g";return c&&T&&(r="y"),typeof m=="string"&&m!==""?d=new RegExp(m,r):m&&(d=new RegExp(m.source,r)),d},v.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(m){var c=this.__position,d=this.readUntilAfter(m);return this.__position=c,d},v.prototype.lookBack=function(m){var c=this.__position-1;return c>=m.length&&this.__input.substring(c-m.length,c).toLowerCase()===m},k.exports.InputScanner=v},,,,,function(k){function T(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}T.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(v);c;)m[c[1]]=c[2],c=this.__directive_pattern.exec(v);return m},T.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=T},,function(k,T,v){var m=v(16).Beautifier,c=v(17).Options;function d(r,s){var o=new m(r,s);return o.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new c}},function(k,T,v){var m=v(17).Options,c=v(2).Output,d=v(8).InputScanner,r=v(13).Directives,s=new r(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,l=/\s/,h=/(?:\s|\n)+/g,I=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(O,S){this._source_text=O||"",this._options=new m(S),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(O){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return S},x.prototype.eatWhitespace=function(O){for(var S=l.test(this._input.peek()),_=0;l.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return S},x.prototype.foundNestedPseudoClass=function(){for(var O=0,S=1,_=this._input.peek(S);_;){if(_==="{")return!0;if(_==="(")O+=1;else if(_===")"){if(O===0)return!1;O-=1}else if(_===";"||_==="}")return!1;S++,_=this._input.peek(S)}return!1},x.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},x.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,S=this._options.eol;S==="auto"&&(S=`
`,O&&o.test(O||"")&&(S=O.match(o)[0])),O=O.replace(a,`
`);var _=O.match(/^[\t ]*/)[0];this._output=new c(this._options,_),this._input=new d(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var g=0,f=!1,u=!1,E=!1,b=!1,y=!1,P=!1,R=this._ch,U=!1,L,j,A;L=this._input.read(h),j=L!=="",A=R,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),R=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var X=this._input.read(I),ee=s.get_directives(X);ee&&ee.ignore==="start"&&(X+=s.readIgnored(this._input)),this.print_string(X),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(j),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?b=!0:se==="import"&&(y=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!f&&g===0&&se.indexOf(":")!==-1&&(u=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(j),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")u&&(u=!1,this.outdent()),E?(E=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(A==="("?this._output.space_before_token=!1:A!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),A==="{"&&this._output.trim(!0),y=!1,b=!1,u&&(this.outdent(),u=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ce=0;ce<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ce++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ce])){U=!0;break}(f||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&g===0?(this.print_string(":"),u||(u=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Le=A==='"'||A==="'";this.preserveSingleSpace(Le||j),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")U=!1,g===0?(u&&(this.outdent(),u=!1),b=!1,y=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),g++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),g&&(g--,this.outdent()));else{var Ce=!1;this._input.lookBack("with")&&(Ce=!0),this.preserveSingleSpace(j||Ce),this.print_string(this._ch),u&&A==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),g++,this.indent())}else if(this._ch===")")g&&(g--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!u||P)&&g===0&&!y&&!b?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!u&&g===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&l.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(j),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),l.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ae=A==='"'||A==="'";this.preserveSingleSpace(Ae||j),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&U&&this._output.add_new_line()}var Pe=this._output.get_code(S);return Pe},k.exports.Beautifier=x},function(k,T,v){var m=v(6).Options;function c(d){m.call(this,d,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<s.length;o++)s[o]!=="expand"?this.brace_style="collapse":this.brace_style=s[o]}c.prototype=new m,k.exports.Options=c}],D={};function H(k){var T=D[k];if(T!==void 0)return T.exports;var v=D[k]={exports:{}};return W[k](v,v.exports,H),v.exports}var F=H(15);N=F})();var V=N;!(q=[],z=function(){return{css_beautify:V}}.apply(Me,q),z!==void 0&&(Ke.exports=z))})()},V5fa:function(Ke,Me,K){Ke.exports={flex_box_center:"flex_box_center___1_S53",flex_space_between:"flex_space_between___1jn1m",flex_box_vertical_center:"flex_box_vertical_center___3ENQs",flex_box_center_end:"flex_box_center_end___1RjJf",flex_box_column:"flex_box_column___3-6wq",bg:"bg___3wGkV",answerWrp:"answerWrp___1GI6r",title:"title___1QMPU",questionIcons:"questionIcons___2kqHA",green:"green___3sUty",orange:"orange___1IwUK",greenTip:"greenTip___2LD-4",redTip:"redTip___Ua25P",orangeTip:"orangeTip___1P_qu",pollDesc:"pollDesc___12pG2",answered:"answered___12rTH",unanswer:"unanswer___2WW2x",anchor:"anchor___K9-2U",answerFlag:"answerFlag___3jqRB",flagActive:"flagActive___38hkf",flagHalf:"flagHalf___1rgyT",answerStudentFlag:"answerStudentFlag___2zRLo",answerStudentActive:"answerStudentActive___2T-mu",questionItem:"questionItem___LqD7i",itemType:"itemType___1pbUF",itemFlag:"itemFlag___3xnGm",answerWrap:"answerWrap___13WPD",answerSubjective:"answerSubjective___BuIEZ",otherInput:"otherInput___3j4KI",submitButton:"submitButton___3lR03",randomFlag:"randomFlag___HVH41",answerTrue:"answerTrue___3EG1E",answerFalse:"answerFalse___zj_y6",answerHalf:"answerHalf___27vGH",renderHtml:"renderHtml___1U3SR",simpleText:"simpleText___1ljHF",answerYes:"answerYes___nDZ92",answerNo:"answerNo___1DhaR",answerInfo:"answerInfo___150u3",answerSheet:"answerSheet___1m3xL",active:"active___I4C3w",countDown:"countDown___1gxag",red:"red___1J5W8",fold:"fold___1XoX9",cardList:"cardList___vfXeA",iframe:"iframe___3x_Cy",eduTip:"eduTip___384XZ",eduQrcode:"eduQrcode___26eCP",eduVideo:"eduVideo___2-PAX",eduUsername:"eduUsername___1ctLk",startAnswer:"startAnswer___2XcIR",eduSubmit:"eduSubmit___2k1g8",eduTitle:"eduTitle___1o443",wrpAnswer:"wrpAnswer___2zPBL",simpleMd:"simpleMd___G5mJD"}},"VrN/":function(Ke,Me,K){(function(q,z){Ke.exports=z()})(this,function(){"use strict";var q=navigator.userAgent,z=navigator.platform,N=/gecko\/\d/i.test(q),V=/MSIE \d/.test(q),W=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),D=/Edge\/(\d+)/.exec(q),H=V||W||D,F=H&&(V?document.documentMode||6:+(D||W)[1]),k=!D&&/WebKit\//.test(q),T=k&&/Qt\/\d+\.\d+/.test(q),v=!D&&/Chrome\//.test(q),m=/Opera\//.test(q),c=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),r=/PhantomJS/.test(q),s=!D&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),o=/Android/.test(q),a=s||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),l=s||/Mac/.test(z),h=/\bCrOS\b/.test(q),I=/win/i.test(z),w=m&&q.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(m=!1,k=!0);var x=l&&(T||m&&(w==null||w<12.11)),O=N||H&&F>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var i=e.className,n=S(t).exec(i);if(n){var p=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(p?n[1]+p:"")}};function g(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return g(e).appendChild(t)}function u(e,t,i,n){var p=document.createElement(e);if(i&&(p.className=i),n&&(p.style.cssText=n),typeof t=="string")p.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)p.appendChild(t[B]);return p}function E(e,t,i,n){var p=u(e,t,i,n);return p.setAttribute("role","presentation"),p}var b;document.createRange?b=function(e,t,i,n){var p=document.createRange();return p.setEnd(n||e,i),p.setStart(e,t),p}:b=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(p){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function y(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 P(){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 R(e,t){var i=e.className;S(t).test(i)||(e.className+=(i?" ":"")+t)}function U(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!S(i[n]).test(t)&&(t+=" "+i[n]);return t}var L=function(e){e.select()};s?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(L=function(e){try{e.select()}catch(t){}});function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function A(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function X(e,t,i,n,p){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=n||0,J=p||0;;){var Z=e.indexOf(" ",B);if(Z<0||Z>=t)return J+(t-B);J+=Z-B,J+=i-J%i,B=Z+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ce=50,Le={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},Ae={origin:"*mouse"},Pe={origin:"+move"};function Ie(e,t,i){for(var n=0,p=0;;){var B=e.indexOf(" ",n);B==-1&&(B=e.length);var J=B-n;if(B==e.length||p+J>=t)return n+Math.min(J,t-p);if(p+=B-n,p+=i-p%i,n=B+1,p>=t)return n}}var pe=[""];function de(e){for(;pe.length<=e;)pe.push(ne(pe)+" ");return pe[e]}function ne(e){return e[e.length-1]}function ge(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function oe(e,t,i){for(var n=0,p=i(t);n<e.length&&i(e[n])<=p;)n++;e.splice(n,0,t)}function De(){}function Ue(e,t){var i;return Object.create?i=Object.create(e):(De.prototype=e,i=new De),t&&A(t,i),i}var we=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ge(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||we.test(e))}function Qe(e,t){return t?t.source.indexOf("\\w")>-1&&Ge(e)?!0:t.test(e):Ge(e)}function et(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ze=/[\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 Je(e){return e.charCodeAt(0)>=768&&ze.test(e)}function Xe(e,t,i){for(;(i<0?t>0:t<e.length)&&Je(e.charAt(t));)t+=i;return t}function yt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var p=(t+i)/2,B=n<0?Math.ceil(p):Math.floor(p);if(B==t)return e(B)?t:i;e(B)?i=B:t=B+n}}function xt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var p=!1,B=0;B<e.length;++B){var J=e[B];(J.from<i&&J.to>t||t==i&&J.to==t)&&(n(Math.max(J.from,t),Math.min(J.to,i),J.level==1?"rtl":"ltr",B),p=!0)}p||n(t,i,"ltr")}var vt=null;function ht(e,t,i){var n;vt=null;for(var p=0;p<e.length;++p){var B=e[p];if(B.from<t&&B.to>t)return p;B.to==t&&(B.from!=B.to&&i=="before"?n=p:vt=p),B.from==t&&(B.from!=B.to&&i!="before"?n=p:vt=p)}return n!=null?n:vt}var Rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,p=/[stwN]/,B=/[LRr]/,J=/[Lb1n]/,Z=/[1n]/;function $(ie,ye,Re){this.level=ie,this.from=ye,this.to=Re}return function(ie,ye){var Re=ye=="ltr"?"L":"R";if(ie.length==0||ye=="ltr"&&!n.test(ie))return!1;for(var Ve=ie.length,We=[],dt=0;dt<Ve;++dt)We.push(i(ie.charCodeAt(dt)));for(var _t=0,It=Re;_t<Ve;++_t){var Ut=We[_t];Ut=="m"?We[_t]=It:It=Ut}for(var Kt=0,Bt=Re;Kt<Ve;++Kt){var Yt=We[Kt];Yt=="1"&&Bt=="r"?We[Kt]="n":B.test(Yt)&&(Bt=Yt,Yt=="r"&&(We[Kt]="R"))}for(var on=1,nn=We[0];on<Ve-1;++on){var bn=We[on];bn=="+"&&nn=="1"&&We[on+1]=="1"?We[on]="1":bn==","&&nn==We[on+1]&&(nn=="1"||nn=="n")&&(We[on]=nn),nn=bn}for(var Wn=0;Wn<Ve;++Wn){var li=We[Wn];if(li==",")We[Wn]="N";else if(li=="%"){var Jn=void 0;for(Jn=Wn+1;Jn<Ve&&We[Jn]=="%";++Jn);for(var Hi=Wn&&We[Wn-1]=="!"||Jn<Ve&&We[Jn]=="1"?"1":"N",Li=Wn;Li<Jn;++Li)We[Li]=Hi;Wn=Jn-1}}for(var ii=0,Di=Re;ii<Ve;++ii){var pi=We[ii];Di=="L"&&pi=="1"?We[ii]="L":B.test(pi)&&(Di=pi)}for(var oi=0;oi<Ve;++oi)if(p.test(We[oi])){var ri=void 0;for(ri=oi+1;ri<Ve&&p.test(We[ri]);++ri);for(var qn=(oi?We[oi-1]:Re)=="L",Mi=(ri<Ve?We[ri]:Re)=="L",Aa=qn==Mi?qn?"L":"R":Re,Nr=oi;Nr<ri;++Nr)We[Nr]=Aa;oi=ri-1}for(var bi=[],mr,ui=0;ui<Ve;)if(J.test(We[ui])){var cs=ui;for(++ui;ui<Ve&&J.test(We[ui]);++ui);bi.push(new $(0,cs,ui))}else{var Ar=ui,qr=bi.length,$r=ye=="rtl"?1:0;for(++ui;ui<Ve&&We[ui]!="L";++ui);for(var wi=Ar;wi<ui;)if(Z.test(We[wi])){Ar<wi&&(bi.splice(qr,0,new $(1,Ar,wi)),qr+=$r);var Oa=wi;for(++wi;wi<ui&&Z.test(We[wi]);++wi);bi.splice(qr,0,new $(2,Oa,wi)),qr+=$r,Ar=wi}else++wi;Ar<ui&&bi.splice(qr,0,new $(1,Ar,ui))}return ye=="ltr"&&(bi[0].level==1&&(mr=ie.match(/^\s+/))&&(bi[0].from=mr[0].length,bi.unshift(new $(0,0,mr[0].length))),ne(bi).level==1&&(mr=ie.match(/\s+$/))&&(ne(bi).to-=mr[0].length,bi.push(new $(0,Ve-mr[0].length,Ve)))),ye=="rtl"?bi.reverse():bi}}();function At(e,t){var i=e.order;return i==null&&(i=e.order=Rt(e.text,t)),i}var ke=[],Oe=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||ke).concat(i)}};function tt(e,t){return e._handlers&&e._handlers[t]||ke}function it(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,p=n&&n[t];if(p){var B=se(p,i);B>-1&&(n[t]=p.slice(0,B).concat(p.slice(B+1)))}}}function Ne(e,t){var i=tt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),p=0;p<i.length;++p)i[p].apply(null,n)}function qe(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ne(e,i||t.type,e,t),he(t)||t.codemirrorIgnore}function Te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)se(i,t[n])==-1&&i.push(t[n])}function fe(e,t){return tt(e,t).length>0}function me(e){e.prototype.on=function(t,i){Oe(this,t,i)},e.prototype.off=function(t,i){it(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ve(e){re(e),ae(e)}function _e(e){return e.target||e.srcElement}function je(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var at=function(){if(H&&F<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),Et;function Lt(e){if(Et==null){var t=u("span","\u200B");f(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Et=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&F<8))}var i=Et?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Tt;function mt(e){if(Tt!=null)return Tt;var t=f(e,document.createTextNode("A\u062EA")),i=b(t,0,1).getBoundingClientRect(),n=b(t,1,2).getBoundingClientRect();return g(e),!i||i.left==i.right?!1:Tt=n.right-i.right<3}var Ze=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var p=e.indexOf(`
`,t);p==-1&&(p=e.length);var B=e.slice(t,e.charAt(p-1)=="\r"?p-1:p),J=B.indexOf("\r");J!=-1?(i.push(B.slice(0,J)),t+=J+1):(i.push(B),t=p+1)}return i}:function(e){return e.split(/\r\n?|\n/)},$e=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},He=function(){var e=u("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),le=null;function be(e){if(le!=null)return le;var t=f(e,u("span","x")),i=t.getBoundingClientRect(),n=b(t,0,1).getBoundingClientRect();return le=Math.abs(i.left-n.left)>1}var rt={},Ye={};function bt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),rt[e]=t}function pt(e,t){Ye[e]=t}function Ee(e){if(typeof e=="string"&&Ye.hasOwnProperty(e))e=Ye[e];else if(e&&typeof e.name=="string"&&Ye.hasOwnProperty(e.name)){var t=Ye[e.name];typeof t=="string"&&(t={name:t}),e=Ue(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ee("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ee("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Be(e,t){t=Ee(t);var i=rt[t.name];if(!i)return Be(e,"text/plain");var n=i(e,t);if(st.hasOwnProperty(t.name)){var p=st[t.name];for(var B in p){if(!p.hasOwnProperty(B))continue;n.hasOwnProperty(B)&&(n["_"+B]=n[B]),n[B]=p[B]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var J in t.modeProps)n[J]=t.modeProps[J];return n}var st={};function ct(e,t){var i=st.hasOwnProperty(e)?st[e]:st[e]={};A(t,i)}function Ct(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var p=t[n];p instanceof Array&&(p=p.concat([])),i[n]=p}return i}function lt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function jt(e,t,i){return e.startState?e.startState(t,i):!0}var qt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};qt.prototype.eol=function(){return this.pos>=this.string.length},qt.prototype.sol=function(){return this.pos==this.lineStart},qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},qt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qt.prototype.skipToEnd=function(){this.pos=this.string.length},qt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qt.prototype.backUp=function(e){this.pos-=e},qt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=X(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},qt.prototype.indentation=function(){return X(this.string,null,this.tabSize)-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},qt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(J){return i?J.toLowerCase():J},p=this.string.substr(this.pos,e.length);if(n(p)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},qt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ot(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 i=e;!i.lines;)for(var n=0;;++n){var p=i.children[n],B=p.chunkSize();if(t<B){i=p;break}t-=B}return i.lines[t]}function Zt(e,t,i){var n=[],p=t.line;return e.iter(t.line,i.line+1,function(B){var J=B.text;p==i.line&&(J=J.slice(0,i.ch)),p==t.line&&(J=J.slice(t.ch)),n.push(J),++p}),n}function un(e,t,i){var n=[];return e.iter(t,i,function(p){n.push(p.text)}),n}function sn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Xt(e){if(e.parent==null)return null;for(var t=e.parent,i=se(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var p=0;!(n.children[p]==t);++p)i+=n.children[p].chunkSize();return i+t.first}function mn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var p=e.children[n],B=p.height;if(t<B){e=p;continue e}t-=B,i+=p.chunkSize()}return i}while(!e.lines);for(var J=0;J<e.lines.length;++J){var Z=e.lines[J],$=Z.height;if(t<$)break;t-=$}return i+J}function kn(e,t){return t>=e.first&&t<e.first+e.size}function Un(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ft(e,t,i){if(i===void 0&&(i=null),!(this instanceof ft))return new ft(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Wt(e,t){return e.line-t.line||e.ch-t.ch}function Qt(e,t){return e.sticky==t.sticky&&Wt(e,t)==0}function $t(e){return ft(e.line,e.ch)}function en(e,t){return Wt(e,t)<0?t:e}function fn(e,t){return Wt(e,t)<0?e:t}function Y(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function C(e,t){if(t.line<e.first)return ft(e.first,0);var i=e.first+e.size-1;return t.line>i?ft(i,Ot(e,i).text.length):M(t,Ot(e,t.line).text.length)}function M(e,t){var i=e.ch;return i==null||i>t?ft(e.line,t):i<0?ft(e.line,0):e}function G(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=C(e,t[n]);return i}var te=function(e,t){this.state=e,this.lookAhead=t},Q=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Q.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Q.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}},Q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Q.fromSaved=function(e,t,i){return t instanceof te?new Q(e,Ct(e.mode,t.state),i,t.lookAhead):new Q(e,Ct(e.mode,t),i)},Q.prototype.save=function(e){var t=e!==!1?Ct(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new te(t,this.maxLookAhead):t};function Se(e,t,i,n){var p=[e.state.modeGen],B={};_n(e,t.text,e.doc.mode,i,function(ie,ye){return p.push(ie,ye)},B,n);for(var J=i.state,Z=function(ie){i.baseTokens=p;var ye=e.state.overlays[ie],Re=1,Ve=0;i.state=!0,_n(e,t.text,ye.mode,i,function(We,dt){for(var _t=Re;Ve<We;){var It=p[Re];It>We&&p.splice(Re,1,We,p[Re+1],It),Re+=2,Ve=Math.min(We,It)}if(!dt)return;if(ye.opaque)p.splice(_t,Re-_t,We,"overlay "+dt),Re=_t+2;else for(;_t<Re;_t+=2){var Ut=p[_t+1];p[_t+1]=(Ut?Ut+" ":"")+"overlay "+dt}},B),i.state=J,i.baseTokens=null,i.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)Z($);return{styles:p,classes:B.bgClass||B.textClass?B:null}}function ot(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=St(e,Xt(t)),p=t.text.length>e.options.maxHighlightLength&&Ct(e.doc.mode,n.state),B=Se(e,t,n);p&&(n.state=p),t.stateAfter=n.save(!p),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,i){var n=e.doc,p=e.display;if(!n.mode.startState)return new Q(n,!0,t);var B=Fn(e,t,i),J=B>n.first&&Ot(n,B-1).stateAfter,Z=J?Q.fromSaved(n,J,B):new Q(n,jt(n.mode),B);return n.iter(B,t,function($){Pt(e,$.text,Z);var ie=Z.line;$.stateAfter=ie==t-1||ie%5==0||ie>=p.viewFrom&&ie<p.viewTo?Z.save():null,Z.nextLine()}),i&&(n.modeFrontier=Z.line),Z}function Pt(e,t,i,n){var p=e.doc.mode,B=new qt(t,e.options.tabSize,i);for(B.start=B.pos=n||0,t==""&&ut(p,i.state);!B.eol();)Vt(p,B,i.state),B.start=B.pos}function ut(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=lt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Vt(e,t,i,n){for(var p=0;p<10;p++){n&&(n[0]=lt(e,i).mode);var B=e.token(t,i);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var tn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Sn(e,t,i,n){var p=e.doc,B=p.mode,J;t=C(p,t);var Z=Ot(p,t.line),$=St(e,t.line,i),ie=new qt(Z.text,e.options.tabSize,$),ye;for(n&&(ye=[]);(n||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,J=Vt(B,ie,$.state),n&&ye.push(new tn(ie,J,Ct(p.mode,$.state)));return n?ye:new tn(ie,J,$.state)}function wn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function _n(e,t,i,n,p,B,J){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var $=0,ie=null,ye=new qt(t,e.options.tabSize,n),Re,Ve=e.options.addModeClass&&[null];for(t==""&&wn(ut(i,n.state),B);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(Z=!1,J&&Pt(e,t,n,ye.pos),ye.pos=t.length,Re=null):Re=wn(Vt(i,ye,n.state,Ve),B),Ve){var We=Ve[0].name;We&&(Re="m-"+(Re?We+" "+Re:We))}if(!Z||ie!=Re){for(;$<ye.start;)$=Math.min(ye.start,$+5e3),p($,ie);ie=Re}ye.start=ye.pos}for(;$<ye.pos;){var dt=Math.min(ye.pos,$+5e3);p(dt,ie),$=dt}}function Fn(e,t,i){for(var n,p,B=e.doc,J=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>J;--Z){if(Z<=B.first)return B.first;var $=Ot(B,Z-1),ie=$.stateAfter;if(ie&&(!i||Z+(ie instanceof te?ie.lookAhead:0)<=B.modeFrontier))return Z;var ye=X($.text,null,e.options.tabSize);(p==null||n>ye)&&(p=Z-1,n=ye)}return p}function mi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var p=Ot(e,n).stateAfter;if(p&&(!(p instanceof te)||n+p.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var ki=!1,Kn=!1;function si(){ki=!0}function Ai(){Kn=!0}function _i(e,t,i){this.marker=e,this.from=t,this.to=i}function ni(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Ki(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Pi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Gi(e,t,i){var n;if(e)for(var p=0;p<e.length;++p){var B=e[p],J=B.marker,Z=B.from==null||(J.inclusiveLeft?B.from<=t:B.from<t);if(Z||B.from==t&&J.type=="bookmark"&&(!i||!B.marker.insertLeft)){var $=B.to==null||(J.inclusiveRight?B.to>=t:B.to>t);(n||(n=[])).push(new _i(J,B.from,$?null:B.to))}}return n}function zi(e,t,i){var n;if(e)for(var p=0;p<e.length;++p){var B=e[p],J=B.marker,Z=B.to==null||(J.inclusiveRight?B.to>=t:B.to>t);if(Z||B.from==t&&J.type=="bookmark"&&(!i||B.marker.insertLeft)){var $=B.from==null||(J.inclusiveLeft?B.from<=t:B.from<t);(n||(n=[])).push(new _i(J,$?null:B.from-t,B.to==null?null:B.to-t))}}return n}function Ni(e,t){if(t.full)return null;var i=kn(e,t.from.line)&&Ot(e,t.from.line).markedSpans,n=kn(e,t.to.line)&&Ot(e,t.to.line).markedSpans;if(!i&&!n)return null;var p=t.from.ch,B=t.to.ch,J=Wt(t.from,t.to)==0,Z=Gi(i,p,J),$=zi(n,B,J),ie=t.text.length==1,ye=ne(t.text).length+(ie?p:0);if(Z)for(var Re=0;Re<Z.length;++Re){var Ve=Z[Re];if(Ve.to==null){var We=ni($,Ve.marker);We?ie&&(Ve.to=We.to==null?null:We.to+ye):Ve.to=p}}if($)for(var dt=0;dt<$.length;++dt){var _t=$[dt];if(_t.to!=null&&(_t.to+=ye),_t.from==null){var It=ni(Z,_t.marker);It||(_t.from=ye,ie&&(Z||(Z=[])).push(_t))}else _t.from+=ye,ie&&(Z||(Z=[])).push(_t)}Z&&(Z=$n(Z)),$&&$!=Z&&($=$n($));var Ut=[Z];if(!ie){var Kt=t.text.length-2,Bt;if(Kt>0&&Z)for(var Yt=0;Yt<Z.length;++Yt)Z[Yt].to==null&&(Bt||(Bt=[])).push(new _i(Z[Yt].marker,null,null));for(var on=0;on<Kt;++on)Ut.push(Bt);Ut.push($)}return Ut}function $n(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ui(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(We){if(We.markedSpans)for(var dt=0;dt<We.markedSpans.length;++dt){var _t=We.markedSpans[dt].marker;_t.readOnly&&(!n||se(n,_t)==-1)&&(n||(n=[])).push(_t)}}),!n)return null;for(var p=[{from:t,to:i}],B=0;B<n.length;++B)for(var J=n[B],Z=J.find(0),$=0;$<p.length;++$){var ie=p[$];if(Wt(ie.to,Z.from)<0||Wt(ie.from,Z.to)>0)continue;var ye=[$,1],Re=Wt(ie.from,Z.from),Ve=Wt(ie.to,Z.to);(Re<0||!J.inclusiveLeft&&!Re)&&ye.push({from:ie.from,to:Z.from}),(Ve>0||!J.inclusiveRight&&!Ve)&&ye.push({from:Z.to,to:ie.to}),p.splice.apply(p,ye),$+=ye.length-3}return p}function Ji(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function di(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Ln(e){return e.inclusiveLeft?-1:0}function Ft(e){return e.inclusiveRight?1:0}function Gn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),p=t.find(),B=Wt(n.from,p.from)||Ln(e)-Ln(t);if(B)return-B;var J=Wt(n.to,p.to)||Ft(e)-Ft(t);return J||t.id-e.id}function pn(e,t){var i=Kn&&e.markedSpans,n;if(i)for(var p=void 0,B=0;B<i.length;++B)p=i[B],p.marker.collapsed&&(t?p.from:p.to)==null&&(!n||Gn(n,p.marker)<0)&&(n=p.marker);return n}function xe(e){return pn(e,!0)}function dn(e){return pn(e,!1)}function Bi(e,t){var i=Kn&&e.markedSpans,n;if(i)for(var p=0;p<i.length;++p){var B=i[p];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!n||Gn(n,B.marker)<0)&&(n=B.marker)}return n}function Qn(e,t,i,n,p){var B=Ot(e,t),J=Kn&&B.markedSpans;if(J)for(var Z=0;Z<J.length;++Z){var $=J[Z];if(!$.marker.collapsed)continue;var ie=$.marker.find(0),ye=Wt(ie.from,i)||Ln($.marker)-Ln(p),Re=Wt(ie.to,n)||Ft($.marker)-Ft(p);if(ye>=0&&Re<=0||ye<=0&&Re>=0)continue;if(ye<=0&&($.marker.inclusiveRight&&p.inclusiveLeft?Wt(ie.to,i)>=0:Wt(ie.to,i)>0)||ye>=0&&($.marker.inclusiveRight&&p.inclusiveLeft?Wt(ie.from,n)<=0:Wt(ie.from,n)<0))return!0}}function gn(e){for(var t;t=xe(e);)e=t.find(-1,!0).line;return e}function Zi(e){for(var t;t=dn(e);)e=t.find(1,!0).line;return e}function Oi(e){for(var t,i;t=dn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qi(e,t){var i=Ot(e,t),n=gn(i);return i==n?t:Xt(n)}function ci(e,t){if(t>e.lastLine())return t;var i=Ot(e,t),n;if(!Fi(e,i))return t;for(;n=dn(i);)i=n.find(1,!0).line;return Xt(i)+1}function Fi(e,t){var i=Kn&&t.markedSpans;if(i)for(var n=void 0,p=0;p<i.length;++p){if(n=i[p],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&sr(e,t,n))return!0}}function sr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return sr(e,n.line,ni(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var p=void 0,B=0;B<t.markedSpans.length;++B)if(p=t.markedSpans[B],p.marker.collapsed&&!p.marker.widgetNode&&p.from==i.to&&(p.to==null||p.to!=i.from)&&(p.marker.inclusiveLeft||i.marker.inclusiveRight)&&sr(e,t,p))return!0}function Ei(e){e=gn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var p=i.lines[n];if(p==e)break;t+=p.height}for(var B=i.parent;B;i=B,B=i.parent)for(var J=0;J<B.children.length;++J){var Z=B.children[J];if(Z==i)break;t+=Z.height}return t}function lr(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=xe(n);){var p=i.find(0,!0);n=p.from.line,t+=p.from.ch-p.to.ch}for(n=e;i=dn(n);){var B=i.find(0,!0);t-=n.text.length-B.from.ch,n=B.to.line,t+=n.text.length-B.to.ch}return t}function ji(e){var t=e.display,i=e.doc;t.maxLine=Ot(i,i.first),t.maxLineLength=lr(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var p=lr(n);p>t.maxLineLength&&(t.maxLineLength=p,t.maxLine=n)})}var xi=function(e,t,i){this.text=e,di(this,t),this.height=i?i(this):1};xi.prototype.lineNo=function(){return Xt(this)},me(xi);function ur(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ji(e),di(e,i);var p=n?n(e):1;p!=e.height&&sn(e,p)}function Gt(e){e.parent=null,Ji(e)}var an={},Jt={};function cn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Jt:an;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function vn(e,t){var i=E("span",null,null,k?"padding-right: .1px":null),n={pre:E("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var p=0;p<=(t.rest?t.rest.length:0);p++){var B=p?t.rest[p-1]:t.line,J=void 0;n.pos=0,n.addToken=yn,mt(e.display.measure)&&(J=At(B,e.doc.direction))&&(n.addToken=ai(n.addToken,J)),n.map=[];var Z=t!=e.display.externalMeasured&&Xt(B);Ri(B,n,ot(e,B,Z)),B.styleClasses&&(B.styleClasses.bgClass&&(n.bgClass=U(B.styleClasses.bgClass,n.bgClass||"")),B.styleClasses.textClass&&(n.textClass=U(B.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Lt(e.display.measure))),p==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(k){var $=n.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=U(n.pre.className,n.textClass||"")),n}function Pn(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function yn(e,t,i,n,p,B,J){if(!t)return;var Z=e.splitSpaces?zn(t,e.trailingSpace):t,$=e.cm.state.specialChars,ie=!1,ye;if(!$.test(t))e.col+=t.length,ye=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,ye),H&&F<9&&(ie=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var Re=0;;){$.lastIndex=Re;var Ve=$.exec(t),We=Ve?Ve.index-Re:t.length-Re;if(We){var dt=document.createTextNode(Z.slice(Re,Re+We));H&&F<9?ye.appendChild(u("span",[dt])):ye.appendChild(dt),e.map.push(e.pos,e.pos+We,dt),e.col+=We,e.pos+=We}if(!Ve)break;Re+=We+1;var _t=void 0;if(Ve[0]==" "){var It=e.cm.options.tabSize,Ut=It-e.col%It;_t=ye.appendChild(u("span",de(Ut),"cm-tab")),_t.setAttribute("role","presentation"),_t.setAttribute("cm-text"," "),e.col+=Ut}else Ve[0]=="\r"||Ve[0]==`
`?(_t=ye.appendChild(u("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_t.setAttribute("cm-text",Ve[0]),e.col+=1):(_t=e.cm.options.specialCharPlaceholder(Ve[0]),_t.setAttribute("cm-text",Ve[0]),H&&F<9?ye.appendChild(u("span",[_t])):ye.appendChild(_t),e.col+=1);e.map.push(e.pos,e.pos+1,_t),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||n||p||ie||B||J){var Kt=i||"";n&&(Kt+=n),p&&(Kt+=p);var Bt=u("span",[ye],Kt,B);if(J)for(var Yt in J)J.hasOwnProperty(Yt)&&Yt!="style"&&Yt!="class"&&Bt.setAttribute(Yt,J[Yt]);return e.content.appendChild(Bt)}e.content.appendChild(ye)}function zn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",p=0;p<e.length;p++){var B=e.charAt(p);B==" "&&i&&(p==e.length-1||e.charCodeAt(p+1)==32)&&(B="\xA0"),n+=B,i=B==" "}return n}function ai(e,t){return function(i,n,p,B,J,Z,$){p=p?p+" cm-force-border":"cm-force-border";for(var ie=i.pos,ye=ie+n.length;;){for(var Re=void 0,Ve=0;Ve<t.length&&!(Re=t[Ve],Re.to>ie&&Re.from<=ie);Ve++);if(Re.to>=ye)return e(i,n,p,B,J,Z,$);e(i,n.slice(0,Re.to-ie),p,B,null,Z,$),B=null,n=n.slice(Re.to-ie),ie=Re.to}}}function hn(e,t,i,n){var p=!n&&i.widgetNode;p&&e.map.push(e.pos,e.pos+t,p),!n&&e.cm.display.input.needsContentAttribute&&(p||(p=e.content.appendChild(document.createElement("span"))),p.setAttribute("cm-marker",i.id)),p&&(e.cm.display.input.setUneditable(p),e.content.appendChild(p)),e.pos+=t,e.trailingSpace=!1}function Ri(e,t,i){var n=e.markedSpans,p=e.text,B=0;if(!n){for(var J=1;J<i.length;J+=2)t.addToken(t,p.slice(B,B=i[J]),cn(i[J+1],t.cm.options));return}for(var Z=p.length,$=0,ie=1,ye="",Re,Ve,We=0,dt,_t,It,Ut,Kt;;){if(We==$){dt=_t=It=Ve="",Kt=null,Ut=null,We=Infinity;for(var Bt=[],Yt=void 0,on=0;on<n.length;++on){var nn=n[on],bn=nn.marker;if(bn.type=="bookmark"&&nn.from==$&&bn.widgetNode)Bt.push(bn);else if(nn.from<=$&&(nn.to==null||nn.to>$||bn.collapsed&&nn.to==$&&nn.from==$)){if(nn.to!=null&&nn.to!=$&&We>nn.to&&(We=nn.to,_t=""),bn.className&&(dt+=" "+bn.className),bn.css&&(Ve=(Ve?Ve+";":"")+bn.css),bn.startStyle&&nn.from==$&&(It+=" "+bn.startStyle),bn.endStyle&&nn.to==We&&(Yt||(Yt=[])).push(bn.endStyle,nn.to),bn.title&&((Kt||(Kt={})).title=bn.title),bn.attributes)for(var Wn in bn.attributes)(Kt||(Kt={}))[Wn]=bn.attributes[Wn];bn.collapsed&&(!Ut||Gn(Ut.marker,bn)<0)&&(Ut=nn)}else nn.from>$&&We>nn.from&&(We=nn.from)}if(Yt)for(var li=0;li<Yt.length;li+=2)Yt[li+1]==We&&(_t+=" "+Yt[li]);if(!Ut||Ut.from==$)for(var Jn=0;Jn<Bt.length;++Jn)hn(t,0,Bt[Jn]);if(Ut&&(Ut.from||0)==$){if(hn(t,(Ut.to==null?Z+1:Ut.to)-$,Ut.marker,Ut.from==null),Ut.to==null)return;Ut.to==$&&(Ut=!1)}}if($>=Z)break;for(var Hi=Math.min(Z,We);;){if(ye){var Li=$+ye.length;if(!Ut){var ii=Li>Hi?ye.slice(0,Hi-$):ye;t.addToken(t,ii,Re?Re+dt:dt,It,$+ii.length==We?_t:"",Ve,Kt)}if(Li>=Hi){ye=ye.slice(Hi-$),$=Hi;break}$=Li,It=""}ye=p.slice(B,B=i[ie++]),Re=cn(i[ie++],t.cm.options)}}}function In(e,t,i){this.line=t,this.rest=Oi(t),this.size=this.rest?Xt(ne(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Fi(e,t)}function Vn(e,t,i){for(var n=[],p,B=t;B<i;B=p){var J=new In(e.doc,Ot(e.doc,B),B);p=B+J.size,n.push(J)}return n}var ei=null;function Ti(e){ei?ei.ops.push(e):e.ownsGroup=ei={ops:[e],delayedCallbacks:[]}}function ea(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var p=e.ops[n];if(p.cursorActivityHandlers)for(;p.cursorActivityCalled<p.cursorActivityHandlers.length;)p.cursorActivityHandlers[p.cursorActivityCalled++].call(null,p.cm)}}while(i<t.length)}function Mn(e,t){var i=e.ownsGroup;if(!i)return;try{ea(i)}finally{ei=null,t(i)}}var An=null;function On(e,t){var i=tt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),p;ei?p=ei.delayedCallbacks:An?p=An:(p=An=[],setTimeout(gi,0));for(var B=function(Z){p.push(function(){return i[Z].apply(null,n)})},J=0;J<i.length;++J)B(J)}function gi(){var e=An;An=null;for(var t=0;t<e.length;++t)e[t]()}function dr(e,t,i,n){for(var p=0;p<t.changes.length;p++){var B=t.changes[p];B=="text"?Ra(e,t):B=="gutter"?ho(e,t,i,n):B=="class"?Fr(e,t):B=="widget"&&fo(e,t,n)}t.changes=null}function $i(e){return e.node==e.text&&(e.node=u("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&F<8&&(e.node.style.zIndex=2)),e.node}function Ur(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=$i(t);t.background=n.insertBefore(u("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Br(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):vn(e,t)}function Ra(e,t){var i=t.text.className,n=Br(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,Fr(e,t)):i&&(t.text.className=i)}function Fr(e,t){Ur(e,t),t.line.wrapClass?$i(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ho(e,t,i,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 p=$i(t);t.gutterBackground=u("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),p.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var J=$i(t),Z=t.gutter=u("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),J.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(u("div",Un(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var $=0;$<e.display.gutterSpecs.length;++$){var ie=e.display.gutterSpecs[$].className,ye=B.hasOwnProperty(ie)&&B[ie];ye&&Z.appendChild(u("div",[ye],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ie]+"px; width: "+n.gutterWidth[ie]+"px"))}}}function fo(e,t,i){t.alignable&&(t.alignable=null);for(var n=S("CodeMirror-linewidget"),p=t.node.firstChild,B=void 0;p;p=B)B=p.nextSibling,n.test(p.className)&&t.node.removeChild(p);po(e,t,i)}function Go(e,t,i,n){var p=Br(e,t);return t.text=t.node=p.pre,p.bgClass&&(t.bgClass=p.bgClass),p.textClass&&(t.textClass=p.textClass),Fr(e,t),ho(e,t,i,n),po(e,t,n),t.node}function po(e,t,i){if(mo(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)mo(e,t.rest[n],t,i,!1)}function mo(e,t,i,n,p){if(!t.widgets)return;for(var B=$i(i),J=0,Z=t.widgets;J<Z.length;++J){var $=Z[J],ie=u("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),go($,ie,i,n),e.display.input.setUneditable(ie),p&&$.above?B.insertBefore(ie,i.gutter||i.text):B.appendChild(ie),On($,"redraw")}}function go(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var p=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(p-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=p+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,u("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Vi(e,t){for(var i=_e(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function ta(e){return e.lineSpace.offsetTop}function na(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function vo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,u("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Yi(e){return ce-e.display.nativeBarWidth}function vr(e){return e.display.scroller.clientWidth-Yi(e)-e.display.barWidth}function ia(e){return e.display.scroller.clientHeight-Yi(e)-e.display.barHeight}function yo(e,t,i){var n=e.options.lineWrapping,p=n&&vr(e);if(!t.measure.heights||n&&t.measure.width!=p){var B=t.measure.heights=[];if(n){t.measure.width=p;for(var J=t.text.firstChild.getClientRects(),Z=0;Z<J.length-1;Z++){var $=J[Z],ie=J[Z+1];Math.abs($.bottom-ie.bottom)>2&&B.push(($.bottom+ie.top)/2-i.top)}}B.push(i.bottom-i.top)}}function Ia(e,t,i){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 p=0;p<e.rest.length;p++)if(Xt(e.rest[p])>i)return{map:e.measure.maps[p],cache:e.measure.caches[p],before:!0}}function zo(e,t){t=gn(t);var i=Xt(t),n=e.display.externalMeasured=new In(e.doc,t,i);n.lineN=i;var p=n.built=vn(e,n);return n.text=p.pre,f(e.display.lineMeasure,p.pre),n}function La(e,t,i,n){return Xi(e,jr(e,t),i,n)}function Ci(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[xr(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function jr(e,t){var i=Xt(t),n=Ci(e,i);n&&!n.text?n=null:n&&n.changes&&(dr(e,n,i,oa(e)),e.curOp.forceUpdate=!0),n||(n=zo(e,t));var p=Ia(n,t,i);return{line:t,view:n,rect:null,map:p.map,cache:p.cache,before:p.before,hasHeights:!1}}function Xi(e,t,i,n,p){t.before&&(i=-1);var B=i+(n||""),J;return t.cache.hasOwnProperty(B)?J=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(yo(e,t.view,t.rect),t.hasHeights=!0),J=bo(e,t,i,n),J.bogus||(t.cache[B]=J)),{left:J.left,right:J.right,top:p?J.rtop:J.top,bottom:p?J.rbottom:J.bottom}}var ra={left:0,right:0,top:0,bottom:0};function Or(e,t,i){for(var n,p,B,J,Z,$,ie=0;ie<e.length;ie+=3)if(Z=e[ie],$=e[ie+1],t<Z?(p=0,B=1,J="left"):t<$?(p=t-Z,B=p+1):(ie==e.length-3||t==$&&e[ie+3]>t)&&(B=$-Z,p=B-1,t>=$&&(J="right")),p!=null){if(n=e[ie+2],Z==$&&i==(n.insertLeft?"left":"right")&&(J=i),i=="left"&&p==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)n=e[(ie-=3)+2],J="left";if(i=="right"&&p==$-Z)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)n=e[(ie+=3)+2],J="right";break}return{node:n,start:p,end:B,collapse:J,coverStart:Z,coverEnd:$}}function Wr(e,t){var i=ra;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var p=e.length-1;p>=0&&!((i=e[p]).left!=i.right);p--);return i}function bo(e,t,i,n){var p=Or(t.map,i,n),B=p.node,J=p.start,Z=p.end,$=p.collapse,ie;if(B.nodeType==3){for(var ye=0;ye<4;ye++){for(;J&&Je(t.line.text.charAt(p.coverStart+J));)--J;for(;p.coverStart+Z<p.coverEnd&&Je(t.line.text.charAt(p.coverStart+Z));)++Z;if(H&&F<9&&J==0&&Z==p.coverEnd-p.coverStart?ie=B.parentNode.getBoundingClientRect():ie=Wr(b(B,J,Z).getClientRects(),n),ie.left||ie.right||J==0)break;Z=J,J=J-1,$="right"}H&&F<11&&(ie=Hr(e.display.measure,ie))}else{J>0&&($=n="right");var Re;e.options.lineWrapping&&(Re=B.getClientRects()).length>1?ie=Re[n=="right"?Re.length-1:0]:ie=B.getBoundingClientRect()}if(H&&F<9&&!J&&(!ie||!ie.left&&!ie.right)){var Ve=B.parentNode.getClientRects()[0];Ve?ie={left:Ve.left,right:Ve.left+_r(e.display),top:Ve.top,bottom:Ve.bottom}:ie=ra}for(var We=ie.top-t.rect.top,dt=ie.bottom-t.rect.top,_t=(We+dt)/2,It=t.view.measure.heights,Ut=0;Ut<It.length-1&&!(_t<It[Ut]);Ut++);var Kt=Ut?It[Ut-1]:0,Bt=It[Ut],Yt={left:($=="right"?ie.right:ie.left)-t.rect.left,right:($=="left"?ie.left:ie.right)-t.rect.left,top:Kt,bottom:Bt};return!ie.left&&!ie.right&&(Yt.bogus=!0),e.options.singleCursorHeightPerLine||(Yt.rtop=We,Yt.rbottom=dt),Yt}function Hr(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!be(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function _o(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 Da(e){e.display.externalMeasure=null,g(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)_o(e.display.view[t])}function En(e){Da(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function yr(){return v&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Eo(){return v&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function aa(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function Rn(e,t,i,n,p){if(!p){var B=aa(t);i.top+=B,i.bottom+=B}if(n=="line")return i;n||(n="local");var J=Ei(t);if(n=="local"?J+=ta(e.display):J-=e.display.viewOffset,n=="page"||n=="window"){var Z=e.display.lineSpace.getBoundingClientRect();J+=Z.top+(n=="window"?0:Eo());var $=Z.left+(n=="window"?0:yr());i.left+=$,i.right+=$}return i.top+=J,i.bottom+=J,i}function br(e,t,i){if(i=="div")return t;var n=t.left,p=t.top;if(i=="page")n-=yr(),p-=Eo();else if(i=="local"||!i){var B=e.display.sizer.getBoundingClientRect();n+=B.left,p+=B.top}var J=e.display.lineSpace.getBoundingClientRect();return{left:n-J.left,top:p-J.top}}function Ma(e,t,i,n,p){return n||(n=Ot(e.doc,t.line)),Rn(e,n,La(e,n,t.ch,p),i)}function Wi(e,t,i,n,p,B){n=n||Ot(e.doc,t.line),p||(p=jr(e,n));function J(dt,_t){var It=Xi(e,p,dt,_t?"right":"left",B);return _t?It.left=It.right:It.right=It.left,Rn(e,n,It,i)}var Z=At(n,e.doc.direction),$=t.ch,ie=t.sticky;if($>=n.text.length?($=n.text.length,ie="before"):$<=0&&($=0,ie="after"),!Z)return J(ie=="before"?$-1:$,ie=="before");function ye(dt,_t,It){var Ut=Z[_t],Kt=Ut.level==1;return J(It?dt-1:dt,Kt!=It)}var Re=ht(Z,$,ie),Ve=vt,We=ye($,Re,ie=="before");return Ve!=null&&(We.other=ye($,Ve,ie!="before")),We}function xo(e,t){var i=0;t=C(e.doc,t),e.options.lineWrapping||(i=_r(e.display)*t.ch);var n=Ot(e.doc,t.line),p=Ei(n)+ta(e.display);return{left:i,right:i,top:p,bottom:p+n.height}}function cr(e,t,i,n,p){var B=ft(e,t,i);return B.xRel=p,n&&(B.outside=n),B}function ka(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return cr(n.first,0,null,-1,-1);var p=mn(n,i),B=n.first+n.size-1;if(p>B)return cr(n.first+n.size-1,Ot(n,B).text.length,null,1,1);t<0&&(t=0);for(var J=Ot(n,p);;){var Z=Vo(e,J,p,t,i),$=Bi(J,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!$)return Z;var ie=$.find(1);if(ie.line==p)return ie;J=Ot(n,p=ie.line)}}function Pa(e,t,i,n){n-=aa(t);var p=t.text.length,B=yt(function(J){return Xi(e,i,J-1).bottom<=n},p,0);return p=yt(function(J){return Xi(e,i,J).top>n},B,p),{begin:B,end:p}}function Kr(e,t,i,n){i||(i=jr(e,t));var p=Rn(e,t,Xi(e,i,n),"line").top;return Pa(e,t,i,p)}function Na(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Vo(e,t,i,n,p){p-=Ei(t);var B=jr(e,t),J=aa(t),Z=0,$=t.text.length,ie=!0,ye=At(t,e.doc.direction);if(ye){var Re=(e.options.lineWrapping?Co:To)(e,t,i,B,ye,n,p);ie=Re.level!=1,Z=ie?Re.from:Re.to-1,$=ie?Re.to:Re.from-1}var Ve=null,We=null,dt=yt(function(on){var nn=Xi(e,B,on);return nn.top+=J,nn.bottom+=J,Na(nn,n,p,!1)?(nn.top<=p&&nn.left<=n&&(Ve=on,We=nn),!0):!1},Z,$),_t,It,Ut=!1;if(We){var Kt=n-We.left<We.right-n,Bt=Kt==ie;dt=Ve+(Bt?0:1),It=Bt?"after":"before",_t=Kt?We.left:We.right}else{!ie&&(dt==$||dt==Z)&&dt++,It=dt==0?"after":dt==t.text.length?"before":Xi(e,B,dt-(ie?1:0)).bottom+J<=p==ie?"after":"before";var Yt=Wi(e,ft(i,dt,It),"line",t,B);_t=Yt.left,Ut=p<Yt.top?-1:p>=Yt.bottom?1:0}return dt=Xe(t.text,dt,1),cr(i,dt,It,Ut,n-_t)}function To(e,t,i,n,p,B,J){var Z=yt(function(Re){var Ve=p[Re],We=Ve.level!=1;return Na(Wi(e,ft(i,We?Ve.to:Ve.from,We?"before":"after"),"line",t,n),B,J,!0)},0,p.length-1),$=p[Z];if(Z>0){var ie=$.level!=1,ye=Wi(e,ft(i,ie?$.from:$.to,ie?"after":"before"),"line",t,n);Na(ye,B,J,!0)&&ye.top>J&&($=p[Z-1])}return $}function Co(e,t,i,n,p,B,J){var Z=Pa(e,t,n,J),$=Z.begin,ie=Z.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var ye=null,Re=null,Ve=0;Ve<p.length;Ve++){var We=p[Ve];if(We.from>=ie||We.to<=$)continue;var dt=We.level!=1,_t=Xi(e,n,dt?Math.min(ie,We.to)-1:Math.max($,We.from)).right,It=_t<B?B-_t+1e9:_t-B;(!ye||Re>It)&&(ye=We,Re=It)}return ye||(ye=p[p.length-1]),ye.from<$&&(ye={from:$,to:ye.to,level:ye.level}),ye.to>ie&&(ye={from:ye.from,to:ie,level:ye.level}),ye}var nr;function Rr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(nr==null){nr=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)nr.appendChild(document.createTextNode("x")),nr.appendChild(u("br"));nr.appendChild(document.createTextNode("x"))}f(e.measure,nr);var i=nr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),g(e.measure),i||1}function _r(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),i=u("pre",[t],"CodeMirror-line-like");f(e.measure,i);var n=t.getBoundingClientRect(),p=(n.right-n.left)/10;return p>2&&(e.cachedCharWidth=p),p||10}function oa(e){for(var t=e.display,i={},n={},p=t.gutters.clientLeft,B=t.gutters.firstChild,J=0;B;B=B.nextSibling,++J){var Z=e.display.gutterSpecs[J].className;i[Z]=B.offsetLeft+B.clientLeft+p,n[Z]=B.clientWidth}return{fixedPos:Ua(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Ua(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ba(e){var t=Rr(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/_r(e.display)-3);return function(p){if(Fi(e.doc,p))return 0;var B=0;if(p.widgets)for(var J=0;J<p.widgets.length;J++)p.widgets[J].height&&(B+=p.widgets[J].height);return i?B+(Math.ceil(p.text.length/n)||1)*t:B+t}}function sa(e){var t=e.doc,i=Ba(e);t.iter(function(n){var p=i(n);p!=n.height&&sn(n,p)})}function Er(e,t,i,n){var p=e.display;if(!i&&_e(t).getAttribute("cm-not-content")=="true")return null;var B,J,Z=p.lineSpace.getBoundingClientRect();try{B=t.clientX-Z.left,J=t.clientY-Z.top}catch(Re){return null}var $=ka(e,B,J),ie;if(n&&$.xRel>0&&(ie=Ot(e.doc,$.line).text).length==$.ch){var ye=X(ie,ie.length,e.options.tabSize)-ie.length;$=ft($.line,Math.max(0,Math.round((B-vo(e.display).left)/_r(e.display))-ye))}return $}function xr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Zn(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var p=e.display;if(n&&i<p.viewTo&&(p.updateLineNumbers==null||p.updateLineNumbers>t)&&(p.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=p.viewTo)Kn&&qi(e.doc,t)<p.viewTo&&fr(e);else if(i<=p.viewFrom)Kn&&ci(e.doc,i+n)>p.viewFrom?fr(e):(p.viewFrom+=n,p.viewTo+=n);else if(t<=p.viewFrom&&i>=p.viewTo)fr(e);else if(t<=p.viewFrom){var B=er(e,i,i+n,1);B?(p.view=p.view.slice(B.index),p.viewFrom=B.lineN,p.viewTo+=n):fr(e)}else if(i>=p.viewTo){var J=er(e,t,t,-1);J?(p.view=p.view.slice(0,J.index),p.viewTo=J.lineN):fr(e)}else{var Z=er(e,t,t,-1),$=er(e,i,i+n,1);Z&&$?(p.view=p.view.slice(0,Z.index).concat(Vn(e,Z.lineN,$.lineN)).concat(p.view.slice($.index)),p.viewTo+=n):fr(e)}var ie=p.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=n:t<ie.lineN+ie.size&&(p.externalMeasured=null))}function hr(e,t,i){e.curOp.viewChanged=!0;var n=e.display,p=e.display.externalMeasured;if(p&&t>=p.lineN&&t<p.lineN+p.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var B=n.view[xr(e,t)];if(B.node==null)return;var J=B.changes||(B.changes=[]);se(J,i)==-1&&J.push(i)}function fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function er(e,t,i,n){var p=xr(e,t),B,J=e.display.view;if(!Kn||i==e.doc.first+e.doc.size)return{index:p,lineN:i};for(var Z=e.display.viewFrom,$=0;$<p;$++)Z+=J[$].size;if(Z!=t){if(n>0){if(p==J.length-1)return null;B=Z+J[p].size-t,p++}else B=Z-t;t+=B,i+=B}for(;qi(e.doc,i)!=i;){if(p==(n<0?0:J.length-1))return null;i+=n*J[p-(n<0?1:0)].size,p+=n}return{index:p,lineN:i}}function Fa(e,t,i){var n=e.display,p=n.view;p.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Vn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Vn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(xr(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Vn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,xr(e,i)))),n.viewTo=i}function So(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var p=t[n];!p.hidden&&(!p.node||p.changes)&&++i}return i}function Tr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function wo(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},p=n.cursors=document.createDocumentFragment(),B=n.selection=document.createDocumentFragment(),J=0;J<i.sel.ranges.length;J++){if(!t&&J==i.sel.primIndex)continue;var Z=i.sel.ranges[J];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var $=Z.empty();($||e.options.showCursorWhenSelecting)&&ja(e,Z.head,p),$||Yo(e,Z,B)}return n}function ja(e,t,i){var n=Wi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),p=i.appendChild(u("div","\xA0","CodeMirror-cursor"));if(p.style.left=n.left+"px",p.style.top=n.top+"px",p.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var B=i.appendChild(u("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=n.other.left+"px",B.style.top=n.other.top+"px",B.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function la(e,t){return e.top-t.top||e.left-t.left}function Yo(e,t,i){var n=e.display,p=e.doc,B=document.createDocumentFragment(),J=vo(e.display),Z=J.left,$=Math.max(n.sizerWidth,vr(e)-n.sizer.offsetLeft)-J.right,ie=p.direction=="ltr";function ye(Bt,Yt,on,nn){Yt<0&&(Yt=0),Yt=Math.round(Yt),nn=Math.round(nn),B.appendChild(u("div",null,"CodeMirror-selected","position: absolute; left: "+Bt+`px;
top: `+Yt+"px; width: "+(on==null?$-Bt:on)+`px;
height: `+(nn-Yt)+"px"))}function Re(Bt,Yt,on){var nn=Ot(p,Bt),bn=nn.text.length,Wn,li;function Jn(ii,Di){return Ma(e,ft(Bt,ii),"div",nn,Di)}function Hi(ii,Di,pi){var oi=Kr(e,nn,null,ii),ri=Di=="ltr"==(pi=="after")?"left":"right",qn=pi=="after"?oi.begin:oi.end-(/\s/.test(nn.text.charAt(oi.end-1))?2:1);return Jn(qn,ri)[ri]}var Li=At(nn,p.direction);return xt(Li,Yt||0,on==null?bn:on,function(ii,Di,pi,oi){var ri=pi=="ltr",qn=Jn(ii,ri?"left":"right"),Mi=Jn(Di-1,ri?"right":"left"),Aa=Yt==null&&ii==0,Nr=on==null&&Di==bn,bi=oi==0,mr=!Li||oi==Li.length-1;if(Mi.top-qn.top<=3){var ui=(ie?Aa:Nr)&&bi,cs=(ie?Nr:Aa)&&mr,Ar=ui?Z:(ri?qn:Mi).left,qr=cs?$:(ri?Mi:qn).right;ye(Ar,qn.top,qr-Ar,qn.bottom)}else{var $r,wi,Oa,hs;ri?($r=ie&&Aa&&bi?Z:qn.left,wi=ie?$:Hi(ii,pi,"before"),Oa=ie?Z:Hi(Di,pi,"after"),hs=ie&&Nr&&mr?$:Mi.right):($r=ie?Hi(ii,pi,"before"):Z,wi=!ie&&Aa&&bi?$:qn.right,Oa=!ie&&Nr&&mr?Z:Mi.left,hs=ie?Hi(Di,pi,"after"):$),ye($r,qn.top,wi-$r,qn.bottom),qn.bottom<Mi.top&&ye(Z,qn.bottom,null,Mi.top),ye(Oa,Mi.top,hs-Oa,Mi.bottom)}(!Wn||la(qn,Wn)<0)&&(Wn=qn),la(Mi,Wn)<0&&(Wn=Mi),(!li||la(qn,li)<0)&&(li=qn),la(Mi,li)<0&&(li=Mi)}),{start:Wn,end:li}}var Ve=t.from(),We=t.to();if(Ve.line==We.line)Re(Ve.line,Ve.ch,We.ch);else{var dt=Ot(p,Ve.line),_t=Ot(p,We.line),It=gn(dt)==gn(_t),Ut=Re(Ve.line,Ve.ch,It?dt.text.length+1:null).end,Kt=Re(We.line,It?0:null,We.ch).start;It&&(Ut.top<Kt.top-2?(ye(Ut.right,Ut.top,null,Ut.bottom),ye(Z,Kt.top,Kt.left,Kt.bottom)):ye(Ut.right,Ut.top,Kt.left-Ut.right,Ut.bottom)),Ut.bottom<Kt.top&&ye(Z,Ut.bottom,null,Kt.top)}i.appendChild(B)}function pr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ir(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ao(e){e.state.focused||(e.display.input.focus(),Ha(e))}function Wa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ir(e))},100)}function Ha(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,R(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),pr(e)}function ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ne(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ua(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var p=t.view[n],B=e.options.lineWrapping,J=void 0,Z=0;if(p.hidden)continue;if(H&&F<8){var $=p.node.offsetTop+p.node.offsetHeight;J=$-i,i=$}else{var ie=p.node.getBoundingClientRect();J=ie.bottom-ie.top,!B&&p.text.firstChild&&(Z=p.text.firstChild.getBoundingClientRect().right-ie.left-1)}var ye=p.line.height-J;if((ye>.005||ye<-.005)&&(sn(p.line,J),Oo(p.line),p.rest))for(var Re=0;Re<p.rest.length;Re++)Oo(p.rest[Re]);if(Z>e.display.sizerWidth){var Ve=Math.ceil(Z/_r(e.display));Ve>e.display.maxLineLength&&(e.display.maxLineLength=Ve,e.display.maxLine=p.line,e.display.maxLineChanged=!0)}}}function Oo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function da(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-ta(e));var p=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,B=mn(t,n),J=mn(t,p);if(i&&i.ensure){var Z=i.ensure.from.line,$=i.ensure.to.line;Z<B?(B=Z,J=mn(t,Ei(Ot(t,Z))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=J&&(B=mn(t,Ei(Ot(t,$))-e.wrapper.clientHeight),J=$)}return{from:B,to:Math.max(J,B+1)}}function Xo(e,t){if(qe(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),p=null;if(t.top+n.top<0?p=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(p=!1),p!=null&&!r){var B=u("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-ta(e.display))+`px;
height: `+(t.bottom-t.top+Yi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(p),e.display.lineSpace.removeChild(B)}}function Qo(e,t,i,n){n==null&&(n=0);var p;!e.options.lineWrapping&&t==i&&(t=t.ch?ft(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?ft(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var J=!1,Z=Wi(e,t),$=!i||i==t?Z:Wi(e,i);p={left:Math.min(Z.left,$.left),top:Math.min(Z.top,$.top)-n,right:Math.max(Z.left,$.left),bottom:Math.max(Z.bottom,$.bottom)+n};var ie=Ka(e,p),ye=e.doc.scrollTop,Re=e.doc.scrollLeft;if(ie.scrollTop!=null&&(zr(e,ie.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(J=!0)),ie.scrollLeft!=null&&(Cr(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-Re)>1&&(J=!0)),!J)break}return p}function Ro(e,t){var i=Ka(e,t);i.scrollTop!=null&&zr(e,i.scrollTop),i.scrollLeft!=null&&Cr(e,i.scrollLeft)}function Ka(e,t){var i=e.display,n=Rr(e.display);t.top<0&&(t.top=0);var p=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,B=ia(e),J={};t.bottom-t.top>B&&(t.bottom=t.top+B);var Z=e.doc.height+na(i),$=t.top<n,ie=t.bottom>Z-n;if(t.top<p)J.scrollTop=$?0:t.top;else if(t.bottom>p+B){var ye=Math.min(t.top,(ie?Z:t.bottom)-B);ye!=p&&(J.scrollTop=ye)}var Re=e.options.fixedGutter?0:i.gutters.offsetWidth,Ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Re,We=vr(e)-i.gutters.offsetWidth,dt=t.right-t.left>We;return dt&&(t.right=t.left+We),t.left<10?J.scrollLeft=0:t.left<Ve?J.scrollLeft=Math.max(0,t.left+Re-(dt?0:10)):t.right>We+Ve-3&&(J.scrollLeft=t.right+(dt?0:10)-We),J}function Ga(e,t){if(t==null)return;ca(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ir(e){ca(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Gr(e,t,i){(t!=null||i!=null)&&ca(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Jo(e,t){ca(e),e.curOp.scrollToPos=t}function ca(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=xo(e,t.from),n=xo(e,t.to);rr(e,i,n,t.margin)}}function rr(e,t,i,n){var p=Ka(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});Gr(e,p.scrollLeft,p.scrollTop)}function zr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Xr(e,{top:t}),Io(e,t,!0),N&&Xr(e),Qi(e,100)}function Io(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Cr(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,fa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+na(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?i:0,docHeight:n,scrollHeight:n+Yi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var kt=function(e,t,i){this.cm=i;var n=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),p=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=p.tabIndex=-1,e(n),e(p),Oe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Oe(p,"scroll",function(){p.clientWidth&&t(p.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};kt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var p=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+p)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"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:i?n:0,bottom:t?n:0}},kt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},kt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},kt.prototype.zeroWidthHack=function(){var e=l&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},kt.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var p=e.getBoundingClientRect(),B=i=="vert"?document.elementFromPoint(p.right-1,(p.top+p.bottom)/2):document.elementFromPoint((p.right+p.left)/2,p.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},kt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ue=function(){};ue.prototype.update=function(){return{bottom:0,right:0}},ue.prototype.setScrollLeft=function(){},ue.prototype.setScrollTop=function(){},ue.prototype.clear=function(){};function nt(e,t){t||(t=Vr(e));var i=e.display.barWidth,n=e.display.barHeight;Fe(e,t);for(var p=0;p<4&&i!=e.display.barWidth||n!=e.display.barHeight;p++)i!=e.display.barWidth&&e.options.lineWrapping&&ua(e),Fe(e,Vr(e)),i=e.display.barWidth,n=e.display.barHeight}function Fe(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var wt={native:kt,null:ue};function gt(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wt[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Cr(e,t):zr(e,t)},e),e.display.scrollbars.addClass&&R(e.display.wrapper,e.display.scrollbars.addClass)}var Nt=0;function zt(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:++Nt},Ti(e.curOp)}function Dt(e){var t=e.curOp;t&&Mn(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;rn(i)})}function rn(e){for(var t=e.ops,i=0;i<t.length;i++)Ht(t[i]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var p=0;p<t.length;p++)Tn(t[p]);for(var B=0;B<t.length;B++)Yn(t[B]);for(var J=0;J<t.length;J++)ln(t[J])}function Ht(e){var t=e.cm,i=t.display;Va(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Lr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Mt(e){e.updatedDisplay=e.mustUpdate&&Yr(e.cm,e.update)}function Tn(e){var t=e.cm,i=t.display;e.updatedDisplay&&ua(t),e.barMeasure=Vr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=La(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Yi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-vr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Yn(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Cr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&nt(t,e.barMeasure),e.updatedDisplay&&Jr(t,e.barMeasure),e.selectionChanged&&pr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ao(e.cm)}function ln(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&ha(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Io(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Cr(t,e.scrollLeft,!0,!0),e.scrollToPos){var p=Qo(t,C(n,e.scrollToPos.from),C(n,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,p)}var B=e.maybeHiddenMarkers,J=e.maybeUnhiddenMarkers;if(B)for(var Z=0;Z<B.length;++Z)B[Z].lines.length||Ne(B[Z],"hide");if(J)for(var $=0;$<J.length;++$)J[$].lines.length&&Ne(J[$],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Dn(e,t){if(e.curOp)return t();zt(e);try{return t()}finally{Dt(e)}}function xn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);zt(e);try{return t.apply(e,arguments)}finally{Dt(e)}}}function Hn(e){return function(){if(this.curOp)return e.apply(this,arguments);zt(this);try{return e.apply(this,arguments)}finally{Dt(this)}}}function Nn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);zt(t);try{return e.apply(this,arguments)}finally{Dt(t)}}}function Qi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(za,e))}function za(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=St(e,t.highlightFrontier),p=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(n.line>=e.display.viewFrom){var J=B.styles,Z=B.text.length>e.options.maxHighlightLength?Ct(t.mode,n.state):null,$=Se(e,B,n,!0);Z&&(n.state=Z),B.styles=$.styles;var ie=B.styleClasses,ye=$.classes;ye?B.styleClasses=ye:ie&&(B.styleClasses=null);for(var Re=!J||J.length!=B.styles.length||ie!=ye&&(!ie||!ye||ie.bgClass!=ye.bgClass||ie.textClass!=ye.textClass),Ve=0;!Re&&Ve<J.length;++Ve)Re=J[Ve]!=B.styles[Ve];Re&&p.push(n.line),B.stateAfter=n.save(),n.nextLine()}else B.text.length<=e.options.maxHighlightLength&&Pt(e,B.text,n),B.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Qi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),p.length&&Dn(e,function(){for(var B=0;B<p.length;B++)hr(e,p[B],"text")})}var Lr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=da(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=vr(e),this.force=i,this.dims=oa(e),this.events=[]};Lr.prototype.signal=function(e,t){fe(e,t)&&this.events.push(arguments)},Lr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.apply(null,this.events[e])};function Va(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yi(e)+"px",t.scrollbarsClipped=!0)}function Ya(e){if(e.hasFocus())return null;var t=P();if(!t||!y(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&y(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function Xa(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Yr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return fr(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&So(e)==0)return!1;pa(e)&&(fr(e),t.dims=oa(e));var p=n.first+n.size,B=Math.max(t.visible.from-e.options.viewportMargin,n.first),J=Math.min(p,t.visible.to+e.options.viewportMargin);i.viewFrom<B&&B-i.viewFrom<20&&(B=Math.max(n.first,i.viewFrom)),i.viewTo>J&&i.viewTo-J<20&&(J=Math.min(p,i.viewTo)),Kn&&(B=qi(e.doc,B),J=ci(e.doc,J));var Z=B!=i.viewFrom||J!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Fa(e,B,J),i.viewOffset=Ei(Ot(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var $=So(e);if(!Z&&$==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=Ya(e);return $>4&&(i.lineDiv.style.display="none"),Qa(e,i.updateLineNumbers,t.dims),$>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Xa(ie),g(i.cursorDiv),g(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Qi(e,400)),i.updateLineNumbers=null,!0}function ha(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==vr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+na(e.display)-ia(e),i.top)}),t.visible=da(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=da(e.display,e.doc,i));if(!Yr(e,t))break;ua(e);var p=Vr(e);Tr(e),nt(e,p),Jr(e,p),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 Xr(e,t){var i=new Lr(e,t);if(Yr(e,i)){ua(e),ha(e,i);var n=Vr(e);Tr(e),nt(e,n),Jr(e,n),i.finish()}}function Qa(e,t,i){var n=e.display,p=e.options.lineNumbers,B=n.lineDiv,J=B.firstChild;function Z(dt){var _t=dt.nextSibling;return k&&l&&e.display.currentWheelTarget==dt?dt.style.display="none":dt.parentNode.removeChild(dt),_t}for(var $=n.view,ie=n.viewFrom,ye=0;ye<$.length;ye++){var Re=$[ye];if(!Re.hidden)if(!Re.node||Re.node.parentNode!=B){var Ve=Go(e,Re,ie,i);B.insertBefore(Ve,J)}else{for(;J!=Re.node;)J=Z(J);var We=p&&t!=null&&t<=ie&&Re.lineNumber;Re.changes&&(se(Re.changes,"gutter")>-1&&(We=!1),dr(e,Re,ie,i)),We&&(g(Re.lineNumber),Re.lineNumber.appendChild(document.createTextNode(Un(e.options,ie)))),J=Re.node.nextSibling}ie+=Re.size}for(;J;)J=Z(J)}function Qr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Jr(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+Yi(e)+"px"}function fa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Ua(t)-t.scroller.scrollLeft+e.doc.scrollLeft,p=t.gutters.offsetWidth,B=n+"px",J=0;J<i.length;J++)if(!i[J].hidden){e.options.fixedGutter&&(i[J].gutter&&(i[J].gutter.style.left=B),i[J].gutterBackground&&(i[J].gutterBackground.style.left=B));var Z=i[J].alignable;if(Z)for(var $=0;$<Z.length;$++)Z[$].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=n+p+"px")}function pa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Un(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var p=n.measure.appendChild(u("div",[u("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=p.firstChild.offsetWidth,J=p.offsetWidth-B;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(B,n.lineGutter.offsetWidth-J)+1,n.lineNumWidth=n.lineNumInnerWidth+J,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Qr(e.display),!0}return!1}function Zr(e,t){for(var i=[],n=!1,p=0;p<e.length;p++){var B=e[p],J=null;if(typeof B!="string"&&(J=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:B,style:J})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function ma(e){var t=e.gutters,i=e.gutterSpecs;g(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var p=i[n],B=p.className,J=p.style,Z=t.appendChild(u("div",null,"CodeMirror-gutter "+B));J&&(Z.style.cssText=J),B=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Qr(e)}function Sr(e){ma(e.display),Zn(e),fa(e)}function Ja(e,t,i,n){var p=this;this.input=i,p.scrollbarFiller=u("div",null,"CodeMirror-scrollbar-filler"),p.scrollbarFiller.setAttribute("cm-not-content","true"),p.gutterFiller=u("div",null,"CodeMirror-gutter-filler"),p.gutterFiller.setAttribute("cm-not-content","true"),p.lineDiv=E("div",null,"CodeMirror-code"),p.selectionDiv=u("div",null,null,"position: relative; z-index: 1"),p.cursorDiv=u("div",null,"CodeMirror-cursors"),p.measure=u("div",null,"CodeMirror-measure"),p.lineMeasure=u("div",null,"CodeMirror-measure"),p.lineSpace=E("div",[p.measure,p.lineMeasure,p.selectionDiv,p.cursorDiv,p.lineDiv],null,"position: relative; outline: none");var B=E("div",[p.lineSpace],"CodeMirror-lines");p.mover=u("div",[B],null,"position: relative"),p.sizer=u("div",[p.mover],"CodeMirror-sizer"),p.sizerWidth=null,p.heightForcer=u("div",null,null,"position: absolute; height: "+ce+"px; width: 1px;"),p.gutters=u("div",null,"CodeMirror-gutters"),p.lineGutter=null,p.scroller=u("div",[p.sizer,p.heightForcer,p.gutters],"CodeMirror-scroll"),p.scroller.setAttribute("tabIndex","-1"),p.wrapper=u("div",[p.scrollbarFiller,p.gutterFiller,p.scroller],"CodeMirror"),H&&F<8&&(p.gutters.style.zIndex=-1,p.scroller.style.paddingRight=0),!k&&!(N&&a)&&(p.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(p.wrapper):e(p.wrapper)),p.viewFrom=p.viewTo=t.first,p.reportedViewFrom=p.reportedViewTo=t.first,p.view=[],p.renderedView=null,p.externalMeasured=null,p.viewOffset=0,p.lastWrapHeight=p.lastWrapWidth=0,p.updateLineNumbers=null,p.nativeBarWidth=p.barHeight=p.barWidth=0,p.scrollbarsClipped=!1,p.lineNumWidth=p.lineNumInnerWidth=p.lineNumChars=null,p.alignWidgets=!1,p.cachedCharWidth=p.cachedTextHeight=p.cachedPaddingH=null,p.maxLine=null,p.maxLineLength=0,p.maxLineChanged=!1,p.wheelDX=p.wheelDY=p.wheelStartX=p.wheelStartY=null,p.shift=!1,p.selForContextMenu=null,p.activeTouch=null,p.gutterSpecs=Zr(n.gutters,n.lineNumbers),ma(p),i.init(p)}var Dr=0,vi=null;H?vi=-.53:N?vi=15:v?vi=-.7:c&&(vi=-1/3);function ga(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function fs(e){var t=ga(e);return t.x*=vi,t.y*=vi,t}function hi(e,t){var i=ga(t),n=i.x,p=i.y,B=e.display,J=B.scroller,Z=J.scrollWidth>J.clientWidth,$=J.scrollHeight>J.clientHeight;if(!(n&&Z||p&&$))return;if(p&&l&&k){e:for(var ie=t.target,ye=B.view;ie!=J;ie=ie.parentNode)for(var Re=0;Re<ye.length;Re++)if(ye[Re].node==ie){e.display.currentWheelTarget=ie;break e}}if(n&&!N&&!m&&vi!=null){p&&$&&zr(e,Math.max(0,J.scrollTop+p*vi)),Cr(e,Math.max(0,J.scrollLeft+n*vi)),(!p||p&&$)&&re(t),B.wheelStartX=null;return}if(p&&vi!=null){var Ve=p*vi,We=e.doc.scrollTop,dt=We+B.wrapper.clientHeight;Ve<0?We=Math.max(0,We+Ve-50):dt=Math.min(e.doc.height,dt+Ve+50),Xr(e,{top:We,bottom:dt})}Dr<20&&(B.wheelStartX==null?(B.wheelStartX=J.scrollLeft,B.wheelStartY=J.scrollTop,B.wheelDX=n,B.wheelDY=p,setTimeout(function(){if(B.wheelStartX==null)return;var _t=J.scrollLeft-B.wheelStartX,It=J.scrollTop-B.wheelStartY,Ut=It&&B.wheelDY&&It/B.wheelDY||_t&&B.wheelDX&&_t/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Ut)return;vi=(vi*Dr+Ut)/(Dr+1),++Dr},200)):(B.wheelDX+=n,B.wheelDY+=p))}var Bn=function(e,t){this.ranges=e,this.primIndex=t};Bn.prototype.primary=function(){return this.ranges[this.primIndex]},Bn.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 i=this.ranges[t],n=e.ranges[t];if(!Qt(i.anchor,n.anchor)||!Qt(i.head,n.head))return!1}return!0},Bn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Cn($t(this.ranges[t].anchor),$t(this.ranges[t].head));return new Bn(e,this.primIndex)},Bn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Bn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Wt(t,n.from())>=0&&Wt(e,n.to())<=0)return i}return-1};var Cn=function(e,t){this.anchor=e,this.head=t};Cn.prototype.from=function(){return fn(this.anchor,this.head)},Cn.prototype.to=function(){return en(this.anchor,this.head)},Cn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function fi(e,t,i){var n=e&&e.options.selectionsMayTouch,p=t[i];t.sort(function(Ve,We){return Wt(Ve.from(),We.from())}),i=se(t,p);for(var B=1;B<t.length;B++){var J=t[B],Z=t[B-1],$=Wt(Z.to(),J.from());if(n&&!J.empty()?$>0:$>=0){var ie=fn(Z.from(),J.from()),ye=en(Z.to(),J.to()),Re=Z.empty()?J.from()==J.head:Z.from()==Z.head;B<=i&&--i,t.splice(--B,2,new Cn(Re?ye:ie,Re?ie:ye))}}return new Bn(t,i)}function Si(e,t){return new Bn([new Cn(e,t||e)],0)}function tr(e){return e.text?ft(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ar(e,t){if(Wt(e,t.from)<0)return e;if(Wt(e,t.to)<=0)return tr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=tr(t).ch-t.to.ch),ft(i,n)}function va(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var p=e.sel.ranges[n];i.push(new Cn(ar(p.anchor,t),ar(p.head,t)))}return fi(e.cm,i,e.sel.primIndex)}function ps(e,t,i){return e.line==t.line?ft(i.line,e.ch-t.ch+i.ch):ft(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],p=ft(e.first,0),B=p,J=0;J<t.length;J++){var Z=t[J],$=ps(Z.from,p,B),ie=ps(tr(Z),p,B);if(p=Z.to,B=ie,i=="around"){var ye=e.sel.ranges[J],Re=Wt(ye.head,ye.anchor)<0;n[J]=new Cn(Re?ie:$,Re?$:ie)}else n[J]=new Cn($,$)}return new Bn(n,e.sel.primIndex)}function Zo(e){e.doc.mode=Be(e.options,e.doc.modeOption),Za(e)}function Za(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,Qi(e,100),e.state.modeGen++,e.curOp&&Zn(e)}function ms(e,t){return t.from.ch==0&&t.to.ch==0&&ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function qo(e,t,i,n){function p(Kt){return i?i[Kt]:null}function B(Kt,Bt,Yt){ur(Kt,Bt,Yt,n),On(Kt,"change",Kt,t)}function J(Kt,Bt){for(var Yt=[],on=Kt;on<Bt;++on)Yt.push(new xi(ie[on],p(on),n));return Yt}var Z=t.from,$=t.to,ie=t.text,ye=Ot(e,Z.line),Re=Ot(e,$.line),Ve=ne(ie),We=p(ie.length-1),dt=$.line-Z.line;if(t.full)e.insert(0,J(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(ms(e,t)){var _t=J(0,ie.length-1);B(Re,Re.text,We),dt&&e.remove(Z.line,dt),_t.length&&e.insert(Z.line,_t)}else if(ye==Re)if(ie.length==1)B(ye,ye.text.slice(0,Z.ch)+Ve+ye.text.slice($.ch),We);else{var It=J(1,ie.length-1);It.push(new xi(Ve+ye.text.slice($.ch),We,n)),B(ye,ye.text.slice(0,Z.ch)+ie[0],p(0)),e.insert(Z.line+1,It)}else if(ie.length==1)B(ye,ye.text.slice(0,Z.ch)+ie[0]+Re.text.slice($.ch),p(0)),e.remove(Z.line+1,dt);else{B(ye,ye.text.slice(0,Z.ch)+ie[0],p(0)),B(Re,Ve+Re.text.slice($.ch),We);var Ut=J(1,ie.length-1);dt>1&&e.remove(Z.line+1,dt-1),e.insert(Z.line+1,Ut)}On(e,"change",e,t)}function Mr(e,t,i){function n(p,B,J){if(p.linked)for(var Z=0;Z<p.linked.length;++Z){var $=p.linked[Z];if($.doc==B)continue;var ie=J&&$.sharedHist;if(i&&!ie)continue;t($.doc,ie),n($.doc,p,ie)}}n(e,null,!0)}function gs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,sa(e),Zo(e),vs(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,Zn(e)}function vs(e){(e.doc.direction=="rtl"?R:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Dn(e,function(){vs(e),Zn(e)})}function Lo(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 $o(e,t){var i={from:$t(t.from),to:tr(t),text:Zt(e,t.from,t.to)};return _s(e,i,t.from.line,t.to.line+1),Mr(e,function(n){return _s(n,i,t.from.line,t.to.line+1)},!0),i}function ys(e){for(;e.length;){var t=ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(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 bs(e,t,i,n){var p=e.history;p.undone.length=0;var B=+new Date,J,Z;if((p.lastOp==n||p.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&p.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(J=pl(p,p.lastOp==n)))Z=ne(J.changes),Wt(t.from,t.to)==0&&Wt(t.from,Z.to)==0?Z.to=tr(t):J.changes.push($o(e,t));else{var $=ne(p.done);for((!$||!$.ranges)&&Do(e.sel,p.done),J={changes:[$o(e,t)],generation:p.generation},p.done.push(J);p.done.length>p.undoDepth;)p.done.shift(),p.done[0].ranges||p.done.shift()}p.done.push(i),p.generation=++p.maxGeneration,p.lastModTime=p.lastSelTime=B,p.lastOp=p.lastSelOp=n,p.lastOrigin=p.lastSelOrigin=t.origin,Z||Ne(e,"historyAdded")}function ml(e,t,i,n){var p=t.charAt(0);return p=="*"||p=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var p=e.history,B=n&&n.origin;i==p.lastSelOp||B&&p.lastSelOrigin==B&&(p.lastModTime==p.lastSelTime&&p.lastOrigin==B||ml(e,B,ne(p.done),t))?p.done[p.done.length-1]=t:Do(t,p.done),p.lastSelTime=+new Date,p.lastSelOrigin=B,p.lastSelOp=i,n&&n.clearRedo!==!1&&ys(p.undone)}function Do(e,t){var i=ne(t);i&&i.ranges&&i.equals(e)||t.push(e)}function _s(e,t,i,n){var p=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(J){J.markedSpans&&((p||(p=t["spans_"+e.id]={}))[B]=J.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],p=0;p<t.text.length;++p)n.push(vl(i[p]));return n}function Es(e,t){var i=yl(e,t),n=Ni(e,t);if(!i)return n;if(!n)return i;for(var p=0;p<i.length;++p){var B=i[p],J=n[p];if(B&&J){e:for(var Z=0;Z<J.length;++Z){for(var $=J[Z],ie=0;ie<B.length;++ie)if(B[ie].marker==$.marker)continue e;B.push($)}}else J&&(i[p]=J)}return i}function ya(e,t,i){for(var n=[],p=0;p<e.length;++p){var B=e[p];if(B.ranges){n.push(i?Bn.prototype.deepCopy.call(B):B);continue}var J=B.changes,Z=[];n.push({changes:Z});for(var $=0;$<J.length;++$){var ie=J[$],ye=void 0;if(Z.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var Re in ie)(ye=Re.match(/^spans_(\d+)$/))&&(se(t,Number(ye[1]))>-1&&(ne(Z)[Re]=ie[Re],delete ie[Re]))}}return n}function es(e,t,i,n){if(n){var p=e.anchor;if(i){var B=Wt(t,p)<0;B!=Wt(i,p)<0?(p=t,t=i):B!=Wt(t,i)<0&&(t=i)}return new Cn(p,t)}else return new Cn(i||t,t)}function Mo(e,t,i,n,p){p==null&&(p=e.cm&&(e.cm.display.shift||e.extend)),yi(e,new Bn([es(e.sel.primary(),t,i,p)],0),n)}function xs(e,t,i){for(var n=[],p=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)n[B]=es(e.sel.ranges[B],t[B],null,p);var J=fi(e.cm,n,e.sel.primIndex);yi(e,J,i)}function ts(e,t,i,n){var p=e.sel.ranges.slice(0);p[t]=i,yi(e,fi(e.cm,p,e.sel.primIndex),n)}function Ts(e,t,i,n){yi(e,Si(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(p){this.ranges=[];for(var B=0;B<p.length;B++)this.ranges[B]=new Cn(C(e,p[B].anchor),C(e,p[B].head))},origin:i&&i.origin};return Ne(e,"beforeSelectionChange",e,n),e.cm&&Ne(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?fi(e.cm,n.ranges,n.ranges.length-1):t}function Cs(e,t,i){var n=e.history.done,p=ne(n);p&&p.ranges?(n[n.length-1]=t,ko(e,t,i)):yi(e,t,i)}function yi(e,t,i){ko(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function ko(e,t,i){(fe(e,"beforeSelectionChange")||e.cm&&fe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Wt(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,As(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Ir(e.cm)}function Ss(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),On(e,"cursorActivity",e)}function ws(e){Ss(e,As(e,e.sel,null,!1))}function As(e,t,i,n){for(var p,B=0;B<t.ranges.length;B++){var J=t.ranges[B],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],$=Po(e,J.anchor,Z&&Z.anchor,i,n),ie=Po(e,J.head,Z&&Z.head,i,n);(p||$!=J.anchor||ie!=J.head)&&(p||(p=t.ranges.slice(0,B)),p[B]=new Cn($,ie))}return p?fi(e.cm,p,t.primIndex):t}function ba(e,t,i,n,p){var B=Ot(e,t.line);if(B.markedSpans)for(var J=0;J<B.markedSpans.length;++J){var Z=B.markedSpans[J],$=Z.marker,ie="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,ye="selectRight"in $?!$.selectRight:$.inclusiveRight;if((Z.from==null||(ie?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(ye?Z.to>=t.ch:Z.to>t.ch))){if(p&&(Ne($,"beforeCursorEnter"),$.explicitlyCleared))if(B.markedSpans){--J;continue}else break;if(!$.atomic)continue;if(i){var Re=$.find(n<0?1:-1),Ve=void 0;if((n<0?ye:ie)&&(Re=Os(e,Re,-n,Re&&Re.line==t.line?B:null)),Re&&Re.line==t.line&&(Ve=Wt(Re,i))&&(n<0?Ve<0:Ve>0))return ba(e,Re,t,n,p)}var We=$.find(n<0?-1:1);return(n<0?ie:ye)&&(We=Os(e,We,n,We.line==t.line?B:null)),We?ba(e,We,t,n,p):null}}return t}function Po(e,t,i,n,p){var B=n||1,J=ba(e,t,i,B,p)||!p&&ba(e,t,i,B,!0)||ba(e,t,i,-B,p)||!p&&ba(e,t,i,-B,!0);return J||(e.cantEdit=!0,ft(e.first,0))}function Os(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?C(e,ft(t.line-1)):null:i>0&&t.ch==(n||Ot(e,t.line)).text.length?t.line<e.first+e.size-1?ft(t.line+1,0):null:new ft(t.line,t.ch+i)}function Rs(e){e.setSelection(ft(e.firstLine(),0),ft(e.lastLine()),Ce)}function Is(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(p,B,J,Z){p&&(n.from=C(e,p)),B&&(n.to=C(e,B)),J&&(n.text=J),Z!==void 0&&(n.origin=Z)}),Ne(e,"beforeChange",e,n),e.cm&&Ne(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 _a(e,t,i){if(e.cm){if(!e.cm.curOp)return xn(e.cm,_a)(e,t,i);if(e.cm.state.suppressEdits)return}if((fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"))&&(t=Is(e,t,!0),!t))return;var n=ki&&!i&&Ui(e,t.from,t.to);if(n)for(var p=n.length-1;p>=0;--p)Ls(e,{from:n[p].from,to:n[p].to,text:p?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Wt(t.from,t.to)==0)return;var i=va(e,t);bs(e,t,i,e.cm?e.cm.curOp.id:NaN),qa(e,t,i,Ni(e,t));var n=[];Mr(e,function(p,B){!B&&se(n,p.history)==-1&&(Ps(p.history,t),n.push(p.history)),qa(p,t,null,Ni(p,t))})}function No(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var p=e.history,B,J=e.sel,Z=t=="undo"?p.done:p.undone,$=t=="undo"?p.undone:p.done,ie=0;ie<Z.length&&!(B=Z[ie],i?B.ranges&&!B.equals(e.sel):!B.ranges);ie++);if(ie==Z.length)return;for(p.lastOrigin=p.lastSelOrigin=null;;)if(B=Z.pop(),B.ranges){if(Do(B,$),i&&!B.equals(e.sel)){yi(e,B,{clearRedo:!1});return}J=B}else if(n){Z.push(B);return}else break;var ye=[];Do(J,$),$.push({changes:ye,generation:p.generation}),p.generation=B.generation||++p.maxGeneration;for(var Re=fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"),Ve=function(_t){var It=B.changes[_t];if(It.origin=t,Re&&!Is(e,It,!1))return Z.length=0,{};ye.push($o(e,It));var Ut=_t?va(e,It):ne(Z);qa(e,It,Ut,Es(e,It)),!_t&&e.cm&&e.cm.scrollIntoView({from:It.from,to:tr(It)});var Kt=[];Mr(e,function(Bt,Yt){!Yt&&se(Kt,Bt.history)==-1&&(Ps(Bt.history,It),Kt.push(Bt.history)),qa(Bt,It,null,Es(Bt,It))})},We=B.changes.length-1;We>=0;--We){var dt=Ve(We);if(dt)return dt.v}}function Ds(e,t){if(t==0)return;if(e.first+=t,e.sel=new Bn(ge(e.sel.ranges,function(p){return new Cn(ft(p.anchor.line+t,p.anchor.ch),ft(p.head.line+t,p.head.ch))}),e.sel.primIndex),e.cm){Zn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)hr(e.cm,n,"gutter")}}function qa(e,t,i,n){if(e.cm&&!e.cm.curOp)return xn(e.cm,qa)(e,t,i,n);if(t.to.line<e.first){Ds(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 p=t.text.length-1-(e.first-t.from.line);Ds(e,p),t={from:ft(e.first,0),to:ft(t.to.line+p,t.to.ch),text:[ne(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:ft(B,Ot(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zt(e,t.from,t.to),i||(i=va(e,t)),e.cm?_l(e.cm,t,n):qo(e,t,n),ko(e,i,Ce),e.cantEdit&&Po(e,ft(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,p=e.display,B=t.from,J=t.to,Z=!1,$=B.line;e.options.lineWrapping||($=Xt(gn(Ot(n,B.line))),n.iter($,J.line+1,function(We){if(We==p.maxLine)return Z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Te(e),qo(n,t,i,Ba(e)),e.options.lineWrapping||(n.iter($,B.line+t.text.length,function(We){var dt=lr(We);dt>p.maxLineLength&&(p.maxLine=We,p.maxLineLength=dt,p.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),mi(n,B.line),Qi(e,400);var ie=t.text.length-(J.line-B.line)-1;t.full?Zn(e):B.line==J.line&&t.text.length==1&&!ms(e.doc,t)?hr(e,B.line,"text"):Zn(e,B.line,J.line+1,ie);var ye=fe(e,"changes"),Re=fe(e,"change");if(Re||ye){var Ve={from:B,to:J,text:t.text,removed:t.removed,origin:t.origin};Re&&On(e,"change",e,Ve),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ve)}e.display.selForContextMenu=null}function Ea(e,t,i,n,p){var B;n||(n=i),Wt(n,i)<0&&(B=[n,i],i=B[0],n=B[1]),typeof t=="string"&&(t=e.splitLines(t)),_a(e,{from:i,to:n,text:t,origin:p})}function Ms(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ks(e,t,i,n){for(var p=0;p<e.length;++p){var B=e[p],J=!0;if(B.ranges){B.copied||(B=e[p]=B.deepCopy(),B.copied=!0);for(var Z=0;Z<B.ranges.length;Z++)Ms(B.ranges[Z].anchor,t,i,n),Ms(B.ranges[Z].head,t,i,n);continue}for(var $=0;$<B.changes.length;++$){var ie=B.changes[$];if(i<ie.from.line)ie.from=ft(ie.from.line+n,ie.from.ch),ie.to=ft(ie.to.line+n,ie.to.ch);else if(t<=ie.to.line){J=!1;break}}J||(e.splice(0,p+1),p=0)}}function Ps(e,t){var i=t.from.line,n=t.to.line,p=t.text.length-(n-i)-1;ks(e.done,i,n,p),ks(e.undone,i,n,p)}function $a(e,t,i,n){var p=t,B=t;return typeof t=="number"?B=Ot(e,Y(e,t)):p=Xt(t),p==null?null:(n(B,p)&&e.cm&&hr(e.cm,p,i),B)}function eo(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}eo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var p=this.lines[i];this.height-=p.height,Gt(p),On(p,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,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,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function to(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var p=e[n];t+=p.chunkSize(),i+=p.height,p.parent=this}this.size=t,this.height=i,this.parent=null}to.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],p=n.chunkSize();if(e<p){var B=Math.min(t,p-e),J=n.height;if(n.removeInner(e,B),this.height-=J-n.height,p==B&&(this.children.splice(i--,1),n.parent=null),(t-=B)==0)break;e=0}else e-=p}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof eo))){var Z=[];this.collapse(Z),this.children=[new eo(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,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var p=this.children[n],B=p.chunkSize();if(e<=B){if(p.insertInner(e,t,i),p.lines&&p.lines.length>50){for(var J=p.lines.length%25+25,Z=J;Z<p.lines.length;){var $=new eo(p.lines.slice(Z,Z+=25));p.height-=$.height,this.children.splice(++n,0,$),$.parent=this}p.lines=p.lines.slice(0,J),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new to(t);if(e.parent){e.size-=i.size,e.height-=i.height;var p=se(e.parent.children,e);e.parent.children.splice(p+1,0,i)}else{var n=new to(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var p=this.children[n],B=p.chunkSize();if(e<B){var J=Math.min(t,B-e);if(p.iterN(e,J,i))return!0;if((t-=J)==0)break;e=0}else e-=B}}};var no=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};no.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Xt(i);if(n==null||!t)return;for(var p=0;p<t.length;++p)t[p]==this&&t.splice(p--,1);t.length||(i.widgets=null);var B=gr(this);sn(i,Math.max(0,i.height-B)),e&&(Dn(e,function(){Ns(e,i,-B),hr(e,n,"widget")}),On(e,"lineWidgetCleared",e,this,n))},no.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var p=gr(this)-t;if(!p)return;Fi(this.doc,n)||sn(n,n.height+p),i&&Dn(i,function(){i.curOp.forceUpdate=!0,Ns(i,n,p),On(i,"lineWidgetChanged",i,e,Xt(n))})},me(no);function Ns(e,t,i){Ei(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ga(e,i)}function El(e,t,i,n){var p=new no(e,i,n),B=e.cm;return B&&p.noHScroll&&(B.display.alignWidgets=!0),$a(e,t,"widget",function(J){var Z=J.widgets||(J.widgets=[]);if(p.insertAt==null?Z.push(p):Z.splice(Math.min(Z.length-1,Math.max(0,p.insertAt)),0,p),p.line=J,B&&!Fi(e,J)){var $=Ei(J)<e.scrollTop;sn(J,J.height+gr(p)),$&&Ga(B,p.height),B.curOp.forceUpdate=!0}return!0}),B&&On(B,"lineWidgetAdded",B,p,typeof t=="number"?t:Xt(t)),p}var Us=0,kr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};kr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&zt(e),fe(this,"clear")){var i=this.find();i&&On(this,"clear",i.from,i.to)}for(var n=null,p=null,B=0;B<this.lines.length;++B){var J=this.lines[B],Z=ni(J.markedSpans,this);e&&!this.collapsed?hr(e,Xt(J),"text"):e&&(Z.to!=null&&(p=Xt(J)),Z.from!=null&&(n=Xt(J))),J.markedSpans=Ki(J.markedSpans,Z),Z.from==null&&this.collapsed&&!Fi(this.doc,J)&&e&&sn(J,Rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var ie=gn(this.lines[$]),ye=lr(ie);ye>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Zn(e,n,p+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ws(e.doc)),e&&On(e,"markerCleared",e,this,n,p),t&&Dt(e),this.parent&&this.parent.clear()},kr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,p=0;p<this.lines.length;++p){var B=this.lines[p],J=ni(B.markedSpans,this);if(J.from!=null&&(i=ft(t?B:Xt(B),J.from),e==-1))return i;if(J.to!=null&&(n=ft(t?B:Xt(B),J.to),e==1))return n}return i&&{from:i,to:n}},kr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Dn(n,function(){var p=t.line,B=Xt(t.line),J=Ci(n,B);if(J&&(_o(J),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Fi(i.doc,p)&&i.height!=null){var Z=i.height;i.height=null;var $=gr(i)-Z;$&&sn(p,p.height+$)}On(n,"markerChanged",n,e)})},kr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},kr.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},me(kr);function xa(e,t,i,n,p){if(n&&n.shared)return xl(e,t,i,n,p);if(e.cm&&!e.cm.curOp)return xn(e.cm,xa)(e,t,i,n,p);var B=new kr(e,p),J=Wt(t,i);if(n&&A(n,B,!1),J>0||J==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=E("span",[B.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(Qn(e,t.line,t,i,B)||t.line!=i.line&&Qn(e,i.line,t,i,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ai()}B.addToHistory&&bs(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,$=e.cm,ie;if(e.iter(Z,i.line+1,function(Re){$&&B.collapsed&&!$.options.lineWrapping&&gn(Re)==$.display.maxLine&&(ie=!0),B.collapsed&&Z!=t.line&&sn(Re,0),Pi(Re,new _i(B,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),B.collapsed&&e.iter(t.line,i.line+1,function(Re){Fi(e,Re)&&sn(Re,0)}),B.clearOnEnter&&Oe(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(si(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++Us,B.atomic=!0),$){if(ie&&($.curOp.updateMaxLine=!0),B.collapsed)Zn($,t.line,i.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var ye=t.line;ye<=i.line;ye++)hr($,ye,"text");B.atomic&&ws($.doc),On($,"markerAdded",$,B)}return B}var io=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};io.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();On(this,"clear")},io.prototype.find=function(e,t){return this.primary.find(e,t)},me(io);function xl(e,t,i,n,p){n=A(n),n.shared=!1;var B=[xa(e,t,i,n,p)],J=B[0],Z=n.widgetNode;return Mr(e,function($){Z&&(n.widgetNode=Z.cloneNode(!0)),B.push(xa($,C($,t),C($,i),n,p));for(var ie=0;ie<$.linked.length;++ie)if($.linked[ie].isParent)return;J=ne(B)}),new io(B,J)}function Bs(e){return e.findMarks(ft(e.first,0),e.clipPos(ft(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],p=n.find(),B=e.clipPos(p.from),J=e.clipPos(p.to);if(Wt(B,J)){var Z=xa(e,B,J,n.primary,n.primary.type);n.markers.push(Z),Z.parent=n}}}function Cl(e){for(var t=function(n){var p=e[n],B=[p.primary.doc];Mr(p.primary.doc,function($){return B.push($)});for(var J=0;J<p.markers.length;J++){var Z=p.markers[J];se(B,Z.doc)==-1&&(Z.parent=null,p.markers.splice(J--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Ii=function(e,t,i,n,p){if(!(this instanceof Ii))return new Ii(e,t,i,n,p);i==null&&(i=0),to.call(this,[new eo([new xi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var B=ft(i,0);this.sel=Si(B),this.history=new Lo(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=p=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),qo(this,{from:B,to:B,text:e}),yi(this,Si(B),Ce)};Ii.prototype=Ue(to.prototype,{constructor:Ii,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=un(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Nn(function(e){var t=ft(this.first,0),i=this.first+this.size-1;_a(this,{from:t,to:ft(i,Ot(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Gr(this.cm,0,0),yi(this,Si(t),Ce)}),replaceRange:function(e,t,i,n){t=C(this,t),i=i?C(this,i):t,Ea(this,e,t,i,n)},getRange:function(e,t,i){var n=Zt(this,C(this,e),C(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(kn(this,e))return Ot(this,e)},getLineNumber:function(e){return Xt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ot(this,e)),gn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return C(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Nn(function(e,t,i){Ts(this,C(this,typeof e=="number"?ft(e,t||0):e),null,i)}),setSelection:Nn(function(e,t,i){Ts(this,C(this,e),C(this,t||e),i)}),extendSelection:Nn(function(e,t,i){Mo(this,C(this,e),t&&C(this,t),i)}),extendSelections:Nn(function(e,t){xs(this,G(this,e),t)}),extendSelectionsBy:Nn(function(e,t){var i=ge(this.sel.ranges,e);xs(this,G(this,i),t)}),setSelections:Nn(function(e,t,i){if(!e.length)return;for(var n=[],p=0;p<e.length;p++)n[p]=new Cn(C(this,e[p].anchor),C(this,e[p].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),yi(this,fi(this.cm,n,t),i)}),addSelection:Nn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Cn(C(this,e),C(this,t||e))),yi(this,fi(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var p=Zt(this,t[n].from(),t[n].to());i=i?i.concat(p):p}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var p=Zt(this,i[n].from(),i[n].to());e!==!1&&(p=p.join(e||this.lineSeparator())),t[n]=p}return t},replaceSelection:function(e,t,i){for(var n=[],p=0;p<this.sel.ranges.length;p++)n[p]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:Nn(function(e,t,i){for(var n=[],p=this.sel,B=0;B<p.ranges.length;B++){var J=p.ranges[B];n[B]={from:J.from(),to:J.to(),text:this.splitLines(e[B]),origin:i}}for(var Z=t&&t!="end"&&hl(this,n,t),$=n.length-1;$>=0;$--)_a(this,n[$]);Z?Cs(this,Z):this.cm&&Ir(this.cm)}),undo:Nn(function(){No(this,"undo")}),redo:Nn(function(){No(this,"redo")}),undoSelection:Nn(function(){No(this,"undo",!0)}),redoSelection:Nn(function(){No(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var p=0;p<e.undone.length;p++)e.undone[p].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Lo(this.history.maxGeneration),Mr(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:ya(this.history.done),undone:ya(this.history.undone)}},setHistory:function(e){var t=this.history=new Lo(this.history.maxGeneration);t.done=ya(e.done.slice(0),null,!0),t.undone=ya(e.undone.slice(0),null,!0)},setGutterMarker:Nn(function(e,t,i){return $a(this,e,"gutter",function(n){var p=n.gutterMarkers||(n.gutterMarkers={});return p[t]=i,!i&&et(p)&&(n.gutterMarkers=null),!0})}),clearGutter:Nn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&$a(t,i,"gutter",function(){return i.gutterMarkers[e]=null,et(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!kn(this,e))return null;if(t=e,e=Ot(this,e),!e)return null}else if(t=Xt(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:Nn(function(e,t,i){return $a(this,e,t=="gutter"?"gutter":"class",function(n){var p=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[p])n[p]=i;else{if(S(i).test(n[p]))return!1;n[p]+=" "+i}return!0})}),removeLineClass:Nn(function(e,t,i){return $a(this,e,t=="gutter"?"gutter":"class",function(n){var p=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=n[p];if(B)if(i==null)n[p]=null;else{var J=B.match(S(i));if(!J)return!1;var Z=J.index+J[0].length;n[p]=B.slice(0,J.index)+(!J.index||Z==B.length?"":" ")+B.slice(Z)||null}else return!1;return!0})}),addLineWidget:Nn(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return xa(this,C(this,e),C(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=C(this,e),xa(this,e,e,i,"bookmark")},findMarksAt:function(e){e=C(this,e);var t=[],i=Ot(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var p=i[n];(p.from==null||p.from<=e.ch)&&(p.to==null||p.to>=e.ch)&&t.push(p.marker.parent||p.marker)}return t},findMarks:function(e,t,i){e=C(this,e),t=C(this,t);var n=[],p=e.line;return this.iter(e.line,t.line+1,function(B){var J=B.markedSpans;if(J)for(var Z=0;Z<J.length;Z++){var $=J[Z];!($.to!=null&&p==e.line&&e.ch>=$.to||$.from==null&&p!=e.line||$.from!=null&&p==t.line&&$.from>=t.ch)&&(!i||i($.marker))&&n.push($.marker.parent||$.marker)}++p}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(p){var B=p.text.length+n;if(B>e)return t=e,!0;e-=B,++i}),C(this,ft(i,t))},indexFromPos:function(e){e=C(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Ii(un(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Ii(un(this,t,i),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}],Tl(n,Bs(this)),n},unlinkDoc:function(e){if(e instanceof Xn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(Bs(this));break}if(e.history==this.history){var n=[e.id];Mr(e,function(p){return n.push(p.id)},!0),e.history=new Lo(null),e.history.done=ya(this.history.done,n),e.history.undone=ya(this.history.undone,n)}},iterLinkedDocs:function(e){Mr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ze(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Nn(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)})}),Ii.prototype.eachLine=Ii.prototype.iter;var Fs=0;function wl(e){var t=this;if(js(t),qe(t,e)||Vi(t.display,e))return;re(e),H&&(Fs=+new Date);var i=Er(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var p=n.length,B=Array(p),J=0,Z=function(){++J==p&&xn(t,function(){i=C(t.doc,i);var We={from:i,to:i,text:t.doc.splitLines(B.filter(function(dt){return dt!=null}).join(t.doc.lineSeparator())),origin:"paste"};_a(t.doc,We),Cs(t.doc,Si(C(t.doc,i),C(t.doc,tr(We))))})()},$=function(We,dt){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,We.type)==-1){Z();return}var _t=new FileReader;_t.onerror=function(){return Z()},_t.onload=function(){var It=_t.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(It)){Z();return}B[dt]=It,Z()},_t.readAsText(We)},ie=0;ie<n.length;ie++)$(n[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ye=e.dataTransfer.getData("Text");if(ye){var Re;if(t.state.draggingText&&!t.state.draggingText.copy&&(Re=t.listSelections()),ko(t.doc,Si(i,i)),Re)for(var Ve=0;Ve<Re.length;++Ve)Ea(t.doc,"",Re[Ve].anchor,Re[Ve].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(We){}}}function Al(e,t){if(H&&(!e.state.draggingText||+new Date-Fs<100)){ve(t);return}if(qe(e,t)||Vi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!c){var i=u("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),m&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Er(e,t);if(!i)return;var n=document.createDocumentFragment();ja(e,i,n),e.display.dragCursor||(e.display.dragCursor=u("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,n)}function js(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var p=t[n].CodeMirror;p&&i.push(p)}i.length&&i[0].operation(function(){for(var B=0;B<i.length;B++)e(i[B])})}var Hs=!1;function Rl(){if(Hs)return;Il(),Hs=!0}function Il(){var e;Oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),Oe(window,"blur",function(){return Ws(ir)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Pr={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"},ro=0;ro<10;ro++)Pr[ro+48]=Pr[ro+96]=String(ro);for(var Uo=65;Uo<=90;Uo++)Pr[Uo]=String.fromCharCode(Uo);for(var ao=1;ao<=12;ao++)Pr[ao+111]=Pr[ao+63235]="F"+ao;var wr={};wr.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"},wr.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"},wr.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"},wr.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"]},wr.default=l?wr.macDefault:wr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,p,B,J=0;J<t.length-1;J++){var Z=t[J];if(/^(cmd|meta|m)$/i.test(Z))B=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))n=!0;else if(/^s(hift)?$/i.test(Z))p=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),p&&(e="Shift-"+e),e}function Ml(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var p=ge(i.split(" "),Dl),B=0;B<p.length;B++){var J=void 0,Z=void 0;B==p.length-1?(Z=p.join(" "),J=n):(Z=p.slice(0,B+1).join(" "),J="...");var $=t[Z];if(!$)t[Z]=J;else if($!=J)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function Ta(e,t,i,n){t=Bo(t);var p=t.call?t.call(e,n):t[e];if(p===!1)return"nothing";if(p==="...")return"multi";if(p!=null&&i(p))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ta(e,t.fallthrough,i,n);for(var B=0;B<t.fallthrough.length;B++){var J=Ta(e,t.fallthrough[B],i,n);if(J)return J}}}function Ks(e){var t=typeof e=="string"?e:Pr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function zs(e,t){if(m&&e.keyCode==34&&e.char)return!1;var i=Pr[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Gs(i,e,t))}function Bo(e){return typeof e=="string"?wr[e]:e}function Ca(e,t){for(var i=e.doc.sel.ranges,n=[],p=0;p<i.length;p++){for(var B=t(i[p]);n.length&&Wt(B.from,ne(n).to)<=0;){var J=n.pop();if(Wt(J.from,B.from)<0){B.from=J.from;break}}n.push(B)}Dn(e,function(){for(var Z=n.length-1;Z>=0;Z--)Ea(e.doc,"",n[Z].from,n[Z].to,"+delete");Ir(e)})}function ns(e,t,i){var n=Xe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function is(e,t,i){var n=ns(e,t.ch,i);return n==null?null:new ft(t.line,n,i<0?"after":"before")}function rs(e,t,i,n,p){if(e){t.doc.direction=="rtl"&&(p=-p);var B=At(i,t.doc.direction);if(B){var J=p<0?ne(B):B[0],Z=p<0==(J.level==1),$=Z?"after":"before",ie;if(J.level>0||t.doc.direction=="rtl"){var ye=jr(t,i);ie=p<0?i.text.length-1:0;var Re=Xi(t,ye,ie).top;ie=yt(function(Ve){return Xi(t,ye,Ve).top==Re},p<0==(J.level==1)?J.from:J.to-1,ie),$=="before"&&(ie=ns(i,ie,1))}else ie=p<0?J.to:J.from;return new ft(n,ie,$)}}return new ft(n,p<0?i.text.length:0,p<0?"before":"after")}function kl(e,t,i,n){var p=At(t,e.doc.direction);if(!p)return is(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var B=ht(p,i.ch,i.sticky),J=p[B];if(e.doc.direction=="ltr"&&J.level%2==0&&(n>0?J.to>i.ch:J.from<i.ch))return is(t,i,n);var Z=function(Ut,Kt){return ns(t,Ut instanceof ft?Ut.ch:Ut,Kt)},$,ie=function(Ut){return e.options.lineWrapping?($=$||jr(e,t),Kr(e,t,$,Ut)):{begin:0,end:t.text.length}},ye=ie(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||J.level==1){var Re=J.level==1==n<0,Ve=Z(i,Re?1:-1);if(Ve!=null&&(Re?Ve<=J.to&&Ve<=ye.end:Ve>=J.from&&Ve>=ye.begin)){var We=Re?"before":"after";return new ft(i.line,Ve,We)}}var dt=function(Ut,Kt,Bt){for(var Yt=function(Wn,li){return li?new ft(i.line,Z(Wn,1),"before"):new ft(i.line,Wn,"after")};Ut>=0&&Ut<p.length;Ut+=Kt){var on=p[Ut],nn=Kt>0==(on.level!=1),bn=nn?Bt.begin:Z(Bt.end,-1);if(on.from<=bn&&bn<on.to)return Yt(bn,nn);if(bn=nn?on.from:Z(on.to,-1),Bt.begin<=bn&&bn<Bt.end)return Yt(bn,nn)}},_t=dt(B+n,n,ye);if(_t)return _t;var It=n>0?ye.end:Z(ye.begin,-1);return It!=null&&!(n>0&&It==t.text.length)&&(_t=dt(n>0?0:p.length-1,n,ie(It)),_t)?_t:null}var oo={selectAll:Rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return Ca(e,function(t){if(t.empty()){var i=Ot(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:ft(t.head.line+1,0)}:{from:t.head,to:ft(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ca(e,function(t){return{from:ft(t.from().line,0),to:C(e.doc,ft(t.to().line+1,0))}})},delLineLeft:function(e){return Ca(e,function(t){return{from:ft(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ca(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Ca(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"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(ft(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ft(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Vs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Pe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Pe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Ys(e,t.head):n},Pe)},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=[],i=e.listSelections(),n=e.options.tabSize,p=0;p<i.length;p++){var B=i[p].from(),J=X(e.getLine(B.line),B.ch,n);t.push(de(n-J%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Dn(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var p=t[n].head,B=Ot(e.doc,p.line).text;if(B){if(p.ch==B.length&&(p=new ft(p.line,p.ch-1)),p.ch>0)p=new ft(p.line,p.ch+1),e.replaceRange(B.charAt(p.ch-1)+B.charAt(p.ch-2),ft(p.line,p.ch-2),p,"+transpose");else if(p.line>e.doc.first){var J=Ot(e.doc,p.line-1).text;J&&(p=new ft(p.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+J.charAt(J.length-1),ft(p.line-1,J.length-1),p,"+transpose"))}}i.push(new Cn(p,p))}e.setSelections(i)})},newlineAndIndent:function(e){return Dn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Ir(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Vs(e,t){var i=Ot(e.doc,t),n=gn(i);return n!=i&&(t=Xt(n)),rs(!0,e,n,t,1)}function Pl(e,t){var i=Ot(e.doc,t),n=Zi(i);return n!=i&&(t=Xt(n)),rs(!0,e,i,t,-1)}function Ys(e,t){var i=Vs(e,t.line),n=Ot(e.doc,i.line),p=At(n,e.doc.direction);if(!p||p[0].level==0){var B=Math.max(i.ch,n.text.search(/\S/)),J=t.line==i.line&&t.ch<=B&&t.ch;return ft(i.line,J?0:B,i.sticky)}return i}function Fo(e,t,i){if(typeof t=="string"&&(t=oo[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),p=t(e)!=Le}finally{e.display.shift=n,e.state.suppressEdits=!1}return p}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var p=Ta(t,e.state.keyMaps[n],i,e);if(p)return p}return e.options.extraKeys&&Ta(t,e.options.extraKeys,i,e)||Ta(t,e.options.keyMap,i,e)}var Ul=new ee;function so(e,t,i,n){var p=e.state.keySeq;if(p){if(Ks(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==p&&(e.state.keySeq=null,e.display.input.reset())}),Xs(e,p+" "+t,i,n))return!0}return Xs(e,t,i,n)}function Xs(e,t,i,n){var p=Nl(e,t,n);return p=="multi"&&(e.state.keySeq=t),p=="handled"&&On(e,"keyHandled",e,t,i),(p=="handled"||p=="multi")&&(re(i),pr(e)),!!p}function Qs(e,t){var i=zs(t,!0);return i?t.shiftKey&&!e.state.keySeq?so(e,"Shift-"+i,t,function(n){return Fo(e,n,!0)})||so(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Fo(e,n)}):so(e,i,t,function(n){return Fo(e,n)}):!1}function Bl(e,t,i){return so(e,"'"+i+"'",t,function(n){return Fo(e,n,!0)})}var as=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),qe(t,e))return;H&&F<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Qs(t,e);m&&(as=n?i:null,!n&&i==88&&!He&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!l&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;R(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(_(t,"CodeMirror-crosshair"),it(document,"keyup",i),it(document,"mouseover",i))}Oe(document,"keyup",i),Oe(document,"mouseover",i)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),qe(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Vi(t.display,e)||qe(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(m&&i==as){as=null,re(e);return}if(m&&(!e.which||e.which<10)&&Qs(t,e))return;var p=String.fromCharCode(n==null?i:n);if(p=="\b")return;if(Bl(t,e,p))return;t.display.input.onKeyPress(e)}var jl=400,os=function(e,t,i){this.time=e,this.pos=t,this.button=i};os.prototype.compare=function(e,t,i){return this.time+jl>e&&Wt(t,this.pos)==0&&i==this.button};var lo,uo;function Wl(e,t){var i=+new Date;return uo&&uo.compare(i,e,t)?(lo=uo=null,"triple"):lo&&lo.compare(i,e,t)?(uo=new os(i,e,t),lo=null,"double"):(lo=new os(i,e,t),uo=null,"single")}function $s(e){var t=this,i=t.display;if(qe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Vi(i,e)){k||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(ss(t,e))return;var n=Er(t,e),p=je(e),B=n?Wl(n,p):"single";if(window.focus(),p==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,p,n,B,e))return;p==1?n?Gl(t,n,B,e):_e(e)==i.scroller&&re(e):p==2?(n&&Mo(t.doc,n),setTimeout(function(){return i.input.focus()},20)):p==3&&(O?t.display.input.onContextMenu(e):Wa(t))}function Hl(e,t,i,n,p){var B="Click";return n=="double"?B="Double"+B:n=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,so(e,Gs(B,p),p,function(J){if(typeof J=="string"&&(J=oo[J]),!J)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=J(e,i)!=Le}finally{e.state.suppressEdits=!1}return Z})}function Kl(e,t,i){var n=e.getOption("configureMouse"),p=n?n(e,t,i):{};if(p.unit==null){var B=h?i.shiftKey&&i.metaKey:i.altKey;p.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(p.extend==null||e.doc.extend)&&(p.extend=e.doc.extend||i.shiftKey),p.addNew==null&&(p.addNew=l?i.metaKey:i.ctrlKey),p.moveOnDrag==null&&(p.moveOnDrag=!(l?i.altKey:i.ctrlKey)),p}function Gl(e,t,i,n){H?setTimeout(j(Ao,e),0):e.curOp.focus=P();var p=Kl(e,i,n),B=e.doc.sel,J;e.options.dragDrop&&at&&!e.isReadOnly()&&i=="single"&&(J=B.contains(t))>-1&&(Wt((J=B.ranges[J]).from(),t)<0||t.xRel>0)&&(Wt(J.to(),t)>0||t.xRel<0)?zl(e,n,t,p):Vl(e,n,t,p)}function zl(e,t,i,n){var p=e.display,B=!1,J=xn(e,function(ie){k&&(p.scroller.draggable=!1),e.state.draggingText=!1,it(p.wrapper.ownerDocument,"mouseup",J),it(p.wrapper.ownerDocument,"mousemove",Z),it(p.scroller,"dragstart",$),it(p.scroller,"drop",J),B||(re(ie),n.addNew||Mo(e.doc,i,null,null,n.extend),k&&!c||H&&F==9?setTimeout(function(){p.wrapper.ownerDocument.body.focus({preventScroll:!0}),p.input.focus()},20):p.input.focus())}),Z=function(ie){B=B||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},$=function(){return B=!0};k&&(p.scroller.draggable=!0),e.state.draggingText=J,J.copy=!n.moveOnDrag,p.scroller.dragDrop&&p.scroller.dragDrop(),Oe(p.wrapper.ownerDocument,"mouseup",J),Oe(p.wrapper.ownerDocument,"mousemove",Z),Oe(p.scroller,"dragstart",$),Oe(p.scroller,"drop",J),Wa(e),setTimeout(function(){return p.input.focus()},20)}function el(e,t,i){if(i=="char")return new Cn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Cn(ft(t.line,0),C(e.doc,ft(t.line+1,0)));var n=i(e,t);return new Cn(n.from,n.to)}function Vl(e,t,i,n){var p=e.display,B=e.doc;re(t);var J,Z,$=B.sel,ie=$.ranges;if(n.addNew&&!n.extend?(Z=B.sel.contains(i),Z>-1?J=ie[Z]:J=new Cn(i,i)):(J=B.sel.primary(),Z=B.sel.primIndex),n.unit=="rectangle")n.addNew||(J=new Cn(i,i)),i=Er(e,t,!0,!0),Z=-1;else{var ye=el(e,i,n.unit);n.extend?J=es(J,ye.anchor,ye.head,n.extend):J=ye}n.addNew?Z==-1?(Z=ie.length,yi(B,fi(e,ie.concat([J]),Z),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[Z].empty()&&n.unit=="char"&&!n.extend?(yi(B,fi(e,ie.slice(0,Z).concat(ie.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),$=B.sel):ts(B,Z,J,Ae):(Z=0,yi(B,new Bn([J],0),Ae),$=B.sel);var Re=i;function Ve(Bt){if(Wt(Re,Bt)==0)return;if(Re=Bt,n.unit=="rectangle"){for(var Yt=[],on=e.options.tabSize,nn=X(Ot(B,i.line).text,i.ch,on),bn=X(Ot(B,Bt.line).text,Bt.ch,on),Wn=Math.min(nn,bn),li=Math.max(nn,bn),Jn=Math.min(i.line,Bt.line),Hi=Math.min(e.lastLine(),Math.max(i.line,Bt.line));Jn<=Hi;Jn++){var Li=Ot(B,Jn).text,ii=Ie(Li,Wn,on);Wn==li?Yt.push(new Cn(ft(Jn,ii),ft(Jn,ii))):Li.length>ii&&Yt.push(new Cn(ft(Jn,ii),ft(Jn,Ie(Li,li,on))))}Yt.length||Yt.push(new Cn(i,i)),yi(B,fi(e,$.ranges.slice(0,Z).concat(Yt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Bt)}else{var Di=J,pi=el(e,Bt,n.unit),oi=Di.anchor,ri;Wt(pi.anchor,oi)>0?(ri=pi.head,oi=fn(Di.from(),pi.anchor)):(ri=pi.anchor,oi=en(Di.to(),pi.head));var qn=$.ranges.slice(0);qn[Z]=Yl(e,new Cn(C(B,oi),ri)),yi(B,fi(e,qn,Z),Ae)}}var We=p.wrapper.getBoundingClientRect(),dt=0;function _t(Bt){var Yt=++dt,on=Er(e,Bt,!0,n.unit=="rectangle");if(!on)return;if(Wt(on,Re)!=0){e.curOp.focus=P(),Ve(on);var nn=da(p,B);(on.line>=nn.to||on.line<nn.from)&&setTimeout(xn(e,function(){dt==Yt&&_t(Bt)}),150)}else{var bn=Bt.clientY<We.top?-20:Bt.clientY>We.bottom?20:0;bn&&setTimeout(xn(e,function(){if(dt!=Yt)return;p.scroller.scrollTop+=bn,_t(Bt)}),50)}}function It(Bt){e.state.selectingText=!1,dt=Infinity,Bt&&(re(Bt),p.input.focus()),it(p.wrapper.ownerDocument,"mousemove",Ut),it(p.wrapper.ownerDocument,"mouseup",Kt),B.history.lastSelOrigin=null}var Ut=xn(e,function(Bt){Bt.buttons===0||!je(Bt)?It(Bt):_t(Bt)}),Kt=xn(e,It);e.state.selectingText=Kt,Oe(p.wrapper.ownerDocument,"mousemove",Ut),Oe(p.wrapper.ownerDocument,"mouseup",Kt)}function Yl(e,t){var i=t.anchor,n=t.head,p=Ot(e.doc,i.line);if(Wt(i,n)==0&&i.sticky==n.sticky)return t;var B=At(p);if(!B)return t;var J=ht(B,i.ch,i.sticky),Z=B[J];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var $=J+(Z.from==i.ch==(Z.level!=1)?0:1);if($==0||$==B.length)return t;var ie;if(n.line!=i.line)ie=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=ht(B,n.ch,n.sticky),Re=ye-J||(n.ch-i.ch)*(Z.level==1?-1:1);ye==$-1||ye==$?ie=Re<0:ie=Re>0}var Ve=B[$+(ie?-1:0)],We=ie==(Ve.level==1),dt=We?Ve.from:Ve.to,_t=We?"after":"before";return i.ch==dt&&i.sticky==_t?t:new Cn(new ft(i.line,dt,_t),n)}function tl(e,t,i,n){var p,B;if(t.touches)p=t.touches[0].clientX,B=t.touches[0].clientY;else try{p=t.clientX,B=t.clientY}catch(Ve){return!1}if(p>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var J=e.display,Z=J.lineDiv.getBoundingClientRect();if(B>Z.bottom||!fe(e,i))return he(t);B-=Z.top-J.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var ie=J.gutters.childNodes[$];if(ie&&ie.getBoundingClientRect().right>=p){var ye=mn(e.doc,B),Re=e.display.gutterSpecs[$];return Ne(e,i,e,ye,Re.className,t),he(t)}}}function ss(e,t){return tl(e,t,"gutterClick",!0)}function nl(e,t){if(Vi(e.display,t)||Xl(e,t))return;if(qe(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Xl(e,t){return fe(e,"gutterContextMenu")?tl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),En(e)}var Sa={toString:function(){return"CodeMirror.Init"}},rl={},jo={};function Ql(e){var t=e.optionHandlers;function i(n,p,B,J){e.defaults[n]=p,B&&(t[n]=J?function(Z,$,ie){ie!=Sa&&B(Z,$,ie)}:B)}e.defineOption=i,e.Init=Sa,i("value","",function(n,p){return n.setValue(p)},!0),i("mode",null,function(n,p){n.doc.modeOption=p,Zo(n)},!0),i("indentUnit",2,Zo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Za(n),En(n),Zn(n)},!0),i("lineSeparator",null,function(n,p){if(n.doc.lineSep=p,!p)return;var B=[],J=n.doc.first;n.doc.iter(function($){for(var ie=0;;){var ye=$.text.indexOf(p,ie);if(ye==-1)break;ie=ye+p.length,B.push(ft(J,ye))}J++});for(var Z=B.length-1;Z>=0;Z--)Ea(n.doc,p,B[Z],ft(B[Z].line,B[Z].ch+p.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,p,B){n.state.specialChars=new RegExp(p.source+(p.test(" ")?"":"| "),"g"),B!=Sa&&n.refresh()}),i("specialCharPlaceholder",Pn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,p){return n.getInputField().spellcheck=p},!0),i("autocorrect",!1,function(n,p){return n.getInputField().autocorrect=p},!0),i("autocapitalize",!1,function(n,p){return n.getInputField().autocapitalize=p},!0),i("rtlMoveVisually",!I),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){il(n),Sr(n)},!0),i("keyMap","default",function(n,p,B){var J=Bo(p),Z=B!=Sa&&Bo(B);Z&&Z.detach&&Z.detach(n,J),J.attach&&J.attach(n,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,p){n.display.gutterSpecs=Zr(p,n.options.lineNumbers),Sr(n)},!0),i("fixedGutter",!0,function(n,p){n.display.gutters.style.left=p?Ua(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return nt(n)},!0),i("scrollbarStyle","native",function(n){gt(n),nt(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,p){n.display.gutterSpecs=Zr(n.options.gutters,p),Sr(n)},!0),i("firstLineNumber",1,Sr,!0),i("lineNumberFormatter",function(n){return n},Sr,!0),i("showCursorWhenSelecting",!1,Tr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,p){p=="nocursor"&&(ir(n),n.display.input.blur()),n.display.input.readOnlyChanged(p)}),i("screenReaderLabel",null,function(n,p){p=p===""?null:p,n.display.input.screenReaderLabelChanged(p)}),i("disableInput",!1,function(n,p){p||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Tr,!0),i("singleCursorHeightPerLine",!0,Tr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Za,!0),i("addModeClass",!1,Za,!0),i("pollInterval",100),i("undoDepth",200,function(n,p){return n.doc.history.undoDepth=p}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Za,!0),i("moveInputWithCursor",!0,function(n,p){p||n.display.input.resetPosition()}),i("tabindex",null,function(n,p){return n.display.input.getField().tabIndex=p||""}),i("autofocus",null),i("direction","ltr",function(n,p){return n.doc.setDirection(p)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=Sa;if(!t!=!n){var p=e.display.dragFunctions,B=t?Oe:it;B(e.display.scroller,"dragstart",p.start),B(e.display.scroller,"dragenter",p.enter),B(e.display.scroller,"dragover",p.over),B(e.display.scroller,"dragleave",p.leave),B(e.display.scroller,"drop",p.drop)}}function Zl(e){e.options.lineWrapping?(R(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),ji(e)),sa(e),Zn(e),En(e),setTimeout(function(){return nt(e)},100)}function Xn(e,t){var i=this;if(!(this instanceof Xn))return new Xn(e,t);this.options=t=t?A(t):{},A(rl,t,!1);var n=t.value;typeof n=="string"?n=new Ii(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var p=new Xn.inputStyles[t.inputStyle](this),B=this.display=new Ja(e,n,p,t);B.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),gt(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 ee,keySeq:null,specialChars:null},t.autofocus&&!a&&B.input.focus(),H&&F<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),zt(this),this.curOp.forceUpdate=!0,gs(this,n),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ha(i)},20):ir(this);for(var J in jo)jo.hasOwnProperty(J)&&jo[J](this,t[J],Sa);pa(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<ls.length;++Z)ls[Z](this);Dt(this),k&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}Xn.defaults=rl,Xn.optionHandlers=jo;function ql(e){var t=e.display;Oe(t.scroller,"mousedown",xn(e,$s)),H&&F<11?Oe(t.scroller,"dblclick",xn(e,function($){if(qe(e,$))return;var ie=Er(e,$);if(!ie||ss(e,$)||Vi(e.display,$))return;re($);var ye=e.findWordAt(ie);Mo(e.doc,ye.anchor,ye.head)})):Oe(t.scroller,"dblclick",function($){return qe(e,$)||re($)}),Oe(t.scroller,"contextmenu",function($){return nl(e,$)}),Oe(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||nl(e,$)});var i,n={end:0};function p(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function B($){if($.touches.length!=1)return!1;var ie=$.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function J($,ie){if(ie.left==null)return!0;var ye=ie.left-$.left,Re=ie.top-$.top;return ye*ye+Re*Re>20*20}Oe(t.scroller,"touchstart",function($){if(!qe(e,$)&&!B($)&&!ss(e,$)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-n.end<=300?n:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function($){var ie=t.activeTouch;if(ie&&!Vi(t,$)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var ye=e.coordsChar(t.activeTouch,"page"),Re;!ie.prev||J(ie,ie.prev)?Re=new Cn(ye,ye):!ie.prev.prev||J(ie,ie.prev.prev)?Re=e.findWordAt(ye):Re=new Cn(ft(ye.line,0),C(e.doc,ft(ye.line+1,0))),e.setSelection(Re.anchor,Re.head),e.focus(),re($)}p()}),Oe(t.scroller,"touchcancel",p),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(zr(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function($){return hi(e,$)}),Oe(t.scroller,"DOMMouseScroll",function($){return hi(e,$)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){qe(e,$)||ve($)},over:function($){qe(e,$)||(Ol(e,$),ve($))},start:function($){return Al(e,$)},drop:xn(e,wl),leave:function($){qe(e,$)||js(e)}};var Z=t.input.getField();Oe(Z,"keyup",function($){return Zs.call(e,$)}),Oe(Z,"keydown",xn(e,Js)),Oe(Z,"keypress",xn(e,qs)),Oe(Z,"focus",function($){return Ha(e,$)}),Oe(Z,"blur",function($){return ir(e,$)})}var ls=[];Xn.defineInitHook=function(e){return ls.push(e)};function co(e,t,i,n){var p=e.doc,B;i==null&&(i="add"),i=="smart"&&(p.mode.indent?B=St(e,t).state:i="prev");var J=e.options.tabSize,Z=Ot(p,t),$=X(Z.text,null,J);Z.stateAfter&&(Z.stateAfter=null);var ie=Z.text.match(/^\s*/)[0],ye;if(!n&&!/\S/.test(Z.text))ye=0,i="not";else if(i=="smart"&&(ye=p.mode.indent(B,Z.text.slice(ie.length),Z.text),ye==Le||ye>150)){if(!n)return;i="prev"}i=="prev"?t>p.first?ye=X(Ot(p,t-1).text,null,J):ye=0:i=="add"?ye=$+e.options.indentUnit:i=="subtract"?ye=$-e.options.indentUnit:typeof i=="number"&&(ye=$+i),ye=Math.max(0,ye);var Re="",Ve=0;if(e.options.indentWithTabs)for(var We=Math.floor(ye/J);We;--We)Ve+=J,Re+=" ";if(Ve<ye&&(Re+=de(ye-Ve)),Re!=ie)return Ea(p,Re,ft(t,0),ft(t,ie.length),"+input"),Z.stateAfter=null,!0;for(var dt=0;dt<p.sel.ranges.length;dt++){var _t=p.sel.ranges[dt];if(_t.head.line==t&&_t.head.ch<ie.length){var It=ft(t,ie.length);ts(p,dt,new Cn(It,It));break}}}var or=null;function Wo(e){or=e}function us(e,t,i,n,p){var B=e.doc;e.display.shift=!1,n||(n=B.sel);var J=+new Date-200,Z=p=="paste"||e.state.pasteIncoming>J,$=Ze(t),ie=null;if(Z&&n.ranges.length>1)if(or&&or.text.join(`
`)==t){if(n.ranges.length%or.text.length==0){ie=[];for(var ye=0;ye<or.text.length;ye++)ie.push(B.splitLines(or.text[ye]))}}else $.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ie=ge($,function(Ut){return[Ut]}));for(var Re=e.curOp.updateInput,Ve=n.ranges.length-1;Ve>=0;Ve--){var We=n.ranges[Ve],dt=We.from(),_t=We.to();We.empty()&&(i&&i>0?dt=ft(dt.line,dt.ch-i):e.state.overwrite&&!Z?_t=ft(_t.line,Math.min(Ot(B,_t.line).text.length,_t.ch+ne($).length)):Z&&or&&or.lineWise&&or.text.join(`
`)==$.join(`
`)&&(dt=_t=ft(dt.line,0)));var It={from:dt,to:_t,text:ie?ie[Ve%ie.length]:$,origin:p||(Z?"paste":e.state.cutIncoming>J?"cut":"+input")};_a(e.doc,It),On(e,"inputRead",e,It)}t&&!Z&&ol(e,t),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Re),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function al(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Dn(t,function(){return us(t,i,0,null,"paste")}),!0}function ol(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var p=i.ranges[n];if(p.head.ch>100||n&&i.ranges[n-1].head.line==p.head.line)continue;var B=e.getModeAt(p.head),J=!1;if(B.electricChars){for(var Z=0;Z<B.electricChars.length;Z++)if(t.indexOf(B.electricChars.charAt(Z))>-1){J=co(e,p.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(Ot(e.doc,p.head.line).text.slice(0,p.head.ch))&&(J=co(e,p.head.line,"smart")));J&&On(e,"electricInput",e,p.head.line)}}function sl(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var p=e.doc.sel.ranges[n].head.line,B={anchor:ft(p,0),head:ft(p+1,0)};i.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:i}}function ll(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function ul(){var e=u("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=u("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),ll(e),t}function $l(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,p){var B=this.options,J=B[n];if(B[n]==p&&n!="mode")return;B[n]=p,t.hasOwnProperty(n)&&xn(this,t[n])(this,p,J),Ne(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,p){this.state.keyMaps[p?"push":"unshift"](Bo(n))},removeKeyMap:function(n){for(var p=this.state.keyMaps,B=0;B<p.length;++B)if(p[B]==n||p[B].name==n)return p.splice(B,1),!0},addOverlay:Hn(function(n,p){var B=n.token?n:e.getMode(this.options,n);if(B.startState)throw new Error("Overlays may not be stateful.");oe(this.state.overlays,{mode:B,modeSpec:n,opaque:p&&p.opaque,priority:p&&p.priority||0},function(J){return J.priority}),this.state.modeGen++,Zn(this)}),removeOverlay:Hn(function(n){for(var p=this.state.overlays,B=0;B<p.length;++B){var J=p[B].modeSpec;if(J==n||typeof n=="string"&&J.name==n){p.splice(B,1),this.state.modeGen++,Zn(this);return}}}),indentLine:Hn(function(n,p,B){typeof p!="string"&&typeof p!="number"&&(p==null?p=this.options.smartIndent?"smart":"prev":p=p?"add":"subtract"),kn(this.doc,n)&&co(this,n,p,B)}),indentSelection:Hn(function(n){for(var p=this.doc.sel.ranges,B=-1,J=0;J<p.length;J++){var Z=p[J];if(Z.empty())Z.head.line>B&&(co(this,Z.head.line,n,!0),B=Z.head.line,J==this.doc.sel.primIndex&&Ir(this));else{var $=Z.from(),ie=Z.to(),ye=Math.max(B,$.line);B=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var Re=ye;Re<B;++Re)co(this,Re,n);var Ve=this.doc.sel.ranges;$.ch==0&&p.length==Ve.length&&Ve[J].from().ch>0&&ts(this.doc,J,new Cn($,Ve[J].to()),Ce)}}}),getTokenAt:function(n,p){return Sn(this,n,p)},getLineTokens:function(n,p){return Sn(this,ft(n),p,!0)},getTokenTypeAt:function(n){n=C(this.doc,n);var p=ot(this,Ot(this.doc,n.line)),B=0,J=(p.length-1)/2,Z=n.ch,$;if(Z==0)$=p[2];else for(;;){var ie=B+J>>1;if((ie?p[ie*2-1]:0)>=Z)J=ie;else if(p[ie*2+1]<Z)B=ie+1;else{$=p[ie*2+2];break}}var ye=$?$.indexOf("overlay "):-1;return ye<0?$:ye==0?null:$.slice(0,ye-1)},getModeAt:function(n){var p=this.doc.mode;return p.innerMode?e.innerMode(p,this.getTokenAt(n).state).mode:p},getHelper:function(n,p){return this.getHelpers(n,p)[0]},getHelpers:function(n,p){var B=[];if(!i.hasOwnProperty(p))return B;var J=i[p],Z=this.getModeAt(n);if(typeof Z[p]=="string")J[Z[p]]&&B.push(J[Z[p]]);else if(Z[p])for(var $=0;$<Z[p].length;$++){var ie=J[Z[p][$]];ie&&B.push(ie)}else Z.helperType&&J[Z.helperType]?B.push(J[Z.helperType]):J[Z.name]&&B.push(J[Z.name]);for(var ye=0;ye<J._global.length;ye++){var Re=J._global[ye];Re.pred(Z,this)&&se(B,Re.val)==-1&&B.push(Re.val)}return B},getStateAfter:function(n,p){var B=this.doc;return n=Y(B,n==null?B.first+B.size-1:n),St(this,n+1,p).state},cursorCoords:function(n,p){var B,J=this.doc.sel.primary();return n==null?B=J.head:typeof n=="object"?B=C(this.doc,n):B=n?J.from():J.to(),Wi(this,B,p||"page")},charCoords:function(n,p){return Ma(this,C(this.doc,n),p||"page")},coordsChar:function(n,p){return n=br(this,n,p||"page"),ka(this,n.left,n.top)},lineAtHeight:function(n,p){return n=br(this,{top:n,left:0},p||"page").top,mn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,p,B){var J=!1,Z;if(typeof n=="number"){var $=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>$&&(n=$,J=!0),Z=Ot(this.doc,n)}else Z=n;return Rn(this,Z,{top:0,left:0},p||"page",B||J).top+(J?this.doc.height-Ei(Z):0)},defaultTextHeight:function(){return Rr(this.display)},defaultCharWidth:function(){return _r(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,p,B,J,Z){var $=this.display;n=Wi(this,C(this.doc,n));var ie=n.bottom,ye=n.left;if(p.style.position="absolute",p.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(p),$.sizer.appendChild(p),J=="over")ie=n.top;else if(J=="above"||J=="near"){var Re=Math.max($.wrapper.clientHeight,this.doc.height),Ve=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(J=="above"||n.bottom+p.offsetHeight>Re)&&n.top>p.offsetHeight?ie=n.top-p.offsetHeight:n.bottom+p.offsetHeight<=Re&&(ie=n.bottom),ye+p.offsetWidth>Ve&&(ye=Ve-p.offsetWidth)}p.style.top=ie+"px",p.style.left=p.style.right="",Z=="right"?(ye=$.sizer.clientWidth-p.offsetWidth,p.style.right="0px"):(Z=="left"?ye=0:Z=="middle"&&(ye=($.sizer.clientWidth-p.offsetWidth)/2),p.style.left=ye+"px"),B&&Ro(this,{left:ye,top:ie,right:ye+p.offsetWidth,bottom:ie+p.offsetHeight})},triggerOnKeyDown:Hn(Js),triggerOnKeyPress:Hn(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Hn($s),execCommand:function(n){if(oo.hasOwnProperty(n))return oo[n].call(null,this)},triggerElectric:Hn(function(n){ol(this,n)}),findPosH:function(n,p,B,J){var Z=1;p<0&&(Z=-1,p=-p);for(var $=C(this.doc,n),ie=0;ie<p&&!($=ds(this.doc,$,Z,B,J),$.hitSide);++ie);return $},moveH:Hn(function(n,p){var B=this;this.extendSelectionsBy(function(J){return B.display.shift||B.doc.extend||J.empty()?ds(B.doc,J.head,n,p,B.options.rtlMoveVisually):n<0?J.from():J.to()},Pe)}),deleteH:Hn(function(n,p){var B=this.doc.sel,J=this.doc;B.somethingSelected()?J.replaceSelection("",null,"+delete"):Ca(this,function(Z){var $=ds(J,Z.head,n,p,!1);return n<0?{from:$,to:Z.head}:{from:Z.head,to:$}})}),findPosV:function(n,p,B,J){var Z=1,$=J;p<0&&(Z=-1,p=-p);for(var ie=C(this.doc,n),ye=0;ye<p;++ye){var Re=Wi(this,ie,"div");if($==null?$=Re.left:Re.left=$,ie=dl(this,Re,Z,B),ie.hitSide)break}return ie},moveV:Hn(function(n,p){var B=this,J=this.doc,Z=[],$=!this.display.shift&&!J.extend&&J.sel.somethingSelected();if(J.extendSelectionsBy(function(ye){if($)return n<0?ye.from():ye.to();var Re=Wi(B,ye.head,"div");ye.goalColumn!=null&&(Re.left=ye.goalColumn),Z.push(Re.left);var Ve=dl(B,Re,n,p);return p=="page"&&ye==J.sel.primary()&&Ga(B,Ma(B,Ve,"div").top-Re.top),Ve},Pe),Z.length)for(var ie=0;ie<J.sel.ranges.length;ie++)J.sel.ranges[ie].goalColumn=Z[ie]}),findWordAt:function(n){var p=this.doc,B=Ot(p,n.line).text,J=n.ch,Z=n.ch;if(B){var $=this.getHelper(n,"wordChars");(n.sticky=="before"||Z==B.length)&&J?--J:++Z;for(var ie=B.charAt(J),ye=Qe(ie,$)?function(Re){return Qe(Re,$)}:/\s/.test(ie)?function(Re){return/\s/.test(Re)}:function(Re){return!/\s/.test(Re)&&!Qe(Re)};J>0&&ye(B.charAt(J-1));)--J;for(;Z<B.length&&ye(B.charAt(Z));)++Z}return new Cn(ft(n.line,J),ft(n.line,Z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?R(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Hn(function(n,p){Gr(this,n,p)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Yi(this)-this.display.barHeight,width:n.scrollWidth-Yi(this)-this.display.barWidth,clientHeight:ia(this),clientWidth:vr(this)}},scrollIntoView:Hn(function(n,p){n==null?(n={from:this.doc.sel.primary().head,to:null},p==null&&(p=this.options.cursorScrollMargin)):typeof n=="number"?n={from:ft(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=p||0,n.from.line!=null?Jo(this,n):rr(this,n.from,n.to,n.margin)}),setSize:Hn(function(n,p){var B=this,J=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};n!=null&&(this.display.wrapper.style.width=J(n)),p!=null&&(this.display.wrapper.style.height=J(p)),this.options.lineWrapping&&Da(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function($){if($.widgets){for(var ie=0;ie<$.widgets.length;ie++)if($.widgets[ie].noHScroll){hr(B,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,Ne(this,"refresh",this)}),operation:function(n){return Dn(this,n)},startOperation:function(){return zt(this)},endOperation:function(){return Dt(this)},refresh:Hn(function(){var n=this.display.cachedTextHeight;Zn(this),this.curOp.forceUpdate=!0,En(this),Gr(this,this.doc.scrollLeft,this.doc.scrollTop),Qr(this.display),(n==null||Math.abs(n-Rr(this.display))>.5||this.options.lineWrapping)&&sa(this),Ne(this,"refresh",this)}),swapDoc:Hn(function(n){var p=this.doc;return p.cm=null,this.state.selectingText&&this.state.selectingText(),gs(this,n),En(this),this.display.input.reset(),Gr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,p),p}),phrase:function(n){var p=this.options.phrases;return p&&Object.prototype.hasOwnProperty.call(p,n)?p[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}},me(e),e.registerHelper=function(n,p,B){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][p]=B},e.registerGlobalHelper=function(n,p,B,J){e.registerHelper(n,p,J),i[n]._global.push({pred:B,val:J})}}function ds(e,t,i,n,p){var B=t,J=i,Z=Ot(e,t.line),$=p&&e.direction=="rtl"?-i:i;function ie(){var Kt=t.line+$;return Kt<e.first||Kt>=e.first+e.size?!1:(t=new ft(Kt,t.ch,t.sticky),Z=Ot(e,Kt))}function ye(Kt){var Bt;if(n=="codepoint"){var Yt=Z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Yt)?Bt=null:Bt=new ft(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(Yt>=55296&&Yt<56320?2:1))),-i)}else p?Bt=kl(e.cm,Z,t,i):Bt=is(Z,t,i);if(Bt==null)if(!Kt&&ie())t=rs(p,e.cm,Z,t.line,$);else return!1;else t=Bt;return!0}if(n=="char"||n=="codepoint")ye();else if(n=="column")ye(!0);else if(n=="word"||n=="group")for(var Re=null,Ve=n=="group",We=e.cm&&e.cm.getHelper(t,"wordChars"),dt=!0;!(i<0&&!ye(!dt));dt=!1){var _t=Z.text.charAt(t.ch)||`
`,It=Qe(_t,We)?"w":Ve&&_t==`
`?"n":!Ve||/\s/.test(_t)?null:"p";if(Ve&&!dt&&!It&&(It="s"),Re&&Re!=It){i<0&&(i=1,ye(),t.sticky="after");break}if(It&&(Re=It),i>0&&!ye(!dt))break}var Ut=Po(e,t,B,J,!0);return Qt(B,Ut)&&(Ut.hitSide=!0),Ut}function dl(e,t,i,n){var p=e.doc,B=t.left,J;if(n=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(Z-.5*Rr(e.display),3);J=(i>0?t.bottom:t.top)+i*$}else n=="line"&&(J=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=ka(e,B,J),!ie.outside);){if(i<0?J<=0:J>=p.height){ie.hitSide=!0;break}J+=i*5}return ie}var jn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};jn.prototype.init=function(e){var t=this,i=this,n=i.cm,p=i.div=e.lineDiv;ll(p,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function B(Z){for(var $=Z.target;$;$=$.parentNode){if($==p)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}Oe(p,"paste",function(Z){if(!B(Z)||qe(n,Z)||al(Z,n))return;F<=11&&setTimeout(xn(n,function(){return t.updateFromDOM()}),20)}),Oe(p,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Oe(p,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Oe(p,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(p,"touchstart",function(){return i.forceCompositionEnd()}),Oe(p,"input",function(){t.composing||t.readFromDOMSoon()});function J(Z){if(!B(Z)||qe(n,Z))return;if(n.somethingSelected())Wo({lineWise:!1,text:n.getSelections()}),Z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var $=sl(n);Wo({lineWise:!0,text:$.text}),Z.type=="cut"&&n.operation(function(){n.setSelections($.ranges,0,Ce),n.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var ie=or.text.join(`
`);if(Z.clipboardData.setData("Text",ie),Z.clipboardData.getData("Text")==ie){Z.preventDefault();return}}var ye=ul(),Re=ye.firstChild;n.display.lineSpace.insertBefore(ye,n.display.lineSpace.firstChild),Re.value=or.text.join(`
`);var Ve=document.activeElement;L(Re),setTimeout(function(){n.display.lineSpace.removeChild(ye),Ve.focus(),Ve==p&&i.showPrimarySelection()},50)}Oe(p,"copy",J),Oe(p,"cut",J)},jn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},jn.prototype.prepareSelection=function(){var e=wo(this.cm,!1);return e.focus=document.activeElement==this.div,e},jn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},jn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},jn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),p=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||p.line<t.display.viewFrom){e.removeAllRanges();return}var B=Ho(t,e.anchorNode,e.anchorOffset),J=Ho(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&J&&!J.bad&&Wt(fn(B,J),n)==0&&Wt(en(B,J),p)==0)return;var Z=t.display.view,$=n.line>=t.display.viewFrom&&cl(t,n)||{node:Z[0].measure.map[2],offset:0},ie=p.line<t.display.viewTo&&cl(t,p);if(!ie){var ye=Z[Z.length-1].measure,Re=ye.maps?ye.maps[ye.maps.length-1]:ye.map;ie={node:Re[Re.length-1],offset:Re[Re.length-2]-Re[Re.length-3]}}if(!$||!ie){e.removeAllRanges();return}var Ve=e.rangeCount&&e.getRangeAt(0),We;try{We=b($.node,$.offset,ie.offset,ie.node)}catch(dt){}We&&(!N&&t.state.focused?(e.collapse($.node,$.offset),We.collapsed||(e.removeAllRanges(),e.addRange(We))):(e.removeAllRanges(),e.addRange(We)),Ve&&e.anchorNode==null?e.addRange(Ve):N&&this.startGracePeriod()),this.rememberSelection()},jn.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)},jn.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},jn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},jn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},jn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},jn.prototype.blur=function(){this.div.blur()},jn.prototype.getField=function(){return this.div},jn.prototype.supportsTouch=function(){return!0},jn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Dn(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)},jn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},jn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&v&&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 i=Ho(t,e.anchorNode,e.anchorOffset),n=Ho(t,e.focusNode,e.focusOffset);i&&n&&Dn(t,function(){yi(t.doc,Si(i,n),Ce),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},jn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),p=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=ft(n.line-1,Ot(e.doc,n.line-1).length)),p.ch==Ot(e.doc,p.line).text.length&&p.line<e.lastLine()&&(p=ft(p.line+1,0)),n.line<t.viewFrom||p.line>t.viewTo-1)return!1;var B,J,Z;n.line==t.viewFrom||(B=xr(e,n.line))==0?(J=Xt(t.view[0].line),Z=t.view[0].node):(J=Xt(t.view[B].line),Z=t.view[B-1].node.nextSibling);var $=xr(e,p.line),ie,ye;if($==t.view.length-1?(ie=t.viewTo-1,ye=t.lineDiv.lastChild):(ie=Xt(t.view[$+1].line)-1,ye=t.view[$+1].node.previousSibling),!Z)return!1;for(var Re=e.doc.splitLines(tu(e,Z,ye,J,ie)),Ve=Zt(e.doc,ft(J,0),ft(ie,Ot(e.doc,ie).text.length));Re.length>1&&Ve.length>1;)if(ne(Re)==ne(Ve))Re.pop(),Ve.pop(),ie--;else if(Re[0]==Ve[0])Re.shift(),Ve.shift(),J++;else break;for(var We=0,dt=0,_t=Re[0],It=Ve[0],Ut=Math.min(_t.length,It.length);We<Ut&&_t.charCodeAt(We)==It.charCodeAt(We);)++We;for(var Kt=ne(Re),Bt=ne(Ve),Yt=Math.min(Kt.length-(Re.length==1?We:0),Bt.length-(Ve.length==1?We:0));dt<Yt&&Kt.charCodeAt(Kt.length-dt-1)==Bt.charCodeAt(Bt.length-dt-1);)++dt;if(Re.length==1&&Ve.length==1&&J==n.line)for(;We&&We>n.ch&&Kt.charCodeAt(Kt.length-dt-1)==Bt.charCodeAt(Bt.length-dt-1);)We--,dt++;Re[Re.length-1]=Kt.slice(0,Kt.length-dt).replace(/^\u200b+/,""),Re[0]=Re[0].slice(We).replace(/\u200b+$/,"");var on=ft(J,We),nn=ft(ie,Ve.length?ne(Ve).length-dt:0);if(Re.length>1||Re[0]||Wt(on,nn))return Ea(e.doc,Re,on,nn,"+input"),!0},jn.prototype.ensurePolled=function(){this.forceCompositionEnd()},jn.prototype.reset=function(){this.forceCompositionEnd()},jn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},jn.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)},jn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Dn(this.cm,function(){return Zn(e.cm)})},jn.prototype.setUneditable=function(e){e.contentEditable="false"},jn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||xn(this.cm,us)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},jn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},jn.prototype.onContextMenu=function(){},jn.prototype.resetPosition=function(){},jn.prototype.needsContentAttribute=!0;function cl(e,t){var i=Ci(e,t.line);if(!i||i.hidden)return null;var n=Ot(e.doc,t.line),p=Ia(i,n,t.line),B=At(n,e.doc.direction),J="left";if(B){var Z=ht(B,t.ch);J=Z%2?"right":"left"}var $=Or(p.map,t.ch,J);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function wa(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,p){var B="",J=!1,Z=e.doc.lineSeparator(),$=!1;function ie(We){return function(dt){return dt.id==We}}function ye(){J&&(B+=Z,$&&(B+=Z),J=$=!1)}function Re(We){We&&(ye(),B+=We)}function Ve(We){if(We.nodeType==1){var dt=We.getAttribute("cm-text");if(dt){Re(dt);return}var _t=We.getAttribute("cm-marker"),It;if(_t){var Ut=e.findMarks(ft(n,0),ft(p+1,0),ie(+_t));Ut.length&&(It=Ut[0].find(0))&&Re(Zt(e.doc,It.from,It.to).join(Z));return}if(We.getAttribute("contenteditable")=="false")return;var Kt=/^(pre|div|p|li|table|br)$/i.test(We.nodeName);if(!/^br$/i.test(We.nodeName)&&We.textContent.length==0)return;Kt&&ye();for(var Bt=0;Bt<We.childNodes.length;Bt++)Ve(We.childNodes[Bt]);/^(pre|p)$/i.test(We.nodeName)&&($=!0),Kt&&(J=!0)}else We.nodeType==3&&Re(We.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ve(t),t==i);)t=t.nextSibling,$=!1;return B}function Ho(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return wa(e.clipPos(ft(e.display.viewTo-1)),!0);t=null,i=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 p=0;p<e.display.view.length;p++){var B=e.display.view[p];if(B.node==n)return nu(B,t,i)}}function nu(e,t,i){var n=e.text.firstChild,p=!1;if(!t||!y(n,t))return wa(ft(Xt(e.line),0),!0);if(t==n&&(p=!0,t=n.childNodes[i],i=0,!t)){var B=e.rest?ne(e.rest):e.line;return wa(ft(Xt(B),B.text.length),p)}var J=t.nodeType==3?t:null,Z=t;for(!J&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(J=t.firstChild,i&&(i=J.nodeValue.length));Z.parentNode!=n;)Z=Z.parentNode;var $=e.measure,ie=$.maps;function ye(It,Ut,Kt){for(var Bt=-1;Bt<(ie?ie.length:0);Bt++)for(var Yt=Bt<0?$.map:ie[Bt],on=0;on<Yt.length;on+=3){var nn=Yt[on+2];if(nn==It||nn==Ut){var bn=Xt(Bt<0?e.line:e.rest[Bt]),Wn=Yt[on]+Kt;return(Kt<0||nn!=It)&&(Wn=Yt[on+(Kt?1:0)]),ft(bn,Wn)}}}var Re=ye(J,Z,i);if(Re)return wa(Re,p);for(var Ve=Z.nextSibling,We=J?J.nodeValue.length-i:0;Ve;Ve=Ve.nextSibling){if(Re=ye(Ve,Ve.firstChild,0),Re)return wa(ft(Re.line,Re.ch-We),p);We+=Ve.textContent.length}for(var dt=Z.previousSibling,_t=i;dt;dt=dt.previousSibling){if(Re=ye(dt,dt.firstChild,-1),Re)return wa(ft(Re.line,Re.ch+_t),p);_t+=dt.textContent.length}}var ti=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};ti.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var p=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(p.style.width="0px"),Oe(p,"input",function(){H&&F>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Oe(p,"paste",function(J){if(qe(n,J)||al(J,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function B(J){if(qe(n,J))return;if(n.somethingSelected())Wo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Z=sl(n);Wo({lineWise:!0,text:Z.text}),J.type=="cut"?n.setSelections(Z.ranges,null,Ce):(i.prevInput="",p.value=Z.text.join(`
`),L(p))}else return;J.type=="cut"&&(n.state.cutIncoming=+new Date)}Oe(p,"cut",B),Oe(p,"copy",B),Oe(e.scroller,"paste",function(J){if(Vi(e,J)||qe(n,J))return;if(!p.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=J.clipboardData,p.dispatchEvent(Z)}),Oe(e.lineSpace,"selectstart",function(J){Vi(e,J)||re(J)}),Oe(p,"compositionstart",function(){var J=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:J,range:n.markText(J,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Oe(p,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ti.prototype.createField=function(e){this.wrapper=ul(),this.textarea=this.wrapper.firstChild},ti.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ti.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=wo(e);if(e.options.moveInputWithCursor){var p=Wi(e,i.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),J=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,p.top+J.top-B.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,p.left+J.left-B.left))}return n},ti.prototype.showSelection=function(e){var t=this.cm,i=t.display;f(i.cursorDiv,e.cursors),f(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ti.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&L(this.textarea),H&&F>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",H&&F>=9&&(this.hasSelection=null))},ti.prototype.getField=function(){return this.textarea},ti.prototype.supportsTouch=function(){return!1},ti.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},ti.prototype.blur=function(){this.textarea.blur()},ti.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ti.prototype.receivedFocus=function(){this.slowPoll()},ti.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()})},ti.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},ti.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||$e(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var p=i.value;if(p==n&&!t.somethingSelected())return!1;if(H&&F>=9&&this.hasSelection===p||l&&/[\uf700-\uf7ff]/.test(p))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=p.charCodeAt(0);if(B==8203&&!n&&(n="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var J=0,Z=Math.min(n.length,p.length);J<Z&&n.charCodeAt(J)==p.charCodeAt(J);)++J;return Dn(t,function(){us(t,p.slice(J),n.length-J,null,e.composing?"*compose":null),p.length>1e3||p.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=p,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ti.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ti.prototype.onKeyPress=function(){H&&F>=9&&(this.hasSelection=null),this.fastPoll()},ti.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,p=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=Er(i,e),J=n.scroller.scrollTop;if(!B||m)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(B)==-1&&xn(i,yi)(i.doc,Si(B),Ce);var $=p.style.cssText,ie=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",p.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Re;k&&(Re=window.scrollY),n.input.focus(),k&&window.scrollTo(null,Re),n.input.reset(),i.somethingSelected()||(p.value=t.prevInput=" "),t.contextMenuPending=We,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ve(){if(p.selectionStart!=null){var _t=i.somethingSelected(),It="\u200B"+(_t?p.value:"");p.value="\u21DA",p.value=It,t.prevInput=_t?"":"\u200B",p.selectionStart=1,p.selectionEnd=It.length,n.selForContextMenu=i.doc.sel}}function We(){if(t.contextMenuPending!=We)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,p.style.cssText=$,H&&F<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=J),p.selectionStart!=null){(!H||H&&F<9)&&Ve();var _t=0,It=function(){n.selForContextMenu==i.doc.sel&&p.selectionStart==0&&p.selectionEnd>0&&t.prevInput=="\u200B"?xn(i,Rs)(i):_t++<10?n.detectingSelectAll=setTimeout(It,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(It,200)}}if(H&&F>=9&&Ve(),O){ve(e);var dt=function(){it(window,"mouseup",dt),setTimeout(We,20)};Oe(window,"mouseup",dt)}else setTimeout(We,50)},ti.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ti.prototype.setUneditable=function(){},ti.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?A(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 i=P();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Z.getValue()}var p;if(e.form&&(Oe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var B=e.form;p=B.submit;try{var J=B.submit=function(){n(),B.submit=p,B.submit(),B.submit=J}}catch($){}}t.finishInit=function($){$.save=n,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,n(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(it(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=p))}},e.style.display="none";var Z=Xn(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return Z}function ru(e){e.off=it,e.on=Oe,e.wheelEventPixels=fs,e.Doc=Ii,e.splitLines=Ze,e.countColumn=X,e.findColumn=Ie,e.isWordChar=Ge,e.Pass=Le,e.signal=Ne,e.Line=xi,e.changeEnd=tr,e.scrollbarModel=wt,e.Pos=ft,e.cmpPos=Wt,e.modes=rt,e.mimeModes=Ye,e.resolveMode=Ee,e.getMode=Be,e.modeExtensions=st,e.extendMode=ct,e.copyState=Ct,e.startState=jt,e.innerMode=lt,e.commands=oo,e.keyMap=wr,e.keyName=zs,e.isModifierKey=Ks,e.lookupKey=Ta,e.normalizeKeyMap=Ml,e.StringStream=qt,e.SharedTextMarker=io,e.TextMarker=kr,e.LineWidget=no,e.e_preventDefault=re,e.e_stopPropagation=ae,e.e_stop=ve,e.addClass=R,e.contains=y,e.rmClass=_,e.keyNames=Pr}Ql(Xn),$l(Xn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ko in Ii.prototype)Ii.prototype.hasOwnProperty(Ko)&&se(au,Ko)<0&&(Xn.prototype[Ko]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ii.prototype[Ko]));return me(Ii),Xn.inputStyles={textarea:ti,contenteditable:jn},Xn.defineMode=function(e){!Xn.defaults.mode&&e!="null"&&(Xn.defaults.mode=e),bt.apply(this,arguments)},Xn.defineMIME=pt,Xn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Xn.defineMIME("text/plain","null"),Xn.defineExtension=function(e,t){Xn.prototype[e]=t},Xn.defineDocExtension=function(e,t){Ii.prototype[e]=t},Xn.fromTextArea=iu,ru(Xn),Xn.version="5.58.2",Xn})},W6BS:function(Ke,Me){Ke.exports="data:image/png;base64,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"},WaYH:function(Ke,Me,K){"use strict";var q=K("rePB"),z=K("Ff2n"),N=K("VTBJ"),V=K("1OyB"),W=K("vuIU"),D=K("JX7q"),H=K("Ji7U"),F=K("LK+K"),k=K("q1tI"),T=K("TSYQ"),v=K.n(T),m=K("sboe"),c=K("OZM5"),d=function(O){var S=O.prefixCls,_=O.level,g=O.isStart,f=O.isEnd;if(!_)return null;for(var u="".concat(S,"-indent-unit"),E=[],b=0;b<_;b+=1){var y;E.push(k.createElement("span",{key:b,className:v()(u,(y={},Object(q.a)(y,"".concat(u,"-start"),g[b+1]),Object(q.a)(y,"".concat(u,"-end"),f[b+1]),Object(q.a)(y,"".concat(u,"-end-first-level"),!b&&f[0]),y))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat(S,"-indent")},E)},r=d,s=K("815F"),o="open",a="close",l="---",h=function(x){Object(H.a)(S,x);var O=Object(F.a)(S);function S(){var _;return Object(V.a)(this,S),_=O.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(g){var f=_.props.context.onNodeClick;f(g,Object(s.b)(_.props)),_.isSelectable()?_.onSelect(g):_.onCheck(g)},_.onSelectorDoubleClick=function(g){var f=_.props.context.onNodeDoubleClick;f(g,Object(s.b)(_.props))},_.onSelect=function(g){if(_.isDisabled())return;var f=_.props.context.onNodeSelect;g.preventDefault(),f(g,Object(s.b)(_.props))},_.onCheck=function(g){if(_.isDisabled())return;var f=_.props,u=f.disableCheckbox,E=f.checked,b=_.props.context.onNodeCheck;if(!_.isCheckable()||u)return;g.preventDefault();var y=!E;b(g,Object(s.b)(_.props),y)},_.onMouseEnter=function(g){var f=_.props.context.onNodeMouseEnter;f(g,Object(s.b)(_.props))},_.onMouseLeave=function(g){var f=_.props.context.onNodeMouseLeave;f(g,Object(s.b)(_.props))},_.onContextMenu=function(g){var f=_.props.context.onNodeContextMenu;f(g,Object(s.b)(_.props))},_.onDragStart=function(g){var f=_.props.context.onNodeDragStart;g.stopPropagation(),_.setState({dragNodeHighlight:!0}),f(g,Object(D.a)(_));try{g.dataTransfer.setData("text/plain","")}catch(u){}},_.onDragEnter=function(g){var f=_.props.context.onNodeDragEnter;g.preventDefault(),g.stopPropagation(),f(g,Object(D.a)(_))},_.onDragOver=function(g){var f=_.props.context.onNodeDragOver;g.preventDefault(),g.stopPropagation(),f(g,Object(D.a)(_))},_.onDragLeave=function(g){var f=_.props.context.onNodeDragLeave;g.stopPropagation(),f(g,Object(D.a)(_))},_.onDragEnd=function(g){var f=_.props.context.onNodeDragEnd;g.stopPropagation(),_.setState({dragNodeHighlight:!1}),f(g,Object(D.a)(_))},_.onDrop=function(g){var f=_.props.context.onNodeDrop;g.preventDefault(),g.stopPropagation(),_.setState({dragNodeHighlight:!1}),f(g,Object(D.a)(_))},_.onExpand=function(g){var f=_.props.context.onNodeExpand;f(g,Object(s.b)(_.props))},_.setSelectHandle=function(g){_.selectHandle=g},_.getNodeState=function(){var g=_.props.expanded;return _.isLeaf()?null:g?o:a},_.hasChildren=function(){var g=_.props.eventKey,f=_.props.context.keyEntities,u=f[g]||{},E=u.children;return!!(E||[]).length},_.isLeaf=function(){var g=_.props,f=g.isLeaf,u=g.loaded,E=_.props.context.loadData,b=_.hasChildren();return f===!1?!1:f||!E&&!b||E&&u&&!b},_.isDisabled=function(){var g=_.props.disabled,f=_.props.context.disabled;return!!(f||g)},_.isCheckable=function(){var g=_.props.checkable,f=_.props.context.checkable;return!f||g===!1?!1:f},_.syncLoadData=function(g){var f=g.expanded,u=g.loading,E=g.loaded,b=_.props.context,y=b.loadData,P=b.onNodeLoad;if(u)return;y&&f&&!_.isLeaf()&&(!_.hasChildren()&&!E&&P(Object(s.b)(_.props)))},_.renderSwitcher=function(){var g=_.props,f=g.expanded,u=g.switcherIcon,E=_.props.context,b=E.prefixCls,y=E.switcherIcon,P=u||y;if(_.isLeaf())return k.createElement("span",{className:v()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof P=="function"?P(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!0})):P);var R=v()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(f?o:a));return k.createElement("span",{onClick:_.onExpand,className:R},typeof P=="function"?P(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!1})):P)},_.renderCheckbox=function(){var g=_.props,f=g.checked,u=g.halfChecked,E=g.disableCheckbox,b=_.props.context.prefixCls,y=_.isDisabled(),P=_.isCheckable();if(!P)return null;var R=typeof P!="boolean"?P:null;return k.createElement("span",{className:v()("".concat(b,"-checkbox"),f&&"".concat(b,"-checkbox-checked"),!f&&u&&"".concat(b,"-checkbox-indeterminate"),(y||E)&&"".concat(b,"-checkbox-disabled")),onClick:_.onCheck},R)},_.renderIcon=function(){var g=_.props.loading,f=_.props.context.prefixCls;return k.createElement("span",{className:v()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(_.getNodeState()||"docu"),g&&"".concat(f,"-icon_loading"))})},_.renderSelector=function(){var g=_.state.dragNodeHighlight,f=_.props,u=f.title,E=f.selected,b=f.icon,y=f.loading,P=f.data,R=_.props.context,U=R.prefixCls,L=R.showIcon,j=R.icon,A=R.draggable,X=R.loadData,ee=R.titleRender,se=_.isDisabled(),ce="".concat(U,"-node-content-wrapper"),Le;if(L){var Ce=b||j;Le=Ce?k.createElement("span",{className:v()("".concat(U,"-iconEle"),"".concat(U,"-icon__customize"))},typeof Ce=="function"?Ce(_.props):Ce):_.renderIcon()}else X&&y&&(Le=_.renderIcon());var Ae;typeof u=="function"?Ae=u(P):ee?Ae=ee(P):Ae=u;var Pe=k.createElement("span",{className:"".concat(U,"-title")},Ae);return k.createElement("span",{ref:_.setSelectHandle,title:typeof u=="string"?u:"",className:v()("".concat(ce),"".concat(ce,"-").concat(_.getNodeState()||"normal"),!se&&(E||g)&&"".concat(U,"-node-selected"),!se&&A&&"draggable"),draggable:!se&&A||void 0,"aria-grabbed":!se&&A||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:A?_.onDragStart:void 0},Le,Pe)},_}return Object(W.a)(S,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var g=this.props.selectable,f=this.props.context.selectable;return typeof g=="boolean"?g:f}},{key:"render",value:function(){var g,f=this.props,u=f.eventKey,E=f.className,b=f.style,y=f.dragOver,P=f.dragOverGapTop,R=f.dragOverGapBottom,U=f.isLeaf,L=f.isStart,j=f.isEnd,A=f.expanded,X=f.selected,ee=f.checked,se=f.halfChecked,ce=f.loading,Le=f.domRef,Ce=f.active,Ae=f.onMouseMove,Pe=Object(z.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ie=this.props.context,pe=Ie.prefixCls,de=Ie.filterTreeNode,ne=Ie.draggable,ge=Ie.keyEntities,oe=this.isDisabled(),De=Object(c.f)(Pe),Ue=ge[u]||{},we=Ue.level,Ge=j[j.length-1];return k.createElement("div",Object.assign({ref:Le,className:v()(E,"".concat(pe,"-treenode"),(g={},Object(q.a)(g,"".concat(pe,"-treenode-disabled"),oe),Object(q.a)(g,"".concat(pe,"-treenode-switcher-").concat(A?"open":"close"),!U),Object(q.a)(g,"".concat(pe,"-treenode-checkbox-checked"),ee),Object(q.a)(g,"".concat(pe,"-treenode-checkbox-indeterminate"),se),Object(q.a)(g,"".concat(pe,"-treenode-selected"),X),Object(q.a)(g,"".concat(pe,"-treenode-loading"),ce),Object(q.a)(g,"".concat(pe,"-treenode-active"),Ce),Object(q.a)(g,"".concat(pe,"-treenode-leaf-last"),Ge),Object(q.a)(g,"drag-over",!oe&&y),Object(q.a)(g,"drag-over-gap-top",!oe&&P),Object(q.a)(g,"drag-over-gap-bottom",!oe&&R),Object(q.a)(g,"filter-node",de&&de(Object(s.b)(this.props))),g)),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:Ae},De),k.createElement(r,{prefixCls:pe,level:we,isStart:L,isEnd:j}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),S}(k.Component),I=function(O){return k.createElement(m.a.Consumer,null,function(S){return k.createElement(h,Object.assign({},O,{context:S}))})};I.displayName="TreeNode",I.defaultProps={title:l},I.isTreeNode=1;var w=Me.a=I},Xsq0:function(Ke,Me,K){Ke.exports=K.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Ke,Me,K){"use strict";K.r(Me),K.d(Me,"ResizableTextArea",function(){return se});var q=K("wx14"),z=K("1OyB"),N=K("vuIU"),V=K("Ji7U"),W=K("LK+K"),D=K("q1tI"),H=K("VTBJ"),F=K("rePB"),k=K("Zm9Q"),T=K("Kwbf"),v=K("c+Xe"),m=K("m+aA"),c=K("bdgK"),d=new Map;function r(Ce){Ce.forEach(function(Ae){var Pe,Ie=Ae.target;(Pe=d.get(Ie))===null||Pe===void 0||Pe.forEach(function(pe){return pe(Ie)})})}var s=new c.default(r),o=null,a=null;function l(Ce,Ae){d.has(Ce)||(d.set(Ce,new Set),s.observe(Ce)),d.get(Ce).add(Ae)}function h(Ce,Ae){d.has(Ce)&&(d.get(Ce).delete(Ae),d.get(Ce).size||(s.unobserve(Ce),d.delete(Ce)))}var I=function(Ce){Object(V.a)(Pe,Ce);var Ae=Object(W.a)(Pe);function Pe(){return Object(z.a)(this,Pe),Ae.apply(this,arguments)}return Object(N.a)(Pe,[{key:"render",value:function(){return this.props.children}}]),Pe}(D.Component),w=D.createContext(null);function x(Ce){var Ae=Ce.children,Pe=Ce.onBatchResize,Ie=D.useRef(0),pe=D.useRef([]),de=D.useContext(w),ne=D.useCallback(function(ge,oe,De){Ie.current+=1;var Ue=Ie.current;pe.current.push({size:ge,element:oe,data:De}),Promise.resolve().then(function(){Ue===Ie.current&&(Pe==null||Pe(pe.current),pe.current=[])}),de==null||de(ge,oe,De)},[Pe,de]);return D.createElement(w.Provider,{value:ne},Ae)}function O(Ce){var Ae=Ce.children,Pe=Ce.disabled,Ie=D.useRef(null),pe=D.useRef(null),de=D.useContext(w),ne=D.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ge=D.isValidElement(Ae)&&Object(v.c)(Ae),oe=ge?Ae.ref:null,De=D.useMemo(function(){return Object(v.a)(oe,Ie)},[oe,Ie]),Ue=D.useRef(Ce);Ue.current=Ce;var we=D.useCallback(function(Ge){var Qe=Ue.current,et=Qe.onResize,ze=Qe.data,Je=Ge.getBoundingClientRect(),Xe=Je.width,yt=Je.height,xt=Ge.offsetWidth,vt=Ge.offsetHeight,ht=Math.floor(Xe),Rt=Math.floor(yt);if(ne.current.width!==ht||ne.current.height!==Rt||ne.current.offsetWidth!==xt||ne.current.offsetHeight!==vt){var At={width:ht,height:Rt,offsetWidth:xt,offsetHeight:vt};ne.current=At;var ke=xt===Math.round(Xe)?Xe:xt,Oe=vt===Math.round(yt)?yt:vt,tt=Object(H.a)(Object(H.a)({},At),{},{offsetWidth:ke,offsetHeight:Oe});de==null||de(tt,Ge,ze),et&&Promise.resolve().then(function(){et(tt,Ge)})}},[]);return D.useEffect(function(){var Ge=Object(m.a)(Ie.current)||Object(m.a)(pe.current);return Ge&&!Pe&&l(Ge,we),function(){return h(Ge,we)}},[Ie.current,Pe]),D.createElement(I,{ref:pe},ge?D.cloneElement(Ae,{ref:De}):Ae)}var S="rc-observer-key";function _(Ce){var Ae=Ce.children,Pe=Object(k.a)(Ae);return Pe.map(function(Ie,pe){var de=(Ie==null?void 0:Ie.key)||"".concat(S,"-").concat(pe);return D.createElement(O,Object(q.a)({},Ce,{key:de}),Ie)})}_.Collection=x;var g=_,f=K("bT9E"),u=K("TSYQ"),E=K.n(u),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
`,y=["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"],P={},R;function U(Ce){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pe=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(Ae&&P[Pe])return P[Pe];var Ie=window.getComputedStyle(Ce),pe=Ie.getPropertyValue("box-sizing")||Ie.getPropertyValue("-moz-box-sizing")||Ie.getPropertyValue("-webkit-box-sizing"),de=parseFloat(Ie.getPropertyValue("padding-bottom"))+parseFloat(Ie.getPropertyValue("padding-top")),ne=parseFloat(Ie.getPropertyValue("border-bottom-width"))+parseFloat(Ie.getPropertyValue("border-top-width")),ge=y.map(function(De){return"".concat(De,":").concat(Ie.getPropertyValue(De))}).join(";"),oe={sizingStyle:ge,paddingSize:de,borderSize:ne,boxSizing:pe};return Ae&&Pe&&(P[Pe]=oe),oe}function L(Ce){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),document.body.appendChild(R)),Ce.getAttribute("wrap")?R.setAttribute("wrap",Ce.getAttribute("wrap")):R.removeAttribute("wrap");var pe=U(Ce,Ae),de=pe.paddingSize,ne=pe.borderSize,ge=pe.boxSizing,oe=pe.sizingStyle;R.setAttribute("style","".concat(oe,";").concat(b)),R.value=Ce.value||Ce.placeholder||"";var De=Number.MIN_SAFE_INTEGER,Ue=Number.MAX_SAFE_INTEGER,we=R.scrollHeight,Ge;if(ge==="border-box"?we+=ne:ge==="content-box"&&(we-=de),Pe!==null||Ie!==null){R.value=" ";var Qe=R.scrollHeight-de;Pe!==null&&(De=Qe*Pe,ge==="border-box"&&(De=De+de+ne),we=Math.max(De,we)),Ie!==null&&(Ue=Qe*Ie,ge==="border-box"&&(Ue=Ue+de+ne),Ge=we>Ue?"":"hidden",we=Math.min(Ue,we))}return{height:we,minHeight:De,maxHeight:Ue,overflowY:Ge,resize:"none"}}var j=K("Gytx"),A=K.n(j),X;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(X||(X={}));var ee=function(Ce){Object(V.a)(Pe,Ce);var Ae=Object(W.a)(Pe);function Pe(Ie){var pe;return Object(z.a)(this,Pe),pe=Ae.call(this,Ie),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(de){pe.textArea=de},pe.handleResize=function(de){var ne=pe.state.resizeStatus,ge=pe.props,oe=ge.autoSize,De=ge.onResize;if(ne!==X.NONE)return;typeof De=="function"&&De(de),oe&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var de=pe.props.autoSize;if(!de||!pe.textArea)return;var ne=de.minRows,ge=de.maxRows,oe=L(pe.textArea,!1,ne,ge);pe.setState({textareaStyles:oe,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:X.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:X.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var de=pe.props,ne=de.prefixCls,ge=ne===void 0?"rc-textarea":ne,oe=de.autoSize,De=de.onResize,Ue=de.className,we=de.disabled,Ge=pe.state,Qe=Ge.textareaStyles,et=Ge.resizeStatus,ze=Object(f.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Je=E()(ge,Ue,Object(F.a)({},"".concat(ge,"-disabled"),we));"value"in ze&&(ze.value=ze.value||"");var Xe=Object(H.a)(Object(H.a)(Object(H.a)({},pe.props.style),Qe),et===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return D.createElement(g,{onResize:pe.handleResize,disabled:!(oe||De)},D.createElement("textarea",Object(q.a)({},ze,{className:Je,style:Xe,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:X.NONE},pe}return Object(N.a)(Pe,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!A()(pe.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 pe=this.textArea.selectionStart,de=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,de)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Pe}(D.Component),se=ee,ce=function(Ce){Object(V.a)(Pe,Ce);var Ae=Object(W.a)(Pe);function Pe(Ie){var pe;Object(z.a)(this,Pe),pe=Ae.call(this,Ie),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(ne){pe.resizableTextArea=ne},pe.handleChange=function(ne){var ge=pe.props.onChange;pe.setValue(ne.target.value,function(){pe.resizableTextArea.resizeTextarea()}),ge&&ge(ne)},pe.handleKeyDown=function(ne){var ge=pe.props,oe=ge.onPressEnter,De=ge.onKeyDown;ne.keyCode===13&&oe&&oe(ne),De&&De(ne)};var de=typeof Ie.value=="undefined"||Ie.value===null?Ie.defaultValue:Ie.value;return pe.state={value:de},pe}return Object(N.a)(Pe,[{key:"setValue",value:function(pe,de){"value"in this.props||this.setState({value:pe},de)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return D.createElement(se,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Pe}(D.Component),Le=Me.default=ce},ZW9T:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return L});var q=K("k1fw"),z=K("miYZ"),N=K("tsqr"),V=K("rAM+"),W=K("tJVT"),D=K("PpiC"),H=K("q1tI"),F=K.n(H),k=K("bdgK"),T=K("oBTY"),v=K("9og8"),m=K("WmNS"),c=K.n(m),d={keywords:["print","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"]},r={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},s={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},o={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},a=K("5VLF"),l=K.n(a),h={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},I=function(A,X){return X.map(function(ee){return{label:ee,kind:A.languages.CompletionItemKind.Keyword,insertText:ee}})},w=function(A){return Object.keys(h.tables).map(function(X){return{label:X,kind:A.languages.CompletionItemKind.Variable,insertText:X}})},x=function(A,X){var ee=h.tables[A];return ee?ee.map(function(se){return{label:se,kind:X.languages.CompletionItemKind.Field,insertText:se}}):[]};function O(j,A,X,ee,se){var ce=A.getWordUntilPosition(X),Le={startLineNumber:X.lineNumber,endLineNumber:X.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},Ce=ee.map(function(Ae){return{label:Ae,kind:j.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}});return se.map(function(Ae){Ce.push(Object(q.a)(Object(q.a)({},Ae),{},{range:Le}))}),Ce}var S=function(j){h.languages.map(function(se){return j.languages.registerDocumentFormattingEditProvider(se,{provideDocumentFormattingEdits:function(Le,Ce,Ae){return Object(v.a)(c.a.mark(function Pe(){var Ie;return c.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return Ie=l()(Le.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),de.abrupt("return",[{range:Le.getFullModelRange(),text:Ie}]);case 2:case"end":return de.stop()}},Pe)}))()}}),se});var A=s.quickKey.map(function(se){return{label:se.label,kind:j.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=o.quickKey.map(function(se){return{label:se.label,kind:j.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=r.quickKey.map(function(se){return{label:se.label,kind:j.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet}});j.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(T.a)(s.keywords),Object(T.a)(s.quickKey.map(function(se){return se.label}))),provideCompletionItems:function(ce,Le){var Ce=ce.getValueInRange({startLineNumber:Le.lineNumber,startColumn:1,endLineNumber:Le.lineNumber,endColumn:Le.column}),Ae=Ce.match(/cu/gim);console.log("match:",Ae,Le,Ce,ce);var Pe=[],Ie=Le.lineNumber,pe=Le.column,de=ce.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:pe}),ne=de.trim().split(/\s+/),ge=ne[ne.length-1];if(ge.endsWith(".")){var oe=ge.slice(0,ge.length-1);Object.keys(h.tables).includes(oe)&&(Pe=Object(T.a)(x(oe,j)))}else ge==="."?Pe=[]:Pe=[].concat(Object(T.a)(w(j)),Object(T.a)(I(j,s.keywords)),Object(T.a)(A));return{suggestions:Pe}}}),j.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(T.a)(d.keywords)),provideCompletionItems:function(ce,Le){var Ce=ce.getValueInRange({startLineNumber:Le.lineNumber,startColumn:1,endLineNumber:Le.lineNumber,endColumn:Le.column}),Ae=Ce.match(/cu/gim);console.log("match:",Ae,Le,Ce,ce);var Pe=[],Ie=Le.lineNumber,pe=Le.column,de=ce.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:pe}),ne=de.trim().split(/\s+/),ge=ne[ne.length-1];if(ge.endsWith(".")){var oe=ge.slice(0,ge.length-1);Object.keys(h.tables).includes(oe)&&(Pe=Object(T.a)(x(oe,j)))}else ge==="."?Pe=[]:Pe=[].concat(Object(T.a)(w(j)),Object(T.a)(I(j,d.keywords)));return{suggestions:Pe}}}),j.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(T.a)(r.keywords)),provideCompletionItems:function(ce,Le){var Ce=[],Ae=Le.lineNumber,Pe=Le.column,Ie=ce.getValueInRange({startLineNumber:Ae,startColumn:0,endLineNumber:Ae,endColumn:Pe}),pe=Ie.trim().split(/\s+/),de=pe[pe.length-1];if(de.endsWith(".")){var ne=de.slice(0,de.length-1);Object.keys(h.tables).includes(ne)&&(Ce=Object(T.a)(x(ne,j)))}else de==="."?Ce=[]:Ce=[].concat(Object(T.a)(w(j)),Object(T.a)(I(j,r.keywords)),Object(T.a)(ee));return{suggestions:Ce}}}),j.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(T.a)(o.keywords)),provideCompletionItems:function(ce,Le){var Ce=[],Ae=Le.lineNumber,Pe=Le.column,Ie=ce.getValueInRange({startLineNumber:Ae,startColumn:0,endLineNumber:Ae,endColumn:Pe}),pe=Ie.trim().split(/\s+/),de=pe[pe.length-1];if(de.endsWith(".")){var ne=de.slice(0,de.length-1);Object.keys(h.tables).includes(ne)&&(Ce=Object(T.a)(x(ne,j)))}else de==="."?Ce=[]:Ce=[].concat(Object(T.a)(w(j)),Object(T.a)(I(j,o.keywords)),Object(T.a)(X));return{suggestions:Ce}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",g=K("LvDl"),f=K("+ua5");function u(j){return/^\d+$/.test(j)?"".concat(j,"px"):j}function E(){}var b=!1,y={"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 P(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=j;if(Array.isArray(j)){for(var X=0;X<j.length;X++){var ee=y[j[X]];if(ee)return ee}return A[0]}return y[A]||A}var R=null,U=Me.b=function(j){var A=j.width,X=A===void 0?"100%":A,ee=j.height,se=ee===void 0?"100%":ee,ce=j.value,Le=j.language,Ce=Le===void 0?"javascript":Le,Ae=j.style,Pe=Ae===void 0?{}:Ae,Ie=j.options,pe=Ie===void 0?{}:Ie,de=j.overrideServices,ne=de===void 0?{}:de,ge=j.theme,oe=ge===void 0?"vs-dark":ge,De=j.onEditBlur,Ue=j.onSave,we=j.autoHeight,Ge=we===void 0?!1:we,Qe=j.forbidCopy,et=Qe===void 0?!1:Qe,ze=j.onChange,Je=ze===void 0?E:ze,Xe=j.editorDidMount,yt=Xe===void 0?E:Xe,xt=j.onFocus,vt=xt===void 0?E:xt,ht=j.filename,Rt=ht===void 0?"educoder.txt":ht,At=j.errorLine,ke=j.errorContent,Oe=ke===void 0?"":ke,tt=Object(D.a)(j,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),it=Object(H.useRef)(),Ne=Object(H.useRef)({}),qe=Object(H.useRef)(),Te=Object(H.useRef)(!1),fe=Object(H.useRef)(),me=Object(H.useState)(!1),re=Object(W.a)(me,2),ae=re[0],he=re[1];function ve(){var Ee;return it.current&&(Ee=new k.default(function(Be){var st=Object(V.a)(Be),ct;try{for(st.s();!(ct=st.n()).done;){var Ct=ct.value;(Ct.target.offsetHeight>0||Ct.target.offsetWidth>0)&&Ne.current.instance.layout()}}catch(lt){st.e(lt)}finally{st.f()}}),Ee.observe(it.current)),Ee}function _e(){N.b.warn(decodeURIComponent(_))}var je=function(){var Be=Ne.current.instance;if(ce!=null&&Be&&ae){var st=Be.getModel();st&&ce!==st.getValue()&&(b=!0,st.setValue(ce),Be.layout(),b=!1)}};Object(H.useEffect)(function(){qe.current&&clearTimeout(qe.current),qe.current=setTimeout(function(){je()},500)},[ce,ae,Ne.current]),Object(H.useEffect)(function(){if(At&&Ne.current&&Ne.current.instance){var Ee=Ne.current.instance;Ee.changeViewZones(function(st){var ct=document.createElement("div");ct.style.padding="10px 20px",ct.style.width="calc(100% - 20px)",ct.className="my-error-line-wrp",ct.innerHTML=Oe,st.addZone({afterLineNumber:At||11,heightInLines:3,domNode:ct})});var Be={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ee.addOverlayWidget(Be),Ee.revealPositionInCenter({lineNumber:20,column:1})}},[At,Ne.current,ae]);function at(){var Ee=Ne.current.instance;if(Ee){var Be=Ee.getSelection(),st=Ne.current.pastePos||{},ct=new R.Range(st.startLineNumber||Be.endLineNumber,st.startColumn||Be.endColumn,st.endLineNumber||Be.endLineNumber,st.endColumn||Be.endColumn);setTimeout(function(){Ee.executeEdits("",[{range:ct,text:""}])},300)}}function Et(Ee){(window.navigator.platform.match("Mac")?Ee.metaKey:Ee.ctrlKey)&&Ee.keyCode==83&&(Ee.preventDefault(),Ue())}var Lt=function(){if(Ge&&Ne.current.instance){var Be=Ne.current.instance.getContentHeight();bt(Be<se?se:Be)}else bt(se)};function Tt(Ee){var Be=document.createEvent("MouseEvents");Be.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ee.dispatchEvent(Be)}function mt(Ee,Be){var st=window.URL||window.webkitURL||window,ct=new Blob([Be]),Ct=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ct.href=st.createObjectURL(ct),Ct.download=Ee,Tt(Ct)}Object(H.useEffect)(function(){Lt()},[Lt]),Object(H.useEffect)(function(){it.current&&!ae&&K.e(27).then(K.t.bind(null,"M/lh",7)).then(function(Ee){try{R=Ee,Ne.current.instance=R.editor.create(it.current,{value:ce,language:P(Ce),theme:oe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},ne);var Be=Ne.current.instance;if(yt(Be,R),setTimeout(function(){Lt(),Ne.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){mt(Rt||"educoder.txt",Be.getValue())}})},500),Ne.current.subscription=Be.onDidChangeModelContent(function(ct){Te.current?clearTimeout(fe.current):(Lt(),Je(Be.getValue(),ct)),fe.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||S(R),et&&(Be.addCommand(R.KeyMod.CtrlCmd|R.KeyMod.Shift|R.KeyCode.KEY_V,function(){return _e(),null}),Be.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_C,function(){return _e(),null})),window.Monaco=R,De&&Be.onDidBlurEditorWidget(function(){De(Be.getValue())}),vt&&Be.onDidFocusEditorText(function(){vt(Be.getValue())}),et){Be.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return _e(),null}),Be.onDidPaste(function(ct){Ne.current.pastePos=ct});try{window.addEventListener("paste",at)}catch(ct){}}var st=ve();return he(!0),function(){var ct=Ne.current.instance;ct.dispose();var Ct=ct.getModel();Ct&&Ct.dispose(),Ne.current.subscription&&Ne.current.subscription.dispose(),et&&window.removeEventListener("paste",at),st.unobserve(it.current)}}catch(ct){}})},[]),Object(H.useEffect)(function(){var Ee=Ne.current.instance;if(Ee&&ae)return document.addEventListener("keydown",Et,!1),function(){document.removeEventListener("keydown",Et)}},[Ue,ae]),Object(H.useEffect)(function(){var Ee=Ne.current.instance;if(Ee&&ae){var Be=P(Ce);R.editor.setModelLanguage(Ee.getModel(),Be),console.log("language:",Ce,Ee.getModel(),Be)}},[Ce,ae]),Object(H.useEffect)(function(){var Ee=Ne.current.instance;Ee&&ae&&R.editor.setTheme(oe)},[oe,ae]),Object(H.useEffect)(function(){var Ee=Ne.current.instance;Ee&&ae&&(Ee.updateOptions(Object(q.a)({},pe)),setTimeout(function(){Ee.getModel().updateOptions(Object(q.a)({},pe))},200))},[JSON.stringify(pe),ae]),Object(H.useEffect)(function(){var Ee=Ne.current.instance;Ee&&ae&&Ee.layout()},[X,se,ae]);var Ze=Object(H.useState)(u(X)),$e=Object(W.a)(Ze,2),He=$e[0],le=$e[1],be=Object(H.useState)(u(se)),rt=Object(W.a)(be,2),Ye=rt[0],bt=rt[1],pt=Object(q.a)(Object(q.a)({},Pe),{},{width:He,height:Ye});return F.a.createElement("div",{className:"my-monaco-editor",ref:it,style:pt})};function L(j){var A=j.width,X=A===void 0?"100%":A,ee=j.height,se=ee===void 0?"100%":ee,ce=j.original,Le=j.modified,Ce=j.language,Ae=j.options,Pe=Ae===void 0?{}:Ae,Ie=Object(H.useRef)(),pe=Object(H.useState)(null),de=Object(W.a)(pe,2),ne=de[0],ge=de[1];function oe(Ge){var Qe;return Ie.current&&(Qe=new k.default(function(et){var ze=Object(V.a)(et),Je;try{for(ze.s();!(Je=ze.n()).done;){var Xe=Je.value;(Xe.target.offsetHeight>0||Xe.target.offsetWidth>0)&&Ge.layout()}}catch(yt){ze.e(yt)}finally{ze.f()}}),Qe.observe(Ie.current)),Qe}Object(H.useEffect)(function(){Ie.current&&K.e(27).then(K.t.bind(null,"M/lh",7)).then(function(Ge){R=Ge;var Qe=R.editor.createDiffEditor(Ie.current,Object(q.a)(Object(q.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},Pe),{},{wordWrap:!0}));ge(Qe);var et=oe(Qe);return function(){Qe.dispose();var ze=Qe.getModel();ze&&ze.dispose(),et.unobserve(Ie.current)}})},[]),Object(H.useEffect)(function(){ne&&ne.setModel({original:R.editor.createModel(ce,Ce),modified:R.editor.createModel(Le,Ce)})},[ce,Le,Ce,ne]);var De=u(X),Ue=u(se),we={width:De,height:Ue};return F.a.createElement("div",{className:"my-diff-editor",ref:Ie,style:we})}},ZpRC:function(Ke,Me,K){"use strict";function q(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function z(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function N(v,m){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var c=getComputedStyle(v,null);return z(c.overflowY,m)||z(c.overflowX,m)||function(d){var r=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(o){return null}}(d);return!!r&&(r.clientHeight<d.scrollHeight||r.clientWidth<d.scrollWidth)}(v)}return!1}function V(v,m,c,d,r,s,o,a){return s<v&&o>m||s>v&&o<m?0:s<=v&&a<=c||o>=m&&a>=c?s-v-d:o>m&&a<c||s<v&&a>c?o-m+r:0}var W=function(v,m){var c=window,d=m.scrollMode,r=m.block,s=m.inline,o=m.boundary,a=m.skipOverflowHiddenElements,l=typeof o=="function"?o:function(Qe){return Qe!==o};if(!q(v))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,I=[],w=v;q(w)&&l(w);){if((w=w.parentElement)===h){I.push(w);break}w!=null&&w===document.body&&N(w)&&!N(document.documentElement)||w!=null&&N(w,a)&&I.push(w)}for(var x=c.visualViewport?c.visualViewport.width:innerWidth,O=c.visualViewport?c.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,g=v.getBoundingClientRect(),f=g.height,u=g.width,E=g.top,b=g.right,y=g.bottom,P=g.left,R=r==="start"||r==="nearest"?E:r==="end"?y:E+f/2,U=s==="center"?P+u/2:s==="end"?b:P,L=[],j=0;j<I.length;j++){var A=I[j],X=A.getBoundingClientRect(),ee=X.height,se=X.width,ce=X.top,Le=X.right,Ce=X.bottom,Ae=X.left;if(d==="if-needed"&&E>=0&&P>=0&&y<=O&&b<=x&&E>=ce&&y<=Ce&&P>=Ae&&b<=Le)return L;var Pe=getComputedStyle(A),Ie=parseInt(Pe.borderLeftWidth,10),pe=parseInt(Pe.borderTopWidth,10),de=parseInt(Pe.borderRightWidth,10),ne=parseInt(Pe.borderBottomWidth,10),ge=0,oe=0,De="offsetWidth"in A?A.offsetWidth-A.clientWidth-Ie-de:0,Ue="offsetHeight"in A?A.offsetHeight-A.clientHeight-pe-ne:0;if(h===A)ge=r==="start"?R:r==="end"?R-O:r==="nearest"?V(_,_+O,O,pe,ne,_+R,_+R+f,f):R-O/2,oe=s==="start"?U:s==="center"?U-x/2:s==="end"?U-x:V(S,S+x,x,Ie,de,S+U,S+U+u,u),ge=Math.max(0,ge+_),oe=Math.max(0,oe+S);else{ge=r==="start"?R-ce-pe:r==="end"?R-Ce+ne+Ue:r==="nearest"?V(ce,Ce,ee,pe,ne+Ue,R,R+f,f):R-(ce+ee/2)+Ue/2,oe=s==="start"?U-Ae-Ie:s==="center"?U-(Ae+se/2)+De/2:s==="end"?U-Le+de+De:V(Ae,Le,se,Ie,de+De,U,U+u,u);var we=A.scrollLeft,Ge=A.scrollTop;R+=Ge-(ge=Math.max(0,Math.min(Ge+ge,A.scrollHeight-ee+Ue))),U+=we-(oe=Math.max(0,Math.min(we+oe,A.scrollWidth-se+De)))}L.push({el:A,top:ge,left:oe})}return L};function D(v){return v===Object(v)&&Object.keys(v).length!==0}function H(v,m){m===void 0&&(m="auto");var c="scrollBehavior"in document.body.style;v.forEach(function(d){var r=d.el,s=d.top,o=d.left;r.scroll&&c?r.scroll({top:s,left:o,behavior:m}):(r.scrollTop=s,r.scrollLeft=o)})}function F(v){return v===!1?{block:"end",inline:"nearest"}:D(v)?v:{block:"start",inline:"nearest"}}function k(v,m){var c=!v.ownerDocument.documentElement.contains(v);if(D(m)&&typeof m.behavior=="function")return m.behavior(c?[]:W(v,m));if(c)return;var d=F(m);return H(W(v,d),d.behavior)}var T=Me.a=k},Zss7:function(Ke,Me,K){var q;(function(z){var N=/^\s+/,V=/\s+$/,W=0,D=z.round,H=z.min,F=z.max,k=z.random;function T(ne,ge){if(ne=ne||"",ge=ge||{},ne instanceof T)return ne;if(!(this instanceof T))return new T(ne,ge);var oe=v(ne);this._originalInput=ne,this._r=oe.r,this._g=oe.g,this._b=oe.b,this._a=oe.a,this._roundA=D(100*this._a)/100,this._format=ge.format||oe.format,this._gradientType=ge.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=oe.ok,this._tc_id=W++}T.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(),ge,oe,De,Ue,we,Ge;return ge=ne.r/255,oe=ne.g/255,De=ne.b/255,ge<=.03928?Ue=ge/12.92:Ue=z.pow((ge+.055)/1.055,2.4),oe<=.03928?we=oe/12.92:we=z.pow((oe+.055)/1.055,2.4),De<=.03928?Ge=De/12.92:Ge=z.pow((De+.055)/1.055,2.4),.2126*Ue+.7152*we+.0722*Ge},setAlpha:function(ne){return this._a=L(ne),this._roundA=D(100*this._a)/100,this},toHsv:function(){var ne=r(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=r(this._r,this._g,this._b),ge=D(ne.h*360),oe=D(ne.s*100),De=D(ne.v*100);return this._a==1?"hsv("+ge+", "+oe+"%, "+De+"%)":"hsva("+ge+", "+oe+"%, "+De+"%, "+this._roundA+")"},toHsl:function(){var ne=c(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=c(this._r,this._g,this._b),ge=D(ne.h*360),oe=D(ne.s*100),De=D(ne.l*100);return this._a==1?"hsl("+ge+", "+oe+"%, "+De+"%)":"hsla("+ge+", "+oe+"%, "+De+"%, "+this._roundA+")"},toHex:function(ne){return o(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return a(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(j(this._r,255)*100)+"%",g:D(j(this._g,255)*100)+"%",b:D(j(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+D(j(this._r,255)*100)+"%, "+D(j(this._g,255)*100)+"%, "+D(j(this._b,255)*100)+"%)":"rgba("+D(j(this._r,255)*100)+"%, "+D(j(this._g,255)*100)+"%, "+D(j(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:R[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var ge="#"+l(this._r,this._g,this._b,this._a),oe=ge,De=this._gradientType?"GradientType = 1, ":"";if(ne){var Ue=T(ne);oe="#"+l(Ue._r,Ue._g,Ue._b,Ue._a)}return"progid:DXImageTransform.Microsoft.gradient("+De+"startColorstr="+ge+",endColorstr="+oe+")"},toString:function(ne){var ge=!!ne;ne=ne||this._format;var oe=!1,De=this._a<1&&this._a>=0,Ue=!ge&&De&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return Ue?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(oe=this.toRgbString()),ne==="prgb"&&(oe=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(oe=this.toHexString()),ne==="hex3"&&(oe=this.toHexString(!0)),ne==="hex4"&&(oe=this.toHex8String(!0)),ne==="hex8"&&(oe=this.toHex8String()),ne==="name"&&(oe=this.toName()),ne==="hsl"&&(oe=this.toHslString()),ne==="hsv"&&(oe=this.toHsvString()),oe||this.toHexString())},clone:function(){return T(this.toString())},_applyModification:function(ne,ge){var oe=ne.apply(null,[this].concat([].slice.call(ge)));return this._r=oe._r,this._g=oe._g,this._b=oe._b,this.setAlpha(oe._a),this},lighten:function(){return this._applyModification(x,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(S,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(I,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(ne,ge){return ne.apply(null,[this].concat([].slice.call(ge)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(y,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(f,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},T.fromRatio=function(ne,ge){if(typeof ne=="object"){var oe={};for(var De in ne)ne.hasOwnProperty(De)&&(De==="a"?oe[De]=ne[De]:oe[De]=Le(ne[De]));ne=oe}return T(ne,ge)};function v(ne){var ge={r:0,g:0,b:0},oe=1,De=null,Ue=null,we=null,Ge=!1,Qe=!1;return typeof ne=="string"&&(ne=pe(ne)),typeof ne=="object"&&(Ie(ne.r)&&Ie(ne.g)&&Ie(ne.b)?(ge=m(ne.r,ne.g,ne.b),Ge=!0,Qe=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):Ie(ne.h)&&Ie(ne.s)&&Ie(ne.v)?(De=Le(ne.s),Ue=Le(ne.v),ge=s(ne.h,De,Ue),Ge=!0,Qe="hsv"):Ie(ne.h)&&Ie(ne.s)&&Ie(ne.l)&&(De=Le(ne.s),we=Le(ne.l),ge=d(ne.h,De,we),Ge=!0,Qe="hsl"),ne.hasOwnProperty("a")&&(oe=ne.a)),oe=L(oe),{ok:Ge,format:ne.format||Qe,r:H(255,F(ge.r,0)),g:H(255,F(ge.g,0)),b:H(255,F(ge.b,0)),a:oe}}function m(ne,ge,oe){return{r:j(ne,255)*255,g:j(ge,255)*255,b:j(oe,255)*255}}function c(ne,ge,oe){ne=j(ne,255),ge=j(ge,255),oe=j(oe,255);var De=F(ne,ge,oe),Ue=H(ne,ge,oe),we,Ge,Qe=(De+Ue)/2;if(De==Ue)we=Ge=0;else{var et=De-Ue;Ge=Qe>.5?et/(2-De-Ue):et/(De+Ue);switch(De){case ne:we=(ge-oe)/et+(ge<oe?6:0);break;case ge:we=(oe-ne)/et+2;break;case oe:we=(ne-ge)/et+4;break}we/=6}return{h:we,s:Ge,l:Qe}}function d(ne,ge,oe){var De,Ue,we;ne=j(ne,360),ge=j(ge,100),oe=j(oe,100);function Ge(ze,Je,Xe){return Xe<0&&(Xe+=1),Xe>1&&(Xe-=1),Xe<1/6?ze+(Je-ze)*6*Xe:Xe<1/2?Je:Xe<2/3?ze+(Je-ze)*(2/3-Xe)*6:ze}if(ge===0)De=Ue=we=oe;else{var Qe=oe<.5?oe*(1+ge):oe+ge-oe*ge,et=2*oe-Qe;De=Ge(et,Qe,ne+1/3),Ue=Ge(et,Qe,ne),we=Ge(et,Qe,ne-1/3)}return{r:De*255,g:Ue*255,b:we*255}}function r(ne,ge,oe){ne=j(ne,255),ge=j(ge,255),oe=j(oe,255);var De=F(ne,ge,oe),Ue=H(ne,ge,oe),we,Ge,Qe=De,et=De-Ue;if(Ge=De===0?0:et/De,De==Ue)we=0;else{switch(De){case ne:we=(ge-oe)/et+(ge<oe?6:0);break;case ge:we=(oe-ne)/et+2;break;case oe:we=(ne-ge)/et+4;break}we/=6}return{h:we,s:Ge,v:Qe}}function s(ne,ge,oe){ne=j(ne,360)*6,ge=j(ge,100),oe=j(oe,100);var De=z.floor(ne),Ue=ne-De,we=oe*(1-ge),Ge=oe*(1-Ue*ge),Qe=oe*(1-(1-Ue)*ge),et=De%6,ze=[oe,Ge,we,we,Qe,oe][et],Je=[Qe,oe,oe,Ge,we,we][et],Xe=[we,we,Qe,oe,oe,Ge][et];return{r:ze*255,g:Je*255,b:Xe*255}}function o(ne,ge,oe,De){var Ue=[ce(D(ne).toString(16)),ce(D(ge).toString(16)),ce(D(oe).toString(16))];return De&&Ue[0].charAt(0)==Ue[0].charAt(1)&&Ue[1].charAt(0)==Ue[1].charAt(1)&&Ue[2].charAt(0)==Ue[2].charAt(1)?Ue[0].charAt(0)+Ue[1].charAt(0)+Ue[2].charAt(0):Ue.join("")}function a(ne,ge,oe,De,Ue){var we=[ce(D(ne).toString(16)),ce(D(ge).toString(16)),ce(D(oe).toString(16)),ce(Ce(De))];return Ue&&we[0].charAt(0)==we[0].charAt(1)&&we[1].charAt(0)==we[1].charAt(1)&&we[2].charAt(0)==we[2].charAt(1)&&we[3].charAt(0)==we[3].charAt(1)?we[0].charAt(0)+we[1].charAt(0)+we[2].charAt(0)+we[3].charAt(0):we.join("")}function l(ne,ge,oe,De){var Ue=[ce(Ce(De)),ce(D(ne).toString(16)),ce(D(ge).toString(16)),ce(D(oe).toString(16))];return Ue.join("")}T.equals=function(ne,ge){return!ne||!ge?!1:T(ne).toRgbString()==T(ge).toRgbString()},T.random=function(){return T.fromRatio({r:k(),g:k(),b:k()})};function h(ne,ge){ge=ge===0?0:ge||10;var oe=T(ne).toHsl();return oe.s-=ge/100,oe.s=A(oe.s),T(oe)}function I(ne,ge){ge=ge===0?0:ge||10;var oe=T(ne).toHsl();return oe.s+=ge/100,oe.s=A(oe.s),T(oe)}function w(ne){return T(ne).desaturate(100)}function x(ne,ge){ge=ge===0?0:ge||10;var oe=T(ne).toHsl();return oe.l+=ge/100,oe.l=A(oe.l),T(oe)}function O(ne,ge){ge=ge===0?0:ge||10;var oe=T(ne).toRgb();return oe.r=F(0,H(255,oe.r-D(255*-(ge/100)))),oe.g=F(0,H(255,oe.g-D(255*-(ge/100)))),oe.b=F(0,H(255,oe.b-D(255*-(ge/100)))),T(oe)}function S(ne,ge){ge=ge===0?0:ge||10;var oe=T(ne).toHsl();return oe.l-=ge/100,oe.l=A(oe.l),T(oe)}function _(ne,ge){var oe=T(ne).toHsl(),De=(oe.h+ge)%360;return oe.h=De<0?360+De:De,T(oe)}function g(ne){var ge=T(ne).toHsl();return ge.h=(ge.h+180)%360,T(ge)}function f(ne){var ge=T(ne).toHsl(),oe=ge.h;return[T(ne),T({h:(oe+120)%360,s:ge.s,l:ge.l}),T({h:(oe+240)%360,s:ge.s,l:ge.l})]}function u(ne){var ge=T(ne).toHsl(),oe=ge.h;return[T(ne),T({h:(oe+90)%360,s:ge.s,l:ge.l}),T({h:(oe+180)%360,s:ge.s,l:ge.l}),T({h:(oe+270)%360,s:ge.s,l:ge.l})]}function E(ne){var ge=T(ne).toHsl(),oe=ge.h;return[T(ne),T({h:(oe+72)%360,s:ge.s,l:ge.l}),T({h:(oe+216)%360,s:ge.s,l:ge.l})]}function b(ne,ge,oe){ge=ge||6,oe=oe||30;var De=T(ne).toHsl(),Ue=360/oe,we=[T(ne)];for(De.h=(De.h-(Ue*ge>>1)+720)%360;--ge;)De.h=(De.h+Ue)%360,we.push(T(De));return we}function y(ne,ge){ge=ge||6;for(var oe=T(ne).toHsv(),De=oe.h,Ue=oe.s,we=oe.v,Ge=[],Qe=1/ge;ge--;)Ge.push(T({h:De,s:Ue,v:we})),we=(we+Qe)%1;return Ge}T.mix=function(ne,ge,oe){oe=oe===0?0:oe||50;var De=T(ne).toRgb(),Ue=T(ge).toRgb(),we=oe/100,Ge={r:(Ue.r-De.r)*we+De.r,g:(Ue.g-De.g)*we+De.g,b:(Ue.b-De.b)*we+De.b,a:(Ue.a-De.a)*we+De.a};return T(Ge)},T.readability=function(ne,ge){var oe=T(ne),De=T(ge);return(z.max(oe.getLuminance(),De.getLuminance())+.05)/(z.min(oe.getLuminance(),De.getLuminance())+.05)},T.isReadable=function(ne,ge,oe){var De=T.readability(ne,ge),Ue,we;we=!1,Ue=de(oe);switch(Ue.level+Ue.size){case"AAsmall":case"AAAlarge":we=De>=4.5;break;case"AAlarge":we=De>=3;break;case"AAAsmall":we=De>=7;break}return we},T.mostReadable=function(ne,ge,oe){var De=null,Ue=0,we,Ge,Qe,et;oe=oe||{},Ge=oe.includeFallbackColors,Qe=oe.level,et=oe.size;for(var ze=0;ze<ge.length;ze++)we=T.readability(ne,ge[ze]),we>Ue&&(Ue=we,De=T(ge[ze]));return T.isReadable(ne,De,{level:Qe,size:et})||!Ge?De:(oe.includeFallbackColors=!1,T.mostReadable(ne,["#fff","#000"],oe))};var P=T.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"},R=T.hexNames=U(P);function U(ne){var ge={};for(var oe in ne)ne.hasOwnProperty(oe)&&(ge[ne[oe]]=oe);return ge}function L(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function j(ne,ge){ee(ne)&&(ne="100%");var oe=se(ne);return ne=H(ge,F(0,parseFloat(ne))),oe&&(ne=parseInt(ne*ge,10)/100),z.abs(ne-ge)<1e-6?1:ne%ge/parseFloat(ge)}function A(ne){return H(1,F(0,ne))}function X(ne){return parseInt(ne,16)}function ee(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function se(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function ce(ne){return ne.length==1?"0"+ne:""+ne}function Le(ne){return ne<=1&&(ne=ne*100+"%"),ne}function Ce(ne){return z.round(parseFloat(ne)*255).toString(16)}function Ae(ne){return X(ne)/255}var Pe=function(){var ne="[-\\+]?\\d+%?",ge="[-\\+]?\\d*\\.\\d+%?",oe="(?:"+ge+")|(?:"+ne+")",De="[\\s|\\(]+("+oe+")[,|\\s]+("+oe+")[,|\\s]+("+oe+")\\s*\\)?",Ue="[\\s|\\(]+("+oe+")[,|\\s]+("+oe+")[,|\\s]+("+oe+")[,|\\s]+("+oe+")\\s*\\)?";return{CSS_UNIT:new RegExp(oe),rgb:new RegExp("rgb"+De),rgba:new RegExp("rgba"+Ue),hsl:new RegExp("hsl"+De),hsla:new RegExp("hsla"+Ue),hsv:new RegExp("hsv"+De),hsva:new RegExp("hsva"+Ue),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 Ie(ne){return!!Pe.CSS_UNIT.exec(ne)}function pe(ne){ne=ne.replace(N,"").replace(V,"").toLowerCase();var ge=!1;if(P[ne])ne=P[ne],ge=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var oe;return(oe=Pe.rgb.exec(ne))?{r:oe[1],g:oe[2],b:oe[3]}:(oe=Pe.rgba.exec(ne))?{r:oe[1],g:oe[2],b:oe[3],a:oe[4]}:(oe=Pe.hsl.exec(ne))?{h:oe[1],s:oe[2],l:oe[3]}:(oe=Pe.hsla.exec(ne))?{h:oe[1],s:oe[2],l:oe[3],a:oe[4]}:(oe=Pe.hsv.exec(ne))?{h:oe[1],s:oe[2],v:oe[3]}:(oe=Pe.hsva.exec(ne))?{h:oe[1],s:oe[2],v:oe[3],a:oe[4]}:(oe=Pe.hex8.exec(ne))?{r:X(oe[1]),g:X(oe[2]),b:X(oe[3]),a:Ae(oe[4]),format:ge?"name":"hex8"}:(oe=Pe.hex6.exec(ne))?{r:X(oe[1]),g:X(oe[2]),b:X(oe[3]),format:ge?"name":"hex"}:(oe=Pe.hex4.exec(ne))?{r:X(oe[1]+""+oe[1]),g:X(oe[2]+""+oe[2]),b:X(oe[3]+""+oe[3]),a:Ae(oe[4]+""+oe[4]),format:ge?"name":"hex8"}:(oe=Pe.hex3.exec(ne))?{r:X(oe[1]+""+oe[1]),g:X(oe[2]+""+oe[2]),b:X(oe[3]+""+oe[3]),format:ge?"name":"hex"}:!1}function de(ne){var ge,oe;return ne=ne||{level:"AA",size:"small"},ge=(ne.level||"AA").toUpperCase(),oe=(ne.size||"small").toLowerCase(),ge!=="AA"&&ge!=="AAA"&&(ge="AA"),oe!=="small"&&oe!=="large"&&(oe="small"),{level:ge,size:oe}}Ke.exports?Ke.exports=T:!(q=function(){return T}.call(Me,K,Me,Ke),q!==void 0&&(Ke.exports=q))})(Math)},aRTE:function(Ke,Me){Ke.exports={L:1,M:0,Q:3,H:2}},bPs0:function(Ke,Me,K){"use strict";K.d(Me,"b",function(){return h});var q=K("k1fw"),z=K("9og8"),N=K("2qtc"),V=K("kLXV"),W=K("tJVT"),D=K("PpiC"),H=K("aHsQ"),F=K("sGsY"),k=K("WmNS"),T=K.n(k),v=K("q1tI"),m=K.n(v),c=K("bntm"),d=K("V0Rq"),r=K("wd/R"),s=K.n(r),o=K("Ty5D"),a=K("9kvl"),l=F.a.Countdown,h=["fullscreenchange","msfullscreenchange","webkitfullscreenchange","mozfullscreenchange"],I=function(x){var O=x.globalSetting,S=x.loading,_=x.user,g=x.exercise,f=x.socket,u=x.dispatch,E=Object(D.a)(x,["globalSetting","loading","user","exercise","socket","dispatch"]),b=Object(v.useState)({}),y=Object(W.a)(b,2),P=y[0],R=y[1],U=V.a.useModal(),L=Object(W.a)(U,2),j=L[0],A=L[1],X=Object(v.useRef)(),ee=Object(v.useRef)(null),se=Object(v.useRef)(null),ce=Object(v.useState)(!0),Le=Object(W.a)(ce,2),Ce=Le[0],Ae=Le[1],Pe=Object(o.h)().query,Ie=Object(o.i)();Object(v.useEffect)(function(){var et,ze,Je,Xe,yt;if(clearTimeout(ee.current),document.addEventListener(Object(c.c)(),Qe,!1),window.addEventListener("blur",we,!1),(et=g.exerciseUserInfo)!==null&&et!==void 0&&et.screen_open&&Object(c.a)()&&(u({type:"globalSetting/headerFooterToggle",payload:!1}),Ae(!1)),(ze=g.exerciseUserInfo)!==null&&ze!==void 0&&ze.screen_at&&s()().diff(s()((Je=g.exerciseUserInfo)===null||Je===void 0?void 0:Je.screen_at),"seconds")>0)pe();else if((Xe=g.exerciseUserInfo)!==null&&Xe!==void 0&&Xe.screen_open&&!Object(c.a)()){var xt=document.domain==="kepukehuan.educoder.net"?30:g.exerciseUserInfo.screen_sec+10+1;X.current=V.a.info({icon:null,content:m.a.createElement("div",{className:"tc font16"},"\u672C\u573A\u8003\u8BD5\u5DF2\u5F00\u542F\u9632\u5207\u5C4F\u9650\u5236\uFF0C",m.a.createElement("br",null),"\u5207\u6362\u9875\u9762 ",g.exerciseUserInfo.screen_num-g.exerciseUserInfo.used_screen_num," \u6B21\u540E\u5C06\u8FDB\u884C\u5F3A\u5236\u4EA4\u5377\uFF0C",m.a.createElement("br",null),"\u8BF7\u52FF\u5207\u5C4F\u53CA\u5237\u65B0\u9875\u9762"),okText:m.a.createElement("span",null,"\u5F00\u59CB\u8003\u8BD5\uFF08",m.a.createElement("span",{style:{display:"inline-block"}},m.a.createElement(l,{onFinish:function(){var ht;pe(),(ht=X.current)===null||ht===void 0||ht.destroy()},valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+xt*1e3})),"S\uFF09"),onOk:function(){var ht;(ht=X.current)===null||ht===void 0||ht.destroy(),Ae(!1),Object(c.d)(document.body),document.getElementById("root").addEventListener("click",de,!1)}})}return(yt=g.exerciseUserInfo)!==null&&yt!==void 0&&yt.screen_open&&!Object(c.a)()||document.getElementById("root").addEventListener("click",de,!1),function(){document.getElementById("root").removeEventListener("click",de,!1),document.removeEventListener(Object(c.c)(),Qe,!1),window.removeEventListener("blur",we,!1),clearTimeout(ee.current)}},[]),Object(v.useEffect)(function(){setTimeout(function(){g.actionTabs.removeEventListenerExitScreen&&(clearTimeout(ee.current),document.getElementById("root").removeEventListener("click",de,!1),document.removeEventListener(Object(c.c)(),Qe,!1))},500),ne()},[g.actionTabs]),Object(v.useEffect)(function(){setTimeout(function(){g.exerciseUserInfo.used_screen_num>g.exerciseUserInfo.screen_num?De():!Ce},500)},[g.exerciseUserInfo]);var pe=function(){var et=Object(z.a)(T.a.mark(function ze(){var Je;return T.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Ge();case 2:Je=yt.sent,setTimeout(function(){var xt,vt;(xt=X.current)===null||xt===void 0||xt.destroy(),X.current=V.a.info({okText:m.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:m.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",m.a.createElement("span",{className:"c-red"},Je.used_screen_num),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",m.a.createElement("span",{className:"c-red"},(vt=g.exerciseUserInfo)===null||vt===void 0?void 0:vt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377"),onOk:function(){var ht=Object(z.a)(T.a.mark(function At(){return T.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:Object(c.d)(document.body);case 1:case"end":return Oe.stop()}},At)}));function Rt(){return ht.apply(this,arguments)}return Rt}()})},1e3);case 4:case"end":return yt.stop()}},ze)}));return function(){return et.apply(this,arguments)}}(),de=function(ze){!Object(c.a)()&&ze.target.nodeName!=="A"&&ze.target.nodeName!=="BUTTON"&&ze.target.innerHTML!=="\u786E \u5B9A"&&(Object(c.d)(document.body),console.log("documentClick.full"))},ne=function(){var et=Object(z.a)(T.a.mark(function ze(){return T.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.abrupt("return",new Promise(function(){var yt=Object(z.a)(T.a.mark(function xt(vt){var ht;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,u({type:"exercise/getExerciseUserInfo",payload:Object(q.a)({},Ie)});case 2:return ht=At.sent,vt(ht==null?void 0:ht.data),At.abrupt("return",ht==null?void 0:ht.data);case 5:case"end":return At.stop()}},xt)}));return function(xt){return yt.apply(this,arguments)}}()));case 1:case"end":return Xe.stop()}},ze)}));return function(){return et.apply(this,arguments)}}(),ge=function(){var et=Object(z.a)(T.a.mark(function ze(Je){var Xe,yt,xt;return T.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:(Xe=X.current)===null||Xe===void 0||((yt=Xe.destroyAll)===null||yt===void 0)||yt.call(Xe),X.current=V.a.info({maskClosable:!1,keyboard:!1,okText:m.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5\uFF08",m.a.createElement("span",{style:{display:"inline-block"}},m.a.createElement(l,{onFinish:Ge,valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+(g.exerciseUserInfo.screen_sec+1)*1e3})),"S\uFF09"),content:m.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",m.a.createElement("span",{className:"c-red"},Je),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",m.a.createElement("span",{className:"c-red"},(xt=g.exerciseUserInfo)===null||xt===void 0?void 0:xt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377,",m.a.createElement("span",{className:"c-red"},g.exerciseUserInfo.screen_sec),"\u79D2\u5185\u56DE\u5230",m.a.createElement("br",null),m.a.createElement("span",{style:{marginLeft:38}},"\u8003\u8BD5\u4E0D\u8BA1\u5207\u5C4F\u6B21\u6570\u3002")),onOk:function(){var Rt=Object(z.a)(T.a.mark(function ke(){return T.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:clearTimeout(se.current),Object(c.d)(document.body),X.current.destroy();case 3:case"end":return tt.stop()}},ke)}));function At(){return Rt.apply(this,arguments)}return At}()}),se.current=setTimeout(function(){var Rt;X.current.update({okText:m.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:m.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",m.a.createElement("span",{className:"c-red"},Je+1),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",m.a.createElement("span",{className:"c-red"},(Rt=g.exerciseUserInfo)===null||Rt===void 0?void 0:Rt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377")})},(g.exerciseUserInfo.screen_sec+1)*1e3);case 3:case"end":return ht.stop()}},ze)}));return function(Je){return et.apply(this,arguments)}}(),oe=function(){location.href="/classrooms/".concat(Ie.coursesId,"/exercise/").concat(Ie.categoryId,"/detail")},De=function(){var et=Object(z.a)(T.a.mark(function ze(){var Je,Xe,yt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return(Je=X.current)===null||Je===void 0||((Xe=Je.destroyAll)===null||Xe===void 0)||Xe.call(Je),vt.next=3,Object(d.Z)({categoryId:Ie.categoryId,commit_method:1});case 3:if(yt=vt.sent,yt){try{f.send(JSON.stringify({type:"toggleLockExit",data:!1})),f.send(JSON.stringify({type:"network-open",data:""}))}catch(ht){}Ue()}case 5:case"end":return vt.stop()}},ze)}));return function(){return et.apply(this,arguments)}}(),Ue=function(){var ze,Je;document.removeEventListener(Object(c.c)(),Qe,!1),Object(c.b)(),(ze=X.current)===null||ze===void 0||((Je=ze.destroyAll)===null||Je===void 0)||Je.call(ze);try{f.send(JSON.stringify({type:"toggleLockExit",data:!1})),f.send(JSON.stringify({type:"network-open",data:""}))}catch(Xe){}j.info({content:m.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",m.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){oe()}})},we=function(ze){Object(c.a)()&&document.getElementById("iframeShixuns").style.display=="none"&&Object(c.b)()},Ge=function(){var et=Object(z.a)(T.a.mark(function ze(){return T.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.abrupt("return",new Promise(function(){var yt=Object(z.a)(T.a.mark(function xt(vt){var ht,Rt,At;return T.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(!((ht=g.exerciseUserInfo)!==null&&ht!==void 0&&ht.screen_at)){Oe.next=3;break}return Oe.next=3,Object(d.h)(Object(q.a)(Object(q.a)({},Ie),{},{reset:!0}));case 3:return Oe.next=5,Object(d.R)({id:Ie.categoryId});case 5:if(Rt=Oe.sent,!(Rt!=null&&Rt.is_commit)){Oe.next=9;break}return Ue(),Oe.abrupt("return");case 9:return Oe.next=11,ne();case 11:At=Oe.sent,vt(At);case 13:case"end":return Oe.stop()}},xt)}));return function(xt){return yt.apply(this,arguments)}}()));case 1:case"end":return Xe.stop()}},ze)}));return function(){return et.apply(this,arguments)}}(),Qe=function(){var et=Object(z.a)(T.a.mark(function ze(){var Je,Xe,yt,xt;return T.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(Je=!1,console.log("fullscreen change"),!Object(c.a)()){ht.next=7;break}(Xe=g.exerciseUserInfo)!==null&&Xe!==void 0&&Xe.screen_at&&Object(d.h)(Object(q.a)(Object(q.a)({},Ie),{},{reset:!0})),clearTimeout(ee.current),ht.next=17;break;case 7:return Je=!0,ht.next=10,Object(d.h)(Object(q.a)({},Ie));case 10:return ht.next=12,ne();case 12:yt=ht.sent,ge(yt.used_screen_num),xt=setTimeout(Object(z.a)(T.a.mark(function Rt(){return T.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:case"end":return ke.stop()}},Rt)})),g.exerciseUserInfo.screen_sec*1e3),window.frames.length!=parent.frames.length&&window.parent.postMessage("backExercise","*"),ee.current=xt;case 17:u({type:"globalSetting/headerFooterToggle",payload:Je});case 18:case"end":return ht.stop()}},ze)}));return function(){return et.apply(this,arguments)}}();return m.a.createElement("div",null,A)};Me.a=Object(a.a)(function(w){var x=w.loading,O=w.user,S=w.exercise,_=w.globalSetting;return{globalSetting:_,user:O,exercise:S,loading:x.effects}})(I)},bT9E:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return z});var q=K("VTBJ");function z(N,V){var W=Object(q.a)({},N);return Array.isArray(V)&&V.forEach(function(D){delete W[D]}),W}},biw7:function(Ke,Me,K){"use strict";var q=K("q1tI"),z=K.n(q),N=q.createContext(null);Me.a=N},c5Ni:function(Ke,Me,K){},cRFk:function(Ke,Me,K){Ke.exports=K.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Ke,Me,K){Ke.exports=K.p+"static/choose.4ad1045f.svg"},dQei:function(Ke,Me){for(var K={glog:function(z){if(z<1)throw new Error("glog("+z+")");return K.LOG_TABLE[z]},gexp:function(z){for(;z<0;)z+=255;for(;z>=256;)z-=255;return K.EXP_TABLE[z]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},q=0;q<8;q++)K.EXP_TABLE[q]=1<<q;for(var q=8;q<256;q++)K.EXP_TABLE[q]=K.EXP_TABLE[q-4]^K.EXP_TABLE[q-5]^K.EXP_TABLE[q-6]^K.EXP_TABLE[q-8];for(var q=0;q<255;q++)K.LOG_TABLE[K.EXP_TABLE[q]]=q;Ke.exports=K},dWSS:function(Ke,Me,K){var q=K("dQei");function z(N,V){if(N.length==null)throw new Error(N.length+"/"+V);for(var W=0;W<N.length&&N[W]==0;)W++;this.num=new Array(N.length-W+V);for(var D=0;D<N.length-W;D++)this.num[D]=N[D+W]}z.prototype={get:function(N){return this.num[N]},getLength:function(){return this.num.length},multiply:function(N){for(var V=new Array(this.getLength()+N.getLength()-1),W=0;W<this.getLength();W++)for(var D=0;D<N.getLength();D++)V[W+D]^=q.gexp(q.glog(this.get(W))+q.glog(N.get(D)));return new z(V,0)},mod:function(N){if(this.getLength()-N.getLength()<0)return this;for(var V=q.glog(this.get(0))-q.glog(N.get(0)),W=new Array(this.getLength()),D=0;D<this.getLength();D++)W[D]=this.get(D);for(var D=0;D<N.getLength();D++)W[D]^=q.gexp(q.glog(N.get(D))+V);return new z(W,0).mod(N)}},Ke.exports=z},dejd:function(Ke,Me,K){},djh8:function(Ke,Me,K){Ke.exports=K.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Ke,Me,K){"use strict";var q=K("Ff2n"),z=K("rePB"),N=K("1OyB"),V=K("vuIU"),W=K("Ji7U"),D=K("md7G"),H=K("foSv"),F=K("q1tI"),k=K.n(F),T=K("TSYQ"),v=K.n(T),m=K("4IlW");function c(f,u){var E=Object.keys(f);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(f);u&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(f,y).enumerable})),E.push.apply(E,b)}return E}function d(f){for(var u=1;u<arguments.length;u++){var E=arguments[u]!=null?arguments[u]:{};u%2?c(Object(E),!0).forEach(function(b){Object(z.a)(f,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(b){Object.defineProperty(f,b,Object.getOwnPropertyDescriptor(E,b))})}return f}function r(f){var u=s();return function(){var b=Object(H.a)(f),y;if(u){var P=Object(H.a)(this).constructor;y=Reflect.construct(b,arguments,P)}else y=b.apply(this,arguments);return Object(D.a)(this,y)}}function s(){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(f){return!1}}function o(){}function a(f){f.preventDefault()}var l=function(u){return u.replace(/[^\w.-]+/g,"")},h=200,I=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(u){return u!=null},O=function(u,E){return E===u||typeof E=="number"&&typeof u=="number"&&isNaN(E)&&isNaN(u)},S=function(f){Object(W.a)(E,f);var u=r(E);function E(b){var y;Object(N.a)(this,E),y=u.call(this,b),y.onKeyDown=function(U){var L=y.props,j=L.onKeyDown,A=L.onPressEnter;if(U.keyCode===m.a.UP){var X=y.getRatio(U);y.up(U,X,null),y.stop()}else if(U.keyCode===m.a.DOWN){var ee=y.getRatio(U);y.down(U,ee,null),y.stop()}else U.keyCode===m.a.ENTER&&A&&A(U);if(y.recordCursorPosition(),y.lastKeyCode=U.keyCode,j){for(var se=arguments.length,ce=new Array(se>1?se-1:0),Le=1;Le<se;Le++)ce[Le-1]=arguments[Le];j.apply(void 0,[U].concat(ce))}},y.onKeyUp=function(U){var L=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),L){for(var j=arguments.length,A=new Array(j>1?j-1:0),X=1;X<j;X++)A[X-1]=arguments[X];L.apply(void 0,[U].concat(A))}},y.onChange=function(U){var L=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(U)),y.setState({inputValue:y.rawInput}),L(y.toNumber(y.rawInput))},y.onMouseUp=function(){var U=y.props.onMouseUp;y.recordCursorPosition(),U&&U.apply(void 0,arguments)},y.onFocus=function(){var U;y.setState({focused:!0}),(U=y.props).onFocus.apply(U,arguments)},y.onBlur=function(){var U=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var L=y.getCurrentValidValue(y.state.inputValue),j=y.setValue(L,o);if(U){var A=y.input.value,X=y.getInputDisplayValue({focus:!1,value:j});y.input.value=X&&Number(X),U.apply(void 0,arguments),y.input.value=A}},y.getRatio=function(U){var L=1;return U.metaKey||U.ctrlKey?L=.1:U.shiftKey&&(L=10),L},y.getFullNum=function(U){return isNaN(U)?U:/e/i.test(String(U))?Number(U).toFixed(18).replace(/\.?0+$/,""):U},y.getPrecision=function(U){if(x(y.props.precision))return y.props.precision;var L=String(U);if(L.indexOf("e-")>=0)return parseInt(L.slice(L.indexOf("e-")+2),10);var j=0;return L.indexOf(".")>=0&&(j=L.length-L.indexOf(".")-1),j},y.getInputDisplayValue=function(U){var L=U||y.state,j=L.focused,A=L.inputValue,X=L.value,ee;j?ee=A:ee=y.toPrecisionAsStep(X),ee==null&&(ee="");var se=y.formatWrapper(ee);return x(y.props.decimalSeparator)&&(se=se.toString().replace(".",y.props.decimalSeparator)),se},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(U){}},y.restoreByAfter=function(U){if(U===void 0)return!1;var L=y.input.value,j=L.lastIndexOf(U);if(j===-1)return!1;var A=y.cursorBefore.length;return y.lastKeyCode===m.a.DELETE&&y.cursorBefore.charAt(A-1)===U[0]?(y.fixCaret(A,A),!0):j+U.length===L.length?(y.fixCaret(j,j),!0):!1},y.partRestoreByAfter=function(U){return U===void 0?!1:Array.prototype.some.call(U,function(L,j){var A=U.substring(j);return y.restoreByAfter(A)})},y.isNotCompleteNumber=function(U){return isNaN(U)||U===""||U===null||U&&U.toString().indexOf(".")===U.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(U,L,j){y.pressingUpOrDown=!0,y.step("down",U,L,j)},y.up=function(U,L,j){y.pressingUpOrDown=!0,y.step("up",U,L,j)},y.saveInput=function(U){y.input=U};var P=b.value;P===void 0&&(P=b.defaultValue),y.state={focused:b.autoFocus};var R=y.getValidValue(y.toNumber(P));return y.state=d(d({},y.state),{},{inputValue:y.toPrecisionAsStep(R),value:R}),y}return Object(V.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var P=this.props,R=P.value,U=P.onChange,L=P.max,j=P.min,A=this.state.focused;if(y){if(!O(y.value,R)||!O(y.max,L)||!O(y.min,j)){var X=A?R:this.getValidValue(R),ee;this.pressingUpOrDown?ee=X:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(X),this.setState({value:X,inputValue:ee})}var se="value"in this.props?R:this.state.value;"max"in this.props&&y.max!==L&&typeof se=="number"&&se>L&&U&&U(L),"min"in this.props&&y.min!==j&&typeof se=="number"&&se<j&&U&&U(j)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ce=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?ce=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(ce=this.cursorStart):ce=this.input.value.length,this.fixCaret(ce,ce)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Le){}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(y){var P=y;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(y){var P=y.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,U=parseFloat(y);return isNaN(U)?y:(U<P&&(U=P),U>R&&(U=R),U)}},{key:"setValue",value:function(y,P){var R=this.props.precision,U=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),L=this.state.value,j=L===void 0?null:L,A=this.state.inputValue,X=A===void 0?null:A,ee=typeof U=="number"?U.toFixed(R):"".concat(U),se=U!==j||ee!=="".concat(X);return"value"in this.props?(X=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:X},P)):this.setState({value:U,inputValue:this.toPrecisionAsStep(y)},P),se&&this.props.onChange(U),U}},{key:"getMaxPrecision",value:function(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,R=this.props,U=R.precision,L=R.step;if(x(U))return U;var j=this.getPrecision(P),A=this.getPrecision(L),X=this.getPrecision(y);return y?Math.max(X,j+A):j+A}},{key:"getPrecisionFactor",value:function(y){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,R=this.getMaxPrecision(y,P);return Math.pow(10,R)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var P=Math.abs(this.getMaxPrecision(y));return isNaN(P)?y.toString():Number(y).toFixed(P)}},{key:"toNumber",value:function(y){var P=this.props.precision,R=this.state.focused,U=y&&y.length>16&&R;return this.isNotCompleteNumber(y)||U?y:x(P)?Math.round(y*Math.pow(10,P))/Math.pow(10,P):Number(y)}},{key:"upStep",value:function(y,P){var R=this.props.step,U=this.getPrecisionFactor(y,P),L=Math.abs(this.getMaxPrecision(y,P)),j=((U*y+U*R*P)/U).toFixed(L);return this.toNumber(j)}},{key:"downStep",value:function(y,P){var R=this.props.step,U=this.getPrecisionFactor(y,P),L=Math.abs(this.getMaxPrecision(y,P)),j=((U*y-U*R*P)/U).toFixed(L);return this.toNumber(j)}},{key:"step",value:function(y,P){var R=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var j=this.props;if(j.disabled)return;var A=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(A))return;var X=this["".concat(y,"Step")](A,U),ee=X>j.max||X<j.min;if(X>j.max?X=j.max:X<j.min&&(X=j.min),this.setValue(X,null),this.setState({focused:!0},function(){R.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){R[y](P,U,!0)},L?h:I)}},{key:"fixCaret",value:function(y,P){if(y===void 0||P===void 0||!this.input||!this.input.value)return;try{var R=this.input.selectionStart,U=this.input.selectionEnd;(y!==R||P!==U)&&this.input.setSelectionRange(y,P)}catch(L){}}},{key:"render",value:function(){var y,P=this.props,R=P.prefixCls,U=P.disabled,L=P.readOnly,j=P.useTouch,A=P.autoComplete,X=P.upHandler,ee=P.downHandler,se=P.className,ce=P.max,Le=P.min,Ce=P.style,Ae=P.title,Pe=P.onMouseEnter,Ie=P.onMouseLeave,pe=P.onMouseOver,de=P.onMouseOut,ne=P.required,ge=P.onClick,oe=P.tabIndex,De=P.type,Ue=P.placeholder,we=P.id,Ge=P.inputMode,Qe=P.pattern,et=P.step,ze=P.maxLength,Je=P.autoFocus,Xe=P.name,yt=P.onPaste,xt=P.onInput,vt=Object(q.a)(P,["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"]),ht=this.state,Rt=ht.value,At=ht.focused,ke=v()(R,(y={},Object(z.a)(y,se,!!se),Object(z.a)(y,"".concat(R,"-disabled"),U),Object(z.a)(y,"".concat(R,"-focused"),At),y)),Oe={};Object.keys(vt).forEach(function(ve){(ve.substr(0,5)==="data-"||ve.substr(0,5)==="aria-"||ve==="role")&&(Oe[ve]=vt[ve])});var tt=!L&&!U,it=this.getInputDisplayValue(null),Ne=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)>=ce),qe=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)<=Le),Te=Ne||U||L,fe=qe||U||L,me=v()("".concat(R,"-handler"),"".concat(R,"-handler-up"),Object(z.a)({},"".concat(R,"-handler-up-disabled"),Te)),re=v()("".concat(R,"-handler"),"".concat(R,"-handler-down"),Object(z.a)({},"".concat(R,"-handler-down-disabled"),fe)),ae=j?{onTouchStart:Te?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Te?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=j?{onTouchStart:fe?o:this.down,onTouchEnd:this.stop}:{onMouseDown:fe?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:ke,style:Ce,title:Ae,onMouseEnter:Pe,onMouseLeave:Ie,onMouseOver:pe,onMouseOut:de,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(R,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":Te,className:me}),X||k.a.createElement("span",{unselectable:"on",className:"".concat(R,"-handler-up-inner"),onClick:a})),k.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":fe,className:re}),ee||k.a.createElement("span",{unselectable:"on",className:"".concat(R,"-handler-down-inner"),onClick:a}))),k.a.createElement("div",{className:"".concat(R,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Le,"aria-valuemax":ce,"aria-valuenow":Rt,required:ne,type:De,placeholder:Ue,onPaste:yt,onClick:ge,onMouseUp:this.onMouseUp,className:"".concat(R,"-input"),tabIndex:oe,autoComplete:A,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:o,onKeyUp:tt?this.onKeyUp:o,autoFocus:Je,maxLength:ze,readOnly:L,disabled:U,max:ce,min:Le,step:et,name:Xe,title:Ae,id:we,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(it),pattern:Qe,inputMode:Ge,onInput:xt},Oe))))}}]),E}(k.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:l,required:!1,autoComplete:"off"};var _=S,g=Me.a=_},f4xo:function(Ke,Me,K){var q=K("nVVt");function z(N){this.mode=q.MODE_8BIT_BYTE,this.data=N}z.prototype={getLength:function(N){return this.data.length},write:function(N){for(var V=0;V<this.data.length;V++)N.put(this.data.charCodeAt(V),8)}},Ke.exports=z},fyJ8:function(Ke,Me,K){"use strict";var q=K("rePB"),z=K("VTBJ"),N=K("Ff2n"),V=K("U8pU"),W=K("q1tI"),D=K.n(W),H=K("TSYQ"),F=K.n(H),k=K("c+Xe"),T=K("sR1s");function v(s){return s&&Object(V.a)(s)==="object"&&!Array.isArray(s)&&!W.isValidElement(s)}function m(s){return typeof s=="string"?!0:Object(k.c)(s)}function c(s,o){var a,l=s.prefixCls,h=s.className,I=s.record,w=s.index,x=s.dataIndex,O=s.render,S=s.children,_=s.component,g=_===void 0?"td":_,f=s.colSpan,u=s.rowSpan,E=s.fixLeft,b=s.fixRight,y=s.firstFixLeft,P=s.lastFixLeft,R=s.firstFixRight,U=s.lastFixRight,L=s.appendNode,j=s.additionalProps,A=j===void 0?{}:j,X=s.ellipsis,ee=s.align,se=s.rowType,ce=s.isSticky,Le="".concat(l,"-cell"),Ce,Ae;if(S)Ae=S;else{var Pe=Object(T.b)(I,x);if(Ae=Pe,O){var Ie=O(Pe,I,w);v(Ie)?(Ae=Ie.children,Ce=Ie.props):Ae=Ie}}Object(V.a)(Ae)==="object"&&!Array.isArray(Ae)&&!W.isValidElement(Ae)&&(Ae=null),X&&(P||R)&&(Ae=W.createElement("span",{className:"".concat(Le,"-content")},Ae));var pe=Ce||{},de=pe.colSpan,ne=pe.rowSpan,ge=pe.style,oe=pe.className,De=Object(N.a)(pe,["colSpan","rowSpan","style","className"]),Ue=de!==void 0?de:f,we=ne!==void 0?ne:u;if(Ue===0||we===0)return null;var Ge={},Qe=typeof E=="number",et=typeof b=="number";Qe&&(Ge.position="sticky",Ge.left=E),et&&(Ge.position="sticky",Ge.right=b);var ze={};ee&&(ze.textAlign=ee);var Je,Xe=X===!0?{showTitle:!0}:X;Xe&&(Xe.showTitle||se==="header")&&(typeof Ae=="string"||typeof Ae=="number"?Je=Ae.toString():W.isValidElement(Ae)&&typeof Ae.props.children=="string"&&(Je=Ae.props.children));var yt=Object(z.a)(Object(z.a)(Object(z.a)({title:Je},De),A),{},{colSpan:Ue&&Ue!==1?Ue:null,rowSpan:we&&we!==1?we:null,className:F()(Le,h,(a={},Object(q.a)(a,"".concat(Le,"-fix-left"),Qe),Object(q.a)(a,"".concat(Le,"-fix-left-first"),y),Object(q.a)(a,"".concat(Le,"-fix-left-last"),P),Object(q.a)(a,"".concat(Le,"-fix-right"),et),Object(q.a)(a,"".concat(Le,"-fix-right-first"),R),Object(q.a)(a,"".concat(Le,"-fix-right-last"),U),Object(q.a)(a,"".concat(Le,"-ellipsis"),X),Object(q.a)(a,"".concat(Le,"-with-append"),L),Object(q.a)(a,"".concat(Le,"-fix-sticky"),(Qe||et)&&ce),a),A.className,oe),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},A.style),ze),Ge),ge),ref:m(g)?o:null});return W.createElement(g,Object.assign({},yt),L,Ae)}var d=W.forwardRef(c);d.displayName="Cell";var r=W.memo(d,function(s,o){return o.shouldCellUpdate?!o.shouldCellUpdate(o.record,s.record):!1});Me.a=r},h78n:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return y});var q=K("q1tI"),z=K.n(q),N=K("TSYQ"),V=K.n(N),W={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},D=function(U){var L=U.map(function(){return Object(q.useRef)()}),j=Object(q.useRef)();return Object(q.useEffect)(function(){var A=Date.now(),X=!1;Object.keys(L).forEach(function(ee){var se=L[ee].current;if(!se)return;X=!0;var ce=se.style;ce.transitionDuration=".3s, .3s, .3s, .06s",j.current&&A-j.current<100&&(ce.transitionDuration="0s, 0s")}),X&&(j.current=Date.now())}),[L]};function H(){return H=Object.assign||function(R){for(var U=1;U<arguments.length;U++){var L=arguments[U];for(var j in L)Object.prototype.hasOwnProperty.call(L,j)&&(R[j]=L[j])}return R},H.apply(this,arguments)}function F(R,U){return c(R)||m(R,U)||T(R,U)||k()}function k(){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(R,U){if(!R)return;if(typeof R=="string")return v(R,U);var L=Object.prototype.toString.call(R).slice(8,-1);if(L==="Object"&&R.constructor&&(L=R.constructor.name),L==="Map"||L==="Set")return Array.from(R);if(L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L))return v(R,U)}function v(R,U){(U==null||U>R.length)&&(U=R.length);for(var L=0,j=new Array(U);L<U;L++)j[L]=R[L];return j}function m(R,U){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(R)))return;var L=[],j=!0,A=!1,X=void 0;try{for(var ee=R[Symbol.iterator](),se;!(j=(se=ee.next()).done)&&!(L.push(se.value),U&&L.length===U);j=!0);}catch(ce){A=!0,X=ce}finally{try{!j&&ee.return!=null&&ee.return()}finally{if(A)throw X}}return L}function c(R){if(Array.isArray(R))return R}function d(R,U){if(R==null)return{};var L=r(R,U),j,A;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(R);for(A=0;A<X.length;A++){if(j=X[A],U.indexOf(j)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(R,j))continue;L[j]=R[j]}}return L}function r(R,U){if(R==null)return{};var L={},j=Object.keys(R),A,X;for(X=0;X<j.length;X++){if(A=j[X],U.indexOf(A)>=0)continue;L[A]=R[A]}return L}var s=function(U){var L=U.className,j=U.percent,A=U.prefixCls,X=U.strokeColor,ee=U.strokeLinecap,se=U.strokeWidth,ce=U.style,Le=U.trailColor,Ce=U.trailWidth,Ae=U.transition,Pe=d(U,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Pe.gapPosition;var Ie=Array.isArray(j)?j:[j],pe=Array.isArray(X)?X:[X],de=D(Ie),ne=F(de,1),ge=ne[0],oe=se/2,De=100-se/2,Ue="M ".concat(ee==="round"?oe:0,",").concat(oe,`
L `).concat(ee==="round"?De:100,",").concat(oe),we="0 0 100 ".concat(se),Ge=0;return z.a.createElement("svg",H({className:V()("".concat(A,"-line"),L),viewBox:we,preserveAspectRatio:"none",style:ce},Pe),z.a.createElement("path",{className:"".concat(A,"-line-trail"),d:Ue,strokeLinecap:ee,stroke:Le,strokeWidth:Ce||se,fillOpacity:"0"}),Ie.map(function(Qe,et){var ze={strokeDasharray:"".concat(Qe,"px, 100px"),strokeDashoffset:"-".concat(Ge,"px"),transition:Ae||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Je=pe[et]||pe[pe.length-1];return Ge+=Qe,z.a.createElement("path",{key:et,className:"".concat(A,"-line-path"),d:Ue,strokeLinecap:ee,stroke:Je,strokeWidth:se,fillOpacity:"0",ref:ge[et],style:ze})}))};s.defaultProps=W;var o=s;function a(){return a=Object.assign||function(R){for(var U=1;U<arguments.length;U++){var L=arguments[U];for(var j in L)Object.prototype.hasOwnProperty.call(L,j)&&(R[j]=L[j])}return R},a.apply(this,arguments)}function l(R,U){return O(R)||x(R,U)||I(R,U)||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 I(R,U){if(!R)return;if(typeof R=="string")return w(R,U);var L=Object.prototype.toString.call(R).slice(8,-1);if(L==="Object"&&R.constructor&&(L=R.constructor.name),L==="Map"||L==="Set")return Array.from(R);if(L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L))return w(R,U)}function w(R,U){(U==null||U>R.length)&&(U=R.length);for(var L=0,j=new Array(U);L<U;L++)j[L]=R[L];return j}function x(R,U){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(R)))return;var L=[],j=!0,A=!1,X=void 0;try{for(var ee=R[Symbol.iterator](),se;!(j=(se=ee.next()).done)&&!(L.push(se.value),U&&L.length===U);j=!0);}catch(ce){A=!0,X=ce}finally{try{!j&&ee.return!=null&&ee.return()}finally{if(A)throw X}}return L}function O(R){if(Array.isArray(R))return R}function S(R,U){if(R==null)return{};var L=_(R,U),j,A;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(R);for(A=0;A<X.length;A++){if(j=X[A],U.indexOf(j)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(R,j))continue;L[j]=R[j]}}return L}function _(R,U){if(R==null)return{};var L={},j=Object.keys(R),A,X;for(X=0;X<j.length;X++){if(A=j[X],U.indexOf(A)>=0)continue;L[A]=R[A]}return L}var g=0;function f(R){return+R.replace("%","")}function u(R){return Array.isArray(R)?R:[R]}function E(R,U,L,j){var A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,X=arguments.length>5?arguments[5]:void 0,ee=50-j/2,se=0,ce=-ee,Le=0,Ce=-2*ee;switch(X){case"left":se=-ee,ce=0,Le=2*ee,Ce=0;break;case"right":se=ee,ce=0,Le=-2*ee,Ce=0;break;case"bottom":ce=ee,Ce=2*ee;break;default:}var Ae="M 50,50 m ".concat(se,",").concat(ce,`
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(Le,",").concat(-Ce,`
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(-Le,",").concat(Ce),Pe=Math.PI*2*ee,Ie={stroke:L,strokeDasharray:"".concat(U/100*(Pe-A),"px ").concat(Pe,"px"),strokeDashoffset:"-".concat(A/2+R/100*(Pe-A),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ae,pathStyle:Ie}}var b=function(U){var L=U.prefixCls,j=U.strokeWidth,A=U.trailWidth,X=U.gapDegree,ee=U.gapPosition,se=U.trailColor,ce=U.strokeLinecap,Le=U.style,Ce=U.className,Ae=U.strokeColor,Pe=U.percent,Ie=S(U,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),pe=Object(q.useMemo)(function(){return g+=1,g},[]),de=E(0,100,se,j,X,ee),ne=de.pathString,ge=de.pathStyle,oe=u(Pe),De=u(Ae),Ue=De.find(function(ze){return Object.prototype.toString.call(ze)==="[object Object]"}),we=D(oe),Ge=l(we,1),Qe=Ge[0],et=function(){var Je=0;return oe.map(function(Xe,yt){var xt=De[yt]||De[De.length-1],vt=Object.prototype.toString.call(xt)==="[object Object]"?"url(#".concat(L,"-gradient-").concat(pe,")"):"",ht=E(Je,Xe,xt,j,X,ee);return Je+=Xe,z.a.createElement("path",{key:yt,className:"".concat(L,"-circle-path"),d:ht.pathString,stroke:vt,strokeLinecap:ce,strokeWidth:j,opacity:Xe===0?0:1,fillOpacity:"0",style:ht.pathStyle,ref:Qe[yt]})})};return z.a.createElement("svg",a({className:V()("".concat(L,"-circle"),Ce),viewBox:"0 0 100 100",style:Le},Ie),Ue&&z.a.createElement("defs",null,z.a.createElement("linearGradient",{id:"".concat(L,"-gradient-").concat(pe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ue).sort(function(ze,Je){return f(ze)-f(Je)}).map(function(ze,Je){return z.a.createElement("stop",{key:Je,offset:ze,stopColor:Ue[ze]})}))),z.a.createElement("path",{className:"".concat(L,"-circle-trail"),d:ne,stroke:se,strokeLinecap:ce,strokeWidth:A||j,fillOpacity:"0",style:ge}),et().reverse())};b.defaultProps=W;var y=b,P={Line:o,Circle:y}},hW8S:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return V}),K.d(Me,"c",function(){return W}),K.d(Me,"b",function(){return D});var q=K("VTBJ"),z=K("Ff2n"),N=K("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function W(H){var F=H.expandable,k=Object(z.a)(H,["expandable"]);return"expandable"in H?Object(q.a)(Object(q.a)({},k),F):k}function D(H){return Object.keys(H).reduce(function(F,k){return(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-")&&(F[k]=H[k]),F},{})}},ji0R:function(Ke,Me,K){Ke.exports=K.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Ke,Me,K){Ke.exports=K.p+"static/question.cb52bef9.gif"},kPYp:function(Ke,Me){Ke.exports="data:image/png;base64,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"},kSUc:function(Ke,Me,K){},l2Kq:function(Ke,Me,K){Ke.exports=K.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Ke,Me,K){(function(q){q(K("VrN/"),K("1eCo"),K("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(z,N){var V=q.getMode(z,"text/html"),W=V.name=="null";function D(j){if(q.findModeByName){var A=q.findModeByName(j);A&&(j=A.mime||A.mimes[0])}var X=q.getMode(z,j);return X.name=="null"?null:X}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var H={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 F in H)H.hasOwnProperty(F)&&N.tokenTypeOverrides[F]&&(H[F]=N.tokenTypeOverrides[F]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,c=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,a=" ";function l(j,A,X){return A.f=A.inline=X,X(j,A)}function h(j,A,X){return A.f=A.block=X,X(j,A)}function I(j){return!j||!/\S/.test(j.string)}function w(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==O){var A=W;if(!A){var X=q.innerMode(V,j.htmlState);A=X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText}A&&(j.f=f,j.block=x,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function x(j,A){var X=j.column()===A.indentation,ee=I(A.prevLine.stream),se=A.indentedCode,ce=A.prevLine.hr,Le=A.list!==!1,Ce=(A.listStack[A.listStack.length-1]||0)+3;A.indentedCode=!1;var Ae=A.indentation;if(A.indentationDiff===null&&(A.indentationDiff=A.indentation,Le)){for(A.list=null;Ae<A.listStack[A.listStack.length-1];)A.listStack.pop(),A.listStack.length?A.indentation=A.listStack[A.listStack.length-1]:A.list=!1;A.list!==!1&&(A.indentationDiff=Ae-A.listStack[A.listStack.length-1])}var Pe=!ee&&!ce&&!A.prevLine.header&&(!Le||!se)&&!A.prevLine.fencedCodeEnd,Ie=(A.list===!1||ce||ee)&&A.indentation<=Ce&&j.match(k),pe=null;if(A.indentationDiff>=4&&(se||A.prevLine.fencedCodeEnd||A.prevLine.header||ee))return j.skipToEnd(),A.indentedCode=!0,H.code;if(j.eatSpace())return null;if(X&&A.indentation<=Ce&&(pe=j.match(m))&&pe[1].length<=6)return A.quote=0,A.header=pe[1].length,A.thisLine.header=!0,N.highlightFormatting&&(A.formatting="header"),A.f=A.inline,_(A);if(A.indentation<=Ce&&j.eat(">"))return A.quote=X?1:A.quote+1,N.highlightFormatting&&(A.formatting="quote"),j.eatSpace(),_(A);if(!Ie&&!A.setext&&X&&A.indentation<=Ce&&(pe=j.match(T))){var de=pe[1]?"ol":"ul";return A.indentation=Ae+j.current().length,A.list=!0,A.quote=0,A.listStack.push(A.indentation),A.em=!1,A.strong=!1,A.code=!1,A.strikethrough=!1,N.taskLists&&j.match(v,!1)&&(A.taskList=!0),A.f=A.inline,N.highlightFormatting&&(A.formatting=["list","list-"+de]),_(A)}else{if(X&&A.indentation<=Ce&&(pe=j.match(r,!0)))return A.quote=0,A.fencedEndRE=new RegExp(pe[1]+"+ *$"),A.localMode=N.fencedCodeBlockHighlighting&&D(pe[2]||N.fencedCodeBlockDefaultMode),A.localMode&&(A.localState=q.startState(A.localMode)),A.f=A.block=S,N.highlightFormatting&&(A.formatting="code-block"),A.code=-1,_(A);if(A.setext||(!Pe||!Le)&&!A.quote&&A.list===!1&&!A.code&&!Ie&&!s.test(j.string)&&(pe=j.lookAhead(1))&&(pe=pe.match(c)))return A.setext?(A.header=A.setext,A.setext=0,j.skipToEnd(),N.highlightFormatting&&(A.formatting="header")):(A.header=pe[0].charAt(0)=="="?1:2,A.setext=A.header),A.thisLine.header=!0,A.f=A.inline,_(A);if(Ie)return j.skipToEnd(),A.hr=!0,A.thisLine.hr=!0,H.hr;if(j.peek()==="[")return l(j,A,P)}return l(j,A,A.inline)}function O(j,A){var X=V.token(j,A.htmlState);if(!W){var ee=q.innerMode(V,A.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||A.md_inside&&j.current().indexOf(">")>-1)&&(A.f=f,A.block=x,A.htmlState=null)}return X}function S(j,A){var X=A.listStack[A.listStack.length-1]||0,ee=A.indentation<X,se=X+3;if(A.fencedEndRE&&A.indentation<=se&&(ee||j.match(A.fencedEndRE))){N.highlightFormatting&&(A.formatting="code-block");var ce;return ee||(ce=_(A)),A.localMode=A.localState=null,A.block=x,A.f=f,A.fencedEndRE=null,A.code=0,A.thisLine.fencedCodeEnd=!0,ee?h(j,A,A.block):ce}else return A.localMode?A.localMode.token(j,A.localState):(j.skipToEnd(),H.code)}function _(j){var A=[];if(j.formatting){A.push(H.formatting),typeof j.formatting=="string"&&(j.formatting=[j.formatting]);for(var X=0;X<j.formatting.length;X++)A.push(H.formatting+"-"+j.formatting[X]),j.formatting[X]==="header"&&A.push(H.formatting+"-"+j.formatting[X]+"-"+j.header),j.formatting[X]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=j.quote?A.push(H.formatting+"-"+j.formatting[X]+"-"+j.quote):A.push("error"))}if(j.taskOpen)return A.push("meta"),A.length?A.join(" "):null;if(j.taskClosed)return A.push("property"),A.length?A.join(" "):null;if(j.linkHref?A.push(H.linkHref,"url"):(j.strong&&A.push(H.strong),j.em&&A.push(H.em),j.strikethrough&&A.push(H.strikethrough),j.emoji&&A.push(H.emoji),j.linkText&&A.push(H.linkText),j.code&&A.push(H.code),j.image&&A.push(H.image),j.imageAltText&&A.push(H.imageAltText,"link"),j.imageMarker&&A.push(H.imageMarker)),j.header&&A.push(H.header,H.header+"-"+j.header),j.quote&&(A.push(H.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=j.quote?A.push(H.quote+"-"+j.quote):A.push(H.quote+"-"+N.maxBlockquoteDepth)),j.list!==!1){var ee=(j.listStack.length-1)%3;ee?ee===1?A.push(H.list2):A.push(H.list3):A.push(H.list1)}return j.trailingSpaceNewLine?A.push("trailing-space-new-line"):j.trailingSpace&&A.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),A.length?A.join(" "):null}function g(j,A){return j.match(d,!0)?_(A):void 0}function f(j,A){var X=A.text(j,A);if(typeof X!="undefined")return X;if(A.list)return A.list=null,_(A);if(A.taskList){var ee=j.match(v,!0)[1]===" ";return ee?A.taskOpen=!0:A.taskClosed=!0,N.highlightFormatting&&(A.formatting="task"),A.taskList=!1,_(A)}if(A.taskOpen=!1,A.taskClosed=!1,A.header&&j.match(/^#+$/,!0))return N.highlightFormatting&&(A.formatting="header"),_(A);var se=j.next();if(A.linkTitle){A.linkTitle=!1;var ce=se;se==="("&&(ce=")"),ce=(ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Le="^\\s*(?:[^"+ce+"\\\\]+|\\\\\\\\|\\\\.)"+ce;if(j.match(new RegExp(Le),!0))return H.linkHref}if(se==="`"){var Ce=A.formatting;N.highlightFormatting&&(A.formatting="code"),j.eatWhile("`");var Ae=j.current().length;if(A.code==0&&(!A.quote||Ae==1))return A.code=Ae,_(A);if(Ae==A.code){var Pe=_(A);return A.code=0,Pe}else return A.formatting=Ce,_(A)}else if(A.code)return _(A);if(se==="\\"&&(j.next(),N.highlightFormatting)){var Ie=_(A),pe=H.formatting+"-escape";return Ie?Ie+" "+pe:pe}if(se==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return A.imageMarker=!0,A.image=!0,N.highlightFormatting&&(A.formatting="image"),_(A);if(se==="["&&A.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return A.imageMarker=!1,A.imageAltText=!0,N.highlightFormatting&&(A.formatting="image"),_(A);if(se==="]"&&A.imageAltText){N.highlightFormatting&&(A.formatting="image");var Ie=_(A);return A.imageAltText=!1,A.image=!1,A.inline=A.f=E,Ie}if(se==="["&&!A.image)return A.linkText&&j.match(/^.*?\]/)||(A.linkText=!0,N.highlightFormatting&&(A.formatting="link")),_(A);if(se==="]"&&A.linkText){N.highlightFormatting&&(A.formatting="link");var Ie=_(A);return A.linkText=!1,A.inline=A.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?E:f,Ie}if(se==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=u,N.highlightFormatting&&(A.formatting="link");var Ie=_(A);return Ie?Ie+=" ":Ie="",Ie+H.linkInline}if(se==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=u,N.highlightFormatting&&(A.formatting="link");var Ie=_(A);return Ie?Ie+=" ":Ie="",Ie+H.linkEmail}if(N.xml&&se==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var de=j.string.indexOf(">",j.pos);if(de!=-1){var ne=j.string.substring(j.start,de);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(A.md_inside=!0)}return j.backUp(1),A.htmlState=q.startState(V),h(j,A,O)}if(N.xml&&se==="<"&&j.match(/^\/\w*?>/))return A.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var ge=1,oe=j.pos==1?" ":j.string.charAt(j.pos-2);ge<3&&j.eat(se);)ge++;var De=j.peek()||" ",Ue=!/\s/.test(De)&&(!o.test(De)||/\s/.test(oe)||o.test(oe)),we=!/\s/.test(oe)&&(!o.test(oe)||/\s/.test(De)||o.test(De)),Ge=null,Qe=null;if(ge%2&&(!A.em&&Ue&&(se==="*"||!we||o.test(oe))?Ge=!0:A.em==se&&we&&(se==="*"||!Ue||o.test(De))&&(Ge=!1)),ge>1&&(!A.strong&&Ue&&(se==="*"||!we||o.test(oe))?Qe=!0:A.strong==se&&we&&(se==="*"||!Ue||o.test(De))&&(Qe=!1)),Qe!=null||Ge!=null){N.highlightFormatting&&(A.formatting=Ge==null?"strong":Qe==null?"em":"strong em"),Ge===!0&&(A.em=se),Qe===!0&&(A.strong=se);var Pe=_(A);return Ge===!1&&(A.em=!1),Qe===!1&&(A.strong=!1),Pe}}else if(se===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return _(A);j.backUp(1)}if(N.strikethrough){if(se==="~"&&j.eatWhile(se)){if(A.strikethrough){N.highlightFormatting&&(A.formatting="strikethrough");var Pe=_(A);return A.strikethrough=!1,Pe}else if(j.match(/^[^\s]/,!1))return A.strikethrough=!0,N.highlightFormatting&&(A.formatting="strikethrough"),_(A)}else if(se===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return _(A);j.backUp(2)}}if(N.emoji&&se===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){A.emoji=!0,N.highlightFormatting&&(A.formatting="emoji");var et=_(A);return A.emoji=!1,et}return se===" "&&(j.match(/^ +$/,!1)?A.trailingSpace++:A.trailingSpace&&(A.trailingSpaceNewLine=!0)),_(A)}function u(j,A){var X=j.next();if(X===">"){A.f=A.inline=f,N.highlightFormatting&&(A.formatting="link");var ee=_(A);return ee?ee+=" ":ee="",ee+H.linkInline}return j.match(/^[^>]+/,!0),H.linkInline}function E(j,A){if(j.eatSpace())return null;var X=j.next();return X==="("||X==="["?(A.f=A.inline=y(X==="("?")":"]"),N.highlightFormatting&&(A.formatting="link-string"),A.linkHref=!0,_(A)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(j){return function(A,X){var ee=A.next();if(ee===j){X.f=X.inline=f,N.highlightFormatting&&(X.formatting="link-string");var se=_(X);return X.linkHref=!1,se}return A.match(b[j]),X.linkHref=!0,_(X)}}function P(j,A){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(A.f=R,j.next(),N.highlightFormatting&&(A.formatting="link"),A.linkText=!0,_(A)):l(j,A,f)}function R(j,A){if(j.match(/^\]:/,!0)){A.f=A.inline=U,N.highlightFormatting&&(A.formatting="link");var X=_(A);return A.linkText=!1,X}return j.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function U(j,A){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?A.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),A.f=A.inline=f,H.linkHref+" url")}var L={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:f,text:g,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(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&q.copyState(V,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?q.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,A){if(A.formatting=!1,j!=A.thisLine.stream){if(A.header=0,A.hr=!1,j.match(/^\s*$/,!0))return w(A),null;if(A.prevLine=A.thisLine,A.thisLine={stream:j},A.taskList=!1,A.trailingSpace=0,A.trailingSpaceNewLine=!1,!A.localState&&(A.f=A.block,A.f!=O)){var X=j.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(A.indentation=X,A.indentationDiff=null,X>0)return null}}return A.f(j,A)},innerMode:function(j){return j.block==O?{state:j.htmlState,mode:V}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:L}},indent:function(j,A,X){return j.block==O&&V.indent?V.indent(j.htmlState,A,X):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,A,X):q.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},lzim:function(Ke,Me,K){"use strict";var q=K("E7E6"),z=K.n(q);K.d(Me,"x",function(){return z.a});var N=K("/GNS"),V=K.n(N);K.d(Me,"w",function(){return V.a});var W=K("FOrL"),D=K.n(W);K.d(Me,"q",function(){return D.a});var H=K("HpTS"),F=K.n(H);K.d(Me,"y",function(){return F.a});var k=K("tWlo"),T=K.n(k);K.d(Me,"a",function(){return T.a});var v=K("7ZXX"),m=K.n(v);K.d(Me,"l",function(){return m.a});var c=K("GABl"),d=K.n(c);K.d(Me,"e",function(){return d.a});var r=K("onxn"),s=K.n(r);K.d(Me,"n",function(){return s.a});var o=K("nKGa"),a=K.n(o);K.d(Me,"m",function(){return a.a});var l=K("4qgm"),h=K.n(l);K.d(Me,"A",function(){return h.a});var I=K("JeFH"),w=K.n(I);K.d(Me,"b",function(){return w.a});var x=K("ji0R"),O=K.n(x);K.d(Me,"i",function(){return O.a});var S=K("W6BS"),_=K.n(S);K.d(Me,"B",function(){return _.a});var g=K("kPYp"),f=K.n(g);K.d(Me,"C",function(){return f.a});var u=K("nukY"),E=K.n(u),b=K("4u4S"),y=K.n(b),P=K("yslc"),R=K.n(P),U=K("l2Kq"),L=K.n(U),j=K("RMFE"),A=K.n(j);K.d(Me,"o",function(){return A.a});var X=K("TGq3"),ee=K.n(X),se=K("SMhR"),ce=K.n(se);K.d(Me,"z",function(){return ce.a});var Le=K("8/bI"),Ce=K.n(Le);K.d(Me,"j",function(){return Ce.a});var Ae=K("JWDV"),Pe=K.n(Ae),Ie=K("Xsq0"),pe=K.n(Ie);K.d(Me,"p",function(){return pe.a});var de=K("Ohmc"),ne=K.n(de);K.d(Me,"c",function(){return ne.a});var ge=K("csWT"),oe=K.n(ge);K.d(Me,"d",function(){return oe.a});var De=K("7v3h"),Ue=K.n(De);K.d(Me,"k",function(){return Ue.a});var we=K("cRFk"),Ge=K.n(we);K.d(Me,"v",function(){return Ge.a});var Qe=K("kPWJ"),et=K.n(Qe);K.d(Me,"u",function(){return et.a});var ze=K("qgvg"),Je=K.n(ze);K.d(Me,"r",function(){return Je.a});var Xe=K("FPkq"),yt=K.n(Xe);K.d(Me,"t",function(){return yt.a});var xt=K("A/g1"),vt=K.n(xt);K.d(Me,"f",function(){return vt.a});var ht=K("Nmxd"),Rt=K.n(ht);K.d(Me,"g",function(){return Rt.a});var At=K("5D2P"),ke=K.n(At);K.d(Me,"h",function(){return ke.a});var Oe=K("djh8"),tt=K.n(Oe);K.d(Me,"s",function(){return tt.a});var it=K("Jq4h"),Ne=K.n(it)},n6Qo:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return F});var q=K("q1tI"),z=K("biw7"),N=K("fyJ8");function V(k){var T=k.className,v=k.index,m=k.children,c=k.colSpan,d=k.rowSpan,r=q.useContext(z.a),s=r.prefixCls,o=r.fixedInfoList,a=o[v];return q.createElement(N.a,Object.assign({className:T,index:v,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:c,rowSpan:d}}}},a))}function W(k){return q.createElement("tr",Object.assign({},k))}function D(k){var T=k.children,v=q.useContext(z.a),m=v.prefixCls;return q.createElement("tfoot",{className:"".concat(m,"-summary")},T)}var H=Me.b=D,F={Cell:V,Row:W}},nKGa:function(Ke,Me,K){Ke.exports=K.p+"static/export_exercise-template.f7655c19.png"},nVVt:function(Ke,Me){Ke.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nukY:function(Ke,Me){Ke.exports="data:image/png;base64,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"},o5mm:function(Ke,Me,K){Ke.exports={flex_box_center:"flex_box_center___yMfGk",flex_space_between:"flex_space_between___3T4Rr",flex_box_vertical_center:"flex_box_vertical_center___2K9ch",flex_box_center_end:"flex_box_center_end___1GgKp",flex_box_column:"flex_box_column___2DSuN",shixunWrp:"shixunWrp___2_2ep"}},onxn:function(Ke,Me){Ke.exports="data:image/png;base64,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"},osHv:function(Ke,Me,K){(function(q){q(K("VrN/"))})(function(q){"use strict";var z=q.Pos;function N(o,a){return o.line-a.line||o.ch-a.ch}var V="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",W=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",D=new RegExp("<(/?)(["+V+"]["+W+"]*)","g");function H(o,a,l,h){this.line=a,this.ch=l,this.cm=o,this.text=o.getLine(a),this.min=h?Math.max(h.from,o.firstLine()):o.firstLine(),this.max=h?Math.min(h.to-1,o.lastLine()):o.lastLine()}function F(o,a){var l=o.cm.getTokenTypeAt(z(o.line,a));return l&&/\btag\b/.test(l)}function k(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function T(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var a=o.text.indexOf(">",o.ch);if(a==-1){if(k(o))continue;return}if(!F(o,a+1)){o.ch=a+1;continue}var l=o.text.lastIndexOf("/",a),h=l>-1&&!/\S/.test(o.text.slice(l+1,a));return o.ch=a+1,h?"selfClose":"regular"}}function m(o){for(;;){var a=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(a==-1){if(T(o))continue;return}if(!F(o,a+1)){o.ch=a;continue}D.lastIndex=a,o.ch=a;var l=D.exec(o.text);if(l&&l.index==a)return l}}function c(o){for(;;){D.lastIndex=o.ch;var a=D.exec(o.text);if(!a){if(k(o))continue;return}if(!F(o,a.index+1)){o.ch=a.index+1;continue}return o.ch=a.index+a[0].length,a}}function d(o){for(;;){var a=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(a==-1){if(T(o))continue;return}if(!F(o,a+1)){o.ch=a;continue}var l=o.text.lastIndexOf("/",a),h=l>-1&&!/\S/.test(o.text.slice(l+1,a));return o.ch=a+1,h?"selfClose":"regular"}}function r(o,a){for(var l=[];;){var h=c(o),I,w=o.line,x=o.ch-(h?h[0].length:0);if(!h||!(I=v(o)))return;if(I=="selfClose")continue;if(h[1]){for(var O=l.length-1;O>=0;--O)if(l[O]==h[2]){l.length=O;break}if(O<0&&(!a||a==h[2]))return{tag:h[2],from:z(w,x),to:z(o.line,o.ch)}}else l.push(h[2])}}function s(o,a){for(var l=[];;){var h=d(o);if(!h)return;if(h=="selfClose"){m(o);continue}var I=o.line,w=o.ch,x=m(o);if(!x)return;if(x[1])l.push(x[2]);else{for(var O=l.length-1;O>=0;--O)if(l[O]==x[2]){l.length=O;break}if(O<0&&(!a||a==x[2]))return{tag:x[2],from:z(o.line,o.ch),to:z(I,w)}}}}q.registerHelper("fold","xml",function(o,a){for(var l=new H(o,a.line,0);;){var h=c(l);if(!h||l.line!=a.line)return;var I=v(l);if(!I)return;if(!h[1]&&I!="selfClose"){var w=z(l.line,l.ch),x=r(l,h[2]);return x&&N(x.from,w)>0?{from:w,to:x.from}:null}}}),q.findMatchingTag=function(o,a,l){var h=new H(o,a.line,a.ch,l);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var I=v(h),w=I&&z(h.line,h.ch),x=I&&m(h);if(!I||!x||N(h,a)>0)return;var O={from:z(h.line,h.ch),to:w,tag:x[2]};return I=="selfClose"?{open:O,close:null,at:"open"}:x[1]?{open:s(h,x[2]),close:O,at:"close"}:(h=new H(o,w.line,w.ch,l),{open:O,close:r(h,x[2]),at:"open"})},q.findEnclosingTag=function(o,a,l,h){for(var I=new H(o,a.line,a.ch,l);;){var w=s(I,h);if(!w)break;var x=new H(o,a.line,a.ch,l),O=r(x,w.tag);if(O)return{open:w,close:O}}},q.scanForClosingTag=function(o,a,l,h){var I=new H(o,a.line,a.ch,h?{from:0,to:h}:null);return r(I,l)}})},p5ED:function(Ke,Me,K){"use strict";var q=K("+L6B"),z=K("2/Rp"),N=K("5Dmo"),V=K("3S7+"),W=K("k1fw"),D=K("tJVT"),H=K("q1tI"),F=K.n(H),k=K("vHTk"),T=K.n(k),v=K("yEEn"),m=K("ZW9T"),c=K("1vsH");Me.a=function(d){var r=d.name,s=d.data,o=d.theme,a=d.type,l=d.filename,h=d.monacoEditor,I=d.className,w=d.style,x=d.close,O=d.onClose,S=d.hasMask,_=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),g=Object(D.a)(_,2),f=g[0],u=g[1],E=Object(H.useState)(""),b=Object(D.a)(E,2),y=b[0],P=b[1],R,U=1024*1024,L=10*U,j=Object(H.useRef)();a==="office"&&(R=Object(c.T)(s).filesize,R>L&&(a="other")),l&&(h.filename=l),Object(H.useEffect)(function(){var ee,se,ce=(ee=document.cookie)===null||ee===void 0||((se=ee.replace(/\s/g,""))===null||se===void 0)?void 0:se.split(";");ce==null||ce.map(function(Le){var Ce=Le.split("=");Ce[0]==="_educoder_session"&&P(Ce[1])})},[]);var A=function(){if(s.startsWith("http")||s.startsWith("/")){X();return}Object(c.z)(l||"educoder",s,l)},X=function(){Object(c.x)(l||r,s)};return console.log("data:",s,"fileanme:",l," name:",r),F.a.createElement("div",{style:Object(W.a)({},w||{}),className:"".concat(S&&T.a.bgBlack," ").concat(a?T.a.wrp:"hide")},x&&F.a.createElement("div",{className:T.a.close,ref:j},F.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return j.current}},F.a.createElement("span",{onClick:X},F.a.createElement("i",{className:"icon-quxiaozhiding"}))),F.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return j.current}},F.a.createElement("span",{className:"",onClick:O},F.a.createElement("i",{className:"icon-guanbi1"})))),F.a.createElement("div",{className:"".concat(T.a[I]," ").concat(I," ").concat(T.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&F.a.createElement(m.b,h)),a==="audio"&&F.a.createElement("audio",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?s:"data:audio/mp3;base64,").concat(s),autoPlay:!0}),a==="video"&&F.a.createElement(F.a.Fragment,null,s!=null&&s.startsWith("/")?F.a.createElement("video",{controls:!0,src:"".concat(s),autoPlay:!0}):F.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(s),autoPlay:!0})),a==="html"&&F.a.createElement("iframe",{src:s+"&disposition=inline"}),a==="pdf"&&F.a.createElement("embed",{className:T.a.embed,src:s}),a==="image"&&F.a.createElement(F.a.Fragment,null,F.a.createElement("img",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(s)})),a==="other"&&F.a.createElement("div",null,F.a.createElement(z.a,{type:"primary",size:"large",onClick:A},F.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&F.a.createElement(z.a,{type:"primary",size:"large",onClick:A},F.a.createElement(v.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ke,Me,K){},psGv:function(Ke,Me,K){var q,z;(function(){var N;(function(){"use strict";var H=[,,function(v){function m(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var r=new m(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},m.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},m.prototype.has_match=function(r){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(r))return!0;return!1},m.prototype.set_indent=function(r,s){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=s||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(r){this.__items.push(r);var s=r.lastIndexOf(`
`);s!==-1?this.__character_count=r.length-s:this.__character_count+=r.length},m.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function c(r,s){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),s=s||"",r.indent_level>0&&(s=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}c.prototype.get_indent_size=function(r,s){var o=this.__base_string_length;return s=s||0,r<0&&(o=0),o+=r*this.__indent_size,o+=s,o},c.prototype.get_indent_string=function(r,s){var o=this.__base_string;return s=s||0,r<0&&(r=0,o=""),s+=r*this.__indent_size,this.__ensure_cache(s),o+=this.__cache[s],o},c.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var r=this.__cache.length,s=0,o="";this.__indent_size&&r>=this.__indent_size&&(s=Math.floor(r/this.__indent_size),r-=s*this.__indent_size,o=new Array(s+1).join(this.__indent_string)),r&&(o+=new Array(r+1).join(" ")),this.__cache.push(o)};function d(r,s){this.__indent_cache=new c(r,s),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(r,s){return this.__indent_cache.get_indent_string(r,s)},d.prototype.get_indent_size=function(r,s){return this.__indent_cache.get_indent_size(r,s)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(r){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return r!==`
`&&(o=o.replace(/[\n]/g,r)),o},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(r,s){return r=r||0,s=s||0,this.next_line.set_indent(r,s),this.__lines.length>1?(this.current_line.set_indent(r,s),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(r){for(var s=0;s<r.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},d.prototype.remove_indent=function(r){for(var s=this.__lines.length;r<s;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(r,s){for(var o=this.__lines.length-2;o>=0;){var a=this.__lines[o];if(a.is_empty())break;if(a.item(0).indexOf(r)!==0&&a.item(-1)!==s){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=d},function(v){function m(c,d,r,s){this.type=c,this.text=d,this.comments_before=null,this.newlines=r||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(r,s){this.raw_options=c(r,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(r,s){var o=this.raw_options[r],a=s||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(a=o.concat()):typeof o=="string"&&(a=o.split(/[^a-zA-Z0-9_\/\-]+/)),a},m.prototype._get_boolean=function(r,s){var o=this.raw_options[r],a=o===void 0?!!s:!!o;return a},m.prototype._get_characters=function(r,s){var o=this.raw_options[r],a=s||"";return typeof o=="string"&&(a=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},m.prototype._get_number=function(r,s){var o=this.raw_options[r];s=parseInt(s,10),isNaN(s)&&(s=0);var a=parseInt(o,10);return isNaN(a)&&(a=s),a},m.prototype._get_selection=function(r,s,o){var a=this._get_selection_list(r,s,o);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
`+s+`
You passed in: '`+this.raw_options[r]+"'");return a[0]},m.prototype._get_selection_list=function(r,s,o){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[s[0]],!this._is_valid_selection(o,s))throw new Error("Invalid Default Value!");var a=this._get_array(r,o);if(!this._is_valid_selection(a,s))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
`+s+`
You passed in: '`+this.raw_options[r]+"'");return a},m.prototype._is_valid_selection=function(r,s){return r.length&&s.length&&!r.some(function(o){return s.indexOf(o)===-1})};function c(r,s){var o={};r=d(r);var a;for(a in r)a!==s&&(o[a]=r[a]);if(s&&r[s])for(a in r[s])o[a]=r[s][a];return o}function d(r){var s={},o;for(o in r){var a=o.replace(/-/g,"_");s[a]=r[o]}return s}v.exports.Options=m,v.exports.normalizeOpts=d,v.exports.mergeOpts=c},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function c(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position<this.__input_length},c.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},c.prototype.peek=function(d){var r=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(r=this.__input.charAt(d)),r},c.prototype.__match=function(d,r){d.lastIndex=r;var s=d.exec(this.__input);return s&&!(m&&d.sticky)&&(s.index!==r&&(s=null)),s},c.prototype.test=function(d,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(d,r):!1},c.prototype.testChar=function(d,r){var s=this.peek(r);return d.lastIndex=0,s!==null&&d.test(s)},c.prototype.match=function(d){var r=this.__match(d,this.__position);return r?this.__position+=r[0].length:r=null,r},c.prototype.read=function(d,r,s){var o="",a;return d&&(a=this.match(d),a&&(o+=a[0])),r&&(a||!d)&&(o+=this.readUntil(r,s)),o},c.prototype.readUntil=function(d,r){var s="",o=this.__position;d.lastIndex=this.__position;var a=d.exec(this.__input);return a?(o=a.index,r&&(o+=a[0].length)):o=this.__input_length,s=this.__input.substring(this.__position,o),this.__position=o,s},c.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},c.prototype.get_regexp=function(d,r){var s=null,o="g";return r&&m&&(o="y"),typeof d=="string"&&d!==""?s=new RegExp(d,o):d&&(s=new RegExp(d.source,o)),s},c.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},c.prototype.peekUntilAfter=function(d){var r=this.__position,s=this.readUntilAfter(d);return this.__position=r,s},c.prototype.lookBack=function(d){var r=this.__position-1;return r>=d.length&&this.__input.substring(r-d.length,r).toLowerCase()===d},v.exports.InputScanner=c},function(v,m,c){var d=c(8).InputScanner,r=c(3).Token,s=c(10).TokenStream,o=c(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,I){this._input=new d(h),this._options=I||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var h,I=new r(a.START,""),w=null,x=[],O=new s;I.type!==a.EOF;){for(h=this._get_next_token(I,w);this._is_comment(h);)O.add(h),h=this._get_next_token(I,w);O.isEmpty()||(h.comments_before=O,O=new s),h.parent=w,this._is_opening(h)?(x.push(w),w=h):w&&this._is_closing(h,w)&&(h.opened=w,w.closed=h,w=x.pop(),h.parent=w),h.previous=I,I.next=h,this.__tokens.add(h),I=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,I){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(a.RAW,w):this._create_token(a.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,I){return!1},l.prototype._create_token=function(h,I){var w=new r(h,I,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=l,v.exports.TOKEN=a},function(v){function m(c){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=c}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__tokens[this.__position],this.__position+=1),c},m.prototype.peek=function(c){var d=null;return c=c||0,c+=this.__position,c>=0&&c<this.__tokens_length&&(d=this.__tokens[c]),d},m.prototype.add=function(c){this.__parent_token&&(c.parent=this.__parent_token),this.__tokens.push(c),this.__tokens_length+=1},v.exports.TokenStream=m},function(v,m,c){var d=c(12).Pattern;function r(s,o){d.call(this,s,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new d,r.prototype.__set_whitespace_patterns=function(s,o){s+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var o=this.__split(this._newline_regexp,s);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return s},r.prototype.matching=function(s,o){var a=this._create();return a.__set_whitespace_patterns(s,o),a._update(),a},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(s,o){s.lastIndex=0;for(var a=0,l=[],h=s.exec(o);h;)l.push(o.substring(a,h.index)),a=h.index+h[0].length,h=s.exec(o);return a<o.length?l.push(o.substring(a,o.length)):l.push(""),l},v.exports.WhitespacePattern=r},function(v){function m(c,d){this._input=c,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}m.prototype.read=function(){var c=this._input.read(this._starting_pattern);return(!this._starting_pattern||c)&&(c+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),c},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(c){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(c),d._update(),d},m.prototype.until=function(c){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(c),d._update(),d},m.prototype.starting_with=function(c){var d=this._create();return d._starting_pattern=this._input.get_regexp(c,!0),d._update(),d},m.prototype.matching=function(c){var d=this._create();return d._match_pattern=this._input.get_regexp(c,!0),d._update(),d},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},v.exports.Pattern=m},function(v){function m(c,d){c=typeof c=="string"?c:c.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(c+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(c+/\sbeautify\signore:end\s/.source+d,"g")}m.prototype.get_directives=function(c){if(!c.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(c);r;)d[r[1]]=r[2],r=this.__directive_pattern.exec(c);return d},m.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=m},function(v,m,c){var d=c(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(o,a){d.call(this,o,a),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var l=new d(o);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new d,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(o){var a=this._create();return a._disabled[o]=!0,a._update(),a},s.prototype.read_options=function(o){var a=this._create();for(var l in r)a._disabled[l]=o.templating.indexOf(l)===-1;return a._update(),a},s.prototype.exclude=function(o){var a=this._create();return a._excluded[o]=!0,a._update(),a},s.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),o+=a,a=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},s.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},s.prototype._read_template=function(){var o="",a=this._input.peek();if(a==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},v.exports.TemplatablePattern=s},,,,function(v,m,c){var d=c(19).Beautifier,r=c(20).Options;function s(o,a,l,h){var I=new d(o,a,l,h);return I.beautify()}v.exports=s,v.exports.defaultOptions=function(){return new r}},function(v,m,c){var d=c(20).Options,r=c(2).Output,s=c(21).Tokenizer,o=c(21).TOKEN,a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,h=function(E,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new r(E,b)};h.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},h.prototype.set_space_before_token=function(E,b){this._output.space_before_token=E,this._output.non_breaking_space=b},h.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},h.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},h.prototype.print_preserved_newlines=function(E){var b=0;E.type!==o.TEXT&&E.previous.type!==o.TEXT&&(b=E.newlines?1:0),this.preserve_newlines&&(b=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var y=0;y<b;y++)this.print_newline(y>0);return b!==0},h.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},h.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},h.prototype.print_newline=function(E){this._output.add_new_line(E)},h.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},h.prototype.indent=function(){this.indent_level++},h.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var I=function(E){for(var b=null,y=E.next;y.type!==o.EOF&&E.closed!==y;){if(y.type===o.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===o.EQUALS&&y.next.next&&y.next.next.type===o.VALUE&&(b=y.next.next.text);break}y=y.next}return b},w=function(E,b){var y=null,P=null;return b.closed?(E==="script"?y="text/javascript":E==="style"&&(y="text/css"),y=I(b)||y,y.search("text/css")>-1?P="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?P="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?P="html":y.search(/test\/null/)>-1&&(P="null"),P):null};function x(E,b){return b.indexOf(E)!==-1}function O(E,b,y){this.parent=E||null,this.tag=b?b.tag_name:"",this.indent_level=y||0,this.parser_token=b||null}function S(E){this._printer=E,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(E){var b=new O(this._current_frame,E,this._printer.indent_level);this._current_frame=b},S.prototype._try_pop_frame=function(E){var b=null;return E&&(b=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),b},S.prototype._get_frame=function(E,b){for(var y=this._current_frame;y&&!(E.indexOf(y.tag)!==-1);){if(b&&b.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},S.prototype.try_pop=function(E,b){var y=this._get_frame([E],b);return this._try_pop_frame(y)},S.prototype.indent_to_tag=function(E){var b=this._get_frame(E);b&&(this._printer.indent_level=b.indent_level)};function _(E,b,y,P){this._source_text=E||"",b=b||{},this._js_beautify=y,this._css_beautify=P,this._tag_stack=null;var R=new d(b,"html");this._options=R,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
`,E&&a.test(E)&&(b=E.match(a)[0])),E=E.replace(l,`
`);var y=E.match(/^[\t ]*/)[0],P={text:"",type:""},R=new g,U=new h(this._options,y),L=new s(E,this._options).tokenize();this._tag_stack=new S(U);for(var j=null,A=L.next();A.type!==o.EOF;)A.type===o.TAG_OPEN||A.type===o.COMMENT?(j=this._handle_tag_open(U,A,R,P),R=j):A.type===o.ATTRIBUTE||A.type===o.EQUALS||A.type===o.VALUE||A.type===o.TEXT&&!R.tag_complete?j=this._handle_inside_tag(U,A,R,L):A.type===o.TAG_CLOSE?j=this._handle_tag_close(U,A,R):A.type===o.TEXT?j=this._handle_text(U,A,R):U.add_raw_token(A),P=j,A=L.next();var X=U._output.get_code(b);return X},_.prototype._handle_tag_close=function(E,b,y){var P={text:b.text,type:b.type};return E.alignment_size=0,y.tag_complete=!0,E.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted?E.add_raw_token(b):(y.tag_start_char==="<"&&(E.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(b)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(E.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&E.set_wrap_point(),P},_.prototype._handle_inside_tag=function(E,b,y,P){var R=y.has_wrapped_attrs,U={text:b.text,type:b.type};if(E.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted)E.add_raw_token(b);else if(y.tag_start_char==="{"&&b.type===o.TEXT)E.print_preserved_newlines(b)?(b.newlines=0,E.add_raw_token(b)):E.print_token(b);else{if(b.type===o.ATTRIBUTE?(E.set_space_before_token(!0),y.attr_count+=1):(b.type===o.EQUALS||b.type===o.VALUE&&b.previous.type===o.EQUALS)&&E.set_space_before_token(!1),b.type===o.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(b),R=R||b.newlines!==0),this._is_wrap_attributes_force)){var L=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var j=!0,A=0,X;do{if(X=P.peek(A),X.type===o.ATTRIBUTE){j=!1;break}A+=1}while(A<4&&X.type!==o.EOF&&X.type!==o.TAG_CLOSE);L=!j}L&&(E.print_newline(!1),R=!0)}E.print_token(b),R=R||E.previous_token_wrapped(),y.has_wrapped_attrs=R}return U},_.prototype._handle_text=function(E,b,y){var P={text:b.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(E,b,y):y.is_unformatted||y.is_content_unformatted?E.add_raw_token(b):(E.traverse_whitespace(b),E.print_token(b)),P},_.prototype._print_custom_beatifier_text=function(E,b,y){var P=this;if(b.text!==""){var R=b.text,U,L=1,j="",A="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:y.custom_beautifier_name==="html"&&(U=function(Ce,Ae){var Pe=new _(Ce,Ae,P._js_beautify,P._css_beautify);return Pe.beautify()}),this._options.indent_scripts==="keep"?L=0:this._options.indent_scripts==="separate"&&(L=-E.indent_level);var X=E.get_full_indent(L);if(R=R.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&R[0]==="<"&&R.match(/^(<!--|<!\[CDATA\[)/)){var ee=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(R);if(!ee){E.add_raw_token(b);return}j=X+ee[1]+`
`,R=ee[4],ee[5]&&(A=X+ee[5]),R=R.replace(/\n[ \t]*$/,""),(ee[2]||ee[3].indexOf(`
`)!==-1)&&(ee=ee[3].match(/[ \t]+$/),ee&&(b.whitespace_before=ee[0]))}if(R)if(U){var se=function(){this.eol=`
`};se.prototype=this._options.raw_options;var ce=new se;R=U(X+R,ce)}else{var Le=b.whitespace_before;Le&&(R=R.replace(new RegExp(`
(`+Le+")?","g"),`
`)),R=X+R.replace(/\n/g,`
`+X)}j&&(R?R=j+R+`
`+A:R=j+A),E.print_newline(!1),R&&(b.text=R,b.whitespace_before="",b.newlines=0,E.add_raw_token(b),E.print_newline(!0))}},_.prototype._handle_tag_open=function(E,b,y,P){var R=this._get_tag_open_token(b);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&b.type===o.TAG_OPEN&&b.text.indexOf("</")===0?(E.add_raw_token(b),R.start_tag_token=this._tag_stack.try_pop(R.tag_name)):(E.traverse_whitespace(b),this._set_tag_position(E,b,R,y,P),R.is_inline_element||E.set_wrap_point(),E.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(R.alignment_size=b.text.length+1),!R.tag_complete&&!R.is_unformatted&&(E.alignment_size=R.alignment_size),R};var g=function(E,b){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!b)this.tag_complete=!0;else{var y;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(y=b.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(b.text.startsWith("{{#>")||b.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&b.next!==null?this.tag_check=b.next.text.split(" ")[0]:this.tag_check=b.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),b.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||b.closed&&b.closed.text==="/>";var P=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(P=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(P)))}};_.prototype._get_tag_open_token=function(E){var b=new g(this._tag_stack.get_parser_token(),E);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||x(b.tag_check,this._options.void_elements),b.is_empty_element=b.tag_complete||b.is_start_tag&&b.is_end_tag,b.is_unformatted=!b.tag_complete&&x(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&x(b.tag_check,this._options.content_unformatted),b.is_inline_element=x(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},_.prototype._set_tag_position=function(E,b,y,P,R){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=w(y.tag_check,b)))),x(y.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var U=E.current_line_has_match(/{{#if/);U||E.print_newline(!1)}y.tag_name==="!--"&&R.type===o.TAG_CLOSE&&P.is_end_tag&&y.text.indexOf(`
`)===-1||(y.is_inline_element||y.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,y))}else if(y.is_end_tag){var L=!1;L=y.start_tag_token&&y.start_tag_token.multiline_content,L=L||!y.is_inline_element&&!(P.is_inline_element||P.is_unformatted)&&!(R.type===o.TAG_CLOSE&&y.start_tag_token===P)&&R.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(L=!1),L&&E.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(R.type!=="TK_CONTENT"||y.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,y)},_.prototype._calcluate_parent_multiline=function(E,b){b.parent&&E._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.parent.multiline_content=!0)};var f=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],u=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(E){var b=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(E.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&f.indexOf(E.tag_name)!==-1){var y=E.parent.parent;(!y||u.indexOf(y.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("thead",["table"]),b=b||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(b=b||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),b=b||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),b},v.exports.Beautifier=_},function(v,m,c){var d=c(6).Options;function r(s){d.call(this,s,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new d,v.exports.Options=r},function(v,m,c){var d=c(9).Tokenizer,r=c(9).TOKEN,s=c(13).Directives,o=c(14).TemplatablePattern,a=c(12).Pattern,l={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},h=new s(/<\!--/,/-->/),I=function(w,x){d.call(this,w,x),this._current_tag_name="";var O=new o(this._input).read_options(this._options),S=new a(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(_).until_after(_)}};I.prototype=new d,I.prototype._is_comment=function(w){return!1},I.prototype._is_opening=function(w){return w.type===l.TAG_OPEN},I.prototype._is_closing=function(w,x){return w.type===l.TAG_CLOSE&&x&&((w.text===">"||w.text==="/>")&&x.text[0]==="<"||w.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},I.prototype._reset=function(){this._current_tag_name=""},I.prototype._get_next_token=function(w,x){var O=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(l.EOF,""):(O=O||this._read_open_handlebars(S,x),O=O||this._read_attribute(S,w,x),O=O||this._read_close(S,x),O=O||this._read_raw_content(S,w,x),O=O||this._read_content_word(S),O=O||this._read_comment_or_cdata(S),O=O||this._read_processing(S),O=O||this._read_open(S,x),O=O||this._create_token(l.UNKNOWN,this._input.next()),O)},I.prototype._read_comment_or_cdata=function(w){var x=null,O=null,S=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(O=this.__patterns.comment.read(),O?(S=h.get_directives(O),S&&S.ignore==="start"&&(O+=h.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(x=this._create_token(l.COMMENT,O),x.directives=S)}return x},I.prototype._read_processing=function(w){var x=null,O=null,S=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(x=this._create_token(l.COMMENT,O),x.directives=S)}return x},I.prototype._read_open=function(w,x){var O=null,S=null;return x||w==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),S=this._create_token(l.TAG_OPEN,O)),S},I.prototype._read_open_handlebars=function(w,x){var O=null,S=null;return x||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),S=this._create_token(l.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),S=this._create_token(l.TAG_OPEN,O))),S},I.prototype._read_close=function(w,x){var O=null,S=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(O=this._input.next(),w==="/"&&(O+=this._input.next()),S=this._create_token(l.TAG_CLOSE,O)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(l.TAG_CLOSE,"}}"))),S},I.prototype._read_attribute=function(w,x,O){var S=null,_="";if(O&&O.text[0]==="<")if(w==="=")S=this._create_token(l.EQUALS,this._input.next());else if(w==='"'||w==="'"){var g=this._input.next();w==='"'?g+=this.__patterns.double_quote.read():g+=this.__patterns.single_quote.read(),S=this._create_token(l.VALUE,g)}else _=this.__patterns.attribute.read(),_&&(x.type===l.EQUALS?S=this._create_token(l.VALUE,_):S=this._create_token(l.ATTRIBUTE,_));return S},I.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},I.prototype._read_raw_content=function(w,x,O){var S="";if(O&&O.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(x.type===l.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var _=x.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var g=this._read_comment_or_cdata(w);if(g)return g.type=l.TEXT,g;S=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(S=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(l.TEXT,S):null},I.prototype._read_content_word=function(w){var x="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(l.TEXT,x)},v.exports.Tokenizer=I,v.exports.TOKEN=l}],F={};function k(v){var m=F[v];if(m!==void 0)return m.exports;var c=F[v]={exports:{}};return H[v](c,c.exports,k),c.exports}var T=k(18);N=T})();var V=N;if(!0)!(q=[K,K("6UM0"),K("TXwP")],z=function(H){var F=K("6UM0"),k=K("TXwP");return{html_beautify:function(T,v){return V(T,v,F.js_beautify,k.css_beautify)}}}.apply(Me,q),z!==void 0&&(Ke.exports=z));else var W,D})()},qgvg:function(Ke,Me){Ke.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"rAM+":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return z});var q=K("Qw5x");function z(N,V){var W;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(W=Object(q.a)(N))||V&&N&&typeof N.length=="number"){W&&(N=W);var D=0,H=function(){};return{s:H,n:function(){return D>=N.length?{done:!0}:{done:!1,value:N[D++]}},e:function(m){throw m},f:H}}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 F=!0,k=!1,T;return{s:function(){W=N[Symbol.iterator]()},n:function(){var m=W.next();return F=m.done,m},e:function(m){k=!0,T=m},f:function(){try{!F&&W.return!=null&&W.return()}finally{if(k)throw T}}}}},rUJ1:function(Ke,Me){const K=/[&<>"']/,q=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},W=S=>V[S];function D(S,_){if(_){if(K.test(S))return S.replace(q,W)}else if(z.test(S))return S.replace(N,W);return S}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(S){return S.replace(H,(_,g)=>(g=g.toLowerCase(),g==="colon"?":":g.charAt(0)==="#"?g.charAt(1)==="x"?String.fromCharCode(parseInt(g.substring(2),16)):String.fromCharCode(+g.substring(1)):""))}const k=/(^|[^\[])\^/g;function T(S,_){S=S.source||S,_=_||"";const g={replace:(f,u)=>(u=u.source||u,u=u.replace(k,"$1"),S=S.replace(f,u),g),getRegex:()=>new RegExp(S,_)};return g}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function c(S,_,g){if(S){let f;try{f=decodeURIComponent(F(g)).replace(v,"").toLowerCase()}catch(u){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}_&&!m.test(g)&&(g=a(_,g));try{g=encodeURI(g).replace(/%25/g,"%")}catch(f){return null}return g}const d={},r=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(S,_){d[" "+S]||(r.test(S)?d[" "+S]=S+"/":d[" "+S]=w(S,"/",!0)),S=d[" "+S];const g=S.indexOf(":")===-1;return _.substring(0,2)==="//"?g?_:S.replace(s,"$1")+_:_.charAt(0)==="/"?g?_:S.replace(o,"$1")+_:S+_}const l={exec:function(){}};function h(S){let _=1,g,f;for(;_<arguments.length;_++){g=arguments[_];for(f in g)Object.prototype.hasOwnProperty.call(g,f)&&(S[f]=g[f])}return S}function I(S,_){const g=S.replace(/\|/g,(E,b,y)=>{let P=!1,R=b;for(;--R>=0&&y[R]==="\\";)P=!P;return P?"|":" |"}),f=g.split(/ \|/);let u=0;if(f.length>_)f.splice(_);else for(;f.length<_;)f.push("");for(;u<f.length;u++)f[u]=f[u].trim().replace(/\\\|/g,"|");return f}function w(S,_,g){const f=S.length;if(f===0)return"";let u=0;for(;u<f;){const E=S.charAt(f-u-1);if(E===_&&!g)u++;else if(E!==_&&g)u++;else break}return S.substr(0,f-u)}function x(S,_){if(S.indexOf(_[1])===-1)return-1;const g=S.length;let f=0,u=0;for(;u<g;u++)if(S[u]==="\\")u++;else if(S[u]===_[0])f++;else if(S[u]===_[1]&&(f--,f<0))return u;return-1}function O(S){S&&S.sanitize&&!S.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")}Ke.exports={escape:D,unescape:F,edit:T,cleanUrl:c,resolveUrl:a,noopTest:l,merge:h,splitCells:I,rtrim:w,findClosingBracket:x,checkSanitizeDeprecation:O}},rcnY:function(Ke,Me,K){var q=K("aRTE");function z(N,V){this.totalCount=N,this.dataCount=V}z.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],z.getRSBlocks=function(N,V){var W=z.getRsBlockTable(N,V);if(W==null)throw new Error("bad rs block @ typeNumber:"+N+"/errorCorrectLevel:"+V);for(var D=W.length/3,H=new Array,F=0;F<D;F++)for(var k=W[F*3+0],T=W[F*3+1],v=W[F*3+2],m=0;m<k;m++)H.push(new z(T,v));return H},z.getRsBlockTable=function(N,V){switch(V){case q.L:return z.RS_BLOCK_TABLE[(N-1)*4+0];case q.M:return z.RS_BLOCK_TABLE[(N-1)*4+1];case q.Q:return z.RS_BLOCK_TABLE[(N-1)*4+2];case q.H:return z.RS_BLOCK_TABLE[(N-1)*4+3];default:return}},Ke.exports=z},sR1s:function(Ke,Me,K){"use strict";K.d(Me,"b",function(){return V}),K.d(Me,"a",function(){return W}),K.d(Me,"c",function(){return D}),K.d(Me,"d",function(){return H});var q=K("U8pU"),z="RC_TABLE_KEY";function N(F){return F==null?[]:Array.isArray(F)?F:[F]}function V(F,k){if(!k&&typeof k!="number")return F;for(var T=N(k),v=F,m=0;m<T.length;m+=1){if(!v)return null;var c=T[m];v=v[c]}return v}function W(F){var k=[],T={};return F.forEach(function(v){for(var m=v||{},c=m.key,d=m.dataIndex,r=c||N(d).join("-")||z;T[r];)r="".concat(r,"_next");T[r]=!0,k.push(r)}),k}function D(){var F={};function k(c,d){d&&Object.keys(d).forEach(function(r){var s=d[r];s&&Object(q.a)(s)==="object"?(c[r]=c[r]||{},k(c[r],s)):c[r]=s})}for(var T=arguments.length,v=new Array(T),m=0;m<T;m++)v[m]=arguments[m];return v.forEach(function(c){k(F,c)}),F}function H(F){return F!=null}},sboe:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return N});var q=K("q1tI"),z=K.n(q),N=q.createContext(null)},t23M:function(Ke,Me,K){"use strict";var q=K("VTBJ"),z=K("1OyB"),N=K("vuIU"),V=K("Ji7U"),W=K("LK+K"),D=K("q1tI"),H=K.n(D),F=K("m+aA"),k=K("Zm9Q"),T=K("Kwbf"),v=K("c+Xe"),m=K("bdgK"),c="rc-observer-key",d=function(r){Object(V.a)(o,r);var s=Object(W.a)(o);function o(){var a;return Object(z.a)(this,o),a=s.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(l){var h=a.props.onResize,I=l[0].target,w=I.getBoundingClientRect(),x=w.width,O=w.height,S=I.offsetWidth,_=I.offsetHeight,g=Math.floor(x),f=Math.floor(O);if(a.state.width!==g||a.state.height!==f||a.state.offsetWidth!==S||a.state.offsetHeight!==_){var u={width:g,height:f,offsetWidth:S,offsetHeight:_};a.setState(u),h&&Promise.resolve().then(function(){h(Object(q.a)(Object(q.a)({},u),{},{offsetWidth:S,offsetHeight:_}))})}},a.setChildNode=function(l){a.childNode=l},a}return Object(N.a)(o,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var l=this.props.disabled;if(l){this.destroyObserver();return}var h=Object(F.a)(this.childNode||this),I=h!==this.currentElement;I&&(this.destroyObserver(),this.currentElement=h),!this.resizeObserver&&h&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(h))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var l=this.props.children,h=Object(k.a)(l);if(h.length>1)Object(T.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(h.length===0)return Object(T.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var I=h[0];if(D.isValidElement(I)&&Object(v.c)(I)){var w=I.ref;h[0]=D.cloneElement(I,{ref:Object(v.a)(w,this.setChildNode)})}return h.length===1?h[0]:h.map(function(x,O){return!D.isValidElement(x)||"key"in x&&x.key!==null?x:D.cloneElement(x,{key:"".concat(c,"-").concat(O)})})}}]),o}(D.Component);d.displayName="ResizeObserver",Me.a=d},tWlo:function(Ke,Me){Ke.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(Ke,Me,K){typeof window!="undefined"&&function(z,N){Ke.exports=N()}(this,function(){return function(q){var z={};function N(V){if(z[V])return z[V].exports;var W=z[V]={i:V,l:!1,exports:{}};return q[V].call(W.exports,W,W.exports,N),W.l=!0,W.exports}return N.m=q,N.c=z,N.d=function(V,W,D){N.o(V,W)||Object.defineProperty(V,W,{enumerable:!0,get:D})},N.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},N.t=function(V,W){if(W&1&&(V=N(V)),W&8)return V;if(W&4&&typeof V=="object"&&V&&V.__esModule)return V;var D=Object.create(null);if(N.r(D),Object.defineProperty(D,"default",{enumerable:!0,value:V}),W&2&&typeof V!="string")for(var H in V)N.d(D,H,function(F){return V[F]}.bind(null,H));return D},N.n=function(V){var W=V&&V.__esModule?function(){return V.default}:function(){return V};return N.d(W,"a",W),W},N.o=function(V,W){return Object.prototype.hasOwnProperty.call(V,W)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,z,N){"use strict";var V=Object.prototype.hasOwnProperty,W="~";function D(){}Object.create&&(D.prototype=Object.create(null),new D().__proto__||(W=!1));function H(v,m,c){this.fn=v,this.context=m,this.once=c||!1}function F(v,m,c,d,r){if(typeof c!="function")throw new TypeError("The listener must be a function");var s=new H(c,d||v,r),o=W?W+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],s]:v._events[o].push(s):(v._events[o]=s,v._eventsCount++),v}function k(v,m){--v._eventsCount===0?v._events=new D:delete v._events[m]}function T(){this._events=new D,this._eventsCount=0}T.prototype.eventNames=function(){var m=[],c,d;if(this._eventsCount===0)return m;for(d in c=this._events)V.call(c,d)&&m.push(W?d.slice(1):d);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(c)):m},T.prototype.listeners=function(m){var c=W?W+m:m,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var r=0,s=d.length,o=new Array(s);r<s;r++)o[r]=d[r].fn;return o},T.prototype.listenerCount=function(m){var c=W?W+m:m,d=this._events[c];return d?d.fn?1:d.length:0},T.prototype.emit=function(m,c,d,r,s,o){var a=W?W+m:m;if(!this._events[a])return!1;var l=this._events[a],h=arguments.length,I,w;if(l.fn){l.once&&this.removeListener(m,l.fn,void 0,!0);switch(h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,c),!0;case 3:return l.fn.call(l.context,c,d),!0;case 4:return l.fn.call(l.context,c,d,r),!0;case 5:return l.fn.call(l.context,c,d,r,s),!0;case 6:return l.fn.call(l.context,c,d,r,s,o),!0}for(w=1,I=new Array(h-1);w<h;w++)I[w-1]=arguments[w];l.fn.apply(l.context,I)}else{var x=l.length,O;for(w=0;w<x;w++){l[w].once&&this.removeListener(m,l[w].fn,void 0,!0);switch(h){case 1:l[w].fn.call(l[w].context);break;case 2:l[w].fn.call(l[w].context,c);break;case 3:l[w].fn.call(l[w].context,c,d);break;case 4:l[w].fn.call(l[w].context,c,d,r);break;default:if(!I)for(O=1,I=new Array(h-1);O<h;O++)I[O-1]=arguments[O];l[w].fn.apply(l[w].context,I)}}}return!0},T.prototype.on=function(m,c,d){return F(this,m,c,d,!1)},T.prototype.once=function(m,c,d){return F(this,m,c,d,!0)},T.prototype.removeListener=function(m,c,d,r){var s=W?W+m:m;if(!this._events[s])return this;if(!c)return k(this,s),this;var o=this._events[s];if(o.fn)o.fn===c&&(!r||o.once)&&(!d||o.context===d)&&k(this,s);else{for(var a=0,l=[],h=o.length;a<h;a++)(o[a].fn!==c||r&&!o[a].once||d&&o[a].context!==d)&&l.push(o[a]);l.length?this._events[s]=l.length===1?l[0]:l:k(this,s)}return this},T.prototype.removeAllListeners=function(m){var c;return m?(c=W?W+m:m,this._events[c]&&k(this,c)):(this._events=new D,this._eventsCount=0),this},T.prototype.off=T.prototype.removeListener,T.prototype.addListener=T.prototype.on,T.prefixed=W,T.EventEmitter=T,q.exports=T},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,z,N){(function(V){var W=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,D=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,k={buildAbsoluteURL:function(T,v,m){if(m=m||{},T=T.trim(),v=v.trim(),!v){if(!m.alwaysNormalize)return T;var c=k.parseURL(T);if(!c)throw new Error("Error trying to parse base URL.");return c.path=k.normalizePath(c.path),k.buildURLFromParts(c)}var d=k.parseURL(v);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return m.alwaysNormalize?(d.path=k.normalizePath(d.path),k.buildURLFromParts(d)):v;var r=k.parseURL(T);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var s=D.exec(r.path);r.netLoc=s[1],r.path=s[2]}r.netLoc&&!r.path&&(r.path="/");var o={scheme:r.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(o.netLoc=r.netLoc,d.path[0]!=="/"))if(!d.path)o.path=r.path,d.params||(o.params=r.params,d.query||(o.query=r.query));else{var a=r.path,l=a.substring(0,a.lastIndexOf("/")+1)+d.path;o.path=k.normalizePath(l)}return o.path===null&&(o.path=m.alwaysNormalize?k.normalizePath(d.path):d.path),k.buildURLFromParts(o)},parseURL:function(T){var v=W.exec(T);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(T){for(T=T.split("").reverse().join("").replace(H,"");T.length!==(T=T.replace(F,"")).length;);return T.split("").reverse().join("")},buildURLFromParts:function(T){return T.scheme+T.netLoc+T.path+T.params+T.query+T.fragment}};q.exports=k})(this)},"./node_modules/webworkify-webpack/index.js":function(q,z,N){function V(m){var c={};function d(s){if(c[s])return c[s].exports;var o=c[s]={i:s,l:!1,exports:{}};return m[s].call(o.exports,o,o.exports,d),o.l=!0,o.exports}d.m=m,d.c=c,d.i=function(s){return s},d.d=function(s,o,a){d.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:a})},d.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},d.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return d.d(o,"a",o),o},d.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},d.p="/",d.oe=function(s){throw console.error(s),s};var r=d(d.s=ENTRY_MODULE);return r.default||r}var W="[\\.|\\-|\\+|\\w|/|@]+",D="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+W+").*?\\)";function H(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(m){return!isNaN(1*m)}function k(m,c,d){var r={};r[d]=[];var s=c.toString(),o=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return r;for(var a=o[1],l=new RegExp("(\\\\n|\\W)"+H(a)+D,"g"),h;h=l.exec(s);){if(h[3]==="dll-reference")continue;r[d].push(h[3])}for(l=new RegExp("\\("+H(a)+'\\("(dll-reference\\s('+W+'))"\\)\\)'+D,"g");h=l.exec(s);)m[h[2]]||(r[d].push(h[1]),m[h[2]]=N(h[1]).m),r[h[2]]=r[h[2]]||[],r[h[2]].push(h[4]);for(var I=Object.keys(r),w=0;w<I.length;w++)for(var x=0;x<r[I[w]].length;x++)F(r[I[w]][x])&&(r[I[w]][x]=1*r[I[w]][x]);return r}function T(m){var c=Object.keys(m);return c.reduce(function(d,r){return d||m[r].length>0},!1)}function v(m,c){for(var d={main:[c]},r={main:[]},s={main:{}};T(d);)for(var o=Object.keys(d),a=0;a<o.length;a++){var l=o[a],h=d[l],I=h.pop();if(s[l]=s[l]||{},s[l][I]||!m[l][I])continue;s[l][I]=!0,r[l]=r[l]||[],r[l].push(I);for(var w=k(m,m[l][I],l),x=Object.keys(w),O=0;O<x.length;O++)d[x[O]]=d[x[O]]||[],d[x[O]]=d[x[O]].concat(w[x[O]])}return r}q.exports=function(m,c){c=c||{};var d={main:N.m},r=c.all?{main:Object.keys(d.main)}:v(d,m),s="";Object.keys(r).filter(function(I){return I!=="main"}).forEach(function(I){for(var w=0;r[I][w];)w++;r[I].push(w),d[I][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+I+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+r[I].map(function(x){return""+JSON.stringify(x)+": "+d[I][x].toString()}).join(",")+`});
`}),s=s+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+r.main.map(function(I){return""+JSON.stringify(I)+": "+d.main[I].toString()}).join(",")+"}))(self);";var o=new window.Blob([s],{type:"text/javascript"});if(c.bare)return o;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,l=a.createObjectURL(o),h=new window.Worker(l);return h.objectURL=l,h}},"./src/config.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"hlsDefaultConfig",function(){return O}),N.d(z,"mergeConfig",function(){return _}),N.d(z,"enableStreamingMode",function(){return g});var V=N("./src/controller/abr-controller.ts"),W=N("./src/controller/audio-stream-controller.ts"),D=N("./src/controller/audio-track-controller.ts"),H=N("./src/controller/subtitle-stream-controller.ts"),F=N("./src/controller/subtitle-track-controller.ts"),k=N("./src/controller/buffer-controller.ts"),T=N("./src/controller/timeline-controller.ts"),v=N("./src/controller/cap-level-controller.ts"),m=N("./src/controller/fps-controller.ts"),c=N("./src/controller/eme-controller.ts"),d=N("./src/controller/cmcd-controller.ts"),r=N("./src/utils/xhr-loader.ts"),s=N("./src/utils/fetch-loader.ts"),o=N("./src/utils/cues.ts"),a=N("./src/utils/mediakeys-helper.ts"),l=N("./src/utils/logger.ts");function h(){return h=Object.assign||function(f){for(var u=1;u<arguments.length;u++){var E=arguments[u];for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(f[b]=E[b])}return f},h.apply(this,arguments)}function I(f,u){var E=Object.keys(f);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(f);u&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(f,y).enumerable})),E.push.apply(E,b)}return E}function w(f){for(var u=1;u<arguments.length;u++){var E=arguments[u]!=null?arguments[u]:{};u%2?I(Object(E),!0).forEach(function(b){x(f,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(E)):I(Object(E)).forEach(function(b){Object.defineProperty(f,b,Object.getOwnPropertyDescriptor(E,b))})}return f}function x(f,u,E){return u in f?Object.defineProperty(f,u,{value:E,enumerable:!0,configurable:!0,writable:!0}):f[u]=E,f}var O=w(w({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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:k.default,capLevelController:v.default,fpsController:m.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:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:F.default,timelineController:T.TimelineController,audioStreamController:W.default,audioTrackController:D.default,emeController:c.default,cmcdController:d.default});function S(){return{cueHandler:o.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 _(f,u){if((u.liveSyncDurationCount||u.liveMaxLatencyDurationCount)&&(u.liveSyncDuration||u.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(u.liveMaxLatencyDurationCount!==void 0&&(u.liveSyncDurationCount===void 0||u.liveMaxLatencyDurationCount<=u.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(u.liveMaxLatencyDuration!==void 0&&(u.liveSyncDuration===void 0||u.liveMaxLatencyDuration<=u.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},f,u)}function g(f){var u=f.loader;if(u!==s.default&&u!==r.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var E=Object(s.fetchSupported)();E&&(f.loader=s.default,f.progressive=!0,f.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/utils/ewma-bandwidth-estimator.ts"),D=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),F=N("./src/errors.ts"),k=N("./src/types/loader.ts"),T=N("./src/utils/logger.ts");function v(d,r){for(var s=0;s<r.length;s++){var o=r[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(d,o.key,o)}}function m(d,r,s){return r&&v(d.prototype,r),s&&v(d,s),d}var c=function(){function d(s){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=s;var o=s.config;this.bwEstimator=new W.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var r=d.prototype;return r.registerListeners=function(){var o=this.hls;o.on(D.Events.FRAG_LOADING,this.onFragLoading,this),o.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(D.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var o=this.hls;o.off(D.Events.FRAG_LOADING,this.onFragLoading,this),o.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(D.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(o,a){var l=a.frag;if(l.type===k.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=l,this.partCurrent=(h=a.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(o,a){var l=this.hls.config;a.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var o=this.fragCurrent,a=this.partCurrent,l=this.hls,h=l.autoLevelEnabled,I=l.config,w=l.media;if(!o||!w)return;var x=a?a.stats:o.stats,O=a?a.duration:o.duration;if(x.aborted){T.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!h||w.paused||!w.playbackRate||!w.readyState)return;var S=performance.now()-x.loading.start,_=Math.abs(w.playbackRate);if(S<=500*O/_)return;var g=l.levels,f=l.minAutoLevel,u=g[o.level],E=x.total||Math.max(x.loaded,Math.round(O*u.maxBitrate/8)),b=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/S),y=(E-x.loaded)/b,P=w.currentTime,R=(H.BufferHelper.bufferInfo(w,P,I.maxBufferHole).end-P)/_;if(R>=2*O/_||y<=R)return;var U=Number.POSITIVE_INFINITY,L;for(L=o.level-1;L>f;L--){var j=g[L].maxBitrate;if(U=O*j/(8*.8*b),U<R)break}if(U>=y)return;var A=this.bwEstimator.getEstimate();T.logger.warn("Fragment "+o.sn+(a?" part "+a.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+L+`
Current BW estimate: `+(Object(V.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+y.toFixed(3)+` s
Estimated load time for the next fragment: `+U.toFixed(3)+` s
Time to underbuffer: `+R.toFixed(3)+" s"),l.nextLoadLevel=L,this.bwEstimator.sample(S,x.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),l.trigger(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:a,stats:x})},r.onFragLoaded=function(o,a){var l=a.frag,h=a.part;if(l.type===k.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(l.sn)){var I=h?h.stats:l.stats,w=h?h.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[l.level],O=(x.loaded?x.loaded.bytes:0)+I.loaded,S=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:O,duration:S},x.realBitrate=Math.round(8*O/S)}if(l.bitrateTest){var _={stats:I,frag:l,part:h,id:l.type};this.onFragBuffered(D.Events.FRAG_BUFFERED,_),l.bitrateTest=!1}}},r.onFragBuffered=function(o,a){var l=a.frag,h=a.part,I=h?h.stats:l.stats;if(I.aborted)return;if(l.type!==k.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var w=I.parsing.end-I.loading.start;this.bwEstimator.sample(w,I.loaded),I.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},r.onError=function(o,a){switch(a.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var o=this.fragCurrent,a=this.partCurrent,l=this.hls,h=l.maxAutoLevel,I=l.config,w=l.minAutoLevel,x=l.media,O=a?a.duration:o?o.duration:0,S=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,g=this.bwEstimator?this.bwEstimator.getEstimate():I.abrEwmaDefaultEstimate,f=(H.BufferHelper.bufferInfo(x,S,I.maxBufferHole).end-S)/_,u=this.findBestLevel(g,w,h,f,I.abrBandWidthFactor,I.abrBandWidthUpFactor);if(u>=0)return u;T.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=O?Math.min(O,I.maxStarvationDelay):I.maxStarvationDelay,b=I.abrBandWidthFactor,y=I.abrBandWidthUpFactor;if(!f){var P=this.bitrateTestDelay;if(P){var R=O?Math.min(O,I.maxLoadingDelay):I.maxLoadingDelay;E=R-P,T.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),b=y=1}}return u=this.findBestLevel(g,w,h,f+E,b,y),Math.max(u,0)},r.findBestLevel=function(o,a,l,h,I,w){for(var x,O=this.fragCurrent,S=this.partCurrent,_=this.lastLoadedFragLevel,g=this.hls.levels,f=g[_],u=!!(f!=null&&(x=f.details)!==null&&x!==void 0&&x.live),E=f==null?void 0:f.codecSet,b=S?S.duration:O?O.duration:0,y=l;y>=a;y--){var P=g[y];if(!P||E&&P.codecSet!==E)continue;var R=P.details,U=(S?R==null?void 0:R.partTarget:R==null?void 0:R.averagetargetduration)||b,L=void 0;y<=_?L=I*o:L=w*o;var j=g[y].maxBitrate,A=j*U/L;if(T.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(L)+"/"+j+"/"+U+"/"+h+"/"+A),L>j&&(!A||u&&!this.bitrateTestDelay||A<h))return y}return-1},m(d,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,a=this.bwEstimator;if(o!==-1&&(!a||!a.canEstimate()))return o;var l=this.getNextABRAutoLevel();return o!==-1&&(l=Math.min(o,l)),l},set:function(o){this._nextAutoLevel=o}}]),d}();z.default=c},"./src/controller/audio-stream-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/controller/base-stream-controller.ts"),D=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),F=N("./src/controller/fragment-tracker.ts"),k=N("./src/types/level.ts"),T=N("./src/types/loader.ts"),v=N("./src/loader/fragment.ts"),m=N("./src/demux/chunk-cache.ts"),c=N("./src/demux/transmuxer-interface.ts"),d=N("./src/types/transmuxer.ts"),r=N("./src/controller/fragment-finders.ts"),s=N("./src/utils/discontinuities.ts"),o=N("./src/errors.ts"),a=N("./src/utils/logger.ts");function l(){return l=Object.assign||function(O){for(var S=1;S<arguments.length;S++){var _=arguments[S];for(var g in _)Object.prototype.hasOwnProperty.call(_,g)&&(O[g]=_[g])}return O},l.apply(this,arguments)}function h(O,S){O.prototype=Object.create(S.prototype),O.prototype.constructor=O,I(O,S)}function I(O,S){return I=Object.setPrototypeOf||function(g,f){return g.__proto__=f,g},I(O,S)}var w=100,x=function(O){h(S,O);function S(g,f){var u;return u=O.call(this,g,f,"[audio-stream-controller]")||this,u.videoBuffer=null,u.videoTrackCC=-1,u.waitingVideoCC=-1,u.audioSwitch=!1,u.trackId=-1,u.waitingData=null,u.mainDetails=null,u.bufferFlushed=!1,u._registerListeners(),u}var _=S.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var f=this.hls;f.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(D.Events.ERROR,this.onError,this),f.on(D.Events.BUFFER_RESET,this.onBufferReset,this),f.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var f=this.hls;f.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(D.Events.ERROR,this.onError,this),f.off(D.Events.BUFFER_RESET,this.onBufferReset,this),f.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(f,u){var E=u.frag,b=u.id,y=u.initPTS;if(b==="main"){var P=E.cc;this.initPTS[E.cc]=y,this.log("InitPTS for cc: "+P+" found from main: "+y),this.videoTrackCC=P,this.state===W.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=W.State.STOPPED;return}var u=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,u>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=W.State.IDLE):(this.loadedmetadata=!1,this.state=W.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},_.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_TRACK:{var f,u=this.levels,E=this.trackId,b=u==null||((f=u[E])===null||f===void 0)?void 0:f.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=W.State.WAITING_INIT_PTS}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var y,P=performance.now(),R=this.retryDate;(!R||P>=R||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=W.State.IDLE);break}case W.State.WAITING_INIT_PTS:{var U=this.waitingData;if(U){var L=U.frag,j=U.part,A=U.cache,X=U.complete;if(this.initPTS[L.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.FRAG_LOADING;var ee=A.flush(),se={frag:L,part:j,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(se),X&&O.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+L.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ce=this.getLoadPosition(),Le=H.BufferHelper.bufferInfo(this.mediaBuffer,ce,this.config.maxBufferHole),Ce=Object(r.fragmentWithinToleranceTest)(Le.end,this.config.maxFragLookUpTolerance,L);Ce<0&&(a.logger.log("Waiting fragment cc ("+L.cc+") @ "+L.start+" cancelled because another fragment at "+Le.end+" is needed"),this.clearWaitingFragment())}}else this.state=W.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.IDLE)},_.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:f,E=u.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},_.doTickIdle=function(){var f,u,E=this.hls,b=this.levels,y=this.media,P=this.trackId,R=E.config;if(!b||!b[P])return;if(!y&&(this.startFragRequested||!R.startFragPrefetch))return;var U=b[P],L=U.details;if(!L||L.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(L)){this.state=W.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,T.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,T.PlaylistLevelType.AUDIO);if(j===null)return;var A=j.len,X=this.getMaxBufferLength(),ee=this.audioSwitch;if(A>=X&&!ee)return;if(!ee&&this._streamEnded(j,L)){E.trigger(D.Events.BUFFER_EOS,{type:"audio"}),this.state=W.State.ENDED;return}var se=L.fragments,ce=se[0].start,Le=j.end;if(ee){var Ce=this.getLoadPosition();Le=Ce,L.PTSKnown&&Ce<ce&&((j.end>ce||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=ce+.05))}var Ae=this.getNextFragment(Le,L);if(!Ae){this.bufferFlushed=!0;return}((f=Ae.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((u=Ae.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(Ae,L):this.loadFragment(Ae,L,Le)},_.getMaxBufferLength=function(){var f=O.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,T.PlaylistLevelType.MAIN);return u===null?f:Math.max(f,u.len)},_.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(f,u){var E=u.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(b){return new k.Level(b)})},_.onAudioTrackSwitching=function(f,u){var E=!!u.url;this.trackId=u.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(w):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=W.State.IDLE):this.state=W.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(f,u){this.mainDetails=u.details},_.onAudioTrackLoaded=function(f,u){var E,b=this.levels,y=u.details,P=u.id;if(!b){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var R=b[P],U=0;if(y.live||(E=R.details)!==null&&E!==void 0&&E.live){var L=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!L)return;!R.details&&y.hasProgramDateTime&&L.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(y,L),U=y.fragments[0].start):U=this.alignPlaylists(y,R.details)}R.details=y,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(R.details,U),this.state===W.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=W.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(f){var u,E=f.frag,b=f.part,y=f.payload,P=this.config,R=this.trackId,U=this.levels;if(!U){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var L=U[R];console.assert(L,"Audio track is defined on fragment load progress");var j=L.details;console.assert(j,"Audio track details are defined on fragment load progress");var A=P.defaultAudioCodec||L.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new c.default(this.hls,T.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[E.cc],se=(u=E.initSegment)===null||u===void 0?void 0:u.data;if(ee!==void 0){var ce=!1,Le=b?b.index:-1,Ce=Le!==-1,Ae=new d.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,y.byteLength,Le,Ce);X.push(y,se,A,"",E,b,j.totalduration,ce,Ae,ee)}else{a.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+R);var Pe=this.waitingData=this.waitingData||{frag:E,part:b,cache:new m.default,complete:!1},Ie=Pe.cache;Ie.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=W.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,f)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(f,u){var E=u.tracks.audio;E&&(this.mediaBuffer=E.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},_.onFragBuffered=function(f,u){var E=u.frag,b=u.part;if(E.type!==T.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(b?" p: "+b.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,b)},_.onError=function(f,u){switch(u.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:this.onFragmentOrKeyLoadError(T.PlaylistLevelType.AUDIO,u);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==W.State.ERROR&&this.state!==W.State.STOPPED&&(this.state=u.fatal?W.State.ERROR:W.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var E=!0,b=this.getFwdBufferInfo(this.mediaBuffer,T.PlaylistLevelType.AUDIO);b&&b.len>.5&&(E=!this.reduceMaxBufferLength(b.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(f,u){var E=u.type;E===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(f){var u,E="audio",b=this.hls,y=f.remuxResult,P=f.chunkMeta,R=this.getCurrentContext(P);if(!R){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var U=R.frag,L=R.part,j=y.audio,A=y.text,X=y.id3,ee=y.initSegment;if(this.fragContextChanged(U))return;if(this.state=W.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,U,P),b.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:E,tracks:ee.tracks})),j){var se=j.startPTS,ce=j.endPTS,Le=j.startDTS,Ce=j.endDTS;L&&(L.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:ce,startDTS:Le,endDTS:Ce}),U.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,se,ce,Le,Ce),this.bufferFragmentData(j,U,L,P)}if(X!=null&&(u=X.samples)!==null&&u!==void 0&&u.length){var Ae=l({frag:U,id:E},X);b.trigger(D.Events.FRAG_PARSING_METADATA,Ae)}if(A){var Pe=l({frag:U,id:E},A);b.trigger(D.Events.FRAG_PARSING_USERDATA,Pe)}},_._bufferInitSegment=function(f,u,E){if(this.state!==W.State.PARSING)return;f.video&&delete f.video;var b=f.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(D.Events.BUFFER_CODECS,f);var y=b.initSegment;if(y!=null&&y.byteLength){var P={type:"audio",frag:u,part:null,chunkMeta:E,parent:u.type,data:y};this.hls.trigger(D.Events.BUFFER_APPENDING,P)}this.tick()},_.loadFragment=function(f,u,E){var b=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||b===F.FragmentState.NOT_LOADED||b===F.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):u.live&&!Object(V.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=W.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,f,u,E)))},_.completeAudioSwitch=function(){var f=this.hls,u=this.media,E=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:E})},S}(W.default);z.default=x},"./src/controller/audio-track-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/errors.ts"),D=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function F(c,d){for(var r=0;r<d.length;r++){var s=d[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function k(c,d,r){return d&&F(c.prototype,d),r&&F(c,r),c}function T(c,d){c.prototype=Object.create(d.prototype),c.prototype.constructor=c,v(c,d)}function v(c,d){return v=Object.setPrototypeOf||function(s,o){return s.__proto__=o,s},v(c,d)}var m=function(c){T(d,c);function d(s){var o;return o=c.call(this,s,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var r=d.prototype;return r.registerListeners=function(){var o=this.hls;o.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(V.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var o=this.hls;o.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(V.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,c.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(o,a){this.tracks=a.audioTracks||[]},r.onAudioTrackLoaded=function(o,a){var l=a.id,h=a.details,I=this.tracksInGroup[l];if(!I){this.warn("Invalid audio track id "+l);return}var w=I.details;I.details=a.details,this.log("audioTrack "+l+" loaded ["+h.startSN+"-"+h.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,a,w))},r.onLevelLoading=function(o,a){this.switchLevel(a.level)},r.onLevelSwitching=function(o,a){this.switchLevel(a.level)},r.switchLevel=function(o){var a=this.hls.levels[o];if(!(a!=null&&a.audioGroupIds))return;var l=a.audioGroupIds[a.urlId];if(this.groupId!==l){this.groupId=l;var h=this.tracks.filter(function(w){return!l||w.groupId===l});this.selectDefaultTrack&&!h.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=h;var I={audioTracks:h};this.log("Updating audio tracks, "+h.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,I),this.selectInitialTrack()}},r.onError=function(o,a){if(c.prototype.onError.call(this,o,a),a.fatal||!a.context)return;a.context.type===H.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},r.setAudioTrack=function(o){var a=this.tracksInGroup;if(o<0||o>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=a[this.trackId];this.log("Now switching to audio-track index "+o);var h=a[o],I=h.id,w=h.groupId,x=w===void 0?"":w,O=h.name,S=h.type,_=h.url;if(this.trackId=o,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:I,groupId:x,name:O,type:S,url:_}),h.details&&!h.details.live)return;var g=this.switchParams(h.url,l==null?void 0:l.details);this.loadPlaylist(g)},r.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,l=this.findTrackId(a)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(o){for(var a=this.tracksInGroup,l=0;l<a.length;l++){var h=a[l];if((!this.selectDefaultTrack||h.default)&&(!o||o===h.name))return h.id}return-1},r.loadPlaylist=function(o){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var l=a.id,h=a.groupId,I=a.url;if(o)try{I=o.addDirectives(I)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:I,id:l,groupId:h,deliveryDirectives:o||null})}},k(d,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),d}(D.default);z.default=m},"./src/controller/base-playlist-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return k});var V=N("./src/polyfills/number.ts"),W=N("./src/types/level.ts"),D=N("./src/controller/level-helper.ts"),H=N("./src/utils/logger.ts"),F=N("./src/errors.ts"),k=function(){function T(m,c){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,c+":"),this.warn=H.logger.warn.bind(H.logger,c+":"),this.hls=m}var v=T.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(c,d){d.fatal&&d.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(c,d){var r=d==null?void 0:d.renditionReports;if(r)for(var s=0;s<r.length;s++){var o=r[s],a=""+o.URI;if(a===c.substr(-a.length)){var l=parseInt(o["LAST-MSN"]),h=parseInt(o["LAST-PART"]);if(d&&this.hls.config.lowLatencyMode){var I=Math.min(d.age-d.partTarget,d.targetduration);h!==void 0&&I>d.partTarget&&(h+=1)}if(Object(V.isFiniteNumber)(l))return new W.HlsUrlParameters(l,Object(V.isFiniteNumber)(h)?h:void 0,W.HlsSkip.No)}}},v.loadPlaylist=function(c){},v.shouldLoadTrack=function(c){return this.canLoad&&c&&!!c.url&&(!c.details||c.details.live)},v.playlistLoaded=function(c,d,r){var s=this,o=d.details,a=d.stats,l=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(o.advancedDateTime=Date.now()-l,o.live||r!=null&&r.live){if(o.reloaded(r),r&&this.log("live playlist "+c+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),r&&o.fragments.length>0&&Object(D.mergeDetails)(r,o),!this.canLoad||!o.live)return;var h,I=void 0,w=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var x=this.hls.config.lowLatencyMode,O=o.lastPartSn,S=o.endSN,_=o.lastPartIndex,g=_!==-1,f=O===S,u=x?0:_;g?(I=f?S+1:O,w=f?u:_+1):I=S+1;var E=o.age,b=E+o.ageHeader,y=Math.min(b-o.partTarget,o.targetduration*1.5);if(y>0){if(r&&y>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+y+" with playlist age: "+o.age),y=0;else{var P=Math.floor(y/o.targetduration);if(I+=P,w!==void 0){var R=Math.round(y%o.targetduration/o.partTarget);w+=R}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+y+" skip sn "+P+" to part "+w)}o.tuneInGoal=y}if(h=this.getDeliveryDirectives(o,d.deliveryDirectives,I,w),x||!f){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(o,d.deliveryDirectives,I,w);var U=Object(D.computeReloadInterval)(o,a);I!==void 0&&o.canBlockReload&&(U-=o.partTarget||1),this.log("reload live playlist "+c+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(h)},U)}else this.clearTimer()},v.getDeliveryDirectives=function(c,d,r,s){var o=Object(W.getSkipValue)(c,r);return d!=null&&d.skip&&c.deltaUpdateFailed&&(r=d.msn,s=d.part,o=W.HlsSkip.No),new W.HlsUrlParameters(r,s,o)},v.retryLoadingOrFail=function(c){var d=this,r=this.hls.config,s=this.retryCount<r.levelLoadingMaxRetry;if(s){var o;if(this.retryCount++,c.details.indexOf("LoadTimeOut")>-1&&(o=c.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+c.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+c.details+'"')}}else this.warn('cannot recover from error "'+c.details+'"'),this.clearTimer(),c.fatal=!0;return s},T}()},"./src/controller/base-stream-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"State",function(){return S}),N.d(z,"default",function(){return _});var V=N("./src/polyfills/number.ts"),W=N("./src/task-loop.ts"),D=N("./src/controller/fragment-tracker.ts"),H=N("./src/utils/buffer-helper.ts"),F=N("./src/utils/logger.ts"),k=N("./src/events.ts"),T=N("./src/errors.ts"),v=N("./src/types/transmuxer.ts"),m=N("./src/utils/mp4-tools.ts"),c=N("./src/utils/discontinuities.ts"),d=N("./src/controller/fragment-finders.ts"),r=N("./src/controller/level-helper.ts"),s=N("./src/loader/fragment-loader.ts"),o=N("./src/crypt/decrypter.ts"),a=N("./src/utils/time-ranges.ts"),l=N("./src/types/loader.ts");function h(g,f){for(var u=0;u<f.length;u++){var E=f[u];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(g,E.key,E)}}function I(g,f,u){return f&&h(g.prototype,f),u&&h(g,u),g}function w(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function x(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,O(g,f)}function O(g,f){return O=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},O(g,f)}var S={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"},_=function(g){x(f,g);function f(E,b,y){var P;return P=g.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=S.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=y,P.log=F.logger.log.bind(F.logger,y+":"),P.warn=F.logger.warn.bind(F.logger,y+":"),P.hls=E,P.fragmentLoader=new s.default(E.config),P.fragmentTracker=b,P.config=E.config,P.decrypter=new o.default(E,E.config),E.on(k.Events.KEY_LOADED,P.onKeyLoaded,w(P)),P}var u=f.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(b){},u.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=S.STOPPED},u._streamEnded=function(b,y){var P=this.fragCurrent,R=this.fragmentTracker;if(!y.live&&P&&P.sn===y.endSN&&!b.nextStart){var U=R.getState(P);return U===D.FragmentState.PARTIAL||U===D.FragmentState.OK}return!1},u.onMediaAttached=function(b,y){var P=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var R=this.config;this.levels&&R.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(R.startPosition)},u.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()},u.onMediaSeeking=function(){var b=this.config,y=this.fragCurrent,P=this.media,R=this.mediaBuffer,U=this.state,L=P?P.currentTime:0,j=H.BufferHelper.bufferInfo(R||P,L,b.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(L)?L.toFixed(3):L)+", state: "+U),U===S.ENDED)this.resetLoadingState();else if(y&&!j.len){var A=b.maxFragLookUpTolerance,X=y.start-A,ee=y.start+y.duration+A,se=L>ee;(L<X||se)&&(se&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=L),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=L),this.tickImmediate()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onKeyLoaded=function(b,y){if(this.state!==S.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var P=this.levels[y.frag.level].details;P&&this.loadFragment(y.frag,P,y.frag.start)},u.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(k.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,g.prototype.onHandlerDestroyed.call(this)},u.loadKey=function(b,y){this.log("Loading key for "+b.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=S.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(k.Events.KEY_LOADING,{frag:b})},u.loadFragment=function(b,y,P){this._loadFragForPlayback(b,y,P)},u._loadFragForPlayback=function(b,y,P){var R=this,U=function(j){if(R.fragContextChanged(b)){R.warn("Fragment "+b.sn+(j.part?" p: "+j.part.index:"")+" of level "+b.level+" was dropped during download."),R.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,R._handleFragmentLoadProgress(j)};this._doFragLoad(b,y,P,U).then(function(L){if(!L)return;R.fragLoadError=0;var j=R.state;if(R.fragContextChanged(b)){(j===S.FRAG_LOADING||j===S.BACKTRACKING||!R.fragCurrent&&j===S.PARSING)&&(R.fragmentTracker.removeFragment(b),R.state=S.IDLE);return}if("payload"in L&&(R.log("Loaded fragment "+b.sn+" of level "+b.level),R.hls.trigger(k.Events.FRAG_LOADED,L),R.state===S.BACKTRACKING)){R.fragmentTracker.backtrack(b,L),R.resetFragmentLoading(b);return}R._handleFragmentLoadComplete(L)}).catch(function(L){R.warn(L),R.resetFragmentLoading(b)})},u.flushMainBuffer=function(b,y,P){if(P===void 0&&(P=null),!(b-y))return;var R={startOffset:b,endOffset:y,type:P};this.fragLoadError=0,this.hls.trigger(k.Events.BUFFER_FLUSHING,R)},u._loadInitSegment=function(b){var y=this;this._doFragLoad(b).then(function(P){if(!P||y.fragContextChanged(b)||!y.levels)throw new Error("init load aborted");return P}).then(function(P){var R=y.hls,U=P.payload,L=b.decryptdata;if(U&&U.byteLength>0&&L&&L.key&&L.iv&&L.method==="AES-128"){var j=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(U),L.key.buffer,L.iv.buffer).then(function(A){var X=self.performance.now();return R.trigger(k.Events.FRAG_DECRYPTED,{frag:b,payload:A,stats:{tstart:j,tdecrypt:X}}),P.payload=A,P})}return P}).then(function(P){var R=y.fragCurrent,U=y.hls,L=y.levels;if(!L)throw new Error("init load aborted, missing levels");var j=L[b.level].details;console.assert(j,"Level details are defined when init segment is loaded");var A=b.stats;y.state=S.IDLE,y.fragLoadError=0,b.data=new Uint8Array(P.payload),A.parsing.start=A.buffering.start=self.performance.now(),A.parsing.end=A.buffering.end=self.performance.now(),P.frag===R&&U.trigger(k.Events.FRAG_BUFFERED,{stats:A,frag:R,part:null,id:b.type}),y.tick()}).catch(function(P){y.warn(P),y.resetFragmentLoading(b)})},u.fragContextChanged=function(b){var y=this.fragCurrent;return!b||!y||b.level!==y.level||b.sn!==y.sn||b.urlId!==y.urlId},u.fragBufferedComplete=function(b,y){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+a.default.toString(H.BufferHelper.getBuffered(P))),this.state=S.IDLE,this.tick()},u._handleFragmentLoadComplete=function(b){var y=this.transmuxer;if(!y)return;var P=b.frag,R=b.part,U=b.partsLoaded,L=!U||U.length===0||U.some(function(A){return!A}),j=new v.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,R?R.index:-1,!L);y.flush(j)},u._handleFragmentLoadProgress=function(b){},u._doFragLoad=function(b,y,P,R){var U=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(b.start,P||0),this.config.lowLatencyMode&&y){var L=y.partList;if(L&&R){P>b.end&&y.fragmentHint&&(b=y.fragmentHint);var j=this.getNextPart(L,b,P);if(j>-1){var A=L[j];return this.log("Loading part sn: "+b.sn+" p: "+A.index+" cc: "+b.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+j+"-"+(L.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=A.start+A.duration,this.state=S.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:b,part:L[j],targetBufferTime:P}),this.doFragPartsLoad(b,L,j,R).catch(function(X){return U.handleFragLoadError(X)})}else if(!b.url||this.loadedEndOfParts(L,P))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(P.toFixed(3))),Object(V.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=S.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:b,targetBufferTime:P}),this.fragmentLoader.load(b,R).catch(function(X){return U.handleFragLoadError(X)})},u.doFragPartsLoad=function(b,y,P,R){var U=this;return new Promise(function(L,j){var A=[],X=function ee(se){var ce=y[se];U.fragmentLoader.loadPart(b,ce,R).then(function(Le){A[ce.index]=Le;var Ce=Le.part;U.hls.trigger(k.Events.FRAG_LOADED,Le);var Ae=y[se+1];if(Ae&&Ae.fragment===b)ee(se+1);else return L({frag:b,part:Ce,partsLoaded:A})}).catch(j)};X(P)})},u.handleFragLoadError=function(b){var y=b.data;return y&&y.details===T.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(k.Events.ERROR,y),null},u._handleTransmuxerFlush=function(b){var y=this.getCurrentContext(b);if(!y||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var P=y.frag,R=y.part,U=y.level,L=self.performance.now();P.stats.parsing.end=L,R&&(R.stats.parsing.end=L),this.updateLevelTiming(P,R,U,b.partial)},u.getCurrentContext=function(b){var y=this.levels,P=b.level,R=b.sn,U=b.part;if(!y||!y[P])return this.warn("Levels object was unset while buffering fragment "+R+" of level "+P+". The current chunk will not be buffered."),null;var L=y[P],j=U>-1?Object(r.getPartWith)(L,R,U):null,A=j?j.fragment:Object(r.getFragmentWithSN)(L,R,this.fragCurrent);return A?{frag:A,part:j,level:L}:null},u.bufferFragmentData=function(b,y,P,R){if(!b||this.state!==S.PARSING)return;var U=b.data1,L=b.data2,j=U;if(U&&L&&(j=Object(m.appendUint8Array)(U,L)),!j||!j.length)return;var A={type:b.type,frag:y,part:P,chunkMeta:R,parent:y.type,data:j};this.hls.trigger(k.Events.BUFFER_APPENDING,A),b.dropped&&b.independent&&!P&&this.flushBufferGap(y)},u.flushBufferGap=function(b){var y=this.media;if(!y)return;if(!H.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,b.start);return}var P=y.currentTime,R=H.BufferHelper.bufferInfo(y,P,0),U=b.duration,L=Math.min(this.config.maxFragLookUpTolerance*2,U*.25),j=Math.max(Math.min(b.start-L,R.end-L),P+L);b.start-j>L&&this.flushMainBuffer(j,b.start)},u.getFwdBufferInfo=function(b,y){var P=this.config,R=this.getLoadPosition();if(!Object(V.isFiniteNumber)(R))return null;var U=H.BufferHelper.bufferInfo(b,R,P.maxBufferHole);if(U.len===0&&U.nextStart!==void 0){var L=this.fragmentTracker.getBufferedFrag(R,y);if(L&&U.nextStart<L.end)return H.BufferHelper.bufferInfo(b,R,Math.max(U.nextStart,P.maxBufferHole))}return U},u.getMaxBufferLength=function(b){var y=this.config,P;return b?P=Math.max(8*y.maxBufferSize/b,y.maxBufferLength):P=y.maxBufferLength,Math.min(P,y.maxMaxBufferLength)},u.reduceMaxBufferLength=function(b){var y=this.config,P=b||y.maxBufferLength;return y.maxMaxBufferLength>=P?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(b,y){var P,R,U=y.fragments,L=U.length;if(!L)return null;var j=this.config,A=U[0].start,X;if(y.live){var ee=j.initialLiveManifestSize;if(L<ee)return this.warn("Not enough fragments to start playback (have: "+L+", need: "+ee+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(y,U),this.startPosition=X?this.hls.liveSyncPosition||X.start:b)}else b<=A&&(X=U[0]);if(!X){var se=j.lowLatencyMode?y.partEnd:y.fragmentEnd;X=this.getFragmentAtPosition(b,se,y)}return(P=X)!==null&&P!==void 0&&P.initSegment&&!((R=X)!==null&&R!==void 0&&R.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},u.getNextPart=function(b,y,P){for(var R=-1,U=!1,L=!0,j=0,A=b.length;j<A;j++){var X=b[j];if(L=L&&!X.independent,R>-1&&P<X.start)break;var ee=X.loaded;!ee&&(U||X.independent||L)&&X.fragment===y&&(R=j),U=ee}return R},u.loadedEndOfParts=function(b,y){var P=b[b.length-1];return P&&y>P.start&&P.loaded},u.getInitialLiveFragment=function(b,y){var P=this.fragPrevious,R=null;if(P){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),R=Object(d.findFragmentByPDT)(y,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!R){var U=P.sn+1;if(U>=b.startSN&&U<=b.endSN){var L=y[U-b.startSN];P.cc===L.cc&&(R=L,this.log("Live playlist, switching playlist, load frag with next SN: "+R.sn))}R||(R=Object(d.findFragWithCC)(y,P.cc),R&&this.log("Live playlist, switching playlist, load frag with same CC: "+R.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(R=this.getFragmentAtPosition(j,this.bitrateTest?b.fragmentEnd:b.edge,b))}return R},u.getFragmentAtPosition=function(b,y,P){var R=this.config,U=this.fragPrevious,L=P.fragments,j=P.endSN,A=P.fragmentHint,X=R.maxFragLookUpTolerance,ee=!!(R.lowLatencyMode&&P.partList&&A);ee&&A&&!this.bitrateTest&&(L=L.concat(A),j=A.sn);var se;if(b<y){var ce=b>y-X?0:X;se=Object(d.findFragmentByPTS)(U,L,b,ce)}else se=L[L.length-1];if(se){var Le=se.sn-P.startSN,Ce=U&&se.level===U.level,Ae=L[Le+1],Pe=this.fragmentTracker.getState(se);if(Pe===D.FragmentState.BACKTRACKED){se=null;for(var Ie=Le;L[Ie]&&this.fragmentTracker.getState(L[Ie])===D.FragmentState.BACKTRACKED;)U?se=L[Ie--]:se=L[--Ie];se||(se=Ae)}else U&&se.sn===U.sn&&!ee&&(Ce&&(se.sn<j&&this.fragmentTracker.getState(Ae)!==D.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+Ae.sn),se=Ae):se=null))}return se},u.synchronizeToLiveEdge=function(b){var y=this.config,P=this.media;if(!P)return;var R=this.hls.liveSyncPosition,U=P.currentTime,L=b.fragments[0].start,j=b.edge,A=U>=L-y.maxFragLookUpTolerance&&U<=j;if(R!==null&&P.duration>R&&(U<R||!A)){var X=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*b.targetduration;(!A&&P.readyState<4||U<j-X)&&(this.loadedmetadata||(this.nextLoadPosition=R),P.readyState&&(this.warn("Playback: "+U.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+R.toFixed(3)),P.currentTime=R))}},u.alignPlaylists=function(b,y){var P=this.levels,R=this.levelLastLoaded,U=this.fragPrevious,L=R!==null?P[R]:null,j=b.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var A=b.fragments[0].start,X=!y,ee=b.alignedSliding&&Object(V.isFiniteNumber)(A);if(X||!ee&&!A){Object(c.alignStream)(U,L,b);var se=b.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+b.startSN+" prev-sn: "+(U?U.sn:"na")+" fragments: "+j),se}return A},u.waitForCdnTuneIn=function(b){var y=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*y)},u.setStartPosition=function(b,y){var P=this.startPosition;if(P<y&&(P=-1),P===-1||this.lastCurrentTime===-1){var R=b.startTimeOffset;Object(V.isFiniteNumber)(R)?(P=y+R,R<0&&(P+=b.totalduration),P=Math.min(Math.max(y,P),y+b.totalduration),this.log("Start time offset "+R+" found in playlist, adjust startPosition to "+P),this.startPosition=P):b.live?P=this.hls.liveSyncPosition||y:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},u.getLoadPosition=function(){var b=this.media,y=0;return this.loadedmetadata&&b?y=b.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},u.handleFragLoadAborted=function(b,y){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(y?" part"+y.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},u.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=S.IDLE)},u.onFragmentOrKeyLoadError=function(b,y){if(y.fatal)return;var P=y.frag;if(!P||P.type!==b)return;var R=this.fragCurrent;console.assert(R&&P.sn===R.sn&&P.level===R.level&&P.urlId===R.urlId,"Frag load error must match current frag to retry");var U=this.config;if(this.fragLoadError+1<=U.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var L=Math.min(Math.pow(2,this.fragLoadError)*U.fragLoadingRetryDelay,U.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+b+" "+P.level+" failed to load, retrying in "+L+"ms"),this.retryDate=self.performance.now()+L,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(b===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(F.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},u.afterBufferFlushed=function(b,y,P){if(!b)return;var R=H.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(y,R,P),this.state===S.ENDED&&this.resetLoadingState()},u.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},u.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[b].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},u.updateLevelTiming=function(b,y,P,R){var U=this,L=P.details;console.assert(!!L,"level.details must be defined");var j=Object.keys(b.elementaryStreams).reduce(function(A,X){var ee=b.elementaryStreams[X];if(ee){var se=ee.endPTS-ee.startPTS;if(se<=0)return U.warn("Could not parse fragment "+b.sn+" "+X+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),U.resetTransmuxer(),A||!1;var ce=R?0:Object(r.updateFragPTSDTS)(L,b,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return U.hls.trigger(k.Events.LEVEL_PTS_UPDATED,{details:L,level:P,drift:ce,type:X,frag:b,start:ee.startPTS,end:ee.endPTS}),!0}return A},!1);j?(this.state=S.PARSED,this.hls.trigger(k.Events.FRAG_PARSED,{frag:b,part:y})):this.resetLoadingState()},u.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},I(f,[{key:"state",get:function(){return this._state},set:function(b){var y=this._state;y!==b&&(this._state=b,this.log(y+"->"+b))}}]),f}(W.default)},"./src/controller/buffer-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return d});var V=N("./src/polyfills/number.ts"),W=N("./src/events.ts"),D=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),F=N("./src/utils/buffer-helper.ts"),k=N("./src/utils/mediasource-helper.ts"),T=N("./src/loader/fragment.ts"),v=N("./src/controller/buffer-operation-queue.ts"),m=Object(k.getMediaSource)(),c=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function r(o){var a=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 l=a.hls,h=a.media,I=a.mediaSource;D.logger.log("[buffer-controller]: Media source opened"),h&&(a.updateMediaElementDuration(),l.trigger(W.Events.MEDIA_ATTACHED,{media:h})),I&&I.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){D.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){D.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var s=r.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var a=this.hls;a.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(W.Events.BUFFER_RESET,this.onBufferReset,this),a.on(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(W.Events.BUFFER_EOS,this.onBufferEos,this),a.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(W.Events.FRAG_PARSED,this.onFragParsed,this),a.on(W.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var a=this.hls;a.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(W.Events.BUFFER_RESET,this.onBufferReset,this),a.off(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(W.Events.BUFFER_EOS,this.onBufferEos,this),a.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(W.Events.FRAG_PARSED,this.onFragParsed,this),a.off(W.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(a,l){var h=2;(l.audio&&!l.video||!l.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,D.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(a,l){var h=this.media=l.media;if(h&&m){var I=this.mediaSource=new m;I.addEventListener("sourceopen",this._onMediaSourceOpen),I.addEventListener("sourceended",this._onMediaSourceEnded),I.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(I),this._objectUrl=h.src}},s.onMediaDetaching=function(){var a=this.media,l=this.mediaSource,h=this._objectUrl;if(l){if(D.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(I){D.logger.warn("[buffer-controller]: onMediaDetaching: "+I.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(h&&self.URL.revokeObjectURL(h),a.src===h?(a.removeAttribute("src"),a.load()):D.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(W.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(l){var h=a.sourceBuffer[l];try{h&&(a.removeBufferListeners(l),a.mediaSource&&a.mediaSource.removeSourceBuffer(h),a.sourceBuffer[l]=void 0)}catch(I){D.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",I)}}),this._initSourceBuffer()},s.onBufferCodecs=function(a,l){var h=this,I=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(w){if(I){var x=h.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var O=l[w],S=O.codec,_=O.levelCodec,g=O.container,f=(x.levelCodec||x.codec).replace(c,"$1"),u=(_||S).replace(c,"$1");if(f!==u){var E=g+";codecs="+(_||S);h.appendChangeType(w,E)}}}else h.pendingTracks[w]=l[w]}),I)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(a,l){var h=this,I=this.operationQueue,w={execute:function(){var O=h.sourceBuffer[a];O&&(D.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+l),O.changeType(l)),I.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(O){D.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",O)}};I.append(w,a)},s.onBufferAppending=function(a,l){var h=this,I=this.hls,w=this.operationQueue,x=this.tracks,O=l.data,S=l.type,_=l.frag,g=l.part,f=l.chunkMeta,u=f.buffering[S],E=self.performance.now();u.start=E;var b=_.stats.buffering,y=g?g.stats.buffering:null;b.start===0&&(b.start=E),y&&y.start===0&&(y.start=E);var P=x.audio,R=S==="audio"&&f.id===1&&(P==null?void 0:P.container)==="audio/mpeg",U={execute:function(){if(u.executeStart=self.performance.now(),R){var j=h.sourceBuffer[S];if(j){var A=_.start-j.timestampOffset;Math.abs(A)>=.1&&(D.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+A+") sn: "+_.sn+")"),j.timestampOffset=_.start)}}h.appendExecutor(O,S)},onStart:function(){},onComplete:function(){var j=self.performance.now();u.executeEnd=u.end=j,b.first===0&&(b.first=j),y&&y.first===0&&(y.first=j);var A=h.sourceBuffer,X={};for(var ee in A)X[ee]=F.BufferHelper.getBuffered(A[ee]);h.appendError=0,h.hls.trigger(W.Events.BUFFER_APPENDED,{type:S,frag:_,part:g,chunkMeta:f,parent:_.type,timeRanges:X})},onError:function(j){D.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",j);var A={type:H.ErrorTypes.MEDIA_ERROR,parent:_.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?A.details=H.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,A.details=H.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>I.config.appendErrorMaxRetry&&(D.logger.error("[buffer-controller]: Failed "+I.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),A.fatal=!0)),I.trigger(W.Events.ERROR,A)}};w.append(U,S)},s.onBufferFlushing=function(a,l){var h=this,I=this.operationQueue,w=function(O){return{execute:h.removeExecutor.bind(h,O,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(W.Events.BUFFER_FLUSHED,{type:O})},onError:function(_){D.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",_)}}};l.type?I.append(w(l.type),l.type):this.getSourceBufferTypes().forEach(function(x){I.append(w(x),x)})},s.onFragParsed=function(a,l){var h=this,I=l.frag,w=l.part,x=[],O=w?w.elementaryStreams:I.elementaryStreams;O[T.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(O[T.ElementaryStreamTypes.AUDIO]&&x.push("audio"),O[T.ElementaryStreamTypes.VIDEO]&&x.push("video"));var S=function(){var g=self.performance.now();I.stats.buffering.end=g,w&&(w.stats.buffering.end=g);var f=w?w.stats:I.stats;h.hls.trigger(W.Events.FRAG_BUFFERED,{frag:I,part:w,stats:f,id:I.type})};x.length===0&&D.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+I.type+" level: "+I.level+" sn: "+I.sn),this.blockBuffers(S,x)},s.onFragChanged=function(a,l){this.flushBackBuffer()},s.onBufferEos=function(a,l){var h=this,I=this.getSourceBufferTypes().reduce(function(w,x){var O=h.sourceBuffer[x];return(!l.type||l.type===x)&&(O&&!O.ended&&(O.ended=!0,D.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!O||O.ended)},!0);I&&this.blockBuffers(function(){var w=h.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},s.onLevelUpdated=function(a,l){var h=l.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var a=this.hls,l=this.details,h=this.media,I=this.sourceBuffer;if(!h||l===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var x=l.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(V.isFiniteNumber)(x)||x<0)return;var O=h.currentTime,S=l.levelTargetDuration,_=Math.max(x,S),g=Math.floor(O/S)*S-_;w.forEach(function(f){var u=I[f];if(u){var E=F.BufferHelper.getBuffered(u);E.length>0&&g>E.start(0)&&(a.trigger(W.Events.BACK_BUFFER_REACHED,{bufferEnd:g}),l.live&&a.trigger(W.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:g}),a.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:g,type:f}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,l=this.hls,h=this.media,I=this.mediaSource,w=a.fragments[0].start+a.totalduration,x=h.duration,O=Object(V.isFiniteNumber)(I.duration)?I.duration:0;a.live&&l.config.liveDurationInfinity?(D.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),I.duration=Infinity,this.updateSeekableRange(a)):(w>O&&w>x||!Object(V.isFiniteNumber)(x))&&(D.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),I.duration=w)},s.updateSeekableRange=function(a){var l=this.mediaSource,h=a.fragments,I=h.length;if(I&&a.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var w=Math.max(0,h[0].start),x=Math.max(w,w+a.totalduration);l.setLiveSeekableRange(w,x)}},s.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,l=this.operationQueue,h=this.pendingTracks,I=Object.keys(h).length;if(I&&!a||I===2){this.createSourceBuffers(h),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(W.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(x){l.executeNext(x)})}},s.createSourceBuffers=function(a){var l=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var I=0;for(var w in a)if(!l[w]){var x=a[w];if(!x)throw Error("source buffer exists for track "+w+", however track does not");var O=x.levelCodec||x.codec,S=x.container+";codecs="+O;D.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var _=l[w]=h.addSourceBuffer(S),g=w;this.addBufferListener(g,"updatestart",this._onSBUpdateStart),this.addBufferListener(g,"updateend",this._onSBUpdateEnd),this.addBufferListener(g,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:O,container:x.container,levelCodec:x.levelCodec,id:x.id},I++}catch(f){D.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(W.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:S})}}I&&this.hls.trigger(W.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(a){var l=this.operationQueue,h=l.current(a);h.onStart()},s._onSBUpdateEnd=function(a){var l=this.operationQueue,h=l.current(a);h.onComplete(),l.shiftAndExecuteNext(a)},s._onSBUpdateError=function(a,l){D.logger.error("[buffer-controller]: "+a+" SourceBuffer error",l),this.hls.trigger(W.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(a);h&&h.onError(l)},s.removeExecutor=function(a,l,h){var I=this.media,w=this.mediaSource,x=this.operationQueue,O=this.sourceBuffer,S=O[a];if(!I||!w||!S){D.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(a);return}var _=Object(V.isFiniteNumber)(I.duration)?I.duration:Infinity,g=Object(V.isFiniteNumber)(w.duration)?w.duration:Infinity,f=Math.max(0,l),u=Math.min(h,_,g);u>f?(D.logger.log("[buffer-controller]: Removing ["+f+","+u+"] from the "+a+" SourceBuffer"),console.assert(!S.updating,a+" sourceBuffer must not be updating"),S.remove(f,u)):x.shiftAndExecuteNext(a)},s.appendExecutor=function(a,l){var h=this.operationQueue,I=this.sourceBuffer,w=I[l];if(!w){D.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(l);return}w.ended=!1,console.assert(!w.updating,l+" sourceBuffer must not be updating"),w.appendBuffer(a)},s.blockBuffers=function(a,l){var h=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){D.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var I=this.operationQueue,w=l.map(function(x){return I.appendBlocker(x)});Promise.all(w).then(function(){a(),l.forEach(function(x){var O=h.sourceBuffer[x];(!O||!O.updating)&&I.shiftAndExecuteNext(x)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(a,l,h){var I=this.sourceBuffer[a];if(!I)return;var w=h.bind(this,a);this.listeners[a].push({event:l,listener:w}),I.addEventListener(l,w)},s.removeBufferListeners=function(a){var l=this.sourceBuffer[a];if(!l)return;this.listeners[a].forEach(function(h){l.removeEventListener(h.event,h.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return W});var V=N("./src/utils/logger.ts"),W=function(){function D(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var H=D.prototype;return H.append=function(k,T){var v=this.queues[T];v.push(k),v.length===1&&this.buffers[T]&&this.executeNext(T)},H.insertAbort=function(k,T){var v=this.queues[T];v.unshift(k),this.executeNext(T)},H.appendBlocker=function(k){var T,v=new Promise(function(c){T=c}),m={execute:T,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,k),v},H.executeNext=function(k){var T=this.buffers,v=this.queues,m=T[k],c=v[k];if(c.length){var d=c[0];try{d.execute()}catch(r){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(r),(!m||!m.updating)&&(c.shift(),this.executeNext(k))}}},H.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},H.current=function(k){return this.queues[k][0]},D}()},"./src/controller/cap-level-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/events.ts");function W(F,k){for(var T=0;T<k.length;T++){var v=k[T];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(F,v.key,v)}}function D(F,k,T){return k&&W(F.prototype,k),T&&W(F,T),F}var H=function(){function F(T){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=T,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var k=F.prototype;return k.setStreamController=function(v){this.streamController=v},k.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},k.registerListeners=function(){var v=this.hls;v.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.unregisterListener=function(){var v=this.hls;v.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.onFpsDropLevelCapping=function(v,m){F.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},k.onMediaAttaching=function(v,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},k.onManifestParsed=function(v,m){var c=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,c.config.capLevelToPlayerSize&&m.video&&this.startCapping()},k.onBufferCodecs=function(v,m){var c=this.hls;c.config.capLevelToPlayerSize&&m.video&&this.startCapping()},k.onMediaDetaching=function(){this.stopCapping()},k.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},k.getMaxLevel=function(v){var m=this,c=this.hls.levels;if(!c.length)return-1;var d=c.filter(function(r,s){return F.isLevelAllowed(s,m.restrictedLevels)&&s<=v});return this.clientRect=null,F.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},k.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()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var c=v.getBoundingClientRect();m.width=c.width,m.height=c.height,!m.width&&!m.height&&(m.width=c.right-c.left||v.width||0,m.height=c.bottom-c.top||v.height||0)}return this.clientRect=m,m},F.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},F.getMaxLevelByMediaSize=function(v,m,c){if(!v||!v.length)return-1;for(var d=function(l,h){return h?l.width!==h.width||l.height!==h.height:!0},r=v.length-1,s=0;s<v.length;s+=1){var o=v[s];if((o.width>=m||o.height>=c)&&d(o,v[s+1])){r=s;break}}return r},D(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),F}();z.default=H},"./src/controller/cmcd-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return d});var V=N("./src/events.ts"),W=N("./src/types/cmcd.ts"),D=N("./src/utils/buffer-helper.ts"),H=N("./src/utils/logger.ts");function F(r,s){for(var o=0;o<s.length;o++){var a=s[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}function k(r,s,o){return s&&F(r.prototype,s),o&&F(r,o),r}function T(r,s){var o=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(o)return(o=o.call(r)).next.bind(o);if(Array.isArray(r)||(o=v(r))||s&&r&&typeof r.length=="number"){o&&(r=o);var a=0;return function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}}}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 v(r,s){if(!r)return;if(typeof r=="string")return m(r,s);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(r,s)}function m(r,s){(s==null||s>r.length)&&(s=r.length);for(var o=0,a=new Array(s);o<s;o++)a[o]=r[o];return a}function c(){return c=Object.assign||function(r){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])}return r},c.apply(this,arguments)}var d=function(){function r(o){var a=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(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(I){try{a.apply(I,{ot:W.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(w){H.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(I){try{var w=I.frag,x=a.hls.levels[w.level],O=a.getObjectType(w),S={d:w.duration*1e3,ot:O};(O===W.CMCDObjectType.VIDEO||O===W.CMCDObjectType.AUDIO||O==W.CMCDObjectType.MUXED)&&(S.br=x.bitrate/1e3,S.tb=a.getTopBandwidth(O),S.bl=a.getBufferLength(O)),a.apply(I,S)}catch(_){H.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=o;var l=this.config=o.config,h=l.cmcd;h!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=h.sessionId||r.uuid(),this.cid=h.contentId,this.useHeaders=h.useHeaders===!0,this.registerListeners())}var s=r.prototype;return s.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(a,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(a,l){var h,I;this.audioBuffer=(h=l.tracks.audio)===null||h===void 0?void 0:h.buffer,this.videoBuffer=(I=l.tracks.video)===null||I===void 0?void 0:I.buffer},s.createData=function(){var a;return{v:W.CMCDVersion,sf:W.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(a,l){l===void 0&&(l={}),c(l,this.createData());var h=l.ot===W.CMCDObjectType.INIT||l.ot===W.CMCDObjectType.VIDEO||l.ot===W.CMCDObjectType.MUXED;if(this.starved&&h&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var I=r.toHeaders(l);if(!Object.keys(I).length)return;a.headers||(a.headers={}),c(a.headers,I)}else{var w=r.toQuery(l);if(!w)return;a.url=r.appendQueryToUri(a.url,w)}},s.getObjectType=function(a){var l=a.type;return l==="subtitle"?W.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?W.CMCDObjectType.INIT:l==="audio"?W.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?W.CMCDObjectType.VIDEO:W.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(a){for(var l=0,h=a===W.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,I=T(h),w;!(w=I()).done;){var x=w.value;x.bitrate>l&&(l=x.bitrate)}return l>0?l:NaN},s.getBufferLength=function(a){var l=this.hls.media,h=a===W.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!l)return NaN;var I=D.BufferHelper.bufferInfo(h,l.currentTime,this.config.maxBufferHole);return I.len*1e3},s.createPlaylistLoader=function(){var a=this.config.pLoader,l=this.applyPlaylistData,h=a||this.config.loader;return function(){function I(x){this.loader=void 0,this.loader=new h(x)}var w=I.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(O,S,_){l(O),this.loader.load(O,S,_)},k(I,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),I}()},s.createFragmentLoader=function(){var a=this.config.fLoader,l=this.applyFragmentData,h=a||this.config.loader;return function(){function I(x){this.loader=void 0,this.loader=new h(x)}var w=I.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(O,S,_){l(O),this.loader.load(O,S,_)},k(I,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),I}()},r.uuid=function(){var a=URL.createObjectURL(new Blob),l=a.toString();return URL.revokeObjectURL(a),l.substr(l.lastIndexOf("/")+1)},r.serialize=function(a){for(var l=[],h=function(R){return!Number.isNaN(R)&&R!=null&&R!==""&&R!==!1},I=function(R){return Math.round(R)},w=function(R){return I(R/100)*100},x=function(R){return encodeURIComponent(R)},O={br:I,d:I,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:I},S=Object.keys(a||{}).sort(),_=T(S),g;!(g=_()).done;){var f=g.value,u=a[f];if(!h(u))continue;if(f==="v"&&u===1)continue;if(f=="pr"&&u===1)continue;var E=O[f];E&&(u=E(u));var b=typeof u,y=void 0;f==="ot"||f==="sf"||f==="st"?y=f+"="+u:b==="boolean"?y=f:b==="number"?y=f+"="+u:y=f+"="+JSON.stringify(u),l.push(y)}return l.join(",")},r.toHeaders=function(a){for(var l=Object.keys(a),h={},I=["Object","Request","Session","Status"],w=[{},{},{},{}],x={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},O=0,S=l;O<S.length;O++){var _=S[O],g=x[_]!=null?x[_]:1;w[g][_]=a[_]}for(var f=0;f<w.length;f++){var u=r.serialize(w[f]);u&&(h["CMCD-"+I[f]]=u)}return h},r.toQuery=function(a){return"CMCD="+encodeURIComponent(r.serialize(a))},r.appendQueryToUri=function(a,l){if(!l)return a;var h=a.includes("?")?"&":"?";return""+a+h+l},r}()},"./src/controller/eme-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/errors.ts"),D=N("./src/utils/logger.ts"),H=N("./src/utils/mediakeys-helper.ts");function F(d,r){for(var s=0;s<r.length;s++){var o=r[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(d,o.key,o)}}function k(d,r,s){return r&&F(d.prototype,r),s&&F(d,s),d}var T=3,v=function(r,s,o){var a={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(l){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:o.audioRobustness||""})}),s.forEach(function(l){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:o.videoRobustness||""})}),[a]},m=function(r,s,o,a){switch(r){case H.KeySystems.WIDEVINE:return v(s,o,a);default:throw new Error("Unknown key-system: "+r)}},c=function(){function d(s){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=s,this._config=s.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 r=d.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(o){switch(o){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},r._attemptKeySystemAccess=function(o,a,l){var h=this,I=m(o,a,l,this._drmSystemOptions);D.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(o,I);this.mediaKeysPromise=w.then(function(x){return h._onMediaKeySystemAccessObtained(o,x)}),w.catch(function(x){D.logger.error('Failed to obtain key-system "'+o+'" access:',x)})},r._onMediaKeySystemAccessObtained=function(o,a){var l=this;D.logger.log('Access for key-system "'+o+'" obtained');var h={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:o};this._mediaKeysList.push(h);var I=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(w){return h.mediaKeys=w,D.logger.log('Media-keys created for key-system "'+o+'"'),l._onMediaKeysCreated(),w});return I.catch(function(w){D.logger.error("Failed to create media-keys:",w)}),I},r._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),o._onNewMediaKeySession(a.mediaKeysSession))})},r._onNewMediaKeySession=function(o){var a=this;D.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(l){a._onKeySessionMessage(o,l.message)},!1)},r._onKeySessionMessage=function(o,a){D.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(l){D.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),o.update(l)})},r.onMediaEncrypted=function(o){var a=this;if(D.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(I){if(!a._media)return;a._attemptSetMediaKeys(I),a._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(l).catch(l)},r._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}D.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(o,a){var l=this,h=this._mediaKeysList[0];if(!h){D.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(h.mediaKeysSessionInitialized){D.logger.warn("Key-Session already initialized but requested again");return}var I=h.mediaKeysSession;if(!I){D.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){D.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}D.logger.log('Generating key-session request for "'+o+'" init data type'),h.mediaKeysSessionInitialized=!0,I.generateRequest(o,a).then(function(){D.logger.debug("Key-session generation succeeded")}).catch(function(w){D.logger.error("Error generating key-session request:",w),l.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(o,a,l){var h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,h,o,a,l);var I=this._licenseXhrSetup;if(I)try{I.call(this.hls,h,o),I=void 0}catch(w){D.logger.error(w)}try{h.readyState||h.open("POST",o,!0),I&&I.call(this.hls,h,o)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return h},r._onLicenseRequestReadyStageChange=function(o,a,l,h){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,D.logger.log("License request succeeded");var I=o.response,w=this._licenseResponseCallback;if(w)try{I=w.call(this.hls,o,a)}catch(O){D.logger.error(O)}h(I)}else{if(D.logger.error("License Request XHR failed ("+a+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>T){this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=T-this._requestLicenseFailureCount+1;D.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(l,h)}break}},r._generateLicenseRequestChallenge=function(o,a){switch(o.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},r._requestLicense=function(o,a){D.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){D.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(l.mediaKeySystemDomain),I=this._createLicenseXhr(h,o,a);D.logger.log("Sending license request to URL: "+h);var w=this._generateLicenseRequestChallenge(l,o);I.send(w)}catch(x){D.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(o,a){if(!this._emeEnabled)return;var l=a.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var o=this._media,a=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(o,a){if(!this._emeEnabled)return;var l=a.levels.map(function(I){return I.audioCodec}).filter(function(I){return!!I}),h=a.levels.map(function(I){return I.videoCodec}).filter(function(I){return!!I});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,l,h)},k(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();z.default=c},"./src/controller/fps-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/utils/logger.ts"),D=function(){function H(k){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=k,this.registerListeners()}var F=H.prototype;return F.setStreamController=function(T){this.streamController=T},F.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(T,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var c=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=c,c&&typeof c.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(T,v,m){var c=performance.now();if(v){if(this.lastTime){var d=c-this.lastTime,r=m-this.lastDroppedFrames,s=v-this.lastDecodedFrames,o=1e3*r/d,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:r,currentDecoded:s,totalDroppedFrames:m}),o>0&&r>a.config.fpsDroppedMonitoringThreshold*s){var l=a.currentLevel;W.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=l)&&(l=l-1,a.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:a.currentLevel}),a.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=c,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},F.checkFPSInterval=function(){var T=this.media;if(T)if(this.isVideoPlaybackQualityAvailable){var v=T.getVideoPlaybackQuality();this.checkFPS(T,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(T,T.webkitDecodedFrameCount,T.webkitDroppedFrameCount)},H}();z.default=D},"./src/controller/fragment-finders.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"findFragmentByPDT",function(){return D}),N.d(z,"findFragmentByPTS",function(){return H}),N.d(z,"fragmentWithinToleranceTest",function(){return F}),N.d(z,"pdtWithinToleranceTest",function(){return k}),N.d(z,"findFragWithCC",function(){return T});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/binary-search.ts");function D(v,m,c){if(m===null||!Array.isArray(v)||!v.length||!Object(V.isFiniteNumber)(m))return null;var d=v[0].programDateTime;if(m<(d||0))return null;var r=v[v.length-1].endProgramDateTime;if(m>=(r||0))return null;c=c||0;for(var s=0;s<v.length;++s){var o=v[s];if(k(m,c,o))return o}return null}function H(v,m,c,d){c===void 0&&(c=0),d===void 0&&(d=0);var r=null;if(v?r=m[v.sn-m[0].sn+1]||null:c===0&&m[0].start===0&&(r=m[0]),r&&F(c,d,r)===0)return r;var s=W.default.search(m,F.bind(null,c,d));return s||r}function F(v,m,c){v===void 0&&(v=0),m===void 0&&(m=0);var d=Math.min(m,c.duration+(c.deltaPTS?c.deltaPTS:0));return c.start+c.duration-d<=v?1:c.start-d>v&&c.start?-1:0}function k(v,m,c){var d=Math.min(m,c.duration+(c.deltaPTS?c.deltaPTS:0))*1e3,r=c.endProgramDateTime||0;return r-d>v}function T(v,m){return W.default.search(v,function(c){return c.cc<m?1:c.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"FragmentState",function(){return D}),N.d(z,"FragmentTracker",function(){return H});var V=N("./src/events.ts"),W=N("./src/types/loader.ts"),D;(function(T){T.NOT_LOADED="NOT_LOADED",T.BACKTRACKED="BACKTRACKED",T.APPENDING="APPENDING",T.PARTIAL="PARTIAL",T.OK="OK"})(D||(D={}));var H=function(){function T(m){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=m,this._registerListeners()}var v=T.prototype;return v._registerListeners=function(){var c=this.hls;c.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var c=this.hls;c.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(c,d){if(d===W.PlaylistLevelType.MAIN){var r=this.activeFragment,s=this.activeParts;if(!r)return null;if(s)for(var o=s.length;o--;){var a=s[o],l=a?a.end:r.appendedPTS;if(a.start<=c&&l!==void 0&&c<=l)return o>9&&(this.activeParts=s.slice(o-9)),a}else if(r.start<=c&&r.appendedPTS!==void 0&&c<=r.appendedPTS)return r}return this.getBufferedFrag(c,d)},v.getBufferedFrag=function(c,d){for(var r=this.fragments,s=Object.keys(r),o=s.length;o--;){var a=r[s[o]];if((a==null?void 0:a.body.type)===d&&a.buffered){var l=a.body;if(l.start<=c&&c<=l.end)return l}}return null},v.detectEvictedFragments=function(c,d,r){var s=this;Object.keys(this.fragments).forEach(function(o){var a=s.fragments[o];if(!a)return;if(!a.buffered){a.body.type===r&&s.removeFragment(a.body);return}var l=a.range[c];if(!l)return;l.time.some(function(h){var I=!s.isTimeBuffered(h.startPTS,h.endPTS,d);return I&&s.removeFragment(a.body),I})})},v.detectPartialFragments=function(c){var d=this,r=this.timeRanges,s=c.frag,o=c.part;if(!r||s.sn==="initSegment")return;var a=k(s),l=this.fragments[a];if(!l)return;Object.keys(r).forEach(function(h){var I=s.elementaryStreams[h];if(!I)return;var w=r[h],x=o!==null||I.partial===!0;l.range[h]=d.getBufferedTimes(s,o,x,w)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},v.fragBuffered=function(c){var d=k(c),r=this.fragments[d];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},v.getBufferedTimes=function(c,d,r,s){for(var o={time:[],partial:r},a=d?d.start:c.start,l=d?d.end:c.end,h=c.minEndPTS||l,I=c.maxStartPTS||a,w=0;w<s.length;w++){var x=s.start(w)-this.bufferPadding,O=s.end(w)+this.bufferPadding;if(I>=x&&h<=O){o.time.push({startPTS:Math.max(a,s.start(w)),endPTS:Math.min(l,s.end(w))});break}else if(a<O&&l>x)o.partial=!0,o.time.push({startPTS:Math.max(a,s.start(w)),endPTS:Math.min(l,s.end(w))});else if(l<=x)break}return o},v.getPartialFragment=function(c){var d=null,r,s,o,a=0,l=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(I){var w=h[I];if(!w)return;F(w)&&(s=w.body.start-l,o=w.body.end+l,c>=s&&c<=o&&(r=Math.min(c-s,o-c),a<=r&&(d=w.body,a=r)))}),d},v.getState=function(c){var d=k(c),r=this.fragments[d];return r?r.buffered?F(r)?D.PARTIAL:D.OK:r.backtrack?D.BACKTRACKED:D.APPENDING:D.NOT_LOADED},v.backtrack=function(c,d){var r=k(c),s=this.fragments[r];if(!s||s.backtrack)return null;var o=s.backtrack=d||s.loaded;return s.loaded=null,o},v.getBacktrackData=function(c){var d=k(c),r=this.fragments[d];if(r){var s,o=r.backtrack;if(o!=null&&(s=o.payload)!==null&&s!==void 0&&s.byteLength)return o;this.removeFragment(c)}return null},v.isTimeBuffered=function(c,d,r){for(var s,o,a=0;a<r.length;a++){if(s=r.start(a)-this.bufferPadding,o=r.end(a)+this.bufferPadding,c>=s&&d<=o)return!0;if(d<=s)return!1}return!1},v.onFragLoaded=function(c,d){var r=d.frag,s=d.part;if(r.sn==="initSegment"||r.bitrateTest||s)return;var o=k(r);this.fragments[o]={body:r,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(c,d){var r=this,s=d.frag,o=d.part,a=d.timeRanges;if(s.type===W.PlaylistLevelType.MAIN)if(this.activeFragment=s,o){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(o)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(h){var I=a[h];if(r.detectEvictedFragments(h,I),!o)for(var w=0;w<I.length;w++)s.appendedPTS=Math.max(I.end(w),s.appendedPTS||0)})},v.onFragBuffered=function(c,d){this.detectPartialFragments(d)},v.hasFragment=function(c){var d=k(c);return!!this.fragments[d]},v.removeFragmentsInRange=function(c,d,r){var s=this;Object.keys(this.fragments).forEach(function(o){var a=s.fragments[o];if(!a)return;if(a.buffered){var l=a.body;l.type===r&&l.start<d&&l.end>c&&s.removeFragment(l)}})},v.removeFragment=function(c){var d=k(c);c.stats.loaded=0,c.clearElementaryStreamInfo(),delete this.fragments[d]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},T}();function F(T){var v,m;return T.buffered&&(((v=T.range.video)===null||v===void 0?void 0:v.partial)||((m=T.range.audio)===null||m===void 0?void 0:m.partial))}function k(T){return T.type+"_"+T.level+"_"+T.urlId+"_"+T.sn}},"./src/controller/gap-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"STALL_MINIMUM_DURATION_MS",function(){return F}),N.d(z,"MAX_START_GAP_JUMP",function(){return k}),N.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return T}),N.d(z,"SKIP_BUFFER_RANGE_START",function(){return v}),N.d(z,"default",function(){return m});var V=N("./src/utils/buffer-helper.ts"),W=N("./src/errors.ts"),D=N("./src/events.ts"),H=N("./src/utils/logger.ts"),F=250,k=2,T=.1,v=.05,m=function(){function c(r,s,o,a){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=r,this.media=s,this.fragmentTracker=o,this.hls=a}var d=c.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(s){var o=this.config,a=this.media,l=this.stalled,h=a.currentTime,I=a.seeking,w=this.seeking&&!I,x=!this.seeking&&I;if(this.seeking=I,h!==s){if(this.moved=!0,l!==null){if(this.stallReported){var O=self.performance.now()-l;H.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||w)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!V.BufferHelper.getBuffered(a).length)return;var S=V.BufferHelper.bufferInfo(a,h,0),_=S.len>0,g=S.nextStart||0;if(!_&&!g)return;if(I){var f=S.len>k,u=!g||g-h>k&&!this.fragmentTracker.getPartialFragment(h);if(f||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,b=Math.max(g,S.start||0)-h,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=y==null||((E=y.details)===null||E===void 0)?void 0:E.live,R=P?y.details.targetduration*2:k;if(b>0&&b<=R){this._trySkipBufferHole(null);return}}var U=self.performance.now();if(l===null){this.stalled=U;return}var L=U-l;!I&&L>=F&&this._reportStall(S.len);var j=V.BufferHelper.bufferInfo(a,h,o.maxBufferHole);this._tryFixBufferStall(j,L)},d._tryFixBufferStall=function(s,o){var a=this.config,l=this.fragmentTracker,h=this.media,I=h.currentTime,w=l.getPartialFragment(I);if(w){var x=this._trySkipBufferHole(w);if(x)return}s.len>a.maxBufferHole&&o>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(s){var o=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+s+")"),o.trigger(D.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},d._trySkipBufferHole=function(s){for(var o=this.config,a=this.hls,l=this.media,h=l.currentTime,I=0,w=V.BufferHelper.getBuffered(l),x=0;x<w.length;x++){var O=w.start(x);if(h+o.maxBufferHole>=I&&h<O){var S=Math.max(O+v,l.currentTime+T);return H.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+S),this.moved=!0,this.stalled=null,l.currentTime=S,s&&a.trigger(D.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+S,frag:s}),S}I=w.end(x)}return 0},d._tryNudgeBuffer=function(){var s=this.config,o=this.hls,a=this.media,l=a.currentTime,h=(this.nudgeRetry||0)+1;if(this.nudgeRetry=h,h<s.nudgeMaxRetry){var I=l+h*s.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+l+" to "+I),a.currentTime=I,o.trigger(D.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+s.nudgeMaxRetry+" nudges"),o.trigger(D.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},c}()},"./src/controller/id3-track-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/utils/texttrack-utils.ts"),D=N("./src/demux/id3.ts"),H=.25,F=function(){function k(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var T=k.prototype;return T.destroy=function(){this._unregisterListeners()},T._registerListeners=function(){var m=this.hls;m.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var m=this.hls;m.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.onMediaAttached=function(m,c){this.media=c.media},T.onMediaDetaching=function(){if(!this.id3Track)return;Object(W.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},T.getID3Track=function(m){if(!this.media)return;for(var c=0;c<m.length;c++){var d=m[c];if(d.kind==="metadata"&&d.label==="id3")return Object(W.sendAddTrackEvent)(d,this.media),d}return this.media.addTextTrack("metadata","id3")},T.onFragParsingMetadata=function(m,c){if(!this.media)return;var d=c.frag,r=c.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<r.length;o++){var a=D.getID3Frames(r[o].data);if(a){var l=r[o].pts,h=o<r.length-1?r[o+1].pts:d.end,I=h-l;I<=0&&(h=l+H);for(var w=0;w<a.length;w++){var x=a[w];if(!D.isTimeStampFrame(x)){var O=new s(l,h,"");O.value=x,this.id3Track.addCue(O)}}}}},T.onBufferFlushing=function(m,c){var d=c.startOffset,r=c.endOffset,s=c.type;if(!s||s==="audio"){var o=this.id3Track;o&&Object(W.removeCuesInRange)(o,d,r)}},k}();z.default=F},"./src/controller/latency-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return k});var V=N("./src/errors.ts"),W=N("./src/events.ts"),D=N("./src/utils/logger.ts");function H(T,v){for(var m=0;m<v.length;m++){var c=v[m];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(T,c.key,c)}}function F(T,v,m){return v&&H(T.prototype,v),m&&H(T,m),T}var k=function(){function T(m){var c=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 c.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var v=T.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(W.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(W.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(W.Events.ERROR,this.onError)},v.onMediaAttached=function(c,d){this.media=d.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(c,d){var r=d.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(c,d){if(d.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,D.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var c=this.media,d=this.levelDetails;if(!c||!d)return;this.currentTime=c.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var s=this.config,o=s.lowLatencyMode,a=s.maxLiveSyncPlaybackRate;if(!o||a===1)return;var l=this.targetLatency;if(l===null)return;var h=r-l,I=Math.min(this.maxLatency,l+d.targetduration),w=h<I;if(d.live&&w&&h>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,a)),O=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;c.playbackRate=Math.min(x,Math.max(1,O))}else c.playbackRate!==1&&c.playbackRate!==0&&(c.playbackRate=1)},v.estimateLiveEdge=function(){var c=this.levelDetails;return c===null?null:c.edge+c.age},v.computeLatency=function(){var c=this.estimateLiveEdge();return c===null?null:c-this.currentTime},F(T,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var c=this.config,d=this.levelDetails;return c.liveMaxLatencyDuration!==void 0?c.liveMaxLatencyDuration:d?c.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var c=this.levelDetails;if(c===null)return null;var d=c.holdBack,r=c.partHoldBack,s=c.targetduration,o=this.config,a=o.liveSyncDuration,l=o.liveSyncDurationCount,h=o.lowLatencyMode,I=this.hls.userConfig,w=h&&r||d;(I.liveSyncDuration||I.liveSyncDurationCount||w===0)&&(w=a!==void 0?a:l*s);var x=s,O=1;return w+Math.min(this.stallCount*O,x)}},{key:"liveSyncPosition",get:function(){var c=this.estimateLiveEdge(),d=this.targetLatency,r=this.levelDetails;if(c===null||d===null||r===null)return null;var s=r.edge,o=c-d-this.edgeStalled,a=s-r.totalduration,l=s-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,o),l)}},{key:"drift",get:function(){var c=this.levelDetails;return c===null?1:c.drift}},{key:"edgeStalled",get:function(){var c=this.levelDetails;if(c===null)return 0;var d=(this.config.lowLatencyMode&&c.partTarget||c.targetduration)*3;return Math.max(c.age-d,0)}},{key:"forwardBufferLength",get:function(){var c=this.media,d=this.levelDetails;if(!c||!d)return 0;var r=c.buffered.length;return r?c.buffered.end(r-1):d.edge-this.currentTime}}]),T}()},"./src/controller/level-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return o});var V=N("./src/types/level.ts"),W=N("./src/events.ts"),D=N("./src/errors.ts"),H=N("./src/utils/codecs.ts"),F=N("./src/controller/level-helper.ts"),k=N("./src/controller/base-playlist-controller.ts"),T=N("./src/types/loader.ts");function v(){return v=Object.assign||function(a){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var I in h)Object.prototype.hasOwnProperty.call(h,I)&&(a[I]=h[I])}return a},v.apply(this,arguments)}function m(a,l){for(var h=0;h<l.length;h++){var I=l[h];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(a,I.key,I)}}function c(a,l,h){return l&&m(a.prototype,l),h&&m(a,h),a}function d(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,r(a,l)}function r(a,l){return r=Object.setPrototypeOf||function(I,w){return I.__proto__=w,I},r(a,l)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(a){d(l,a);function l(I){var w;return w=a.call(this,I,"[level-controller]")||this,w._levels=[],w._firstLevel=-1,w._startLevel=void 0,w.currentLevelIndex=-1,w.manualLevelIndex=-1,w.onParsedComplete=void 0,w._registerListeners(),w}var h=l.prototype;return h._registerListeners=function(){var w=this.hls;w.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(W.Events.ERROR,this.onError,this)},h._unregisterListeners=function(){var w=this.hls;w.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(W.Events.ERROR,this.onError,this)},h.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},h.startLoad=function(){var w=this._levels;w.forEach(function(x){x.loadError=0}),a.prototype.startLoad.call(this)},h.onManifestLoaded=function(w,x){var O=[],S=[],_=[],g,f={},u,E=!1,b=!1,y=!1;if(x.levels.forEach(function(L){var j=L.attrs;E=E||!!(L.width&&L.height),b=b||!!L.videoCodec,y=y||!!L.audioCodec,s&&L.audioCodec&&L.audioCodec.indexOf("mp4a.40.34")!==-1&&(L.audioCodec=void 0);var A=L.bitrate+"-"+L.attrs.RESOLUTION+"-"+L.attrs.CODECS;u=f[A],u?u.url.push(L.url):(u=new V.Level(L),f[A]=u,O.push(u)),j&&(j.AUDIO&&Object(F.addGroupId)(u,"audio",j.AUDIO),j.SUBTITLES&&Object(F.addGroupId)(u,"text",j.SUBTITLES))}),(E||b)&&y&&(O=O.filter(function(L){var j=L.videoCodec,A=L.width,X=L.height;return!!j||!!(A&&X)})),O=O.filter(function(L){var j=L.audioCodec,A=L.videoCodec;return(!j||Object(H.isCodecSupportedInMp4)(j,"audio"))&&(!A||Object(H.isCodecSupportedInMp4)(A,"video"))}),x.audioTracks&&(S=x.audioTracks.filter(function(L){return!L.audioCodec||Object(H.isCodecSupportedInMp4)(L.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(S)),x.subtitles&&(_=x.subtitles,Object(F.assignTrackIdsByGroup)(_)),O.length>0){g=O[0].bitrate,O.sort(function(L,j){return L.bitrate-j.bitrate}),this._levels=O;for(var P=0;P<O.length;P++)if(O[P].bitrate===g){this._firstLevel=P,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+g);break}var R=y&&!b,U={levels:O,audioTracks:S,subtitleTracks:_,firstLevel:this._firstLevel,stats:x.stats,audio:y,video:b,altAudio:!R&&S.some(function(L){return!!L.url})};this.hls.trigger(W.Events.MANIFEST_PARSED,U),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(W.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},h.onError=function(w,x){if(a.prototype.onError.call(this,w,x),x.fatal)return;var O=x.context,S=this._levels[this.currentLevelIndex];if(O&&(O.type===T.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&O.groupId===S.audioGroupIds[S.urlId]||O.type===T.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&O.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,g=!0,f;switch(x.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:if(x.frag){var u=this._levels[x.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=x.frag.level)):f=x.frag.level}break;case D.ErrorDetails.LEVEL_LOAD_ERROR:case D.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(g=!1),f=O.level),_=!0;break;case D.ErrorDetails.REMUX_ALLOC_ERROR:f=x.level,_=!0;break}f!==void 0&&this.recoverLevel(x,f,_,g)},h.recoverLevel=function(w,x,O,S){var _=w.details,g=this._levels[x];if(g.loadError++,O){var f=this.retryLoadingOrFail(w);if(f)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var u=g.url.length;if(u>1&&g.loadError<u)w.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var E=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(_+": switch to "+E),w.levelRetry=!0,this.hls.nextAutoLevel=E)}}},h.redundantFailover=function(w){var x=this._levels[w],O=x.url.length;if(O>1){var S=(x.urlId+1)%O;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(_){_.urlId=S}),this.level=w}},h.onFragLoaded=function(w,x){var O=x.frag;if(O!==void 0&&O.type===T.PlaylistLevelType.MAIN){var S=this._levels[O.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},h.onLevelLoaded=function(w,x){var O,S=x.level,_=x.details,g=this._levels[S];if(!g){var f;this.warn("Invalid level index "+S),(f=x.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(_.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(g.fragmentError===0&&(g.loadError=0,this.retryCount=0),this.playlistLoaded(S,x,g.details)):(O=x.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(_.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(w,x){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var S=-1,_=this.hls.audioTracks[x.id].groupId,g=0;g<O.audioGroupIds.length;g++)if(O.audioGroupIds[g]===_){S=g;break}S!==O.urlId&&(O.urlId=S,this.startLoad())}},h.loadPlaylist=function(w){var x=this.currentLevelIndex,O=this._levels[x];if(this.canLoad&&O&&O.url.length>0){var S=O.urlId,_=O.url[S];if(w)try{_=w.addDirectives(_)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Attempt loading level index "+x+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+S+" "+_),this.clearTimer(),this.hls.trigger(W.Events.LEVEL_LOADING,{url:_,level:x,id:S,deliveryDirectives:w||null})}},h.removeLevel=function(w,x){var O=function(g,f){return f!==x},S=this._levels.filter(function(_,g){return g!==w?!0:_.url.length>1&&x!==void 0?(_.url=_.url.filter(O),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(O)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(O)),_.urlId=0,!0):!1}).map(function(_,g){var f=_.details;return f!=null&&f.fragments&&f.fragments.forEach(function(u){u.level=g}),_});this._levels=S,this.hls.trigger(W.Events.LEVELS_UPDATED,{levels:S})},c(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var x,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===w&&(x=O[w])!==null&&x!==void 0&&x.details)return;if(w<0||w>=O.length){var S=w<0;if(this.hls.trigger(W.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:S,reason:"invalid level idx"}),S)return;w=Math.min(w,O.length-1)}this.clearTimer();var _=this.currentLevelIndex,g=O[_],f=O[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var u=v({},f,{level:w,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete u._urlId,this.hls.trigger(W.Events.LEVEL_SWITCHING,u);var E=f.details;if(!E||E.live){var b=this.switchParams(f.uri,g==null?void 0:g.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),l}(k.default)},"./src/controller/level-helper.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"addGroupId",function(){return D}),N.d(z,"assignTrackIdsByGroup",function(){return H}),N.d(z,"updatePTS",function(){return F}),N.d(z,"updateFragPTSDTS",function(){return T}),N.d(z,"mergeDetails",function(){return v}),N.d(z,"mapPartIntersection",function(){return m}),N.d(z,"mapFragmentIntersection",function(){return c}),N.d(z,"adjustSliding",function(){return d}),N.d(z,"addSliding",function(){return r}),N.d(z,"computeReloadInterval",function(){return s}),N.d(z,"getFragmentWithSN",function(){return o}),N.d(z,"getPartWith",function(){return a});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/logger.ts");function D(l,h,I){switch(h){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(I);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(I);break}}function H(l){var h={};l.forEach(function(I){var w=I.groupId||"";I.id=h[w]=h[w]||0,h[w]++})}function F(l,h,I){var w=l[h],x=l[I];k(w,x)}function k(l,h){var I=h.startPTS;if(Object(V.isFiniteNumber)(I)){var w=0,x;h.sn>l.sn?(w=I-l.start,x=l):(w=l.start-I,x=h),x.duration!==w&&(x.duration=w)}else if(h.sn>l.sn){var O=l.cc===h.cc;O&&l.minEndPTS?h.start=l.start+(l.minEndPTS-l.start):h.start=l.start+l.duration}else h.start=Math.max(l.start-h.duration,0)}function T(l,h,I,w,x,O){var S=w-I;S<=0&&(W.logger.warn("Fragment should have a positive duration",h),w=I+h.duration,O=x+h.duration);var _=I,g=w,f=h.startPTS,u=h.endPTS;if(Object(V.isFiniteNumber)(f)){var E=Math.abs(f-I);Object(V.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(E,h.deltaPTS):h.deltaPTS=E,_=Math.max(I,f),I=Math.min(I,f),x=Math.min(x,h.startDTS),g=Math.min(w,u),w=Math.max(w,u),O=Math.max(O,h.endDTS)}h.duration=w-I;var b=I-h.start;h.appendedPTS=w,h.start=h.startPTS=I,h.maxStartPTS=_,h.startDTS=x,h.endPTS=w,h.minEndPTS=g,h.endDTS=O;var y=h.sn;if(!l||y<l.startSN||y>l.endSN)return 0;var P,R=y-l.startSN,U=l.fragments;for(U[R]=h,P=R;P>0;P--)k(U[P],U[P-1]);for(P=R;P<U.length-1;P++)k(U[P],U[P+1]);return l.fragmentHint&&k(U[U.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,b}function v(l,h){for(var I=null,w=l.fragments,x=w.length-1;x>=0;x--){var O=w[x].initSegment;if(O){I=O;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var S=0,_;if(c(l,h,function(P,R){P.relurl&&(S=P.cc-R.cc),Object(V.isFiniteNumber)(P.startPTS)&&Object(V.isFiniteNumber)(P.endPTS)&&(R.start=R.startPTS=P.startPTS,R.startDTS=P.startDTS,R.appendedPTS=P.appendedPTS,R.maxStartPTS=P.maxStartPTS,R.endPTS=P.endPTS,R.endDTS=P.endDTS,R.minEndPTS=P.minEndPTS,R.duration=P.endPTS-P.startPTS,R.duration&&(_=R),h.PTSKnown=h.alignedSliding=!0),R.elementaryStreams=P.elementaryStreams,R.loader=P.loader,R.stats=P.stats,R.urlId=P.urlId,P.initSegment&&(R.initSegment=P.initSegment,I=P.initSegment)}),I){var g=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;g.forEach(function(P){var R;(!P.initSegment||P.initSegment.relurl===((R=I)===null||R===void 0?void 0:R.relurl))&&(P.initSegment=I)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(P){return!P}),h.deltaUpdateFailed)){W.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=h.skippedSegments;f--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var u=h.fragments;if(S){W.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<u.length;E++)u[E].cc+=S}h.skippedSegments&&(h.startCC=h.fragments[0].cc),m(l.partList,h.partList,function(P,R){R.elementaryStreams=P.elementaryStreams,R.stats=P.stats}),_?T(h,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):d(l,h),u.length&&(h.totalduration=h.edge-u[0].start),h.driftStartTime=l.driftStartTime,h.driftStart=l.driftStart;var b=h.advancedDateTime;if(h.advanced&&b){var y=h.edge;h.driftStart||(h.driftStartTime=b,h.driftStart=y),h.driftEndTime=b,h.driftEnd=y}else h.driftEndTime=l.driftEndTime,h.driftEnd=l.driftEnd,h.advancedDateTime=l.advancedDateTime}function m(l,h,I){if(l&&h)for(var w=0,x=0,O=l.length;x<=O;x++){var S=l[x],_=h[x+w];S&&_&&S.index===_.index&&S.fragment.sn===_.fragment.sn?I(S,_):w--}}function c(l,h,I){for(var w=h.skippedSegments,x=Math.max(l.startSN,h.startSN)-h.startSN,O=(l.fragmentHint?1:0)+(w?h.endSN:Math.min(l.endSN,h.endSN))-h.startSN,S=h.startSN-l.startSN,_=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,g=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,f=x;f<=O;f++){var u=g[S+f],E=_[f];w&&!E&&f<w&&(E=h.fragments[f]=u),u&&E&&I(u,E)}}function d(l,h){var I=h.startSN+h.skippedSegments-l.startSN,w=l.fragments;if(I<0||I>=w.length)return;r(h,w[I].start)}function r(l,h){if(h){for(var I=l.fragments,w=l.skippedSegments;w<I.length;w++)I[w].start+=h;l.fragmentHint&&(l.fragmentHint.start+=h)}}function s(l,h){var I=1e3*l.levelTargetDuration,w=I/2,x=l.age,O=x>0&&x<I*3,S=h.loading.end-h.loading.start,_,g=l.availabilityDelay;if(l.updated===!1)if(O){var f=333*l.misses;_=Math.max(Math.min(w,S*2),f),l.availabilityDelay=(l.availabilityDelay||0)+_}else _=w;else O?(g=Math.min(g||I/2,x),l.availabilityDelay=g,_=g+I-x):_=I-S;return Math.round(_)}function o(l,h,I){if(!l||!l.details)return null;var w=l.details,x=w.fragments[h-w.startSN];return x||(x=w.fragmentHint,x&&x.sn===h?x:h<w.startSN&&I&&I.sn===h?I:null)}function a(l,h,I){if(!l||!l.details)return null;var w=l.details.partList;if(w)for(var x=w.length;x--;){var O=w[x];if(O.index===I&&O.fragment.sn===h)return O}return null}},"./src/controller/stream-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return w});var V=N("./src/polyfills/number.ts"),W=N("./src/controller/base-stream-controller.ts"),D=N("./src/is-supported.ts"),H=N("./src/events.ts"),F=N("./src/utils/buffer-helper.ts"),k=N("./src/controller/fragment-tracker.ts"),T=N("./src/types/loader.ts"),v=N("./src/loader/fragment.ts"),m=N("./src/demux/transmuxer-interface.ts"),c=N("./src/types/transmuxer.ts"),d=N("./src/controller/gap-controller.ts"),r=N("./src/errors.ts"),s=N("./src/utils/logger.ts");function o(x,O){for(var S=0;S<O.length;S++){var _=O[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function a(x,O,S){return O&&o(x.prototype,O),S&&o(x,S),x}function l(x,O){x.prototype=Object.create(O.prototype),x.prototype.constructor=x,h(x,O)}function h(x,O){return h=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},h(x,O)}var I=100,w=function(x){l(O,x);function O(_,g){var f;return f=x.call(this,_,g,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var S=O.prototype;return S._registerListeners=function(){var g=this.hls;g.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),g.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),g.on(H.Events.ERROR,this.onError,this),g.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),g.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var g=this.hls;g.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),g.off(H.Events.ERROR,this.onError,this),g.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),g.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(g){if(this.levels){var f=this.lastCurrentTime,u=this.hls;if(this.stopLoad(),this.setInterval(I),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=u.startLevel;E===-1&&(u.config.testBandwidth?(E=0,this.bitrateTest=!0):E=u.nextAutoLevel),this.level=u.nextLoadLevel=E,this.loadedmetadata=!1}f>0&&g===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),g=f),this.state=W.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()}else this._forceStartLoad=!0,this.state=W.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_LEVEL:{var g,f=this.levels,u=this.level,E=f==null||((g=f[u])===null||g===void 0)?void 0:g.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=W.State.IDLE;break}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var b,y=self.performance.now(),P=this.retryDate;(!P||y>=P||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=W.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var g,f,u=this.hls,E=this.levelLastLoaded,b=this.levels,y=this.media,P=u.config,R=u.nextLoadLevel;if(E===null||!y&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[R])return;var U=b[R];this.level=u.nextLoadLevel=R;var L=U.details;if(!L||this.state===W.State.WAITING_LEVEL||L.live&&this.levelLastLoaded!==R){this.state=W.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,T.PlaylistLevelType.MAIN);if(j===null)return;var A=j.len,X=this.getMaxBufferLength(U.maxBitrate);if(A>=X)return;if(this._streamEnded(j,L)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,ee),this.state=W.State.ENDED;return}var se=j.end,ce=this.getNextFragment(se,L);if(this.couldBacktrack&&!this.fragPrevious&&ce&&ce.sn!=="initSegment"){var Le=ce.sn-L.startSN;Le>1&&(ce=L.fragments[Le-1],this.fragmentTracker.removeFragment(ce))}if(ce&&this.fragmentTracker.getState(ce)===k.FragmentState.OK&&this.nextLoadPosition>se){var Ce=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Ce,T.PlaylistLevelType.MAIN),ce=this.getNextFragment(this.nextLoadPosition,L)}if(!ce)return;ce.initSegment&&!ce.initSegment.data&&!this.bitrateTest&&(ce=ce.initSegment),((g=ce.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((f=ce.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(ce,L):this.loadFragment(ce,L,se)},S.loadFragment=function(g,f,u){var E,b=this.fragmentTracker.getState(g);if(this.fragCurrent=g,b===k.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(g);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else b=k.FragmentState.NOT_LOADED}b===k.FragmentState.NOT_LOADED||b===k.FragmentState.PARTIAL?g.sn==="initSegment"?this._loadInitSegment(g):this.bitrateTest?(g.bitrateTest=!0,this.log("Fragment "+g.sn+" of level "+g.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(g)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,g,f,u)):b===k.FragmentState.APPENDING?this.reduceMaxBufferLength(g.duration)&&this.fragmentTracker.removeFragment(g):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(g){var f=this.fragmentTracker.getAppendedFrag(g,T.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},S.getBufferedFrag=function(g){return this.fragmentTracker.getBufferedFrag(g,T.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(g){return g?this.getBufferedFrag(g.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var g=this.levels,f=this.media;if(f!=null&&f.readyState){var u,E=this.getAppendedFrag(f.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!f.paused&&g){var b=this.hls.nextLoadLevel,y=g[b],P=this.fragLastKbps;P&&this.fragCurrent?u=this.fragCurrent.duration*y.maxBitrate/(1e3*P)+1:u=0}else u=0;var R=this.getBufferedFrag(f.currentTime+u);if(R){var U=this.followingBufferedFrag(R);if(U){this.abortCurrentFrag();var L=U.maxStartPTS?U.maxStartPTS:U.start,j=U.duration,A=Math.max(R.end,L+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(A,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var g=this.fragCurrent;this.fragCurrent=null,g!=null&&g.loader&&g.loader.abort(),this.state===W.State.KEY_LOADING&&(this.state=W.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(g,f){x.prototype.flushMainBuffer.call(this,g,f,this.altAudio?"video":null)},S.onMediaAttached=function(g,f){x.prototype.onMediaAttached.call(this,g,f);var u=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,u,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var g=this.media;g&&(g.removeEventListener("playing",this.onvplaying),g.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var g=this.media,f=g?g.currentTime:null;Object(V.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(g,f){var u=!1,E=!1,b;f.levels.forEach(function(y){b=y.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(u=!0),b.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=u&&E&&!Object(D.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},S.onLevelLoading=function(g,f){var u=this.levels;if(!u||this.state!==W.State.IDLE)return;var E=u[f.level];(!E.details||E.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(E.details))&&(this.state=W.State.WAITING_LEVEL)},S.onLevelLoaded=function(g,f){var u,E=this.levels,b=f.level,y=f.details,P=y.totalduration;if(!E){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+P);var R=this.fragCurrent;R&&(this.state===W.State.FRAG_LOADING||this.state===W.State.FRAG_LOADING_WAITING_RETRY)&&(R.level!==f.level&&R.loader&&(this.state=W.State.IDLE,R.loader.abort()));var U=E[b],L=0;if(y.live||(u=U.details)!==null&&u!==void 0&&u.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;L=this.alignPlaylists(y,U.details)}if(U.details=y,this.levelLastLoaded=b,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:y,level:b}),this.state===W.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=W.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,L),this.tick()},S._handleFragmentLoadProgress=function(g){var f,u=g.frag,E=g.part,b=g.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var P=y[u.level],R=P.details;if(!R){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var U=P.videoCodec,L=R.PTSKnown||!R.live,j=(f=u.initSegment)===null||f===void 0?void 0:f.data,A=this._getAudioCodec(P),X=this.transmuxer=this.transmuxer||new m.default(this.hls,T.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=E?E.index:-1,se=ee!==-1,ce=new c.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,b.byteLength,ee,se),Le=this.initPTS[u.cc];X.push(b,j,A,U,u,E,R.totalduration,L,ce,Le)},S.onAudioTrackSwitching=function(g,f){var u=this.altAudio,E=!!f.url,b=f.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;u&&P.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:b})}},S.onAudioTrackSwitched=function(g,f){var u=f.id,E=!!this.hls.audioTracks[u].url;if(E){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=E,this.tick()},S.onBufferCreated=function(g,f){var u=f.tracks,E,b,y=!1;for(var P in u){var R=u[P];if(R.id==="main"){if(b=P,E=R,P==="video"){var U=u[P];U&&(this.videoBuffer=U.buffer)}}else y=!0}y&&E?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(g,f){var u=f.frag,E=f.part;if(u&&u.type!==T.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(E?" p: "+E.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===W.State.PARSED&&(this.state=W.State.IDLE);return}var b=E?E.stats:u.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,E)},S.onError=function(g,f){switch(f.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(T.PlaylistLevelType.MAIN,f);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==W.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=W.State.ERROR):!f.levelRetry&&this.state===W.State.WAITING_LEVEL&&(this.state=W.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var u=!0,E=this.getFwdBufferInfo(this.media,T.PlaylistLevelType.MAIN);E&&E.len>.5&&(u=!this.reduceMaxBufferLength(E.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var g=this.media,f=this.gapController;if(!g||!f||!g.readyState)return;var u=F.BufferHelper.getBuffered(g);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=g.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=W.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(g,f){var u=f.type;if(u!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(u===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,u,T.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(g,f){this.levels=f.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var g=this.media,f=g.currentTime,u=this.startPosition;if(u>=0&&f<u){if(g.seeking){s.logger.log("could not seek to "+u+", already seeking at "+f);return}var E=F.BufferHelper.getBuffered(g),b=E.length?E.start(0):0,y=b-u;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+y+" to match buffer start"),u+=y,this.startPosition=u),this.log("seek to target start position "+u+" from current time "+f),g.currentTime=u}},S._getAudioCodec=function(g){var f=this.config.defaultAudioCodec||g.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},S._loadBitrateTestFrag=function(g){var f=this;this._doFragLoad(g).then(function(u){var E=f.hls;if(!u||E.nextLoadLevel||f.fragContextChanged(g))return;f.fragLoadError=0,f.state=W.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var b=g.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),E.trigger(H.Events.FRAG_LOADED,u)})},S._handleTransmuxComplete=function(g){var f,u="main",E=this.hls,b=g.remuxResult,y=g.chunkMeta,P=this.getCurrentContext(y);if(!P){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var R=P.frag,U=P.part,L=P.level,j=b.video,A=b.text,X=b.id3,ee=b.initSegment,se=this.altAudio?void 0:b.audio;if(this.fragContextChanged(R))return;if(this.state=W.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(L,ee.tracks,R,y),E.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:u,tracks:ee.tracks}));var ce=ee.initPTS,Le=ee.timescale;Object(V.isFiniteNumber)(ce)&&(this.initPTS[R.cc]=ce,E.trigger(H.Events.INIT_PTS_FOUND,{frag:R,id:u,initPTS:ce,timescale:Le}))}if(j&&b.independent!==!1){if(L.details){var Ce=j.startPTS,Ae=j.endPTS,Pe=j.startDTS,Ie=j.endDTS;if(U)U.elementaryStreams[j.type]={startPTS:Ce,endPTS:Ae,startDTS:Pe,endDTS:Ie};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<Ce){this.backtrack(R);return}R.setElementaryStreamInfo(j.type,R.start,Ae,R.start,Ie,!0)}R.setElementaryStreamInfo(j.type,Ce,Ae,Pe,Ie),this.bufferFragmentData(j,R,U,y)}}else if(b.independent===!1){this.backtrack(R);return}if(se){var de=se.startPTS,ne=se.endPTS,ge=se.startDTS,oe=se.endDTS;U&&(U.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:ne,startDTS:ge,endDTS:oe}),R.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,de,ne,ge,oe),this.bufferFragmentData(se,R,U,y)}if(X!=null&&(f=X.samples)!==null&&f!==void 0&&f.length){var De={frag:R,id:u,samples:X.samples};E.trigger(H.Events.FRAG_PARSING_METADATA,De)}if(A){var Ue={frag:R,id:u,samples:A.samples};E.trigger(H.Events.FRAG_PARSING_USERDATA,Ue)}},S._bufferInitSegment=function(g,f,u,E){var b=this;if(this.state!==W.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var y=f.audio,P=f.video,R=f.audiovideo;if(y){var U=g.audioCodec,L=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(U&&(U.indexOf("mp4a.40.5")!==-1?U="mp4a.40.2":U="mp4a.40.5"),y.metadata.channelCount!==1&&L.indexOf("firefox")===-1&&(U="mp4a.40.5")),L.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(U="mp4a.40.2",this.log("Android: force audio codec to "+U)),g.audioCodec&&g.audioCodec!==U&&this.log('Swapping manifest audio codec "'+g.audioCodec+'" for "'+U+'"'),y.levelCodec=U,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(U||"")+"/"+(g.audioCodec||"")+"/"+y.codec+"]")}P&&(P.levelCodec=g.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(g.videoCodec||"")+"/"+P.codec+"]")),R&&this.log("Init audiovideo buffer, container:"+R.container+", codecs[level/parsed]=["+(g.attrs.CODECS||"")+"/"+R.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(j){var A=f[j],X=A.initSegment;X!=null&&X.byteLength&&b.hls.trigger(H.Events.BUFFER_APPENDING,{type:j,data:X,frag:u,part:null,chunkMeta:E,parent:u.type})}),this.tick()},S.backtrack=function(g){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(g);var f=this.fragmentTracker.backtrack(g);this.fragPrevious=null,this.nextLoadPosition=g.start,f?this.resetFragmentLoading(g):this.state=W.State.BACKTRACKING},S.checkFragmentChanged=function(){var g=this.media,f=null;if(g&&g.readyState>1&&g.seeking===!1){var u=g.currentTime;if(F.BufferHelper.isBuffered(g,u)?f=this.getAppendedFrag(u):F.BufferHelper.isBuffered(g,u+.1)&&(f=this.getAppendedFrag(u+.1)),f){var E=this.fragPlaying,b=f.level;(!E||f.sn!==E.sn||E.level!==b||f.urlId!==E.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:f}),(!E||E.level!==b)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=f)}}},a(O,[{key:"nextLevel",get:function(){var g=this.nextBufferedFrag;return g?g.level:-1}},{key:"currentLevel",get:function(){var g=this.media;if(g){var f=this.getAppendedFrag(g.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var g=this.media;if(g){var f=this.getAppendedFrag(g.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(W.default)},"./src/controller/subtitle-stream-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"SubtitleStreamController",function(){return l});var V=N("./src/events.ts"),W=N("./src/utils/logger.ts"),D=N("./src/utils/buffer-helper.ts"),H=N("./src/controller/fragment-finders.ts"),F=N("./src/utils/discontinuities.ts"),k=N("./src/controller/level-helper.ts"),T=N("./src/controller/fragment-tracker.ts"),v=N("./src/controller/base-stream-controller.ts"),m=N("./src/types/loader.ts"),c=N("./src/types/level.ts");function d(h,I){for(var w=0;w<I.length;w++){var x=I[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(h,x.key,x)}}function r(h,I,w){return I&&d(h.prototype,I),w&&d(h,w),h}function s(h,I){h.prototype=Object.create(I.prototype),h.prototype.constructor=h,o(h,I)}function o(h,I){return o=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},o(h,I)}var a=500,l=function(h){s(I,h);function I(x,O){var S;return S=h.call(this,x,O,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var w=I.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var O=this.hls;O.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(V.Events.ERROR,this.onError,this),O.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var O=this.hls;O.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(V.Events.ERROR,this.onError,this),O.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(a),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(O,S){this.mainDetails=S.details},w.onSubtitleFragProcessed=function(O,S){var _=S.frag,g=S.success;if(this.fragPrevious=_,this.state=v.State.IDLE,!g)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var u,E=_.start,b=0;b<f.length;b++)if(E>=f[b].start&&E<=f[b].end){u=f[b];break}var y=_.start+_.duration;u?u.end=y:(u={start:E,end:y},f.push(u)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(O,S){var _=S.startOffset,g=S.endOffset;if(_===0&&g!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,u=this.levels;if(!u.length||!u[f]||!u[f].details)return;var E=u[f].details,b=E.targetduration,y=g-b;if(y<=0)return;S.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(P){for(var R=0;R<P.length;){if(P[R].end<=y){P.shift();continue}else if(P[R].start<y)P[R].start=y;else break;R++}}),this.fragmentTracker.removeFragmentsInRange(_,y,m.PlaylistLevelType.SUBTITLE)}},w.onError=function(O,S){var _,g=S.frag;if(!g||g.type!==m.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},w.onSubtitleTracksUpdated=function(O,S){var _=this,g=S.subtitleTracks;this.tracksBuffered=[],this.levels=g.map(function(f){return new c.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){_.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(O,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(a)},w.onSubtitleTrackLoaded=function(O,S){var _,g=S.details,f=S.id,u=this.currentTrackId,E=this.levels;if(!E.length)return;var b=E[u];if(f>=E.length||f!==u||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,g.live||(_=b.details)!==null&&_!==void 0&&_.live){var y=this.mainDetails;if(g.deltaUpdateFailed||!y)return;var P=y.fragments[0];if(!b.details)g.hasProgramDateTime&&y.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(g,y):P&&Object(k.addSliding)(g,P.start);else{var R=this.alignPlaylists(g,b.details);R===0&&P&&Object(k.addSliding)(g,P.start)}}if(b.details=g,this.levelLastLoaded=f,this.tick(),g.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var U=Object(H.findFragmentByPTS)(null,g.fragments,this.media.currentTime,0);U||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},w._handleFragmentLoadComplete=function(O){var S=O.frag,_=O.payload,g=S.decryptdata,f=this.hls;if(this.fragContextChanged(S))return;if(_&&_.byteLength>0&&g&&g.key&&g.iv&&g.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),g.key.buffer,g.iv.buffer).then(function(E){var b=performance.now();f.trigger(V.Events.FRAG_DECRYPTED,{frag:S,payload:E,stats:{tstart:u,tdecrypt:b}})})}},w.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var O,S=this.currentTrackId,_=this.levels;if(!_.length||!_[S]||!_[S].details)return;var g=_[S].details,f=g.targetduration,u=this.config,E=this.media,b=D.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-f,u.maxBufferHole),y=b.end,P=b.len,R=this.getMaxBufferLength()+f;if(P>R)return;console.assert(g,"Subtitle track details are defined on idle subtitle stream controller tick");var U=g.fragments,L=U.length,j=g.edge,A,X=this.fragPrevious;if(y<j){var ee=u.maxFragLookUpTolerance;X&&g.hasProgramDateTime&&(A=Object(H.findFragmentByPDT)(U,X.endProgramDateTime,ee)),A||(A=Object(H.findFragmentByPTS)(X,U,y,ee),!A&&X&&X.start<U[0].start&&(A=U[0]))}else A=U[L-1];(O=A)!==null&&O!==void 0&&O.encrypted?(W.logger.log("Loading key for "+A.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:A})):A&&this.fragmentTracker.getState(A)===T.FragmentState.NOT_LOADED&&this.loadFragment(A,g,y)}},w.loadFragment=function(O,S,_){this.fragCurrent=O,h.prototype.loadFragment.call(this,O,S,_)},r(I,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),I}(v.default)},"./src/controller/subtitle-track-controller.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/events.ts"),W=N("./src/utils/texttrack-utils.ts"),D=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function F(d,r){for(var s=0;s<r.length;s++){var o=r[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(d,o.key,o)}}function k(d,r,s){return r&&F(d.prototype,r),s&&F(d,s),d}function T(d,r){d.prototype=Object.create(r.prototype),d.prototype.constructor=d,v(d,r)}function v(d,r){return v=Object.setPrototypeOf||function(o,a){return o.__proto__=a,o},v(d,r)}var m=function(d){T(r,d);function r(o){var a;return a=d.call(this,o,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var s=r.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,d.prototype.destroy.call(this)},s.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(V.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(V.Events.ERROR,this.onError,this)},s.onMediaAttached=function(a,l){if(this.media=l.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)},s.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},s.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 a=c(this.media.textTracks);a.forEach(function(l){Object(W.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(a,l){this.tracks=l.subtitleTracks},s.onSubtitleTrackLoaded=function(a,l){var h=l.id,I=l.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+h);return}var O=x.details;x.details=l.details,this.log("subtitle track "+h+" loaded ["+I.startSN+"-"+I.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,l,O))},s.onLevelLoading=function(a,l){this.switchLevel(l.level)},s.onLevelSwitching=function(a,l){this.switchLevel(l.level)},s.switchLevel=function(a){var l=this.hls.levels[a];if(!(l!=null&&l.textGroupIds))return;var h=l.textGroupIds[l.urlId];if(this.groupId!==h){var I=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(S){return!h||S.groupId===h});this.tracksInGroup=w;var x=this.findTrackId(I==null?void 0:I.name)||this.findTrackId();this.groupId=h;var O={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,O),x!==-1&&this.setSubtitleTrack(x,I)}},s.findTrackId=function(a){for(var l=this.tracksInGroup,h=0;h<l.length;h++){var I=l[h];if((!this.selectDefaultTrack||I.default)&&(!a||a===I.name))return I.id}return-1},s.onError=function(a,l){if(d.prototype.onError.call(this,a,l),l.fatal||!l.context)return;l.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},s.loadPlaylist=function(a){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var h=l.id,I=l.groupId,w=l.url;if(a)try{w=a.addDirectives(w)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+h),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:w,id:h,groupId:I,deliveryDirectives:a||null})}},s.toggleTrackModes=function(a){var l=this,h=this.media,I=this.subtitleDisplay,w=this.trackId;if(!h)return;var x=c(h.textTracks),O=x.filter(function(g){return g.groupId===l.groupId});if(a===-1)[].slice.call(x).forEach(function(g){g.mode="disabled"});else{var S=O[w];S&&(S.mode="disabled")}var _=O[a];_&&(_.mode=I?"showing":"hidden")},s.setSubtitleTrack=function(a,l){var h,I=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(h=I[a])!==null&&h!==void 0&&h.details)||a<-1||a>=I.length)return;this.clearTimer();var w=I[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,w){var x=w.id,O=w.groupId,S=O===void 0?"":O,_=w.name,g=w.type,f=w.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:S,name:_,type:g,url:f});var u=this.switchParams(w.url,l==null?void 0:l.details);this.loadPlaylist(u)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:a})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,l=c(this.media.textTracks),h=0;h<l.length;h++)if(l[h].mode==="hidden")a=h;else if(l[h].mode==="showing"){a=h;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},k(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,l)}}]),r}(D.default);function c(d){for(var r=[],s=0;s<d.length;s++){var o=d[s];o.kind==="subtitles"&&o.label&&r.push(d[s])}return r}z.default=m},"./src/controller/timeline-controller.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"TimelineController",function(){return c});var V=N("./src/polyfills/number.ts"),W=N("./src/events.ts"),D=N("./src/utils/cea-608-parser.ts"),H=N("./src/utils/output-filter.ts"),F=N("./src/utils/webvtt-parser.ts"),k=N("./src/utils/texttrack-utils.ts"),T=N("./src/utils/imsc1-ttml-parser.ts"),v=N("./src/types/loader.ts"),m=N("./src/utils/logger.ts"),c=function(){function o(l){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=s(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.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 H.default(this,"textTrack1"),I=new H.default(this,"textTrack2"),w=new H.default(this,"textTrack3"),x=new H.default(this,"textTrack4");this.cea608Parser1=new D.default(1,h,I),this.cea608Parser2=new D.default(3,w,x)}l.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(W.Events.FRAG_LOADING,this.onFragLoading,this),l.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=o.prototype;return a.destroy=function(){var h=this.hls;h.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.off(W.Events.FRAG_LOADING,this.onFragLoading,this),h.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.off(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.off(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(h,I,w,x,O){for(var S=!1,_=O.length;_--;){var g=O[_],f=r(g[0],g[1],I,w);if(f>=0&&(g[0]=Math.min(g[0],I),g[1]=Math.max(g[1],w),S=!0,f/(w-I)>.5))return}if(S||O.push([I,w]),this.config.renderTextTracksNatively){var u=this.captionsTracks[h];this.Cues.newCue(u,I,w,x)}else{var E=this.Cues.newCue(null,I,w,x);this.hls.trigger(W.Events.CUES_PARSED,{type:"captions",cues:E,track:h})}},a.onInitPtsFound=function(h,I){var w=this,x=I.frag,O=I.id,S=I.initPTS,_=I.timescale,g=this.unparsedVttFrags;O==="main"&&(this.initPTS[x.cc]=S,this.timescale[x.cc]=_),g.length&&(this.unparsedVttFrags=[],g.forEach(function(f){w.onFragLoaded(W.Events.FRAG_LOADED,f)}))},a.getExistingTrack=function(h){var I=this.media;if(I)for(var w=0;w<I.textTracks.length;w++){var x=I.textTracks[w];if(x[h])return x}return null},a.createCaptionsTrack=function(h){this.config.renderTextTracksNatively?this.createNativeTrack(h):this.createNonNativeTrack(h)},a.createNativeTrack=function(h){if(this.captionsTracks[h])return;var I=this.captionsProperties,w=this.captionsTracks,x=this.media,O=I[h],S=O.label,_=O.languageCode,g=this.getExistingTrack(h);if(g)w[h]=g,Object(k.clearCurrentCues)(w[h]),Object(k.sendAddTrackEvent)(w[h],x);else{var f=this.createTextTrack("captions",S,_);f&&(f[h]=!0,w[h]=f)}},a.createNonNativeTrack=function(h){if(this.nonNativeCaptionsTracks[h])return;var I=this.captionsProperties[h];if(!I)return;var w=I.label,x={_id:h,label:w,kind:"captions",default:I.media?!!I.media.default:!1,closedCaptions:I.media};this.nonNativeCaptionsTracks[h]=x,this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},a.createTextTrack=function(h,I,w){var x=this.media;return x?x.addTextTrack(h,I,w):void 0},a.onMediaAttaching=function(h,I){this.media=I.media,this._cleanTracks()},a.onMediaDetaching=function(){var h=this.captionsTracks;Object.keys(h).forEach(function(I){Object(k.clearCurrentCues)(h[I]),delete h[I]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),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())},a._cleanTracks=function(){var h=this.media;if(!h)return;var I=h.textTracks;if(I)for(var w=0;w<I.length;w++)Object(k.clearCurrentCues)(I[w])},a.onSubtitleTracksUpdated=function(h,I){var w=this;this.textTracks=[];var x=I.subtitleTracks||[],O=x.some(function(f){return f.textCodec===T.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var S=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,u){var E;if(u<_.length){for(var b=null,y=0;y<_.length;y++)if(d(_[y],f)){b=_[y];break}b&&(E=b)}E?Object(k.clearCurrentCues)(E):(E=w.createTextTrack("subtitles",f.name,f.lang),E&&(E.mode="disabled")),E&&(E.groupId=f.groupId,w.textTracks.push(E))})}else if(!S&&this.tracks&&this.tracks.length){var g=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:g})}}},a.onManifestLoaded=function(h,I){var w=this;this.config.enableCEA708Captions&&I.captions&&I.captions.forEach(function(x){var O=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!O)return;var S="textTrack"+O[1],_=w.captionsProperties[S];if(!_)return;_.label=x.name,x.lang&&(_.languageCode=x.lang),_.media=x})},a.onFragLoading=function(h,I){var w=this.cea608Parser1,x=this.cea608Parser2,O=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(w&&x))return;if(I.frag.type===v.PlaylistLevelType.MAIN){var _,g,f=I.frag.sn,u=(_=I==null||((g=I.part)===null||g===void 0)?void 0:g.index)!=null?_:-1;f===O+1||f===O&&u===S+1||(w.reset(),x.reset()),this.lastSn=f,this.lastPartIndex=u}},a.onFragLoaded=function(h,I){var w=I.frag,x=I.payload,O=this.initPTS,S=this.unparsedVttFrags;if(w.type===v.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(V.isFiniteNumber)(O[w.cc])){S.push(I),O.length&&this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var _=w.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var g=this.tracks[w.level],f=this.vttCCs;f[w.cc]||(f[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),g&&g.textCodec===T.IMSC1_CODEC?this._parseIMSC1(w,x):this._parseVTTs(w,x,f)}}else this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(h,I){var w=this,x=this.hls;Object(T.parseIMSC1)(I,this.initPTS[h.cc],this.timescale[h.cc],function(O){w._appendCues(O,h.level),x.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(O){m.logger.log("Failed to parse IMSC1: "+O),x.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:O})})},a._parseVTTs=function(h,I,w){var x=this,O=this.hls;Object(F.parseWebVTT)(I,this.initPTS[h.cc],this.timescale[h.cc],w,h.cc,h.start,function(S){x._appendCues(S,h.level),O.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(S){x._fallbackToIMSC1(h,I),m.logger.log("Failed to parse VTT cue: "+S),O.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:S})})},a._fallbackToIMSC1=function(h,I){var w=this,x=this.tracks[h.level];x.textCodec||Object(T.parseIMSC1)(I,this.initPTS[h.cc],this.timescale[h.cc],function(){x.textCodec=T.IMSC1_CODEC,w._parseIMSC1(h,I)},function(){x.textCodec="wvtt"})},a._appendCues=function(h,I){var w=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[I];if(x.mode==="disabled")return;h.forEach(function(_){return Object(k.addCueToTrack)(x,_)})}else{var O=this.tracks[I],S=O.default?"default":"subtitles"+I;w.trigger(W.Events.CUES_PARSED,{type:"subtitles",cues:h,track:S})}},a.onFragDecrypted=function(h,I){var w=I.frag;if(w.type===v.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(I);return}this.onFragLoaded(W.Events.FRAG_LOADED,I)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(h,I){var w=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(w&&x))return;for(var O=0;O<I.samples.length;O++){var S=I.samples[O].bytes;if(S){var _=this.extractCea608Data(S);w.addData(I.samples[O].pts,_[0]),x.addData(I.samples[O].pts,_[1])}}},a.onBufferFlushing=function(h,I){var w=I.startOffset,x=I.endOffset,O=I.endOffsetSubtitles,S=I.type,_=this.media;if(!_||_.currentTime<x)return;if(!S||S==="video"){var g=this.captionsTracks;Object.keys(g).forEach(function(u){return Object(k.removeCuesInRange)(g[u],w,x)})}if(this.config.renderTextTracksNatively&&(w===0&&O!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(u){return Object(k.removeCuesInRange)(f[u],w,O)})}},a.extractCea608Data=function(h){for(var I=h[0]&31,w=2,x=[[],[]],O=0;O<I;O++){var S=h[w++],_=127&h[w++],g=127&h[w++],f=(4&S)!==0,u=3&S;if(_===0&&g===0)continue;f&&((u===0||u===1)&&(x[u].push(_),x[u].push(g)))}return x},o}();function d(o,a){return o&&o.label===a.name&&!(o.textTrack1||o.textTrack2)}function r(o,a,l,h){return Math.min(a,h)-Math.max(o,l)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(H,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=F}var D=W.prototype;return D.decrypt=function(F,k){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},k,F)},W}()},"./src/crypt/aes-decryptor.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"removePadding",function(){return W}),N.d(z,"default",function(){return D});var V=N("./src/utils/typed-array.ts");function W(H){var F=H.byteLength,k=F&&new DataView(H.buffer).getUint8(F-1);return k?Object(V.sliceUint8)(H,0,F-k):H}var D=function(){function H(){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 F=H.prototype;return F.uint8ArrayToUint32Array_=function(T){for(var v=new DataView(T),m=new Uint32Array(4),c=0;c<4;c++)m[c]=v.getUint32(c*4);return m},F.initTable=function(){var T=this.sBox,v=this.invSBox,m=this.subMix,c=m[0],d=m[1],r=m[2],s=m[3],o=this.invSubMix,a=o[0],l=o[1],h=o[2],I=o[3],w=new Uint32Array(256),x=0,O=0,S=0;for(S=0;S<256;S++)S<128?w[S]=S<<1:w[S]=S<<1^283;for(S=0;S<256;S++){var _=O^O<<1^O<<2^O<<3^O<<4;_=_>>>8^_&255^99,T[x]=_,v[_]=x;var g=w[x],f=w[g],u=w[f],E=w[_]*257^_*16843008;c[x]=E<<24|E>>>8,d[x]=E<<16|E>>>16,r[x]=E<<8|E>>>24,s[x]=E,E=u*16843009^f*65537^g*257^x*16843008,a[_]=E<<24|E>>>8,l[_]=E<<16|E>>>16,h[_]=E<<8|E>>>24,I[_]=E,x?(x=g^w[w[w[u^g]]],O^=w[w[O]]):x=O=1}},F.expandKey=function(T){for(var v=this.uint8ArrayToUint32Array_(T),m=!0,c=0;c<v.length&&m;)m=v[c]===this.key[c],c++;if(m)return;this.key=v;var d=this.keySize=v.length;if(d!==4&&d!==6&&d!==8)throw new Error("Invalid aes key size="+d);var r=this.ksRows=(d+6+1)*4,s,o,a=this.keySchedule=new Uint32Array(r),l=this.invKeySchedule=new Uint32Array(r),h=this.sBox,I=this.rcon,w=this.invSubMix,x=w[0],O=w[1],S=w[2],_=w[3],g,f;for(s=0;s<r;s++){if(s<d){g=a[s]=v[s];continue}f=g,s%d===0?(f=f<<8|f>>>24,f=h[f>>>24]<<24|h[f>>>16&255]<<16|h[f>>>8&255]<<8|h[f&255],f^=I[s/d|0]<<24):d>6&&s%d===4&&(f=h[f>>>24]<<24|h[f>>>16&255]<<16|h[f>>>8&255]<<8|h[f&255]),a[s]=g=(a[s-d]^f)>>>0}for(o=0;o<r;o++)s=r-o,o&3?f=a[s]:f=a[s-4],o<4||s<=4?l[o]=f:l[o]=x[h[f>>>24]]^O[h[f>>>16&255]]^S[h[f>>>8&255]]^_[h[f&255]],l[o]=l[o]>>>0},F.networkToHostOrderSwap=function(T){return T<<24|(T&65280)<<8|(T&16711680)>>8|T>>>24},F.decrypt=function(T,v,m){for(var c=this.keySize+6,d=this.invKeySchedule,r=this.invSBox,s=this.invSubMix,o=s[0],a=s[1],l=s[2],h=s[3],I=this.uint8ArrayToUint32Array_(m),w=I[0],x=I[1],O=I[2],S=I[3],_=new Int32Array(T),g=new Int32Array(_.length),f,u,E,b,y,P,R,U,L,j,A,X,ee,se,ce=this.networkToHostOrderSwap;v<_.length;){for(L=ce(_[v]),j=ce(_[v+1]),A=ce(_[v+2]),X=ce(_[v+3]),y=L^d[0],P=X^d[1],R=A^d[2],U=j^d[3],ee=4,se=1;se<c;se++)f=o[y>>>24]^a[P>>16&255]^l[R>>8&255]^h[U&255]^d[ee],u=o[P>>>24]^a[R>>16&255]^l[U>>8&255]^h[y&255]^d[ee+1],E=o[R>>>24]^a[U>>16&255]^l[y>>8&255]^h[P&255]^d[ee+2],b=o[U>>>24]^a[y>>16&255]^l[P>>8&255]^h[R&255]^d[ee+3],y=f,P=u,R=E,U=b,ee=ee+4;f=r[y>>>24]<<24^r[P>>16&255]<<16^r[R>>8&255]<<8^r[U&255]^d[ee],u=r[P>>>24]<<24^r[R>>16&255]<<16^r[U>>8&255]<<8^r[y&255]^d[ee+1],E=r[R>>>24]<<24^r[U>>16&255]<<16^r[y>>8&255]<<8^r[P&255]^d[ee+2],b=r[U>>>24]<<24^r[y>>16&255]<<16^r[P>>8&255]<<8^r[R&255]^d[ee+3],g[v]=ce(f^w),g[v+1]=ce(b^x),g[v+2]=ce(E^O),g[v+3]=ce(u^S),w=L,x=j,O=A,S=X,v=v+4}return g.buffer},H}()},"./src/crypt/decrypter.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return v});var V=N("./src/crypt/aes-crypto.ts"),W=N("./src/crypt/fast-aes-key.ts"),D=N("./src/crypt/aes-decryptor.ts"),H=N("./src/utils/logger.ts"),F=N("./src/utils/mp4-tools.ts"),k=N("./src/utils/typed-array.ts"),T=16,v=function(){function m(d,r,s){var o=s===void 0?{}:s,a=o.removePKCS7Padding,l=a===void 0?!0:a;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=d,this.config=r,this.removePKCS7Padding=l,l)try{var h=self.crypto;h&&(this.subtle=h.subtle||h.webkitSubtle)}catch(I){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var c=m.prototype;return c.destroy=function(){this.observer=null},c.isSync=function(){return this.config.enableSoftwareAES},c.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var s=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(D.removePadding)(s):s},c.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},c.decrypt=function(r,s,o,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),s,o);var l=this.flush();l&&a(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),s,o).then(a)},c.softwareDecrypt=function(r,s,o){var a=this.currentIV,l=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(r=Object(F.appendUint8Array)(h,r),this.remainderData=null);var I=this.getValidChunk(r);if(!I.length)return null;a&&(o=a);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new D.default),w.expandKey(s);var x=l;return this.currentResult=w.decrypt(I.buffer,0,o),this.currentIV=Object(k.sliceUint8)(I,-16).buffer,x||null},c.webCryptoDecrypt=function(r,s,o){var a=this,l=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new W.default(l,s)),this.fastAesKey.expandKey().then(function(h){if(!l)return Promise.reject(new Error("web crypto not initialized"));var I=new V.default(l,o);return I.decrypt(r.buffer,h)}).catch(function(h){return a.onWebCryptoError(h,r,s,o)})},c.onWebCryptoError=function(r,s,o,a){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,o,a)},c.getValidChunk=function(r){var s=r,o=r.length-r.length%T;return o!==r.length&&(s=Object(k.sliceUint8)(r,0,o),this.remainderData=Object(k.sliceUint8)(r,o)),s},c.logOnce=function(r){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(H,F){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=F}var D=W.prototype;return D.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},W}()},"./src/demux/aacdemuxer.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/demux/base-audio-demuxer.ts"),W=N("./src/demux/adts.ts"),D=N("./src/utils/logger.ts"),H=N("./src/demux/id3.ts");function F(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,k(v,m)}function k(v,m){return k=Object.setPrototypeOf||function(d,r){return d.__proto__=r,d},k(v,m)}var T=function(v){F(m,v);function m(d,r){var s;return s=v.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=d,s.config=r,s}var c=m.prototype;return c.resetInitSegment=function(r,s,o){v.prototype.resetInitSegment.call(this,r,s,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(r){if(!r)return!1;for(var s=H.getID3Data(r,0)||[],o=s.length,a=r.length;o<a;o++)if(W.probe(r,o))return D.logger.log("ADTS sync word found !"),!0;return!1},c.canParse=function(r,s){return W.canParse(r,s)},c.appendFrame=function(r,s,o){W.initTrackConfig(r,this.observer,s,o,r.manifestCodec);var a=W.appendFrame(r,s,o,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},m}(V.default);T.minProbeByteLength=9,z.default=T},"./src/demux/adts.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"getAudioConfig",function(){return H}),N.d(z,"isHeaderPattern",function(){return F}),N.d(z,"getHeaderLength",function(){return k}),N.d(z,"getFullFrameLength",function(){return T}),N.d(z,"canGetFrameLength",function(){return v}),N.d(z,"isHeader",function(){return m}),N.d(z,"canParse",function(){return c}),N.d(z,"probe",function(){return d}),N.d(z,"initTrackConfig",function(){return r}),N.d(z,"getFrameDuration",function(){return s}),N.d(z,"parseFrameHeader",function(){return o}),N.d(z,"appendFrame",function(){return a});var V=N("./src/utils/logger.ts"),W=N("./src/errors.ts"),D=N("./src/events.ts");function H(l,h,I,w){var x,O,S,_,g=navigator.userAgent.toLowerCase(),f=w,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((h[I+2]&192)>>>6)+1;var E=(h[I+2]&60)>>>2;if(E>u.length-1){l.trigger(D.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return S=(h[I+2]&1)<<2,S|=(h[I+3]&192)>>>6,V.logger.log("manifest codec:"+w+", ADTS type:"+x+", samplingIndex:"+E),/firefox/i.test(g)?E>=6?(x=5,_=new Array(4),O=E-3):(x=2,_=new Array(2),O=E):g.indexOf("android")!==-1?(x=2,_=new Array(2),O=E):(x=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&E>=6?O=E-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(E>=6&&S===1||/vivaldi/i.test(g))||!w&&S===1)&&(x=2,_=new Array(2)),O=E)),_[0]=x<<3,_[0]|=(E&14)>>1,_[1]|=(E&1)<<7,_[1]|=S<<3,x===5&&(_[1]|=(O&14)>>1,_[2]=(O&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:u[E],channelCount:S,codec:"mp4a.40."+x,manifestCodec:f}}function F(l,h){return l[h]===255&&(l[h+1]&246)===240}function k(l,h){return l[h+1]&1?7:9}function T(l,h){return(l[h+3]&3)<<11|l[h+4]<<3|(l[h+5]&224)>>>5}function v(l,h){return h+5<l.length}function m(l,h){return h+1<l.length&&F(l,h)}function c(l,h){return v(l,h)&&F(l,h)&&T(l,h)<=l.length-h}function d(l,h){if(m(l,h)){var I=k(l,h);if(h+I>=l.length)return!1;var w=T(l,h);if(w<=I)return!1;var x=h+w;return x===l.length||m(l,x)}return!1}function r(l,h,I,w,x){if(!l.samplerate){var O=H(h,I,w,x);if(!O)return;l.config=O.config,l.samplerate=O.samplerate,l.channelCount=O.channelCount,l.codec=O.codec,l.manifestCodec=O.manifestCodec,V.logger.log("parsed codec:"+l.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function s(l){return 1024*9e4/l}function o(l,h,I,w,x){var O=k(l,h),S=T(l,h);if(S-=O,S>0){var _=I+w*x;return{headerLength:O,frameLength:S,stamp:_}}}function a(l,h,I,w,x){var O=s(l.samplerate),S=o(h,I,w,x,O);if(S){var _=S.frameLength,g=S.headerLength,f=S.stamp,u=g+_,E=Math.max(0,I+u-h.length),b;E?(b=new Uint8Array(u-g),b.set(h.subarray(I+g,h.length),0)):b=h.subarray(I+g,I+u);var y={unit:b,pts:f};return E||l.samples.push(y),{sample:y,length:u,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"initPTSFn",function(){return T});var V=N("./src/polyfills/number.ts"),W=N("./src/demux/id3.ts"),D=N("./src/demux/dummy-demuxed-track.ts"),H=N("./src/utils/mp4-tools.ts"),F=N("./src/utils/typed-array.ts"),k=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(d,r,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(d,r){return!1},m.appendFrame=function(d,r,s){},m.demux=function(d,r){this.cachedData&&(d=Object(H.appendUint8Array)(this.cachedData,d),this.cachedData=null);var s=W.getID3Data(d,0),o=s?s.length:0,a,l,h=this._audioTrack,I=this._id3Track,w=s?W.getTimeStamp(s):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=T(w,r)),s&&s.length>0&&I.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),l=this.initPTS;o<x;){if(this.canParse(d,o)){var O=this.appendFrame(h,d,o);O?(this.frameIndex++,l=O.sample.pts,o+=O.length,a=o):o=x}else W.canParse(d,o)?(s=W.getID3Data(d,o),I.samples.push({pts:l,dts:l,data:s}),o+=s.length,a=o):o++;if(o===x&&a!==x){var S=Object(F.sliceUint8)(d,a);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:h,avcTrack:Object(D.dummyTrack)(),id3Track:I,textTrack:Object(D.dummyTrack)()}},m.demuxSampleAes=function(d,r,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(d){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(D.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(D.dummyTrack)()}},m.destroy=function(){},v}(),T=function(m,c){return Object(V.isFiniteNumber)(m)?m*90:c*9e4};z.default=k},"./src/demux/chunk-cache.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function D(){this.chunks=[],this.dataLength=0}var H=D.prototype;return H.push=function(k){this.chunks.push(k),this.dataLength+=k.length},H.flush=function(){var k=this.chunks,T=this.dataLength,v;if(k.length)k.length===1?v=k[0]:v=W(k,T);else return new Uint8Array(0);return this.reset(),v},H.reset=function(){this.chunks.length=0,this.dataLength=0},D}();function W(D,H){for(var F=new Uint8Array(H),k=0,T=0;T<D.length;T++){var v=D[T];F.set(v,k),k+=v.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/utils/logger.ts"),W=function(){function D(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var H=D.prototype;return H.loadWord=function(){var k=this.data,T=this.bytesAvailable,v=k.byteLength-T,m=new Uint8Array(4),c=Math.min(4,T);if(c===0)throw new Error("no bytes available");m.set(k.subarray(v,v+c)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=c*8,this.bytesAvailable-=c},H.skipBits=function(k){var T;this.bitsAvailable>k?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,T=k>>3,k-=T>>3,this.bytesAvailable-=T,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},H.readBits=function(k){var T=Math.min(this.bitsAvailable,k),v=this.word>>>32-T;return k>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=T,this.bitsAvailable>0?this.word<<=T:this.bytesAvailable>0&&this.loadWord(),T=k-T,T>0&&this.bitsAvailable?v<<T|this.readBits(T):v},H.skipLZ=function(){var k;for(k=0;k<this.bitsAvailable;++k)if((this.word&2147483648>>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},H.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(k){for(var T=8,v=8,m,c=0;c<k;c++)v!==0&&(m=this.readEG(),v=(T+m+256)%256),T=v===0?T:v},H.readSPS=function(){var k=0,T=0,v=0,m=0,c,d,r,s=this.readUByte.bind(this),o=this.readBits.bind(this),a=this.readUEG.bind(this),l=this.readBoolean.bind(this),h=this.skipBits.bind(this),I=this.skipEG.bind(this),w=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);s();var O=s();if(o(5),h(3),s(),w(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var S=a();if(S===3&&h(1),w(),w(),h(1),l())for(d=S!==3?8:12,r=0;r<d;r++)l()&&(r<6?x(16):x(64))}w();var _=a();if(_===0)a();else if(_===1)for(h(1),I(),I(),c=a(),r=0;r<c;r++)I();w(),h(1);var g=a(),f=a(),u=o(1);u===0&&h(1),h(1),l()&&(k=a(),T=a(),v=a(),m=a());var E=[1,1];if(l()&&l()){var b=s();switch(b){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((g+1)*16-k*2-T*2),height:(2-u)*(f+1)*16-(u?2:4)*(v+m),pixelRatio:E}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},D}();z.default=W},"./src/demux/id3.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"isHeader",function(){return V}),N.d(z,"isFooter",function(){return W}),N.d(z,"getID3Data",function(){return D}),N.d(z,"canParse",function(){return F}),N.d(z,"getTimeStamp",function(){return k}),N.d(z,"isTimeStampFrame",function(){return T}),N.d(z,"getID3Frames",function(){return m}),N.d(z,"decodeFrame",function(){return c}),N.d(z,"utf8ArrayToStr",function(){return a}),N.d(z,"testables",function(){return l});var V=function(x,O){return O+10<=x.length&&(x[O]===73&&x[O+1]===68&&x[O+2]===51&&(x[O+3]<255&&x[O+4]<255&&(x[O+6]<128&&x[O+7]<128&&x[O+8]<128&&x[O+9]<128)))},W=function(x,O){return O+10<=x.length&&(x[O]===51&&x[O+1]===68&&x[O+2]===73&&(x[O+3]<255&&x[O+4]<255&&(x[O+6]<128&&x[O+7]<128&&x[O+8]<128&&x[O+9]<128)))},D=function(x,O){for(var S=O,_=0;V(x,O);){_+=10;var g=H(x,O+6);_+=g,W(x,O+10)&&(_+=10),O+=_}return _>0?x.subarray(S,S+_):void 0},H=function(x,O){var S=0;return S=(x[O]&127)<<21,S|=(x[O+1]&127)<<14,S|=(x[O+2]&127)<<7,S|=x[O+3]&127,S},F=function(x,O){return V(x,O)&&H(x,O+6)+10<=x.length-O},k=function(x){for(var O=m(x),S=0;S<O.length;S++){var _=O[S];if(T(_))return o(_)}return},T=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},v=function(x){var O=String.fromCharCode(x[0],x[1],x[2],x[3]),S=H(x,4),_=10;return{type:O,size:S,data:x.subarray(_,_+S)}},m=function(x){for(var O=0,S=[];V(x,O);){var _=H(x,O+6);O+=10;for(var g=O+_;O+8<g;){var f=v(x.subarray(O)),u=c(f);u&&S.push(u),O+=f.size+10}W(x,O)&&(O+=10)}return S},c=function(x){return x.type==="PRIV"?d(x):x.type[0]==="W"?s(x):r(x)},d=function(x){if(x.size<2)return;var O=a(x.data,!0),S=new Uint8Array(x.data.subarray(O.length+1));return{key:x.type,info:O,data:S.buffer}},r=function(x){if(x.size<2)return;if(x.type==="TXXX"){var O=1,S=a(x.data.subarray(O),!0);O+=S.length+1;var _=a(x.data.subarray(O));return{key:x.type,info:S,data:_}}var g=a(x.data.subarray(1));return{key:x.type,data:g}},s=function(x){if(x.type==="WXXX"){if(x.size<2)return;var O=1,S=a(x.data.subarray(O),!0);O+=S.length+1;var _=a(x.data.subarray(O));return{key:x.type,info:S,data:_}}var g=a(x.data);return{key:x.type,data:g}},o=function(x){if(x.data.byteLength===8){var O=new Uint8Array(x.data),S=O[3]&1,_=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return _/=45,S&&(_+=4772185884e-2),Math.round(_)}return},a=function(x,O){O===void 0&&(O=!1);var S=I();if(S){var _=S.decode(x);if(O){var g=_.indexOf("\0");return g!==-1?_.substring(0,g):_}return _.replace(/\0/g,"")}for(var f=x.length,u,E,b,y="",P=0;P<f;){if(u=x[P++],u===0&&O)return y;if(u===0||u===3)continue;switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(u);break;case 12:case 13:E=x[P++],y+=String.fromCharCode((u&31)<<6|E&63);break;case 14:E=x[P++],b=x[P++],y+=String.fromCharCode((u&15)<<12|(E&63)<<6|(b&63)<<0);break;default:}}return y},l={decodeTextFrame:r},h;function I(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/demux/base-audio-demuxer.ts"),W=N("./src/demux/id3.ts"),D=N("./src/utils/logger.ts"),H=N("./src/demux/mpegaudio.ts");function F(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,k(v,m)}function k(v,m){return k=Object.setPrototypeOf||function(d,r){return d.__proto__=r,d},k(v,m)}var T=function(v){F(m,v);function m(){return v.apply(this,arguments)||this}var c=m.prototype;return c.resetInitSegment=function(r,s,o){v.prototype.resetInitSegment.call(this,r,s,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(r){if(!r)return!1;for(var s=W.getID3Data(r,0)||[],o=s.length,a=r.length;o<a;o++)if(H.probe(r,o))return D.logger.log("MPEG Audio sync word found !"),!0;return!1},c.canParse=function(r,s){return H.canParse(r,s)},c.appendFrame=function(r,s,o){return this.initPTS===null?void 0:H.appendFrame(r,s,o,this.initPTS,this.frameIndex)},m}(V.default);T.minProbeByteLength=4,z.default=T},"./src/demux/mp4demuxer.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/utils/mp4-tools.ts"),W=N("./src/demux/dummy-demuxed-track.ts"),D=function(){function H(k,T){this.remainderData=null,this.config=void 0,this.config=T}var F=H.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},H.probe=function(T){return Object(V.findBox)({data:T,start:0,end:Math.min(T.length,16384)},["moof"]).length>0},F.demux=function(T){var v=T,m=Object(W.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(V.appendUint8Array)(this.remainderData,T));var c=Object(V.segmentValidRange)(v);this.remainderData=c.remainder,m.samples=c.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(W.dummyTrack)(),avcTrack:m,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},F.flush=function(){var T=Object(W.dummyTrack)();return T.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(W.dummyTrack)(),avcTrack:T,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},F.demuxSampleAes=function(T,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},H}();D.minProbeByteLength=1024,z.default=D},"./src/demux/mpegaudio.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"appendFrame",function(){return k}),N.d(z,"parseHeader",function(){return T}),N.d(z,"isHeaderPattern",function(){return v}),N.d(z,"isHeader",function(){return m}),N.d(z,"canParse",function(){return c}),N.d(z,"probe",function(){return d});var V=null,W=[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],D=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function k(r,s,o,a,l){if(o+24>s.length)return;var h=T(s,o);if(h&&o+h.frameLength<=s.length){var I=h.samplesPerFrame*9e4/h.sampleRate,w=a+l*I,x={unit:s.subarray(o,o+h.frameLength),pts:w,dts:w};return r.config=[],r.channelCount=h.channelCount,r.samplerate=h.sampleRate,r.samples.push(x),{sample:x,length:h.frameLength,missing:0}}}function T(r,s){var o=r[s+1]>>3&3,a=r[s+1]>>1&3,l=r[s+2]>>4&15,h=r[s+2]>>2&3;if(o!==1&&l!==0&&l!==15&&h!==3){var I=r[s+2]>>1&1,w=r[s+3]>>6,x=o===3?3-a:a===3?3:4,O=W[x*14+l-1]*1e3,S=o===3?0:o===2?1:2,_=D[S*3+h],g=w===3?1:2,f=H[o][a],u=F[a],E=f*8*u,b=Math.floor(f*O/_+I)*u;if(V===null){var y=navigator.userAgent||"",P=y.match(/Chrome\/(\d+)/i);V=P?parseInt(P[1]):0}var R=!!V&&V<=87;return R&&a===2&&O>=224e3&&w===0&&(r[s+3]=r[s+3]|128),{sampleRate:_,channelCount:g,frameLength:b,samplesPerFrame:E}}}function v(r,s){return r[s]===255&&(r[s+1]&224)===224&&(r[s+1]&6)!==0}function m(r,s){return s+1<r.length&&v(r,s)}function c(r,s){var o=4;return v(r,s)&&o<=r.length-s}function d(r,s){if(s+1<r.length&&v(r,s)){var o=4,a=T(r,s),l=o;a!=null&&a.frameLength&&(l=a.frameLength);var h=s+l;return h===r.length||m(r,h)}return!1}},"./src/demux/sample-aes.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/crypt/decrypter.ts"),W=N("./src/demux/tsdemuxer.ts"),D=function(){function H(k,T,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new V.default(k,T,{removePKCS7Padding:!1})}var F=H.prototype;return F.decryptBuffer=function(T,v){this.decrypter.decrypt(T,this.keyData.key.buffer,this.keyData.iv.buffer,v)},F.decryptAacSample=function(T,v,m,c){var d=T[v].unit,r=d.subarray(16,d.length-d.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),o=this;this.decryptBuffer(s,function(a){var l=new Uint8Array(a);d.set(l,16),c||o.decryptAacSamples(T,v+1,m)})},F.decryptAacSamples=function(T,v,m){for(;;v++){if(v>=T.length){m();return}if(T[v].unit.length<32)continue;var c=this.decrypter.isSync();if(this.decryptAacSample(T,v,m,c),!c)return}},F.getAvcEncryptedData=function(T){for(var v=Math.floor((T.length-48)/160)*16+16,m=new Int8Array(v),c=0,d=32;d<=T.length-16;d+=160,c+=16)m.set(T.subarray(d,d+16),c);return m},F.getAvcDecryptedUnit=function(T,v){for(var m=new Uint8Array(v),c=0,d=32;d<=T.length-16;d+=160,c+=16)T.set(m.subarray(c,c+16),d);return T},F.decryptAvcSample=function(T,v,m,c,d,r){var s=Object(W.discardEPB)(d.data),o=this.getAvcEncryptedData(s),a=this;this.decryptBuffer(o.buffer,function(l){d.data=a.getAvcDecryptedUnit(s,l),r||a.decryptAvcSamples(T,v,m+1,c)})},F.decryptAvcSamples=function(T,v,m,c){if(T instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=T.length){c();return}for(var d=T[v].units;!(m>=d.length);m++){var r=d[m];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(T,v,m,c,r,s),!s)return}}},H}();z.default=D},"./src/demux/transmuxer-interface.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return d});var V=N("./node_modules/webworkify-webpack/index.js"),W=N.n(V),D=N("./src/events.ts"),H=N("./src/demux/transmuxer.ts"),F=N("./src/utils/logger.ts"),k=N("./src/errors.ts"),T=N("./src/utils/mediasource-helper.ts"),v=N("./node_modules/eventemitter3/index.js"),m=N.n(v),c=Object(T.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function r(o,a,l,h){var I=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=o,this.id=a,this.onTransmuxComplete=l,this.onFlush=h;var w=o.config,x=function(f,u){u=u||{},u.frag=I.frag,u.id=I.id,o.trigger(f,u)};this.observer=new v.EventEmitter,this.observer.on(D.Events.FRAG_DECRYPTED,x),this.observer.on(D.Events.ERROR,x);var O={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var _;try{_=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(g){o.trigger(D.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(g.message+" ("+g.filename+":"+g.lineno+")")})},_.postMessage({cmd:"init",typeSupported:O,vendor:S,id:a,config:JSON.stringify(w)})}catch(g){F.logger.warn("Error in worker:",g),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new H.default(this.observer,O,w,S,a),this.worker=null}}else this.transmuxer=new H.default(this.observer,O,w,S,a)}var s=r.prototype;return s.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},s.push=function(a,l,h,I,w,x,O,S,_,g){var f=this;_.transmuxing.start=self.performance.now();var u=this.transmuxer,E=this.worker,b=x?x.start:w.start,y=w.decryptdata,P=this.frag,R=!(P&&w.cc===P.cc),U=!(P&&_.level===P.level),L=P?_.sn-P.sn:-1,j=this.part?_.part-this.part.index:1,A=!U&&(L===1||L===0&&j===1),X=self.performance.now();(U||L||w.stats.parsing.start===0)&&(w.stats.parsing.start=X),x&&(j||!A)&&(x.stats.parsing.start=X);var ee=new H.TransmuxState(R,A,S,U,b);if(!A||R){F.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
discontinuity: `+R+`
trackSwitch: `+U+`
contiguous: `+A+`
accurateTimeOffset: `+S+`
timeOffset: `+b);var se=new H.TransmuxConfig(h,I,l,O,g);this.configureTransmuxer(se)}if(this.frag=w,this.part=x,E)E.postMessage({cmd:"demux",data:a,decryptdata:y,chunkMeta:_,state:ee},a instanceof ArrayBuffer?[a]:[]);else if(u){var ce=u.push(a,y,_,ee);Object(H.isPromise)(ce)?ce.then(function(Le){f.handleTransmuxComplete(Le)}):this.handleTransmuxComplete(ce)}},s.flush=function(a){var l=this;a.transmuxing.start=self.performance.now();var h=this.transmuxer,I=this.worker;if(I)I.postMessage({cmd:"flush",chunkMeta:a});else if(h){var w=h.flush(a);Object(H.isPromise)(w)?w.then(function(x){l.handleFlushResult(x,a)}):this.handleFlushResult(w,a)}},s.handleFlushResult=function(a,l){var h=this;a.forEach(function(I){h.handleTransmuxComplete(I)}),this.onFlush(l)},s.onWorkerMessage=function(a){var l=a.data,h=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,h.trigger(l.event,l.data);break}}},s.configureTransmuxer=function(a){var l=this.worker,h=this.transmuxer;l?l.postMessage({cmd:"configure",config:a}):h&&h.configure(a)},s.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},r}()},"./src/demux/transmuxer-worker.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return k});var V=N("./src/demux/transmuxer.ts"),W=N("./src/events.ts"),D=N("./src/utils/logger.ts"),H=N("./node_modules/eventemitter3/index.js"),F=N.n(H);function k(d){var r=new H.EventEmitter,s=function(a,l){d.postMessage({event:a,data:l})};r.on(W.Events.FRAG_DECRYPTED,s),r.on(W.Events.ERROR,s),d.addEventListener("message",function(o){var a=o.data;switch(a.cmd){case"init":{var l=JSON.parse(a.config);d.transmuxer=new V.default(r,a.typeSupported,l,a.vendor,a.id),Object(D.enableLogs)(l.debug),s("init",null);break}case"configure":{d.transmuxer.configure(a.config);break}case"demux":{var h=d.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(h)?h.then(function(x){T(d,x)}):T(d,h);break}case"flush":{var I=a.chunkMeta,w=d.transmuxer.flush(I);Object(V.isPromise)(w)?w.then(function(x){m(d,x,I)}):m(d,w,I);break}default:break}})}function T(d,r){if(c(r.remuxResult))return;var s=[],o=r.remuxResult,a=o.audio,l=o.video;a&&v(s,a),l&&v(s,l),d.postMessage({event:"transmuxComplete",data:r},s)}function v(d,r){r.data1&&d.push(r.data1.buffer),r.data2&&d.push(r.data2.buffer)}function m(d,r,s){r.forEach(function(o){T(d,o)}),d.postMessage({event:"flush",data:s})}function c(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return l}),N.d(z,"isPromise",function(){return w}),N.d(z,"TransmuxConfig",function(){return x}),N.d(z,"TransmuxState",function(){return O});var V=N("./src/events.ts"),W=N("./src/errors.ts"),D=N("./src/crypt/decrypter.ts"),H=N("./src/demux/aacdemuxer.ts"),F=N("./src/demux/mp4demuxer.ts"),k=N("./src/demux/tsdemuxer.ts"),T=N("./src/demux/mp3demuxer.ts"),v=N("./src/remux/mp4-remuxer.ts"),m=N("./src/remux/passthrough-remuxer.ts"),c=N("./src/demux/chunk-cache.ts"),d=N("./src/utils/mp4-tools.ts"),r=N("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(S){r.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var o=[{demux:k.default,remux:v.default},{demux:F.default,remux:m.default},{demux:H.default,remux:v.default},{demux:T.default,remux:v.default}],a=1024;o.forEach(function(S){var _=S.demux;a=Math.max(a,_.minProbeByteLength)});var l=function(){function S(g,f,u,E,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 c.default,this.observer=g,this.typeSupported=f,this.config=u,this.vendor=E,this.id=b}var _=S.prototype;return _.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},_.push=function(f,u,E,b){var y=this,P=E.transmuxing;P.executeStart=s();var R=new Uint8Array(f),U=this.cache,L=this.config,j=this.currentTransmuxState,A=this.transmuxConfig;b&&(this.currentTransmuxState=b);var X=h(R,u);if(X&&X.method==="AES-128"){var ee=this.getDecrypter();if(L.enableSoftwareAES){var se=ee.softwareDecrypt(R,X.key.buffer,X.iv.buffer);if(!se)return P.executeEnd=s(),I(E);R=new Uint8Array(se)}else return this.decryptionPromise=ee.webCryptoDecrypt(R,X.key.buffer,X.iv.buffer).then(function(Ge){var Qe=y.push(Ge,null,E);return y.decryptionPromise=null,Qe}),this.decryptionPromise}var ce=b||j,Le=ce.contiguous,Ce=ce.discontinuity,Ae=ce.trackSwitch,Pe=ce.accurateTimeOffset,Ie=ce.timeOffset,pe=A.audioCodec,de=A.videoCodec,ne=A.defaultInitPts,ge=A.duration,oe=A.initSegmentData;if((Ce||Ae)&&this.resetInitSegment(oe,pe,de,ge),Ce&&this.resetInitialTimestamp(ne),Le||this.resetContiguity(),this.needsProbing(R,Ce,Ae)){if(U.dataLength){var De=U.flush();R=Object(d.appendUint8Array)(De,R)}this.configureTransmuxer(R,A)}var Ue=this.transmux(R,X,Ie,Pe,E),we=this.currentTransmuxState;return we.contiguous=!0,we.discontinuity=!1,we.trackSwitch=!1,P.executeEnd=s(),Ue},_.flush=function(f){var u=this,E=f.transmuxing;E.executeStart=s();var b=this.decrypter,y=this.cache,P=this.currentTransmuxState,R=this.decryptionPromise;if(R)return R.then(function(){return u.flush(f)});var U=[],L=P.timeOffset;if(b){var j=b.flush();j&&U.push(this.push(j,null,f))}var A=y.dataLength;y.reset();var X=this.demuxer,ee=this.remuxer;if(!X||!ee)return A>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=s(),[I(f)];var se=X.flush(L);return w(se)?se.then(function(ce){return u.flushRemux(U,ce,f),U}):(this.flushRemux(U,se,f),U)},_.flushRemux=function(f,u,E){var b=u.audioTrack,y=u.avcTrack,P=u.id3Track,R=u.textTrack,U=this.currentTransmuxState,L=U.accurateTimeOffset,j=U.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var A=this.remuxer.remux(b,y,P,R,j,L,!0,this.id);f.push({remuxResult:A,chunkMeta:E}),E.transmuxing.executeEnd=s()},_.resetInitialTimestamp=function(f){var u=this.demuxer,E=this.remuxer;if(!u||!E)return;u.resetTimeStamp(f),E.resetTimeStamp(f)},_.resetContiguity=function(){var f=this.demuxer,u=this.remuxer;if(!f||!u)return;f.resetContiguity(),u.resetNextTimestamp()},_.resetInitSegment=function(f,u,E,b){var y=this.demuxer,P=this.remuxer;if(!y||!P)return;y.resetInitSegment(u,E,b),P.resetInitSegment(f,u,E)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(f,u,E,b,y){var P;return u&&u.method==="SAMPLE-AES"?P=this.transmuxSampleAes(f,u,E,b,y):P=this.transmuxUnencrypted(f,E,b,y),P},_.transmuxUnencrypted=function(f,u,E,b){var y=this.demuxer.demux(f,u,!1,!this.config.progressive),P=y.audioTrack,R=y.avcTrack,U=y.id3Track,L=y.textTrack,j=this.remuxer.remux(P,R,U,L,u,E,!1,this.id);return{remuxResult:j,chunkMeta:b}},_.transmuxSampleAes=function(f,u,E,b,y){var P=this;return this.demuxer.demuxSampleAes(f,u,E).then(function(R){var U=P.remuxer.remux(R.audioTrack,R.avcTrack,R.id3Track,R.textTrack,E,b,!1,P.id);return{remuxResult:U,chunkMeta:y}})},_.configureTransmuxer=function(f,u){for(var E=this.config,b=this.observer,y=this.typeSupported,P=this.vendor,R=u.audioCodec,U=u.defaultInitPts,L=u.duration,j=u.initSegmentData,A=u.videoCodec,X,ee=0,se=o.length;ee<se;ee++)if(o[ee].demux.probe(f)){X=o[ee];break}X||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:F.default,remux:m.default});var ce=this.demuxer,Le=this.remuxer,Ce=X.remux,Ae=X.demux;(!Le||!(Le instanceof Ce))&&(this.remuxer=new Ce(b,E,y,P)),(!ce||!(ce instanceof Ae))&&(this.demuxer=new Ae(b,E,y),this.probe=Ae.probe),this.resetInitSegment(j,R,A,L),this.resetInitialTimestamp(U)},_.needsProbing=function(f,u,E){return!this.demuxer||!this.remuxer||u||E},_.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new D.default(this.observer,this.config)),f},S}();function h(S,_){var g=null;return S.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(g=_),g}var I=function(_){return{remuxResult:{},chunkMeta:_}};function w(S){return"then"in S&&S.then instanceof Function}var x=function(_,g,f,u,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=g,this.initSegmentData=f,this.duration=u,this.defaultInitPts=E},O=function(_,g,f,u,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=g,this.accurateTimeOffset=f,this.trackSwitch=u,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"discardEPB",function(){return I});var V=N("./src/demux/adts.ts"),W=N("./src/demux/mpegaudio.ts"),D=N("./src/demux/exp-golomb.ts"),H=N("./src/demux/id3.ts"),F=N("./src/demux/sample-aes.ts"),k=N("./src/events.ts"),T=N("./src/utils/mp4-tools.ts"),v=N("./src/utils/logger.ts"),m=N("./src/errors.ts"),c={video:1,audio:2,id3:3,text:4},d=function(){function w(O,S,_){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=O,this.config=S,this.typeSupported=_}w.probe=function(S){var _=w.syncOffset(S);return _<0?!1:(_&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(S){for(var _=Math.min(1e3,S.length-3*188),g=0;g<_;){if(S[g]===71&&S[g+188]===71&&S[g+2*188]===71)return g;g++}return-1},w.createTrack=function(S,_){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:c[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?_:void 0}};var x=w.prototype;return x.resetInitSegment=function(S,_,g){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",g),this._audioTrack=w.createTrack("audio",g),this._id3Track=w.createTrack("id3",g),this._txtTrack=w.createTrack("text",g),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=_,this._duration=g},x.resetTimeStamp=function(){},x.resetContiguity=function(){var S=this._audioTrack,_=this._avcTrack,g=this._id3Track;S&&(S.pesData=null),_&&(_.pesData=null),g&&(g.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(S,_,g,f){g===void 0&&(g=!1),f===void 0&&(f=!1),g||(this.sampleAes=null);var u,E=this._avcTrack,b=this._audioTrack,y=this._id3Track,P=E.pid,R=E.pesData,U=b.pid,L=y.pid,j=b.pesData,A=y.pesData,X=!1,ee=this.pmtParsed,se=this._pmtId,ce=S.length;if(this.remainderData&&(S=Object(T.appendUint8Array)(this.remainderData,S),ce=S.length,this.remainderData=null),ce<188&&!f)return this.remainderData=S,{audioTrack:b,avcTrack:E,id3Track:y,textTrack:this._txtTrack};var Le=Math.max(0,w.syncOffset(S));ce-=(ce+Le)%188,ce<S.byteLength&&!f&&(this.remainderData=new Uint8Array(S.buffer,ce,S.buffer.byteLength-ce));for(var Ce=Le;Ce<ce;Ce+=188)if(S[Ce]===71){var Ae=!!(S[Ce+1]&64),Pe=((S[Ce+1]&31)<<8)+S[Ce+2],Ie=(S[Ce+3]&48)>>4,pe=void 0;if(Ie>1){if(pe=Ce+5+S[Ce+4],pe===Ce+188)continue}else pe=Ce+4;switch(Pe){case P:Ae&&(R&&(u=a(R))&&this.parseAVCPES(u,!1),R={data:[],size:0}),R&&(R.data.push(S.subarray(pe,Ce+188)),R.size+=Ce+188-pe);break;case U:Ae&&(j&&(u=a(j))&&(b.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),j={data:[],size:0}),j&&(j.data.push(S.subarray(pe,Ce+188)),j.size+=Ce+188-pe);break;case L:Ae&&(A&&(u=a(A))&&this.parseID3PES(u),A={data:[],size:0}),A&&(A.data.push(S.subarray(pe,Ce+188)),A.size+=Ce+188-pe);break;case 0:Ae&&(pe+=S[pe]+1),se=this._pmtId=s(S,pe);break;case se:{Ae&&(pe+=S[pe]+1);var de=o(S,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,g);P=de.avc,P>0&&(E.pid=P),U=de.audio,U>0&&(b.pid=U,b.isAAC=de.isAAC),L=de.id3,L>0&&(y.pid=L),X&&!ee&&(v.logger.log("reparse from beginning"),X=!1,Ce=Le-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=R,b.pesData=j,y.pesData=A;var ne={audioTrack:b,avcTrack:E,id3Track:y,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(ne),ne},x.flush=function(){var S=this.remainderData;this.remainderData=null;var _;return S?_=this.demux(S,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},x.extractRemainingSamples=function(S){var _=S.audioTrack,g=S.avcTrack,f=S.id3Track,u=g.pesData,E=_.pesData,b=f.pesData,y;u&&(y=a(u))?(this.parseAVCPES(y,!0),g.pesData=null):g.pesData=u,E&&(y=a(E))?(_.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),_.pesData=null):(E!=null&&E.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=E),b&&(y=a(b))?(this.parseID3PES(y),f.pesData=null):f.pesData=b},x.demuxSampleAes=function(S,_,g){var f=this.demux(S,g,!0,!this.config.progressive),u=this.sampleAes=new F.default(this.observer,this.config,_);return this.decrypt(f,u)},x.decrypt=function(S,_){return new Promise(function(g){var f=S.audioTrack,u=S.avcTrack;f.samples&&f.isAAC?_.decryptAacSamples(f.samples,0,function(){u.samples?_.decryptAvcSamples(u.samples,0,0,function(){g(S)}):g(S)}):u.samples&&_.decryptAvcSamples(u.samples,0,0,function(){g(S)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(S,_){var g=this,f=this._avcTrack,u=this.parseAVCNALu(S.data),E=!1,b=this.avcSample,y,P=!1;S.data=null,b&&u.length&&!f.audFound&&(l(b,f),b=this.avcSample=r(!1,S.pts,S.dts,"")),u.forEach(function(R){switch(R.type){case 1:{y=!0,b||(b=g.avcSample=r(!0,S.pts,S.dts,"")),E&&(b.debug+="NDR "),b.frame=!0;var U=R.data;if(P&&U.length>4){var L=new D.default(U).readSliceType();(L===2||L===4||L===7||L===9)&&(b.key=!0)}break}case 5:y=!0,b||(b=g.avcSample=r(!0,S.pts,S.dts,"")),E&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{y=!0,E&&b&&(b.debug+="SEI ");var j=new D.default(I(R.data));j.readUByte();for(var A=0,X=0,ee=!1,se=0;!ee&&j.bytesAvailable>1;){A=0;do se=j.readUByte(),A+=se;while(se===255);X=0;do se=j.readUByte(),X+=se;while(se===255);if(A===4&&j.bytesAvailable!==0){ee=!0;var ce=j.readUByte();if(ce===181){var Le=j.readUShort();if(Le===49){var Ce=j.readUInt();if(Ce===1195456820){var Ae=j.readUByte();if(Ae===3){for(var Pe=j.readUByte(),Ie=j.readUByte(),pe=31&Pe,de=[Pe,Ie],ne=0;ne<pe;ne++)de.push(j.readUByte()),de.push(j.readUByte()),de.push(j.readUByte());h(g._txtTrack.samples,{type:3,pts:S.pts,bytes:de})}}}}}else if(A===5&&j.bytesAvailable!==0){if(ee=!0,X>16){for(var ge=[],oe=0;oe<16;oe++)ge.push(j.readUByte().toString(16)),(oe===3||oe===5||oe===7||oe===9)&&ge.push("-");for(var De=X-16,Ue=new Uint8Array(De),we=0;we<De;we++)Ue[we]=j.readUByte();h(g._txtTrack.samples,{pts:S.pts,payloadType:A,uuid:ge.join(""),userData:Object(H.utf8ArrayToStr)(Ue),userDataBytes:Ue})}}else if(X<j.bytesAvailable)for(var Ge=0;Ge<X;Ge++)j.readUByte()}break}case 7:if(y=!0,P=!0,E&&b&&(b.debug+="SPS "),!f.sps){var Qe=new D.default(R.data),et=Qe.readSPS();f.width=et.width,f.height=et.height,f.pixelRatio=et.pixelRatio,f.sps=[R.data],f.duration=g._duration;for(var ze=R.data.subarray(1,4),Je="avc1.",Xe=0;Xe<3;Xe++){var yt=ze[Xe].toString(16);yt.length<2&&(yt="0"+yt),Je+=yt}f.codec=Je}break;case 8:y=!0,E&&b&&(b.debug+="PPS "),f.pps||(f.pps=[R.data]);break;case 9:y=!1,f.audFound=!0,b&&l(b,f),b=g.avcSample=r(!1,S.pts,S.dts,E?"AUD ":"");break;case 12:y=!1;break;default:y=!1,b&&(b.debug+="unknown NAL "+R.type+" ");break}if(b&&y){var xt=b.units;xt.push(R)}}),_&&b&&(l(b,f),this.avcSample=null)},x.getLastNalUnit=function(){var S,_=this.avcSample,g;if(!_||_.units.length===0){var f=this._avcTrack.samples;_=f[f.length-1]}if((S=_)!==null&&S!==void 0&&S.units){var u=_.units;g=u[u.length-1]}return g},x.parseAVCNALu=function(S){var _=S.byteLength,g=this._avcTrack,f=g.naluState||0,u=f,E=[],b=0,y,P,R,U=-1,L=0;for(f===-1&&(U=0,L=S[0]&31,f=0,b=1);b<_;){if(y=S[b++],!f){f=y?0:1;continue}if(f===1){f=y?0:2;continue}if(!y)f=3;else if(y===1){if(U>=0){var j={data:S.subarray(U,b-f-1),type:L};E.push(j)}else{var A=this.getLastNalUnit();if(A&&(u&&b<=4-u&&(A.state&&(A.data=A.data.subarray(0,A.data.byteLength-u))),P=b-f-1,P>0)){var X=new Uint8Array(A.data.byteLength+P);X.set(A.data,0),X.set(S.subarray(0,P),A.data.byteLength),A.data=X,A.state=0}}b<_?(R=S[b]&31,U=b,L=R,f=0):f=-1}else f=0}if(U>=0&&f>=0){var ee={data:S.subarray(U,_),type:L,state:f};E.push(ee)}if(E.length===0){var se=this.getLastNalUnit();if(se){var ce=new Uint8Array(se.data.byteLength+S.byteLength);ce.set(se.data,0),ce.set(S,se.data.byteLength),se.data=ce}}return g.naluState=f,E},x.parseAACPES=function(S){var _=0,g=this._audioTrack,f=this.aacOverFlow,u=S.data;if(f){this.aacOverFlow=null;var E=f.sample.unit.byteLength,b=Math.min(f.missing,E),y=E-b;f.sample.unit.set(u.subarray(0,b),y),g.samples.push(f.sample),_=f.missing}var P,R;for(P=_,R=u.length;P<R-1&&!V.isHeader(u,P);P++);if(P!==_){var U,L;if(P<R-1?(U="AAC PES did not start with ADTS header,offset:"+P,L=!1):(U="no ADTS header found in AAC PES",L=!0),v.logger.warn("parsing error:"+U),this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:L,reason:U}),L)return}V.initTrackConfig(g,this.observer,u,P,this.audioCodec);var j;if(S.pts!==void 0)j=S.pts;else if(f){var A=V.getFrameDuration(g.samplerate);j=f.sample.pts+A}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;P<R;)if(V.isHeader(u,P)){if(P+5<R){var ee=V.appendFrame(g,u,P,j,X);if(ee)if(ee.missing)this.aacOverFlow=ee;else{P+=ee.length,X++;continue}}break}else P++},x.parseMPEGPES=function(S){var _=S.data,g=_.length,f=0,u=0,E=S.pts;if(E===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;u<g;)if(W.isHeader(_,u)){var b=W.appendFrame(this._audioTrack,_,u,E,f);if(b)u+=b.length,f++;else break}else u++},x.parseID3PES=function(S){if(S.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},w}();d.minProbeByteLength=188;function r(w,x,O,S){return{key:w,frame:!1,pts:x,dts:O,units:[],debug:S,length:0}}function s(w,x){return(w[x+10]&31)<<8|w[x+11]}function o(w,x,O,S){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},g=(w[x+1]&15)<<8|w[x+2],f=x+3+g-4,u=(w[x+10]&15)<<8|w[x+11];for(x+=12+u;x<f;){var E=(w[x+1]&31)<<8|w[x+2];switch(w[x]){case 207:if(!S){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=E);break;case 21:_.id3===-1&&(_.id3=E);break;case 219:if(!S){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=E);break;case 3:case 4:O?_.audio===-1&&(_.audio=E,_.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((w[x+3]&15)<<8|w[x+4])+5}return _}function a(w){var x=0,O,S,_,g,f,u=w.data;if(!w||w.size===0)return null;for(;u[0].length<19&&u.length>1;){var E=new Uint8Array(u[0].length+u[1].length);E.set(u[0]),E.set(u[1],u[0].length),u[0]=E,u.splice(1,1)}O=u[0];var b=(O[0]<<16)+(O[1]<<8)+O[2];if(b===1){if(S=(O[4]<<8)+O[5],S&&S>w.size-6)return null;var y=O[7];y&192&&(g=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,y&64?(f=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,g-f>60*9e4&&(v.logger.warn(Math.round((g-f)/9e4)+"s delta between PTS and DTS, align them"),g=f)):f=g),_=O[8];var P=_+9;if(w.size<=P)return null;w.size-=P;for(var R=new Uint8Array(w.size),U=0,L=u.length;U<L;U++){O=u[U];var j=O.byteLength;if(P)if(P>j){P-=j;continue}else O=O.subarray(P),j-=P,P=0;R.set(O,x),x+=j}return S&&(S-=_+3),{data:R,pts:g,dts:f,len:S}}return null}function l(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var O=x.samples,S=O.length;if(S){var _=O[S-1];w.pts=_.pts,w.dts=_.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&v.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function h(w,x){var O=w.length;if(O>0){if(x.pts>=w[O-1].pts)w.push(x);else for(var S=O-1;S>=0;S--)if(x.pts<w[S].pts){w.splice(S,0,x);break}}else w.push(x)}function I(w){for(var x=w.byteLength,O=[],S=1;S<x-2;)w[S]===0&&w[S+1]===0&&w[S+2]===3?(O.push(S+2),S+=2):S++;if(O.length===0)return w;var _=x-O.length,g=new Uint8Array(_),f=0;for(S=0;S<_;f++,S++)f===O[0]&&(f++,O.shift()),g[S]=w[f];return g}z.default=d},"./src/errors.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"ErrorTypes",function(){return V}),N.d(z,"ErrorDetails",function(){return W});var V;(function(D){D.NETWORK_ERROR="networkError",D.MEDIA_ERROR="mediaError",D.KEY_SYSTEM_ERROR="keySystemError",D.MUX_ERROR="muxError",D.OTHER_ERROR="otherError"})(V||(V={}));var W;(function(D){D.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",D.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",D.KEY_SYSTEM_NO_SESSION="keySystemNoSession",D.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",D.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",D.MANIFEST_LOAD_ERROR="manifestLoadError",D.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",D.MANIFEST_PARSING_ERROR="manifestParsingError",D.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",D.LEVEL_EMPTY_ERROR="levelEmptyError",D.LEVEL_LOAD_ERROR="levelLoadError",D.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",D.LEVEL_SWITCH_ERROR="levelSwitchError",D.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",D.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",D.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",D.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",D.FRAG_LOAD_ERROR="fragLoadError",D.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",D.FRAG_DECRYPT_ERROR="fragDecryptError",D.FRAG_PARSING_ERROR="fragParsingError",D.REMUX_ALLOC_ERROR="remuxAllocError",D.KEY_LOAD_ERROR="keyLoadError",D.KEY_LOAD_TIMEOUT="keyLoadTimeOut",D.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",D.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",D.BUFFER_APPEND_ERROR="bufferAppendError",D.BUFFER_APPENDING_ERROR="bufferAppendingError",D.BUFFER_STALLED_ERROR="bufferStalledError",D.BUFFER_FULL_ERROR="bufferFullError",D.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",D.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",D.INTERNAL_EXCEPTION="internalException",D.INTERNAL_ABORTED="aborted",D.UNKNOWN="unknown"})(W||(W={}))},"./src/events.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"Events",function(){return V});var V;(function(W){W.MEDIA_ATTACHING="hlsMediaAttaching",W.MEDIA_ATTACHED="hlsMediaAttached",W.MEDIA_DETACHING="hlsMediaDetaching",W.MEDIA_DETACHED="hlsMediaDetached",W.BUFFER_RESET="hlsBufferReset",W.BUFFER_CODECS="hlsBufferCodecs",W.BUFFER_CREATED="hlsBufferCreated",W.BUFFER_APPENDING="hlsBufferAppending",W.BUFFER_APPENDED="hlsBufferAppended",W.BUFFER_EOS="hlsBufferEos",W.BUFFER_FLUSHING="hlsBufferFlushing",W.BUFFER_FLUSHED="hlsBufferFlushed",W.MANIFEST_LOADING="hlsManifestLoading",W.MANIFEST_LOADED="hlsManifestLoaded",W.MANIFEST_PARSED="hlsManifestParsed",W.LEVEL_SWITCHING="hlsLevelSwitching",W.LEVEL_SWITCHED="hlsLevelSwitched",W.LEVEL_LOADING="hlsLevelLoading",W.LEVEL_LOADED="hlsLevelLoaded",W.LEVEL_UPDATED="hlsLevelUpdated",W.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",W.LEVELS_UPDATED="hlsLevelsUpdated",W.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",W.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",W.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",W.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",W.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",W.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",W.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",W.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",W.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",W.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",W.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",W.CUES_PARSED="hlsCuesParsed",W.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",W.INIT_PTS_FOUND="hlsInitPtsFound",W.FRAG_LOADING="hlsFragLoading",W.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",W.FRAG_LOADED="hlsFragLoaded",W.FRAG_DECRYPTED="hlsFragDecrypted",W.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",W.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",W.FRAG_PARSING_METADATA="hlsFragParsingMetadata",W.FRAG_PARSED="hlsFragParsed",W.FRAG_BUFFERED="hlsFragBuffered",W.FRAG_CHANGED="hlsFragChanged",W.FPS_DROP="hlsFpsDrop",W.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",W.ERROR="hlsError",W.DESTROYING="hlsDestroying",W.KEY_LOADING="hlsKeyLoading",W.KEY_LOADED="hlsKeyLoaded",W.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",W.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return w});var V=N("./node_modules/url-toolkit/src/url-toolkit.js"),W=N.n(V),D=N("./src/loader/playlist-loader.ts"),H=N("./src/loader/key-loader.ts"),F=N("./src/controller/id3-track-controller.ts"),k=N("./src/controller/latency-controller.ts"),T=N("./src/controller/level-controller.ts"),v=N("./src/controller/fragment-tracker.ts"),m=N("./src/controller/stream-controller.ts"),c=N("./src/is-supported.ts"),d=N("./src/utils/logger.ts"),r=N("./src/config.ts"),s=N("./node_modules/eventemitter3/index.js"),o=N.n(s),a=N("./src/events.ts"),l=N("./src/errors.ts");function h(x,O){for(var S=0;S<O.length;S++){var _=O[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function I(x,O,S){return O&&h(x.prototype,O),S&&h(x,S),x}var w=function(){x.isSupported=function(){return Object(c.isSupported)()};function x(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.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 _=this.config=Object(r.mergeConfig)(x.DefaultConfig,S);this.userConfig=S,Object(d.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(r.enableStreamingMode)(_);var g=_.abrController,f=_.bufferController,u=_.capLevelController,E=_.fpsController,b=this.abrController=new g(this),y=this.bufferController=new f(this),P=this.capLevelController=new u(this),R=new E(this),U=new D.default(this),L=new H.default(this),j=new F.default(this),A=this.levelController=new T.default(this),X=new v.FragmentTracker(this),ee=this.streamController=new m.default(this,X);P.setStreamController(ee),R.setStreamController(ee);var se=[A,ee];this.networkControllers=se;var ce=[U,L,b,y,P,R,j,X];this.audioTrackController=this.createController(_.audioTrackController,null,se),this.createController(_.audioStreamController,X,se),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,se),this.createController(_.subtitleStreamController,X,se),this.createController(_.timelineController,null,ce),this.emeController=this.createController(_.emeController,null,ce),this.cmcdController=this.createController(_.cmcdController,null,ce),this.latencyController=this.createController(k.default,null,ce),this.coreComponents=ce}var O=x.prototype;return O.createController=function(_,g,f){if(_){var u=g?new _(this,g):new _(this);return f&&f.push(u),u}return null},O.on=function(_,g,f){f===void 0&&(f=this),this._emitter.on(_,g,f)},O.once=function(_,g,f){f===void 0&&(f=this),this._emitter.once(_,g,f)},O.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},O.off=function(_,g,f,u){f===void 0&&(f=this),this._emitter.off(_,g,f,u)},O.listeners=function(_){return this._emitter.listeners(_)},O.emit=function(_,g,f){return this._emitter.emit(_,g,f)},O.trigger=function(_,g){if(this.config.debug)return this.emit(_,_,g);try{return this.emit(_,_,g)}catch(f){d.logger.error("An internal error happened while handling event "+_+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(a.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:f})}return!1},O.listenerCount=function(_){return this._emitter.listenerCount(_)},O.destroy=function(){d.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},O.attachMedia=function(_){d.logger.log("attachMedia"),this._media=_,this.trigger(a.Events.MEDIA_ATTACHING,{media:_})},O.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(_){this.stopLoad();var g=this.media,f=this.url,u=this.url=V.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});d.logger.log("loadSource:"+u),g&&f&&f!==u&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(g)),this.trigger(a.Events.MANIFEST_LOADING,{url:_})},O.startLoad=function(_){_===void 0&&(_=-1),d.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(g){g.startLoad(_)})},O.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},O.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){d.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},O.removeLevel=function(_,g){g===void 0&&(g=0),this.levelController.removeLevel(_,g)},I(x,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){d.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){d.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){d.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){d.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){d.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var g=!!_;g!==this.config.capLevelToPlayerSize&&(g?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=g)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(d.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,g=this.config.minAutoBitrate;if(!_)return 0;for(var f=_.length,u=0;u<f;u++)if(_[u].maxBitrate>g)return u;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,g=this.autoLevelCapping,f;return g===-1&&_&&_.length?f=_.length-1:f=g,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var g=this.audioTrackController;g&&(g.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var g=this.subtitleTrackController;g&&(g.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var g=this.subtitleTrackController;g&&(g.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 a.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:r.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"isSupported",function(){return D}),N.d(z,"changeTypeSupported",function(){return H});var V=N("./src/utils/mediasource-helper.ts");function W(){return self.SourceBuffer||self.WebKitSourceBuffer}function D(){var F=Object(V.getMediaSource)();if(!F)return!1;var k=W(),T=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!T&&!!v}function H(){var F,k=W();return typeof(k==null||((F=k.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return d}),N.d(z,"LoadError",function(){return s});var V=N("./src/polyfills/number.ts"),W=N("./src/errors.ts");function D(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,v(o,a)}function H(o){var a=typeof Map=="function"?new Map:void 0;return H=function(h){if(h===null||!T(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(h))return a.get(h);a.set(h,I)}function I(){return F(h,arguments,m(this).constructor)}return I.prototype=Object.create(h.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),v(I,h)},H(o)}function F(o,a,l){return k()?F=Reflect.construct:F=function(I,w,x){var O=[null];O.push.apply(O,w);var S=Function.bind.apply(I,O),_=new S;return x&&v(_,x.prototype),_},F.apply(null,arguments)}function k(){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(o){return!1}}function T(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,a){return v=Object.setPrototypeOf||function(h,I){return h.__proto__=I,h},v(o,a)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},m(o)}var c=Math.pow(2,17),d=function(){function o(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var a=o.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(h,I){var w=this,x=h.url;if(!x)return Promise.reject(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var O=this.config,S=O.fLoader,_=O.loader;return new Promise(function(g,f){w.loader&&w.loader.destroy();var u=w.loader=h.loader=S?new S(O):new _(O),E=r(h),b={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:c};h.stats=u.stats,u.load(E,b,{onSuccess:function(P,R,U,L){w.resetLoader(h,u),g({frag:h,part:null,payload:P.data,networkDetails:L})},onError:function(P,R,U){w.resetLoader(h,u),f(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:P,networkDetails:U}))},onAbort:function(P,R,U){w.resetLoader(h,u),f(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:U}))},onTimeout:function(P,R,U){w.resetLoader(h,u),f(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:U}))},onProgress:function(P,R,U,L){I&&I({frag:h,part:null,payload:U,networkDetails:L})}})})},a.loadPart=function(h,I,w){var x=this;this.abort();var O=this.config,S=O.fLoader,_=O.loader;return new Promise(function(g,f){x.loader&&x.loader.destroy();var u=x.loader=h.loader=S?new S(O):new _(O),E=r(h,I),b={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:c};I.stats=u.stats,u.load(E,b,{onSuccess:function(P,R,U,L){x.resetLoader(h,u),x.updateStatsFromPart(h,I);var j={frag:h,part:I,payload:P.data,networkDetails:L};w(j),g(j)},onError:function(P,R,U){x.resetLoader(h,u),f(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:I,response:P,networkDetails:U}))},onAbort:function(P,R,U){h.stats.aborted=I.stats.aborted,x.resetLoader(h,u),f(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:I,networkDetails:U}))},onTimeout:function(P,R,U){x.resetLoader(h,u),f(new s({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:I,networkDetails:U}))}})})},a.updateStatsFromPart=function(h,I){var w=h.stats,x=I.stats,O=x.total;if(w.loaded+=x.loaded,O){var S=Math.round(h.duration/I.duration),_=Math.min(Math.round(w.loaded/O),S),g=S-_,f=g*Math.round(w.loaded/_);w.total=w.loaded+f}else w.total=Math.max(w.loaded,w.total);var u=w.loading,E=x.loading;u.start?u.first+=E.first-E.start:(u.start=E.start,u.first=E.first),u.end=E.end},a.resetLoader=function(h,I){h.loader=null,this.loader===I&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),I.destroy()},o}();function r(o,a){a===void 0&&(a=null);var l=a||o,h={frag:o,part:a,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},I=l.byteRangeStartOffset,w=l.byteRangeEndOffset;return Object(V.isFiniteNumber)(I)&&Object(V.isFiniteNumber)(w)&&(h.rangeStart=I,h.rangeEnd=w),h}var s=function(o){D(a,o);function a(l){for(var h,I=arguments.length,w=new Array(I>1?I-1:0),x=1;x<I;x++)w[x-1]=arguments[x];return h=o.call.apply(o,[this].concat(w))||this,h.data=void 0,h.data=l,h}return a}(H(Error))},"./src/loader/fragment.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"ElementaryStreamTypes",function(){return d}),N.d(z,"BaseSegment",function(){return r}),N.d(z,"Fragment",function(){return s}),N.d(z,"Part",function(){return o});var V=N("./src/polyfills/number.ts"),W=N("./node_modules/url-toolkit/src/url-toolkit.js"),D=N.n(W),H=N("./src/utils/logger.ts"),F=N("./src/loader/level-key.ts"),k=N("./src/loader/load-stats.ts");function T(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,v(a,l)}function v(a,l){return v=Object.setPrototypeOf||function(I,w){return I.__proto__=w,I},v(a,l)}function m(a,l){for(var h=0;h<l.length;h++){var I=l[h];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(a,I.key,I)}}function c(a,l,h){return l&&m(a.prototype,l),h&&m(a,h),a}var d;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(d||(d={}));var r=function(){function a(h){var I;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(I={},I[d.AUDIO]=null,I[d.VIDEO]=null,I[d.AUDIOVIDEO]=null,I),this.baseurl=h}var l=a.prototype;return l.setByteRange=function(I,w){var x=I.split("@",2),O=[];x.length===1?O[0]=w?w.byteRangeEndOffset:0:O[0]=parseInt(x[1]),O[1]=parseInt(x[0])+O[0],this._byteRange=O},c(a,[{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(W.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(I){this._url=I}}]),a}(),s=function(a){T(l,a);function l(I,w){var x;return x=a.call(this,w)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new k.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=I,x}var h=l.prototype;return h.createInitializationVector=function(w){for(var x=new Uint8Array(16),O=12;O<16;O++)x[O]=w>>8*(15-O)&255;return x},h.setDecryptDataFromLevelKey=function(w,x){var O=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(O=F.LevelKey.fromURI(w.uri),O.method=w.method,O.iv=this.createInitializationVector(x),O.keyFormat="identity"),O},h.setElementaryStreamInfo=function(w,x,O,S,_,g){g===void 0&&(g=!1);var f=this.elementaryStreams,u=f[w];if(!u){f[w]={startPTS:x,endPTS:O,startDTS:S,endDTS:_,partial:g};return}u.startPTS=Math.min(u.startPTS,x),u.endPTS=Math.max(u.endPTS,O),u.startDTS=Math.min(u.startDTS,S),u.endDTS=Math.max(u.endDTS,_)},h.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[d.AUDIO]=null,w[d.VIDEO]=null,w[d.AUDIOVIDEO]=null},c(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var w=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),l}(r),o=function(a){T(l,a);function l(h,I,w,x,O){var S;S=a.call(this,w)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new k.LoadStats,S.duration=h.decimalFloatingPoint("DURATION"),S.gap=h.bool("GAP"),S.independent=h.bool("INDEPENDENT"),S.relurl=h.enumeratedString("URI"),S.fragment=I,S.index=x;var _=h.enumeratedString("BYTERANGE");return _&&S.setByteRange(_,O),O&&(S.fragOffset=O.fragOffset+O.duration),S}return c(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var I=this.elementaryStreams;return!!(I.audio||I.video||I.audiovideo)}}]),l}(r)},"./src/loader/key-loader.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return H});var V=N("./src/events.ts"),W=N("./src/errors.ts"),D=N("./src/utils/logger.ts"),H=function(){function F(T){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=T,this._registerListeners()}var k=F.prototype;return k._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},k.onKeyLoading=function(v,m){var c=m.frag,d=c.type,r=this.loaders[d];if(!c.decryptdata){D.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=c.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(r&&(D.logger.warn("abort previous key loader for type:"+d),r.abort()),!s){D.logger.warn("key uri is falsy");return}var a=o.loader,l=c.loader=this.loaders[d]=new a(o);this.decrypturl=s,this.decryptkey=null;var h={url:s,frag:c,responseType:"arraybuffer"},I={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(h,I,w)}else this.decryptkey&&(c.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:c}))},k.loadsuccess=function(v,m,c){var d=c.frag;if(!d.decryptdata){D.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(v.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:d})},k.loaderror=function(v,m){var c=m.frag,d=c.loader;d&&d.abort(),delete this.loaders[c.type],this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:v})},k.loadtimeout=function(v,m){var c=m.frag,d=c.loader;d&&d.abort(),delete this.loaders[c.type],this.hls.trigger(V.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},F}()},"./src/loader/level-details.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"LevelDetails",function(){return F});var V=N("./src/polyfills/number.ts");function W(k,T){for(var v=0;v<T.length;v++){var m=T[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(k,m.key,m)}}function D(k,T,v){return T&&W(k.prototype,T),v&&W(k,v),k}var H=10,F=function(){function k(v){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=v}var T=k.prototype;return T.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var c=this.lastPartSn-m.lastPartSn,d=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!d||!!c,this.advanced=this.endSN>m.endSN||c>0||c===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},D(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var c=this.driftEnd-this.driftStart;return c*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),k}()},"./src/loader/level-key.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"LevelKey",function(){return F});var V=N("./node_modules/url-toolkit/src/url-toolkit.js"),W=N.n(V);function D(k,T){for(var v=0;v<T.length;v++){var m=T[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(k,m.key,m)}}function H(k,T,v){return T&&D(k.prototype,T),v&&D(k,v),k}var F=function(){k.fromURL=function(v,m){return new k(v,m)},k.fromURI=function(v){return new k(v)};function k(T,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(V.buildAbsoluteURL)(T,v,{alwaysNormalize:!0}):this._uri=T}return H(k,[{key:"uri",get:function(){return this._uri}}]),k}()},"./src/loader/load-stats.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"LoadStats",function(){return V});var V=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(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return l});var V=N("./src/polyfills/number.ts"),W=N("./node_modules/url-toolkit/src/url-toolkit.js"),D=N.n(W),H=N("./src/loader/fragment.ts"),F=N("./src/loader/level-details.ts"),k=N("./src/loader/level-key.ts"),T=N("./src/utils/attr-list.ts"),v=N("./src/utils/logger.ts"),m=N("./src/utils/codecs.ts"),c=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=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("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function a(O){var S,_;return o.test((S=(_=W.parseURL(O))===null||_===void 0?void 0:_.path)!=null?S:"")}var l=function(){function O(){}return O.findGroup=function(_,g){for(var f=0;f<_.length;f++){var u=_[f];if(u.id===g)return u}},O.convertAVC1ToAVCOTI=function(_){var g=_.split(".");if(g.length>2){var f=g.shift()+".";return f+=parseInt(g.shift()).toString(16),f+=("000"+parseInt(g.shift()).toString(16)).substr(-4),f}return _},O.resolve=function(_,g){return W.buildAbsoluteURL(g,_,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(_,g){var f=[],u={},E=!1;c.lastIndex=0;for(var b;(b=c.exec(_))!=null;)if(b[1]){var y=new T.AttrList(b[1]),P={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:O.resolve(b[2],g)},R=y.decimalResolution("RESOLUTION");R&&(P.width=R.width,P.height=R.height),h((y.CODECS||"").split(/[ ,]+/).filter(function(L){return L}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=O.convertAVC1ToAVCOTI(P.videoCodec)),f.push(P)}else if(b[3]){var U=new T.AttrList(b[3]);U["DATA-ID"]&&(E=!0,u[U["DATA-ID"]]=U)}return{levels:f,sessionData:E?u:null}},O.parseMasterPlaylistMedia=function(_,g,f,u){u===void 0&&(u=[]);var E,b=[],y=0;for(d.lastIndex=0;(E=d.exec(_))!==null;){var P=new T.AttrList(E[1]);if(P.TYPE===f){var R={attrs:P,bitrate:0,id:y++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:f,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?O.resolve(P.URI,g):""};if(u.length){var U=O.findGroup(u,R.groupId)||u[0];I(R,U,"audioCodec"),I(R,U,"textCodec")}b.push(R)}}return b},O.parseLevelPlaylist=function(_,g,f,u,E){var b=new F.LevelDetails(g),y=b.fragments,P=null,R=0,U=0,L=0,j=0,A=null,X=new H.Fragment(u,g),ee,se,ce,Le=-1,Ce=!1;for(r.lastIndex=0,b.m3u8=_;(ee=r.exec(_))!==null;){Ce&&(Ce=!1,X=new H.Fragment(u,g),X.start=L,X.sn=R,X.cc=j,X.level=f,P&&(X.initSegment=P,X.rawProgramDateTime=P.rawProgramDateTime));var Ae=ee[1];if(Ae){X.duration=parseFloat(Ae);var Pe=(" "+ee[2]).slice(1);X.title=Pe||null,X.tagList.push(Pe?["INF",Ae,Pe]:["INF",Ae])}else if(ee[3])Object(V.isFiniteNumber)(X.duration)&&(X.start=L,ce&&(X.levelkey=ce),X.sn=R,X.level=f,X.cc=j,X.urlId=E,y.push(X),X.relurl=(" "+ee[3]).slice(1),x(X,A),A=X,L+=X.duration,R++,U=0,Ce=!0);else if(ee[4]){var Ie=(" "+ee[4]).slice(1);A?X.setByteRange(Ie,A):X.setByteRange(Ie)}else if(ee[5])X.rawProgramDateTime=(" "+ee[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),Le===-1&&(Le=y.length);else{if(ee=ee[0].match(s),!ee){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<ee.length&&!(typeof ee[se]!="undefined");se++);var pe=(" "+ee[se]).slice(1),de=(" "+ee[se+1]).slice(1),ne=ee[se+2]?(" "+ee[se+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":b.type=de.toUpperCase();break;case"MEDIA-SEQUENCE":R=b.startSN=parseInt(de);break;case"SKIP":{var ge=new T.AttrList(de),oe=ge.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(oe)){b.skippedSegments=oe;for(var De=oe;De--;)y.unshift(null);R+=oe}var Ue=ge.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ue&&(b.recentlyRemovedDateranges=Ue.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(de);break;case"VERSION":b.version=parseInt(de);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(de||ne)&&X.tagList.push(ne?[de,ne]:[de]);break;case"DIS":j++;case"GAP":X.tagList.push([pe]);break;case"BITRATE":X.tagList.push([pe,de]);break;case"DISCONTINUITY-SEQ":j=parseInt(de);break;case"KEY":{var we,Ge=new T.AttrList(de),Qe=Ge.enumeratedString("METHOD"),et=Ge.URI,ze=Ge.hexadecimalInteger("IV"),Je=Ge.enumeratedString("KEYFORMATVERSIONS"),Xe=Ge.enumeratedString("KEYID"),yt=(we=Ge.enumeratedString("KEYFORMAT"))!=null?we:"identity",xt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(xt.indexOf(yt)>-1){v.logger.warn("Keyformat "+yt+" is not supported from the manifest");continue}else if(yt!=="identity")continue;Qe&&(ce=k.LevelKey.fromURL(g,et),et&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Qe)>=0&&(ce.method=Qe,ce.keyFormat=yt,Xe&&(ce.keyID=Xe),Je&&(ce.keyFormatVersions=Je),ce.iv=ze));break}case"START":{var vt=new T.AttrList(de),ht=vt.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(ht)&&(b.startTimeOffset=ht);break}case"MAP":{var Rt=new T.AttrList(de);X.relurl=Rt.URI,Rt.BYTERANGE&&X.setByteRange(Rt.BYTERANGE),X.level=f,X.sn="initSegment",ce&&(X.levelkey=ce),X.initSegment=null,P=X,Ce=!0;break}case"SERVER-CONTROL":{var At=new T.AttrList(de);b.canBlockReload=At.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=At.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&At.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=At.optionalFloat("PART-HOLD-BACK",0),b.holdBack=At.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ke=new T.AttrList(de);b.partTarget=ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Oe=b.partList;Oe||(Oe=b.partList=[]);var tt=U>0?Oe[Oe.length-1]:void 0,it=U++,Ne=new H.Part(new T.AttrList(de),X,g,it,tt);Oe.push(Ne),X.duration+=Ne.duration;break}case"PRELOAD-HINT":{var qe=new T.AttrList(de);b.preloadHint=qe;break}case"RENDITION-REPORT":{var Te=new T.AttrList(de);b.renditionReports=b.renditionReports||[],b.renditionReports.push(Te);break}default:v.logger.warn("line parsed but not handled: "+ee);break}}}A&&!A.relurl?(y.pop(),L-=A.duration,b.partList&&(b.fragmentHint=A)):b.partList&&(x(X,A),X.cc=j,b.fragmentHint=X);var fe=y.length,me=y[0],re=y[fe-1];if(L+=b.skippedSegments*b.targetduration,L>0&&fe&&re){b.averagetargetduration=L/fe;var ae=re.sn;b.endSN=ae!=="initSegment"?ae:0,me&&(b.startCC=me.cc,me.initSegment||b.fragments.every(function(he){return he.relurl&&a(he.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new H.Fragment(u,g),X.relurl=re.relurl,X.level=f,X.sn="initSegment",me.initSegment=X,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(L+=b.fragmentHint.duration),b.totalduration=L,b.endCC=j,Le>0&&w(y,Le),b},O}();function h(O,S){["video","audio","text"].forEach(function(_){var g=O.filter(function(u){return Object(m.isCodecType)(u,_)});if(g.length){var f=g.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});S[_+"Codec"]=f.length>0?f[0]:g[0],O=O.filter(function(u){return g.indexOf(u)===-1})}}),S.unknownCodecs=O}function I(O,S,_){var g=S[_];g&&(O[_]=g)}function w(O,S){for(var _=O[S],g=S;g--;){var f=O[g];if(!f)return;f.programDateTime=_.programDateTime-f.duration*1e3,_=f}}function x(O,S){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):S!=null&&S.programDateTime&&(O.programDateTime=S.endProgramDateTime),Object(V.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/events.ts"),D=N("./src/errors.ts"),H=N("./src/utils/logger.ts"),F=N("./src/utils/mp4-tools.ts"),k=N("./src/loader/m3u8-parser.ts"),T=N("./src/types/loader.ts"),v=N("./src/utils/attr-list.ts");function m(r){var s=r.type;switch(s){case T.PlaylistContextType.AUDIO_TRACK:return T.PlaylistLevelType.AUDIO;case T.PlaylistContextType.SUBTITLE_TRACK:return T.PlaylistLevelType.SUBTITLE;default:return T.PlaylistLevelType.MAIN}}function c(r,s){var o=r.url;return(o===void 0||o.indexOf("data:")===0)&&(o=s.url),o}var d=function(){function r(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var s=r.prototype;return s.registerListeners=function(){var a=this.hls;a.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var a=this.hls;a.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(a){var l=this.hls.config,h=l.pLoader,I=l.loader,w=h||I,x=new w(l);return a.loader=x,this.loaders[a.type]=x,x},s.getInternalLoader=function(a){return this.loaders[a.type]},s.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},s.destroyInternalLoaders=function(){for(var a in this.loaders){var l=this.loaders[a];l&&l.destroy(),this.resetInternalLoader(a)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(a,l){var h=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:T.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},s.onLevelLoading=function(a,l){var h=l.id,I=l.level,w=l.url,x=l.deliveryDirectives;this.load({id:h,groupId:null,level:I,responseType:"text",type:T.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},s.onAudioTrackLoading=function(a,l){var h=l.id,I=l.groupId,w=l.url,x=l.deliveryDirectives;this.load({id:h,groupId:I,level:null,responseType:"text",type:T.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},s.onSubtitleTrackLoading=function(a,l){var h=l.id,I=l.groupId,w=l.url,x=l.deliveryDirectives;this.load({id:h,groupId:I,level:null,responseType:"text",type:T.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},s.load=function(a){var l,h=this.hls.config,I=this.getInternalLoader(a);if(I){var w=I.context;if(w&&w.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),I.abort()}var x,O,S,_;switch(a.type){case T.PlaylistContextType.MANIFEST:x=h.manifestLoadingMaxRetry,O=h.manifestLoadingTimeOut,S=h.manifestLoadingRetryDelay,_=h.manifestLoadingMaxRetryTimeout;break;case T.PlaylistContextType.LEVEL:case T.PlaylistContextType.AUDIO_TRACK:case T.PlaylistContextType.SUBTITLE_TRACK:x=0,O=h.levelLoadingTimeOut;break;default:x=h.levelLoadingMaxRetry,O=h.levelLoadingTimeOut,S=h.levelLoadingRetryDelay,_=h.levelLoadingMaxRetryTimeout;break}if(I=this.createInternalLoader(a),(l=a.deliveryDirectives)!==null&&l!==void 0&&l.part){var g;if(a.type===T.PlaylistContextType.LEVEL&&a.level!==null?g=this.hls.levels[a.level].details:a.type===T.PlaylistContextType.AUDIO_TRACK&&a.id!==null?g=this.hls.audioTracks[a.id].details:a.type===T.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(g=this.hls.subtitleTracks[a.id].details),g){var f=g.partTarget,u=g.targetduration;f&&u&&(O=Math.min(Math.max(f*3,u*.8)*1e3,O))}}var E={timeout:O,maxRetry:x,retryDelay:S,maxRetryDelay:_,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};I.load(a,E,b)},s.loadsuccess=function(a,l,h,I){if(I===void 0&&(I=null),h.isSidxRequest){this.handleSidxRequest(a,h),this.handlePlaylistLoaded(a,l,h,I);return}this.resetInternalLoader(h.type);var w=a.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,h,"no EXTM3U delimiter",I);return}l.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,l,h,I):this.handleMasterPlaylist(a,l,h,I)},s.loaderror=function(a,l,h){h===void 0&&(h=null),this.handleNetworkError(l,h,!1,a)},s.loadtimeout=function(a,l,h){h===void 0&&(h=null),this.handleNetworkError(l,h,!0)},s.handleMasterPlaylist=function(a,l,h,I){var w=this.hls,x=a.data,O=c(a,h),S=k.default.parseMasterPlaylist(x,O),_=S.levels,g=S.sessionData;if(!_.length){this.handleManifestParsingError(a,h,"no level found in manifest",I);return}var f=_.map(function(R){return{id:R.attrs.AUDIO,audioCodec:R.audioCodec}}),u=_.map(function(R){return{id:R.attrs.SUBTITLES,textCodec:R.textCodec}}),E=k.default.parseMasterPlaylistMedia(x,O,"AUDIO",f),b=k.default.parseMasterPlaylistMedia(x,O,"SUBTITLES",u),y=k.default.parseMasterPlaylistMedia(x,O,"CLOSED-CAPTIONS");if(E.length){var P=E.some(function(R){return!R.url});!P&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}w.trigger(W.Events.MANIFEST_LOADED,{levels:_,audioTracks:E,subtitles:b,captions:y,url:O,stats:l,networkDetails:I,sessionData:g})},s.handleTrackOrLevelPlaylist=function(a,l,h,I){var w=this.hls,x=h.id,O=h.level,S=h.type,_=c(a,h),g=Object(V.isFiniteNumber)(x)?x:0,f=Object(V.isFiniteNumber)(O)?O:g,u=m(h),E=k.default.parseLevelPlaylist(a.data,_,f,u,g);if(!E.fragments.length){w.trigger(W.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(S===T.PlaylistContextType.MANIFEST){var b={attrs:new v.AttrList({}),bitrate:0,details:E,name:"",url:_};w.trigger(W.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:_,stats:l,networkDetails:I,sessionData:null})}if(l.parsing.end=performance.now(),E.needSidxRanges){var y,P=(y=E.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:P,isSidxRequest:!0,type:S,level:O,levelDetails:E,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=E,this.handlePlaylistLoaded(a,l,h,I)},s.handleSidxRequest=function(a,l){var h=Object(F.parseSegmentIndex)(new Uint8Array(a.data));if(!h)return;var I=h.references,w=l.levelDetails;I.forEach(function(x,O){var S=x.info,_=w.fragments[O];_.byteRange.length===0&&_.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),_.initSegment&&_.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(a,l,h,I){this.hls.trigger(W.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===T.PlaylistContextType.MANIFEST,url:a.url,reason:h,response:a,context:l,networkDetails:I})},s.handleNetworkError=function(a,l,h,I){h===void 0&&(h=!1),H.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var w=D.ErrorDetails.UNKNOWN,x=!1,O=this.getInternalLoader(a);switch(a.type){case T.PlaylistContextType.MANIFEST:w=h?D.ErrorDetails.MANIFEST_LOAD_TIMEOUT:D.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case T.PlaylistContextType.LEVEL:w=h?D.ErrorDetails.LEVEL_LOAD_TIMEOUT:D.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case T.PlaylistContextType.AUDIO_TRACK:w=h?D.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case T.PlaylistContextType.SUBTITLE_TRACK:w=h?D.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:D.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}O&&this.resetInternalLoader(a.type);var S={type:D.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:a.url,loader:O,context:a,networkDetails:l};I&&(S.response=I),this.hls.trigger(W.Events.ERROR,S)},s.handlePlaylistLoaded=function(a,l,h,I){var w=h.type,x=h.level,O=h.id,S=h.groupId,_=h.loader,g=h.levelDetails,f=h.deliveryDirectives;if(!(g!=null&&g.targetduration)){this.handleManifestParsingError(a,h,"invalid target duration",I);return}if(!_)return;g.live&&(_.getCacheAge&&(g.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(g.ageHeader))&&(g.ageHeader=0));switch(w){case T.PlaylistContextType.MANIFEST:case T.PlaylistContextType.LEVEL:this.hls.trigger(W.Events.LEVEL_LOADED,{details:g,level:x||0,id:O||0,stats:l,networkDetails:I,deliveryDirectives:f});break;case T.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(W.Events.AUDIO_TRACK_LOADED,{details:g,id:O||0,groupId:S||"",stats:l,networkDetails:I,deliveryDirectives:f});break;case T.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADED,{details:g,id:O||0,groupId:S||"",stats:l,networkDetails:I,deliveryDirectives:f});break}},r}();z.default=d},"./src/polyfills/number.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"isFiniteNumber",function(){return V}),N.d(z,"MAX_SAFE_INTEGER",function(){return W});var V=Number.isFinite||function(D){return typeof D=="number"&&isFinite(D)},W=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,z,N){"use strict";N.r(z);var V=function(){function W(){}return W.getSilentFrame=function(H,F){switch(H){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===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(F===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(F===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(F===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(F===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},W}();z.default=V},"./src/remux/mp4-generator.ts":function(q,z,N){"use strict";N.r(z);var V=Math.pow(2,32)-1,W=function(){function D(){}return D.init=function(){D.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 F;for(F in D.types)D.types.hasOwnProperty(F)&&(D.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var k=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]),T=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]);D.HDLR_TYPES={video:k,audio:T};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);D.STTS=D.STSC=D.STCO=m,D.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),D.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),D.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var c=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);D.FTYP=D.box(D.types.ftyp,c,r,c,d),D.DINF=D.box(D.types.dinf,D.box(D.types.dref,v))},D.box=function(F){for(var k=8,T=arguments.length,v=new Array(T>1?T-1:0),m=1;m<T;m++)v[m-1]=arguments[m];for(var c=v.length,d=c;c--;)k+=v[c].byteLength;var r=new Uint8Array(k);for(r[0]=k>>24&255,r[1]=k>>16&255,r[2]=k>>8&255,r[3]=k&255,r.set(F,4),c=0,k=8;c<d;c++)r.set(v[c],k),k+=v[c].byteLength;return r},D.hdlr=function(F){return D.box(D.types.hdlr,D.HDLR_TYPES[F])},D.mdat=function(F){return D.box(D.types.mdat,F)},D.mdhd=function(F,k){k*=F;var T=Math.floor(k/(V+1)),v=Math.floor(k%(V+1));return D.box(D.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,T>>24,T>>16&255,T>>8&255,T&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},D.mdia=function(F){return D.box(D.types.mdia,D.mdhd(F.timescale,F.duration),D.hdlr(F.type),D.minf(F))},D.mfhd=function(F){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},D.minf=function(F){return F.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(F)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(F))},D.moof=function(F,k,T){return D.box(D.types.moof,D.mfhd(F),D.traf(T,k))},D.moov=function(F){for(var k=F.length,T=[];k--;)T[k]=D.trak(F[k]);return D.box.apply(null,[D.types.moov,D.mvhd(F[0].timescale,F[0].duration)].concat(T).concat(D.mvex(F)))},D.mvex=function(F){for(var k=F.length,T=[];k--;)T[k]=D.trex(F[k]);return D.box.apply(null,[D.types.mvex].concat(T))},D.mvhd=function(F,k){k*=F;var T=Math.floor(k/(V+1)),v=Math.floor(k%(V+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,T>>24,T>>16&255,T>>8&255,T&255,v>>24,v>>16&255,v>>8&255,v&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 D.box(D.types.mvhd,m)},D.sdtp=function(F){var k=F.samples||[],T=new Uint8Array(4+k.length),v,m;for(v=0;v<k.length;v++)m=k[v].flags,T[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return D.box(D.types.sdtp,T)},D.stbl=function(F){return D.box(D.types.stbl,D.stsd(F),D.box(D.types.stts,D.STTS),D.box(D.types.stsc,D.STSC),D.box(D.types.stsz,D.STSZ),D.box(D.types.stco,D.STCO))},D.avc1=function(F){var k=[],T=[],v,m,c;for(v=0;v<F.sps.length;v++)m=F.sps[v],c=m.byteLength,k.push(c>>>8&255),k.push(c&255),k=k.concat(Array.prototype.slice.call(m));for(v=0;v<F.pps.length;v++)m=F.pps[v],c=m.byteLength,T.push(c>>>8&255),T.push(c&255),T=T.concat(Array.prototype.slice.call(m));var d=D.box(D.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|F.sps.length].concat(k).concat([F.pps.length]).concat(T))),r=F.width,s=F.height,o=F.pixelRatio[0],a=F.pixelRatio[1];return D.box(D.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,r>>8&255,r&255,s>>8&255,s&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]),d,D.box(D.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),D.box(D.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&255])))},D.esds=function(F){var k=F.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(F.config).concat([6,1,2]))},D.mp4a=function(F){var k=F.samplerate;return D.box(D.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),D.box(D.types.esds,D.esds(F)))},D.mp3=function(F){var k=F.samplerate;return D.box(D.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},D.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(F)):D.box(D.types.stsd,D.STSD,D.mp4a(F)):D.box(D.types.stsd,D.STSD,D.avc1(F))},D.tkhd=function(F){var k=F.id,T=F.duration*F.timescale,v=F.width,m=F.height,c=Math.floor(T/(V+1)),d=Math.floor(T%(V+1));return D.box(D.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,d>>24,d>>16&255,d>>8&255,d&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,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},D.traf=function(F,k){var T=D.sdtp(F),v=F.id,m=Math.floor(k/(V+1)),c=Math.floor(k%(V+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,c>>24,c>>16&255,c>>8&255,c&255])),D.trun(F,T.length+16+20+8+16+8+8),T)},D.trak=function(F){return F.duration=F.duration||4294967295,D.box(D.types.trak,D.tkhd(F),D.mdia(F))},D.trex=function(F){var k=F.id;return D.box(D.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},D.trun=function(F,k){var T=F.samples||[],v=T.length,m=12+16*v,c=new Uint8Array(m),d,r,s,o,a,l;for(k+=8+m,c.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),d=0;d<v;d++)r=T[d],s=r.duration,o=r.size,a=r.flags,l=r.cts,c.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*d);return D.box(D.types.trun,c)},D.initSegment=function(F){D.types||D.init();var k=D.moov(F),T=new Uint8Array(D.FTYP.byteLength+k.byteLength);return T.set(D.FTYP),T.set(k,D.FTYP.byteLength),T},D}();W.types=void 0,W.HDLR_TYPES=void 0,W.STTS=void 0,W.STSC=void 0,W.STCO=void 0,W.STSZ=void 0,W.VMHD=void 0,W.SMHD=void 0,W.STSD=void 0,W.FTYP=void 0,W.DINF=void 0,z.default=W},"./src/remux/mp4-remuxer.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return l}),N.d(z,"normalizePts",function(){return h});var V=N("./src/polyfills/number.ts"),W=N("./src/remux/aac-helper.ts"),D=N("./src/remux/mp4-generator.ts"),H=N("./src/events.ts"),F=N("./src/errors.ts"),k=N("./src/utils/logger.ts"),T=N("./src/types/loader.ts"),v=N("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(O){for(var S=1;S<arguments.length;S++){var _=arguments[S];for(var g in _)Object.prototype.hasOwnProperty.call(_,g)&&(O[g]=_[g])}return O},m.apply(this,arguments)}var c=10*1e3,d=1024,r=1152,s=null,o=null,a=!1,l=function(){function O(_,g,f,u){if(u===void 0&&(u=""),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=_,this.config=g,this.typeSupported=f,this.ISGenerated=!1,s===null){var E=navigator.userAgent||"",b=E.match(/Chrome\/(\d+)/i);s=b?parseInt(b[1]):0}if(o===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);o=y?parseInt(y[1]):0}a=!!s&&s<75||!!o&&o<600}var S=O.prototype;return S.destroy=function(){},S.resetTimeStamp=function(g){k.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=g},S.resetNextTimestamp=function(){k.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){k.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(g){var f=!1,u=g.reduce(function(E,b){var y=b.pts-E;return y<-4294967296?(f=!0,h(E,b.pts)):y>0?E:b.pts},g[0].pts);return f&&k.logger.debug("PTS rollover detected"),u},S.remux=function(g,f,u,E,b,y,P,R){var U,L,j,A,X,ee,se=b,ce=b,Le=g.pid>-1,Ce=f.pid>-1,Ae=f.samples.length,Pe=g.samples.length>0,Ie=Ae>1,pe=(!Le||Pe)&&(!Ce||Ie)||this.ISGenerated||P;if(pe){this.ISGenerated||(j=this.generateIS(g,f,b));var de=this.isVideoContiguous,ne=-1;if(Ie&&(ne=I(f.samples),!de&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,ne>0){k.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Ae+" video samples due to a missing keyframe");var ge=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(ne),f.dropped+=ne,ce+=(f.samples[0].pts-ge)/(f.timescale||9e4)}else ne===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ae+" video samples"),ee=!1);if(this.ISGenerated){if(Pe&&Ie){var oe=this.getVideoStartPts(f.samples),De=h(g.samples[0].pts,oe)-oe,Ue=De/f.inputTimeScale;se+=Math.max(0,Ue),ce+=Math.max(0,-Ue)}if(Pe){if(g.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(g,f,b)),L=this.remuxAudio(g,se,this.isAudioContiguous,y,Ce||Ie||R===T.PlaylistLevelType.AUDIO?ce:void 0),Ie){var we=L?L.endPTS-L.startPTS:0;f.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(g,f,b)),U=this.remuxVideo(f,ce,de,we)}}else Ie&&(U=this.remuxVideo(f,ce,de,0));U&&(U.firstKeyFrame=ne,U.independent=ne!==-1)}}return this.ISGenerated&&(u.samples.length&&(X=this.remuxID3(u,b)),E.samples.length&&(A=this.remuxText(E,b))),{audio:L,video:U,initSegment:j,independent:ee,text:A,id3:X}},S.generateIS=function(g,f,u){var E=g.samples,b=f.samples,y=this.typeSupported,P={},R=!Object(V.isFiniteNumber)(this._initPTS),U="audio/mp4",L,j,A;if(R&&(L=j=Infinity),g.config&&E.length&&(g.timescale=g.samplerate,g.isAAC||(y.mpeg?(U="audio/mpeg",g.codec=""):y.mp3&&(g.codec="mp3")),P.audio={id:"audio",container:U,codec:g.codec,initSegment:!g.isAAC&&y.mpeg?new Uint8Array(0):D.default.initSegment([g]),metadata:{channelCount:g.channelCount}},R&&(A=g.inputTimeScale,L=j=E[0].pts-Math.round(A*u))),f.sps&&f.pps&&b.length&&(f.timescale=f.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:D.default.initSegment([f]),metadata:{width:f.width,height:f.height}},R)){A=f.inputTimeScale;var X=this.getVideoStartPts(b),ee=Math.round(A*u);j=Math.min(j,h(b[0].dts,X)-ee),L=Math.min(L,X-ee)}if(Object.keys(P).length)return this.ISGenerated=!0,R&&(this._initPTS=L,this._initDTS=j),{tracks:P,initPTS:L,timescale:A}},S.remuxVideo=function(g,f,u,E){var b=g.inputTimeScale,y=g.samples,P=[],R=y.length,U=this._initPTS,L=this.nextAvcDts,j=8,A,X,ee,se=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,Le=0,Ce=!1;if(!u||L===null){var Ae=f*b,Pe=y[0].pts-h(y[0].dts,y[0].pts);L=Ae-Pe}for(var Ie=0;Ie<R;Ie++){var pe=y[Ie];if(pe.pts=h(pe.pts-U,L),pe.dts=h(pe.dts-U,L),pe.dts>pe.pts){var de=9e4*.2;Le=Math.max(Math.min(Le,pe.pts-pe.dts),-1*de)}pe.dts<y[Ie>0?Ie-1:Ie].dts&&(Ce=!0)}Ce&&y.sort(function(mt,Ze){var $e=mt.dts-Ze.dts,He=mt.pts-Ze.pts;return $e||He}),X=y[0].dts,ee=y[y.length-1].dts;var ne=Math.round((ee-X)/(R-1));if(Le<0){if(Le<ne*-2){k.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var ge=Le,oe=0;oe<R;oe++)y[oe].dts=ge=Math.max(ge,y[oe].pts-ne),y[oe].pts=Math.max(ge,y[oe].pts)}else{k.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Le,!0)+" ms to overcome this issue");for(var De=0;De<R;De++)y[De].dts=y[De].dts+Le}X=y[0].dts}if(u){var Ue=X-L,we=Ue>ne,Ge=Ue<-1;if(we||Ge){we?k.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ue,!0)+" ms ("+Ue+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ue,!0)+" ms ("+Ue+"dts) overlapping between fragments detected"),X=L;var Qe=y[0].pts-Ue;y[0].dts=X,y[0].pts=Qe,k.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Qe,!0)+"/"+Object(v.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ue,!0)+" ms")}}a&&(X=Math.max(0,X));for(var et=0,ze=0,Je=0;Je<R;Je++){for(var Xe=y[Je],yt=Xe.units,xt=yt.length,vt=0,ht=0;ht<xt;ht++)vt+=yt[ht].data.length;ze+=vt,et+=xt,Xe.length=vt,Xe.dts=Math.max(Xe.dts,X),Xe.pts=Math.max(Xe.pts,Xe.dts,0),se=Math.min(Xe.pts,se),ce=Math.max(Xe.pts,ce)}ee=y[R-1].dts;var Rt=ze+4*et+8,At;try{At=new Uint8Array(Rt)}catch(mt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Rt,reason:"fail allocating video mdat "+Rt});return}var ke=new DataView(At.buffer);ke.setUint32(0,Rt),At.set(D.default.types.mdat,4);for(var Oe=0;Oe<R;Oe++){for(var tt=y[Oe],it=tt.units,Ne=0,qe=0,Te=it.length;qe<Te;qe++){var fe=it[qe],me=fe.data,re=fe.data.byteLength;ke.setUint32(j,re),j+=4,At.set(me,j),j+=re,Ne+=4+re}if(Oe<R-1)A=y[Oe+1].dts-tt.dts;else{var ae=this.config,he=tt.dts-y[Oe>0?Oe-1:Oe].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var ve=Math.floor(ae.maxBufferHole*b),_e=(E?se+E*b:this.nextAudioPts)-tt.pts;_e>ve?(A=_e-he,A<0&&(A=he),k.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=he}else A=he}var je=Math.round(tt.pts-tt.dts);P.push(new w(tt.key,A,Ne,je))}if(P.length&&s&&s<70){var at=P[0].flags;at.dependsOn=2,at.isNonSync=0}console.assert(A!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=L=ee+A,this.isVideoContiguous=!0;var Et=D.default.moof(g.sequenceNumber++,X,m({},g,{samples:P})),Lt="video",Tt={data1:Et,data2:At,startPTS:se/b,endPTS:(ce+A)/b,startDTS:X/b,endDTS:L/b,type:Lt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:g.dropped};return g.samples=[],g.dropped=0,console.assert(At.length,"MDAT length must not be zero"),Tt},S.remuxAudio=function(g,f,u,E,b){var y=g.inputTimeScale,P=g.samplerate?g.samplerate:y,R=y/P,U=g.isAAC?d:r,L=U*R,j=this._initPTS,A=!g.isAAC&&this.typeSupported.mpeg,X=[],ee=g.samples,se=A?0:8,ce=this.nextAudioPts||-1,Le=f*y;if(this.isAudioContiguous=u=u||ee.length&&ce>0&&(E&&Math.abs(Le-ce)<9e3||Math.abs(h(ee[0].pts-j,Le)-ce)<20*L),ee.forEach(function(me){me.pts=h(me.pts-j,Le)}),!u||ce<0){if(ee=ee.filter(function(me){return me.pts>=0}),!ee.length)return;b===0?ce=0:E?ce=Math.max(0,Le):ce=ee[0].pts}if(g.isAAC)for(var Ce=b!==void 0,Ae=this.config.maxAudioFramesDrift,Pe=0,Ie=ce;Pe<ee.length;Pe++){var pe=ee[Pe],de=pe.pts,ne=de-Ie,ge=Math.abs(1e3*ne/y);if(ne<=-Ae*L&&Ce)Pe===0&&(k.logger.warn("Audio frame @ "+(de/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/y)+" ms."),this.nextAudioPts=ce=Ie=de);else if(ne>=Ae*L&&ge<c&&Ce){var oe=Math.round(ne/L);Ie=de-oe*L,Ie<0&&(oe--,Ie+=L),Pe===0&&(this.nextAudioPts=ce=Ie),k.logger.warn("[mp4-remuxer]: Injecting "+oe+" audio frame @ "+(Ie/y).toFixed(3)+"s due to "+Math.round(1e3*ne/y)+" ms gap.");for(var De=0;De<oe;De++){var Ue=Math.max(Ie,0),we=W.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);we||(k.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),we=pe.unit.subarray()),ee.splice(Pe,0,{unit:we,pts:Ue}),Ie+=L,Pe++}}pe.pts=Ie,Ie+=L}for(var Ge=null,Qe=null,et,ze=0,Je=ee.length;Je--;)ze+=ee[Je].unit.byteLength;for(var Xe=0,yt=ee.length;Xe<yt;Xe++){var xt=ee[Xe],vt=xt.unit,ht=xt.pts;if(Qe!==null){var Rt=X[Xe-1];Rt.duration=Math.round((ht-Qe)/R)}else if(u&&g.isAAC&&(ht=ce),Ge=ht,ze>0){ze+=se;try{et=new Uint8Array(ze)}catch(me){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ze,reason:"fail allocating audio mdat "+ze});return}if(!A){var At=new DataView(et.buffer);At.setUint32(0,ze),et.set(D.default.types.mdat,4)}}else return;et.set(vt,se);var ke=vt.byteLength;se+=ke,X.push(new w(!0,U,ke,0)),Qe=ht}var Oe=X.length;if(!Oe)return;var tt=X[X.length-1];this.nextAudioPts=ce=Qe+R*tt.duration;var it=A?new Uint8Array(0):D.default.moof(g.sequenceNumber++,Ge/R,m({},g,{samples:X}));g.samples=[];var Ne=Ge/y,qe=ce/y,Te="audio",fe={data1:it,data2:et,startPTS:Ne,endPTS:qe,startDTS:Ne,endDTS:qe,type:Te,hasAudio:!0,hasVideo:!1,nb:Oe};return this.isAudioContiguous=!0,console.assert(et.length,"MDAT length must not be zero"),fe},S.remuxEmptyAudio=function(g,f,u,E){var b=g.inputTimeScale,y=g.samplerate?g.samplerate:b,P=b/y,R=this.nextAudioPts,U=(R!==null?R:E.startDTS*b)+this._initDTS,L=E.endDTS*b+this._initDTS,j=P*d,A=Math.ceil((L-U)/j),X=W.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],se=0;se<A;se++){var ce=U+se*j;ee.push({unit:X,pts:ce,dts:ce})}return g.samples=ee,this.remuxAudio(g,f,u,!1)},S.remuxID3=function(g,f){var u=g.samples.length;if(!u)return;for(var E=g.inputTimeScale,b=this._initPTS,y=this._initDTS,P=0;P<u;P++){var R=g.samples[P];R.pts=h(R.pts-b,f*E)/E,R.dts=h(R.dts-y,f*E)/E}var U=g.samples;return g.samples=[],{samples:U}},S.remuxText=function(g,f){var u=g.samples.length;if(!u)return;for(var E=g.inputTimeScale,b=this._initPTS,y=0;y<u;y++){var P=g.samples[y];P.pts=h(P.pts-b,f*E)/E}g.samples.sort(function(U,L){return U.pts-L.pts});var R=g.samples;return g.samples=[],{samples:R}},O}();function h(O,S){var _;if(S===null)return O;for(S<O?_=-8589934592:_=8589934592;Math.abs(O-S)>4294967296;)O+=_;return O}function I(O){for(var S=0;S<O.length;S++)if(O[S].key)return S;return-1}var w=function(S,_,g,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=g,this.cts=f,this.flags=new x(S)},x=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/polyfills/number.ts"),W=N("./src/utils/mp4-tools.ts"),D=N("./src/loader/fragment.ts"),H=N("./src/utils/logger.ts"),F=function(){function v(){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 m=v.prototype;return m.destroy=function(){},m.resetTimeStamp=function(d){this.initPTS=d,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(d,r,s){this.audioCodec=r,this.videoCodec=s,this.generateInitSegment(d),this.emitInitSegment=!0},m.generateInitSegment=function(d){var r=this.audioCodec,s=this.videoCodec;if(!d||!d.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(W.parseInitSegment)(d);r||(r=T(o.audio,D.ElementaryStreamTypes.AUDIO)),s||(s=T(o.video,D.ElementaryStreamTypes.VIDEO));var a={};o.audio&&o.video?a.audiovideo={container:"video/mp4",codec:r+","+s,initSegment:d,id:"main"}:o.audio?a.audio={container:"audio/mp4",codec:r,initSegment:d,id:"audio"}:o.video?a.video={container:"video/mp4",codec:s,initSegment:d,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},m.remux=function(d,r,s,o,a){var l=this.initPTS,h=this.lastEndDTS,I={audio:void 0,video:void 0,text:o,id3:s,initSegment:void 0};Object(V.isFiniteNumber)(h)||(h=this.lastEndDTS=a||0);var w=r.samples;if(!w||!w.length)return I;var x={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(w),O=this.initData),!O||!O.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),I;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(l)||(this.initPTS=x.initPTS=l=k(O,w,h));var S=Object(W.getDuration)(w,O),_=h,g=S+_;Object(W.offsetStartDTS)(O,w,l),S>0?this.lastEndDTS=g:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!O.audio,u=!!O.video,E="";f&&(E+="audio"),u&&(E+="video");var b={data1:w,startPTS:_,startDTS:_,endPTS:g,endDTS:g,type:E,hasAudio:f,hasVideo:u,nb:1,dropped:0};return I.audio=b.type==="audio"?b:void 0,I.video=b.type!=="audio"?b:void 0,I.text=o,I.id3=s,I.initSegment=x,I},v}(),k=function(m,c,d){return Object(W.getStartDTS)(m,c)-d};function T(v,m){var c=v==null?void 0:v.codec;return c&&c.length>4?c:c==="hvc1"?"hvc1.1.c.L120.90":c==="av01"?"av01.0.04M.08":c==="avc1"||m===D.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=F},"./src/task-loop.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var D=W.prototype;return D.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},D.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},D.onHandlerDestroyed=function(){},D.hasInterval=function(){return!!this._tickInterval},D.hasNextTick=function(){return!!this._tickTimer},D.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},D.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},D.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},D.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},D.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},D.doTick=function(){},W}()},"./src/types/cmcd.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"CMCDVersion",function(){return V}),N.d(z,"CMCDObjectType",function(){return W}),N.d(z,"CMCDStreamingFormat",function(){return D}),N.d(z,"CMCDStreamType",function(){return H});var V=1,W;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(W||(W={}));var D;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(D||(D={}));var H;(function(F){F.VOD="v",F.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"HlsSkip",function(){return D}),N.d(z,"getSkipValue",function(){return H}),N.d(z,"HlsUrlParameters",function(){return F}),N.d(z,"Level",function(){return k});function V(T,v){for(var m=0;m<v.length;m++){var c=v[m];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(T,c.key,c)}}function W(T,v,m){return v&&V(T.prototype,v),m&&V(T,m),T}var D;(function(T){T.No="",T.Yes="YES",T.v2="v2"})(D||(D={}));function H(T,v){var m=T.canSkipUntil,c=T.canSkipDateRanges,d=T.endSN,r=v!==void 0?v-d:0;return m&&r<m?c?D.v2:D.Yes:D.No}var F=function(){function T(m,c,d){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=c,this.skip=d}var v=T.prototype;return v.addDirectives=function(c){var d=new self.URL(c);return this.msn!==void 0&&d.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&d.searchParams.set("_HLS_part",this.part.toString()),this.skip&&d.searchParams.set("_HLS_skip",this.skip),d.toString()},T}(),k=function(){function T(v){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=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return W(T,[{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(m){var c=m%this.url.length;this._urlId!==c&&(this.details=void 0,this._urlId=c)}}]),T}()},"./src/types/loader.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"PlaylistContextType",function(){return V}),N.d(z,"PlaylistLevelType",function(){return W});var V;(function(D){D.MANIFEST="manifest",D.LEVEL="level",D.AUDIO_TRACK="audioTrack",D.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var W;(function(D){D.MAIN="main",D.AUDIO="audio",D.SUBTITLE="subtitle"})(W||(W={}))},"./src/types/transmuxer.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"ChunkMetadata",function(){return V});var V=function(H,F,k,T,v,m){T===void 0&&(T=0),v===void 0&&(v=-1),m===void 0&&(m=!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=W(),this.buffering={audio:W(),video:W(),audiovideo:W()},this.level=H,this.sn=F,this.id=k,this.size=T,this.part=v,this.partial=m};function W(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"AttrList",function(){return D});var V=/^(\d+)x(\d+)$/,W=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,D=function(){function H(k){typeof k=="string"&&(k=H.parseAttrList(k));for(var T in k)k.hasOwnProperty(T)&&(this[T]=k[T])}var F=H.prototype;return F.decimalInteger=function(T){var v=parseInt(this[T],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},F.hexadecimalInteger=function(T){if(this[T]){var v=(this[T]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),c=0;c<v.length/2;c++)m[c]=parseInt(v.slice(c*2,c*2+2),16);return m}else return null},F.hexadecimalIntegerAsNumber=function(T){var v=parseInt(this[T],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},F.decimalFloatingPoint=function(T){return parseFloat(this[T])},F.optionalFloat=function(T,v){var m=this[T];return m?parseFloat(m):v},F.enumeratedString=function(T){return this[T]},F.bool=function(T){return this[T]==="YES"},F.decimalResolution=function(T){var v=V.exec(this[T]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},H.parseAttrList=function(T){var v,m={},c='"';for(W.lastIndex=0;(v=W.exec(T))!==null;){var d=v[2];d.indexOf(c)===0&&d.lastIndexOf(c)===d.length-1&&(d=d.slice(1,-1)),m[v[1]]=d}return m},H}()},"./src/utils/binary-search.ts":function(q,z,N){"use strict";N.r(z);var V={search:function(D,H){for(var F=0,k=D.length-1,T=null,v=null;F<=k;){T=(F+k)/2|0,v=D[T];var m=H(v);if(m>0)F=T+1;else if(m<0)k=T-1;else return v}return null}};z.default=V},"./src/utils/buffer-helper.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"BufferHelper",function(){return D});var V=N("./src/utils/logger.ts"),W={length:0,start:function(){return 0},end:function(){return 0}},D=function(){function H(){}return H.isBuffered=function(k,T){try{if(k){for(var v=H.getBuffered(k),m=0;m<v.length;m++)if(T>=v.start(m)&&T<=v.end(m))return!0}}catch(c){}return!1},H.bufferInfo=function(k,T,v){try{if(k){var m=H.getBuffered(k),c=[],d;for(d=0;d<m.length;d++)c.push({start:m.start(d),end:m.end(d)});return this.bufferedInfo(c,T,v)}}catch(r){}return{len:0,start:T,end:T,nextStart:void 0}},H.bufferedInfo=function(k,T,v){T=Math.max(0,T),k.sort(function(x,O){var S=x.start-O.start;return S||O.end-x.end});var m=[];if(v)for(var c=0;c<k.length;c++){var d=m.length;if(d){var r=m[d-1].end;k[c].start-r<v?k[c].end>r&&(m[d-1].end=k[c].end):m.push(k[c])}else m.push(k[c])}else m=k;for(var s=0,o,a=T,l=T,h=0;h<m.length;h++){var I=m[h].start,w=m[h].end;if(T+v>=I&&T<w)a=I,l=w,s=l-T;else if(T+v<I){o=I;break}}return{len:s,start:a||0,end:l||0,nextStart:o}},H.getBuffered=function(k){try{return k.buffered}catch(T){return V.logger.log("failed to get media.buffered",T),W}},H}()},"./src/utils/cea-608-parser.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"Row",function(){return l}),N.d(z,"CaptionScreen",function(){return h});var V=N("./src/utils/logger.ts"),W={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},D=function(g){var f=g;return W.hasOwnProperty(g)&&(f=W[g]),String.fromCharCode(f)},H=15,F=100,k={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},T={17:2,18:4,21:6,22:8,23:10,19:13,20:15},v={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},c=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(d||(d={}));var r=function(){function _(){this.time=null,this.verboseLevel=d.ERROR}var g=_.prototype;return g.log=function(u,E){this.verboseLevel>=u&&V.logger.log(this.time+" ["+u+"] "+E)},_}(),s=function(g){for(var f=[],u=0;u<g.length;u++)f.push(g[u].toString(16));return f},o=function(){function _(f,u,E,b,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=u||!1,this.italics=E||!1,this.background=b||"black",this.flash=y||!1}var g=_.prototype;return g.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},g.setStyles=function(u){for(var E=["foreground","underline","italics","background","flash"],b=0;b<E.length;b++){var y=E[b];u.hasOwnProperty(y)&&(this[y]=u[y])}},g.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},g.equals=function(u){return this.foreground===u.foreground&&this.underline===u.underline&&this.italics===u.italics&&this.background===u.background&&this.flash===u.flash},g.copy=function(u){this.foreground=u.foreground,this.underline=u.underline,this.italics=u.italics,this.background=u.background,this.flash=u.flash},g.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),a=function(){function _(f,u,E,b,y,P){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new o(u,E,b,y,P)}var g=_.prototype;return g.reset=function(){this.uchar=" ",this.penState.reset()},g.setChar=function(u,E){this.uchar=u,this.penState.copy(E)},g.setPenState=function(u){this.penState.copy(u)},g.equals=function(u){return this.uchar===u.uchar&&this.penState.equals(u.penState)},g.copy=function(u){this.uchar=u.uchar,this.penState.copy(u.penState)},g.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),l=function(){function _(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var u=0;u<F;u++)this.chars.push(new a);this.logger=f,this.pos=0,this.currPenState=new o}var g=_.prototype;return g.equals=function(u){for(var E=!0,b=0;b<F;b++)if(!this.chars[b].equals(u.chars[b])){E=!1;break}return E},g.copy=function(u){for(var E=0;E<F;E++)this.chars[E].copy(u.chars[E])},g.isEmpty=function(){for(var u=!0,E=0;E<F;E++)if(!this.chars[E].isEmpty()){u=!1;break}return u},g.setCursor=function(u){this.pos!==u&&(this.pos=u),this.pos<0?(this.logger.log(d.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},g.moveCursor=function(u){var E=this.pos+u;if(u>1)for(var b=this.pos+1;b<E+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(E)},g.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},g.insertChar=function(u){u>=144&&this.backSpace();var E=D(u);if(this.pos>=F){this.logger.log(d.ERROR,"Cannot insert "+u.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},g.clearFromPos=function(u){var E;for(E=u;E<F;E++)this.chars[E].reset()},g.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},g.clearToEndOfRow=function(){this.clearFromPos(this.pos)},g.getTextString=function(){for(var u=[],E=!0,b=0;b<F;b++){var y=this.chars[b].uchar;y!==" "&&(E=!1),u.push(y)}return E?"":u.join("")},g.setPenStyles=function(u){this.currPenState.setStyles(u);var E=this.chars[this.pos];E.setPenState(this.currPenState)},_}(),h=function(){function _(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var u=0;u<H;u++)this.rows.push(new l(f));this.logger=f,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var g=_.prototype;return g.reset=function(){for(var u=0;u<H;u++)this.rows[u].clear();this.currRow=H-1},g.equals=function(u){for(var E=!0,b=0;b<H;b++)if(!this.rows[b].equals(u.rows[b])){E=!1;break}return E},g.copy=function(u){for(var E=0;E<H;E++)this.rows[E].copy(u.rows[E])},g.isEmpty=function(){for(var u=!0,E=0;E<H;E++)if(!this.rows[E].isEmpty()){u=!1;break}return u},g.backSpace=function(){var u=this.rows[this.currRow];u.backSpace()},g.clearToEndOfRow=function(){var u=this.rows[this.currRow];u.clearToEndOfRow()},g.insertChar=function(u){var E=this.rows[this.currRow];E.insertChar(u)},g.setPen=function(u){var E=this.rows[this.currRow];E.setPenStyles(u)},g.moveCursor=function(u){var E=this.rows[this.currRow];E.moveCursor(u)},g.setCursor=function(u){this.logger.log(d.INFO,"setCursor: "+u);var E=this.rows[this.currRow];E.setCursor(u)},g.setPAC=function(u){this.logger.log(d.INFO,"pacData = "+JSON.stringify(u));var E=u.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var b=0;b<H;b++)this.rows[b].clear();var y=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var R=P.rows[y].cueStartTime,U=this.logger.time;if(R&&U!==null&&R<U)for(var L=0;L<this.nrRollUpRows;L++)this.rows[E-this.nrRollUpRows+L+1].copy(P.rows[y+L])}}this.currRow=E;var j=this.rows[this.currRow];if(u.indent!==null){var A=u.indent,X=Math.max(A-1,0);j.setCursor(u.indent),u.color=j.chars[X].penState.foreground}var ee={foreground:u.color,underline:u.underline,italics:u.italics,background:"black",flash:!1};this.setPen(ee)},g.setBkgData=function(u){this.logger.log(d.INFO,"bkgData = "+JSON.stringify(u)),this.backSpace(),this.setPen(u),this.insertChar(32)},g.setRollUpRows=function(u){this.nrRollUpRows=u},g.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(d.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(d.TEXT,this.getDisplayText());var u=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(u,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(d.INFO,"Rolling up")},g.getDisplayText=function(u){u=u||!1;for(var E=[],b="",y=-1,P=0;P<H;P++){var R=this.rows[P].getTextString();R&&(y=P+1,u?E.push("Row "+y+": '"+R+"'"):E.push(R.trim()))}return E.length>0&&(u?b="["+E.join(" | ")+"]":b=E.join(`
`)),b},g.getTextAndFormat=function(){return this.rows},_}(),I=function(){function _(f,u,E){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=f,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new h(E),this.nonDisplayedMemory=new h(E),this.lastOutputScreen=new h(E),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var g=_.prototype;return g.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},g.getHandler=function(){return this.outputFilter},g.setHandler=function(u){this.outputFilter=u},g.setPAC=function(u){this.writeScreen.setPAC(u)},g.setBkgData=function(u){this.writeScreen.setBkgData(u)},g.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(d.INFO,"MODE="+u),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=u},g.insertChars=function(u){for(var E=0;E<u.length;E++)this.writeScreen.insertChar(u[E]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(d.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(d.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},g.ccRCL=function(){this.logger.log(d.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},g.ccBS=function(){if(this.logger.log(d.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},g.ccAOF=function(){},g.ccAON=function(){},g.ccDER=function(){this.logger.log(d.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},g.ccRU=function(u){this.logger.log(d.INFO,"RU("+u+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(u)},g.ccFON=function(){this.logger.log(d.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},g.ccRDC=function(){this.logger.log(d.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},g.ccTR=function(){this.logger.log(d.INFO,"TR"),this.setMode("MODE_TEXT")},g.ccRTD=function(){this.logger.log(d.INFO,"RTD"),this.setMode("MODE_TEXT")},g.ccEDM=function(){this.logger.log(d.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},g.ccCR=function(){this.logger.log(d.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},g.ccENM=function(){this.logger.log(d.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},g.ccEOC=function(){if(this.logger.log(d.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var u=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=u,this.writeScreen=this.nonDisplayedMemory,this.logger.log(d.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},g.ccTO=function(u){this.logger.log(d.INFO,"TO("+u+") - Tab Offset"),this.writeScreen.moveCursor(u)},g.ccMIDROW=function(u){var E={flash:!1};if(E.underline=u%2===1,E.italics=u>=46,E.italics)E.foreground="white";else{var b=Math.floor(u/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=y[b]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},g.outputDataUpdate=function(u){u===void 0&&(u=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},g.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},_}(),w=function(){function _(f,u,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new r;this.channels=[null,new I(f,u,b),new I(f+1,E,b)],this.cmdHistory=S(),this.logger=b}var g=_.prototype;return g.getHandler=function(u){return this.channels[u].getHandler()},g.setHandler=function(u,E){this.channels[u].setHandler(E)},g.addData=function(u,E){var b,y,P,R=!1;this.logger.time=u;for(var U=0;U<E.length;U+=2){if(y=E[U]&127,P=E[U+1]&127,y===0&&P===0)continue;if(this.logger.log(d.DATA,"["+s([E[U],E[U+1]])+"] -> ("+s([y,P])+")"),b=this.parseCmd(y,P),b||(b=this.parseMidrow(y,P)),b||(b=this.parsePAC(y,P)),b||(b=this.parseBackgroundAttributes(y,P)),!b&&(R=this.parseChars(y,P),R)){var L=this.currentChannel;if(L&&L>0){var j=this.channels[L];j.insertChars(R)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!R&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+s([y,P])+" orig: "+s([E[U],E[U+1]]))}},g.parseCmd=function(u,E){var b=this.cmdHistory,y=(u===20||u===28||u===21||u===29)&&E>=32&&E<=47,P=(u===23||u===31)&&E>=33&&E<=35;if(!(y||P))return!1;if(O(u,E,b))return x(null,null,b),this.logger.log(d.DEBUG,"Repeated command ("+s([u,E])+") is dropped"),!0;var R=u===20||u===21||u===23?1:2,U=this.channels[R];return u===20||u===21||u===28||u===29?E===32?U.ccRCL():E===33?U.ccBS():E===34?U.ccAOF():E===35?U.ccAON():E===36?U.ccDER():E===37?U.ccRU(2):E===38?U.ccRU(3):E===39?U.ccRU(4):E===40?U.ccFON():E===41?U.ccRDC():E===42?U.ccTR():E===43?U.ccRTD():E===44?U.ccEDM():E===45?U.ccCR():E===46?U.ccENM():E===47&&U.ccEOC():U.ccTO(E-32),x(u,E,b),this.currentChannel=R,!0},g.parseMidrow=function(u,E){var b=0;if((u===17||u===25)&&E>=32&&E<=47){if(u===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[b];return y?(y.ccMIDROW(E),this.logger.log(d.DEBUG,"MIDROW ("+s([u,E])+")"),!0):!1}return!1},g.parsePAC=function(u,E){var b,y=this.cmdHistory,P=(u>=17&&u<=23||u>=25&&u<=31)&&E>=64&&E<=127,R=(u===16||u===24)&&E>=64&&E<=95;if(!(P||R))return!1;if(O(u,E,y))return x(null,null,y),!0;var U=u<=23?1:2;E>=64&&E<=95?b=U===1?k[u]:v[u]:b=U===1?T[u]:m[u];var L=this.channels[U];return L?(L.setPAC(this.interpretPAC(b,E)),x(u,E,y),this.currentChannel=U,!0):!1},g.interpretPAC=function(u,E){var b,y={color:null,italics:!1,indent:null,underline:!1,row:u};return E>95?b=E-96:b=E-64,y.underline=(b&1)===1,b<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((b-16)/2)*4,y},g.parseChars=function(u,E){var b,y=null,P=null;if(u>=25?(b=2,P=u-8):(b=1,P=u),P>=17&&P<=19){var R;P===17?R=E+80:P===18?R=E+112:R=E+144,this.logger.log(d.INFO,"Special char '"+D(R)+"' in channel "+b),y=[R]}else u>=32&&u<=127&&(y=E===0?[u]:[u,E]);if(y){var U=s(y);this.logger.log(d.DEBUG,"Char codes = "+U.join(",")),x(u,E,this.cmdHistory)}return y},g.parseBackgroundAttributes=function(u,E){var b=(u===16||u===24)&&E>=32&&E<=47,y=(u===23||u===31)&&E>=45&&E<=47;if(!(b||y))return!1;var P,R={};u===16||u===24?(P=Math.floor((E-32)/2),R.background=c[P],E%2===1&&(R.background=R.background+"_semi")):E===45?R.background="transparent":(R.foreground="black",E===47&&(R.underline=!0));var U=u<=23?1:2,L=this.channels[U];return L.setBkgData(R),x(u,E,this.cmdHistory),!0},g.reset=function(){for(var u=0;u<Object.keys(this.channels).length;u++){var E=this.channels[u];E&&E.reset()}this.cmdHistory=S()},g.cueSplitAtTime=function(u){for(var E=0;E<this.channels.length;E++){var b=this.channels[E];b&&b.cueSplitAtTime(u)}},_}();function x(_,g,f){f.a=_,f.b=g}function O(_,g,f){return f.a===_&&f.b===g}function S(){return{a:null,b:null}}z.default=w},"./src/utils/codecs.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"isCodecType",function(){return W}),N.d(z,"isCodecSupportedInMp4",function(){return D});var V={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 W(H,F){var k=V[F];return!!k&&k[H.slice(0,4)]===!0}function D(H,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/utils/vttparser.ts"),W=N("./src/utils/webvtt-parser.ts"),D=N("./src/utils/texttrack-utils.ts"),H=/\s/,F={newCue:function(T,v,m,c){for(var d=[],r,s,o,a,l,h=self.VTTCue||self.TextTrackCue,I=0;I<c.rows.length;I++)if(r=c.rows[I],o=!0,a=0,l="",!r.isEmpty()){for(var w=0;w<r.chars.length;w++)H.test(r.chars[w].uchar)&&o?a++:(l+=r.chars[w].uchar,o=!1);r.cueStartTime=v,v===m&&(m+=1e-4),a>=16?a--:a++;var x=Object(V.fixLineBreaks)(l.trim()),O=Object(W.generateCueId)(v,m,x);(!T||!T.cues||!T.cues.getCueById(O))&&(s=new h(v,m,x),s.id=O,s.line=I+1,s.align="left",s.position=10+Math.min(80,Math.floor(a*8/32)*10),d.push(s))}return T&&d.length&&(d.sort(function(S,_){return S.line==="auto"||_.line==="auto"?0:S.line>8&&_.line>8?_.line-S.line:S.line-_.line}),d.forEach(function(S){return Object(D.addCueToTrack)(T,S)})),d}};z.default=F},"./src/utils/discontinuities.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"findFirstFragWithCC",function(){return H}),N.d(z,"shouldAlignOnDiscontinuities",function(){return F}),N.d(z,"findDiscontinuousReferenceFrag",function(){return k}),N.d(z,"adjustSlidingStart",function(){return v}),N.d(z,"alignStream",function(){return m}),N.d(z,"alignPDT",function(){return d}),N.d(z,"alignFragmentByPDTDelta",function(){return r}),N.d(z,"alignMediaPlaylistByPDT",function(){return s});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/logger.ts"),D=N("./src/controller/level-helper.ts");function H(o,a){for(var l=null,h=0,I=o.length;h<I;h++){var w=o[h];if(w&&w.cc===a){l=w;break}}return l}function F(o,a,l){return!!(a.details&&(l.endCC>l.startCC||o&&o.cc<l.startCC))}function k(o,a){var l=o.fragments,h=a.fragments;if(!h.length||!l.length){W.logger.log("No fragments to align");return}var I=H(l,h[0].cc);if(!I||I&&!I.startPTS){W.logger.log("No frag in previous level to align on");return}return I}function T(o,a){if(o){var l=o.start+a;o.start=o.startPTS=l,o.endPTS=l+o.duration}}function v(o,a){for(var l=a.fragments,h=0,I=l.length;h<I;h++)T(l[h],o);a.fragmentHint&&T(a.fragmentHint,o),a.alignedSliding=!0}function m(o,a,l){if(!a)return;c(o,l,a),!l.alignedSliding&&a.details&&d(l,a.details),!l.alignedSliding&&a.details&&!l.skippedSegments&&Object(D.adjustSliding)(a.details,l)}function c(o,a,l){if(F(o,l,a)){var h=k(l.details,a);h&&Object(V.isFiniteNumber)(h.start)&&(W.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),v(h.start,a))}}function d(o,a){if(!a.fragments.length||!o.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,h=o.fragments[0].programDateTime,I=(h-l)/1e3+a.fragments[0].start;I&&Object(V.isFiniteNumber)(I)&&(W.logger.log("Adjusting PTS using programDateTime delta "+(h-l)+"ms, sliding:"+I.toFixed(3)+" "+o.url+" "),v(I,o))}function r(o,a){var l=o.programDateTime;if(!l)return;var h=(l-a)/1e3;o.start=o.startPTS=h,o.endPTS=h+o.duration}function s(o,a){if(!a.fragments.length||!o.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,h=a.fragments[0].start,I=l-h*1e3;o.fragments.forEach(function(w){r(w,I)}),o.fragmentHint&&r(o.fragmentHint,I),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/utils/ewma.ts"),W=function(){function D(F,k,T){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=T,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(F),this.fast_=new V.default(k)}var H=D.prototype;return H.update=function(k,T){var v=this.slow_,m=this.fast_;this.slow_.halfLife!==k&&(this.slow_=new V.default(k,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==T&&(this.fast_=new V.default(T,m.getEstimate(),m.getTotalWeight()))},H.sample=function(k,T){k=Math.max(k,this.minDelayMs_);var v=8*T,m=k/1e3,c=v/m;this.fast_.sample(m,c),this.slow_.sample(m,c)},H.canEstimate=function(){var k=this.fast_;return k&&k.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},D}();z.default=W},"./src/utils/ewma.ts":function(q,z,N){"use strict";N.r(z);var V=function(){function W(H,F,k){F===void 0&&(F=0),k===void 0&&(k=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=F,this.totalWeight_=k}var D=W.prototype;return D.sample=function(F,k){var T=Math.pow(this.alpha_,F);this.estimate_=k*(1-T)+T*this.estimate_,this.totalWeight_+=F},D.getTotalWeight=function(){return this.totalWeight_},D.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},W}();z.default=V},"./src/utils/fetch-loader.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"fetchSupported",function(){return r});var V=N("./src/polyfills/number.ts"),W=N("./src/loader/load-stats.ts"),D=N("./src/demux/chunk-cache.ts");function H(h,I){h.prototype=Object.create(I.prototype),h.prototype.constructor=h,m(h,I)}function F(h){var I=typeof Map=="function"?new Map:void 0;return F=function(x){if(x===null||!v(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof I!="undefined"){if(I.has(x))return I.get(x);I.set(x,O)}function O(){return k(x,arguments,c(this).constructor)}return O.prototype=Object.create(x.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,x)},F(h)}function k(h,I,w){return T()?k=Reflect.construct:k=function(O,S,_){var g=[null];g.push.apply(g,S);var f=Function.bind.apply(O,g),u=new f;return _&&m(u,_.prototype),u},k.apply(null,arguments)}function T(){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 v(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function m(h,I){return m=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},m(h,I)}function c(h){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},c(h)}function d(){return d=Object.assign||function(h){for(var I=1;I<arguments.length;I++){var w=arguments[I];for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(h[x]=w[x])}return h},d.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}var s=function(){function h(w){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=w.fetchSetup||a,this.controller=new self.AbortController,this.stats=new W.LoadStats}var I=h.prototype;return I.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},I.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},I.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},I.load=function(x,O,S){var _=this,g=this.stats;if(g.loading.start)throw new Error("Loader can only be used once.");g.loading.start=self.performance.now();var f=o(x,this.controller.signal),u=S.onProgress,E=x.responseType==="arraybuffer",b=E?"byteLength":"length";this.context=x,this.config=O,this.callbacks=S,this.request=this.fetchSetup(x,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),S.onTimeout(g,x,_.response)},O.timeout),self.fetch(this.request).then(function(y){if(_.response=_.loader=y,!y.ok){var P=y.status,R=y.statusText;throw new l(R||"fetch, bad network response",P,y)}return g.loading.first=Math.max(self.performance.now(),g.loading.start),g.total=parseInt(y.headers.get("Content-Length")||"0"),u&&Object(V.isFiniteNumber)(O.highWaterMark)?_.loadProgressively(y,g,x,O.highWaterMark,u):E?y.arrayBuffer():y.text()}).then(function(y){var P=_.response;self.clearTimeout(_.requestTimeout),g.loading.end=Math.max(self.performance.now(),g.loading.first),g.loaded=g.total=y[b];var R={url:P.url,data:y};u&&!Object(V.isFiniteNumber)(O.highWaterMark)&&u(g,x,y,P),S.onSuccess(R,g,x,P)}).catch(function(y){if(self.clearTimeout(_.requestTimeout),g.aborted)return;var P=y.code||0;S.onError({code:P,text:y.message},x,y.details)})},I.getCacheAge=function(){var x=null;if(this.response){var O=this.response.headers.get("age");x=O?parseFloat(O):null}return x},I.loadProgressively=function(x,O,S,_,g){_===void 0&&(_=0);var f=new D.default,u=x.body.getReader(),E=function b(){return u.read().then(function(y){if(y.done)return f.dataLength&&g(O,S,f.flush(),x),Promise.resolve(new ArrayBuffer(0));var P=y.value,R=P.length;return O.loaded+=R,R<_||f.dataLength?(f.push(P),f.dataLength>=_&&g(O,S,f.flush(),x)):g(O,S,P,x),b()}).catch(function(){return Promise.reject()})};return E()},h}();function o(h,I){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:I,headers:new self.Headers(d({},h.headers))};return h.rangeEnd&&w.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),w}function a(h,I){return new self.Request(h.url,I)}var l=function(h){H(I,h);function I(w,x,O){var S;return S=h.call(this,w)||this,S.code=void 0,S.details=void 0,S.code=x,S.details=O,S}return I}(F(Error));z.default=s},"./src/utils/imsc1-ttml-parser.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"IMSC1_CODEC",function(){return v}),N.d(z,"parseIMSC1",function(){return r});var V=N("./src/utils/mp4-tools.ts"),W=N("./src/utils/vttparser.ts"),D=N("./src/utils/vttcue.ts"),H=N("./src/demux/id3.ts"),F=N("./src/utils/timescale-conversion.ts"),k=N("./src/utils/webvtt-parser.ts");function T(){return T=Object.assign||function(_){for(var g=1;g<arguments.length;g++){var f=arguments[g];for(var u in f)Object.prototype.hasOwnProperty.call(f,u)&&(_[u]=f[u])}return _},T.apply(this,arguments)}var v="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,c=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,d={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(_,g,f,u,E){var b=Object(V.findBox)(new Uint8Array(_),["mdat"]);if(b.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var y=b[0],P=Object(H.utf8ArrayToStr)(new Uint8Array(_,y.start,y.end-y.start)),R=Object(F.toTimescaleFromScale)(g,1,f);try{u(s(P,R))}catch(U){E(U)}}function s(_,g){var f=new DOMParser,u=f.parseFromString(_,"text/xml"),E=u.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(b).reduce(function(j,A){return j[A]=E.getAttribute("ttp:"+A)||b[A],j},{}),P=E.getAttribute("xml:space")!=="preserve",R=a(o(E,"styling","style")),U=a(o(E,"layout","region")),L=o(E,"body","[begin]");return[].map.call(L,function(j){var A=l(j,P);if(!A||!j.hasAttribute("begin"))return null;var X=x(j.getAttribute("begin"),y),ee=x(j.getAttribute("dur"),y),se=x(j.getAttribute("end"),y);if(X===null)throw w(j);if(se===null){if(ee===null)throw w(j);se=X+ee}var ce=new D.default(X-g,se-g,A);ce.id=Object(k.generateCueId)(ce.startTime,ce.endTime,ce.text);var Le=U[j.getAttribute("region")],Ce=R[j.getAttribute("style")];ce.position=10,ce.size=80;var Ae=h(Le,Ce),Pe=Ae.textAlign;if(Pe){var Ie=d[Pe];Ie&&(ce.lineAlign=Ie),ce.align=Pe}return T(ce,Ae),ce}).filter(function(j){return j!==null})}function o(_,g,f){var u=_.getElementsByTagName(g)[0];return u?[].slice.call(u.querySelectorAll(f)):[]}function a(_){return _.reduce(function(g,f){var u=f.getAttribute("xml:id");return u&&(g[u]=f),g},{})}function l(_,g){return[].slice.call(_.childNodes).reduce(function(f,u,E){var b;return u.nodeName==="br"&&E?f+`
`:(b=u.childNodes)!==null&&b!==void 0&&b.length?l(u,g):g?f+u.textContent.trim().replace(/\s+/g," "):f+u.textContent},"")}function h(_,g){var f="http://www.w3.org/ns/ttml#styling",u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return u.reduce(function(E,b){var y=I(g,f,b)||I(_,f,b);return y&&(E[b]=y),E},{})}function I(_,g,f){return _.hasAttributeNS(g,f)?_.getAttributeNS(g,f):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function x(_,g){if(!_)return null;var f=Object(W.parseTimeStamp)(_);return f===null&&(m.test(_)?f=O(_,g):c.test(_)&&(f=S(_,g))),f}function O(_,g){var f=m.exec(_),u=(f[4]|0)+(f[5]|0)/g.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+u/g.frameRate}function S(_,g){var f=c.exec(_),u=Number(f[1]),E=f[2];switch(E){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/g.frameRate;case"t":return u/g.tickRate}return u}},"./src/utils/logger.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"enableLogs",function(){return k}),N.d(z,"logger",function(){return T});var V=function(){},W={trace:V,debug:V,log:V,warn:V,info:V,error:V},D=W;function H(v){var m=self.console[v];return m?m.bind(self.console,"["+v+"] >"):V}function F(v){for(var m=arguments.length,c=new Array(m>1?m-1:0),d=1;d<m;d++)c[d-1]=arguments[d];c.forEach(function(r){D[r]=v[r]?v[r].bind(v):H(r)})}function k(v){if(self.console&&v===!0||typeof v=="object"){F(v,"debug","log","info","warn","error");try{D.log()}catch(m){D=W}}else D=W}var T=D},"./src/utils/mediakeys-helper.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"KeySystems",function(){return V}),N.d(z,"requestMediaKeySystemAccess",function(){return W});var V;(function(D){D.WIDEVINE="com.widevine.alpha",D.PLAYREADY="com.microsoft.playready"})(V||(V={}));var W=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"bin2str",function(){return F}),N.d(z,"readUint16",function(){return k}),N.d(z,"readUint32",function(){return T}),N.d(z,"writeUint32",function(){return v}),N.d(z,"findBox",function(){return m}),N.d(z,"parseSegmentIndex",function(){return c}),N.d(z,"parseInitSegment",function(){return d}),N.d(z,"getStartDTS",function(){return r}),N.d(z,"getDuration",function(){return s}),N.d(z,"computeRawDurationFromSamples",function(){return o}),N.d(z,"offsetStartDTS",function(){return a}),N.d(z,"segmentValidRange",function(){return l}),N.d(z,"appendUint8Array",function(){return h});var V=N("./src/utils/typed-array.ts"),W=N("./src/loader/fragment.ts"),D=Math.pow(2,32)-1,H=[].push;function F(I){return String.fromCharCode.apply(null,I)}function k(I,w){"data"in I&&(w+=I.start,I=I.data);var x=I[w]<<8|I[w+1];return x<0?65536+x:x}function T(I,w){"data"in I&&(w+=I.start,I=I.data);var x=I[w]<<24|I[w+1]<<16|I[w+2]<<8|I[w+3];return x<0?4294967296+x:x}function v(I,w,x){"data"in I&&(w+=I.start,I=I.data),I[w]=x>>24,I[w+1]=x>>16&255,I[w+2]=x>>8&255,I[w+3]=x&255}function m(I,w){var x=[];if(!w.length)return x;var O,S,_;"data"in I?(O=I.data,S=I.start,_=I.end):(O=I,S=0,_=O.byteLength);for(var g=S;g<_;){var f=T(O,g),u=F(O.subarray(g+4,g+8)),E=f>1?g+f:_;if(u===w[0])if(w.length===1)x.push({data:O,start:g+8,end:E});else{var b=m({data:O,start:g+8,end:E},w.slice(1));b.length&&H.apply(x,b)}g=E}return x}function c(I){var w=m(I,["moov"]),x=w[0],O=x?x.end:null,S=m(I,["sidx"]);if(!S||!S[0])return null;var _=[],g=S[0],f=g.data[0],u=f===0?8:16,E=T(g,u);u+=4;var b=0,y=0;f===0?u+=8:u+=16,u+=2;var P=g.end+y,R=k(g,u);u+=2;for(var U=0;U<R;U++){var L=u,j=T(g,L);L+=4;var A=j&2147483647,X=(j&2147483648)>>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=T(g,L);L+=4,_.push({referenceSize:A,subsegmentDuration:ee,info:{duration:ee/E,start:P,end:P+A-1}}),P+=A,L+=4,u=L}return{earliestPresentationTime:b,timescale:E,version:f,referencesCount:R,references:_,moovEndOffset:O}}function d(I){for(var w=[],x=m(I,["moov","trak"]),O=0;O<x.length;O++){var S=x[O],_=m(S,["tkhd"])[0];if(_){var g=_.data[_.start],f=g===0?12:20,u=T(_,f),E=m(S,["mdia","mdhd"])[0];if(E){g=E.data[E.start],f=g===0?12:20;var b=T(E,f),y=m(S,["mdia","hdlr"])[0];if(y){var P=F(y.data.subarray(y.start+8,y.start+12)),R={soun:W.ElementaryStreamTypes.AUDIO,vide:W.ElementaryStreamTypes.VIDEO}[P];if(R){var U=m(S,["mdia","minf","stbl","stsd"])[0],L=void 0;U&&(L=F(U.data.subarray(U.start+12,U.start+16))),w[u]={timescale:b,type:R},w[R]={timescale:b,id:u,codec:L}}}}}}var j=m(I,["moov","mvex","trex"]);return j.forEach(function(A){var X=T(A,4),ee=w[X];ee&&(ee.default={duration:T(A,12),flags:T(A,20)})}),w}function r(I,w){return m(w,["moof","traf"]).reduce(function(x,O){var S=m(O,["tfdt"])[0],_=S.data[S.start],g=m(O,["tfhd"]).reduce(function(f,u){var E=T(u,4),b=I[E];if(b){var y=T(S,4);_===1&&(y*=Math.pow(2,32),y+=T(S,8));var P=b.timescale||9e4,R=y/P;if(isFinite(R)&&(f===null||R<f))return R}return f},null);return g!==null&&isFinite(g)&&(x===null||g<x)?g:x},null)||0}function s(I,w){for(var x=0,O=0,S=0,_=m(I,["moof","traf"]),g=0;g<_.length;g++){var f=_[g],u=m(f,["tfhd"])[0],E=T(u,4),b=w[E];if(!b)continue;var y=b.default,P=T(u,0)|(y==null?void 0:y.flags),R=y==null?void 0:y.duration;P&8&&(P&2?R=T(u,12):R=T(u,8));for(var U=b.timescale||9e4,L=m(f,["trun"]),j=0;j<L.length;j++){if(R){var A=T(L[j],4);x=R*A}else x=o(L[j]);b.type===W.ElementaryStreamTypes.VIDEO?O+=x/U:b.type===W.ElementaryStreamTypes.AUDIO&&(S+=x/U)}}if(O===0&&S===0){var X=c(I);if(X!=null&&X.references)return X.references.reduce(function(ee,se){return ee+se.info.duration||0},0)}return O||S}function o(I){var w=T(I,0),x=8;w&1&&(x+=4),w&4&&(x+=4);for(var O=0,S=T(I,4),_=0;_<S;_++){if(w&256){var g=T(I,x);O+=g,x+=4}w&512&&(x+=4),w&1024&&(x+=4),w&2048&&(x+=4)}return O}function a(I,w,x){m(w,["moof","traf"]).forEach(function(O){m(O,["tfhd"]).forEach(function(S){var _=T(S,4),g=I[_];if(!g)return;var f=g.timescale||9e4;m(O,["tfdt"]).forEach(function(u){var E=u.data[u.start],b=T(u,4);if(E===0)v(u,4,b-x*f);else{b*=Math.pow(2,32),b+=T(u,8),b-=x*f,b=Math.max(b,0);var y=Math.floor(b/(D+1)),P=Math.floor(b%(D+1));v(u,4,y),v(u,8,P)}})})})}function l(I){var w={valid:null,remainder:null},x=m(I,["moof"]);if(x){if(x.length<2)return w.remainder=I,w}else return w;var O=x[x.length-1];return w.valid=Object(V.sliceUint8)(I,0,O.start-8),w.remainder=Object(V.sliceUint8)(I,O.start-8),w}function h(I,w){var x=new Uint8Array(I.length+w.length);return x.set(I),x.set(w,I.length),x}},"./src/utils/output-filter.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"default",function(){return V});var V=function(){function W(H,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=F}var D=W.prototype;return D.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},D.newCue=function(F,k,T){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=k,this.screen=T,this.timelineController.createCaptionsTrack(this.trackName)},D.reset=function(){this.cueRanges=[]},W}()},"./src/utils/texttrack-utils.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"sendAddTrackEvent",function(){return W}),N.d(z,"addCueToTrack",function(){return D}),N.d(z,"clearCurrentCues",function(){return H}),N.d(z,"removeCuesInRange",function(){return F}),N.d(z,"getCuesInRange",function(){return T});var V=N("./src/utils/logger.ts");function W(v,m){var c;try{c=new Event("addtrack")}catch(d){c=document.createEvent("Event"),c.initEvent("addtrack",!1,!1)}c.track=v,m.dispatchEvent(c)}function D(v,m){var c=v.mode;if(c==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(r){V.logger.debug("[texttrack-utils]: "+r);var d=new self.TextTrackCue(m.startTime,m.endTime,m.text);d.id=m.id,v.addCue(d)}c==="disabled"&&(v.mode=c)}function H(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var c=v.cues.length;c--;)v.removeCue(v.cues[c]);m==="disabled"&&(v.mode=m)}function F(v,m,c){var d=v.mode;if(d==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var r=T(v.cues,m,c),s=0;s<r.length;s++)v.removeCue(r[s]);d==="disabled"&&(v.mode=d)}function k(v,m){if(m<v[0].startTime)return 0;var c=v.length-1;if(m>v[c].endTime)return-1;for(var d=0,r=c;d<=r;){var s=Math.floor((r+d)/2);if(m<v[s].startTime)r=s-1;else if(m>v[s].startTime&&d<c)d=s+1;else return s}return v[d].startTime-m<m-v[r].startTime?d:r}function T(v,m,c){var d=[],r=k(v,m);if(r>-1)for(var s=r,o=v.length;s<o;s++){var a=v[s];if(a.startTime>=m&&a.endTime<=c)d.push(a);else if(a.startTime>c)return d}return d}},"./src/utils/time-ranges.ts":function(q,z,N){"use strict";N.r(z);var V={toString:function(D){for(var H="",F=D.length,k=0;k<F;k++)H+="["+D.start(k).toFixed(3)+","+D.end(k).toFixed(3)+"]";return H}};z.default=V},"./src/utils/timescale-conversion.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"toTimescaleFromBase",function(){return W}),N.d(z,"toTimescaleFromScale",function(){return D}),N.d(z,"toMsFromMpegTsClock",function(){return H}),N.d(z,"toMpegTsClockFromTimescale",function(){return F});var V=9e4;function W(k,T,v,m){v===void 0&&(v=1),m===void 0&&(m=!1);var c=k*T*v;return m?Math.round(c):c}function D(k,T,v,m){return v===void 0&&(v=1),m===void 0&&(m=!1),W(k,T,1/v,m)}function H(k,T){return T===void 0&&(T=!1),W(k,1e3,1/V,T)}function F(k,T){return T===void 0&&(T=1),W(k,V,1/T)}},"./src/utils/typed-array.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"sliceUint8",function(){return V});function V(W,D,H){return Uint8Array.prototype.slice?W.slice(D,H):new Uint8Array(Array.prototype.slice.call(W,D,H))}},"./src/utils/vttcue.ts":function(q,z,N){"use strict";N.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],W=["start","middle","end","left","right"];function D(v,m){if(typeof m!="string")return!1;if(!Array.isArray(v))return!1;var c=m.toLowerCase();return~v.indexOf(c)?c:!1}function H(v){return D(V,v)}function F(v){return D(W,v)}function k(v){for(var m=arguments.length,c=new Array(m>1?m-1:0),d=1;d<m;d++)c[d-1]=arguments[d];for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var o in s)v[o]=s[o]}return v}function T(v,m,c){var d=this,r={enumerable:!0};d.hasBeenReset=!1;var s="",o=!1,a=v,l=m,h=c,I=null,w="",x=!0,O="auto",S="start",_=50,g="middle",f=50,u="middle";Object.defineProperty(d,"id",k({},r,{get:function(){return s},set:function(b){s=""+b}})),Object.defineProperty(d,"pauseOnExit",k({},r,{get:function(){return o},set:function(b){o=!!b}})),Object.defineProperty(d,"startTime",k({},r,{get:function(){return a},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");a=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",k({},r,{get:function(){return l},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");l=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",k({},r,{get:function(){return h},set:function(b){h=""+b,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",k({},r,{get:function(){return I},set:function(b){I=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",k({},r,{get:function(){return w},set:function(b){var y=H(b);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=y,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",k({},r,{get:function(){return x},set:function(b){x=!!b,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",k({},r,{get:function(){return O},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",k({},r,{get:function(){return S},set:function(b){var y=F(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");S=y,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",k({},r,{get:function(){return _},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",k({},r,{get:function(){return g},set:function(b){var y=F(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");g=y,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",k({},r,{get:function(){return f},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");f=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",k({},r,{get:function(){return u},set:function(b){var y=F(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");u=y,this.hasBeenReset=!0}})),d.displayState=void 0}return T.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},T}()},"./src/utils/vttparser.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"parseTimeStamp",function(){return D}),N.d(z,"fixLineBreaks",function(){return m}),N.d(z,"VTTParser",function(){return c});var V=N("./src/utils/vttcue.ts"),W=function(){function d(){}var r=d.prototype;return r.decode=function(o,a){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},d}();function D(d){function r(o,a,l,h){return(o|0)*3600+(a|0)*60+(l|0)+parseFloat(h||0)}var s=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?r(s[2],s[3],0,s[4]):r(s[1],s[2],s[3],s[4]):null}var H=function(){function d(){this.values=Object.create(null)}var r=d.prototype;return r.set=function(o,a){!this.get(o)&&a!==""&&(this.values[o]=a)},r.get=function(o,a,l){return l?this.has(o)?this.values[o]:a[l]:this.has(o)?this.values[o]:a},r.has=function(o){return o in this.values},r.alt=function(o,a,l){for(var h=0;h<l.length;++h)if(a===l[h]){this.set(o,a);break}},r.integer=function(o,a){/^-?\d+$/.test(a)&&this.set(o,parseInt(a,10))},r.percent=function(o,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var l=parseFloat(a);if(l>=0&&l<=100)return this.set(o,l),!0}return!1},d}();function F(d,r,s,o){var a=o?d.split(o):[d];for(var l in a){if(typeof a[l]!="string")continue;var h=a[l].split(s);if(h.length!==2)continue;var I=h[0],w=h[1];r(I,w)}}var k=new V.default(0,0,""),T=k.align==="middle"?"middle":"center";function v(d,r,s){var o=d;function a(){var I=D(d);if(I===null)throw new Error("Malformed timestamp: "+o);return d=d.replace(/^[^\sa-zA-Z-]+/,""),I}function l(I,w){var x=new H;F(I,function(_,g){var f;switch(_){case"region":for(var u=s.length-1;u>=0;u--)if(s[u].id===g){x.set(_,s[u].region);break}break;case"vertical":x.alt(_,g,["rl","lr"]);break;case"line":f=g.split(","),x.integer(_,f[0]),x.percent(_,f[0])&&x.set("snapToLines",!1),x.alt(_,f[0],["auto"]),f.length===2&&x.alt("lineAlign",f[1],["start",T,"end"]);break;case"position":f=g.split(","),x.percent(_,f[0]),f.length===2&&x.alt("positionAlign",f[1],["start",T,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,g);break;case"align":x.alt(_,g,["start",T,"end","left","right"]);break}},/:/,/\s/),w.region=x.get("region",null),w.vertical=x.get("vertical","");var O=x.get("line","auto");O==="auto"&&k.line===-1&&(O=-1),w.line=O,w.lineAlign=x.get("lineAlign","start"),w.snapToLines=x.get("snapToLines",!0),w.size=x.get("size",100),w.align=x.get("align",T);var S=x.get("position","auto");S==="auto"&&k.position===50&&(S=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=S}function h(){d=d.replace(/^\s+/,"")}if(h(),r.startTime=a(),h(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);d=d.substr(3),h(),r.endTime=a(),h(),l(d,r)}function m(d){return d.replace(/<br(?: \/)?>/gi,`
`)}var c=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new W,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=d.prototype;return r.parse=function(o){var a=this;o&&(a.buffer+=a.decoder.decode(o,{stream:!0}));function l(){var S=a.buffer,_=0;for(S=m(S);_<S.length&&S[_]!=="\r"&&S[_]!==`
`;)++_;var g=S.substr(0,_);return S[_]==="\r"&&++_,S[_]===`
`&&++_,a.buffer=S.substr(_),g}function h(S){F(S,function(_,g){},/:/)}try{var I="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;I=l();var w=I.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var x=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;x?x=!1:I=l();switch(a.state){case"HEADER":/:/.test(I)?h(I):I||(a.state="ID");continue;case"NOTE":I||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(I)){a.state="NOTE";break}if(!I)continue;if(a.cue=new V.default(0,0,""),a.state="CUE",I.indexOf("-->")===-1){a.cue.id=I;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{v(I,a.cue,a.regionList)}catch(S){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var O=I.indexOf("-->")!==-1;if(!I||O&&(x=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
`),a.cue.text+=I}continue;case"BADCUE":I||(a.state="ID")}}}catch(S){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){o.onparsingerror&&o.onparsingerror(a)}return o.onflush&&o.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(q,z,N){"use strict";N.r(z),N.d(z,"generateCueId",function(){return c}),N.d(z,"parseWebVTT",function(){return r});var V=N("./src/polyfills/number.ts"),W=N("./src/utils/vttparser.ts"),D=N("./src/demux/id3.ts"),H=N("./src/utils/timescale-conversion.ts"),F=N("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,T=function(o,a,l){return l===void 0&&(l=0),o.substr(l,a.length)===a},v=function(o){var a=parseInt(o.substr(-3)),l=parseInt(o.substr(-6,2)),h=parseInt(o.substr(-9,2)),I=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(l)||!Object(V.isFiniteNumber)(h)||!Object(V.isFiniteNumber)(I))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return a+=1e3*l,a+=60*1e3*h,a+=60*60*1e3*I,a},m=function(o){for(var a=5381,l=o.length;l;)a=a*33^o.charCodeAt(--l);return(a>>>0).toString()};function c(s,o,a){return m(s.toString())+m(o.toString())+m(a)}var d=function(o,a,l){var h=o[a],I=o[h.prevCC];if(!I||!I.new&&h.new){o.ccOffset=o.presentationOffset=h.start,h.new=!1;return}for(;(w=I)!==null&&w!==void 0&&w.new;){var w;o.ccOffset+=h.start-I.start,h.new=!1,h=I,I=o[h.prevCC]}o.presentationOffset=l};function r(s,o,a,l,h,I,w,x){var O=new W.VTTParser,S=Object(D.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(k,`
`).split(`
`),_=[],g=Object(H.toMpegTsClockFromTimescale)(o,a),f="00:00.000",u=0,E=0,b,y=!0,P=!1;O.oncue=function(R){var U=l[h],L=l.ccOffset,j=(u-g)/9e4;if(U!=null&&U.new&&(E!==void 0?L=l.ccOffset=U.start:d(l,h,j)),j&&(L=j-l.presentationOffset),P){var A=R.endTime-R.startTime,X=Object(F.normalizePts)((R.startTime+L-E)*9e4,I*9e4)/9e4;R.startTime=X,R.endTime=X+A}var ee=R.text.trim();R.text=decodeURIComponent(encodeURIComponent(ee)),R.id||(R.id=c(R.startTime,R.endTime,ee)),R.endTime>0&&_.push(R)},O.onparsingerror=function(R){b=R},O.onflush=function(){if(b){x(b);return}w(_)},S.forEach(function(R){if(y)if(T(R,"X-TIMESTAMP-MAP=")){y=!1,P=!0,R.substr(16).split(",").forEach(function(U){T(U,"LOCAL:")?f=U.substr(6):T(U,"MPEGTS:")&&(u=parseInt(U.substr(7)))});try{E=v(f)/1e3}catch(U){P=!1,b=U}return}else R===""&&(y=!1);O.parse(R+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(q,z,N){"use strict";N.r(z);var V=N("./src/utils/logger.ts"),W=N("./src/loader/load-stats.ts"),D=/^age:\s*[\d.]+\s*$/m,H=function(){function F(T){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=T?T.xhrSetup:null,this.stats=new W.LoadStats,this.retryDelay=0}var k=F.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},k.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(v,m,c){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=c,this.retryDelay=m.retryDelay,this.loadInternal()},k.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var c=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var r=this.xhrSetup;try{if(r)try{r(c,m.url)}catch(a){c.open("GET",m.url,!0),r(c,m.url)}c.readyState||c.open("GET",m.url,!0);var s=this.context.headers;if(s)for(var o in s)c.setRequestHeader(o,s[o])}catch(a){this.callbacks.onError({code:c.status,text:a.message},m,c);return}m.rangeEnd&&c.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),c.onreadystatechange=this.readystatechange.bind(this),c.onprogress=this.loadprogress.bind(this),c.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),c.send()},k.readystatechange=function(){var v=this.context,m=this.loader,c=this.stats;if(!v||!m)return;var d=m.readyState,r=this.config;if(c.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),c.loading.first===0&&(c.loading.first=Math.max(self.performance.now(),c.loading.start)),d===4){m.onreadystatechange=null,m.onprogress=null;var s=m.status;if(s>=200&&s<300){c.loading.end=Math.max(self.performance.now(),c.loading.first);var o,a;if(v.responseType==="arraybuffer"?(o=m.response,a=o.byteLength):(o=m.responseText,a=o.length),c.loaded=c.total=a,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(c,v,o,m),!this.callbacks)return;var h={url:m.responseURL,data:o};this.callbacks.onSuccess(h,c,v,m)}else c.retry>=r.maxRetry||s>=400&&s<499?(V.logger.error(s+" while loading "+v.url),this.callbacks.onError({code:s,text:m.statusText},v,m)):(V.logger.warn(s+" while loading "+v.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,r.maxRetryDelay),c.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},k.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},k.getCacheAge=function(){var v=null;if(this.loader&&D.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},F}();z.default=H}}).default})},vHTk:function(Ke,Me,K){Ke.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return vt});var q=K("rePB"),z=K("VTBJ"),N=K("KQm4"),V=K("U8pU"),W=K("ODXe"),D=K("q1tI"),H=K("TSYQ"),F=K.n(H),k=K("Gytx"),T=K.n(k),v=K("Kwbf"),m=K("t23M"),c=K("qx4F"),d=K("6eGT"),r=K("IBYe"),s=K("Ff2n"),o=K("c+Xe"),a=K("fyJ8"),l=K("biw7");function h(ke,Oe,tt,it,Ne){var qe=tt[ke]||{},Te=tt[Oe]||{},fe,me;qe.fixed==="left"?fe=it.left[ke]:Te.fixed==="right"&&(me=it.right[Oe]);var re=!1,ae=!1,he=!1,ve=!1,_e=tt[Oe+1],je=tt[ke-1];if(Ne==="rtl"){if(fe!==void 0){var at=je&&je.fixed==="left";ve=!at}else if(me!==void 0){var Et=_e&&_e.fixed==="right";he=!Et}}else if(fe!==void 0){var Lt=_e&&_e.fixed==="left";re=!Lt}else if(me!==void 0){var Tt=je&&je.fixed==="right";ae=!Tt}return{fixLeft:fe,fixRight:me,lastFixLeft:re,firstFixRight:ae,lastFixRight:he,firstFixLeft:ve,isSticky:it.isSticky}}var I=K("sR1s");function w(ke){var Oe=ke.cells,tt=ke.stickyOffsets,it=ke.flattenColumns,Ne=ke.rowComponent,qe=ke.cellComponent,Te=ke.onHeaderRow,fe=ke.index,me=D.useContext(l.a),re=me.prefixCls,ae=me.direction,he;Te&&(he=Te(Oe.map(function(_e){return _e.column}),fe));var ve=Object(I.a)(Oe.map(function(_e){return _e.column}));return D.createElement(Ne,Object.assign({},he),Oe.map(function(_e,je){var at=_e.column,Et=h(_e.colStart,_e.colEnd,it,tt,ae),Lt;return at&&at.onHeaderCell&&(Lt=_e.column.onHeaderCell(at)),D.createElement(a.a,Object.assign({},_e,{ellipsis:at.ellipsis,align:at.align,component:qe,prefixCls:re,key:ve[je]},Et,{additionalProps:Lt,rowType:"header"}))}))}w.displayName="HeaderRow";var x=w;function O(ke){var Oe=[];function tt(Te,fe){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Oe[me]=Oe[me]||[];var re=fe,ae=Te.filter(Boolean).map(function(he){var ve={key:he.key,className:he.className||"",children:he.title,column:he,colStart:re},_e=1,je=he.children;return je&&je.length>0&&(_e=tt(je,re,me+1).reduce(function(at,Et){return at+Et},0),ve.hasSubColumns=!0),"colSpan"in he&&(_e=he.colSpan),"rowSpan"in he&&(ve.rowSpan=he.rowSpan),ve.colSpan=_e,ve.colEnd=ve.colStart+_e-1,Oe[me].push(ve),re+=_e,_e});return ae}tt(ke,0);for(var it=Oe.length,Ne=function(fe){Oe[fe].forEach(function(me){!("rowSpan"in me)&&!me.hasSubColumns&&(me.rowSpan=it-fe)})},qe=0;qe<it;qe+=1)Ne(qe);return Oe}function S(ke){var Oe=ke.stickyOffsets,tt=ke.columns,it=ke.flattenColumns,Ne=ke.onHeaderRow,qe=D.useContext(l.a),Te=qe.prefixCls,fe=qe.getComponent,me=D.useMemo(function(){return O(tt)},[tt]),re=fe(["header","wrapper"],"thead"),ae=fe(["header","row"],"tr"),he=fe(["header","cell"],"th");return D.createElement(re,{className:"".concat(Te,"-thead")},me.map(function(ve,_e){var je=D.createElement(x,{key:_e,flattenColumns:it,cells:ve,stickyOffsets:Oe,rowComponent:ae,cellComponent:he,onHeaderRow:Ne,index:_e});return je}))}var _=S,g=K("hW8S");function f(ke){for(var Oe=ke.colWidths,tt=ke.columns,it=ke.columCount,Ne=[],qe=it||tt.length,Te=!1,fe=qe-1;fe>=0;fe-=1){var me=Oe[fe],re=tt&&tt[fe],ae=re&&re[g.a];(me||ae||Te)&&(Ne.unshift(D.createElement("col",Object.assign({key:fe,style:{width:me,minWidth:me}},ae))),Te=!0)}return D.createElement("colgroup",null,Ne)}var u=f;function E(ke,Oe){return Object(D.useMemo)(function(){for(var tt=[],it=0;it<Oe;it+=1){var Ne=ke[it];if(Ne!==void 0)tt[it]=Ne;else return null}return tt},[ke.join("_"),Oe])}var b=D.forwardRef(function(ke,Oe){var tt=ke.noData,it=ke.columns,Ne=ke.flattenColumns,qe=ke.colWidths,Te=ke.columCount,fe=ke.stickyOffsets,me=ke.direction,re=ke.fixHeader,ae=ke.offsetHeader,he=ke.stickyClassName,ve=ke.onScroll,_e=Object(s.a)(ke,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),je=D.useContext(l.a),at=je.prefixCls,Et=je.scrollbarSize,Lt=je.isSticky,Tt=Lt&&!re?0:Et,mt=D.useRef(null),Ze=D.useCallback(function(bt){Object(o.b)(Oe,bt),Object(o.b)(mt,bt)},[]);D.useEffect(function(){var bt;function pt(Ee){var Be=Ee.currentTarget,st=Ee.deltaX;st&&(ve({currentTarget:Be,scrollLeft:Be.scrollLeft+st}),Ee.preventDefault())}return(bt=mt.current)===null||bt===void 0||bt.addEventListener("wheel",pt),function(){var Ee;(Ee=mt.current)===null||Ee===void 0||Ee.removeEventListener("wheel",pt)}},[]);var $e=Ne[Ne.length-1],He={fixed:$e?$e.fixed:null,onHeaderCell:function(){return{className:"".concat(at,"-cell-scrollbar")}}},le=Object(D.useMemo)(function(){return Tt?[].concat(Object(N.a)(it),[He]):it},[Tt,it]),be=Object(D.useMemo)(function(){return Tt?[].concat(Object(N.a)(Ne),[He]):Ne},[Tt,Ne]),rt=Object(D.useMemo)(function(){var bt=fe.right,pt=fe.left;return Object(z.a)(Object(z.a)({},fe),{},{left:me==="rtl"?[].concat(Object(N.a)(pt.map(function(Ee){return Ee+Tt})),[0]):pt,right:me==="rtl"?bt:[].concat(Object(N.a)(bt.map(function(Ee){return Ee+Tt})),[0]),isSticky:Lt})},[Tt,fe,Lt]),Ye=E(qe,Te);return D.createElement("div",{style:Object(z.a)({overflow:"hidden"},Lt?{top:ae}:{}),ref:Ze,className:F()("".concat(at,"-header"),Object(q.a)({},he,!!he))},D.createElement("table",{style:{tableLayout:"fixed",visibility:tt||Ye?null:"hidden"}},D.createElement(u,{colWidths:Ye?[].concat(Object(N.a)(Ye),[Tt]):[],columCount:Te+1,columns:be}),D.createElement(_,Object.assign({},_e,{stickyOffsets:rt,columns:le,flattenColumns:be}))))});b.displayName="FixedHeader";var y=b,P=D.createContext(null),R=P;function U(ke){var Oe=ke.prefixCls,tt=ke.children,it=ke.component,Ne=ke.cellComponent,qe=ke.fixHeader,Te=ke.fixColumn,fe=ke.horizonScroll,me=ke.className,re=ke.expanded,ae=ke.componentWidth,he=ke.colSpan,ve=D.useContext(l.a),_e=ve.scrollbarSize;return D.useMemo(function(){var je=tt;return Te&&(je=D.createElement("div",{style:{width:ae-(qe?_e:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Oe,"-expanded-row-fixed")},je)),D.createElement(it,{className:me,style:{display:re?null:"none"}},D.createElement(a.a,{component:Ne,prefixCls:Oe,colSpan:he},je))},[tt,it,qe,fe,me,re,ae,he,_e])}var L=U;function j(ke){var Oe=ke.className,tt=ke.style,it=ke.record,Ne=ke.index,qe=ke.rowKey,Te=ke.getRowKey,fe=ke.rowExpandable,me=ke.expandedKeys,re=ke.onRow,ae=ke.indent,he=ae===void 0?0:ae,ve=ke.rowComponent,_e=ke.cellComponent,je=ke.childrenColumnName,at=D.useContext(l.a),Et=at.prefixCls,Lt=at.fixedInfoList,Tt=D.useContext(R),mt=Tt.fixHeader,Ze=Tt.fixColumn,$e=Tt.horizonScroll,He=Tt.componentWidth,le=Tt.flattenColumns,be=Tt.expandableType,rt=Tt.expandRowByClick,Ye=Tt.onTriggerExpand,bt=Tt.rowClassName,pt=Tt.expandedRowClassName,Ee=Tt.indentSize,Be=Tt.expandIcon,st=Tt.expandedRowRender,ct=Tt.expandIconColumnIndex,Ct=D.useState(!1),lt=Object(W.a)(Ct,2),jt=lt[0],qt=lt[1],Ot=me&&me.has(ke.recordKey);D.useEffect(function(){Ot&&qt(!0)},[Ot]);var Zt=be==="row"&&(!fe||fe(it)),un=be==="nest",sn=je&&it&&it[je],Xt=Zt||un,mn;re&&(mn=re(it,Ne));var kn=function(C){if(rt&&Xt&&Ye(it,C),mn&&mn.onClick){for(var M,G=arguments.length,te=new Array(G>1?G-1:0),Q=1;Q<G;Q++)te[Q-1]=arguments[Q];(M=mn).onClick.apply(M,[C].concat(te))}},Un;typeof bt=="string"?Un=bt:typeof bt=="function"&&(Un=bt(it,Ne,he));var ft=Object(I.a)(le),Wt=D.createElement(ve,Object.assign({},mn,{"data-row-key":qe,className:F()(Oe,"".concat(Et,"-row"),"".concat(Et,"-row-level-").concat(he),Un,mn&&mn.className),style:Object(z.a)(Object(z.a)({},tt),mn?mn.style:null),onClick:kn}),le.map(function(Y,C){var M=Y.render,G=Y.dataIndex,te=Y.className,Q=ft[C],Se=Lt[C],ot;C===(ct||0)&&un&&(ot=D.createElement(D.Fragment,null,D.createElement("span",{style:{paddingLeft:"".concat(Ee*he,"px")},className:"".concat(Et,"-row-indent indent-level-").concat(he)}),Be({prefixCls:Et,expanded:Ot,expandable:sn,record:it,onExpand:Ye})));var St;return Y.onCell&&(St=Y.onCell(it,Ne)),D.createElement(a.a,Object.assign({className:te,ellipsis:Y.ellipsis,align:Y.align,component:_e,prefixCls:Et,key:Q,record:it,index:Ne,dataIndex:G,render:M,shouldCellUpdate:Y.shouldCellUpdate},Se,{appendNode:ot,additionalProps:St}))})),Qt;if(Zt&&(jt||Ot)){var $t=st(it,Ne,he+1,Ot),en=pt&&pt(it,Ne,he);Qt=D.createElement(L,{expanded:Ot,className:F()("".concat(Et,"-expanded-row"),"".concat(Et,"-expanded-row-level-").concat(he+1),en),prefixCls:Et,fixHeader:mt,fixColumn:Ze,horizonScroll:$e,component:ve,componentWidth:He,cellComponent:_e,colSpan:le.length},$t)}var fn;return sn&&Ot&&(fn=(it[je]||[]).map(function(Y,C){var M=Te(Y,C);return D.createElement(j,Object.assign({},ke,{key:M,rowKey:M,record:Y,recordKey:M,index:C,indent:he+1}))})),D.createElement(D.Fragment,null,Wt,Qt,fn)}j.displayName="BodyRow";var A=j,X=D.createContext(null),ee=X;function se(ke){var Oe=ke.columnKey,tt=ke.onColumnResize,it=D.useRef();return D.useEffect(function(){it.current&&tt(Oe,it.current.offsetWidth)},[]),D.createElement(m.a,{onResize:function(qe){var Te=qe.offsetWidth;tt(Oe,Te)}},D.createElement("td",{ref:it,style:{padding:0,border:0,height:0}},D.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ce(ke){var Oe=ke.data,tt=ke.getRowKey,it=ke.measureColumnWidth,Ne=ke.expandedKeys,qe=ke.onRow,Te=ke.rowExpandable,fe=ke.emptyNode,me=ke.childrenColumnName,re=D.useContext(ee),ae=re.onColumnResize,he=D.useContext(l.a),ve=he.prefixCls,_e=he.getComponent,je=D.useContext(R),at=je.fixHeader,Et=je.horizonScroll,Lt=je.flattenColumns,Tt=je.componentWidth;return D.useMemo(function(){var mt=_e(["body","wrapper"],"tbody"),Ze=_e(["body","row"],"tr"),$e=_e(["body","cell"],"td"),He;Oe.length?He=Oe.map(function(be,rt){var Ye=tt(be,rt);return D.createElement(A,{key:Ye,rowKey:Ye,record:be,recordKey:Ye,index:rt,rowComponent:Ze,cellComponent:$e,expandedKeys:Ne,onRow:qe,getRowKey:tt,rowExpandable:Te,childrenColumnName:me})}):He=D.createElement(L,{expanded:!0,className:"".concat(ve,"-placeholder"),prefixCls:ve,fixHeader:at,fixColumn:Et,horizonScroll:Et,component:Ze,componentWidth:Tt,cellComponent:$e,colSpan:Lt.length},fe);var le=Object(I.a)(Lt);return D.createElement(mt,{className:"".concat(ve,"-tbody")},it&&D.createElement("tr",{"aria-hidden":"true",className:"".concat(ve,"-measure-row"),style:{height:0}},le.map(function(be){return D.createElement(se,{key:be,columnKey:be,onColumnResize:ae})})),He)},[Oe,ve,qe,it,Ne,tt,_e,Tt,fe,Lt])}var Le=D.memo(ce);Le.displayName="Body";var Ce=Le,Ae=K("wRmb"),Pe=K("xEkU"),Ie=K.n(Pe);function pe(ke){var Oe=Object(D.useRef)(ke),tt=Object(D.useState)({}),it=Object(W.a)(tt,2),Ne=it[1],qe=Object(D.useRef)(null),Te=Object(D.useRef)([]);function fe(me){qe.current===null&&(Te.current=[],qe.current=Ie()(function(){Te.current.forEach(function(re){Oe.current=re(Oe.current)}),qe.current=null,Ne({})})),Te.current.push(me)}return Object(D.useEffect)(function(){return function(){Ie.a.cancel(qe.current)}},[]),[Oe.current,fe]}function de(ke){var Oe=Object(D.useRef)(ke),tt=Object(D.useRef)(null);function it(){window.clearTimeout(tt.current)}function Ne(Te){Oe.current=Te,it(),tt.current=window.setTimeout(function(){Oe.current=null,tt.current=null},100)}function qe(){return Oe.current}return Object(D.useEffect)(function(){return it},[]),[Ne,qe]}function ne(ke,Oe,tt){var it=Object(D.useMemo)(function(){for(var Ne=[],qe=[],Te=0,fe=0,me=0;me<Oe;me+=1)if(tt==="rtl"){qe[me]=fe,fe+=ke[me]||0;var re=Oe-me-1;Ne[re]=Te,Te+=ke[re]||0}else{Ne[me]=Te,Te+=ke[me]||0;var ae=Oe-me-1;qe[ae]=fe,fe+=ke[ae]||0}return{left:Ne,right:qe}},[ke,Oe,tt]);return it}var ge=ne;function oe(ke){var Oe=ke.className,tt=ke.children;return D.createElement("div",{className:Oe},tt)}var De=oe,Ue=K("n6Qo");function we(ke){var Oe,tt=ke.prefixCls,it=ke.record,Ne=ke.onExpand,qe=ke.expanded,Te=ke.expandable,fe="".concat(tt,"-row-expand-icon");if(!Te)return D.createElement("span",{className:F()(fe,"".concat(tt,"-row-spaced"))});var me=function(ae){Ne(it,ae),ae.stopPropagation()};return D.createElement("span",{className:F()(fe,(Oe={},Object(q.a)(Oe,"".concat(tt,"-row-expanded"),qe),Object(q.a)(Oe,"".concat(tt,"-row-collapsed"),!qe),Oe)),onClick:me})}function Ge(ke,Oe,tt){var it=[];function Ne(qe){(qe||[]).forEach(function(Te,fe){it.push(Oe(Te,fe)),Ne(Te[tt])})}return Ne(ke),it}var Qe=K("zT1h"),et=K("y0+3"),ze=function(Oe,tt){var it,Ne,qe=Oe.scrollBodyRef,Te=Oe.onScroll,fe=Oe.offsetScroll,me=D.useContext(l.a),re=me.prefixCls,ae=((it=qe.current)===null||it===void 0?void 0:it.scrollWidth)||0,he=((Ne=qe.current)===null||Ne===void 0?void 0:Ne.clientWidth)||0,ve=ae&&he*(he/ae),_e=D.useRef(),je=pe({scrollLeft:0,isHiddenScrollBar:!1}),at=Object(W.a)(je,2),Et=at[0],Lt=at[1],Tt=D.useRef({delta:0,x:0}),mt=D.useState(!1),Ze=Object(W.a)(mt,2),$e=Ze[0],He=Ze[1],le=function(){He(!1)},be=function(Ee){Ee.persist(),Tt.current.delta=Ee.pageX-Et.scrollLeft,Tt.current.x=0,He(!0),Ee.preventDefault()},rt=function(Ee){var Be,st=Ee||((Be=window)===null||Be===void 0?void 0:Be.event),ct=st.buttons;if(!$e||ct===0){$e&&He(!1);return}var Ct=Tt.current.x+Ee.pageX-Tt.current.x-Tt.current.delta;Ct<=0&&(Ct=0),Ct+ve>=he&&(Ct=he-ve),Te({scrollLeft:Ct/he*(ae+2)}),Tt.current.x=Ee.pageX},Ye=function(){var Ee=Object(et.b)(qe.current).top,Be=Ee+qe.current.offsetHeight,st=document.documentElement.scrollTop+window.innerHeight;Be-Object(c.a)()<=st||Ee>=st-fe?Lt(function(ct){return Object(z.a)(Object(z.a)({},ct),{},{isHiddenScrollBar:!0})}):Lt(function(ct){return Object(z.a)(Object(z.a)({},ct),{},{isHiddenScrollBar:!1})})},bt=function(Ee){Lt(function(Be){return Object(z.a)(Object(z.a)({},Be),{},{scrollLeft:Ee/ae*he||0})})};return D.useImperativeHandle(tt,function(){return{setScrollLeft:bt}}),D.useEffect(function(){var pt=Object(Qe.a)(document.body,"mouseup",le,!1),Ee=Object(Qe.a)(document.body,"mousemove",rt,!1);return Ye(),function(){pt.remove(),Ee.remove()}},[ve,$e]),D.useEffect(function(){var pt=Object(Qe.a)(window,"scroll",Ye,!1),Ee=Object(Qe.a)(window,"resize",Ye,!1);return function(){pt.remove(),Ee.remove()}},[]),D.useEffect(function(){Et.isHiddenScrollBar||Lt(function(pt){var Ee,Be;return Object(z.a)(Object(z.a)({},pt),{},{scrollLeft:qe.current.scrollLeft/((Ee=qe.current)===null||Ee===void 0?void 0:Ee.scrollWidth)*((Be=qe.current)===null||Be===void 0?void 0:Be.clientWidth)})})},[Et.isHiddenScrollBar]),ae<=he||!ve||Et.isHiddenScrollBar?null:D.createElement("div",{style:{height:Object(c.a)(),width:he,bottom:fe},className:"".concat(re,"-sticky-scroll")},D.createElement("div",{onMouseDown:be,ref:_e,className:F()("".concat(re,"-sticky-scroll-bar"),Object(q.a)({},"".concat(re,"-sticky-scroll-bar-active"),$e)),style:{width:"".concat(ve,"px"),transform:"translate3d(".concat(Et.scrollLeft,"px, 0, 0)")}}))},Je=D.forwardRef(ze);function Xe(ke,Oe){return D.useMemo(function(){var tt=!!ke;return{isSticky:tt,stickyClassName:tt?"".concat(Oe,"-sticky-header"):"",offsetHeader:Object(V.a)(ke)==="object"&&ke.offsetHeader||0,offsetScroll:Object(V.a)(ke)==="object"&&ke.offsetScroll||0}},[ke,Oe])}var yt=[],xt={},vt="rc-table-internal-hook",ht=D.memo(function(ke){var Oe=ke.children;return Oe},function(ke,Oe){return T()(ke.props,Oe.props)?ke.pingLeft!==Oe.pingLeft||ke.pingRight!==Oe.pingRight:!1});function Rt(ke){var Oe,tt=ke.prefixCls,it=ke.className,Ne=ke.rowClassName,qe=ke.style,Te=ke.data,fe=ke.rowKey,me=ke.scroll,re=ke.tableLayout,ae=ke.direction,he=ke.title,ve=ke.footer,_e=ke.summary,je=ke.id,at=ke.showHeader,Et=ke.components,Lt=ke.emptyText,Tt=ke.onRow,mt=ke.onHeaderRow,Ze=ke.internalHooks,$e=ke.transformColumns,He=ke.internalRefs,le=ke.sticky,be=Te||yt,rt=!!be.length,Ye=D.useState(0),bt=Object(W.a)(Ye,2),pt=bt[0],Ee=bt[1];D.useEffect(function(){Ee(Object(c.a)())});var Be=D.useMemo(function(){return Object(I.c)(Et,{})},[Et]),st=D.useCallback(function(Mn,An){return Object(I.b)(Be,Mn)||An},[Be]),ct=D.useMemo(function(){return typeof fe=="function"?fe:function(Mn){var An=Mn&&Mn[fe];return An}},[fe]),Ct=Object(g.c)(ke),lt=Ct.expandIcon,jt=Ct.expandedRowKeys,qt=Ct.defaultExpandedRowKeys,Ot=Ct.defaultExpandAllRows,Zt=Ct.expandedRowRender,un=Ct.onExpand,sn=Ct.onExpandedRowsChange,Xt=Ct.expandRowByClick,mn=Ct.rowExpandable,kn=Ct.expandIconColumnIndex,Un=Ct.expandedRowClassName,ft=Ct.childrenColumnName,Wt=Ct.indentSize,Qt=lt||we,$t=ft||"children",en=D.useMemo(function(){return Zt?"row":ke.expandable&&Ze===vt&&ke.expandable.__PARENT_RENDER_ICON__||be.some(function(Mn){return Mn&&Object(V.a)(Mn)==="object"&&Mn[$t]})?"nest":!1},[!!Zt,be]),fn=D.useState(function(){return qt||(Ot?Ge(be,ct,$t):[])}),Y=Object(W.a)(fn,2),C=Y[0],M=Y[1],G=D.useMemo(function(){return new Set(jt||C||[])},[jt,C]),te=D.useCallback(function(Mn){var An=ct(Mn,be.indexOf(Mn)),On,gi=G.has(An);gi?(G.delete(An),On=Object(N.a)(G)):On=[].concat(Object(N.a)(G),[An]),M(On),un&&un(!gi,Mn),sn&&sn(On)},[ct,G,be,un,sn]),Q=D.useState(0),Se=Object(W.a)(Q,2),ot=Se[0],St=Se[1],Pt=Object(Ae.b)(Object(z.a)(Object(z.a)(Object(z.a)({},ke),Ct),{},{expandable:!!Zt,expandedKeys:G,getRowKey:ct,onTriggerExpand:te,expandIcon:Qt,expandIconColumnIndex:kn,direction:ae}),Ze===vt?$e:null),ut=Object(W.a)(Pt,2),Vt=ut[0],tn=ut[1],Sn=D.useMemo(function(){return{columns:Vt,flattenColumns:tn}},[Vt,tn]),wn=D.useRef(),_n=D.useRef(),Fn=D.useRef(),mi=D.useState(!1),ki=Object(W.a)(mi,2),Kn=ki[0],si=ki[1],Ai=D.useState(!1),_i=Object(W.a)(Ai,2),ni=_i[0],Ki=_i[1],Pi=pe(new Map),Gi=Object(W.a)(Pi,2),zi=Gi[0],Ni=Gi[1],$n=Object(I.a)(tn),Ui=$n.map(function(Mn){return zi.get(Mn)}),Ji=D.useMemo(function(){return Ui},[Ui.join("_")]),di=ge(Ji,tn.length,ae),Ln=me&&Object(I.d)(me.y),Ft=me&&Object(I.d)(me.x),Gn=Ft&&tn.some(function(Mn){var An=Mn.fixed;return An}),pn=D.useRef(),xe=Xe(le,tt),dn=xe.isSticky,Bi=xe.offsetHeader,Qn=xe.offsetScroll,gn=xe.stickyClassName,Zi,Oi,qi;Ln&&(Oi={overflowY:"scroll",maxHeight:me.y}),Ft&&(Zi={overflowX:"auto"},Ln||(Oi={overflowY:"hidden"}),qi={width:me.x===!0?"auto":me.x,minWidth:"100%"});var ci=D.useCallback(function(Mn,An){Ni(function(On){var gi=new Map(On);return gi.set(Mn,An),gi})},[]),Fi=de(null),sr=Object(W.a)(Fi,2),Ei=sr[0],lr=sr[1];function ji(Mn,An){if(!An)return;typeof An=="function"?An(Mn):An.scrollLeft!==Mn&&(An.scrollLeft=Mn)}var xi=function(An){var On=An.currentTarget,gi=An.scrollLeft,dr=typeof gi=="number"?gi:On.scrollLeft,$i=On||xt;if(!lr()||lr()===$i){var Ur;Ei($i),ji(dr,_n.current),ji(dr,Fn.current),ji(dr,(Ur=pn.current)===null||Ur===void 0?void 0:Ur.setScrollLeft)}if(On){var Br=On.scrollWidth,Ra=On.clientWidth;si(dr>0),Ki(dr<Br-Ra)}},ur=function(){Fn.current&&xi({currentTarget:Fn.current})},Gt=function(An){var On=An.width;ur(),St(wn.current?wn.current.offsetWidth:On)};D.useEffect(function(){return ur},[]),D.useEffect(function(){Ft&&ur()},[Ft]),D.useEffect(function(){Ze===vt&&He&&(He.body.current=Fn.current)});var an=st(["table"],"table"),Jt=D.useMemo(function(){return re||(Gn?me.x==="max-content"?"auto":"fixed":Ln||tn.some(function(Mn){var An=Mn.ellipsis;return An})?"fixed":"auto")},[Ln,Gn,tn,re]),cn,vn={colWidths:Ji,columCount:tn.length,stickyOffsets:di,onHeaderRow:mt,fixHeader:Ln},Pn=D.useMemo(function(){return rt?null:typeof Lt=="function"?Lt():Lt},[rt,Lt]),yn=D.createElement(Ce,{data:be,measureColumnWidth:Ln||Ft||dn,expandedKeys:G,rowExpandable:mn,getRowKey:ct,onRow:Tt,emptyNode:Pn,childrenColumnName:$t}),zn=D.createElement(u,{colWidths:tn.map(function(Mn){var An=Mn.width;return An}),columns:tn}),ai=_e&&D.createElement(Ue.b,null,_e(be)),hn=st(["body"]);if(Ln||dn){var Ri;typeof hn=="function"?(Ri=hn(be,{scrollbarSize:pt,ref:Fn,onScroll:xi}),vn.colWidths=tn.map(function(Mn,An){var On=Mn.width,gi=An===Vt.length-1?On-pt:On;return typeof gi=="number"&&!Number.isNaN(gi)?gi:(Object(v.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Ri=D.createElement("div",{style:Object(z.a)(Object(z.a)({},Zi),Oi),onScroll:xi,ref:Fn,className:F()("".concat(tt,"-body"))},D.createElement(an,{style:Object(z.a)(Object(z.a)({},qi),{},{tableLayout:Jt})},zn,yn,ai),dn&&D.createElement(Je,{ref:pn,offsetScroll:Qn,scrollBodyRef:Fn,onScroll:xi})),cn=D.createElement(D.Fragment,null,at!==!1&&D.createElement(y,Object.assign({noData:!be.length},vn,Sn,{direction:ae,offsetHeader:Bi,stickyClassName:gn,ref:_n,onScroll:xi})),Ri)}else cn=D.createElement("div",{style:Object(z.a)(Object(z.a)({},Zi),Oi),className:F()("".concat(tt,"-content")),onScroll:xi,ref:Fn},D.createElement(an,{style:Object(z.a)(Object(z.a)({},qi),{},{tableLayout:Jt})},zn,at!==!1&&D.createElement(_,Object.assign({},vn,Sn)),yn,ai));var In=Object(g.b)(ke),Vn=D.createElement("div",Object.assign({className:F()(tt,it,(Oe={},Object(q.a)(Oe,"".concat(tt,"-rtl"),ae==="rtl"),Object(q.a)(Oe,"".concat(tt,"-ping-left"),Kn),Object(q.a)(Oe,"".concat(tt,"-ping-right"),ni),Object(q.a)(Oe,"".concat(tt,"-layout-fixed"),re==="fixed"),Object(q.a)(Oe,"".concat(tt,"-fixed-header"),Ln),Object(q.a)(Oe,"".concat(tt,"-fixed-column"),Gn),Object(q.a)(Oe,"".concat(tt,"-scroll-horizontal"),Ft),Object(q.a)(Oe,"".concat(tt,"-has-fix-left"),tn[0]&&tn[0].fixed),Object(q.a)(Oe,"".concat(tt,"-has-fix-right"),tn[tn.length-1]&&tn[tn.length-1].fixed==="right"),Oe)),style:qe,id:je,ref:wn},In),D.createElement(ht,{pingLeft:Kn,pingRight:ni,props:Object(z.a)(Object(z.a)({},ke),{},{stickyOffsets:di,mergedExpandedKeys:G})},he&&D.createElement(De,{className:"".concat(tt,"-title")},he(be)),D.createElement("div",{className:"".concat(tt,"-container")},cn),ve&&D.createElement(De,{className:"".concat(tt,"-footer")},ve(be))));Ft&&(Vn=D.createElement(m.a,{onResize:Gt},Vn));var ei=D.useMemo(function(){return{prefixCls:tt,getComponent:st,scrollbarSize:pt,direction:ae,fixedInfoList:tn.map(function(Mn,An){return h(An,An,tn,di,ae)}),isSticky:dn}},[tt,st,pt,ae,tn,di,ae,dn]),Ti=D.useMemo(function(){return Object(z.a)(Object(z.a)({},Sn),{},{tableLayout:Jt,rowClassName:Ne,expandedRowClassName:Un,componentWidth:ot,fixHeader:Ln,fixColumn:Gn,horizonScroll:Ft,expandIcon:Qt,expandableType:en,expandRowByClick:Xt,expandedRowRender:Zt,onTriggerExpand:te,expandIconColumnIndex:kn,indentSize:Wt})},[Sn,Jt,Ne,Un,ot,Ln,Gn,Ft,Qt,en,Xt,Zt,te,kn,Wt]),ea=D.useMemo(function(){return{onColumnResize:ci}},[ci]);return D.createElement(l.a.Provider,{value:ei},D.createElement(R.Provider,{value:Ti},D.createElement(ee.Provider,{value:ea},Vn)))}Rt.Column=r.a,Rt.ColumnGroup=d.a,Rt.Summary=Ue.a,Rt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var At=Me.b=Rt},wRmb:function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return T});var q=K("rePB"),z=K("KQm4"),N=K("VTBJ"),V=K("Ff2n"),W=K("q1tI"),D=K.n(W),H=K("Kwbf"),F=K("Zm9Q"),k=K("hW8S");function T(r){return Object(F.a)(r).filter(function(s){return W.isValidElement(s)}).map(function(s){var o=s.key,a=s.props,l=a.children,h=Object(V.a)(a,["children"]),I=Object(N.a)({key:o},h);return l&&(I.children=T(l)),I})}function v(r){return r.reduce(function(s,o){var a=o.fixed,l=a===!0?"left":a,h=o.children;return h&&h.length>0?[].concat(Object(z.a)(s),Object(z.a)(v(h).map(function(I){return Object(N.a)({fixed:l},I)}))):[].concat(Object(z.a)(s),[Object(N.a)(Object(N.a)({},o),{},{fixed:l})])},[])}function m(r){for(var s=!0,o=0;o<r.length;o+=1){var a=r[o];if(s&&a.fixed!=="left")s=!1;else if(!s&&a.fixed==="left"){Object(H.a)(!1,"Index ".concat(o-1," of `columns` missing `fixed='left'` prop."));break}}for(var l=!0,h=r.length-1;h>=0;h-=1){var I=r[h];if(l&&I.fixed!=="right")l=!1;else if(!l&&I.fixed==="right"){Object(H.a)(!1,"Index ".concat(h+1," of `columns` missing `fixed='right'` prop."));break}}}function c(r){return r.map(function(s){var o=s.fixed,a=Object(V.a)(s,["fixed"]),l=o;return o==="left"?l="right":o==="right"&&(l="left"),Object(N.a)({fixed:l},a)})}function d(r,s){var o=r.prefixCls,a=r.columns,l=r.children,h=r.expandable,I=r.expandedKeys,w=r.getRowKey,x=r.onTriggerExpand,O=r.expandIcon,S=r.rowExpandable,_=r.expandIconColumnIndex,g=r.direction,f=r.expandRowByClick,u=W.useMemo(function(){return a||T(l)},[a,l]),E=W.useMemo(function(){if(h){var P,R=_||0,U=u[R],L=(P={},Object(q.a)(P,k.a,{className:"".concat(o,"-expand-icon-col")}),Object(q.a)(P,"title",""),Object(q.a)(P,"fixed",U?U.fixed:null),Object(q.a)(P,"className","".concat(o,"-row-expand-icon-cell")),Object(q.a)(P,"render",function(X,ee,se){var ce=w(ee,se),Le=I.has(ce),Ce=S?S(ee):!0,Ae=O({prefixCls:o,expanded:Le,expandable:Ce,record:ee,onExpand:x});return f?W.createElement("span",{onClick:function(Ie){return Ie.stopPropagation()}},Ae):Ae}),P),j=u.slice();return R>=0&&j.splice(R,0,L),j}return u},[h,u,w,I,O,g]),b=W.useMemo(function(){var P=E;return s&&(P=s(P)),P.length||(P=[{render:function(){return null}}]),P},[s,E,g]),y=W.useMemo(function(){return g==="rtl"?c(v(b)):v(b)},[b,g]);return[b,y]}Me.b=d},wU8J:function(Ke,Me){function K(){this.buffer=new Array,this.length=0}K.prototype={get:function(q){var z=Math.floor(q/8);return(this.buffer[z]>>>7-q%8&1)==1},put:function(q,z){for(var N=0;N<z;N++)this.putBit((q>>>z-N-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(q){var z=Math.floor(this.length/8);this.buffer.length<=z&&this.buffer.push(0),q&&(this.buffer[z]|=128>>>this.length%8),this.length++}},Ke.exports=K},"y0+3":function(Ke,Me,K){"use strict";K.d(Me,"a",function(){return v}),K.d(Me,"b",function(){return c});var q=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},N={cssFloat:1,styleFloat:1,float:1};function V(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function W(d,r,s){if(r=r.toLowerCase(),s==="auto"){if(r==="height")return d.offsetHeight;if(r==="width")return d.offsetWidth}return r in z||(z[r]=q.test(r)),z[r]?parseFloat(s)||0:s}function D(d,r){var s=arguments.length,o=V(d);return r=N[r]?"cssFloat"in d.style?"cssFloat":"styleFloat":r,s===1?o:W(d,r,o[r]||d.style[r])}function H(d,r,s){var o=arguments.length;if(r=N[r]?"cssFloat"in d.style?"cssFloat":"styleFloat":r,o===3)return typeof s=="number"&&q.test(r)&&(s="".concat(s,"px")),d.style[r]=s,s;for(var a in r)r.hasOwnProperty(a)&&H(d,a,r[a]);return V(d)}function F(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function k(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function T(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:r}}function v(){var d=document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:r}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function c(d){var r=d.getBoundingClientRect(),s=document.documentElement;return{left:r.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:r.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},yslc:function(Ke,Me){Ke.exports="data:image/png;base64,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"}}]);