(window.webpackJsonp=window.webpackJsonp||[]).push([[194,3,5,7,8,20],{"++UQ":function(nt,Le,F){},"+NIl":function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(Q,j){"use strict";function S(l,s){l.cmdState.push(s)}function D(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function x(l){var s=l.cmdState.pop();s&&s.closeBracket()}function T(l){for(var s=l.cmdState,h=s.length-1;h>=0;h--){var r=s[h];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function w(l,s,h){return function(){this.name=l,this.bracketNo=0,this.style=s,this.styles=h,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var f={};f.importmodule=w("importmodule","tag",["string","builtin"]),f.documentclass=w("documentclass","tag",["","atom"]),f.usepackage=w("usepackage","tag",["atom"]),f.begin=w("begin","tag",["atom"]),f.end=w("end","tag",["atom"]),f.label=w("label","tag",["atom"]),f.ref=w("ref","tag",["atom"]),f.eqref=w("eqref","tag",["atom"]),f.cite=w("cite","tag",["atom"]),f.bibitem=w("bibitem","tag",["atom"]),f.Bibitem=w("Bibitem","tag",["atom"]),f.RBibitem=w("RBibitem","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(l,s){l.f=s}function u(l,s){var h;if(l.match(/^\\[a-zA-Z@]+/)){var r=l.current().slice(1);return h=f.hasOwnProperty(r)?f[r]:f.DEFAULT,h=new h,S(s,h),p(s,i),h.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return p(s,function(n,c){return o(n,c,"\\]")}),"keyword";if(l.match("\\("))return p(s,function(n,c){return o(n,c,"\\)")}),"keyword";if(l.match("$$"))return p(s,function(n,c){return o(n,c,"$$")}),"keyword";if(l.match("$"))return p(s,function(n,c){return o(n,c,"$")}),"keyword";var t=l.next();if(t=="%")return l.skipToEnd(),"comment";if(t=="}"||t=="]"){if(h=D(s),h)h.closeBracket(t),p(s,i);else return"error";return"bracket"}else return t=="{"||t=="["?(h=f.DEFAULT,h=new h,S(s,h),"bracket"):/\d/.test(t)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),h=T(s),h.name=="begin"&&(h.argument=l.current()),h.styleIdentifier())}function o(l,s,h){if(l.eatSpace())return null;if(h&&l.match(h))return p(s,u),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=l.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(l.skipToEnd(),"comment"):"error"}function i(l,s){var h=l.peek(),r;return h=="{"||h=="["?(r=D(s),r.openBracket(h),l.eat(h),p(s,u),"bracket"):/[ \t\r]/.test(h)?(l.eat(h),null):(p(s,u),x(s),u(l,s))}return{startState:function(){var l=j.inMathMode?function(s,h){return o(s,h)}:u;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,s){return s.f(l,s)},blankLine:function(l){l.f=u,l.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+QRC":function(nt,Le,F){"use strict";var ue=F("E9nw"),Q={"text/plain":"Text","text/html":"Url",default:"Text"},j="Copy to clipboard: #{key}, Enter";function S(x){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return x.replace(/#{\s*key\s*}/g,T)}function D(x,T){var w,f,p,u,o,i,l=!1;T||(T={}),w=T.debug||!1;try{p=ue(),u=document.createRange(),o=document.getSelection(),i=document.createElement("span"),i.textContent=x,i.style.all="unset",i.style.position="fixed",i.style.top=0,i.style.clip="rect(0, 0, 0, 0)",i.style.whiteSpace="pre",i.style.webkitUserSelect="text",i.style.MozUserSelect="text",i.style.msUserSelect="text",i.style.userSelect="text",i.addEventListener("copy",function(h){if(h.stopPropagation(),T.format)if(h.preventDefault(),typeof h.clipboardData=="undefined"){w&&console.warn("unable to use e.clipboardData"),w&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=Q[T.format]||Q.default;window.clipboardData.setData(r,x)}else h.clipboardData.clearData(),h.clipboardData.setData(T.format,x);T.onCopy&&(h.preventDefault(),T.onCopy(h.clipboardData))}),document.body.appendChild(i),u.selectNodeContents(i),o.addRange(u);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");l=!0}catch(h){w&&console.error("unable to copy using execCommand: ",h),w&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",x),T.onCopy&&T.onCopy(window.clipboardData),l=!0}catch(r){w&&console.error("unable to copy using clipboardData: ",r),w&&console.error("falling back to prompt"),f=S("message"in T?T.message:j),window.prompt(f,x)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(u):o.removeAllRanges()),i&&document.body.removeChild(i),p()}return l}nt.exports=D},"+ua5":function(nt,Le,F){},"/cxE":function(nt,Le,F){"use strict";F.d(Le,"e",function(){return j}),F.d(Le,"f",function(){return S}),F.d(Le,"g",function(){return D}),F.d(Le,"d",function(){return T}),F.d(Le,"a",function(){return w}),F.d(Le,"b",function(){return f}),F.d(Le,"c",function(){return p});var ue=function(){function u(){this.listeners=[],this.unexpectedErrorHandler=function(o){setTimeout(function(){throw o.stack?new Error(o.message+` `+o.stack):o},0)}}return u.prototype.emit=function(o){this.listeners.forEach(function(i){i(o)})},u.prototype.onUnexpectedError=function(o){this.unexpectedErrorHandler(o),this.emit(o)},u.prototype.onUnexpectedExternalError=function(o){this.unexpectedErrorHandler(o)},u}(),Q=new ue;function j(u){T(u)||Q.onUnexpectedError(u);return}function S(u){T(u)||Q.onUnexpectedExternalError(u);return}function D(u){if(u instanceof Error){var o=u.name,i=u.message,l=u.stacktrace||u.stack;return{$isError:!0,name:o,message:i,stack:l}}return u}var x="Canceled";function T(u){return u instanceof Error&&u.name===x&&u.message===x}function w(){var u=new Error(x);return u.name=u.message,u}function f(u){return u?new Error("Illegal argument: "+u):new Error("Illegal argument")}function p(u){return u?new Error("Illegal state: "+u):new Error("Illegal state")}},"07cG":function(nt,Le,F){nt.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(nt,Le){var F=arguments[3],ue=arguments[4],Q=arguments[5],j=JSON.stringify;nt.exports=function(S,D){for(var x,T=Object.keys(Q),w=0,f=T.length;w")):null:_.match("--")?A(s("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),A(h(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),O.tokenize=s("meta","?>"),"meta"):(p=_.eat("/")?"closeTag":"openTag",O.tokenize=i,"tag bracket");if(P=="&"){var I;return _.eat("#")?_.eat("x")?I=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):I=_.eatWhile(/[\d]/)&&_.eat(";"):I=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),I?"atom":"error"}else return _.eatWhile(/[^&<]/),null}o.isInText=!0;function i(_,O){var A=_.next();if(A==">"||A=="/"&&_.eat(">"))return O.tokenize=o,p=A==">"?"endTag":"selfcloseTag","tag bracket";if(A=="=")return p="equals",null;if(A=="<"){O.tokenize=o,O.state=c,O.tagName=O.tagStart=null;var P=O.tokenize(_,O);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(A)?(O.tokenize=l(A),O.stringStartCol=_.column(),O.tokenize(_,O)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(_){var O=function(A,P){for(;!A.eol();)if(A.next()==_){P.tokenize=i;break}return"string"};return O.isInAttribute=!0,O}function s(_,O){return function(A,P){for(;!A.eol();){if(A.match(O)){P.tokenize=o;break}A.next()}return _}}function h(_){return function(O,A){for(var P;(P=O.next())!=null;){if(P=="<")return A.tokenize=h(_+1),A.tokenize(O,A);if(P==">")if(_==1){A.tokenize=o;break}else return A.tokenize=h(_-1),A.tokenize(O,A)}return"meta"}}function r(_,O,A){this.prev=_.context,this.tagName=O,this.indent=_.indented,this.startOfLine=A,(T.doNotIndent.hasOwnProperty(O)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function t(_){_.context&&(_.context=_.context.prev)}function n(_,O){for(var A;;){if(!_.context)return;if(A=_.context.tagName,!T.contextGrabbers.hasOwnProperty(A)||!T.contextGrabbers[A].hasOwnProperty(O))return;t(_)}}function c(_,O,A){return _=="openTag"?(A.tagStart=O.column(),m):_=="closeTag"?v:c}function m(_,O,A){return _=="word"?(A.tagName=O.current(),u="tag",g):T.allowMissingTagName&&_=="endTag"?(u="tag bracket",g(_,O,A)):(u="error",m)}function v(_,O,A){if(_=="word"){var P=O.current();return A.context&&A.context.tagName!=P&&T.implicitlyClosed.hasOwnProperty(A.context.tagName)&&t(A),A.context&&A.context.tagName==P||T.matchClosing===!1?(u="tag",b):(u="tag error",E)}else return T.allowMissingTagName&&_=="endTag"?(u="tag bracket",b(_,O,A)):(u="error",E)}function b(_,O,A){return _!="endTag"?(u="error",b):(t(A),c)}function E(_,O,A){return u="error",b(_,O,A)}function g(_,O,A){if(_=="word")return u="attribute",y;if(_=="endTag"||_=="selfcloseTag"){var P=A.tagName,I=A.tagStart;return A.tagName=A.tagStart=null,_=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(P)?n(A,P):(n(A,P),A.context=new r(A,P,I==A.indented)),c}return u="error",g}function y(_,O,A){return _=="equals"?C:(T.allowMissing||(u="error"),g(_,O,A))}function C(_,O,A){return _=="string"?d:_=="word"&&T.allowUnquoted?(u="string",g):(u="error",g(_,O,A))}function d(_,O,A){return _=="string"?d:g(_,O,A)}return{startState:function(_){var O={tokenize:o,state:c,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(O.baseIndent=_),O},token:function(_,O){if(!O.tagName&&_.sol()&&(O.indented=_.indentation()),_.eatSpace())return null;p=null;var A=O.tokenize(_,O);return(A||p)&&A!="comment"&&(u=null,O.state=O.state(p||A,_,O),u&&(A=u=="error"?A+" error":u)),A},indent:function(_,O,A){var P=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+x;if(P&&P.noIndent)return ue.Pass;if(_.tokenize!=i&&_.tokenize!=o)return A?A.match(/^(\s*)/)[0].length:0;if(_.tagName)return T.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+x*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/$/,blockCommentStart:"",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(_){_.state==C&&(_.state=g)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var O=[],A=_.context;A;A=A.prev)A.tagName&&O.push(A.tagName);return O.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(nt,Le,F){"use strict";F.d(Le,"d",function(){return q}),F.d(Le,"b",function(){return rt}),F.d(Le,"c",function(){return xt}),F.d(Le,"a",function(){return Bt});var ue=F("VTBJ"),Q=F("1OyB"),j=F("vuIU"),S=F("JX7q"),D=F("Ji7U"),x=F("LK+K"),T=F("q1tI"),w=F("I8Z2"),f=F("BGR+"),p=F("wx14"),u=F("rePB"),o=F("4IlW"),i=F("2GS6"),l=F("Gytx"),s=F.n(l),h=F("TSYQ"),r=F.n(h),t=F("U8pU"),n=F("ODXe"),c=/iPhone/i,m=/iPod/i,v=/iPad/i,b=/\bAndroid(?:.+)Mobile\b/i,E=/Android/i,g=/\bAndroid(?:.+)SD4930UR\b/i,y=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,C=/Windows Phone/i,d=/\bWindows(?:.+)ARM\b/i,_=/BlackBerry/i,O=/BB10/i,A=/Opera Mini/i,P=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function W(Dt,lt){return Dt.test(lt)}function K(Dt){var lt=Dt||(typeof navigator!="undefined"?navigator.userAgent:""),pt=lt.split("[FBAN");if(typeof pt[1]!="undefined"){var ut=pt,Pe=Object(n.a)(ut,1);lt=Pe[0]}if(pt=lt.split("Twitter"),typeof pt[1]!="undefined"){var Ve=pt,yt=Object(n.a)(Ve,1);lt=yt[0]}var st={apple:{phone:W(c,lt)&&!W(C,lt),ipod:W(m,lt),tablet:!W(c,lt)&&W(v,lt)&&!W(C,lt),device:(W(c,lt)||W(m,lt)||W(v,lt))&&!W(C,lt)},amazon:{phone:W(g,lt),tablet:!W(g,lt)&&W(y,lt),device:W(g,lt)||W(y,lt)},android:{phone:!W(C,lt)&&W(g,lt)||!W(C,lt)&&W(b,lt),tablet:!W(C,lt)&&!W(g,lt)&&!W(b,lt)&&(W(y,lt)||W(E,lt)),device:!W(C,lt)&&(W(g,lt)||W(y,lt)||W(b,lt)||W(E,lt))||W(/\bokhttp\b/i,lt)},windows:{phone:W(C,lt),tablet:W(d,lt),device:W(C,lt)||W(d,lt)},other:{blackberry:W(_,lt),blackberry10:W(O,lt),opera:W(A,lt),firefox:W(I,lt),chrome:W(P,lt),device:W(_,lt)||W(O,lt)||W(A,lt)||W(I,lt)||W(P,lt)},any:null,phone:null,tablet:null};return st.any=st.apple.device||st.android.device||st.windows.device||st.other.device,st.phone=st.apple.phone||st.android.phone||st.windows.phone,st.tablet=st.apple.tablet||st.android.tablet||st.windows.tablet,st}var te=Object(ue.a)(Object(ue.a)({},K()),{},{isMobile:K}),H=te;function G(){}function V(Dt,lt,pt){var ut=lt||"";return Dt.key||"".concat(ut,"item_").concat(pt)}function re(Dt){return"".concat(Dt,"-menu-")}function $(Dt,lt){var pt=-1;T.Children.forEach(Dt,function(ut){pt+=1,ut&&ut.type&&ut.type.isMenuItemGroup?T.Children.forEach(ut.props.children,function(Pe){pt+=1,lt(Pe,pt)}):lt(ut,pt)})}function ne(Dt,lt,pt){if(!Dt||pt.find)return;T.Children.forEach(Dt,function(ut){if(ut){var Pe=ut.type;if(!Pe||!(Pe.isSubMenu||Pe.isMenuItem||Pe.isMenuItemGroup))return;lt.indexOf(ut.key)!==-1?pt.find=!0:ut.props.children&&ne(ut.props.children,lt,pt)}})}var he=["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"],pe=function(lt){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ut=lt&&typeof lt.getBoundingClientRect=="function"&<.getBoundingClientRect().width;if(ut){if(pt){var Pe=getComputedStyle(lt),Ve=Pe.marginLeft,yt=Pe.marginRight;ut+=+Ve.replace("px","")+ +yt.replace("px","")}ut=+ut.toFixed(6)}return ut||0},Te=function(lt,pt,ut){lt&&Object(t.a)(lt.style)==="object"&&(lt.style[pt]=ut)},we=function(){return H.any},Me=F("KQm4"),Ee=F("Ff2n"),xe=F("i8i4"),Ge=F("bdgK"),je=F("uciX"),We=F("8XRh"),ze={adjustX:1,adjustY:1},de={topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ze,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ze,offset:[4,0]}},le={topLeft:{points:["bl","tl"],overflow:ze,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ze,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ze,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ze,offset:[4,0]}},Oe=de,Ie=0,qe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ee=function(lt,pt,ut){var Pe=re(pt),Ve=lt.getState();lt.setState({defaultActiveFirst:Object(ue.a)(Object(ue.a)({},Ve.defaultActiveFirst),{},Object(u.a)({},Pe,ut))})},k=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(ut){var Pe;Object(Q.a)(this,pt),Pe=lt.call(this,ut),Pe.onDestroy=function(it){Pe.props.onDestroy(it)},Pe.onKeyDown=function(it){var mt=it.keyCode,bt=Pe.menuInstance,At=Pe.props,Xt=At.isOpen,Ae=At.store;if(mt===o.a.ENTER)return Pe.onTitleClick(it),ee(Ae,Pe.props.eventKey,!0),!0;if(mt===o.a.RIGHT)return Xt?bt.onKeyDown(it):(Pe.triggerOpenChange(!0),ee(Ae,Pe.props.eventKey,!0)),!0;if(mt===o.a.LEFT){var ge;if(Xt)ge=bt.onKeyDown(it);else return;return ge||(Pe.triggerOpenChange(!1),ge=!0),ge}return Xt&&(mt===o.a.UP||mt===o.a.DOWN)?bt.onKeyDown(it):void 0},Pe.onOpenChange=function(it){Pe.props.onOpenChange(it)},Pe.onPopupVisibleChange=function(it){Pe.triggerOpenChange(it,it?"mouseenter":"mouseleave")},Pe.onMouseEnter=function(it){var mt=Pe.props,bt=mt.eventKey,At=mt.onMouseEnter,Xt=mt.store;ee(Xt,Pe.props.eventKey,!1),At({key:bt,domEvent:it})},Pe.onMouseLeave=function(it){var mt=Pe.props,bt=mt.parentMenu,At=mt.eventKey,Xt=mt.onMouseLeave;bt.subMenuInstance=Object(S.a)(Pe),Xt({key:At,domEvent:it})},Pe.onTitleMouseEnter=function(it){var mt=Pe.props,bt=mt.eventKey,At=mt.onItemHover,Xt=mt.onTitleMouseEnter;At({key:bt,hover:!0}),Xt({key:bt,domEvent:it})},Pe.onTitleMouseLeave=function(it){var mt=Pe.props,bt=mt.parentMenu,At=mt.eventKey,Xt=mt.onItemHover,Ae=mt.onTitleMouseLeave;bt.subMenuInstance=Object(S.a)(Pe),Xt({key:At,hover:!1}),Ae({key:At,domEvent:it})},Pe.onTitleClick=function(it){var mt=Object(S.a)(Pe),bt=mt.props;if(bt.onTitleClick({key:bt.eventKey,domEvent:it}),bt.triggerSubMenuAction==="hover")return;Pe.triggerOpenChange(!bt.isOpen,"click"),ee(bt.store,Pe.props.eventKey,!1)},Pe.onSubMenuClick=function(it){typeof Pe.props.onClick=="function"&&Pe.props.onClick(Pe.addKeyPath(it))},Pe.onSelect=function(it){Pe.props.onSelect(it)},Pe.onDeselect=function(it){Pe.props.onDeselect(it)},Pe.getPrefixCls=function(){return"".concat(Pe.props.rootPrefixCls,"-submenu")},Pe.getActiveClassName=function(){return"".concat(Pe.getPrefixCls(),"-active")},Pe.getDisabledClassName=function(){return"".concat(Pe.getPrefixCls(),"-disabled")},Pe.getSelectedClassName=function(){return"".concat(Pe.getPrefixCls(),"-selected")},Pe.getOpenClassName=function(){return"".concat(Pe.props.rootPrefixCls,"-submenu-open")},Pe.saveMenuInstance=function(it){Pe.menuInstance=it},Pe.addKeyPath=function(it){return Object(ue.a)(Object(ue.a)({},it),{},{keyPath:(it.keyPath||[]).concat(Pe.props.eventKey)})},Pe.triggerOpenChange=function(it,mt){var bt=Pe.props.eventKey,At=function(){Pe.onOpenChange({key:bt,item:Object(S.a)(Pe),trigger:mt,open:it})};mt==="mouseenter"?Pe.mouseenterTimeout=setTimeout(function(){At()},0):At()},Pe.isChildrenSelected=function(){var it={find:!1};return ne(Pe.props.children,Pe.props.selectedKeys,it),it.find},Pe.isOpen=function(){return Pe.props.openKeys.indexOf(Pe.props.eventKey)!==-1},Pe.adjustWidth=function(){if(!Pe.subMenuTitle||!Pe.menuInstance)return;var it=xe.findDOMNode(Pe.menuInstance);if(it.offsetWidth>=Pe.subMenuTitle.offsetWidth)return;it.style.minWidth="".concat(Pe.subMenuTitle.offsetWidth,"px")},Pe.saveSubMenuTitle=function(it){Pe.subMenuTitle=it},Pe.getBaseProps=function(){var it=Object(S.a)(Pe),mt=it.props;return{mode:mt.mode==="horizontal"?"vertical":mt.mode,visible:Pe.props.isOpen,level:mt.level+1,inlineIndent:mt.inlineIndent,focusable:!1,onClick:Pe.onSubMenuClick,onSelect:Pe.onSelect,onDeselect:Pe.onDeselect,onDestroy:Pe.onDestroy,selectedKeys:mt.selectedKeys,eventKey:"".concat(mt.eventKey,"-menu-"),openKeys:mt.openKeys,motion:mt.motion,onOpenChange:Pe.onOpenChange,subMenuOpenDelay:mt.subMenuOpenDelay,parentMenu:Object(S.a)(Pe),subMenuCloseDelay:mt.subMenuCloseDelay,forceSubMenuRender:mt.forceSubMenuRender,triggerSubMenuAction:mt.triggerSubMenuAction,builtinPlacements:mt.builtinPlacements,defaultActiveFirst:mt.store.getState().defaultActiveFirst[re(mt.eventKey)],multiple:mt.multiple,prefixCls:mt.rootPrefixCls,id:Pe.internalMenuId,manualRef:Pe.saveMenuInstance,itemIcon:mt.itemIcon,expandIcon:mt.expandIcon,direction:mt.direction}},Pe.getMotion=function(it,mt){var bt=Object(S.a)(Pe),At=bt.haveRendered,Xt=Pe.props,Ae=Xt.motion,ge=Xt.rootPrefixCls,z=Object(ue.a)(Object(ue.a)({},Ae),{},{leavedClassName:"".concat(ge,"-hidden"),removeOnLeave:!1,motionAppear:At||!mt||it!=="inline"});return z};var Ve=ut.store,yt=ut.eventKey,st=Ve.getState(),Nt=st.defaultActiveFirst;Pe.isRootMenu=!1;var Ut=!1;return Nt&&(Ut=Nt[yt]),ee(Ve,yt,Ut),Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Pe=this,Ve=this.props,yt=Ve.mode,st=Ve.parentMenu,Nt=Ve.manualRef;if(Nt&&Nt(this),yt!=="horizontal"||!st.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return Pe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Pe=this.props,Ve=Pe.onDestroy,yt=Pe.eventKey;Ve&&Ve(yt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(Pe){var Ve=this,yt=this.getBaseProps(),st=this.getMotion(yt.mode,yt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||yt.visible||yt.forceSubMenuRender,!this.haveOpened)return T.createElement("div",null);var Nt=yt.direction;return T.createElement(We.default,Object.assign({visible:yt.visible},st),function(Ut){var it=Ut.className,mt=Ut.style,bt=r()("".concat(yt.prefixCls,"-sub"),it,Object(u.a)({},"".concat(yt.prefixCls,"-rtl"),Nt==="rtl"));return T.createElement(Ke,Object.assign({},yt,{id:Ve.internalMenuId,className:bt,style:mt}),Pe)})}},{key:"render",value:function(){var Pe,Ve=Object(ue.a)({},this.props),yt=Ve.isOpen,st=this.getPrefixCls(),Nt=Ve.mode==="inline",Ut=r()(st,"".concat(st,"-").concat(Ve.mode),(Pe={},Object(u.a)(Pe,Ve.className,!!Ve.className),Object(u.a)(Pe,this.getOpenClassName(),yt),Object(u.a)(Pe,this.getActiveClassName(),Ve.active||yt&&!Nt),Object(u.a)(Pe,this.getDisabledClassName(),Ve.disabled),Object(u.a)(Pe,this.getSelectedClassName(),this.isChildrenSelected()),Pe));this.internalMenuId||(Ve.eventKey?this.internalMenuId="".concat(Ve.eventKey,"$Menu"):(Ie+=1,this.internalMenuId="$__$".concat(Ie,"$Menu")));var it={},mt={},bt={};Ve.disabled||(it={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mt={onClick:this.onTitleClick},bt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var At={},Xt=Ve.direction;Nt&&(Xt==="rtl"?At.paddingRight=Ve.inlineIndent*Ve.level:At.paddingLeft=Ve.inlineIndent*Ve.level);var Ae={};this.props.isOpen&&(Ae={"aria-owns":this.internalMenuId});var ge=null;Ve.mode!=="horizontal"&&(ge=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ge=T.createElement(this.props.expandIcon,Object(ue.a)({},this.props))));var z=T.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:At,className:"".concat(st,"-title"),role:"button"},bt,mt,{"aria-expanded":yt},Ae,{"aria-haspopup":"true",title:typeof Ve.title=="string"?Ve.title:void 0}),Ve.title,ge||T.createElement("i",{className:"".concat(st,"-arrow")})),Z=this.renderChildren(Ve.children),oe=Ve.parentMenu.isRootMenu?Ve.parentMenu.props.getPopupContainer:function(Qt){return Qt.parentNode},me=qe[Ve.mode],Re=Ve.popupOffset?{offset:Ve.popupOffset}:{},Je=Ve.mode==="inline"?"":Ve.popupClassName;Je+=Xt==="rtl"?" ".concat(st,"-rtl"):"";var at=Ve.disabled,kt=Ve.triggerSubMenuAction,jt=Ve.subMenuOpenDelay,ot=Ve.forceSubMenuRender,wt=Ve.subMenuCloseDelay,Kt=Ve.builtinPlacements;he.forEach(function(Qt){return delete Ve[Qt]}),delete Ve.onClick;var Et=Xt==="rtl"?Object.assign({},le,Kt):Object.assign({},de,Kt);return delete Ve.direction,T.createElement("li",Object.assign({},Ve,it,{className:Ut,role:"menuitem"}),Nt&&z,Nt&&Z,!Nt&&T.createElement(je.a,{prefixCls:st,popupClassName:r()("".concat(st,"-popup"),Je),getPopupContainer:oe,builtinPlacements:Et,popupPlacement:me,popupVisible:yt,popupAlign:Re,popup:Z,action:at?[]:[kt],mouseEnterDelay:jt,mouseLeaveDelay:wt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ot},z))}}]),pt}(T.Component);k.defaultProps={onMouseEnter:G,onMouseLeave:G,onTitleMouseEnter:G,onTitleMouseLeave:G,onTitleClick:G,manualRef:G,mode:"vertical",title:""};var U=Object(w.b)(function(Dt,lt){var pt=Dt.openKeys,ut=Dt.activeKey,Pe=Dt.selectedKeys,Ve=lt.eventKey,yt=lt.subMenuKey;return{isOpen:pt.indexOf(Ve)>-1,active:ut[yt]===Ve,selectedKeys:Pe}})(k);U.isSubMenu=!0;var q=U,Y="menuitem-overflowed",J=.5,be=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(){var ut;return Object(Q.a)(this,pt),ut=lt.apply(this,arguments),ut.resizeObserver=null,ut.mutationObserver=null,ut.originalTotalWidth=0,ut.overflowedItems=[],ut.menuItemSizes=[],ut.cancelFrameId=null,ut.state={lastVisibleIndex:void 0},ut.getMenuItemNodes=function(){var Pe=ut.props.prefixCls,Ve=xe.findDOMNode(Object(S.a)(ut));return Ve?[].slice.call(Ve.children).filter(function(yt){return yt.className.split(" ").indexOf("".concat(Pe,"-overflowed-submenu"))<0}):[]},ut.getOverflowedSubMenuItem=function(Pe,Ve,yt){var st=ut.props,Nt=st.overflowedIndicator,Ut=st.level,it=st.mode,mt=st.prefixCls,bt=st.theme;if(Ut!==1||it!=="horizontal")return null;var At=ut.props.children[0],Xt=At.props,Ae=Xt.children,ge=Xt.title,z=Xt.style,Z=Object(Ee.a)(Xt,["children","title","style"]),oe=Object(ue.a)({},z),me="".concat(Pe,"-overflowed-indicator"),Re="".concat(Pe,"-overflowed-indicator");Ve.length===0&&yt!==!0?oe=Object(ue.a)(Object(ue.a)({},oe),{},{display:"none"}):yt&&(oe=Object(ue.a)(Object(ue.a)({},oe),{},{visibility:"hidden",position:"absolute"}),me="".concat(me,"-placeholder"),Re="".concat(Re,"-placeholder"));var Je=bt?"".concat(mt,"-").concat(bt):"",at={};return he.forEach(function(kt){Z[kt]!==void 0&&(at[kt]=Z[kt])}),T.createElement(q,Object.assign({title:Nt,className:"".concat(mt,"-overflowed-submenu"),popupClassName:Je},at,{key:me,eventKey:Re,disabled:!1,style:oe}),Ve)},ut.setChildrenWidthAndResize=function(){if(ut.props.mode!=="horizontal")return;var Pe=xe.findDOMNode(Object(S.a)(ut));if(!Pe)return;var Ve=Pe.children;if(!Ve||Ve.length===0)return;var yt=Pe.children[Ve.length-1];Te(yt,"display","inline-block");var st=ut.getMenuItemNodes(),Nt=st.filter(function(Ut){return Ut.className.split(" ").indexOf(Y)>=0});Nt.forEach(function(Ut){Te(Ut,"display","inline-block")}),ut.menuItemSizes=st.map(function(Ut){return pe(Ut,!0)}),Nt.forEach(function(Ut){Te(Ut,"display","none")}),ut.overflowedIndicatorWidth=pe(Pe.children[Pe.children.length-1],!0),ut.originalTotalWidth=ut.menuItemSizes.reduce(function(Ut,it){return Ut+it},0),ut.handleResize(),Te(yt,"display","none")},ut.handleResize=function(){if(ut.props.mode!=="horizontal")return;var Pe=xe.findDOMNode(Object(S.a)(ut));if(!Pe)return;var Ve=pe(Pe);ut.overflowedItems=[];var yt=0,st;ut.originalTotalWidth>Ve+J&&(st=-1,ut.menuItemSizes.forEach(function(Nt){yt+=Nt,yt+ut.overflowedIndicatorWidth<=Ve&&(st+=1)})),ut.setState({lastVisibleIndex:st})},ut}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){var Pe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ve=xe.findDOMNode(this);if(!Ve)return;this.resizeObserver=new Ge.default(function(yt){yt.forEach(function(){var st=Pe.cancelFrameId;cancelAnimationFrame(st),Pe.cancelFrameId=requestAnimationFrame(Pe.setChildrenWidthAndResize)})}),[].slice.call(Ve.children).concat(Ve).forEach(function(yt){Pe.resizeObserver.observe(yt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Pe.resizeObserver.disconnect(),[].slice.call(Ve.children).concat(Ve).forEach(function(yt){Pe.resizeObserver.observe(yt)}),Pe.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ve,{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(Pe){var Ve=this,yt=this.state.lastVisibleIndex;return(Pe||[]).reduce(function(st,Nt,Ut){var it=Nt;if(Ve.props.mode==="horizontal"){var mt=Ve.getOverflowedSubMenuItem(Nt.props.eventKey,[]);yt!==void 0&&Ve.props.className.indexOf("".concat(Ve.props.prefixCls,"-root"))!==-1&&(Ut>yt&&(it=T.cloneElement(Nt,{style:{display:"none"},eventKey:"".concat(Nt.props.eventKey,"-hidden"),className:"".concat(Y)})),Ut===yt+1&&(Ve.overflowedItems=Pe.slice(yt+1).map(function(At){return T.cloneElement(At,{key:At.props.eventKey,mode:"vertical-left"})}),mt=Ve.getOverflowedSubMenuItem(Nt.props.eventKey,Ve.overflowedItems)));var bt=[].concat(Object(Me.a)(st),[mt,it]);return Ut===Pe.length-1&&bt.push(Ve.getOverflowedSubMenuItem(Nt.props.eventKey,[],!0)),bt}return[].concat(Object(Me.a)(st),[it])},[])}},{key:"render",value:function(){var Pe=this.props,Ve=Pe.visible,yt=Pe.prefixCls,st=Pe.overflowedIndicator,Nt=Pe.mode,Ut=Pe.level,it=Pe.tag,mt=Pe.children,bt=Pe.theme,At=Object(Ee.a)(Pe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Xt=it;return T.createElement(Xt,Object.assign({},At),this.renderChildren(mt))}}]),pt}(T.Component);be.defaultProps={tag:"div",className:""};var ke=be;function ct(Dt){return Dt.length?Dt.every(function(lt){return!!lt.props.disabled}):!0}function He(Dt,lt,pt){var ut=Dt.getState();Dt.setState({activeKey:Object(ue.a)(Object(ue.a)({},ut.activeKey),{},Object(u.a)({},lt,pt))})}function Be(Dt){return Dt.eventKey||"0-menu-"}function Ze(Dt,lt){var pt=lt,ut=Dt.children,Pe=Dt.eventKey;if(pt){var Ve;if($(ut,function(yt,st){yt&&yt.props&&!yt.props.disabled&&pt===V(yt,Pe,st)&&(Ve=!0)}),Ve)return pt}return pt=null,Dt.defaultActiveFirst&&$(ut,function(yt,st){!pt&&yt&&!yt.props.disabled&&(pt=V(yt,Pe,st))}),pt}function ht(Dt){if(Dt){var lt=this.instanceArray.indexOf(Dt);lt!==-1?this.instanceArray[lt]=Dt:this.instanceArray.push(Dt)}}var Qe=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(ut){var Pe;return Object(Q.a)(this,pt),Pe=lt.call(this,ut),Pe.onKeyDown=function(Ve,yt){var st=Ve.keyCode,Nt;if(Pe.getFlatInstanceArray().forEach(function(it){it&&it.props.active&&it.onKeyDown&&(Nt=it.onKeyDown(Ve))}),Nt)return 1;var Ut=null;return(st===o.a.UP||st===o.a.DOWN)&&(Ut=Pe.step(st===o.a.UP?-1:1)),Ut?(Ve.preventDefault(),He(Pe.props.store,Be(Pe.props),Ut.props.eventKey),typeof yt=="function"&&yt(Ut),1):void 0},Pe.onItemHover=function(Ve){var yt=Ve.key,st=Ve.hover;He(Pe.props.store,Be(Pe.props),st?yt:null)},Pe.onDeselect=function(Ve){Pe.props.onDeselect(Ve)},Pe.onSelect=function(Ve){Pe.props.onSelect(Ve)},Pe.onClick=function(Ve){Pe.props.onClick(Ve)},Pe.onOpenChange=function(Ve){Pe.props.onOpenChange(Ve)},Pe.onDestroy=function(Ve){Pe.props.onDestroy(Ve)},Pe.getFlatInstanceArray=function(){return Pe.instanceArray},Pe.step=function(Ve){var yt=Pe.getFlatInstanceArray(),st=Pe.props.store.getState().activeKey[Be(Pe.props)],Nt=yt.length;if(!Nt)return null;Ve<0&&(yt=yt.concat().reverse());var Ut=-1;if(yt.every(function(At,Xt){return At&&At.props.eventKey===st?(Ut=Xt,!1):!0}),!Pe.props.defaultActiveFirst&&Ut!==-1&&ct(yt.slice(Ut,Nt-1)))return;var it=(Ut+1)%Nt,mt=it;do{var bt=yt[mt];if(!bt||bt.props.disabled)mt=(mt+1)%Nt;else return bt}while(mt!==it);return null},Pe.renderCommonMenuItem=function(Ve,yt,st){var Nt=Pe.props.store.getState(),Ut=Object(S.a)(Pe),it=Ut.props,mt=V(Ve,it.eventKey,yt),bt=Ve.props;if(!bt||typeof Ve.type=="string")return Ve;var At=mt===Nt.activeKey,Xt=Object(ue.a)(Object(ue.a)({mode:bt.mode||it.mode,level:it.level,inlineIndent:it.inlineIndent,renderMenuItem:Pe.renderMenuItem,rootPrefixCls:it.prefixCls,index:yt,parentMenu:it.parentMenu,manualRef:bt.disabled?void 0:Object(i.a)(Ve.ref,ht.bind(Object(S.a)(Pe))),eventKey:mt,active:!bt.disabled&&At,multiple:it.multiple,onClick:function(ge){(bt.onClick||G)(ge),Pe.onClick(ge)},onItemHover:Pe.onItemHover,motion:it.motion,subMenuOpenDelay:it.subMenuOpenDelay,subMenuCloseDelay:it.subMenuCloseDelay,forceSubMenuRender:it.forceSubMenuRender,onOpenChange:Pe.onOpenChange,onDeselect:Pe.onDeselect,onSelect:Pe.onSelect,builtinPlacements:it.builtinPlacements,itemIcon:bt.itemIcon||Pe.props.itemIcon,expandIcon:bt.expandIcon||Pe.props.expandIcon},st),{},{direction:it.direction});return(it.mode==="inline"||we())&&(Xt.triggerSubMenuAction="click"),T.cloneElement(Ve,Xt)},Pe.renderMenuItem=function(Ve,yt,st){if(!Ve)return null;var Nt=Pe.props.store.getState(),Ut={openKeys:Nt.openKeys,selectedKeys:Nt.selectedKeys,triggerSubMenuAction:Pe.props.triggerSubMenuAction,subMenuKey:st};return Pe.renderCommonMenuItem(Ve,yt,Ut)},ut.store.setState({activeKey:Object(ue.a)(Object(ue.a)({},ut.store.getState().activeKey),{},Object(u.a)({},ut.eventKey,Ze(ut,ut.activeKey)))}),Pe.instanceArray=[],Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Pe){return this.props.visible||Pe.visible||this.props.className!==Pe.className||!s()(this.props.style,Pe.style)}},{key:"componentDidUpdate",value:function(Pe){var Ve=this.props,yt="activeKey"in Ve?Ve.activeKey:Ve.store.getState().activeKey[Be(Ve)],st=Ze(Ve,yt);if(st!==yt)He(Ve.store,Be(Ve),st);else if("activeKey"in Pe){var Nt=Ze(Pe,Pe.activeKey);st!==Nt&&He(Ve.store,Be(Ve),st)}}},{key:"render",value:function(){var Pe=this,Ve=Object(p.a)({},this.props);this.instanceArray=[];var yt=r()(Ve.prefixCls,Ve.className,"".concat(Ve.prefixCls,"-").concat(Ve.mode)),st={className:yt,role:Ve.role||"menu"};Ve.id&&(st.id=Ve.id),Ve.focusable&&(st.tabIndex=0,st.onKeyDown=this.onKeyDown);var Nt=Ve.prefixCls,Ut=Ve.eventKey,it=Ve.visible,mt=Ve.level,bt=Ve.mode,At=Ve.overflowedIndicator,Xt=Ve.theme;return he.forEach(function(Ae){return delete Ve[Ae]}),delete Ve.onClick,T.createElement(ke,Object.assign({},Ve,{prefixCls:Nt,mode:bt,tag:"ul",level:mt,theme:Xt,visible:it,overflowedIndicator:At},st),T.Children.map(Ve.children,function(Ae,ge){return Pe.renderMenuItem(Ae,ge,Ut||"0-menu-")}))}}]),pt}(T.Component);Qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:G};var Xe=Object(w.b)()(Qe),Ke=Xe,Fe=F("Kwbf");function Ue(Dt,lt,pt){var ut=Dt.prefixCls,Pe=Dt.motion,Ve=Dt.defaultMotions,yt=Ve===void 0?{}:Ve,st=Dt.openAnimation,Nt=Dt.openTransitionName,Ut=lt.switchingModeFromInline;if(Pe)return Pe;if(Object(t.a)(st)==="object"&&st)Object(Fe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof st=="string")return{motionName:"".concat(ut,"-open-").concat(st)};if(Nt)return{motionName:Nt};var it=yt[pt];return it||(Ut?null:yt.other)}var _e=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(ut){var Pe;Object(Q.a)(this,pt),Pe=lt.call(this,ut),Pe.inlineOpenKeys=[],Pe.onSelect=function(st){var Nt=Object(S.a)(Pe),Ut=Nt.props;if(Ut.selectable){var it=Pe.store.getState(),mt=it.selectedKeys,bt=st.key;Ut.multiple?mt=mt.concat([bt]):mt=[bt],"selectedKeys"in Ut||Pe.store.setState({selectedKeys:mt}),Ut.onSelect(Object(ue.a)(Object(ue.a)({},st),{},{selectedKeys:mt}))}},Pe.onClick=function(st){var Nt=Pe.getRealMenuMode(),Ut=Object(S.a)(Pe),it=Ut.store,mt=Ut.props.onOpenChange;Nt!=="inline"&&!("openKeys"in Pe.props)&&(it.setState({openKeys:[]}),mt([])),Pe.props.onClick(st)},Pe.onKeyDown=function(st,Nt){Pe.innerMenu.getWrappedInstance().onKeyDown(st,Nt)},Pe.onOpenChange=function(st){var Nt=Object(S.a)(Pe),Ut=Nt.props,it=Pe.store.getState().openKeys.concat(),mt=!1,bt=function(Xt){var Ae=!1;if(Xt.open)Ae=it.indexOf(Xt.key)===-1,Ae&&it.push(Xt.key);else{var ge=it.indexOf(Xt.key);Ae=ge!==-1,Ae&&it.splice(ge,1)}mt=mt||Ae};Array.isArray(st)?st.forEach(bt):bt(st),mt&&("openKeys"in Pe.props||Pe.store.setState({openKeys:it}),Ut.onOpenChange(it))},Pe.onDeselect=function(st){var Nt=Object(S.a)(Pe),Ut=Nt.props;if(Ut.selectable){var it=Pe.store.getState().selectedKeys.concat(),mt=st.key,bt=it.indexOf(mt);bt!==-1&&it.splice(bt,1),"selectedKeys"in Ut||Pe.store.setState({selectedKeys:it}),Ut.onDeselect(Object(ue.a)(Object(ue.a)({},st),{},{selectedKeys:it}))}},Pe.onMouseEnter=function(st){Pe.restoreModeVerticalFromInline();var Nt=Pe.props.onMouseEnter;Nt&&Nt(st)},Pe.onTransitionEnd=function(st){var Nt=st.propertyName==="width"&&st.target===st.currentTarget,Ut=st.target.className,it=Object.prototype.toString.call(Ut)==="[object SVGAnimatedString]"?Ut.animVal:Ut,mt=st.propertyName==="font-size"&&it.indexOf("anticon")>=0;(Nt||mt)&&Pe.restoreModeVerticalFromInline()},Pe.setInnerMenu=function(st){Pe.innerMenu=st},Pe.isRootMenu=!0;var Ve=ut.defaultSelectedKeys,yt=ut.defaultOpenKeys;return"selectedKeys"in ut&&(Ve=ut.selectedKeys||[]),"openKeys"in ut&&(yt=ut.openKeys||[]),Pe.store=Object(w.c)({selectedKeys:Ve,openKeys:yt,activeKey:{"0-menu-":Ze(ut,ut.activeKey)}}),Pe.state={switchingModeFromInline:!1},Pe}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Pe){this.updateOpentKeysWhenSwitchMode(Pe),this.updateMiniStore();var Ve=this.props,yt=Ve.siderCollapsed,st=Ve.inlineCollapsed,Nt=Ve.onOpenChange;(!Pe.inlineCollapsed&&st||!Pe.siderCollapsed&&yt)&&Nt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(Pe){var Ve=this.props,yt=this.store,st=this.inlineOpenKeys,Nt=yt.getState(),Ut={};Pe.mode==="inline"&&Ve.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ve||((Ve.inlineCollapsed&&!Pe.inlineCollapsed||Ve.siderCollapsed&&!Pe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Nt.openKeys.concat(),Ut.openKeys=[]),(!Ve.inlineCollapsed&&Pe.inlineCollapsed||!Ve.siderCollapsed&&Pe.siderCollapsed)&&(Ut.openKeys=st,this.inlineOpenKeys=[])),Object.keys(Ut).length&&yt.setState(Ut)}},{key:"updateMenuDisplay",value:function(){var Pe=this.props.collapsedWidth,Ve=this.store,yt=this.prevOpenKeys,st=this.getInlineCollapsed()&&(Pe===0||Pe==="0"||Pe==="0px");st?(this.prevOpenKeys=Ve.getState().openKeys.concat(),this.store.setState({openKeys:[]})):yt&&(this.store.setState({openKeys:yt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Pe=this.props.mode,Ve=this.state.switchingModeFromInline,yt=this.getInlineCollapsed();return Ve&&yt?"inline":yt?"vertical":Pe}},{key:"getInlineCollapsed",value:function(){var Pe=this.props,Ve=Pe.inlineCollapsed,yt=Pe.siderCollapsed;return yt!==void 0?yt:Ve}},{key:"restoreModeVerticalFromInline",value:function(){var Pe=this.state.switchingModeFromInline;Pe&&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 Pe=Object(ue.a)({},Object(f.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ve=this.getRealMenuMode();return Pe.className+=" ".concat(Pe.prefixCls,"-root"),Pe.direction==="rtl"&&(Pe.className+=" ".concat(Pe.prefixCls,"-rtl")),Pe=Object(ue.a)(Object(ue.a)({},Pe),{},{mode:Ve,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ue(this.props,this.state,Ve)}),delete Pe.openAnimation,delete Pe.openTransitionName,T.createElement(w.a,{store:this.store},T.createElement(Ke,Object.assign({},Pe,{ref:this.setInnerMenu}),this.props.children))}}]),pt}(T.Component);_e.defaultProps={selectable:!0,onClick:G,onSelect:G,onOpenChange:G,onDeselect:G,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:T.createElement("span",null,"\xB7\xB7\xB7")};var Ce=_e,Ne=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(){var ut;return Object(Q.a)(this,pt),ut=lt.apply(this,arguments),ut.onKeyDown=function(Pe){var Ve=Pe.keyCode;return Ve===o.a.ENTER?(ut.onClick(Pe),!0):void 0},ut.onMouseLeave=function(Pe){var Ve=ut.props,yt=Ve.eventKey,st=Ve.onItemHover,Nt=Ve.onMouseLeave;st({key:yt,hover:!1}),Nt({key:yt,domEvent:Pe})},ut.onMouseEnter=function(Pe){var Ve=ut.props,yt=Ve.eventKey,st=Ve.onItemHover,Nt=Ve.onMouseEnter;st({key:yt,hover:!0}),Nt({key:yt,domEvent:Pe})},ut.onClick=function(Pe){var Ve=ut.props,yt=Ve.eventKey,st=Ve.multiple,Nt=Ve.onClick,Ut=Ve.onSelect,it=Ve.onDeselect,mt=Ve.isSelected,bt={key:yt,keyPath:[yt],item:Object(S.a)(ut),domEvent:Pe};Nt(bt),st?mt?it(bt):Ut(bt):mt||Ut(bt)},ut.saveNode=function(Pe){ut.node=Pe},ut}return Object(j.a)(pt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Pe=this.props;Pe.onDestroy&&Pe.onDestroy(Pe.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 Pe,Ve=Object(ue.a)({},this.props),yt=r()(this.getPrefixCls(),Ve.className,(Pe={},Object(u.a)(Pe,this.getActiveClassName(),!Ve.disabled&&Ve.active),Object(u.a)(Pe,this.getSelectedClassName(),Ve.isSelected),Object(u.a)(Pe,this.getDisabledClassName(),Ve.disabled),Pe)),st=Object(ue.a)(Object(ue.a)({},Ve.attribute),{},{title:typeof Ve.title=="string"?Ve.title:void 0,className:yt,role:Ve.role||"menuitem","aria-disabled":Ve.disabled});Ve.role==="option"?st=Object(ue.a)(Object(ue.a)({},st),{},{role:"option","aria-selected":Ve.isSelected}):(Ve.role===null||Ve.role==="none")&&(st.role="none");var Nt={onClick:Ve.disabled?null:this.onClick,onMouseLeave:Ve.disabled?null:this.onMouseLeave,onMouseEnter:Ve.disabled?null:this.onMouseEnter},Ut=Object(ue.a)({},Ve.style);Ve.mode==="inline"&&(Ve.direction==="rtl"?Ut.paddingRight=Ve.inlineIndent*Ve.level:Ut.paddingLeft=Ve.inlineIndent*Ve.level),he.forEach(function(mt){return delete Ve[mt]}),delete Ve.direction;var it=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(it=T.createElement(this.props.itemIcon,this.props)),T.createElement("li",Object.assign({},Object(f.default)(Ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),st,Nt,{style:Ut,ref:this.saveNode}),Ve.children,it)}}]),pt}(T.Component);Ne.isMenuItem=!0,Ne.defaultProps={onSelect:G,onMouseEnter:G,onMouseLeave:G,manualRef:G};var De=Object(w.b)(function(Dt,lt){var pt=Dt.activeKey,ut=Dt.selectedKeys,Pe=lt.eventKey,Ve=lt.subMenuKey;return{active:pt[Ve]===Pe,isSelected:ut.indexOf(Pe)!==-1}})(Ne),rt=De,tt=function(Dt){Object(D.a)(pt,Dt);var lt=Object(x.a)(pt);function pt(){var ut;return Object(Q.a)(this,pt),ut=lt.apply(this,arguments),ut.renderInnerMenuItem=function(Pe){var Ve=ut.props,yt=Ve.renderMenuItem,st=Ve.index;return yt(Pe,st,ut.props.subMenuKey)},ut}return Object(j.a)(pt,[{key:"render",value:function(){var Pe=Object(p.a)({},this.props),Ve=Pe.className,yt=Ve===void 0?"":Ve,st=Pe.rootPrefixCls,Nt="".concat(st,"-item-group-title"),Ut="".concat(st,"-item-group-list"),it=Pe.title,mt=Pe.children;return he.forEach(function(bt){return delete Pe[bt]}),delete Pe.onClick,delete Pe.direction,T.createElement("li",Object.assign({},Pe,{className:"".concat(yt," ").concat(st,"-item-group")}),T.createElement("div",{className:Nt,title:typeof it=="string"?it:void 0},it),T.createElement("ul",{className:Ut},T.Children.map(mt,this.renderInnerMenuItem)))}}]),pt}(T.Component);tt.isMenuItemGroup=!0,tt.defaultProps={disabled:!0};var xt=tt,Mt=function(lt){var pt=lt.className,ut=lt.rootPrefixCls,Pe=lt.style;return T.createElement("li",{className:"".concat(pt," ").concat(ut,"-item-divider"),style:Pe})};Mt.defaultProps={disabled:!0,className:"",style:{}};var Bt=Mt,It=Le.e=Ce},"24hK":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue=F("JYp7"),Q=function(){function S(D){this.element=D,this.next=S.Undefined,this.prev=S.Undefined}return S.Undefined=new S(void 0),S}(),j=function(){function S(){this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}return Object.defineProperty(S.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),S.prototype.isEmpty=function(){return this._first===Q.Undefined},S.prototype.clear=function(){this._first=Q.Undefined,this._last=Q.Undefined,this._size=0},S.prototype.unshift=function(D){return this._insert(D,!1)},S.prototype.push=function(D){return this._insert(D,!0)},S.prototype._insert=function(D,x){var T=this,w=new Q(D);if(this._first===Q.Undefined)this._first=w,this._last=w;else if(x){var f=this._last;this._last=w,w.prev=f,f.next=w}else{var p=this._first;this._first=w,w.next=p,p.prev=w}this._size+=1;var u=!1;return function(){u||(u=!0,T._remove(w))}},S.prototype.shift=function(){if(this._first===Q.Undefined)return;var D=this._first.element;return this._remove(this._first),D},S.prototype.pop=function(){if(this._last===Q.Undefined)return;var D=this._last.element;return this._remove(this._last),D},S.prototype._remove=function(D){if(D.prev!==Q.Undefined&&D.next!==Q.Undefined){var x=D.prev;x.next=D.next,D.next.prev=x}else D.prev===Q.Undefined&&D.next===Q.Undefined?(this._first=Q.Undefined,this._last=Q.Undefined):D.next===Q.Undefined?(this._last=this._last.prev,this._last.next=Q.Undefined):D.prev===Q.Undefined&&(this._first=this._first.next,this._first.prev=Q.Undefined);this._size-=1},S.prototype.iterator=function(){var D,x=this._first;return{next:function(){return x===Q.Undefined?ue.c:(D?D.value=x.element:D={done:!1,value:x.element},x=x.next,D)}}},S.prototype.toArray=function(){for(var D=[],x=this._first;x!==Q.Undefined;x=x.next)D.push(x.element);return D},S}()},"3tLw":function(nt,Le,F){nt.exports=F.p+"static/a.39070d50.svg"},"4xil":function(nt,Le,F){nt.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return n}),F.d(Le,"b",function(){return g});var ue=F("Ty5D"),Q=F("dI71"),j=F("q1tI"),S=F.n(j),D=F("YS25"),x=F("17x9"),T=F.n(x),w=F("wx14"),f=F("zLVn"),p=F("9R94"),u=function(C){Object(Q.a)(d,C);function d(){for(var O,A=arguments.length,P=new Array(A),I=0;I=0||A.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;C.setState({goInputText:""}),W(C.getValidValue())},C.go=function(A){var P=C.state.goInputText;if(P==="")return;(A.keyCode===l.ENTER||A.type==="click")&&(C.setState({goInputText:""}),C.props.quickGo(C.getValidValue()))},C}return Object(D.a)(y,[{key:"getValidValue",value:function(){var d=this.state,_=d.goInputText,O=d.current;return!_||isNaN(_)?O:Number(_)}},{key:"getPageSizeOptions",value:function(){var d=this.props,_=d.pageSize,O=d.pageSizeOptions;return O.some(function(A){return A.toString()===_.toString()})?O:O.concat([_.toString()]).sort(function(A,P){var I=isNaN(Number(A))?0:Number(A),W=isNaN(Number(P))?0:Number(P);return I-W})}},{key:"render",value:function(){var d=this,_=this.props,O=_.pageSize,A=_.locale,P=_.rootPrefixCls,I=_.changeSize,W=_.quickGo,K=_.goButton,te=_.selectComponentClass,H=_.buildOptionText,G=_.selectPrefixCls,V=_.disabled,re=this.state.goInputText,$="".concat(P,"-options"),ne=te,he=null,pe=null,Te=null;if(!I&&!W)return null;var we=this.getPageSizeOptions();if(I&&ne){var Me=we.map(function(Ee,xe){return f.a.createElement(ne.Option,{key:xe,value:Ee.toString()},(H||d.buildOptionText)(Ee))});he=f.a.createElement(ne,{disabled:V,prefixCls:G,showSearch:!1,className:"".concat($,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||we[0]).toString(),onChange:this.changeSize,getPopupContainer:function(xe){return xe.parentNode}},Me)}return W&&(K&&(Te=typeof K=="boolean"?f.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat($,"-quick-jumper-button")},A.jump_to_confirm):f.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),pe=f.a.createElement("div",{className:"".concat($,"-quick-jumper")},A.jump_to,f.a.createElement("input",{disabled:V,type:"text",value:re,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),A.page,Te)),f.a.createElement("li",{className:"".concat($)},he,pe)}}]),y}(f.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=s,r=F("N2Kk");function t(){}function n(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function c(E,g,y){return y}function m(E,g,y){var C=typeof E=="undefined"?g.pageSize:E;return Math.floor((y.total-1)/C)+1}var v=function(E){Object(x.a)(y,E);var g=Object(T.a)(y);function y(C){var d;Object(S.a)(this,y),d=g.call(this,C),d.getJumpPrevPage=function(){return Math.max(1,d.state.current-(d.props.showLessItems?3:5))},d.getJumpNextPage=function(){return Math.min(m(void 0,d.state,d.props),d.state.current+(d.props.showLessItems?3:5))},d.getItemIcon=function(I,W){var K=d.props.prefixCls,te=I||f.a.createElement("button",{type:"button","aria-label":W,className:"".concat(K,"-item-link")});return typeof I=="function"&&(te=f.a.createElement(I,Object(j.a)({},d.props))),te},d.savePaginationNode=function(I){d.paginationNode=I},d.isValid=function(I){return n(I)&&I!==d.state.current},d.shouldDisplayQuickJumper=function(){var I=d.props,W=I.showQuickJumper,K=I.pageSize,te=I.total;return te<=K?!1:W},d.handleKeyDown=function(I){(I.keyCode===l.ARROW_UP||I.keyCode===l.ARROW_DOWN)&&I.preventDefault()},d.handleKeyUp=function(I){var W=d.getValidValue(I),K=d.state.currentInputValue;W!==K&&d.setState({currentInputValue:W}),I.keyCode===l.ENTER?d.handleChange(W):I.keyCode===l.ARROW_UP?d.handleChange(W-1):I.keyCode===l.ARROW_DOWN&&d.handleChange(W+1)},d.changePageSize=function(I){var W=d.state.current,K=m(I,d.state,d.props);W=W>K?K:W,K===0&&(W=d.state.current),typeof I=="number"&&("pageSize"in d.props||d.setState({pageSize:I}),"current"in d.props||d.setState({current:W,currentInputValue:W})),d.props.onShowSizeChange(W,I),"onChange"in d.props&&d.props.onChange&&d.props.onChange(W,I)},d.handleChange=function(I){var W=d.props.disabled,K=I;if(d.isValid(K)&&!W){var te=m(void 0,d.state,d.props);K>te?K=te:K<1&&(K=1),"current"in d.props||d.setState({current:K,currentInputValue:K});var H=d.state.pageSize;return d.props.onChange(K,H),K}return d.state.current},d.prev=function(){d.hasPrev()&&d.handleChange(d.state.current-1)},d.next=function(){d.hasNext()&&d.handleChange(d.state.current+1)},d.jumpPrev=function(){d.handleChange(d.getJumpPrevPage())},d.jumpNext=function(){d.handleChange(d.getJumpNextPage())},d.hasPrev=function(){return d.state.current>1},d.hasNext=function(){return d.state.current2?K-2:0),H=2;H=O?P=O:P=Number(_),P}},{key:"getShowSizeChanger",value:function(){var d=this.props,_=d.showSizeChanger,O=d.total,A=d.totalBoundaryShowSizeChanger;return typeof _!="undefined"?_:O>A}},{key:"renderPrev",value:function(d){var _=this.props,O=_.prevIcon,A=_.itemRender,P=A(d,"prev",this.getItemIcon(O,"prev page")),I=!this.hasPrev();return Object(w.isValidElement)(P)?Object(w.cloneElement)(P,{disabled:I}):P}},{key:"renderNext",value:function(d){var _=this.props,O=_.nextIcon,A=_.itemRender,P=A(d,"next",this.getItemIcon(O,"next page")),I=!this.hasNext();return Object(w.isValidElement)(P)?Object(w.cloneElement)(P,{disabled:I}):P}},{key:"render",value:function(){var d=this,_=this.props,O=_.prefixCls,A=_.className,P=_.style,I=_.disabled,W=_.hideOnSinglePage,K=_.total,te=_.locale,H=_.showQuickJumper,G=_.showLessItems,V=_.showTitle,re=_.showTotal,$=_.simple,ne=_.itemRender,he=_.showPrevNextJumpers,pe=_.jumpPrevIcon,Te=_.jumpNextIcon,we=_.selectComponentClass,Me=_.selectPrefixCls,Ee=_.pageSizeOptions,xe=this.state,Ge=xe.current,je=xe.pageSize,We=xe.currentInputValue;if(W===!0&&K<=je)return null;var ze=m(void 0,this.state,this.props),de=[],le=null,Oe=null,Ie=null,qe=null,ee=null,k=H&&H.goButton,U=G?1:2,q=Ge-1>0?Ge-1:0,Y=Ge+1=U*2&&Ge!==1+2&&(de[0]=Object(w.cloneElement)(de[0],{className:"".concat(O,"-item-after-jump-prev")}),de.unshift(le)),ze-Ge>=U*2&&Ge!==ze-2&&(de[de.length-1]=Object(w.cloneElement)(de[de.length-1],{className:"".concat(O,"-item-before-jump-next")}),de.push(Oe)),Ze!==1&&de.unshift(Ie),ht!==ze&&de.push(qe)}var Ke=null;re&&(Ke=f.a.createElement("li",{className:"".concat(O,"-total-text")},re(K,[K===0?0:(Ge-1)*je+1,Ge*je>K?K:Ge*je])));var Fe=!this.hasPrev()||!ze,Ue=!this.hasNext()||!ze;return f.a.createElement("ul",Object(ue.a)({className:u()(O,A,Object(Q.a)({},"".concat(O,"-disabled"),I)),style:P,unselectable:"unselectable",ref:this.savePaginationNode},J),Ke,f.a.createElement("li",{title:V?te.prev_page:null,onClick:this.prev,tabIndex:Fe?null:0,onKeyPress:this.runIfEnterPrev,className:u()("".concat(O,"-prev"),Object(Q.a)({},"".concat(O,"-disabled"),Fe)),"aria-disabled":Fe},this.renderPrev(q)),de,f.a.createElement("li",{title:V?te.next_page:null,onClick:this.next,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterNext,className:u()("".concat(O,"-next"),Object(Q.a)({},"".concat(O,"-disabled"),Ue)),"aria-disabled":Ue},this.renderNext(Y)),f.a.createElement(h,{disabled:I,locale:te,rootPrefixCls:O,selectComponentClass:we,selectPrefixCls:Me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ge,pageSize:je,pageSizeOptions:Ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:k}))}}],[{key:"getDerivedStateFromProps",value:function(d,_){var O={};if("current"in d&&(O.current=d.current,d.current!==_.current&&(O.currentInputValue=O.current)),"pageSize"in d&&d.pageSize!==_.pageSize){var A=_.current,P=m(d.pageSize,_,d);A=A>P?P:A,"current"in d||(O.current=A,O.currentInputValue=A),O.pageSize=d.pageSize}return O}}]),y}(f.a.Component);v.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:r.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var b=v},"6RRn":function(nt,Le,F){"use strict";var ue=F("wCXF"),Q=F("n6Qo");F.d(Le,"b",function(){return Q.a});var j=F("IBYe"),S=F("6eGT"),D=F("hW8S");F.d(Le,"a",function(){return D.a}),Le.c=ue.b},"6eGT":function(nt,Le,F){"use strict";function ue(Q){return null}Le.a=ue},"7+5b":function(nt,Le,F){nt.exports=F.p+"static/v.e7f297d6.svg"},"746U":function(nt,Le,F){"use strict";F.d(Le,"d",function(){return Q}),F.d(Le,"j",function(){return j}),F.d(Le,"i",function(){return S}),F.d(Le,"h",function(){return D}),F.d(Le,"e",function(){return x}),F.d(Le,"k",function(){return T}),F.d(Le,"l",function(){return w}),F.d(Le,"a",function(){return f}),F.d(Le,"f",function(){return u}),F.d(Le,"g",function(){return o}),F.d(Le,"m",function(){return i}),F.d(Le,"c",function(){return h}),F.d(Le,"b",function(){return r}),F.d(Le,"n",function(){return t}),F.d(Le,"o",function(){return n});var ue={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function Q(c){return Array.isArray?Array.isArray(c):!!(c&&typeof c.length===ue.number&&c.constructor===Array)}function j(c){return typeof c===ue.string||c instanceof String}function S(c){return typeof c===ue.object&&c!==null&&!Array.isArray(c)&&!(c instanceof RegExp)&&!(c instanceof Date)}function D(c){return(typeof c===ue.number||c instanceof Number)&&!isNaN(c)}function x(c){return c===!0||c===!1}function T(c){return typeof c===ue.undefined}function w(c){return T(c)||c===null}function f(c,m){if(!c)throw new Error(m?"Unexpected type, expected '"+m+"'":"Unexpected type")}var p=Object.prototype.hasOwnProperty;function u(c){if(!S(c))return!1;for(var m in c)if(p.call(c,m))return!1;return!0}function o(c){return typeof c===ue.function}function i(c,m){for(var v=Math.min(c.length,m.length),b=0;b1&&arguments[1]!==void 0?arguments[1]:0,s=(T[i[l+0]]+T[i[l+1]]+T[i[l+2]]+T[i[l+3]]+"-"+T[i[l+4]]+T[i[l+5]]+"-"+T[i[l+6]]+T[i[l+7]]+"-"+T[i[l+8]]+T[i[l+9]]+"-"+T[i[l+10]]+T[i[l+11]]+T[i[l+12]]+T[i[l+13]]+T[i[l+14]]+T[i[l+15]]).toLowerCase();if(!x(s))throw TypeError("Stringified UUID is invalid");return s}var p=f;function u(i,l,s){i=i||{};var h=i.random||(i.rng||j)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,l){s=s||0;for(var r=0;r<16;++r)l[s+r]=h[r];return l}return p(h)}var o=Le.a=u},"7ahc":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return m});var ue=F("k1fw"),Q=F("0Owb"),j=F("+L6B"),S=F("2/Rp"),D=F("y8nQ"),x=F("Vl3Y"),T=F("tJVT"),w=F("OaEy"),f=F("2fM7"),p=F("q1tI"),u=F.n(p),o=F("VrN/"),i=F.n(o),l=F("p77/"),s=F.n(l),h=F("c5Ni"),r=F.n(h),t=f.a.Option,n={labelCol:{span:4},wrapperCol:{span:20}},c={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"]};Le.b=function(v){var b=v.callback,E=v.onCancel,g=Object(p.useState)("python"),y=Object(T.a)(g,2),C=y[0],d=y[1];function _(A){d(c[A][1])}function O(A){b(A)}return u.a.createElement(x.a,Object(Q.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:O}),u.a.createElement(x.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},u.a.createElement(f.a,{onChange:_},Object.keys(c).map(function(A){return u.a.createElement(t,{key:A,value:A},c[A][0])}))),u.a.createElement(x.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},u.a.createElement(m,{mode:C})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),u.a.createElement(S.a,{type:"ghost",onClick:E},"\u53D6\u6D88")))};function m(v){var b=v.value,E=v.onChange,g=v.mode,y=v.options,C=y===void 0?{}:y,d=Object(p.useRef)(),_=Object(p.useState)(),O=Object(T.a)(_,2),A=O[0],P=O[1];return Object(p.useEffect)(function(){if(A){function I(W){var K=W.getValue();E&&E(K)}return A.on("change",I),function(){A.off("change",I)}}},[A,E]),Object(p.useEffect)(function(){A&&A.setOption("mode",g)},[A,g]),Object(p.useEffect)(function(){A&&((b!==A.getValue()||b==="")&&setTimeout(function(){A.setValue(b||" ")},300))},[A,b]),Object(p.useEffect)(function(){if(d.current&&!A){var I=i.a.fromTextArea(d.current,Object(ue.a)({mode:g,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));P(I)}},[d.current,A]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:d}))}},"7ixt":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue={adjustX:1,adjustY:1},Q=[0,0],j={left:{points:["cr","cl"],overflow:ue,offset:[-4,0],targetOffset:Q},right:{points:["cl","cr"],overflow:ue,offset:[4,0],targetOffset:Q},top:{points:["bc","tc"],overflow:ue,offset:[0,-4],targetOffset:Q},bottom:{points:["tc","bc"],overflow:ue,offset:[0,4],targetOffset:Q},topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-4],targetOffset:Q},leftTop:{points:["tr","tl"],overflow:ue,offset:[-4,0],targetOffset:Q},topRight:{points:["br","tr"],overflow:ue,offset:[0,-4],targetOffset:Q},rightTop:{points:["tl","tr"],overflow:ue,offset:[4,0],targetOffset:Q},bottomRight:{points:["tr","br"],overflow:ue,offset:[0,4],targetOffset:Q},rightBottom:{points:["bl","br"],overflow:ue,offset:[4,0],targetOffset:Q},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,4],targetOffset:Q},leftBottom:{points:["br","bl"],overflow:ue,offset:[-4,0],targetOffset:Q}},S=j},"7qur":function(nt,Le,F){"use strict";F.d(Le,"m",function(){return Q}),F.d(Le,"s",function(){return j}),F.d(Le,"h",function(){return S}),F.d(Le,"o",function(){return D}),F.d(Le,"n",function(){return x}),F.d(Le,"l",function(){return T}),F.d(Le,"b",function(){return w}),F.d(Le,"q",function(){return f}),F.d(Le,"t",function(){return p}),F.d(Le,"v",function(){return u}),F.d(Le,"w",function(){return o}),F.d(Le,"u",function(){return i}),F.d(Le,"p",function(){return l}),F.d(Le,"f",function(){return s}),F.d(Le,"a",function(){return h}),F.d(Le,"j",function(){return r}),F.d(Le,"k",function(){return t}),F.d(Le,"d",function(){return n}),F.d(Le,"g",function(){return c}),F.d(Le,"c",function(){return m}),F.d(Le,"e",function(){return v}),F.d(Le,"i",function(){return b}),F.d(Le,"r",function(){return E});var ue=F("ErOA");function Q(g){return Object(ue.c)("mypractices/".concat(g,".json"),{hidePopLogin:!0})}function j(g,y){return Object(ue.f)("mypractices/".concat(g,"/code_submit.json"),y)}function S(g,y){return Object(ue.c)("mypractices/".concat(g,"/code_debug.json"),y)}function D(g,y){return Object(ue.c)("mypractices/".concat(g,"/submit_records.json"),y)}function x(g){return Object(ue.c)("mypractices/record_detail.json",{id:g})}function T(g,y){return Object(ue.c)("mypractices/".concat(g,"/result.json"),{mode:y})}function w(g,y){return Object(ue.f)("mypractices/".concat(g,"/add_notes.json"),y)}function f(g,y){return Object(ue.f)("mypractices/".concat(g,"/restore_initial_code.json"),y)}function p(g,y){return Object(ue.f)("mypractices/".concat(g,"/sync_code.json"),y)}function u(g,y){return Object(ue.f)("mypractices/".concat(g,"/update_code.json"),y)}function o(g){return Object(ue.f)("mypractices/".concat(g,"/initial_codes.json"))}function i(g,y){return Object(ue.f)("discusses/".concat(g,"/plus.json"),y)}function l(g){return Object(ue.c)("practices/practices_list.json",g)}function s(g,y){return Object(ue.c)("practices/".concat(g,"/question_solution_articles"),y)}function h(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles"),y)}function r(g,y){return Object(ue.g)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function t(g,y){return Object(ue.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/edit"),y)}function n(g,y){return Object(ue.c)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function c(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/set_authority_or_excellent"),y)}function m(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/praise_or_treads"),y)}function v(g,y){return Object(ue.f)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active,"/hide"))}function b(g,y){return Object(ue.b)("practices/".concat(g,"/question_solution_articles/").concat(y==null?void 0:y.active),y)}function E(g,y){return Object(ue.f)("mypractices/".concat(g,"/update_practice_time_sum"),y)}},"815F":function(nt,Le,F){"use strict";F.d(Le,"e",function(){return T}),F.d(Le,"c",function(){return f}),F.d(Le,"d",function(){return p}),F.d(Le,"a",function(){return o}),F.d(Le,"f",function(){return i}),F.d(Le,"b",function(){return l});var ue=F("KQm4"),Q=F("VTBJ"),j=F("Ff2n"),S=F("Zm9Q"),D=F("Kwbf"),x=F("OZM5");function T(s,h){return s!=null?s:h}function w(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=new Map;function r(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(c){var m=c.key,v=c.children;Object(D.a)(m!=null,"Tree node must have a certain key: [".concat(n).concat(m,"]"));var b=String(m);Object(D.a)(!h.has(b)||m===null||m===void 0,"Same 'key' exist in the Tree: ".concat(b)),h.set(b,!0),r(v,"".concat(n).concat(b," > "))})}r(s)}function f(s){function h(r){var t=Object(S.a)(r);return t.map(function(n){if(!Object(x.i)(n))return Object(D.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var c=n.key,m=n.props,v=m.children,b=Object(j.a)(m,["children"]),E=Object(Q.a)({key:c},b),g=h(v);return g.length&&(E.children=g),E}).filter(function(n){return n})}return h(s)}function p(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(h===!0?[]:h),t=[];function n(c){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(v,b){var E=Object(x.h)(m?m.pos:"0",b),g=T(v.key,E),y=Object(Q.a)(Object(Q.a)({},v),{},{parent:m,pos:E,children:null,data:v,isStart:[].concat(Object(ue.a)(m?m.isStart:[]),[b===0]),isEnd:[].concat(Object(ue.a)(m?m.isEnd:[]),[b===c.length-1])});return t.push(y),h===!0||r.has(g)?y.children=n(v.children||[],y):y.children=[],y})}return n(s),t}function u(s,h,r){var t;r?typeof r=="string"?t=function(m){return m[r]}:typeof r=="function"&&(t=function(m){return r(m)}):t=function(m,v){return T(m.key,v)};function n(c,m,v){var b=c?c.children:s,E=c?Object(x.h)(v.pos,m):"0";if(c){var g=t(c,E),y={node:c,index:m,pos:E,key:g,parentPos:v.node?v.pos:null,level:v.level+1};h(y)}b&&b.forEach(function(C,d){n(C,d,{node:c,pos:E,level:v?v.level+1:-1})})}n(null)}function o(s){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=h.initWrapper,t=h.processEntity,n=h.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,m={},v={},b={posEntities:m,keyEntities:v};return r&&(b=r(b)||b),u(s,function(E){var g=E.node,y=E.index,C=E.pos,d=E.key,_=E.parentPos,O=E.level,A={node:g,index:y,key:d,pos:C,level:O},P=T(d,C);m[C]=A,v[P]=A,A.parent=m[_],A.parent&&(A.parent.children=A.parent.children||[],A.parent.children.push(A)),t&&t(A,b)},c),n&&n(b),b}function i(s,h){var r=h.expandedKeys,t=h.selectedKeys,n=h.loadedKeys,c=h.loadingKeys,m=h.checkedKeys,v=h.halfCheckedKeys,b=h.dragOverNodeKey,E=h.dropPosition,g=h.keyEntities,y=g[s],C={eventKey:s,expanded:r.indexOf(s)!==-1,selected:t.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:c.indexOf(s)!==-1,checked:m.indexOf(s)!==-1,halfChecked:v.indexOf(s)!==-1,pos:String(y?y.pos:""),dragOver:b===s&&E===0,dragOverGapTop:b===s&&E===-1,dragOverGapBottom:b===s&&E===1};return C}function l(s){var h=s.data,r=s.expanded,t=s.selected,n=s.checked,c=s.loaded,m=s.loading,v=s.halfChecked,b=s.dragOver,E=s.dragOverGapTop,g=s.dragOverGapBottom,y=s.pos,C=s.active,d=Object(Q.a)(Object(Q.a)({},h),{},{expanded:r,selected:t,checked:n,loaded:c,loading:m,halfChecked:v,dragOver:b,dragOverGapTop:E,dragOverGapBottom:g,pos:y,active:C});return"props"in d||Object.defineProperty(d,"props",{get:function(){return Object(D.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),d}},"8EBN":function(nt,Le,F){(function(ue){ue(F("VrN/"))})(function(ue){"use strict";ue.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 Q=0;Q-1&&S.substring(T+1,S.length);if(w)return ue.findModeByExtension(w)},ue.findModeByName=function(S){S=S.toLowerCase();for(var D=0;D0&&i[i.length-1])&&(r[0]===6||r[0]===2)){p=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]=ae.length?fe.slice(ae.length):fe}).join(` `)}var r=[],t=["
    "],n=new l.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function m(){r.length=0,t=["
      "]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(ie,N,B,ae){if(N>=ie.length||ie[N].level<=B)return N;var fe=ie[N];ae.push("
    • "+fe.text+""),N++;var se=[];return N=b(ie,N,fe.level,se),se.length>0&&(ae.push("
        "),se.forEach(function($e){ae.push($e)}),ae.push("
      ")),ae.push("
    • "),N=b(ie,N,B,ae),N}function E(){return b(r,0,0,t),t.push("
    "),t.join("")}var g={heading:function(N){var B=c.exec(N);if(B)return{type:"heading",raw:B[0],depth:B[1].length,text:B[2]}},fences:function(N){var B=this.rules.block.fences.exec(N);if(B){var ae=B[0],fe=h(ae,B[3]||""),se=B[2]?B[2].trim():B[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=d(),St=fe;fe=$e,_[$e]={type:"block",expression:St}}return{type:"code",raw:ae,lang:se,text:fe}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,d=function(){return"__special_katext_id_".concat(C++,"__")},_={};function O(){return _}function A(){C=0,_={}}function P(ie){return ie=ie.replace(y,function(N,B){var ae=d();return _[ae]={type:"inline",expression:B},ae}),ie}var I=n.listitem;n.listitem=function(ie){return I(P(ie))};var W=n.paragraph;n.paragraph=function(ie){return W(P(ie))};var K=n.tablecell;n.tablecell=function(ie,N){return K(P(ie),N)},n.code=function(ie,N,B){var ae=(N||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"

    ".concat(ie,"

    "):'
    ').concat(B?ie:Object(s.escape)(ie,!0),`
    `):'
    '+(B?ie:Object(s.escape)(ie,!0))+"
    "},n.heading=function(ie,N,B){var ae=this.options.headerPrefix+B.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return r.push({anchor:ae,level:N,text:ie}),"'+ie+""},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:g,renderer:n});var te=l.a,H=F("SJMd"),G=F("ulZh"),V=F.n(G),re=F("m3rI"),$=F("Oy/b"),ne=F("p5ED"),he=F("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var pe=function(ie,N){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,ae){B.__proto__=ae}||function(B,ae){for(var fe in ae)Object.prototype.hasOwnProperty.call(ae,fe)&&(B[fe]=ae[fe])})(ie,N)};function Te(ie,N){function B(){this.constructor=ie}pe(ie,N),ie.prototype=N===null?Object.create(N):(B.prototype=N.prototype,new B)}function we(ie,N,B,ae){return new(B||(B=Promise))(function(fe,se){function $e($t){try{Pt(ae.next($t))}catch(Ot){se(Ot)}}function St($t){try{Pt(ae.throw($t))}catch(Ot){se(Ot)}}function Pt($t){var Ot;$t.done?fe($t.value):(Ot=$t.value,Ot instanceof B?Ot:new B(function(zt){zt(Ot)})).then($e,St)}Pt((ae=ae.apply(ie,N||[])).next())})}function Me(ie,N){var B,ae,fe,se,$e={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return se={next:St(0),throw:St(1),return:St(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function St(Pt){return function($t){return function(Ot){if(B)throw new TypeError("Generator is already executing.");for(;$e;)try{if(B=1,ae&&(fe=2&Ot[0]?ae.return:Ot[0]?ae.throw||((fe=ae.return)&&fe.call(ae),0):ae.next)&&!(fe=fe.call(ae,Ot[1])).done)return fe;switch(ae=0,fe&&(Ot=[2&Ot[0],fe.value]),Ot[0]){case 0:case 1:fe=Ot;break;case 4:return $e.label++,{value:Ot[1],done:!1};case 5:$e.label++,ae=Ot[1],Ot=[0];continue;case 7:Ot=$e.ops.pop(),$e.trys.pop();continue;default:if(!(fe=$e.trys,(fe=fe.length>0&&fe[fe.length-1])||Ot[0]!==6&&Ot[0]!==2)){$e=0;continue}if(Ot[0]===3&&(!fe||Ot[1]>fe[0]&&Ot[1]',"select"),this.addActionButton(ae,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ae,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ae,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ae,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ae,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ae,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ae,'',"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(se){var $e=document.createElement("div");$e.className=""+B.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",se.typeName),$e.innerHTML=se.icon,$e.addEventListener("click",function(){B.markerToolbarButtonClicked($e,se)}),B.buttons.push($e),B.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var fe=document.createElement("div");fe.className=this.toolbarBlockStyleClass.name,fe.style.whiteSpace="nowrap",fe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(fe),this.addActionButton(fe,'',"render"),this.addActionButton(fe,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ie.prototype.addButtonClickListener=function(N){this.buttonClickListeners.push(N)},ie.prototype.removeButtonClickListener=function(N){this.buttonClickListeners.indexOf(N)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(N),1)},ie.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ie.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var N=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var B=0;B0&&this.buttonClickListeners.forEach(function(ae){return ae("marker",B)}),this.markerButtonOverflowBlock.style.display="none"},ie.prototype.actionToolbarButtonClicked=function(N,B){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ae){return ae("action",B)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ie.prototype.setActiveButton=function(N){this.resetButtonStyles(),N.className=N.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),N.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ie.prototype.setActiveMarkerButton=function(N){var B=this.markerButtons.find(function(ae){return ae.getAttribute("data-type-name")===N});B&&this.setActiveButton(B)},ie.prototype.setCurrentMarker=function(N){var B=this;this.currentMarker=N,this.buttons.filter(function(ae){return/delete|notes/.test(ae.getAttribute("data-action"))}).forEach(function(ae){B.currentMarker===void 0?(ae.style.fillOpacity="0.4",ae.style.pointerEvents="none"):(ae.style.fillOpacity="1",ae.style.pointerEvents="all")})},ie}(),Ie=function(){function ie(N,B,ae,fe){this.panels=[],this.panelButtons=[],this.markerjsContainer=N,this.displayMode=B,this.uiStyleSettings=ae,this.styles=fe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ie.prototype.addStyles=function(){var N;this.toolboxStyleClass=this.styles.addClass(new le("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 le("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var B=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new le("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new le("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new le("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 le("toolbox-panel-row_colors",` background-color: `+((N=this.uiStyleSettings.toolboxBackgroundColor)!==null&&N!==void 0?N:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new le("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px; padding: `+B+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new le("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new de("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new de("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},ie.prototype.show=function(N){var B;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolboxStyleClass.name+" "+((B=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ie.prototype.setPanelButtons=function(N){var B,ae,fe=this;this.panels=N,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((B=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ae=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ae!==void 0?ae:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var $e;se.uiStyleSettings=fe.uiStyleSettings;var St=document.createElement("div");St.className=fe.toolboxButtonStyleClass.name+" "+(($e=fe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:fe.toolboxButtonStyleColorsClass.name),St.innerHTML=se.icon,St.title=se.title,St.addEventListener("click",function(){fe.panelButtonClick(se)}),fe.panelButtons.push(St),fe.buttonRow.appendChild(St)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ie.prototype.panelButtonClick=function(N){var B=this,ae=-1;if(N!==this.activePanel){ae=this.panels.indexOf(N),this.panelRow.innerHTML="";var fe=N.getUi();fe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(fe),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=N}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){B.displayMode==="inline"?B.panelRow.style.display="none":B.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,$e){var St,Pt;se.className=B.toolboxButtonStyleClass.name+" "+($e===ae?""+((St=B.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&St!==void 0?St:B.toolboxActiveButtonStyleColorsClass.name):""+((Pt=B.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pt!==void 0?Pt:B.toolboxButtonStyleColorsClass.name))})},ie}(),qe=function(ie,N){this.title=ie,this.icon=N},ee=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=ae,$e.currentColor=fe,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.whiteSpace="nowrap",this.colors.forEach(function(fe){var se=B.getColorBox(fe);ae.appendChild(se),B.colorBoxes.push(se)}),ae},N.prototype.getColorBox=function(B){var ae=this,fe=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-fe,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=se-2+"px",$e.style.height=se-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(se+2)/2+"px",$e.style.borderColor=B===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){ae.setCurrentColor(B,$e)});var St=document.createElement("div");return St.style.display="inline-block",St.style.width=se-2+"px",St.style.height=se-2+"px",St.style.backgroundColor=B,St.style.borderRadius=se/2+"px",B==="transparent"&&(St.style.fill=this.uiStyleSettings.toolboxAccentColor,St.innerHTML=` `),$e.appendChild(St),$e},N.prototype.setCurrentColor=function(B,ae){var fe=this;this.currentColor=B,this.colorBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(B)},N}(qe),k=function(){function ie(N,B,ae){this._state="new",this._isSelected=!1,this._container=N,this._overlayContainer=B,this.globalSettings=ae,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ie.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ie.prototype.ownsTarget=function(N){return!1},Object.defineProperty(ie.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ie.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ie.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ie.prototype.pointerDown=function(N,B){},ie.prototype.dblClick=function(N,B){},ie.prototype.manipulate=function(N){},ie.prototype.pointerUp=function(N){this.stateChanged()},ie.prototype.dispose=function(){},ie.prototype.addMarkerVisualToContainer=function(N){this.container.childNodes.length>0?this.container.insertBefore(N,this.container.childNodes[0]):this.container.appendChild(N)},ie.prototype.getState=function(){return{typeName:ie.typeName,state:this.state,notes:this.notes}},ie.prototype.restoreState=function(N){this._state=N.state,this.notes=N.notes},ie.prototype.scale=function(N,B){},ie.prototype.colorChanged=function(N){this.onColorChanged&&this.onColorChanged(N),this.stateChanged()},ie.prototype.fillColorChanged=function(N){this.onFillColorChanged&&this.onFillColorChanged(N),this.stateChanged()},ie.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var N=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),N.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(N)&&this.onStateChanged(this)}},ie.typeName="MarkerBase",ie}(),U=function(){function ie(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ie.prototype.findGripByVisual=function(N){return this.topLeft.ownsTarget(N)?this.topLeft:this.topCenter.ownsTarget(N)?this.topCenter:this.topRight.ownsTarget(N)?this.topRight:this.centerLeft.ownsTarget(N)?this.centerLeft:this.centerRight.ownsTarget(N)?this.centerRight:this.bottomLeft.ownsTarget(N)?this.bottomLeft:this.bottomCenter.ownsTarget(N)?this.bottomCenter:this.bottomRight.ownsTarget(N)?this.bottomRight:void 0},ie}(),q=function(){function ie(){this.GRIP_SIZE=10,this.visual=xe.createGroup(),this.visual.appendChild(xe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(xe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie}(),Y=function(){function ie(){}return ie.toITransformMatrix=function(N){return{a:N.a,b:N.b,c:N.c,d:N.d,e:N.e,f:N.f}},ie.toSVGMatrix=function(N,B){return N.a=B.a,N.b=B.b,N.c=B.c,N.d=B.d,N.e=B.e,N.f=B.f,N},ie}(),J=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(xe.createTransform()),se.setupControlBox(),se}return Te(N,ie),Object.defineProperty(N.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"visual",{get:function(){return this._visual},set:function(B){this._visual=B;var ae=xe.createTransform();this._visual.transform.baseVal.appendItem(ae)},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(B){return!!ie.prototype.ownsTarget.call(this,B)||!!(this.controlGrips.findGripByVisual(B)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B))},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.left=B.x,this.top=B.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var fe=this.unrotatePoint(B);if(this.manipulationStartX=fe.x,this.manipulationStartY=fe.y,this.offsetX=fe.x-this.left,this.offsetY=fe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ae),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ae)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},N.prototype.pointerUp=function(B){var ae=this.state;ie.prototype.pointerUp.call(this,B),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(B),this._state="select",ae==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},N.prototype.moveVisual=function(B){this.visual.style.transform="translate("+B.x+"px, "+B.y+"px)"},N.prototype.manipulate=function(B){var ae=this.unrotatePoint(B);this.state==="creating"?this.resize(B):this.state==="move"?(this.left=this.manipulationStartLeft+(ae.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ae.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ae):this.state==="rotate"&&this.rotate(B)},N.prototype.resize=function(B){var ae=this.manipulationStartLeft,fe=this.manipulationStartWidth,se=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ae=this.manipulationStartLeft+B.x-this.manipulationStartX,fe=this.manipulationStartWidth+this.manipulationStartLeft-ae;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:fe=this.manipulationStartWidth+B.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+B.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+B.y-this.manipulationStartY}fe>=0?(this.left=ae,this.width=fe):(this.left=ae+fe,this.width=-fe),$e>=0?(this.top=se,this.height=$e):(this.top=se+$e,this.height=-$e),this.setSize()},N.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},N.prototype.rotate=function(B){if(Math.abs(B.x-this.centerX)>.1){var ae=Math.sign(B.x-this.centerX);this.rotationAngle=180*Math.atan((B.y-this.centerY)/(B.x-this.centerX))/Math.PI+90*ae,this.applyRotation()}},N.prototype.applyRotation=function(){var B=this.container.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(B,0)},N.prototype.rotatePoint=function(B){if(this.rotationAngle===0)return B;var ae=this.container.getCTM(),fe=xe.createPoint(B.x,B.y);return{x:(fe=fe.matrixTransform(ae)).x,y:fe.y}},N.prototype.unrotatePoint=function(B){if(this.rotationAngle===0)return B;var ae=this.container.getCTM();ae=ae.inverse();var fe=xe.createPoint(B.x,B.y);return{x:(fe=fe.matrixTransform(ae)).x,y:fe.y}},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=xe.createGroup();var B=xe.createTransform();B.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(B),this.container.appendChild(this.controlBox),this.controlRect=xe.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=xe.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 U,this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){var B=this.controlBox.transform.baseVal.getItem(0);B.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(B,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()},N.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()},N.prototype.createGrip=function(){var B=new q;return B.visual.transform.baseVal.appendItem(xe.createTransform()),this.controlBox.appendChild(B.visual),B},N.prototype.positionGrips=function(){var B=this.controlGrips.topLeft.GRIP_SIZE,ae=-B/2,fe=ae,se=(this.width+this.CB_DISTANCE)/2-B/2,$e=(this.height+this.CB_DISTANCE)/2-B/2,St=this.height+this.CB_DISTANCE-B/2,Pt=this.width+this.CB_DISTANCE-B/2;this.positionGrip(this.controlGrips.topLeft.visual,ae,fe),this.positionGrip(this.controlGrips.topCenter.visual,se,fe),this.positionGrip(this.controlGrips.topRight.visual,Pt,fe),this.positionGrip(this.controlGrips.centerLeft.visual,ae,$e),this.positionGrip(this.controlGrips.centerRight.visual,Pt,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,ae,St),this.positionGrip(this.controlGrips.bottomCenter.visual,se,St),this.positionGrip(this.controlGrips.bottomRight.visual,Pt,St),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,fe-3*this.CB_DISTANCE)},N.prototype.positionGrip=function(B,ae,fe){var se=B.transform.baseVal.getItem(0);se.setTranslate(ae,fe),B.transform.baseVal.replaceItem(se,0)},N.prototype.hideControlBox=function(){this.controlBox.style.display="none"},N.prototype.showControlBox=function(){this.controlBox.style.display=""},N.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Y.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Y.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ie.prototype.getState.call(this))},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.left=ae.left,this.top=ae.top,this.width=ae.width,this.height=ae.height,this.rotationAngle=ae.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ae.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Y.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ae.containerTransformMatrix))},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae);var fe=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:fe.x*B,y:fe.y*ae});this.left=se.x,this.top=se.y,this.width=this.width*B,this.height=this.height*ae,this.adjustControlBox()},N}(k),be=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual)},N.prototype.createVisual=function(){this.visual=xe.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)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.manipulate=function(B){ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),this.setSize()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(B){ie.prototype.pointerUp.call(this,B),this.setSize()},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&xe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},N.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&xe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&xe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&xe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this))},N.prototype.restoreState=function(B){var ae=B;this.fillColor=ae.fillColor,this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.opacity=ae.opacity,this.createVisual(),ie.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setSize()},N.title="Rectangle marker",N}(J),ke=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=ae,$e.currentWidth=fe,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.widths.forEach(function(fe){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=fe===B.currentWidth?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentWidth(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=fe.toString(),$e.style.marginRight="5px",se.appendChild($e);var St=document.createElement("div");St.style.minHeight="20px",St.style.flexGrow="2",St.style.display="flex",St.style.alignItems="center";var Pt=document.createElement("hr");Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop=fe+"px solid "+B.uiStyleSettings.toolboxColor,Pt.style.flexGrow="2",St.appendChild(Pt),se.appendChild(St),B.widthBoxes.push(se)}),ae},N.prototype.setCurrentWidth=function(B,ae){var fe=this;this.currentWidth=B,this.widthBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},N}(qe),ct=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=ae,$e.currentStyle=fe,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",this.styles.forEach(function(fe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/B.styles.length-5+"%",se.style.borderColor=fe===B.currentStyle?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentStyle(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var St=` `;$e.innerHTML=St,se.appendChild($e),B.styleBoxes.push(se)}),ae},N.prototype.setCurrentStyle=function(B,ae){var fe=this;this.currentStyle=B,this.styleBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},N}(qe),He=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.strokePanel=new ee("Line color",fe.defaultColorSet,fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="FrameMarker",N.title="Frame marker",N.icon='',N}(be),Be=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},Ze=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!!ie.prototype.ownsTarget.call(this,B)||!(!this.grip1.ownsTarget(B)&&!this.grip2.ownsTarget(B))},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.manipulationStartX=B.x,this.manipulationStartY=B.y,this.state==="new"&&(this.x1=B.x,this.y1=B.y,this.x2=B.x,this.y2=B.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(ae)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ae)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},N.prototype.pointerUp=function(B){var ae=this.state;ie.prototype.pointerUp.call(this,B),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(B),this._state="select",ae==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},N.prototype.adjustVisual=function(){},N.prototype.manipulate=function(B){this.state==="creating"?this.resize(B):this.state==="move"?(this.x1=this.manipulationStartX1+B.x-this.manipulationStartX,this.y1=this.manipulationStartY1+B.y-this.manipulationStartY,this.x2=this.manipulationStartX2+B.x-this.manipulationStartX,this.y2=this.manipulationStartY2+B.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(B)},N.prototype.resize=function(B){switch(this.activeGrip){case this.grip1:this.x1=B.x,this.y1=B.y;break;case this.grip2:case void 0:this.x2=B.x,this.y2=B.y}this.adjustVisual(),this.adjustControlBox()},N.prototype.select=function(){ie.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ie.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=xe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){this.positionGrips()},N.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},N.prototype.createGrip=function(){var B=new q;return B.visual.transform.baseVal.appendItem(xe.createTransform()),this.controlBox.appendChild(B.visual),B},N.prototype.positionGrips=function(){var B=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-B/2,this.y1-B/2),this.positionGrip(this.grip2.visual,this.x2-B/2,this.y2-B/2)},N.prototype.positionGrip=function(B,ae,fe){var se=B.transform.baseVal.getItem(0);se.setTranslate(ae,fe),B.transform.baseVal.replaceItem(se,0)},N.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ie.prototype.getState.call(this))},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.x1=ae.x1,this.y1=ae.y1,this.x2=ae.x2,this.y2=ae.y2},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.x1=this.x1*B,this.y1=this.y1*ae,this.x2=this.x2*B,this.y2=this.y2*ae,this.adjustVisual(),this.adjustControlBox()},N}(k),ht=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.strokePanel=new ee("Line color",fe.defaultColorSet,fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorLine&&B!==this.visibleLine)},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.selectorLine=xe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=xe.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)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},N.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()),xe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),xe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),xe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.createVisual(),this.adjustVisual()},N.typeName="LineMarker",N.title="Line marker",N.icon='',N}(Ze),Qe=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=ae,$e.currentFont=fe,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.overflow="hidden",ae.style.flexGrow="2",this.fonts.forEach(function(fe){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/B.fonts.length-5+"%",se.style.borderColor=fe===B.currentFont?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentFont(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=fe,$e.style.overflow="hidden";var St=document.createElement("div");St.style.whiteSpace="nowrap",St.style.overflow="hidden",St.style.textOverflow="ellipsis",St.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(St),se.appendChild($e),B.fontBoxes.push(se)}),ae},N.prototype.setCurrentFont=function(B,ae){var fe=this;this.currentFont=B,this.fontBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},N}(qe),Xe=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=fe.defaultColor,se.fontFamily=fe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new ee("Color",fe.defaultColorSet,fe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new Qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Te(N,ie),N.prototype.ownsTarget=function(B){if(ie.prototype.ownsTarget.call(this,B)||B===this.visual||B===this.textElement||B===this.bgRectangle)return!0;var ae=!1;return this.textElement.childNodes.forEach(function(fe){fe===B&&(ae=!0)}),ae},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.bgRectangle=xe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=xe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(xe.createTransform()),this.textElement.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.isMoved=!1,this.pointerDownPoint=B,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.renderText=function(){var B=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(ae){B.textElement.appendChild(xe.createTSpan(ae.trim()===""?" ":ae.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},N.prototype.getTextScale=function(){var B=this.textElement.getBBox(),ae=1;if(B.width>0&&B.height>0){var fe=(1*this.width-this.width*this.padding*2/100)/B.width,se=(1*this.height-this.height*this.padding*2/100)/B.height;ae=Math.min(fe,se)}return ae},N.prototype.getTextPosition=function(B){var ae=this.textElement.getBBox(),fe=0,se=0;return ae.width>0&&ae.height>0&&(fe=(this.width-ae.width*B)/2,se=this.height/2-ae.height*B/2),{x:fe,y:se}},N.prototype.sizeText=function(){var B=this.textElement.getBBox(),ae=this.getTextScale(),fe=this.getTextPosition(ae);fe.y-=B.y*ae,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+fe.x+"px, "+fe.y+"px) scale("+ae+", "+ae+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(fe.x,fe.y),this.textElement.transform.baseVal.getItem(1).setScale(ae,ae))},N.prototype.manipulate=function(B){ie.prototype.manipulate.call(this,B),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(B.x-this.pointerDownPoint.x)>5||Math.abs(B.y-this.pointerDownPoint.y)>5)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),this.isMoved=!0,this.setSize(),this.sizeText()},N.prototype.setSize=function(){ie.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},N.prototype.pointerUp=function(B){var ae=this.state;ae==="creating"&&(this._suppressMarkerCreateEvent=!0),ie.prototype.pointerUp.call(this,B),this.setSize(),(ae==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},N.prototype.showTextEditor=function(){var B=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(ae){ae.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ae=Number.parseFloat(B.textEditor.style.fontSize);B.textEditor.clientWidth>=Number.parseInt(B.textEditor.style.maxWidth)&&ae>.9;)ae-=.1,B.textEditor.style.fontSize=Math.max(ae,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ae){ae.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ae){if(ae.clipboardData){var fe=ae.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(fe)),ae.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){B.textEditDivClicked(B.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},N.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var B=this.getTextScale(),ae=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),fe=this.textElement.getBBox(),se={x:fe.width*B,y:fe.height*B};ae.x-=se.x/2,ae.y-=se.y/2,this.textEditor.style.top=ae.y+"px",this.textEditor.style.left=ae.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ae.x+"px",this.textEditor.style.fontSize=Math.max(16*B,12)+"px",this.textElement.style.display="none"}},N.prototype.textEditDivClicked=function(B){this.text=B.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},N.prototype.select=function(){ie.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},N.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ie.prototype.deselect.call(this)},N.prototype.dblClick=function(B,ae){ie.prototype.dblClick.call(this,B,ae),this.showTextEditor()},N.prototype.setColor=function(B){this.textElement&&xe.setAttributes(this.textElement,[["fill",B]]),this.color=B,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(B)},N.prototype.setFont=function(B){this.textElement&&xe.setAttributes(this.textElement,[["font-family",B]]),this.fontFamily=B,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},N.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},N.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var ae=B;this.color=ae.color,this.fontFamily=ae.fontFamily,this.padding=ae.padding,this.text=ae.text,this.createVisual(),ie.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setSize(),this.sizeText(),this.positionTextEditor()},N.typeName="TextMarker",N.title="Text marker",N.icon='',N}(J),Ke=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=fe.defaultColor,se.lineWidth=fe.defaultStrokeWidth,se.pixelRatio=fe.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new ee("Color",fe.defaultColorSet,fe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.drawingImage)},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.drawingImage=xe.createImage(),this.visual.appendChild(this.drawingImage);var B=xe.createTransform();this.visual.transform.baseVal.appendItem(B),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,ae){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(B.x,B.y),this.drawing=!0):ie.prototype.pointerDown.call(this,B,ae)},N.prototype.manipulate=function(B){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(B.x,B.y),this.canvasContext.stroke()):ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ie.prototype.resize.call(this,B),xe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(B){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ie.prototype.pointerUp.call(this,B)},N.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)},N.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.select.call(this)},N.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ie.prototype.deselect.call(this)},N.prototype.finishCreation=function(){for(var B=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ae=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],fe=ae[0],se=ae[1],$e=ae[2],St=ae[3],Pt=!1,$t=0;$t0&&(Pt=!0,$tSt&&(St=$t),Ot>$e&&($e=Ot));if(Pt){this.left=fe/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-fe)/this.pixelRatio,this.height=(St-se)/this.pixelRatio;var zt=document.createElement("canvas");zt.width=$e-fe,zt.height=St-se,zt.getContext("2d").putImageData(this.canvasContext.getImageData(fe,se,$e-fe,St-se),0,0),this.drawingImgUrl=zt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},N.prototype.setDrawingImage=function(){xe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),xe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},N.prototype.setColor=function(B){this.color=B,this.colorChanged(B)},N.prototype.setLineWidth=function(B){this.lineWidth=B},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({drawingImgUrl:this.drawingImgUrl},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){this.createVisual(),ie.prototype.restoreState.call(this,B),this.drawingImgUrl=B.drawingImgUrl,this.setDrawingImage()},N.prototype.scale=function(B,ae){ie.prototype.scale.call(this,B,ae),this.setDrawingImage()},N.typeName="FreehandMarker",N.title="Freehand marker",N.icon='',N}(J),Fe=function(ie){function N(B,ae,fe){var se=ie.call(this,B,fe||'')||this;return se.typeBoxes=[],se.currentType=ae,se.setCurrentType=se.setCurrentType.bind(se),se}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2";for(var fe=function(St){var Pt="both";switch(St){case 0:Pt="both";break;case 1:Pt="start";break;case 2:Pt="end";break;case 3:Pt="none"}var $t=document.createElement("div");if($t.style.display="flex",$t.style.flexGrow="2",$t.style.alignItems="center",$t.style.justifyContent="space-between",$t.style.padding="5px",$t.style.borderWidth="2px",$t.style.borderStyle="solid",$t.style.borderColor=Pt===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",$t.addEventListener("click",function(){B.setCurrentType(Pt,$t)}),ae.appendChild($t),Pt==="both"||Pt==="start"){var Ot=document.createElement("div");Ot.style.display="flex",Ot.style.alignItems="center",Ot.style.minHeight="20px",Ot.innerHTML=` `,Ot.style.marginLeft="5px",$t.appendChild(Ot)}var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.style.flexGrow="2";var an=document.createElement("hr");if(an.style.minWidth="20px",an.style.border="0px",an.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),an.style.flexGrow="2",zt.appendChild(an),$t.appendChild(zt),Pt==="both"||Pt==="end"){var jn=document.createElement("div");jn.style.display="flex",jn.style.alignItems="center",jn.style.minHeight="20px",jn.innerHTML=` `,jn.style.marginRight="5px",$t.appendChild(jn)}se.typeBoxes.push($t)},se=this,$e=0;$e<4;$e++)fe($e);return ae},N.prototype.setCurrentType=function(B,ae){var fe=this;this.currentType=B,this.typeBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings!==void 0?fe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},N}(qe),Ue=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Fe("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.arrow1&&B!==this.arrow2)},N.prototype.getArrowPoints=function(B,ae){var fe=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return B-fe/2+","+(ae+se/2)+" "+B+","+(ae-se/2)+" "+(B+fe/2)+","+(ae+se/2)},N.prototype.createTips=function(){this.arrow1=xe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=xe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.arrow2)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ie.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",xe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),xe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.arrow1.transform.baseVal.getItem(0);ae.setRotate(B,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ae,0);var fe=this.arrow2.transform.baseVal.getItem(0);fe.setRotate(B+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(fe,0)}},N.prototype.setArrowType=function(B){this.arrowType=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({arrowType:this.arrowType},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.arrowType=ae.arrowType,this.createTips(),this.adjustVisual()},N.typeName="ArrowMarker",N.title="Arrow marker",N.icon='',N}(ht),_e=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.fillColor=fe.defaultFillColor,se.strokeWidth=0,se.fillPanel=new ee("Color",fe.defaultColorSet,fe.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Te(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="CoverMarker",N.title="Cover marker",N.icon='',N}(be),Ce=function(ie){function N(B,ae,fe,se){var $e=ie.call(this,B,se||'')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=ae,$e.currentOpacity=fe,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return Te(N,ie),N.prototype.getUi=function(){var B=this,ae=document.createElement("div");return ae.style.display="flex",ae.style.overflow="hidden",ae.style.flexGrow="2",ae.style.justifyContent="space-between",this.opacities.forEach(function(fe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=fe===B.currentOpacity?B.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){B.setCurrentOpacity(fe,se)}),ae.appendChild(se);var $e=document.createElement("div");$e.innerText=100*fe+"%",se.appendChild($e),B.opacityBoxes.push(se)}),ae},N.prototype.setCurrentOpacity=function(B,ae){var fe=this;this.currentOpacity=B,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===ae?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},N}(qe),Ne=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=fe.defaultHighlightColor,se.strokeWidth=0,se.opacity=fe.defaultHighlightOpacity,se.fillPanel=new ee("Color",fe.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ce("Opacity",fe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Te(N,ie),N.prototype.setOpacity=function(B){this.opacity=B,this.visual&&xe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="HighlightMarker",N.title="Highlight marker",N.icon='',N}(_e),De='',rt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=fe.defaultStrokeColor,se.bgColor=fe.defaultFillColor,se.fontFamily=fe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new ee("Text color",fe.defaultColorSet,se.color,''),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new ee("Fill color",fe.defaultColorSet,se.bgColor,De),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new Qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new q,se.tipGrip.visual.transform.baseVal.appendItem(xe.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Te(N,ie),N.prototype.ownsTarget=function(B){return ie.prototype.ownsTarget.call(this,B)||this.tipGrip.ownsTarget(B)||this.tip===B},N.prototype.createTip=function(){xe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=xe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},N.prototype.pointerDown=function(B,ae){this.state==="new"&&ie.prototype.pointerDown.call(this,B,ae),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ae)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ie.prototype.pointerDown.call(this,B,ae)},N.prototype.pointerUp=function(B){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ie.prototype.pointerUp.call(this,B);else{var ae=this.state==="creating";ie.prototype.pointerUp.call(this,B),this.setTipPoints(ae),this.positionTip()}},N.prototype.manipulate=function(B){if(this.tipMoving){var ae=this.unrotatePoint(B);this.tipPosition={x:ae.x-this.manipulationStartLeft,y:ae.y-this.manipulationStartTop},this.positionTip()}else ie.prototype.manipulate.call(this,B)},N.prototype.setBgColor=function(B){this.bgRectangle&&this.tip&&(xe.setAttributes(this.bgRectangle,[["fill",B]]),xe.setAttributes(this.tip,[["fill",B]])),this.bgColor=B,this.fillColorChanged(B)},N.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},N.prototype.setTipPoints=function(B){B===void 0&&(B=!1);var ae=Math.min(this.height/2,15),fe=this.height/5;B&&(this.tipPosition={x:ae+fe/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?se.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ae=this.tip1.transform.baseVal.getItem(0);ae.setRotate(B,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ae,0);var fe=this.tip2.transform.baseVal.getItem(0);fe.setRotate(B+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(fe,0)}},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B),this.createTips(),this.adjustVisual()},N.typeName="MeasurementMarker",N.title="Measurement marker",N.icon='',N}(ht),Mt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokePanel.colors=fe.defaultColorSet,se.fillColor="transparent",se}return Te(N,ie),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ie.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="EllipseFrameMarker",N.title="Ellipse frame marker",N.icon='',N}(tt),Bt=function(){function ie(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ie.prototype.addUndoStep=function(N){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(N)||(this.undoStack.push(N),JSON.stringify(this.lastRedoStep)!==JSON.stringify(N)&&this.redoStack.splice(0,this.redoStack.length))},ie.prototype.replaceLastUndoStep=function(N){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=N)},ie.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ie.prototype.undo=function(){if(this.undoStack.length>1){var N=this.undoStack.pop();return N!==void 0&&this.redoStack.push(N),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ie.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ie}(),It=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae,fe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.strokePanel=new ee("Line color",fe.defaultColorSet,fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new ct("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(N,ie),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorCurve&&B!==this.visibleCurve&&!this.curveGrip.ownsTarget(B))},N.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},N.prototype.createVisual=function(){this.visual=xe.createGroup(),this.selectorCurve=xe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=xe.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)},N.prototype.pointerDown=function(B,ae){ie.prototype.pointerDown.call(this,B,ae),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=B.x,this.curveY=B.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ae)&&(this.activeGrip=this.curveGrip,this._state="resize")},N.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),xe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),xe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),xe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ie.prototype.setupControlBox.call(this),this.curveControlLine1=xe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=xe.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)},N.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ie.prototype.addControlGrips.call(this)},N.prototype.positionGrips=function(){ie.prototype.positionGrips.call(this);var B=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-B/2,this.curveY-B/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()))},N.prototype.manipulate=function(B){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+B.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+B.y-this.manipulationStartY),ie.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){this.activeGrip===this.curveGrip&&(this.curveX=B.x,this.curveY=B.y),ie.prototype.resize.call(this,B),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual()},N.prototype.scale=function(B,ae){this.curveX=this.curveX*B,this.curveY=this.curveY*ae,ie.prototype.scale.call(this,B,ae)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ie.prototype.restoreState.call(this,B);var ae=B;this.strokeColor=ae.strokeColor,this.strokeWidth=ae.strokeWidth,this.strokeDasharray=ae.strokeDasharray,this.curveX=ae.curveX,this.curveY=ae.curveY,this.createVisual(),this.adjustVisual()},N.typeName="CurveMarker",N.title="Curve marker",N.icon='',N}(Ze),Dt=function(){function ie(N,B){B===void 0&&(B=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=N,this.cancelable=B}return Object.defineProperty(ie.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ie.prototype.preventDefault=function(){this._defaultPrevented=!0},ie}(),lt=function(ie){function N(B,ae,fe){var se=ie.call(this,B,!1)||this;return se.dataUrl=ae,se.state=fe,se}return Te(N,ie),N}(Dt),pt=function(ie){function N(B,ae,fe){fe===void 0&&(fe=!1);var se=ie.call(this,B,fe)||this;return se.marker=ae,se}return Te(N,ie),N}(Dt),ut=function(){function ie(){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 ie.prototype.addEventListener=function(N,B){this[N].push(B)},ie.prototype.removeEventListener=function(N,B){var ae=this[N].indexOf(B);ae>-1&&this[N].splice(ae,1)},ie}(),Pe=function(){function ie(N){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new Bt,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 ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ie.instanceCounter++,this.styles=new ze(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=N,this.targetRoot=document.body,this.width=N.clientWidth,this.height=N.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(ie.prototype,"ALL_MARKER_TYPES",{get:function(){return[He,Ke,Ue,Xe,Mt,tt,Ne,rt,xt,_e,ht,It]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[He,Ke,Ue,Xe,tt,Ne,rt]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"BASIC_MARKER_TYPES",{get:function(){return[He,Ke,Ue,Xe,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(N){var B=this;this._availableMarkerTypes.splice(0),N.forEach(function(ae){if(typeof ae=="string"){var fe=B.ALL_MARKER_TYPES.find(function(se){return se.typeName===ae});fe!==void 0&&B._availableMarkerTypes.push(fe)}else B._availableMarkerTypes.push(ae)})},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(N){this._zoomLevel=N,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(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ie.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ge.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ie.prototype.show=function(){var N=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(B){return B(new Dt(N))})},ie.prototype.render=function(){return we(this,void 0,void 0,function(){var N;return Me(this,function(B){switch(B.label){case 0:return this.setCurrentMarker(),(N=new je).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.markersOnly=this.renderMarkersOnly,N.width=this.renderWidth,N.height=this.renderHeight,[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return B.sent(),[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,B.sent()]}})})},ie.prototype.close=function(N){var B=this;if(N===void 0&&(N=!1),this.isOpen){var ae=!1;N||this.eventListeners.beforeclose.forEach(function(fe){var se=new Dt(B,!0);fe(se),se.defaultPrevented&&(ae=!0)}),ae||(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(fe){return fe(new Dt(B))}),this.detachEvents(),this._isOpen=!1)}},ie.prototype.addMarkersToToolbar=function(){for(var N,B=[],ae=0;aethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*N:this.editorCanvas.clientWidth,ae=B',N.title="Powered by marker.js",N.style.display="grid",N.style.alignItems="center",N.style.justifyItems="center",N.style.padding="3px",N.style.width="20px",N.style.height="20px",this.logoUI.appendChild(N),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ie.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")},ie.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"},ie.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ie.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 N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"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 Oe(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-1&&this.markers.splice(this.markers.indexOf(N),1),N.dispose()},ie.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())},ie.prototype.toolbarButtonClicked=function(N,B){if(N==="marker"&&B!==void 0)this.createNewMarker(B);else if(N==="action")switch(B){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()}},ie.prototype.deleteSelectedMarker=function(){var N=this;if(this._currentMarker!==void 0){var B=!1;if(this.eventListeners.markerbeforedelete.forEach(function(fe){var se=new pt(N,N._currentMarker,!0);fe(se),se.defaultPrevented&&(B=!0)}),!B){var ae=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(fe){return fe(new pt(N,ae))})}}},ie.prototype.clear=function(){var N=this,B=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var St=new pt(N,void 0,!0);$e(St),St.defaultPrevented&&(B=!0)}),!B)){this.setCurrentMarker();for(var ae=function($e){var St=fe.markers[$e];fe.setCurrentMarker(fe.markers[$e]),fe._currentMarker.dispose(),fe.markerImage.removeChild(fe._currentMarker.container),fe.markers.splice(fe.markers.indexOf(fe._currentMarker),1),fe.eventListeners.markerdelete.forEach(function(Pt){return Pt(new pt(N,St))})},fe=this,se=this.markers.length-1;se>=0;se--)ae(se);this.addUndoStep()}},Object.defineProperty(ie.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ie.prototype.showNotesEditor=function(){var N;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=(N=this._currentMarker.notes)!==null&&N!==void 0?N:"",this.overlayContainer.appendChild(this.notesArea))},ie.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)},ie.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ie.prototype.addUndoStep=function(){var N=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var B=this.getState(),ae=this.undoRedoManager.getLastUndoStep();if(!ae||ae.width===B.width&&ae.height===B.height){var fe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(B),fe1&&this.panTo({x:N.clientX,y:N.clientY}))},ie.prototype.onPointerUp=function(N){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(N.clientX,N.clientY)),this.isDragging=!1,this.addUndoStep()},ie.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ie.prototype.onKeyUp=function(N){this._currentMarker===void 0||this.notesArea!==void 0||N.key!=="Delete"&&N.key!=="Backspace"||this.deleteSelectedMarker()},ie.prototype.clientToLocalCoordinates=function(N,B){var ae=this.markerImage.getBoundingClientRect();return{x:(N-ae.left)/this.zoomLevel,y:(B-ae.top)/this.zoomLevel}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"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()},ie.prototype.addLicenseKey=function(N){Ge.addKey(N)},ie.prototype.addEventListener=function(N,B){this.eventListeners.addEventListener(N,B)},ie.prototype.removeEventListener=function(N,B){this.eventListeners.removeEventListener(N,B)},ie.prototype.renderState=function(N){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(N),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ie.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ie.prototype.focus=function(){var N=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(B){return B(new Dt(N))}))},ie.prototype.blur=function(){var N=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(B){return B(new Dt(N))}))},ie.instanceCounter=0,ie}();/* ********************************** 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 Ve=function(ie,N){return(Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,ae){B.__proto__=ae}||function(B,ae){for(var fe in ae)Object.prototype.hasOwnProperty.call(ae,fe)&&(B[fe]=ae[fe])})(ie,N)};function yt(ie,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function B(){this.constructor=ie}Ve(ie,N),ie.prototype=N===null?Object.create(N):(B.prototype=N.prototype,new B)}function st(ie,N,B,ae){return new(B||(B=Promise))(function(fe,se){function $e($t){try{Pt(ae.next($t))}catch(Ot){se(Ot)}}function St($t){try{Pt(ae.throw($t))}catch(Ot){se(Ot)}}function Pt($t){var Ot;$t.done?fe($t.value):(Ot=$t.value,Ot instanceof B?Ot:new B(function(zt){zt(Ot)})).then($e,St)}Pt((ae=ae.apply(ie,N||[])).next())})}function Nt(ie,N){var B,ae,fe,se,$e={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return se={next:St(0),throw:St(1),return:St(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function St(Pt){return function($t){return function(Ot){if(B)throw new TypeError("Generator is already executing.");for(;$e;)try{if(B=1,ae&&(fe=2&Ot[0]?ae.return:Ot[0]?ae.throw||((fe=ae.return)&&fe.call(ae),0):ae.next)&&!(fe=fe.call(ae,Ot[1])).done)return fe;switch(ae=0,fe&&(Ot=[2&Ot[0],fe.value]),Ot[0]){case 0:case 1:fe=Ot;break;case 4:return $e.label++,{value:Ot[1],done:!1};case 5:$e.label++,ae=Ot[1],Ot=[0];continue;case 7:Ot=$e.ops.pop(),$e.trys.pop();continue;default:if(!(fe=$e.trys,(fe=fe.length>0&&fe[fe.length-1])||Ot[0]!==6&&Ot[0]!==2)){$e=0;continue}if(Ot[0]===3&&(!fe||Ot[1]>fe[0]&&Ot[1]0&&B>0){var ae=new oe(N,B),fe=ae.ratio>=1?20:ae.getHorizontalLength(20),se=ae.ratio<1?20:ae.getVerticalLength(20),$e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("xmlns","http://www.w3.org/2000/svg"),$e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($e);var St=it.createDefs();$e.appendChild(St);var Pt=it.createElement("clipPath",[["id","text-bg-clip"]]);St.appendChild(Pt);var $t=it.createPath(it.getHollowRectanglePath((24-fe)/2,(24-se)/2,fe,se,(24-fe)/2+2,(24-se)/2+2,fe-4,se-4));$e.appendChild($t);var Ot=it.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ot.appendChild(it.createTSpan(N+":"+B)),$e.appendChild(Ot);var zt=Ot.getBBox();it.setAttributes(Ot,[["x",((24-zt.width)/2).toString()],["y",((24-zt.height)/2-zt.y).toString()]]);var an=it.createPath(it.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(zt.width))/2,(24-Math.ceil(zt.height))/2,Math.ceil(zt.width),Math.ceil(zt.height)));return Pt.appendChild(an),it.setAttributes($t,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($e),$e.outerHTML}return''},ie}(),Re=function(ie){function N(B,ae,fe){var se=ie.call(this,B,ae)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=fe,se}return yt(N,ie),N.prototype.setupDropdown=function(){var B=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=B.className,ae.colorsClassName=B.colorsClassName,B.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},N.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},N.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},N.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},N.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},N.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},N}(z),Je=function(){function ie(N,B){this.GRIP_SIZE=10,this.color=N,this.fillColor=B,this.visual=it.createGroup(),this.visual.appendChild(it.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(it.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ie.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ie.prototype.setCenter=function(N,B){this.visual.childNodes.forEach(function(ae){return it.setAttributes(ae,[["cx",N.toString()],["cy",B.toString()]])})},ie}(),at=function(){function ie(N,B,ae,fe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=N,this.canvasHeight=B,this.margin=ae,this.container=fe,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(ie.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(N){this._aspectRatio=N,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.gridContainer&&it.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(N){this._zoomFactor=N,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ie.prototype.open=function(){var N=this;this.cropShadeElement=it.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=it.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var B=0;Bthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-B.height/2),it.setAttributes(this.cropRectElement,[["x",B.x.toString()],["y",B.y.toString()],["width",B.width.toString()],["height",B.height.toString()]]);var ae=B.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var St=B.y+ae*($e+1);it.setAttributes(se,[["x1",""+B.x],["y1",""+St],["x2",""+(B.x+B.width)],["y2",""+St]])});var fe=B.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var St=B.x+fe*($e+1);it.setAttributes(se,[["x1",""+St],["y1",""+B.y],["x2",""+St],["y2",""+(B.y+B.height)]])}),it.setAttributes(this.cropShadeElement,[["d",it.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,B.x,B.y,B.width,B.height)]]),this.topLeftGrip.setCenter(B.x,B.y),this.topRightGrip.setCenter(B.x+B.width,B.y),this.bottomLeftGrip.setCenter(B.x,B.y+B.height),this.bottomRightGrip.setCenter(B.x+B.width,B.y+B.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ie.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)},ie.prototype.clientToLocalCoordinates=function(N,B){var ae=this.container.getBoundingClientRect();return{x:N-ae.left+this.margin,y:B-ae.top+this.margin}},ie.prototype.onPointerDown=function(N){this.container.setPointerCapture(N.pointerId),this.previousPoint=this.clientToLocalCoordinates(N.clientX,N.clientY),this.cropRectElement===N.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(N.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(N.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(N.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(N.target)&&(this.activeGrip=this.bottomRightGrip)},ie.prototype.onPointerMove=function(N){if(this.isMoving)this.move(this.clientToLocalCoordinates(N.clientX,N.clientY));else if(this.activeGrip){var B=this.clientToLocalCoordinates(N.clientX,N.clientY);this.resize(B)}N.preventDefault()},ie.prototype.onPointerUp=function(N){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(N.pointerId)},ie.prototype.move=function(N){var B=N.x-this.previousPoint.x,ae=N.y-this.previousPoint.y;this.zoomFactor!==1&&(B=-B/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+B),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=N},ie.prototype.resize=function(N){var B=Object.assign({},this.cropRect),ae=N.x-this.previousPoint.x,fe=N.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:B.x+aethis.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-B.width),B.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(B.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),B.height=this.aspectRatio.getVerticalLength(B.width)):(B.y+=fe,B.height=this.cropRect.y+this.cropRect.height-B.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?B.height=this.aspectRatio.getVerticalLength(B.width):B.height+=fe}B.width<10&&(B.x=this.cropRect.x,B.width=10),B.height<10&&(B.y=this.cropRect.y,B.height=10),this.previousPoint=N,B.x>=this.margin&&B.y>=this.margin&&B.x-this.margin+B.width<=this.canvasWidth&&B.y-this.margin+B.height<=this.canvasHeight&&(this.cropRect=B,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ie.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var N=this.cropRect.x+this.cropRect.width/2,B=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),fe=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidththis.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=N-this.cropRect.width/2,this.cropRect.y=B-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)}},ie.prototype.getRescaledRect=function(N,B,ae,fe,se,$e){var St=ae/N,Pt=fe/B;return{x:(se.x-$e)*St+$e,y:(se.y-$e)*Pt+$e,width:se.width*St,height:se.height*Pt}},ie.prototype.scaleCanvas=function(N,B){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,N,B,this.cropRect,this.margin);this.canvasWidth=N,this.canvasHeight=B,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ie}(),kt=function(){function ie(N){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=N,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(ie.prototype,"angle",{get:function(){return this._angle},set:function(N){this._angle=N,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ie.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},ie.prototype.onPointerDown=function(N){this.controlContainer.setPointerCapture(N.pointerId),this.isDragging=!0,this.previousPoint={x:N.clientX,y:N.clientY}},ie.prototype.onPointerMove=function(N){this.isDragging&&(this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.previousPoint.x=N.clientX)},ie.prototype.onPointerUp=function(N){this.isDragging&&this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(N.pointerId)},ie.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var N=this.angleLabelText.getBBox();it.setAttributes(this.angleLabelElement,[["x",((this.width-N.width)/2).toString()],["y",(this.height/2).toString()]])}},ie.prototype.positionScaleShape=function(){if(this.scaleShape){var N=this.scaleShape.transform.baseVal.getItem(0);N.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(N,0)}},ie.prototype.getVisual=function(){var N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("xmlns","http://www.w3.org/2000/svg"),N.setAttribute("width",this.width+"px"),N.setAttribute("height",this.height+"px"),N.setAttribute("viewBox","0 0 "+this.width+" "+this.height),N.style.flexShrink="0",document.body.appendChild(N);for(var B="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var fe=ae%5==0?this.height/3:this.height/6;B+="h4v"+-fe+"h1v"+fe}B+="v1H0Z",this.scaleShape=it.createPath(B);var se=it.createTransform();this.scaleShape.transform.baseVal.appendItem(se),N.appendChild(this.scaleShape),this.angleLabelElement=it.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=it.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $e=it.createTSpan("");return $e.innerHTML="°",this.angleLabelElement.appendChild($e),N.appendChild(this.angleLabelElement),document.body.removeChild(N),N},ie}(),jt=function(){function ie(){this.naturalSize=!1,this.imageType="image/png"}return ie.prototype.rasterize=function(N,B,ae,fe,se,$e,St){var Pt=this;return new Promise(function($t){var Ot=document.createElement("canvas");Ot.width=N.width.baseVal.value-2*fe,Ot.height=N.height.baseVal.value-2*fe;var zt=1,an=1;Pt.naturalSize===!0?(zt=B.naturalWidth/(N.width.baseVal.value-2*fe)/$e,an=B.naturalHeight/(N.height.baseVal.value-2*fe)/St,Ot.width=B.naturalWidth/$e,Ot.height=B.naturalHeight/St):Pt.width!==void 0&&Pt.height!==void 0&&(zt=Pt.width/ae.width,an=Pt.height/ae.height,Ot.width*=zt,Ot.height*=an);var jn=Ot.getContext("2d");jn.translate(Ot.width/2,Ot.height/2),jn.rotate(se*Math.PI/180),jn.scale($e,St),jn.translate(-Ot.width/2,-Ot.height/2),jn.drawImage(B,0,0,Ot.width,Ot.height);var Dr=document.createElement("canvas");Dr.width=ae.width*zt,Dr.height=ae.height*an,Dr.getContext("2d").putImageData(jn.getImageData((ae.x-fe)*zt,(ae.y-fe)*an,ae.width*zt,ae.height*an),0,0),$t(Dr.toDataURL(Pt.imageType,Pt.imageQuality))})},ie}(),ot=function(){function ie(N){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=ie.instanceCounter++,this.styles=new mt(this.instanceNo),this.target=N,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(ie.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(N){this._zoomToCropEnabled=N,N?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"gridLines",{get:function(){return this._gridLines},set:function(N){this._gridLines=N,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(N){this._rotationAngle=N,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"aspectRatio",{get:function(){var N;return(N=this._aspectRatio)!==null&&N!==void 0?N:this.aspectRatios[0]},set:function(N){this._aspectRatio=N},enumerable:!1,configurable:!0}),ie.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},ie.prototype.show=function(){this.showUI(),this.open()},ie.prototype.close=function(N){N===void 0&&(N=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),N||this.closeEventListeners.forEach(function(B){return B()}),this._isOpen=!1)},ie.prototype.addRenderEventListener=function(N){this.renderEventListeners.push(N)},ie.prototype.removeRenderEventListener=function(N){this.renderEventListeners.indexOf(N)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(N),1)},ie.prototype.addCloseEventListener=function(N){this.closeEventListeners.push(N)},ie.prototype.removeCloseEventListener=function(N){this.closeEventListeners.indexOf(N)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(N),1)},ie.prototype.setupResizeObserver=function(){var N=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.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))},ie.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var N=1*this.target.clientWidth/this.target.clientHeight,B=this.contentDiv.clientWidth/N>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*N:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=B+2*this.CANVAS_MARGINN+this.CANVAS_MARGIN?this.target.offsetTop-(N+this.CANVAS_MARGIN):0;this.coverDiv.style.top=B+"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},ie.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ie.prototype.addTopToolbar=function(){var N=this;this.topToolbar=new Xt,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 B=new ge;B.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(B);var ae=[];this.aspectRatios.forEach(function(an){var jn=new z(me.getIcon(an.horizontal,an.vertical),an.horizontal===0&&an.vertical===0?"FREE":an.horizontal+":"+an.vertical);jn.onClick=function(){return N.ratioButtonClicked(an)},ae.push(jn)}),this.aspectRatioButton=new Re(me.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,B.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var fe=new z('',"Toggle grid");fe.isActive=this.isGridVisible,fe.onClick=function(){N.isGridVisible=!N.isGridVisible,fe.isActive=N.isGridVisible},B.addButton(fe);var se=new z('',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){N.zoomToCropEnabled=!N.zoomToCropEnabled,se.isActive=N.zoomToCropEnabled},B.addButton(se),!Ut.isLicensed){var $e=new Z;this.topToolbar.addElementBlock($e);var St=document.createElement("div");St.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Pt=document.createElement("a");Pt.style.color="currentColor",Pt.href="https://markerjs.com/products/cropro",Pt.target="_blank",Pt.innerHTML='',St.appendChild(Pt),$e.addElement(St)}var $t=new ge;$t.minWidth=3*this.toolbarHeight+"px",$t.contentAlign="end",this.topToolbar.addButtonBlock($t);var Ot=new z('',"OK");Ot.onClick=this.startRenderAndClose,$t.addButton(Ot),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ot.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var zt=new z('',"Close");zt.onClick=this.close,$t.addButton(zt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(zt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ie.prototype.addBottomToolbar=function(){var N=this;this.bottomToolbar=new Xt,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 B=new ge;B.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(B);var ae=new z('',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,B.addButton(ae);var fe=new z('',"Rotate right");fe.onClick=this.rotateRightButtonClicked,B.addButton(fe);var se=new Z;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new kt("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($t){N.rotateBy($t),N.straightener.angle=N.rotationAngle},se.addElement(this.straightener.getUI());var $e=new ge;$e.minWidth=2*this.toolbarHeight+"px",$e.contentAlign="end",this.bottomToolbar.addButtonBlock($e);var St=new z('',"Flip horizontal");St.onClick=this.flipHorizontallyButtonClicked,$e.addButton(St);var Pt=new z('',"Flip vertical");Pt.onClick=this.flipVerticallyButtonClicked,$e.addButton(Pt)},ie.prototype.ratioButtonClicked=function(N){this.aspectRatio=N,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ie.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=me.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ie.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ie.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ie.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ie.prototype.restoreState=function(N){if(N){var B=this.cropLayer.getRescaledRect(N.width,N.height,this.imageWidth,this.imageHeight,N.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(B),this.cropRectChanged(B),this.flippedHorizontally=N.flippedHorizontally,this.flippedVertically=N.flippedVertically,this.applyFlip(),this.rotationAngle=N.rotationAngle,this.applyRotation()}},ie.prototype.clientToLocalCoordinates=function(N,B){var ae=this.cropImage.getBoundingClientRect();return{x:N-ae.left,y:B-ae.top}},ie.prototype.onWindowResize=function(){this.positionUI()},ie.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var N=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=N+"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()},ie.prototype.rotateLeftButtonClicked=function(){var N=this.rotationAngle-90;this.rotationAngle%90!=0&&(N+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateRightButtonClicked=function(){var N=this.rotationAngle+90;this.rotationAngle%90!=0&&(N-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(N)},ie.prototype.rotateTo=function(N){N=(N=N>180?N-360:N)<=-180?N+360:N,this.rotationAngle=N,this.applyRotation()},ie.prototype.rotateBy=function(N){this.rotateTo((this.rotationAngle+N)%360)},ie.prototype.applyRotation=function(){var N=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var B=this.editingTargetRotationContainer.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(B,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=N},ie.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ie.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ie.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ie.prototype.startRenderAndClose=function(){return st(this,void 0,void 0,function(){var N,B;return Nt(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return N=ae.sent(),B=this.getState(),this.renderEventListeners.forEach(function(fe){return fe(N,B)}),this.close(!0),[2]}})})},ie.prototype.render=function(){return st(this,void 0,void 0,function(){var N;return Nt(this,function(B){switch(B.label){case 0:return(N=new jt).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.width=this.renderWidth,N.height=this.renderHeight,this.unzoomFromCrop(),it.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,N.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 B.sent(),[4,N.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,B.sent()]}})})},ie.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new At("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 At("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new At("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var N=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new At("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*N)+`px; height: `+(this.toolbarHeight-2*N)+`px; padding: `+N+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new At("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new At("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new At("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 At("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new At("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 At("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*N)+`px; padding: `+N+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new At("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},ie.instanceCounter=0,ie}(),wt=F("8hTe"),Kt=F.n(wt),Et=/]*>/g;function Qt(ie){var N=document.createElement("div");return N.innerHTML=ie,N.childNodes.length===0?"":N.childNodes[0].nodeValue}var Vt=Le.a=function(ie){var N=ie.value,B=N===void 0?"":N,ae=ie.edit,fe=ae===void 0?!1:ae,se=ie.className,$e=ie.showTextOnly,St=ie.showLines,Pt=ie.replaces,$t=ie.zoomImg,Ot=ie.hasMask,zt=ie.style,an=zt===void 0?{}:zt,jn=ie.stylesPrev,Dr=jn===void 0?{}:jn,Cr=String(B),Nn=Object(p.useRef)(),hr=Object(p.useRef)(),mi=Object(p.useState)(""),Or=Object(T.a)(mi,2),yr=Or[0],pr=Or[1],Yr=Object(p.useState)("office"),Mr=Object(T.a)(Yr,2),Zr=Mr[0],wr=Mr[1],vi=function(){var Sn=new ot(hr.current);Sn.displayMode="popup",Sn.addRenderEventListener(function(){var _r=Object(x.a)(f.a.mark(function zn(Lr){var rr;return f.a.wrap(function(Pr){for(;;)switch(Pr.prev=Pr.next){case 0:return Nn.current.style.display="none",Pr.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Lr}});case 3:rr=Pr.sent,rr!=null&&rr.id&&Pt(hr.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(rr==null?void 0:rr.id,"?type=").concat(rr.content_type));case 5:case"end":return Pr.stop()}},zn)}));return function(zn){return _r.apply(this,arguments)}}()),Sn.show()},li=function(){var Sn=new Pe(hr.current);Sn.settings.displayMode="popup",Sn.addEventListener("render",function(){var _r=Object(x.a)(f.a.mark(function zn(Lr){var rr;return f.a.wrap(function(Pr){for(;;)switch(Pr.prev=Pr.next){case 0:if(Nn.current.style.display="none",!hr.current){Pr.next=6;break}return Pr.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Lr.dataUrl}});case 4:rr=Pr.sent,rr!=null&&rr.id&&Pt(hr.current.getAttribute("src").replace(re.a.API_SERVER,""),"/api/attachments/".concat(rr==null?void 0:rr.id,"?type=").concat(rr.content_type));case 6:case"end":return Pr.stop()}},zn)}));return function(zn){return _r.apply(this,arguments)}}()),Sn.show(),window.markerArea=Sn},Kr=Object(p.useMemo)(function(){try{var Fn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Sn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_r=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Cr=Cr.replace(Fn,"("+re.a.API_SERVER+"/api/attachments/").replace(Sn,'"'+re.a.API_SERVER+"/api/attachments/").replace(_r,'"'+re.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,` `),Cr=Cr.replace(new RegExp("(?[TOC]

    ",E()),m()),zn=zn.replace(/(__special_katext_id_\d+__)/g,function(Ri,Pr){var ni=Lr[Pr],ji=ni.type,ui=ni.expression;return Object($.renderToString)(Qt(ui)||"",{displayMode:ji==="block",throwOnError:!1,output:"html"})}),zn=zn.replace(/▁/g,"\u2581\u2581\u2581"),A(),$e){var rr=document.createElement("div");return rr.innerHTML=zn,rr.innerText}return setTimeout(function(){return gi()},500),zn},[Cr]),zr=Object(p.useRef)();v.WebkitLineClamp=St,St&&(an=Object(D.a)(Object(D.a)({},an),v));function xi(Fn){var Sn=Fn.target;if(Sn.tagName.toUpperCase()==="IMG"){if($t){var _r=Sn.getAttribute("src");pr(_r),wr("image")}}else if(Sn.tagName.toUpperCase()==="A"){var zn=Sn.getAttribute("href");if(zn.indexOf("office")>-1)Fn.preventDefault(),pr(zn),wr("office");else if(zn.indexOf("application/pdf")>-1)Fn.preventDefault(),pr(zn),wr("pdf");else if(zn.indexOf("type=text")>-1)Fn.preventDefault(),pr(zn),wr("html");else if(zn.startsWith("#")){Fn.preventDefault();var Lr=document.getElementById(zn.replace("#",""));Lr&&Lr.scrollIntoView(!0)}}}var gi=function(){var Sn,_r=(Sn=zr.current)===null||Sn===void 0?void 0:Sn.querySelectorAll("video");_r==null||_r.forEach(function(zn){if(zn.oncontextmenu=function(){return!1},zn.src.indexOf(".m3u8")>-1&&!zn.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Lr=new V.a;Lr.loadSource(zn.src),Lr.attachMedia(zn)}}})};Object(p.useEffect)(function(){if(zr.current&&Kr&&(Kr.match(Et)&&window.PR.prettyPrint()),zr.current)return zr.current.addEventListener("click",xi),function(){zr.current.removeEventListener("click",xi),A(),m()}},[Kr,zr.current,xi]);var Si=function(Sn){if(!fe)return;Sn.target.nodeName==="IMG"?(Nn.current.style.display="flex",Nn.current.style.width=Sn.target.clientWidth+"px",Nn.current.style.height=Sn.target.clientHeight+"px",Nn.current.style.top=Sn.target.offsetTop+"px",Nn.current.style.left=Sn.target.offsetLeft+"px",hr.current.src=Sn.target.getAttribute("src")):Nn.current.style.display="none"};return u.a.createElement("div",{style:{position:"relative"}},u.a.createElement("div",{ref:zr,style:Object(D.a)({},an),className:"".concat(se||""," markdown-body ").concat(Kt.a.mdBody),onMouseOver:Si,dangerouslySetInnerHTML:{__html:Kr}}),u.a.createElement("div",{ref:Nn,className:Kt.a.button},u.a.createElement(Q.a,null,u.a.createElement(S.a,{onClick:function(){return vi()}},"\u88C1\u526A"),u.a.createElement(S.a,{onClick:function(){return li()}},"\u7F16\u8F91"))),u.a.createElement("img",{ref:hr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),u.a.createElement(ne.a,{close:!0,data:yr,hasMask:Ot,type:yr!=null&&yr.length?Zr:"",style:Object(D.a)({},Dr),onClose:function(){return pr("")}}))}},"9VGf":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return j});var ue=F("q1tI"),Q=F.n(ue);function j(S,D){var x=Object(ue.useRef)();Object(ue.useEffect)(function(){x.current=S}),Object(ue.useEffect)(function(){function T(){x.current()}if(D!==null){var w=setInterval(T,D);return function(){return clearInterval(w)}}},[D])}},AMnG:function(nt,Le,F){"use strict";var ue=F("miYZ"),Q=F("tsqr"),j=F("tJVT"),S=F("q1tI"),D=F.n(S),x=F("nWbc"),T=F.n(x),w=F("Ot1p");Le.a=function(f){var p=f.id,u=f.activeDiscussIndex,o=f.onReplyDiscuss,i=Object(S.useState)(""),l=Object(j.a)(i,2),s=l[0],h=l[1];function r(n){h(n)}function t(){if(!s){Q.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}o(p,s),h("")}return D.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:u===p?"block":"none",width:"100%"}},D.a.createElement(w.a,{miniToolbar:!0,startInit:u===p,defaultValue:s,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:r}),D.a.createElement("a",{onClick:t,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return f});var ue=F("ErOA"),Q=F("ppsT"),j=F.n(Q),S="",D,x="";function T(p){w(p)}function w(p){D=new j.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(o){console.log("addFileSuccess: "+o.file.name),p.addFileSuccess&&p.addFileSuccess(o),D.startUpload()},onUploadstarted:function(o){var i=o.file.name;if(o.videoId){var h="/api/users/".concat(S,"/video_auths.json");Object(ue.a)(h,{method:"put",body:{video_id:o.videoId,title:i,file_name:i,virtual_classroom_id:x}}).then(function(r){if(r.status==-1){p.onUploadError&&p.onUploadError(o);return}var t=r.data,n=t.UploadAuth,c=t.UploadAddress,m=t.VideoId;D.setUploadAuthAndAddress(o,n,c)}).catch(function(r){D.deleteFile(D._curIndex),D.nextUpload(),console.log(r)})}else{var l="/api/users/".concat(S,"/video_auths.json"),s="";Object(ue.a)(l,{method:"Post",body:{title:s+i,file_name:s+i,virtual_classroom_id:x}}).then(function(r){if(r){var t=r.data,n=t.UploadAuth,c=t.UploadAddress,m=t.VideoId;D.setUploadAuthAndAddress(o,n,c,m)}}).catch(function(r){D.deleteFile(D._curIndex),D.nextUpload(),console.log(r)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(o){p.onUploadSucceed&&p.onUploadSucceed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(o,i,l){p.onUploadFailed&&p.onUploadFailed(o),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(o,i,l){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(o,i,l){p.onUploadProgress&&p.onUploadProgress(o,i,l);var s=Math.ceil(l*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(o){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var i="/api/users/".concat(S,"/video_auths.json");Object(ue.a)(i,{method:"put",body:{video_id:o.videoId}}).then(function(l){var s=l.data,h=s.UploadAuth;D.resumeUploadWithAuth(h)}).catch(function(l){console.log(l)})},onUploadEnd:function(o){p.onUploadEnd&&p.onUploadEnd(o),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(D)}function f(p,u,o){p&&(S=p),u&&(x=u),T(o)}},BU3w:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return x});var ue=F("MNnm"),Q="rc-util-key";function j(T){if(T.attachTo)return T.attachTo;var w=document.querySelector("head");return w||document.body}function S(T){var w,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var p=document.createElement("style");if((w=f.csp)===null||w===void 0?void 0:w.nonce){var u;p.nonce=(u=f.csp)===null||u===void 0?void 0:u.nonce}p.innerHTML=T;var o=j(f),i=o.firstChild;return f.prepend&&o.prepend?o.prepend(p):f.prepend&&i?o.insertBefore(p,i):o.appendChild(p),p}var D=new Map;function x(T,w){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=j(f);if(!D.has(p)){var u=S("",f),o=u.parentNode;D.set(p,o),o.removeChild(u)}var i=Array.from(D.get(p).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===w});if(i){var l,s;if(((l=f.csp)===null||l===void 0?void 0:l.nonce)&&i.nonce!==((s=f.csp)===null||s===void 0?void 0:s.nonce)){var h;i.nonce=(h=f.csp)===null||h===void 0?void 0:h.nonce}return i.innerHTML!==T&&(i.innerHTML=T),i}var r=S(T,f);return r[Q]=w,r}},Bd2K:function(nt,Le,F){(function(ue){ue(F("VrN/"),F("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(f,p,u){if(u!=ue.Init&&u&&f.removeKeyMap("autoCloseTags"),!p)return;var o={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(o["'/'"]=function(i){return x(i)}),(typeof p!="object"||p.whenOpening!==!1)&&(o["'>'"]=function(i){return S(i)}),f.addKeyMap(o)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],j=["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 S(f){if(f.getOption("disableInput"))return ue.Pass;for(var p=f.listSelections(),u=[],o=f.getOption("autoCloseTags"),i=0;il.ch&&(n=n.slice(0,n.length-s.end+l.ch));var b=n.toLowerCase();if(!n||s.type=="string"&&(s.end!=l.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&t.close||s.string.indexOf("/")==l.ch-s.start-1||m&&T(m,b)>-1||w(f,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(r)||[],n,l,!0))return ue.Pass;var E=typeof o=="object"&&o.emptyTags;if(E&&T(E,n)>-1){u[i]={text:"/>",newPos:ue.Pos(l.line,l.ch+2)};continue}var g=v&&T(v,b)>-1;u[i]={indent:g,text:">"+(g?` `:"")+"",newPos:g?ue.Pos(l.line+1,0):ue.Pos(l.line,l.ch+1)}}for(var y=typeof o=="object"&&o.dontIndentOnAutoClose,i=p.length-1;i>=0;i--){var C=u[i];f.replaceRange(C.text,p[i].head,p[i].anchor,"+insert");var d=f.listSelections().slice(0);d[i]={head:C.newPos,anchor:C.newPos},f.setSelections(d),!y&&C.indent&&(f.indentLine(C.newPos.line,null,!0),f.indentLine(C.newPos.line+1,null,!0))}}function D(f,p){for(var u=f.listSelections(),o=[],i=p?"/":""&&(m+=">"),o[h]=m}if(f.replaceSelections(o),u=f.listSelections(),!s)for(var h=0;h=0&&p[r]==u;r--)++h;o=s.to;for(var r=1;r0){for(var p=0;p1&&arguments[1]!==void 0?arguments[1]:"",p=[],u=0;u=0;p--){var u=j().key(p);f(S(u),u)}}function T(f){return j().removeItem(f)}function w(){return j().clear()}},DlQD:function(nt,Le,F){(function(ue,Q){nt.exports=Q()})(this,function(){"use strict";function ue(Ke,Fe){for(var Ue=0;UeKe.length)&&(Fe=Ke.length);for(var Ue=0,_e=new Array(Fe);Ue=Ke.length?{done:!0}:{done:!1,value:Ke[_e++]}}}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 Ue=Ke[Symbol.iterator](),Ue.next.bind(Ue)}function x(Ke,Fe){return Fe={exports:{}},Ke(Fe,Fe.exports),Fe.exports}var T=x(function(Ke){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 Ue(_e){Ke.exports.defaults=_e}Ke.exports={defaults:Fe(),getDefaults:Fe,changeDefaults:Ue}}),w=T.defaults,f=T.getDefaults,p=T.changeDefaults,u=/[&<>"']/,o=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(Fe){return s[Fe]};function r(Ke,Fe){if(Fe){if(u.test(Ke))return Ke.replace(o,h)}else if(i.test(Ke))return Ke.replace(l,h);return Ke}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(Ke){return Ke.replace(t,function(Fe,Ue){return Ue=Ue.toLowerCase(),Ue==="colon"?":":Ue.charAt(0)==="#"?Ue.charAt(1)==="x"?String.fromCharCode(parseInt(Ue.substring(2),16)):String.fromCharCode(+Ue.substring(1)):""})}var c=/(^|[^\[])\^/g;function m(Ke,Fe){Ke=Ke.source||Ke,Fe=Fe||"";var Ue={replace:function(Ce,Ne){return Ne=Ne.source||Ne,Ne=Ne.replace(c,"$1"),Ke=Ke.replace(Ce,Ne),Ue},getRegex:function(){return new RegExp(Ke,Fe)}};return Ue}var v=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(Ke,Fe,Ue){if(Ke){var _e;try{_e=decodeURIComponent(n(Ue)).replace(v,"").toLowerCase()}catch(Ce){return null}if(_e.indexOf("javascript:")===0||_e.indexOf("vbscript:")===0||_e.indexOf("data:")===0)return null}Fe&&!b.test(Ue)&&(Ue=_(Fe,Ue));try{Ue=encodeURI(Ue).replace(/%25/g,"%")}catch(Ce){return null}return Ue}var g={},y=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(Ke,Fe){g[" "+Ke]||(y.test(Ke)?g[" "+Ke]=Ke+"/":g[" "+Ke]=I(Ke,"/",!0)),Ke=g[" "+Ke];var Ue=Ke.indexOf(":")===-1;return Fe.substring(0,2)==="//"?Ue?Fe:Ke.replace(C,"$1")+Fe:Fe.charAt(0)==="/"?Ue?Fe:Ke.replace(d,"$1")+Fe:Ke+Fe}var O={exec:function(){}};function A(Ke){for(var Fe=1,Ue,_e;Fe=0&&rt[xt]==="\\";)tt=!tt;return tt?"|":" |"}),_e=Ue.split(/ \|/),Ce=0;if(_e.length>Fe)_e.splice(Fe);else for(;_e.length=_e.length?Ce.slice(_e.length):Ce}).join(` `)}var pe=function(){function Ke(Ue){this.options=Ue||H}var Fe=Ke.prototype;return Fe.space=function(_e){var Ce=this.rules.block.newline.exec(_e);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:` `}},Fe.code=function(_e,Ce){var Ne=this.rules.block.code.exec(_e);if(Ne){var De=Ce[Ce.length-1];if(De&&De.type==="paragraph")return{raw:Ne[0],text:Ne[0].trimRight()};var rt=Ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ne[0],codeBlockStyle:"indented",text:this.options.pedantic?rt:G(rt,` `)}}},Fe.fences=function(_e){var Ce=this.rules.block.fences.exec(_e);if(Ce){var Ne=Ce[0],De=he(Ne,Ce[3]||"");return{type:"code",raw:Ne,lang:Ce[2]?Ce[2].trim():Ce[2],text:De}}},Fe.heading=function(_e){var Ce=this.rules.block.heading.exec(_e);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},Fe.nptable=function(_e){var Ce=this.rules.block.nptable.exec(_e);if(Ce){var Ne={type:"table",header:V(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(` `):[],raw:Ce[0]};if(Ne.header.length===Ne.align.length){var De=Ne.align.length,rt;for(rt=0;rt ?/gm,"");return{type:"blockquote",raw:Ce[0],text:Ne}}},Fe.list=function(_e){var Ce=this.rules.block.list.exec(_e);if(Ce){for(var Ne=Ce[0],De=Ce[2],rt=De.length>1,tt=De[De.length-1]===")",xt={type:"list",raw:Ne,ordered:rt,start:rt?+De.slice(0,-1):"",loose:!1,items:[]},Mt=Ce[0].match(this.rules.block.item),Bt=!1,It,Dt,lt,pt,ut,Pe,Ve,yt=Mt.length,st=0;st1||this.options.smartLists&<!==De)&&(pt=Mt.slice(st+1).join(` `),xt.raw=xt.raw.substring(0,xt.raw.length-pt.length),st=yt-1)),ut=Bt||/\n\n(?!\s*$)/.test(It),st!==yt-1&&(Bt=It.charAt(It.length-1)===` `,ut||(ut=Bt)),ut&&(xt.loose=!0),Pe=/^\[[ xX]\] /.test(It),Ve=void 0,Pe&&(Ve=It[1]!==" ",It=It.replace(/^\[[ xX]\] +/,"")),xt.items.push({type:"list_item",raw:Ne,task:Pe,checked:Ve,loose:ut,text:It});return xt}},Fe.html=function(_e){var Ce=this.rules.block.html.exec(_e);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):re(Ce[0]):Ce[0]}},Fe.def=function(_e){var Ce=this.rules.block.def.exec(_e);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var Ne=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Ne,raw:Ce[0],href:Ce[2],title:Ce[3]}}},Fe.table=function(_e){var Ce=this.rules.block.table.exec(_e);if(Ce){var Ne={type:"table",header:V(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(` `):[]};if(Ne.header.length===Ne.align.length){Ne.raw=Ce[0];var De=Ne.align.length,rt;for(rt=0;rt/i.test(De[0])&&(Ce=!1),!Ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(De[0])?Ne=!0:Ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(De[0])&&(Ne=!1),{type:this.options.sanitize?"text":"html",raw:De[0],inLink:Ce,inRawBlock:Ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):re(De[0]):De[0]}},Fe.link=function(_e){var Ce=this.rules.inline.link.exec(_e);if(Ce){var Ne=$(Ce[2],"()");if(Ne>-1){var De=Ce[0].indexOf("!")===0?5:4,rt=De+Ce[1].length+Ne;Ce[2]=Ce[2].substring(0,Ne),Ce[0]=Ce[0].substring(0,rt).trim(),Ce[3]=""}var tt=Ce[2],xt="";if(this.options.pedantic){var Mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(tt);Mt?(tt=Mt[1],xt=Mt[3]):xt=""}else xt=Ce[3]?Ce[3].slice(1,-1):"";tt=tt.trim().replace(/^<([\s\S]*)>$/,"$1");var Bt=ne(Ce,{href:tt&&tt.replace(this.rules.inline._escapes,"$1"),title:xt&&xt.replace(this.rules.inline._escapes,"$1")},Ce[0]);return Bt}},Fe.reflink=function(_e,Ce){var Ne;if((Ne=this.rules.inline.reflink.exec(_e))||(Ne=this.rules.inline.nolink.exec(_e))){var De=(Ne[2]||Ne[1]).replace(/\s+/g," ");if(De=Ce[De.toLowerCase()],!De||!De.href){var rt=Ne[0].charAt(0);return{type:"text",raw:rt,text:rt}}var tt=ne(Ne,De,Ne[0]);return tt}},Fe.strong=function(_e,Ce,Ne){Ne===void 0&&(Ne="");var De=this.rules.inline.strong.start.exec(_e);if(De&&(!De[1]||De[1]&&(Ne===""||this.rules.inline.punctuation.exec(Ne)))){Ce=Ce.slice(-1*_e.length);var rt=De[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;rt.lastIndex=0;for(var tt;(De=rt.exec(Ce))!=null;)if(tt=this.rules.inline.strong.middle.exec(Ce.slice(0,De.index+3)),tt)return{type:"strong",raw:_e.slice(0,tt[0].length),text:_e.slice(2,tt[0].length-2)}}},Fe.em=function(_e,Ce,Ne){Ne===void 0&&(Ne="");var De=this.rules.inline.em.start.exec(_e);if(De&&(!De[1]||De[1]&&(Ne===""||this.rules.inline.punctuation.exec(Ne)))){Ce=Ce.slice(-1*_e.length);var rt=De[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;rt.lastIndex=0;for(var tt;(De=rt.exec(Ce))!=null;)if(tt=this.rules.inline.em.middle.exec(Ce.slice(0,De.index+2)),tt)return{type:"em",raw:_e.slice(0,tt[0].length),text:_e.slice(1,tt[0].length-1)}}},Fe.codespan=function(_e){var Ce=this.rules.inline.code.exec(_e);if(Ce){var Ne=Ce[2].replace(/\n/g," "),De=/[^ ]/.test(Ne),rt=Ne.startsWith(" ")&&Ne.endsWith(" ");return De&&rt&&(Ne=Ne.substring(1,Ne.length-1)),Ne=re(Ne,!0),{type:"codespan",raw:Ce[0],text:Ne}}},Fe.br=function(_e){var Ce=this.rules.inline.br.exec(_e);if(Ce)return{type:"br",raw:Ce[0]}},Fe.del=function(_e){var Ce=this.rules.inline.del.exec(_e);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},Fe.autolink=function(_e,Ce){var Ne=this.rules.inline.autolink.exec(_e);if(Ne){var De,rt;return Ne[2]==="@"?(De=re(this.options.mangle?Ce(Ne[1]):Ne[1]),rt="mailto:"+De):(De=re(Ne[1]),rt=De),{type:"link",raw:Ne[0],text:De,href:rt,tokens:[{type:"text",raw:De,text:De}]}}},Fe.url=function(_e,Ce){var Ne;if(Ne=this.rules.inline.url.exec(_e)){var De,rt;if(Ne[2]==="@")De=re(this.options.mangle?Ce(Ne[0]):Ne[0]),rt="mailto:"+De;else{var tt;do tt=Ne[0],Ne[0]=this.rules.inline._backpedal.exec(Ne[0])[0];while(tt!==Ne[0]);De=re(Ne[0]),Ne[1]==="www."?rt="http://"+De:rt=De}return{type:"link",raw:Ne[0],text:De,href:rt,tokens:[{type:"text",raw:De,text:De}]}}},Fe.inlineText=function(_e,Ce,Ne){var De=this.rules.inline.text.exec(_e);if(De){var rt;return Ce?rt=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):re(De[0]):De[0]:rt=re(this.options.smartypants?Ne(De[0]):De[0]),{type:"text",raw:De[0],text:rt}}},Ke}(),Te=te.noopTest,we=te.edit,Me=te.merge,Ee={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ee.def=we(Ee.def).replace("label",Ee._label).replace("title",Ee._title).getRegex(),Ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ee.item=we(Ee.item,"gm").replace(/bull/g,Ee.bullet).getRegex(),Ee.list=we(Ee.list).replace(/bull/g,Ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ee.def.source+")").getRegex(),Ee._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",Ee._comment=//,Ee.html=we(Ee.html,"i").replace("comment",Ee._comment).replace("tag",Ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee.paragraph=we(Ee._paragraph).replace("hr",Ee.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",")|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.blockquote=we(Ee.blockquote).replace("paragraph",Ee.paragraph).getRegex(),Ee.normal=Me({},Ee),Ee.gfm=Me({},Ee.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*|$)"}),Ee.gfm.nptable=we(Ee.gfm.nptable).replace("hr",Ee.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",")|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.gfm.table=we(Ee.gfm.table).replace("hr",Ee.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",")|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.pedantic=Me({},Ee.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ee._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Te,paragraph:we(Ee.normal._paragraph).replace("hr",Ee.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var xe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",xe.punctuation=we(xe.punctuation).replace(/punctuation/g,xe._punctuation).getRegex(),xe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",xe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",xe.em.start=we(xe.em.start).replace(/punctuation/g,xe._punctuation).getRegex(),xe.em.middle=we(xe.em.middle).replace(/punctuation/g,xe._punctuation).replace(/overlapSkip/g,xe._overlapSkip).getRegex(),xe.em.endAst=we(xe.em.endAst,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.em.endUnd=we(xe.em.endUnd,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.start=we(xe.strong.start).replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.middle=we(xe.strong.middle).replace(/punctuation/g,xe._punctuation).replace(/blockSkip/g,xe._blockSkip).getRegex(),xe.strong.endAst=we(xe.strong.endAst,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.endUnd=we(xe.strong.endUnd,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.blockSkip=we(xe._blockSkip,"g").getRegex(),xe.overlapSkip=we(xe._overlapSkip,"g").getRegex(),xe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,xe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,xe._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])?)+(?![-_])/,xe.autolink=we(xe.autolink).replace("scheme",xe._scheme).replace("email",xe._email).getRegex(),xe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,xe.tag=we(xe.tag).replace("comment",Ee._comment).replace("attribute",xe._attribute).getRegex(),xe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,xe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,xe.link=we(xe.link).replace("label",xe._label).replace("href",xe._href).replace("title",xe._title).getRegex(),xe.reflink=we(xe.reflink).replace("label",xe._label).getRegex(),xe.reflinkSearch=we(xe.reflinkSearch,"g").replace("reflink",xe.reflink).replace("nolink",xe.nolink).getRegex(),xe.normal=Me({},xe),xe.pedantic=Me({},xe.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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",xe._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xe._label).getRegex()}),xe.gfm=Me({},xe.normal,{escape:we(xe.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]*?(?:(?=[\\.5&&(_e="x"+_e.toString(16)),Fe+="&#"+_e+";";return Fe}var Oe=function(){function Ke(Ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ue||je,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var _e={block:We.normal,inline:ze.normal};this.options.pedantic?(_e.block=We.pedantic,_e.inline=ze.pedantic):this.options.gfm&&(_e.block=We.gfm,this.options.breaks?_e.inline=ze.breaks:_e.inline=ze.gfm),this.tokenizer.rules=_e}Ke.lex=function(_e,Ce){var Ne=new Ke(Ce);return Ne.lex(_e)};var Fe=Ke.prototype;return Fe.lex=function(_e){return _e=_e.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(_e,this.tokens,!0),this.inline(this.tokens),this.tokens},Fe.blockTokens=function(_e,Ce,Ne){Ce===void 0&&(Ce=[]),Ne===void 0&&(Ne=!0),_e=_e.replace(/^ +$/gm,"");for(var De,rt,tt,xt;_e;){if(De=this.tokenizer.space(_e)){_e=_e.substring(De.raw.length),De.type&&Ce.push(De);continue}if(De=this.tokenizer.code(_e,Ce)){_e=_e.substring(De.raw.length),De.type?Ce.push(De):(xt=Ce[Ce.length-1],xt.raw+=` `+De.raw,xt.text+=` `+De.text);continue}if(De=this.tokenizer.fences(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.heading(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.nptable(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.hr(_e)){_e=_e.substring(De.raw.length),Ce.push(De);continue}if(De=this.tokenizer.blockquote(_e)){_e=_e.substring(De.raw.length),De.tokens=this.blockTokens(De.text,[],Ne),Ce.push(De);continue}if(De=this.tokenizer.list(_e)){for(_e=_e.substring(De.raw.length),tt=De.items.length,rt=0;rt0)for(;(Mt=this.tokenizer.rules.inline.reflinkSearch.exec(xt))!=null;)Bt.includes(Mt[0].slice(Mt[0].lastIndexOf("[")+1,-1))&&(xt=xt.slice(0,Mt.index)+"["+"a".repeat(Mt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Mt=this.tokenizer.rules.inline.blockSkip.exec(xt))!=null;)xt=xt.slice(0,Mt.index)+"["+"a".repeat(Mt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;_e;){if(tt=this.tokenizer.escape(_e)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.tag(_e,Ne,De)){_e=_e.substring(tt.raw.length),Ne=tt.inLink,De=tt.inRawBlock,Ce.push(tt);continue}if(tt=this.tokenizer.link(_e)){_e=_e.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,De)),Ce.push(tt);continue}if(tt=this.tokenizer.reflink(_e,this.tokens.links)){_e=_e.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,De)),Ce.push(tt);continue}if(tt=this.tokenizer.strong(_e,xt,rt)){_e=_e.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Ne,De),Ce.push(tt);continue}if(tt=this.tokenizer.em(_e,xt,rt)){_e=_e.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Ne,De),Ce.push(tt);continue}if(tt=this.tokenizer.codespan(_e)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.br(_e)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.del(_e)){_e=_e.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Ne,De),Ce.push(tt);continue}if(tt=this.tokenizer.autolink(_e,le)){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(!Ne&&(tt=this.tokenizer.url(_e,le))){_e=_e.substring(tt.raw.length),Ce.push(tt);continue}if(tt=this.tokenizer.inlineText(_e,De,de)){_e=_e.substring(tt.raw.length),rt=tt.raw.slice(-1),Ce.push(tt);continue}if(_e){var It="Infinite loop on byte: "+_e.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return Ce},Q(Ke,null,[{key:"rules",get:function(){return{block:We,inline:ze}}}]),Ke}(),Ie=T.defaults,qe=te.cleanUrl,ee=te.escape,k=function(){function Ke(Ue){this.options=Ue||Ie}var Fe=Ke.prototype;return Fe.code=function(_e,Ce,Ne){var De=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var rt=this.options.highlight(_e,De);rt!=null&&rt!==_e&&(Ne=!0,_e=rt)}return De?'
    '+(Ne?_e:ee(_e,!0))+`
    `:"
    "+(Ne?_e:ee(_e,!0))+`
    `},Fe.blockquote=function(_e){return`
    `+_e+`
    `},Fe.html=function(_e){return _e},Fe.heading=function(_e,Ce,Ne,De){return this.options.headerIds?"'+_e+" `:""+_e+" `},Fe.hr=function(){return this.options.xhtml?`
    `:`
    `},Fe.list=function(_e,Ce,Ne){var De=Ce?"ol":"ul",rt=Ce&&Ne!==1?' start="'+Ne+'"':"";return"<"+De+rt+`> `+_e+" `},Fe.listitem=function(_e){return"
  • "+_e+`
  • `},Fe.checkbox=function(_e){return" "},Fe.paragraph=function(_e){return"

    "+_e+`

    `},Fe.table=function(_e,Ce){return Ce&&(Ce=""+Ce+""),` `+_e+` `+Ce+`
    `},Fe.tablerow=function(_e){return` `+_e+` `},Fe.tablecell=function(_e,Ce){var Ne=Ce.header?"th":"td",De=Ce.align?"<"+Ne+' align="'+Ce.align+'">':"<"+Ne+">";return De+_e+" `},Fe.strong=function(_e){return""+_e+""},Fe.em=function(_e){return""+_e+""},Fe.codespan=function(_e){return""+_e+""},Fe.br=function(){return this.options.xhtml?"
    ":"
    "},Fe.del=function(_e){return""+_e+""},Fe.link=function(_e,Ce,Ne){if(_e=qe(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Ne;var De='",De},Fe.image=function(_e,Ce,Ne){if(_e=qe(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Ne;var De=''+Ne+'":">",De},Fe.text=function(_e){return _e},Ke}(),U=function(){function Ke(){}var Fe=Ke.prototype;return Fe.strong=function(_e){return _e},Fe.em=function(_e){return _e},Fe.codespan=function(_e){return _e},Fe.del=function(_e){return _e},Fe.html=function(_e){return _e},Fe.text=function(_e){return _e},Fe.link=function(_e,Ce,Ne){return""+Ne},Fe.image=function(_e,Ce,Ne){return""+Ne},Fe.br=function(){return""},Ke}(),q=function(){function Ke(){this.seen={}}var Fe=Ke.prototype;return Fe.slug=function(_e){var Ce=_e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var Ne=Ce;do this.seen[Ne]++,Ce=Ne+"-"+this.seen[Ne];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},Ke}(),Y=T.defaults,J=te.unescape,be=function(){function Ke(Ue){this.options=Ue||Y,this.options.renderer=this.options.renderer||new k,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U,this.slugger=new q}Ke.parse=function(_e,Ce){var Ne=new Ke(Ce);return Ne.parse(_e)};var Fe=Ke.prototype;return Fe.parse=function(_e,Ce){Ce===void 0&&(Ce=!0);var Ne="",De,rt,tt,xt,Mt,Bt,It,Dt,lt,pt,ut,Pe,Ve,yt,st,Nt,Ut,it,mt=_e.length;for(De=0;De0&&st.tokens[0].type==="text"?(st.tokens[0].text=it+" "+st.tokens[0].text,st.tokens[0].tokens&&st.tokens[0].tokens.length>0&&st.tokens[0].tokens[0].type==="text"&&(st.tokens[0].tokens[0].text=it+" "+st.tokens[0].tokens[0].text)):st.tokens.unshift({type:"text",text:it}):yt+=it),yt+=this.parse(st.tokens,Ve),lt+=this.renderer.listitem(yt,Ut,Nt);Ne+=this.renderer.list(lt,ut,Pe);continue}case"html":{Ne+=this.renderer.html(pt.text);continue}case"paragraph":{Ne+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(lt=pt.tokens?this.parseInline(pt.tokens):pt.text;De+1An error occurred:

    "+He(tt.message+"",!0)+"
    ";throw tt}}Qe.options=Qe.setOptions=function(Ke){return ke(Qe.defaults,Ke),Ze(Qe.defaults),Qe},Qe.getDefaults=Be,Qe.defaults=ht,Qe.use=function(Ke){var Fe=ke({},Ke);if(Ke.renderer&&function(){var _e=Qe.defaults.renderer||new k,Ce=function(rt){var tt=_e[rt];_e[rt]=function(){for(var xt=arguments.length,Mt=new Array(xt),Bt=0;Bt=0;i--){if(!j(o[i]))continue;var l=o[i].split("="),s=unescape(l[0]),h=unescape(l[1]);u(h,s)}}function T(u,o){if(!u)return;S.cookie=escape(u)+"="+escape(o)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function w(u){if(!u||!p(u))return;S.cookie=escape(u)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function f(){x(function(u,o){w(o)})}function p(u){return new RegExp("(?:^|;\\s*)"+escape(u).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(S.cookie)}},E2g8:function(nt,Le,F){(function(ue,Q){/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */(function(j,S){nt.exports=S()})(this,function(){"use strict";function j(k){var U=typeof k;return k!==null&&(U==="object"||U==="function")}function S(k){return typeof k=="function"}var D=void 0;Array.isArray?D=Array.isArray:D=function(k){return Object.prototype.toString.call(k)==="[object Array]"};var x=D,T=0,w=void 0,f=void 0,p=function(U,q){b[T]=U,b[T+1]=q,T+=2,T===2&&(f?f(E):y())};function u(k){f=k}function o(k){p=k}var i=typeof window!="undefined"?window:void 0,l=i||{},s=l.MutationObserver||l.WebKitMutationObserver,h=typeof self=="undefined"&&typeof ue!="undefined"&&{}.toString.call(ue)==="[object process]",r=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function t(){return function(){return ue.nextTick(E)}}function n(){return typeof w!="undefined"?function(){w(E)}:v()}function c(){var k=0,U=new s(E),q=document.createTextNode("");return U.observe(q,{characterData:!0}),function(){q.data=k=++k%2}}function m(){var k=new MessageChannel;return k.port1.onmessage=E,function(){return k.port2.postMessage(0)}}function v(){var k=setTimeout;return function(){return k(E,1)}}var b=new Array(1e3);function E(){for(var k=0;k`,triples:"",explode:"[]{}"},j=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(s,h,r){r&&r!=ue.Init&&(s.removeKeyMap(D),s.state.closeBrackets=null),h&&(x(S(h,"pairs")),s.state.closeBrackets=h,s.addKeyMap(D))});function S(s,h){return h=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[h]!=null?s[h]:Q[h]}var D={Backspace:f,Enter:p};function x(s){for(var h=0;h=0;n--){var m=t[n].head;s.replaceRange("",j(m.line,m.ch-1),j(m.line,m.ch+1),"+delete")}}function p(s){var h=w(s),r=h&&S(h,"explode");if(!r||s.getOption("disableInput"))return ue.Pass;for(var t=s.listSelections(),n=0;n0;return{anchor:new j(s.anchor.line,s.anchor.ch+(h?-1:1)),head:new j(s.head.line,s.head.ch+(h?1:-1))}}function o(s,h){var r=w(s);if(!r||s.getOption("disableInput"))return ue.Pass;var t=S(r,"pairs"),n=t.indexOf(h);if(n==-1)return ue.Pass;for(var c=S(r,"closeBefore"),m=S(r,"triples"),v=t.charAt(n+1)==h,b=s.listSelections(),E=n%2==0,g,y=0;y=0&&s.getRange(d,j(d.line,d.ch+3))==h+h+h?_="skipThree":_="skip";else if(v&&d.ch>1&&m.indexOf(h)>=0&&s.getRange(j(d.line,d.ch-2),d)==h+h){if(d.ch>2&&/\bstring/.test(s.getTokenTypeAt(j(d.line,d.ch-2))))return ue.Pass;_="addFour"}else if(v){var A=d.ch==0?" ":s.getRange(j(d.line,d.ch-1),d);if(!ue.isWordChar(O)&&A!=h&&!ue.isWordChar(A))_="both";else return ue.Pass}else if(E&&(O.length===0||/\s/.test(O)||c.indexOf(O)>-1))_="both";else return ue.Pass;if(!g)g=_;else if(g!=_)return ue.Pass}var P=n%2?t.charAt(n-1):h,I=n%2?h:t.charAt(n+1);s.operation(function(){if(g=="skip")s.execCommand("goCharRight");else if(g=="skipThree")for(var W=0;W<3;W++)s.execCommand("goCharRight");else if(g=="surround"){for(var K=s.getSelections(),W=0;W ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","error",oe),!Ae.ENABLE_ERROR)return;console.error?console.error(oe):console.warn?console.warn(oe):console.log(oe)}},{key:"i",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","info",oe),!Ae.ENABLE_INFO)return;console.info?console.info(oe):console.log(oe)}},{key:"w",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","warn",oe),!Ae.ENABLE_WARN)return;console.warn?console.warn(oe):console.log(oe)}},{key:"d",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","debug",oe),!Ae.ENABLE_DEBUG)return;console.debug?console.debug(oe):console.log(oe)}},{key:"v",value:function(z,Z){(!z||Ae.FORCE_GLOBAL_TAG)&&(z=Ae.GLOBAL_TAG);var oe="[".concat(z,"] > ").concat(Z);if(Ae.ENABLE_CALLBACK&&Ae.emitter.emit("log","verbose",oe),!Ae.ENABLE_VERBOSE)return;console.log(oe)}}]),Ae}();T.GLOBAL_TAG="flv.js",T.FORCE_GLOBAL_TAG=!1,T.ENABLE_ERROR=!0,T.ENABLE_INFO=!0,T.ENABLE_WARN=!0,T.ENABLE_DEBUG=!0,T.ENABLE_VERBOSE=!0,T.ENABLE_CALLBACK=!1,T.emitter=new x.a;var w=T,f=function(){function Ae(){Object(ue.a)(this,Ae),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(Q.a)(Ae,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(z){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=z,this._totalBytes+=z):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=z,this._totalBytes+=z):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=z,this._totalBytes+=z,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var z=(this._now()-this._lastCheckpoint)/1e3;return z==0&&(z=1),this._intervalBytes/z/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var z=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/z/1024}}]),Ae}(),p=f,u=F("yKVA"),o=F("879j"),i=function(){function Ae(ge){Object(ue.a)(this,Ae),this._message=ge}return Object(Q.a)(Ae,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Ae}(),l=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z){return Object(ue.a)(this,z),ge.call(this,Z)}return Object(Q.a)(z,[{key:"name",get:function(){return"IllegalStateException"}}]),z}(i),s=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z){return Object(ue.a)(this,z),ge.call(this,Z)}return Object(Q.a)(z,[{key:"name",get:function(){return"InvalidArgumentException"}}]),z}(i),h=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z){return Object(ue.a)(this,z),ge.call(this,Z)}return Object(Q.a)(z,[{key:"name",get:function(){return"NotImplementedException"}}]),z}(i),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},t={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},n=function(){function Ae(ge){Object(ue.a)(this,Ae),this._type=ge||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===r.kConnecting||this._status===r.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(z){this._onContentLengthKnown=z}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(z){this._onURLRedirect=z}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(z){this._onDataArrival=z}},{key:"onError",get:function(){return this._onError},set:function(z){this._onError=z}},{key:"onComplete",get:function(){return this._onComplete},set:function(z){this._onComplete=z}},{key:"open",value:function(z,Z){throw new h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),Ae}(),c=F("oZsa");function m(Ae,ge){for(;!Object.prototype.hasOwnProperty.call(Ae,ge)&&!(Ae=Object(c.a)(Ae),Ae===null););return Ae}function v(Ae,ge,z){return typeof Reflect!="undefined"&&Reflect.get?v=Reflect.get:v=function(oe,me,Re){var Je=m(oe,me);if(!Je)return;var at=Object.getOwnPropertyDescriptor(Je,me);return at.get?at.get.call(Re):at.value},v(Ae,ge,z||Ae)}var b={};function E(){var Ae=self.navigator.userAgent.toLowerCase(),ge=/(edge)\/([\w.]+)/.exec(Ae)||/(opr)[\/]([\w.]+)/.exec(Ae)||/(chrome)[ \/]([\w.]+)/.exec(Ae)||/(iemobile)[\/]([\w.]+)/.exec(Ae)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ae)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Ae)||/(webkit)[ \/]([\w.]+)/.exec(Ae)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Ae)||/(msie) ([\w.]+)/.exec(Ae)||Ae.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Ae)||Ae.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Ae)||[],z=/(ipad)/.exec(Ae)||/(ipod)/.exec(Ae)||/(windows phone)/.exec(Ae)||/(iphone)/.exec(Ae)||/(kindle)/.exec(Ae)||/(android)/.exec(Ae)||/(windows)/.exec(Ae)||/(mac)/.exec(Ae)||/(linux)/.exec(Ae)||/(cros)/.exec(Ae)||[],Z={browser:ge[5]||ge[3]||ge[1]||"",version:ge[2]||ge[4]||"0",majorVersion:ge[4]||ge[2]||"0",platform:z[0]||""},oe={};if(Z.browser){oe[Z.browser]=!0;var me=Z.majorVersion.split(".");oe.version={major:parseInt(Z.majorVersion,10),string:Z.version},me.length>1&&(oe.version.minor=parseInt(me[1],10)),me.length>2&&(oe.version.build=parseInt(me[2],10))}if(Z.platform&&(oe[Z.platform]=!0),(oe.chrome||oe.opr||oe.safari)&&(oe.webkit=!0),oe.rv||oe.iemobile){oe.rv&&delete oe.rv;var Re="msie";Z.browser=Re,oe[Re]=!0}if(oe.edge){delete oe.edge;var Je="msedge";Z.browser=Je,oe[Je]=!0}if(oe.opr){var at="opera";Z.browser=at,oe[at]=!0}if(oe.safari&&oe.android){var kt="android";Z.browser=kt,oe[kt]=!0}oe.name=Z.browser,oe.platform=Z.platform;for(var jt in b)b.hasOwnProperty(jt)&&delete b[jt];Object.assign(b,oe)}E();var g=b,y=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z,oe){var me;return Object(ue.a)(this,z),me=ge.call(this,"fetch-stream-loader"),me.TAG="FetchStreamLoader",me._seekHandler=Z,me._config=oe,me._needStash=!0,me._requestAbort=!1,me._contentLength=null,me._receivedLength=0,me}return Object(Q.a)(z,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,me){var Re=this;this._dataSource=oe,this._range=me;var Je=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Je=oe.redirectedURL);var at=this._seekHandler.getConfig(Je,me),kt=new self.Headers;if(typeof at.headers=="object"){var jt=at.headers;for(var ot in jt)jt.hasOwnProperty(ot)&&kt.append(ot,jt[ot])}var wt={method:"GET",headers:kt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Kt in this._config.headers)kt.append(Kt,this._config.headers[Kt]);oe.cors===!1&&(wt.mode="same-origin"),oe.withCredentials&&(wt.credentials="include"),oe.referrerPolicy&&(wt.referrerPolicy=oe.referrerPolicy),this._status=r.kConnecting,self.fetch(at.url,wt).then(function(Et){if(Re._requestAbort){Re._requestAbort=!1,Re._status=r.kIdle;return}if(Et.ok&&Et.status>=200&&Et.status<=299){if(Et.url!==at.url&&Re._onURLRedirect){var Qt=Re._seekHandler.removeURLParameters(Et.url);Re._onURLRedirect(Qt)}var Vt=Et.headers.get("Content-Length");return Vt!=null&&(Re._contentLength=parseInt(Vt),Re._contentLength!==0&&(Re._onContentLengthKnown&&Re._onContentLengthKnown(Re._contentLength))),Re._pump.call(Re,Et.body.getReader())}else if(Re._status=r.kError,Re._onError)Re._onError(t.HTTP_STATUS_CODE_INVALID,{code:Et.status,msg:Et.statusText});else throw new i("FetchStreamLoader: Http code invalid, "+Et.status+" "+Et.statusText)}).catch(function(Et){if(Re._status=r.kError,Re._onError)Re._onError(t.EXCEPTION,{code:-1,msg:Et.message});else throw Et})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(oe){var me=this;return oe.read().then(function(Re){if(Re.done)if(me._contentLength!==null&&me._receivedLength=15048,me=g.msedge?oe:!0;return self.fetch&&self.ReadableStream&&me}catch(Re){return!1}}}]),z}(n),C=y,d=function(Ae){Object(u.a)(z,Ae);var ge=Object(o.a)(z);function z(Z,oe){var me;return Object(ue.a)(this,z),me=ge.call(this,"xhr-moz-chunked-loader"),me.TAG="MozChunkedLoader",me._seekHandler=Z,me._config=oe,me._needStash=!0,me._xhr=null,me._requestAbort=!1,me._contentLength=null,me._receivedLength=0,me}return Object(Q.a)(z,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),v(Object(c.a)(z.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,me){this._dataSource=oe,this._range=me;var Re=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Re=oe.redirectedURL);var Je=this._seekHandler.getConfig(Re,me);this._requestURL=Je.url;var at=this._xhr=new XMLHttpRequest;if(at.open("GET",Je.url,!0),at.responseType="moz-chunked-arraybuffer",at.onreadystatechange=this._onReadyStateChange.bind(this),at.onprogress=this._onProgress.bind(this),at.onloadend=this._onLoadEnd.bind(this),at.onerror=this._onXhrError.bind(this),oe.withCredentials&&(at.withCredentials=!0),typeof Je.headers=="object"){var kt=Je.headers;for(var jt in kt)kt.hasOwnProperty(jt)&&at.setRequestHeader(jt,kt[jt])}if(typeof this._config.headers=="object"){var ot=this._config.headers;for(var wt in ot)ot.hasOwnProperty(wt)&&at.setRequestHeader(wt,ot[wt])}this._status=r.kConnecting,at.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.kComplete}},{key:"_onReadyStateChange",value:function(oe){var me=oe.target;if(me.readyState===2){if(me.responseURL!=null&&me.responseURL!==this._requestURL&&this._onURLRedirect){var Re=this._seekHandler.removeURLParameters(me.responseURL);this._onURLRedirect(Re)}if(me.status!==0&&(me.status<200||me.status>299))if(this._status=r.kError,this._onError)this._onError(t.HTTP_STATUS_CODE_INVALID,{code:me.status,msg:me.statusText});else throw new i("MozChunkedLoader: Http code invalid, "+me.status+" "+me.statusText);else this._status=r.kBuffering}}},{key:"_onProgress",value:function(oe){if(this._status===r.kError)return;this._contentLength===null&&(oe.total!==null&&oe.total!==0&&(this._contentLength=oe.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var me=oe.target.response,Re=this._range.from+this._receivedLength;this._receivedLength+=me.byteLength,this._onDataArrival&&this._onDataArrival(me,Re,this._receivedLength)}},{key:"_onLoadEnd",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===r.kError)return;this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(oe){this._status=r.kError;var me=0,Re=null;if(this._contentLength&&oe.loaded=200&&me.status<=299){if(this._status=r.kBuffering,me.responseURL!=null){var Re=this._seekHandler.removeURLParameters(me.responseURL);me.responseURL!==this._currentRequestURL&&Re!==this._currentRedirectedURL&&(this._currentRedirectedURL=Re,this._onURLRedirect&&this._onURLRedirect(Re))}var Je=me.getResponseHeader("Content-Length");if(Je!=null&&this._contentLength==null){var at=parseInt(Je);at>0&&(this._contentLength=at,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=r.kError,this._onError)this._onError(t.HTTP_STATUS_CODE_INVALID,{code:me.status,msg:me.statusText});else throw new i("MSStreamLoader: Http code invalid, "+me.status+" "+me.statusText);else if(me.readyState===3&&(me.status>=200&&me.status<=299)){this._status=r.kBuffering;var kt=me.response;this._reader.readAsArrayBuffer(kt)}}},{key:"_xhrOnError",value:function(oe){this._status=r.kError;var me=t.EXCEPTION,Re={code:-1,msg:oe.constructor.name+" "+oe.type};if(this._onError)this._onError(me,Re);else throw new i(Re.msg)}},{key:"_msrOnProgress",value:function(oe){var me=oe.target,Re=me.result;if(Re==null){this._doReconnectIfNeeded();return}var Je=Re.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Re.byteLength;var at=this._totalRange.from+this._receivedLength;this._receivedLength+=Je.byteLength,this._onDataArrival&&this._onDataArrival(Je,at,this._receivedLength),Re.byteLength>=this._bufferLimit&&(w.v(this.TAG,"MSStream buffer exceeded max size near ".concat(at+Je.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(Re=this._range.from+this._contentLength-1)),this._currentRequestRange={from:me,to:Re},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(oe,me){this._lastTimeLoaded=0;var Re=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Re=this._currentRedirectedURL:oe.redirectedURL!=null&&(Re=oe.redirectedURL));var Je=this._seekHandler.getConfig(Re,me);this._currentRequestURL=Je.url;var at=this._xhr=new XMLHttpRequest;if(at.open("GET",Je.url,!0),at.responseType="arraybuffer",at.onreadystatechange=this._onReadyStateChange.bind(this),at.onprogress=this._onProgress.bind(this),at.onload=this._onLoad.bind(this),at.onerror=this._onXhrError.bind(this),oe.withCredentials&&(at.withCredentials=!0),typeof Je.headers=="object"){var kt=Je.headers;for(var jt in kt)kt.hasOwnProperty(jt)&&at.setRequestHeader(jt,kt[jt])}if(typeof this._config.headers=="object"){var ot=this._config.headers;for(var wt in ot)ot.hasOwnProperty(wt)&&at.setRequestHeader(wt,ot[wt])}at.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=r.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(oe){var me=oe.target;if(me.readyState===2){if(me.responseURL!=null){var Re=this._seekHandler.removeURLParameters(me.responseURL);me.responseURL!==this._currentRequestURL&&Re!==this._currentRedirectedURL&&(this._currentRedirectedURL=Re,this._onURLRedirect&&this._onURLRedirect(Re))}if(me.status>=200&&me.status<=299){if(this._waitForTotalLength)return;this._status=r.kBuffering}else if(this._status=r.kError,this._onError)this._onError(t.HTTP_STATUS_CODE_INVALID,{code:me.status,msg:me.statusText});else throw new i("RangeLoader: Http code invalid, "+me.status+" "+me.statusText)}}},{key:"_onProgress",value:function(oe){if(this._status===r.kError)return;if(this._contentLength===null){var me=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,me=!0;var Re=oe.total;this._internalAbort(),Re!=null&Re!==0&&(this._totalLength=Re)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,me){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Je=oe.loaded-this._lastTimeLoaded;this._lastTimeLoaded=oe.loaded,this._speedSampler.addBytes(Je)}},{key:"_normalizeSpeed",value:function(oe){var me=this._chunkSizeKBList,Re=me.length-1,Je=0,at=0,kt=Re;if(oe=me[Je]&&oe=3&&(me=this._speedSampler.currentKBps)),me!==0){var Re=this._normalizeSpeed(me);this._currentSpeedNormalized!==Re&&(this._currentSpeedNormalized=Re,this._currentChunkSizeKB=Re)}var Je=oe.target.response,at=this._range.from+this._receivedLength;this._receivedLength+=Je.byteLength;var kt=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var Je=oe.split("&"),at=0;at0;kt[0]!==this._startName&&kt[0]!==this._endName&&(jt&&(Re+="&"),Re+=Je[at])}return Re.length===0?Z:Z+"?"+Re}}]),Ae}(),V=G,re=function(){function Ae(ge,z,Z){Object(ue.a)(this,Ae),this.TAG="IOController",this._config=z,this._extraData=Z,this._stashInitialSize=1024*384,z.stashInitialSize!=null&&z.stashInitialSize>0&&(this._stashInitialSize=z.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,z.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ge,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ge.url),this._refTotalLength=ge.filesize?ge.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new p,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(z){this._extraData=z}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(z){this._onDataArrival=z}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(z){this._onSeeked=z}},{key:"onError",get:function(){return this._onError},set:function(z){this._onError=z}},{key:"onComplete",get:function(){return this._onComplete},set:function(z){this._onComplete=z}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(z){this._onRedirect=z}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(z){this._onRecoveredEarlyEof=z}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===I?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var z=this._config;if(z.seekType==="range")this._seekHandler=new H(this._config.rangeLoadZeroStart);else if(z.seekType==="param"){var Z=z.seekParamStart||"bstart",oe=z.seekParamEnd||"bend";this._seekHandler=new V(Z,oe)}else if(z.seekType==="custom"){if(typeof z.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new z.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(z.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=K;else if(C.isSupported())this._loaderClass=C;else if(_.isSupported())this._loaderClass=_;else if(I.isSupported())this._loaderClass=I;else throw new i("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(z){this._currentRange={from:0,to:-1},z&&(this._currentRange.from=z),this._speedSampler.reset(),z||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var z=this._resumeFrom;this._resumeFrom=0,this._internalSeek(z,!0)}}},{key:"seek",value:function(z){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(z,!0)}},{key:"_internalSeek",value:function(z,Z){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Z),this._loader.destroy(),this._loader=null;var oe={from:z,to:-1};this._currentRange={from:oe.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,oe),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(z){if(!z||typeof z!="string"||z.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=z}},{key:"_expandBuffer",value:function(z){for(var Z=this._stashSize;Z+1024*1024*10){var me=new Uint8Array(this._stashBuffer,0,this._stashUsed),Re=new Uint8Array(oe,0,Z);Re.set(me,0)}this._stashBuffer=oe,this._bufferSize=Z}},{key:"_normalizeSpeed",value:function(z){var Z=this._speedNormalizeList,oe=Z.length-1,me=0,Re=0,Je=oe;if(z=Z[me]&&z=512&&z<=1024?Z=Math.floor(z*1.5):Z=z*2,Z>8192&&(Z=8192);var oe=Z*1024+1024*1024*1;this._bufferSize0){var Qt=this._stashBuffer.slice(0,this._stashUsed),Vt=this._dispatchChunks(Qt,this._stashByteStart);if(Vt0){var ie=new Uint8Array(Qt,Vt);Et.set(ie,0),this._stashUsed=ie.byteLength,this._stashByteStart+=Vt}}else this._stashUsed=0,this._stashByteStart+=Vt;this._stashUsed+z.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+z.byteLength),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength}else{var N=this._dispatchChunks(z,Z);if(Nthis._bufferSize&&(this._expandBuffer(B),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(z,N),0),this._stashUsed+=B,this._stashByteStart=Z+N}}}else if(this._stashUsed===0){var Je=this._dispatchChunks(z,Z);if(Jethis._bufferSize&&this._expandBuffer(at);var kt=new Uint8Array(this._stashBuffer,0,this._bufferSize);kt.set(new Uint8Array(z,Je),0),this._stashUsed+=at,this._stashByteStart=Z+Je}}else{this._stashUsed+z.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+z.byteLength);var jt=new Uint8Array(this._stashBuffer,0,this._bufferSize);jt.set(new Uint8Array(z),this._stashUsed),this._stashUsed+=z.byteLength;var ot=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ot0){var wt=new Uint8Array(this._stashBuffer,ot);jt.set(wt,0)}this._stashUsed-=ot,this._stashByteStart+=ot}}},{key:"_flushStashBuffer",value:function(z){if(this._stashUsed>0){var Z=this._stashBuffer.slice(0,this._stashUsed),oe=this._dispatchChunks(Z,this._stashByteStart),me=Z.byteLength-oe;if(oe0){var Re=new Uint8Array(this._stashBuffer,0,this._bufferSize),Je=new Uint8Array(Z,oe);Re.set(Je,0),this._stashUsed=Je.byteLength,this._stashByteStart+=oe}return 0}return this._stashUsed=0,this._stashByteStart=0,me}return 0}},{key:"_onLoaderComplete",value:function(z,Z){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(z,Z){w.e(this.TAG,"Loader error, code = ".concat(Z.code,", msg = ").concat(Z.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,z=t.UNRECOVERABLE_EARLY_EOF);switch(z){case t.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var oe=this._currentRange.to+1;oe0){var Z=Ae.getConfig();z.emit("change",Z)}}},{key:"registerListener",value:function(z){Ae.emitter.addListener("change",z)}},{key:"removeListener",value:function(z){Ae.emitter.removeListener("change",z)}},{key:"addLogListener",value:function(z){w.emitter.addListener("log",z),w.emitter.listenerCount("log")>0&&(w.ENABLE_CALLBACK=!0,Ae._notifyChange())}},{key:"removeLogListener",value:function(z){w.emitter.removeListener("log",z),w.emitter.listenerCount("log")===0&&(w.ENABLE_CALLBACK=!1,Ae._notifyChange())}}]),Ae}();Ee.emitter=new x.a;var xe=Ee,Ge=function(){function Ae(){Object(ue.a)(this,Ae),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(Q.a)(Ae,[{key:"isComplete",value:function(){var z=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Z=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&z&&Z}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(z){if(this.keyframesIndex==null)return null;var Z=this.keyframesIndex,oe=this._search(Z.times,z);return{index:oe,milliseconds:Z.times[oe],fileposition:Z.filepositions[oe]}}},{key:"_search",value:function(z,Z){var oe=0,me=z.length-1,Re=0,Je=0,at=me;for(Z=z[Re]&&Z=128){ge.push(String.fromCharCode(me&65535)),Z+=2;continue}}}else if(z[Z]<240){if(We(z,Z,2)){var Re=(z[Z]&15)<<12|(z[Z+1]&63)<<6|z[Z+2]&63;if(Re>=2048&&(Re&63488)!==55296){ge.push(String.fromCharCode(Re&65535)),Z+=3;continue}}}else if(z[Z]<248&&We(z,Z,3)){var Je=(z[Z]&7)<<18|(z[Z+1]&63)<<12|(z[Z+2]&63)<<6|z[Z+3]&63;if(Je>65536&&Je<1114112){Je-=65536,ge.push(String.fromCharCode(Je>>>10|55296)),ge.push(String.fromCharCode(Je&1023|56320)),Z+=4;continue}}}ge.push(String.fromCharCode(65533)),++Z}return ge.join("")}var de=ze,le=function(){var Ae=new ArrayBuffer(2);return new DataView(Ae).setInt16(0,256,!0),new Int16Array(Ae)[0]===256}(),Oe=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"parseScriptData",value:function(z,Z,oe){var me={};try{var Re=Ae.parseValue(z,Z,oe),Je=Ae.parseValue(z,Z+Re.size,oe-Re.size);me[Re.data]=Je.data}catch(at){w.e("AMF",at.toString())}return me}},{key:"parseObject",value:function(z,Z,oe){if(oe<3)throw new l("Data not enough when parse ScriptDataObject");var me=Ae.parseString(z,Z,oe),Re=Ae.parseValue(z,Z+me.size,oe-me.size),Je=Re.objectEnd;return{data:{name:me.data,value:Re.data},size:me.size+Re.size,objectEnd:Je}}},{key:"parseVariable",value:function(z,Z,oe){return Ae.parseObject(z,Z,oe)}},{key:"parseString",value:function(z,Z,oe){if(oe<2)throw new l("Data not enough when parse String");var me=new DataView(z,Z,oe),Re=me.getUint16(0,!le),Je;return Re>0?Je=de(new Uint8Array(z,Z+2,Re)):Je="",{data:Je,size:2+Re}}},{key:"parseLongString",value:function(z,Z,oe){if(oe<4)throw new l("Data not enough when parse LongString");var me=new DataView(z,Z,oe),Re=me.getUint32(0,!le),Je;return Re>0?Je=de(new Uint8Array(z,Z+4,Re)):Je="",{data:Je,size:4+Re}}},{key:"parseDate",value:function(z,Z,oe){if(oe<10)throw new l("Data size invalid when parse Date");var me=new DataView(z,Z,oe),Re=me.getFloat64(0,!le),Je=me.getInt16(8,!le);return Re+=Je*60*1e3,{data:new Date(Re),size:8+2}}},{key:"parseValue",value:function(z,Z,oe){if(oe<1)throw new l("Data not enough when parse Value");var me=new DataView(z,Z,oe),Re=1,Je=me.getUint8(0),at,kt=!1;try{switch(Je){case 0:at=me.getFloat64(1,!le),Re+=8;break;case 1:{var jt=me.getUint8(1);at=!!jt,Re+=1;break}case 2:{var ot=Ae.parseString(z,Z+1,oe-1);at=ot.data,Re+=ot.size;break}case 3:{at={};var wt=0;for((me.getUint32(oe-4,!le)&16777215)===9&&(wt=3);Re32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(z<=this._current_word_bits_left){var Z=this._current_word>>>32-z;return this._current_word<<=z,this._current_word_bits_left-=z,Z}var oe=this._current_word_bits_left?this._current_word:0;oe=oe>>>32-this._current_word_bits_left;var me=z-this._current_word_bits_left;this._fillCurrentWord();var Re=Math.min(me,this._current_word_bits_left),Je=this._current_word>>>32-Re;return this._current_word<<=Re,this._current_word_bits_left-=Re,oe=oe<>>z)!==0)return this._current_word<<=z,this._current_word_bits_left-=z,z;return this._fillCurrentWord(),z+this._skipLeadingZero()}},{key:"readUEG",value:function(){var z=this._skipLeadingZero();return this.readBits(z+1)-1}},{key:"readSEG",value:function(){var z=this.readUEG();return z&1?z+1>>>1:-1*(z>>>1)}}]),Ae}(),ee=qe,k=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"_ebsp2rbsp",value:function(z){for(var Z=z,oe=Z.byteLength,me=new Uint8Array(oe),Re=0,Je=0;Je=2&&(Z[Je]===3&&Z[Je-1]===0&&Z[Je-2]===0))continue;me[Re]=Z[Je],Re++}return new Uint8Array(me.buffer,0,Re)}},{key:"parseSPS",value:function(z){var Z=Ae._ebsp2rbsp(z),oe=new ee(Z);oe.readByte();var me=oe.readByte();oe.readByte();var Re=oe.readByte();oe.readUEG();var Je=Ae.getProfileString(me),at=Ae.getLevelString(Re),kt=1,jt=420,ot=[0,420,422,444],wt=8;if((me===100||me===110||me===122||me===244||me===44||me===83||me===86||me===118||me===128||me===138||me===144)&&(kt=oe.readUEG(),kt===3&&oe.readBits(1),kt<=3&&(jt=ot[kt]),wt=oe.readUEG()+8,oe.readUEG(),oe.readBits(1),oe.readBool()))for(var Kt=kt!==3?8:12,Et=0;Et0&&hr<16?(Ot=mi[hr-1],zt=Or[hr-1]):hr===255&&(Ot=oe.readByte()<<8|oe.readByte(),zt=oe.readByte()<<8|oe.readByte())}if(oe.readBool()&&oe.readBool(),oe.readBool()&&(oe.readBits(4),oe.readBool()&&oe.readBits(24)),oe.readBool()&&(oe.readUEG(),oe.readUEG()),oe.readBool()){var yr=oe.readBits(32),pr=oe.readBits(32);jn=oe.readBool(),Dr=pr,Cr=yr*2,an=Dr/Cr}}var Yr=1;(Ot!==1||zt!==1)&&(Yr=Ot/zt);var Mr=0,Zr=0;if(kt===0)Mr=1,Zr=2-fe;else{var wr=kt===3?1:2,vi=kt===1?2:1;Mr=wr,Zr=vi*(2-fe)}var li=(B+1)*16,Kr=(2-fe)*((ae+1)*16);li-=(se+$e)*Mr,Kr-=(St+Pt)*Zr;var zr=Math.ceil(li*Yr);return oe.destroy(),oe=null,{profile_string:Je,level_string:at,bit_depth:wt,ref_frames:N,chroma_format:jt,chroma_format_string:Ae.getChromaFormatString(jt),frame_rate:{fixed:jn,fps:an,fps_den:Cr,fps_num:Dr},sar_ratio:{width:Ot,height:zt},codec_size:{width:li,height:Kr},present_size:{width:zr,height:Kr}}}},{key:"_skipScalingList",value:function(z,Z){for(var oe=8,me=8,Re=0,Je=0;Je>>8&255|(Ae&255)<<8}function be(Ae){return(Ae&4278190080)>>>24|(Ae&16711680)>>>8|(Ae&65280)<<8|(Ae&255)<<24}function ke(Ae,ge){return Ae[ge]<<24|Ae[ge+1]<<16|Ae[ge+2]<<8|Ae[ge+3]}var ct=function(){function Ae(ge,z){Object(ue.a)(this,Ae),this.TAG="FLVDemuxer",this._config=z,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ge.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ge.hasAudioTrack,this._hasVideo=ge.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new je,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var Z=new ArrayBuffer(2);return new DataView(Z).setInt16(0,256,!0),new Int16Array(Z)[0]===256}()}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(z){return z.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(z){this._onTrackMetadata=z}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(z){this._onMediaInfo=z}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(z){this._onMetaDataArrived=z}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(z){this._onScriptDataArrived=z}},{key:"onError",get:function(){return this._onError},set:function(z){this._onError=z}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(z){this._onDataAvailable=z}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(z){this._timestampBase=z}},{key:"overridedDuration",get:function(){return this._duration},set:function(z){this._durationOverrided=!0,this._duration=z,this._mediaInfo.duration=z}},{key:"overridedHasAudio",set:function(z){this._hasAudioFlagOverrided=!0,this._hasAudio=z,this._mediaInfo.hasAudio=z}},{key:"overridedHasVideo",set:function(z){this._hasVideoFlagOverrided=!0,this._hasVideo=z,this._mediaInfo.hasVideo=z}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new je}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(z,Z){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new l("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var oe=0,me=this._littleEndian;if(Z===0)if(z.byteLength>13){var Re=Ae.probe(z);oe=Re.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,Z+oe!==this._dataOffset&&w.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Je=new DataView(z,oe),at=Je.getUint32(0,!me);at!==0&&w.w(this.TAG,"PrevTagSize0 !== 0 !!!"),oe+=4}for(;oez.byteLength)break;var jt=kt.getUint8(0),ot=kt.getUint32(0,!me)&16777215;if(oe+11+ot+4>z.byteLength)break;if(jt!==8&&jt!==9&&jt!==18){w.w(this.TAG,"Unsupported tag type ".concat(jt,", skipped")),oe+=11+ot+4;continue}var wt=kt.getUint8(4),Kt=kt.getUint8(5),Et=kt.getUint8(6),Qt=kt.getUint8(7),Vt=Et|Kt<<8|wt<<16|Qt<<24,ie=kt.getUint32(7,!me)&16777215;ie!==0&&w.w(this.TAG,"Meet tag which has StreamID != 0!");var N=oe+11;switch(jt){case 8:this._parseAudioData(z,N,ot,Vt);break;case 9:this._parseVideoData(z,N,ot,Vt,Z+oe);break;case 18:this._parseScriptData(z,N,ot);break}var B=kt.getUint32(11+ot,!me);B!==11+ot&&w.w(this.TAG,"Invalid PrevTagSize ".concat(B)),oe+=11+ot+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),oe}},{key:"_parseScriptData",value:function(z,Z,oe){var me=Ie.parseScriptData(z,Z,oe);if(me.hasOwnProperty("onMetaData")){if(me.onMetaData==null||typeof me.onMetaData!="object"){w.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&w.w(this.TAG,"Found another onMetaData tag!"),this._metadata=me;var Re=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Re)),typeof Re.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Re.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Re.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Re.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Re.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Re.audiodatarate),typeof Re.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Re.videodatarate),typeof Re.width=="number"&&(this._mediaInfo.width=Re.width),typeof Re.height=="number"&&(this._mediaInfo.height=Re.height),typeof Re.duration=="number"){if(!this._durationOverrided){var Je=Math.floor(Re.duration*this._timescale);this._duration=Je,this._mediaInfo.duration=Je}}else this._mediaInfo.duration=0;if(typeof Re.framerate=="number"){var at=Math.floor(Re.framerate*1e3);if(at>0){var kt=at/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=kt,this._referenceFrameRate.fps_num=at,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=kt}}if(typeof Re.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var jt=Re.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(jt),Re.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Re,w.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(me).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},me)))}},{key:"_parseKeyframesIndex",value:function(z){for(var Z=[],oe=[],me=1;me>>4;if(kt!==2&&kt!==10){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+kt);return}var jt=0,ot=(at&12)>>>2;if(ot>=0&&ot<=4)jt=this._flvSoundRateTable[ot];else{this._onError(Y.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ot);return}var wt=(at&2)>>>1,Kt=at&1,Et=this._audioMetadata,Qt=this._audioTrack;if(Et||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Et=this._audioMetadata={},Et.type="audio",Et.id=Qt.id,Et.timescale=this._timescale,Et.duration=this._duration,Et.audioSampleRate=jt,Et.channelCount=Kt===0?1:2),kt===10){var Vt=this._parseAACAudioData(z,Z+1,oe-1);if(Vt==null)return;if(Vt.packetType===0){Et.config&&w.w(this.TAG,"Found another AudioSpecificConfig!");var ie=Vt.data;Et.audioSampleRate=ie.samplingRate,Et.channelCount=ie.channelCount,Et.codec=ie.codec,Et.originalCodec=ie.originalCodec,Et.config=ie.config,Et.refSampleDuration=1024/Et.audioSampleRate*Et.timescale,w.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Et);var N=this._mediaInfo;N.audioCodec=Et.originalCodec,N.audioSampleRate=Et.audioSampleRate,N.audioChannelCount=Et.channelCount,N.hasVideo?N.videoCodec!=null&&(N.mimeType='video/x-flv; codecs="'+N.videoCodec+","+N.audioCodec+'"'):N.mimeType='video/x-flv; codecs="'+N.audioCodec+'"',N.isComplete()&&this._onMediaInfo(N)}else if(Vt.packetType===1){var B=this._timestampBase+me,ae={unit:Vt.data,length:Vt.data.byteLength,dts:B,pts:B};Qt.samples.push(ae),Qt.length+=Vt.data.length}else w.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Vt.packetType))}else if(kt===2){if(!Et.codec){var fe=this._parseMP3AudioData(z,Z+1,oe-1,!0);if(fe==null)return;Et.audioSampleRate=fe.samplingRate,Et.channelCount=fe.channelCount,Et.codec=fe.codec,Et.originalCodec=fe.originalCodec,Et.refSampleDuration=1152/Et.audioSampleRate*Et.timescale,w.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Et);var se=this._mediaInfo;se.audioCodec=Et.codec,se.audioSampleRate=Et.audioSampleRate,se.audioChannelCount=Et.channelCount,se.audioDataRate=fe.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var $e=this._parseMP3AudioData(z,Z+1,oe-1,!1);if($e==null)return;var St=this._timestampBase+me,Pt={unit:$e,length:$e.byteLength,dts:St,pts:St};Qt.samples.push(Pt),Qt.length+=$e.length}}},{key:"_parseAACAudioData",value:function(z,Z,oe){if(oe<=1){w.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var me={},Re=new Uint8Array(z,Z,oe);return me.packetType=Re[0],Re[0]===0?me.data=this._parseAACAudioSpecificConfig(z,Z+1,oe-1):me.data=Re.subarray(1),me}},{key:"_parseAACAudioSpecificConfig",value:function(z,Z,oe){var me=new Uint8Array(z,Z,oe),Re=null,Je=0,at=0,kt=null,jt=0,ot=null;if(Je=at=me[0]>>>3,jt=(me[0]&7)<<1|me[1]>>>7,jt<0||jt>=this._mpegSamplingRates.length){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var wt=this._mpegSamplingRates[jt],Kt=(me[1]&120)>>>3;if(Kt<0||Kt>=8){this._onError(Y.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Je===5&&(ot=(me[1]&7)<<1|me[2]>>>7,kt=(me[2]&124)>>>2);var Et=self.navigator.userAgent.toLowerCase();return Et.indexOf("firefox")!==-1?jt>=6?(Je=5,Re=new Array(4),ot=jt-3):(Je=2,Re=new Array(2),ot=jt):Et.indexOf("android")!==-1?(Je=2,Re=new Array(2),ot=jt):(Je=5,ot=jt,Re=new Array(4),jt>=6?ot=jt-3:Kt===1&&(Je=2,Re=new Array(2),ot=jt)),Re[0]=Je<<3,Re[0]|=(jt&15)>>>1,Re[1]=(jt&15)<<7,Re[1]|=(Kt&15)<<3,Je===5&&(Re[1]|=(ot&15)>>>1,Re[2]=(ot&1)<<7,Re[2]|=2<<2,Re[3]=0),{config:Re,samplingRate:wt,channelCount:Kt,codec:"mp4a.40."+Je,originalCodec:"mp4a.40."+at}}},{key:"_parseMP3AudioData",value:function(z,Z,oe,me){if(oe<4){w.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Re=this._littleEndian,Je=new Uint8Array(z,Z,oe),at=null;if(me){if(Je[0]!==255)return;var kt=Je[1]>>>3&3,jt=(Je[1]&6)>>1,ot=(Je[2]&240)>>>4,wt=(Je[2]&12)>>>2,Kt=Je[3]>>>6&3,Et=Kt!==3?2:1,Qt=0,Vt=0,ie=34,N="mp3";switch(kt){case 0:Qt=this._mpegAudioV25SampleRateTable[wt];break;case 2:Qt=this._mpegAudioV20SampleRateTable[wt];break;case 3:Qt=this._mpegAudioV10SampleRateTable[wt];break}switch(jt){case 1:ie=34,ot>>4,kt=Je&15;if(kt!==7){this._onError(Y.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(kt));return}this._parseAVCVideoPacket(z,Z+1,oe-1,me,Re,at)}},{key:"_parseAVCVideoPacket",value:function(z,Z,oe,me,Re,Je){if(oe<4){w.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var at=this._littleEndian,kt=new DataView(z,Z,oe),jt=kt.getUint8(0),ot=kt.getUint32(0,!at)&16777215,wt=ot<<8>>8;if(jt===0)this._parseAVCDecoderConfigurationRecord(z,Z+4,oe-4);else if(jt===1)this._parseAVCVideoData(z,Z+4,oe-4,me,Re,Je,wt);else if(!(jt===2)){this._onError(Y.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(jt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(z,Z,oe){if(oe<7){w.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var me=this._videoMetadata,Re=this._videoTrack,Je=this._littleEndian,at=new DataView(z,Z,oe);me?typeof me.avcc!="undefined"&&w.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),me=this._videoMetadata={},me.type="video",me.id=Re.id,me.timescale=this._timescale,me.duration=this._duration);var kt=at.getUint8(0),jt=at.getUint8(1),ot=at.getUint8(2),wt=at.getUint8(3);if(kt!==1||jt===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(at.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Y.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Kt=at.getUint8(5)&31;if(Kt===0){this._onError(Y.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Kt>1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Kt));for(var Et=6,Qt=0;Qt1&&w.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat($t));Et++;for(var Ot=0;Ot<$t;Ot++){var zt=at.getUint16(Et,!Je);if(Et+=2,zt===0)continue;Et+=zt}me.avcc=new Uint8Array(oe),me.avcc.set(new Uint8Array(z,Z,oe),0),w.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",me)}},{key:"_parseAVCVideoData",value:function(z,Z,oe,me,Re,Je,at){for(var kt=this._littleEndian,jt=new DataView(z,Z,oe),ot=[],wt=0,Kt=0,Et=this._naluLengthSize,Qt=this._timestampBase+me,Vt=Je===1;Kt=oe){w.w(this.TAG,"Malformed Nalu near timestamp ".concat(Qt,", offset = ").concat(Kt,", dataSize = ").concat(oe));break}var ie=jt.getUint32(Kt,!kt);if(Et===3&&(ie>>>=8),ie>oe-Et){w.w(this.TAG,"Malformed Nalus near timestamp ".concat(Qt,", NaluSize > DataSize!"));return}var N=jt.getUint8(Kt+Et)&31;N===5&&(Vt=!0);var B=new Uint8Array(z,Z+Kt,Et+ie),ae={type:N,data:B};ot.push(ae),wt+=B.byteLength,Kt+=Et+ie}if(ot.length){var fe=this._videoTrack,se={units:ot,length:wt,isKeyframe:Vt,dts:Qt,cts:at,pts:Qt+at};Vt&&(se.fileposition=Re),fe.samples.push(se),fe.length+=wt}}}],[{key:"probe",value:function(z){var Z=new Uint8Array(z),oe={match:!1};if(Z[0]!==70||Z[1]!==76||Z[2]!==86||Z[3]!==1)return oe;var me=(Z[4]&4)>>>2!==0,Re=(Z[4]&1)!==0,Je=ke(Z,5);return Je<9?oe:{match:!0,consumed:Je,dataOffset:Je,hasAudioTrack:me,hasVideoTrack:Re}}}]),Ae}(),He=ct,Be=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"init",value:function(){Ae.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var z in Ae.types)Ae.types.hasOwnProperty(z)&&(Ae.types[z]=[z.charCodeAt(0),z.charCodeAt(1),z.charCodeAt(2),z.charCodeAt(3)]);var Z=Ae.constants={};Z.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Z.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),Z.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),Z.STSC=Z.STCO=Z.STTS,Z.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Z.HDLR_VIDEO=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]),Z.HDLR_AUDIO=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]),Z.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Z.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Z.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(z){for(var Z=8,oe=null,me=Array.prototype.slice.call(arguments,1),Re=me.length,Je=0;Je>>24&255,oe[1]=Z>>>16&255,oe[2]=Z>>>8&255,oe[3]=Z&255,oe.set(z,4);for(var at=8,kt=0;kt>>24&255,z>>>16&255,z>>>8&255,z&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&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]))}},{key:"trak",value:function(z){return Ae.box(Ae.types.trak,Ae.tkhd(z),Ae.mdia(z))}},{key:"tkhd",value:function(z){var Z=z.id,oe=z.duration,me=z.presentWidth,Re=z.presentHeight;return Ae.box(Ae.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&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,me>>>8&255,me&255,0,0,Re>>>8&255,Re&255,0,0]))}},{key:"mdia",value:function(z){return Ae.box(Ae.types.mdia,Ae.mdhd(z),Ae.hdlr(z),Ae.minf(z))}},{key:"mdhd",value:function(z){var Z=z.timescale,oe=z.duration;return Ae.box(Ae.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,85,196,0,0]))}},{key:"hdlr",value:function(z){var Z=null;return z.type==="audio"?Z=Ae.constants.HDLR_AUDIO:Z=Ae.constants.HDLR_VIDEO,Ae.box(Ae.types.hdlr,Z)}},{key:"minf",value:function(z){var Z=null;return z.type==="audio"?Z=Ae.box(Ae.types.smhd,Ae.constants.SMHD):Z=Ae.box(Ae.types.vmhd,Ae.constants.VMHD),Ae.box(Ae.types.minf,Z,Ae.dinf(),Ae.stbl(z))}},{key:"dinf",value:function(){var z=Ae.box(Ae.types.dinf,Ae.box(Ae.types.dref,Ae.constants.DREF));return z}},{key:"stbl",value:function(z){var Z=Ae.box(Ae.types.stbl,Ae.stsd(z),Ae.box(Ae.types.stts,Ae.constants.STTS),Ae.box(Ae.types.stsc,Ae.constants.STSC),Ae.box(Ae.types.stsz,Ae.constants.STSZ),Ae.box(Ae.types.stco,Ae.constants.STCO));return Z}},{key:"stsd",value:function(z){return z.type==="audio"?z.codec==="mp3"?Ae.box(Ae.types.stsd,Ae.constants.STSD_PREFIX,Ae.mp3(z)):Ae.box(Ae.types.stsd,Ae.constants.STSD_PREFIX,Ae.mp4a(z)):Ae.box(Ae.types.stsd,Ae.constants.STSD_PREFIX,Ae.avc1(z))}},{key:"mp3",value:function(z){var Z=z.channelCount,oe=z.audioSampleRate,me=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Ae.box(Ae.types[".mp3"],me)}},{key:"mp4a",value:function(z){var Z=z.channelCount,oe=z.audioSampleRate,me=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Z,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Ae.box(Ae.types.mp4a,me,Ae.esds(z))}},{key:"esds",value:function(z){var Z=z.config||[],oe=Z.length,me=new Uint8Array([0,0,0,0,3,23+oe,0,1,0,4,15+oe,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([oe]).concat(Z).concat([6,1,2]));return Ae.box(Ae.types.esds,me)}},{key:"avc1",value:function(z){var Z=z.avcc,oe=z.codecWidth,me=z.codecHeight,Re=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,oe>>>8&255,oe&255,me>>>8&255,me&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return Ae.box(Ae.types.avc1,Re,Ae.box(Ae.types.avcC,Z))}},{key:"mvex",value:function(z){return Ae.box(Ae.types.mvex,Ae.trex(z))}},{key:"trex",value:function(z){var Z=z.id,oe=new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Ae.box(Ae.types.trex,oe)}},{key:"moof",value:function(z,Z){return Ae.box(Ae.types.moof,Ae.mfhd(z.sequenceNumber),Ae.traf(z,Z))}},{key:"mfhd",value:function(z){var Z=new Uint8Array([0,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255]);return Ae.box(Ae.types.mfhd,Z)}},{key:"traf",value:function(z,Z){var oe=z.id,me=Ae.box(Ae.types.tfhd,new Uint8Array([0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255])),Re=Ae.box(Ae.types.tfdt,new Uint8Array([0,0,0,0,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255])),Je=Ae.sdtp(z),at=Ae.trun(z,Je.byteLength+16+16+8+16+8+8);return Ae.box(Ae.types.traf,me,Re,at,Je)}},{key:"sdtp",value:function(z){for(var Z=z.samples||[],oe=Z.length,me=new Uint8Array(4+oe),Re=0;Re>>24&255,me>>>16&255,me>>>8&255,me&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255],0);for(var at=0;at>>24&255,kt>>>16&255,kt>>>8&255,kt&255,jt>>>24&255,jt>>>16&255,jt>>>8&255,jt&255,ot.isLeading<<2|ot.dependsOn,ot.isDependedOn<<6|ot.hasRedundancy<<4|ot.isNonSync,0,0,wt>>>24&255,wt>>>16&255,wt>>>8&255,wt&255],12+16*at)}return Ae.box(Ae.types.trun,Je)}},{key:"mdat",value:function(z){return Ae.box(Ae.types.mdat,z)}}]),Ae}();Be.init();var Ze=Be,ht=function(){function Ae(){Object(ue.a)(this,Ae)}return Object(Q.a)(Ae,null,[{key:"getSilentFrame",value:function(z,Z){if(z==="mp4a.40.2"){if(Z===1)return new Uint8Array([0,200,0,128,35,128]);if(Z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Z===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(Z===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])}else{if(Z===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(Z===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(Z===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])}return null}}]),Ae}(),Qe=ht,Xe=function Ae(ge,z,Z,oe,me){Object(ue.a)(this,Ae),this.dts=ge,this.pts=z,this.duration=Z,this.originalDts=oe,this.isSyncPoint=me,this.fileposition=null},Ke=function(){function Ae(){Object(ue.a)(this,Ae),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(Q.a)(Ae,[{key:"appendSyncPoint",value:function(z){z.isSyncPoint=!0,this.syncPoints.push(z)}}]),Ae}(),Fe=function(){function Ae(){Object(ue.a)(this,Ae),this._list=[]}return Object(Q.a)(Ae,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(z){var Z=this._list;if(z.length===0)return;Z.length>0&&z[0].originalDts=Z[Re].dts&&zZ[me].lastSample.originalDts&&z=Z[me].lastSample.originalDts&&(me===Z.length-1||me0&&(Re=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Re,this._list.splice(Re,0,oe)}},{key:"getLastSegmentBefore",value:function(z){var Z=this._searchNearestSegmentBefore(z);return Z>=0?this._list[Z]:null}},{key:"getLastSampleBefore",value:function(z){var Z=this.getLastSegmentBefore(z);return Z!=null?Z.lastSample:null}},{key:"getLastSyncPointBefore",value:function(z){for(var Z=this._searchNearestSegmentBefore(z),oe=this._list[Z].syncPoints;oe.length===0&&Z>0;)Z--,oe=this._list[Z].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Ae}(),_e=function(){function Ae(ge){Object(ue.a)(this,Ae),this.TAG="MP4Remuxer",this._config=ge,this._isLive=ge.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ue("audio"),this._videoSegmentInfoList=new Ue("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661)),this._fillSilentAfterSeek=g.msedge||g.msie,this._mp3UseMpegAudio=!g.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(z){return z.onDataAvailable=this.remux.bind(this),z.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(z){this._onInitSegment=z}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(z){this._onMediaSegment=z}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(z){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(z,Z){if(!this._onMediaSegment)throw new l("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(z,Z),this._remuxVideo(Z),this._remuxAudio(z)}},{key:"_onTrackMetadataReceived",value:function(z,Z){var oe=null,me="mp4",Re=Z.codec;if(z==="audio")this._audioMeta=Z,Z.codec==="mp3"&&this._mp3UseMpegAudio?(me="mpeg",Re="",oe=new Uint8Array):oe=Ze.generateInitSegment(Z);else if(z==="video")this._videoMeta=Z,oe=Ze.generateInitSegment(Z);else return;if(!this._onInitSegment)throw new l("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(z,{type:z,data:oe.buffer,codec:Re,container:"".concat(z,"/").concat(me),mediaDuration:Z.duration})}},{key:"_calculateDtsBase",value:function(z,Z){if(this._dtsBaseInited)return;z.samples&&z.samples.length&&(this._audioDtsBase=z.samples[0].dts),Z.samples&&Z.samples.length&&(this._videoDtsBase=Z.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var z=this._videoStashedLastSample,Z=this._audioStashedLastSample,oe={type:"video",id:1,sequenceNumber:0,samples:[],length:0};z!=null&&(oe.samples.push(z),oe.length=z.length);var me={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Z!=null&&(me.samples.push(Z),me.length=Z.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(oe,!0),this._remuxAudio(me,!0)}},{key:"_remuxAudio",value:function(z,Z){if(this._audioMeta==null)return;var oe=z,me=oe.samples,Re=void 0,Je=-1,at=-1,kt=-1,jt=this._audioMeta.refSampleDuration,ot=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,wt=this._dtsBaseInited&&this._audioNextDts===void 0,Kt=!1;if(!me||me.length===0)return;if(me.length===1&&!Z)return;var Et=0,Qt=null,Vt=0;ot?(Et=0,Vt=oe.length):(Et=8,Vt=8+oe.length);var ie=null;if(me.length>1&&(ie=me.pop(),Vt-=ie.length),this._audioStashedLastSample!=null){var N=this._audioStashedLastSample;this._audioStashedLastSample=null,me.unshift(N),Vt+=N.length}ie!=null&&(this._audioStashedLastSample=ie);var B=me[0].dts-this._dtsBase;if(this._audioNextDts)Re=B-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Re=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Kt=!0));else{var ae=this._audioSegmentInfoList.getLastSampleBefore(B);if(ae!=null){var fe=B-(ae.originalDts+ae.duration);fe<=3&&(fe=0);var se=ae.dts+ae.duration+fe;Re=B-se}else Re=0}if(Kt){var $e=B-Re,St=this._videoSegmentInfoList.getLastSegmentBefore(B);if(St!=null&&St.beginDts<$e){var Pt=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Pt){var $t=St.beginDts,Ot=$e-St.beginDts;w.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat($t,", duration: ").concat(Ot)),me.unshift({unit:Pt,dts:$t,pts:$t}),Vt+=Pt.byteLength}}else Kt=!1}for(var zt=[],an=0;an=1?hr=zt[zt.length-1].duration:hr=Math.floor(jt);var yr=!1,pr=null;if(hr>jt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!g.safari){yr=!0;var Yr=Math.abs(hr-jt),Mr=Math.ceil(Yr/jt),Zr=Nn+jt;w.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. `+"dts: ".concat(Nn+hr," ms, expected: ").concat(Nn+Math.round(jt)," ms, ")+"delta: ".concat(Math.round(Yr)," ms, generate: ").concat(Mr," frames"));var wr=Qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);wr==null&&(w.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),wr=Dr),pr=[];for(var vi=0;vi0){var Kr=pr[pr.length-1];Kr.duration=li-Kr.dts}var zr={dts:li,pts:li,cts:0,unit:wr,size:wr.byteLength,duration:0,originalDts:Cr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};pr.push(zr),Vt+=zr.size,Zr+=jt}var xi=pr[pr.length-1];xi.duration=Nn+hr-xi.dts,hr=Math.round(jt)}zt.push({dts:Nn,pts:Nn,cts:0,unit:jn.unit,size:jn.unit.byteLength,duration:hr,originalDts:Cr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),yr&&zt.push.apply(zt,pr)}ot?Qt=new Uint8Array(Vt):(Qt=new Uint8Array(Vt),Qt[0]=Vt>>>24&255,Qt[1]=Vt>>>16&255,Qt[2]=Vt>>>8&255,Qt[3]=Vt&255,Qt.set(Ze.types.mdat,4));for(var gi=0;gi1&&(Et=me.pop(),Kt-=Et.length),this._videoStashedLastSample!=null){var Qt=this._videoStashedLastSample;this._videoStashedLastSample=null,me.unshift(Qt),Kt+=Qt.length}Et!=null&&(this._videoStashedLastSample=Et);var Vt=me[0].dts-this._dtsBase;if(this._videoNextDts)Re=Vt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Re=0;else{var ie=this._videoSegmentInfoList.getLastSampleBefore(Vt);if(ie!=null){var N=Vt-(ie.originalDts+ie.duration);N<=3&&(N=0);var B=ie.dts+ie.duration+N;Re=Vt-B}else Re=0}for(var ae=new Ke,fe=[],se=0;se=1?an=fe[fe.length-1].duration:an=Math.floor(this._videoMeta.refSampleDuration);if(Pt){var Cr=new Xe($t,zt,an,$e.dts,!0);Cr.fileposition=$e.fileposition,ae.appendSyncPoint(Cr)}fe.push({dts:$t,pts:zt,cts:Ot,units:$e.units,size:$e.length,isKeyframe:Pt,duration:an,originalDts:St,flags:{isLeading:0,dependsOn:Pt?2:1,isDependedOn:Pt?1:0,hasRedundancy:0,isNonSync:Pt?0:1}})}wt=new Uint8Array(Kt),wt[0]=Kt>>>24&255,wt[1]=Kt>>>16&255,wt[2]=Kt>>>8&255,wt[3]=Kt&255,wt.set(Ze.types.mdat,4);for(var Nn=0;Nn0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Re=this._demuxer.parseChunks(z,Z);else if((me=He.probe(z)).match){this._demuxer=new He(me,this._config),this._remuxer||(this._remuxer=new Ce(this._config));var Je=this._mediaDataSource;Je.duration!=null&&!isNaN(Je.duration)&&(this._demuxer.overridedDuration=Je.duration),typeof Je.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Je.hasAudio),typeof Je.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Je.hasVideo),this._demuxer.timestampBase=Je.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),Re=this._demuxer.parseChunks(z,Z)}else me=null,w.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){oe._internalAbort()}),this._emitter.emit(De.DEMUX_ERROR,Y.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Re=0;return Re}},{key:"_onMediaInfo",value:function(z){var Z=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},z),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,je.prototype));var oe=Object.assign({},z);Object.setPrototypeOf(oe,je.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=oe,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var me=Z._pendingSeekTime;Z._pendingSeekTime=null,Z.seek(me)})}},{key:"_onMetaDataArrived",value:function(z){this._emitter.emit(De.METADATA_ARRIVED,z)}},{key:"_onScriptDataArrived",value:function(z){this._emitter.emit(De.SCRIPTDATA_ARRIVED,z)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(z){var Z=z,oe=Z+1;oe0&&oe[0].originalDts===me&&(me=oe[0].pts),this._emitter.emit(De.RECOMMEND_SEEKPOINT,me)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(z){var Z=this._mediaInfo.segments[z],oe=Object.assign({},Z);oe.duration=this._mediaInfo.duration,oe.segmentCount=this._mediaInfo.segmentCount,delete oe.segments,delete oe.keyframesIndex,this._emitter.emit(De.MEDIA_INFO,oe)}},{key:"_reportStatisticsInfo",value:function(){var z={};z.url=this._ioctl.currentURL,z.hasRedirect=this._ioctl.hasRedirect,z.hasRedirect&&(z.redirectedURL=this._ioctl.currentRedirectedURL),z.speed=this._ioctl.currentSpeed,z.loaderType=this._ioctl.loaderType,z.currentSegmentIndex=this._currentSegmentIndex,z.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(De.STATISTICS_INFO,z)}}]),Ae}(),tt=rt,xt=function(ge){var z="TransmuxingWorker",Z=null,oe=Vt.bind(this);S.install(),ge.addEventListener("message",function(ie){switch(ie.data.cmd){case"init":Z=new tt(ie.data.param[0],ie.data.param[1]),Z.on(De.IO_ERROR,Kt.bind(this)),Z.on(De.DEMUX_ERROR,Et.bind(this)),Z.on(De.INIT_SEGMENT,me.bind(this)),Z.on(De.MEDIA_SEGMENT,Re.bind(this)),Z.on(De.LOADING_COMPLETE,Je.bind(this)),Z.on(De.RECOVERED_EARLY_EOF,at.bind(this)),Z.on(De.MEDIA_INFO,kt.bind(this)),Z.on(De.METADATA_ARRIVED,jt.bind(this)),Z.on(De.SCRIPTDATA_ARRIVED,ot.bind(this)),Z.on(De.STATISTICS_INFO,wt.bind(this)),Z.on(De.RECOMMEND_SEEKPOINT,Qt.bind(this));break;case"destroy":Z&&(Z.destroy(),Z=null),ge.postMessage({msg:"destroyed"});break;case"start":Z.start();break;case"stop":Z.stop();break;case"seek":Z.seek(ie.data.param);break;case"pause":Z.pause();break;case"resume":Z.resume();break;case"logging_config":{var N=ie.data.param;xe.applyConfig(N),N.enableCallback===!0?xe.addLogListener(oe):xe.removeLogListener(oe);break}}});function me(ie,N){var B={msg:De.INIT_SEGMENT,data:{type:ie,data:N}};ge.postMessage(B,[N.data])}function Re(ie,N){var B={msg:De.MEDIA_SEGMENT,data:{type:ie,data:N}};ge.postMessage(B,[N.data])}function Je(){var ie={msg:De.LOADING_COMPLETE};ge.postMessage(ie)}function at(){var ie={msg:De.RECOVERED_EARLY_EOF};ge.postMessage(ie)}function kt(ie){var N={msg:De.MEDIA_INFO,data:ie};ge.postMessage(N)}function jt(ie){var N={msg:De.METADATA_ARRIVED,data:ie};ge.postMessage(N)}function ot(ie){var N={msg:De.SCRIPTDATA_ARRIVED,data:ie};ge.postMessage(N)}function wt(ie){var N={msg:De.STATISTICS_INFO,data:ie};ge.postMessage(N)}function Kt(ie,N){ge.postMessage({msg:De.IO_ERROR,data:{type:ie,info:N}})}function Et(ie,N){ge.postMessage({msg:De.DEMUX_ERROR,data:{type:ie,info:N}})}function Qt(ie){ge.postMessage({msg:De.RECOMMEND_SEEKPOINT,data:ie})}function Vt(ie,N){ge.postMessage({msg:"logcat_callback",data:{type:ie,logcat:N}})}},Mt=xt,Bt=function(){function Ae(ge,z){if(Object(ue.a)(this,Ae),this.TAG="Transmuxer",this._emitter=new x.a,z.enableWorker&&typeof Worker!="undefined")try{var Z=F("0r65");this._worker=Z(Mt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ge,z]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},xe.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:xe.getConfig()})}catch(me){w.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new tt(ge,z)}else this._controller=new tt(ge,z);if(this._controller){var oe=this._controller;oe.on(De.IO_ERROR,this._onIOError.bind(this)),oe.on(De.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(De.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(De.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(De.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(De.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(De.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(De.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(De.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(De.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(De.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),xe.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(z,Z){this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(z){this._worker?this._worker.postMessage({cmd:"seek",param:z}):this._controller.seek(z)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.INIT_SEGMENT,z,Z)})}},{key:"_onMediaSegment",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.MEDIA_SEGMENT,z,Z)})}},{key:"_onLoadingComplete",value:function(){var z=this;Promise.resolve().then(function(){z._emitter.emit(De.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var z=this;Promise.resolve().then(function(){z._emitter.emit(De.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.MEDIA_INFO,z)})}},{key:"_onMetaDataArrived",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.METADATA_ARRIVED,z)})}},{key:"_onScriptDataArrived",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.SCRIPTDATA_ARRIVED,z)})}},{key:"_onStatisticsInfo",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.STATISTICS_INFO,z)})}},{key:"_onIOError",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.IO_ERROR,z,Z)})}},{key:"_onDemuxError",value:function(z,Z){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(De.DEMUX_ERROR,z,Z)})}},{key:"_onRecommendSeekpoint",value:function(z){var Z=this;Promise.resolve().then(function(){Z._emitter.emit(De.RECOMMEND_SEEKPOINT,z)})}},{key:"_onLoggingConfigChanged",value:function(z){this._worker&&this._worker.postMessage({cmd:"logging_config",param:z})}},{key:"_onWorkerMessage",value:function(z){var Z=z.data,oe=Z.data;if(Z.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Z.msg){case De.INIT_SEGMENT:case De.MEDIA_SEGMENT:this._emitter.emit(Z.msg,oe.type,oe.data);break;case De.LOADING_COMPLETE:case De.RECOVERED_EARLY_EOF:this._emitter.emit(Z.msg);break;case De.MEDIA_INFO:Object.setPrototypeOf(oe,je.prototype),this._emitter.emit(Z.msg,oe);break;case De.METADATA_ARRIVED:case De.SCRIPTDATA_ARRIVED:case De.STATISTICS_INFO:this._emitter.emit(Z.msg,oe);break;case De.IO_ERROR:case De.DEMUX_ERROR:this._emitter.emit(Z.msg,oe.type,oe.info);break;case De.RECOMMEND_SEEKPOINT:this._emitter.emit(Z.msg,oe);break;case"logcat_callback":w.emitter.emit("log",oe.type,oe.logcat);break;default:break}}}]),Ae}(),It=Bt,Dt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},lt=Dt,pt=function(){function Ae(ge){Object(ue.a)(this,Ae),this.TAG="MSEController",this._config=ge,this._emitter=new x.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Fe}return Object(Q.a)(Ae,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(z,Z){this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"attachMediaElement",value:function(z){if(this._mediaSource)throw new l("MediaSource has been attached to an HTMLMediaElement!");var Z=this._mediaSource=new window.MediaSource;Z.addEventListener("sourceopen",this.e.onSourceOpen),Z.addEventListener("sourceended",this.e.onSourceEnded),Z.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=z,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),z.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var z=this._mediaSource;for(var Z in this._sourceBuffers){var oe=this._pendingSegments[Z];oe.splice(0,oe.length),this._pendingSegments[Z]=null,this._pendingRemoveRanges[Z]=null,this._lastInitSegments[Z]=null;var me=this._sourceBuffers[Z];if(me){if(z.readyState!=="closed"){try{z.removeSourceBuffer(me)}catch(Re){w.e(this.TAG,Re.message)}me.removeEventListener("error",this.e.onSourceBufferError),me.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Z]=null,this._sourceBuffers[Z]=null}}if(z.readyState==="open")try{z.endOfStream()}catch(Re){w.e(this.TAG,Re.message)}z.removeEventListener("sourceopen",this.e.onSourceOpen),z.removeEventListener("sourceended",this.e.onSourceEnded),z.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(z,Z){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(z),this._pendingSegments[z.type].push(z);return}var oe=z,me="".concat(oe.container);oe.codec&&oe.codec.length>0&&(me+=";codecs=".concat(oe.codec));var Re=!1;if(w.v(this.TAG,"Received Initialization Segment, mimeType: "+me),this._lastInitSegments[oe.type]=oe,me!==this._mimeTypes[oe.type]){if(this._mimeTypes[oe.type])w.v(this.TAG,"Notice: ".concat(oe.type," mimeType changed, origin: ").concat(this._mimeTypes[oe.type],", target: ").concat(me));else{Re=!0;try{var Je=this._sourceBuffers[oe.type]=this._mediaSource.addSourceBuffer(me);Je.addEventListener("error",this.e.onSourceBufferError),Je.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(at){w.e(this.TAG,at.message),this._emitter.emit(lt.ERROR,{code:at.code,msg:at.message});return}}this._mimeTypes[oe.type]=me}Z||this._pendingSegments[oe.type].push(oe),Re||this._sourceBuffers[oe.type]&&!this._sourceBuffers[oe.type].updating&&this._doAppendSegments(),g.safari&&oe.container==="audio/mpeg"&&oe.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=oe.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(z){var Z=z;this._pendingSegments[Z.type].push(Z),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var oe=this._sourceBuffers[Z.type];oe&&!oe.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(z){for(var Z in this._sourceBuffers){if(!this._sourceBuffers[Z])continue;var oe=this._sourceBuffers[Z];if(this._mediaSource.readyState==="open")try{oe.abort()}catch(jt){w.e(this.TAG,jt.message)}this._idrList.clear();var me=this._pendingSegments[Z];if(me.splice(0,me.length),this._mediaSource.readyState==="closed")continue;for(var Re=0;Re=1&&z-me.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var z=this._mediaElement.currentTime;for(var Z in this._sourceBuffers){var oe=this._sourceBuffers[Z];if(oe){for(var me=oe.buffered,Re=!1,Je=0;Je=this._config.autoCleanupMaxBackwardDuration){Re=!0;var jt=z-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Z].push({start:at,end:jt})}}else kt0&&(isNaN(Z)||oe>Z)&&(w.v(this.TAG,"Update MediaSource duration from ".concat(Z," to ").concat(oe)),this._mediaSource.duration=oe),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var z in this._pendingRemoveRanges){if(!this._sourceBuffers[z]||this._sourceBuffers[z].updating)continue;for(var Z=this._sourceBuffers[z],oe=this._pendingRemoveRanges[z];oe.length&&!Z.updating;){var me=oe.shift();Z.remove(me.start,me.end)}}}},{key:"_doAppendSegments",value:function(){var z=this._pendingSegments;for(var Z in z){if(!this._sourceBuffers[Z]||this._sourceBuffers[Z].updating)continue;if(z[Z].length>0){var oe=z[Z].shift();if(oe.timestampOffset){var me=this._sourceBuffers[Z].timestampOffset,Re=oe.timestampOffset/1e3,Je=Math.abs(me-Re);Je>.1&&(w.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(me," to ").concat(Re)),this._sourceBuffers[Z].timestampOffset=Re),delete oe.timestampOffset}if(!oe.data||oe.data.byteLength===0)continue;try{this._sourceBuffers[Z].appendBuffer(oe.data),this._isBufferFull=!1,Z==="video"&&oe.hasOwnProperty("info")&&this._idrList.appendArray(oe.info.syncPoints)}catch(at){this._pendingSegments[Z].unshift(oe),at.code===22?(this._isBufferFull||this._emitter.emit(lt.BUFFER_FULL),this._isBufferFull=!0):(w.e(this.TAG,at.message),this._emitter.emit(lt.ERROR,{code:at.code,msg:at.message}))}}}}},{key:"_onSourceOpen",value:function(){if(w.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var z=this._pendingSourceBufferInit;z.length;){var Z=z.shift();this.appendInitSegment(Z,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(lt.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){w.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){w.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var z=this._pendingSegments;return z.video.length>0||z.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var z=this._pendingRemoveRanges;return z.video.length>0||z.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(lt.UPDATE_END)}},{key:"_onSourceBufferError",value:function(z){w.e(this.TAG,"SourceBuffer Error: ".concat(z))}}]),Ae}(),ut=pt,Pe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ve={NETWORK_EXCEPTION:t.EXCEPTION,NETWORK_STATUS_CODE_INVALID:t.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:t.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:t.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Y.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Y.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Y.CODEC_UNSUPPORTED},yt=function(){function Ae(ge,z){if(Object(ue.a)(this,Ae),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new x.a,this._config=he(),typeof z=="object"&&Object.assign(this._config,z),ge.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");ge.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=ge,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var Z=g.chrome&&(g.version.major<50||g.version.major===50&&g.version.build<2661);this._alwaysSeekKeyframe=!!(Z||g.msedge||g.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Q.a)(Ae,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(z,Z){var oe=this;z===Me.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Me.MEDIA_INFO,oe.mediaInfo)}):z===Me.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Me.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(z,Z)}},{key:"off",value:function(z,Z){this._emitter.removeListener(z,Z)}},{key:"attachMediaElement",value:function(z){var Z=this;if(this._mediaElement=z,z.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),z.addEventListener("seeking",this.e.onvSeeking),z.addEventListener("canplay",this.e.onvCanPlay),z.addEventListener("stalled",this.e.onvStalled),z.addEventListener("progress",this.e.onvProgress),this._msectl=new ut(this._config),this._msectl.on(lt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(lt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(lt.SOURCE_OPEN,function(){Z._mseSourceOpened=!0,Z._hasPendingLoad&&(Z._hasPendingLoad=!1,Z.load())}),this._msectl.on(lt.ERROR,function(oe){Z._emitter.emit(Me.ERROR,Pe.MEDIA_ERROR,Ve.MEDIA_MSE_ERROR,oe)}),this._msectl.attachMediaElement(z),this._pendingSeekTime!=null)try{z.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(oe){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var z=this;if(!this._mediaElement)throw new l("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new l("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new It(this._mediaDataSource,this._config),this._transmuxer.on(De.INIT_SEGMENT,function(Z,oe){z._msectl.appendInitSegment(oe)}),this._transmuxer.on(De.MEDIA_SEGMENT,function(Z,oe){if(z._msectl.appendMediaSegment(oe),z._config.lazyLoad&&!z._config.isLive){var me=z._mediaElement.currentTime;oe.info.endDts>=(me+z._config.lazyLoadMaxDuration)*1e3&&(z._progressChecker==null&&(w.v(z.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),z._suspendTransmuxer()))}}),this._transmuxer.on(De.LOADING_COMPLETE,function(){z._msectl.endOfStream(),z._emitter.emit(Me.LOADING_COMPLETE)}),this._transmuxer.on(De.RECOVERED_EARLY_EOF,function(){z._emitter.emit(Me.RECOVERED_EARLY_EOF)}),this._transmuxer.on(De.IO_ERROR,function(Z,oe){z._emitter.emit(Me.ERROR,Pe.NETWORK_ERROR,Z,oe)}),this._transmuxer.on(De.DEMUX_ERROR,function(Z,oe){z._emitter.emit(Me.ERROR,Pe.MEDIA_ERROR,Z,{code:-1,msg:oe})}),this._transmuxer.on(De.MEDIA_INFO,function(Z){z._mediaInfo=Z,z._emitter.emit(Me.MEDIA_INFO,Object.assign({},Z))}),this._transmuxer.on(De.METADATA_ARRIVED,function(Z){z._emitter.emit(Me.METADATA_ARRIVED,Z)}),this._transmuxer.on(De.SCRIPTDATA_ARRIVED,function(Z){z._emitter.emit(Me.SCRIPTDATA_ARRIVED,Z)}),this._transmuxer.on(De.STATISTICS_INFO,function(Z){z._statisticsInfo=z._fillStatisticsInfo(Z),z._emitter.emit(Me.STATISTICS_INFO,Object.assign({},z._statisticsInfo))}),this._transmuxer.on(De.RECOMMEND_SEEKPOINT,function(Z){z._mediaElement&&!z._config.accurateSeek&&(z._requestSetTime=!0,z._mediaElement.currentTime=Z/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(z){this._mediaElement.volume=z}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(z){this._mediaElement.muted=z}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(z){this._mediaElement?this._internalSeek(z):this._pendingSeekTime=z}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(z){if(z.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return z;var Z=!0,oe=0,me=0;if(this._mediaElement.getVideoPlaybackQuality){var Re=this._mediaElement.getVideoPlaybackQuality();oe=Re.totalVideoFrames,me=Re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,me=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(z.decodedFrames=oe,z.droppedFrames=me),z}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var z=this._mediaElement.buffered,Z=this._mediaElement.currentTime,oe=0,me=0,Re=0;Re=Z+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(w.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){w.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var z=this._mediaElement.currentTime,Z=this._mediaElement.buffered,oe=!1,me=0;me=Re&&z=Je-this._config.lazyLoadRecoverDuration&&(oe=!0);break}}oe&&(window.clearInterval(this._progressChecker),this._progressChecker=null,oe&&(w.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(z){for(var Z=this._mediaElement.buffered,oe=0;oe=me&&z0){var Re=this._mediaElement.buffered.start(0);(Re<1&&z0&&Z.currentTime0){var me=oe.start(0);if(me<1&&Z0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(z){this._mediaElement.volume=z}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(z){this._mediaElement.muted=z}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(z){this._mediaElement?this._mediaElement.currentTime=z:this._pendingSeekTime=z}},{key:"mediaInfo",get:function(){var z=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",Z={mimeType:z+this._mediaDataSource.type};return this._mediaElement&&(Z.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Z.width=this._mediaElement.videoWidth,Z.height=this._mediaElement.videoHeight)),Z}},{key:"statisticsInfo",get:function(){var z={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return z;var Z=!0,oe=0,me=0;if(this._mediaElement.getVideoPlaybackQuality){var Re=this._mediaElement.getVideoPlaybackQuality();oe=Re.totalVideoFrames,me=Re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,me=this._mediaElement.webkitDroppedFrameCount):Z=!1;return Z&&(z.decodedFrames=oe,z.droppedFrames=me),z}},{key:"_onvLoadedMetadata",value:function(z){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Me.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Me.STATISTICS_INFO,this.statisticsInfo)}}]),Ae}(),Ut=Nt;S.install();function it(Ae,ge){var z=Ae;if(z==null||typeof z!="object")throw new s("MediaDataSource must be an javascript object!");if(!z.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(z.type){case"flv":return new st(z,ge);default:return new Ut(z,ge)}}function mt(){return Te.supportMSEH264Playback()}function bt(){return Te.getFeatureList()}var At={};At.createPlayer=it,At.isSupported=mt,At.getFeatureList=bt,At.BaseLoader=n,At.LoaderStatus=r,At.LoaderErrors=t,At.Events=Me,At.ErrorTypes=Pe,At.ErrorDetails=Ve,At.FlvPlayer=st,At.NativePlayer=Ut,At.LoggingControl=xe,Object.defineProperty(At,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Xt=Le.a=At},GgEA:function(nt,Le,F){},Gytx:function(nt,Le){nt.exports=function(ue,Q,j,S){var D=j?j.call(S,ue,Q):void 0;if(D!==void 0)return!!D;if(ue===Q)return!0;if(typeof ue!="object"||!ue||typeof Q!="object"||!Q)return!1;var x=Object.keys(ue),T=Object.keys(Q);if(x.length!==T.length)return!1;for(var w=Object.prototype.hasOwnProperty.bind(Q),f=0;f>>6)+f(128|I&63):f(224|I>>>12&15)+f(128|I>>>6&63)+f(128|I&63)}else{var I=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return f(240|I>>>18&7)+f(128|I>>>12&63)+f(128|I>>>6&63)+f(128|I&63)}},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,o=function(P){return P.replace(u,p)},i=function(P){var I=[0,2,1][P.length%3],W=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),K=[T.charAt(W>>>18),T.charAt(W>>>12&63),I>=2?"=":T.charAt(W>>>6&63),I>=1?"=":T.charAt(W&63)];return K.join("")},l=S.btoa&&typeof S.btoa=="function"?function(P){return S.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,i)},s=function(P){return l(o(String(P)))},h=function(P){return P.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},r=function(P,I){return I?h(s(P)):s(P)},t=function(P){return r(P,!0)},n;S.Uint8Array&&(n=function(P,I){for(var W="",K=0,te=P.length;K>>18)+T.charAt(re>>>12&63)+(typeof G!="undefined"?T.charAt(re>>>6&63):"=")+(typeof V!="undefined"?T.charAt(re&63):"=")}return I?h(W):W});var c=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=function(P){switch(P.length){case 4:var I=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),W=I-65536;return f((W>>>10)+55296)+f((W&1023)+56320);case 3:return f((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return f((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},v=function(P){return P.replace(c,m)},b=function(P){var I=P.length,W=I%4,K=(I>0?w[P.charAt(0)]<<18:0)|(I>1?w[P.charAt(1)]<<12:0)|(I>2?w[P.charAt(2)]<<6:0)|(I>3?w[P.charAt(3)]:0),te=[f(K>>>16),f(K>>>8&255),f(K&255)];return te.length-=[0,0,2,1][W],te.join("")},E=S.atob&&typeof S.atob=="function"?function(P){return S.atob(P)}:function(P){return P.replace(/\S{1,4}/g,b)},g=function(P){return E(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(P){return v(E(P))},C=function(P){return String(P).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(P){return y(C(P))},_;S.Uint8Array&&(_=function(P){return Uint8Array.from(g(C(P)),function(I){return I.charCodeAt(0)})});var O=function(){var P=S.Base64;return S.Base64=D,P};if(S.Base64={VERSION:x,atob:g,btoa:l,fromBase64:d,toBase64:r,utob:o,encode:r,encodeURI:t,btou:v,decode:d,noConflict:O,fromUint8Array:n,toUint8Array:_},typeof Object.defineProperty=="function"){var A=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};S.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",A(function(){return d(this)})),Object.defineProperty(String.prototype,"toBase64",A(function(P){return r(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",A(function(){return r(this,!0)}))}}return S.Meteor&&(Base64=S.Base64),nt.exports?nt.exports.Base64=S.Base64:!(Q=[],j=function(){return S.Base64}.apply(Le,Q),j!==void 0&&(nt.exports=j)),{Base64:S.Base64}})}).call(this,F("IyRk"))},JOrW:function(nt,Le,F){nt.exports=F.p+"static/gf.09d89ab3.svg"},JYp7:function(nt,Le,F){"use strict";F.d(Le,"c",function(){return Q}),F.d(Le,"d",function(){return j}),F.d(Le,"f",function(){return D}),F.d(Le,"a",function(){return x}),F.d(Le,"b",function(){return T}),F.d(Le,"e",function(){return w});var ue=function(){var f=function(p,u){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var l in i)i.hasOwnProperty(l)&&(o[l]=i[l])},f(p,u)};return function(p,u){f(p,u);function o(){this.constructor=p}p.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}}(),Q={done:!0,value:void 0},j;(function(f){var p={next:function(){return Q}};function u(){return p}f.empty=u;function o(v){var b=!1;return{next:function(){return b?Q:(b=!0,{done:!1,value:v})}}}f.single=o;function i(v,b,E){return b===void 0&&(b=0),E===void 0&&(E=v.length),{next:function(){return b>=E?Q:{done:!1,value:v[b++]}}}}f.fromArray=i;function l(v){return{next:function(){var b=v.next();return b.done?Q:{done:!1,value:b.value}}}}f.fromNativeIterator=l;function s(v){return v?Array.isArray(v)?f.fromArray(v):v:f.empty()}f.from=s;function h(v,b){return{next:function(){var E=v.next();return E.done?Q:{done:!1,value:b(E.value)}}}}f.map=h;function r(v,b){return{next:function(){for(;;){var E=v.next();if(E.done)return Q;if(b(E.value))return{done:!1,value:E.value}}}}}f.filter=r;function t(v,b){for(var E=v.next();!E.done;E=v.next())b(E.value)}f.forEach=t;function n(v,b){b===void 0&&(b=Number.POSITIVE_INFINITY);var E=[];if(b===0)return E;for(var g=0,y=v.next();!y.done&&!(E.push(y.value),++g>=b);y=v.next());return E}f.collect=n;function c(){for(var v=[],b=0;b=v.length)return Q;var g=v[E],y=g.next();return y.done?(E++,this.next()):y}}}f.concat=c;function m(v){return new S(v)}f.chain=m})(j||(j={}));var S=function(){function f(p){this.it=p}return f.prototype.next=function(){return this.it.next()},f}();function D(f){return Array.isArray(f)?j.fromArray(f):f||j.empty()}var x=function(){function f(p,u,o,i){u===void 0&&(u=0),o===void 0&&(o=p.length),i===void 0&&(i=u-1),this.items=p,this.start=u,this.end=o,this.index=i}return f.prototype.first=function(){return this.index=this.start,this.current()},f.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},f.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},f}(),T=function(f){ue(p,f);function p(u,o,i,l){return o===void 0&&(o=0),i===void 0&&(i=u.length),l===void 0&&(l=o-1),f.call(this,u,o,i,l)||this}return p.prototype.current=function(){return f.prototype.current.call(this)},p.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},p.prototype.first=function(){return this.index=this.start,this.current()},p.prototype.last=function(){return this.index=this.end-1,this.current()},p.prototype.parent=function(){return null},p}(x),w=function(){function f(p,u){this.iterator=p,this.fn=u}return f.prototype.next=function(){return this.fn(this.iterator.next())},f}()},LdHM:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return c}),F.d(Le,"a",function(){return v});var ue=F("1OyB"),Q=F("vuIU"),j=F("Ji7U"),S=F("LK+K"),D=F("q1tI"),x=F("rePB"),T=F("Ff2n"),w=F("ODXe"),f=F("4IlW"),p=F("bX4T"),u=F("YrtM"),o=F("TSYQ"),i=F.n(o),l=F("+nKL"),s=F("8OUc"),h=function(V,re){var $=V.prefixCls,ne=V.id,he=V.flattenOptions,pe=V.childrenAsData,Te=V.values,we=V.searchValue,Me=V.multiple,Ee=V.defaultActiveFirstOption,xe=V.height,Ge=V.itemHeight,je=V.notFoundContent,We=V.open,ze=V.menuItemSelectedIcon,de=V.virtual,le=V.onSelect,Oe=V.onToggleOpen,Ie=V.onActiveValue,qe=V.onScroll,ee=V.onMouseEnter,k="".concat($,"-item"),U=Object(u.a)(function(){return he},[We,he],function(Xe,Ke){return Ke[0]&&Xe[1]!==Ke[1]}),q=D.useRef(null),Y=function(Ke){Ke.preventDefault()},J=function(Ke){q.current&&q.current.scrollTo({index:Ke})},be=function(Ke){for(var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ue=U.length,_e=0;_e1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(G).map(function(re,$){if(!D.isValidElement(re)||!re.type)return null;var ne=re.type.isSelectOptGroup,he=re.key,pe=re.props,Te=pe.children,we=Object(T.a)(pe,["children"]);return V||!ne?g(re):Object(b.a)(Object(b.a)({key:"__RC_SELECT_GRP__".concat(he===null?$:he,"__"),label:he},we),{},{options:y(Te)})}).filter(function(re){return re})}var C=F("2Qr1"),d=F("qNPg"),_=F("U8pU"),O=F("Kwbf"),A=F("WKfj");function P(G){var V=G.mode,re=G.options,$=G.children,ne=G.backfill,he=G.allowClear,pe=G.placeholder,Te=G.getInputElement,we=G.showSearch,Me=G.onSearch,Ee=G.defaultOpen,xe=G.autoFocus,Ge=G.labelInValue,je=G.value,We=G.inputValue,ze=G.optionLabelProp,de=V==="multiple"||V==="tags",le=we!==void 0?we:de||V==="combobox",Oe=re||y($);if(Object(O.a)(V!=="tags"||Oe.every(function(k){return!k.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Ie=Oe.some(function(k){return k.options?k.options.some(function(U){return typeof("value"in U?U.value:U.key)=="number"}):typeof("value"in k?k.value:k.key)=="number"});Object(O.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(O.a)(V!=="combobox"||!ze,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(O.a)(V==="combobox"||!ne,"`backfill` only works with `combobox` mode."),Object(O.a)(V==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(O.b)(V!=="combobox"||!Te||!he||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Me&&!le&&V!=="combobox"&&V!=="tags"&&Object(O.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(O.b)(!Ee||xe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),je!=null){var qe=Object(A.d)(je);Object(O.a)(!Ge||qe.every(function(k){return Object(_.a)(k)==="object"&&("key"in k||"value"in k)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(O.a)(!de||Array.isArray(je),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var ee=null;Object(E.a)($).some(function(k){if(!D.isValidElement(k)||!k.type)return!1;var U=k.type;if(U.isSelectOption)return!1;if(U.isSelectOptGroup){var q=Object(E.a)(k.props.children).every(function(Y){return!D.isValidElement(Y)||!k.type||Y.type.isSelectOption?!0:(ee=Y.type,!1)});return!q}return ee=U,!0}),ee&&Object(O.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ee.displayName||ee.name||ee,"`.")),Object(O.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=P,W=Object(d.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:y,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:I,fillOptionsWithMissingValue:C.a}),K=function(G){Object(j.a)(re,G);var V=Object(S.a)(re);function re(){var $;return Object(ue.a)(this,re),$=V.apply(this,arguments),$.selectRef=D.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(Q.a)(re,[{key:"render",value:function(){return D.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),re}(D.Component);K.Option=c,K.OptGroup=v;var te=K,H=Le.c=te},M8RZ:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return f});var ue=F("fWQN"),Q=F("mtLc"),j=F("yKVA"),S=F("879j"),D=F("q1tI"),x=F.n(D),T=F("i8i4"),w=F.n(T),f=function(p){Object(j.a)(o,p);var u=Object(S.a)(o);function o(i){var l;Object(ue.a)(this,o),l=u.call(this,i);var s=window.document;return l.node=s.createElement("div"),s.body.appendChild(l.node),l}return Object(Q.a)(o,[{key:"render",value:function(){var l=this.props.children;return Object(T.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),o}(x.a.Component)},MFOe:function(nt,Le,F){(function(ue){var Q=x(),j=T(),S=w(),D=typeof window!="undefined"?window:ue;nt.exports={assign:Q,create:j,trim:S,bind:f,slice:p,each:u,map:o,pluck:i,isList:l,isFunction:s,isObject:h,Global:D};function x(){return Object.assign?Object.assign:function(t,n,c,m){for(var v=1;v1)&&ne.fire(pe),$=0},K)})},onLastListenerRemove:function(){G.dispose()}});return ne.event}l.debounce=b;function E(I){var W=new Date().getTime();return h(s(I),function(K){return new Date().getTime()-W})}l.stopwatch=E;function g(I){var W=!0,K;return t(I,function(te){var H=W||te!==K;return W=!1,K=te,H})}l.latch=g;function y(I,W,K){W===void 0&&(W=!1),K===void 0&&(K=[]);var te=K.slice(),H=I(function(re){te?te.push(re):V.fire(re)}),G=function(){te&&te.forEach(function(re){return V.fire(re)}),te=null},V=new f({onFirstListenerAdd:function(){H||(H=I(function(re){return V.fire(re)}))},onFirstListenerDidAdd:function(){te&&(W?setTimeout(G):G())},onLastListenerRemove:function(){H&&H.dispose(),H=null}});return V.event}l.buffer=y;var C=function(){function I(W){this.event=W}return I.prototype.map=function(W){return new I(h(this.event,W))},I.prototype.forEach=function(W){return new I(r(this.event,W))},I.prototype.filter=function(W){return new I(t(this.event,W))},I.prototype.reduce=function(W,K){return new I(m(this.event,W,K))},I.prototype.latch=function(){return new I(g(this.event))},I.prototype.debounce=function(W,K,te,H){return K===void 0&&(K=100),te===void 0&&(te=!1),new I(b(this.event,W,K,te,H))},I.prototype.on=function(W,K,te){return this.event(W,K,te)},I.prototype.once=function(W,K,te){return s(this.event)(W,K,te)},I}();function d(I){return new C(I)}l.chain=d;function _(I,W,K){K===void 0&&(K=function(re){return re});var te=function(){for(var re=[],$=0;$0?new w(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(l.prototype,"event",{get:function(){var s=this;return this._event||(this._event=function(h,r,t){s._listeners||(s._listeners=new S.a);var n=s._listeners.isEmpty();n&&s._options&&s._options.onFirstListenerAdd&&s._options.onFirstListenerAdd(s);var c=s._listeners.push(r?[h,r]:h);n&&s._options&&s._options.onFirstListenerDidAdd&&s._options.onFirstListenerDidAdd(s),s._options&&s._options.onListenerDidAdd&&s._options.onListenerDidAdd(s,h,r);var m;s._leakageMon&&(m=s._leakageMon.check(s._listeners.size));var v;return v={dispose:function(){if(m&&m(),v.dispose=l._noop,!s._disposed&&(c(),s._options&&s._options.onLastListenerRemove)){var b=s._listeners&&!s._listeners.isEmpty();b||s._options.onLastListenerRemove(s)}}},t instanceof j.b?t.add(v):Array.isArray(t)&&t.push(v),v}),this._event},enumerable:!0,configurable:!0}),l.prototype.fire=function(s){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new S.a);for(var h=this._listeners.iterator(),r=h.next();!r.done;r=h.next())this._deliveryQueue.push([r.value,s]);for(;this._deliveryQueue.size>0;){var t=this._deliveryQueue.shift(),n=t[0],c=t[1];try{typeof n=="function"?n.call(void 0,c):n[0].call(n[1],c)}catch(m){Object(ue.e)(m)}}}},l.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},l._noop=function(){},l}(),p=function(l){D(s,l);function s(h){var r=l.call(this,h)||this;return r._isPaused=0,r._eventQueue=new S.a,r._mergeFn=h&&h.merge,r}return s.prototype.pause=function(){this._isPaused++},s.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var h=this._eventQueue.toArray();this._eventQueue.clear(),l.prototype.fire.call(this,this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)l.prototype.fire.call(this,this._eventQueue.shift())},s.prototype.fire=function(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):l.prototype.fire.call(this,h))},s}(f),u=function(){function l(){var s=this;this.hasListeners=!1,this.events=[],this.emitter=new f({onFirstListenerAdd:function(){return s.onFirstListenerAdd()},onLastListenerRemove:function(){return s.onLastListenerRemove()}})}return Object.defineProperty(l.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),l.prototype.add=function(s){var h=this,r={event:s,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);var t=function(){h.hasListeners&&h.unhook(r);var n=h.events.indexOf(r);h.events.splice(n,1)};return Object(j.h)(Object(Q.a)(t))},l.prototype.onFirstListenerAdd=function(){var s=this;this.hasListeners=!0,this.events.forEach(function(h){return s.hook(h)})},l.prototype.onLastListenerRemove=function(){var s=this;this.hasListeners=!1,this.events.forEach(function(h){return s.unhook(h)})},l.prototype.hook=function(s){var h=this;s.listener=s.event(function(r){return h.emitter.fire(r)})},l.prototype.unhook=function(s){s.listener&&s.listener.dispose(),s.listener=null},l.prototype.dispose=function(){this.emitter.dispose()},l}(),o=function(){function l(){this.buffers=[]}return l.prototype.wrapEvent=function(s){var h=this;return function(r,t,n){return s(function(c){var m=h.buffers[h.buffers.length-1];m?m.push(function(){return r.call(t,c)}):r.call(t,c)},void 0,n)}},l.prototype.bufferEvents=function(s){var h=[];this.buffers.push(h);var r=s();return this.buffers.pop(),h.forEach(function(t){return t()}),r},l}(),i=function(){function l(){var s=this;this.listening=!1,this.inputEvent=x.None,this.inputEventListener=j.a.None,this.emitter=new f({onFirstListenerDidAdd:function(){s.listening=!0,s.inputEventListener=s.inputEvent(s.emitter.fire,s.emitter)},onLastListenerRemove:function(){s.listening=!1,s.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(l.prototype,"input",{set:function(s){this.inputEvent=s,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=s(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),l.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},l}()},MVJL:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},N0LK:function(nt,Le,F){"use strict";F.d(Le,"x",function(){return ue}),F.d(Le,"F",function(){return Q}),F.d(Le,"r",function(){return S}),F.d(Le,"o",function(){return D}),F.d(Le,"p",function(){return x}),F.d(Le,"Q",function(){return T}),F.d(Le,"K",function(){return f}),F.d(Le,"k",function(){return p}),F.d(Le,"N",function(){return u}),F.d(Le,"m",function(){return o}),F.d(Le,"l",function(){return i}),F.d(Le,"I",function(){return l}),F.d(Le,"H",function(){return s}),F.d(Le,"q",function(){return h}),F.d(Le,"t",function(){return r}),F.d(Le,"D",function(){return t}),F.d(Le,"e",function(){return n}),F.d(Le,"f",function(){return c}),F.d(Le,"B",function(){return m}),F.d(Le,"C",function(){return v}),F.d(Le,"n",function(){return E}),F.d(Le,"O",function(){return y}),F.d(Le,"c",function(){return C}),F.d(Le,"d",function(){return d}),F.d(Le,"z",function(){return _}),F.d(Le,"A",function(){return O}),F.d(Le,"u",function(){return A}),F.d(Le,"E",function(){return I}),F.d(Le,"G",function(){return W}),F.d(Le,"i",function(){return te}),F.d(Le,"g",function(){return G}),F.d(Le,"v",function(){return re}),F.d(Le,"h",function(){return $}),F.d(Le,"y",function(){return ne}),F.d(Le,"w",function(){return he}),F.d(Le,"a",function(){return pe}),F.d(Le,"P",function(){return Te}),F.d(Le,"L",function(){return we}),F.d(Le,"J",function(){return Me}),F.d(Le,"j",function(){return Ee}),F.d(Le,"M",function(){return xe}),F.d(Le,"s",function(){return Ge}),F.d(Le,"b",function(){return je});function ue(de){return!de||typeof de!="string"?!0:de.trim().length===0}function Q(de,le,Oe){Oe===void 0&&(Oe="0");for(var Ie=""+de,qe=[Ie],ee=Ie.length;ee=le.length?Ie:le[ee]})}function D(de){return de.replace(/[<>&]/g,function(le){switch(le){case"<":return"<";case">":return">";case"&":return"&";default:return le}})}function x(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function T(de,le){le===void 0&&(le=" ");var Oe=w(de,le);return f(Oe,le)}function w(de,le){if(!de||!le)return de;var Oe=le.length;if(Oe===0||de.length===0)return de;for(var Ie=0;de.indexOf(le,Ie)===Ie;)Ie=Ie+Oe;return de.substring(Ie)}function f(de,le){if(!de||!le)return de;var Oe=le.length,Ie=de.length;if(Oe===0||Ie===0)return de;for(var qe=Ie,ee=-1;!(ee=de.lastIndexOf(le,qe-1),ee===-1||ee+Oe!==qe);){if(ee===0)return"";qe=ee}return de.substring(0,qe)}function p(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function u(de,le){if(de.length0?de.indexOf(le,Oe)===Oe:Oe===0?de===le:!1}function i(de,le,Oe){if(Oe===void 0&&(Oe={}),!de)throw new Error("Cannot create regex from empty string");le||(de=x(de)),Oe.wholeWord&&(/\B/.test(de.charAt(0))||(de="\\b"+de),/\B/.test(de.charAt(de.length-1))||(de=de+"\\b"));var Ie="";return Oe.global&&(Ie+="g"),Oe.matchCase||(Ie+="i"),Oe.multiline&&(Ie+="m"),Oe.unicode&&(Ie+="u"),new RegExp(de,Ie)}function l(de){if(de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$")return!1;var le=de.exec("");return!!(le&&de.lastIndex===0)}function s(de){return(de.global?"g":"")+(de.ignoreCase?"i":"")+(de.multiline?"m":"")+(de.unicode?"u":"")}function h(de){for(var le=0,Oe=de.length;le=0;Oe--){var Ie=de.charCodeAt(Oe);if(Ie!==32&&Ie!==9)return Oe}return-1}function n(de,le){return dele?1:0}function c(de,le){for(var Oe=Math.min(de.length,le.length),Ie=0;Iele.length?1:0}function m(de){return de>=97&&de<=122}function v(de){return de>=65&&de<=90}function b(de){return m(de)||v(de)}function E(de,le){return de.length===le.length&&g(de,le)}function g(de,le,Oe){Oe===void 0&&(Oe=de.length);for(var Ie=0;Iede.length?!1:g(de,le,Oe)}function C(de,le){var Oe,Ie=Math.min(de.length,le.length);for(Oe=0;Oe1){var Ie=de.charCodeAt(le-2);if(_(Ie))return(Ie-55296<<10)+(Oe-56320)+65536}return Oe}function I(de,le){var Oe=We.getInstance(),Ie=le,qe=de.length,ee=A(de,qe,le);le+=ee>=65536?2:1;for(var k=Oe.getGraphemeBreakType(ee);le=65536?2:1,k=q}return le-Ie}function W(de,le){var Oe=We.getInstance(),Ie=le,qe=P(de,le);le-=qe>=65536?2:1;for(var ee=Oe.getGraphemeBreakType(qe);le>0;){var k=P(de,le),U=Oe.getGraphemeBreakType(k);if(je(U,ee))break;le-=k>=65536?2:1,ee=U}return Ie-le}var K=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function te(de){return K.test(de)}var H=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function G(de){return H.test(de)}var V=/^[\t\n\r\x20-\x7E]*$/;function re(de){return V.test(de)}function $(de){for(var le=0,Oe=de.length;le=11904&&de<=55215||de>=63744&&de<=64255||de>=65281&&de<=65374}function he(de){return de>=127462&&de<=127487||de>=9728&&de<=10175||de>=127744&&de<=128591||de>=128640&&de<=128764||de>=128992&&de<=129003||de>=129280&&de<=129535||de>=129648&&de<=129651||de>=129656&&de<=129666||de>=129680&&de<=129685}var pe=String.fromCharCode(65279);function Te(de){return!!(de&&de.length>0&&de.charCodeAt(0)===65279)}function we(de){return btoa(encodeURIComponent(de))}function Me(de,le){for(var Oe="",Ie=0;IeOe[3*qe+1])qe=2*qe+1;else return Oe[3*qe+2];return 0},de._INSTANCE=null,de}();function ze(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},NvD2:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return x});var ue=F("Kwbf");function Q(T,w){var f=new Set;return T.forEach(function(p){w.has(p)||f.add(p)}),f}function j(T){var w=T||{},f=w.disabled,p=w.disableCheckbox,u=w.checkable;return!!(f||p)||u===!1}function S(T,w,f,p){for(var u=new Set(T),o=new Set,i=0;i<=f;i+=1){var l=w.get(i)||new Set;l.forEach(function(t){var n=t.key,c=t.node,m=t.children,v=m===void 0?[]:m;u.has(n)&&!p(c)&&v.filter(function(b){return!p(b.node)}).forEach(function(b){u.add(b.key)})})}for(var s=new Set,h=f;h>=0;h-=1){var r=w.get(h)||new Set;r.forEach(function(t){var n=t.parent,c=t.node;if(p(c)||!t.parent||s.has(t.parent.key))return;if(p(t.parent.node)){s.add(n.key);return}var m=!0,v=!1;(n.children||[]).filter(function(b){return!p(b.node)}).forEach(function(b){var E=b.key,g=u.has(E);m&&!g&&(m=!1),!v&&(g||o.has(E))&&(v=!0)}),m&&u.add(n.key),v&&o.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(Q(o,u))}}function D(T,w,f,p,u){for(var o=new Set(T),i=new Set(w),l=0;l<=p;l+=1){var s=f.get(l)||new Set;s.forEach(function(n){var c=n.key,m=n.node,v=n.children,b=v===void 0?[]:v;!o.has(c)&&!i.has(c)&&!u(m)&&b.filter(function(E){return!u(E.node)}).forEach(function(E){o.delete(E.key)})})}i=new Set;for(var h=new Set,r=p;r>=0;r-=1){var t=f.get(r)||new Set;t.forEach(function(n){var c=n.parent,m=n.node;if(u(m)||!n.parent||h.has(n.parent.key))return;if(u(n.parent.node)){h.add(c.key);return}var v=!0,b=!1;(c.children||[]).filter(function(E){return!u(E.node)}).forEach(function(E){var g=E.key,y=o.has(g);v&&!y&&(v=!1),!b&&(y||i.has(g))&&(b=!0)}),v||o.delete(c.key),b&&i.add(c.key),h.add(c.key)})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(Q(i,o))}}function x(T,w,f,p){var u=[],o;p?o=p:o=j;var i=new Set(T.filter(function(r){var t=!!f[r];return t||u.push(r),t})),l=new Map,s=0;Object.keys(f).forEach(function(r){var t=f[r],n=t.level,c=l.get(n);c||(c=new Set,l.set(n,c)),c.add(t),s=Math.max(s,n)}),Object(ue.a)(!u.length,"Tree missing follow keys: ".concat(u.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var h;return w===!0?h=S(i,l,s,o):h=D(i,w.halfCheckedKeys,l,s,o),h}},OLES:function(nt,Le,F){"use strict";var ue=F("U8pU"),Q=F("VTBJ"),j=F("Ff2n"),S=F("q1tI"),D=F("uciX"),x=F("7ixt"),T=function(i){var l=i.overlay,s=i.prefixCls,h=i.id,r=i.overlayInnerStyle;return S.createElement("div",{className:"".concat(s,"-inner"),id:h,role:"tooltip",style:r},typeof l=="function"?l():l)},w=T,f=function(i,l){var s=i.overlayClassName,h=i.trigger,r=h===void 0?["hover"]:h,t=i.mouseEnterDelay,n=t===void 0?0:t,c=i.mouseLeaveDelay,m=c===void 0?.1:c,v=i.overlayStyle,b=i.prefixCls,E=b===void 0?"rc-tooltip":b,g=i.children,y=i.onVisibleChange,C=i.afterVisibleChange,d=i.transitionName,_=i.animation,O=i.placement,A=O===void 0?"right":O,P=i.align,I=P===void 0?{}:P,W=i.destroyTooltipOnHide,K=W===void 0?!1:W,te=i.defaultVisible,H=i.getTooltipContainer,G=i.overlayInnerStyle,V=Object(j.a)(i,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),re=Object(S.useRef)(null);Object(S.useImperativeHandle)(l,function(){return re.current});var $=Object(Q.a)({},V);"visible"in i&&($.popupVisible=i.visible);var ne=function(){var Me=i.arrowContent,Ee=Me===void 0?null:Me,xe=i.overlay,Ge=i.id;return[S.createElement("div",{className:"".concat(E,"-arrow"),key:"arrow"},Ee),S.createElement(w,{key:"content",prefixCls:E,id:Ge,overlay:xe,overlayInnerStyle:G})]},he=!1,pe=!1;if(typeof K=="boolean")he=K;else if(K&&Object(ue.a)(K)==="object"){var Te=K.keepParent;he=Te===!0,pe=Te===!1}return S.createElement(D.a,Object.assign({popupClassName:s,prefixCls:E,popup:ne,action:r,builtinPlacements:x.a,popupPlacement:A,ref:re,popupAlign:I,getPopupContainer:H,onPopupVisibleChange:y,afterPopupVisibleChange:C,popupTransitionName:d,popupAnimation:_,defaultPopupVisible:te,destroyPopupOnHide:he,autoDestroy:pe,mouseLeaveDelay:m,popupStyle:v,mouseEnterDelay:n},$),g)},p=Object(S.forwardRef)(f),u=Le.a=p},OZM5:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return p}),F.d(Le,"a",function(){return u}),F.d(Le,"k",function(){return o}),F.d(Le,"h",function(){return i}),F.d(Le,"i",function(){return l}),F.d(Le,"g",function(){return s}),F.d(Le,"c",function(){return h}),F.d(Le,"d",function(){return r}),F.d(Le,"j",function(){return c}),F.d(Le,"e",function(){return m}),F.d(Le,"f",function(){return v});var ue=F("KQm4"),Q=F("U8pU"),j=F("Ff2n"),S=F("q1tI"),D=F.n(S),x=F("Kwbf"),T=F("WaYH"),w=.25,f=2;function p(b,E){var g=b.slice(),y=g.indexOf(E);return y>=0&&g.splice(y,1),g}function u(b,E){var g=b.slice();return g.indexOf(E)===-1&&g.push(E),g}function o(b){return b.split("-")}function i(b,E){return"".concat(b,"-").concat(E)}function l(b){return b&&b.type&&b.type.isTreeNode}function s(b,E){var g=[b],y=E[b];function C(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(_){var O=_.key,A=_.children;g.push(O),C(A)})}return C(y.children),g}function h(b,E){var g=b.clientY,y=E.selectHandle.getBoundingClientRect(),C=y.top,d=y.bottom,_=y.height,O=Math.max(_*w,f);return g<=C+O?-1:g>=d-O?1:0}function r(b,E){if(!b)return;var g=E.multiple;return g?b.slice():b.length?[b[0]]:b}var t=function(E){return E};function n(b,E){if(!b)return[];var g=E||{},y=g.processProps,C=y===void 0?t:y,d=Array.isArray(b)?b:[b];return d.map(function(_){var O=_.children,A=Object(j.a)(_,["children"]),P=n(O,E);return D.a.createElement(T.a,Object.assign({},C(A)),P)})}function c(b){if(!b)return null;var E;if(Array.isArray(b))E={checkedKeys:b,halfCheckedKeys:void 0};else if(Object(Q.a)(b)==="object")E={checkedKeys:b.checked||void 0,halfCheckedKeys:b.halfChecked||void 0};else return Object(x.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function m(b,E){var g=new Set;function y(C){if(g.has(C))return;var d=E[C];if(!d)return;g.add(C);var _=d.parent,O=d.node;if(O.disabled)return;_&&y(_.key)}return(b||[]).forEach(function(C){y(C)}),Object(ue.a)(g)}function v(b){var E={};return Object.keys(b).forEach(function(g){(g.startsWith("data-")||g.startsWith("aria-"))&&(E[g]=b[g])}),E}},"OkW/":function(nt,Le,F){},Ot1p:function(nt,Le,F){"use strict";var ue=F("2qtc"),Q=F("kLXV"),j=F("rAM+"),S=F("miYZ"),D=F("tsqr"),x=F("9og8"),T=F("tJVT"),w=F("jrin"),f=F("WmNS"),p=F.n(f),u=F("q1tI"),o=F.n(u),i=F("VrN/"),l=F.n(i),s=F("bdgK"),h=F("p77/"),r=F("Bd2K"),t=F("ELLl"),n=F("19Vz"),c=F("lZu9"),m=F("+NIl"),v=F("kSUc"),b=F("9Bee"),E=function(tt){var xt=tt.value,Mt=xt===void 0?"":xt,Bt=tt.className,It=tt.showTextOnly,Dt=tt.showLines,lt=tt.style,pt=lt===void 0?{}:lt,ut=Object(u.useMemo)(function(){return""},[Mt]);return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},g=F("0Owb"),y=F("dejd"),C=F("C+DQ"),d=F("1vsH"),_=F("m3rI"),O=[{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 A(tt){var xt=tt.onActionCallback,Mt=tt.title,Bt=tt.icon,It=tt.actionName,Dt=tt.className,lt=Dt===void 0?"":Dt,pt=tt.children;function ut(){xt(It)}return o.a.createElement("a",{title:Mt,className:lt,onClick:ut},o.a.createElement("i",{className:"md-iconfont ".concat(Bt)}),pt)}var P=function(tt){var xt=tt.watch,Mt=tt.showNullButton,Bt=tt.onActionCallback,It=tt.fullScreen,Dt=tt.insertTemp,lt=tt.hidetoolBar,pt=tt.uuid,ut=tt.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.D)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(_.a.PROXY_SERVER)));var Pe=[].concat(O,[{title:"".concat(xt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(xt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return o.a.createElement("ul",{className:"markdown-toolbar-container"},!lt&&Pe.map(function(Ve,yt){return o.a.createElement("li",{key:yt},Ve.actionName?o.a.createElement(A,Object(g.a)({},Ve,{onActionCallback:Bt})):o.a.createElement("span",{className:"v-line"}))}),Mt?o.a.createElement("li",null,o.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Bt},o.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Dt&&o.a.createElement("li",null,o.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Dt),onActionCallback:Bt},o.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),o.a.createElement("li",{className:"btn-full-screen"},o.a.createElement(A,{icon:"".concat(It?"icon-shrink":"icon-enlarge"),title:It?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Bt})))},I=F("M8RZ"),W=F("+L6B"),K=F("2/Rp"),te=F("y8nQ"),H=F("Vl3Y"),G=F("5NDa"),V=F("5rEg"),re={labelCol:{span:4},wrapperCol:{span:20}},$=function(tt){var xt=tt.callback,Mt=tt.onCancel;function Bt(It){xt(It)}return o.a.createElement(H.a,Object(g.a)({},re,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Bt}),o.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},o.a.createElement(V.a,null)),o.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},o.a.createElement(V.a,null)),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(K.a,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))},ne=F("7ahc"),he=F("k1fw"),pe=F("HmJG"),Te=F("BjJ7"),we=H.a.useForm,Me={width:280,marginRight:10},Ee={labelCol:{span:5},wrapperCol:{span:19}},xe=function(tt){var xt=tt.callback,Mt=tt.onCancel,Bt=we(),It=Object(T.a)(Bt,1),Dt=It[0],lt=Object(u.useRef)();function pt(Ve){xt(Object(he.a)(Object(he.a)({},Ve),{},{name:lt.current}))}function ut(Ve,yt){Dt.setFieldsValue({src:"/api/attachments/".concat(Ve.id,"?type=").concat(Ve.content_type),type:yt.type})}function Pe(Ve){var yt=Ve.target.files[0];lt.current=yt.name,je(yt,ut)}return o.a.createElement(H.a,Object(g.a)({form:Dt},Ee,{className:"upload-image-panel",onFinish:pt}),o.a.createElement(H.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},o.a.createElement("div",{className:"flex-container"},o.a.createElement(H.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},o.a.createElement(V.a,{style:Me})),o.a.createElement(Ge,{onFileChange:Pe}))),o.a.createElement(H.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},o.a.createElement(V.a,{style:{width:264}})),o.a.createElement(H.a.Item,{style:{textAlign:"right"}},o.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(K.a,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))};function Ge(tt){var xt=tt.onFileChange;return o.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",o.a.createElement("input",{type:"file",onChange:xt}))}function je(tt,xt){if(!tt)throw new String("\u6CA1\u6709\u6587\u4EF6");var Mt=new FormData;Mt.append("editormd-image-file",tt),Mt.append("file_param_name","editormd-image-file"),Mt.append("byxhr","true");var Bt=new window.XMLHttpRequest;Bt.withCredentials=!0,Bt.addEventListener("load",function(It){xt(JSON.parse(It.target.responseText),tt)},!1),Bt.addEventListener("error",function(It){console.error(It)},!1),Bt.open("POST","".concat(Te.a,"/api/attachments.json")),Bt.send(Mt)}var We=F("giR+"),ze=F("fyUT"),de=F("7Kak"),le=F("9yH6"),Oe=le.a.Group,Ie={margin:"0 8px"},qe=function(tt){var xt=tt.callback,Mt=tt.onCancel;function Bt(It){xt(It)}return o.a.createElement(H.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Bt},o.a.createElement("div",{className:"flex-container"},o.a.createElement("span",{style:Ie},"\u5355\u5143\u683C\u6570\uFF1A"),o.a.createElement("span",{style:Ie},"\u884C\u6570"),o.a.createElement(H.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},o.a.createElement(ze.a,null)),o.a.createElement("span",{style:Ie},"\u5217\u6570"),o.a.createElement(H.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},o.a.createElement(ze.a,null))),o.a.createElement("div",{className:"flex-container",style:{marginTop:12}},o.a.createElement("span",{style:Ie},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),o.a.createElement(H.a.Item,{name:"align"},o.a.createElement(Oe,null,o.a.createElement(le.a,{value:"default"},o.a.createElement("i",{className:"fa fa-align-justify"})),o.a.createElement(le.a,{value:"left"},o.a.createElement("i",{className:"fa fa-align-left"})),o.a.createElement(le.a,{value:"center"},o.a.createElement("i",{className:"fa fa-align-center"})),o.a.createElement(le.a,{value:"right"},o.a.createElement("i",{className:"fa fa-align-right"}))))),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(K.a,{type:"ghost",onClick:Mt},"\u53D6\u6D88")))},ee=F("ErOA"),k=F("7Cbv"),U="link",q="upload-image",Y="code-block",J="add-table",be="------------",ke={default:be,left:":".concat(be),center:":".concat(be,":"),right:"".concat(be,":")},ct=F("9VGf"),He,Be;function Ze(){}var ht=0,Qe=1e4,Xe="\u2581",Ke=` **\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 Fe(tt){return/^\d+$/.test(tt)?"".concat(tt,"px"):tt}var Ue=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=Ue?"Cmd":"Ctrl",Ce=["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"],Ne=(He={},Object(w.a)(He,_e+"-B","bold"),Object(w.a)(He,_e+"-I","italic"),He),De=(Be={},Object(w.a)(Be,U,"\u6DFB\u52A0\u94FE\u63A5"),Object(w.a)(Be,Y,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(w.a)(Be,q,"\u6DFB\u52A0\u6587\u4EF6"),Object(w.a)(Be,J,"\u6DFB\u52A0\u8868\u683C"),Be),rt=Le.a=function(tt){var xt=tt.defaultValue,Mt=xt===void 0?"":xt,Bt=tt.onChange,It=tt.width,Dt=It===void 0?"100%":It,lt=tt.height,pt=lt===void 0?400:lt,ut=tt.miniToolbar,Pe=ut===void 0?!1:ut,Ve=tt.isFocus,yt=Ve===void 0?!1:Ve,st=tt.watch,Nt=tt.insertTemp,Ut=tt.mode,it=Ut===void 0?"markdown":Ut,mt=tt.id,bt=mt===void 0?"markdown-editor-id":mt,At=tt.showResizeBar,Xt=At===void 0?!1:At,Ae=tt.noStorage,ge=Ae===void 0?!1:Ae,z=tt.showNullButton,Z=z===void 0?!1:z,oe=tt.hidetoolBar,me=oe===void 0?!1:oe,Re=tt.fullScreen,Je=Re===void 0?!1:Re,at=tt.onBlur,kt=tt.onCMBeforeChange,jt=tt.onFullScreen,ot=tt.className,wt=ot===void 0?"":ot,Kt=tt.disablePaste,Et=Kt===void 0?!1:Kt,Qt=tt.placeholder,Vt=Qt===void 0?"":Qt,ie=tt.values,N=ie===void 0?"":ie,B=Object(u.useState)(null),ae=Object(T.a)(B,2),fe=ae[0],se=ae[1],$e=Object(u.useState)(Mt),St=Object(T.a)($e,2),Pt=St[0],$t=St[1],Ot=Object(u.useState)(st),zt=Object(T.a)(Ot,2),an=zt[0],jn=zt[1],Dr=Object(u.useState)(Je),Cr=Object(T.a)(Dr,2),Nn=Cr[0],hr=Cr[1],mi=Object(u.useState)(""),Or=Object(T.a)(mi,2),yr=Or[0],pr=Or[1],Yr=Object(u.useState)(0),Mr=Object(T.a)(Yr,2),Zr=Mr[0],wr=Mr[1],vi=Object(u.useState)(pt),li=Object(T.a)(vi,2),Kr=li[0],zr=li[1],xi=Object(u.useState)(!1),gi=Object(T.a)(xi,2),Si=gi[0],Fn=gi[1],Sn=Object(u.useRef)(Object(k.a)()),_r=Object(u.useRef)(!1),zn=Object(u.useRef)(),Lr=Object(u.useRef)(),rr=Object(u.useRef)(),Ri=Object(u.useRef)(),Pr=Object(u.useRef)(),ni=function(){var un=Object(x.a)(p.a.mark(function Cn(){var pn,Un;return p.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(ee.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Sn.current}});case 2:Un=mr.sent,Un!=null&&(pn=Un.attachments)!==null&&pn!==void 0&&pn.length&&(console.log("cm:",fe,Lr),Un.attachments.map(function(Zn){Zn.content_type.indexOf("image")>-1?fe.replaceSelection("![,](/api/attachments/".concat(Zn.id,"?type=").concat(Zn.content_type,")")):Zn.content_type.indexOf("video")>-1?fe.replaceSelection('')):Zn.content_type.indexOf("pdf")>-1?fe.replaceSelection('
    ').concat(Zn.name,"")):fe.replaceSelection("[".concat(Zn.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(Zn.id,"?type=").concat(Zn.content_type,")"))}));case 4:case"end":return mr.stop()}},Cn)}));return function(){return un.apply(this,arguments)}}();Object(u.useEffect)(function(){$t(N),fe==null||fe.setValue(N)},[N]),Object(u.useEffect)(function(){jt==null||jt(Nn)},[Nn]),Object(u.useEffect)(function(){if(Lr.current){var un=l.a.fromTextArea(Lr.current,{mode:it,lineNumbers:!Pe,lineWrapping:!0,value:Mt,autoCloseTags:!0,autoCloseBrackets:!0});yt&&un.focus();function Cn(pn,Un){if(Et){Un.preventDefault();return}var ur=Un.clipboardData;if(ur){var mr=ur.types.toString(),Zn=ur.items;if(mr==="Files"||ur.types.indexOf("Files")>-1){if(Un.preventDefault(),it=="stex")return;try{var hn,Fr=Zn[1];((hn=Zn[0])===null||hn===void 0?void 0:hn.kind)==="file"&&(Fr=Zn[0]);var Bn=Fr.getAsFile(),Bi=Bn.name.split(".").pop();je(Bn,function(cr){if(cr.id){var Br,bi,ft;(Bn==null||((Br=Bn.type)===null||Br===void 0)?void 0:Br.indexOf("image"))>-1?un.replaceSelection("![,](/api/attachments/".concat(cr.id,"?type=").concat(cr.content_type,")")):(Bn==null||((bi=Bn.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?un.replaceSelection('')):(Bn==null||((ft=Bn.type)===null||ft===void 0)?void 0:ft.indexOf("pdf"))>-1?un.replaceSelection('').concat(Bn.name,"")):Ce.includes(Bi)?un.replaceSelection('').concat(Bn.name,"")):un.replaceSelection("[".concat(Bn.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})}catch(cr){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return un.on("paste",Cn),un.on("dragleave",function(pn,Un){rr.current.classList.remove("mouse-hover-md")}),un.on("dragover",function(pn,Un){rr.current.classList.add("mouse-hover-md")}),un.on("drop",function(pn,Un){rr.current.classList.add("mouse-hover-md");var ur;if(ur=Un.dataTransfer.files,ur.length>0){Un.preventDefault(),Un.stopPropagation();for(var mr=function(Fr){var Bn=ur[Fr],Bi=Bn.name.split(".").pop();je(Bn,function(cr){if(cr.id){var Br,bi,ft;(Bn==null||((Br=Bn.type)===null||Br===void 0)?void 0:Br.indexOf("image"))>-1?un.replaceSelection("![,](/api/attachments/".concat(cr.id,"?type=").concat(cr.content_type,")")):(Bn==null||((bi=Bn.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?un.replaceSelection('')):(Bn==null||((ft=Bn.type)===null||ft===void 0)?void 0:ft.indexOf("pdf"))>-1?un.replaceSelection('').concat(Bn.name,"")):Ce.includes(Bi)?un.replaceSelection('').concat(Bn.name,"")):un.replaceSelection("[".concat(Bn.name,"](").concat(_.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})},Zn=0;Zn0||Zn.target.offsetWidth>0)&&(ji(),fe.setSize("100%","100%"),fe.refresh())}}catch(hn){ur.e(hn)}finally{ur.f()}});return pn.observe(Lr.current.parentElement),pn}if(fe){var Cn=un();return function(){Cn.unobserve(Lr.current.parentElement)}}},[fe,ji]),Object(u.useEffect)(function(){if(fe){for(var un=[],Cn=function(){var Zn=Un[pn];ur=Object(T.a)(Zn,2);var hn=ur[0],Fr=ur[1],Bn=Object(w.a)({},hn,function(){ui(Fr)});un.push(Bn),fe.addKeyMap(Bn)},pn=0,Un=Object.entries(Ne);pn0){var un=new Date().getTime(),Cn=window.sessionStorage.getItem(bt);un>=Zr+Qe&&(!Cn||Cn!==Pt)&&(window.sessionStorage.setItem(bt,Pt),Fn(!0))}},Qe),Object(u.useEffect)(function(){jn(st)},[fe,st]),Object(u.useEffect)(function(){fe&&(yt&&fe.focus())},[fe,yt]),Object(u.useEffect)(function(){if(an&&fe){var un=fe.getScrollerElement();function Cn(pn){var Un=pn.target;if(Pr.current){var ur=Un.scrollTop/Un.scrollHeight;Pr.current.scrollTop=Pr.current.scrollHeight*ur}}return un.addEventListener("scroll",Cn),function(){un.removeEventListener("scroll",Cn)}}},[fe,an]),Object(u.useEffect)(function(){if(fe&&kt){function un(Cn,pn){kt(Cn,pn)}return fe.on("beforeChange",un),function(){fe.off("beforeChange",un)}}},[fe,kt]),Object(u.useEffect)(function(){if(fe&&at){function un(){at(fe.getValue())}return fe.on("blur",un),function(){fe.off("blur",un)}}},[fe,at]),Object(u.useEffect)(function(){if(fe){function un(Cn){var pn=Cn.getValue();$t(pn),wr(new Date().getTime()),Cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Bt&&Bt(pn)}return fe.on("change",un),function(){fe.off("change",un)}}},[fe,Bt]),Object(u.useEffect)(function(){fe&&(Mt==null?(fe.setValue(""),$t("")):Mt!==fe.getValue()&&(fe.setValue(Mt),$t(Mt),fe.setCursor(fe.lineCount(),0)))},[fe,Mt]);var ui=Object(u.useCallback)(function(un){var Cn=fe.getCursor(),pn=fe.getSelection(),Un=pn.split(` `);switch(un){case"bold":return fe.replaceSelection("**"+pn+"**"),pn===""&&fe.setCursor(Cn.line,Cn.ch+2),fe.focus();case"italic":return fe.replaceSelection("*"+pn+"*"),pn===""&&fe.setCursor(Cn.line,Cn.ch+1),fe.focus();case"code":return fe.replaceSelection("`"+pn+"`"),pn===""&&fe.setCursor(Cn.line,Cn.ch+1),fe.focus();case"inline-latex":return fe.replaceSelection("`$$"+pn+"$$`"),pn===""&&fe.setCursor(Cn.line,Cn.ch+3),fe.focus();case"latex":return fe.replaceSelection("```latex\n"+pn+"\n```"),fe.setCursor(Cn.line+1,pn.length+1),fe.focus();case"line-break":return fe.replaceSelection(`
    `),fe.focus();case"list-ul":return pn===""?fe.replaceSelection("- "+pn):fe.replaceSelection(Un.map(function(ur){return ur===""?"":"- ".concat(ur)}).join(` `)),fe.focus();case"list-ol":return pn===""?fe.replaceSelection("1. "+pn):fe.replaceSelection(Un.map(function(ur,mr){return ur===""?"":"".concat(mr+1,". ").concat(ur)}).join(` `)),fe.focus();case"add-null-ch":return pn===""&&fe.setCursor(Cn.line,Cn.ch+1),fe.replaceSelection(Xe),fe.focus();case"inster-template-1":return pn===""&&fe.setCursor(Cn.line,Cn.ch),fe.replaceSelection(Ke),fe.focus();case"eraser":return fe.setValue(""),fe.focus();case"trigger-watch":return jn(!an),fe.focus();case"trigger-full-screen":return hr(!Nn),fe.focus();case U:pr(U);return;case Y:pr(Y);return;case q:pr(q);return;case J:pr(J);return;default:throw new Error}},[fe,an,Nn]),Di=Object(u.useCallback)(function(un){pr("");switch(yr){case U:var Cn=un.title,pn=un.link;return fe.replaceSelection("[".concat(Cn,"](").concat(pn,")")),fe.focus();case Y:var Un=un.language,ur=un.content;return fe.replaceSelection(["```"+Un,ur,"```"].join(` `)),fe.focus();case q:var mr=un.src,Zn=un.alt,hn=un.name;return mr.indexOf("type=image")>-1?fe.replaceSelection("![ ".concat(Zn||""," ]( ").concat(mr,' "').concat(Zn||"",'" )')):mr.indexOf("type=application/pdf")>-1?fe.replaceSelection('').concat(hn,"")):fe.replaceSelection('').concat(hn,"")),fe.focus();case J:for(var Fr=un.row,Bn=un.col,Bi=un.align,cr=` `,Br=0;Br300&&(hn=300);var Fr=pt+hn+"px";zr(Fr)}}return un.addEventListener("mousedown",Un),document.addEventListener("mousemove",mr),document.addEventListener("mouseup",ur),function(){un.removeEventListener("mousedown",Un),document.removeEventListener("mousemove",mr),document.removeEventListener("mouseup",ur)}}},[fe,Ri]),Object(u.useEffect)(function(){zr(pt)},[pt]);var Fi=Fe(Dt),Ci=Fe(Kr),zi={width:Fi,height:Ci},qi=Object(u.useMemo)(function(){if(Zr){var un=new Date(Zr),Cn=un.getHours(),pn=un.getMinutes(),Un=un.getSeconds();return Cn=Cn<10?"0"+Cn:Cn,pn=pn<10?"0"+pn:pn,Un=Un<10?"0"+Un:Un,"".concat(Cn,":").concat(pn,":").concat(Un)}return 0},[Zr]);function yi(){window.sessionStorage.removeItem(bt),Fn(!1),wr(0)}function aa(){Fn(!1),wr(0),fe.setValue(window.sessionStorage.getItem(bt))}function ma(un,Cn){var pn=fe.getValue();pn=pn.replace(un,Cn),$t(pn),fe==null||fe.setValue(pn)}return o.a.createElement(u.Fragment,null,o.a.createElement("div",{className:"markdown-editor-wrapper",ref:rr},o.a.createElement("div",{className:"markdown-editor-container ".concat(wt," ").concat(an?"on-preview":""," ").concat(Pe?"mini":""," ").concat(Nn?"full-screen":""),style:zi},o.a.createElement(P,{insertTemp:Nt,watch:an,fullScreen:Nn,showNullButton:Z,onActionCallback:ui,hidetoolBar:me,uuid:Sn.current,setOpenPhones:function(){_r.current=!0}}),o.a.createElement("div",{className:"markdown-editor-body"},o.a.createElement("div",{className:"codemirror-container"},o.a.createElement("textarea",{ref:Lr,placeholder:Vt})),an?o.a.createElement("div",{ref:Pr,className:"preview-container"},it==="stex"&&o.a.createElement(E,{value:Pt}),it!=="stex"&&o.a.createElement(b.a,{edit:!0,value:Pt,replaces:ma})):null))),Xt?o.a.createElement("a",{ref:Ri,className:"editor-resize"}):null,o.a.createElement(I.a,null,De[yr]?o.a.createElement(Q.a,{centered:!0,title:De[yr],visible:!0,onCancel:ci,footer:null},ta):null))}},P5Jw:function(nt,Le,F){"use strict";var ue=F("rHrb"),Q=ue.CopyToClipboard;Q.CopyToClipboard=Q,nt.exports=Q},PD8m:function(nt,Le){nt.exports={name:"memoryStorage",read:ue,write:Q,each:j,remove:S,clearAll:D};var F={};function ue(x){return F[x]}function Q(x,T){F[x]=T}function j(x){for(var T in F)F.hasOwnProperty(T)&&x(F[T],T)}function S(x){delete F[x]}function D(x){F={}}},QDVR:function(nt,Le,F){"use strict";F.d(Le,"e",function(){return Q}),F.d(Le,"d",function(){return j}),F.d(Le,"c",function(){return T}),F.d(Le,"b",function(){return w}),F.d(Le,"a",function(){return p});var ue=function(){var u=function(o,i){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var h in s)s.hasOwnProperty(h)&&(l[h]=s[h])},u(o,i)};return function(o,i){u(o,i);function l(){this.constructor=o}o.prototype=i===null?Object.create(i):(l.prototype=i.prototype,new l)}}();function Q(u){var o=[];return u.forEach(function(i){return o.push(i)}),o}function j(u){var o=[];return u.forEach(function(i,l){return o.push(l)}),o}var S=function(){function u(){this._value="",this._pos=0}return u.prototype.reset=function(o){return this._value=o,this._pos=0,this},u.prototype.next=function(){return this._pos+=1,this},u.prototype.hasNext=function(){return this._pos0)s.left||(s.left=new x,s.left.segment=l.value()),s=s.left;else if(h<0)s.right||(s.right=new x,s.right.segment=l.value()),s=s.right;else if(l.hasNext())l.next(),s.mid||(s.mid=new x,s.mid.segment=l.value()),s=s.mid;else break}var r=s.value;return s.value=i,s.key=o,r},u.prototype.get=function(o){for(var i=this._iter.reset(o),l=this._root;l;){var s=i.cmp(l.segment);if(s>0)l=l.left;else if(s<0)l=l.right;else if(i.hasNext())i.next(),l=l.mid;else break}return l?l.value:void 0},u.prototype.findSubstr=function(o){for(var i=this._iter.reset(o),l=this._root,s=void 0;l;){var h=i.cmp(l.segment);if(h>0)l=l.left;else if(h<0)l=l.right;else if(i.hasNext())i.next(),s=l.value||s,l=l.mid;else break}return l&&l.value||s},u.prototype.forEach=function(o){this._forEach(this._root,o)},u.prototype._forEach=function(o,i){o&&(this._forEach(o.left,i),o.value&&i(o.value,o.key),this._forEach(o.mid,i),this._forEach(o.right,i))},u}(),w=function(){function u(){this.map=new Map,this.ignoreCase=!1}return u.prototype.set=function(o,i){this.map.set(this.toKey(o),i)},u.prototype.get=function(o){return this.map.get(this.toKey(o))},u.prototype.toKey=function(o){var i=o.toString();return this.ignoreCase&&(i=i.toLowerCase()),i},u}(),f=function(){function u(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return u.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(u.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),u.prototype.get=function(o,i){i===void 0&&(i=0);var l=this._map.get(o);return l?(i!==0&&this.touch(l,i),l.value):void 0},u.prototype.set=function(o,i,l){l===void 0&&(l=0);var s=this._map.get(o);if(s)s.value=i,l!==0&&this.touch(s,l);else{s={key:o,value:i,next:void 0,previous:void 0};switch(l){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(o,s),this._size++}},u.prototype.delete=function(o){return!!this.remove(o)},u.prototype.remove=function(o){var i=this._map.get(o);return i?(this._map.delete(o),this.removeItem(i),this._size--,i.value):void 0},u.prototype.forEach=function(o,i){for(var l=this._head;l;)i?o.bind(i)(l.value,l.key,this):o(l.value,l.key,this),l=l.next},u.prototype.trimOld=function(o){if(o>=this.size)return;if(o===0){this.clear();return}for(var i=this._head,l=this.size;i&&l>o;)this._map.delete(i.key),i=i.next,l--;this._head=i,this._size=l,i&&(i.previous=void 0)},u.prototype.addItemFirst=function(o){if(!this._head&&!this._tail)this._tail=o;else if(this._head)o.next=this._head,this._head.previous=o;else throw new Error("Invalid list");this._head=o},u.prototype.addItemLast=function(o){if(!this._head&&!this._tail)this._head=o;else if(this._tail)o.previous=this._tail,this._tail.next=o;else throw new Error("Invalid list");this._tail=o},u.prototype.removeItem=function(o){if(o===this._head&&o===this._tail)this._head=void 0,this._tail=void 0;else if(o===this._head){if(!o.next)throw new Error("Invalid list");o.next.previous=void 0,this._head=o.next}else if(o===this._tail){if(!o.previous)throw new Error("Invalid list");o.previous.next=void 0,this._tail=o.previous}else{var i=o.next,l=o.previous;if(!i||!l)throw new Error("Invalid list");i.previous=l,l.next=i}o.next=void 0,o.previous=void 0},u.prototype.touch=function(o,i){if(!this._head||!this._tail)throw new Error("Invalid list");if(i!==1&&i!==2)return;if(i===1){if(o===this._head)return;var l=o.next,s=o.previous;o===this._tail?(s.next=void 0,this._tail=s):(l.previous=s,s.next=l),o.previous=void 0,o.next=this._head,this._head.previous=o,this._head=o}else if(i===2){if(o===this._tail)return;var l=o.next,s=o.previous;o===this._head?(l.previous=void 0,this._head=l):(l.previous=s,s.next=l),o.next=void 0,o.previous=this._tail,this._tail.next=o,this._tail=o}},u.prototype.toJSON=function(){var o=[];return this.forEach(function(i,l){o.push([l,i])}),o},u}(),p=function(u){ue(o,u);function o(i,l){l===void 0&&(l=1);var s=u.call(this)||this;return s._limit=i,s._ratio=Math.min(Math.max(0,l),1),s}return o.prototype.get=function(i){return u.prototype.get.call(this,i,2)},o.prototype.peek=function(i){return u.prototype.get.call(this,i,0)},o.prototype.set=function(i,l){u.prototype.set.call(this,i,l,2),this.checkTrim()},o.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},o}(f)},RELg:function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global;nt.exports={name:"oldIE-userDataStorage",write:T,read:w,each:f,remove:p,clearAll:u};var j="storejs",S=Q.document,D=l(),x=(Q.navigator?Q.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function T(s,h){if(x)return;var r=i(s);D(function(t){t.setAttribute(r,h),t.save(j)})}function w(s){if(x)return;var h=i(s),r=null;return D(function(t){r=t.getAttribute(h)}),r}function f(s){D(function(h){for(var r=h.XMLDocument.documentElement.attributes,t=r.length-1;t>=0;t--){var n=r[t];s(h.getAttribute(n.name),n.name)}})}function p(s){var h=i(s);D(function(r){r.removeAttribute(h),r.save(j)})}function u(){D(function(s){var h=s.XMLDocument.documentElement.attributes;s.load(j);for(var r=h.length-1;r>=0;r--)s.removeAttribute(h[r].name);s.save(j)})}var o=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function i(s){return s.replace(/^\d/,"___$&").replace(o,"___")}function l(){if(!S||!S.documentElement||!S.documentElement.addBehavior)return null;var s="script",h,r,t;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+s+">document.w=window'),r.close(),h=r.w.frames[0].document,t=h.createElement("div")}catch(n){t=S.createElement("div"),h=S.body}return function(n){var c=[].slice.call(arguments,0);c.unshift(t),h.appendChild(t),t.addBehavior("#default#userData"),t.load(j),n.apply(this,c),h.removeChild(t);return}}},RpDr:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return b}),F.d(Le,"c",function(){return y});var ue=F("+L6B"),Q=F("2/Rp"),j=F("tJVT"),S=F("k1fw"),D=F("jrin"),x=F("5NDa"),T=F("5rEg"),w=F("q1tI"),f=F.n(w),p=F("8Skl"),u=F("y3Kf"),o=F("bdLU"),i=F("J66h"),l=F.n(i),s=F("++UQ"),h=F.n(s),r=F("IxHN"),t=F("9Bee"),n=F("1vsH"),c,m=T.a.TextArea,v={visible:!1,tabIndex:"0"},b=(c={},Object(D.a)(c,o.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(D.a)(c,o.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(D.a)(c,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(D.a)(c,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(D.a)(c,4,"\u7F16\u8BD1\u5931\u8D25"),Object(D.a)(c,5,"\u6267\u884C\u5931\u8D25"),c),E;(function(d){d[d.SET_VISIBLE=0]="SET_VISIBLE",d[d.SET_TABINDEX=1]="SET_TABINDEX"})(E||(E={}));function g(d,_){switch(_.type){case E.SET_VISIBLE:return Object(S.a)(Object(S.a)({},d),{},{visible:_.payload});case E.SET_TABINDEX:return Object(S.a)(Object(S.a)({},d),{},{tabIndex:_.payload});default:throw new Error}}function y(d){var _=d.status,O=d.error_msg,A=d.output,P=d.input,I=d.expected_output,W=d.is_file,K=d.input_file_url,te=d.output_file_url,H=d.expected_output_file_url,G=null,V={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(_){case o.a.NOMATCH:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!W&&f.a.createElement(t.a,{value:P,style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(K,P)}},P)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!W&&f.a.createElement(t.a,{value:A&&i.Base64.decode(A)||"",style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(te,A)}},A)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!W&&f.a.createElement(t.a,{value:I&&i.Base64.decode(I)||"",style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(H,I)}},I)));break;case o.a.EXECUTEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!W&&f.a.createElement(t.a,{value:P,style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(K,P)}},P)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.COMPILEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!W&&f.a.createElement(t.a,{value:P,style:V}),W&&f.a.createElement("div",{style:V},f.a.createElement("a",{onClick:function(){return Object(n.w)(K,P)}},P)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.PODFAILURE:G=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:G=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",G," ")}function C(d){var _=d.status,O=d.error_msg,A=d.execute_time,P=d.output,I=d.input,W=d.expected_output,K=d.is_file,te=d.input_file_url,H=d.output_file_url,G=d.expected_output_file_url,V=null;switch(_){case o.a.OK:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",A),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,i.Base64.decode(P)));break;case o.a.NOMATCH:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,I)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",P&&i.Base64.decode(P)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",W&&i.Base64.decode(W)));break;case o.a.EXECUTEFAILURE:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,I)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.COMPILEFAILURE:V=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,I)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},i.Base64.decode(O)));break;case o.a.PODFAILURE:V=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case o.a.TIMEOUT:V=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",V," ")}Le.b=function(d){var _=d.id,O=d.input,A=d.debuging,P=d.submitting,I=d.executingMessage,W=d.debugResult,K=d.onChangeInput,te=d.onDebugCode,H=d.onSubmitCode,G=Object(w.useReducer)(g,v),V=Object(j.a)(G,2),re=V[0],$=V[1],ne=re.visible,he=re.tabIndex;Object(w.useEffect)(function(){$({type:E.SET_VISIBLE,payload:!1})},[_]);function pe(Ee){var xe=Ee.target.id;$({type:E.SET_TABINDEX,payload:xe})}function Te(){$({type:E.SET_VISIBLE,payload:!ne})}var we=Object(w.useMemo)(function(){if(W){var Ee=W.status;return f.a.createElement(f.a.Fragment,null,C(W))}return null},[W]);function Me(){$({type:E.SET_VISIBLE,payload:!0}),$({type:E.SET_TABINDEX,payload:"1"}),te()}return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(ne?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:he==="0"?"active":"",id:"0",onClick:pe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:he==="1"?"active":"",id:"1",onClick:pe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="0"?"":"hide")},f.a.createElement(m,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:O,onChange:K})),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="1"?"":"hide")},A?f.a.createElement(r.a,{message:I}):W?f.a.createElement("section",{style:{height:200}}," ",we," "):f.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),f.a.createElement("a",{className:"btn-collapse ".concat(ne?"up":""),onClick:Te},ne?f.a.createElement(p.a,null):f.a.createElement(u.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},f.a.createElement(Q.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),f.a.createElement(Q.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(Q.a,{className:"btn-green",type:"ghost",loading:A,onClick:Me},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(Q.a,{type:"primary",loading:P,disabled:P,onClick:function(){$({type:E.SET_VISIBLE,payload:!1}),H()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(nt,Le,F){nt.exports=F.p+"static/time.a3dc82f3.svg"},"SA+Z":function(nt,Le,F){var ue=F("wTVA"),Q=F("EbDI"),j=F("ZhPi"),S=F("wkBT");function D(x){return ue(x)||Q(x)||j(x)||S()}nt.exports=D,nt.exports.__esModule=!0,nt.exports.default=nt.exports},SJMd:function(nt,Le){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var F,ue,Q,j=!1,S,D;window.PR_SHOULD_USE_CONTINUATION=!0;var x,T;(function(){var w=window,f=["break,continue,do,else,for,if,return,while"],p=[f,"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"],u=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],o=[u,"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"],i=[u,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[u,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",h=[u,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",t=[f,"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"],n=[f,"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"],c=[f,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],m=[o,l,i,h,r,t,n,c],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,b="str",E="kwd",g="com",y="typ",C="lit",d="pun",_="pln",O="tag",A="dec",P="src",I="atn",W="atv",K="nocode",te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(le){for(var Oe=0,Ie=!1,qe=!1,ee=0,k=le.length;ee122||(_e<65||Ue>90||Ze.push([Math.max(65,Ue)|32,Math.min(_e,90)|32]),_e<97||Ue>122||Ze.push([Math.max(97,Ue)&~32,Math.min(_e,122)&~32]))}}Ze.sort(function(rt,tt){return rt[0]-tt[0]||tt[1]-rt[1]});for(var Ce=[],Ne=[],Xe=0;XeDe[0]&&(De[1]+1>De[0]&&Qe.push("-"),Qe.push(J(De[1])))}return Qe.push("]"),Qe.join("")}function ke(He){for(var Be=He.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")),Ze=Be.length,ht=[],Qe=0,Xe=0;Qe=2&&Ue==="["?Be[Qe]=be(Ke):Ue!=="\\"&&(Be[Qe]=Ke.replace(/[a-zA-Z]/g,function(Ne){var De=Ne.charCodeAt(0);return"["+String.fromCharCode(De&~32,De|32)+"]"}))}return Be.join("")}for(var ct=[],ee=0,k=le.length;ee=0;)Ie[ct.charAt(He)]=ke;var Be=ke[1],Ze=""+Be;Y.hasOwnProperty(Ze)||(q.push(Be),Y[Ze]=null)}q.push(/[\0-\uffff]/),qe=H(q)})();var ee=Oe.length,k=function(U){for(var q=U.sourceCode,Y=U.basePos,J=U.sourceNode,be=[Y,_],ke=0,ct=q.match(qe)||[],He={},Be=0,Ze=ct.length;Be=5&&Qe.substring(0,5)==="lang-",Ke&&!(Xe&&typeof Xe[1]=="string")&&(Ke=!1,Qe=P),Ke||(He[ht]=Qe)}var _e=ke;if(ke+=ht.length,!Ke)be.push(Y+_e,Qe);else{var Ce=Xe[1],Ne=ht.indexOf(Ce),De=Ne+Ce.length;Xe[2]&&(De=ht.length-Xe[2].length,Ne=De-Ce.length);var rt=Qe.substring(5);V(J,Y+_e,ht.substring(0,Ne),k,be),V(J,Y+_e+Ne,Ce,xe(rt,Ce),be),V(J,Y+_e+De,ht.substring(De),k,be)}}U.decorations=be};return k}function he(le){var Oe=[],Ie=[];le.tripleQuotedStrings?Oe.push([b,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):le.multiLineStrings?Oe.push([b,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Oe.push([b,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),le.verbatimStrings&&Ie.push([b,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=le.hashComments;qe&&(le.cStyleComments?(qe>1?Oe.push([g,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Oe.push([g,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([b,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Oe.push([g,/^#[^\r\n]*/,null,"#"])),le.cStyleComments&&(Ie.push([g,/^\/\/[^\r\n]*/,null]),Ie.push([g,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ee=le.regexLiterals;if(ee){var k=ee>1?"":` \r`,U=k?".":"[\\S\\s]",q="/(?=[^/*"+k+"])(?:[^/\\x5B\\x5C"+k+"]|\\x5C"+U+"|\\x5B(?:[^\\x5C\\x5D"+k+"]|\\x5C"+U+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+te+"("+q+")")])}var Y=le.types;Y&&Ie.push([y,Y]);var J=(""+le.keywords).replace(/^ | $/g,"");J.length&&Ie.push([E,new RegExp("^(?:"+J.replace(/[\s,]+/g,"|")+")\\b"),null]),Oe.push([_,/^\s+/,null,` \r \xA0`]);var be="^.[^\\s\\w.$@'\"`/\\\\]*";return le.regexLiterals&&(be+="(?!s*/)"),Ie.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[_,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[_,/^\\[\s\S]?/,null],[d,new RegExp(be),null]),ne(Oe,Ie)}var pe=he({keywords:m,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(le,Oe,Ie){for(var qe=/(?:^|\s)nocode(?:\s|$)/,ee=/\r\n?|\n/,k=le.ownerDocument,U=k.createElement("li");le.firstChild;)U.appendChild(le.firstChild);var q=[U];function Y(Be){var Ze=Be.nodeType;if(Ze==1&&!qe.test(Be.className))if(Be.nodeName==="br")J(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var ht=Be.firstChild;ht;ht=ht.nextSibling)Y(ht);else if((Ze==3||Ze==4)&&Ie){var Qe=Be.nodeValue,Xe=Qe.match(ee);if(Xe){var Ke=Qe.substring(0,Xe.index);Be.nodeValue=Ke;var Fe=Qe.substring(Xe.index+Xe[0].length);if(Fe){var Ue=Be.parentNode;Ue.insertBefore(k.createTextNode(Fe),Be.nextSibling)}J(Be),Ke||Be.parentNode.removeChild(Be)}}}function J(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function Ze(Xe,Ke){var Fe=Ke?Xe.cloneNode(!1):Xe,Ue=Xe.parentNode;if(Ue){var _e=Ze(Ue,1),Ce=Xe.nextSibling;_e.appendChild(Fe);for(var Ne=Ce;Ne;Ne=Ce)Ce=Ne.nextSibling,_e.appendChild(Ne)}return Fe}for(var ht=Ze(Be.nextSibling,0),Qe;(Qe=ht.parentNode)&&Qe.nodeType===1;)ht=Qe;q.push(ht)}for(var be=0;be=Ue&&(Y+=2),k>=_e&&(ke+=2)}}finally{Qe&&(Qe.style.display=Xe)}}var Me={};function Ee(le,Oe){for(var Ie=Oe.length;--Ie>=0;){var qe=Oe[Ie];Me.hasOwnProperty(qe)?w.console&&console.warn("cannot override language handler %s",qe):Me[qe]=le}}function xe(le,Oe){return le&&Me.hasOwnProperty(le)||(le=/^\s*]*(?:>|$)/],[g,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ee(ne([[_,/^[\s]+/,null,` \r `],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[O,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),Ee(ne([],[[W,/^[\s\S]+/]]),["uq.val"]),Ee(he({keywords:o,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),Ee(he({keywords:"null,true,false"}),["json"]),Ee(he({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),Ee(he({keywords:i,cStyleComments:!0}),["java"]),Ee(he({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ee(he({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ee(he({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ee(he({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ee(he({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ee(he({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ee(ne([],[[b,/^[\s\S]+/]]),["regex"]);function Ge(le){var Oe=le.langExtension;try{var Ie=G(le.sourceNode,le.pre),qe=Ie.sourceCode;le.sourceCode=qe,le.spans=Ie.spans,le.basePos=0,xe(Oe,qe)(le),we(le)}catch(ee){w.console&&console.log(ee&&ee.stack||ee)}}function je(le,Oe,Ie){var qe=Ie||!1,ee=Oe||null,k=document.createElement("div");k.innerHTML="
    "+le+"
    ",k=k.firstChild,qe&&Te(k,qe,!0);var U={langExtension:ee,numberLines:qe,sourceNode:k,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ge(U),k.innerHTML}function We(le,Oe){var Ie=Oe||document.body,qe=Ie.ownerDocument||document;function ee(Fe){return Ie.getElementsByTagName(Fe)}for(var k=[ee("pre"),ee("code"),ee("xmp")],U=[],q=0;q=0){var c=t.split("!=");return w.create(c[0].trim(),this._deserializeValue(c[1],n))}if(t.indexOf("==")>=0){var c=t.split("==");return T.create(c[0].trim(),this._deserializeValue(c[1],n))}if(t.indexOf("=~")>=0){var c=t.split("=~");return p.create(c[0].trim(),this._deserializeRegexValue(c[1],n))}return/^\!\s*/.test(t)?f.create(t.substr(1).trim()):x.create(t)},r._deserializeValue=function(t,n){if(t=t.trim(),t==="true")return!0;if(t==="false")return!1;var c=/^'([^']*)'$/.exec(t);return c?c[1].trim():t},r._deserializeRegexValue=function(t,n){if(Object(ue.x)(t)){if(n)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var c=t.indexOf("/"),m=t.lastIndexOf("/");if(c===m||c<0){if(n)throw new Error("bad regexp-value '"+t+"', missing /-enclosure");return console.warn("bad regexp-value '"+t+"', missing /-enclosure"),null}var v=t.slice(c+1,m),b=t[m+1]==="i"?"i":"";try{return new RegExp(v,b)}catch(E){if(n)throw new Error("bad regexp-value '"+t+"', parse error: "+E);return console.warn("bad regexp-value '"+t+"', parse error: "+E),null}},r}();function D(r,t){var n=r.getType(),c=t.getType();if(n!==c)return n-c;switch(n){case 1:return r.cmp(t);case 2:return r.cmp(t);case 3:return r.cmp(t);case 4:return r.cmp(t);case 6:return r.cmp(t);case 7:return r.cmp(t);case 5:return r.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var x=function(){function r(t){this.key=t}return r.create=function(t){return new r(t)},r.prototype.getType=function(){return 1},r.prototype.cmp=function(t){return this.keyt.key?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key:!1},r.prototype.evaluate=function(t){return!!t.getValue(this.key)},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return f.create(this.key)},r}(),T=function(){function r(t,n){this.key=t,this.value=n}return r.create=function(t,n){return typeof n=="boolean"?n?x.create(t):f.create(t):new r(t,n)},r.prototype.getType=function(){return 3},r.prototype.cmp=function(t){return this.keyt.key?1:this.valuet.value?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key&&this.value===t.value:!1},r.prototype.evaluate=function(t){return t.getValue(this.key)==this.value},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return w.create(this.key,this.value)},r}(),w=function(){function r(t,n){this.key=t,this.value=n}return r.create=function(t,n){return typeof n=="boolean"?n?f.create(t):x.create(t):new r(t,n)},r.prototype.getType=function(){return 4},r.prototype.cmp=function(t){return this.keyt.key?1:this.valuet.value?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key&&this.value===t.value:!1},r.prototype.evaluate=function(t){return t.getValue(this.key)!=this.value},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return T.create(this.key,this.value)},r}(),f=function(){function r(t){this.key=t}return r.create=function(t){return new r(t)},r.prototype.getType=function(){return 2},r.prototype.cmp=function(t){return this.keyt.key?1:0},r.prototype.equals=function(t){return t instanceof r?this.key===t.key:!1},r.prototype.evaluate=function(t){return!t.getValue(this.key)},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return x.create(this.key)},r}(),p=function(){function r(t,n){this.key=t,this.regexp=n}return r.create=function(t,n){return new r(t,n)},r.prototype.getType=function(){return 6},r.prototype.cmp=function(t){if(this.keyt.key)return 1;var n=this.regexp?this.regexp.source:"",c=t.regexp?t.regexp.source:"";return nc?1:0},r.prototype.equals=function(t){if(t instanceof r){var n=this.regexp?this.regexp.source:"",c=t.regexp?t.regexp.source:"";return this.key===t.key&&n===c}return!1},r.prototype.evaluate=function(t){var n=t.getValue(this.key);return this.regexp?this.regexp.test(n):!1},r.prototype.keys=function(){return[this.key]},r.prototype.negate=function(){return u.create(this)},r}(),u=function(){function r(t){this._actual=t}return r.create=function(t){return new r(t)},r.prototype.getType=function(){return 7},r.prototype.cmp=function(t){return this._actual.cmp(t._actual)},r.prototype.equals=function(t){return t instanceof r?this._actual.equals(t._actual):!1},r.prototype.evaluate=function(t){return!this._actual.evaluate(t)},r.prototype.keys=function(){return this._actual.keys()},r.prototype.negate=function(){return this._actual},r}(),o=function(){function r(t){this.expr=t}return r.create=function(t){var n=r._normalizeArr(t);return n.length===0?void 0:n.length===1?n[0]:new r(n)},r.prototype.getType=function(){return 5},r.prototype.cmp=function(t){if(this.expr.lengtht.expr.length)return 1;for(var n=0,c=this.expr.length;n1;){for(var b=t.shift(),E=t.shift(),g=[],y=0,C=v(b);y=15&&(o=!1,f=!0);var b=n&&(p||o&&(v==null||v<12.11)),E=j||T&&w>=9;function g(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,a){var R=e.className,L=g(a).exec(R);if(L){var M=R.slice(L.index+L[0].length);e.className=R.slice(0,L.index)+(M?L[1]+M:"")}};function C(e){for(var a=e.childNodes.length;a>0;--a)e.removeChild(e.firstChild);return e}function d(e,a){return C(e).appendChild(a)}function _(e,a,R,L){var M=document.createElement(e);if(R&&(M.className=R),L&&(M.style.cssText=L),typeof a=="string")M.appendChild(document.createTextNode(a));else if(a)for(var X=0;X=a)return ce+(a-X);ce+=ve-X,ce+=R-ce%R,X=ve+1}}var re=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};re.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},re.prototype.set=function(e,a){this.f=a;var R=+new Date+e;(!this.id||R=a)return L+Math.min(ce,a-M);if(M+=X-L,M+=R-M%R,L=X+1,M>=a)return L}}var Ee=[""];function xe(e){for(;Ee.length<=e;)Ee.push(Ge(Ee)+" ");return Ee[e]}function Ge(e){return e[e.length-1]}function je(e,a){for(var R=[],L=0;L"\x80"&&(e.toUpperCase()!=e.toLowerCase()||le.test(e))}function Ie(e,a){return a?a.source.indexOf("\\w")>-1&&Oe(e)?!0:a.test(e):Oe(e)}function qe(e){for(var a in e)if(e.hasOwnProperty(a)&&e[a])return!1;return!0}var ee=/[\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 k(e){return e.charCodeAt(0)>=768&&ee.test(e)}function U(e,a,R){for(;(R<0?a>0:aR?-1:1;;){if(a==R)return a;var M=(a+R)/2,X=L<0?Math.ceil(M):Math.floor(M);if(X==a)return e(X)?a:R;e(X)?R=X:a=X+L}}function Y(e,a,R,L){if(!e)return L(a,R,"ltr",0);for(var M=!1,X=0;Xa||a==R&&ce.to==a)&&(L(Math.max(ce.from,a),Math.min(ce.to,R),ce.level==1?"rtl":"ltr",X),M=!0)}M||L(a,R,"ltr")}var J=null;function be(e,a,R){var L;J=null;for(var M=0;Ma)return M;X.to==a&&(X.from!=X.to&&R=="before"?L=M:J=M),X.from==a&&(X.from!=X.to&&R!="before"?L=M:J=M)}return L!=null?L:J}var ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",a="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function R(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?a.charAt(Se-1536):1774<=Se&&Se<=2220?"r":8192<=Se&&Se<=8203?"w":Se==8204?"b":"L"}var L=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,M=/[stwN]/,X=/[LRr]/,ce=/[Lb1n]/,ve=/[1n]/;function ye(Se,Ye,et){this.level=Se,this.from=Ye,this.to=et}return function(Se,Ye){var et=Ye=="ltr"?"L":"R";if(Se.length==0||Ye=="ltr"&&!L.test(Se))return!1;for(var vt=Se.length,dt=[],Lt=0;Lt-1&&(L[a]=M.slice(0,X).concat(M.slice(X+1)))}}}function Qe(e,a){var R=Ze(e,a);if(!R.length)return;for(var L=Array.prototype.slice.call(arguments,2),M=0;M0}function Ue(e){e.prototype.on=function(a,R){Be(this,a,R)},e.prototype.off=function(a,R){ht(this,a,R)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function De(e){_e(e),Ce(e)}function rt(e){return e.target||e.srcElement}function tt(e){var a=e.which;return a==null&&(e.button&1?a=1:e.button&2?a=3:e.button&4&&(a=2)),n&&e.ctrlKey&&a==1&&(a=3),a}var xt=function(){if(T&&w<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}(),Mt;function Bt(e){if(Mt==null){var a=_("span","\u200B");d(e,_("span",[a,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Mt=a.offsetWidth<=1&&a.offsetHeight>2&&!(T&&w<8))}var R=Mt?_("span","\u200B"):_("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return R.setAttribute("cm-text",""),R}var It;function Dt(e){if(It!=null)return It;var a=d(e,document.createTextNode("A\u062EA")),R=A(a,0,1).getBoundingClientRect(),L=A(a,1,2).getBoundingClientRect();return C(e),!R||R.left==R.right?!1:It=L.right-R.right<3}var lt=` b`.split(/\n/).length!=3?function(e){for(var a=0,R=[],L=e.length;a<=L;){var M=e.indexOf(` `,a);M==-1&&(M=e.length);var X=e.slice(a,e.charAt(M-1)=="\r"?M-1:M),ce=X.indexOf("\r");ce!=-1?(R.push(X.slice(0,ce)),a+=ce+1):(R.push(X),a=M+1)}return R}:function(e){return e.split(/\r\n?|\n/)},pt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(a){return!1}}:function(e){var a;try{a=e.ownerDocument.selection.createRange()}catch(R){}return!a||a.parentElement()!=e?!1:a.compareEndPoints("StartToEnd",a)!=0},ut=function(){var e=_("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Pe=null;function Ve(e){if(Pe!=null)return Pe;var a=d(e,_("span","x")),R=a.getBoundingClientRect(),L=A(a,0,1).getBoundingClientRect();return Pe=Math.abs(R.left-L.left)>1}var yt={},st={};function Nt(e,a){arguments.length>2&&(a.dependencies=Array.prototype.slice.call(arguments,2)),yt[e]=a}function Ut(e,a){st[e]=a}function it(e){if(typeof e=="string"&&st.hasOwnProperty(e))e=st[e];else if(e&&typeof e.name=="string"&&st.hasOwnProperty(e.name)){var a=st[e.name];typeof a=="string"&&(a={name:a}),e=de(a,e),e.name=a.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return it("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return it("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function mt(e,a){a=it(a);var R=yt[a.name];if(!R)return mt(e,"text/plain");var L=R(e,a);if(bt.hasOwnProperty(a.name)){var M=bt[a.name];for(var X in M){if(!M.hasOwnProperty(X))continue;L.hasOwnProperty(X)&&(L["_"+X]=L[X]),L[X]=M[X]}}if(L.name=a.name,a.helperType&&(L.helperType=a.helperType),a.modeProps)for(var ce in a.modeProps)L[ce]=a.modeProps[ce];return L}var bt={};function At(e,a){var R=bt.hasOwnProperty(e)?bt[e]:bt[e]={};G(a,R)}function Xt(e,a){if(a===!0)return a;if(e.copyState)return e.copyState(a);var R={};for(var L in a){var M=a[L];M instanceof Array&&(M=M.concat([])),R[L]=M}return R}function Ae(e,a){for(var R;e.innerMode&&!(R=e.innerMode(a),!R||R.mode==e);)a=R.state,e=R.mode;return R||{mode:e,state:a}}function ge(e,a,R){return e.startState?e.startState(a,R):!0}var z=function(e,a,R){this.pos=this.start=0,this.string=e,this.tabSize=a||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=R};z.prototype.eol=function(){return this.pos>=this.string.length},z.prototype.sol=function(){return this.pos==this.lineStart},z.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},z.prototype.next=function(){if(this.posa},z.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},z.prototype.skipToEnd=function(){this.pos=this.string.length},z.prototype.skipTo=function(e){var a=this.string.indexOf(e,this.pos);if(a>-1)return this.pos=a,!0},z.prototype.backUp=function(e){this.pos-=e},z.prototype.column=function(){return this.lastColumnPos0?null:(X&&a!==!1&&(this.pos+=X[0].length),X)}},z.prototype.current=function(){return this.string.slice(this.start,this.pos)},z.prototype.hideFirstChars=function(e,a){this.lineStart+=e;try{return a()}finally{this.lineStart-=e}},z.prototype.lookAhead=function(e){var a=this.lineOracle;return a&&a.lookAhead(e)},z.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Z(e,a){if(a-=e.first,a<0||a>=e.size)throw new Error("There is no line "+(a+e.first)+" in the document.");for(var R=e;!R.lines;)for(var L=0;;++L){var M=R.children[L],X=M.chunkSize();if(a=e.first&&aR?ot(R,Z(e,R).text.length):B(a,Z(e,a.line).text.length)}function B(e,a){var R=e.ch;return R==null||R>a?ot(e.line,a):R<0?ot(e.line,0):e}function ae(e,a){for(var R=[],L=0;Lthis.maxLookAhead&&(this.maxLookAhead=e),a},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var a=this.baseTokens[this.baseTokenPos+1];return{type:a&&a.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,a,R){return a instanceof fe?new se(e,Xt(e.mode,a.state),R,a.lookAhead):new se(e,Xt(e.mode,a),R)},se.prototype.save=function(e){var a=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fe(a,this.maxLookAhead):a};function $e(e,a,R,L){var M=[e.state.modeGen],X={};Cr(e,a.text,e.doc.mode,R,function(Se,Ye){return M.push(Se,Ye)},X,L);for(var ce=R.state,ve=function(Se){R.baseTokens=M;var Ye=e.state.overlays[Se],et=1,vt=0;R.state=!0,Cr(e,a.text,Ye.mode,R,function(dt,Lt){for(var Ft=et;vtdt&&M.splice(et,1,dt,M[et+1],Gt),et+=2,vt=Math.min(dt,Gt)}if(!Lt)return;if(Ye.opaque)M.splice(Ft,et-Ft,dt,"overlay "+Lt),et=Ft+2;else for(;Fte.options.maxHighlightLength&&Xt(e.doc.mode,L.state),X=$e(e,a,L);M&&(L.state=M),a.stateAfter=L.save(!M),a.styles=X.styles,X.classes?a.styleClasses=X.classes:a.styleClasses&&(a.styleClasses=null),R===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return a.styles}function Pt(e,a,R){var L=e.doc,M=e.display;if(!L.mode.startState)return new se(L,!0,a);var X=Nn(e,a,R),ce=X>L.first&&Z(L,X-1).stateAfter,ve=ce?se.fromSaved(L,ce,X):new se(L,ge(L.mode),X);return L.iter(X,a,function(ye){$t(e,ye.text,ve);var Se=ve.line;ye.stateAfter=Se==a-1||Se%5==0||Se>=M.viewFrom&&Sea.start)return X}throw new Error("Mode "+e.name+" failed to advance stream.")}var an=function(e,a,R){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=a||null,this.state=R};function jn(e,a,R,L){var M=e.doc,X=M.mode,ce;a=N(M,a);var ve=Z(M,a.line),ye=Pt(e,a.line,R),Se=new z(ve.text,e.options.tabSize,ye),Ye;for(L&&(Ye=[]);(L||Se.pose.options.maxHighlightLength?(ve=!1,ce&&$t(e,a,L,Ye.pos),Ye.pos=a.length,et=null):et=Dr(zt(R,Ye,L.state,vt),X),vt){var dt=vt[0].name;dt&&(et="m-"+(et?dt+" "+et:dt))}if(!ve||Se!=et){for(;yece;--ve){if(ve<=X.first)return X.first;var ye=Z(X,ve-1),Se=ye.stateAfter;if(Se&&(!R||ve+(Se instanceof fe?Se.lookAhead:0)<=X.modeFrontier))return ve;var Ye=V(ye.text,null,e.options.tabSize);(M==null||L>Ye)&&(M=ve-1,L=Ye)}return M}function hr(e,a){if(e.modeFrontier=Math.min(e.modeFrontier,a),e.highlightFrontierR;L--){var M=Z(e,L).stateAfter;if(M&&(!(M instanceof fe)||L+M.lookAhead=a:X.to>a);(L||(L=[])).push(new Yr(ce,X.from,ye?null:X.to))}}return L}function li(e,a,R){var L;if(e)for(var M=0;M=a:X.to>a);if(ve||X.from==a&&ce.type=="bookmark"&&(!R||X.marker.insertLeft)){var ye=X.from==null||(ce.inclusiveLeft?X.from<=a:X.from0&&ve)for(var ln=0;ln0)continue;var Ye=[ye,1],et=wt(Se.from,ve.from),vt=wt(Se.to,ve.to);(et<0||!ce.inclusiveLeft&&!et)&&Ye.push({from:Se.from,to:ve.from}),(vt>0||!ce.inclusiveRight&&!vt)&&Ye.push({from:ve.to,to:Se.to}),M.splice.apply(M,Ye),ye+=Ye.length-3}return M}function gi(e){var a=e.markedSpans;if(!a)return;for(var R=0;Ra)&&(!L||_r(L,X.marker)<0)&&(L=X.marker)}return L}function Pr(e,a,R,L,M){var X=Z(e,a),ce=Or&&X.markedSpans;if(ce)for(var ve=0;ve=0&&et<=0||Ye<=0&&et>=0)continue;if(Ye<=0&&(ye.marker.inclusiveRight&&M.inclusiveLeft?wt(Se.to,R)>=0:wt(Se.to,R)>0)||Ye>=0&&(ye.marker.inclusiveRight&&M.inclusiveLeft?wt(Se.from,L)<=0:wt(Se.from,L)<0))return!0}}function ni(e){for(var a;a=Lr(e);)e=a.find(-1,!0).line;return e}function ji(e){for(var a;a=rr(e);)e=a.find(1,!0).line;return e}function ui(e){for(var a,R;a=rr(e);)e=a.find(1,!0).line,(R||(R=[])).push(e);return R}function Di(e,a){var R=Z(e,a),L=ni(R);return R==L?a:Je(L)}function ta(e,a){if(a>e.lastLine())return a;var R=Z(e,a),L;if(!ci(e,R))return a;for(;L=rr(R);)R=L.find(1,!0).line;return Je(R)+1}function ci(e,a){var R=Or&&a.markedSpans;if(R)for(var L=void 0,M=0;Ma.maxLineLength&&(a.maxLineLength=M,a.maxLine=L)})}var yi=function(e,a,R){this.text=e,Si(this,a),this.height=R?R(this):1};yi.prototype.lineNo=function(){return Je(this)},Ue(yi);function aa(e,a,R,L){e.text=a,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gi(e),Si(e,R);var M=L?L(e):1;M!=e.height&&Re(e,M)}function ma(e){e.parent=null,gi(e)}var un={},Cn={};function pn(e,a){if(!e||/^\s*$/.test(e))return null;var R=a.addModeClass?Cn:un;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,a){var R=O("span",null,null,f?"padding-right: .1px":null),L={pre:O("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};a.measure={};for(var M=0;M<=(a.rest?a.rest.length:0);M++){var X=M?a.rest[M-1]:a.line,ce=void 0;L.pos=0,L.addToken=mr,Dt(e.display.measure)&&(ce=ct(X,e.doc.direction))&&(L.addToken=hn(L.addToken,ce)),L.map=[];var ve=a!=e.display.externalMeasured&&Je(X);Bn(X,L,St(e,X,ve)),X.styleClasses&&(X.styleClasses.bgClass&&(L.bgClass=K(X.styleClasses.bgClass,L.bgClass||"")),X.styleClasses.textClass&&(L.textClass=K(X.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Bt(e.display.measure))),M==0?(a.measure.map=L.map,a.measure.cache={}):((a.measure.maps||(a.measure.maps=[])).push(L.map),(a.measure.caches||(a.measure.caches=[])).push({}))}if(f){var ye=L.content.lastChild;(/\bcm-tab\b/.test(ye.className)||ye.querySelector&&ye.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return Qe(e,"renderLine",e,a.line,L.pre),L.pre.className&&(L.textClass=K(L.pre.className,L.textClass||"")),L}function ur(e){var a=_("span","\u2022","cm-invalidchar");return a.title="\\u"+e.charCodeAt(0).toString(16),a.setAttribute("aria-label",a.title),a}function mr(e,a,R,L,M,X,ce){if(!a)return;var ve=e.splitSpaces?Zn(a,e.trailingSpace):a,ye=e.cm.state.specialChars,Se=!1,Ye;if(!ye.test(a))e.col+=a.length,Ye=document.createTextNode(ve),e.map.push(e.pos,e.pos+a.length,Ye),T&&w<9&&(Se=!0),e.pos+=a.length;else{Ye=document.createDocumentFragment();for(var et=0;;){ye.lastIndex=et;var vt=ye.exec(a),dt=vt?vt.index-et:a.length-et;if(dt){var Lt=document.createTextNode(ve.slice(et,et+dt));T&&w<9?Ye.appendChild(_("span",[Lt])):Ye.appendChild(Lt),e.map.push(e.pos,e.pos+dt,Lt),e.col+=dt,e.pos+=dt}if(!vt)break;et+=dt+1;var Ft=void 0;if(vt[0]==" "){var Gt=e.cm.options.tabSize,en=Gt-e.col%Gt;Ft=Ye.appendChild(_("span",xe(en),"cm-tab")),Ft.setAttribute("role","presentation"),Ft.setAttribute("cm-text"," "),e.col+=en}else vt[0]=="\r"||vt[0]==` `?(Ft=Ye.appendChild(_("span",vt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ft.setAttribute("cm-text",vt[0]),e.col+=1):(Ft=e.cm.options.specialCharPlaceholder(vt[0]),Ft.setAttribute("cm-text",vt[0]),T&&w<9?Ye.appendChild(_("span",[Ft])):Ye.appendChild(Ft),e.col+=1);e.map.push(e.pos,e.pos+1,Ft),e.pos++}}if(e.trailingSpace=ve.charCodeAt(a.length-1)==32,R||L||M||Se||X||ce){var on=R||"";L&&(on+=L),M&&(on+=M);var tn=_("span",[Ye],on,X);if(ce)for(var ln in ce)ce.hasOwnProperty(ln)&&ln!="style"&&ln!="class"&&tn.setAttribute(ln,ce[ln]);return e.content.appendChild(tn)}e.content.appendChild(Ye)}function Zn(e,a){if(e.length>1&&!/ /.test(e))return e;for(var R=a,L="",M=0;MSe&&et.from<=Se);vt++);if(et.to>=Ye)return e(R,L,M,X,ce,ve,ye);e(R,L.slice(0,et.to-Se),M,X,null,ve,ye),X=null,L=L.slice(et.to-Se),Se=et.to}}}function Fr(e,a,R,L){var M=!L&&R.widgetNode;M&&e.map.push(e.pos,e.pos+a,M),!L&&e.cm.display.input.needsContentAttribute&&(M||(M=e.content.appendChild(document.createElement("span"))),M.setAttribute("cm-marker",R.id)),M&&(e.cm.display.input.setUneditable(M),e.content.appendChild(M)),e.pos+=a,e.trailingSpace=!1}function Bn(e,a,R){var L=e.markedSpans,M=e.text,X=0;if(!L){for(var ce=1;ceye||qn.collapsed&&En.to==ye&&En.from==ye)){if(En.to!=null&&En.to!=ye&&dt>En.to&&(dt=En.to,Ft=""),qn.className&&(Lt+=" "+qn.className),qn.css&&(vt=(vt?vt+";":"")+qn.css),qn.startStyle&&En.from==ye&&(Gt+=" "+qn.startStyle),qn.endStyle&&En.to==dt&&(ln||(ln=[])).push(qn.endStyle,En.to),qn.title&&((on||(on={})).title=qn.title),qn.attributes)for(var Rr in qn.attributes)(on||(on={}))[Rr]=qn.attributes[Rr];qn.collapsed&&(!en||_r(en.marker,qn)<0)&&(en=En)}else En.from>ye&&dt>En.from&&(dt=En.from)}if(ln)for(var oi=0;oi=ve)break;for(var ki=Math.min(ve,dt);;){if(Ye){var Ai=ye+Ye.length;if(!en){var Qr=Ai>ki?Ye.slice(0,ki-ye):Ye;a.addToken(a,Qr,et?et+Lt:Lt,Gt,ye+Qr.length==dt?Ft:"",vt,on)}if(Ai>=ki){Ye=Ye.slice(ki-ye),ye=ki;break}ye=Ai,Gt=""}Ye=M.slice(X,X=R[Se++]),et=pn(R[Se++],a.cm.options)}}}function Bi(e,a,R){this.line=a,this.rest=ui(a),this.size=this.rest?Je(Ge(this.rest))-R+1:1,this.node=this.text=null,this.hidden=ci(e,a)}function cr(e,a,R){for(var L=[],M,X=a;X2&&X.push((ye.bottom+Se.top)/2-R.top)}}X.push(R.bottom-R.top)}}function fr(e,a,R){if(e.line==a)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;LR)return{map:e.measure.maps[M],cache:e.measure.caches[M],before:!0}}function Wn(e,a){a=ni(a);var R=Je(a),L=e.display.externalMeasured=new Bi(e.doc,a,R);L.lineN=R;var M=L.built=Un(e,L);return L.text=M.pre,d(e.display.lineMeasure,M.pre),L}function Jt(e,a,R,L){return or(e,tr(e,a),R,L)}function gn(e,a){if(a>=e.display.viewFrom&&a=R.lineN&&aa)&&(X=ye-ve,M=X-1,a>=ye&&(ce="right")),M!=null){if(L=e[Se+2],ve==ye&&R==(L.insertLeft?"left":"right")&&(ce=R),R=="left"&&M==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)L=e[(Se-=3)+2],ce="left";if(R=="right"&&M==ye-ve)for(;Se=0&&!((R=e[M]).left!=R.right);M--);return R}function yn(e,a,R,L){var M=Jn(a.map,R,L),X=M.node,ce=M.start,ve=M.end,ye=M.collapse,Se;if(X.nodeType==3){for(var Ye=0;Ye<4;Ye++){for(;ce&&k(a.line.text.charAt(M.coverStart+ce));)--ce;for(;M.coverStart+ve0&&(ye=L="right");var et;e.options.lineWrapping&&(et=X.getClientRects()).length>1?Se=et[L=="right"?et.length-1:0]:Se=X.getBoundingClientRect()}if(T&&w<9&&!ce&&(!Se||!Se.left&&!Se.right)){var vt=X.parentNode.getClientRects()[0];vt?Se={left:vt.left,right:vt.left+Xn(e.display),top:vt.top,bottom:vt.bottom}:Se=gr}for(var dt=Se.top-a.rect.top,Lt=Se.bottom-a.rect.top,Ft=(dt+Lt)/2,Gt=a.view.measure.heights,en=0;en=L.text.length?(ye=L.text.length,Se="before"):ye<=0&&(ye=0,Se="after"),!ve)return ce(Se=="before"?ye-1:ye,Se=="before");function Ye(Lt,Ft,Gt){var en=ve[Ft],on=en.level==1;return ce(Gt?Lt-1:Lt,on!=Gt)}var et=be(ve,ye,Se),vt=J,dt=Ye(ye,et,Se=="before");return vt!=null&&(dt.other=Ye(ye,vt,Se!="before")),dt}function sr(e,a){var R=0;a=N(e.doc,a),e.options.lineWrapping||(R=Xn(e.display)*a.ch);var L=Z(e.doc,a.line),M=Ci(L)+Gn(e.display);return{left:R,right:R,top:M,bottom:M+L.height}}function br(e,a,R,L,M){var X=ot(e,a,R);return X.xRel=M,L&&(X.outside=L),X}function kr(e,a,R){var L=e.doc;if(R+=e.display.viewOffset,R<0)return br(L.first,0,null,-1,-1);var M=at(L,R),X=L.first+L.size-1;if(M>X)return br(L.first+L.size-1,Z(L,X).text.length,null,1,1);a<0&&(a=0);for(var ce=Z(L,M);;){var ve=Wi(e,ce,M,a,R),ye=Ri(ce,ve.ch+(ve.xRel>0||ve.outside>0?1:0));if(!ye)return ve;var Se=ye.find(1);if(Se.line==M)return Se;ce=Z(L,M=Se.line)}}function ei(e,a,R,L){L-=Hn(a);var M=a.text.length,X=q(function(ce){return or(e,R,ce-1).bottom<=L},M,0);return M=q(function(ce){return or(e,R,ce).top>L},X,M),{begin:X,end:M}}function Mi(e,a,R,L){R||(R=tr(e,a));var M=bn(e,a,or(e,R,L),"line").top;return ei(e,a,R,M)}function $r(e,a,R,L){return e.bottom<=R?!1:e.top>R?!0:(L?e.left:e.right)>a}function Wi(e,a,R,L,M){M-=Ci(a);var X=tr(e,a),ce=Hn(a),ve=0,ye=a.text.length,Se=!0,Ye=ct(a,e.doc.direction);if(Ye){var et=(e.options.lineWrapping?Gi:na)(e,a,R,X,Ye,L,M);Se=et.level!=1,ve=Se?et.from:et.to-1,ye=Se?et.to:et.from-1}var vt=null,dt=null,Lt=q(function(On){var En=or(e,X,On);return En.top+=ce,En.bottom+=ce,$r(En,L,M,!1)?(En.top<=M&&En.left<=L&&(vt=On,dt=En),!0):!1},ve,ye),Ft,Gt,en=!1;if(dt){var on=L-dt.left=ln.bottom?1:0}return Lt=U(a.text,Lt,1),br(R,Lt,Gt,en,L-Ft)}function na(e,a,R,L,M,X,ce){var ve=q(function(et){var vt=M[et],dt=vt.level!=1;return $r(Vn(e,ot(R,dt?vt.to:vt.from,dt?"before":"after"),"line",a,L),X,ce,!0)},0,M.length-1),ye=M[ve];if(ve>0){var Se=ye.level!=1,Ye=Vn(e,ot(R,Se?ye.from:ye.to,Se?"after":"before"),"line",a,L);$r(Ye,X,ce,!0)&&Ye.top>ce&&(ye=M[ve-1])}return ye}function Gi(e,a,R,L,M,X,ce){var ve=ei(e,a,L,ce),ye=ve.begin,Se=ve.end;/\s/.test(a.text.charAt(Se-1))&&Se--;for(var Ye=null,et=null,vt=0;vt=Se||dt.to<=ye)continue;var Lt=dt.level!=1,Ft=or(e,L,Lt?Math.min(Se,dt.to)-1:Math.max(ye,dt.from)).right,Gt=FtGt)&&(Ye=dt,et=Gt)}return Ye||(Ye=M[M.length-1]),Ye.fromSe&&(Ye={from:Ye.from,to:Se,level:Ye.level}),Ye}var di;function Vi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(di==null){di=_("pre",null,"CodeMirror-line-like");for(var a=0;a<49;++a)di.appendChild(document.createTextNode("x")),di.appendChild(_("br"));di.appendChild(document.createTextNode("x"))}d(e.measure,di);var R=di.offsetHeight/50;return R>3&&(e.cachedTextHeight=R),C(e.measure),R||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var a=_("span","xxxxxxxxxx"),R=_("pre",[a],"CodeMirror-line-like");d(e.measure,R);var L=a.getBoundingClientRect(),M=(L.right-L.left)/10;return M>2&&(e.cachedCharWidth=M),M||10}function An(e){for(var a=e.display,R={},L={},M=a.gutters.clientLeft,X=a.gutters.firstChild,ce=0;X;X=X.nextSibling,++ce){var ve=e.display.gutterSpecs[ce].className;R[ve]=X.offsetLeft+X.clientLeft+M,L[ve]=X.clientWidth}return{fixedPos:nr(a),gutterTotalWidth:a.gutters.offsetWidth,gutterLeft:R,gutterWidth:L,wrapperWidth:a.wrapper.clientWidth}}function nr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var a=Vi(e.display),R=e.options.lineWrapping,L=R&&Math.max(5,e.display.scroller.clientWidth/Xn(e.display)-3);return function(M){if(ci(e.doc,M))return 0;var X=0;if(M.widgets)for(var ce=0;ce0&&(Se=Z(e.doc,ye.line).text).length==ye.ch){var Ye=V(Se,Se.length,e.options.tabSize)-Se.length;ye=ot(ye.line,Math.max(0,Math.round((X-ir(e.display).left)/Xn(e.display))-Ye))}return ye}function ri(e,a){if(a>=e.display.viewTo)return null;if(a-=e.display.viewFrom,a<0)return null;for(var R=e.display.view,L=0;La)&&(M.updateLineNumbers=a),e.curOp.viewChanged=!0,a>=M.viewTo)Or&&Di(e.doc,a)M.viewFrom?wi(e):(M.viewFrom+=L,M.viewTo+=L);else if(a<=M.viewFrom&&R>=M.viewTo)wi(e);else if(a<=M.viewFrom){var X=Ii(e,R,R+L,1);X?(M.view=M.view.slice(X.index),M.viewFrom=X.lineN,M.viewTo+=L):wi(e)}else if(R>=M.viewTo){var ce=Ii(e,a,a,-1);ce?(M.view=M.view.slice(0,ce.index),M.viewTo=ce.lineN):wi(e)}else{var ve=Ii(e,a,a,-1),ye=Ii(e,R,R+L,1);ve&&ye?(M.view=M.view.slice(0,ve.index).concat(cr(e,ve.lineN,ye.lineN)).concat(M.view.slice(ye.index)),M.viewTo+=L):wi(e)}var Se=M.externalMeasured;Se&&(R=M.lineN&&a=L.viewTo)return;var X=L.view[ri(e,a)];if(X.node==null)return;var ce=X.changes||(X.changes=[]);$(ce,R)==-1&&ce.push(R)}function wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ii(e,a,R,L){var M=ri(e,a),X,ce=e.display.view;if(!Or||R==e.doc.first+e.doc.size)return{index:M,lineN:R};for(var ve=e.display.viewFrom,ye=0;ye0){if(M==ce.length-1)return null;X=ve+ce[M].size-a,M++}else X=ve-a;a+=X,R+=X}for(;Di(e.doc,R)!=R;){if(M==(L<0?0:ce.length-1))return null;R+=L*ce[M-(L<0?1:0)].size,M+=L}return{index:M,lineN:R}}function Xi(e,a,R){var L=e.display,M=L.view;M.length==0||a>=L.viewTo||R<=L.viewFrom?(L.view=cr(e,a,R),L.viewFrom=a):(L.viewFrom>a?L.view=cr(e,a,L.viewFrom).concat(L.view):L.viewFromR&&(L.view=L.view.slice(0,ri(e,R)))),L.viewTo=R}function Kn(e){for(var a=e.display.view,R=0,L=0;L=e.display.viewTo||ve.to().line0?a.blinker=setInterval(function(){e.hasFocus()||Hi(e),a.cursorDiv.style.visibility=(R=!R)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(a.cursorDiv.style.visibility="hidden")}function Vr(e){e.state.focused||(e.display.input.focus(),vn(e))}function va(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Hi(e))},100)}function vn(e,a){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Qe(e,"focus",e,a),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),f&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Gr(e)}function Hi(e,a){if(e.state.delayingBlurEvent)return;e.state.focused&&(Qe(e,"blur",e,a),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function oa(e){for(var a=e.display,R=a.lineDiv.offsetTop,L=0;L.005||Ye<-.005)&&(Re(M.line,ce),Yi(M.line),M.rest))for(var et=0;ete.display.sizerWidth){var vt=Math.ceil(ve/Xn(e.display));vt>e.display.maxLineLength&&(e.display.maxLineLength=vt,e.display.maxLine=M.line,e.display.maxLineChanged=!0)}}}function Yi(e){if(e.widgets)for(var a=0;a=ce&&(X=at(a,Ci(Z(a,ye))-e.wrapper.clientHeight),ce=ye)}return{from:X,to:Math.max(ce,X+1)}}function $i(e,a){if(Xe(e,"scrollCursorIntoView"))return;var R=e.display,L=R.sizer.getBoundingClientRect(),M=null;if(a.top+L.top<0?M=!0:a.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!s){var X=_("div","\u200B",null,`position: absolute; top: `+(a.top-R.viewOffset-Gn(e.display))+`px; height: `+(a.bottom-a.top+dr(e)+R.barHeight)+`px; left: `+a.left+"px; width: "+Math.max(2,a.right-a.left)+"px;");e.display.lineSpace.appendChild(X),X.scrollIntoView(M),e.display.lineSpace.removeChild(X)}}function sa(e,a,R,L){L==null&&(L=0);var M;!e.options.lineWrapping&&a==R&&(a=a.ch?ot(a.line,a.sticky=="before"?a.ch-1:a.ch,"after"):a,R=a.sticky=="before"?ot(a.line,a.ch+1,"before"):a);for(var X=0;X<5;X++){var ce=!1,ve=Vn(e,a),ye=!R||R==a?ve:Vn(e,R);M={left:Math.min(ve.left,ye.left),top:Math.min(ve.top,ye.top)-L,right:Math.max(ve.left,ye.left),bottom:Math.max(ve.bottom,ye.bottom)+L};var Se=Zi(e,M),Ye=e.doc.scrollTop,et=e.doc.scrollLeft;if(Se.scrollTop!=null&&(Ua(e,Se.scrollTop),Math.abs(e.doc.scrollTop-Ye)>1&&(ce=!0)),Se.scrollLeft!=null&&(ga(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-et)>1&&(ce=!0)),!ce)break}return M}function la(e,a){var R=Zi(e,a);R.scrollTop!=null&&Ua(e,R.scrollTop),R.scrollLeft!=null&&ga(e,R.scrollLeft)}function Zi(e,a){var R=e.display,L=Vi(e.display);a.top<0&&(a.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,X=xr(e),ce={};a.bottom-a.top>X&&(a.bottom=a.top+X);var ve=e.doc.height+Tr(R),ye=a.topve-L;if(a.topM+X){var Ye=Math.min(a.top,(Se?ve:a.bottom)-X);Ye!=M&&(ce.scrollTop=Ye)}var et=e.options.fixedGutter?0:R.gutters.offsetWidth,vt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:R.scroller.scrollLeft-et,dt=vr(e)-R.gutters.offsetWidth,Lt=a.right-a.left>dt;return Lt&&(a.right=a.left+dt),a.left<10?ce.scrollLeft=0:a.leftdt+vt-3&&(ce.scrollLeft=a.right+(Lt?0:10)-dt),ce}function Ia(e,a){if(a==null)return;no(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+a}function Ir(e){no(e);var a=e.getCursor();e.curOp.scrollToPos={from:a,to:a,margin:e.options.cursorScrollMargin}}function Na(e,a,R){(a!=null||R!=null)&&no(e),a!=null&&(e.curOp.scrollLeft=a),R!=null&&(e.curOp.scrollTop=R)}function Qs(e,a){no(e),e.curOp.scrollToPos=a}function no(e){var a=e.curOp.scrollToPos;if(a){e.curOp.scrollToPos=null;var R=sr(e,a.from),L=sr(e,a.to);Wo(e,R,L,a.margin)}}function Wo(e,a,R,L){var M=Zi(e,{left:Math.min(a.left,R.left),top:Math.min(a.top,R.top)-L,right:Math.max(a.right,R.right),bottom:Math.max(a.bottom,R.bottom)+L});Na(e,M.scrollLeft,M.scrollTop)}function Ua(e,a){if(Math.abs(e.doc.scrollTop-a)<2)return;j||Eo(e,{top:a}),Ho(e,a,!0),j&&Eo(e),Ba(e,100)}function Ho(e,a,R){if(a=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,a)),e.display.scroller.scrollTop==a&&!R)return;e.doc.scrollTop=a,e.display.scrollbars.setScrollTop(a),e.display.scroller.scrollTop!=a&&(e.display.scroller.scrollTop=a)}function ga(e,a,R,L){if(a=Math.max(0,Math.min(a,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?a==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-a)<2)&&!L)return;e.doc.scrollLeft=a,Xo(e),e.display.scroller.scrollLeft!=a&&(e.display.scroller.scrollLeft=a),e.display.scrollbars.setScrollLeft(a)}function ja(e){var a=e.display,R=a.gutters.offsetWidth,L=Math.round(e.doc.height+Tr(e.display));return{clientHeight:a.scroller.clientHeight,viewHeight:a.wrapper.clientHeight,scrollWidth:a.scroller.scrollWidth,clientWidth:a.scroller.clientWidth,viewWidth:a.wrapper.clientWidth,barLeft:e.options.fixedGutter?R:0,docHeight:L,scrollHeight:L+dr(e)+a.barHeight,nativeBarWidth:a.nativeBarWidth,gutterWidth:R}}var ya=function(e,a,R){this.cm=R;var L=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=M.tabIndex=-1,e(L),e(M),Be(L,"scroll",function(){L.clientHeight&&a(L.scrollTop,"vertical")}),Be(M,"scroll",function(){M.clientWidth&&a(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&w<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ya.prototype.update=function(e){var a=e.scrollWidth>e.clientWidth+1,R=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(R){this.vert.style.display="block",this.vert.style.bottom=a?L+"px":"0";var M=e.viewHeight-(a?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+M)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(a){this.horiz.style.display="block",this.horiz.style.right=R?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var X=e.viewWidth-e.barLeft-(R?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+X)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(L==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:R?L:0,bottom:a?L:0}},ya.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ya.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ya.prototype.zeroWidthHack=function(){var e=n&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new re,this.disableVert=new re},ya.prototype.enableZeroWidthBar=function(e,a,R){e.style.pointerEvents="auto";function L(){var M=e.getBoundingClientRect(),X=R=="vert"?document.elementFromPoint(M.right-1,(M.top+M.bottom)/2):document.elementFromPoint((M.right+M.left)/2,M.bottom-1);X!=e?e.style.pointerEvents="none":a.set(1e3,L)}a.set(1e3,L)},ya.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fa=function(){};Fa.prototype.update=function(){return{bottom:0,right:0}},Fa.prototype.setScrollLeft=function(){},Fa.prototype.setScrollTop=function(){},Fa.prototype.clear=function(){};function Sa(e,a){a||(a=ja(e));var R=e.display.barWidth,L=e.display.barHeight;Ko(e,a);for(var M=0;M<4&&R!=e.display.barWidth||L!=e.display.barHeight;M++)R!=e.display.barWidth&&e.options.lineWrapping&&oa(e),Ko(e,ja(e)),R=e.display.barWidth,L=e.display.barHeight}function Ko(e,a){var R=e.display,L=R.scrollbars.update(a);R.sizer.style.paddingRight=(R.barWidth=L.right)+"px",R.sizer.style.paddingBottom=(R.barHeight=L.bottom)+"px",R.heightForcer.style.borderBottom=L.bottom+"px solid transparent",L.right&&L.bottom?(R.scrollbarFiller.style.display="block",R.scrollbarFiller.style.height=L.bottom+"px",R.scrollbarFiller.style.width=L.right+"px"):R.scrollbarFiller.style.display="",L.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(R.gutterFiller.style.display="block",R.gutterFiller.style.height=L.bottom+"px",R.gutterFiller.style.width=a.gutterWidth+"px"):R.gutterFiller.style.display=""}var zo={native:ya,null:Fa};function Go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zo[e.options.scrollbarStyle](function(a){e.display.wrapper.insertBefore(a,e.display.scrollbarFiller),Be(a,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,R){R=="horizontal"?ga(e,a):Ua(e,a)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function ba(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:++Zs},bi(e.curOp)}function Ea(e){var a=e.curOp;a&>(a,function(R){for(var L=0;L=R.viewTo)||R.maxLineChanged&&a.options.lineWrapping,e.update=e.mustUpdate&&new ro(a,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nl(e){e.updatedDisplay=e.mustUpdate&&bo(e.cm,e.update)}function rl(e){var a=e.cm,R=a.display;e.updatedDisplay&&oa(a),e.barMeasure=ja(a),R.maxLineChanged&&!a.options.lineWrapping&&(e.adjustWidthTo=Jt(a,R.maxLine,R.maxLine.text.length).left+3,a.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(R.scroller.clientWidth,R.sizer.offsetLeft+e.adjustWidthTo+dr(a)+a.display.barWidth),e.maxScrollLeft=Math.max(0,R.sizer.offsetLeft+e.adjustWidthTo-vr(a))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=R.input.prepareSelection())}function il(e){var a=e.cm;e.adjustWidthTo!=null&&(a.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var R=+new Date+e.options.workTime,L=Pt(e,a.highlightFrontier),M=[];a.iter(L.line,Math.min(a.first+a.size,e.display.viewTo+500),function(X){if(L.line>=e.display.viewFrom){var ce=X.styles,ve=X.text.length>e.options.maxHighlightLength?Xt(a.mode,L.state):null,ye=$e(e,X,L,!0);ve&&(L.state=ve),X.styles=ye.styles;var Se=X.styleClasses,Ye=ye.classes;Ye?X.styleClasses=Ye:Se&&(X.styleClasses=null);for(var et=!ce||ce.length!=X.styles.length||Se!=Ye&&(!Se||!Ye||Se.bgClass!=Ye.bgClass||Se.textClass!=Ye.textClass),vt=0;!et&&vtR)return Ba(e,e.options.workDelay),!0}),a.highlightFrontier=L.line,a.modeFrontier=Math.max(a.modeFrontier,L.line),M.length&&Pi(e,function(){for(var X=0;X=R.viewFrom&&a.visible.to<=R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo)&&R.renderedView==R.view&&Kn(e)==0)return!1;Yo(e)&&(wi(e),a.dims=An(e));var M=L.first+L.size,X=Math.max(a.visible.from-e.options.viewportMargin,L.first),ce=Math.min(M,a.visible.to+e.options.viewportMargin);R.viewFromce&&R.viewTo-ce<20&&(ce=Math.min(M,R.viewTo)),Or&&(X=Di(e.doc,X),ce=ta(e.doc,ce));var ve=X!=R.viewFrom||ce!=R.viewTo||R.lastWrapHeight!=a.wrapperHeight||R.lastWrapWidth!=a.wrapperWidth;Xi(e,X,ce),R.viewOffset=Ci(Z(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var ye=Kn(e);if(!ve&&ye==0&&!a.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var Se=ll(e);return ye>4&&(R.lineDiv.style.display="none"),cl(e,R.updateLineNumbers,a.dims),ye>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,ul(Se),C(R.cursorDiv),C(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,ve&&(R.lastWrapHeight=a.wrapperHeight,R.lastWrapWidth=a.wrapperWidth,Ba(e,400)),R.updateLineNumbers=null,!0}function Vo(e,a){for(var R=a.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||a.oldDisplayWidth==vr(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+Tr(e.display)-xr(e),R.top)}),a.visible=Ki(e.display,e.doc,R),a.visible.from>=e.display.viewFrom&&a.visible.to<=e.display.viewTo)break}else L&&(a.visible=Ki(e.display,e.doc,R));if(!bo(e,a))break;oa(e);var M=ja(e);wn(e),Sa(e,M),xo(e,M),a.force=!1}a.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(a.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Eo(e,a){var R=new ro(e,a);if(bo(e,R)){oa(e),Vo(e,R);var L=ja(e);wn(e),Sa(e,L),xo(e,L),R.finish()}}function cl(e,a,R){var L=e.display,M=e.options.lineNumbers,X=L.lineDiv,ce=X.firstChild;function ve(Lt){var Ft=Lt.nextSibling;return f&&n&&e.display.currentWheelTarget==Lt?Lt.style.display="none":Lt.parentNode.removeChild(Lt),Ft}for(var ye=L.view,Se=L.viewFrom,Ye=0;Ye-1&&(dt=!1),fn(e,et,Se,R)),dt&&(C(et.lineNumber),et.lineNumber.appendChild(document.createTextNode(jt(e.options,Se)))),ce=et.node.nextSibling}Se+=et.size}for(;ce;)ce=ve(ce)}function _o(e){var a=e.gutters.offsetWidth;e.sizer.style.marginLeft=a+"px"}function xo(e,a){e.display.sizer.style.minHeight=a.docHeight+"px",e.display.heightForcer.style.top=a.docHeight+"px",e.display.gutters.style.height=a.docHeight+e.display.barHeight+dr(e)+"px"}function Xo(e){var a=e.display,R=a.view;if(!a.alignWidgets&&(!a.gutters.firstChild||!e.options.fixedGutter))return;for(var L=nr(a)-a.scroller.scrollLeft+e.doc.scrollLeft,M=a.gutters.offsetWidth,X=L+"px",ce=0;cece.clientWidth,ye=ce.scrollHeight>ce.clientHeight;if(!(L&&ve||M&&ye))return;if(M&&n&&f){e:for(var Se=a.target,Ye=X.view;Se!=ce;Se=Se.parentNode)for(var et=0;et=0&&wt(e,L.to())<=0)return R}return-1};var Er=function(e,a){this.anchor=e,this.head=a};Er.prototype.from=function(){return Vt(this.anchor,this.head)},Er.prototype.to=function(){return Qt(this.anchor,this.head)},Er.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ji(e,a,R){var L=e&&e.options.selectionsMayTouch,M=a[R];a.sort(function(vt,dt){return wt(vt.from(),dt.from())}),R=$(a,M);for(var X=1;X0:ye>=0){var Se=Vt(ve.from(),ce.from()),Ye=Qt(ve.to(),ce.to()),et=ve.empty()?ce.from()==ce.head:ve.from()==ve.head;X<=R&&--R,a.splice(--X,2,new Er(et?Ye:Se,et?Se:Ye))}}return new Ui(a,R)}function ua(e,a){return new Ui([new Er(e,a||e)],0)}function ca(e){return e.text?ot(e.from.line+e.text.length-1,Ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,a){if(wt(e,a.from)<0)return e;if(wt(e,a.to)<=0)return ca(a);var R=e.line+a.text.length-(a.to.line-a.from.line)-1,L=e.ch;return e.line==a.to.line&&(L+=ca(a).ch-a.to.ch),ot(R,L)}function Co(e,a){for(var R=[],L=0;L1&&e.remove(ve.line+1,Lt-1),e.insert(ve.line+1,en)}Ht(e,"change",e,a)}function da(e,a,R){function L(M,X,ce){if(M.linked)for(var ve=0;ve1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ge(e.done)}function is(e,a,R,L){var M=e.history;M.undone.length=0;var X=+new Date,ce,ve;if((M.lastOp==L||M.lastOrigin==a.origin&&a.origin&&(a.origin.charAt(0)=="+"&&M.lastModTime>X-(e.cm?e.cm.options.historyEventDelay:500)||a.origin.charAt(0)=="*"))&&(ce=ml(M,M.lastOp==L)))ve=Ge(ce.changes),wt(a.from,a.to)==0&&wt(a.from,ve.to)==0?ve.to=ca(a):ce.changes.push(Ao(e,a));else{var ye=Ge(M.done);for((!ye||!ye.ranges)&&oo(e.sel,M.done),ce={changes:[Ao(e,a)],generation:M.generation},M.done.push(ce);M.done.length>M.undoDepth;)M.done.shift(),M.done[0].ranges||M.done.shift()}M.done.push(R),M.generation=++M.maxGeneration,M.lastModTime=M.lastSelTime=X,M.lastOp=M.lastSelOp=L,M.lastOrigin=M.lastSelOrigin=a.origin,ve||Qe(e,"historyAdded")}function vl(e,a,R,L){var M=a.charAt(0);return M=="*"||M=="+"&&R.ranges.length==L.ranges.length&&R.somethingSelected()==L.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,a,R,L){var M=e.history,X=L&&L.origin;R==M.lastSelOp||X&&M.lastSelOrigin==X&&(M.lastModTime==M.lastSelTime&&M.lastOrigin==X||vl(e,X,Ge(M.done),a))?M.done[M.done.length-1]=a:oo(a,M.done),M.lastSelTime=+new Date,M.lastSelOrigin=X,M.lastSelOp=R,L&&L.clearRedo!==!1&&rs(M.undone)}function oo(e,a){var R=Ge(a);R&&R.ranges&&R.equals(e)||a.push(e)}function as(e,a,R,L){var M=a["spans_"+e.id],X=0;e.iter(Math.max(e.first,R),Math.min(e.first+e.size,L),function(ce){ce.markedSpans&&((M||(M=a["spans_"+e.id]={}))[X]=ce.markedSpans),++X})}function yl(e){if(!e)return null;for(var a,R=0;R-1&&(Ge(ve)[et]=Se[et],delete Se[et]))}}return L}function Oo(e,a,R,L){if(L){var M=e.anchor;if(R){var X=wt(a,M)<0;X!=wt(R,M)<0?(M=a,a=R):X!=wt(a,R)<0&&(a=R)}return new Er(M,a)}else return new Er(R||a,a)}function so(e,a,R,L,M){M==null&&(M=e.cm&&(e.cm.display.shift||e.extend)),fi(e,new Ui([Oo(e.sel.primary(),a,R,M)],0),L)}function ss(e,a,R){for(var L=[],M=e.cm&&(e.cm.display.shift||e.extend),X=0;X=a.ch:ve.to>a.ch))){if(M&&(Qe(ye,"beforeCursorEnter"),ye.explicitlyCleared))if(X.markedSpans){--ce;continue}else break;if(!ye.atomic)continue;if(R){var et=ye.find(L<0?1:-1),vt=void 0;if((L<0?Ye:Se)&&(et=fs(e,et,-L,et&&et.line==a.line?X:null)),et&&et.line==a.line&&(vt=wt(et,R))&&(L<0?vt<0:vt>0))return wa(e,et,a,L,M)}var dt=ye.find(L<0?-1:1);return(L<0?Se:Ye)&&(dt=fs(e,dt,L,dt.line==a.line?X:null)),dt?wa(e,dt,a,L,M):null}}return a}function uo(e,a,R,L,M){var X=L||1,ce=wa(e,a,R,X,M)||!M&&wa(e,a,R,X,!0)||wa(e,a,R,-X,M)||!M&&wa(e,a,R,-X,!0);return ce||(e.cantEdit=!0,ot(e.first,0))}function fs(e,a,R,L){return R<0&&a.ch==0?a.line>e.first?N(e,ot(a.line-1)):null:R>0&&a.ch==(L||Z(e,a.line)).text.length?a.line=0;--M)vs(e,{from:L[M].from,to:L[M].to,text:M?[""]:a.text,origin:a.origin});else vs(e,a)}function vs(e,a){if(a.text.length==1&&a.text[0]==""&&wt(a.from,a.to)==0)return;var R=Co(e,a);is(e,a,R,e.cm?e.cm.curOp.id:NaN),Ka(e,a,R,Kr(e,a));var L=[];da(e,function(M,X){!X&&$(L,M.history)==-1&&(Es(M.history,a),L.push(M.history)),Ka(M,a,null,Kr(M,a))})}function co(e,a,R){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!R)return;for(var M=e.history,X,ce=e.sel,ve=a=="undo"?M.done:M.undone,ye=a=="undo"?M.undone:M.done,Se=0;Se=0;--dt){var Lt=vt(dt);if(Lt)return Lt.v}}function gs(e,a){if(a==0)return;if(e.first+=a,e.sel=new Ui(je(e.sel.ranges,function(M){return new Er(ot(M.anchor.line+a,M.anchor.ch),ot(M.head.line+a,M.head.ch))}),e.sel.primIndex),e.cm){Ur(e.cm,e.first,e.first-a,a);for(var R=e.cm.display,L=R.viewFrom;Le.lastLine())return;if(a.from.lineX&&(a={from:a.from,to:ot(X,Z(e,X).text.length),text:[a.text[0]],origin:a.origin}),a.removed=oe(e,a.from,a.to),R||(R=Co(e,a)),e.cm?_l(e.cm,a,L):To(e,a,L),lo(e,R,pe),e.cantEdit&&uo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,a,R){var L=e.doc,M=e.display,X=a.from,ce=a.to,ve=!1,ye=X.line;e.options.lineWrapping||(ye=Je(ni(Z(L,X.line))),L.iter(ye,ce.line+1,function(dt){if(dt==M.maxLine)return ve=!0,!0})),L.sel.contains(a.from,a.to)>-1&&Ke(e),To(L,a,R,lr(e)),e.options.lineWrapping||(L.iter(ye,X.line+a.text.length,function(dt){var Lt=zi(dt);Lt>M.maxLineLength&&(M.maxLine=dt,M.maxLineLength=Lt,M.maxLineChanged=!0,ve=!1)}),ve&&(e.curOp.updateMaxLine=!0)),hr(L,X.line),Ba(e,400);var Se=a.text.length-(ce.line-X.line)-1;a.full?Ur(e):X.line==ce.line&&a.text.length==1&&!es(e.doc,a)?Jr(e,X.line,"text"):Ur(e,X.line,ce.line+1,Se);var Ye=Fe(e,"changes"),et=Fe(e,"change");if(et||Ye){var vt={from:X,to:ce,text:a.text,removed:a.removed,origin:a.origin};et&&Ht(e,"change",e,vt),Ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(vt)}e.display.selForContextMenu=null}function Aa(e,a,R,L,M){var X;L||(L=R),wt(L,R)<0&&(X=[L,R],R=X[0],L=X[1]),typeof a=="string"&&(a=e.splitLines(a)),Ta(e,{from:R,to:L,text:a,origin:M})}function ys(e,a,R,L){R1||!(this.children[0]instanceof Ga))){var ve=[];this.collapse(ve),this.children=[new Ga(ve)],this.children[0].parent=this}},collapse:function(e){for(var a=0;a50){for(var ce=M.lines.length%25+25,ve=ce;ve10);e.parent.maybeSpill()},iterN:function(e,a,R){for(var L=0;Le.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=Ye,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&Ur(e,L,M+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&Ht(e,"markerCleared",e,this,L,M),a&&Ea(e),this.parent&&this.parent.clear()},ha.prototype.find=function(e,a){e==null&&this.type=="bookmark"&&(e=1);for(var R,L,M=0;M0||ce==0&&X.clearWhenEmpty!==!1)return X;if(X.replacedWith&&(X.collapsed=!0,X.widgetNode=O("span",[X.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||X.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(X.widgetNode.insertLeft=!0)),X.collapsed){if(Pr(e,a.line,a,R,X)||a.line!=R.line&&Pr(e,R.line,a,R,X))throw new Error("Inserting collapsed marker partially overlapping an existing one");pr()}X.addToHistory&&is(e,{from:a,to:R,origin:"markText"},e.sel,NaN);var ve=a.line,ye=e.cm,Se;if(e.iter(ve,R.line+1,function(et){ye&&X.collapsed&&!ye.options.lineWrapping&&ni(et)==ye.display.maxLine&&(Se=!0),X.collapsed&&ve!=a.line&&Re(et,0),wr(et,new Yr(X,ve==a.line?a.ch:null,ve==R.line?R.ch:null)),++ve}),X.collapsed&&e.iter(a.line,R.line+1,function(et){ci(e,et)&&Re(et,0)}),X.clearOnEnter&&Be(X,"beforeCursorEnter",function(){return X.clear()}),X.readOnly&&(yr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),X.collapsed&&(X.id=++xs,X.atomic=!0),ye){if(Se&&(ye.curOp.updateMaxLine=!0),X.collapsed)Ur(ye,a.line,R.line+1);else if(X.className||X.startStyle||X.endStyle||X.css||X.attributes||X.title)for(var Ye=a.line;Ye<=R.line;Ye++)Jr(ye,Ye,"text");X.atomic&&ds(ye.doc),Ht(ye,"markerAdded",ye,X)}return X}var Ya=function(e,a){this.markers=e,this.primary=a;for(var R=0;R=0;ye--)Ta(this,L[ye]);ve?us(this,ve):this.cm&&Ir(this.cm)}),undo:ai(function(){co(this,"undo")}),redo:ai(function(){co(this,"redo")}),undoSelection:ai(function(){co(this,"undo",!0)}),redoSelection:ai(function(){co(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,a=0,R=0,L=0;L=e.ch)&&a.push(M.marker.parent||M.marker)}return a},findMarks:function(e,a,R){e=N(this,e),a=N(this,a);var L=[],M=e.line;return this.iter(e.line,a.line+1,function(X){var ce=X.markedSpans;if(ce)for(var ve=0;ve=ye.to||ye.from==null&&M!=e.line||ye.from!=null&&M==a.line&&ye.from>=a.ch)&&(!R||R(ye.marker))&&L.push(ye.marker.parent||ye.marker)}++M}),L},getAllMarks:function(){var e=[];return this.iter(function(a){var R=a.markedSpans;if(R)for(var L=0;Le)return a=e,!0;e-=X,++R}),N(this,ot(R,a))},indexFromPos:function(e){e=N(this,e);var a=e.ch;if(e.linea&&(a=e.from),e.to!=null&&e.to-1){a.state.draggingText(e),setTimeout(function(){return a.display.input.focus()},20);return}try{var Ye=e.dataTransfer.getData("Text");if(Ye){var et;if(a.state.draggingText&&!a.state.draggingText.copy&&(et=a.listSelections()),lo(a.doc,ua(R,R)),et)for(var vt=0;vt=0;ve--)Aa(e.doc,"",L[ve].from,L[ve].to,"+delete");Ir(e)})}function Ro(e,a,R){var L=U(e.text,a+R,R);return L<0||L>e.text.length?null:L}function Do(e,a,R){var L=Ro(e,a.ch,R);return L==null?null:new ot(a.line,L,R<0?"after":"before")}function Po(e,a,R,L,M){if(e){a.doc.direction=="rtl"&&(M=-M);var X=ct(R,a.doc.direction);if(X){var ce=M<0?Ge(X):X[0],ve=M<0==(ce.level==1),ye=ve?"after":"before",Se;if(ce.level>0||a.doc.direction=="rtl"){var Ye=tr(a,R);Se=M<0?R.text.length-1:0;var et=or(a,Ye,Se).top;Se=q(function(vt){return or(a,Ye,vt).top==et},M<0==(ce.level==1)?ce.from:ce.to-1,Se),ye=="before"&&(Se=Ro(R,Se,1))}else Se=M<0?ce.to:ce.from;return new ot(L,Se,ye)}}return new ot(L,M<0?R.text.length:0,M<0?"before":"after")}function Il(e,a,R,L){var M=ct(a,e.doc.direction);if(!M)return Do(a,R,L);R.ch>=a.text.length?(R.ch=a.text.length,R.sticky="before"):R.ch<=0&&(R.ch=0,R.sticky="after");var X=be(M,R.ch,R.sticky),ce=M[X];if(e.doc.direction=="ltr"&&ce.level%2==0&&(L>0?ce.to>R.ch:ce.from=ce.from&&vt>=Ye.begin)){var dt=et?"before":"after";return new ot(R.line,vt,dt)}}var Lt=function(en,on,tn){for(var ln=function(Rr,oi){return oi?new ot(R.line,ve(Rr,1),"before"):new ot(R.line,Rr,"after")};en>=0&&en0==(On.level!=1),qn=En?tn.begin:ve(tn.end,-1);if(On.from<=qn&&qn0?Ye.end:ve(Ye.begin,-1);return Gt!=null&&!(L>0&&Gt==a.text.length)&&(Ft=Lt(L>0?0:M.length-1,L,Se(Gt)),Ft)?Ft:null}var Qa={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return Ra(e,function(a){if(a.empty()){var R=Z(e.doc,a.head.line).text.length;return a.head.ch==R&&a.head.line0)M=new ot(M.line,M.ch+1),e.replaceRange(X.charAt(M.ch-1)+X.charAt(M.ch-2),ot(M.line,M.ch-2),M,"+transpose");else if(M.line>e.doc.first){var ce=Z(e.doc,M.line-1).text;ce&&(M=new ot(M.line,1),e.replaceRange(X.charAt(0)+e.doc.lineSeparator()+ce.charAt(ce.length-1),ot(M.line-1,ce.length-1),M,"+transpose"))}}R.push(new Er(M,M))}e.setSelections(R)})},newlineAndIndent:function(e){return Pi(e,function(){for(var a=e.listSelections(),R=a.length-1;R>=0;R--)e.replaceRange(e.doc.lineSeparator(),a[R].anchor,a[R].head,"+input");a=e.listSelections();for(var L=0;Le&&wt(a,this.pos)==0&&R==this.button};var Za,eo;function Hl(e,a){var R=+new Date;return eo&&eo.compare(R,e,a)?(Za=eo=null,"triple"):Za&&Za.compare(R,e,a)?(eo=new Mo(R,e,a),Za=null,"double"):(Za=new Mo(R,e,a),eo=null,"single")}function js(e){var a=this,R=a.display;if(Xe(a,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,Pn(R,e)){f||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(Io(a,e))return;var L=In(a,e),M=tt(e),X=L?Hl(L,M):"single";if(window.focus(),M==1&&a.state.selectingText&&a.state.selectingText(e),L&&Kl(a,M,L,X,e))return;M==1?L?Gl(a,L,X,e):rt(e)==R.scroller&&_e(e):M==2?(L&&so(a.doc,L),setTimeout(function(){return R.input.focus()},20)):M==3&&(E?a.display.input.onContextMenu(e):va(a))}function Kl(e,a,R,L,M){var X="Click";return L=="double"?X="Double"+X:L=="triple"&&(X="Triple"+X),X=(a==1?"Left":a==2?"Middle":"Right")+X,qa(e,Ls(X,M),M,function(ce){if(typeof ce=="string"&&(ce=Qa[ce]),!ce)return!1;var ve=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ve=ce(e,R)!=he}finally{e.state.suppressEdits=!1}return ve})}function zl(e,a,R){var L=e.getOption("configureMouse"),M=L?L(e,a,R):{};if(M.unit==null){var X=c?R.shiftKey&&R.metaKey:R.altKey;M.unit=X?"rectangle":a=="single"?"char":a=="double"?"word":"line"}return(M.extend==null||e.doc.extend)&&(M.extend=e.doc.extend||R.shiftKey),M.addNew==null&&(M.addNew=n?R.metaKey:R.ctrlKey),M.moveOnDrag==null&&(M.moveOnDrag=!(n?R.altKey:R.ctrlKey)),M}function Gl(e,a,R,L){T?setTimeout(H(Vr,e),0):e.curOp.focus=I();var M=zl(e,R,L),X=e.doc.sel,ce;e.options.dragDrop&&xt&&!e.isReadOnly()&&R=="single"&&(ce=X.contains(a))>-1&&(wt((ce=X.ranges[ce]).from(),a)<0||a.xRel>0)&&(wt(ce.to(),a)>0||a.xRel<0)?Vl(e,L,a,M):Xl(e,L,a,M)}function Vl(e,a,R,L){var M=e.display,X=!1,ce=ii(e,function(Se){f&&(M.scroller.draggable=!1),e.state.draggingText=!1,ht(M.wrapper.ownerDocument,"mouseup",ce),ht(M.wrapper.ownerDocument,"mousemove",ve),ht(M.scroller,"dragstart",ye),ht(M.scroller,"drop",ce),X||(_e(Se),L.addNew||so(e.doc,R,null,null,L.extend),f&&!i||T&&w==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),ve=function(Se){X=X||Math.abs(a.clientX-Se.clientX)+Math.abs(a.clientY-Se.clientY)>=10},ye=function(){return X=!0};f&&(M.scroller.draggable=!0),e.state.draggingText=ce,ce.copy=!L.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),Be(M.wrapper.ownerDocument,"mouseup",ce),Be(M.wrapper.ownerDocument,"mousemove",ve),Be(M.scroller,"dragstart",ye),Be(M.scroller,"drop",ce),va(e),setTimeout(function(){return M.input.focus()},20)}function Fs(e,a,R){if(R=="char")return new Er(a,a);if(R=="word")return e.findWordAt(a);if(R=="line")return new Er(ot(a.line,0),N(e.doc,ot(a.line+1,0)));var L=R(e,a);return new Er(L.from,L.to)}function Xl(e,a,R,L){var M=e.display,X=e.doc;_e(a);var ce,ve,ye=X.sel,Se=ye.ranges;if(L.addNew&&!L.extend?(ve=X.sel.contains(R),ve>-1?ce=Se[ve]:ce=new Er(R,R)):(ce=X.sel.primary(),ve=X.sel.primIndex),L.unit=="rectangle")L.addNew||(ce=new Er(R,R)),R=In(e,a,!0,!0),ve=-1;else{var Ye=Fs(e,R,L.unit);L.extend?ce=Oo(ce,Ye.anchor,Ye.head,L.extend):ce=Ye}L.addNew?ve==-1?(ve=Se.length,fi(X,Ji(e,Se.concat([ce]),ve),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[ve].empty()&&L.unit=="char"&&!L.extend?(fi(X,Ji(e,Se.slice(0,ve).concat(Se.slice(ve+1)),0),{scroll:!1,origin:"*mouse"}),ye=X.sel):Lo(X,ve,ce,Te):(ve=0,fi(X,new Ui([ce],0),Te),ye=X.sel);var et=R;function vt(tn){if(wt(et,tn)==0)return;if(et=tn,L.unit=="rectangle"){for(var ln=[],On=e.options.tabSize,En=V(Z(X,R.line).text,R.ch,On),qn=V(Z(X,tn.line).text,tn.ch,On),Rr=Math.min(En,qn),oi=Math.max(En,qn),jr=Math.min(R.line,tn.line),ki=Math.min(e.lastLine(),Math.max(R.line,tn.line));jr<=ki;jr++){var Ai=Z(X,jr).text,Qr=Me(Ai,Rr,On);Rr==oi?ln.push(new Er(ot(jr,Qr),ot(jr,Qr))):Ai.length>Qr&&ln.push(new Er(ot(jr,Qr),ot(jr,Me(Ai,oi,On))))}ln.length||ln.push(new Er(R,R)),fi(X,Ji(e,ye.ranges.slice(0,ve).concat(ln),ve),{origin:"*mouse",scroll:!1}),e.scrollIntoView(tn)}else{var Oi=ce,hi=Fs(e,tn,L.unit),ti=Oi.anchor,qr;wt(hi.anchor,ti)>0?(qr=hi.head,ti=Vt(Oi.from(),hi.anchor)):(qr=hi.anchor,ti=Qt(Oi.to(),hi.head));var Hr=ye.ranges.slice(0);Hr[ve]=Yl(e,new Er(N(X,ti),qr)),fi(X,Ji(e,Hr,ve),Te)}}var dt=M.wrapper.getBoundingClientRect(),Lt=0;function Ft(tn){var ln=++Lt,On=In(e,tn,!0,L.unit=="rectangle");if(!On)return;if(wt(On,et)!=0){e.curOp.focus=I(),vt(On);var En=Ki(M,X);(On.line>=En.to||On.linedt.bottom?20:0;qn&&setTimeout(ii(e,function(){if(Lt!=ln)return;M.scroller.scrollTop+=qn,Ft(tn)}),50)}}function Gt(tn){e.state.selectingText=!1,Lt=Infinity,tn&&(_e(tn),M.input.focus()),ht(M.wrapper.ownerDocument,"mousemove",en),ht(M.wrapper.ownerDocument,"mouseup",on),X.history.lastSelOrigin=null}var en=ii(e,function(tn){tn.buttons===0||!tt(tn)?Gt(tn):Ft(tn)}),on=ii(e,Gt);e.state.selectingText=on,Be(M.wrapper.ownerDocument,"mousemove",en),Be(M.wrapper.ownerDocument,"mouseup",on)}function Yl(e,a){var R=a.anchor,L=a.head,M=Z(e.doc,R.line);if(wt(R,L)==0&&R.sticky==L.sticky)return a;var X=ct(M);if(!X)return a;var ce=be(X,R.ch,R.sticky),ve=X[ce];if(ve.from!=R.ch&&ve.to!=R.ch)return a;var ye=ce+(ve.from==R.ch==(ve.level!=1)?0:1);if(ye==0||ye==X.length)return a;var Se;if(L.line!=R.line)Se=(L.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ye=be(X,L.ch,L.sticky),et=Ye-ce||(L.ch-R.ch)*(ve.level==1?-1:1);Ye==ye-1||Ye==ye?Se=et<0:Se=et>0}var vt=X[ye+(Se?-1:0)],dt=Se==(vt.level==1),Lt=dt?vt.from:vt.to,Ft=dt?"after":"before";return R.ch==Lt&&R.sticky==Ft?a:new Er(new ot(R.line,Lt,Ft),L)}function Bs(e,a,R,L){var M,X;if(a.touches)M=a.touches[0].clientX,X=a.touches[0].clientY;else try{M=a.clientX,X=a.clientY}catch(vt){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&_e(a);var ce=e.display,ve=ce.lineDiv.getBoundingClientRect();if(X>ve.bottom||!Fe(e,R))return Ne(a);X-=ve.top-ce.viewOffset;for(var ye=0;ye=M){var Ye=at(e.doc,X),et=e.display.gutterSpecs[ye];return Qe(e,R,e,Ye,et.className,a),Ne(a)}}}function Io(e,a){return Bs(e,a,"gutterClick",!0)}function Ws(e,a){if(Pn(e.display,a)||$l(e,a))return;if(Xe(e,a,"contextmenu"))return;E||e.display.input.onContextMenu(a)}function $l(e,a){return Fe(e,"gutterContextMenu")?Bs(e,a,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nn(e)}var Da={toString:function(){return"CodeMirror.Init"}},Ks={},mo={};function Jl(e){var a=e.optionHandlers;function R(L,M,X,ce){e.defaults[L]=M,X&&(a[L]=ce?function(ve,ye,Se){Se!=Da&&X(ve,ye,Se)}:X)}e.defineOption=R,e.Init=Da,R("value","",function(L,M){return L.setValue(M)},!0),R("mode",null,function(L,M){L.doc.modeOption=M,wo(L)},!0),R("indentUnit",2,wo,!0),R("indentWithTabs",!1),R("smartIndent",!0),R("tabSize",4,function(L){Ha(L),nn(L),Ur(L)},!0),R("lineSeparator",null,function(L,M){if(L.doc.lineSep=M,!M)return;var X=[],ce=L.doc.first;L.doc.iter(function(ye){for(var Se=0;;){var Ye=ye.text.indexOf(M,Se);if(Ye==-1)break;Se=Ye+M.length,X.push(ot(ce,Ye))}ce++});for(var ve=X.length-1;ve>=0;ve--)Aa(L.doc,M,X[ve],ot(X[ve].line,X[ve].ch+M.length))}),R("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,M,X){L.state.specialChars=new RegExp(M.source+(M.test(" ")?"":"| "),"g"),X!=Da&&L.refresh()}),R("specialCharPlaceholder",ur,function(L){return L.refresh()},!0),R("electricChars",!0),R("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),R("spellcheck",!1,function(L,M){return L.getInputField().spellcheck=M},!0),R("autocorrect",!1,function(L,M){return L.getInputField().autocorrect=M},!0),R("autocapitalize",!1,function(L,M){return L.getInputField().autocapitalize=M},!0),R("rtlMoveVisually",!m),R("wholeLineUpdateBefore",!0),R("theme","default",function(L){Hs(L),Wa(L)},!0),R("keyMap","default",function(L,M,X){var ce=fo(M),ve=X!=Da&&fo(X);ve&&ve.detach&&ve.detach(L,ce),ce.attach&&ce.attach(L,ve||null)}),R("extraKeys",null),R("configureMouse",null),R("lineWrapping",!1,ql,!0),R("gutters",[],function(L,M){L.display.gutterSpecs=So(M,L.options.lineNumbers),Wa(L)},!0),R("fixedGutter",!0,function(L,M){L.display.gutters.style.left=M?nr(L.display)+"px":"0",L.refresh()},!0),R("coverGutterNextToScrollbar",!1,function(L){return Sa(L)},!0),R("scrollbarStyle","native",function(L){Go(L),Sa(L),L.display.scrollbars.setScrollTop(L.doc.scrollTop),L.display.scrollbars.setScrollLeft(L.doc.scrollLeft)},!0),R("lineNumbers",!1,function(L,M){L.display.gutterSpecs=So(L.options.gutters,M),Wa(L)},!0),R("firstLineNumber",1,Wa,!0),R("lineNumberFormatter",function(L){return L},Wa,!0),R("showCursorWhenSelecting",!1,wn,!0),R("resetSelectionOnContextMenu",!0),R("lineWiseCopyCut",!0),R("pasteLinesPerSelection",!0),R("selectionsMayTouch",!1),R("readOnly",!1,function(L,M){M=="nocursor"&&(Hi(L),L.display.input.blur()),L.display.input.readOnlyChanged(M)}),R("screenReaderLabel",null,function(L,M){M=M===""?null:M,L.display.input.screenReaderLabelChanged(M)}),R("disableInput",!1,function(L,M){M||L.display.input.reset()},!0),R("dragDrop",!0,Ql),R("allowDropFileTypes",null),R("cursorBlinkRate",530),R("cursorScrollMargin",0),R("cursorHeight",1,wn,!0),R("singleCursorHeightPerLine",!0,wn,!0),R("workTime",100),R("workDelay",100),R("flattenSpans",!0,Ha,!0),R("addModeClass",!1,Ha,!0),R("pollInterval",100),R("undoDepth",200,function(L,M){return L.doc.history.undoDepth=M}),R("historyEventDelay",1250),R("viewportMargin",10,function(L){return L.refresh()},!0),R("maxHighlightLength",1e4,Ha,!0),R("moveInputWithCursor",!0,function(L,M){M||L.display.input.resetPosition()}),R("tabindex",null,function(L,M){return L.display.input.getField().tabIndex=M||""}),R("autofocus",null),R("direction","ltr",function(L,M){return L.doc.setDirection(M)},!0),R("phrases",null)}function Ql(e,a,R){var L=R&&R!=Da;if(!a!=!L){var M=e.display.dragFunctions,X=a?Be:ht;X(e.display.scroller,"dragstart",M.start),X(e.display.scroller,"dragenter",M.enter),X(e.display.scroller,"dragover",M.over),X(e.display.scroller,"dragleave",M.leave),X(e.display.scroller,"drop",M.drop)}}function ql(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),qi(e)),Wr(e),Ur(e),nn(e),setTimeout(function(){return Sa(e)},100)}function Nr(e,a){var R=this;if(!(this instanceof Nr))return new Nr(e,a);this.options=a=a?G(a):{},G(Ks,a,!1);var L=a.value;typeof L=="string"?L=new Ti(L,a.mode,null,a.lineSeparator,a.direction):a.mode&&(L.modeOption=a.mode),this.doc=L;var M=new Nr.inputStyles[a.inputStyle](this),X=this.display=new dl(e,L,M,a);X.wrapper.CodeMirror=this,Hs(this),a.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Go(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 re,keySeq:null,specialChars:null},a.autofocus&&!t&&X.input.focus(),T&&w<11&&setTimeout(function(){return R.display.input.reset(!0)},20),Zl(this),Rl(),ba(this),this.curOp.forceUpdate=!0,ts(this,L),a.autofocus&&!t||this.hasFocus()?setTimeout(function(){R.hasFocus()&&!R.state.focused&&vn(R)},20):Hi(this);for(var ce in mo)mo.hasOwnProperty(ce)&&mo[ce](this,a[ce],Da);Yo(this),a.finishInit&&a.finishInit(this);for(var ve=0;ve20*20}Be(a.scroller,"touchstart",function(ye){if(!Xe(e,ye)&&!X(ye)&&!Io(e,ye)){a.input.ensurePolled(),clearTimeout(R);var Se=+new Date;a.activeTouch={start:Se,moved:!1,prev:Se-L.end<=300?L:null},ye.touches.length==1&&(a.activeTouch.left=ye.touches[0].pageX,a.activeTouch.top=ye.touches[0].pageY)}}),Be(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),Be(a.scroller,"touchend",function(ye){var Se=a.activeTouch;if(Se&&!Pn(a,ye)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var Ye=e.coordsChar(a.activeTouch,"page"),et;!Se.prev||ce(Se,Se.prev)?et=new Er(Ye,Ye):!Se.prev.prev||ce(Se,Se.prev.prev)?et=e.findWordAt(Ye):et=new Er(ot(Ye.line,0),N(e.doc,ot(Ye.line+1,0))),e.setSelection(et.anchor,et.head),e.focus(),_e(ye)}M()}),Be(a.scroller,"touchcancel",M),Be(a.scroller,"scroll",function(){a.scroller.clientHeight&&(Ua(e,a.scroller.scrollTop),ga(e,a.scroller.scrollLeft,!0),Qe(e,"scroll",e))}),Be(a.scroller,"mousewheel",function(ye){return Qo(e,ye)}),Be(a.scroller,"DOMMouseScroll",function(ye){return Qo(e,ye)}),Be(a.wrapper,"scroll",function(){return a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(ye){Xe(e,ye)||De(ye)},over:function(ye){Xe(e,ye)||(Ll(e,ye),De(ye))},start:function(ye){return Ol(e,ye)},drop:ii(e,Al),leave:function(ye){Xe(e,ye)||ws(e)}};var ve=a.input.getField();Be(ve,"keyup",function(ye){return Ns.call(e,ye)}),Be(ve,"keydown",ii(e,Is)),Be(ve,"keypress",ii(e,Us)),Be(ve,"focus",function(ye){return vn(e,ye)}),Be(ve,"blur",function(ye){return Hi(e,ye)})}var No=[];Nr.defineInitHook=function(e){return No.push(e)};function to(e,a,R,L){var M=e.doc,X;R==null&&(R="add"),R=="smart"&&(M.mode.indent?X=Pt(e,a).state:R="prev");var ce=e.options.tabSize,ve=Z(M,a),ye=V(ve.text,null,ce);ve.stateAfter&&(ve.stateAfter=null);var Se=ve.text.match(/^\s*/)[0],Ye;if(!L&&!/\S/.test(ve.text))Ye=0,R="not";else if(R=="smart"&&(Ye=M.mode.indent(X,ve.text.slice(Se.length),ve.text),Ye==he||Ye>150)){if(!L)return;R="prev"}R=="prev"?a>M.first?Ye=V(Z(M,a-1).text,null,ce):Ye=0:R=="add"?Ye=ye+e.options.indentUnit:R=="subtract"?Ye=ye-e.options.indentUnit:typeof R=="number"&&(Ye=ye+R),Ye=Math.max(0,Ye);var et="",vt=0;if(e.options.indentWithTabs)for(var dt=Math.floor(Ye/ce);dt;--dt)vt+=ce,et+=" ";if(vtce,ye=lt(a),Se=null;if(ve&&L.ranges.length>1)if(Qi&&Qi.text.join(` `)==a){if(L.ranges.length%Qi.text.length==0){Se=[];for(var Ye=0;Ye=0;vt--){var dt=L.ranges[vt],Lt=dt.from(),Ft=dt.to();dt.empty()&&(R&&R>0?Lt=ot(Lt.line,Lt.ch-R):e.state.overwrite&&!ve?Ft=ot(Ft.line,Math.min(Z(X,Ft.line).text.length,Ft.ch+Ge(ye).length)):ve&&Qi&&Qi.lineWise&&Qi.text.join(` `)==ye.join(` `)&&(Lt=Ft=ot(Lt.line,0)));var Gt={from:Lt,to:Ft,text:Se?Se[vt%Se.length]:ye,origin:M||(ve?"paste":e.state.cutIncoming>ce?"cut":"+input")};Ta(e.doc,Gt),Ht(e,"inputRead",e,Gt)}a&&!ve&&Gs(e,a),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=et),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function zs(e,a){var R=e.clipboardData&&e.clipboardData.getData("Text");if(R)return e.preventDefault(),!a.isReadOnly()&&!a.options.disableInput&&Pi(a,function(){return Uo(a,R,0,null,"paste")}),!0}function Gs(e,a){if(!e.options.electricChars||!e.options.smartIndent)return;for(var R=e.doc.sel,L=R.ranges.length-1;L>=0;L--){var M=R.ranges[L];if(M.head.ch>100||L&&R.ranges[L-1].head.line==M.head.line)continue;var X=e.getModeAt(M.head),ce=!1;if(X.electricChars){for(var ve=0;ve-1){ce=to(e,M.head.line,"smart");break}}else X.electricInput&&(X.electricInput.test(Z(e.doc,M.head.line).text.slice(0,M.head.ch))&&(ce=to(e,M.head.line,"smart")));ce&&Ht(e,"electricInput",e,M.head.line)}}function Vs(e){for(var a=[],R=[],L=0;LX&&(to(this,ve.head.line,L,!0),X=ve.head.line,ce==this.doc.sel.primIndex&&Ir(this));else{var ye=ve.from(),Se=ve.to(),Ye=Math.max(X,ye.line);X=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var et=Ye;et0&&Lo(this.doc,ce,new Er(ye,vt[ce].to()),pe)}}}),getTokenAt:function(L,M){return jn(this,L,M)},getLineTokens:function(L,M){return jn(this,ot(L),M,!0)},getTokenTypeAt:function(L){L=N(this.doc,L);var M=St(this,Z(this.doc,L.line)),X=0,ce=(M.length-1)/2,ve=L.ch,ye;if(ve==0)ye=M[2];else for(;;){var Se=X+ce>>1;if((Se?M[Se*2-1]:0)>=ve)ce=Se;else if(M[Se*2+1]ye&&(L=ye,ce=!0),ve=Z(this.doc,L)}else ve=L;return bn(this,ve,{top:0,left:0},M||"page",X||ce).top+(ce?this.doc.height-Ci(ve):0)},defaultTextHeight:function(){return Vi(this.display)},defaultCharWidth:function(){return Xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(L,M,X,ce,ve){var ye=this.display;L=Vn(this,N(this.doc,L));var Se=L.bottom,Ye=L.left;if(M.style.position="absolute",M.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(M),ye.sizer.appendChild(M),ce=="over")Se=L.top;else if(ce=="above"||ce=="near"){var et=Math.max(ye.wrapper.clientHeight,this.doc.height),vt=Math.max(ye.sizer.clientWidth,ye.lineSpace.clientWidth);(ce=="above"||L.bottom+M.offsetHeight>et)&&L.top>M.offsetHeight?Se=L.top-M.offsetHeight:L.bottom+M.offsetHeight<=et&&(Se=L.bottom),Ye+M.offsetWidth>vt&&(Ye=vt-M.offsetWidth)}M.style.top=Se+"px",M.style.left=M.style.right="",ve=="right"?(Ye=ye.sizer.clientWidth-M.offsetWidth,M.style.right="0px"):(ve=="left"?Ye=0:ve=="middle"&&(Ye=(ye.sizer.clientWidth-M.offsetWidth)/2),M.style.left=Ye+"px"),X&&la(this,{left:Ye,top:Se,right:Ye+M.offsetWidth,bottom:Se+M.offsetHeight})},triggerOnKeyDown:Ei(Is),triggerOnKeyPress:Ei(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:Ei(js),execCommand:function(L){if(Qa.hasOwnProperty(L))return Qa[L].call(null,this)},triggerElectric:Ei(function(L){Gs(this,L)}),findPosH:function(L,M,X,ce){var ve=1;M<0&&(ve=-1,M=-M);for(var ye=N(this.doc,L),Se=0;Se0&&Ye(X.charAt(ce-1));)--ce;for(;ve.5||this.options.lineWrapping)&&Wr(this),Qe(this,"refresh",this)}),swapDoc:Ei(function(L){var M=this.doc;return M.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),nn(this),this.display.input.reset(),Na(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,Ht(this,"swapDoc",this,M),M}),phrase:function(L){var M=this.options.phrases;return M&&Object.prototype.hasOwnProperty.call(M,L)?M[L]:L},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}},Ue(e),e.registerHelper=function(L,M,X){R.hasOwnProperty(L)||(R[L]=e[L]={_global:[]}),R[L][M]=X},e.registerGlobalHelper=function(L,M,X,ce){e.registerHelper(L,M,ce),R[L]._global.push({pred:X,val:ce})}}function jo(e,a,R,L,M){var X=a,ce=R,ve=Z(e,a.line),ye=M&&e.direction=="rtl"?-R:R;function Se(){var on=a.line+ye;return on=e.first+e.size?!1:(a=new ot(on,a.ch,a.sticky),ve=Z(e,on))}function Ye(on){var tn;if(L=="codepoint"){var ln=ve.text.charCodeAt(a.ch+(L>0?0:-1));isNaN(ln)?tn=null:tn=new ot(a.line,Math.max(0,Math.min(ve.text.length,a.ch+R*(ln>=55296&&ln<56320?2:1))),-R)}else M?tn=Il(e.cm,ve,a,R):tn=Do(ve,a,R);if(tn==null)if(!on&&Se())a=Po(M,e.cm,ve,a.line,ye);else return!1;else a=tn;return!0}if(L=="char"||L=="codepoint")Ye();else if(L=="column")Ye(!0);else if(L=="word"||L=="group")for(var et=null,vt=L=="group",dt=e.cm&&e.cm.getHelper(a,"wordChars"),Lt=!0;!(R<0&&!Ye(!Lt));Lt=!1){var Ft=ve.text.charAt(a.ch)||` `,Gt=Ie(Ft,dt)?"w":vt&&Ft==` `?"n":!vt||/\s/.test(Ft)?null:"p";if(vt&&!Lt&&!Gt&&(Gt="s"),et&&et!=Gt){R<0&&(R=1,Ye(),a.sticky="after");break}if(Gt&&(et=Gt),R>0&&!Ye(!Lt))break}var en=uo(e,a,X,ce,!0);return Kt(X,en)&&(en.hitSide=!0),en}function $s(e,a,R,L){var M=e.doc,X=a.left,ce;if(L=="page"){var ve=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ye=Math.max(ve-.5*Vi(e.display),3);ce=(R>0?a.bottom:a.top)+R*ye}else L=="line"&&(ce=R>0?a.bottom+3:a.top-3);for(var Se;!(Se=kr(e,X,ce),!Se.outside);){if(R<0?ce<=0:ce>=M.height){Se.hitSide=!0;break}ce+=R*5}return Se}var Sr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new re,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sr.prototype.init=function(e){var a=this,R=this,L=R.cm,M=R.div=e.lineDiv;Xs(M,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function X(ve){for(var ye=ve.target;ye;ye=ye.parentNode){if(ye==M)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ye.className))break}return!1}Be(M,"paste",function(ve){if(!X(ve)||Xe(L,ve)||zs(ve,L))return;w<=11&&setTimeout(ii(L,function(){return a.updateFromDOM()}),20)}),Be(M,"compositionstart",function(ve){a.composing={data:ve.data,done:!1}}),Be(M,"compositionupdate",function(ve){a.composing||(a.composing={data:ve.data,done:!1})}),Be(M,"compositionend",function(ve){a.composing&&(ve.data!=a.composing.data&&a.readFromDOMSoon(),a.composing.done=!0)}),Be(M,"touchstart",function(){return R.forceCompositionEnd()}),Be(M,"input",function(){a.composing||a.readFromDOMSoon()});function ce(ve){if(!X(ve)||Xe(L,ve))return;if(L.somethingSelected())vo({lineWise:!1,text:L.getSelections()}),ve.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ye=Vs(L);vo({lineWise:!0,text:ye.text}),ve.type=="cut"&&L.operation(function(){L.setSelections(ye.ranges,0,pe),L.replaceSelection("",null,"cut")})}else return;if(ve.clipboardData){ve.clipboardData.clearData();var Se=Qi.text.join(` `);if(ve.clipboardData.setData("Text",Se),ve.clipboardData.getData("Text")==Se){ve.preventDefault();return}}var Ye=Ys(),et=Ye.firstChild;L.display.lineSpace.insertBefore(Ye,L.display.lineSpace.firstChild),et.value=Qi.text.join(` `);var vt=document.activeElement;te(et),setTimeout(function(){L.display.lineSpace.removeChild(Ye),vt.focus(),vt==M&&R.showPrimarySelection()},50)}Be(M,"copy",ce),Be(M,"cut",ce)},Sr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=Yn(this.cm,!1);return e.focus=document.activeElement==this.div,e},Sr.prototype.showSelection=function(e,a){if(!e||!this.cm.display.view.length)return;(e.focus||a)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sr.prototype.showPrimarySelection=function(){var e=this.getSelection(),a=this.cm,R=a.doc.sel.primary(),L=R.from(),M=R.to();if(a.display.viewTo==a.display.viewFrom||L.line>=a.display.viewTo||M.line=a.display.viewFrom&&Js(a,L)||{node:ve[0].measure.map[2],offset:0},Se=M.linee.firstLine()&&(L=ot(L.line-1,Z(e.doc,L.line-1).length)),M.ch==Z(e.doc,M.line).text.length&&M.linea.viewTo-1)return!1;var X,ce,ve;L.line==a.viewFrom||(X=ri(e,L.line))==0?(ce=Je(a.view[0].line),ve=a.view[0].node):(ce=Je(a.view[X].line),ve=a.view[X-1].node.nextSibling);var ye=ri(e,M.line),Se,Ye;if(ye==a.view.length-1?(Se=a.viewTo-1,Ye=a.lineDiv.lastChild):(Se=Je(a.view[ye+1].line)-1,Ye=a.view[ye+1].node.previousSibling),!ve)return!1;for(var et=e.doc.splitLines(nu(e,ve,Ye,ce,Se)),vt=oe(e.doc,ot(ce,0),ot(Se,Z(e.doc,Se).text.length));et.length>1&&vt.length>1;)if(Ge(et)==Ge(vt))et.pop(),vt.pop(),Se--;else if(et[0]==vt[0])et.shift(),vt.shift(),ce++;else break;for(var dt=0,Lt=0,Ft=et[0],Gt=vt[0],en=Math.min(Ft.length,Gt.length);dtL.ch&&on.charCodeAt(on.length-Lt-1)==tn.charCodeAt(tn.length-Lt-1);)dt--,Lt++;et[et.length-1]=on.slice(0,on.length-Lt).replace(/^\u200b+/,""),et[0]=et[0].slice(dt).replace(/\u200b+$/,"");var On=ot(ce,dt),En=ot(Se,vt.length?Ge(vt).length-Lt:0);if(et.length>1||et[0]||wt(On,En))return Aa(e.doc,et,On,En,"+input"),!0},Sr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Sr.prototype.reset=function(){this.forceCompositionEnd()},Sr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Sr.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)},Sr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pi(this.cm,function(){return Ur(e.cm)})},Sr.prototype.setUneditable=function(e){e.contentEditable="false"},Sr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ii(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Sr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Sr.prototype.onContextMenu=function(){},Sr.prototype.resetPosition=function(){},Sr.prototype.needsContentAttribute=!0;function Js(e,a){var R=gn(e,a.line);if(!R||R.hidden)return null;var L=Z(e.doc,a.line),M=fr(R,L,a.line),X=ct(L,e.doc.direction),ce="left";if(X){var ve=be(X,a.ch);ce=ve%2?"right":"left"}var ye=Jn(M.map,a.ch,ce);return ye.offset=ye.collapse=="right"?ye.end:ye.start,ye}function tu(e){for(var a=e;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function Pa(e,a){return a&&(e.bad=!0),e}function nu(e,a,R,L,M){var X="",ce=!1,ve=e.doc.lineSeparator(),ye=!1;function Se(dt){return function(Lt){return Lt.id==dt}}function Ye(){ce&&(X+=ve,ye&&(X+=ve),ce=ye=!1)}function et(dt){dt&&(Ye(),X+=dt)}function vt(dt){if(dt.nodeType==1){var Lt=dt.getAttribute("cm-text");if(Lt){et(Lt);return}var Ft=dt.getAttribute("cm-marker"),Gt;if(Ft){var en=e.findMarks(ot(L,0),ot(M+1,0),Se(+Ft));en.length&&(Gt=en[0].find(0))&&et(oe(e.doc,Gt.from,Gt.to).join(ve));return}if(dt.getAttribute("contenteditable")=="false")return;var on=/^(pre|div|p|li|table|br)$/i.test(dt.nodeName);if(!/^br$/i.test(dt.nodeName)&&dt.textContent.length==0)return;on&&Ye();for(var tn=0;tn=9&&a.hasSelection&&(a.hasSelection=null),R.poll()}),Be(M,"paste",function(ce){if(Xe(L,ce)||zs(ce,L))return;L.state.pasteIncoming=+new Date,R.fastPoll()});function X(ce){if(Xe(L,ce))return;if(L.somethingSelected())vo({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var ve=Vs(L);vo({lineWise:!0,text:ve.text}),ce.type=="cut"?L.setSelections(ve.ranges,null,pe):(R.prevInput="",M.value=ve.text.join(` `),te(M))}else return;ce.type=="cut"&&(L.state.cutIncoming=+new Date)}Be(M,"cut",X),Be(M,"copy",X),Be(e.scroller,"paste",function(ce){if(Pn(e,ce)||Xe(L,ce))return;if(!M.dispatchEvent){L.state.pasteIncoming=+new Date,R.focus();return}var ve=new Event("paste");ve.clipboardData=ce.clipboardData,M.dispatchEvent(ve)}),Be(e.lineSpace,"selectstart",function(ce){Pn(e,ce)||_e(ce)}),Be(M,"compositionstart",function(){var ce=L.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:ce,range:L.markText(ce,L.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(M,"compositionend",function(){R.composing&&(R.poll(),R.composing.range.clear(),R.composing=null)})},Xr.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Xr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Xr.prototype.prepareSelection=function(){var e=this.cm,a=e.display,R=e.doc,L=Yn(e);if(e.options.moveInputWithCursor){var M=Vn(e,R.sel.primary().head,"div"),X=a.wrapper.getBoundingClientRect(),ce=a.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(a.wrapper.clientHeight-10,M.top+ce.top-X.top)),L.teLeft=Math.max(0,Math.min(a.wrapper.clientWidth-10,M.left+ce.left-X.left))}return L},Xr.prototype.showSelection=function(e){var a=this.cm,R=a.display;d(R.cursorDiv,e.cursors),d(R.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var a=this.cm;if(a.somethingSelected()){this.prevInput="";var R=a.getSelection();this.textarea.value=R,a.state.focused&&te(this.textarea),T&&w>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",T&&w>=9&&(this.hasSelection=null))},Xr.prototype.getField=function(){return this.textarea},Xr.prototype.supportsTouch=function(){return!1},Xr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xr.prototype.blur=function(){this.textarea.blur()},Xr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xr.prototype.receivedFocus=function(){this.slowPoll()},Xr.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()})},Xr.prototype.fastPoll=function(){var e=!1,a=this;a.pollingFast=!0;function R(){var L=a.poll();!L&&!e?(e=!0,a.polling.set(60,R)):(a.pollingFast=!1,a.slowPoll())}a.polling.set(20,R)},Xr.prototype.poll=function(){var e=this,a=this.cm,R=this.textarea,L=this.prevInput;if(this.contextMenuPending||!a.state.focused||pt(R)&&!L&&!this.composing||a.isReadOnly()||a.options.disableInput||a.state.keySeq)return!1;var M=R.value;if(M==L&&!a.somethingSelected())return!1;if(T&&w>=9&&this.hasSelection===M||n&&/[\uf700-\uf7ff]/.test(M))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var X=M.charCodeAt(0);if(X==8203&&!L&&(L="\u200B"),X==8666)return this.reset(),this.cm.execCommand("undo")}for(var ce=0,ve=Math.min(L.length,M.length);ce1e3||M.indexOf(` `)>-1?R.value=e.prevInput="":e.prevInput=M,e.composing&&(e.composing.range.clear(),e.composing.range=a.markText(e.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Xr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xr.prototype.onKeyPress=function(){T&&w>=9&&(this.hasSelection=null),this.fastPoll()},Xr.prototype.onContextMenu=function(e){var a=this,R=a.cm,L=R.display,M=a.textarea;a.contextMenuPending&&a.contextMenuPending();var X=In(R,e),ce=L.scroller.scrollTop;if(!X||o)return;var ve=R.options.resetSelectionOnContextMenu;ve&&R.doc.sel.contains(X)==-1&&ii(R,fi)(R.doc,ua(X),pe);var ye=M.style.cssText,Se=a.wrapper.style.cssText,Ye=a.wrapper.offsetParent.getBoundingClientRect();a.wrapper.style.cssText="position: static",M.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: `+(T?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var et;f&&(et=window.scrollY),L.input.focus(),f&&window.scrollTo(null,et),L.input.reset(),R.somethingSelected()||(M.value=a.prevInput=" "),a.contextMenuPending=dt,L.selForContextMenu=R.doc.sel,clearTimeout(L.detectingSelectAll);function vt(){if(M.selectionStart!=null){var Ft=R.somethingSelected(),Gt="\u200B"+(Ft?M.value:"");M.value="\u21DA",M.value=Gt,a.prevInput=Ft?"":"\u200B",M.selectionStart=1,M.selectionEnd=Gt.length,L.selForContextMenu=R.doc.sel}}function dt(){if(a.contextMenuPending!=dt)return;if(a.contextMenuPending=!1,a.wrapper.style.cssText=Se,M.style.cssText=ye,T&&w<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=ce),M.selectionStart!=null){(!T||T&&w<9)&&vt();var Ft=0,Gt=function(){L.selForContextMenu==R.doc.sel&&M.selectionStart==0&&M.selectionEnd>0&&a.prevInput=="\u200B"?ii(R,ps)(R):Ft++<10?L.detectingSelectAll=setTimeout(Gt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(Gt,200)}}if(T&&w>=9&&vt(),E){De(e);var Lt=function(){ht(window,"mouseup",Lt),setTimeout(dt,20)};Be(window,"mouseup",Lt)}else setTimeout(dt,50)},Xr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Xr.prototype.setUneditable=function(){},Xr.prototype.needsContentAttribute=!1;function iu(e,a){if(a=a?G(a):{},a.value=e.value,!a.tabindex&&e.tabIndex&&(a.tabindex=e.tabIndex),!a.placeholder&&e.placeholder&&(a.placeholder=e.placeholder),a.autofocus==null){var R=I();a.autofocus=R==e||e.getAttribute("autofocus")!=null&&R==document.body}function L(){e.value=ve.getValue()}var M;if(e.form&&(Be(e.form,"submit",L),!a.leaveSubmitMethodAlone)){var X=e.form;M=X.submit;try{var ce=X.submit=function(){L(),X.submit=M,X.submit(),X.submit=ce}}catch(ye){}}a.finishInit=function(ye){ye.save=L,ye.getTextArea=function(){return e},ye.toTextArea=function(){ye.toTextArea=isNaN,L(),e.parentNode.removeChild(ye.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",L),!a.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=M))}},e.style.display="none";var ve=Nr(function(ye){return e.parentNode.insertBefore(ye,e.nextSibling)},a);return ve}function au(e){e.off=ht,e.on=Be,e.wheelEventPixels=hl,e.Doc=Ti,e.splitLines=lt,e.countColumn=V,e.findColumn=Me,e.isWordChar=Oe,e.Pass=he,e.signal=Qe,e.Line=yi,e.changeEnd=ca,e.scrollbarModel=zo,e.Pos=ot,e.cmpPos=wt,e.modes=yt,e.mimeModes=st,e.resolveMode=it,e.getMode=mt,e.modeExtensions=bt,e.extendMode=At,e.copyState=Xt,e.startState=ge,e.innerMode=Ae,e.commands=Qa,e.keyMap=ra,e.keyName=Rs,e.isModifierKey=Os,e.lookupKey=La,e.normalizeKeyMap=Ml,e.StringStream=z,e.SharedTextMarker=Ya,e.TextMarker=ha,e.LineWidget=Xa,e.e_preventDefault=_e,e.e_stopPropagation=Ce,e.e_stop=De,e.addClass=W,e.contains=P,e.rmClass=y,e.keyNames=fa}Jl(Nr),eu(Nr);var ou="iter insert remove copy getEditor constructor".split(" ");for(var yo in Ti.prototype)Ti.prototype.hasOwnProperty(yo)&&$(ou,yo)<0&&(Nr.prototype[yo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ti.prototype[yo]));return Ue(Ti),Nr.inputStyles={textarea:Xr,contenteditable:Sr},Nr.defineMode=function(e){!Nr.defaults.mode&&e!="null"&&(Nr.defaults.mode=e),Nt.apply(this,arguments)},Nr.defineMIME=Ut,Nr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nr.defineMIME("text/plain","null"),Nr.defineExtension=function(e,a){Nr.prototype[e]=a},Nr.defineDocExtension=function(e,a){Ti.prototype[e]=a},Nr.fromTextArea=iu,au(Nr),Nr.version="5.58.2",Nr})},W7jJ:function(nt,Le,F){"use strict";F.r(Le);var ue=F("0Owb"),Q=F("PpiC"),j=F("OaEy"),S=F("2fM7"),D=F("T2oS"),x=F("W9HT"),T=F("miYZ"),w=F("tsqr"),f=F("2qtc"),p=F("kLXV"),u=F("9og8"),o=F("tJVT"),i=F("k1fw"),l=F("aHsQ"),s=F("sGsY"),h=F("WmNS"),r=F.n(h),t=F("q1tI"),n=F.n(t),c=F("Fvcw"),m=F("GIiI"),v=F("Ty5D"),b=F("9kvl"),E=F("55Ip"),g=F("7qur"),y=F("cDPC"),C=F("m3rI"),d=F("RCxd"),_=F("EHPI"),O=F("J66h"),A=F("uMZB"),P=F.n(A),I=F("sNtx"),W=F("RpDr"),K=F("+L6B"),te=F("2/Rp"),H=F("y8nQ"),G=F("Vl3Y"),V=F("5NDa"),re=F("5rEg"),$=re.a.TextArea,ne=5e3,he=function(ft){var gt=ft.callback,Rt=ft.onCancel,Ht=ft.notes;function mn(fn){gt(fn)}return n.a.createElement(G.a,{className:"note-form-panel",onFinish:mn,initialValues:{notes:Ht}},n.a.createElement(G.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ne,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ne)}]},n.a.createElement($,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(G.a.Item,{style:{textAlign:"right"}},n.a.createElement(te.a,{type:"ghost",onClick:Rt,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(te.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},pe=F("ZsLC"),Te=F.n(pe),we=F("DjyN"),Me=F("NUBc"),Ee=F("g9YV"),xe=F("wCAj"),Ge=F("Hw79"),je=F.n(Ge),We=F("ye1Q"),ze=F("lfch"),de=F("bdLU"),le=F("1vsH"),Oe=F("wd/R"),Ie=F.n(Oe),qe=xe.a.Column,ee=function(ft){var gt=ft.submitResult,Rt=ft.submitting,Ht=ft.submitRecords,mn=ft.page,fn=ft.onPageChange,Ct=ft.topicId,_t=gt||{},Zt=_t.status,Tt=_t.id,sn=_t.input,Wt=_t.output,dn=_t.expected_output,$n=_t.is_file,Dn=_t.input_file_url,_n=_t.output_file_url,er=_t.expected_output_file_url,Rn=_t.error_msg,Pn=Ht||{},Gn=Pn.records,Tr=Pn.records_count,ir=Object(v.i)();function dr(){$n?navigator.clipboard.writeText(O.Base64.decode(Rn)).then(function(){w.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(O.Base64.decode(Wt)).then(function(){w.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(x.a,{spinning:Rt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(We.a,{style:{fontSize:24},spin:!0})},Tt?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:je.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:Zt===de.a.OK?"c-green":"c-red"},W.a[Zt])),n.a.createElement("li",{className:je.a.error},n.a.createElement("a",{onClick:dr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(ze.a,null)," ")),n.a.createElement("li",null,n.a.createElement(E.a,{to:"/problems/".concat(Ct,"/record-detail/").concat(Tt,"?backId=").concat(ir==null?void 0:ir.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Zt!==de.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!$n&&sn,$n&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(le.w)(Dn,sn)}},sn)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(Zt===4||Zt===5)&&O.Base64.decode(Rn),Zt!=4&&Zt!=5&&($n?n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(le.w)(_n,Wt)}},Wt):O.Base64.decode(Wt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!$n&&O.Base64.decode(dn),$n&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(le.w)(er,dn)}},dn))):null):null,(Gn==null?void 0:Gn.length)>0?n.a.createElement(xe.a,{dataSource:Gn,rowKey:"id",pagination:!1},n.a.createElement(qe,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(xr,ar){return n.a.createElement("span",null," ",Ie()(xr).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(qe,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(xr,ar){var fr;return n.a.createElement(E.a,{className:xr===0?"c-green":"c-red",to:"/problems/".concat(Ct,"/record-detail/").concat(ar.id,"?backId=").concat(ir==null?void 0:ir.save_identifier)},(fr=W.a[xr])===null||fr===void 0?void 0:fr.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(qe,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),n.a.createElement(qe,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),n.a.createElement(qe,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,Tr>15?n.a.createElement(Me.a,{className:je.a.pagination,current:mn,pageSize:15,total:Tr,onChange:fn}):null)},k=F("BdwD"),U=F("DYRE"),q=F("zeV3"),Y=F("+BJd"),J=F("mr32"),be=F("TcMa"),ke=F.n(be),ct=F("9Bee"),He={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Be=function(ft){var gt=ft.hack,Rt=ft.onTriggerPraise,Ht=ft.toDiscuss,mn=gt.language,fn=gt.difficulty,Ct=gt.time_limit,_t=gt.username,Zt=gt.user_path,Tt=gt.user_praise,sn=gt.comments_count,Wt=gt.praises_count,dn=gt.description,$n=gt.pass_count,Dn=gt.submit_count,_n=Object(v.h)();console.log(gt.language,"language");var er=He[fn];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:ke.a.info},n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(J.a,{color:er.color},er.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,Ct,"\u79D2"))),n.a.createElement(ct.a,{value:dn,className:ke.a.desc}),n.a.createElement("ul",{className:ke.a["commit-info"]},n.a.createElement("li",null,n.a.createElement(q.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,$n))),n.a.createElement("li",null,n.a.createElement(q.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,Dn))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),n.a.createElement("li",null,n.a.createElement(q.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ht})," ",n.a.createElement("b",null,sn))," ")))},Ze=F("dhSg"),ht=F("ps8w"),Qe=F.n(ht),Xe=F("oBTY"),Ke=F("M8RZ"),Fe=F("OkW/"),Ue=F("ErOA");function _e(ft){return Object(Ue.c)("comments.json",ft)}function Ce(ft){return Object(Ue.f)("/discusses/".concat(ft,"/plus.json"),{container_type:"Discuss",type:1})}function Ne(ft){return Object(Ue.f)("comments/reply.json",ft)}function De(ft){return Object(Ue.f)("comments.json",ft)}function rt(ft){return Object(Ue.f)("comments/".concat(ft==null?void 0:ft.id,"/hidden.json"),ft)}function tt(ft){return Object(Ue.b)("comments/".concat(ft==null?void 0:ft.id,".json"))}var xt=F("GgEA"),Mt=F("AMnG"),Bt=F("xKgJ");function It(ft){var gt=ft.author;return n.a.createElement("a",{href:"/users/".concat(gt.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(C.a.IMG_SERVER,"/images/").concat(gt.image_url),width:"50"}))}function Dt(ft){var gt=ft.data,Rt=ft.index,Ht=ft.parentDiscussIndex,mn=ft.user,fn=ft.onSetActionType,Ct=gt.author,_t=gt.can_delete,Zt=gt.content,Tt=gt.id,sn=gt.time;function Wt(){fn({id:Tt,index:Rt,type:"delete-discuss",parentDiscussIndex:Ht,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var dn=mn.admin||_t||Ct.user_id===mn.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(It,{author:Ct}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Ct.login),target:"_blank"},Ct.name),n.a.createElement("span",{className:"grey"},sn),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},dn?n.a.createElement("a",{onClick:Wt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(ct.a,{className:"discuss-content",value:Zt})))}var lt=function(ft){var gt=ft.user,Rt=ft.data,Ht=ft.index,mn=ft.onPlusDiscuss,fn=ft.onSetActionType,Ct=ft.activeDiscussIndex,_t=ft.onReplyDiscuss,Zt=ft.onSetActiveDiscussIndex,Tt=Rt.content,sn=Rt.children,Wt=Rt.hidden,dn=Rt.id,$n=Rt.praise_count,Dn=Rt.time,_n=Rt.user_praise,er=Rt.can_delete,Rn=Rt.author;console.log(er&&(!sn||sn.length==0),"children22");function Pn(){Zt(dn)}function Gn(){mn(dn,!_n,Ht)}function Tr(){fn({id:dn,index:Ht,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function ir(){fn({id:dn,index:Ht,params:{hidden:Wt?"0":"1"},type:"hidden-discuss",message:Wt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var dr=gt.admin||gt.user_id===Rn.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:dn},n.a.createElement(It,{author:Rn}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Rn.login),target:"_blank"}," ",Rn.name," "),n.a.createElement("span",{className:"grey"},Dn)),n.a.createElement(ct.a,{className:"discuss-content",value:Tt}),sn&&sn.length>0?n.a.createElement("div",{className:"reply-discuss-container"},sn.map(function(vr,xr){return n.a.createElement(Dt,{key:vr.id,data:vr,index:xr,user:gt,onSetActionType:fn,parentDiscussIndex:Ht})})):null,n.a.createElement("div",{className:"btn-group"},Object(Bt.v)()?n.a.createElement("a",{onClick:ir,title:Wt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Wt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,er&&(!sn||sn.length==0)?n.a.createElement("a",{onClick:Tr,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:Pn,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:Gn,className:_n?"c-orange":""},n.a.createElement("i",{className:_n?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,$n||""))),n.a.createElement(Mt.a,{id:dn,activeDiscussIndex:Ct,onReplyDiscuss:_t})))},pt=F("kaH+"),ut=F("Wx9E"),Pe=F("Ot1p"),Ve=function(ft){var gt=ft.user_praise,Rt=ft.praise_count,Ht=ft.praisePlus,mn=ft.onCreateDiscuss,fn=ft.discuss_count,Ct=Object(t.useState)(!1),_t=Object(o.a)(Ct,2),Zt=_t[0],Tt=_t[1],sn=Object(t.useState)(""),Wt=Object(o.a)(sn,2),dn=Wt[0],$n=Wt[1];function Dn(Gn){$n(Gn)}function _n(){Tt(!0)}function er(){Tt(!1)}function Rn(){return Pn.apply(this,arguments)}function Pn(){return Pn=Object(u.a)(r.a.mark(function Gn(){return r.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:mn(dn),$n(""),Tt(!1);case 3:case"end":return ir.stop()}},Gn)})),Pn.apply(this,arguments)}return n.a.createElement("div",{className:"dis-input-editor-container ".concat(Zt?"active":""," ")},n.a.createElement("div",{className:Zt?"text-area hide":"text-area"},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:_n}),n.a.createElement("a",{style:{alignItems:"center"}}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",fn," "),n.a.createElement("a",{className:"c-light-black",onClick:Ht,style:{alignItems:"center"},title:gt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(gt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Rt?n.a.createElement("span",null,Rt):"")),Zt?n.a.createElement("div",{className:"input-mask",onClick:er}):null,n.a.createElement("div",{className:Zt?"md-container":"md-container hide"},n.a.createElement(Pe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:dn,height:240,onChange:Dn}),n.a.createElement("div",{className:"tip-container",onClick:er},n.a.createElement("a",{className:"btn-send",onClick:Rn}," \u53D1\u9001 "))))},yt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},st;(function(ft){ft[ft.GET_DISCUSSES=0]="GET_DISCUSSES",ft[ft.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",ft[ft.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",ft[ft.PLUS_DISCUSS=3]="PLUS_DISCUSS",ft[ft.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",ft[ft.SET_PAGE=5]="SET_PAGE",ft[ft.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(st||(st={}));function Nt(ft,gt){switch(gt.type){case st.SHOW_DISCUSSES_LOADING:return Object(i.a)(Object(i.a)({},ft),{},{loading:!0});case st.GET_DISCUSSES:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.TOP_OR_DOWN_DISCUSS:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.SET_ACTION_TYPE:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.PLUS_DISCUSS:return Object(i.a)(Object(i.a)({},ft),gt.payload);case st.SET_PAGE:return Object(i.a)(Object(i.a)({},ft),{},{page:gt.payload});case st.ACTIVE_DISCUSS_INDEX:return Object(i.a)(Object(i.a)({},ft),gt.payload);default:throw new Error}}var Ut=function(ft){var gt=ft.user,Rt=ft.identifier,Ht=ft.hack,mn=ft.onTriggerPraise,fn=ft.setDiscussTotal,Ct=Object(t.useReducer)(Nt,yt),_t=Object(o.a)(Ct,2),Zt=_t[0],Tt=_t[1],sn=Zt.loading,Wt=Zt.page,dn=Zt.data,$n=Zt.count,Dn=Zt.actionType,_n=Zt.activeDiscussIndex,er=Object(t.useCallback)(Object(u.a)(r.a.mark(function gn(){var tr,or,gr;return r.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Tt({type:st.SHOW_DISCUSSES_LOADING}),Qn.next=3,_e({container_type:"Practice",container_identifier:Rt,limit:10,page:Wt});case 3:tr=Qn.sent,or=tr.comments,gr=tr.disscuss_count,Tt({type:st.GET_DISCUSSES,payload:{data:or,count:gr,loading:!1}}),fn(gr);case 7:case"end":return Qn.stop()}},gn)})),[Wt,Rt]);Object(t.useEffect)(function(){er()},[Rt,Wt]);function Rn(gn){Tt({type:st.SET_PAGE,page:gn})}function Pn(gn){Tt({type:st.SET_ACTION_TYPE,payload:{actionType:gn}})}function Gn(gn){_n===gn?Tt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):Tt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:gn}})}function Tr(gn,tr,or){return ir.apply(this,arguments)}function ir(){return ir=Object(u.a)(r.a.mark(function gn(tr,or,gr){var Jn;return r.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,Ce(tr);case 3:Jn=yn.sent,dn[gr].user_praise=or,dn[gr].praise_count=Jn.praise_count,Tt({type:st.PLUS_DISCUSS,payload:{data:Object(Xe.a)(dn)}}),yn.next=12;break;case 9:yn.prev=9,yn.t0=yn.catch(0),console.log(yn.t0);case 12:case"end":return yn.stop()}},gn,null,[[0,9]])})),ir.apply(this,arguments)}function dr(){return vr.apply(this,arguments)}function vr(){return vr=Object(u.a)(r.a.mark(function gn(){var tr,or,gr,Jn,Qn;return r.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(tr=Dn.id,or=Dn.params,gr=Dn.type,Jn=Dn.index,Qn=Dn.parentDiscussIndex,!(gr==="hidden-discuss")){Ln.next=7;break}return console.log(or,"params"),Ln.next=5,rt(Object(i.a)({id:tr,container_type:"Practice",container_identifier:Rt},or));case 5:Qn?dn[Qn].children[Jn].hidden=or.hidden==1:dn[Jn].hidden=or.hidden==1,Tt({type:st.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Xe.a)(dn)}});case 7:if(!(gr==="delete-discuss")){Ln.next=13;break}return Ln.next=10,tt({id:tr,container_type:"Practice",container_identifier:Rt});case 10:return Tt({type:st.SET_ACTION_TYPE,payload:{actionType:null}}),Ln.next=13,er();case 13:case"end":return Ln.stop()}},gn)})),vr.apply(this,arguments)}function xr(){Tt({type:st.SET_ACTION_TYPE,payload:{actionType:null}})}function ar(gn,tr){return fr.apply(this,arguments)}function fr(){return fr=Object(u.a)(r.a.mark(function gn(tr,or){return r.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.prev=0,Jn.next=3,Ne({container_type:"Practice",container_identifier:Rt,comments:{content:or,parent_id:tr}});case 3:er(),Jn.next=9;break;case 6:Jn.prev=6,Jn.t0=Jn.catch(0),console.log(Jn.t0);case 9:case"end":return Jn.stop()}},gn,null,[[0,6]])})),fr.apply(this,arguments)}function Wn(gn){return Jt.apply(this,arguments)}function Jt(){return Jt=Object(u.a)(r.a.mark(function gn(tr){return r.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return Tt({type:st.SHOW_DISCUSSES_LOADING}),gr.next=3,De({comments:{content:tr},container_type:"Practice",container_identifier:Rt});case 3:er();case 4:case"end":return gr.stop()}},gn)})),Jt.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},dn.length===0?n.a.createElement(k.a,null):dn.map(function(gn,tr){return n.a.createElement(lt,{onReplyDiscuss:ar,onPlusDiscuss:Tr,onSetActiveDiscussIndex:Gn,onSetActionType:Pn,data:gn,index:tr,user:gt,activeDiscussIndex:_n})}),$n>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(Me.a,{showQuickJumper:!0,onChange:Rn,current:Wt,total:$n})):null),n.a.createElement(Ve,{user_praise:Ht.user_praise,praise_count:Ht.praises_count,praisePlus:mn,discuss_count:Ht.comments_count,onCreateDiscuss:Wn}),n.a.createElement(Ke.a,null,n.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Dn,onOk:dr,onCancel:xr},n.a.createElement("p",null,Dn?Dn.message:"")),n.a.createElement(pt.a,null)))},it=F("1FX+"),mt=F.n(it),bt=F("pYxM"),At=F.n(bt),Xt=F("sB/4"),Ae=F.n(Xt),ge=F("Wtmd"),z=F.n(ge),Z=F("CNDd"),oe=F.n(Z),me=F("nCk5"),Re=F.n(me),Je=F("kovY"),at=F.n(Je),kt=function(gt){var Rt=gt.style,Ht=Rt===void 0?{}:Rt,mn=gt.onClick,fn=gt.onAssist,Ct=gt.onHide,_t=gt.data,Zt=gt.active,Tt=gt.showLine;return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:Zt===(_t==null?void 0:_t.id)?"".concat(At.a.list," ").concat(At.a.active):At.a.list,style:Ht,onClick:function(){return mn(_t)}},(_t==null?void 0:_t.video)&&n.a.createElement("div",{className:At.a.left},n.a.createElement("img",{src:_t==null?void 0:_t.video_cover}),n.a.createElement("div",null,n.a.createElement("img",{src:Ae.a}),n.a.createElement("span",null,_t==null?void 0:_t.video_duration)),n.a.createElement("div",{className:At.a.mask})),n.a.createElement("div",{className:At.a.right},n.a.createElement("div",{className:At.a.name},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(_t==null?void 0:_t.image_url),width:30,height:30}),n.a.createElement("div",{title:_t==null?void 0:_t.name,className:At.a.title},_t==null?void 0:_t.name),(_t==null?void 0:_t.is_authority)&&n.a.createElement("div",{className:At.a.b},"\u5B98\u65B9"),(_t==null?void 0:_t.is_excellent)&&n.a.createElement("div",{className:At.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:At.a.des},n.a.createElement(ct.a,{showLines:2,showTextOnly:!0,value:(_t==null?void 0:_t.content)||"\u6682\u65E0\u5185\u5BB9"})),n.a.createElement("div",{className:At.a.tag},n.a.createElement("span",{className:"current",onClick:function(Wt){Wt.stopPropagation(),fn(_t)}},n.a.createElement("img",{src:_t!=null&&_t.user_liker?oe.a:z.a}),n.a.createElement("span",{style:{color:_t!=null&&_t.user_liker?"#0152d9":"#656f87"}},_t==null?void 0:_t.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Re.a}),n.a.createElement("span",null,_t==null?void 0:_t.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:at.a}),n.a.createElement("span",null,_t==null?void 0:_t.viewed_count)),Object(Bt.v)()&&n.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Wt){Wt.stopPropagation(),Ct(_t)}},_t!=null&&_t.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),Tt&&n.a.createElement("div",{className:At.a.line}))},jt=kt,ot=F("5Dmo"),wt=F("3S7+"),Kt=F("Z8dc"),Et=F.n(Kt),Qt=F("Aky1"),Vt=F("7+5b"),ie=F.n(Vt),N=F("twBr"),B=F.n(N),ae=F("oE5q"),fe=F.n(ae),se=function(gt,Rt){var Ht,mn,fn,Ct=Rt.payload.uploadInfo,_t=Ct===void 0?{}:Ct;switch(Rt.type){case"addVideo":return{videoList:[].concat(Object(Xe.a)(gt.videoList),[{name:_t.file.name,size:_t.file.size,type:_t.file.type,fileHash:_t.fileHash,state:_t.state,video_id:_t.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:gt.videoList.filter(function(Zt){return Zt.name!==Rt.payload.name})};case"replaceVideo":return{videoList:Rt.payload};case"removeAll":return[];case"updateProgress":return{videoList:gt.videoList.map(function(Zt){return Zt.name===Rt.payload.uploadInfo.file.name?Object(i.a)(Object(i.a)({},Zt),{loaded:Rt.payload.progressPercent,video_id:_t.videoId,fileHash:_t.fileHash}):Zt})};case"updateTitle":return{videoList:(Ht=gt.videoList)===null||Ht===void 0?void 0:Ht.map(function(Zt){return Zt.name===Rt.payload.item.name?Object(i.a)(Object(i.a)({},Zt),{title:Rt.payload.title}):Zt})};case"updateImg":return{videoList:(mn=gt.videoList)===null||mn===void 0?void 0:mn.map(function(Zt){return Zt.name===Rt.payload.item.name?Object(i.a)(Object(i.a)({},Zt),{attachment_id:Rt.payload.attachment_id}):Zt})};case"updateImg":return{videoList:(fn=gt.videoList)===null||fn===void 0?void 0:fn.map(function(Zt){return Zt.name===Rt.payload.item.name?Object(i.a)(Object(i.a)({},Zt),{attachment_id:Rt.payload.attachment_id}):Zt})};default:return[]}},$e=function(gt){var Rt,Ht,mn=gt.onClose,fn=gt.onOk,Ct=gt.identifier,_t=gt.active,Zt=G.a.useForm(),Tt=Object(o.a)(Zt,1),sn=Tt[0],Wt=Object(t.useState)({}),dn=Object(o.a)(Wt,2),$n=dn[0],Dn=dn[1],_n=Object(t.useState)(!1),er=Object(o.a)(_n,2),Rn=er[0],Pn=er[1],Gn=Object(t.useState)(!1),Tr=Object(o.a)(Gn,2),ir=Tr[0],dr=Tr[1],vr=Object(t.useReducer)(se,{videoList:[]}),xr=Object(o.a)(vr,2),ar=xr[0],fr=xr[1],Wn=Object(Bt.x)(),Jt=Object(v.i)(),gn=Object(t.useRef)();Object(t.useEffect)(function(){_t&&tr()},[_t]);var tr=function(){var bn=Object(u.a)(r.a.mark(function Mn(){var Tn,Vn,sr,br,kr,ei,Mi,$r,Wi,na,Gi,di;return r.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,Object(g.k)(Ct,{active:_t});case 2:Tn=Xn.sent,(Tn==null?void 0:Tn.status)===0&&(ei={name:Tn==null||((Vn=Tn.data)===null||Vn===void 0)?void 0:Vn.name,content:Tn==null||((sr=Tn.data)===null||sr===void 0)?void 0:sr.content},sn.setFieldsValue(ei),Dn(ei),Tn!=null&&(br=Tn.data)!==null&&br!==void 0&&(kr=br.videos)!==null&&kr!==void 0&&kr[0]&&fr({type:"replaceVideo",payload:[{video_id:Tn==null||((Mi=Tn.data)===null||Mi===void 0||(($r=Mi.videos)===null||$r===void 0||((Wi=$r[0])===null||Wi===void 0)))?void 0:Wi.video_id,name:Tn==null||((na=Tn.data)===null||na===void 0||((Gi=na.videos)===null||Gi===void 0||((di=Gi[0])===null||di===void 0)))?void 0:di.title,loaded:100}]}));case 4:case"end":return Xn.stop()}},Mn)}));return function(){return bn.apply(this,arguments)}}(),or=function(Mn,Tn){Dn(Object(i.a)({},Tn))},gr=function(){var bn=Object(u.a)(r.a.mark(function Mn(Tn){var Vn,sr,br,kr,ei;return r.a.wrap(function($r){for(;;)switch($r.prev=$r.next){case 0:if(sr={videos:ar.videoList,articles:Tn},dr(!0),!_t){$r.next=9;break}return sr.active=_t,$r.next=6,Object(g.j)(Ct,sr);case 6:br=$r.sent,$r.next=12;break;case 9:return $r.next=11,Object(g.a)(Ct,sr);case 11:br=$r.sent;case 12:((Vn=br)===null||Vn===void 0?void 0:Vn.status)===0&&(console.log(_t||((kr=br)===null||kr===void 0?void 0:kr.id),44),fn(_t||((ei=br)===null||ei===void 0?void 0:ei.id))),dr(!1);case 14:case"end":return $r.stop()}},Mn)}));return function(Tn){return bn.apply(this,arguments)}}(),Jn=function(){var Mn=document.getElementById("fileUpload");Mn.value=""},Qn=function(Mn){var Tn='{"Vod":{}}';if(Pn(!0),gn.current){gn.current.addFile(Mn,null,null,null,Tn);return}Object(Qt.a)(Wn==null?void 0:Wn.login,"",{create:!gn,addFileSuccess:function(sr){fr({type:"addVideo",payload:{uploadInfo:sr}})},onUploadProgress:function(sr,br,kr){var ei=Math.ceil(kr*100);fr({type:"updateProgress",payload:{uploadInfo:sr,progressPercent:ei}}),Jn()},onUploadFailed:function(sr){w.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(sr){Pn(!1)},onUploadSucceed:function(sr){Pn(!1)},onUploadError:function(sr){Pn(!1)},gotUploader:function(sr){sr.addFile(Mn,null,null,null,Tn),gn.current=sr}})},yn=function(Mn){var Tn,Vn=1024,sr=Mn.target.files[0];if(!sr){Jn();return}var br=sr.name.toLowerCase();if(br&&br.indexOf(".avi")==-1&&br.indexOf(".flv")==-1&&br.indexOf(".f4v")==-1&&br.indexOf(".m4v")==-1&&br.indexOf(".mov")==-1&&br.indexOf(".mp4")==-1&&br.indexOf(".rmvb")==-1&&br.indexOf(".swf")==-1&&br.indexOf(".webm")==-1&&br.indexOf(".wmv")==-1){w.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Jn();return}if(sr.size>Vn*1024*1024){w.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(Vn,"M")),Jn();return}if((Tn=ar.videoList)!==null&&Tn!==void 0&&Tn.find(function(kr){return kr.name===sr.name})){w.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),Jn();return}Qn(sr)},Ln=function(Mn,Tn){p.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",Tn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Jn(),fr({type:"removeVideo",payload:{name:Mn}})}})},Yt=function(){return n.a.createElement("label",{htmlFor:"fileUpload",className:Et.a.main},n.a.createElement("img",{src:ie.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},qt=function(Mn){return n.a.createElement("div",{className:Et.a.mainLoading},n.a.createElement("div",{className:Et.a.proWarp},n.a.createElement("div",{className:Et.a.pro},n.a.createElement("div",{style:{width:Mn}})),n.a.createElement("span",null,Mn||0,"%")),n.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),n.a.createElement("div",{className:Et.a.tip},n.a.createElement(wt.a,{getPopupContainer:function(Vn){return Vn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:fe.a,alt:""}))))},nn=function(Mn){return n.a.createElement("div",{className:Et.a.mainSucceed},n.a.createElement("img",{src:B.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),n.a.createElement("div",{className:Et.a.tip},n.a.createElement(wt.a,{getPopupContainer:function(Vn){return Vn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:fe.a,alt:""}))),n.a.createElement("div",{className:Et.a.del,onClick:function(){return Ln(Mn.name,Mn.loaded==100)}},n.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},xn=function(){var Mn;return n.a.createElement(n.a.Fragment,null,(Mn=ar.videoList)===null||Mn===void 0?void 0:Mn.map(function(Tn,Vn){return n.a.createElement(n.a.Fragment,{key:Vn},Tn.loaded==100?nn(Tn):qt(Tn.loaded))}))},cn=function(){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:mn})},Hn=(Rt=ar.videoList)===null||Rt===void 0?void 0:Rt.length;return n.a.createElement("div",{className:Et.a.listForm},n.a.createElement("header",null,_t?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),n.a.createElement("section",{className:Et.a.scroll,id:"sss"},n.a.createElement("div",{className:Et.a.formWrap}," ",n.a.createElement(G.a,{form:sn,scrollToFirstError:!0,layout:"vertical",onValuesChange:or,onFinish:gr},n.a.createElement(G.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},n.a.createElement(re.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ht=$n.name)===null||Ht===void 0?void 0:Ht.length)||0,"/60")})),n.a.createElement(G.a.Item,{name:"content",label:"\u5185\u5BB9:"},n.a.createElement(Pe.a,{defaultValue:$n.content||"",watch:!0})))),n.a.createElement("div",{className:Et.a.upload},Hn?xn():Yt(),n.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:yn,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}))),n.a.createElement("div",{className:Et.a.btns},n.a.createElement(te.a,{onClick:cn,type:"primary",ghost:!0},"\u5173\u95ED"),n.a.createElement(te.a,{loading:ir,disabled:Rn,onClick:function(){return sn.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},St=$e,Pt=F("cWXX"),$t=F("/ezw"),Ot=F("CaVn"),zt=F.n(Ot),an=F("s8/Y"),jn=F.n(an),Dr=F("JOrW"),Cr=F.n(Dr),Nn=F("gqXR"),hr=F.n(Nn),mi=F("14J3"),Or=F("BMrR"),yr=F("jCWc"),pr=F("kPKH"),Yr=F("wW8i"),Mr=F.n(Yr),Zr=F("MVJL"),wr=F.n(Zr),vi=function(gt){var Rt=gt.id,Ht=gt.cb,mn=Object(t.useState)(""),fn=Object(o.a)(mn,2),Ct=fn[0],_t=fn[1];return n.a.createElement("aside",{className:"mt10"},n.a.createElement(Pe.a,{defaultValue:Ct,id:"writeForumsReviewId",onChange:function(Tt){_t(Tt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Or.a,null,n.a.createElement(pr.a,{flex:"1"}),n.a.createElement(pr.a,null,n.a.createElement(te.a,{type:"primary",size:"large",onClick:Object(u.a)(r.a.mark(function Zt(){return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:Ct===""?w.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):Ht(Rt,Ct);case 1:case"end":return sn.stop()}},Zt)}))},"\u53D1\u9001"))))},li=function(gt){var Rt,Ht=gt.data;return n.a.createElement("div",{className:wr.a.thirdlyLevelDiscuss},n.a.createElement("span",{className:"c-grey-333"},n.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null||((Rt=Ht.author)===null||Rt===void 0)?void 0:Rt.name),"@",n.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null?void 0:Ht.parent_name),":"),n.a.createElement(ct.a,{value:Ht==null?void 0:Ht.content}))},Kr=function(gt){var Rt,Ht,mn,fn,Ct=gt.data,_t=gt.onReplyDiscuss,Zt=gt.thirdlyReply,Tt=gt.setThirdlyReply,sn=Object(Bt.x)();return console.log(sn,"user"),n.a.createElement("div",{className:wr.a.list},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(Ct==null||((Rt=Ct.author)===null||Rt===void 0)?void 0:Rt.image_url)}),n.a.createElement("div",{className:wr.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333"},Ct==null||((Ht=Ct.author)===null||Ht===void 0)?void 0:Ht.name),(sn==null?void 0:sn.login)!==(Ct==null||((mn=Ct.author)===null||mn===void 0)?void 0:mn.login)&&n.a.createElement("span",{onClick:function(){return Tt(Ct==null?void 0:Ct.id)},className:"c-grey-999 current",style:{float:"right"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),n.a.createElement("span",null,"\u56DE\u590D"))),n.a.createElement(ct.a,{value:Ct==null?void 0:Ct.content}),Ct==null||((fn=Ct.children)===null||fn===void 0)?void 0:fn.map(function(Wt){return n.a.createElement(li,{key:Wt.id,data:Wt})}),Zt===(Ct==null?void 0:Ct.id)&&n.a.createElement("div",null,n.a.createElement(vi,{id:Ct==null?void 0:Ct.id,cb:_t}),n.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return Tt(null)},className:"c-light-primary current"},n.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),n.a.createElement("div",{className:wr.a.line})))},zr=function(gt){var Rt,Ht,mn,fn,Ct=gt.data,_t=gt.onReplyDiscuss,Zt=gt.secondReply,Tt=gt.setSecondReply,sn=gt.thirdlyReply,Wt=gt.setThirdlyReply,dn=gt.onPlusDiscuss,$n=Object(t.useState)(!1),Dn=Object(o.a)($n,2),_n=Dn[0],er=Dn[1];return console.log(Ct,"data"),n.a.createElement("div",{className:wr.a.discussItem},n.a.createElement("div",{className:wr.a.list},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(Ct==null||((Rt=Ct.author)===null||Rt===void 0)?void 0:Rt.image_url)}),n.a.createElement("div",{className:wr.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333 mr30"},Ct==null||((Ht=Ct.author)===null||Ht===void 0)?void 0:Ht.name),n.a.createElement("span",{className:"c-grey-999"},Ct==null?void 0:Ct.time)),n.a.createElement(ct.a,{value:Ct==null?void 0:Ct.content}),n.a.createElement("div",{className:wr.a.btns},n.a.createElement("div",{onClick:function(){return dn(Ct==null?void 0:Ct.id)},className:Ct!=null&&Ct.user_praise?"c-light-primary":"c-grey-999"},n.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),n.a.createElement("span",null,Ct==null?void 0:Ct.praise_count)),n.a.createElement("div",{onClick:function(){var Pn;if((Ct==null||((Pn=Ct.children)===null||Pn===void 0)?void 0:Pn.length)===0)return;Tt(null),er(!_n)},style:{color:_n?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),n.a.createElement("span",null,_n?"\u6536\u8D77\u8BC4\u8BBA":Ct==null||((mn=Ct.children)===null||mn===void 0)?void 0:mn.length)),n.a.createElement("div",{onClick:function(){er(!1),Tt(Zt===(Ct==null?void 0:Ct.id)?null:Ct==null?void 0:Ct.id)},style:{color:Zt===(Ct==null?void 0:Ct.id)?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),n.a.createElement("span",null,Zt===(Ct==null?void 0:Ct.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Zt===(Ct==null?void 0:Ct.id)&&n.a.createElement(vi,{id:Ct==null?void 0:Ct.id,cb:function(Pn,Gn){_t(Pn,Gn),er(!0)}}),_n&&n.a.createElement("div",{className:wr.a.secondLevelDiscuss},Ct==null||((fn=Ct.children)===null||fn===void 0)?void 0:fn.map(function(Rn){return n.a.createElement(Kr,{thirdlyReply:sn,setThirdlyReply:Wt,key:Rn.id,data:Rn,onReplyDiscuss:_t})})))))},xi=zr,gi=function(gt){var Rt=gt.identifier,Ht=gt.active,mn=gt.onOk,fn=Object(t.useState)(""),Ct=Object(o.a)(fn,2),_t=Ct[0],Zt=Ct[1],Tt=Object(t.useState)(1),sn=Object(o.a)(Tt,2),Wt=sn[0],dn=sn[1],$n=Object(t.useState)([]),Dn=Object(o.a)($n,2),_n=Dn[0],er=Dn[1],Rn=Object(t.useState)(0),Pn=Object(o.a)(Rn,2),Gn=Pn[0],Tr=Pn[1],ir=Object(t.useState)(null),dr=Object(o.a)(ir,2),vr=dr[0],xr=dr[1],ar=Object(t.useState)(null),fr=Object(o.a)(ar,2),Wn=fr[0],Jt=fr[1];Object(t.useEffect)(function(){gn(1),dn(1)},[Ht]);var gn=function(){var Qn=Object(u.a)(r.a.mark(function yn(Ln){var Yt;return r.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,_e({container_type:"QuestionSolutionArticle",container_identifier:Ht,limit:5,page:Ln});case 2:Yt=nn.sent,Yt!=null&&Yt.comments&&(er((Yt==null?void 0:Yt.comments)||[]),dn(Ln),Tr(Yt==null?void 0:Yt.disscuss_count));case 4:case"end":return nn.stop()}},yn)}));return function(Ln){return Qn.apply(this,arguments)}}(),tr=function(){var Qn=Object(u.a)(r.a.mark(function yn(){var Ln;return r.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:if(!(_t==="")){qt.next=3;break}return w.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),qt.abrupt("return");case 3:return qt.next=5,De({comments:{content:_t},container_type:"QuestionSolutionArticle",container_identifier:Ht});case 5:Ln=qt.sent,Ln!=null&&Ln.discuss&&(Zt(""),gn(Wt),mn());case 7:case"end":return qt.stop()}},yn)}));return function(){return Qn.apply(this,arguments)}}(),or=function(){var Qn=Object(u.a)(r.a.mark(function yn(Ln,Yt,qt){var nn;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Ne({container_type:"QuestionSolutionArticle",container_identifier:Ht,comments:{content:Yt,parent_id:Ln}});case 2:nn=cn.sent,xr(null),Jt(null),gn(Wt);case 6:case"end":return cn.stop()}},yn)}));return function(Ln,Yt,qt){return Qn.apply(this,arguments)}}(),gr=function(){var Qn=Object(u.a)(r.a.mark(function yn(Ln){var Yt;return r.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Ce(Ln);case 2:Yt=nn.sent,gn(Wt);case 4:case"end":return nn.stop()}},yn)}));return function(Ln){return Qn.apply(this,arguments)}}(),Jn=function(yn){dn(yn),gn(yn)};return n.a.createElement("div",{className:Mr.a.discuss},n.a.createElement("aside",{className:Mr.a.reply,style:{borderWidth:Gn?1:0}},n.a.createElement(Pe.a,{defaultValue:_t,id:"writeForumsReviewId",onChange:function(yn){Zt(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Or.a,null,n.a.createElement(pr.a,{flex:"1"}),n.a.createElement(pr.a,null,n.a.createElement(te.a,{type:"primary",size:"large",onClick:function(){return tr()}},"\u53D1\u9001")))),_n==null?void 0:_n.map(function(Qn){return n.a.createElement(xi,{secondReply:vr,setSecondReply:xr,thirdlyReply:Wn,setThirdlyReply:Jt,key:Qn.id,data:Qn,onReplyDiscuss:or,onPlusDiscuss:gr})}),n.a.createElement(Me.a,{className:Mr.a.pagination,showTotal:function(yn){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:Wt,onChange:Jn,total:Gn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Si=gi,Fn=F("hgre"),Sn=function(gt){var Rt,Ht,mn,fn,Ct,_t,Zt,Tt,sn,Wt,dn=gt.active,$n=gt.identifier,Dn=gt.onAssist,_n=gt.onEdit,er=gt.onArticlesSkip,Rn=gt.onClose,Pn=gt.onOk,Gn=gt.onDelete,Tr=gt.detailsIndex,ir=gt.btnShowStatus,dr=Object(t.useState)(!0),vr=Object(o.a)(dr,2),xr=vr[0],ar=vr[1],fr=Object(t.useState)({}),Wn=Object(o.a)(fr,2),Jt=Wn[0],gn=Wn[1];Object(t.useEffect)(function(){dn&&tr()},[dn,Tr]);var tr=function(){var yn=Object(u.a)(r.a.mark(function Ln(){var Yt,qt,nn=arguments;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return Yt=nn.length>0&&nn[0]!==void 0?nn[0]:!0,Yt&&ar(!0),cn.next=4,Object(g.d)($n,{active:dn});case 4:qt=cn.sent,(qt==null?void 0:qt.status)===0&&gn((qt==null?void 0:qt.data)||{}),ar(!1);case 7:case"end":return cn.stop()}},Ln)}));return function(){return yn.apply(this,arguments)}}(),or=function(){var yn=Object(u.a)(r.a.mark(function Ln(Yt){var qt;return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(g.g)($n,Object(i.a)({active:dn},Yt));case 2:qt=xn.sent,(qt==null?void 0:qt.status)===0&&(tr(!1),Pn());case 4:case"end":return xn.stop()}},Ln)}));return function(Yt){return yn.apply(this,arguments)}}(),gr=function(){var yn=Object(u.a)(r.a.mark(function Ln(Yt){var qt;return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(g.c)($n,{active:Yt==null?void 0:Yt.id});case 2:qt=xn.sent,qt.status===0&&(tr(!1),Pn());case 4:case"end":return xn.stop()}},Ln)}));return function(Yt){return yn.apply(this,arguments)}}(),Jn=function(Ln){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return Gn(Ln)}})},Qn=function(){tr(!1),Pn()};return n.a.createElement("div",{className:zt.a.listDetails},n.a.createElement($t.a,{className:"pt20 pl20 pr20",loading:xr,active:!0,paragraph:{rows:5}},n.a.createElement("div",{className:zt.a.head},n.a.createElement("div",{className:zt.a.name},n.a.createElement("div",{title:Jt==null?void 0:Jt.name,className:zt.a.title},Jt==null?void 0:Jt.name),(Jt==null?void 0:Jt.is_authority)&&n.a.createElement("div",{className:zt.a.b},"\u5B98\u65B9"),(Jt==null?void 0:Jt.is_excellent)&&n.a.createElement("div",{className:zt.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:zt.a.tag},n.a.createElement("img",{src:C.a.IMG_SERVER+"/images/"+(Jt==null?void 0:Jt.image_url)}),n.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Jt==null?void 0:Jt.username),n.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",Ie()(Jt==null?void 0:Jt.created_at).format("YYYY-MM-DD")),n.a.createElement("span",null,n.a.createElement("img",{src:z.a}),n.a.createElement("span",null,Jt==null?void 0:Jt.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Re.a}),n.a.createElement("span",null,Jt==null?void 0:Jt.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:at.a}),n.a.createElement("span",null,Jt==null?void 0:Jt.viewed_count)),n.a.createElement("div",{className:zt.a.btn},(Object(Bt.v)()||(Jt==null?void 0:Jt.is_self))&&n.a.createElement(n.a.Fragment,null,n.a.createElement(te.a,{onClick:function(){return Jn(Jt)},type:"primary",ghost:!0},"\u5220\u9664"),n.a.createElement(te.a,{onClick:function(){return _n(Jt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Bt.v)()&&n.a.createElement(te.a,{onClick:function(){return or({is_authority:!(Jt!=null&&Jt.is_authority)})},type:"primary"},n.a.createElement("img",{src:Cr.a}),Jt!=null&&Jt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Bt.v)()&&n.a.createElement(te.a,{onClick:function(){return or({is_excellent:!(Jt!=null&&Jt.is_excellent)})},type:"primary"},n.a.createElement("img",{src:jn.a}),Jt!=null&&Jt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),n.a.createElement("div",{className:zt.a.scroll},(Jt==null||((Rt=Jt.videos)===null||Rt===void 0||((Ht=Rt[0])===null||Ht===void 0))?void 0:Ht.id)&&n.a.createElement("div",{className:zt.a.video},n.a.createElement(x.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Jt!=null&&(mn=Jt.videos)!==null&&mn!==void 0&&(fn=mn[0])!==null&&fn!==void 0&&fn.transcoded)},n.a.createElement(Fn.a,{poster:Jt==null||((Ct=Jt.videos)===null||Ct===void 0||((_t=Ct[0])===null||_t===void 0))?void 0:_t.cover_url,src:(Jt==null||((Zt=Jt.videos)===null||Zt===void 0||((Tt=Zt[0])===null||Tt===void 0))?void 0:Tt.play_url)||"",videoId:Jt==null||((sn=Jt.videos)===null||sn===void 0||((Wt=sn[0])===null||Wt===void 0))?void 0:Wt.id,logWatchHistory:function(){}}))),n.a.createElement(ct.a,{className:zt.a.html,value:(Jt==null?void 0:Jt.content)||""}),n.a.createElement("div",{onClick:function(){return gr(Jt)},className:zt.a.g},n.a.createElement("img",{className:"mr10",src:(Jt!=null&&Jt.user_liker,hr.a)}),n.a.createElement("span",null,Jt==null?void 0:Jt.praises_count)),n.a.createElement(Si,{onOk:Qn,active:dn,identifier:$n})),n.a.createElement("div",{className:zt.a.btns},n.a.createElement(te.a,{onClick:function(){return Rn()},type:"primary",ghost:!0},"\u5173\u95ED"),ir[0]&&n.a.createElement(te.a,{onClick:function(Ln){return er(Ln,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),ir[1]&&n.a.createElement(te.a,{onClick:function(Ln){return er(Ln,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},_r=Sn,zn=F("3tLw"),Lr=F.n(zn),rr=F("ek7X"),Ri=F("0NbB"),Pr=function(gt){var Rt=gt.identifier,Ht=gt.tabStatus,mn=gt.setFilterListTotal,fn=gt.setListStatus,Ct={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},_t=Object(t.useState)(Object(i.a)({},Ct)),Zt=Object(o.a)(_t,2),Tt=Zt[0],sn=Zt[1],Wt=Object(t.useState)(!1),dn=Object(o.a)(Wt,2),$n=dn[0],Dn=dn[1],_n=Object(t.useState)(0),er=Object(o.a)(_n,2),Rn=er[0],Pn=er[1],Gn=Object(t.useState)(1),Tr=Object(o.a)(Gn,2),ir=Tr[0],dr=Tr[1],vr=Object(t.useState)(null),xr=Object(o.a)(vr,2),ar=xr[0],fr=xr[1],Wn=Object(t.useState)([]),Jt=Object(o.a)(Wn,2),gn=Jt[0],tr=Jt[1],or=Object(t.useState)([!0,!0]),gr=Object(o.a)(or,2),Jn=gr[0],Qn=gr[1],yn=Object(t.useState)(0),Ln=Object(o.a)(yn,2),Yt=Ln[0],qt=Ln[1],nn=Object(t.useRef)(null);Object(t.useEffect)(function(){kr()},[Ht]),Object(t.useEffect)(function(){xn()},[ar]),Object(t.useEffect)(function(){Hn(Object(i.a)({},Ct)),kr()},[Rt]),Object(t.useEffect)(function(){return window.addEventListener("resize",cn),fn(Yt),function(){window.removeEventListener("resize",cn)}},[Yt]);var xn=function(){var Xn=Object(u.a)(r.a.mark(function An(){var nr,lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(ar){In.next=3;break}return Qn([!0,!0]),In.abrupt("return");case 3:nr=[!0,!0],lr=gn==null?void 0:gn.findIndex(function(ri){return ri.id===ar}),lr===0&&Tt.page===1&&(nr[0]=!1),(Tt.page-1)*Tt.limit+(lr+1)===Tt.total&&(nr[1]=!1),Qn(nr);case 8:case"end":return In.stop()}},An)}));return function(){return Xn.apply(this,arguments)}}(),cn=function(){if(Yt){var An,nr=window.innerWidth-((An=nn.current)===null||An===void 0?void 0:An.clientWidth);Pn(nr)}},Hn=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr,Wr,In,ri;return r.a.wrap(function(Jr){for(;;)switch(Jr.prev=Jr.next){case 0:return Dn(!0),Jr.next=3,Object(g.f)(Rt,nr);case 3:return lr=Jr.sent,(lr==null?void 0:lr.status)===0&&(tr((lr==null||((Wr=lr.data)===null||Wr===void 0)?void 0:Wr.articles)||[]),sn(Object(i.a)(Object(i.a)({},nr),{},{total:lr==null||((In=lr.data)===null||In===void 0)?void 0:In.articles_count})),mn(lr==null||((ri=lr.data)===null||ri===void 0)?void 0:ri.articles_count)),Dn(!1),Jr.abrupt("return",lr);case 7:case"end":return Jr.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),bn=function(){(Tt==null?void 0:Tt.sort_direction)===null?Tt.sort_direction="asc":(Tt==null?void 0:Tt.sort_direction)==="asc"?Tt.sort_direction="desc":(Tt==null?void 0:Tt.sort_direction)==="desc"&&(Tt.sort_direction=null),Tt.page=1,kr(),sn(Object(i.a)({},Tt)),Hn(Tt)},Mn=function(){Tt.page=1,Tt.search=Tt==null?void 0:Tt.save_search,kr(),sn(Object(i.a)({},Tt)),Hn(Tt)},Tn=function(){var An,nr=document.getElementsByClassName("btn-resize");nr[0].style.visibility="hidden";var lr=window.innerWidth-((An=nn.current)===null||An===void 0?void 0:An.clientWidth);Pn(lr)},Vn=function(){Tn(),qt(1)},sr=function(An){Tn(),fr(An==null?void 0:An.id),qt(3)},br=function(An){Tn(),fr(An==null?void 0:An.id),qt(2)},kr=function(){var An=document.getElementsByClassName("btn-resize");An[0].style.visibility="visible",Pn(0),qt(0),fr(null)},ei=function(An){qt(3),fr(An),Tt.page=1,sn(Object(i.a)({},Tt)),Hn(Tt)},Mi=function(An){qt(3),fr(An),sn(Object(i.a)({},Tt)),Hn(Tt)},$r=function(An){sn(Object(i.a)({},Tt)),Hn(Tt)},Wi=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(g.c)(Rt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Hn(Tt),dr(ir+1));case 4:case"end":return In.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),na=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(g.e)(Rt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(Hn(Tt),dr(ir+1));case 4:case"end":return In.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),Gi=function(){var Xn=Object(u.a)(r.a.mark(function An(nr){var lr;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(g.i)(Rt,{active:nr==null?void 0:nr.id});case 2:lr=In.sent,lr.status===0&&(kr(),Hn(Tt));case 4:case"end":return In.stop()}},An)}));return function(nr){return Xn.apply(this,arguments)}}(),di=function(An){Tt.page=An,sn(Object(i.a)({},Tt)),Hn(Tt)},Vi=function(){var Xn=Object(u.a)(r.a.mark(function An(nr,lr){var Wr,In,ri,Ur,Jr,wi,Ii,Xi,Kn,wn,Yn;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(Wr=gn==null?void 0:gn.findIndex(function(Ar){return Ar.id===ar}),console.log(Wr,lr,22),!(lr==="prev")){kn.next=21;break}if(!(Wr===void 0)){kn.next=6;break}return w.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 6:if(!(Wr===0)){kn.next=19;break}if(!(Tt.page===1)){kn.next=10;break}return w.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 10:if(!(Tt.page!==1)){kn.next=17;break}return Tt.page=Tt.page-1,sn(Object(i.a)({},Tt)),kn.next=15,Hn(Tt);case 15:In=kn.sent,(In==null?void 0:In.status)===0&&(wi=In==null||((ri=In.data)===null||ri===void 0)?void 0:ri.articles[(In==null||((Ur=In.data)===null||Ur===void 0||((Jr=Ur.articles)===null||Jr===void 0))?void 0:Jr.length)-1],fr(wi==null?void 0:wi.id),console.log(nr.target,555));case 17:kn.next=21;break;case 19:Ii=gn[Wr-1],fr(Ii==null?void 0:Ii.id);case 21:if(!(lr==="next")){kn.next=39;break}if(!(Wr===void 0)){kn.next=25;break}return w.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 25:if(!((Tt.page-1)*Tt.limit+(Wr+1)===Tt.total)){kn.next=28;break}return w.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),kn.abrupt("return");case 28:if(!(Wr+1===Tt.limit)){kn.next=37;break}return Tt.page=Tt.page+1,sn(Object(i.a)({},Tt)),kn.next=33,Hn(Tt);case 33:Xi=kn.sent,(Xi==null?void 0:Xi.status)===0&&(wn=Xi==null||((Kn=Xi.data)===null||Kn===void 0)?void 0:Kn.articles[0],fr(wn==null?void 0:wn.id)),kn.next=39;break;case 37:Yn=gn[Wr+1],fr(Yn==null?void 0:Yn.id);case 39:case"end":return kn.stop()}},An)}));return function(nr,lr){return Xn.apply(this,arguments)}}();return n.a.createElement("div",{className:mt.a.wrap,ref:nn},n.a.createElement("div",{className:mt.a.head},n.a.createElement("div",{className:mt.a.sort,onClick:bn},n.a.createElement("span",null,"\u6700\u65B0"),n.a.createElement("aside",null,n.a.createElement(rr.a,{style:{color:(Tt==null?void 0:Tt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),n.a.createElement(Ri.a,{style:{color:(Tt==null?void 0:Tt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),n.a.createElement(re.a.Search,{value:Tt.save_search,className:mt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(An){Tt.save_search=An.target.value,sn(Object(i.a)({},Tt))},onSearch:Mn}),n.a.createElement("div",{onClick:Vn,className:mt.a.btn},n.a.createElement("img",{src:Lr.a}),"\u5199\u9898\u89E3")),n.a.createElement("div",{className:mt.a.listWarp},n.a.createElement(x.a,{spinning:$n,className:"mt20"},gn==null?void 0:gn.map(function(Xn,An){var nr=!0;return An+1===gn.length&&An!==0&&(nr=!1),n.a.createElement(jt,{active:ar,key:Xn.id,data:Xn,showLine:nr,onClick:sr,onAssist:Wi,onHide:na})}),(gn==null?void 0:gn.length)===0&&n.a.createElement(k.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),n.a.createElement(Me.a,{className:mt.a.pagination,showTotal:function(An){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},An),"\u6761\u6570\u636E")},total:Tt.total,showSizeChanger:!1,current:Tt==null?void 0:Tt.page,onChange:di,hideOnSinglePage:!0,showQuickJumper:!0}),Yt>0&&n.a.createElement("div",{className:mt.a.fixedRight,style:{width:Rn}},Yt===1&&n.a.createElement(St,{identifier:Rt,onClose:kr,onOk:ei}),Yt===2&&n.a.createElement(St,{active:ar,identifier:Rt,onClose:kr,onOk:Mi}),Yt===3&&n.a.createElement(_r,{btnShowStatus:Jn,onArticlesSkip:Vi,detailsIndex:ir,active:ar,identifier:Rt,onClose:kr,onOk:$r,onEdit:br,onAssist:Wi,onDelete:Gi})))},ni=Pr,ji=F("VEzc"),ui=F.n(ji),Di=function(gt){var Rt,Ht=gt.visible,mn=gt.onVisible,fn=gt.value,Ct=gt.onChange,_t=gt.setIndex,Zt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},Tt=Object(t.useState)(Zt),sn=Object(o.a)(Tt,2),Wt=sn[0],dn=sn[1],$n=Object(t.useState)([]),Dn=Object(o.a)($n,2),_n=Dn[0],er=Dn[1],Rn=Object(t.useState)([]),Pn=Object(o.a)(Rn,2),Gn=Pn[0],Tr=Pn[1],ir=Object(t.useState)(!1),dr=Object(o.a)(ir,2),vr=dr[0],xr=dr[1],ar=Object(t.useRef)([]),fr=Object(t.useRef)(null),Wn=Object(v.i)();Object(t.useEffect)(function(){return Wn!=null&&Wn.id&&(fr.current=setInterval(function(){Jt(30)},3e4)),function(){clearInterval(fr.current)}},[]);var Jt=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn){var xn;return r.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(g.r)(Wn==null?void 0:Wn.id,{practice_time:nn});case 2:xn=Hn.sent;case 3:case"end":return Hn.stop()}},qt)}));return function(nn){return Yt.apply(this,arguments)}}();Object(t.useEffect)(function(){Qn(Wt),gr()},[]),Object(t.useEffect)(function(){return window.addEventListener("click",tr),function(){window.removeEventListener("click",tr)}},[Wn==null?void 0:Wn.save_identifier,Ht]),Object(t.useEffect)(function(){var Yt=ar.current.findIndex(function(Hn){return Hn.identifier===(Wn==null?void 0:Wn.save_identifier)}),qt=ar.current[Yt-1],nn=ar.current[Yt+1],xn=document.getElementById("oj-prev"),cn=document.getElementById("oj-next");qt?xn.style.display="block":xn.style.display="none",nn?cn.style.display="block":cn.style.display="none"},[Wn==null?void 0:Wn.save_identifier,ar.current]);var gn=function(qt,nn){if(qt.id===nn)return qt;for(var xn=0,cn=qt;cn=cn.parentNode;xn++){if(cn.id===nn)return cn;if(cn==document.documentElement)return!1}},tr=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn){var xn,cn,Hn;return r.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!gn(nn.target,"oj-drawer")&&Ht&&mn(!1),xn=ar.current.findIndex(function(Tn){return Tn.identifier===(Wn==null?void 0:Wn.save_identifier)}),cn=ar.current[xn-1],Hn=ar.current[xn+1],!(nn.target.id==="oj-prev")){Mn.next=14;break}if(!(!cn||xn===-1)){Mn.next=8;break}return w.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 8:return nn.target.style.pointerEvents="none",nn.target.style.cursor="not-allowed",Mn.next=12,yn(cn==null?void 0:cn.identifier);case 12:_t("0"),setTimeout(function(){nn.target.style.pointerEvents="auto",nn.target.style.cursor="pointer"},400);case 14:if(!(nn.target.id==="oj-next"||nn.target.id==="oj-modal-next")){Mn.next=24;break}if(!(!Hn||xn===-1)){Mn.next=18;break}return w.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),Mn.abrupt("return");case 18:return nn.target.style.pointerEvents="none",nn.target.style.cursor="not-allowed",Mn.next=22,yn(Hn==null?void 0:Hn.identifier);case 22:_t("0"),setTimeout(function(){nn.target.style.pointerEvents="auto",nn.target.style.cursor="pointer"},400);case 24:case"end":return Mn.stop()}},qt)}));return function(nn){return Yt.apply(this,arguments)}}();Object(t.useEffect)(function(){Ct(Wn==null?void 0:Wn.save_identifier);var Yt=Gn.findIndex(function(qt){return qt.some(function(nn){return nn.identifier===(Wn==null?void 0:Wn.save_identifier)})});Yt===-1?dn(Object(i.a)(Object(i.a)({},Wt),{},{page:1})):dn(Object(i.a)(Object(i.a)({},Wt),{},{page:Yt+1}))},[Wn==null?void 0:Wn.save_identifier,Gn]);var or=function(qt){Wt.page=1,Wt.tag_discipline_id=qt,dn(Object(i.a)({},Wt)),Qn(Wt)},gr=function(){var Yt=Object(u.a)(r.a.mark(function qt(){var nn;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(Ue.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:nn=cn.sent,er(nn.tag_disciplines||[]);case 4:case"end":return cn.stop()}},qt)}));return function(){return Yt.apply(this,arguments)}}(),Jn=function(qt){Wt.page=1,Wt.difficulty=typeof qt=="number"?qt:null,dn(Object(i.a)({},Wt)),Qn(Wt)},Qn=function(){var Yt=Object(u.a)(r.a.mark(function qt(nn){var xn,cn,Hn,bn,Mn,Tn;return r.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return xr(!0),sr.next=3,Object(g.p)(nn);case 3:if(xn=sr.sent,xn!=null&&xn.practices_list){for(Hn=xn==null||((cn=xn.practices_list)===null||cn===void 0)?void 0:cn.length,bn=[],Mn=0;Mn(kn+3)*1e3,Ki!==0&&!la&&setTimeout(Gr,1e3),!la){Ir.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),_t({type:hn.SET_SUBMITING,payload:!1}),Ir.abrupt("return");case 12:if(!(Ki===0)){Ir.next=19;break}return $i.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Ir.next=16,Object(g.o)(Tt,{limit:15,page:Gn});case 16:Zi=Ir.sent,_t({type:hn.SET_SUBMIT_RESULT,payload:Object(i.a)(Object(i.a)({},Ct),{},{submitResult:$i,submitting:!1,submitRecords:Zi})}),($i==null?void 0:$i.status)===0&&nn(!0);case 19:case"end":return Ir.stop()}},oa)})),Vr.apply(this,arguments)},Gr=function(){return Vr.apply(this,arguments)},Yn={},vn.next=14,Object(g.s)(Tt,Yn);case 14:if(rn=vn.sent,!(rn.status===-1)){vn.next=18;break}return window.parent.location.href="/classrooms/".concat(Wt.query.coursesId,"/exercise/").concat(Wt.query.exercisesId,"/detail"),vn.abrupt("return");case 18:kn=bn.time_limit,Ar=Fr(),Gr();case 21:vn.next=26;break;case 23:vn.prev=23,vn.t0=vn.catch(3),_t({type:hn.SET_SUBMITING,payload:!1});case 26:case"end":return vn.stop()}},Kn,null,[[3,23]])})),Wi.apply(this,arguments)}function na(){return Gi.apply(this,arguments)}function Gi(){return Gi=Object(u.a)(r.a.mark(function Kn(){var wn,Yn,rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Ct.debuging=!0,_t({type:hn.SET_DEBUGING,payload:!0}),vn.prev=2,vn.next=5,ei();case 5:if(wn=vn.sent,!(wn.status===0)){vn.next=21;break}return Vr=function(){return Vr=Object(u.a)(r.a.mark(function oa(){var Yi,Ki,$i,sa,la,Zi;return r.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(g.l)(Tt,"debug");case 2:if(Yi=Ir.sent,Ki=Yi.status,$i=Yi.message,sa=Yi.data,la=Fr(),Zi=la-Ar>(Yn+3)*1e3,Ki!==0&&!Zi&&(_t({type:hn.SET_EXECUTE_MESSAGE,payload:$i}),setTimeout(Gr,1e3)),!Zi){Ir.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:hn.SET_DEBUGING,payload:!1}),Ir.abrupt("return");case 13:Ki===0&&(_t({type:hn.SET_DEBUGING,payload:!1}),sa.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),_t({type:hn.SET_EXECUTE_RESULT,payload:Object(i.a)(Object(i.a)({},Ct),{},{debugResult:sa,debuging:!1})}));case 14:case"end":return Ir.stop()}},oa)})),Vr.apply(this,arguments)},Gr=function(){return Vr.apply(this,arguments)},Yn=bn.time_limit,rn={input:encodeURIComponent(_n.test_case.input)},vn.next=13,Object(g.h)(Tt,rn);case 13:if(kn=vn.sent,!(kn.status===-1)){vn.next=17;break}return window.parent.location.href="/classrooms/".concat(Wt.query.coursesId,"/exercise/").concat(Wt.query.exercisesId,"/detail"),vn.abrupt("return");case 17:Ar=Fr(),Gr(),vn.next=22;break;case 21:_t({type:hn.SET_DEBUGING,payload:!1});case 22:vn.next=27;break;case 24:vn.prev=24,vn.t0=vn.catch(2),console.log(vn.t0);case 27:return vn.prev=27,vn.finish(27);case 29:case"end":return vn.stop()}},Kn,null,[[2,24,27,29]])})),Gi.apply(this,arguments)}function di(Kn){var wn;clearTimeout(xn.current),xn.current=setTimeout(function(){var Yn;ei({code:O.Base64.encode(Kn),language:cn==null||((Yn=cn.current)===null||Yn===void 0)?void 0:Yn.language})},2e3),_t({type:hn.SET_DATA,payload:Object(i.a)(Object(i.a)({},cn==null?void 0:cn.current),{},{hack:Object(i.a)(Object(i.a)({},cn==null||((wn=cn.current)===null||wn===void 0)?void 0:wn.hack),{},{code:Kn})})})}function Vi(Kn){var wn=Kn.target.value;_t({type:hn.SET_DATA,payload:Object(i.a)(Object(i.a)({},_n),{},{test_case:{input:wn}})})}var Xn=function(){var Kn=Object(u.a)(r.a.mark(function wn(Yn){var rn,kn,Ar,Gr,Vr;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return _t({type:hn.SET_LOADING,payload:!0}),vn.next=3,ei();case 3:if(rn=vn.sent,!(rn.status===0)){vn.next=14;break}return _t({type:hn.SET_SUBMIT_RESULT,payload:{languageValue:Yn}}),cn.current.language=Yn,kn="".concat(Hn==null?void 0:Hn.login,"-language"),localStorage.setItem(kn,Yn),vn.next=11,Object(g.w)(Tt);case 11:Ar=vn.sent,Ar.status===0&&(Vr=Ar==null||((Gr=Ar.data)===null||Gr===void 0)?void 0:Gr.find(function(Hi){return Hi.language===Yn}),di(O.Base64.decode(Vr.code))),setTimeout(function(){_t({type:hn.SET_LOADING,payload:!1})},300);case 14:case"end":return vn.stop()}},wn)}));return function(Yn){return Kn.apply(this,arguments)}}();function An(){return nr.apply(this,arguments)}function nr(){return nr=Object(u.a)(r.a.mark(function Kn(){var wn;return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.prev=0,rn.next=3,Object(g.q)(Tt,{language:dn});case 3:wn=rn.sent,wn.status===401?sn.replace("/login",{from:Wt.pathname}):(di(O.Base64.decode(wn.code)),sr()),rn.next=10;break;case 7:rn.prev=7,rn.t0=rn.catch(0),console.log(rn.t0);case 10:case"end":return rn.stop()}},Kn,null,[[0,7]])})),nr.apply(this,arguments)}function lr(){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(u.a)(r.a.mark(function wn(){var Yn;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(g.t)(Tt,{language:dn});case 2:Yn=kn.sent,Yn.status===401?sn.replace("/login",{from:Wt.pathname}):di(O.Base64.decode(Yn.code));case 4:case"end":return kn.stop()}},wn)}))()}})}function Wr(){_t({type:hn.SET_SHOW_NOTE,payload:!0})}function In(){_t({type:hn.SET_SHOW_NOTE,payload:!1})}function ri(Kn){return Ur.apply(this,arguments)}function Ur(){return Ur=Object(u.a)(r.a.mark(function Kn(wn){return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Object(g.b)(Tt,wn);case 2:_t({type:hn.GET_DATA,payload:{showNote:!1,data:Object(i.a)(Object(i.a)({},_n),{},{hack:Object(i.a)(Object(i.a)({},bn),{},{notes:wn.notes})})}});case 3:case"end":return rn.stop()}},Kn)})),Ur.apply(this,arguments)}var Jr={input:_n==null||((gt=_n.test_case)===null||gt===void 0)?void 0:gt.input,language:bn==null?void 0:bn.language,code:bn==null?void 0:bn.code,title:"main."+Zn[bn==null?void 0:bn.language],modify_code:bn==null?void 0:bn.modify_code,notes:bn==null?void 0:bn.notes,debugResult:er,debuging:ir,submitting:dr,executingMessage:vr,id:Tt,languageValue:dn,languageList:$n,onChangeLanguage:Xn,onCancelNote:In,onAddNote:ri,showNote:Tr,onShowNote:Wr,onSubmitCode:$r,onChangeCode:di,onChangeInput:Vi,onDebugCode:na,onResetCode:An,onSyncCode:lr,onUpdateCode:ei};function wi(){return Ii.apply(this,arguments)}function Ii(){return Ii=Object(u.a)(r.a.mark(function Kn(){var wn,Yn,rn;return r.a.wrap(function(Ar){for(;;)switch(Ar.prev=Ar.next){case 0:return Ar.next=2,Object(g.u)(bn.id,{container_type:"Hack",type:1});case 2:wn=Ar.sent,Yn=wn.praise_count,rn=Object(i.a)(Object(i.a)({},_n),{},{hack:Object(i.a)(Object(i.a)({},bn),{},{praises_count:Yn,user_praise:!bn.user_praise})}),_t({type:hn.SET_DATA,payload:rn});case 6:case"end":return Ar.stop()}},Kn)})),Ii.apply(this,arguments)}var Xi={topicId:Tt,submitResult:Rn,submitRecords:Pn,submitting:dr,page:Gn,onPageChange:kr,hack:bn,user:_n==null?void 0:_n.user,onTriggerPraise:wi};return console.log(_n,cn==null?void 0:cn.current,"data--------"),n.a.createElement(n.a.Fragment,null,n.a.createElement(x.a,{className:"oj-custom-large-spin",size:"large",spinning:Dn},_n?n.a.createElement("div",{className:"oj-custom-warp"},n.a.createElement("header",{className:P.a.header,style:{minWidth:1200}},n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(C.a.IMG_SERVER,"/images/").concat(Hn.image_url),alt:"user",width:30}),n.a.createElement("span",null,Hn.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,bn.name),n.a.createElement(zi,{onChange:function(wn){},className:"font12 c-grey-999"})),n.a.createElement(ur.CopyToClipboard,{text:"".concat((Rt=window.location)===null||Rt===void 0?void 0:Rt.origin,"/problems/").concat(bn.identifier,"/share"),onCopy:function(){return w.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},n.a.createElement("span",{className:P.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",n.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),bn.edit_privilege?n.a.createElement(E.a,{className:P.a.btn_back,to:"/problems/".concat(bn.identifier,"/ojedit"),style:{marginRight:10}}," ",n.a.createElement(c.a,null)," \u7F16\u8F91"):null,n.a.createElement(E.a,{className:P.a.btn_back,to:"/problems"}," ",n.a.createElement(m.a,null),"\u9000\u51FA")),n.a.createElement(y.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:n.a.createElement(ci,Xi),rightChild:n.a.createElement(bi,Jr)})):null),n.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:qt,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:yi.a,alt:""}),n.a.createElement("i",{onClick:function(){return nn(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Cn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Rn==null?void 0:Rn.execute_time,"s"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:ma.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},Rn==null?void 0:Rn.execute_memory,"kb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Rn==null?void 0:Rn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function Br(ft){var gt=ft.languageValue,Rt=ft.languageList,Ht=ft.onChangeLanguage,mn=ft.title,fn=ft.modify_code,Ct=ft.onSyncCode,_t=ft.onShowCodeSetting,Zt=ft.onResetCode,Tt=Object(v.h)(),sn=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(d.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Zt})};return n.a.createElement("div",{className:"action-bar"},n.a.createElement(S.a,{className:"oj-select",value:gt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ht},Rt==null?void 0:Rt.map(function(Wt){return n.a.createElement(S.a.Option,{key:Wt.language,value:Wt.language},Wt.language)})),n.a.createElement("span",null),n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:sn},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:_t},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function bi(ft){var gt=ft.id,Rt=ft.input,Ht=ft.showNote,mn=ft.onShowNote,fn=ft.notes,Ct=ft.onCancelNote,_t=ft.onAddNote,Zt=ft.debugResult,Tt=ft.language,sn=ft.debuging,Wt=ft.submitting,dn=ft.executingMessage,$n=ft.code,Dn=ft.onSubmitCode,_n=ft.onDebugCode,er=ft.onChangeCode,Rn=ft.onChangeInput,Pn=ft.onUpdateCode,Gn=Object(Q.a)(ft,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function Tr(dr){return n.a.createElement(Br,Object(ue.a)({},Gn,{onShowCodeSetting:dr}))}var ir={id:gt,input:Rt,debugResult:Zt,debuging:sn,submitting:Wt,executingMessage:dn,onDebugCode:_n,onChangeCode:er,onSubmitCode:Dn,onChangeInput:Rn};return n.a.createElement("div",{className:"right-panel"},n.a.createElement(_.a,{language:Tt,value:$n,onChange:er,ActionBarRender:Tr}),n.a.createElement("div",{className:"note-form-area ".concat(Ht?"active":"")},n.a.createElement(he,{onCancel:Ct,notes:fn,callback:_t})),n.a.createElement(W.b,ir))}},WaYH:function(nt,Le,F){"use strict";var ue=F("rePB"),Q=F("Ff2n"),j=F("VTBJ"),S=F("1OyB"),D=F("vuIU"),x=F("JX7q"),T=F("Ji7U"),w=F("LK+K"),f=F("q1tI"),p=F("TSYQ"),u=F.n(p),o=F("sboe"),i=F("OZM5"),l=function(E){var g=E.prefixCls,y=E.level,C=E.isStart,d=E.isEnd;if(!y)return null;for(var _="".concat(g,"-indent-unit"),O=[],A=0;A1&&arguments[1]!==void 0?arguments[1]:!1,we=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(Te&&I[we])return I[we];var Me=window.getComputedStyle(pe),Ee=Me.getPropertyValue("box-sizing")||Me.getPropertyValue("-moz-box-sizing")||Me.getPropertyValue("-webkit-box-sizing"),xe=parseFloat(Me.getPropertyValue("padding-bottom"))+parseFloat(Me.getPropertyValue("padding-top")),Ge=parseFloat(Me.getPropertyValue("border-bottom-width"))+parseFloat(Me.getPropertyValue("border-top-width")),je=P.map(function(ze){return"".concat(ze,":").concat(Me.getPropertyValue(ze))}).join(";"),We={sizingStyle:je,paddingSize:xe,borderSize:Ge,boxSizing:Ee};return Te&&we&&(I[we]=We),We}function te(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),pe.getAttribute("wrap")?W.setAttribute("wrap",pe.getAttribute("wrap")):W.removeAttribute("wrap");var Ee=K(pe,Te),xe=Ee.paddingSize,Ge=Ee.borderSize,je=Ee.boxSizing,We=Ee.sizingStyle;W.setAttribute("style","".concat(We,";").concat(A)),W.value=pe.value||pe.placeholder||"";var ze=Number.MIN_SAFE_INTEGER,de=Number.MAX_SAFE_INTEGER,le=W.scrollHeight,Oe;if(je==="border-box"?le+=Ge:je==="content-box"&&(le-=xe),we!==null||Me!==null){W.value=" ";var Ie=W.scrollHeight-xe;we!==null&&(ze=Ie*we,je==="border-box"&&(ze=ze+xe+Ge),le=Math.max(ze,le)),Me!==null&&(de=Ie*Me,je==="border-box"&&(de=de+xe+Ge),Oe=le>de?"":"hidden",le=Math.min(de,le))}return{height:le,minHeight:ze,maxHeight:de,overflowY:Oe,resize:"none"}}var H=F("Gytx"),G=F.n(H),V;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(V||(V={}));var re=function(pe){Object(S.a)(we,pe);var Te=Object(D.a)(we);function we(Me){var Ee;return Object(Q.a)(this,we),Ee=Te.call(this,Me),Ee.nextFrameActionId=void 0,Ee.resizeFrameId=void 0,Ee.textArea=void 0,Ee.saveTextArea=function(xe){Ee.textArea=xe},Ee.handleResize=function(xe){var Ge=Ee.state.resizeStatus,je=Ee.props,We=je.autoSize,ze=je.onResize;if(Ge!==V.NONE)return;typeof ze=="function"&&ze(xe),We&&Ee.resizeOnNextFrame()},Ee.resizeOnNextFrame=function(){cancelAnimationFrame(Ee.nextFrameActionId),Ee.nextFrameActionId=requestAnimationFrame(Ee.resizeTextarea)},Ee.resizeTextarea=function(){var xe=Ee.props.autoSize;if(!xe||!Ee.textArea)return;var Ge=xe.minRows,je=xe.maxRows,We=te(Ee.textArea,!1,Ge,je);Ee.setState({textareaStyles:We,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(Ee.resizeFrameId),Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:V.RESIZED},function(){Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:V.NONE}),Ee.fixFirefoxAutoScroll()})})})})},Ee.renderTextArea=function(){var xe=Ee.props,Ge=xe.prefixCls,je=Ge===void 0?"rc-textarea":Ge,We=xe.autoSize,ze=xe.onResize,de=xe.className,le=xe.disabled,Oe=Ee.state,Ie=Oe.textareaStyles,qe=Oe.resizeStatus,ee=Object(d.a)(Ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),k=O()(je,de,Object(w.a)({},"".concat(je,"-disabled"),le));"value"in ee&&(ee.value=ee.value||"");var U=Object(T.a)(Object(T.a)(Object(T.a)({},Ee.props.style),Ie),qe===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return x.createElement(C,{onResize:Ee.handleResize,disabled:!(We||ze)},x.createElement("textarea",Object(ue.a)({},ee,{className:k,style:U,ref:Ee.saveTextArea})))},Ee.state={textareaStyles:{},resizeStatus:V.NONE},Ee}return Object(j.a)(we,[{key:"componentDidUpdate",value:function(Ee){(Ee.value!==this.props.value||!G()(Ee.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 Ee=this.textArea.selectionStart,xe=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ee,xe)}}catch(Ge){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(x.Component),$=re,ne=function(pe){Object(S.a)(we,pe);var Te=Object(D.a)(we);function we(Me){var Ee;Object(Q.a)(this,we),Ee=Te.call(this,Me),Ee.resizableTextArea=void 0,Ee.focus=function(){Ee.resizableTextArea.textArea.focus()},Ee.saveTextArea=function(Ge){Ee.resizableTextArea=Ge},Ee.handleChange=function(Ge){var je=Ee.props.onChange;Ee.setValue(Ge.target.value,function(){Ee.resizableTextArea.resizeTextarea()}),je&&je(Ge)},Ee.handleKeyDown=function(Ge){var je=Ee.props,We=je.onPressEnter,ze=je.onKeyDown;Ge.keyCode===13&&We&&We(Ge),ze&&ze(Ge)};var xe=typeof Me.value=="undefined"||Me.value===null?Me.defaultValue:Me.value;return Ee.state={value:xe},Ee}return Object(j.a)(we,[{key:"setValue",value:function(Ee,xe){"value"in this.props||this.setState({value:Ee},xe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return x.createElement($,Object(ue.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ee){return"value"in Ee?{value:Ee.value}:null}}]),we}(x.Component),he=Le.default=ne},Z8dc:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(nt,Le,F){"use strict";var ue=F("BoS7"),Q=F("Sdc0"),j=F("OaEy"),S=F("2fM7"),D=F("q1tI"),x=F.n(D),T=F("lOMy"),w=F.n(T),f=S.a.Option;Le.a=function(p){var u=p.onFontSizeChange,o=p.cmFontSize,i=p.cmCodeMode,l=p.onCodeModeChange,s=p.onTabToSpace,h=p.className,r=h===void 0?"":h,t=p.tabToSpace,n=p.children;return x.a.createElement("div",{className:"tpi-code-setting ".concat(r)},x.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),x.a.createElement("section",null,x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),x.a.createElement(S.a,{bordered:!1,size:"small",value:i,onChange:l},x.a.createElement(f,{value:"vs"},"\u767D\u8272\u80CC\u666F"),x.a.createElement(f,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),x.a.createElement(S.a,{bordered:!1,size:"small",value:o,onChange:u},x.a.createElement(f,{value:12},"12px"),x.a.createElement(f,{value:14},"14px"),x.a.createElement(f,{value:16},"16px"),x.a.createElement(f,{value:18},"18px"),x.a.createElement(f,{value:20},"20px"),x.a.createElement(f,{value:22},"22px"))),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"Tab\u8F6C\u6362"),x.a.createElement(Q.a,{checked:t,onChange:s}))),x.a.createElement("h3",null,"\u5FEB\u6377\u952E"),x.a.createElement("section",null,x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),x.a.createElement("span",null,"Ctrl + S")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),x.a.createElement("span",null,"F1 / Alt + F1")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),x.a.createElement("span",null,"Ctrl + ]/[")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),x.a.createElement("span",null,"Ctrl + Shift + \\")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),x.a.createElement("span",null,"Home")),x.a.createElement("div",{className:"file-item"},x.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),x.a.createElement("span",null,"End"))),n)}},ZW9T:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return C});var ue=F("k1fw"),Q=F("oBTY"),j=F("9og8"),S=F("miYZ"),D=F("tsqr"),x=F("rAM+"),T=F("tJVT"),w=F("PpiC"),f=F("WmNS"),p=F.n(f),u=F("q1tI"),o=F.n(u),i=F("bdgK");function l(d,_,O,A,P){var I=_.getWordUntilPosition(O),W={startLineNumber:O.lineNumber,endLineNumber:O.lineNumber,startColumn:I.startColumn,endColumn:I.endColumn},K=A.map(function(te){return{label:te,kind:d.languages.CompletionItemKind.Keyword,insertText:te,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:W}});return P.map(function(te){K.push(Object(ue.a)(Object(ue.a)({},te),{},{range:W}))}),K}var s=function(d){var _={label:"ifelse",kind:d.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet},O=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];d.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(W,K){var te=l(d,W,K,O,[_]);return{suggestions:te}}});var A=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];d.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(W,K){var te=[{label:"print",kind:d.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=l(d,W,K,A,te);return{suggestions:H}}});var P=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];d.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(W,K){var te=[_,{label:"main",kind:d.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:d.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=l(d,W,K,P,te);return{suggestions:H}}})},h="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",r=F("fjLI"),t=F("LvDl"),n=F("+ua5");function c(d){return/^\d+$/.test(d)?"".concat(d,"px"):d}function m(){}var v=!1,b={"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",Scala:"scale"};function E(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=d;if(Array.isArray(d)){for(var O=0;O0||Ae.target.offsetWidth>0)&&Ze.current.instance.layout()}}catch(ge){At.e(ge)}finally{At.f()}}),mt.observe(Be.current)),mt}function rt(){D.b.warn({content:decodeURIComponent(h),key:"monaco-editor-tip"})}var tt=function(){var bt=Ze.current.instance;if(I!=null&&bt&&Ce){var At=bt.getModel();At&&I!==At.getValue()&&(v=!0,At.setValue(I),bt.layout(),v=!1)}};Object(u.useEffect)(function(){try{var mt,bt=Ze.current.instance;Qe.current&&clearTimeout(Qe.current),Qe.current=setTimeout(function(){tt()},500),bt==null||((mt=bt.updateOptions)===null||mt===void 0)||mt.call(bt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(I.split(/\r\n|\r|\n/g).length))+3,5)})}catch(At){debugger}},[I,Ce,Ze.current]),Object(u.useEffect)(function(){try{if(q&&Ze.current&&Ze.current.instance){var mt=Ze.current.instance;mt.changeViewZones(function(At){var Xt=document.createElement("div");Xt.style.padding="10px 20px",Xt.style.width="calc(100% - 20px)",Xt.className="my-error-line-wrp",Xt.innerHTML=J,At.addZone({afterLineNumber:q||11,heightInLines:3,domNode:Xt})});var bt={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}};mt.addOverlayWidget(bt),mt.revealPositionInCenter({lineNumber:20,column:1})}}catch(At){debugger}},[q,Ze.current,Ce]),Object(u.useEffect)(function(){var mt;if((mt=Ze.current)!==null&&mt!==void 0&&mt.instance&&Ce&&ct){var bt=Ze.current.instance,At=bt.getModel();if(!At)return;var Xt=function(){var wt=[],Kt=[],Et=At.getAllDecorations(),Qt=Object(x.a)(Et),Vt;try{for(Qt.s();!(Vt=Qt.n()).done;){var ie=Vt.value;if(ie.options.className==="highlighted-line"){var N;wt.push(ie==null||((N=ie.range)===null||N===void 0)?void 0:N.startLineNumber),Kt.push(ie==null?void 0:ie.id)}}}catch(ae){Qt.e(ae)}finally{Qt.f()}At.deltaDecorations(Kt,[]);var B=At.getLineCount();!!be&&be<=B&&(bt.deltaDecorations([],[{range:new g.Range(be,1,be,At.getLineMaxColumn(be)),options:{isWholeLine:!0,className:"highlighted-line"}}]),bt.revealLineInCenter(be))};Xt();var Ae=function(){var wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Kt=[],Et=[],Qt=At.getAllDecorations(),Vt=Object(x.a)(Qt),ie;try{for(Vt.s();!(ie=Vt.n()).done;){var N=ie.value;if(N.options.linesDecorationsClassName==="breakpoints"){var B;Kt.push(N==null||((B=N.range)===null||B===void 0)?void 0:B.startLineNumber),Et.push(N==null?void 0:N.id)}}}catch(ae){Vt.e(ae)}finally{Vt.f()}if(wt)return{lines:Kt,ids:Et};Ie(Kt)},ge=function(){var ot=Object(j.a)(p.a.mark(function wt(Kt){var Et;return p.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Et={range:new g.Range(Kt,1,Kt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},Vt.next=3,At.deltaDecorations([],[Et]);case 3:Ae();case 4:case"end":return Vt.stop()}},wt)}));return function(Kt){return ot.apply(this,arguments)}}(),z=function(){var ot=Object(j.a)(p.a.mark(function wt(Kt){var Et,Qt,Vt,ie,N;return p.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:Et=[],Qt=bt.getLineDecorations(Kt),Vt=Object(x.a)(Qt);try{for(Vt.s();!(ie=Vt.n()).done;)N=ie.value,N.options.linesDecorationsClassName==="breakpoints"&&Et.push(N.id)}catch(fe){Vt.e(fe)}finally{Vt.f()}return ae.next=6,At.deltaDecorations(Et,[]);case 6:Ae();case 7:case"end":return ae.stop()}},wt)}));return function(Kt){return ot.apply(this,arguments)}}(),Z=function(wt){var Kt=bt.getLineDecorations(wt),Et=Object(x.a)(Kt),Qt;try{for(Et.s();!(Qt=Et.n()).done;){var Vt=Qt.value;if(Vt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(ie){Et.e(ie)}finally{Et.f()}return!1};if(!Object(t.isEqual)(ee,Ae(!0).lines)){At.deltaDecorations(Ae(!0).ids,[]);var oe=ee.map(function(ot){return{range:new g.Range(ot,1,ot,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});At.deltaDecorations([],oe)}var me=bt.onDidChangeModelContent(function(ot){var wt=bt.getPosition();if(wt){var Kt=wt.lineNumber;At.getLineContent(Kt).trim()===""?z(Kt):Z(Kt)&&(z(Kt),ge(Kt))}}),Re=bt.onMouseDown(function(ot){var wt,Kt,Et;if(ot.target.detail&&(wt=ot.target)!==null&&wt!==void 0&&(Kt=wt.element)!==null&&Kt!==void 0&&(Et=Kt.className)!==null&&Et!==void 0&&Et.includes("line-numbers")){var Qt=ot.target.position.lineNumber;if(At.getLineContent(Qt).trim()==="")return;Z(Qt)?z(Qt):ge(Qt)}}),Je=function(wt){var Kt={range:new g.Range(wt,1,wt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=bt.deltaDecorations(Xe.current,[Kt])},at=function(){Xe.current=bt.deltaDecorations(Xe.current,[])},kt=bt.onMouseMove(function(ot){var wt,Kt,Et;if(at(),ot.target.detail&&(wt=ot.target)!==null&&wt!==void 0&&(Kt=wt.element)!==null&&Kt!==void 0&&(Et=Kt.className)!==null&&Et!==void 0&&Et.includes("line-numbers")){var Qt=ot.target.position.lineNumber;if(At.getLineContent(Qt).trim()==="")return;Je(Qt)}}),jt=bt.onMouseLeave(function(){at()});return function(){me.dispose(),Re.dispose(),kt.dispose(),jt.dispose()}}},[Ze.current,Ce,ee,be,ct]);function xt(){var mt=Ze.current.instance;if(mt){var bt=mt.getSelection(),At=Ze.current.pastePos||{},Xt=new g.Range(At.startLineNumber||bt.endLineNumber,At.startColumn||bt.endColumn,At.endLineNumber||bt.endLineNumber,At.endColumn||bt.endColumn);setTimeout(function(){mt.executeEdits("",[{range:Xt,text:""}])},300)}}function Mt(mt){(window.navigator.platform.match("Mac")?mt.metaKey:mt.ctrlKey)&&mt.keyCode==83&&(mt.preventDefault(),Te())}var Bt=function(){if(Me&&Ze.current.instance){var bt=Ze.current.instance.getContentHeight();Ut(bt0||We.target.offsetWidth>0)&&Me.layout()}}catch(ze){Ge.e(ze)}finally{Ge.f()}}),Ee.observe(G.current)),Ee}Object(u.useEffect)(function(){return G.current&&F.e(27).then(F.t.bind(null,"M/lh",7)).then(function(Me){g=Me;var Ee=g.editor.createDiffEditor(G.current,Object(ue.a)(Object(ue.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},H),{},{wordWrap:!0}));ne(Ee);var xe=he(Ee);return function(){Ee.dispose();var Ge=Ee.getModel();Ge&&Ge.dispose(),xe.unobserve(G.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(u.useEffect)(function(){$&&$.setModel({original:g.editor.createModel(I,K),modified:g.editor.createModel(W,K)})},[I,W,K,$]);var pe=c(O),Te=c(P),we={width:pe,height:Te};return o.a.createElement("div",{className:"my-diff-editor",ref:G,style:we})}},ZpRC:function(nt,Le,F){"use strict";function ue(u){return typeof u=="object"&&u!=null&&u.nodeType===1}function Q(u,o){return(!o||u!=="hidden")&&u!=="visible"&&u!=="clip"}function j(u,o){if(u.clientHeighto||h>u&&r=o&&t>=i?h-u-l:r>o&&ti?r-o+s:0}var D=function(u,o){var i=window,l=o.scrollMode,s=o.block,h=o.inline,r=o.boundary,t=o.skipOverflowHiddenElements,n=typeof r=="function"?r:function(Ie){return Ie!==r};if(!ue(u))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,m=[],v=u;ue(v)&&n(v);){if((v=v.parentElement)===c){m.push(v);break}v!=null&&v===document.body&&j(v)&&!j(document.documentElement)||v!=null&&j(v,t)&&m.push(v)}for(var b=i.visualViewport?i.visualViewport.width:innerWidth,E=i.visualViewport?i.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,C=u.getBoundingClientRect(),d=C.height,_=C.width,O=C.top,A=C.right,P=C.bottom,I=C.left,W=s==="start"||s==="nearest"?O:s==="end"?P:O+d/2,K=h==="center"?I+_/2:h==="end"?A:I,te=[],H=0;H=0&&I>=0&&P<=E&&A<=b&&O>=ne&&P<=pe&&I>=Te&&A<=he)return te;var we=getComputedStyle(G),Me=parseInt(we.borderLeftWidth,10),Ee=parseInt(we.borderTopWidth,10),xe=parseInt(we.borderRightWidth,10),Ge=parseInt(we.borderBottomWidth,10),je=0,We=0,ze="offsetWidth"in G?G.offsetWidth-G.clientWidth-Me-xe:0,de="offsetHeight"in G?G.offsetHeight-G.clientHeight-Ee-Ge:0;if(c===G)je=s==="start"?W:s==="end"?W-E:s==="nearest"?S(y,y+E,E,Ee,Ge,y+W,y+W+d,d):W-E/2,We=h==="start"?K:h==="center"?K-b/2:h==="end"?K-b:S(g,g+b,b,Me,xe,g+K,g+K+_,_),je=Math.max(0,je+y),We=Math.max(0,We+g);else{je=s==="start"?W-ne-Ee:s==="end"?W-pe+Ge+de:s==="nearest"?S(ne,pe,re,Ee,Ge+de,W,W+d,d):W-(ne+re/2)+de/2,We=h==="start"?K-Te-Me:h==="center"?K-(Te+$/2)+ze/2:h==="end"?K-he+xe+ze:S(Te,he,$,Me,xe+ze,K,K+_,_);var le=G.scrollLeft,Oe=G.scrollTop;W+=Oe-(je=Math.max(0,Math.min(Oe+je,G.scrollHeight-re+de))),K+=le-(We=Math.max(0,Math.min(le+We,G.scrollWidth-$+ze)))}te.push({el:G,top:je,left:We})}return te};function x(u){return u===Object(u)&&Object.keys(u).length!==0}function T(u,o){o===void 0&&(o="auto");var i="scrollBehavior"in document.body.style;u.forEach(function(l){var s=l.el,h=l.top,r=l.left;s.scroll&&i?s.scroll({top:h,left:r,behavior:o}):(s.scrollTop=h,s.scrollLeft=r)})}function w(u){return u===!1?{block:"end",inline:"nearest"}:x(u)?u:{block:"start",inline:"nearest"}}function f(u,o){var i=!u.ownerDocument.documentElement.contains(u);if(x(o)&&typeof o.behavior=="function")return o.behavior(i?[]:D(u,o));if(i)return;var l=w(o);return T(D(u,l),l.behavior)}var p=Le.a=f},ZsLC:function(nt,Le,F){nt.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return S}),F.d(Le,"a",function(){return D});var ue=F("je13"),Q=F.n(ue),j=!1;function S(x,T){var w=Q.a.get("__ec");w||(w={}),w[x]=T,Q.a.set("__ec",w)}function D(x,T){var w=Q.a.get("__ec");return w?w[x]===void 0?T:w[x]:T}},bT9E:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return Q});var ue=F("VTBJ");function Q(j,S){var D=Object(ue.a)({},j);return Array.isArray(S)&&S.forEach(function(x){delete D[x]}),D}},bdLU:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return ue});var ue;(function(Q){Q[Q.NOMATCH=-1]="NOMATCH",Q[Q.OK=0]="OK",Q[Q.TIMEOUT=2]="TIMEOUT",Q[Q.PODFAILURE=3]="PODFAILURE",Q[Q.COMPILEFAILURE=4]="COMPILEFAILURE",Q[Q.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ue||(ue={}))},biw7:function(nt,Le,F){"use strict";var ue=F("q1tI"),Q=F.n(ue),j=ue.createContext(null);Le.a=j},c5Ni:function(nt,Le,F){},cDPC:function(nt,Le,F){"use strict";var ue=F("tJVT"),Q=F("q1tI"),j=F.n(Q),S=F("i3hx"),D=F.n(S);Le.a=function(x){var T=x.defaultX,w=T===void 0?"40%":T,f=x.leftChild,p=x.rightChild,u=x.className,o=x.hideResize,i=o===void 0?!1:o,l=Object(Q.useState)(w),s=Object(ue.a)(l,2),h=s[0],r=s[1],t=Object(Q.useRef)();function n(){t.current=!0}Object(Q.useEffect)(function(){function v(E){t.current&&r(E.pageX)}function b(){t.current=!1}return window.addEventListener("mousemove",v),window.addEventListener("mouseup",b),function(){window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",b)}},[]);var c=typeof h=="number"&&h!==.01?"".concat(h,"px"):w,m="calc(100% - ".concat(i?"0px":"4px"," - ").concat(c,")");return j.a.createElement("div",{className:"split-panel-container ".concat(u)},j.a.createElement("section",{style:{width:c,display:h===.01?"none":""}},f),j.a.createElement("section",{className:"resize-x-bar",onMouseDown:n},j.a.createElement("a",{className:"btn-resize"},j.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},j.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),j.a.createElement("section",{style:{width:m}},p))}},dejd:function(nt,Le,F){},dmUQ:function(nt,Le,F){"use strict";var ue=F("Ff2n"),Q=F("rePB"),j=F("1OyB"),S=F("vuIU"),D=F("Ji7U"),x=F("md7G"),T=F("foSv"),w=F("q1tI"),f=F.n(w),p=F("TSYQ"),u=F.n(p),o=F("4IlW");function i(d,_){var O=Object.keys(d);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(d);_&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(d,P).enumerable})),O.push.apply(O,A)}return O}function l(d){for(var _=1;_1?$-1:0),he=1;he<$;he++)ne[he-1]=arguments[he];H.apply(void 0,[K].concat(ne))}},P.onKeyUp=function(K){var te=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),te){for(var H=arguments.length,G=new Array(H>1?H-1:0),V=1;V=0)return parseInt(te.slice(te.indexOf("e-")+2),10);var H=0;return te.indexOf(".")>=0&&(H=te.length-te.indexOf(".")-1),H},P.getInputDisplayValue=function(K){var te=K||P.state,H=te.focused,G=te.inputValue,V=te.value,re;H?re=G:re=P.toPrecisionAsStep(V),re==null&&(re="");var $=P.formatWrapper(re);return b(P.props.decimalSeparator)&&($=$.toString().replace(".",P.props.decimalSeparator)),$},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(K){}},P.restoreByAfter=function(K){if(K===void 0)return!1;var te=P.input.value,H=te.lastIndexOf(K);if(H===-1)return!1;var G=P.cursorBefore.length;return P.lastKeyCode===o.a.DELETE&&P.cursorBefore.charAt(G-1)===K[0]?(P.fixCaret(G,G),!0):H+K.length===te.length?(P.fixCaret(H,H),!0):!1},P.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function(te,H){var G=K.substring(H);return P.restoreByAfter(G)})},P.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(K,te,H){P.pressingUpOrDown=!0,P.step("down",K,te,H)},P.up=function(K,te,H){P.pressingUpOrDown=!0,P.step("up",K,te,H)},P.saveInput=function(K){P.input=K};var I=A.value;I===void 0&&(I=A.defaultValue),P.state={focused:A.autoFocus};var W=P.getValidValue(P.toNumber(I));return P.state=l(l({},P.state),{},{inputValue:P.toPrecisionAsStep(W),value:W}),P}return Object(S.a)(O,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var I=this.props,W=I.value,K=I.onChange,te=I.max,H=I.min,G=this.state.focused;if(P){if(!E(P.value,W)||!E(P.max,te)||!E(P.min,H)){var V=G?W:this.getValidValue(W),re;this.pressingUpOrDown?re=V:this.inputting?re=this.rawInput:re=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:re})}var $="value"in this.props?W:this.state.value;"max"in this.props&&P.max!==te&&typeof $=="number"&&$>te&&K&&K(te),"min"in this.props&&P.min!==H&&typeof $=="number"&&$1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,K=parseFloat(P);return isNaN(K)?P:(KW&&(K=W),K)}},{key:"setValue",value:function(P,I){var W=this.props.precision,K=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),te=this.state.value,H=te===void 0?null:te,G=this.state.inputValue,V=G===void 0?null:G,re=typeof K=="number"?K.toFixed(W):"".concat(K),$=K!==H||re!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},I)):this.setState({value:K,inputValue:this.toPrecisionAsStep(P)},I),$&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(P){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,K=W.precision,te=W.step;if(b(K))return K;var H=this.getPrecision(I),G=this.getPrecision(te),V=this.getPrecision(P);return P?Math.max(V,H+G):H+G}},{key:"getPrecisionFactor",value:function(P){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(P,I);return Math.pow(10,W)}},{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(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var I=Math.abs(this.getMaxPrecision(P));return isNaN(I)?P.toString():Number(P).toFixed(I)}},{key:"toNumber",value:function(P){var I=this.props.precision,W=this.state.focused,K=P&&P.length>16&&W;return this.isNotCompleteNumber(P)||K?P:b(I)?Math.round(P*Math.pow(10,I))/Math.pow(10,I):Number(P)}},{key:"upStep",value:function(P,I){var W=this.props.step,K=this.getPrecisionFactor(P,I),te=Math.abs(this.getMaxPrecision(P,I)),H=((K*P+K*W*I)/K).toFixed(te);return this.toNumber(H)}},{key:"downStep",value:function(P,I){var W=this.props.step,K=this.getPrecisionFactor(P,I),te=Math.abs(this.getMaxPrecision(P,I)),H=((K*P-K*W*I)/K).toFixed(te);return this.toNumber(H)}},{key:"step",value:function(P,I){var W=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,te=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var H=this.props;if(H.disabled)return;var G=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(G))return;var V=this["".concat(P,"Step")](G,K),re=V>H.max||VH.max?V=H.max:V=ne),Xe=(ke||ke===0)&&(isNaN(ke)||Number(ke)<=he),Ke=Qe||K||te,Fe=Xe||K||te,Ue=u()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Q.a)({},"".concat(W,"-handler-up-disabled"),Ke)),_e=u()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Q.a)({},"".concat(W,"-handler-down-disabled"),Fe)),Ce=H?{onTouchStart:Ke?r:this.up,onTouchEnd:this.stop}:{onMouseDown:Ke?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ne=H?{onTouchStart:Fe?r:this.down,onTouchEnd:this.stop}:{onMouseDown:Fe?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return f.a.createElement("div",{className:He,style:pe,title:Te,onMouseEnter:we,onMouseLeave:Me,onMouseOver:Ee,onMouseOut:xe,onFocus:function(){return null},onBlur:function(){return null}},f.a.createElement("div",{className:"".concat(W,"-handler-wrap")},f.a.createElement("span",Object.assign({unselectable:"on"},Ce,{role:"button","aria-label":"Increase Value","aria-disabled":Ke,className:Ue}),V||f.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:t})),f.a.createElement("span",Object.assign({unselectable:"on"},Ne,{role:"button","aria-label":"Decrease Value","aria-disabled":Fe,className:_e}),re||f.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:t}))),f.a.createElement("div",{className:"".concat(W,"-input-wrap")},f.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":he,"aria-valuemax":ne,"aria-valuenow":ke,required:Ge,type:ze,placeholder:de,onPaste:q,onClick:je,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:We,autoComplete:G,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ze?this.onKeyDown:r,onKeyUp:Ze?this.onKeyUp:r,autoFocus:k,maxLength:ee,readOnly:te,disabled:K,max:ne,min:he,step:qe,name:U,title:Te,id:le,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ht),pattern:Ie,inputMode:Oe,onInput:Y},Be))))}}]),O}(f.a.Component);g.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:n,required:!1,autoComplete:"off"};var y=g,C=Le.a=y},fcSX:function(nt,Le,F){"use strict";var ue=F("Ff2n"),Q=F("1OyB"),j=F("vuIU"),S=F("Ji7U"),D=F("md7G"),x=F("foSv"),T=F("1W/9"),w=F("q1tI"),f=F("rePB"),p=F("JX7q"),u=F("TSYQ"),o=F.n(u),i=F("qx4F"),l=F("4IlW");function s(K){return Array.isArray(K)?K:[K]}var h={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(h).filter(function(K){if(typeof document=="undefined")return!1;var te=document.getElementsByTagName("html")[0];return K in(te?te.style:{})})[0],t=h[r];function n(K,te,H,G){K.addEventListener?K.addEventListener(te,H,G):K.attachEvent&&K.attachEvent("on".concat(te),H)}function c(K,te,H,G){K.removeEventListener?K.removeEventListener(te,H,G):K.attachEvent&&K.detachEvent("on".concat(te),H)}function m(K,te){var H=typeof K=="function"?K(te):K;return Array.isArray(H)?H.length===2?H:[H[0],H[1]]:[H]}var v=function(te){return!isNaN(parseFloat(te))&&isFinite(te)},b=!(typeof window!="undefined"&&window.document&&window.document.createElement),E=function K(te,H,G,V){if(!H||H===document||H instanceof Document)return!1;if(H===te.parentNode)return!0;var re=Math.max(Math.abs(G),Math.abs(V))===Math.abs(V),$=Math.max(Math.abs(G),Math.abs(V))===Math.abs(G),ne=H.scrollHeight-H.clientHeight,he=H.scrollWidth-H.clientWidth,pe=document.defaultView.getComputedStyle(H),Te=pe.overflowY==="auto"||pe.overflowY==="scroll",we=pe.overflowX==="auto"||pe.overflowX==="scroll",Me=ne&&Te,Ee=he&&we;return re&&(!Me||Me&&(H.scrollTop>=ne&&V<0||H.scrollTop<=0&&V>0))||$&&(!Ee||Ee&&(H.scrollLeft>=he&&G<0||H.scrollLeft<=0&&G>0))?K(te,H.parentNode,G,V):!1};function g(K){var te=y();return function(){var G=Object(x.a)(K),V;if(te){var re=Object(x.a)(this).constructor;V=Reflect.construct(G,arguments,re)}else V=G.apply(this,arguments);return Object(D.a)(this,V)}}function y(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(K){return!1}}var C={},d=function(K){Object(S.a)(H,K);var te=g(H);function H(G){var V;return Object(Q.a)(this,H),V=te.call(this,G),V.domFocus=function(){V.dom&&V.dom.focus()},V.removeStartHandler=function(re){if(re.touches.length>1)return;V.startPos={x:re.touches[0].clientX,y:re.touches[0].clientY}},V.removeMoveHandler=function(re){if(re.changedTouches.length>1)return;var $=re.currentTarget,ne=re.changedTouches[0].clientX-V.startPos.x,he=re.changedTouches[0].clientY-V.startPos.y;($===V.maskDom||$===V.handlerDom||$===V.contentDom&&E($,re.target,ne,he))&&re.cancelable&&re.preventDefault()},V.transitionEnd=function(re){var $=re.target;c($,t,V.transitionEnd),$.style.transition=""},V.onKeyDown=function(re){if(re.keyCode===l.a.ESC){var $=V.props.onClose;re.stopPropagation(),$&&$(re)}},V.onWrapperTransitionEnd=function(re){var $=V.props,ne=$.open,he=$.afterVisibleChange;re.target===V.contentWrapper&&re.propertyName.match(/transform$/)&&(V.dom.style.transition="",!ne&&V.getCurrentDrawerSome()&&(document.body.style.overflowX="",V.maskDom&&(V.maskDom.style.left="",V.maskDom.style.width="")),he&&he(!!ne))},V.openLevelTransition=function(){var re=V.props,$=re.open,ne=re.width,he=re.height,pe=V.getHorizontalBoolAndPlacementName(),Te=pe.isHorizontal,we=pe.placementName,Me=V.contentDom?V.contentDom.getBoundingClientRect()[Te?"width":"height"]:0,Ee=(Te?ne:he)||Me;V.setLevelAndScrolling($,we,Ee)},V.setLevelTransform=function(re,$,ne,he){var pe=V.props,Te=pe.placement,we=pe.levelMove,Me=pe.duration,Ee=pe.ease,xe=pe.showMask;V.levelDom.forEach(function(Ge){Ge.style.transition="transform ".concat(Me," ").concat(Ee),n(Ge,t,V.transitionEnd);var je=re?ne:0;if(we){var We=m(we,{target:Ge,open:re});je=re?We[0]:We[1]||0}var ze=typeof je=="number"?"".concat(je,"px"):je,de=Te==="left"||Te==="top"?ze:"-".concat(ze);de=xe&&Te==="right"&&he?"calc(".concat(de," + ").concat(he,"px)"):de,Ge.style.transform=je?"".concat($,"(").concat(de,")"):""})},V.setLevelAndScrolling=function(re,$,ne){var he=V.props.onChange;if(!b){var pe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(i.a)(!0):0;V.setLevelTransform(re,$,ne,pe),V.toggleScrollingToDrawerAndBody(pe)}he&&he(re)},V.toggleScrollingToDrawerAndBody=function(re){var $=V.props,ne=$.getOpenCount,he=$.getContainer,pe=$.showMask,Te=$.open,we=he&&he(),Me=ne&&ne();if(we&&we.parentNode===document.body&&pe){var Ee=["touchstart"],xe=[document.body,V.maskDom,V.handlerDom,V.contentDom];Te&&document.body.style.overflow!=="hidden"?(re&&V.addScrollingEffect(re),Me===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",xe.forEach(function(Ge,je){if(!Ge)return;n(Ge,Ee[je]||"touchmove",je?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(Me||(document.body.style.overflow=""),document.body.style.touchAction="",re&&V.remScrollingEffect(re),xe.forEach(function(Ge,je){if(!Ge)return;c(Ge,Ee[je]||"touchmove",je?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(re){var $=V.props,ne=$.placement,he=$.duration,pe=$.ease,Te=$.getOpenCount,we=$.switchScrollingEffect,Me=Te&&Te();Me===1&&we();var Ee="width ".concat(he," ").concat(pe),xe="transform ".concat(he," ").concat(pe);V.dom.style.transition="none";switch(ne){case"right":V.dom.style.transform="translateX(-".concat(re,"px)");break;case"top":case"bottom":V.dom.style.width="calc(100% - ".concat(re,"px)"),V.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(xe,",").concat(Ee),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(re){var $=V.props,ne=$.placement,he=$.duration,pe=$.ease,Te=$.getOpenCount,we=$.switchScrollingEffect,Me=Te&&Te();Me||we(!0),r&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var Ee,xe="width ".concat(he," ").concat(pe),Ge="transform ".concat(he," ").concat(pe);switch(ne){case"left":{V.dom.style.width="100%",xe="width 0s ".concat(pe," ").concat(he);break}case"right":{V.dom.style.transform="translateX(".concat(re,"px)"),V.dom.style.width="100%",xe="width 0s ".concat(pe," ").concat(he),V.maskDom&&(V.maskDom.style.left="-".concat(re,"px"),V.maskDom.style.width="calc(100% + ".concat(re,"px)"));break}case"top":case"bottom":{V.dom.style.width="calc(100% + ".concat(re,"px)"),V.dom.style.height="100%",V.dom.style.transform="translateZ(0)",Ee="height 0s ".concat(pe," ").concat(he);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(Ge,",").concat(Ee?"".concat(Ee,","):"").concat(xe),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(C).some(function(re){return C[re]})},V.getLevelDom=function(re){var $=re.level,ne=re.getContainer;if(b)return;var he=ne&&ne(),pe=he?he.parentNode:null;if(V.levelDom=[],$==="all"){var Te=pe?Array.prototype.slice.call(pe.children):[];Te.forEach(function(we){we.nodeName!=="SCRIPT"&&we.nodeName!=="STYLE"&&we.nodeName!=="LINK"&&we!==he&&V.levelDom.push(we)})}else $&&s($).forEach(function(we){document.querySelectorAll(we).forEach(function(Me){V.levelDom.push(Me)})})},V.getHorizontalBoolAndPlacementName=function(){var re=V.props.placement,$=re==="left"||re==="right",ne="translate".concat($?"X":"Y");return{isHorizontal:$,placementName:ne}},V.state={_self:Object(p.a)(V)},V}return Object(j.a)(H,[{key:"componentDidMount",value:function(){var V=this;if(!b){var re=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return re=!0,null}}))}catch(Te){}this.passive=re?{passive:!1}:!1}var $=this.props,ne=$.open,he=$.getContainer,pe=he&&he();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ne&&(pe&&pe.parentNode===document.body&&(C[this.drawerId]=ne),this.openLevelTransition(),this.forceUpdate(function(){V.domFocus()}))}},{key:"componentDidUpdate",value:function(V){var re=this.props,$=re.open,ne=re.getContainer,he=ne&&ne();$!==V.open&&($&&this.domFocus(),he&&he.parentNode===document.body&&(C[this.drawerId]=!!$),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,re=V.getOpenCount,$=V.open,ne=V.switchScrollingEffect,he=typeof re=="function"&&re();delete C[this.drawerId],$&&(this.setLevelTransform(!1),document.body.style.touchAction=""),he||(document.body.style.overflow="",ne(!0))}},{key:"render",value:function(){var V,re=this,$=this.props,ne=$.className,he=$.children,pe=$.style,Te=$.width,we=$.height,Me=$.defaultOpen,Ee=$.open,xe=$.prefixCls,Ge=$.placement,je=$.level,We=$.levelMove,ze=$.ease,de=$.duration,le=$.getContainer,Oe=$.handler,Ie=$.onChange,qe=$.afterVisibleChange,ee=$.showMask,k=$.maskClosable,U=$.maskStyle,q=$.onClose,Y=$.onHandleClick,J=$.keyboard,be=$.getOpenCount,ke=$.switchScrollingEffect,ct=Object(ue.a)($,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),He=this.dom?Ee:!1,Be=o()(xe,(V={},Object(f.a)(V,"".concat(xe,"-").concat(Ge),!0),Object(f.a)(V,"".concat(xe,"-open"),He),Object(f.a)(V,ne||"",!!ne),Object(f.a)(V,"no-mask",!ee),V)),Ze=this.getHorizontalBoolAndPlacementName(),ht=Ze.placementName,Qe=Ge==="left"||Ge==="top"?"-100%":"100%",Xe=He?"":"".concat(ht,"(").concat(Qe,")"),Ke=Oe&&w.cloneElement(Oe,{onClick:function(Ue){Oe.props.onClick&&Oe.props.onClick(),Y&&Y(Ue)},ref:function(Ue){re.handlerDom=Ue}});return w.createElement("div",Object.assign({},ct,{tabIndex:-1,className:Be,style:pe,ref:function(Ue){re.dom=Ue},onKeyDown:He&&J?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),ee&&w.createElement("div",{className:"".concat(xe,"-mask"),onClick:k?q:void 0,style:U,ref:function(Ue){re.maskDom=Ue}}),w.createElement("div",{className:"".concat(xe,"-content-wrapper"),style:{transform:Xe,msTransform:Xe,width:v(Te)?"".concat(Te,"px"):Te,height:v(we)?"".concat(we,"px"):we},ref:function(Ue){re.contentWrapper=Ue}},w.createElement("div",{className:"".concat(xe,"-content"),ref:function(Ue){re.contentDom=Ue},onTouchStart:He&&ee?this.removeStartHandler:void 0,onTouchMove:He&&ee?this.removeMoveHandler:void 0},he),Ke))}}],[{key:"getDerivedStateFromProps",value:function(V,re){var $=re.prevProps,ne=re._self,he={prevProps:V};if($!==void 0){var pe=V.placement,Te=V.level;pe!==$.placement&&(ne.contentDom=null),Te!==$.level&&ne.getLevelDom(V)}return he}}]),H}(w.Component);d.defaultProps={switchScrollingEffect:function(){}};var _=d;function O(K){var te=A();return function(){var G=Object(x.a)(K),V;if(te){var re=Object(x.a)(this).constructor;V=Reflect.construct(G,arguments,re)}else V=G.apply(this,arguments);return Object(D.a)(this,V)}}function A(){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(K){return!1}}var P=function(K){Object(S.a)(H,K);var te=O(H);function H(G){var V;Object(Q.a)(this,H),V=te.call(this,G),V.onHandleClick=function($){var ne=V.props,he=ne.onHandleClick,pe=ne.open;if(he&&he($),typeof pe=="undefined"){var Te=V.state.open;V.setState({open:!Te})}},V.onClose=function($){var ne=V.props,he=ne.onClose,pe=ne.open;he&&he($),typeof pe=="undefined"&&V.setState({open:!1})};var re=typeof G.open!="undefined"?G.open:!!G.defaultOpen;return V.state={open:re},"onMaskClick"in G&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),V}return Object(j.a)(H,[{key:"render",value:function(){var V=this,re=this.props,$=re.defaultOpen,ne=re.getContainer,he=re.wrapperClassName,pe=re.forceRender,Te=re.handler,we=Object(ue.a)(re,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Me=this.state.open;if(!ne)return w.createElement("div",{className:he,ref:function(Ge){V.dom=Ge}},w.createElement(_,Object.assign({},we,{open:Me,handler:Te,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var Ee=!!Te||pe;return w.createElement(T.a,{visible:Me,forceRender:Ee,getContainer:ne,wrapperClassName:he},function(xe){var Ge=xe.visible,je=xe.afterClose,We=Object(ue.a)(xe,["visible","afterClose"]);return w.createElement(_,Object.assign({},we,We,{open:Ge!==void 0?Ge:Me,afterVisibleChange:je!==void 0?je:we.afterVisibleChange,handler:Te,onClose:V.onClose,onHandleClick:V.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(V,re){var $=re.prevProps,ne={prevProps:V};return typeof $!="undefined"&&V.open!==$.open&&(ne.open=V.open),ne}}]),H}(w.Component);P.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:w.createElement("div",{className:"drawer-handle"},w.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var I=P,W=Le.a=I},fcyK:function(nt,Le,F){},fjLI:function(nt,Le,F){"use strict";F.d(Le,"e",function(){return p}),F.d(Le,"a",function(){return u}),F.d(Le,"c",function(){return o}),F.d(Le,"d",function(){return l}),F.d(Le,"b",function(){return s});var ue=F("8HAY"),Q=F("Cg/j"),j=F("T8No"),S=F("nnTU"),D=F("MI8n"),x=function(){var h=function(r,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,c){n.__proto__=c}||function(n,c){for(var m in c)c.hasOwnProperty(m)&&(n[m]=c[m])},h(r,t)};return function(r,t){h(r,t);function n(){this.constructor=r}r.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),T=function(h,r,t,n){var c=arguments.length,m=c<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,t):n,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(h,r,t,n);else for(var b=h.length-1;b>=0;b--)(v=h[b])&&(m=(c<3?v(m):c>3?v(r,t,m):v(r,t))||m);return c>3&&m&&Object.defineProperty(r,t,m),m},w=function(h,r){return function(t,n){r(t,n,h)}},f=function(){for(var h=0,r=0,t=arguments.length;r=0&&(c.splice(m,1),n._onDidChangeMenu.fire(r))}}},h.prototype.getMenuItems=function(r){var t=(this._menuItems.get(r)||[]).slice(0);return r===0&&this._appendImplicitItems(t),t},h.prototype._appendImplicitItems=function(r){for(var t=new Set,n=r.filter(function(g){return p(g)}),c=0,m=n;c0&&!this.paused&&!this.ended&&this.readyState>2}});function h(n,c){return n-c}function r(n){n.sort(h);for(var c=0,m=0;m1&&arguments[1]!==void 0?arguments[1]:!1,Ke={point:V.current.currentTime};k?(Ke.log_id=k,Ke.watch_duration=r(ke),Ke.total_duration=qe):(C?(Ke.video_id=parseInt(E,10),Ke.course_id=C):Ke.video_id=E,Ke.duration=Ie,Ke.device=de),Xe&&(Ke.ed="1");function Fe(){return Ue.apply(this,arguments)}function Ue(){return Ue=Object(j.a)(D.a.mark(function _e(){var Ce;return D.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return J=!0,De.next=3,g(Ke);case 3:Ce=De.sent,k=Ce,J=!1,Qe&&Qe();case 7:case"end":return De.stop()}},_e)})),Ue.apply(this,arguments)}Fe()},[E,C]);Object(x.useEffect)(function(){Q.b.destroy();var Qe=null;return w.a.isSupported&&G&&v&&(v==null?void 0:v.indexOf(".m3u8"))<0?(Qe=w.a.createPlayer({type:"flv",volume:.8,cors:!0,url:v,muted:!1}),V.current&&(Qe.attachMediaElement(V.current),Qe.load())):V.current.setAttribute("src",v),Be(),function(){Qe&&(Qe.unload(),Qe.pause(),Qe.destroy(),Qe=null)}},[V,G,v]);function He(){V.current.paused?(ne.current.style.display="none",he.current.style.display="block"):(ne.current.style.display="block",he.current.style.display="none")}function Be(){xe.current.style.display="none",je.current.style.display="none",Ge.current.style.display="none",V.current.muted||V.current.volume===0?xe.current.style.display="block":V.current.volume>0&&V.current.volume<=.5?je.current.style.display="block":Ge.current.style.display="block"}Object(x.useEffect)(function(){var Qe=document.getElementById("play"),Xe=document.querySelectorAll(".playback-icons use");function Ke(){P(),d&&!le.current&&(V.current.currentTime=d),le.current=!0,ke.push(V.current.currentTime),U||(U=!0,b&&ct())}function Fe(){return Ue.apply(this,arguments)}function Ue(){return Ue=Object(j.a)(D.a.mark(function lt(){return D.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:He(),ke.push(V.current.currentTime),b&&ct(function(){k=null,ee=0,U=!1,J=!1,be=!1,ke=[],qe=0,Y=1},!0);case 3:case"end":return ut.stop()}},lt)})),Ue.apply(this,arguments)}function _e(){pe.current.value=Math.floor(V.current.currentTime),Te.current.value=Math.floor(V.current.currentTime)}function Ce(){var lt=s(Math.round(V.current.currentTime));Me.current.innerText="".concat(lt.minutes,":").concat(lt.seconds),Me.current.setAttribute("datetime","".concat(lt.minutes,"m ").concat(lt.seconds,"s"))}function Ne(){var lt=Math.round(V.current.duration);pe.current.setAttribute("max",lt),Te.current.setAttribute("max",lt);var pt=s(lt);we.current.innerText="".concat(pt.minutes,":").concat(pt.seconds),we.current.setAttribute("datetime","".concat(pt.minutes,"m ").concat(pt.seconds,"s"))}function De(){var lt=Math.round(V.current.duration);pe.current.setAttribute("max",lt),Te.current.setAttribute("max",lt);var pt=s(lt);we.current.innerText="".concat(pt.minutes,":").concat(pt.seconds),we.current.setAttribute("datetime","".concat(pt.minutes,"m ").concat(pt.seconds,"s")),_e(),Ce();var ut=re.current.getBoundingClientRect(),Pe=ut.width,Ve=ut.height,yt=ut.x,st=ut.y;if(yt<0||st<0||!Pe)return;if(!be){var Nt=V.current.currentTime,Ut=Nt-ee;Math.abs(Ut)<10?(qe+=Math.abs(Ut),ee=Nt,J||qe-Y*q>=0&&(Y++,ke.push(ee),b&&ct())):(ee=Nt,b&&ct())}}function rt(){be=!0}function tt(){V.current.playing&&ke.push(V.current.currentTime,ee),ee=V.current.currentTime,be=!1}function xt(){Ie=V.current.duration,Ie<=20&&(q=Ie/3),V.current.addEventListener("play",Ke)}function Mt(lt){lt.preventDefault(),Object(o.a)()?(V.current.style.width="100%",V.current.style.height="100%"):V.current.style.cssText=""}function Bt(){O()}function It(lt){var pt=lt.target.dataset.seek?lt.target.dataset.seek:lt.target.value;V.current.currentTime=pt,Te.current.value=pt,pe.current.value=pt}function Dt(lt){var pt=Math.round(lt.offsetX/lt.target.clientWidth*parseInt(lt.target.getAttribute("max"),10));pe.current.setAttribute("data-seek",pt);var ut=s(pt);Ee.current.textContent="".concat(ut.minutes,":").concat(ut.seconds);var Pe=V.current.getBoundingClientRect();Ee.current.style.left="".concat(lt.pageX-Pe.left,"px")}return $.current.addEventListener(Object(o.c)(),Mt),V.current.addEventListener("canplay",xt),V.current.addEventListener("ended",Fe),V.current.addEventListener("seeking",rt),V.current.addEventListener("seeked",tt),V.current.addEventListener("loadedmetadata",Ne),pe.current.addEventListener("mousemove",Dt),pe.current.addEventListener("input",It),V.current.addEventListener("timeupdate",De),V.current.addEventListener("pause",Bt),V.current.addEventListener("volumechange",Be),function(){V.current.removeEventListener("canplay",xt),V.current.removeEventListener("play",Ke),V.current.removeEventListener("ended",Fe),V.current.removeEventListener("seeking",rt),V.current.removeEventListener("seeked",tt),pe.current.removeEventListener("mousemove",Dt),pe.current.removeEventListener("input",It),V.current.removeEventListener("timeupdate",De),V.current.removeEventListener("pause",Bt),V.current.removeEventListener("loadedmetadata",Ne),V.current.removeEventListener("volumechange",Be),V.current.playing&&(ke.push(ee,V.current.currentTime),b&&ct())}},[V,v]),Object(x.useEffect)(function(){if(V.current.onended=function(){W(V)},V.current.oncontextmenu=function(){return!1},(v==null?void 0:v.indexOf(".m3u8"))>-1){if(V.current.canPlayType("application/vnd.apple.mpegurl"))V.current.src=v;else if(p.a.isSupported()){var Qe=new p.a;Qe.loadSource(v),Qe.attachMedia(V.current)}}},[v]),Object(x.useEffect)(function(){V.current.playbackRate=te},[te]);var Ze=function(){V.current.paused||V.current.ended?V.current.play():V.current.pause(),He()};function ht(){V.current.muted=!V.current.muted,V.current.muted?(We.current.setAttribute("data-volume",volume.value),We.current.value=0):We.current.value=We.current.dataset.volume}return T.a.createElement("div",{style:{position:"relative"},ref:$},T.a.createElement("div",{ref:re,className:"".concat(l.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(l.a.animate__loop)},Oe?Oe.login:" "),T.a.createElement("div",{className:l.a.container},T.a.createElement("div",{className:l.a["video-container"],id:"video-container"},T.a.createElement("div",{className:l.a["playback-animation"],id:"playback-animation"},T.a.createElement("svg",{className:l.a["playback-icons"]},T.a.createElement("use",{className:"hidden",href:"#play-icon"}),T.a.createElement("use",{href:"#pause"}))),T.a.createElement("video",{className:l.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:V,autoPlay:!1}),T.a.createElement("div",{className:"".concat(l.a["video-controls"]," "),id:"video-controls"},T.a.createElement("div",{className:l.a["bottom-controls"]},T.a.createElement("div",{className:l.a["left-controls"]},T.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ze},T.a.createElement("svg",{className:l.a["playback-icons"]},T.a.createElement("use",{ref:he,href:"#play-icon"}),T.a.createElement("use",{ref:ne,style:{display:"none"},href:"#pause"}))),T.a.createElement("div",{className:l.a.time},T.a.createElement("time",{id:"time-elapsed",ref:Me},"00:00"),T.a.createElement("span",null," / "),T.a.createElement("time",{id:"duration",ref:we},"00:00"))),T.a.createElement("div",{className:l.a["right-controls"]},T.a.createElement("div",{className:l.a["volume-controls"]},T.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l.a["volume-button"],id:"volume-button",onClick:ht},T.a.createElement("svg",null,T.a.createElement("use",{ref:xe,href:"#volume-mute"}),T.a.createElement("use",{ref:je,href:"#volume-low"}),T.a.createElement("use",{ref:Ge,href:"#volume-high"}))),T.a.createElement("input",{className:l.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:We,style:{display:"none"},onClick:Be})),T.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l.a["fullscreen-button"],onClick:function(){Object(o.a)()?Object(o.b)():Object(o.d)($.current)}},T.a.createElement("svg",null,T.a.createElement("use",{href:"#fullscreen"}),T.a.createElement("use",{href:"#fullscreen-exit",className:"hidden"}))))),T.a.createElement("div",{className:l.a["video-progress"]},T.a.createElement("progress",{ref:Te,value:"0",min:"0"}),T.a.createElement("input",{className:l.a.seek,ref:pe,value:"0",min:"0",type:"range",step:"1"}),T.a.createElement("div",{className:l.a["seek-tooltip"],ref:Ee,id:"seek-tooltip"},"00:00"))))),T.a.createElement("svg",{style:{display:"none"}},T.a.createElement("defs",null,T.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),T.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),T.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),T.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),T.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),T.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),T.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),T.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},T.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(nt,Le,F){},je13:function(nt,Le,F){var ue=F("5nXd"),Q=F("gRFJ"),j=[F("uQRt")];nt.exports=ue.createStore(Q,j)},kSUc:function(nt,Le,F){},"kaH+":function(nt,Le,F){"use strict";var ue=F("+L6B"),Q=F("2/Rp"),j=F("tJVT"),S=F("q1tI"),D=F.n(S),x=F("XFxt"),T=F.n(x),w=F("dhSg"),f=F("rLCj"),p=F("dF/Y"),u=F("4i/N");Le.a=function(){var o=Object(S.useState)(""),i=Object(j.a)(o,2),l=i[0],s=i[1],h=Object(S.useState)(0),r=Object(j.a)(h,2),t=r[0],n=r[1],c=Object(S.useRef)("");Object(S.useEffect)(function(){var E=w.a.subscribe("preview-image",function(g){s(g),document.body.style.overflow="hidden"});return E},[]),Object(S.useEffect)(function(){return document.addEventListener("keydown",m),function(){document.removeEventListener("keydown",m)}},[]),Object(S.useEffect)(function(){c.current=l},[l]);function m(E){E.keyCode==27&&c.current&&v()}function v(){document.body.style.overflow="auto",s("")}function b(){n(t+90)}return D.a.createElement(S.Fragment,null,l?D.a.createElement("div",{className:T.a["image-preview-container"]},D.a.createElement("div",{className:T.a["button-group"]},D.a.createElement(Q.a,{onClick:b},"\u65CB\u8F6C",D.a.createElement(f.a,null)),D.a.createElement(Q.a,{href:l},"\u4E0B\u8F7D",D.a.createElement(p.a,null)),D.a.createElement(Q.a,{onClick:v},"\u5173\u95ED",D.a.createElement(u.a,null))),D.a.createElement("div",{className:T.a["preview-wrp-group"]},D.a.createElement("img",{className:T.a["image-preview"],src:l,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(t,"deg)")}}))):null)}},kovY:function(nt,Le,F){nt.exports=F.p+"static/e.eabfa286.svg"},lOMy:function(nt,Le,F){},lZu9:function(nt,Le,F){(function(ue){ue(F("VrN/"),F("1eCo"),F("8EBN"))})(function(ue){"use strict";ue.defineMode("markdown",function(Q,j){var S=ue.getMode(Q,"text/html"),D=S.name=="null";function x(H){if(ue.findModeByName){var G=ue.findModeByName(H);G&&(H=G.mime||G.mimes[0])}var V=ue.getMode(Q,H);return V.name=="null"?null:V}j.highlightFormatting===void 0&&(j.highlightFormatting=!1),j.maxBlockquoteDepth===void 0&&(j.maxBlockquoteDepth=0),j.taskLists===void 0&&(j.taskLists=!1),j.strikethrough===void 0&&(j.strikethrough=!1),j.emoji===void 0&&(j.emoji=!1),j.fencedCodeBlockHighlighting===void 0&&(j.fencedCodeBlockHighlighting=!0),j.fencedCodeBlockDefaultMode===void 0&&(j.fencedCodeBlockDefaultMode="text/plain"),j.xml===void 0&&(j.xml=!0),j.tokenTypeOverrides===void 0&&(j.tokenTypeOverrides={});var T={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 w in T)T.hasOwnProperty(w)&&j.tokenTypeOverrides[w]&&(T[w]=j.tokenTypeOverrides[w]);var f=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,o=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,i=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,t=" ";function n(H,G,V){return G.f=G.inline=V,V(H,G)}function c(H,G,V){return G.f=G.block=V,V(H,G)}function m(H){return!H||!/\S/.test(H.string)}function v(H){if(H.linkTitle=!1,H.linkHref=!1,H.linkText=!1,H.em=!1,H.strong=!1,H.strikethrough=!1,H.quote=0,H.indentedCode=!1,H.f==E){var G=D;if(!G){var V=ue.innerMode(S,H.htmlState);G=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}G&&(H.f=d,H.block=b,H.htmlState=null)}return H.trailingSpace=0,H.trailingSpaceNewLine=!1,H.prevLine=H.thisLine,H.thisLine={stream:null},null}function b(H,G){var V=H.column()===G.indentation,re=m(G.prevLine.stream),$=G.indentedCode,ne=G.prevLine.hr,he=G.list!==!1,pe=(G.listStack[G.listStack.length-1]||0)+3;G.indentedCode=!1;var Te=G.indentation;if(G.indentationDiff===null&&(G.indentationDiff=G.indentation,he)){for(G.list=null;Te=4&&($||G.prevLine.fencedCodeEnd||G.prevLine.header||re))return H.skipToEnd(),G.indentedCode=!0,T.code;if(H.eatSpace())return null;if(V&&G.indentation<=pe&&(Ee=H.match(o))&&Ee[1].length<=6)return G.quote=0,G.header=Ee[1].length,G.thisLine.header=!0,j.highlightFormatting&&(G.formatting="header"),G.f=G.inline,y(G);if(G.indentation<=pe&&H.eat(">"))return G.quote=V?1:G.quote+1,j.highlightFormatting&&(G.formatting="quote"),H.eatSpace(),y(G);if(!Me&&!G.setext&&V&&G.indentation<=pe&&(Ee=H.match(p))){var xe=Ee[1]?"ol":"ul";return G.indentation=Te+H.current().length,G.list=!0,G.quote=0,G.listStack.push(G.indentation),G.em=!1,G.strong=!1,G.code=!1,G.strikethrough=!1,j.taskLists&&H.match(u,!1)&&(G.taskList=!0),G.f=G.inline,j.highlightFormatting&&(G.formatting=["list","list-"+xe]),y(G)}else{if(V&&G.indentation<=pe&&(Ee=H.match(s,!0)))return G.quote=0,G.fencedEndRE=new RegExp(Ee[1]+"+ *$"),G.localMode=j.fencedCodeBlockHighlighting&&x(Ee[2]||j.fencedCodeBlockDefaultMode),G.localMode&&(G.localState=ue.startState(G.localMode)),G.f=G.block=g,j.highlightFormatting&&(G.formatting="code-block"),G.code=-1,y(G);if(G.setext||(!we||!he)&&!G.quote&&G.list===!1&&!G.code&&!Me&&!h.test(H.string)&&(Ee=H.lookAhead(1))&&(Ee=Ee.match(i)))return G.setext?(G.header=G.setext,G.setext=0,H.skipToEnd(),j.highlightFormatting&&(G.formatting="header")):(G.header=Ee[0].charAt(0)=="="?1:2,G.setext=G.header),G.thisLine.header=!0,G.f=G.inline,y(G);if(Me)return H.skipToEnd(),G.hr=!0,G.thisLine.hr=!0,T.hr;if(H.peek()==="[")return n(H,G,I)}return n(H,G,G.inline)}function E(H,G){var V=S.token(H,G.htmlState);if(!D){var re=ue.innerMode(S,G.htmlState);(re.mode.name=="xml"&&re.state.tagStart===null&&!re.state.context&&re.state.tokenize.isInText||G.md_inside&&H.current().indexOf(">")>-1)&&(G.f=d,G.block=b,G.htmlState=null)}return V}function g(H,G){var V=G.listStack[G.listStack.length-1]||0,re=G.indentation=H.quote?G.push(T.formatting+"-"+H.formatting[V]+"-"+H.quote):G.push("error"))}if(H.taskOpen)return G.push("meta"),G.length?G.join(" "):null;if(H.taskClosed)return G.push("property"),G.length?G.join(" "):null;if(H.linkHref?G.push(T.linkHref,"url"):(H.strong&&G.push(T.strong),H.em&&G.push(T.em),H.strikethrough&&G.push(T.strikethrough),H.emoji&&G.push(T.emoji),H.linkText&&G.push(T.linkText),H.code&&G.push(T.code),H.image&&G.push(T.image),H.imageAltText&&G.push(T.imageAltText,"link"),H.imageMarker&&G.push(T.imageMarker)),H.header&&G.push(T.header,T.header+"-"+H.header),H.quote&&(G.push(T.quote),!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=H.quote?G.push(T.quote+"-"+H.quote):G.push(T.quote+"-"+j.maxBlockquoteDepth)),H.list!==!1){var re=(H.listStack.length-1)%3;re?re===1?G.push(T.list2):G.push(T.list3):G.push(T.list1)}return H.trailingSpaceNewLine?G.push("trailing-space-new-line"):H.trailingSpace&&G.push("trailing-space-"+(H.trailingSpace%2?"a":"b")),G.length?G.join(" "):null}function C(H,G){return H.match(l,!0)?y(G):void 0}function d(H,G){var V=G.text(H,G);if(typeof V!="undefined")return V;if(G.list)return G.list=null,y(G);if(G.taskList){var re=H.match(u,!0)[1]===" ";return re?G.taskOpen=!0:G.taskClosed=!0,j.highlightFormatting&&(G.formatting="task"),G.taskList=!1,y(G)}if(G.taskOpen=!1,G.taskClosed=!1,G.header&&H.match(/^#+$/,!0))return j.highlightFormatting&&(G.formatting="header"),y(G);var $=H.next();if(G.linkTitle){G.linkTitle=!1;var ne=$;$==="("&&(ne=")"),ne=(ne+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var he="^\\s*(?:[^"+ne+"\\\\]+|\\\\\\\\|\\\\.)"+ne;if(H.match(new RegExp(he),!0))return T.linkHref}if($==="`"){var pe=G.formatting;j.highlightFormatting&&(G.formatting="code"),H.eatWhile("`");var Te=H.current().length;if(G.code==0&&(!G.quote||Te==1))return G.code=Te,y(G);if(Te==G.code){var we=y(G);return G.code=0,we}else return G.formatting=pe,y(G)}else if(G.code)return y(G);if($==="\\"&&(H.next(),j.highlightFormatting)){var Me=y(G),Ee=T.formatting+"-escape";return Me?Me+" "+Ee:Ee}if($==="!"&&H.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return G.imageMarker=!0,G.image=!0,j.highlightFormatting&&(G.formatting="image"),y(G);if($==="["&&G.imageMarker&&H.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return G.imageMarker=!1,G.imageAltText=!0,j.highlightFormatting&&(G.formatting="image"),y(G);if($==="]"&&G.imageAltText){j.highlightFormatting&&(G.formatting="image");var Me=y(G);return G.imageAltText=!1,G.image=!1,G.inline=G.f=O,Me}if($==="["&&!G.image)return G.linkText&&H.match(/^.*?\]/)||(G.linkText=!0,j.highlightFormatting&&(G.formatting="link")),y(G);if($==="]"&&G.linkText){j.highlightFormatting&&(G.formatting="link");var Me=y(G);return G.linkText=!1,G.inline=G.f=H.match(/\(.*?\)| ?\[.*?\]/,!1)?O:d,Me}if($==="<"&&H.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){G.f=G.inline=_,j.highlightFormatting&&(G.formatting="link");var Me=y(G);return Me?Me+=" ":Me="",Me+T.linkInline}if($==="<"&&H.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){G.f=G.inline=_,j.highlightFormatting&&(G.formatting="link");var Me=y(G);return Me?Me+=" ":Me="",Me+T.linkEmail}if(j.xml&&$==="<"&&H.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var xe=H.string.indexOf(">",H.pos);if(xe!=-1){var Ge=H.string.substring(H.start,xe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ge)&&(G.md_inside=!0)}return H.backUp(1),G.htmlState=ue.startState(S),c(H,G,E)}if(j.xml&&$==="<"&&H.match(/^\/\w*?>/))return G.md_inside=!1,"tag";if($==="*"||$==="_"){for(var je=1,We=H.pos==1?" ":H.string.charAt(H.pos-2);je<3&&H.eat($);)je++;var ze=H.peek()||" ",de=!/\s/.test(ze)&&(!r.test(ze)||/\s/.test(We)||r.test(We)),le=!/\s/.test(We)&&(!r.test(We)||/\s/.test(ze)||r.test(ze)),Oe=null,Ie=null;if(je%2&&(!G.em&&de&&($==="*"||!le||r.test(We))?Oe=!0:G.em==$&&le&&($==="*"||!de||r.test(ze))&&(Oe=!1)),je>1&&(!G.strong&&de&&($==="*"||!le||r.test(We))?Ie=!0:G.strong==$&&le&&($==="*"||!de||r.test(ze))&&(Ie=!1)),Ie!=null||Oe!=null){j.highlightFormatting&&(G.formatting=Oe==null?"strong":Ie==null?"em":"strong em"),Oe===!0&&(G.em=$),Ie===!0&&(G.strong=$);var we=y(G);return Oe===!1&&(G.em=!1),Ie===!1&&(G.strong=!1),we}}else if($===" "&&(H.eat("*")||H.eat("_"))){if(H.peek()===" ")return y(G);H.backUp(1)}if(j.strikethrough){if($==="~"&&H.eatWhile($)){if(G.strikethrough){j.highlightFormatting&&(G.formatting="strikethrough");var we=y(G);return G.strikethrough=!1,we}else if(H.match(/^[^\s]/,!1))return G.strikethrough=!0,j.highlightFormatting&&(G.formatting="strikethrough"),y(G)}else if($===" "&&H.match(/^~~/,!0)){if(H.peek()===" ")return y(G);H.backUp(2)}}if(j.emoji&&$===":"&&H.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){G.emoji=!0,j.highlightFormatting&&(G.formatting="emoji");var qe=y(G);return G.emoji=!1,qe}return $===" "&&(H.match(/^ +$/,!1)?G.trailingSpace++:G.trailingSpace&&(G.trailingSpaceNewLine=!0)),y(G)}function _(H,G){var V=H.next();if(V===">"){G.f=G.inline=d,j.highlightFormatting&&(G.formatting="link");var re=y(G);return re?re+=" ":re="",re+T.linkInline}return H.match(/^[^>]+/,!0),T.linkInline}function O(H,G){if(H.eatSpace())return null;var V=H.next();return V==="("||V==="["?(G.f=G.inline=P(V==="("?")":"]"),j.highlightFormatting&&(G.formatting="link-string"),G.linkHref=!0,y(G)):"error"}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(H){return function(G,V){var re=G.next();if(re===H){V.f=V.inline=d,j.highlightFormatting&&(V.formatting="link-string");var $=y(V);return V.linkHref=!1,$}return G.match(A[H]),V.linkHref=!0,y(V)}}function I(H,G){return H.match(/^([^\]\\]|\\.)*\]:/,!1)?(G.f=W,H.next(),j.highlightFormatting&&(G.formatting="link"),G.linkText=!0,y(G)):n(H,G,d)}function W(H,G){if(H.match(/^\]:/,!0)){G.f=G.inline=K,j.highlightFormatting&&(G.formatting="link");var V=y(G);return G.linkText=!1,V}return H.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function K(H,G){return H.eatSpace()?null:(H.match(/^[^\s]+/,!0),H.peek()===void 0?G.linkTitle=!0:H.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),G.f=G.inline=d,T.linkHref+" url")}var te={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:d,text:C,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(H){return{f:H.f,prevLine:H.prevLine,thisLine:H.thisLine,block:H.block,htmlState:H.htmlState&&ue.copyState(S,H.htmlState),indentation:H.indentation,localMode:H.localMode,localState:H.localMode?ue.copyState(H.localMode,H.localState):null,inline:H.inline,text:H.text,formatting:!1,linkText:H.linkText,linkTitle:H.linkTitle,linkHref:H.linkHref,code:H.code,em:H.em,strong:H.strong,strikethrough:H.strikethrough,emoji:H.emoji,header:H.header,setext:H.setext,hr:H.hr,taskList:H.taskList,list:H.list,listStack:H.listStack.slice(0),quote:H.quote,indentedCode:H.indentedCode,trailingSpace:H.trailingSpace,trailingSpaceNewLine:H.trailingSpaceNewLine,md_inside:H.md_inside,fencedEndRE:H.fencedEndRE}},token:function(H,G){if(G.formatting=!1,H!=G.thisLine.stream){if(G.header=0,G.hr=!1,H.match(/^\s*$/,!0))return v(G),null;if(G.prevLine=G.thisLine,G.thisLine={stream:H},G.taskList=!1,G.trailingSpace=0,G.trailingSpaceNewLine=!1,!G.localState&&(G.f=G.block,G.f!=E)){var V=H.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(G.indentation=V,G.indentationDiff=null,V>0)return null}}return G.f(H,G)},innerMode:function(H){return H.block==E?{state:H.htmlState,mode:S}:H.localState?{state:H.localState,mode:H.localMode}:{state:H,mode:te}},indent:function(H,G,V){return H.block==E&&S.indent?S.indent(H.htmlState,G,V):H.localState&&H.localMode.indent?H.localMode.indent(H.localState,G,V):ue.Pass},blankLine:v,getType:y,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return te},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},n6Qo:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return w});var ue=F("q1tI"),Q=F("biw7"),j=F("fyJ8");function S(f){var p=f.className,u=f.index,o=f.children,i=f.colSpan,l=f.rowSpan,s=ue.useContext(Q.a),h=s.prefixCls,r=s.fixedInfoList,t=r[u];return ue.createElement(j.a,Object.assign({className:p,index:u,component:"td",prefixCls:h,record:null,dataIndex:null,render:function(){return{children:o,props:{colSpan:i,rowSpan:l}}}},t))}function D(f){return ue.createElement("tr",Object.assign({},f))}function x(f){var p=f.children,u=ue.useContext(Q.a),o=u.prefixCls;return ue.createElement("tfoot",{className:"".concat(o,"-summary")},p)}var T=Le.b=x,w={Cell:S,Row:D}},nCk5:function(nt,Le,F){nt.exports=F.p+"static/d.53bf6ae3.svg"},nWbc:function(nt,Le,F){},nnTU:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return w}),F.d(Le,"a",function(){return f});var ue=F("pmY6"),Q=F("746U"),j=F("Cg/j"),S=F("MI8n"),D=F("24hK"),x=F("QDVR"),T=function(){for(var p=0,u=0,o=arguments.length;u=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function p(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function u(r){for(;;){var t=r.text.indexOf(">",r.ch);if(t==-1){if(f(r))continue;return}if(!w(r,t+1)){r.ch=t+1;continue}var n=r.text.lastIndexOf("/",t),c=n>-1&&!/\S/.test(r.text.slice(n+1,t));return r.ch=t+1,c?"selfClose":"regular"}}function o(r){for(;;){var t=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(t==-1){if(p(r))continue;return}if(!w(r,t+1)){r.ch=t;continue}x.lastIndex=t,r.ch=t;var n=x.exec(r.text);if(n&&n.index==t)return n}}function i(r){for(;;){x.lastIndex=r.ch;var t=x.exec(r.text);if(!t){if(f(r))continue;return}if(!w(r,t.index+1)){r.ch=t.index+1;continue}return r.ch=t.index+t[0].length,t}}function l(r){for(;;){var t=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(t==-1){if(p(r))continue;return}if(!w(r,t+1)){r.ch=t;continue}var n=r.text.lastIndexOf("/",t),c=n>-1&&!/\S/.test(r.text.slice(n+1,t));return r.ch=t+1,c?"selfClose":"regular"}}function s(r,t){for(var n=[];;){var c=i(r),m,v=r.line,b=r.ch-(c?c[0].length:0);if(!c||!(m=u(r)))return;if(m=="selfClose")continue;if(c[1]){for(var E=n.length-1;E>=0;--E)if(n[E]==c[2]){n.length=E;break}if(E<0&&(!t||t==c[2]))return{tag:c[2],from:Q(v,b),to:Q(r.line,r.ch)}}else n.push(c[2])}}function h(r,t){for(var n=[];;){var c=l(r);if(!c)return;if(c=="selfClose"){o(r);continue}var m=r.line,v=r.ch,b=o(r);if(!b)return;if(b[1])n.push(b[2]);else{for(var E=n.length-1;E>=0;--E)if(n[E]==b[2]){n.length=E;break}if(E<0&&(!t||t==b[2]))return{tag:b[2],from:Q(r.line,r.ch),to:Q(m,v)}}}}ue.registerHelper("fold","xml",function(r,t){for(var n=new T(r,t.line,0);;){var c=i(n);if(!c||n.line!=t.line)return;var m=u(n);if(!m)return;if(!c[1]&&m!="selfClose"){var v=Q(n.line,n.ch),b=s(n,c[2]);return b&&j(b.from,v)>0?{from:v,to:b.from}:null}}}),ue.findMatchingTag=function(r,t,n){var c=new T(r,t.line,t.ch,n);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var m=u(c),v=m&&Q(c.line,c.ch),b=m&&o(c);if(!m||!b||j(c,t)>0)return;var E={from:Q(c.line,c.ch),to:v,tag:b[2]};return m=="selfClose"?{open:E,close:null,at:"open"}:b[1]?{open:h(c,b[2]),close:E,at:"close"}:(c=new T(r,v.line,v.ch,n),{open:E,close:s(c,b[2]),at:"open"})},ue.findEnclosingTag=function(r,t,n,c){for(var m=new T(r,t.line,t.ch,n);;){var v=h(m,c);if(!v)break;var b=new T(r,t.line,t.ch,n),E=s(b,v.tag);if(E)return{open:v,close:E}}},ue.scanForClosingTag=function(r,t,n,c){var m=new T(r,t.line,t.ch,c?{from:0,to:c}:null);return s(m,n)}})},p5ED:function(nt,Le,F){"use strict";var ue=F("+L6B"),Q=F("2/Rp"),j=F("5Dmo"),S=F("3S7+"),D=F("k1fw"),x=F("9og8"),T=F("tJVT"),w=F("WmNS"),f=F.n(w),p=F("q1tI"),u=F.n(p),o=F("vHTk"),i=F.n(o),l=F("yEEn"),s=F("ZW9T"),h=F("1vsH"),r=F("V0Rq"),t=F("m3rI");Le.a=function(n){var c,m,v,b,E,g,y=n.editOffice,C=y===void 0?"view":y,d=n.name,_=n.data,O=n.theme,A=n.type,P=n.filename,I=n.monacoEditor,W=n.className,K=n.style,te=n.close,H=n.onClose,G=n.hasMask,V=n.disabledDownload,re=n.onImgDimensions,$=n.otherData,ne=Object(p.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),he=Object(T.a)(ne,2),pe=he[0],Te=he[1],we=Object(p.useState)(""),Me=Object(T.a)(we,2),Ee=Me[0],xe=Me[1],Ge=Object(p.useState)(),je=Object(T.a)(Ge,2),We=je[0],ze=je[1],de=window.ENV==="build"?"/react/build":"",le=location.host.startsWith("localhost")?t.a.PROXY_SERVER:t.a.API_SERVER,Oe,Ie=1024*1024,qe=10*Ie,ee=Object(p.useRef)();(c=_)!==null&&c!==void 0&&c.startsWith("/api")&&A!=="txt"&&(_=t.a.API_SERVER+_),A==="office"&&(Oe=Object(h.P)(_).filesize,Oe>qe&&(A="other")),P&&(I.filename=P),Object(p.useEffect)(function(){var Y,J,be=(Y=document.cookie)===null||Y===void 0||((J=Y.replace(/\s/g,""))===null||J===void 0)?void 0:J.split(";");be==null||be.map(function(ke){var ct=ke.split("=");ct[0]==="_educoder_session"&&xe(ct[1])})},[]),Object(p.useEffect)(function(){A==="office"&&k()},[A,_]);var k=function(){var Y=Object(x.a)(f.a.mark(function J(){var be,ke,ct;return f.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return console.log("data:",_),be=_,_.startsWith("http")||(be=location.origin+be),ke=new URL(be).pathname.split("/").pop(),Be.next=6,Object(r.U)({attachment_id:ke});case 6:ct=Be.sent,ze(ct);case 8:case"end":return Be.stop()}},J)}));return function(){return Y.apply(this,arguments)}}(),U=function(){if(_.startsWith("http")||_.startsWith("blob:")){q();return}Object(h.x)(P||"educoder",_,P)},q=function(){Object(h.v)(P||"educoder",decodeURIComponent(_))};return u.a.createElement("div",{style:Object(D.a)({},K||{}),className:"".concat(G&&i.a.bgBlack," ").concat(A?i.a.wrp:"hide")},te&&u.a.createElement("div",{className:i.a.close,ref:ee},!!re&&u.a.createElement(S.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return ee.current}},u.a.createElement("span",{onClick:function(){H(),re()}},u.a.createElement("i",{className:"icon-yulanpizhu"}))),!V&&u.a.createElement(S.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ee.current}},u.a.createElement("span",{onClick:q},u.a.createElement("i",{className:"icon-quxiaozhiding"}))),u.a.createElement(S.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ee.current}},u.a.createElement("span",{className:"",onClick:H},u.a.createElement("i",{className:"icon-guanbi1"})))),u.a.createElement("div",{className:"".concat(i.a[W]," ").concat(W," ").concat(i.a.monaco," ").concat(A==="txt"?"show":"hide")},A==="txt"&&u.a.createElement(s.b,I)),A==="audio"&&u.a.createElement("audio",{src:"".concat(((m=_)===null||m===void 0?void 0:m.indexOf("http://"))>-1||((v=_)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(_),autoPlay:!0}),A==="video"&&u.a.createElement(u.a.Fragment,null,((b=_)===null||b===void 0?void 0:b.indexOf("http"))>-1?u.a.createElement("video",{controls:!0,src:"".concat(_),autoPlay:!0}):u.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(_),autoPlay:!0})),A==="office"&&We&&u.a.createElement("iframe",{src:"".concat(de,"/office.html?key=").concat(We.key,"&url=").concat(le+We.url,"&callbackUrl=").concat(le+We.callbackUrl,"&fileType=").concat(We.fileType,"&title=").concat(We.title,"&model=").concat(C,"&officeServer=").concat(t.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),(A==="xlsx"||A==="doc"||A==="pptx"||A==="docx")&&u.a.createElement("iframe",{src:"/react/build/office.html?key=".concat($.key,"&url=").concat(t.a.API_SERVER+$.url,"&callbackUrl=").concat(t.a.API_SERVER+$.callbackUrl,"&fileType=").concat($.fileType,"&title=").concat($.title,"&model=").concat($.model)}),A==="html"&&u.a.createElement("iframe",{src:_+"&disposition=inline"}),A==="pdf"&&u.a.createElement("embed",{className:i.a.embed,src:_}),A==="image"&&u.a.createElement("img",{src:"".concat(((E=_)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((g=_)===null||g===void 0?void 0:g.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(_)}),A==="other"&&u.a.createElement("div",null,u.a.createElement(Q.a,{type:"primary",size:"large",onClick:U},u.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),A==="download"&&u.a.createElement(Q.a,{type:"primary",size:"large",onClick:U},u.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,Le,F){},pYxM:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},pmY6:function(nt,Le,F){"use strict";F.d(Le,"g",function(){return D}),F.d(Le,"f",function(){return x}),F.d(Le,"e",function(){return T}),F.d(Le,"h",function(){return w}),F.d(Le,"b",function(){return f}),F.d(Le,"a",function(){return p}),F.d(Le,"d",function(){return u}),F.d(Le,"c",function(){return o});var ue=!1,Q="__is_disposable_tracked__";function j(i){if(!ue)return;if(i&&i!==p.None)try{i[Q]=!0}catch(l){}}function S(i){if(!ue)return i;var l=new Error("Potentially leaked disposable").stack;return setTimeout(function(){i[Q]||console.log(l)},3e3),i}function D(i){return typeof i.dispose=="function"&&i.dispose.length===0}function x(i){return Array.isArray(i)?(i.forEach(function(l){l&&(j(l),l.dispose())}),[]):i?(j(i),i.dispose(),i):void 0}function T(){for(var i=[],l=0;l0?$["Content-Type"]=re.mime:$["Content-Type"]=b.getType(re.mime||m.extname(re.object||""))||"application/octet-stream"),re.content&&($["Content-Md5"]=c.createHash("md5").update(new w(re.content,"utf8")).digest("base64"),$["Content-Length"]||($["Content-Length"]=re.content.length));var ne=this._getResource(re);$.authorization=this.authorization(re.method,ne,re.subres,$);var he=this._getReqUrl(re);n("request %s %s, with headers %j, !!stream: %s",re.method,he,$,!!re.stream);var pe=re.timeout||this.options.timeout;return{url:he,params:{agent:this.agent,method:re.method,content:re.content,stream:re.stream,headers:$,timeout:pe,writeStream:re.writeStream,customResponse:re.customResponse,ctx:re.ctx||this.ctx}}},V.request=h.default.mark(function re($){var ne,he,pe,Te;return h.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return ne=this.createRequest($),he=void 0,pe=void 0,we.prev=3,we.next=6,this.urllib.request(ne.url,ne.params);case 6:he=we.sent,n("response %s %s, got %s, headers: %j",$.method,ne.url,he.status,he.headers),we.next=13;break;case 10:we.prev=10,we.t0=we.catch(3),pe=we.t0;case 13:if(Te=void 0,!he||!$.successStatuses||$.successStatuses.indexOf(he.status)!==-1){we.next=26;break}return we.next=17,this.requestError(he);case 17:if(Te=we.sent,Te.code!=="RequestTimeTooSkewed"){we.next=23;break}return this.options.amendTimeSkewed=+new Date(Te.serverTime)-new Date,we.next=22,this.request($);case 22:return we.abrupt("return",we.sent);case 23:Te.params=$,we.next=30;break;case 26:if(!pe){we.next=30;break}return we.next=29,this.requestError(pe);case 29:Te=we.sent;case 30:if(!Te){we.next=32;break}throw Te;case 32:if(!$.xmlResponse){we.next=36;break}return we.next=35,this.parseXML(he.data);case 35:he.data=we.sent;case 36:return we.abrupt("return",he);case 37:case"end":return we.stop()}},re,this,[[3,10]])}),V._getResource=function(re){var $="/";return re.bucket&&($+=re.bucket+"/"),re.object&&($+=re.object),$},V._isIP=function(re){return H._isIP(re)},V._escape=function(re){return A.encodeURIComponent(re).replace(/%2F/g,"/")},V._getReqUrl=function(re){var $={};v(this.options.endpoint).to($);var ne=this._isIP($.hostname),he=this.options.cname;!re.bucket||he||ne||($.host=re.bucket+"."+$.host);var pe="/";re.bucket&&ne&&(pe+=re.bucket+"/"),re.object&&(pe+=this._escape(re.object).replace(/\+/g,"%2B")),$.pathname=pe;var Te={};if(re.query&&C(Te,re.query),re.subres){var we={};_.string(re.subres)?we[re.subres]="":_.array(re.subres)?re.subres.forEach(function(Me){we[Me]=""}):we=re.subres,C(Te,we)}return $.query=Te,d.format($)},V._getUserAgent=function(){var re=T&&T.browser?"js":"nodejs",$="aliyun-sdk-"+re+"/"+I.version,ne=O.description;return!ne&&T&&(ne="Node.js "+T.version.slice(1)+" on "+T.platform+" "+T.arch),this._checkUserAgent($+" "+ne)},V._checkUserAgent=function(re){return re.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},V.checkBrowserAndVersion=function(re,$){return K.name===re&&K.version.split(".")[0]===$},V.parseXML=function(re){return function($){w.isBuffer(re)&&(re=re.toString()),E.parseString(re,{explicitRoot:!1,explicitArray:!1},$)}},V.requestError=h.default.mark(function re($){var ne,he,pe,Te;return h.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(ne=null,$.data&&$.data.length){we.next=5;break}$.status===-1||$.status===-2?(ne=new Error($.message),ne.name=$.name,ne.status=$.status,ne.code=$.name):($.status===404?(ne=new Error("Object not exists"),ne.name="NoSuchKeyError",ne.status=404,ne.code="NoSuchKey"):$.status===412?(ne=new Error("Pre condition failed"),ne.name="PreconditionFailedError",ne.status=412,ne.code="PreconditionFailed"):(ne=new Error("Unknow error, status: "+$.status),ne.name="UnknowError",ne.status=$.status),ne.requestId=$.headers["x-oss-request-id"],ne.host=""),we.next=30;break;case 5:return he=String($.data),n("request response error data: %s",he),pe=void 0,we.prev=8,we.next=11,this.parseXML(he)||{};case 11:pe=we.sent,we.next=21;break;case 14:return we.prev=14,we.t0=we.catch(8),n(he),we.t0.message+=` raw xml: `+he,we.t0.status=$.status,we.t0.requestId=$.headers["x-oss-request-id"],we.abrupt("return",we.t0);case 21:Te=pe.Message||"unknow request error, status: "+$.status,pe.Condition&&(Te+=" (condition: "+pe.Condition+")"),ne=new Error(Te),ne.name=pe.Code?pe.Code+"Error":"UnknowError",ne.status=$.status,ne.code=pe.Code,ne.requestId=pe.RequestId,ne.hostId=pe.HostId,ne.serverTime=pe.ServerTime;case 30:return n("generate error %j",ne),we.abrupt("return",ne);case 32:case"end":return we.stop()}},re,this,[[8,14]])})}).call(this,S("_process"),S("buffer").Buffer)},{"../common/multipart":8,"../common/signUtils":9,"../common/thunkpool.js":10,"../common/utils":11,"./../../shims/crypto/crypto.js":237,"./managed_upload":3,"./object":4,"./version":5,"./wrapper":6,_process:173,agentkeepalive:12,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,bowser:35,buffer:38,"copy-to":43,dateformat:154,debug:155,"humanize-ms":160,"is-type-of":165,"merge-descriptors":168,mime:242,path:170,platform:171,url:203,urllib:244,utility:243,xml2js:213}],3:[function(S,D,x){(function(T){"use strict";function w(v){return v&&v.__esModule?v:{default:v}}function f(v,b){if(!(this instanceof f))return new f(v,b);m.call(this,b),this.file=v,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=S("babel-runtime/core-js/array/from"),u=w(p),o=S("babel-runtime/regenerator"),i=w(o),l=S("is-type-of"),s=S("util"),h=S("path"),r=S("mime"),t=S("copy-to"),n=x;n.multipartUpload=i.default.mark(function v(b,E,g){var y,C,d,_,O,A,P,I,W;return i.default.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(this.resetCancelFlag(),g=g||{},!g.checkpoint||!g.checkpoint.uploadId){K.next=6;break}return K.next=5,this._resumeMultipart(g.checkpoint,g);case 5:return K.abrupt("return",K.sent);case 6:return y=102400,g.mime||(l.file(E)?g.mime=r.getType(h.extname(E.name)):l.blob(E)?g.mime=E.type:g.mime=r.getType(h.extname(E))),g.headers=g.headers||{},this._convertMetaToHeaders(g.meta,g.headers),K.next=12,this._getFileSize(E);case 12:if(!((C=K.sent)0&&t(_).to(A),P=this._divideParts(y,C),I=P.length,W=!1,K=i.default.mark(function Me(Ee,xe){var Ge,je,We;return i.default.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(Ee.isCancel()){ze.next=21;break}return ze.prev=1,Ge=P[xe-1],je={stream:Ee._createStream(g,Ge.start,Ge.end),size:Ge.end-Ge.start},ze.next=6,Ee._uploadPart(O,d,xe,je);case 6:if(We=ze.sent,Ee.isCancel()||W){ze.next=13;break}if(b.doneParts.push({number:xe,etag:We.res.headers.etag}),A.push({number:xe,etag:We.res.headers.etag}),!E||!E.progress){ze.next=13;break}return ze.next=13,E.progress(_.length/I,b,We.res);case 13:ze.next=21;break;case 15:if(ze.prev=15,ze.t0=ze.catch(1),Ee.isCancel()){ze.next=21;break}throw Ee.cancel(),ze.t0.partNum=xe,ze.t0;case 21:case"end":return ze.stop()}},Me,this,[[1,15]])}),te=(0,u.default)(new Array(I),function(Me,Ee){return Ee+1}),H=A.map(function(Me){return Me.number}),G=te.filter(function(Me){return H.indexOf(Me)<0}),V=5,re=E.parallel||V,!this.checkBrowserAndVersion("Internet Explorer","10")&&re!==1){we.next=26;break}$=0;case 16:if(!($0)){we.next=37;break}throw this.resetCancelFlag(),Te=pe[0],Te.message="Failed to upload some parts with error: "+Te.toString()+" part_num: "+Te.partNum,Te;case 37:if(!this.isCancel()){we.next=40;break}throw ne=null,this._makeCancelEvent();case 40:return we.next=42,this.completeMultipartUpload(O,d,A,E);case 42:return we.abrupt("return",we.sent);case 43:case"end":return we.stop()}},v,this)}),l.file=function(v){return typeof File!="undefined"&&v instanceof File},l.blob=function(v){return typeof Blob!="undefined"&&v instanceof Blob},n._getFileSize=i.default.mark(function v(b){var E;return i.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(!l.buffer(b)){g.next=4;break}return g.abrupt("return",b.length);case 4:if(!l.blob(b)&&!l.file(b)){g.next=6;break}return g.abrupt("return",b.size);case 6:if(!l.string(b)){g.next=11;break}return g.next=9,this._statFile(b);case 9:return E=g.sent,g.abrupt("return",E.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return g.stop()}},v,this)});var c=S("stream"),m=c.Readable;s.inherits(f,m),f.prototype.readFileAndPush=function(v){if(this.fileBuffer)for(var b=!0;b&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:g,this.start=g,b=this.push(this.fileBuffer.slice(E,g))}},f.prototype._read=function(v){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);v=v||16384;var b=this;this.reader.onload=function(E){b.fileBuffer=new T(new Uint8Array(E.target.result)),b.file=null,b.readFileAndPush(v)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(v)},n._createStream=function(v,b,E){if(l.blob(v)||l.file(v))return new f(v.slice(b,E));throw new Error("_createStream requires File/String.")},n._getPartSize=function(v,b){return b?Math.max(Math.ceil(v/1e4),b):1048576},n._divideParts=function(v,b){for(var E=Math.ceil(v/b),g=[],y=0;y `,g.quiet?y+=` true `:y+=` false `,C=0;C"+i.escape(this._objectName(E[C]))+` `;return y+="",o("delete multi objects: %s",y),g.subres="delete",d=this._objectRequestParams("POST","",g),d.mime="xml",d.content=y,d.xmlResponse=!0,d.successStatuses=[200],P.next=14,this.request(d);case 14:return _=P.sent,O=_.data,A=O&&O.Deleted||null,A&&(Array.isArray(A)||(A=[A]),A=A.map(function(I){return I.Key})),P.abrupt("return",{res:_.res,deleted:A});case 19:case"end":return P.stop()}},b,this)}),v.copy=u.default.mark(function b(E,g,y){var C,d,_;return u.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return y=y||{},y.headers=y.headers||{},(0,f.default)(y.headers).forEach(function(A){y.headers["x-oss-copy-source-"+A.toLowerCase()]=y.headers[A]}),y.meta&&(y.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(y.meta,y.headers),g=g[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(g):"/"+encodeURIComponent(g.slice(1)),y.headers["x-oss-copy-source"]=g,C=this._objectRequestParams("PUT",E,y),C.xmlResponse=!0,C.successStatuses=[200,304],O.next=12,this.request(C);case 12:return d=O.sent,_=d.data,_&&(_={etag:_.ETag,lastModified:_.LastModified}),O.abrupt("return",{data:_,res:d.res});case 16:case"end":return O.stop()}},b,this)}),v.putMeta=u.default.mark(function b(E,g,y){return u.default.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,this.copy(E,E,{meta:g||{},timeout:y&&y.timeout,ctx:y&&y.ctx});case 2:return C.abrupt("return",C.sent);case 3:case"end":return C.stop()}},b,this)}),v.list=u.default.mark(function b(E,g){var y,C,d,_,O;return u.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return y=this._objectRequestParams("GET","",g),y.query=E,y.xmlResponse=!0,y.successStatuses=[200],A.next=6,this.request(y);case 6:return C=A.sent,d=C.data.Contents,_=this,d&&(Array.isArray(d)||(d=[d]),d=d.map(function(P){return{name:P.Key,url:_._objectUrl(P.Key),lastModified:P.LastModified,etag:P.ETag,type:P.Type,size:Number(P.Size),storageClass:P.StorageClass,owner:{id:P.Owner.ID,displayName:P.Owner.DisplayName}}})),O=C.data.CommonPrefixes||null,O&&(Array.isArray(O)||(O=[O]),O=O.map(function(P){return P.Prefix})),A.abrupt("return",{res:C.res,objects:d,prefixes:O,nextMarker:C.data.NextMarker||null,isTruncated:C.data.IsTruncated==="true"});case 13:case"end":return A.stop()}},b,this)}),v.putACL=u.default.mark(function b(E,g,y){var C,d;return u.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return y=y||{},y.subres="acl",y.headers=y.headers||{},y.headers["x-oss-object-acl"]=g,E=this._objectName(E),C=this._objectRequestParams("PUT",E,y),C.successStatuses=[200],_.next=9,this.request(C);case 9:return d=_.sent,_.abrupt("return",{res:d.res});case 11:case"end":return _.stop()}},b,this)}),v.getACL=u.default.mark(function b(E,g){var y,C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return g=g||{},g.subres="acl",E=this._objectName(E),y=this._objectRequestParams("GET",E,g),y.successStatuses=[200],y.xmlResponse=!0,d.next=8,this.request(y);case 8:return C=d.sent,d.abrupt("return",{acl:C.data.AccessControlList.Grant,owner:{id:C.data.Owner.ID,displayName:C.data.Owner.DisplayName},res:C.res});case 10:case"end":return d.stop()}},b,this)}),v.restore=u.default.mark(function b(E,g){var y,C;return u.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return g=g||{},g.subres="restore",y=this._objectRequestParams("POST",E,g),y.successStatuses=[202],d.next=6,this.request(y);case 6:return C=d.sent,d.abrupt("return",{res:C.res});case 8:case"end":return d.stop()}},b,this)}),v.signatureUrl=function(b,E){E=E||{},b=this._objectName(b),E.method=E.method||"GET";var g=i.timestamp()+(E.expires||1800),y={bucket:this.options.bucket,object:b},C=this._getResource(y);this.options.stsToken&&(E["security-token"]=this.options.stsToken);var d=m._signatureForURL(this.options.accessKeySecret,E,C,g),_=h.parse(this._getReqUrl(y));return _.query={OSSAccessKeyId:this.options.accessKeyId,Expires:g,Signature:d.Signature},r(d.subResource).to(_.query),_.format()},v.getObjectUrl=function(b,E){return E?E[E.length-1]!=="/"&&(E+="/"):E=this.options.endpoint.format(),E+this._escape(this._objectName(b))},v._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},v.generateObjectUrl=function(b,E){if(E)E[E.length-1]!=="/"&&(E+="/");else{E=this.options.endpoint.format();var g=h.parse(E),y=this.options.bucket;g.hostname=y+"."+g.hostname,g.host=y+"."+g.host,E=g.format()}return E+this._escape(this._objectName(b))},v._objectRequestParams=function(b,E,g){if(!this.options.bucket)throw new Error("Please create a bucket first");g=g||{},E=this._objectName(E);var y={object:E,bucket:this.options.bucket,method:b,subres:g&&g.subres,timeout:g&&g.timeout,ctx:g&&g.ctx};return g.headers&&(y.headers={},r(g.headers).to(y.headers)),y},v._objectName=function(b){return b.replace(/^\/+/,"")},v._statFile=function(b){return function(E){l.stat(b,E)}},v._convertMetaToHeaders=function(b,E){b&&(0,f.default)(b).forEach(function(g){E["x-oss-meta-"+g]=b[g]})},v._deleteFileSafe=function(b){return function(E){l.exists(b,function(g){g?l.unlink(b,function(y){y&&o("unlink %j error: %s",b,y),E()}):E()})}}},{"../common/callback":7,"../common/signUtils":9,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,"copy-to":43,debug:155,fs:36,"is-type-of":165,mime:242,path:170,url:203,utility:243}],5:[function(S,D,x){"use strict";x.version="5.3.1"},{}],6:[function(S,D,x){"use strict";function T(t){return t&&t.__esModule?t:{default:t}}function w(t){return t&&typeof t.next=="function"&&typeof t.throw=="function"}function f(t){if(!t)return!1;var n=t.constructor;return!!n&&(n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction"||w(n.prototype)||w(t.prototype))}function p(t,n){var c=new t(n),m=(0,s.default)(c),v=(0,s.default)((0,i.default)(c));m.concat(v).forEach(function(b){f(c[b])?this[b]=h.wrap(c[b]).bind(c):this[b]=c[b]},this)}function u(t){if(!(this instanceof u))return new u(t);p.call(this,r,t)}var o=S("babel-runtime/core-js/object/get-prototype-of"),i=T(o),l=S("babel-runtime/core-js/object/keys"),s=T(l),h=S("co"),r=S("./client");D.exports=u,u.STS=function t(n){if(!(this instanceof t))return new t(n);p.call(this,r.STS,n)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(S,D,x){(function(T){"use strict";function w(i){return i&&i.__esModule?i:{default:i}}var f=S("babel-runtime/core-js/object/keys"),p=w(f),u=S("babel-runtime/core-js/json/stringify"),o=w(u);x.encodeCallback=function(i,l){if(i.headers=i.headers||{},!Object.prototype.hasOwnProperty.call(i.headers,"x-oss-callback")&&l.callback){var s={callbackUrl:encodeURI(l.callback.url),callbackBody:l.callback.body};l.callback.host&&(s.callbackHost=l.callback.host),l.callback.contentType&&(s.callbackBodyType=l.callback.contentType);var h=new T((0,o.default)(s)).toString("base64");if(i.headers["x-oss-callback"]=h,l.callback.customValue){var r={};(0,p.default)(l.callback.customValue).forEach(function(t){r["x:"+t]=l.callback.customValue[t]}),i.headers["x-oss-callback-var"]=new T((0,o.default)(r)).toString("base64")}}}}).call(this,S("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(S,D,x){"use strict";var T=S("babel-runtime/regenerator"),w=function(o){return o&&o.__esModule?o:{default:o}}(T),f=S("copy-to"),p=S("./callback"),u=x;u.listUploads=w.default.mark(function o(i,l){var s,h,r,t;return w.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return l=l||{},s={},f(l).to(s),s.subres="uploads",h=this._objectRequestParams("GET","",s),h.query=i,h.xmlResponse=!0,h.successStatuses=[200],n.next=10,this.request(h);case 10:return r=n.sent,t=r.data.Upload||[],Array.isArray(t)||(t=[t]),t=t.map(function(c){return{name:c.Key,uploadId:c.UploadId,initiated:c.Initiated}}),n.abrupt("return",{res:r.res,uploads:t,bucket:r.data.Bucket,nextKeyMarker:r.data.NextKeyMarker,nextUploadIdMarker:r.data.NextUploadIdMarker,isTruncated:r.data.IsTruncated==="true"});case 15:case"end":return n.stop()}},o,this)}),u.listParts=w.default.mark(function o(i,l,s,h){var r,t,n;return w.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return h=h||{},r={},f(h).to(r),r.subres={uploadId:l},t=this._objectRequestParams("GET",i,r),t.query=s,t.xmlResponse=!0,t.successStatuses=[200],c.next=10,this.request(t);case 10:return n=c.sent,c.abrupt("return",{res:n.res,uploadId:n.data.UploadId,bucket:n.data.Bucket,name:n.data.Key,partNumberMarker:n.data.PartNumberMarker,nextPartNumberMarker:n.data.NextPartNumberMarker,maxParts:n.data.MaxParts,isTruncated:n.data.IsTruncated,parts:n.data.Part||[]});case 12:case"end":return c.stop()}},o,this)}),u.abortMultipartUpload=w.default.mark(function o(i,l,s){var h,r,t;return w.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.cancel(),s=s||{},h={},f(s).to(h),h.subres={uploadId:l},r=this._objectRequestParams("DELETE",i,h),r.successStatuses=[204],n.next=9,this.request(r);case 9:return t=n.sent,n.abrupt("return",{res:t.res});case 11:case"end":return n.stop()}},o,this)}),u.initMultipartUpload=w.default.mark(function o(i,l){var s,h,r;return w.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return l=l||{},s={},f(l).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(l.meta,s.headers),s.subres="uploads",h=this._objectRequestParams("POST",i,s),h.mime=l.mime,h.xmlResponse=!0,h.successStatuses=[200],t.next=12,this.request(h);case 12:return r=t.sent,t.abrupt("return",{res:r.res,bucket:r.data.Bucket,name:r.data.Key,uploadId:r.data.UploadId});case 14:case"end":return t.stop()}},o,this)}),u.uploadPart=w.default.mark(function o(i,l,s,h,r,t,n){var c;return w.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return c={stream:this._createStream(h,r,t),size:t-r},m.next=3,this._uploadPart(i,l,s,c,n);case 3:return m.abrupt("return",m.sent);case 4:case"end":return m.stop()}},o,this)}),u.completeMultipartUpload=w.default.mark(function o(i,l,s,h){var r,t,n,c,m,v,b,E;return w.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:for(r=s.concat().sort(function(y,C){return y.number-C.number}).filter(function(y,C,d){return!C||y.number!==d[C-1].number}),t=` `,n=0;n `,t+=""+c.number+` `,t+=""+c.etag+` `,t+=` `;return t+="",h=h||{},m={},f(h).to(m),m.subres={uploadId:l},v=this._objectRequestParams("POST",i,m),p.encodeCallback(v,m),v.mime="xml",v.content=t,v.headers&&v.headers["x-oss-callback"]||(v.xmlResponse=!0),v.successStatuses=[200],g.next=16,this.request(v);case 16:return b=g.sent,E={res:b.res,bucket:v.bucket,name:i,etag:b.res.headers.etag},v.headers&&v.headers["x-oss-callback"]&&(E.data=JSON.parse(b.data.toString())),g.abrupt("return",E);case 20:case"end":return g.stop()}},o,this)}),u._uploadPart=w.default.mark(function o(i,l,s,h,r){var t,n,c;return w.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return r=r||{},t={},f(r).to(t),t.headers={"Content-Length":h.size},t.subres={partNumber:s,uploadId:l},n=this._objectRequestParams("PUT",i,t),n.mime=t.mime,n.stream=h.stream,n.successStatuses=[200],m.next=11,this.request(n);case 11:return c=m.sent,h.stream=null,n.stream=null,m.abrupt("return",{name:i,etag:c.res.headers.etag,res:c.res});case 15:case"end":return m.stop()}},o,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(S,D,x){(function(T){"use strict";function w(s){return s&&s.__esModule?s:{default:s}}var f=S("babel-runtime/core-js/json/stringify"),p=w(f),u=S("babel-runtime/core-js/object/keys"),o=w(u),i=S("./../../shims/crypto/crypto.js"),l=S("is-type-of");x.buildCanonicalizedResource=function(s,h){var r=""+s,t="?";if(l.string(h)&&h.trim()!=="")r+=t+h;else if(l.array(h))h.sort(),r+=t+h.join("&");else if(h){var n=function(m,v){return m[0]>v[0]?1:m[0]0)throw new Error("Invalid string. Length must be a multiple of 4");var v=c.indexOf("=");return v===-1&&(v=m),[v,v===m?0:4-v%4]}function w(c){var m=T(c),v=m[0],b=m[1];return 3*(v+b)/4-b}function f(c,m,v){return 3*(m+v)/4-v}function p(c){for(var m,v=T(c),b=v[0],E=v[1],g=new h(f(c,b,E)),y=0,C=E>0?b-4:b,d=0;d>16&255,g[y++]=m>>8&255,g[y++]=255&m;return E===2&&(m=s[c.charCodeAt(d)]<<2|s[c.charCodeAt(d+1)]>>4,g[y++]=255&m),E===1&&(m=s[c.charCodeAt(d)]<<10|s[c.charCodeAt(d+1)]<<4|s[c.charCodeAt(d+2)]>>2,g[y++]=m>>8&255,g[y++]=255&m),g}function u(c){return l[c>>18&63]+l[c>>12&63]+l[c>>6&63]+l[63&c]}function o(c,m,v){for(var b,E=[],g=m;gy?y:g+16383));return b===1?(m=c[v-1],E.push(l[m>>2]+l[m<<4&63]+"==")):b===2&&(m=(c[v-2]<<8)+c[v-1],E.push(l[m>>10]+l[m>>4&63]+l[m<<2&63]+"=")),E.join("")}x.byteLength=w,x.toByteArray=p,x.fromByteArray=i;for(var l=[],s=[],h=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=r.length;t1&&$[1]||""}function r(re){var $=s.match(re);return $&&$.length>1&&$[2]||""}var t,n=h(/(ipod|iphone|ipad)/i).toLowerCase(),c=/like android/i.test(s),m=!c&&/android/i.test(s),v=/nexus\s*[0-6]\s*/i.test(s),b=!v&&/nexus\s*[0-9]+/i.test(s),E=/CrOS/.test(s),g=/silk/i.test(s),y=/sailfish/i.test(s),C=/tizen/i.test(s),d=/(web|hpw)os/i.test(s),_=/windows phone/i.test(s),O=(/SamsungBrowser/i.test(s),!_&&/windows/i.test(s)),A=!n&&!g&&/macintosh/i.test(s),P=!m&&!y&&!C&&!d&&/linux/i.test(s),I=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),W=h(/version\/(\d+(\.\d+)?)/i),K=/tablet/i.test(s)&&!/tablet pc/i.test(s),te=!K&&/[^-]mobi/i.test(s),H=/xbox/i.test(s);/opera/i.test(s)?t={name:"Opera",opera:i,version:W||h(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?t={name:"Opera",opera:i,version:h(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||W}:/SamsungBrowser/i.test(s)?t={name:"Samsung Internet for Android",samsungBrowser:i,version:W||h(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?t={name:"Opera Coast",coast:i,version:W||h(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?t={name:"Yandex Browser",yandexbrowser:i,version:W||h(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?t={name:"UC Browser",ucbrowser:i,version:h(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?t={name:"Maxthon",maxthon:i,version:h(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?t={name:"Epiphany",epiphany:i,version:h(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?t={name:"Puffin",puffin:i,version:h(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?t={name:"Sleipnir",sleipnir:i,version:h(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?t={name:"K-Meleon",kMeleon:i,version:h(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:_?(t={name:"Windows Phone",osname:"Windows Phone",windowsphone:i},I?(t.msedge=i,t.version=I):(t.msie=i,t.version=h(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?t={name:"Internet Explorer",msie:i,version:h(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:E?t={name:"Chrome",osname:"Chrome OS",chromeos:i,chromeBook:i,chrome:i,version:h(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?t={name:"Microsoft Edge",msedge:i,version:I}:/vivaldi/i.test(s)?t={name:"Vivaldi",vivaldi:i,version:h(/vivaldi\/(\d+(\.\d+)?)/i)||W}:y?t={name:"Sailfish",osname:"Sailfish OS",sailfish:i,version:h(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?t={name:"SeaMonkey",seamonkey:i,version:h(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(t={name:"Firefox",firefox:i,version:h(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(t.firefoxos=i,t.osname="Firefox OS")):g?t={name:"Amazon Silk",silk:i,version:h(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?t={name:"PhantomJS",phantom:i,version:h(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?t={name:"SlimerJS",slimer:i,version:h(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?t={name:"BlackBerry",osname:"BlackBerry OS",blackberry:i,version:W||h(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:d?(t={name:"WebOS",osname:"WebOS",webos:i,version:W||h(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(t.touchpad=i)):/bada/i.test(s)?t={name:"Bada",osname:"Bada",bada:i,version:h(/dolfin\/(\d+(\.\d+)?)/i)}:C?t={name:"Tizen",osname:"Tizen",tizen:i,version:h(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||W}:/qupzilla/i.test(s)?t={name:"QupZilla",qupzilla:i,version:h(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||W}:/chromium/i.test(s)?t={name:"Chromium",chromium:i,version:h(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||W}:/chrome|crios|crmo/i.test(s)?t={name:"Chrome",chrome:i,version:h(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:m?t={name:"Android",version:W}:/safari|applewebkit/i.test(s)?(t={name:"Safari",safari:i},W&&(t.version=W)):n?(t={name:n=="iphone"?"iPhone":n=="ipad"?"iPad":"iPod"},W&&(t.version=W)):t=/googlebot/i.test(s)?{name:"Googlebot",googlebot:i,version:h(/googlebot\/(\d+(\.\d+))/i)||W}:{name:h(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!t.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(t.name=t.name||"Blink",t.blink=i):(t.name=t.name||"Webkit",t.webkit=i),!t.version&&W&&(t.version=W)):!t.opera&&/gecko\//i.test(s)&&(t.name=t.name||"Gecko",t.gecko=i,t.version=t.version||h(/gecko\/(\d+(\.\d+)?)/i)),t.windowsphone||!m&&!t.silk?!t.windowsphone&&n?(t[n]=i,t.ios=i,t.osname="iOS"):A?(t.mac=i,t.osname="macOS"):H?(t.xbox=i,t.osname="Xbox"):O?(t.windows=i,t.osname="Windows"):P&&(t.linux=i,t.osname="Linux"):(t.android=i,t.osname="Android");var G="";t.windows?G=function(re){switch(re){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(h(/Windows ((NT|XP)( \d\d?.\d)?)/i)):t.windowsphone?G=h(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):t.mac?(G=h(/Mac OS X (\d+([_\.\s]\d+)*)/i),G=G.replace(/[_\s]/g,".")):n?(G=h(/os (\d+([_\s]\d+)*) like mac os x/i),G=G.replace(/[_\s]/g,".")):m?G=h(/android[ \/-](\d+(\.\d+)*)/i):t.webos?G=h(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):t.blackberry?G=h(/rim\stablet\sos\s(\d+(\.\d+)*)/i):t.bada?G=h(/bada\/(\d+(\.\d+)*)/i):t.tizen&&(G=h(/tizen[\/\s](\d+(\.\d+)*)/i)),G&&(t.osversion=G);var V=!t.windows&&G.split(".")[0];return K||b||n=="ipad"||m&&(V==3||V>=4&&!te)||t.silk?t.tablet=i:(te||n=="iphone"||n=="ipod"||m||v||t.blackberry||t.webos||t.bada)&&(t.mobile=i),t.msedge||t.msie&&t.version>=10||t.yandexbrowser&&t.version>=15||t.vivaldi&&t.version>=1||t.chrome&&t.version>=20||t.samsungBrowser&&t.version>=4||t.firefox&&t.version>=20||t.safari&&t.version>=6||t.opera&&t.version>=10||t.ios&&t.osversion&&t.osversion.split(".")[0]>=6||t.blackberry&&t.version>=10.1||t.chromium&&t.version>=20?t.a=i:t.msie&&t.version<10||t.chrome&&t.version<20||t.firefox&&t.version<20||t.safari&&t.version<6||t.opera&&t.version<10||t.ios&&t.osversion&&t.osversion.split(".")[0]<6||t.chromium&&t.version<20?t.c=i:t.x=i,t}function w(s){return s.split(".").length}function f(s,h){var r,t=[];if(Array.prototype.map)return Array.prototype.map.call(s,h);for(r=0;r=0;){if(r[0][h]>r[1][h])return 1;if(r[0][h]!==r[1][h])return-1;if(h===0)return 0}}function u(s,h,r){var t=l;typeof h=="string"&&(r=h,h=void 0),h===void 0&&(h=!1),r&&(t=T(r));var n=""+t.version;for(var c in s)if(s.hasOwnProperty(c)&&t[c]){if(typeof s[c]!="string")throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(s));return p([n,s[c]])<0}return h}function o(s,h,r){return!u(s,h,r)}var i=!0,l=T(typeof navigator!="undefined"&&navigator.userAgent||"");return l.test=function(s){for(var h=0;h=this.charLength-this.charReceived?this.charLength-this.charReceived:l.length;if(l.copy(this.charBuffer,this.charReceived,0,h),this.charReceived+=h,this.charReceived=55296&&t<=56319)){if(this.charReceived=this.charLength=0,l.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(l);var r=l.length;this.charLength&&(l.copy(this.charBuffer,0,l.length-this.charReceived,r),r-=this.charReceived),s+=l.toString(this.encoding,0,r);var r=s.length-1,t=s.charCodeAt(r);if(t>=55296&&t<=56319){var n=this.surrogateSize;return this.charLength+=n,this.charReceived+=n,this.charBuffer.copy(this.charBuffer,n,0,n),l.copy(this.charBuffer,0,0,n),s.substring(0,r)}return s},i.prototype.detectIncompleteChar=function(l){for(var s=l.length>=3?3:l.length;s>0;s--){var h=l[l.length-s];if(s==1&&h>>5==6){this.charLength=2;break}if(s<=2&&h>>4==14){this.charLength=3;break}if(s<=3&&h>>3==30){this.charLength=4;break}}this.charReceived=s},i.prototype.end=function(l){var s="";if(l&&l.length&&(s=this.write(l)),this.charReceived){var h=this.charReceived,r=this.charBuffer,t=this.encoding;s+=r.slice(0,h).toString(t)}return s}},{buffer:38}],38:[function(S,D,x){(function(T){"use strict";function w(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(k,U){if(w()=w())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w().toString(16)+" bytes");return 0|k}function c(k){return+k!=k&&(k=0),p.alloc(+k)}function m(k,U){if(p.isBuffer(k))return k.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(k)||k instanceof ArrayBuffer))return k.byteLength;typeof k!="string"&&(k=""+k);var q=k.length;if(q===0)return 0;for(var Y=!1;;)switch(U){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":case void 0:return xe(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*q;case"hex":return q>>>1;case"base64":return We(k).length;default:if(Y)return xe(k).length;U=(""+U).toLowerCase(),Y=!0}}function v(k,U,q){var Y=!1;if((U===void 0||U<0)&&(U=0),U>this.length)return"";if((q===void 0||q>this.length)&&(q=this.length),q<=0)return"";if(q>>>=0,U>>>=0,q<=U)return"";for(k||(k="utf8");;)switch(k){case"hex":return H(this,U,q);case"utf8":case"utf-8":return I(this,U,q);case"ascii":return K(this,U,q);case"latin1":case"binary":return te(this,U,q);case"base64":return P(this,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,U,q);default:if(Y)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),Y=!0}}function b(k,U,q){var Y=k[U];k[U]=k[q],k[q]=Y}function E(k,U,q,Y,J){if(k.length===0)return-1;if(typeof q=="string"?(Y=q,q=0):q>2147483647?q=2147483647:q<-2147483648&&(q=-2147483648),q=+q,isNaN(q)&&(q=J?0:k.length-1),q<0&&(q=k.length+q),q>=k.length){if(J)return-1;q=k.length-1}else if(q<0){if(!J)return-1;q=0}if(typeof U=="string"&&(U=p.from(U,Y)),p.isBuffer(U))return U.length===0?-1:g(k,U,q,Y,J);if(typeof U=="number")return U&=255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(k,U,q):Uint8Array.prototype.lastIndexOf.call(k,U,q):g(k,[U],q,Y,J);throw new TypeError("val must be string, number or Buffer")}function g(k,U,q,Y,J){function be(Xe,Ke){return ke===1?Xe[Ke]:Xe.readUInt16BE(Ke*ke)}var ke=1,ct=k.length,He=U.length;if(Y!==void 0&&((Y=String(Y).toLowerCase())==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(k.length<2||U.length<2)return-1;ke=2,ct/=2,He/=2,q/=2}var Be;if(J){var Ze=-1;for(Be=q;Bect&&(q=ct-He),Be=q;Be>=0;Be--){for(var ht=!0,Qe=0;QeJ&&(Y=J):Y=J;var be=U.length;if(be%2!=0)throw new TypeError("Invalid hex string");Y>be/2&&(Y=be/2);for(var ke=0;ke239?4:be>223?3:be>191?2:1;if(J+ct<=q){var He,Be,Ze,ht;switch(ct){case 1:be<128&&(ke=be);break;case 2:He=k[J+1],(192&He)==128&&(ht=(31&be)<<6|63&He)>127&&(ke=ht);break;case 3:He=k[J+1],Be=k[J+2],(192&He)==128&&(192&Be)==128&&(ht=(15&be)<<12|(63&He)<<6|63&Be)>2047&&(ht<55296||ht>57343)&&(ke=ht);break;case 4:He=k[J+1],Be=k[J+2],Ze=k[J+3],(192&He)==128&&(192&Be)==128&&(192&Ze)==128&&(ht=(15&be)<<18|(63&He)<<12|(63&Be)<<6|63&Ze)>65535&&ht<1114112&&(ke=ht)}}ke===null?(ke=65533,ct=1):ke>65535&&(ke-=65536,Y.push(ke>>>10&1023|55296),ke=56320|1023&ke),Y.push(ke),J+=ct}return W(Y)}function W(k){var U=k.length;if(U<=qe)return String.fromCharCode.apply(String,k);for(var q="",Y=0;YY)&&(q=Y);for(var J="",be=U;beq)throw new RangeError("Trying to access beyond buffer length")}function re(k,U,q,Y,J,be){if(!p.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>J||Uk.length)throw new RangeError("Index out of range")}function $(k,U,q,Y){U<0&&(U=65535+U+1);for(var J=0,be=Math.min(k.length-q,2);J>>8*(Y?J:1-J)}function ne(k,U,q,Y){U<0&&(U=4294967295+U+1);for(var J=0,be=Math.min(k.length-q,4);J>>8*(Y?J:3-J)&255}function he(k,U,q,Y,J,be){if(q+Y>k.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("Index out of range")}function pe(k,U,q,Y,J){return J||he(k,U,q,4,34028234663852886e22,-34028234663852886e22),Oe.write(k,U,q,Y,23,4),q+4}function Te(k,U,q,Y,J){return J||he(k,U,q,8,17976931348623157e292,-17976931348623157e292),Oe.write(k,U,q,Y,52,8),q+8}function we(k){if(k=Me(k).replace(ee,""),k.length<2)return"";for(;k.length%4!=0;)k+="=";return k}function Me(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}function Ee(k){return k<16?"0"+k.toString(16):k.toString(16)}function xe(k,U){U=U||1/0;for(var q,Y=k.length,J=null,be=[],ke=0;ke55295&&q<57344){if(!J){if(q>56319){(U-=3)>-1&&be.push(239,191,189);continue}if(ke+1===Y){(U-=3)>-1&&be.push(239,191,189);continue}J=q;continue}if(q<56320){(U-=3)>-1&&be.push(239,191,189),J=q;continue}q=65536+(J-55296<<10|q-56320)}else J&&(U-=3)>-1&&be.push(239,191,189);if(J=null,q<128){if((U-=1)<0)break;be.push(q)}else if(q<2048){if((U-=2)<0)break;be.push(q>>6|192,63&q|128)}else if(q<65536){if((U-=3)<0)break;be.push(q>>12|224,q>>6&63|128,63&q|128)}else{if(!(q<1114112))throw new Error("Invalid code point");if((U-=4)<0)break;be.push(q>>18|240,q>>12&63|128,q>>6&63|128,63&q|128)}}return be}function Ge(k){for(var U=[],q=0;q>8,J=q%256,be.push(J),be.push(Y);return be}function We(k){return le.toByteArray(we(k))}function ze(k,U,q,Y){for(var J=0;J=U.length||J>=k.length);++J)U[J+q]=k[J];return J}function de(k){return k!==k}var le=S("base64-js"),Oe=S("ieee754"),Ie=S("isarray");x.Buffer=p,x.SlowBuffer=c,x.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=T.TYPED_ARRAY_SUPPORT!==void 0?T.TYPED_ARRAY_SUPPORT:function(){try{var k=new Uint8Array(1);return k.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},k.foo()===42&&typeof k.subarray=="function"&&k.subarray(1,1).byteLength===0}catch(U){return!1}}(),x.kMaxLength=w(),p.poolSize=8192,p._augment=function(k){return k.__proto__=p.prototype,k},p.from=function(k,U,q){return u(null,k,U,q)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0})),p.alloc=function(k,U,q){return i(null,k,U,q)},p.allocUnsafe=function(k){return l(null,k)},p.allocUnsafeSlow=function(k){return l(null,k)},p.isBuffer=function(k){return!(k==null||!k._isBuffer)},p.compare=function(k,U){if(!p.isBuffer(k)||!p.isBuffer(U))throw new TypeError("Arguments must be Buffers");if(k===U)return 0;for(var q=k.length,Y=U.length,J=0,be=Math.min(q,Y);J0&&(k=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(k+=" ... ")),""},p.prototype.compare=function(k,U,q,Y,J){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");if(U===void 0&&(U=0),q===void 0&&(q=k?k.length:0),Y===void 0&&(Y=0),J===void 0&&(J=this.length),U<0||q>k.length||Y<0||J>this.length)throw new RangeError("out of range index");if(Y>=J&&U>=q)return 0;if(Y>=J)return-1;if(U>=q)return 1;if(U>>>=0,q>>>=0,Y>>>=0,J>>>=0,this===k)return 0;for(var be=J-Y,ke=q-U,ct=Math.min(be,ke),He=this.slice(Y,J),Be=k.slice(U,q),Ze=0;ZeJ)&&(q=J),k.length>0&&(q<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");for(var be=!1;;)switch(Y){case"hex":return y(this,k,U,q);case"utf8":case"utf-8":return C(this,k,U,q);case"ascii":return d(this,k,U,q);case"latin1":case"binary":return _(this,k,U,q);case"base64":return O(this,k,U,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,k,U,q);default:if(be)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),be=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var qe=4096;p.prototype.slice=function(k,U){var q=this.length;k=~~k,U=U===void 0?q:~~U,k<0?(k+=q)<0&&(k=0):k>q&&(k=q),U<0?(U+=q)<0&&(U=0):U>q&&(U=q),U0&&(J*=256);)Y+=this[k+--U]*J;return Y},p.prototype.readUInt8=function(k,U){return U||V(k,1,this.length),this[k]},p.prototype.readUInt16LE=function(k,U){return U||V(k,2,this.length),this[k]|this[k+1]<<8},p.prototype.readUInt16BE=function(k,U){return U||V(k,2,this.length),this[k]<<8|this[k+1]},p.prototype.readUInt32LE=function(k,U){return U||V(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+16777216*this[k+3]},p.prototype.readUInt32BE=function(k,U){return U||V(k,4,this.length),16777216*this[k]+(this[k+1]<<16|this[k+2]<<8|this[k+3])},p.prototype.readIntLE=function(k,U,q){k|=0,U|=0,q||V(k,U,this.length);for(var Y=this[k],J=1,be=0;++be=J&&(Y-=Math.pow(2,8*U)),Y},p.prototype.readIntBE=function(k,U,q){k|=0,U|=0,q||V(k,U,this.length);for(var Y=U,J=1,be=this[k+--Y];Y>0&&(J*=256);)be+=this[k+--Y]*J;return J*=128,be>=J&&(be-=Math.pow(2,8*U)),be},p.prototype.readInt8=function(k,U){return U||V(k,1,this.length),128&this[k]?-1*(255-this[k]+1):this[k]},p.prototype.readInt16LE=function(k,U){U||V(k,2,this.length);var q=this[k]|this[k+1]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt16BE=function(k,U){U||V(k,2,this.length);var q=this[k+1]|this[k]<<8;return 32768&q?4294901760|q:q},p.prototype.readInt32LE=function(k,U){return U||V(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},p.prototype.readInt32BE=function(k,U){return U||V(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},p.prototype.readFloatLE=function(k,U){return U||V(k,4,this.length),Oe.read(this,k,!0,23,4)},p.prototype.readFloatBE=function(k,U){return U||V(k,4,this.length),Oe.read(this,k,!1,23,4)},p.prototype.readDoubleLE=function(k,U){return U||V(k,8,this.length),Oe.read(this,k,!0,52,8)},p.prototype.readDoubleBE=function(k,U){return U||V(k,8,this.length),Oe.read(this,k,!1,52,8)},p.prototype.writeUIntLE=function(k,U,q,Y){(k=+k,U|=0,q|=0,!Y)&&re(this,k,U,q,Math.pow(2,8*q)-1,0);var J=1,be=0;for(this[U]=255&k;++be=0&&(be*=256);)this[U+J]=k/be&255;return U+q},p.prototype.writeUInt8=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,1,255,0),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),this[U]=255&k,U+1},p.prototype.writeUInt16LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8):$(this,k,U,!0),U+2},p.prototype.writeUInt16BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>8,this[U+1]=255&k):$(this,k,U,!1),U+2},p.prototype.writeUInt32LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U+3]=k>>>24,this[U+2]=k>>>16,this[U+1]=k>>>8,this[U]=255&k):ne(this,k,U,!0),U+4},p.prototype.writeUInt32BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>24,this[U+1]=k>>>16,this[U+2]=k>>>8,this[U+3]=255&k):ne(this,k,U,!1),U+4},p.prototype.writeIntLE=function(k,U,q,Y){if(k=+k,U|=0,!Y){var J=Math.pow(2,8*q-1);re(this,k,U,q,J-1,-J)}var be=0,ke=1,ct=0;for(this[U]=255&k;++be>0)-ct&255;return U+q},p.prototype.writeIntBE=function(k,U,q,Y){if(k=+k,U|=0,!Y){var J=Math.pow(2,8*q-1);re(this,k,U,q,J-1,-J)}var be=q-1,ke=1,ct=0;for(this[U+be]=255&k;--be>=0&&(ke*=256);)k<0&&ct===0&&this[U+be+1]!==0&&(ct=1),this[U+be]=(k/ke>>0)-ct&255;return U+q},p.prototype.writeInt8=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,1,127,-128),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),k<0&&(k=255+k+1),this[U]=255&k,U+1},p.prototype.writeInt16LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8):$(this,k,U,!0),U+2},p.prototype.writeInt16BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>8,this[U+1]=255&k):$(this,k,U,!1),U+2},p.prototype.writeInt32LE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[U]=255&k,this[U+1]=k>>>8,this[U+2]=k>>>16,this[U+3]=k>>>24):ne(this,k,U,!0),U+4},p.prototype.writeInt32BE=function(k,U,q){return k=+k,U|=0,q||re(this,k,U,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),p.TYPED_ARRAY_SUPPORT?(this[U]=k>>>24,this[U+1]=k>>>16,this[U+2]=k>>>8,this[U+3]=255&k):ne(this,k,U,!1),U+4},p.prototype.writeFloatLE=function(k,U,q){return pe(this,k,U,!0,q)},p.prototype.writeFloatBE=function(k,U,q){return pe(this,k,U,!1,q)},p.prototype.writeDoubleLE=function(k,U,q){return Te(this,k,U,!0,q)},p.prototype.writeDoubleBE=function(k,U,q){return Te(this,k,U,!1,q)},p.prototype.copy=function(k,U,q,Y){if(q||(q=0),Y||Y===0||(Y=this.length),U>=k.length&&(U=k.length),U||(U=0),Y>0&&Y=this.length)throw new RangeError("sourceStart out of bounds");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),k.length-U=0;--J)k[J+U]=this[J+q];else if(be<1e3||!p.TYPED_ARRAY_SUPPORT)for(J=0;J>>=0,q=q===void 0?this.length:q>>>0,k||(k=0);var be;if(typeof k=="number")for(be=U;be>>1;u(f[l])2&&(v=h.call(arguments,1)),n(v)})})}function p(r){return Promise.all(r.map(w,this))}function u(r){for(var t=new r.constructor,n=Object.keys(r),c=[],m=0;mr;)if((l=s[r++])!=l)return!0}else for(;h>r;r++)if((p||r in s)&&s[r]===o)return p||r||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(S,D,x){var T=S("./_cof"),w=S("./_wks")("toStringTag"),f=T(function(){return arguments}())=="Arguments",p=function(u,o){try{return u[o]}catch(i){}};D.exports=function(u){var o,i,l;return u===void 0?"Undefined":u===null?"Null":typeof(i=p(o=Object(u),w))=="string"?i:f?T(o):(l=T(o))=="Object"&&typeof o.callee=="function"?"Arguments":l}},{"./_cof":64,"./_wks":131}],64:[function(S,D,x){var T={}.toString;D.exports=function(w){return T.call(w).slice(8,-1)}},{}],65:[function(S,D,x){var T=D.exports={version:"2.5.7"};typeof __e=="number"&&(__e=T)},{}],66:[function(S,D,x){"use strict";var T=S("./_object-dp"),w=S("./_property-desc");D.exports=function(f,p,u){p in f?T.f(f,p,w(0,u)):f[p]=u}},{"./_object-dp":98,"./_property-desc":111}],67:[function(S,D,x){var T=S("./_a-function");D.exports=function(w,f,p){if(T(w),f===void 0)return w;switch(p){case 1:return function(u){return w.call(f,u)};case 2:return function(u,o){return w.call(f,u,o)};case 3:return function(u,o,i){return w.call(f,u,o,i)}}return function(){return w.apply(f,arguments)}}},{"./_a-function":58}],68:[function(S,D,x){D.exports=function(T){if(T==null)throw TypeError("Can't call method on "+T);return T}},{}],69:[function(S,D,x){D.exports=!S("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(S,D,x){var T=S("./_is-object"),w=S("./_global").document,f=T(w)&&T(w.createElement);D.exports=function(p){return f?w.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(S,D,x){D.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(S,D,x){var T=S("./_object-keys"),w=S("./_object-gops"),f=S("./_object-pie");D.exports=function(p){var u=T(p),o=w.f;if(o)for(var i,l=o(p),s=f.f,h=0;l.length>h;)s.call(p,i=l[h++])&&u.push(i);return u}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(S,D,x){var T=S("./_global"),w=S("./_core"),f=S("./_ctx"),p=S("./_hide"),u=S("./_has"),o=function(i,l,s){var h,r,t,n=i&o.F,c=i&o.G,m=i&o.S,v=i&o.P,b=i&o.B,E=i&o.W,g=c?w:w[l]||(w[l]={}),y=g.prototype,C=c?T:m?T[l]:(T[l]||{}).prototype;c&&(s=l);for(h in s)(r=!n&&C&&C[h]!==void 0)&&u(g,h)||(t=r?C[h]:s[h],g[h]=c&&typeof C[h]!="function"?s[h]:b&&r?f(t,T):E&&C[h]==t?function(d){var _=function(O,A,P){if(this instanceof d){switch(arguments.length){case 0:return new d;case 1:return new d(O);case 2:return new d(O,A)}return new d(O,A,P)}return d.apply(this,arguments)};return _.prototype=d.prototype,_}(t):v&&typeof t=="function"?f(Function.call,t):t,v&&((g.virtual||(g.virtual={}))[h]=t,i&o.R&&y&&!y[h]&&p(y,h,t)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,D.exports=o},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(S,D,x){D.exports=function(T){try{return!!T()}catch(w){return!0}}},{}],75:[function(S,D,x){var T=S("./_ctx"),w=S("./_iter-call"),f=S("./_is-array-iter"),p=S("./_an-object"),u=S("./_to-length"),o=S("./core.get-iterator-method"),i={},l={},x=D.exports=function(s,h,r,t,n){var c,m,v,b,E=n?function(){return s}:o(s),g=T(r,t,h?2:1),y=0;if(typeof E!="function")throw TypeError(s+" is not iterable!");if(f(E)){for(c=u(s.length);c>y;y++)if((b=h?g(p(m=s[y])[0],m[1]):g(s[y]))===i||b===l)return b}else for(v=E.call(s);!(m=v.next()).done;)if((b=w(v,g,m.value,h))===i||b===l)return b};x.BREAK=i,x.RETURN=l},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(S,D,x){var T=D.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=T)},{}],77:[function(S,D,x){var T={}.hasOwnProperty;D.exports=function(w,f){return T.call(w,f)}},{}],78:[function(S,D,x){var T=S("./_object-dp"),w=S("./_property-desc");D.exports=S("./_descriptors")?function(f,p,u){return T.f(f,p,w(1,u))}:function(f,p,u){return f[p]=u,f}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(S,D,x){var T=S("./_global").document;D.exports=T&&T.documentElement},{"./_global":76}],80:[function(S,D,x){D.exports=!S("./_descriptors")&&!S("./_fails")(function(){return Object.defineProperty(S("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(S,D,x){D.exports=function(T,w,f){var p=f===void 0;switch(w.length){case 0:return p?T():T.call(f);case 1:return p?T(w[0]):T.call(f,w[0]);case 2:return p?T(w[0],w[1]):T.call(f,w[0],w[1]);case 3:return p?T(w[0],w[1],w[2]):T.call(f,w[0],w[1],w[2]);case 4:return p?T(w[0],w[1],w[2],w[3]):T.call(f,w[0],w[1],w[2],w[3])}return T.apply(f,w)}},{}],82:[function(S,D,x){var T=S("./_cof");D.exports=Object("z").propertyIsEnumerable(0)?Object:function(w){return T(w)=="String"?w.split(""):Object(w)}},{"./_cof":64}],83:[function(S,D,x){var T=S("./_iterators"),w=S("./_wks")("iterator"),f=Array.prototype;D.exports=function(p){return p!==void 0&&(T.Array===p||f[w]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(S,D,x){var T=S("./_cof");D.exports=Array.isArray||function(w){return T(w)=="Array"}},{"./_cof":64}],85:[function(S,D,x){D.exports=function(T){return typeof T=="object"?T!==null:typeof T=="function"}},{}],86:[function(S,D,x){var T=S("./_an-object");D.exports=function(w,f,p,u){try{return u?f(T(p)[0],p[1]):f(p)}catch(i){var o=w.return;throw o!==void 0&&T(o.call(w)),i}}},{"./_an-object":61}],87:[function(S,D,x){"use strict";var T=S("./_object-create"),w=S("./_property-desc"),f=S("./_set-to-string-tag"),p={};S("./_hide")(p,S("./_wks")("iterator"),function(){return this}),D.exports=function(u,o,i){u.prototype=T(p,{next:w(1,i)}),f(u,o+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(S,D,x){"use strict";var T=S("./_library"),w=S("./_export"),f=S("./_redefine"),p=S("./_hide"),u=S("./_iterators"),o=S("./_iter-create"),i=S("./_set-to-string-tag"),l=S("./_object-gpo"),s=S("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),r=function(){return this};D.exports=function(t,n,c,m,v,b,E){o(c,n,m);var g,y,C,d=function(H){if(!h&&H in P)return P[H];switch(H){case"keys":case"values":return function(){return new c(this,H)}}return function(){return new c(this,H)}},_=n+" Iterator",O=v=="values",A=!1,P=t.prototype,I=P[s]||P["@@iterator"]||v&&P[v],W=I||d(v),K=v?O?d("entries"):W:void 0,te=n=="Array"&&P.entries||I;if(te&&(C=l(te.call(new t)))!==Object.prototype&&C.next&&(i(C,_,!0),T||typeof C[s]=="function"||p(C,s,r)),O&&I&&I.name!=="values"&&(A=!0,W=function(){return I.call(this)}),T&&!E||!h&&!A&&P[s]||p(P,s,W),u[n]=W,u[_]=r,v)if(g={values:O?W:d("values"),keys:b?W:d("keys"),entries:K},E)for(y in g)y in P||f(P,y,g[y]);else w(w.P+w.F*(h||A),n,g);return g}},{"./_export":73,"./_hide":78,"./_iter-create":87,"./_iterators":91,"./_library":92,"./_object-gpo":104,"./_redefine":113,"./_set-to-string-tag":115,"./_wks":131}],89:[function(S,D,x){var T=S("./_wks")("iterator"),w=!1;try{var f=[7][T]();f.return=function(){w=!0},Array.from(f,function(){throw 2})}catch(p){}D.exports=function(p,u){if(!u&&!w)return!1;var o=!1;try{var i=[7],l=i[T]();l.next=function(){return{done:o=!0}},i[T]=function(){return l},p(i)}catch(s){}return o}},{"./_wks":131}],90:[function(S,D,x){D.exports=function(T,w){return{value:w,done:!!T}}},{}],91:[function(S,D,x){D.exports={}},{}],92:[function(S,D,x){D.exports=!0},{}],93:[function(S,D,x){var T=S("./_uid")("meta"),w=S("./_is-object"),f=S("./_has"),p=S("./_object-dp").f,u=0,o=Object.isExtensible||function(){return!0},i=!S("./_fails")(function(){return o(Object.preventExtensions({}))}),l=function(n){p(n,T,{value:{i:"O"+ ++u,w:{}}})},s=function(n,c){if(!w(n))return typeof n=="symbol"?n:(typeof n=="string"?"S":"P")+n;if(!f(n,T)){if(!o(n))return"F";if(!c)return"E";l(n)}return n[T].i},h=function(n,c){if(!f(n,T)){if(!o(n))return!0;if(!c)return!1;l(n)}return n[T].w},r=function(n){return i&&t.NEED&&o(n)&&!f(n,T)&&l(n),n},t=D.exports={KEY:T,NEED:!1,fastKey:s,getWeak:h,onFreeze:r}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(S,D,x){var T=S("./_global"),w=S("./_task").set,f=T.MutationObserver||T.WebKitMutationObserver,p=T.process,u=T.Promise,o=S("./_cof")(p)=="process";D.exports=function(){var i,l,s,h=function(){var c,m;for(o&&(c=p.domain)&&c.exit();i;){m=i.fn,i=i.next;try{m()}catch(v){throw i?s():l=void 0,v}}l=void 0,c&&c.enter()};if(o)s=function(){p.nextTick(h)};else if(!f||T.navigator&&T.navigator.standalone)if(u&&u.resolve){var r=u.resolve(void 0);s=function(){r.then(h)}}else s=function(){w.call(T,h)};else{var t=!0,n=document.createTextNode("");new f(h).observe(n,{characterData:!0}),s=function(){n.data=t=!t}}return function(c){var m={fn:c,next:void 0};l&&(l.next=m),i||(i=m,s()),l=m}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(S,D,x){"use strict";function T(f){var p,u;this.promise=new f(function(o,i){if(p!==void 0||u!==void 0)throw TypeError("Bad Promise constructor");p=o,u=i}),this.resolve=w(p),this.reject=w(u)}var w=S("./_a-function");D.exports.f=function(f){return new T(f)}},{"./_a-function":58}],96:[function(S,D,x){"use strict";var T=S("./_object-keys"),w=S("./_object-gops"),f=S("./_object-pie"),p=S("./_to-object"),u=S("./_iobject"),o=Object.assign;D.exports=!o||S("./_fails")(function(){var i={},l={},s=Symbol(),h="abcdefghijklmnopqrst";return i[s]=7,h.split("").forEach(function(r){l[r]=r}),o({},i)[s]!=7||Object.keys(o({},l)).join("")!=h})?function(i,l){for(var s=p(i),h=arguments.length,r=1,t=w.f,n=f.f;h>r;)for(var c,m=u(arguments[r++]),v=t?T(m).concat(t(m)):T(m),b=v.length,E=0;b>E;)n.call(m,c=v[E++])&&(s[c]=m[c]);return s}:o},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(S,D,x){var T=S("./_an-object"),w=S("./_object-dps"),f=S("./_enum-bug-keys"),p=S("./_shared-key")("IE_PROTO"),u=function(){},o=function(){var i,l=S("./_dom-create")("iframe"),s=f.length;for(l.style.display="none",S("./_html").appendChild(l),l.src="javascript:",i=l.contentWindow.document,i.open(),i.write(""),i.close(),o=i.F;s--;)delete o.prototype[f[s]];return o()};D.exports=Object.create||function(i,l){var s;return i!==null?(u.prototype=T(i),s=new u,u.prototype=null,s[p]=i):s=o(),l===void 0?s:w(s,l)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(S,D,x){var T=S("./_an-object"),w=S("./_ie8-dom-define"),f=S("./_to-primitive"),p=Object.defineProperty;x.f=S("./_descriptors")?Object.defineProperty:function(u,o,i){if(T(u),o=f(o,!0),T(i),w)try{return p(u,o,i)}catch(l){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(u[o]=i.value),u}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(S,D,x){var T=S("./_object-dp"),w=S("./_an-object"),f=S("./_object-keys");D.exports=S("./_descriptors")?Object.defineProperties:function(p,u){w(p);for(var o,i=f(u),l=i.length,s=0;l>s;)T.f(p,o=i[s++],u[o]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(S,D,x){var T=S("./_object-pie"),w=S("./_property-desc"),f=S("./_to-iobject"),p=S("./_to-primitive"),u=S("./_has"),o=S("./_ie8-dom-define"),i=Object.getOwnPropertyDescriptor;x.f=S("./_descriptors")?i:function(l,s){if(l=f(l),s=p(s,!0),o)try{return i(l,s)}catch(h){}if(u(l,s))return w(!T.f.call(l,s),l[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(S,D,x){var T=S("./_to-iobject"),w=S("./_object-gopn").f,f={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(o){try{return w(o)}catch(i){return p.slice()}};D.exports.f=function(o){return p&&f.call(o)=="[object Window]"?u(o):w(T(o))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(S,D,x){var T=S("./_object-keys-internal"),w=S("./_enum-bug-keys").concat("length","prototype");x.f=Object.getOwnPropertyNames||function(f){return T(f,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(S,D,x){x.f=Object.getOwnPropertySymbols},{}],104:[function(S,D,x){var T=S("./_has"),w=S("./_to-object"),f=S("./_shared-key")("IE_PROTO"),p=Object.prototype;D.exports=Object.getPrototypeOf||function(u){return u=w(u),T(u,f)?u[f]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(S,D,x){var T=S("./_has"),w=S("./_to-iobject"),f=S("./_array-includes")(!1),p=S("./_shared-key")("IE_PROTO");D.exports=function(u,o){var i,l=w(u),s=0,h=[];for(i in l)i!=p&&T(l,i)&&h.push(i);for(;o.length>s;)T(l,i=o[s++])&&(~f(h,i)||h.push(i));return h}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(S,D,x){var T=S("./_object-keys-internal"),w=S("./_enum-bug-keys");D.exports=Object.keys||function(f){return T(f,w)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(S,D,x){x.f={}.propertyIsEnumerable},{}],108:[function(S,D,x){var T=S("./_export"),w=S("./_core"),f=S("./_fails");D.exports=function(p,u){var o=(w.Object||{})[p]||Object[p],i={};i[p]=u(o),T(T.S+T.F*f(function(){o(1)}),"Object",i)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(S,D,x){D.exports=function(T){try{return{e:!1,v:T()}}catch(w){return{e:!0,v:w}}}},{}],110:[function(S,D,x){var T=S("./_an-object"),w=S("./_is-object"),f=S("./_new-promise-capability");D.exports=function(p,u){if(T(p),w(u)&&u.constructor===p)return u;var o=f.f(p);return(0,o.resolve)(u),o.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(S,D,x){D.exports=function(T,w){return{enumerable:!(1&T),configurable:!(2&T),writable:!(4&T),value:w}}},{}],112:[function(S,D,x){var T=S("./_hide");D.exports=function(w,f,p){for(var u in f)p&&w[u]?w[u]=f[u]:T(w,u,f[u]);return w}},{"./_hide":78}],113:[function(S,D,x){D.exports=S("./_hide")},{"./_hide":78}],114:[function(S,D,x){"use strict";var T=S("./_global"),w=S("./_core"),f=S("./_object-dp"),p=S("./_descriptors"),u=S("./_wks")("species");D.exports=function(o){var i=typeof w[o]=="function"?w[o]:T[o];p&&i&&!i[u]&&f.f(i,u,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(S,D,x){var T=S("./_object-dp").f,w=S("./_has"),f=S("./_wks")("toStringTag");D.exports=function(p,u,o){p&&!w(p=o?p:p.prototype,f)&&T(p,f,{configurable:!0,value:u})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(S,D,x){var T=S("./_shared")("keys"),w=S("./_uid");D.exports=function(f){return T[f]||(T[f]=w(f))}},{"./_shared":117,"./_uid":127}],117:[function(S,D,x){var T=S("./_core"),w=S("./_global"),f=w["__core-js_shared__"]||(w["__core-js_shared__"]={});(D.exports=function(p,u){return f[p]||(f[p]=u!==void 0?u:{})})("versions",[]).push({version:T.version,mode:S("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(S,D,x){var T=S("./_an-object"),w=S("./_a-function"),f=S("./_wks")("species");D.exports=function(p,u){var o,i=T(p).constructor;return i===void 0||(o=T(i)[f])==null?u:w(o)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(S,D,x){var T=S("./_to-integer"),w=S("./_defined");D.exports=function(f){return function(p,u){var o,i,l=String(w(p)),s=T(u),h=l.length;return s<0||s>=h?f?"":void 0:(o=l.charCodeAt(s),o<55296||o>56319||s+1===h||(i=l.charCodeAt(s+1))<56320||i>57343?f?l.charAt(s):o:f?l.slice(s,s+2):i-56320+(o-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(S,D,x){var T,w,f,p=S("./_ctx"),u=S("./_invoke"),o=S("./_html"),i=S("./_dom-create"),l=S("./_global"),s=l.process,h=l.setImmediate,r=l.clearImmediate,t=l.MessageChannel,n=l.Dispatch,c=0,m={},v=function(){var E=+this;if(m.hasOwnProperty(E)){var g=m[E];delete m[E],g()}},b=function(E){v.call(E.data)};h&&r||(h=function(E){for(var g=[],y=1;arguments.length>y;)g.push(arguments[y++]);return m[++c]=function(){u(typeof E=="function"?E:Function(E),g)},T(c),c},r=function(E){delete m[E]},S("./_cof")(s)=="process"?T=function(E){s.nextTick(p(v,E,1))}:n&&n.now?T=function(E){n.now(p(v,E,1))}:t?(w=new t,f=w.port2,w.port1.onmessage=b,T=p(f.postMessage,f,1)):l.addEventListener&&typeof postMessage=="function"&&!l.importScripts?(T=function(E){l.postMessage(E+"","*")},l.addEventListener("message",b,!1)):T="onreadystatechange"in i("script")?function(E){o.appendChild(i("script")).onreadystatechange=function(){o.removeChild(this),v.call(E)}}:function(E){setTimeout(p(v,E,1),0)}),D.exports={set:h,clear:r}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(S,D,x){var T=S("./_to-integer"),w=Math.max,f=Math.min;D.exports=function(p,u){return p=T(p),p<0?w(p+u,0):f(p,u)}},{"./_to-integer":122}],122:[function(S,D,x){var T=Math.ceil,w=Math.floor;D.exports=function(f){return isNaN(f=+f)?0:(f>0?w:T)(f)}},{}],123:[function(S,D,x){var T=S("./_iobject"),w=S("./_defined");D.exports=function(f){return T(w(f))}},{"./_defined":68,"./_iobject":82}],124:[function(S,D,x){var T=S("./_to-integer"),w=Math.min;D.exports=function(f){return f>0?w(T(f),9007199254740991):0}},{"./_to-integer":122}],125:[function(S,D,x){var T=S("./_defined");D.exports=function(w){return Object(T(w))}},{"./_defined":68}],126:[function(S,D,x){var T=S("./_is-object");D.exports=function(w,f){if(!T(w))return w;var p,u;if(f&&typeof(p=w.toString)=="function"&&!T(u=p.call(w)))return u;if(typeof(p=w.valueOf)=="function"&&!T(u=p.call(w)))return u;if(!f&&typeof(p=w.toString)=="function"&&!T(u=p.call(w)))return u;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(S,D,x){var T=0,w=Math.random();D.exports=function(f){return"Symbol(".concat(f===void 0?"":f,")_",(++T+w).toString(36))}},{}],128:[function(S,D,x){var T=S("./_global"),w=T.navigator;D.exports=w&&w.userAgent||""},{"./_global":76}],129:[function(S,D,x){var T=S("./_global"),w=S("./_core"),f=S("./_library"),p=S("./_wks-ext"),u=S("./_object-dp").f;D.exports=function(o){var i=w.Symbol||(w.Symbol=f?{}:T.Symbol||{});o.charAt(0)=="_"||o in i||u(i,o,{value:p.f(o)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(S,D,x){x.f=S("./_wks")},{"./_wks":131}],131:[function(S,D,x){var T=S("./_shared")("wks"),w=S("./_uid"),f=S("./_global").Symbol,p=typeof f=="function";(D.exports=function(u){return T[u]||(T[u]=p&&f[u]||(p?f:w)("Symbol."+u))}).store=T},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(S,D,x){var T=S("./_classof"),w=S("./_wks")("iterator"),f=S("./_iterators");D.exports=S("./_core").getIteratorMethod=function(p){if(p!=null)return p[w]||p["@@iterator"]||f[T(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(S,D,x){"use strict";var T=S("./_ctx"),w=S("./_export"),f=S("./_to-object"),p=S("./_iter-call"),u=S("./_is-array-iter"),o=S("./_to-length"),i=S("./_create-property"),l=S("./core.get-iterator-method");w(w.S+w.F*!S("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var h,r,t,n,c=f(s),m=typeof this=="function"?this:Array,v=arguments.length,b=v>1?arguments[1]:void 0,E=b!==void 0,g=0,y=l(c);if(E&&(b=T(b,v>2?arguments[2]:void 0,2)),y==null||m==Array&&u(y))for(h=o(c.length),r=new m(h);h>g;g++)i(r,g,E?b(c[g],g):c[g]);else for(n=y.call(c),r=new m;!(t=n.next()).done;g++)i(r,g,E?p(n,b,[t.value,g],!0):t.value);return r.length=g,r}})},{"./_create-property":66,"./_ctx":67,"./_export":73,"./_is-array-iter":83,"./_iter-call":86,"./_iter-detect":89,"./_to-length":124,"./_to-object":125,"./core.get-iterator-method":132}],134:[function(S,D,x){"use strict";var T=S("./_add-to-unscopables"),w=S("./_iter-step"),f=S("./_iterators"),p=S("./_to-iobject");D.exports=S("./_iter-define")(Array,"Array",function(u,o){this._t=p(u),this._i=0,this._k=o},function(){var u=this._t,o=this._k,i=this._i++;return!u||i>=u.length?(this._t=void 0,w(1)):o=="keys"?w(0,i):o=="values"?w(0,u[i]):w(0,[i,u[i]])},"values"),f.Arguments=f.Array,T("keys"),T("values"),T("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(S,D,x){"use strict";var T=S("./_is-object"),w=S("./_object-gpo"),f=S("./_wks")("hasInstance"),p=Function.prototype;f in p||S("./_object-dp").f(p,f,{value:function(u){if(typeof this!="function"||!T(u))return!1;if(!T(this.prototype))return u instanceof this;for(;u=w(u);)if(this.prototype===u)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(S,D,x){var T=S("./_export");T(T.S+T.F,"Object",{assign:S("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(S,D,x){var T=S("./_export");T(T.S,"Object",{create:S("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(S,D,x){var T=S("./_export");T(T.S+T.F*!S("./_descriptors"),"Object",{defineProperty:S("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(S,D,x){S("./_object-sap")("getOwnPropertyNames",function(){return S("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(S,D,x){var T=S("./_to-object"),w=S("./_object-gpo");S("./_object-sap")("getPrototypeOf",function(){return function(f){return w(T(f))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(S,D,x){var T=S("./_to-object"),w=S("./_object-keys");S("./_object-sap")("keys",function(){return function(f){return w(T(f))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(S,D,x){arguments[4][36][0].apply(x,arguments)},{dup:36}],143:[function(S,D,x){"use strict";var T,w,f,p,u=S("./_library"),o=S("./_global"),i=S("./_ctx"),l=S("./_classof"),s=S("./_export"),h=S("./_is-object"),r=S("./_a-function"),t=S("./_an-instance"),n=S("./_for-of"),c=S("./_species-constructor"),m=S("./_task").set,v=S("./_microtask")(),b=S("./_new-promise-capability"),E=S("./_perform"),g=S("./_user-agent"),y=S("./_promise-resolve"),C=o.TypeError,d=o.process,_=d&&d.versions,O=_&&_.v8||"",A=o.Promise,P=l(d)=="process",I=function(){},W=w=b.f,K=!!function(){try{var he=A.resolve(1),pe=(he.constructor={})[S("./_wks")("species")]=function(Te){Te(I,I)};return(P||typeof PromiseRejectionEvent=="function")&&he.then(I)instanceof pe&&O.indexOf("6.6")!==0&&g.indexOf("Chrome/66")===-1}catch(Te){}}(),te=function(he){var pe;return!(!h(he)||typeof(pe=he.then)!="function")&&pe},H=function(he,pe){if(!he._n){he._n=!0;var Te=he._c;v(function(){for(var we=he._v,Me=he._s==1,Ee=0;Te.length>Ee;)!function(xe){var Ge,je,We,ze=Me?xe.ok:xe.fail,de=xe.resolve,le=xe.reject,Oe=xe.domain;try{ze?(Me||(he._h==2&&re(he),he._h=1),ze===!0?Ge=we:(Oe&&Oe.enter(),Ge=ze(we),Oe&&(Oe.exit(),We=!0)),Ge===xe.promise?le(C("Promise-chain cycle")):(je=te(Ge))?je.call(Ge,de,le):de(Ge)):le(we)}catch(Ie){Oe&&!We&&Oe.exit(),le(Ie)}}(Te[Ee++]);he._c=[],he._n=!1,pe&&!he._h&&G(he)})}},G=function(he){m.call(o,function(){var pe,Te,we,Me=he._v,Ee=V(he);if(Ee&&(pe=E(function(){P?d.emit("unhandledRejection",Me,he):(Te=o.onunhandledrejection)?Te({promise:he,reason:Me}):(we=o.console)&&we.error&&we.error("Unhandled promise rejection",Me)}),he._h=P||V(he)?2:1),he._a=void 0,Ee&&pe.e)throw pe.v})},V=function(he){return he._h!==1&&(he._a||he._c).length===0},re=function(he){m.call(o,function(){var pe;P?d.emit("rejectionHandled",he):(pe=o.onrejectionhandled)&&pe({promise:he,reason:he._v})})},$=function(he){var pe=this;pe._d||(pe._d=!0,pe=pe._w||pe,pe._v=he,pe._s=2,pe._a||(pe._a=pe._c.slice()),H(pe,!0))},ne=function(he){var pe,Te=this;if(!Te._d){Te._d=!0,Te=Te._w||Te;try{if(Te===he)throw C("Promise can't be resolved itself");(pe=te(he))?v(function(){var we={_w:Te,_d:!1};try{pe.call(he,i(ne,we,1),i($,we,1))}catch(Me){$.call(we,Me)}}):(Te._v=he,Te._s=1,H(Te,!1))}catch(we){$.call({_w:Te,_d:!1},we)}}};K||(A=function(he){t(this,A,"Promise","_h"),r(he),T.call(this);try{he(i(ne,this,1),i($,this,1))}catch(pe){$.call(this,pe)}},T=function(he){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},T.prototype=S("./_redefine-all")(A.prototype,{then:function(he,pe){var Te=W(c(this,A));return Te.ok=typeof he!="function"||he,Te.fail=typeof pe=="function"&&pe,Te.domain=P?d.domain:void 0,this._c.push(Te),this._a&&this._a.push(Te),this._s&&H(this,!1),Te.promise},catch:function(he){return this.then(void 0,he)}}),f=function(){var he=new T;this.promise=he,this.resolve=i(ne,he,1),this.reject=i($,he,1)},b.f=W=function(he){return he===A||he===p?new f(he):w(he)}),s(s.G+s.W+s.F*!K,{Promise:A}),S("./_set-to-string-tag")(A,"Promise"),S("./_set-species")("Promise"),p=S("./_core").Promise,s(s.S+s.F*!K,"Promise",{reject:function(he){var pe=W(this);return(0,pe.reject)(he),pe.promise}}),s(s.S+s.F*(u||!K),"Promise",{resolve:function(he){return y(u&&this===p?A:this,he)}}),s(s.S+s.F*!(K&&S("./_iter-detect")(function(he){A.all(he).catch(I)})),"Promise",{all:function(he){var pe=this,Te=W(pe),we=Te.resolve,Me=Te.reject,Ee=E(function(){var xe=[],Ge=0,je=1;n(he,!1,function(We){var ze=Ge++,de=!1;xe.push(void 0),je++,pe.resolve(We).then(function(le){de||(de=!0,xe[ze]=le,--je||we(xe))},Me)}),--je||we(xe)});return Ee.e&&Me(Ee.v),Te.promise},race:function(he){var pe=this,Te=W(pe),we=Te.reject,Me=E(function(){n(he,!1,function(Ee){pe.resolve(Ee).then(Te.resolve,we)})});return Me.e&&we(Me.v),Te.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(S,D,x){var T=S("./_export"),w=S("./_to-absolute-index"),f=String.fromCharCode,p=String.fromCodePoint;T(T.S+T.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(u){for(var o,i=[],l=arguments.length,s=0;l>s;){if(o=+arguments[s++],w(o,1114111)!==o)throw RangeError(o+" is not a valid code point");i.push(o<65536?f(o):f(55296+((o-=65536)>>10),o%1024+56320))}return i.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(S,D,x){"use strict";var T=S("./_string-at")(!0);S("./_iter-define")(String,"String",function(w){this._t=String(w),this._i=0},function(){var w,f=this._t,p=this._i;return p>=f.length?{value:void 0,done:!0}:(w=T(f,p),this._i+=w.length,{value:w,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(S,D,x){"use strict";var T=S("./_global"),w=S("./_has"),f=S("./_descriptors"),p=S("./_export"),u=S("./_redefine"),o=S("./_meta").KEY,i=S("./_fails"),l=S("./_shared"),s=S("./_set-to-string-tag"),h=S("./_uid"),r=S("./_wks"),t=S("./_wks-ext"),n=S("./_wks-define"),c=S("./_enum-keys"),m=S("./_is-array"),v=S("./_an-object"),b=S("./_is-object"),E=S("./_to-iobject"),g=S("./_to-primitive"),y=S("./_property-desc"),C=S("./_object-create"),d=S("./_object-gopn-ext"),_=S("./_object-gopd"),O=S("./_object-dp"),A=S("./_object-keys"),P=_.f,I=O.f,W=d.f,K=T.Symbol,te=T.JSON,H=te&&te.stringify,G=r("_hidden"),V=r("toPrimitive"),re={}.propertyIsEnumerable,$=l("symbol-registry"),ne=l("symbols"),he=l("op-symbols"),pe=Object.prototype,Te=typeof K=="function",we=T.QObject,Me=!we||!we.prototype||!we.prototype.findChild,Ee=f&&i(function(){return C(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function(q,Y,J){var be=P(pe,Y);be&&delete pe[Y],I(q,Y,J),be&&q!==pe&&I(pe,Y,be)}:I,xe=function(q){var Y=ne[q]=C(K.prototype);return Y._k=q,Y},Ge=Te&&typeof K.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof K},je=function(q,Y,J){return q===pe&&je(he,Y,J),v(q),Y=g(Y,!0),v(J),w(ne,Y)?(J.enumerable?(w(q,G)&&q[G][Y]&&(q[G][Y]=!1),J=C(J,{enumerable:y(0,!1)})):(w(q,G)||I(q,G,y(1,{})),q[G][Y]=!0),Ee(q,Y,J)):I(q,Y,J)},We=function(q,Y){v(q);for(var J,be=c(Y=E(Y)),ke=0,ct=be.length;ct>ke;)je(q,J=be[ke++],Y[J]);return q},ze=function(q,Y){return Y===void 0?C(q):We(C(q),Y)},de=function(q){var Y=re.call(this,q=g(q,!0));return!(this===pe&&w(ne,q)&&!w(he,q))&&(!(Y||!w(this,q)||!w(ne,q)||w(this,G)&&this[G][q])||Y)},le=function(q,Y){if(q=E(q),Y=g(Y,!0),q!==pe||!w(ne,Y)||w(he,Y)){var J=P(q,Y);return!J||!w(ne,Y)||w(q,G)&&q[G][Y]||(J.enumerable=!0),J}},Oe=function(q){for(var Y,J=W(E(q)),be=[],ke=0;J.length>ke;)w(ne,Y=J[ke++])||Y==G||Y==o||be.push(Y);return be},Ie=function(q){for(var Y,J=q===pe,be=W(J?he:E(q)),ke=[],ct=0;be.length>ct;)!w(ne,Y=be[ct++])||J&&!w(pe,Y)||ke.push(ne[Y]);return ke};Te||(K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor!");var q=h(arguments.length>0?arguments[0]:void 0),Y=function(J){this===pe&&Y.call(he,J),w(this,G)&&w(this[G],q)&&(this[G][q]=!1),Ee(this,q,y(1,J))};return f&&Me&&Ee(pe,q,{configurable:!0,set:Y}),xe(q)},u(K.prototype,"toString",function(){return this._k}),_.f=le,O.f=je,S("./_object-gopn").f=d.f=Oe,S("./_object-pie").f=de,S("./_object-gops").f=Ie,f&&!S("./_library")&&u(pe,"propertyIsEnumerable",de,!0),t.f=function(q){return xe(r(q))}),p(p.G+p.W+p.F*!Te,{Symbol:K});for(var qe="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;qe.length>ee;)r(qe[ee++]);for(var k=A(r.store),U=0;k.length>U;)n(k[U++]);p(p.S+p.F*!Te,"Symbol",{for:function(q){return w($,q+="")?$[q]:$[q]=K(q)},keyFor:function(q){if(!Ge(q))throw TypeError(q+" is not a symbol!");for(var Y in $)if($[Y]===q)return Y},useSetter:function(){Me=!0},useSimple:function(){Me=!1}}),p(p.S+p.F*!Te,"Object",{create:ze,defineProperty:je,defineProperties:We,getOwnPropertyDescriptor:le,getOwnPropertyNames:Oe,getOwnPropertySymbols:Ie}),te&&p(p.S+p.F*(!Te||i(function(){var q=K();return H([q])!="[null]"||H({a:q})!="{}"||H(Object(q))!="{}"})),"JSON",{stringify:function(q){for(var Y,J,be=[q],ke=1;arguments.length>ke;)be.push(arguments[ke++]);if(J=Y=be[1],(b(Y)||q!==void 0)&&!Ge(q))return m(Y)||(Y=function(ct,He){if(typeof J=="function"&&(He=J.call(this,ct,He)),!Ge(He))return He}),be[1]=Y,H.apply(te,be)}}),K.prototype[V]||S("./_hide")(K.prototype,V,K.prototype.valueOf),s(K,"Symbol"),s(Math,"Math",!0),s(T.JSON,"JSON",!0)},{"./_an-object":61,"./_descriptors":69,"./_enum-keys":72,"./_export":73,"./_fails":74,"./_global":76,"./_has":77,"./_hide":78,"./_is-array":84,"./_is-object":85,"./_library":92,"./_meta":93,"./_object-create":97,"./_object-dp":98,"./_object-gopd":100,"./_object-gopn":102,"./_object-gopn-ext":101,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_property-desc":111,"./_redefine":113,"./_set-to-string-tag":115,"./_shared":117,"./_to-iobject":123,"./_to-primitive":126,"./_uid":127,"./_wks":131,"./_wks-define":129,"./_wks-ext":130}],147:[function(S,D,x){"use strict";var T=S("./_export"),w=S("./_core"),f=S("./_global"),p=S("./_species-constructor"),u=S("./_promise-resolve");T(T.P+T.R,"Promise",{finally:function(o){var i=p(this,w.Promise||f.Promise),l=typeof o=="function";return this.then(l?function(s){return u(i,o()).then(function(){return s})}:o,l?function(s){return u(i,o()).then(function(){throw s})}:o)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(S,D,x){"use strict";var T=S("./_export"),w=S("./_new-promise-capability"),f=S("./_perform");T(T.S,"Promise",{try:function(p){var u=w.f(this),o=f(p);return(o.e?u.reject:u.resolve)(o.v),u.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(S,D,x){S("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(S,D,x){S("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(S,D,x){S("./es6.array.iterator");for(var T=S("./_global"),w=S("./_hide"),f=S("./_iterators"),p=S("./_wks")("toStringTag"),u="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),o=0;o0?"-":"+")+p(100*Math.floor(Math.abs(P)/60)+Math.abs(P)%60,4),S:["th","st","nd","rd"][E%10>3?0:(E%100-E%10!=10)*E%10],W:I,N:W};return n.replace(s,function(te){return te in K?K[te]:te.slice(1,te.length-1)})}}();l.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},l.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},typeof j=="function"&&j.amd?j(function(){return l}):(x===void 0?"undefined":(0,w.default)(x))==="object"?D.exports=l:f.dateFormat=l}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(S,D,x){(function(T){function w(){return!(typeof window=="undefined"||!window.process||window.process.type!=="renderer")||typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(i){var l=this.useColors;if(i[0]=(l?"%c":"")+this.namespace+(l?" %c":" ")+i[0]+(l?"%c ":" ")+"+"+x.humanize(this.diff),l){var s="color: "+this.color;i.splice(1,0,s,"color: inherit");var h=0,r=0;i[0].replace(/%[a-zA-Z%]/g,function(t){t!=="%%"&&(h++,t==="%c"&&(r=h))}),i.splice(r,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function u(i){try{i==null?x.storage.removeItem("debug"):x.storage.debug=i}catch(l){}}function o(){var i;try{i=x.storage.debug}catch(l){}return!i&&T!==void 0&&"env"in T&&(i=T.env.DEBUG),i}x=D.exports=S("./debug"),x.log=p,x.formatArgs=f,x.save=u,x.load=o,x.useColors=w,x.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(i){}}(),x.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],x.formatters.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}},x.enable(o())}).call(this,S("_process"))},{"./debug":156,_process:173}],156:[function(S,D,x){function T(l){var s,h=0;for(s in l)h=(h<<5)-h+l.charCodeAt(s),h|=0;return x.colors[Math.abs(h)%x.colors.length]}function w(l){function s(){if(s.enabled){var h=s,r=+new Date,t=r-(i||r);h.diff=t,h.prev=i,h.curr=r,i=r;for(var n=new Array(arguments.length),c=0;c]/;D.exports=T},{}],158:[function(S,D,x){function T(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function w(o){return typeof o=="function"}function f(o){return typeof o=="number"}function p(o){return typeof o=="object"&&o!==null}function u(o){return o===void 0}D.exports=T,T.EventEmitter=T,T.prototype._events=void 0,T.prototype._maxListeners=void 0,T.defaultMaxListeners=10,T.prototype.setMaxListeners=function(o){if(!f(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},T.prototype.emit=function(o){var i,l,s,h,r,t;if(this._events||(this._events={}),o==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((i=arguments[1])instanceof Error)throw i;var n=new Error('Uncaught, unspecified "error" event. ('+i+")");throw n.context=i,n}if(l=this._events[o],u(l))return!1;if(w(l))switch(arguments.length){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),l.apply(this,h)}else if(p(l))for(h=Array.prototype.slice.call(arguments,1),t=l.slice(),s=t.length,r=0;r0&&this._events[o].length>l&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace()),this},T.prototype.on=T.prototype.addListener,T.prototype.once=function(o,i){function l(){this.removeListener(o,l),s||(s=!0,i.apply(this,arguments))}if(!w(i))throw TypeError("listener must be a function");var s=!1;return l.listener=i,this.on(o,l),this},T.prototype.removeListener=function(o,i){var l,s,h,r;if(!w(i))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(l=this._events[o],h=l.length,s=-1,l===i||w(l.listener)&&l.listener===i)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,i);else if(p(l)){for(r=h;r-- >0;)if(l[r]===i||l[r].listener&&l[r].listener===i){s=r;break}if(s<0)return this;l.length===1?(l.length=0,delete this._events[o]):l.splice(s,1),this._events.removeListener&&this.emit("removeListener",o,i)}return this},T.prototype.removeAllListeners=function(o){var i,l;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(i in this._events)i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events={},this}if(l=this._events[o],w(l))this.removeListener(o,l);else if(l)for(;l.length;)this.removeListener(o,l[l.length-1]);return delete this._events[o],this},T.prototype.listeners=function(o){return this._events&&this._events[o]?w(this._events[o])?[this._events[o]]:this._events[o].slice():[]},T.prototype.listenerCount=function(o){if(this._events){var i=this._events[o];if(w(i))return 1;if(i)return i.length}return 0},T.listenerCount=function(o,i){return o.listenerCount(i)}},{}],159:[function(S,D,x){var T=S("http"),w=D.exports;for(var f in T)T.hasOwnProperty(f)&&(w[f]=T[f]);w.request=function(p,u){return p||(p={}),p.scheme="https",p.protocol="https:",T.request.call(this,p,u)}},{http:196}],160:[function(S,D,x){"use strict";var T=S("util"),w=S("ms");D.exports=function(f){if(typeof f=="number")return f;var p=w(f);if(p===void 0){var u=new Error(T.format("humanize-ms(%j) result undefined",f));console.warn(u.stack)}return p}},{ms:169,util:207}],161:[function(S,D,x){x.read=function(T,w,f,p,u){var o,i,l=8*u-p-1,s=(1<>1,r=-7,t=f?u-1:0,n=f?-1:1,c=T[w+t];for(t+=n,o=c&(1<<-r)-1,c>>=-r,r+=l;r>0;o=256*o+T[w+t],t+=n,r-=8);for(i=o&(1<<-r)-1,o>>=-r,r+=p;r>0;i=256*i+T[w+t],t+=n,r-=8);if(o===0)o=1-h;else{if(o===s)return i?NaN:1/0*(c?-1:1);i+=Math.pow(2,p),o-=h}return(c?-1:1)*i*Math.pow(2,o-p)},x.write=function(T,w,f,p,u,o){var i,l,s,h=8*o-u-1,r=(1<>1,n=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=p?0:o-1,m=p?1:-1,v=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(l=isNaN(w)?1:0,i=r):(i=Math.floor(Math.log(w)/Math.LN2),w*(s=Math.pow(2,-i))<1&&(i--,s*=2),w+=i+t>=1?n/s:n*Math.pow(2,1-t),w*s>=2&&(i++,s/=2),i+t>=r?(l=0,i=r):i+t>=1?(l=(w*s-1)*Math.pow(2,u),i+=t):(l=w*Math.pow(2,t-1)*Math.pow(2,u),i=0));u>=8;T[f+c]=255&l,c+=m,l/=256,u-=8);for(i=i<0;T[f+c]=255&i,c+=m,i/=256,h-=8);T[f+c-m]|=128*v}},{}],162:[function(S,D,x){typeof Object.create=="function"?D.exports=function(T,w){T.super_=w,T.prototype=Object.create(w.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}})}:D.exports=function(T,w){T.super_=w;var f=function(){};f.prototype=w.prototype,T.prototype=new f,T.prototype.constructor=T}},{}],163:[function(S,D,x){function T(f){return!!f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function w(f){return typeof f.readFloatLE=="function"&&typeof f.slice=="function"&&T(f.slice(0,0))}D.exports=function(f){return f!=null&&(T(f)||w(f)||!!f._isBuffer)}},{}],164:[function(S,D,x){!function(T){function w(u){return p.call(u).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function f(u){return typeof u=="function"&&(/^class(\s|\{\}$)/.test(p.call(u))||/^.*classCallCheck\(/.test(w(u)))}var p=Function.prototype.toString;x!==void 0?(D!==void 0&&D.exports&&(x=D.exports=f),x.isClass=f):typeof j=="function"&&j.amd?j([],function(){return f}):T.isClass=f}(this)},{}],165:[function(S,D,x){"use strict";function T(o){var i=o.slice(2);return i=i[0].toLowerCase()+i.slice(1)}var w=S("core-util-is"),f=S("isstream"),p=S("is-class");Object.keys(w).map(function(o){x[T(o)]=w[o]}),x.stream=f,x.readableStream=f.isReadable,x.writableStream=f.isWritable,x.duplexStream=f.isDuplex,x.class=p,x.finite=function(o){return Number.isFinite(o)},x.NaN=function(o){return Number.isNaN(o)},x.generator=function(o){return o&&typeof o.next=="function"&&typeof o.throw=="function"},x.generatorFunction=function(o){return o&&o.constructor&&o.constructor.name==="GeneratorFunction"},x.asyncFunction=function(o){return o&&o.constructor&&o.constructor.name==="AsyncFunction"},x.promise=function(o){return o&&typeof o.then=="function"};var u=Math.pow(2,31);x.int=function(o){return w.isNumber(o)&&o%1==0},x.int32=function(o){return x.int(o)&&o=-u},x.long=function(o){return x.int(o)&&(o>=u||o<-u)},x.Long=function(o){return x.object(o)&&x.number(o.high)&&x.number(o.low)},x.double=function(o){return w.isNumber(o)&&!isNaN(o)&&o%1!=0},x.date=function(o){return o instanceof Date},x.regExp=function(o){return o instanceof RegExp},x.regexp=x.regExp,x.error=function(o){return o instanceof Error},x.array=function(o){return Array.isArray(o)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(S,D,x){var T={}.toString;D.exports=Array.isArray||function(w){return T.call(w)=="[object Array]"}},{}],167:[function(S,D,x){function T(o){return o instanceof u.Stream}function w(o){return T(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}function f(o){return T(o)&&typeof o._write=="function"&&typeof o._writableState=="object"}function p(o){return w(o)&&f(o)}var u=S("stream");D.exports=T,D.exports.isReadable=w,D.exports.isWritable=f,D.exports.isDuplex=p},{stream:195}],168:[function(S,D,x){"use strict";function T(f,p,u){if(!f)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return u===void 0&&(u=!0),Object.getOwnPropertyNames(p).forEach(function(o){if(u||!w.call(f,o)){var i=Object.getOwnPropertyDescriptor(p,o);Object.defineProperty(f,o,i)}}),f}D.exports=T;var w=Object.prototype.hasOwnProperty},{}],169:[function(S,D,x){function T(h){if(h=String(h),!(h.length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(h);if(r){var t=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*s;case"days":case"day":case"d":return t*l;case"hours":case"hour":case"hrs":case"hr":case"h":return t*i;case"minutes":case"minute":case"mins":case"min":case"m":return t*o;case"seconds":case"second":case"secs":case"sec":case"s":return t*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function w(h){return h>=l?Math.round(h/l)+"d":h>=i?Math.round(h/i)+"h":h>=o?Math.round(h/o)+"m":h>=u?Math.round(h/u)+"s":h+"ms"}function f(h){return p(h,l,"day")||p(h,i,"hour")||p(h,o,"minute")||p(h,u,"second")||h+" ms"}function p(h,r,t){if(!(h0)return T(h);if(t==="number"&&isNaN(h)===!1)return r.long?f(h):w(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))}},{}],170:[function(S,D,x){(function(T){function w(o,i){for(var l=0,s=o.length-1;s>=0;s--){var h=o[s];h==="."?o.splice(s,1):h===".."?(o.splice(s,1),l++):l&&(o.splice(s,1),l--)}if(i)for(;l--;l)o.unshift("..");return o}function f(o){typeof o!="string"&&(o+="");var i,l=0,s=-1,h=!0;for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!h){l=i+1;break}}else s===-1&&(h=!1,s=i+1);return s===-1?"":o.slice(l,s)}function p(o,i){if(o.filter)return o.filter(i);for(var l=[],s=0;s=-1&&!i;l--){var s=l>=0?arguments[l]:T.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(o=s+"/"+o,i=s.charAt(0)==="/")}return o=w(p(o.split("/"),function(h){return!!h}),!i).join("/"),(i?"/":"")+o||"."},x.normalize=function(o){var i=x.isAbsolute(o),l=u(o,-1)==="/";return o=w(p(o.split("/"),function(s){return!!s}),!i).join("/"),o||i||(o="."),o&&l&&(o+="/"),(i?"/":"")+o},x.isAbsolute=function(o){return o.charAt(0)==="/"},x.join=function(){var o=Array.prototype.slice.call(arguments,0);return x.normalize(p(o,function(i,l){if(typeof i!="string")throw new TypeError("Arguments to path.join must be strings");return i}).join("/"))},x.relative=function(o,i){function l(m){for(var v=0;v=0&&m[b]==="";b--);return v>b?[]:m.slice(v,b-v+1)}o=x.resolve(o).substr(1),i=x.resolve(i).substr(1);for(var s=l(o.split("/")),h=l(i.split("/")),r=Math.min(s.length,h.length),t=r,n=0;n=1;--r)if((i=o.charCodeAt(r))===47){if(!h){s=r;break}}else h=!1;return s===-1?l?"/":".":l&&s===1?"/":o.slice(0,s)},x.basename=function(o,i){var l=f(o);return i&&l.substr(-1*i.length)===i&&(l=l.substr(0,l.length-i.length)),l},x.extname=function(o){typeof o!="string"&&(o+="");for(var i=-1,l=0,s=-1,h=!0,r=0,t=o.length-1;t>=0;--t){var n=o.charCodeAt(t);if(n!==47)s===-1&&(h=!1,s=t+1),n===46?i===-1?i=t:r!==1&&(r=1):i!==-1&&(r=-1);else if(!h){l=t+1;break}}return i===-1||s===-1||r===0||r===1&&i===s-1&&i===l+1?"":o.slice(i,s)};var u="ab".substr(-1)==="b"?function(o,i,l){return o.substr(i,l)}:function(o,i,l){return i<0&&(i=o.length+i),o.substr(i,l)}}).call(this,S("_process"))},{_process:173}],171:[function(S,D,x){(function(T){(function(){"use strict";function w(O){return O=String(O),O.charAt(0).toUpperCase()+O.slice(1)}function f(O,A,P){var I={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return A&&P&&/^Win/i.test(O)&&!/^Windows Phone /i.test(O)&&(I=I[/[\d.]+$/.exec(O)])&&(O="Windows "+I),O=String(O),A&&P&&(O=O.replace(RegExp(A,"i"),P)),O=u(O.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}function p(O,A){var P=-1,I=O?O.length:0;if(typeof I=="number"&&I>-1&&I<=E)for(;++P3&&"WebKit"||/\bOpera\b/.test(Ie)&&(/\bOPR\b/.test(O)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(O)&&!/^(?:Trident|EdgeHTML)$/.test(Oe)&&"WebKit"||!Oe&&/\bMSIE\b/i.test(O)&&(k=="Mac OS"?"Tasman":"Trident")||Oe=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Ie)&&"NetFront")&&(Oe=[H]),Ie=="IE"&&(H=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(O)||0)[1])?(Ie+=" Mobile",k="Windows Phone "+(/\+$/.test(H)?H:H+".x"),We.unshift("desktop mode")):/\bWPDesktop\b/i.test(O)?(Ie="IE Mobile",k="Windows Phone 8.x",We.unshift("desktop mode"),le||(le=(/\brv:([\d.]+)/.exec(O)||0)[1])):Ie!="IE"&&Oe=="Trident"&&(H=/\brv:([\d.]+)/.exec(O))&&(Ie&&We.push("identifying as "+Ie+(le?" "+le:"")),Ie="IE",le=H[1]),de){if(l(I,"global"))if(pe&&(H=pe.lang.System,je=H.getProperty("os.arch"),k=k||H.getProperty("os.name")+" "+H.getProperty("os.version")),Te){try{le=I.require("ringo/engine").version.join("."),Ie="RingoJS"}catch(q){(H=I.system)&&H.global.system==I.system&&(Ie="Narwhal",k||(k=H[0].os||null))}Ie||(Ie="Rhino")}else typeof I.process=="object"&&!I.process.browser&&(H=I.process)&&(typeof H.versions=="object"&&(typeof H.versions.electron=="string"?(We.push("Node "+H.versions.node),Ie="Electron",le=H.versions.electron):typeof H.versions.nw=="string"&&(We.push("Chromium "+le,"Node "+H.versions.node),Ie="NW.js",le=H.versions.nw)),Ie||(Ie="Node.js",je=H.arch,k=H.platform,le=/[\d.]+/.exec(H.version),le=le?le[0]:null));else i(H=I.runtime)==re?(Ie="Adobe AIR",k=H.flash.system.Capabilities.os):i(H=I.phantom)==he?(Ie="PhantomJS",le=(H=H.version||null)&&H.major+"."+H.minor+"."+H.patch):typeof Ee.documentMode=="number"&&(H=/\bTrident\/(\d+)/i.exec(O))?(le=[le,Ee.documentMode],(H=+H[1]+4)!=le[1]&&(We.push("IE "+le[1]+" mode"),Oe&&(Oe[1]=""),le[1]=H),le=Ie=="IE"?String(le[1].toFixed(1)):le[0]):typeof Ee.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Ie)&&(We.push("masking as "+Ie+" "+le),Ie="IE",le="11.0",Oe=["Trident"],k="Windows");k=k&&u(k)}if(le&&(H=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(le)||/(?:alpha|beta)(?: ?\d)?/i.exec(O+";"+(de&&K.appMinorVersion))||/\bMinefield\b/i.test(O)&&"a")&&(ze=/b/i.test(H)?"beta":"alpha",le=le.replace(RegExp(H+"\\+?$"),"")+(ze=="beta"?Me:we)+(/\d+\+?/.exec(H)||"")),Ie=="Fennec"||Ie=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(k))Ie="Firefox Mobile";else if(Ie=="Maxthon"&&le)le=le.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(qe))qe=="Xbox 360"&&(k=null),qe=="Xbox 360"&&/\bIEMobile\b/.test(O)&&We.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(Ie)&&(!Ie||qe||/Browser|Mobi/.test(Ie))||k!="Windows CE"&&!/Mobi/i.test(O))if(Ie=="IE"&&de)try{I.external===null&&We.unshift("platform preview")}catch(q){We.unshift("embedded")}else(/\bBlackBerry\b/.test(qe)||/\bBB10\b/.test(O))&&(H=(RegExp(qe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(O)||0)[1]||le)?(H=[H,/BB10/.test(O)],k=(H[1]?(qe=null,ee="BlackBerry"):"Device Software")+" "+H[0],le=null):this!=o&&qe!="Wii"&&(de&&xe||/Opera/.test(Ie)&&/\b(?:MSIE|Firefox)\b/i.test(O)||Ie=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(k)||Ie=="IE"&&(k&&!/^Win/.test(k)&&le>5.5||/\bWindows XP\b/.test(k)&&le>8||le==8&&!/\bTrident\b/.test(O)))&&!g.test(H=t.call(o,O.replace(g,"")+";"))&&H.name&&(H="ing as "+H.name+((H=H.version)?" "+H:""),g.test(Ie)?(/\bIE\b/.test(H)&&k=="Mac OS"&&(k=null),H="identify"+H):(H="mask"+H,Ie=Ge?u(Ge.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(H)&&(k=null),de||(le=null)),Oe=["Presto"],We.push(H));else Ie+=" Mobile";(H=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(O)||0)[1])&&(H=[parseFloat(H.replace(/\.(\d)$/,".0$1")),H],Ie=="Safari"&&H[1].slice(-1)=="+"?(Ie="WebKit Nightly",ze="alpha",le=H[1].slice(0,-1)):le!=H[1]&&le!=(H[2]=(/\bSafari\/([\d.]+\+?)/i.exec(O)||0)[1])||(le=null),H[1]=(/\bChrome\/([\d.]+)/i.exec(O)||0)[1],H[0]==537.36&&H[2]==537.36&&parseFloat(H[1])>=28&&Oe=="WebKit"&&(Oe=["Blink"]),de&&(V||H[1])?(Oe&&(Oe[1]="like Chrome"),H=H[1]||(H=H[0],H<530?1:H<532?2:H<532.05?3:H<533?4:H<534.03?5:H<534.07?6:H<534.1?7:H<534.13?8:H<534.16?9:H<534.24?10:H<534.3?11:H<535.01?12:H<535.02?"13+":H<535.07?15:H<535.11?16:H<535.19?17:H<536.05?18:H<536.1?19:H<537.01?20:H<537.11?"21+":H<537.13?23:H<537.18?24:H<537.24?25:H<537.36?26:Oe!="Blink"?"27":"28")):(Oe&&(Oe[1]="like Safari"),H=H[0],H=H<400?1:H<500?2:H<526?3:H<533?4:H<534?"4+":H<535?5:H<537?6:H<538?7:H<601?8:"8"),Oe&&(Oe[1]+=" "+(H+=typeof H=="number"?".x":/[.+]/.test(H)?"":"+")),Ie=="Safari"&&(!le||parseInt(le)>45)&&(le=H)),Ie=="Opera"&&(H=/\bzbov|zvav$/.exec(k))?(Ie+=" ",We.unshift("desktop mode"),H=="zvav"?(Ie+="Mini",le=null):Ie+="Mobile",k=k.replace(RegExp(" *"+H+"$"),"")):Ie=="Safari"&&/\bChrome\b/.exec(Oe&&Oe[1])&&(We.unshift("desktop mode"),Ie="Chrome Mobile",le=null,/\bOS X\b/.test(k)?(ee="Apple",k="iOS 4.3+"):k=null),le&&le.indexOf(H=/[\d.]+$/.exec(k))==0&&O.indexOf("/"+H+"-")>-1&&(k=r(k.replace(H,""))),Oe&&!/\b(?:Avant|Nook)\b/.test(Ie)&&(/Browser|Lunascape|Maxthon/.test(Ie)||Ie!="Safari"&&/^iOS/.test(k)&&/\bSafari\b/.test(Oe[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(Ie)&&Oe[1])&&(H=Oe[Oe.length-1])&&We.push(H),We.length&&(We=["("+We.join("; ")+")"]),ee&&qe&&qe.indexOf(ee)<0&&We.push("on "+ee),qe&&We.push((/^on /.test(We[We.length-1])?"":"on ")+qe),k&&(H=/ ([\d.+]+)$/.exec(k),G=H&&k.charAt(k.length-H[0].length-1)=="/",k={architecture:32,family:H&&!G?k.replace(H[0],""):k,version:H?H[1]:null,toString:function(){var q=this.version;return this.family+(q&&!G?" "+q:"")+(this.architecture==64?" 64-bit":"")}}),(H=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(je))&&!/\bi686\b/i.test(je)?(k&&(k.architecture=64,k.family=k.family.replace(RegExp(" *"+H),"")),Ie&&(/\bWOW64\b/i.test(O)||de&&/\w(?:86|32)$/.test(K.cpuClass||K.platform)&&!/\bWin64; x64\b/i.test(O))&&We.unshift("32-bit")):k&&/^OS X/.test(k.family)&&Ie=="Chrome"&&parseFloat(le)>=39&&(k.architecture=64),O||(O=null);var U={};return U.description=O,U.layout=Oe&&Oe[0],U.manufacturer=ee,U.name=Ie,U.prerelease=ze,U.product=qe,U.ua=O,U.version=Ie&&le,U.os=k||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=t,U.toString=P,U.version&&We.unshift(le),U.name&&We.unshift(Ie),k&&Ie&&(k!=String(k).split(" ")[0]||k!=Ie.split(" ")[0]&&!qe)&&We.push(qe?"("+k+")":"on "+k),We.length&&(U.description=We.join(" ")),U}var n={function:!0,object:!0},c=n[typeof window]&&window||this,m=n[typeof x]&&x,v=n[typeof D]&&D&&!D.nodeType&&D,b=m&&v&&typeof T=="object"&&T;!b||b.global!==b&&b.window!==b&&b.self!==b||(c=b);var E=Math.pow(2,53)-1,g=/\bOpera/,y=Object.prototype,C=y.hasOwnProperty,d=y.toString,_=t();typeof j=="function"&&typeof j.amd=="object"&&j.amd?(c.platform=_,j(function(){return _})):m&&v?o(_,function(O,A){m[A]=O}):c.platform=_}).call(this)}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(S,D,x){(function(T){"use strict";function w(f,p,u,o){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var i,l,s=arguments.length;switch(s){case 0:case 1:return T.nextTick(f);case 2:return T.nextTick(function(){f.call(null,p)});case 3:return T.nextTick(function(){f.call(null,p,u)});case 4:return T.nextTick(function(){f.call(null,p,u,o)});default:for(i=new Array(s-1),l=0;l1)for(var E=1;E1&&(Te=pe[0]+"@",ne=pe[1]),ne=ne.replace(H,"."),Te+p(ne.split("."),he).join(".")}function o(ne){for(var he,pe,Te=[],we=0,Me=ne.length;we=55296&&he<=56319&&we65535&&(he-=65536,pe+=$(he>>>10&1023|55296),he=56320|1023&he),pe+=$(he)}).join("")}function l(ne){return ne-48<10?ne-22:ne-65<26?ne-65:ne-97<26?ne-97:C}function s(ne,he){return ne+22+75*(ne<26)-((he!=0)<<5)}function h(ne,he,pe){var Te=0;for(ne=pe?re(ne/A):ne>>1,ne+=re(ne/he);ne>V*_>>1;Te+=C)ne=re(ne/V);return re(Te+(V+1)*ne/(ne+O))}function r(ne){var he,pe,Te,we,Me,Ee,xe,Ge,je,We,ze=[],de=ne.length,le=0,Oe=I,Ie=P;for(pe=ne.lastIndexOf(W),pe<0&&(pe=0),Te=0;Te=128&&f("not-basic"),ze.push(ne.charCodeAt(Te));for(we=pe>0?pe+1:0;we=de&&f("invalid-input"),Ge=l(ne.charCodeAt(we++)),(Ge>=C||Ge>re((y-le)/Ee))&&f("overflow"),le+=Ge*Ee,je=xe<=Ie?d:xe>=Ie+_?_:xe-Ie,!(Gere(y/We)&&f("overflow"),Ee*=We;he=ze.length+1,Ie=h(le-Me,he,Me==0),re(le/he)>y-Oe&&f("overflow"),Oe+=re(le/he),le%=he,ze.splice(le++,0,Oe)}return i(ze)}function t(ne){var he,pe,Te,we,Me,Ee,xe,Ge,je,We,ze,de,le,Oe,Ie,qe=[];for(ne=o(ne),de=ne.length,he=I,pe=0,Me=P,Ee=0;Ee=he&&zere((y-pe)/le)&&f("overflow"),pe+=(xe-he)*le,he=xe,Ee=0;Eey&&f("overflow"),ze==he){for(Ge=pe,je=C;We=je<=Me?d:je>=Me+_?_:je-Me,!(Ge= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=C-d,re=Math.floor,$=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:o,encode:i},decode:r,encode:t,toASCII:c,toUnicode:n},typeof j=="function"&&typeof j.amd=="object"&&j.amd)j("punycode",function(){return E});else if(m&&v)if(D.exports==m)v.exports=E;else for(g in E)E.hasOwnProperty(g)&&(m[g]=E[g]);else w.punycode=E}(this)}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(S,D,x){"use strict";function T(f,p){return Object.prototype.hasOwnProperty.call(f,p)}D.exports=function(f,p,u,o){p=p||"&",u=u||"=";var i={};if(typeof f!="string"||f.length===0)return i;var l=/\+/g;f=f.split(p);var s=1e3;o&&typeof o.maxKeys=="number"&&(s=o.maxKeys);var h=f.length;s>0&&h>s&&(h=s);for(var r=0;r=0?(t=v.substr(0,b),n=v.substr(b+1)):(t=v,n=""),c=decodeURIComponent(t),m=decodeURIComponent(n),T(i,c)?w(i[c])?i[c].push(m):i[c]=[i[c],m]:i[c]=m}return i};var w=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"}},{}],176:[function(S,D,x){"use strict";function T(u,o){if(u.map)return u.map(o);for(var i=[],l=0;l0?(typeof le=="string"||ee.objectMode||(0,G.default)(le)===pe.prototype||(le=f(le)),Ie?ee.endEmitted?de.emit("error",new Error("stream.unshift() after end event")):s(de,ee,le,!0):ee.ended?de.emit("error",new Error("stream.push() after EOF")):(ee.reading=!1,ee.decoder&&!Oe?(le=ee.decoder.write(le),ee.objectMode||le.length!==0?s(de,ee,le,!1):b(de,ee)):s(de,ee,le,!1))):Ie||(ee.reading=!1)}return r(ee)}function s(de,le,Oe,Ie){le.flowing&&le.length===0&&!le.sync?(de.emit("data",Oe),de.read(0)):(le.length+=le.objectMode?1:Oe.length,Ie?le.buffer.unshift(Oe):le.buffer.push(Oe),le.needReadable&&m(de)),b(de,le)}function h(de,le){var Oe;return p(le)||typeof le=="string"||le===void 0||de.objectMode||(Oe=new TypeError("Invalid non-string/buffer chunk")),Oe}function r(de){return!de.ended&&(de.needReadable||de.length=ze?de=ze:(de--,de|=de>>>1,de|=de>>>2,de|=de>>>4,de|=de>>>8,de|=de>>>16,de++),de}function n(de,le){return de<=0||le.length===0&&le.ended?0:le.objectMode?1:de!==de?le.flowing&&le.length?le.buffer.head.data.length:le.length:(de>le.highWaterMark&&(le.highWaterMark=t(de)),de<=le.length?de:le.ended?le.length:(le.needReadable=!0,0))}function c(de,le){if(!le.ended){if(le.decoder){var Oe=le.decoder.end();Oe&&Oe.length&&(le.buffer.push(Oe),le.length+=le.objectMode?1:Oe.length)}le.ended=!0,m(de)}}function m(de){var le=de._readableState;le.needReadable=!1,le.emittedReadable||(Ee("emitReadable",le.flowing),le.emittedReadable=!0,le.sync?V.nextTick(v,de):v(de))}function v(de){Ee("emit readable"),de.emit("readable"),_(de)}function b(de,le){le.readingMore||(le.readingMore=!0,V.nextTick(E,de,le))}function E(de,le){for(var Oe=le.length;!le.reading&&!le.flowing&&!le.ended&&le.length=le.length?(Oe=le.decoder?le.buffer.join(""):le.buffer.length===1?le.buffer.head.data:le.buffer.concat(le.length),le.buffer.clear()):Oe=A(de,le.buffer,le.decoder),Oe}function A(de,le,Oe){var Ie;return deee.length?ee.length:de;if(k===ee.length?qe+=ee:qe+=ee.slice(0,de),(de-=k)===0){k===ee.length?(++Ie,Oe.next?le.head=Oe.next:le.head=le.tail=null):(le.head=Oe,Oe.data=ee.slice(k));break}++Ie}return le.length-=Ie,qe}function I(de,le){var Oe=pe.allocUnsafe(de),Ie=le.head,qe=1;for(Ie.data.copy(Oe),de-=Ie.data.length;Ie=Ie.next;){var ee=Ie.data,k=de>ee.length?ee.length:de;if(ee.copy(Oe,Oe.length-de,0,k),(de-=k)===0){k===ee.length?(++qe,Ie.next?le.head=Ie.next:le.head=le.tail=null):(le.head=Ie,Ie.data=ee.slice(k));break}++qe}return le.length-=qe,Oe}function W(de){var le=de._readableState;if(le.length>0)throw new Error('"endReadable()" called on non-empty stream');le.endEmitted||(le.ended=!0,V.nextTick(K,le,de))}function K(de,le){de.endEmitted||de.length!==0||(de.endEmitted=!0,le.readable=!1,le.emit("end"))}function te(de,le){for(var Oe=0,Ie=de.length;Oe=le.highWaterMark||le.ended))return Ee("read: emitReadable",le.length,le.ended),le.length===0&&le.ended?W(this):m(this),null;if((de=n(de,le))===0&&le.ended)return le.length===0&&W(this),null;var Ie=le.needReadable;Ee("need readable",Ie),(le.length===0||le.length-de0?O(de,le):null,qe===null?(le.needReadable=!0,de=0):le.length-=de,le.length===0&&(le.ended||(le.needReadable=!0),Oe!==de&&le.ended&&W(this)),qe!==null&&this.emit("data",qe),qe},i.prototype._read=function(de){this.emit("error",new Error("_read() is not implemented"))},i.prototype.pipe=function(de,le){function Oe(ht,Qe){Ee("onunpipe"),ht===J&&Qe&&Qe.hasUnpiped===!1&&(Qe.hasUnpiped=!0,qe())}function Ie(){Ee("onend"),de.end()}function qe(){Ee("cleanup"),de.removeListener("close",U),de.removeListener("finish",q),de.removeListener("drain",He),de.removeListener("error",k),de.removeListener("unpipe",Oe),J.removeListener("end",Ie),J.removeListener("end",Y),J.removeListener("data",ee),Be=!0,!be.awaitDrain||de._writableState&&!de._writableState.needDrain||He()}function ee(ht){Ee("ondata"),Ze=!1,de.write(ht)!==!1||Ze||((be.pipesCount===1&&be.pipes===de||be.pipesCount>1&&te(be.pipes,de)!==-1)&&!Be&&(Ee("false write response, pause",J._readableState.awaitDrain),J._readableState.awaitDrain++,Ze=!0),J.pause())}function k(ht){Ee("onerror",ht),Y(),de.removeListener("error",k),ne(de,"error")===0&&de.emit("error",ht)}function U(){de.removeListener("finish",q),Y()}function q(){Ee("onfinish"),de.removeListener("close",U),Y()}function Y(){Ee("unpipe"),J.unpipe(de)}var J=this,be=this._readableState;switch(be.pipesCount){case 0:be.pipes=de;break;case 1:be.pipes=[be.pipes,de];break;default:be.pipes.push(de)}be.pipesCount+=1,Ee("pipe count=%d opts=%j",be.pipesCount,le);var ke=(!le||le.end!==!1)&&de!==T.stdout&&de!==T.stderr,ct=ke?Ie:Y;be.endEmitted?V.nextTick(ct):J.once("end",ct),de.on("unpipe",Oe);var He=g(J);de.on("drain",He);var Be=!1,Ze=!1;return J.on("data",ee),u(de,"error",k),de.once("close",U),de.once("finish",q),de.emit("pipe",J),be.flowing||(Ee("pipe resume"),J.resume()),de},i.prototype.unpipe=function(de){var le=this._readableState,Oe={hasUnpiped:!1};if(le.pipesCount===0)return this;if(le.pipesCount===1)return de&&de!==le.pipes?this:(de||(de=le.pipes),le.pipes=null,le.pipesCount=0,le.flowing=!1,de&&de.emit("unpipe",this,Oe),this);if(!de){var Ie=le.pipes,qe=le.pipesCount;le.pipes=null,le.pipesCount=0,le.flowing=!1;for(var ee=0;ee-1?re.default:$.nextTick;s.WritableState=l;var pe=S("core-util-is");pe.inherits=S("inherits");var Te={deprecate:S("util-deprecate")},we=S("./internal/streams/stream"),Me=S("safe-buffer").Buffer,Ee=w.Uint8Array||function(){},xe=S("./internal/streams/destroy");pe.inherits(s,we),l.prototype.getBuffer=function(){for(var je=this.bufferedRequest,We=[];je;)We.push(je),je=je.next;return We},function(){try{Object.defineProperty(l.prototype,"buffer",{get:Te.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(je){}}();var Ge;typeof G.default=="function"&&te.default&&typeof Function.prototype[te.default]=="function"?(Ge=Function.prototype[te.default],(0,W.default)(s,te.default,{value:function(je){return!!Ge.call(this,je)||this===s&&je&&je._writableState instanceof l}})):Ge=function(je){return je instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(je,We,ze){var de=this._writableState,le=!1,Oe=!de.objectMode&&o(je);return Oe&&!Me.isBuffer(je)&&(je=u(je)),typeof We=="function"&&(ze=We,We=null),Oe?We="buffer":We||(We=de.defaultEncoding),typeof ze!="function"&&(ze=i),de.ended?h(this,ze):(Oe||r(this,de,je,ze))&&(de.pendingcb++,le=n(this,de,Oe,je,We,ze)),le},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var je=this._writableState;je.corked&&(je.corked--,je.writing||je.corked||je.finished||je.bufferProcessing||!je.bufferedRequest||y(this,je))},s.prototype.setDefaultEncoding=function(je){if(typeof je=="string"&&(je=je.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((je+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+je);return this._writableState.defaultEncoding=je,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(je,We,ze){ze(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(je,We,ze){var de=this._writableState;typeof je=="function"?(ze=je,je=null,We=null):typeof We=="function"&&(ze=We,We=null),je!=null&&this.write(je,We),de.corked&&(de.corked=1,this.uncork()),de.ending||de.finished||A(this,de,ze)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(je){this._writableState&&(this._writableState.destroyed=je)}}),s.prototype.destroy=xe.destroy,s.prototype._undestroy=xe.undestroy,s.prototype._destroy=function(je,We){this.end(),We(je)}}).call(this,S("_process"),typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/set-immediate":25,"babel-runtime/core-js/symbol":27,"babel-runtime/core-js/symbol/has-instance":28,"core-util-is":153,inherits:162,"process-nextick-args":172,"safe-buffer":193,"util-deprecate":205}],184:[function(S,D,x){"use strict";function T(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}function w(u,o,i){u.copy(o,i)}var f=S("safe-buffer").Buffer,p=S("util");D.exports=function(){function u(){T(this,u),this.head=null,this.tail=null,this.length=0}return u.prototype.push=function(o){var i={data:o,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},u.prototype.unshift=function(o){var i={data:o,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},u.prototype.shift=function(){if(this.length!==0){var o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}},u.prototype.clear=function(){this.head=this.tail=null,this.length=0},u.prototype.join=function(o){if(this.length===0)return"";for(var i=this.head,l=""+i.data;i=i.next;)l+=o+i.data;return l},u.prototype.concat=function(o){if(this.length===0)return f.alloc(0);if(this.length===1)return this.head.data;for(var i=f.allocUnsafe(o>>>0),l=this.head,s=0;l;)w(l.data,i,s),s+=l.data.length,l=l.next;return i},u}(),p&&p.inspect&&p.inspect.custom&&(D.exports.prototype[p.inspect.custom]=function(){var u=p.inspect({length:this.length});return this.constructor.name+" "+u})},{"safe-buffer":193,util:36}],185:[function(S,D,x){"use strict";function T(u,o){var i=this,l=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return l||s?(o?o(u):!u||this._writableState&&this._writableState.errorEmitted||p.nextTick(f,this,u),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(h){!o&&h?(p.nextTick(f,i,h),i._writableState&&(i._writableState.errorEmitted=!0)):o&&o(h)}),this)}function w(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function f(u,o){u.emit("error",o)}var p=S("process-nextick-args");D.exports={destroy:T,undestroy:w}},{"process-nextick-args":172}],186:[function(S,D,x){"use strict";D.exports=S("events").EventEmitter},{events:158}],187:[function(S,D,x){D.exports=S("./readable").PassThrough},{"./readable":188}],188:[function(S,D,x){x=D.exports=S("./lib/_stream_readable.js"),x.Stream=x,x.Readable=x,x.Writable=S("./lib/_stream_writable.js"),x.Duplex=S("./lib/_stream_duplex.js"),x.Transform=S("./lib/_stream_transform.js"),x.PassThrough=S("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],189:[function(S,D,x){D.exports=S("./readable").Transform},{"./readable":188}],190:[function(S,D,x){D.exports=S("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(S,D,x){var T=function(){return this}()||Function("return this")(),w=T.regeneratorRuntime&&Object.getOwnPropertyNames(T).indexOf("regeneratorRuntime")>=0,f=w&&T.regeneratorRuntime;if(T.regeneratorRuntime=void 0,D.exports=S("./runtime"),w)T.regeneratorRuntime=f;else try{delete T.regeneratorRuntime}catch(p){T.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(S,D,x){!function(T){"use strict";function w(re,$,ne,he){var pe=$&&$.prototype instanceof p?$:p,Te=Object.create(pe.prototype),we=new n(he||[]);return Te._invoke=s(re,ne,we),Te}function f(re,$,ne){try{return{type:"normal",arg:re.call($,ne)}}catch(he){return{type:"throw",arg:he}}}function p(){}function u(){}function o(){}function i(re){["next","throw","return"].forEach(function($){re[$]=function(ne){return this._invoke($,ne)}})}function l(re){function $(pe,Te,we,Me){var Ee=f(re[pe],re,Te);if(Ee.type!=="throw"){var xe=Ee.arg,Ge=xe.value;return Ge&&typeof Ge=="object"&&E.call(Ge,"__await")?Promise.resolve(Ge.__await).then(function(je){$("next",je,we,Me)},function(je){$("throw",je,we,Me)}):Promise.resolve(Ge).then(function(je){xe.value=je,we(xe)},Me)}Me(Ee.arg)}function ne(pe,Te){function we(){return new Promise(function(Me,Ee){$(pe,Te,Me,Ee)})}return he=he?he.then(we,we):we()}var he;this._invoke=ne}function s(re,$,ne){var he=A;return function(pe,Te){if(he===I)throw new Error("Generator is already running");if(he===W){if(pe==="throw")throw Te;return m()}for(ne.method=pe,ne.arg=Te;;){var we=ne.delegate;if(we){var Me=h(we,ne);if(Me){if(Me===K)continue;return Me}}if(ne.method==="next")ne.sent=ne._sent=ne.arg;else if(ne.method==="throw"){if(he===A)throw he=W,ne.arg;ne.dispatchException(ne.arg)}else ne.method==="return"&&ne.abrupt("return",ne.arg);he=I;var Ee=f(re,$,ne);if(Ee.type==="normal"){if(he=ne.done?W:P,Ee.arg===K)continue;return{value:Ee.arg,done:ne.done}}Ee.type==="throw"&&(he=W,ne.method="throw",ne.arg=Ee.arg)}}}function h(re,$){var ne=re.iterator[$.method];if(ne===v){if($.delegate=null,$.method==="throw"){if(re.iterator.return&&($.method="return",$.arg=v,h(re,$),$.method==="throw"))return K;$.method="throw",$.arg=new TypeError("The iterator does not provide a 'throw' method")}return K}var he=f(ne,re.iterator,$.arg);if(he.type==="throw")return $.method="throw",$.arg=he.arg,$.delegate=null,K;var pe=he.arg;return pe?pe.done?($[re.resultName]=pe.value,$.next=re.nextLoc,$.method!=="return"&&($.method="next",$.arg=v),$.delegate=null,K):pe:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,K)}function r(re){var $={tryLoc:re[0]};1 in re&&($.catchLoc=re[1]),2 in re&&($.finallyLoc=re[2],$.afterLoc=re[3]),this.tryEntries.push($)}function t(re){var $=re.completion||{};$.type="normal",delete $.arg,re.completion=$}function n(re){this.tryEntries=[{tryLoc:"root"}],re.forEach(r,this),this.reset(!0)}function c(re){if(re){var $=re[y];if($)return $.call(re);if(typeof re.next=="function")return re;if(!isNaN(re.length)){var ne=-1,he=function pe(){for(;++ne=0;--he){var pe=this.tryEntries[he],Te=pe.completion;if(pe.tryLoc==="root")return $("end");if(pe.tryLoc<=this.prev){var we=E.call(pe,"catchLoc"),Me=E.call(pe,"finallyLoc");if(we&&Me){if(this.prev=0;--ne){var he=this.tryEntries[ne];if(he.tryLoc<=this.prev&&E.call(he,"finallyLoc")&&this.prev=0;--$){var ne=this.tryEntries[$];if(ne.finallyLoc===re)return this.complete(ne.completion,ne.afterLoc),t(ne),K}},catch:function(re){for(var $=this.tryEntries.length-1;$>=0;--$){var ne=this.tryEntries[$];if(ne.tryLoc===re){var he=ne.completion;if(he.type==="throw"){var pe=he.arg;t(ne)}return pe}}throw new Error("illegal catch attempt")},delegateYield:function(re,$,ne){return this.delegate={iterator:c(re),resultName:$,nextLoc:ne},this.method==="next"&&(this.arg=v),K}}}(function(){return this}()||Function("return this")())},{}],193:[function(S,D,x){function T(u,o){for(var i in u)o[i]=u[i]}function w(u,o,i){return p(u,o,i)}var f=S("buffer"),p=f.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?D.exports=f:(T(f,x),x.Buffer=w),T(p,w),w.from=function(u,o,i){if(typeof u=="number")throw new TypeError("Argument must not be a number");return p(u,o,i)},w.alloc=function(u,o,i){if(typeof u!="number")throw new TypeError("Argument must be a number");var l=p(u);return o!==void 0?typeof i=="string"?l.fill(o,i):l.fill(o):l.fill(0),l},w.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return p(u)},w.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(u)}},{buffer:38}],194:[function(S,D,x){(function(T){"use strict";function w(m){return m&&m.__esModule?m:{default:m}}var f=S("babel-runtime/core-js/string/from-code-point"),p=w(f),u=S("babel-runtime/core-js/json/stringify"),o=w(u),i=S("babel-runtime/helpers/typeof"),l=w(i),s=S("babel-runtime/core-js/object/define-property"),h=w(s),r=S("babel-runtime/core-js/object/keys"),t=w(r),n=S("babel-runtime/core-js/object/create"),c=w(n);!function(m){function v(Y,J){if(!(this instanceof v))return new v(Y,J);var be=this;E(be),be.q=be.c="",be.bufferCheckPosition=m.MAX_BUFFER_LENGTH,be.opt=J||{},be.opt.lowercase=be.opt.lowercase||be.opt.lowercasetags,be.looseCase=be.opt.lowercase?"toLowerCase":"toUpperCase",be.tags=[],be.closed=be.closedRoot=be.sawRoot=!1,be.tag=be.error=null,be.strict=!!Y,be.noscript=!(!Y&&!be.opt.noscript),be.state=U.BEGIN,be.strictEntities=be.opt.strictEntities,be.ENTITIES=be.strictEntities?(0,c.default)(m.XML_ENTITIES):(0,c.default)(m.ENTITIES),be.attribList=[],be.opt.xmlns&&(be.ns=(0,c.default)(Oe)),be.trackPosition=be.opt.position!==!1,be.trackPosition&&(be.position=be.line=be.column=0),I(be,"onready")}function b(Y){for(var J=Math.max(m.MAX_BUFFER_LENGTH,10),be=0,ke=0,ct=xe.length;keJ)switch(xe[ke]){case"textNode":K(Y);break;case"cdata":W(Y,"oncdata",Y.cdata),Y.cdata="";break;case"script":W(Y,"onscript",Y.script),Y.script="";break;default:H(Y,"Max buffer length exceeded: "+xe[ke])}be=Math.max(be,He)}var Be=m.MAX_BUFFER_LENGTH-be;Y.bufferCheckPosition=Be+Y.position}function E(Y){for(var J=0,be=xe.length;J"||d(Y)}function A(Y,J){return Y.test(J)}function P(Y,J){return!A(Y,J)}function I(Y,J,be){Y[J]&&Y[J](be)}function W(Y,J,be){Y.textNode&&K(Y),I(Y,J,be)}function K(Y){Y.textNode=te(Y.opt,Y.textNode),Y.textNode&&I(Y,"ontext",Y.textNode),Y.textNode=""}function te(Y,J){return Y.trim&&(J=J.trim()),Y.normalize&&(J=J.replace(/\s+/g," ")),J}function H(Y,J){return K(Y),Y.trackPosition&&(J+=` Line: `+Y.line+` Column: `+Y.column+` Char: `+Y.c),J=new Error(J),Y.error=J,I(Y,"onerror",J),Y}function G(Y){return Y.sawRoot&&!Y.closedRoot&&V(Y,"Unclosed root tag"),Y.state!==U.BEGIN&&Y.state!==U.BEGIN_WHITESPACE&&Y.state!==U.TEXT&&H(Y,"Unexpected end"),K(Y),Y.c="",Y.closed=!0,I(Y,"onend"),v.call(Y,Y.strict,Y.opt),Y}function V(Y,J){if((Y===void 0?"undefined":(0,l.default)(Y))!=="object"||!(Y instanceof v))throw new Error("bad call to strictFail");Y.strict&&H(Y,J)}function re(Y){Y.strict||(Y.tagName=Y.tagName[Y.looseCase]());var J=Y.tags[Y.tags.length-1]||Y,be=Y.tag={name:Y.tagName,attributes:{}};Y.opt.xmlns&&(be.ns=J.ns),Y.attribList.length=0,W(Y,"onopentagstart",be)}function $(Y,J){var be=Y.indexOf(":"),ke=be<0?["",Y]:Y.split(":"),ct=ke[0],He=ke[1];return J&&Y==="xmlns"&&(ct="xmlns",He=""),{prefix:ct,local:He}}function ne(Y){if(Y.strict||(Y.attribName=Y.attribName[Y.looseCase]()),Y.attribList.indexOf(Y.attribName)!==-1||Y.tag.attributes.hasOwnProperty(Y.attribName))return void(Y.attribName=Y.attribValue="");if(Y.opt.xmlns){var J=$(Y.attribName,!0),be=J.prefix,ke=J.local;if(be==="xmlns")if(ke==="xml"&&Y.attribValue!==de)V(Y,"xml: prefix must be bound to "+de+` Actual: `+Y.attribValue);else if(ke==="xmlns"&&Y.attribValue!==le)V(Y,"xmlns: prefix must be bound to "+le+` Actual: `+Y.attribValue);else{var ct=Y.tag,He=Y.tags[Y.tags.length-1]||Y;ct.ns===He.ns&&(ct.ns=(0,c.default)(He.ns)),ct.ns[ke]=Y.attribValue}Y.attribList.push([Y.attribName,Y.attribValue])}else Y.tag.attributes[Y.attribName]=Y.attribValue,W(Y,"onattribute",{name:Y.attribName,value:Y.attribValue});Y.attribName=Y.attribValue=""}function he(Y,J){if(Y.opt.xmlns){var be=Y.tag,ke=$(Y.tagName);be.prefix=ke.prefix,be.local=ke.local,be.uri=be.ns[ke.prefix]||"",be.prefix&&!be.uri&&(V(Y,"Unbound namespace prefix: "+(0,o.default)(Y.tagName)),be.uri=ke.prefix);var ct=Y.tags[Y.tags.length-1]||Y;be.ns&&ct.ns!==be.ns&&(0,t.default)(be.ns).forEach(function(Ce){W(Y,"onopennamespace",{prefix:Ce,uri:be.ns[Ce]})});for(var He=0,Be=Y.attribList.length;He",Y.tagName="",void(Y.state=U.SCRIPT);W(Y,"onscript",Y.script),Y.script=""}var J=Y.tags.length,be=Y.tagName;Y.strict||(be=be[Y.looseCase]());for(var ke=be;J--&&!(Y.tags[J].name===ke);)V(Y,"Unexpected close tag");if(J<0)return V(Y,"Unmatched closing tag: "+Y.tagName),Y.textNode+="",void(Y.state=U.TEXT);Y.tagName=be;for(var ct=Y.tags.length;ct-- >J;){var He=Y.tag=Y.tags.pop();Y.tagName=Y.tag.name,W(Y,"onclosetag",Y.tagName);var Be={};for(var Ze in He.ns)Be[Ze]=He.ns[Ze];var ht=Y.tags[Y.tags.length-1]||Y;Y.opt.xmlns&&He.ns!==ht.ns&&(0,t.default)(He.ns).forEach(function(Qe){var Xe=He.ns[Qe];W(Y,"onclosenamespace",{prefix:Qe,uri:Xe})})}J===0&&(Y.closedRoot=!0),Y.tagName=Y.attribValue=Y.attribName="",Y.attribList.length=0,Y.state=U.TEXT}function Te(Y){var J,be=Y.entity,ke=be.toLowerCase(),ct="";return Y.ENTITIES[be]?Y.ENTITIES[be]:Y.ENTITIES[ke]?Y.ENTITIES[ke]:(be=ke,be.charAt(0)==="#"&&(be.charAt(1)==="x"?(be=be.slice(2),J=parseInt(be,16),ct=J.toString(16)):(be=be.slice(1),J=parseInt(be,10),ct=J.toString(10))),be=be.replace(/^0+/,""),isNaN(J)||ct.toLowerCase()!==be?(V(Y,"Invalid character entity"),"&"+Y.entity+";"):(0,p.default)(J))}function we(Y,J){J==="<"?(Y.state=U.OPEN_WAKA,Y.startTagPosition=Y.position):d(J)||(V(Y,"Non-whitespace before first tag."),Y.textNode=J,Y.state=U.TEXT)}function Me(Y,J){var be="";return J"?(W(J,"onsgmldeclaration",J.sgmlDecl),J.sgmlDecl="",J.state=U.TEXT):(_(ke)&&(J.state=U.SGML_DECL_QUOTED),J.sgmlDecl+=ke);continue;case U.SGML_DECL_QUOTED:ke===J.q&&(J.state=U.SGML_DECL,J.q=""),J.sgmlDecl+=ke;continue;case U.DOCTYPE:ke===">"?(J.state=U.TEXT,W(J,"ondoctype",J.doctype),J.doctype=!0):(J.doctype+=ke,ke==="["?J.state=U.DOCTYPE_DTD:_(ke)&&(J.state=U.DOCTYPE_QUOTED,J.q=ke));continue;case U.DOCTYPE_QUOTED:J.doctype+=ke,ke===J.q&&(J.q="",J.state=U.DOCTYPE);continue;case U.DOCTYPE_DTD:J.doctype+=ke,ke==="]"?J.state=U.DOCTYPE:_(ke)&&(J.state=U.DOCTYPE_DTD_QUOTED,J.q=ke);continue;case U.DOCTYPE_DTD_QUOTED:J.doctype+=ke,ke===J.q&&(J.state=U.DOCTYPE_DTD,J.q="");continue;case U.COMMENT:ke==="-"?J.state=U.COMMENT_ENDING:J.comment+=ke;continue;case U.COMMENT_ENDING:ke==="-"?(J.state=U.COMMENT_ENDED,J.comment=te(J.opt,J.comment),J.comment&&W(J,"oncomment",J.comment),J.comment=""):(J.comment+="-"+ke,J.state=U.COMMENT);continue;case U.COMMENT_ENDED:ke!==">"?(V(J,"Malformed comment"),J.comment+="--"+ke,J.state=U.COMMENT):J.state=U.TEXT;continue;case U.CDATA:ke==="]"?J.state=U.CDATA_ENDING:J.cdata+=ke;continue;case U.CDATA_ENDING:ke==="]"?J.state=U.CDATA_ENDING_2:(J.cdata+="]"+ke,J.state=U.CDATA);continue;case U.CDATA_ENDING_2:ke===">"?(J.cdata&&W(J,"oncdata",J.cdata),W(J,"onclosecdata"),J.cdata="",J.state=U.TEXT):ke==="]"?J.cdata+="]":(J.cdata+="]]"+ke,J.state=U.CDATA);continue;case U.PROC_INST:ke==="?"?J.state=U.PROC_INST_ENDING:d(ke)?J.state=U.PROC_INST_BODY:J.procInstName+=ke;continue;case U.PROC_INST_BODY:if(!J.procInstBody&&d(ke))continue;ke==="?"?J.state=U.PROC_INST_ENDING:J.procInstBody+=ke;continue;case U.PROC_INST_ENDING:ke===">"?(W(J,"onprocessinginstruction",{name:J.procInstName,body:J.procInstBody}),J.procInstName=J.procInstBody="",J.state=U.TEXT):(J.procInstBody+="?"+ke,J.state=U.PROC_INST_BODY);continue;case U.OPEN_TAG:A(qe,ke)?J.tagName+=ke:(re(J),ke===">"?he(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:(d(ke)||V(J,"Invalid character in tag name"),J.state=U.ATTRIB));continue;case U.OPEN_TAG_SLASH:ke===">"?(he(J,!0),pe(J)):(V(J,"Forward-slash in opening tag not followed by >"),J.state=U.ATTRIB);continue;case U.ATTRIB:if(d(ke))continue;ke===">"?he(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(Ie,ke)?(J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):V(J,"Invalid attribute name");continue;case U.ATTRIB_NAME:ke==="="?J.state=U.ATTRIB_VALUE:ke===">"?(V(J,"Attribute without value"),J.attribValue=J.attribName,ne(J),he(J)):d(ke)?J.state=U.ATTRIB_NAME_SAW_WHITE:A(qe,ke)?J.attribName+=ke:V(J,"Invalid attribute name");continue;case U.ATTRIB_NAME_SAW_WHITE:if(ke==="=")J.state=U.ATTRIB_VALUE;else{if(d(ke))continue;V(J,"Attribute without value"),J.tag.attributes[J.attribName]="",J.attribValue="",W(J,"onattribute",{name:J.attribName,value:""}),J.attribName="",ke===">"?he(J):A(Ie,ke)?(J.attribName=ke,J.state=U.ATTRIB_NAME):(V(J,"Invalid attribute name"),J.state=U.ATTRIB)}continue;case U.ATTRIB_VALUE:if(d(ke))continue;_(ke)?(J.q=ke,J.state=U.ATTRIB_VALUE_QUOTED):(V(J,"Unquoted attribute value"),J.state=U.ATTRIB_VALUE_UNQUOTED,J.attribValue=ke);continue;case U.ATTRIB_VALUE_QUOTED:if(ke!==J.q){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_Q:J.attribValue+=ke;continue}ne(J),J.q="",J.state=U.ATTRIB_VALUE_CLOSED;continue;case U.ATTRIB_VALUE_CLOSED:d(ke)?J.state=U.ATTRIB:ke===">"?he(J):ke==="/"?J.state=U.OPEN_TAG_SLASH:A(Ie,ke)?(V(J,"No whitespace between attributes"),J.attribName=ke,J.attribValue="",J.state=U.ATTRIB_NAME):V(J,"Invalid attribute name");continue;case U.ATTRIB_VALUE_UNQUOTED:if(!O(ke)){ke==="&"?J.state=U.ATTRIB_VALUE_ENTITY_U:J.attribValue+=ke;continue}ne(J),ke===">"?he(J):J.state=U.ATTRIB;continue;case U.CLOSE_TAG:if(J.tagName)ke===">"?pe(J):A(qe,ke)?J.tagName+=ke:J.script?(J.script+=""?pe(J):V(J,"Invalid characters in closing tag");continue;case U.TEXT_ENTITY:case U.ATTRIB_VALUE_ENTITY_Q:case U.ATTRIB_VALUE_ENTITY_U:var Be,Ze;switch(J.state){case U.TEXT_ENTITY:Be=U.TEXT,Ze="textNode";break;case U.ATTRIB_VALUE_ENTITY_Q:Be=U.ATTRIB_VALUE_QUOTED,Ze="attribValue";break;case U.ATTRIB_VALUE_ENTITY_U:Be=U.ATTRIB_VALUE_UNQUOTED,Ze="attribValue"}ke===";"?(J[Ze]+=Te(J),J.entity="",J.state=Be):A(J.entity.length?k:ee,ke)?J.entity+=ke:(V(J,"Invalid character in entity name"),J[Ze]+="&"+J.entity+ke,J.entity="",J.state=Be);continue;default:throw new Error(J,"Unknown state: "+J.state)}return J.position>=J.bufferCheckPosition&&b(J),J}m.parser=function(Y,J){return new v(Y,J)},m.SAXParser=v,m.SAXStream=C,m.createStream=y,m.MAX_BUFFER_LENGTH=65536;var xe=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];m.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],c.default||(Object.create=function(Y){function J(){}return J.prototype=Y,new J}),t.default||(Object.keys=function(Y){var J=[];for(var be in Y)Y.hasOwnProperty(be)&&J.push(be);return J}),v.prototype={end:function(){G(this)},write:Ee,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){g(this)}};var Ge;try{Ge=S("stream").Stream}catch(Y){Ge=function(){}}var je=m.EVENTS.filter(function(Y){return Y!=="error"&&Y!=="end"});C.prototype=(0,c.default)(Ge.prototype,{constructor:{value:C}}),C.prototype.write=function(Y){if(typeof T=="function"&&typeof T.isBuffer=="function"&&T.isBuffer(Y)){if(!this._decoder){var J=S("string_decoder").StringDecoder;this._decoder=new J("utf8")}Y=this._decoder.write(Y)}return this._parser.write(Y.toString()),this.emit("data",Y),!0},C.prototype.end=function(Y){return Y&&Y.length&&this.write(Y),this._parser.end(),!0},C.prototype.on=function(Y,J){var be=this;return be._parser["on"+Y]||je.indexOf(Y)===-1||(be._parser["on"+Y]=function(){var ke=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ke.splice(0,0,Y),be.emit.apply(be,ke)}),Ge.prototype.on.call(be,Y,J)};var We="[CDATA[",ze="DOCTYPE",de="http://www.w3.org/XML/1998/namespace",le="http://www.w3.org/2000/xmlns/",Oe={xml:de,xmlns:le},Ie=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,qe=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,ee=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,k=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,U=0;m.STATE={BEGIN:U++,BEGIN_WHITESPACE:U++,TEXT:U++,TEXT_ENTITY:U++,OPEN_WAKA:U++,SGML_DECL:U++,SGML_DECL_QUOTED:U++,DOCTYPE:U++,DOCTYPE_QUOTED:U++,DOCTYPE_DTD:U++,DOCTYPE_DTD_QUOTED:U++,COMMENT_STARTING:U++,COMMENT:U++,COMMENT_ENDING:U++,COMMENT_ENDED:U++,CDATA:U++,CDATA_ENDING:U++,CDATA_ENDING_2:U++,PROC_INST:U++,PROC_INST_BODY:U++,PROC_INST_ENDING:U++,OPEN_TAG:U++,OPEN_TAG_SLASH:U++,ATTRIB:U++,ATTRIB_NAME:U++,ATTRIB_NAME_SAW_WHITE:U++,ATTRIB_VALUE:U++,ATTRIB_VALUE_QUOTED:U++,ATTRIB_VALUE_CLOSED:U++,ATTRIB_VALUE_UNQUOTED:U++,ATTRIB_VALUE_ENTITY_Q:U++,ATTRIB_VALUE_ENTITY_U:U++,CLOSE_TAG:U++,CLOSE_TAG_SAW_WHITE:U++,SCRIPT:U++,SCRIPT_ENDING:U++},m.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},m.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,t.default)(m.ENTITIES).forEach(function(Y){var J=m.ENTITIES[Y],be=typeof J=="number"?String.fromCharCode(J):J;m.ENTITIES[Y]=be});for(var q in m.STATE)m.STATE[m.STATE[q]]=q;U=m.STATE,p.default||function(){var Y=String.fromCharCode,J=Math.floor,be=function(){var ke,ct,He=[],Be=-1,Ze=arguments.length;if(!Ze)return"";for(var ht="";++Be1114111||J(Qe)!==Qe)throw RangeError("Invalid code point: "+Qe);Qe<=65535?He.push(Qe):(Qe-=65536,ke=55296+(Qe>>10),ct=Qe%1024+56320,He.push(ke,ct)),(Be+1===Ze||He.length>16384)&&(ht+=Y.apply(null,He),He.length=0)}return ht};h.default?Object.defineProperty(String,"fromCodePoint",{value:be,configurable:!0,writable:!0}):String.fromCodePoint=be}()}(x===void 0?(void 0).sax={}:x)}).call(this,S("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/create":19,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/string/from-code-point":26,"babel-runtime/helpers/typeof":32,buffer:38,stream:195,string_decoder:37}],195:[function(S,D,x){function T(){w.call(this)}D.exports=T;var w=S("events").EventEmitter;S("inherits")(T,w),T.Readable=S("readable-stream/readable.js"),T.Writable=S("readable-stream/writable.js"),T.Duplex=S("readable-stream/duplex.js"),T.Transform=S("readable-stream/transform.js"),T.PassThrough=S("readable-stream/passthrough.js"),T.Stream=T,T.prototype.pipe=function(f,p){function u(n){f.writable&&f.write(n)===!1&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}function i(){t||(t=!0,f.end())}function l(){t||(t=!0,typeof f.destroy=="function"&&f.destroy())}function s(n){if(h(),w.listenerCount(this,"error")===0)throw n}function h(){r.removeListener("data",u),f.removeListener("drain",o),r.removeListener("end",i),r.removeListener("close",l),r.removeListener("error",s),f.removeListener("error",s),r.removeListener("end",h),r.removeListener("close",h),f.removeListener("close",h)}var r=this;r.on("data",u),f.on("drain",o),f._isStdio||p&&p.end===!1||(r.on("end",i),r.on("close",l));var t=!1;return r.on("error",s),f.on("error",s),r.on("end",h),r.on("close",h),f.on("close",h),f.emit("pipe",r),f}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(S,D,x){(function(T){var w=S("./lib/request"),f=S("./lib/response"),p=S("xtend"),u=S("builtin-status-codes"),o=S("url"),i=x;i.request=function(l,s){l=typeof l=="string"?o.parse(l):p(l);var h=T.location.protocol.search(/^https?:$/)===-1?"http:":"",r=l.protocol||h,t=l.hostname||l.host,n=l.port,c=l.path||"/";t&&t.indexOf(":")!==-1&&(t="["+t+"]"),l.url=(t?r+"//"+t:"")+(n?":"+n:"")+c,l.method=(l.method||"GET").toUpperCase(),l.headers=l.headers||{};var m=new w(l);return s&&m.on("response",s),m},i.get=function(l,s){var h=i.request(l,s);return h.end(),h},i.ClientRequest=w,i.IncomingMessage=f.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=u,i.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(S,D,x){(function(T){"use strict";function w(){if(u!==void 0)return u;if(T.XMLHttpRequest){u=new T.XMLHttpRequest;try{u.open("GET",T.XDomainRequest?"/":"https://example.com")}catch(l){u=null}}else u=null;return u}function f(l){var s=w();if(!s)return!1;try{return s.responseType=l,s.responseType===l}catch(h){}return!1}function p(l){return typeof l=="function"}x.fetch=p(T.fetch)&&p(T.ReadableStream),x.writableStream=p(T.WritableStream),x.abortController=p(T.AbortController),x.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),x.blobConstructor=!0}catch(l){}var u,o=T.ArrayBuffer!==void 0,i=o&&p(T.ArrayBuffer.prototype.slice);x.arraybuffer=x.fetch||o&&f("arraybuffer"),x.msstream=!x.fetch&&i&&f("ms-stream"),x.mozchunkedarraybuffer=!x.fetch&&o&&f("moz-chunked-arraybuffer"),x.overrideMimeType=x.fetch||!!w()&&p(w().overrideMimeType),x.vbArray=p(T.VBArray),u=null}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(S,D,x){(function(T,w,f){"use strict";function p(b,E){return l.fetch&&E?"fetch":l.mozchunkedarraybuffer?"moz-chunked-arraybuffer":l.msstream?"ms-stream":l.arraybuffer&&b?"arraybuffer":l.vbArray&&b?"text:vbarray":"text"}function u(b){try{var E=b.status;return E!==null&&E!==0}catch(g){return!1}}var o=S("babel-runtime/core-js/object/keys"),i=function(b){return b&&b.__esModule?b:{default:b}}(o),l=S("./capability"),s=S("inherits"),h=S("./response"),r=S("readable-stream"),t=S("to-arraybuffer"),n=h.IncomingMessage,c=h.readyStates,m=D.exports=function(b){var E=this;r.Writable.call(E),E._opts=b,E._body=[],E._headers={},b.auth&&E.setHeader("Authorization","Basic "+new f(b.auth).toString("base64")),(0,i.default)(b.headers).forEach(function(C){E.setHeader(C,b.headers[C])});var g,y=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!l.abortController)y=!1,g=!0;else if(b.mode==="prefer-streaming")g=!1;else if(b.mode==="allow-wrong-content-type")g=!l.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");g=!0}E._mode=p(g,y),E._fetchTimer=null,E.on("finish",function(){E._onFinish()})};s(m,r.Writable),m.prototype.setHeader=function(b,E){var g=this,y=b.toLowerCase();v.indexOf(y)===-1&&(g._headers[y]={name:b,value:E})},m.prototype.getHeader=function(b){var E=this._headers[b.toLowerCase()];return E?E.value:null},m.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},m.prototype._onFinish=function(){var b=this;if(!b._destroyed){var E=b._opts,g=b._headers,y=null;E.method!=="GET"&&E.method!=="HEAD"&&(y=l.arraybuffer?t(f.concat(b._body)):l.blobConstructor?new w.Blob(b._body.map(function(A){return t(A)}),{type:(g["content-type"]||{}).value||""}):f.concat(b._body).toString());var C=[];if((0,i.default)(g).forEach(function(A){var P=g[A].name,I=g[A].value;Array.isArray(I)?I.forEach(function(W){C.push([P,W])}):C.push([P,I])}),b._mode==="fetch"){var d=null;if(l.abortController){var _=new AbortController;d=_.signal,b._fetchAbortController=_,"requestTimeout"in E&&E.requestTimeout!==0&&(b._fetchTimer=w.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},E.requestTimeout))}w.fetch(b._opts.url,{method:b._opts.method,headers:C,body:y||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:d}).then(function(A){b._fetchResponse=A,b._connect()},function(A){w.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",A)})}else{var O=b._xhr=new w.XMLHttpRequest;try{O.open(b._opts.method,b._opts.url,!0)}catch(A){return void T.nextTick(function(){b.emit("error",A)})}"responseType"in O&&(O.responseType=b._mode.split(":")[0]),"withCredentials"in O&&(O.withCredentials=!!E.withCredentials),b._mode==="text"&&"overrideMimeType"in O&&O.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(O.timeout=E.requestTimeout,O.ontimeout=function(){b.emit("requestTimeout")}),C.forEach(function(A){O.setRequestHeader(A[0],A[1])}),b._response=null,O.onreadystatechange=function(){switch(O.readyState){case c.LOADING:case c.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(O.onprogress=function(){b._onXHRProgress()}),O.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{O.send(y)}catch(A){return void T.nextTick(function(){b.emit("error",A)})}}}},m.prototype._onXHRProgress=function(){var b=this;u(b._xhr)&&!b._destroyed&&(b._response||b._connect(),b._response._onXHRProgress())},m.prototype._connect=function(){var b=this;b._destroyed||(b._response=new n(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(E){b.emit("error",E)}),b.emit("response",b._response))},m.prototype._write=function(b,E,g){this._body.push(b),g()},m.prototype.abort=m.prototype.destroy=function(){var b=this;b._destroyed=!0,w.clearTimeout(b._fetchTimer),b._response&&(b._response._destroyed=!0),b._xhr?b._xhr.abort():b._fetchAbortController&&b._fetchAbortController.abort()},m.prototype.end=function(b,E,g){var y=this;typeof b=="function"&&(g=b,b=void 0),r.Writable.prototype.end.call(y,b,E,g)},m.prototype.flushHeaders=function(){},m.prototype.setTimeout=function(){},m.prototype.setNoDelay=function(){},m.prototype.setSocketKeepAlive=function(){};var v=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,S("_process"),typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},S("buffer").Buffer)},{"./capability":197,"./response":199,_process:173,"babel-runtime/core-js/object/keys":23,buffer:38,inherits:162,"readable-stream":188,"to-arraybuffer":202}],199:[function(S,D,x){(function(T,w,f){"use strict";var p=S("babel-runtime/core-js/promise"),u=function(r){return r&&r.__esModule?r:{default:r}}(p),o=S("./capability"),i=S("inherits"),l=S("readable-stream"),s=x.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=x.IncomingMessage=function(r,t,n,c){var m=this;if(l.Readable.call(m),m._mode=n,m.headers={},m.rawHeaders=[],m.trailers={},m.rawTrailers=[],m.on("end",function(){T.nextTick(function(){m.emit("close")})}),n==="fetch"){if(m._fetchResponse=t,m.url=t.url,m.statusCode=t.status,m.statusMessage=t.statusText,t.headers.forEach(function(y,C){m.headers[C.toLowerCase()]=y,m.rawHeaders.push(C,y)}),o.writableStream){var v=new WritableStream({write:function(y){return new u.default(function(C,d){m._destroyed?d():m.push(new f(y))?C():m._resumeFetch=C})},close:function(){w.clearTimeout(c),m._destroyed||m.push(null)},abort:function(y){m._destroyed||m.emit("error",y)}});try{return void t.body.pipeTo(v).catch(function(y){w.clearTimeout(c),m._destroyed||m.emit("error",y)})}catch(y){}}var b=t.body.getReader();!function y(){b.read().then(function(C){if(!m._destroyed){if(C.done)return w.clearTimeout(c),void m.push(null);m.push(new f(C.value)),y()}}).catch(function(C){w.clearTimeout(c),m._destroyed||m.emit("error",C)})}()}else if(m._xhr=r,m._pos=0,m.url=r.responseURL,m.statusCode=r.status,m.statusMessage=r.statusText,r.getAllResponseHeaders().split(/\r?\n/).forEach(function(y){var C=y.match(/^([^:]+):\s*(.*)/);if(C){var d=C[1].toLowerCase();d==="set-cookie"?(m.headers[d]===void 0&&(m.headers[d]=[]),m.headers[d].push(C[2])):m.headers[d]!==void 0?m.headers[d]+=", "+C[2]:m.headers[d]=C[2],m.rawHeaders.push(C[1],C[2])}}),m._charset="x-user-defined",!o.overrideMimeType){var E=m.rawHeaders["mime-type"];if(E){var g=E.match(/;\s*charset=([^;])(;|$)/);g&&(m._charset=g[1].toLowerCase())}m._charset||(m._charset="utf-8")}};i(h,l.Readable),h.prototype._read=function(){var r=this,t=r._resumeFetch;t&&(r._resumeFetch=null,t())},h.prototype._onXHRProgress=function(){var r=this,t=r._xhr,n=null;switch(r._mode){case"text:vbarray":if(t.readyState!==s.DONE)break;try{n=new w.VBArray(t.responseBody).toArray()}catch(E){}if(n!==null){r.push(new f(n));break}case"text":try{n=t.responseText}catch(E){r._mode="text:vbarray";break}if(n.length>r._pos){var c=n.substr(r._pos);if(r._charset==="x-user-defined"){for(var m=new f(c.length),v=0;vr._pos&&(r.push(new f(new Uint8Array(b.result.slice(r._pos)))),r._pos=b.result.byteLength)},b.onload=function(){r.push(null)},b.readAsArrayBuffer(n)}r._xhr.readyState===s.DONE&&r._mode!=="ms-stream"&&r.push(null)}}).call(this,S("_process"),typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{},S("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(S,D,x){"use strict";function T(E){if(!E)return"utf8";for(var g;;)switch(E){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return E;default:if(g)return;E=(""+E).toLowerCase(),g=!0}}function w(E){var g=T(E);if(typeof g!="string"&&(v.isEncoding===b||!b(E)))throw new Error("Unknown encoding: "+E);return g||E}function f(E){this.encoding=w(E);var g;switch(this.encoding){case"utf16le":this.text=h,this.end=r,g=4;break;case"utf8":this.fillLast=i,g=4;break;case"base64":this.text=t,this.end=n,g=3;break;default:return this.write=c,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=v.allocUnsafe(g)}function p(E){return E<=127?0:E>>5==6?2:E>>4==14?3:E>>3==30?4:E>>6==2?-1:-2}function u(E,g,y){var C=g.length-1;if(C=0?(d>0&&(E.lastNeed=d-1),d):--C=0?(d>0&&(E.lastNeed=d-2),d):--C=0?(d>0&&(d===2?d=0:E.lastNeed=d-3),d):0)}function o(E,g,y){if((192&g[0])!=128)return E.lastNeed=0,"\u951F\uFFFD";if(E.lastNeed>1&&g.length>1){if((192&g[1])!=128)return E.lastNeed=1,"\u951F\uFFFD";if(E.lastNeed>2&&g.length>2&&(192&g[2])!=128)return E.lastNeed=2,"\u951F\uFFFD"}}function i(E){var g=this.lastTotal-this.lastNeed,y=o(this,E,g);return y!==void 0?y:this.lastNeed<=E.length?(E.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(E.copy(this.lastChar,g,0,E.length),void(this.lastNeed-=E.length))}function l(E,g){var y=u(this,E,g);if(!this.lastNeed)return E.toString("utf8",g);this.lastTotal=y;var C=E.length-(y-this.lastNeed);return E.copy(this.lastChar,0,C),E.toString("utf8",g,C)}function s(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+"\u951F\uFFFD":g}function h(E,g){if((E.length-g)%2==0){var y=E.toString("utf16le",g);if(y){var C=y.charCodeAt(y.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",g,E.length-1)}function r(E){var g=E&&E.length?this.write(E):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,y)}return g}function t(E,g){var y=(E.length-g)%3;return y===0?E.toString("base64",g):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",g,E.length-y))}function n(E){var g=E&&E.length?this.write(E):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function c(E){return E.toString(this.encoding)}function m(E){return E&&E.length?this.write(E):""}var v=S("safe-buffer").Buffer,b=v.isEncoding||function(E){switch((E=""+E)&&E.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};x.StringDecoder=f,f.prototype.write=function(E){if(E.length===0)return"";var g,y;if(this.lastNeed){if((g=this.fillLast(E))===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},h))},x.setImmediate=typeof T=="function"?T:function(s){var h=l++,r=!(arguments.length<2)&&o.call(arguments,1);return i[h]=!0,p(function(){i[h]&&(r?s.apply(null,r):s.call(null),x.clearImmediate(h))}),h},x.clearImmediate=typeof w=="function"?w:function(s){delete i[s]}}).call(this,S("timers").setImmediate,S("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(S,D,x){var T=S("buffer").Buffer;D.exports=function(w){if(w instanceof Uint8Array){if(w.byteOffset===0&&w.byteLength===w.buffer.byteLength)return w.buffer;if(typeof w.buffer.slice=="function")return w.buffer.slice(w.byteOffset,w.byteOffset+w.byteLength)}if(T.isBuffer(w)){for(var f=new Uint8Array(w.length),p=w.length,u=0;u",'"',"`"," ","\r",` `," "],t=["{","}","|","\\","^","`"].concat(r),n=["'"].concat(t),c=["%","/","?",";","#"].concat(n),m=["/","?","#"],v=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=S("querystring");T.prototype.parse=function(d,_,O){if(!i.isString(d))throw new TypeError("Parameter 'url' must be a string, not "+typeof d);var A=d.indexOf("?"),P=A!==-1&&A127?xe+="x":xe+=Ee[Ge];if(!xe.match(v)){var We=we.slice(0,$),ze=we.slice($+1),de=Ee.match(b);de&&(We.push(de[1]),ze.unshift(de[2])),ze.length&&(K="/"+ze.join(".")+K),this.hostname=We.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Te||(this.hostname=o.toASCII(this.hostname));var le=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+le,this.href+=this.host,Te&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),K[0]!=="/"&&(K="/"+K))}if(!E[G])for(var $=0,Me=n.length;$0)&&O.host.split("@");xe&&(O.auth=xe.shift(),O.host=O.hostname=xe.shift())}return O.search=d.search,O.query=d.query,i.isNull(O.pathname)&&i.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!we.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var Ge=we.slice(-1)[0],je=(O.host||d.host||we.length>1)&&(Ge==="."||Ge==="..")||Ge==="",We=0,ze=we.length;ze>=0;ze--)Ge=we[ze],Ge==="."?we.splice(ze,1):Ge===".."?(we.splice(ze,1),We++):We&&(we.splice(ze,1),We--);if(!pe&&!Te)for(;We--;We)we.unshift("..");!pe||we[0]===""||we[0]&&we[0].charAt(0)==="/"||we.unshift(""),je&&we.join("/").substr(-1)!=="/"&&we.push("");var de=we[0]===""||we[0]&&we[0].charAt(0)==="/";if(Ee){O.hostname=O.host=de?"":we.length?we.shift():"";var xe=!!(O.host&&O.host.indexOf("@")>0)&&O.host.split("@");xe&&(O.auth=xe.shift(),O.host=O.hostname=xe.shift())}return pe=pe||O.host&&we.length,pe&&!de&&we.unshift(""),we.length?O.pathname=we.join("/"):(O.pathname=null,O.path=null),i.isNull(O.pathname)&&i.isNull(O.search)||(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=d.auth||O.auth,O.slashes=O.slashes||d.slashes,O.href=O.format(),O},T.prototype.parseHost=function(){var d=this.host,_=s.exec(d);_&&(_=_[0],_!==":"&&(this.port=_.substr(1)),d=d.substr(0,d.length-_.length)),d&&(this.hostname=d)}},{"./util":204,punycode:174,querystring:177}],204:[function(S,D,x){"use strict";D.exports={isString:function(T){return typeof T=="string"},isObject:function(T){return typeof T=="object"&&T!==null},isNull:function(T){return T===null},isNullOrUndefined:function(T){return T==null}}},{}],205:[function(S,D,x){(function(T){function w(p,u){function o(){if(!i){if(f("throwDeprecation"))throw new Error(u);f("traceDeprecation")?console.trace(u):console.warn(u),i=!0}return p.apply(this,arguments)}if(f("noDeprecation"))return p;var i=!1;return o}function f(p){try{if(!T.localStorage)return!1}catch(o){return!1}var u=T.localStorage[p];return u!=null&&String(u).toLowerCase()==="true"}D.exports=w}).call(this,typeof ue!="undefined"?ue:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(S,D,x){D.exports=function(T){return T&&typeof T=="object"&&typeof T.copy=="function"&&typeof T.fill=="function"&&typeof T.readUInt8=="function"}},{}],207:[function(S,D,x){(function(T,w){function f($,ne){var he={seen:[],stylize:u};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),c(ne)?he.showHidden=ne:ne&&x._extend(he,ne),y(he.showHidden)&&(he.showHidden=!1),y(he.depth)&&(he.depth=2),y(he.colors)&&(he.colors=!1),y(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=p),i(he,$,he.depth)}function p($,ne){var he=f.styles[ne];return he?"["+f.colors[he][0]+"m"+$+"["+f.colors[he][1]+"m":$}function u($,ne){return $}function o($){var ne={};return $.forEach(function(he,pe){ne[he]=!0}),ne}function i($,ne,he){if($.customInspect&&ne&&A(ne.inspect)&&ne.inspect!==x.inspect&&(!ne.constructor||ne.constructor.prototype!==ne)){var pe=ne.inspect(he,$);return E(pe)||(pe=i($,pe,he)),pe}var Te=l($,ne);if(Te)return Te;var we=Object.keys(ne),Me=o(we);if($.showHidden&&(we=Object.getOwnPropertyNames(ne)),O(ne)&&(we.indexOf("message")>=0||we.indexOf("description")>=0))return s(ne);if(we.length===0){if(A(ne)){var Ee=ne.name?": "+ne.name:"";return $.stylize("[Function"+Ee+"]","special")}if(C(ne))return $.stylize(RegExp.prototype.toString.call(ne),"regexp");if(_(ne))return $.stylize(Date.prototype.toString.call(ne),"date");if(O(ne))return s(ne)}var xe="",Ge=!1,je=["{","}"];if((n(ne)&&(Ge=!0,je=["[","]"]),A(ne))&&(xe=" [Function"+(ne.name?": "+ne.name:"")+"]"),C(ne)&&(xe=" "+RegExp.prototype.toString.call(ne)),_(ne)&&(xe=" "+Date.prototype.toUTCString.call(ne)),O(ne)&&(xe=" "+s(ne)),we.length===0&&(!Ge||ne.length==0))return je[0]+xe+je[1];if(he<0)return C(ne)?$.stylize(RegExp.prototype.toString.call(ne),"regexp"):$.stylize("[Object]","special");$.seen.push(ne);var We;return We=Ge?h($,ne,he,Me,we):we.map(function(ze){return r($,ne,he,Me,ze,Ge)}),$.seen.pop(),t(We,xe,je)}function l($,ne){if(y(ne))return $.stylize("undefined","undefined");if(E(ne)){var he="'"+JSON.stringify(ne).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(he,"string")}return b(ne)?$.stylize(""+ne,"number"):c(ne)?$.stylize(""+ne,"boolean"):m(ne)?$.stylize("null","null"):void 0}function s($){return"["+Error.prototype.toString.call($)+"]"}function h($,ne,he,pe,Te){for(var we=[],Me=0,Ee=ne.length;Me-1&&(Ee=we?Ee.split(` `).map(function(Ge){return" "+Ge}).join(` `).substr(2):` `+Ee.split(` `).map(function(Ge){return" "+Ge}).join(` `))):Ee=$.stylize("[Circular]","special")),y(Me)){if(we&&Te.match(/^\d+$/))return Ee;Me=JSON.stringify(""+Te),Me.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Me=Me.substr(1,Me.length-2),Me=$.stylize(Me,"name")):(Me=Me.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Me=$.stylize(Me,"string"))}return Me+": "+Ee}function t($,ne,he){var pe=0;return $.reduce(function(Te,we){return pe++,we.indexOf(` `)>=0&&pe++,Te+we.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?he[0]+(ne===""?"":ne+` `)+" "+$.join(`, `)+" "+he[1]:he[0]+ne+" "+$.join(", ")+" "+he[1]}function n($){return Array.isArray($)}function c($){return typeof $=="boolean"}function m($){return $===null}function v($){return $==null}function b($){return typeof $=="number"}function E($){return typeof $=="string"}function g($){return typeof $=="symbol"}function y($){return $===void 0}function C($){return d($)&&I($)==="[object RegExp]"}function d($){return typeof $=="object"&&$!==null}function _($){return d($)&&I($)==="[object Date]"}function O($){return d($)&&(I($)==="[object Error]"||$ instanceof Error)}function A($){return typeof $=="function"}function P($){return $===null||typeof $=="boolean"||typeof $=="number"||typeof $=="string"||typeof $=="symbol"||$===void 0}function I($){return Object.prototype.toString.call($)}function W($){return $<10?"0"+$.toString(10):$.toString(10)}function K(){var $=new Date,ne=[W($.getHours()),W($.getMinutes()),W($.getSeconds())].join(":");return[$.getDate(),re[$.getMonth()],ne].join(" ")}function te($,ne){return Object.prototype.hasOwnProperty.call($,ne)}var H=/%[sdj%]/g;x.format=function($){if(!E($)){for(var ne=[],he=0;he=Te)return xe;switch(xe){case"%s":return String(pe[he++]);case"%d":return Number(pe[he++]);case"%j":try{return JSON.stringify(pe[he++])}catch(Ge){return"[Circular]"}default:return xe}}),Me=pe[he];he=0||t.indexOf(">")>=0||t.indexOf("<")>=0)},h=function(t){return""},l=function(t){return t.replace("]]>","]]]]>")},x.Builder=function(){function t(n){var c,m,v;this.options={},m=i[.2];for(c in m)r.call(m,c)&&(v=m[c],this.options[c]=v);for(c in n)r.call(n,c)&&(v=n[c],this.options[c]=v)}return t.prototype.buildObject=function(n){var c,m,v,b,E;return c=this.options.attrkey,m=this.options.charkey,(0,u.default)(n).length===1&&this.options.rootName===i[.2].rootName?(E=(0,u.default)(n)[0],n=n[E]):E=this.options.rootName,v=function(g){return function(y,C){var d,_,O,A,P,I;if((C===void 0?"undefined":(0,f.default)(C))!=="object")g.options.cdata&&s(C)?y.raw(h(C)):y.txt(C);else if(Array.isArray(C)){for(A in C)if(r.call(C,A)){_=C[A];for(P in _)O=_[P],y=v(y.ele(P),O).up()}}else for(P in C)if(r.call(C,P))if(_=C[P],P===c){if((_===void 0?"undefined":(0,f.default)(_))==="object")for(d in _)I=_[d],y=y.att(d,I)}else if(P===m)y=g.options.cdata&&s(_)?y.raw(h(_)):y.txt(_);else if(Array.isArray(_))for(A in _)r.call(_,A)&&(O=_[A],y=typeof O=="string"?g.options.cdata&&s(O)?y.ele(P).raw(h(O)).up():y.ele(P,O).up():v(y.ele(P),O).up());else(_===void 0?"undefined":(0,f.default)(_))==="object"?y=v(y.ele(P),_).up():typeof _=="string"&&g.options.cdata&&s(_)?y=y.ele(P).raw(h(_)).up():(_==null&&(_=""),y=y.ele(P,_.toString()).up());return y}}(this),b=o.create(E,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),v(b,n).end(this.options.renderOpts)},t}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(S,D,x){"use strict";(function(){x.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:` `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],211:[function(S,D,x){"use strict";function T(l){return l&&l.__esModule?l:{default:l}}var w=S("babel-runtime/core-js/object/get-own-property-names"),f=T(w),p=S("babel-runtime/core-js/object/keys"),u=T(p),o=S("babel-runtime/helpers/typeof"),i=T(o);(function(){var l,s,h,r,t,n,c,m,v=function(g,y){return function(){return g.apply(y,arguments)}},b=function(g,y){function C(){this.constructor=g}for(var d in y)E.call(y,d)&&(g[d]=y[d]);return C.prototype=y.prototype,g.prototype=new C,g.__super__=y.prototype,g},E={}.hasOwnProperty;c=S("sax"),h=S("events"),l=S("./bom"),n=S("./processors"),m=S("timers").setImmediate,s=S("./defaults").defaults,r=function(g){return(g===void 0?"undefined":(0,i.default)(g))==="object"&&g!=null&&(0,u.default)(g).length===0},t=function(g,y,C){var d,_,O;for(d=0,_=g.length;d<_;d++)O=g[d],y=O(y,C);return y},x.Parser=function(g){function y(C){this.parseString=v(this.parseString,this),this.reset=v(this.reset,this),this.assignOrPush=v(this.assignOrPush,this),this.processAsync=v(this.processAsync,this);var d,_,O;if(!(this instanceof x.Parser))return new x.Parser(C);this.options={},_=s[.2];for(d in _)E.call(_,d)&&(O=_[d],this.options[d]=O);for(d in C)E.call(C,d)&&(O=C[d],this.options[d]=O);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(n.normalize)),this.reset()}return b(y,g),y.prototype.processAsync=function(){var C,d;try{return this.remaining.length<=this.options.chunkSize?(C=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(C),this.saxParser.close()):(C=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(C),m(this.processAsync))}catch(_){if(d=_,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(d)}},y.prototype.assignOrPush=function(C,d,_){return d in C?(C[d]instanceof Array||(C[d]=[C[d]]),C[d].push(_)):this.options.explicitArray?C[d]=[_]:C[d]=_},y.prototype.reset=function(){var C,d,_,O;return this.removeAllListeners(),this.saxParser=c.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(A){return function(P){if(A.saxParser.resume(),!A.saxParser.errThrown)return A.saxParser.errThrown=!0,A.emit("error",P)}}(this),this.saxParser.onend=function(A){return function(){if(!A.saxParser.ended)return A.saxParser.ended=!0,A.emit("end",A.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,O=[],C=this.options.attrkey,d=this.options.charkey,this.saxParser.onopentag=function(A){return function(P){var I,W,K,te,H;if(K={},K[d]="",!A.options.ignoreAttrs){H=P.attributes;for(I in H)E.call(H,I)&&(C in K||A.options.mergeAttrs||(K[C]={}),W=A.options.attrValueProcessors?t(A.options.attrValueProcessors,P.attributes[I],I):P.attributes[I],te=A.options.attrNameProcessors?t(A.options.attrNameProcessors,I):I,A.options.mergeAttrs?A.assignOrPush(K,te,W):K[C][te]=W)}return K["#name"]=A.options.tagNameProcessors?t(A.options.tagNameProcessors,P.name):P.name,A.options.xmlns&&(K[A.options.xmlnskey]={uri:P.uri,local:P.local}),O.push(K)}}(this),this.saxParser.onclosetag=function(A){return function(){var P,I,W,K,te,H,G,V,re,$;if(H=O.pop(),te=H["#name"],A.options.explicitChildren&&A.options.preserveChildrenOrder||delete H["#name"],H.cdata===!0&&(P=H.cdata,delete H.cdata),re=O[O.length-1],H[d].match(/^\s*$/)&&!P?(I=H[d],delete H[d]):(A.options.trim&&(H[d]=H[d].trim()),A.options.normalize&&(H[d]=H[d].replace(/\s{2,}/g," ").trim()),H[d]=A.options.valueProcessors?t(A.options.valueProcessors,H[d],te):H[d],(0,u.default)(H).length===1&&d in H&&!A.EXPLICIT_CHARKEY&&(H=H[d])),r(H)&&(H=A.options.emptyTag!==""?A.options.emptyTag:I),A.options.validator!=null&&($="/"+function(){var ne,he,pe;for(pe=[],ne=0,he=O.length;ne0&&(K[A.options.childkey]=H),H=K;return O.length>0?A.assignOrPush(re,te,H):(A.options.explicitRoot&&(V=H,H={},H[te]=V),A.resultObject=H,A.saxParser.ended=!0,A.emit("end",A.resultObject))}}(this),_=function(A){return function(P){var I,W;if(W=O[O.length-1])return W[d]+=P,A.options.explicitChildren&&A.options.preserveChildrenOrder&&A.options.charsAsChildren&&(A.options.includeWhiteChars||P.replace(/\\n/g,"").trim()!=="")&&(W[A.options.childkey]=W[A.options.childkey]||[],I={"#name":"__text__"},I[d]=P,A.options.normalize&&(I[d]=I[d].replace(/\s{2,}/g," ").trim()),W[A.options.childkey].push(I)),W}}(this),this.saxParser.ontext=_,this.saxParser.oncdata=function(A){return function(P){var I;if(I=_(P))return I.cdata=!0}}()},y.prototype.parseString=function(C,d){var _;d!=null&&typeof d=="function"&&(this.on("end",function(O){return this.reset(),d(null,O)}),this.on("error",function(O){return this.reset(),d(O)}));try{return C=C.toString(),C.trim()===""?(this.emit("end",null),!0):(C=l.stripBOM(C),this.options.async?(this.remaining=C,m(this.processAsync),this.saxParser):this.saxParser.write(C).close())}catch(O){if(_=O,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",_),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw _}},y}(h.EventEmitter),x.parseString=function(g,y,C){var d,_,O;return C!=null?(typeof C=="function"&&(d=C),(y===void 0?"undefined":(0,i.default)(y))==="object"&&(_=y)):(typeof y=="function"&&(d=y),_={}),O=new x.Parser(_),O.parseString(g,d)}}).call(void 0)},{"./bom":208,"./defaults":210,"./processors":212,"babel-runtime/core-js/object/get-own-property-names":21,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,events:158,sax:194,timers:201}],212:[function(S,D,x){"use strict";(function(){var T;T=new RegExp(/(?!xmlns)^.*:/),x.normalize=function(w){return w.toLowerCase()},x.firstCharLowerCase=function(w){return w.charAt(0).toLowerCase()+w.slice(1)},x.stripPrefix=function(w){return w.replace(T,"")},x.parseNumbers=function(w){return isNaN(w)||(w=w%1==0?parseInt(w,10):parseFloat(w)),w},x.parseBooleans=function(w){return/^(?:true|false)$/i.test(w)&&(w=w.toLowerCase()==="true"),w}}).call(void 0)},{}],213:[function(S,D,x){"use strict";(function(){var T,w,f,p,u=function(i,l){function s(){this.constructor=i}for(var h in l)o.call(l,h)&&(i[h]=l[h]);return s.prototype=l.prototype,i.prototype=new s,i.__super__=l.prototype,i},o={}.hasOwnProperty;w=S("./defaults"),T=S("./builder"),f=S("./parser"),p=S("./processors"),x.defaults=w.defaults,x.processors=p,x.ValidationError=function(i){function l(s){this.message=s}return u(l,i),l}(Error),x.Builder=T.Builder,x.Parser=f.Parser,x.parseString=f.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(S,D,x){"use strict";function T(l){return l&&l.__esModule?l:{default:l}}var w=S("babel-runtime/core-js/object/get-prototype-of"),f=T(w),p=S("babel-runtime/helpers/typeof"),u=T(p),o=S("babel-runtime/core-js/object/assign"),i=T(o);(function(){var l,s,h,r,t,n,c=[].slice,m={}.hasOwnProperty;l=function(){var v,b,E,g,y,C;if(C=arguments[0],y=2<=arguments.length?c.call(arguments,1):[],r(i.default))i.default.apply(null,arguments);else for(v=0,E=y.length;v=0;)this.up();return this.onEnd()},C.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},C.prototype.openNode=function(d){if(!d.isOpen)return!this.root&&this.currentLevel===0&&d instanceof h&&(this.root=d),this.onData(this.writer.openNode(d,this.currentLevel)),d.isOpen=!0},C.prototype.closeNode=function(d){if(!d.isClosed)return this.onData(this.writer.closeNode(d,this.currentLevel)),d.isClosed=!0},C.prototype.onData=function(d){return this.documentStarted=!0,this.onDataCallback(d)},C.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},C.prototype.ele=function(){return this.element.apply(this,arguments)},C.prototype.nod=function(d,_,O){return this.node(d,_,O)},C.prototype.txt=function(d){return this.text(d)},C.prototype.dat=function(d){return this.cdata(d)},C.prototype.com=function(d){return this.comment(d)},C.prototype.ins=function(d,_){return this.instruction(d,_)},C.prototype.dec=function(d,_,O){return this.declaration(d,_,O)},C.prototype.dtd=function(d,_,O){return this.doctype(d,_,O)},C.prototype.e=function(d,_,O){return this.element(d,_,O)},C.prototype.n=function(d,_,O){return this.node(d,_,O)},C.prototype.t=function(d){return this.text(d)},C.prototype.d=function(d){return this.cdata(d)},C.prototype.c=function(d){return this.comment(d)},C.prototype.r=function(d){return this.raw(d)},C.prototype.i=function(d,_){return this.instruction(d,_)},C.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},C.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},C.prototype.ent=function(d,_){return this.entity(d,_)},C.prototype.pent=function(d,_){return this.pEntity(d,_)},C.prototype.not=function(d,_){return this.notation(d,_)},C}()}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLStringWriter":231,"./XMLStringifier":232,"./XMLText":233}],226:[function(S,D,x){"use strict";var T=S("babel-runtime/core-js/object/create"),w=function(f){return f&&f.__esModule?f:{default:f}}(T);(function(){var f,p,u,o,i,l=function(h,r){function t(){this.constructor=h}for(var n in r)s.call(r,n)&&(h[n]=r[n]);return t.prototype=r.prototype,h.prototype=new t,h.__super__=r.prototype,h},s={}.hasOwnProperty;i=S("./Utility"),o=i.isObject,u=i.isFunction,p=S("./XMLNode"),f=S("./XMLAttribute"),D.exports=function(h){function r(t,n,c){if(r.__super__.constructor.call(this,t),n==null)throw new Error("Missing element name");this.name=this.stringify.eleName(n),this.attributes={},c!=null&&this.attribute(c),t.isDocument&&(this.isRoot=!0,this.documentObject=t,t.rootObject=this)}return l(r,h),r.prototype.clone=function(){var t,n,c,m;c=(0,w.default)(this),c.isRoot&&(c.documentObject=null),c.attributes={},m=this.attributes;for(n in m)s.call(m,n)&&(t=m[n],c.attributes[n]=t.clone());return c.children=[],this.children.forEach(function(v){var b;return b=v.clone(),b.parent=c,c.children.push(b)}),c},r.prototype.attribute=function(t,n){var c,m;if(t!=null&&(t=t.valueOf()),o(t))for(c in t)s.call(t,c)&&(m=t[c],this.attribute(c,m));else u(n)&&(n=n.apply()),this.options.skipNullAttributes&&n==null||(this.attributes[t]=new f(this,t,n));return this},r.prototype.removeAttribute=function(t){var n,c,m;if(t==null)throw new Error("Missing attribute name");if(t=t.valueOf(),Array.isArray(t))for(c=0,m=t.length;c"+this.endline(E))},b.prototype.comment=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},b.prototype.declaration=function(E,g){return this.stream.write(this.space(g)),this.stream.write('"),this.stream.write(this.endline(E))},b.prototype.docType=function(E,g){var y,C,d,_;if(g||(g=0),this.stream.write(this.space(g)),this.stream.write("0){for(this.stream.write(" ["),this.stream.write(this.endline(E)),_=E.children,C=0,d=_.length;C"),this.stream.write(this.endline(E))},b.prototype.element=function(E,g){var y,C,d,_,O,A,P,I;g||(g=0),I=this.space(g),this.stream.write(I+"<"+E.name),A=E.attributes;for(O in A)m.call(A,O)&&(y=A[O],this.attribute(y));if(E.children.length===0||E.children.every(function(W){return W.value===""}))this.allowEmpty?this.stream.write(">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)this.stream.write(">"),this.stream.write(E.children[0].value),this.stream.write("");else{for(this.stream.write(">"+this.newline),P=E.children,d=0,_=P.length;d<_;d++)switch(C=P[d],!1){case!(C instanceof T):this.cdata(C,g+1);break;case!(C instanceof w):this.comment(C,g+1);break;case!(C instanceof s):this.element(C,g+1);break;case!(C instanceof r):this.raw(C,g+1);break;case!(C instanceof t):this.text(C,g+1);break;case!(C instanceof h):this.processingInstruction(C,g+1);break;default:throw new Error("Unknown XML node type: "+C.constructor.name)}this.stream.write(I+"")}return this.stream.write(this.endline(E))},b.prototype.processingInstruction=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},b.prototype.raw=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},b.prototype.text=function(E,g){return this.stream.write(this.space(g)+E.value+this.endline(E))},b.prototype.dtdAttList=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},b.prototype.dtdElement=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},b.prototype.dtdEntity=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},b.prototype.dtdNotation=function(E,g){return this.stream.write(this.space(g)+""+this.endline(E))},b.prototype.endline=function(E){return E.isLastRootNode?"":this.newline},b}(n)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],231:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i,l,s,h,r,t,n,c=function(v,b){function E(){this.constructor=v}for(var g in b)m.call(b,g)&&(v[g]=b[g]);return E.prototype=b.prototype,v.prototype=new E,v.__super__=b.prototype,v},m={}.hasOwnProperty;i=S("./XMLDeclaration"),l=S("./XMLDocType"),T=S("./XMLCData"),w=S("./XMLComment"),s=S("./XMLElement"),r=S("./XMLRaw"),t=S("./XMLText"),h=S("./XMLProcessingInstruction"),f=S("./XMLDTDAttList"),p=S("./XMLDTDElement"),u=S("./XMLDTDEntity"),o=S("./XMLDTDNotation"),n=S("./XMLWriterBase"),D.exports=function(v){function b(E){b.__super__.constructor.call(this,E)}return c(b,v),b.prototype.document=function(E){var g,y,C,d,_;for(this.textispresent=!1,d="",_=E.children,y=0,C=_.length;y"+this.newline},b.prototype.comment=function(E,g){return this.space(g)+""+this.newline},b.prototype.declaration=function(E,g){var y;return y=this.space(g),y+='",y+=this.newline},b.prototype.docType=function(E,g){var y,C,d,_,O;if(g||(g=0),_=this.space(g),_+="0){for(_+=" [",_+=this.newline,O=E.children,C=0,d=O.length;C",_+=this.newline},b.prototype.element=function(E,g){var y,C,d,_,O,A,P,I,W,K,te,H,G;g||(g=0),G=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),H=this.space(g),I="",I+=H+"<"+E.name,W=E.attributes;for(P in W)m.call(W,P)&&(y=W[P],I+=this.attribute(y));if(E.children.length===0||E.children.every(function(V){return V.value===""}))this.allowEmpty?I+=">"+this.newline:I+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&E.children.length===1&&E.children[0].value!=null)I+=">",I+=E.children[0].value,I+=""+this.newline;else{if(this.dontprettytextnodes){for(K=E.children,d=0,O=K.length;d"+this.newline,te=E.children,_=0,A=te.length;_"+this.newline}return I},b.prototype.processingInstruction=function(E,g){var y;return y=this.space(g)+""+this.newline},b.prototype.raw=function(E,g){return this.space(g)+E.value+this.newline},b.prototype.text=function(E,g){return this.space(g)+E.value+this.newline},b.prototype.dtdAttList=function(E,g){var y;return y=this.space(g)+""+this.newline},b.prototype.dtdElement=function(E,g){return this.space(g)+""+this.newline},b.prototype.dtdEntity=function(E,g){var y;return y=this.space(g)+""+this.newline},b.prototype.dtdNotation=function(E,g){var y;return y=this.space(g)+""+this.newline},b.prototype.openNode=function(E,g){var y,C,d,_;if(g||(g=0),E instanceof s){d=this.space(g)+"<"+E.name,_=E.attributes;for(C in _)m.call(_,C)&&(y=_[C],d+=this.attribute(y));return d+=(E.children?">":"/>")+this.newline}return d=this.space(g)+"")+this.newline},b.prototype.closeNode=function(E,g){switch(g||(g=0),!1){case!(E instanceof s):return this.space(g)+""+this.newline;case!(E instanceof l):return this.space(g)+"]>"+this.newline}},b}(n)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],232:[function(S,D,x){"use strict";(function(){var T=function(f,p){return function(){return f.apply(p,arguments)}},w={}.hasOwnProperty;D.exports=function(){function f(p){this.assertLegalChar=T(this.assertLegalChar,this);var u,o,i;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,o=p.stringify||{};for(u in o)w.call(o,u)&&(i=o[u],this[u]=i)}return f.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},f.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},f.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]>"),this.assertLegalChar(p)},f.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},f.prototype.raw=function(p){return""+p||""},f.prototype.attName=function(p){return p=""+p||""},f.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},f.prototype.insTarget=function(p){return""+p||""},f.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},f.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},f.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},f.prototype.xmlStandalone=function(p){return p?"yes":"no"},f.prototype.dtdPubID=function(p){return""+p||""},f.prototype.dtdSysID=function(p){return""+p||""},f.prototype.dtdElementValue=function(p){return""+p||""},f.prototype.dtdAttType=function(p){return""+p||""},f.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},f.prototype.dtdEntityValue=function(p){return""+p||""},f.prototype.dtdNData=function(p){return""+p||""},f.prototype.convertAttKey="@",f.prototype.convertPIKey="?",f.prototype.convertTextKey="#text",f.prototype.convertCDataKey="#cdata",f.prototype.convertCommentKey="#comment",f.prototype.convertRawKey="#raw",f.prototype.assertLegalChar=function(p){var u;if(u=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+u.index);return p},f.prototype.elEscape=function(p){var u;return u=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(u,"&").replace(//g,">").replace(/\r/g," ")},f.prototype.attEscape=function(p){var u;return u=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(u,"&").replace(/0?new Array(p).join(this.indent):""):""},w}()}).call(void 0)},{}],235:[function(S,D,x){"use strict";(function(){var T,w,f,p,u,o,i;i=S("./Utility"),u=i.assign,o=i.isFunction,T=S("./XMLDocument"),w=S("./XMLDocumentCB"),p=S("./XMLStringWriter"),f=S("./XMLStreamWriter"),D.exports.create=function(l,s,h,r){var t,n;if(l==null)throw new Error("Root element needs a name");return r=u({},s,h,r),t=new T(r),n=t.element(l),r.headless||(t.declaration(r),r.pubID==null&&r.sysID==null||t.doctype(r)),n},D.exports.begin=function(l,s,h){var r;return o(l)&&(r=[l,s],s=r[0],h=r[1],l={}),s?new w(l,s,h):new T(l)},D.exports.stringWriter=function(l){return new p(l)},D.exports.streamWriter=function(l,s){return new f(l,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(S,D,x){function T(){for(var f={},p=0;ps?t=r(t):t.length>5]|=128<>>9<<4)]=r;for(var t=1732584193,n=-271733879,c=-1732584194,m=271733878,v=0;v>16)+(r>>16)+(t>>16)<<16|65535&t}function l(h,r){return h<>>32-r}var s=S("./helpers");D.exports=function(h){return s.hash(h,T,16)}},{"./helpers":238}],240:[function(S,D,x){"use strict";function T(i,l){i[l>>5]|=128<<24-l%32,i[15+(l+64>>9<<4)]=l;for(var s=Array(80),h=1732584193,r=-271733879,t=-1732584194,n=271733878,c=-1009589776,m=0;m>16)+(l>>16)+(s>>16)<<16|65535&s}function u(i,l){return i<>>32-l}var o=S("./helpers");D.exports=function(i){return o.hash(i,T,20,!0)}},{"./helpers":238}],241:[function(S,D,x){"use strict";var T=S("./helpers"),w=function(t,n){var c=(65535&t)+(65535&n);return(t>>16)+(n>>16)+(c>>16)<<16|65535&c},f=function(t,n){return t>>>n|t<<32-n},p=function(t,n){return t>>>n},u=function(t,n,c){return t&n^~t&c},o=function(t,n,c){return t&n^t&c^n&c},i=function(t){return f(t,2)^f(t,13)^f(t,22)},l=function(t){return f(t,6)^f(t,11)^f(t,25)},s=function(t){return f(t,7)^f(t,18)^p(t,3)},h=function(t){return f(t,17)^f(t,19)^p(t,10)},r=function(t,n){var c,m,v,b,E,g,y,C,d,_,O,A,P=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),W=new Array(64);t[n>>5]|=128<<24-n%32,t[15+(n+64>>9<<4)]=n;for(var d=0;d=0)return m("Request#%d %s: got digest auth header WWW-Authenticate: %s",V,C,Ce),d.headers=d.headers||{},d.headers.Authorization=digestAuthHeader(Ee.method,Ee.path,Ce,d.digestAuth),m("Request#%d %s: auth with digest header: %s",V,C,d.headers.Authorization),Fe.headers["set-cookie"]&&(d.headers.Cookie=Fe.headers["set-cookie"].join(";")),x.requestWithCallback(C,d,Ue)}var Ne=Date.now()-ne;He&&(He.contentDownload=Ne),m("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Ne,Y,J,Ee.method,Ee.host,Ee.path,q,He);var De={status:J,statusCode:J,headers:_e,size:Y,aborted:be,rt:Ne,keepAliveSocket:q,data:Ke,requestUrls:d.requestUrls,timing:He,remoteAddress:ke,remotePort:ct};if(Xe){var rt="";we&&typeof we.getCurrentStatus=="function"&&(rt=", agent status: "+(0,l.default)(we.getCurrentStatus())),Xe.message+=", "+Ee.method+" "+C+" "+J+" (connected: "+U+", keepalive socket: "+q+rt+`) headers: `+(0,l.default)(_e),Xe.data=Ke,Xe.path=Ee.path,Xe.status=J,Xe.headers=_e,Xe.res=De}Ue(Xe,Ke,d.streaming?Fe:De),d.emitter&&(re.url=C,re.socket=Qe&&Qe.connection,re.options=Ee,re.size=Oe,d.emitter.emit("response",{requestId:V,error:Xe,ctx:d.ctx,req:re,res:De}))}function I(Xe){var Ke=null;if(d.followRedirect&&statuses.redirect[Xe.statusCode]){d._followRedirectCount=(d._followRedirectCount||0)+1;var Fe=Xe.headers.location;if(Fe){if(!(d._followRedirectCount>d.maxRedirects)){var Ue=d.formatRedirectUrl?d.formatRedirectUrl(C,Fe):t.resolve(C,Fe);m("Request#%d %s: `redirected` from %s to %s",V,Ee.path,C,Ue),A(),d.headers&&d.headers.Host&&g.test(Fe)&&(d.headers.Host=null);var _e=_;return _=null,x.requestWithCallback(Ue,d,_e),{redirect:!0,error:null}}Ke=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+C),Ke.name="MaxRedirectError"}else Ke=new Error("Got statusCode "+Xe.statusCode+" but cannot resolve next location from headers"),Ke.name="FollowRedirectError"}return{redirect:!1,error:Ke}}function W(Xe,Ke,Fe){return Fe(null,Ke,Xe.headers["content-encoding"])}function K(Xe){if(He&&(He.waiting=Date.now()-ne),m("Request#%d %s `req response` event emit: status %d, headers: %j",V,C,Xe.statusCode,Xe.headers),d.streaming){var Ke=I(Xe);return Ke.redirect?void Xe.resume():Ke.error?(Xe.resume(),P(Ke.error,null,Xe)):P(null,null,Xe)}if(Xe.on("close",function(){m("Request#%d %s: `res close` event emit, total size %d",V,C,Y)}),Xe.on("error",function(){m("Request#%d %s: `res error` event emit, total size %d",V,C,Y)}),Xe.on("aborted",function(){be=!0,m("Request#%d %s: `res aborted` event emit, total size %d",V,C,Y)}),Be){var Ke=I(Xe);return Ke.redirect?void Xe.resume():Ke.error?(Xe.resume(),Be.end(),P(Ke.error,null,Xe)):(d.consumeWriteStream===!1?Xe.on("end",P.bind(null,null,null,Xe)):isNode010||isNode012?first([[Be,"close"],[Xe,"aborted"]],function(_e,Ce,Ne){m("Request#%d %s: writeStream or res %s event emitted",V,C,Ne),P(k||null,null,Xe)}):Be.on("close",function(){m("Request#%d %s: writeStream close event emitted",V,C),P(k||null,null,Xe)}),Xe.pipe(Be))}var Fe=[];Xe.on("data",function(Ue){m("Request#%d %s: `res data` event emit, size %d",V,C,Ue.length),Y+=Ue.length,Fe.push(Ue)}),Xe.on("end",function(){var Ue=w.concat(Fe,Y);if(m("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",V,C,Y,Xe._dumped),k)return P(k,Ue,Xe);var _e=I(Xe);if(_e.error)return P(_e.error,Ue,Xe);_e.redirect||W(Xe,Ue,function(Ce,Ne,De){if(Ce)return P(Ce,Ue,Xe);if(!De&&y.indexOf(d.dataType)>=0){try{Ne=decodeBodyByCharset(Ne,Xe)}catch(tt){return m("decodeBodyByCharset error: %s",tt),P(null,Ne,Xe)}if(d.dataType==="json")if(Y===0)Ne=null;else{var rt=parseJSON(Ne,Me);rt.error?Ce=rt.error:Ne=rt.data}}be&&m("Request#%d %s: Remote socket was terminated before `response.end()` was called",V,C),P(Ce,Ne,Xe)})})}function te(){m("Response timer ticking, timeout: %d",ht),ee=setTimeout(function(){ee=null;var Xe="Response timeout for "+ht+"ms";k=new Error(Xe),k.name="ResponseTimeoutError",k.requestId=V,m("ResponseTimeout: Request#%d %s %s: %s, connected: %s",V,C,k.name,Xe,U),H()},ht)}function H(){m("Request#%d %s abort, connected: %s",V,C,U),Qe.socket||(k.noSocket=!0,P(k)),Qe.abort()}if(!C||typeof C!="string"&&(C===void 0?"undefined":(0,h.default)(C))!=="object"){var G=r.format("expect request url to be a string or a http request options, but got %j",C);throw new Error(G)}arguments.length===2&&typeof d=="function"&&(_=d,d=null),d=d||{},b>=E&&(b=0);var V=++b;d.requestUrls=d.requestUrls||[];var re={requestId:V,url:C,args:d,ctx:d.ctx};d.emitter&&d.emitter.emit("request",re),d.timeout=d.timeout||x.TIMEOUTS,d.maxRedirects=d.maxRedirects||10,d.streaming=d.streaming||d.customResponse;var $,ne=Date.now();typeof C=="string"?(g.test(C)||(C="http://"+C),$=t.parse(C)):$=C;var he=(d.type||d.method||$.method||"GET").toUpperCase(),pe=$.port||80,Te=n,we=p(d.agent,x.agent),Me=d.fixJSONCtlChars;$.protocol==="https:"&&(Te=c,we=p(d.httpsAgent,x.httpsAgent),$.port||(pe=443));var Ee={host:$.hostname||$.host||"localhost",path:$.path||"/",method:he,port:pe,agent:we,headers:d.headers||{},lookup:d.lookup};Array.isArray(d.timeout)?Ee.requestTimeout=d.timeout[d.timeout.length-1]:d.timeout!==void 0&&(Ee.requestTimeout=d.timeout);for(var xe=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ge=0;Ge>>2]>>>24-g%4*8&255;m[b+g>>>2]|=y<<24-(b+g)%4*8}else for(var g=0;g>>2]=v[g>>>2];return this.sigBytes+=E,this},clamp:function(){var c=this.words,m=this.sigBytes;c[m>>>2]&=4294967295<<32-m%4*8,c.length=T.ceil(m/4)},clone:function(){var c=o.clone.call(this);return c.words=this.words.slice(0),c},random:function(c){for(var m,v=[],b=0;b>16)&C,g=18e3*(65535&g)+(g>>16)&C;var d=(y<<16)+g&C;return d/=4294967296,(d+=.5)*(T.random()>.5?1:-1)}}(4294967296*(m||T.random()));m=987654071*E(),v.push(4294967296*E()|0)}return new i.init(v,c)}}),l=p.enc={},s=l.Hex={stringify:function(c){for(var m=c.words,v=c.sigBytes,b=[],E=0;E>>2]>>>24-E%4*8&255;b.push((g>>>4).toString(16)),b.push((15&g).toString(16))}return b.join("")},parse:function(c){for(var m=c.length,v=[],b=0;b>>3]|=parseInt(c.substr(b,2),16)<<24-b%8*4;return new i.init(v,m/2)}},h=l.Latin1={stringify:function(c){for(var m=c.words,v=c.sigBytes,b=[],E=0;E>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(g))}return b.join("")},parse:function(c){for(var m=c.length,v=[],b=0;b>>2]|=(255&c.charCodeAt(b))<<24-b%4*8;return new i.init(v,m)}},r=l.Utf8={stringify:function(c){try{return decodeURIComponent(escape(h.stringify(c)))}catch(m){throw new Error("Malformed UTF-8 data")}},parse:function(c){return h.parse(unescape(encodeURIComponent(c)))}},t=u.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(c){typeof c=="string"&&(c=r.parse(c)),this._data.concat(c),this._nDataBytes+=c.sigBytes},_process:function(c){var m=this._data,v=m.words,b=m.sigBytes,E=this.blockSize,g=4*E,y=b/g;y=c?T.ceil(y):T.max((0|y)-this._minBufferSize,0);var C=y*E,d=T.min(4*C,b);if(C){for(var _=0;_",o[0];)p++;return p>4&&p}},{key:"extend",value:function(p,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&u[o]&&(p[o]=u[o])}},{key:"isArray",value:function(p){return Object.prototype.toString.call(arg)==="[object Array]"}},{key:"getFileType",value:function(p){return p=p.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(p)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(p)?"audio":/.bmp|.jpg|.jpeg|.png/.test(p)?"img":"other"}},{key:"isImage",value:function(p){return p=p.toLowerCase(),!!/.jpg|.jpeg|.png/.test(p)}},{key:"ISODateString",value:function(p){function u(o){return o<10?"0"+o:o}return p.getUTCFullYear()+"-"+u(p.getUTCMonth()+1)+"-"+u(p.getUTCDate())+"T"+u(p.getUTCHours())+":"+u(p.getUTCMinutes())+":"+u(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),f}();S.default=w},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){return function(T){function w(n,c,m,v,b,E,g){var y=n+(c&m|~c&v)+b+g;return(y<>>32-E)+c}function f(n,c,m,v,b,E,g){var y=n+(c&v|m&~v)+b+g;return(y<>>32-E)+c}function p(n,c,m,v,b,E,g){var y=n+(c^m^v)+b+g;return(y<>>32-E)+c}function u(n,c,m,v,b,E,g){var y=n+(m^(c|~v))+b+g;return(y<>>32-E)+c}var o=x,i=o.lib,l=i.WordArray,s=i.Hasher,h=o.algo,r=[];!function(){for(var n=0;n<64;n++)r[n]=4294967296*T.abs(T.sin(n+1))|0}();var t=h.MD5=s.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(n,c){for(var m=0;m<16;m++){var v=c+m,b=n[v];n[v]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8)}var E=this._hash.words,g=n[c+0],y=n[c+1],C=n[c+2],d=n[c+3],_=n[c+4],O=n[c+5],A=n[c+6],P=n[c+7],I=n[c+8],W=n[c+9],K=n[c+10],te=n[c+11],H=n[c+12],G=n[c+13],V=n[c+14],re=n[c+15],$=E[0],ne=E[1],he=E[2],pe=E[3];$=w($,ne,he,pe,g,7,r[0]),pe=w(pe,$,ne,he,y,12,r[1]),he=w(he,pe,$,ne,C,17,r[2]),ne=w(ne,he,pe,$,d,22,r[3]),$=w($,ne,he,pe,_,7,r[4]),pe=w(pe,$,ne,he,O,12,r[5]),he=w(he,pe,$,ne,A,17,r[6]),ne=w(ne,he,pe,$,P,22,r[7]),$=w($,ne,he,pe,I,7,r[8]),pe=w(pe,$,ne,he,W,12,r[9]),he=w(he,pe,$,ne,K,17,r[10]),ne=w(ne,he,pe,$,te,22,r[11]),$=w($,ne,he,pe,H,7,r[12]),pe=w(pe,$,ne,he,G,12,r[13]),he=w(he,pe,$,ne,V,17,r[14]),ne=w(ne,he,pe,$,re,22,r[15]),$=f($,ne,he,pe,y,5,r[16]),pe=f(pe,$,ne,he,A,9,r[17]),he=f(he,pe,$,ne,te,14,r[18]),ne=f(ne,he,pe,$,g,20,r[19]),$=f($,ne,he,pe,O,5,r[20]),pe=f(pe,$,ne,he,K,9,r[21]),he=f(he,pe,$,ne,re,14,r[22]),ne=f(ne,he,pe,$,_,20,r[23]),$=f($,ne,he,pe,W,5,r[24]),pe=f(pe,$,ne,he,V,9,r[25]),he=f(he,pe,$,ne,d,14,r[26]),ne=f(ne,he,pe,$,I,20,r[27]),$=f($,ne,he,pe,G,5,r[28]),pe=f(pe,$,ne,he,C,9,r[29]),he=f(he,pe,$,ne,P,14,r[30]),ne=f(ne,he,pe,$,H,20,r[31]),$=p($,ne,he,pe,O,4,r[32]),pe=p(pe,$,ne,he,I,11,r[33]),he=p(he,pe,$,ne,te,16,r[34]),ne=p(ne,he,pe,$,V,23,r[35]),$=p($,ne,he,pe,y,4,r[36]),pe=p(pe,$,ne,he,_,11,r[37]),he=p(he,pe,$,ne,P,16,r[38]),ne=p(ne,he,pe,$,K,23,r[39]),$=p($,ne,he,pe,G,4,r[40]),pe=p(pe,$,ne,he,g,11,r[41]),he=p(he,pe,$,ne,d,16,r[42]),ne=p(ne,he,pe,$,A,23,r[43]),$=p($,ne,he,pe,W,4,r[44]),pe=p(pe,$,ne,he,H,11,r[45]),he=p(he,pe,$,ne,re,16,r[46]),ne=p(ne,he,pe,$,C,23,r[47]),$=u($,ne,he,pe,g,6,r[48]),pe=u(pe,$,ne,he,P,10,r[49]),he=u(he,pe,$,ne,V,15,r[50]),ne=u(ne,he,pe,$,O,21,r[51]),$=u($,ne,he,pe,H,6,r[52]),pe=u(pe,$,ne,he,d,10,r[53]),he=u(he,pe,$,ne,K,15,r[54]),ne=u(ne,he,pe,$,y,21,r[55]),$=u($,ne,he,pe,I,6,r[56]),pe=u(pe,$,ne,he,re,10,r[57]),he=u(he,pe,$,ne,A,15,r[58]),ne=u(ne,he,pe,$,G,21,r[59]),$=u($,ne,he,pe,_,6,r[60]),pe=u(pe,$,ne,he,te,10,r[61]),he=u(he,pe,$,ne,C,15,r[62]),ne=u(ne,he,pe,$,W,21,r[63]),E[0]=E[0]+$|0,E[1]=E[1]+ne|0,E[2]=E[2]+he|0,E[3]=E[3]+pe|0},_doFinalize:function(){var n=this._data,c=n.words,m=8*this._nDataBytes,v=8*n.sigBytes;c[v>>>5]|=128<<24-v%32;var b=T.floor(m/4294967296),E=m;c[15+(v+64>>>9<<4)]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),c[14+(v+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),n.sigBytes=4*(c.length+1),this._process();for(var g=this._hash,y=g.words,C=0;C<4;C++){var d=y[C];y[C]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return g},clone:function(){var n=s.clone.call(this);return n._hash=this._hash.clone(),n}});o.MD5=s._createHelper(t),o.HmacMD5=s._createHmacHelper(t)}(Math),x.MD5})},function(j,S,D){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},S.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},S.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(j,S,D){"use strict";function x(t){return t&&t.__esModule?t:{default:t}}function T(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function t(n,c){for(var m=0;m-1)return"Baiduspider";if(l.indexOf("PlayStation")>-1)return"PS4";var h=navigator.platform=="Win32"||navigator.platform=="Windows"||l.indexOf("Windows")>-1,r=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return r&&(s="macOS"),navigator.platform=="X11"&&!h&&!r&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),h?"windows":s},f=function(){var i=navigator.userAgent,l="";return(i.indexOf("Windows NT 5.0")>-1||i.indexOf("Windows 2000")>-1)&&(l="2000"),(i.indexOf("Windows NT 5.1")>-1||i.indexOf("Windows XP")>-1)&&(l="XP"),(i.indexOf("Windows NT 5.2")>-1||i.indexOf("Windows 2003")>-1)&&(l="2003"),(i.indexOf("Windows NT 6.0")>-1||i.indexOf("Windows Vista")>-1)&&(l="Vista"),(i.indexOf("Windows NT 6.1")>-1||i.indexOf("Windows 7")>-1)&&(l="7"),(i.indexOf("Windows NT 6.2")>-1||i.indexOf("Windows 8")>-1)&&(l="8"),(i.indexOf("Windows NT 6.3")>-1||i.indexOf("Windows 8.1")>-1)&&(l="8.1"),(i.indexOf("Windows NT 10")>-1||i.indexOf("Windows 10")>-1)&&(l="10"),l},p=function(i){var l=navigator.userAgent.toLowerCase();return i.chrome?"Chrome":i.firefox?"Firefox":i.safari?"Safari":i.webview?"webview":i.ie?/edge/.test(l)?"Edge":"IE":/baiduspider/.test(l)?"Baiduspider":/ucweb/.test(l)||/UCBrowser/.test(l)?"UC":/opera/.test(l)?"Opera":/ucweb/.test(l)?"UC":/360se/.test(l)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(l)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(l)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(l)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(l)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(l)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(l)?"PS4\u6D4F\u89C8\u5668":void 0},u=function(){var i={},l={},s=navigator.userAgent,h=navigator.platform,r=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),t=s.match(/(Android);?[\s\/]+([\d.]+)?/),n=!!s.match(/\(Macintosh\; Intel /),c=s.match(/(iPad).*OS\s([\d_]+)/),m=s.match(/(iPod)(.*OS\s([\d_]+))?/),v=!c&&s.match(/(iPhone\sOS)\s([\d_]+)/),b=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),E=/Win\d{2}|Windows/.test(h),g=s.match(/Windows Phone ([\d.]+)/),y=b&&s.match(/TouchPad/),C=s.match(/Kindle\/([\d.]+)/),d=s.match(/Silk\/([\d._]+)/),_=s.match(/(BlackBerry).*Version\/([\d.]+)/),O=s.match(/(BB10).*Version\/([\d.]+)/),A=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),P=s.match(/PlayBook/),I=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),W=s.match(/Firefox\/([\d.]+)/),K=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),te=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),H=!I&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),G=H||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((l.webkit=!!r)&&(l.version=r[1]),t&&(i.android=!0,i.version=t[2]),v&&!m&&(i.ios=i.iphone=!0,i.version=v[2].replace(/_/g,".")),c&&(i.ios=i.ipad=!0,i.version=c[2].replace(/_/g,".")),m&&(i.ios=i.ipod=!0,i.version=m[3]?m[3].replace(/_/g,"."):null),g&&(i.wp=!0,i.version=g[1]),b&&(i.webos=!0,i.version=b[2]),y&&(i.touchpad=!0),_&&(i.blackberry=!0,i.version=_[2]),O&&(i.bb10=!0,i.version=O[2]),A&&(i.rimtabletos=!0,i.version=A[2]),P&&(l.playbook=!0),C&&(i.kindle=!0,i.version=C[1]),d&&(l.silk=!0,l.version=d[1]),!d&&i.android&&s.match(/Kindle Fire/)&&(l.silk=!0),I&&(l.chrome=!0,l.version=I[1]),W&&(l.firefox=!0,l.version=W[1]),K&&(i.firefoxos=!0,i.version=K[1]),te&&(l.ie=!0,l.version=te[1]),G&&(n||i.ios||E||t)&&(l.safari=!0,i.ios||(l.version=G[1])),H&&(l.webview=!0),n){var V=s.match(/[\d]*_[\d]*_[\d]*/);V&&V.length>0&&V[0]&&(i.version=V[0].replace(/_/g,"."))}return i.tablet=!!(c||P||t&&!s.match(/Mobile/)||W&&s.match(/Tablet/)||te&&!s.match(/Phone/)&&s.match(/Touch/)),i.phone=!(i.tablet||i.ipod||!(t||v||b||_||O||I&&s.match(/Android/)||I&&s.match(/CriOS\/([\d.]+)/)||W&&s.match(/Mobile/)||te&&s.match(/Touch/))),i.pc=!i.tablet&&!i.phone,n?i.name="macOS":E?(i.name="windows",i.version=f()):i.name=w(i),l.name=p(l),{os:i,browser:l}}(),o=function(){function i(){x(this,i)}return T(i,null,[{key:"getHost",value:function(l){var s="";if(l===void 0||l==null||l=="")return"";var h=l.indexOf("//"),r=l;h>-1&&(r=l.substring(h+2));var s=r,t=r.split("/");return t&&t.length>0&&(s=t[0]),t=s.split(":"),t&&t.length>0&&(s=t[0]),s}},{key:"os",get:function(){return u.os}},{key:"browser",get:function(){var l=u.browser;return l.name||(l.name=p()),l}}]),i}();S.default=o},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o0){V._invalidUserId=!0;var he=ne.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(he)}}catch(pe){console.log(pe)}})})}K&&(G.videoInfo=K?JSON.parse(K).Vod:{},G.userData=l.default.encode(K)),G.ri=v.default.create(),this._uploadList.push(G),this._reportLog("20001",G,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(G)}catch(re){console.log(re)}return!0}},{key:"deleteFile",value:function(A){return!!this.cancelFile(A)&&(this._uploadList.splice(A,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var P=this._uploadList[A];if(A==this._curIndex&&P.state==f.UPLOADSTATE.UPLOADING){P.state=f.UPLOADSTATE.CANCELED;var I=this._getCheckoutpoint(P);I&&I.checkpoint&&(I=I.checkpoint),I&&this._ossUpload.abort(P),this._removeCheckoutpoint(P),this.nextUpload()}else P.state!=f.UPLOADSTATE.SUCCESS&&(P.state=f.UPLOADSTATE.CANCELED);return this._reportLog("20008",P),!0}},{key:"resumeFile",value:function(A){if(this.options,A<0||A>=this._uploadList.length)return!1;var P=this._uploadList[A];return P.state==f.UPLOADSTATE.CANCELED&&(P.state=f.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(A){return this._getCheckoutpoint({file:A})}},{key:"startUpload",value:function(A){if(this._retryCount=0,this.options,this._state==f.VODSTATE.START||this._state==f.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=f.VODSTATE.END);var P=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(P),this._state=f.VODSTATE.START}},{key:"nextUpload",value:function(){var A=this.options;if(this._state==f.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var P=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(P)}else{this._state=f.VODSTATE.END;try{A.onUploadEnd&&A.onUploadEnd(P)}catch(I){console.log(I)}}}},{key:"clear",value:function(A){for(var P=this.options,I=0,W=0;Wthis._curIndex&&(K=this._uploadList[this._curIndex]),K&&(this.init(A,P,I,W),this._state=f.VODSTATE.START,this._ossUpload=null,this._uploadCore(K,K.retry),K.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(A,P,I){if(this._curIndex==-1)return!1;if(this._state!=f.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var W=this._uploadList[this._curIndex];W.object?this._refreshSTSTokenUpload(W,A,P,I):this.setSTSToken(W,A,P,I)}}},{key:"setSTSTokenDirectlyUpload",value:function(A,P,I,W,K){if(!(P&&I&&W&&K))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var te=A;this.init(P,I,W,K),te.endpoint=te._endpoint,te.bucket=te._bucket,te.object=te._object,this._ossUpload=null,this._uploadCore(te,A.retry),A.retry=!1}},{key:"setSTSToken",value:function(A,P,I,W){if(!P||!I||!W)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var K=A.videoInfo,te={accessKeyId:P,securityToken:W,accessKeySecret:I,fileName:A.file.name,title:K.Title,requestId:A.ri,region:this.options.region};K.ImageType&&(te.imageType=K.ImageType),K.ImageExt&&(te.imageExt=K.ImageExt),K.FileSize&&(te.fileSize=K.FileSize),K.Description&&(te.description=K.Description),K.CateId&&(te.cateId=K.CateId),K.Tags&&(te.tags=K.Tags),K.TemplateGroupId&&(te.templateGroupId=K.TemplateGroupId),K.StorageLocation&&(te.storageLocation=K.StorageLocation),K.CoverURL&&(te.coverUrl=K.CoverURL),K.TransCodeMode&&(te.transCodeMode=K.TransCodeMode),K.UserData&&(te.userData=K.UserData);var H=this,G="getUploadAuth";A.videoId?(te.videoId=A.videoId,G="refreshUploadAuth"):A.isImage&&(G="getImageUploadAuth"),E.default[G](te,function(V){A.videoId=V.VideoId?V.VideoId:A.videoId,H.setUploadAuthAndAddress(A,V.UploadAuth,V.UploadAddress),H._state=f.VODSTATE.START},function(V){H._error(A,{name:V.Code,code:V.Code,message:V.Message,requestId:V.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(A,P,I,W){if(!A||!P||!I)return!1;var K=JSON.parse(l.default.decode(P));if(!(K.AccessKeyId&&K.AccessKeySecret&&K.SecurityToken&&K.Expiration))return console.error("uploadauth is invalid"),!1;var te={},H=A;if(I){if(te=JSON.parse(l.default.decode(I)),!te.Endpoint||!te.Bucket||!te.FileName)return console.error("uploadAddress is invalid"),!1}else te.Endpoint=H.endpoint,te.Bucket=H.bucket,te.FileName=H.object;this._ut="vod",this._uploadWay="vod",this.options.region=K.Region||this.options.region,this.init(K.AccessKeyId,K.AccessKeySecret,K.SecurityToken,K.Expiration),H.endpoint=H._endpoint?H._endpoint:te.Endpoint,H.bucket=H._bucket?H._bucket:te.Bucket,H.object=H._object?H._object:te.FileName,H.region=this.options.region,W&&(H.videoId=W),this._ossUpload=null,this._uploadCore(H,A.retry),A.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(A,P,I,W){if(!P||!I||!W)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var K={accessKeyId:P,securityToken:W,accessKeySecret:I,videoId:A.object,requestId:A.ri,region:this.options.region},te=this,H="refreshUploadAuth";A.isImage&&(H="getImageUploadAuth"),E.default[H](K,function(G){te.setUploadAuthAndAddress(A,G.UploadAuth,UploadAddress),te._state=f.VODSTATE.START},function(G){te._error(A,{name:G.Code,code:G.Code,message:G.Message,requestId:G.RequestId})})}},{key:"_upload",value:function(A){var P=arguments.length>1&&arguments[1]!==void 0&&arguments[1],I=this.options;if(A.retry=P,I.onUploadstarted&&!P)try{var W=this._getCheckoutpoint(A);W&&W.state!=f.UPLOADSTATE.UPLOADING&&(A.checkpoint=W,A.videoId=W.videoId),I.onUploadstarted(A)}catch(K){console.log(K)}}},{key:"_uploadCore",value:function(A){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1],!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId\u3001AccessKeySecret\u3001securityToken should not be null");if(A.state=f.UPLOADSTATE.UPLOADING,!this._ossUpload){A.endpoint=A.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var P=this;this._ossUpload=new o.default({bucket:A.bucket,endpoint:A.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(V,re){P._error.call(P,V,re)},oncomplete:function(V,re){P._complete.call(P,V,re)},onprogress:function(V,re,$){P._progress.call(P,V,re,$)}})}var I=c.default.getFileType(A.file.name),W=this._getCheckoutpoint(A),K="",te="";W&&W.checkpoint&&(te=W.state,K=W.videoId,W=W.checkpoint),W&&K==A.videoId&&te!=f.UPLOADSTATE.UPLOADING&&(W.file=A.file,A.checkpoint=W,W.uploadId);var H=this._adjustPartSize(A);this._reportLog("20002",A,{ft:I,fs:A.file.size,bu:A.bucket,ok:A.object,vid:A.videoId||"",fn:A.file.name,fw:null,fh:null,ps:H});var G={headers:{"x-oss-notification":A.userData?A.userData:""},partSize:H,parallel:this.options.parallel};this._ossUpload.upload(A,G)}},{key:"_findUploadIndex",value:function(){for(var A=-1,P=0;P0||P.name=="SignatureDoesNotMatchError"||P.code=="SecurityTokenExpired"||P.code=="InvalidSecurityToken.Expired"||P.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=f.VODSTATE.EXPIRE,A.state=f.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(A,P)}catch(W){console.log(W)}}return}if((P.name=="RequestTimeoutError"||P.name=="ConnectionTimeout"||P.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var I=this;return setTimeout(function(){I._uploadCore(A,!0)},1e3*I._retryDuration),void this._retryCount++}P.name=="NoSuchUploadError"&&this._removeCheckoutpoint(A),this._handleError(A,P)}}},{key:"_handleError",value:function(A,P){var I=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],W=f.UPLOADSTATE.FAIlURE;if(A.state!=f.UPLOADSTATE.CANCELED&&(A.state=f.UPLOADSTATE.FAIlURE,this._state=f.VODSTATE.FAILURE,this.options.onUploadFailed&&P&&P.code&&P.message))try{this.options.onUploadFailed(A,P.code,P.message)}catch(te){console.log(te)}if(I&&this._changeState(A,W),this._reportLog("20006",A,{code:P.name,message:P.message,requestId:P.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),this._reportLog("20004",A,{requestId:P.requestId,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),A.ri=v.default.create(),this._findUploadIndex()!=-1){var K=this;this._state=f.VODSTATE.START,setTimeout(function(){K.nextUpload()},100)}}},{key:"_complete",value:function(A,P){if(A.state=f.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(A)}catch(K){console.log(K)}var I=0;P&&P.res&&P.res.headers&&(I=P.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(A);var W=this;setTimeout(function(){W.nextUpload()},100),this._retryCount=0,this._reportLog("20003",A,{requestId:I})}},{key:"_progress",value:function(A,P,I){if(this.options.onUploadProgress)try{A.loaded=P.loaded,this.options.onUploadProgress(A,P.total,P.loaded)}catch(re){console.log(re)}var W=P.checkpoint,K=0;W&&(A.checkpoint=W,this._saveCheckoutpoint(A,W,f.UPLOADSTATE.UPLOADING),K=W.uploadId),this._retryCount=0;var te=this._getPortNumber(W),H=0;if(I&&I.headers&&(H=I.headers["x-oss-request-id"]),P.loaded!=0&&this._reportLog("20007",A,{pn:te,requestId:H}),P.loaded!=1&&this._reportLog("20005",A,{UploadId:K,pn:te+1,pr:A.retry?1:0,fs:A.file.size,bu:A.bucket,ok:A.object,fn:A.file.name}),!this._invalidUserId&&!A.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var G={file:A.file,checkpoint:P,userId:this.options.userId,videoId:A.videoId,region:this.options.region,fileHash:A.fileHash};try{var V=this;y.default.upload(G,function(){},function(re){if((re=JSON.parse(re))&&re.Code=="InvalidParameter"&&re.Message.indexOf("UserId")>0){V._invalidUserId=!0;var $=re.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log($)}})}catch(re){console.log(re)}}}},{key:"_getPortNumber",value:function(A){if(A){var P=A.doneParts;if(P&&P.length>0)return P[P.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(A){var P=this._getCheckoutpointKey(A);h.default.remove(P)}},{key:"_getCheckoutpoint",value:function(A){var P=this._getCheckoutpointKey(A),I=h.default.get(P);if(I)try{return JSON.parse(I)}catch(W){}return""}},{key:"_saveCheckoutpoint",value:function(A,P,I){if(P){var W=this._getCheckoutpointKey(A),K=A.file,te={fileName:K.name,lastModified:K.lastModified,size:K.size,object:A.object,videoId:A.videoId,bucket:A.bucket,endpoint:A.endpoint,checkpoint:P,loaded:A.loaded,state:I};h.default.set(W,JSON.stringify(te))}}},{key:"_changeState",value:function(A,P){var I=this._getCheckoutpoint(A);I&&((this._onbeforeunload=!0)&&(P=f.UPLOADSTATE.STOPED),this._saveCheckoutpoint(A,I.checkpoint,P))}},{key:"_getCheckoutpointKey",value:function(A){return"upload_"+A.file.lastModified+"_"+A.file.name+"_"+A.file.size}},{key:"_getCheckoutpointFromCloud",value:function(A,P,I){var W={userId:this.options.userId,uploadInfoList:[{FileName:A.file.name,FileSize:A.file.size,FileCreateTime:A.file.lastModified,FileHash:A.fileHash}],region:this.options.region};y.default.get(W,function(K){P(K)},I)}},{key:"_reportLog",value:function(A,P,I){I||(I={}),I.ri=P.ri,this._ut&&(I.ut=this._ut),this._log.log(A,I)}},{key:"_initEvent",value:function(){var A=this;window&&(window.onbeforeunload=function(P){if(A._onbeforeunload=!0,A._curIndex!=-1&&A._uploadList.length>A._curIndex){var I=A._uploadList[A._curIndex];A._changeState(I,f.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var A=0;A1e4?A.file.size/9999:this.options.partSize}}]),O}());S.default=_},function(j,S,D){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},S.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(j,S,D){"use strict";function x(i){return i&&i.__esModule?i:{default:i}}function T(i,l){if(!(i instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var w=function(){function i(l,s){for(var h=0;h=T())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T().toString(16)+" bytes");return 0|ee}function n(ee){return+ee!=ee&&(ee=0),f.alloc(+ee)}function c(ee,k){if(f.isBuffer(ee))return ee.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(ee)||ee instanceof ArrayBuffer))return ee.byteLength;typeof ee!="string"&&(ee=""+ee);var U=ee.length;if(U===0)return 0;for(var q=!1;;)switch(k){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":case void 0:return Ee(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*U;case"hex":return U>>>1;case"base64":return je(ee).length;default:if(q)return Ee(ee).length;k=(""+k).toLowerCase(),q=!0}}function m(ee,k,U){var q=!1;if((k===void 0||k<0)&&(k=0),k>this.length)return"";if((U===void 0||U>this.length)&&(U=this.length),U<=0)return"";if(U>>>=0,k>>>=0,U<=k)return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return te(this,k,U);case"utf8":case"utf-8":return P(this,k,U);case"ascii":return W(this,k,U);case"latin1":case"binary":return K(this,k,U);case"base64":return A(this,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,k,U);default:if(q)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),q=!0}}function v(ee,k,U){var q=ee[k];ee[k]=ee[U],ee[U]=q}function b(ee,k,U,q,Y){if(ee.length===0)return-1;if(typeof U=="string"?(q=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,isNaN(U)&&(U=Y?0:ee.length-1),U<0&&(U=ee.length+U),U>=ee.length){if(Y)return-1;U=ee.length-1}else if(U<0){if(!Y)return-1;U=0}if(typeof k=="string"&&(k=f.from(k,q)),f.isBuffer(k))return k.length===0?-1:E(ee,k,U,q,Y);if(typeof k=="number")return k&=255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(ee,k,U):Uint8Array.prototype.lastIndexOf.call(ee,k,U):E(ee,[k],U,q,Y);throw new TypeError("val must be string, number or Buffer")}function E(ee,k,U,q,Y){function J(Qe,Xe){return be===1?Qe[Xe]:Qe.readUInt16BE(Xe*be)}var be=1,ke=ee.length,ct=k.length;if(q!==void 0&&((q=String(q).toLowerCase())==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(ee.length<2||k.length<2)return-1;be=2,ke/=2,ct/=2,U/=2}var He;if(Y){var Be=-1;for(He=U;Heke&&(U=ke-ct),He=U;He>=0;He--){for(var Ze=!0,ht=0;htY&&(q=Y):q=Y;var J=k.length;if(J%2!=0)throw new TypeError("Invalid hex string");q>J/2&&(q=J/2);for(var be=0;be239?4:J>223?3:J>191?2:1;if(Y+ke<=U){var ct,He,Be,Ze;switch(ke){case 1:J<128&&(be=J);break;case 2:ct=ee[Y+1],(192&ct)==128&&(Ze=(31&J)<<6|63&ct)>127&&(be=Ze);break;case 3:ct=ee[Y+1],He=ee[Y+2],(192&ct)==128&&(192&He)==128&&(Ze=(15&J)<<12|(63&ct)<<6|63&He)>2047&&(Ze<55296||Ze>57343)&&(be=Ze);break;case 4:ct=ee[Y+1],He=ee[Y+2],Be=ee[Y+3],(192&ct)==128&&(192&He)==128&&(192&Be)==128&&(Ze=(15&J)<<18|(63&ct)<<12|(63&He)<<6|63&Be)>65535&&Ze<1114112&&(be=Ze)}}be===null?(be=65533,ke=1):be>65535&&(be-=65536,q.push(be>>>10&1023|55296),be=56320|1023&be),q.push(be),Y+=ke}return I(q)}function I(ee){var k=ee.length;if(k<=Ie)return String.fromCharCode.apply(String,ee);for(var U="",q=0;qq)&&(U=q);for(var Y="",J=k;JU)throw new RangeError("Trying to access beyond buffer length")}function V(ee,k,U,q,Y,J){if(!f.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>Y||kee.length)throw new RangeError("Index out of range")}function re(ee,k,U,q){k<0&&(k=65535+k+1);for(var Y=0,J=Math.min(ee.length-U,2);Y>>8*(q?Y:1-Y)}function $(ee,k,U,q){k<0&&(k=4294967295+k+1);for(var Y=0,J=Math.min(ee.length-U,4);Y>>8*(q?Y:3-Y)&255}function ne(ee,k,U,q,Y,J){if(U+q>ee.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function he(ee,k,U,q,Y){return Y||ne(ee,k,U,4,34028234663852886e22,-34028234663852886e22),le.write(ee,k,U,q,23,4),U+4}function pe(ee,k,U,q,Y){return Y||ne(ee,k,U,8,17976931348623157e292,-17976931348623157e292),le.write(ee,k,U,q,52,8),U+8}function Te(ee){if(ee=we(ee).replace(qe,""),ee.length<2)return"";for(;ee.length%4!=0;)ee+="=";return ee}function we(ee){return ee.trim?ee.trim():ee.replace(/^\s+|\s+$/g,"")}function Me(ee){return ee<16?"0"+ee.toString(16):ee.toString(16)}function Ee(ee,k){k=k||1/0;for(var U,q=ee.length,Y=null,J=[],be=0;be55295&&U<57344){if(!Y){if(U>56319){(k-=3)>-1&&J.push(239,191,189);continue}if(be+1===q){(k-=3)>-1&&J.push(239,191,189);continue}Y=U;continue}if(U<56320){(k-=3)>-1&&J.push(239,191,189),Y=U;continue}U=65536+(Y-55296<<10|U-56320)}else Y&&(k-=3)>-1&&J.push(239,191,189);if(Y=null,U<128){if((k-=1)<0)break;J.push(U)}else if(U<2048){if((k-=2)<0)break;J.push(U>>6|192,63&U|128)}else if(U<65536){if((k-=3)<0)break;J.push(U>>12|224,U>>6&63|128,63&U|128)}else{if(!(U<1114112))throw new Error("Invalid code point");if((k-=4)<0)break;J.push(U>>18|240,U>>12&63|128,U>>6&63|128,63&U|128)}}return J}function xe(ee){for(var k=[],U=0;U>8,Y=U%256,J.push(Y),J.push(q);return J}function je(ee){return de.toByteArray(Te(ee))}function We(ee,k,U,q){for(var Y=0;Y=k.length||Y>=ee.length);++Y)k[Y+U]=ee[Y];return Y}function ze(ee){return ee!==ee}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var de=D(21),le=D(22),Oe=D(23);S.Buffer=f,S.SlowBuffer=n,S.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=x.TYPED_ARRAY_SUPPORT!==void 0?x.TYPED_ARRAY_SUPPORT:function(){try{var ee=new Uint8Array(1);return ee.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ee.foo()===42&&typeof ee.subarray=="function"&&ee.subarray(1,1).byteLength===0}catch(k){return!1}}(),S.kMaxLength=T(),f.poolSize=8192,f._augment=function(ee){return ee.__proto__=f.prototype,ee},f.from=function(ee,k,U){return p(null,ee,k,U)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(ee,k,U){return o(null,ee,k,U)},f.allocUnsafe=function(ee){return i(null,ee)},f.allocUnsafeSlow=function(ee){return i(null,ee)},f.isBuffer=function(ee){return!(ee==null||!ee._isBuffer)},f.compare=function(ee,k){if(!f.isBuffer(ee)||!f.isBuffer(k))throw new TypeError("Arguments must be Buffers");if(ee===k)return 0;for(var U=ee.length,q=k.length,Y=0,J=Math.min(U,q);Y0&&(ee=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(ee+=" ... ")),""},f.prototype.compare=function(ee,k,U,q,Y){if(!f.isBuffer(ee))throw new TypeError("Argument must be a Buffer");if(k===void 0&&(k=0),U===void 0&&(U=ee?ee.length:0),q===void 0&&(q=0),Y===void 0&&(Y=this.length),k<0||U>ee.length||q<0||Y>this.length)throw new RangeError("out of range index");if(q>=Y&&k>=U)return 0;if(q>=Y)return-1;if(k>=U)return 1;if(k>>>=0,U>>>=0,q>>>=0,Y>>>=0,this===ee)return 0;for(var J=Y-q,be=U-k,ke=Math.min(J,be),ct=this.slice(q,Y),He=ee.slice(k,U),Be=0;BeY)&&(U=Y),ee.length>0&&(U<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");for(var J=!1;;)switch(q){case"hex":return g(this,ee,k,U);case"utf8":case"utf-8":return y(this,ee,k,U);case"ascii":return C(this,ee,k,U);case"latin1":case"binary":return d(this,ee,k,U);case"base64":return _(this,ee,k,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,ee,k,U);default:if(J)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),J=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ie=4096;f.prototype.slice=function(ee,k){var U=this.length;ee=~~ee,k=k===void 0?U:~~k,ee<0?(ee+=U)<0&&(ee=0):ee>U&&(ee=U),k<0?(k+=U)<0&&(k=0):k>U&&(k=U),k0&&(Y*=256);)q+=this[ee+--k]*Y;return q},f.prototype.readUInt8=function(ee,k){return k||G(ee,1,this.length),this[ee]},f.prototype.readUInt16LE=function(ee,k){return k||G(ee,2,this.length),this[ee]|this[ee+1]<<8},f.prototype.readUInt16BE=function(ee,k){return k||G(ee,2,this.length),this[ee]<<8|this[ee+1]},f.prototype.readUInt32LE=function(ee,k){return k||G(ee,4,this.length),(this[ee]|this[ee+1]<<8|this[ee+2]<<16)+16777216*this[ee+3]},f.prototype.readUInt32BE=function(ee,k){return k||G(ee,4,this.length),16777216*this[ee]+(this[ee+1]<<16|this[ee+2]<<8|this[ee+3])},f.prototype.readIntLE=function(ee,k,U){ee|=0,k|=0,U||G(ee,k,this.length);for(var q=this[ee],Y=1,J=0;++J=Y&&(q-=Math.pow(2,8*k)),q},f.prototype.readIntBE=function(ee,k,U){ee|=0,k|=0,U||G(ee,k,this.length);for(var q=k,Y=1,J=this[ee+--q];q>0&&(Y*=256);)J+=this[ee+--q]*Y;return Y*=128,J>=Y&&(J-=Math.pow(2,8*k)),J},f.prototype.readInt8=function(ee,k){return k||G(ee,1,this.length),128&this[ee]?-1*(255-this[ee]+1):this[ee]},f.prototype.readInt16LE=function(ee,k){k||G(ee,2,this.length);var U=this[ee]|this[ee+1]<<8;return 32768&U?4294901760|U:U},f.prototype.readInt16BE=function(ee,k){k||G(ee,2,this.length);var U=this[ee+1]|this[ee]<<8;return 32768&U?4294901760|U:U},f.prototype.readInt32LE=function(ee,k){return k||G(ee,4,this.length),this[ee]|this[ee+1]<<8|this[ee+2]<<16|this[ee+3]<<24},f.prototype.readInt32BE=function(ee,k){return k||G(ee,4,this.length),this[ee]<<24|this[ee+1]<<16|this[ee+2]<<8|this[ee+3]},f.prototype.readFloatLE=function(ee,k){return k||G(ee,4,this.length),le.read(this,ee,!0,23,4)},f.prototype.readFloatBE=function(ee,k){return k||G(ee,4,this.length),le.read(this,ee,!1,23,4)},f.prototype.readDoubleLE=function(ee,k){return k||G(ee,8,this.length),le.read(this,ee,!0,52,8)},f.prototype.readDoubleBE=function(ee,k){return k||G(ee,8,this.length),le.read(this,ee,!1,52,8)},f.prototype.writeUIntLE=function(ee,k,U,q){(ee=+ee,k|=0,U|=0,!q)&&V(this,ee,k,U,Math.pow(2,8*U)-1,0);var Y=1,J=0;for(this[k]=255ⅇ++J=0&&(J*=256);)this[k+Y]=ee/J&255;return k+U},f.prototype.writeUInt8=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,1,255,0),f.TYPED_ARRAY_SUPPORT||(ee=Math.floor(ee)),this[k]=255&ee,k+1},f.prototype.writeUInt16LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8):re(this,ee,k,!0),k+2},f.prototype.writeUInt16BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>8,this[k+1]=255&ee):re(this,ee,k,!1),k+2},f.prototype.writeUInt32LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[k+3]=ee>>>24,this[k+2]=ee>>>16,this[k+1]=ee>>>8,this[k]=255&ee):$(this,ee,k,!0),k+4},f.prototype.writeUInt32BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>24,this[k+1]=ee>>>16,this[k+2]=ee>>>8,this[k+3]=255&ee):$(this,ee,k,!1),k+4},f.prototype.writeIntLE=function(ee,k,U,q){if(ee=+ee,k|=0,!q){var Y=Math.pow(2,8*U-1);V(this,ee,k,U,Y-1,-Y)}var J=0,be=1,ke=0;for(this[k]=255ⅇ++J>0)-ke&255;return k+U},f.prototype.writeIntBE=function(ee,k,U,q){if(ee=+ee,k|=0,!q){var Y=Math.pow(2,8*U-1);V(this,ee,k,U,Y-1,-Y)}var J=U-1,be=1,ke=0;for(this[k+J]=255ⅇ--J>=0&&(be*=256);)ee<0&&ke===0&&this[k+J+1]!==0&&(ke=1),this[k+J]=(ee/be>>0)-ke&255;return k+U},f.prototype.writeInt8=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,1,127,-128),f.TYPED_ARRAY_SUPPORT||(ee=Math.floor(ee)),ee<0&&(ee=255+ee+1),this[k]=255&ee,k+1},f.prototype.writeInt16LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8):re(this,ee,k,!0),k+2},f.prototype.writeInt16BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>8,this[k+1]=255&ee):re(this,ee,k,!1),k+2},f.prototype.writeInt32LE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8,this[k+2]=ee>>>16,this[k+3]=ee>>>24):$(this,ee,k,!0),k+4},f.prototype.writeInt32BE=function(ee,k,U){return ee=+ee,k|=0,U||V(this,ee,k,4,2147483647,-2147483648),ee<0&&(ee=4294967295+ee+1),f.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>24,this[k+1]=ee>>>16,this[k+2]=ee>>>8,this[k+3]=255&ee):$(this,ee,k,!1),k+4},f.prototype.writeFloatLE=function(ee,k,U){return he(this,ee,k,!0,U)},f.prototype.writeFloatBE=function(ee,k,U){return he(this,ee,k,!1,U)},f.prototype.writeDoubleLE=function(ee,k,U){return pe(this,ee,k,!0,U)},f.prototype.writeDoubleBE=function(ee,k,U){return pe(this,ee,k,!1,U)},f.prototype.copy=function(ee,k,U,q){if(U||(U=0),q||q===0||(q=this.length),k>=ee.length&&(k=ee.length),k||(k=0),q>0&&q=this.length)throw new RangeError("sourceStart out of bounds");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),ee.length-k=0;--Y)ee[Y+k]=this[Y+U];else if(J<1e3||!f.TYPED_ARRAY_SUPPORT)for(Y=0;Y>>=0,U=U===void 0?this.length:U>>>0,ee||(ee=0);var J;if(typeof ee=="number")for(J=k;J0)throw new Error("Invalid string. Length must be a multiple of 4");return t[n-2]==="="?2:t[n-1]==="="?1:0}function T(t){return 3*t.length/4-x(t)}function w(t){var n,c,m,v,b,E=t.length;v=x(t),b=new l(3*E/4-v),c=v>0?E-4:E;var g=0;for(n=0;n>16&255,b[g++]=m>>8&255,b[g++]=255&m;return v===2?(m=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,b[g++]=255&m):v===1&&(m=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,b[g++]=m>>8&255,b[g++]=255&m),b}function f(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function p(t,n,c){for(var m,v=[],b=n;bg?g:E+16383));return m===1?(n=t[c-1],v+=o[n>>2],v+=o[n<<4&63],v+="=="):m===2&&(n=(t[c-2]<<8)+t[c-1],v+=o[n>>10],v+=o[n>>4&63],v+=o[n<<2&63],v+="="),b.push(v),b.join("")}S.byteLength=T,S.toByteArray=w,S.fromByteArray=u;for(var o=[],i=[],l=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,r=s.length;h>1,s=-7,h=T?f-1:0,r=T?-1:1,t=D[x+h];for(h+=r,p=t&(1<<-s)-1,t>>=-s,s+=o;s>0;p=256*p+D[x+h],h+=r,s-=8);for(u=p&(1<<-s)-1,p>>=-s,s+=w;s>0;u=256*u+D[x+h],h+=r,s-=8);if(p===0)p=1-l;else{if(p===i)return u?NaN:1/0*(t?-1:1);u+=Math.pow(2,w),p-=l}return(t?-1:1)*u*Math.pow(2,p-w)},S.write=function(D,x,T,w,f,p){var u,o,i,l=8*p-f-1,s=(1<>1,r=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,t=w?0:p-1,n=w?1:-1,c=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(o=isNaN(x)?1:0,u=s):(u=Math.floor(Math.log(x)/Math.LN2),x*(i=Math.pow(2,-u))<1&&(u--,i*=2),x+=u+h>=1?r/i:r*Math.pow(2,1-h),x*i>=2&&(u++,i/=2),u+h>=s?(o=0,u=s):u+h>=1?(o=(x*i-1)*Math.pow(2,f),u+=h):(o=x*Math.pow(2,h-1)*Math.pow(2,f),u=0));f>=8;D[T+t]=255&o,t+=n,o/=256,f-=8);for(u=u<0;D[T+t]=255&u,t+=n,u/=256,l-=8);D[T+t-n]|=128*c}},function(j,S){var D={}.toString;j.exports=Array.isArray||function(x){return D.call(x)=="[object Array]"}},function(j,S,D){"use strict";function x(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function f(p,u){for(var o=0;o>>31}var E=(r<<5|r>>>27)+m+o[v];E+=v<20?1518500249+(t&n|~t&c):v<40?1859775393+(t^n^c):v<60?(t&n|t&c|n&c)-1894007588:(t^n^c)-899497514,m=c,c=n,n=t<<30|t>>>2,t=r,r=E}h[0]=h[0]+r|0,h[1]=h[1]+t|0,h[2]=h[2]+n|0,h[3]=h[3]+c|0,h[4]=h[4]+m|0},_doFinalize:function(){var l=this._data,s=l.words,h=8*this._nDataBytes,r=8*l.sigBytes;return s[r>>>5]|=128<<24-r%32,s[14+(r+64>>>9<<4)]=Math.floor(h/4294967296),s[15+(r+64>>>9<<4)]=h,l.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var l=p.clone.call(this);return l._hash=this._hash.clone(),l}});T.SHA1=p._createHelper(i),T.HmacSHA1=p._createHmacHelper(i)}(),x.SHA1})},function(j,S,D){!function(x,T){j.exports=S=T(D(0))}(0,function(x){!function(){var T=x,w=T.lib,f=w.Base,p=T.enc,u=p.Utf8,o=T.algo;o.HMAC=f.extend({init:function(i,l){i=this._hasher=new i.init,typeof l=="string"&&(l=u.parse(l));var s=i.blockSize,h=4*s;l.sigBytes>h&&(l=i.finalize(l)),l.clamp();for(var r=this._oKey=l.clone(),t=this._iKey=l.clone(),n=r.words,c=t.words,m=0;m>>6-r%4*2;s[h>>>2]|=(t|n)<<24-h%4*8,h++}return p.create(s,h)}var w=x,f=w.lib,p=f.WordArray,u=w.enc;u.Base64={stringify:function(o){var i=o.words,l=o.sigBytes,s=this._map;o.clamp();for(var h=[],r=0;r>>2]>>>24-r%4*8&255,n=i[r+1>>>2]>>>24-(r+1)%4*8&255,c=i[r+2>>>2]>>>24-(r+2)%4*8&255,m=t<<16|n<<8|c,v=0;v<4&&r+.75*v>>6*(3-v)&63));var b=s.charAt(64);if(b)for(;h.length%4;)h.push(b);return h.join("")},parse:function(o){var i=o.length,l=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var h=0;h0&&(G=H.UploadProgress.UploadProgressList[0],V=G.ClientId),l.default.setClientId(V),C&&C(G)},function(H){H&&(d(H),console.log(H))})}}]),g}();S.default=E},function(j,S,D){"use strict";function x(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(S,"__esModule",{value:!0});var T=function(){function u(o,i){for(var l=0;l=j.length?{done:!0}:{done:!1,value:j[x++]}},e:function(o){throw o},f:T}}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 w=!0,f=!1,p;return{s:function(){D=j[Symbol.iterator]()},n:function(){var o=D.next();return w=o.done,o},e:function(o){f=!0,p=o},f:function(){try{!w&&D.return!=null&&D.return()}finally{if(f)throw p}}}}},rHrb:function(nt,Le,F){"use strict";Object.defineProperty(Le,"__esModule",{value:!0}),Le.CopyToClipboard=void 0;var ue=j(F("q1tI")),Q=j(F("+QRC"));function j(n){return n&&n.__esModule?n:{default:n}}function S(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S=function(m){return typeof m}:S=function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},S(n)}function D(n,c){var m=Object.keys(n);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(n);c&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(n,b).enumerable})),m.push.apply(m,v)}return m}function x(n){for(var c=1;c=0)continue;if(!Object.prototype.propertyIsEnumerable.call(n,v))continue;m[v]=n[v]}}return m}function w(n,c){if(n==null)return{};var m={},v=Object.keys(n),b,E;for(E=0;E=0)continue;m[b]=n[b]}return m}function f(n,c){if(!(n instanceof c))throw new TypeError("Cannot call a class as a function")}function p(n,c){for(var m=0;m"']/,ue=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},D=g=>S[g];function x(g,y){if(y){if(F.test(g))return g.replace(ue,D)}else if(Q.test(g))return g.replace(j,D);return g}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(g){return g.replace(T,(y,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const f=/(^|[^\[])\^/g;function p(g,y){g=g.source||g,y=y||"";const C={replace:(d,_)=>(_=_.source||_,_=_.replace(f,"$1"),g=g.replace(d,_),C),getRegex:()=>new RegExp(g,y)};return C}const u=/[^\w:]/g,o=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function i(g,y,C){if(g){let d;try{d=decodeURIComponent(w(C)).replace(u,"").toLowerCase()}catch(_){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}y&&!o.test(C)&&(C=t(y,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(d){return null}return C}const l={},s=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(g,y){l[" "+g]||(s.test(g)?l[" "+g]=g+"/":l[" "+g]=v(g,"/",!0)),g=l[" "+g];const C=g.indexOf(":")===-1;return y.substring(0,2)==="//"?C?y:g.replace(h,"$1")+y:y.charAt(0)==="/"?C?y:g.replace(r,"$1")+y:g+y}const n={exec:function(){}};function c(g){let y=1,C,d;for(;y{let I=!1,W=A;for(;--W>=0&&P[W]==="\\";)I=!I;return I?"|":" |"}),d=C.split(/ \|/);let _=0;if(d.length>y)d.splice(y);else for(;d.length=0;p--){var u=j().key(p);f(S(u),u)}}function T(f){return j().removeItem(f)}function w(){return j().clear()}},"s8/Y":function(nt,Le,F){nt.exports=F.p+"static/jx.6713fc81.svg"},"sB/4":function(nt,Le,F){nt.exports=F.p+"static/b.7405990c.svg"},sNtx:function(nt,Le,F){},sR1s:function(nt,Le,F){"use strict";F.d(Le,"b",function(){return S}),F.d(Le,"a",function(){return D}),F.d(Le,"c",function(){return x}),F.d(Le,"d",function(){return T});var ue=F("U8pU"),Q="RC_TABLE_KEY";function j(w){return w==null?[]:Array.isArray(w)?w:[w]}function S(w,f){if(!f&&typeof f!="number")return w;for(var p=j(f),u=w,o=0;o1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var m=c[0];if(x.isValidElement(m)&&Object(u.c)(m)){var v=m.ref;c[0]=x.cloneElement(m,{ref:Object(u.a)(v,this.setChildNode)})}return c.length===1?c[0]:c.map(function(b,E){return!x.isValidElement(b)||"key"in b&&b.key!==null?b:x.cloneElement(b,{key:"".concat(i,"-").concat(E)})})}}]),r}(x.Component);l.displayName="ResizeObserver",Le.a=l},twBr:function(nt,Le,F){nt.exports=F.p+"static/s.1f286590.svg"},uMZB:function(nt,Le,F){nt.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(nt,Le,F){nt.exports=ue;function ue(){return F("gaXo"),{}}},ulZh:function(nt,Le,F){typeof window!="undefined"&&function(Q,j){nt.exports=j()}(this,function(){return function(ue){var Q={};function j(S){if(Q[S])return Q[S].exports;var D=Q[S]={i:S,l:!1,exports:{}};return ue[S].call(D.exports,D,D.exports,j),D.l=!0,D.exports}return j.m=ue,j.c=Q,j.d=function(S,D,x){j.o(S,D)||Object.defineProperty(S,D,{enumerable:!0,get:x})},j.r=function(S){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})},j.t=function(S,D){if(D&1&&(S=j(S)),D&8)return S;if(D&4&&typeof S=="object"&&S&&S.__esModule)return S;var x=Object.create(null);if(j.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:S}),D&2&&typeof S!="string")for(var T in S)j.d(x,T,function(w){return S[w]}.bind(null,T));return x},j.n=function(S){var D=S&&S.__esModule?function(){return S.default}:function(){return S};return j.d(D,"a",D),D},j.o=function(S,D){return Object.prototype.hasOwnProperty.call(S,D)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,Q,j){"use strict";var S=Object.prototype.hasOwnProperty,D="~";function x(){}Object.create&&(x.prototype=Object.create(null),new x().__proto__||(D=!1));function T(u,o,i){this.fn=u,this.context=o,this.once=i||!1}function w(u,o,i,l,s){if(typeof i!="function")throw new TypeError("The listener must be a function");var h=new T(i,l||u,s),r=D?D+o:o;return u._events[r]?u._events[r].fn?u._events[r]=[u._events[r],h]:u._events[r].push(h):(u._events[r]=h,u._eventsCount++),u}function f(u,o){--u._eventsCount===0?u._events=new x:delete u._events[o]}function p(){this._events=new x,this._eventsCount=0}p.prototype.eventNames=function(){var o=[],i,l;if(this._eventsCount===0)return o;for(l in i=this._events)S.call(i,l)&&o.push(D?l.slice(1):l);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(i)):o},p.prototype.listeners=function(o){var i=D?D+o:o,l=this._events[i];if(!l)return[];if(l.fn)return[l.fn];for(var s=0,h=l.length,r=new Array(h);s0},!1)}function u(o,i){for(var l={main:[i]},s={main:[]},h={main:{}};p(l);)for(var r=Object.keys(l),t=0;t=2*E/y||P<=W)return;var K=Number.POSITIVE_INFINITY,te;for(te=r.level-1;te>d;te--){var H=C[te].maxBitrate;if(K=E*H/(8*.8*A),K=P)return;var G=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+r.sn+(t?" part "+t.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+te+` Current BW estimate: `+(Object(S.isFiniteNumber)(G)?(G/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+P.toFixed(3)+` s Estimated load time for the next fragment: `+K.toFixed(3)+` s Time to underbuffer: `+W.toFixed(3)+" s"),n.nextLoadLevel=te,this.bwEstimator.sample(g,b.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),n.trigger(x.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:t,stats:b})},s.onFragLoaded=function(r,t){var n=t.frag,c=t.part;if(n.type===f.PlaylistLevelType.MAIN&&Object(S.isFiniteNumber)(n.sn)){var m=c?c.stats:n.stats,v=c?c.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[n.level],E=(b.loaded?b.loaded.bytes:0)+m.loaded,g=(b.loaded?b.loaded.duration:0)+v;b.loaded={bytes:E,duration:g},b.realBitrate=Math.round(8*E/g)}if(n.bitrateTest){var y={stats:m,frag:n,part:c,id:n.type};this.onFragBuffered(x.Events.FRAG_BUFFERED,y),n.bitrateTest=!1}}},s.onFragBuffered=function(r,t){var n=t.frag,c=t.part,m=c?c.stats:n.stats;if(m.aborted)return;if(n.type!==f.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var v=m.parsing.end-m.loading.start;this.bwEstimator.sample(v,m.loaded),m.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},s.onError=function(r,t){switch(t.details){case w.ErrorDetails.FRAG_LOAD_ERROR:case w.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var r=this.fragCurrent,t=this.partCurrent,n=this.hls,c=n.maxAutoLevel,m=n.config,v=n.minAutoLevel,b=n.media,E=t?t.duration:r?r.duration:0,g=b?b.currentTime:0,y=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():m.abrEwmaDefaultEstimate,d=(T.BufferHelper.bufferInfo(b,g,m.maxBufferHole).end-g)/y,_=this.findBestLevel(C,v,c,d,m.abrBandWidthFactor,m.abrBandWidthUpFactor);if(_>=0)return _;p.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var O=E?Math.min(E,m.maxStarvationDelay):m.maxStarvationDelay,A=m.abrBandWidthFactor,P=m.abrBandWidthUpFactor;if(!d){var I=this.bitrateTestDelay;if(I){var W=E?Math.min(E,m.maxLoadingDelay):m.maxLoadingDelay;O=W-I,p.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*O)+" ms"),A=P=1}}return _=this.findBestLevel(C,v,c,d+O,A,P),Math.max(_,0)},s.findBestLevel=function(r,t,n,c,m,v){for(var b,E=this.fragCurrent,g=this.partCurrent,y=this.lastLoadedFragLevel,C=this.hls.levels,d=C[y],_=!!(d!=null&&(b=d.details)!==null&&b!==void 0&&b.live),O=d==null?void 0:d.codecSet,A=g?g.duration:E?E.duration:0,P=n;P>=t;P--){var I=C[P];if(!I||O&&I.codecSet!==O)continue;var W=I.details,K=(g?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||A,te=void 0;P<=y?te=m*r:te=v*r;var H=C[P].maxBitrate,G=H*K/te;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(te)+"/"+H+"/"+K+"/"+c+"/"+G),te>H&&(!G||_&&!this.bitrateTestDelay||G0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+_.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},y.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var d,_=this.levels,O=this.trackId,A=_==null||((d=_[O])===null||d===void 0)?void 0:d.details;if(A){if(this.waitForCdnTuneIn(A))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var P,I=performance.now(),W=this.retryDate;(!W||I>=W||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var te=K.frag,H=K.part,G=K.cache,V=K.complete;if(this.initPTS[te.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var re=G.flush(),$={frag:te,part:H,payload:re,networkDetails:null};this._handleFragmentLoadProgress($),V&&E.prototype._handleFragmentLoadComplete.call(this,$)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+te.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ne=this.getLoadPosition(),he=T.BufferHelper.bufferInfo(this.mediaBuffer,ne,this.config.maxBufferHole),pe=Object(s.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,te);pe<0&&(t.logger.log("Waiting fragment cc ("+te.cc+") @ "+te.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},y.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var _=this.mediaBuffer?this.mediaBuffer:d,O=_.buffered;!this.loadedmetadata&&O.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},y.doTickIdle=function(){var d,_,O=this.hls,A=this.levels,P=this.media,I=this.trackId,W=O.config;if(!A||!A[I])return;if(!P&&(this.startFragRequested||!W.startFragPrefetch))return;var K=A[I],te=K.details;if(!te||te.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(te)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(H===null)return;var G=H.len,V=this.getMaxBufferLength(),re=this.audioSwitch;if(G>=V&&!re)return;if(!re&&this._streamEnded(H,te)){O.trigger(x.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var $=te.fragments,ne=$[0].start,he=H.end;if(re){var pe=this.getLoadPosition();he=pe,te.PTSKnown&&pene||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=ne+.05))}var Te=this.getNextFragment(he,te);if(!Te){this.bufferFlushed=!0;return}((d=Te.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((_=Te.decryptdata)!==null&&_!==void 0&&_.key)?this.loadKey(Te,te):this.loadFragment(Te,te,he)},y.getMaxBufferLength=function(){var d=E.prototype.getMaxBufferLength.call(this),_=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return _===null?d:Math.max(d,_.len)},y.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(d,_){var O=_.audioTracks;this.resetTransmuxer(),this.levels=O.map(function(A){return new f.Level(A)})},y.onAudioTrackSwitching=function(d,_){var O=!!_.url;this.trackId=_.id;var A=this.fragCurrent;A!=null&&A.loader&&A.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),O?this.setInterval(v):this.resetTransmuxer(),O?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(d,_){this.mainDetails=_.details},y.onAudioTrackLoaded=function(d,_){var O,A=this.levels,P=_.details,I=_.id;if(!A){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var W=A[I],K=0;if(P.live||(O=W.details)!==null&&O!==void 0&&O.live){var te=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!te)return;!W.details&&P.hasProgramDateTime&&te.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(P,te),K=P.fragments[0].start):K=this.alignPlaylists(P,W.details)}W.details=P,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(W.details,K),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=D.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(d){var _,O=d.frag,A=d.part,P=d.payload,I=this.config,W=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+O.sn+" of level "+O.level+" will not be buffered");return}var te=K[W];console.assert(te,"Audio track is defined on fragment load progress");var H=te.details;console.assert(H,"Audio track details are defined on fragment load progress");var G=I.defaultAudioCodec||te.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new i.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var re=this.initPTS[O.cc],$=(_=O.initSegment)===null||_===void 0?void 0:_.data;if(re!==void 0){var ne=!1,he=A?A.index:-1,pe=he!==-1,Te=new l.ChunkMetadata(O.level,O.sn,O.stats.chunkCount,P.byteLength,he,pe);V.push(P,$,G,"",O,A,H.totalduration,ne,Te,re)}else{t.logger.log("Unknown video PTS for cc "+O.cc+", waiting for video PTS before demuxing audio frag "+O.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+W);var we=this.waitingData=this.waitingData||{frag:O,part:A,cache:new o.default,complete:!1},Me=we.cache;Me.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,d)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(d,_){var O=_.tracks.audio;O&&(this.mediaBuffer=O.buffer),_.tracks.video&&(this.videoBuffer=_.tracks.video.buffer)},y.onFragBuffered=function(d,_){var O=_.frag,A=_.part;if(O.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(O)){this.warn("Fragment "+O.sn+(A?" p: "+A.index:"")+" of level "+O.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}O.sn!=="initSegment"&&(this.fragPrevious=O,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(x.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(O,A)},y.onError=function(d,_){switch(_.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(p.PlaylistLevelType.AUDIO,_);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=_.fatal?D.State.ERROR:D.State.IDLE,this.warn(_.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(_.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var O=!0,A=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);A&&A.len>.5&&(O=!this.reduceMaxBufferLength(A.len)),O&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(d,_){var O=_.type;O===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(d){var _,O="audio",A=this.hls,P=d.remuxResult,I=d.chunkMeta,W=this.getCurrentContext(I);if(!W){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var K=W.frag,te=W.part,H=P.audio,G=P.text,V=P.id3,re=P.initSegment;if(this.fragContextChanged(K))return;if(this.state=D.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),re!=null&&re.tracks&&(this._bufferInitSegment(re.tracks,K,I),A.trigger(x.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:O,tracks:re.tracks})),H){var $=H.startPTS,ne=H.endPTS,he=H.startDTS,pe=H.endDTS;te&&(te.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:ne,startDTS:he,endDTS:pe}),K.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,$,ne,he,pe),this.bufferFragmentData(H,K,te,I)}if(V!=null&&(_=V.samples)!==null&&_!==void 0&&_.length){var Te=n({frag:K,id:O},V);A.trigger(x.Events.FRAG_PARSING_METADATA,Te)}if(G){var we=n({frag:K,id:O},G);A.trigger(x.Events.FRAG_PARSING_USERDATA,we)}},y._bufferInitSegment=function(d,_,O){if(this.state!==D.State.PARSING)return;d.video&&delete d.video;var A=d.audio;if(!A)return;A.levelCodec=A.codec,A.id="audio",this.log("Init audio buffer, container:"+A.container+", codecs[parsed]=["+A.codec+"]"),this.hls.trigger(x.Events.BUFFER_CODECS,d);var P=A.initSegment;if(P!=null&&P.byteLength){var I={type:"audio",frag:_,part:null,chunkMeta:O,parent:_.type,data:P};this.hls.trigger(x.Events.BUFFER_APPENDING,I)}this.tick()},y.loadFragment=function(d,_,O){var A=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||A===w.FragmentState.NOT_LOADED||A===w.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):_.live&&!Object(S.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,d,_,O)))},y.completeAudioSwitch=function(){var d=this.hls,_=this.media,O=this.trackId;_&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(x.Events.AUDIO_TRACK_SWITCHED,{id:O})},g}(D.default);Q.default=b},"./src/controller/audio-track-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/controller/base-playlist-controller.ts"),T=j("./src/types/loader.ts");function w(i,l){for(var s=0;s=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=t[this.trackId];this.log("Now switching to audio-track index "+r);var c=t[r],m=c.id,v=c.groupId,b=v===void 0?"":v,E=c.name,g=c.type,y=c.url;if(this.trackId=r,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(S.Events.AUDIO_TRACK_SWITCHING,{id:m,groupId:b,name:E,type:g,url:y}),c.details&&!c.details.live)return;var C=this.switchParams(c.url,n==null?void 0:n.details);this.loadPlaylist(C)},s.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,n=this.findTrackId(t)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(r){for(var t=this.tracksInGroup,n=0;nl.partTarget&&(c+=1)}if(Object(S.isFiniteNumber)(n))return new D.HlsUrlParameters(n,Object(S.isFiniteNumber)(c)?c:void 0,D.HlsSkip.No)}}},u.loadPlaylist=function(i){},u.shouldLoadTrack=function(i){return this.canLoad&&i&&!!i.url&&(!i.details||i.details.live)},u.playlistLoaded=function(i,l,s){var h=this,r=l.details,t=l.stats,n=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(r.advancedDateTime=Date.now()-n,r.live||s!=null&&s.live){if(r.reloaded(s),s&&this.log("live playlist "+i+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),s&&r.fragments.length>0&&Object(x.mergeDetails)(s,r),!this.canLoad||!r.live)return;var c,m=void 0,v=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var b=this.hls.config.lowLatencyMode,E=r.lastPartSn,g=r.endSN,y=r.lastPartIndex,C=y!==-1,d=E===g,_=b?0:y;C?(m=d?g+1:E,v=d?_:y+1):m=g+1;var O=r.age,A=O+r.ageHeader,P=Math.min(A-r.partTarget,r.targetduration*1.5);if(P>0){if(s&&P>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+P+" with playlist age: "+r.age),P=0;else{var I=Math.floor(P/r.targetduration);if(m+=I,v!==void 0){var W=Math.round(P%r.targetduration/r.partTarget);v+=W}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+O.toFixed(2)+"s goal: "+P+" skip sn "+I+" to part "+v)}r.tuneInGoal=P}if(c=this.getDeliveryDirectives(r,l.deliveryDirectives,m,v),b||!d){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(r,l.deliveryDirectives,m,v);var K=Object(x.computeReloadInterval)(r,t);m!==void 0&&r.canBlockReload&&(K-=r.partTarget||1),this.log("reload live playlist "+i+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(c)},K)}else this.clearTimer()},u.getDeliveryDirectives=function(i,l,s,h){var r=Object(D.getSkipValue)(i,s);return l!=null&&l.skip&&i.deltaUpdateFailed&&(s=l.msn,h=l.part,r=D.HlsSkip.No),new D.HlsUrlParameters(s,h,r)},u.retryLoadingOrFail=function(i){var l=this,s=this.hls.config,h=this.retryCount-1&&(r=i.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+i.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+i.details+'"')}}else this.warn('cannot recover from error "'+i.details+'"'),this.clearTimer(),i.fatal=!0;return h},p}()},"./src/controller/base-stream-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"State",function(){return g}),j.d(Q,"default",function(){return y});var S=j("./src/polyfills/number.ts"),D=j("./src/task-loop.ts"),x=j("./src/controller/fragment-tracker.ts"),T=j("./src/utils/buffer-helper.ts"),w=j("./src/utils/logger.ts"),f=j("./src/events.ts"),p=j("./src/errors.ts"),u=j("./src/types/transmuxer.ts"),o=j("./src/utils/mp4-tools.ts"),i=j("./src/utils/discontinuities.ts"),l=j("./src/controller/fragment-finders.ts"),s=j("./src/controller/level-helper.ts"),h=j("./src/loader/fragment-loader.ts"),r=j("./src/crypt/decrypter.ts"),t=j("./src/utils/time-ranges.ts"),n=j("./src/types/loader.ts");function c(C,d){for(var _=0;_re;(te0&&te&&te.key&&te.iv&&te.method==="AES-128"){var H=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(K),te.key.buffer,te.iv.buffer).then(function(G){var V=self.performance.now();return W.trigger(f.Events.FRAG_DECRYPTED,{frag:A,payload:G,stats:{tstart:H,tdecrypt:V}}),I.payload=G,I})}return I}).then(function(I){var W=P.fragCurrent,K=P.hls,te=P.levels;if(!te)throw new Error("init load aborted, missing levels");var H=te[A.level].details;console.assert(H,"Level details are defined when init segment is loaded");var G=A.stats;P.state=g.IDLE,P.fragLoadError=0,A.data=new Uint8Array(I.payload),G.parsing.start=G.buffering.start=self.performance.now(),G.parsing.end=G.buffering.end=self.performance.now(),I.frag===W&&K.trigger(f.Events.FRAG_BUFFERED,{stats:G,frag:W,part:null,id:A.type}),P.tick()}).catch(function(I){P.warn(I),P.resetFragmentLoading(A)})},_.fragContextChanged=function(A){var P=this.fragCurrent;return!A||!P||A.level!==P.level||A.sn!==P.sn||A.urlId!==P.urlId},_.fragBufferedComplete=function(A,P){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+A.type+" sn: "+A.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+A.level+" "+t.default.toString(T.BufferHelper.getBuffered(I))),this.state=g.IDLE,this.tick()},_._handleFragmentLoadComplete=function(A){var P=this.transmuxer;if(!P)return;var I=A.frag,W=A.part,K=A.partsLoaded,te=!K||K.length===0||K.some(function(G){return!G}),H=new u.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,W?W.index:-1,!te);P.flush(H)},_._handleFragmentLoadProgress=function(A){},_._doFragLoad=function(A,P,I,W){var K=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(A.start,I||0),this.config.lowLatencyMode&&P){var te=P.partList;if(te&&W){I>A.end&&P.fragmentHint&&(A=P.fragmentHint);var H=this.getNextPart(te,A,I);if(H>-1){var G=te[H];return this.log("Loading part sn: "+A.sn+" p: "+G.index+" cc: "+A.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+H+"-"+(te.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=G.start+G.duration,this.state=g.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:A,part:te[H],targetBufferTime:I}),this.doFragPartsLoad(A,te,H,W).catch(function(V){return K.handleFragLoadError(V)})}else if(!A.url||this.loadedEndOfParts(te,I))return Promise.resolve(null)}}return this.log("Loading fragment "+A.sn+" cc: "+A.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+A.level+", target: "+parseFloat(I.toFixed(3))),Object(S.isFiniteNumber)(A.sn)&&!this.bitrateTest&&(this.nextLoadPosition=A.start+A.duration),this.state=g.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:A,targetBufferTime:I}),this.fragmentLoader.load(A,W).catch(function(V){return K.handleFragLoadError(V)})},_.doFragPartsLoad=function(A,P,I,W){var K=this;return new Promise(function(te,H){var G=[],V=function re($){var ne=P[$];K.fragmentLoader.loadPart(A,ne,W).then(function(he){G[ne.index]=he;var pe=he.part;K.hls.trigger(f.Events.FRAG_LOADED,he);var Te=P[$+1];if(Te&&Te.fragment===A)re($+1);else return te({frag:A,part:pe,partsLoaded:G})}).catch(H)};V(I)})},_.handleFragLoadError=function(A){var P=A.data;return P&&P.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(f.Events.ERROR,P),null},_._handleTransmuxerFlush=function(A){var P=this.getCurrentContext(A);if(!P||this.state!==g.PARSING){this.fragCurrent||(this.state=g.IDLE);return}var I=P.frag,W=P.part,K=P.level,te=self.performance.now();I.stats.parsing.end=te,W&&(W.stats.parsing.end=te),this.updateLevelTiming(I,W,K,A.partial)},_.getCurrentContext=function(A){var P=this.levels,I=A.level,W=A.sn,K=A.part;if(!P||!P[I])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+I+". The current chunk will not be buffered."),null;var te=P[I],H=K>-1?Object(s.getPartWith)(te,W,K):null,G=H?H.fragment:Object(s.getFragmentWithSN)(te,W,this.fragCurrent);return G?{frag:G,part:H,level:te}:null},_.bufferFragmentData=function(A,P,I,W){if(!A||this.state!==g.PARSING)return;var K=A.data1,te=A.data2,H=K;if(K&&te&&(H=Object(o.appendUint8Array)(K,te)),!H||!H.length)return;var G={type:A.type,frag:P,part:I,chunkMeta:W,parent:P.type,data:H};this.hls.trigger(f.Events.BUFFER_APPENDING,G),A.dropped&&A.independent&&!I&&this.flushBufferGap(P)},_.flushBufferGap=function(A){var P=this.media;if(!P)return;if(!T.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,A.start);return}var I=P.currentTime,W=T.BufferHelper.bufferInfo(P,I,0),K=A.duration,te=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),H=Math.max(Math.min(A.start-te,W.end-te),I+te);A.start-H>te&&this.flushMainBuffer(H,A.start)},_.getFwdBufferInfo=function(A,P){var I=this.config,W=this.getLoadPosition();if(!Object(S.isFiniteNumber)(W))return null;var K=T.BufferHelper.bufferInfo(A,W,I.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var te=this.fragmentTracker.getBufferedFrag(W,P);if(te&&K.nextStart=I?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},_.getNextFragment=function(A,P){var I,W,K=P.fragments,te=K.length;if(!te)return null;var H=this.config,G=K[0].start,V;if(P.live){var re=H.initialLiveManifestSize;if(te-1&&II.start&&I.loaded},_.getInitialLiveFragment=function(A,P){var I=this.fragPrevious,W=null;if(I){if(A.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),W=Object(l.findFragmentByPDT)(P,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var K=I.sn+1;if(K>=A.startSN&&K<=A.endSN){var te=P[K-A.startSN];I.cc===te.cc&&(W=te,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(l.findFragWithCC)(P,I.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(W=this.getFragmentAtPosition(H,this.bitrateTest?A.fragmentEnd:A.edge,A))}return W},_.getFragmentAtPosition=function(A,P,I){var W=this.config,K=this.fragPrevious,te=I.fragments,H=I.endSN,G=I.fragmentHint,V=W.maxFragLookUpTolerance,re=!!(W.lowLatencyMode&&I.partList&&G);re&&G&&!this.bitrateTest&&(te=te.concat(G),H=G.sn);var $;if(AP-V?0:V;$=Object(l.findFragmentByPTS)(K,te,A,ne)}else $=te[te.length-1];if($){var he=$.sn-I.startSN,pe=K&&$.level===K.level,Te=te[he+1],we=this.fragmentTracker.getState($);if(we===x.FragmentState.BACKTRACKED){$=null;for(var Me=he;te[Me]&&this.fragmentTracker.getState(te[Me])===x.FragmentState.BACKTRACKED;)K?$=te[Me--]:$=te[--Me];$||($=Te)}else K&&$.sn===K.sn&&!re&&(pe&&($.sn=te-P.maxFragLookUpTolerance&&K<=H;if(W!==null&&I.duration>W&&(K"+A.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+H),$}return G},_.waitForCdnTuneIn=function(A){var P=3;return A.live&&A.canBlockReload&&A.tuneInGoal>Math.max(A.partHoldBack,A.partTarget*P)},_.setStartPosition=function(A,P){var I=this.startPosition;if(I"+A))}}]),d}(D.default)},"./src/controller/buffer-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l});var S=j("./src/polyfills/number.ts"),D=j("./src/events.ts"),x=j("./src/utils/logger.ts"),T=j("./src/errors.ts"),w=j("./src/utils/buffer-helper.ts"),f=j("./src/utils/mediasource-helper.ts"),p=j("./src/loader/fragment.ts"),u=j("./src/controller/buffer-operation-queue.ts"),o=Object(f.getMediaSource)(),i=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function s(r){var t=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 n=t.hls,c=t.media,m=t.mediaSource;x.logger.log("[buffer-controller]: Media source opened"),c&&(t.updateMediaElementDuration(),n.trigger(D.Events.MEDIA_ATTACHED,{media:c})),m&&m.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){x.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){x.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var h=s.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var t=this.hls;t.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(D.Events.BUFFER_RESET,this.onBufferReset,this),t.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(D.Events.BUFFER_EOS,this.onBufferEos,this),t.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(D.Events.FRAG_PARSED,this.onFragParsed,this),t.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var t=this.hls;t.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(D.Events.BUFFER_RESET,this.onBufferReset,this),t.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(D.Events.BUFFER_EOS,this.onBufferEos,this),t.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(D.Events.FRAG_PARSED,this.onFragParsed,this),t.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(t,n){var c=2;(n.audio&&!n.video||!n.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,x.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(t,n){var c=this.media=n.media;if(c&&o){var m=this.mediaSource=new o;m.addEventListener("sourceopen",this._onMediaSourceOpen),m.addEventListener("sourceended",this._onMediaSourceEnded),m.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(m),this._objectUrl=c.src}},h.onMediaDetaching=function(){var t=this.media,n=this.mediaSource,c=this._objectUrl;if(n){if(x.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(m){x.logger.warn("[buffer-controller]: onMediaDetaching: "+m.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(c&&self.URL.revokeObjectURL(c),t.src===c?(t.removeAttribute("src"),t.load()):x.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(D.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(n){var c=t.sourceBuffer[n];try{c&&(t.removeBufferListeners(n),t.mediaSource&&t.mediaSource.removeSourceBuffer(c),t.sourceBuffer[n]=void 0)}catch(m){x.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",m)}}),this._initSourceBuffer()},h.onBufferCodecs=function(t,n){var c=this,m=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(v){if(m){var b=c.tracks[v];if(b&&typeof b.buffer.changeType=="function"){var E=n[v],g=E.codec,y=E.levelCodec,C=E.container,d=(b.levelCodec||b.codec).replace(i,"$1"),_=(y||g).replace(i,"$1");if(d!==_){var O=C+";codecs="+(y||g);c.appendChangeType(v,O)}}}else c.pendingTracks[v]=n[v]}),m)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(t,n){var c=this,m=this.operationQueue,v={execute:function(){var E=c.sourceBuffer[t];E&&(x.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+n),E.changeType(n)),m.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(E){x.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",E)}};m.append(v,t)},h.onBufferAppending=function(t,n){var c=this,m=this.hls,v=this.operationQueue,b=this.tracks,E=n.data,g=n.type,y=n.frag,C=n.part,d=n.chunkMeta,_=d.buffering[g],O=self.performance.now();_.start=O;var A=y.stats.buffering,P=C?C.stats.buffering:null;A.start===0&&(A.start=O),P&&P.start===0&&(P.start=O);var I=b.audio,W=g==="audio"&&d.id===1&&(I==null?void 0:I.container)==="audio/mpeg",K={execute:function(){if(_.executeStart=self.performance.now(),W){var H=c.sourceBuffer[g];if(H){var G=y.start-H.timestampOffset;Math.abs(G)>=.1&&(x.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+G+") sn: "+y.sn+")"),H.timestampOffset=y.start)}}c.appendExecutor(E,g)},onStart:function(){},onComplete:function(){var H=self.performance.now();_.executeEnd=_.end=H,A.first===0&&(A.first=H),P&&P.first===0&&(P.first=H);var G=c.sourceBuffer,V={};for(var re in G)V[re]=w.BufferHelper.getBuffered(G[re]);c.appendError=0,c.hls.trigger(D.Events.BUFFER_APPENDED,{type:g,frag:y,part:C,chunkMeta:d,parent:y.type,timeRanges:V})},onError:function(H){x.logger.error("[buffer-controller]: Error encountered while trying to append to the "+g+" SourceBuffer",H);var G={type:T.ErrorTypes.MEDIA_ERROR,parent:y.type,details:T.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?G.details=T.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,G.details=T.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>m.config.appendErrorMaxRetry&&(x.logger.error("[buffer-controller]: Failed "+m.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),G.fatal=!0)),m.trigger(D.Events.ERROR,G)}};v.append(K,g)},h.onBufferFlushing=function(t,n){var c=this,m=this.operationQueue,v=function(E){return{execute:c.removeExecutor.bind(c,E,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(D.Events.BUFFER_FLUSHED,{type:E})},onError:function(y){x.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",y)}}};n.type?m.append(v(n.type),n.type):this.getSourceBufferTypes().forEach(function(b){m.append(v(b),b)})},h.onFragParsed=function(t,n){var c=this,m=n.frag,v=n.part,b=[],E=v?v.elementaryStreams:m.elementaryStreams;E[p.ElementaryStreamTypes.AUDIOVIDEO]?b.push("audiovideo"):(E[p.ElementaryStreamTypes.AUDIO]&&b.push("audio"),E[p.ElementaryStreamTypes.VIDEO]&&b.push("video"));var g=function(){var C=self.performance.now();m.stats.buffering.end=C,v&&(v.stats.buffering.end=C);var d=v?v.stats:m.stats;c.hls.trigger(D.Events.FRAG_BUFFERED,{frag:m,part:v,stats:d,id:m.type})};b.length===0&&x.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+m.type+" level: "+m.level+" sn: "+m.sn),this.blockBuffers(g,b)},h.onFragChanged=function(t,n){this.flushBackBuffer()},h.onBufferEos=function(t,n){var c=this,m=this.getSourceBufferTypes().reduce(function(v,b){var E=c.sourceBuffer[b];return(!n.type||n.type===b)&&(E&&!E.ended&&(E.ended=!0,x.logger.log("[buffer-controller]: "+b+" sourceBuffer now EOS"))),v&&!!(!E||E.ended)},!0);m&&this.blockBuffers(function(){var v=c.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},h.onLevelUpdated=function(t,n){var c=n.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var t=this.hls,n=this.details,c=this.media,m=this.sourceBuffer;if(!c||n===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var b=n.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(S.isFiniteNumber)(b)||b<0)return;var E=c.currentTime,g=n.levelTargetDuration,y=Math.max(b,g),C=Math.floor(E/g)*g-y;v.forEach(function(d){var _=m[d];if(_){var O=w.BufferHelper.getBuffered(_);O.length>0&&C>O.start(0)&&(t.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),n.live&&t.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),t.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:d}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,n=this.hls,c=this.media,m=this.mediaSource,v=t.fragments[0].start+t.totalduration,b=c.duration,E=Object(S.isFiniteNumber)(m.duration)?m.duration:0;t.live&&n.config.liveDurationInfinity?(x.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),m.duration=Infinity,this.updateSeekableRange(t)):(v>E&&v>b||!Object(S.isFiniteNumber)(b))&&(x.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),m.duration=v)},h.updateSeekableRange=function(t){var n=this.mediaSource,c=t.fragments,m=c.length;if(m&&t.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var v=Math.max(0,c[0].start),b=Math.max(v,v+t.totalduration);n.setLiveSeekableRange(v,b)}},h.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,n=this.operationQueue,c=this.pendingTracks,m=Object.keys(c).length;if(m&&!t||m===2){this.createSourceBuffers(c),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(b){n.executeNext(b)})}},h.createSourceBuffers=function(t){var n=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var m=0;for(var v in t)if(!n[v]){var b=t[v];if(!b)throw Error("source buffer exists for track "+v+", however track does not");var E=b.levelCodec||b.codec,g=b.container+";codecs="+E;x.logger.log("[buffer-controller]: creating sourceBuffer("+g+")");try{var y=n[v]=c.addSourceBuffer(g),C=v;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[v]={buffer:y,codec:E,container:b.container,levelCodec:b.levelCodec,id:b.id},m++}catch(d){x.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:g})}}m&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(t){var n=this.operationQueue,c=n.current(t);c.onStart()},h._onSBUpdateEnd=function(t){var n=this.operationQueue,c=n.current(t);c.onComplete(),n.shiftAndExecuteNext(t)},h._onSBUpdateError=function(t,n){x.logger.error("[buffer-controller]: "+t+" SourceBuffer error",n),this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(t);c&&c.onError(n)},h.removeExecutor=function(t,n,c){var m=this.media,v=this.mediaSource,b=this.operationQueue,E=this.sourceBuffer,g=E[t];if(!m||!v||!g){x.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),b.shiftAndExecuteNext(t);return}var y=Object(S.isFiniteNumber)(m.duration)?m.duration:Infinity,C=Object(S.isFiniteNumber)(v.duration)?v.duration:Infinity,d=Math.max(0,n),_=Math.min(c,y,C);_>d?(x.logger.log("[buffer-controller]: Removing ["+d+","+_+"] from the "+t+" SourceBuffer"),console.assert(!g.updating,t+" sourceBuffer must not be updating"),g.remove(d,_)):b.shiftAndExecuteNext(t)},h.appendExecutor=function(t,n){var c=this.operationQueue,m=this.sourceBuffer,v=m[n];if(!v){x.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(n);return}v.ended=!1,console.assert(!v.updating,n+" sourceBuffer must not be updating"),v.appendBuffer(t)},h.blockBuffers=function(t,n){var c=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){x.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var m=this.operationQueue,v=n.map(function(b){return m.appendBlocker(b)});Promise.all(v).then(function(){t(),n.forEach(function(b){var E=c.sourceBuffer[b];(!E||!E.updating)&&m.shiftAndExecuteNext(b)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(t,n,c){var m=this.sourceBuffer[t];if(!m)return;var v=c.bind(this,t);this.listeners[t].push({event:n,listener:v}),m.addEventListener(n,v)},h.removeBufferListeners=function(t){var n=this.sourceBuffer[t];if(!n)return;this.listeners[t].forEach(function(c){n.removeEventListener(c.event,c.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return D});var S=j("./src/utils/logger.ts"),D=function(){function x(w){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=w}var T=x.prototype;return T.append=function(f,p){var u=this.queues[p];u.push(f),u.length===1&&this.buffers[p]&&this.executeNext(p)},T.insertAbort=function(f,p){var u=this.queues[p];u.unshift(f),this.executeNext(p)},T.appendBlocker=function(f){var p,u=new Promise(function(i){p=i}),o={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(o,f),u},T.executeNext=function(f){var p=this.buffers,u=this.queues,o=p[f],i=u[f];if(i.length){var l=i[0];try{l.execute()}catch(s){S.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(s),(!o||!o.updating)&&(i.shift(),this.executeNext(f))}}},T.shiftAndExecuteNext=function(f){this.queues[f].shift(),this.executeNext(f)},T.current=function(f){return this.queues[f][0]},x}()},"./src/controller/cap-level-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts");function D(w,f){for(var p=0;p0&&this.mediaWidth>0){var u=this.hls.levels;if(u.length){var o=this.hls;o.autoLevelCapping=this.getMaxLevel(u.length-1),o.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=o.autoLevelCapping}}},f.getMaxLevel=function(u){var o=this,i=this.hls.levels;if(!i.length)return-1;var l=i.filter(function(s,h){return w.isLevelAllowed(h,o.restrictedLevels)&&h<=u});return this.clientRect=null,w.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},f.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()},f.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},f.getDimensions=function(){if(this.clientRect)return this.clientRect;var u=this.media,o={width:0,height:0};if(u){var i=u.getBoundingClientRect();o.width=i.width,o.height=i.height,!o.width&&!o.height&&(o.width=i.right-i.left||u.width||0,o.height=i.bottom-i.top||u.height||0)}return this.clientRect=o,o},w.isLevelAllowed=function(u,o){return o===void 0&&(o=[]),o.indexOf(u)===-1},w.getMaxLevelByMediaSize=function(u,o,i){if(!u||!u.length)return-1;for(var l=function(n,c){return c?n.width!==c.width||n.height!==c.height:!0},s=u.length-1,h=0;h=o||r.height>=i)&&l(r,u[h+1])){s=h;break}}return s},x(w,[{key:"mediaWidth",get:function(){return this.getDimensions().width*w.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*w.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var u=1;try{u=self.devicePixelRatio}catch(o){}return u}}]),w}();Q.default=T},"./src/controller/cmcd-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l});var S=j("./src/events.ts"),D=j("./src/types/cmcd.ts"),x=j("./src/utils/buffer-helper.ts"),T=j("./src/utils/logger.ts");function w(s,h){for(var r=0;r=s.length?{done:!0}:{done:!1,value:s[t++]}}}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 u(s,h){if(!s)return;if(typeof s=="string")return o(s,h);var r=Object.prototype.toString.call(s).slice(8,-1);if(r==="Object"&&s.constructor&&(r=s.constructor.name),r==="Map"||r==="Set")return Array.from(s);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(s,h)}function o(s,h){(h==null||h>s.length)&&(h=s.length);for(var r=0,t=new Array(h);rn&&(n=b.bitrate)}return n>0?n:NaN},h.getBufferLength=function(t){var n=this.hls.media,c=t===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!n)return NaN;var m=x.BufferHelper.bufferInfo(c,n.currentTime,this.config.maxBufferHole);return m.len*1e3},h.createPlaylistLoader=function(){var t=this.config.pLoader,n=this.applyPlaylistData,c=t||this.config.loader;return function(){function m(b){this.loader=void 0,this.loader=new c(b)}var v=m.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(E,g,y){n(E),this.loader.load(E,g,y)},f(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},h.createFragmentLoader=function(){var t=this.config.fLoader,n=this.applyFragmentData,c=t||this.config.loader;return function(){function m(b){this.loader=void 0,this.loader=new c(b)}var v=m.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(E,g,y){n(E),this.loader.load(E,g,y)},f(m,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),m}()},s.uuid=function(){var t=URL.createObjectURL(new Blob),n=t.toString();return URL.revokeObjectURL(t),n.substr(n.lastIndexOf("/")+1)},s.serialize=function(t){for(var n=[],c=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},m=function(W){return Math.round(W)},v=function(W){return m(W/100)*100},b=function(W){return encodeURIComponent(W)},E={br:m,d:m,bl:v,dl:v,mtp:v,nor:b,rtp:v,tb:m},g=Object.keys(t||{}).sort(),y=p(g),C;!(C=y()).done;){var d=C.value,_=t[d];if(!c(_))continue;if(d==="v"&&_===1)continue;if(d=="pr"&&_===1)continue;var O=E[d];O&&(_=O(_));var A=typeof _,P=void 0;d==="ot"||d==="sf"||d==="st"?P=d+"="+_:A==="boolean"?P=d:A==="number"?P=d+"="+_:P=d+"="+JSON.stringify(_),n.push(P)}return n.join(",")},s.toHeaders=function(t){for(var n=Object.keys(t),c={},m=["Object","Request","Session","Status"],v=[{},{},{},{}],b={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},E=0,g=n;Ep){this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var b=p-this._requestLicenseFailureCount+1;x.logger.warn("Retrying license request, "+b+" attempts left"),this._requestLicense(n,c)}break}},s._generateLicenseRequestChallenge=function(r,t){switch(r.mediaKeySystemDomain){case T.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},s._requestLicense=function(r,t){x.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){x.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(n.mediaKeySystemDomain),m=this._createLicenseXhr(c,r,t);x.logger.log("Sending license request to URL: "+c);var v=this._generateLicenseRequestChallenge(n,r);m.send(v)}catch(b){x.logger.error("Failure requesting DRM license: "+b),this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(r,t){if(!this._emeEnabled)return;var n=t.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var r=this._media,t=this._mediaKeysList;if(!r)return;r.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return r.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(r,t){if(!this._emeEnabled)return;var n=t.levels.map(function(m){return m.audioCodec}).filter(function(m){return!!m}),c=t.levels.map(function(m){return m.videoCodec}).filter(function(m){return!!m});this._attemptKeySystemAccess(T.KeySystems.WIDEVINE,n,c)},f(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();Q.default=i},"./src/controller/fps-controller.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/events.ts"),D=j("./src/utils/logger.ts"),x=function(){function T(f){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=f,this.registerListeners()}var w=T.prototype;return w.setStreamController=function(p){this.streamController=p},w.registerListeners=function(){this.hls.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},w.unregisterListeners=function(){this.hls.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching)},w.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},w.onMediaAttaching=function(p,u){var o=this.hls.config;if(o.capLevelOnFPSDrop){var i=u.media instanceof self.HTMLVideoElement?u.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},w.checkFPS=function(p,u,o){var i=performance.now();if(u){if(this.lastTime){var l=i-this.lastTime,s=o-this.lastDroppedFrames,h=u-this.lastDecodedFrames,r=1e3*s/l,t=this.hls;if(t.trigger(S.Events.FPS_DROP,{currentDropped:s,currentDecoded:h,totalDroppedFrames:o}),r>0&&s>t.config.fpsDroppedMonitoringThreshold*h){var n=t.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=n)&&(n=n-1,t.trigger(S.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:t.currentLevel}),t.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=o,this.lastDecodedFrames=u}},w.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var u=p.getVideoPlaybackQuality();this.checkFPS(p,u.totalVideoFrames,u.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},T}();Q.default=x},"./src/controller/fragment-finders.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"findFragmentByPDT",function(){return x}),j.d(Q,"findFragmentByPTS",function(){return T}),j.d(Q,"fragmentWithinToleranceTest",function(){return w}),j.d(Q,"pdtWithinToleranceTest",function(){return f}),j.d(Q,"findFragWithCC",function(){return p});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/binary-search.ts");function x(u,o,i){if(o===null||!Array.isArray(u)||!u.length||!Object(S.isFiniteNumber)(o))return null;var l=u[0].programDateTime;if(o<(l||0))return null;var s=u[u.length-1].endProgramDateTime;if(o>=(s||0))return null;i=i||0;for(var h=0;hu&&i.start?-1:0}function f(u,o,i){var l=Math.min(o,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3,s=i.endProgramDateTime||0;return s-l>u}function p(u,o){return D.default.search(u,function(i){return i.cco?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"FragmentState",function(){return x}),j.d(Q,"FragmentTracker",function(){return T});var S=j("./src/events.ts"),D=j("./src/types/loader.ts"),x;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(x||(x={}));var T=function(){function p(o){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=o,this._registerListeners()}var u=p.prototype;return u._registerListeners=function(){var i=this.hls;i.on(S.Events.BUFFER_APPENDED,this.onBufferAppended,this),i.on(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(S.Events.FRAG_LOADED,this.onFragLoaded,this)},u._unregisterListeners=function(){var i=this.hls;i.off(S.Events.BUFFER_APPENDED,this.onBufferAppended,this),i.off(S.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(S.Events.FRAG_LOADED,this.onFragLoaded,this)},u.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},u.getAppendedFrag=function(i,l){if(l===D.PlaylistLevelType.MAIN){var s=this.activeFragment,h=this.activeParts;if(!s)return null;if(h)for(var r=h.length;r--;){var t=h[r],n=t?t.end:s.appendedPTS;if(t.start<=i&&n!==void 0&&i<=n)return r>9&&(this.activeParts=h.slice(r-9)),t}else if(s.start<=i&&s.appendedPTS!==void 0&&i<=s.appendedPTS)return s}return this.getBufferedFrag(i,l)},u.getBufferedFrag=function(i,l){for(var s=this.fragments,h=Object.keys(s),r=h.length;r--;){var t=s[h[r]];if((t==null?void 0:t.body.type)===l&&t.buffered){var n=t.body;if(n.start<=i&&i<=n.end)return n}}return null},u.detectEvictedFragments=function(i,l,s){var h=this;Object.keys(this.fragments).forEach(function(r){var t=h.fragments[r];if(!t)return;if(!t.buffered){t.body.type===s&&h.removeFragment(t.body);return}var n=t.range[i];if(!n)return;n.time.some(function(c){var m=!h.isTimeBuffered(c.startPTS,c.endPTS,l);return m&&h.removeFragment(t.body),m})})},u.detectPartialFragments=function(i){var l=this,s=this.timeRanges,h=i.frag,r=i.part;if(!s||h.sn==="initSegment")return;var t=f(h),n=this.fragments[t];if(!n)return;Object.keys(s).forEach(function(c){var m=h.elementaryStreams[c];if(!m)return;var v=s[c],b=r!==null||m.partial===!0;n.range[c]=l.getBufferedTimes(h,r,b,v)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},u.fragBuffered=function(i){var l=f(i),s=this.fragments[l];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},u.getBufferedTimes=function(i,l,s,h){for(var r={time:[],partial:s},t=l?l.start:i.start,n=l?l.end:i.end,c=i.minEndPTS||n,m=i.maxStartPTS||t,v=0;v=b&&c<=E){r.time.push({startPTS:Math.max(t,h.start(v)),endPTS:Math.min(n,h.end(v))});break}else if(tb)r.partial=!0,r.time.push({startPTS:Math.max(t,h.start(v)),endPTS:Math.min(n,h.end(v))});else if(n<=b)break}return r},u.getPartialFragment=function(i){var l=null,s,h,r,t=0,n=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(m){var v=c[m];if(!v)return;w(v)&&(h=v.body.start-n,r=v.body.end+n,i>=h&&i<=r&&(s=Math.min(i-h,r-i),t<=s&&(l=v.body,t=s)))}),l},u.getState=function(i){var l=f(i),s=this.fragments[l];return s?s.buffered?w(s)?x.PARTIAL:x.OK:s.backtrack?x.BACKTRACKED:x.APPENDING:x.NOT_LOADED},u.backtrack=function(i,l){var s=f(i),h=this.fragments[s];if(!h||h.backtrack)return null;var r=h.backtrack=l||h.loaded;return h.loaded=null,r},u.getBacktrackData=function(i){var l=f(i),s=this.fragments[l];if(s){var h,r=s.backtrack;if(r!=null&&(h=r.payload)!==null&&h!==void 0&&h.byteLength)return r;this.removeFragment(i)}return null},u.isTimeBuffered=function(i,l,s){for(var h,r,t=0;t=h&&l<=r)return!0;if(l<=h)return!1}return!1},u.onFragLoaded=function(i,l){var s=l.frag,h=l.part;if(s.sn==="initSegment"||s.bitrateTest||h)return;var r=f(s);this.fragments[r]={body:s,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},u.onBufferAppended=function(i,l){var s=this,h=l.frag,r=l.part,t=l.timeRanges;if(h.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=h,r){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(r)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(c){var m=t[c];if(s.detectEvictedFragments(c,m),!r)for(var v=0;vi&&h.removeFragment(n)}})},u.removeFragment=function(i){var l=f(i);i.stats.loaded=0,i.clearElementaryStreamInfo(),delete this.fragments[l]},u.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function w(p){var u,o;return p.buffered&&(((u=p.range.video)===null||u===void 0?void 0:u.partial)||((o=p.range.audio)===null||o===void 0?void 0:o.partial))}function f(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return w}),j.d(Q,"MAX_START_GAP_JUMP",function(){return f}),j.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),j.d(Q,"SKIP_BUFFER_RANGE_START",function(){return u}),j.d(Q,"default",function(){return o});var S=j("./src/utils/buffer-helper.ts"),D=j("./src/errors.ts"),x=j("./src/events.ts"),T=j("./src/utils/logger.ts"),w=250,f=2,p=.1,u=.05,o=function(){function i(s,h,r,t){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=h,this.fragmentTracker=r,this.hls=t}var l=i.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(h){var r=this.config,t=this.media,n=this.stalled,c=t.currentTime,m=t.seeking,v=this.seeking&&!m,b=!this.seeking&&m;if(this.seeking=m,c!==h){if(this.moved=!0,n!==null){if(this.stallReported){var E=self.performance.now()-n;T.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((b||v)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!S.BufferHelper.getBuffered(t).length)return;var g=S.BufferHelper.bufferInfo(t,c,0),y=g.len>0,C=g.nextStart||0;if(!y&&!C)return;if(m){var d=g.len>f,_=!C||C-c>f&&!this.fragmentTracker.getPartialFragment(c);if(d||_)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var O,A=Math.max(C,g.start||0)-c,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=P==null||((O=P.details)===null||O===void 0)?void 0:O.live,W=I?P.details.targetduration*2:f;if(A>0&&A<=W){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(n===null){this.stalled=K;return}var te=K-n;!m&&te>=w&&this._reportStall(g.len);var H=S.BufferHelper.bufferInfo(t,c,r.maxBufferHole);this._tryFixBufferStall(H,te)},l._tryFixBufferStall=function(h,r){var t=this.config,n=this.fragmentTracker,c=this.media,m=c.currentTime,v=n.getPartialFragment(m);if(v){var b=this._trySkipBufferHole(v);if(b)return}h.len>t.maxBufferHole&&r>t.highBufferWatchdogPeriod*1e3&&(T.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(h){var r=this.hls,t=this.media,n=this.stallReported;n||(this.stallReported=!0,T.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+h+")"),r.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},l._trySkipBufferHole=function(h){for(var r=this.config,t=this.hls,n=this.media,c=n.currentTime,m=0,v=S.BufferHelper.getBuffered(n),b=0;b=m&&c.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,t)),E=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;i.playbackRate=Math.min(b,Math.max(1,E))}else i.playbackRate!==1&&i.playbackRate!==0&&(i.playbackRate=1)},u.estimateLiveEdge=function(){var i=this.levelDetails;return i===null?null:i.edge+i.age},u.computeLatency=function(){var i=this.estimateLiveEdge();return i===null?null:i-this.currentTime},w(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var i=this.config,l=this.levelDetails;return i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:l?i.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var i=this.levelDetails;if(i===null)return null;var l=i.holdBack,s=i.partHoldBack,h=i.targetduration,r=this.config,t=r.liveSyncDuration,n=r.liveSyncDurationCount,c=r.lowLatencyMode,m=this.hls.userConfig,v=c&&s||l;(m.liveSyncDuration||m.liveSyncDurationCount||v===0)&&(v=t!==void 0?t:n*h);var b=h,E=1;return v+Math.min(this.stallCount*E,b)}},{key:"liveSyncPosition",get:function(){var i=this.estimateLiveEdge(),l=this.targetLatency,s=this.levelDetails;if(i===null||l===null||s===null)return null;var h=s.edge,r=i-l-this.edgeStalled,t=h-s.totalduration,n=h-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(t,r),n)}},{key:"drift",get:function(){var i=this.levelDetails;return i===null?1:i.drift}},{key:"edgeStalled",get:function(){var i=this.levelDetails;if(i===null)return 0;var l=(this.config.lowLatencyMode&&i.partTarget||i.targetduration)*3;return Math.max(i.age-l,0)}},{key:"forwardBufferLength",get:function(){var i=this.media,l=this.levelDetails;if(!i||!l)return 0;var s=i.buffered.length;return s?i.buffered.end(s-1):l.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return r});var S=j("./src/types/level.ts"),D=j("./src/events.ts"),x=j("./src/errors.ts"),T=j("./src/utils/codecs.ts"),w=j("./src/controller/level-helper.ts"),f=j("./src/controller/base-playlist-controller.ts"),p=j("./src/types/loader.ts");function u(){return u=Object.assign||function(t){for(var n=1;n0){C=E[0].bitrate,E.sort(function(te,H){return te.bitrate-H.bitrate}),this._levels=E;for(var I=0;Ithis.hls.config.fragLoadingMaxRetry&&(d=b.frag.level)):d=b.frag.level}break;case x.ErrorDetails.LEVEL_LOAD_ERROR:case x.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(C=!1),d=E.level),y=!0;break;case x.ErrorDetails.REMUX_ALLOC_ERROR:d=b.level,y=!0;break}d!==void 0&&this.recoverLevel(b,d,y,C)},c.recoverLevel=function(v,b,E,g){var y=v.details,C=this._levels[b];if(C.loadError++,E){var d=this.retryLoadingOrFail(v);if(d)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(g){var _=C.url.length;if(_>1&&C.loadError<_)v.levelRetry=!0,this.redundantFailover(b);else if(this.manualLevelIndex===-1){var O=b===0?this._levels.length-1:b-1;this.currentLevelIndex!==O&&this._levels[O].loadError===0&&(this.warn(y+": switch to "+O),v.levelRetry=!0,this.hls.nextAutoLevel=O)}}},c.redundantFailover=function(v){var b=this._levels[v],E=b.url.length;if(E>1){var g=(b.urlId+1)%E;this.warn("Switching to redundant URL-id "+g),this._levels.forEach(function(y){y.urlId=g}),this.level=v}},c.onFragLoaded=function(v,b){var E=b.frag;if(E!==void 0&&E.type===p.PlaylistLevelType.MAIN){var g=this._levels[E.level];g!==void 0&&(g.fragmentError=0,g.loadError=0)}},c.onLevelLoaded=function(v,b){var E,g=b.level,y=b.details,C=this._levels[g];if(!C){var d;this.warn("Invalid level index "+g),(d=b.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(y.deltaUpdateFailed=!0);return}g===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(g,b,C.details)):(E=b.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(y.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(v,b){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var g=-1,y=this.hls.audioTracks[b.id].groupId,C=0;C0){var g=E.urlId,y=E.url[g];if(v)try{y=v.addDirectives(y)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+b+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+g+" "+y),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:y,level:b,id:g,deliveryDirectives:v||null})}},c.removeLevel=function(v,b){var E=function(C,d){return d!==b},g=this._levels.filter(function(y,C){return C!==v?!0:y.url.length>1&&b!==void 0?(y.url=y.url.filter(E),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(E)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(E)),y.urlId=0,!0):!1}).map(function(y,C){var d=y.details;return d!=null&&d.fragments&&d.fragments.forEach(function(_){_.level=C}),y});this._levels=g,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:g})},i(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var b,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===v&&(b=E[v])!==null&&b!==void 0&&b.details)return;if(v<0||v>=E.length){var g=v<0;if(this.hls.trigger(D.Events.ERROR,{type:x.ErrorTypes.OTHER_ERROR,details:x.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:g,reason:"invalid level idx"}),g)return;v=Math.min(v,E.length-1)}this.clearTimer();var y=this.currentLevelIndex,C=E[y],d=E[v];this.log("switching to level "+v+" from "+y),this.currentLevelIndex=v;var _=u({},d,{level:v,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete _._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,_);var O=d.details;if(!O||O.live){var A=this.switchParams(d.uri,C==null?void 0:C.details);this.loadPlaylist(A)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),n}(f.default)},"./src/controller/level-helper.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"addGroupId",function(){return x}),j.d(Q,"assignTrackIdsByGroup",function(){return T}),j.d(Q,"updatePTS",function(){return w}),j.d(Q,"updateFragPTSDTS",function(){return p}),j.d(Q,"mergeDetails",function(){return u}),j.d(Q,"mapPartIntersection",function(){return o}),j.d(Q,"mapFragmentIntersection",function(){return i}),j.d(Q,"adjustSliding",function(){return l}),j.d(Q,"addSliding",function(){return s}),j.d(Q,"computeReloadInterval",function(){return h}),j.d(Q,"getFragmentWithSN",function(){return r}),j.d(Q,"getPartWith",function(){return t});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/logger.ts");function x(n,c,m){switch(c){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(m);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(m);break}}function T(n){var c={};n.forEach(function(m){var v=m.groupId||"";m.id=c[v]=c[v]||0,c[v]++})}function w(n,c,m){var v=n[c],b=n[m];f(v,b)}function f(n,c){var m=c.startPTS;if(Object(S.isFiniteNumber)(m)){var v=0,b;c.sn>n.sn?(v=m-n.start,b=n):(v=n.start-m,b=c),b.duration!==v&&(b.duration=v)}else if(c.sn>n.sn){var E=n.cc===c.cc;E&&n.minEndPTS?c.start=n.start+(n.minEndPTS-n.start):c.start=n.start+n.duration}else c.start=Math.max(n.start-c.duration,0)}function p(n,c,m,v,b,E){var g=v-m;g<=0&&(D.logger.warn("Fragment should have a positive duration",c),v=m+c.duration,E=b+c.duration);var y=m,C=v,d=c.startPTS,_=c.endPTS;if(Object(S.isFiniteNumber)(d)){var O=Math.abs(d-m);Object(S.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(O,c.deltaPTS):c.deltaPTS=O,y=Math.max(m,d),m=Math.min(m,d),b=Math.min(b,c.startDTS),C=Math.min(v,_),v=Math.max(v,_),E=Math.max(E,c.endDTS)}c.duration=v-m;var A=m-c.start;c.appendedPTS=v,c.start=c.startPTS=m,c.maxStartPTS=y,c.startDTS=b,c.endPTS=v,c.minEndPTS=C,c.endDTS=E;var P=c.sn;if(!n||Pn.endSN)return 0;var I,W=P-n.startSN,K=n.fragments;for(K[W]=c,I=W;I>0;I--)f(K[I],K[I-1]);for(I=W;I=0;b--){var E=v[b].initSegment;if(E){m=E;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var g=0,y;if(i(n,c,function(I,W){I.relurl&&(g=I.cc-W.cc),Object(S.isFiniteNumber)(I.startPTS)&&Object(S.isFiniteNumber)(I.endPTS)&&(W.start=W.startPTS=I.startPTS,W.startDTS=I.startDTS,W.appendedPTS=I.appendedPTS,W.maxStartPTS=I.maxStartPTS,W.endPTS=I.endPTS,W.endDTS=I.endDTS,W.minEndPTS=I.minEndPTS,W.duration=I.endPTS-I.startPTS,W.duration&&(y=W),c.PTSKnown=c.alignedSliding=!0),W.elementaryStreams=I.elementaryStreams,W.loader=I.loader,W.stats=I.stats,W.urlId=I.urlId,I.initSegment&&(W.initSegment=I.initSegment,m=I.initSegment)}),m){var C=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;C.forEach(function(I){var W;(!I.initSegment||I.initSegment.relurl===((W=m)===null||W===void 0?void 0:W.relurl))&&(I.initSegment=m)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(I){return!I}),c.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=c.skippedSegments;d--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var _=c.fragments;if(g){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var O=0;O<_.length;O++)_[O].cc+=g}c.skippedSegments&&(c.startCC=c.fragments[0].cc),o(n.partList,c.partList,function(I,W){W.elementaryStreams=I.elementaryStreams,W.stats=I.stats}),y?p(c,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):l(n,c),_.length&&(c.totalduration=c.edge-_[0].start),c.driftStartTime=n.driftStartTime,c.driftStart=n.driftStart;var A=c.advancedDateTime;if(c.advanced&&A){var P=c.edge;c.driftStart||(c.driftStartTime=A,c.driftStart=P),c.driftEndTime=A,c.driftEnd=P}else c.driftEndTime=n.driftEndTime,c.driftEnd=n.driftEnd,c.advancedDateTime=n.advancedDateTime}function o(n,c,m){if(n&&c)for(var v=0,b=0,E=n.length;b<=E;b++){var g=n[b],y=c[b+v];g&&y&&g.index===y.index&&g.fragment.sn===y.fragment.sn?m(g,y):v--}}function i(n,c,m){for(var v=c.skippedSegments,b=Math.max(n.startSN,c.startSN)-c.startSN,E=(n.fragmentHint?1:0)+(v?c.endSN:Math.min(n.endSN,c.endSN))-c.startSN,g=c.startSN-n.startSN,y=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,C=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,d=b;d<=E;d++){var _=C[g+d],O=y[d];v&&!O&&d=v.length)return;s(c,v[m].start)}function s(n,c){if(c){for(var m=n.fragments,v=n.skippedSegments;v0&&b0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),C=d),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},g.stopLoad=function(){this._forceStartLoad=!1,b.prototype.stopLoad.call(this)},g.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var C,d=this.levels,_=this.level,O=d==null||((C=d[_])===null||C===void 0)?void 0:C.details;if(O&&(!O.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(O))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var A,P=self.performance.now(),I=this.retryDate;(!I||P>=I||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},g.onTickEnd=function(){b.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},g.doTickIdle=function(){var C,d,_=this.hls,O=this.levelLastLoaded,A=this.levels,P=this.media,I=_.config,W=_.nextLoadLevel;if(O===null||!P&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!A||!A[W])return;var K=A[W];this.level=_.nextLoadLevel=W;var te=K.details;if(!te||this.state===D.State.WAITING_LEVEL||te.live&&this.levelLastLoaded!==W){this.state=D.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,p.PlaylistLevelType.MAIN);if(H===null)return;var G=H.len,V=this.getMaxBufferLength(K.maxBitrate);if(G>=V)return;if(this._streamEnded(H,te)){var re={};this.altAudio&&(re.type="video"),this.hls.trigger(T.Events.BUFFER_EOS,re),this.state=D.State.ENDED;return}var $=H.end,ne=this.getNextFragment($,te);if(this.couldBacktrack&&!this.fragPrevious&&ne&&ne.sn!=="initSegment"){var he=ne.sn-te.startSN;he>1&&(ne=te.fragments[he-1],this.fragmentTracker.removeFragment(ne))}if(ne&&this.fragmentTracker.getState(ne)===f.FragmentState.OK&&this.nextLoadPosition>$){var pe=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,pe,p.PlaylistLevelType.MAIN),ne=this.getNextFragment(this.nextLoadPosition,te)}if(!ne)return;ne.initSegment&&!ne.initSegment.data&&!this.bitrateTest&&(ne=ne.initSegment),((C=ne.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((d=ne.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ne,te):this.loadFragment(ne,te,$)},g.loadFragment=function(C,d,_){var O,A=this.fragmentTracker.getState(C);if(this.fragCurrent=C,A===f.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(C);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else A=f.FragmentState.NOT_LOADED}A===f.FragmentState.NOT_LOADED||A===f.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,C,d,_)):A===f.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((O=this.media)===null||O===void 0?void 0:O.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},g.getAppendedFrag=function(C){var d=this.fragmentTracker.getAppendedFrag(C,p.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},g.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,p.PlaylistLevelType.MAIN)},g.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},g.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},g.nextLevelSwitch=function(){var C=this.levels,d=this.media;if(d!=null&&d.readyState){var _,O=this.getAppendedFrag(d.currentTime);if(O&&O.start>1&&this.flushMainBuffer(0,O.start-1),!d.paused&&C){var A=this.hls.nextLoadLevel,P=C[A],I=this.fragLastKbps;I&&this.fragCurrent?_=this.fragCurrent.duration*P.maxBitrate/(1e3*I)+1:_=0}else _=0;var W=this.getBufferedFrag(d.currentTime+_);if(W){var K=this.followingBufferedFrag(W);if(K){this.abortCurrentFrag();var te=K.maxStartPTS?K.maxStartPTS:K.start,H=K.duration,G=Math.max(W.end,te+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(G,Number.POSITIVE_INFINITY)}}}},g.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},g.flushMainBuffer=function(C,d){b.prototype.flushMainBuffer.call(this,C,d,this.altAudio?"video":null)},g.onMediaAttached=function(C,d){b.prototype.onMediaAttached.call(this,C,d);var _=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),_.addEventListener("playing",this.onvplaying),_.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,_,this.fragmentTracker,this.hls)},g.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),b.prototype.onMediaDetaching.call(this)},g.onMediaPlaying=function(){this.tick()},g.onMediaSeeked=function(){var C=this.media,d=C?C.currentTime:null;Object(S.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},g.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(T.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},g.onManifestParsed=function(C,d){var _=!1,O=!1,A;d.levels.forEach(function(P){A=P.audioCodec,A&&(A.indexOf("mp4a.40.2")!==-1&&(_=!0),A.indexOf("mp4a.40.5")!==-1&&(O=!0))}),this.audioCodecSwitch=_&&O&&!Object(x.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},g.onLevelLoading=function(C,d){var _=this.levels;if(!_||this.state!==D.State.IDLE)return;var O=_[d.level];(!O.details||O.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(O.details))&&(this.state=D.State.WAITING_LEVEL)},g.onLevelLoaded=function(C,d){var _,O=this.levels,A=d.level,P=d.details,I=P.totalduration;if(!O){this.warn("Levels were reset while loading level "+A);return}this.log("Level "+A+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+I);var W=this.fragCurrent;W&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==d.level&&W.loader&&(this.state=D.State.IDLE,W.loader.abort()));var K=O[A],te=0;if(P.live||(_=K.details)!==null&&_!==void 0&&_.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;te=this.alignPlaylists(P,K.details)}if(K.details=P,this.levelLastLoaded=A,this.hls.trigger(T.Events.LEVEL_UPDATED,{details:P,level:A}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=D.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,te),this.tick()},g._handleFragmentLoadProgress=function(C){var d,_=C.frag,O=C.part,A=C.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var I=P[_.level],W=I.details;if(!W){this.warn("Dropping fragment "+_.sn+" of level "+_.level+" after level details were reset");return}var K=I.videoCodec,te=W.PTSKnown||!W.live,H=(d=_.initSegment)===null||d===void 0?void 0:d.data,G=this._getAudioCodec(I),V=this.transmuxer=this.transmuxer||new o.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),re=O?O.index:-1,$=re!==-1,ne=new i.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,A.byteLength,re,$),he=this.initPTS[_.cc];V.push(A,H,G,K,_,O,W.totalduration,te,ne,he)},g.onAudioTrackSwitching=function(C,d){var _=this.altAudio,O=!!d.url,A=d.id;if(!O){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;_&&I.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:A})}},g.onAudioTrackSwitched=function(C,d){var _=d.id,O=!!this.hls.audioTracks[_].url;if(O){var A=this.videoBuffer;A&&this.mediaBuffer!==A&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=A)}this.altAudio=O,this.tick()},g.onBufferCreated=function(C,d){var _=d.tracks,O,A,P=!1;for(var I in _){var W=_[I];if(W.id==="main"){if(A=I,O=W,I==="video"){var K=_[I];K&&(this.videoBuffer=K.buffer)}}else P=!0}P&&O?(this.log("Alternate track found, use "+A+".buffered to schedule main fragment loading"),this.mediaBuffer=O.buffer):this.mediaBuffer=this.media},g.onFragBuffered=function(C,d){var _=d.frag,O=d.part;if(_&&_.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(O?" p: "+O.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var A=O?O.stats:_.stats;this.fragLastKbps=Math.round(8*A.total/(A.buffering.end-A.loading.first)),_.sn!=="initSegment"&&(this.fragPrevious=_),this.fragBufferedComplete(_,O)},g.onError=function(C,d){switch(d.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.MAIN,d);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=D.State.ERROR):!d.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var _=!0,O=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);O&&O.len>.5&&(_=!this.reduceMaxBufferLength(O.len)),_&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},g.checkBuffer=function(){var C=this.media,d=this.gapController;if(!C||!d||!C.readyState)return;var _=w.BufferHelper.getBuffered(C);!this.loadedmetadata&&_.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},g.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},g.onBufferFlushed=function(C,d){var _=d.type;if(_!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var O=(_===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(O,_,p.PlaylistLevelType.MAIN)}},g.onLevelsUpdated=function(C,d){this.levels=d.levels},g.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},g.seekToStartPos=function(){var C=this.media,d=C.currentTime,_=this.startPosition;if(_>=0&&d<_){if(C.seeking){h.logger.log("could not seek to "+_+", already seeking at "+d);return}var O=w.BufferHelper.getBuffered(C),A=O.length?O.start(0):0,P=A-_;P>0&&(P1&&C.seeking===!1){var _=C.currentTime;if(w.BufferHelper.isBuffered(C,_)?d=this.getAppendedFrag(_):w.BufferHelper.isBuffered(C,_+.1)&&(d=this.getAppendedFrag(_+.1)),d){var O=this.fragPlaying,A=d.level;(!O||d.sn!==O.sn||O.level!==A||d.urlId!==O.urlId)&&(this.hls.trigger(T.Events.FRAG_CHANGED,{frag:d}),(!O||O.level!==A)&&this.hls.trigger(T.Events.LEVEL_SWITCHED,{level:A}),this.fragPlaying=d)}}},t(E,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var d=this.getAppendedFrag(C.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var d=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),E}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"SubtitleStreamController",function(){return n});var S=j("./src/events.ts"),D=j("./src/utils/logger.ts"),x=j("./src/utils/buffer-helper.ts"),T=j("./src/controller/fragment-finders.ts"),w=j("./src/utils/discontinuities.ts"),f=j("./src/controller/level-helper.ts"),p=j("./src/controller/fragment-tracker.ts"),u=j("./src/controller/base-stream-controller.ts"),o=j("./src/types/loader.ts"),i=j("./src/types/level.ts");function l(c,m){for(var v=0;v=d[A].start&&O<=d[A].end){_=d[A];break}var P=y.start+y.duration;_?_.end=P:(_={start:O,end:P},d.push(_)),this.fragmentTracker.fragBuffered(y)},v.onBufferFlushing=function(E,g){var y=g.startOffset,C=g.endOffset;if(y===0&&C!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,_=this.levels;if(!_.length||!_[d]||!_[d].details)return;var O=_[d].details,A=O.targetduration,P=C-A;if(P<=0)return;g.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(I){for(var W=0;W=O.length||d!==_||!A)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(y=A.details)!==null&&y!==void 0&&y.live){var P=this.mainDetails;if(C.deltaUpdateFailed||!P)return;var I=P.fragments[0];if(!A.details)C.hasProgramDateTime&&P.hasProgramDateTime?Object(w.alignMediaPlaylistByPDT)(C,P):I&&Object(f.addSliding)(C,I.start);else{var W=this.alignPlaylists(C,A.details);W===0&&I&&Object(f.addSliding)(C,I.start)}}if(A.details=C,this.levelLastLoaded=d,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE){var K=Object(T.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),A.details=void 0)}},v._handleFragmentLoadComplete=function(E){var g=E.frag,y=E.payload,C=g.decryptdata,d=this.hls;if(this.fragContextChanged(g))return;if(y&&y.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var _=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),C.key.buffer,C.iv.buffer).then(function(O){var A=performance.now();d.trigger(S.Events.FRAG_DECRYPTED,{frag:g,payload:O,stats:{tstart:_,tdecrypt:A}})})}},v.doTick=function(){if(!this.media){this.state=u.State.IDLE;return}if(this.state===u.State.IDLE){var E,g=this.currentTrackId,y=this.levels;if(!y.length||!y[g]||!y[g].details)return;var C=y[g].details,d=C.targetduration,_=this.config,O=this.media,A=x.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,O.currentTime-d,_.maxBufferHole),P=A.end,I=A.len,W=this.getMaxBufferLength()+d;if(I>W)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var K=C.fragments,te=K.length,H=C.edge,G,V=this.fragPrevious;if(P-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)},h.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},h.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 t=i(this.media.textTracks);t.forEach(function(n){Object(D.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(t,n){this.tracks=n.subtitleTracks},h.onSubtitleTrackLoaded=function(t,n){var c=n.id,m=n.details,v=this.trackId,b=this.tracksInGroup[v];if(!b){this.warn("Invalid subtitle track id "+c);return}var E=b.details;b.details=n.details,this.log("subtitle track "+c+" loaded ["+m.startSN+"-"+m.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,n,E))},h.onLevelLoading=function(t,n){this.switchLevel(n.level)},h.onLevelSwitching=function(t,n){this.switchLevel(n.level)},h.switchLevel=function(t){var n=this.hls.levels[t];if(!(n!=null&&n.textGroupIds))return;var c=n.textGroupIds[n.urlId];if(this.groupId!==c){var m=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(g){return!c||g.groupId===c});this.tracksInGroup=v;var b=this.findTrackId(m==null?void 0:m.name)||this.findTrackId();this.groupId=c;var E={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(S.Events.SUBTITLE_TRACKS_UPDATED,E),b!==-1&&this.setSubtitleTrack(b,m)}},h.findTrackId=function(t){for(var n=this.tracksInGroup,c=0;c=m.length)return;this.clearTimer();var v=m[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,v){var b=v.id,E=v.groupId,g=E===void 0?"":E,y=v.name,C=v.type,d=v.url;this.hls.trigger(S.Events.SUBTITLE_TRACK_SWITCH,{id:b,groupId:g,name:y,type:C,url:d});var _=this.switchParams(v.url,n==null?void 0:n.details);this.loadPlaylist(_)}else this.hls.trigger(S.Events.SUBTITLE_TRACK_SWITCH,{id:t})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,n=i(this.media.textTracks),c=0;c=0&&(C[0]=Math.min(C[0],m),C[1]=Math.max(C[1],v),g=!0,d/(v-m)>.5))return}if(g||E.push([m,v]),this.config.renderTextTracksNatively){var _=this.captionsTracks[c];this.Cues.newCue(_,m,v,b)}else{var O=this.Cues.newCue(null,m,v,b);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:O,track:c})}},t.onInitPtsFound=function(c,m){var v=this,b=m.frag,E=m.id,g=m.initPTS,y=m.timescale,C=this.unparsedVttFrags;E==="main"&&(this.initPTS[b.cc]=g,this.timescale[b.cc]=y),C.length&&(this.unparsedVttFrags=[],C.forEach(function(d){v.onFragLoaded(D.Events.FRAG_LOADED,d)}))},t.getExistingTrack=function(c){var m=this.media;if(m)for(var v=0;v>>8^y&255^99,p[b]=y,u[y]=b;var C=v[b],d=v[C],_=v[d],O=v[y]*257^y*16843008;i[b]=O<<24|O>>>8,l[b]=O<<16|O>>>16,s[b]=O<<8|O>>>24,h[b]=O,O=_*16843009^d*65537^C*257^b*16843008,t[y]=O<<24|O>>>8,n[y]=O<<16|O>>>16,c[y]=O<<8|O>>>24,m[y]=O,b?(b=C^v[v[v[_^C]]],E^=v[v[E]]):b=E=1}},w.expandKey=function(p){for(var u=this.uint8ArrayToUint32Array_(p),o=!0,i=0;i>>6)+1;var O=(c[m+2]&60)>>>2;if(O>_.length-1){n.trigger(x.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+O});return}return g=(c[m+2]&1)<<2,g|=(c[m+3]&192)>>>6,S.logger.log("manifest codec:"+v+", ADTS type:"+b+", samplingIndex:"+O),/firefox/i.test(C)?O>=6?(b=5,y=new Array(4),E=O-3):(b=2,y=new Array(2),E=O):C.indexOf("android")!==-1?(b=2,y=new Array(2),E=O):(b=5,y=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&O>=6?E=O-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(O>=6&&g===1||/vivaldi/i.test(C))||!v&&g===1)&&(b=2,y=new Array(2)),E=O)),y[0]=b<<3,y[0]|=(O&14)>>1,y[1]|=(O&1)<<7,y[1]|=g<<3,b===5&&(y[1]|=(E&14)>>1,y[2]=(E&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:_[O],channelCount:g,codec:"mp4a.40."+b,manifestCodec:d}}function w(n,c){return n[c]===255&&(n[c+1]&246)===240}function f(n,c){return n[c+1]&1?7:9}function p(n,c){return(n[c+3]&3)<<11|n[c+4]<<3|(n[c+5]&224)>>>5}function u(n,c){return c+5=n.length)return!1;var v=p(n,c);if(v<=m)return!1;var b=c+v;return b===n.length||o(n,b)}return!1}function s(n,c,m,v,b){if(!n.samplerate){var E=T(c,m,v,b);if(!E)return;n.config=E.config,n.samplerate=E.samplerate,n.channelCount=E.channelCount,n.codec=E.codec,n.manifestCodec=E.manifestCodec,S.logger.log("parsed codec:"+n.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function h(n){return 1024*9e4/n}function r(n,c,m,v,b){var E=f(n,c),g=p(n,c);if(g-=E,g>0){var y=m+v*b;return{headerLength:E,frameLength:g,stamp:y}}}function t(n,c,m,v,b){var E=h(n.samplerate),g=r(c,m,v,b,E);if(g){var y=g.frameLength,C=g.headerLength,d=g.stamp,_=C+y,O=Math.max(0,m+_-c.length),A;O?(A=new Uint8Array(_-C),A.set(c.subarray(m+C,c.length),0)):A=c.subarray(m+C,m+_);var P={unit:A,pts:d};return O||n.samples.push(P),{sample:P,length:_,missing:O}}}},"./src/demux/base-audio-demuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"initPTSFn",function(){return p});var S=j("./src/polyfills/number.ts"),D=j("./src/demux/id3.ts"),x=j("./src/demux/dummy-demuxed-track.ts"),T=j("./src/utils/mp4-tools.ts"),w=j("./src/utils/typed-array.ts"),f=function(){function u(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var o=u.prototype;return o.resetInitSegment=function(l,s,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},o.resetTimeStamp=function(){},o.resetContiguity=function(){},o.canParse=function(l,s){return!1},o.appendFrame=function(l,s,h){},o.demux=function(l,s){this.cachedData&&(l=Object(T.appendUint8Array)(this.cachedData,l),this.cachedData=null);var h=D.getID3Data(l,0),r=h?h.length:0,t,n,c=this._audioTrack,m=this._id3Track,v=h?D.getTimeStamp(h):void 0,b=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(v,s)),h&&h.length>0&&m.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),n=this.initPTS;rf?(this.word<<=f,this.bitsAvailable-=f):(f-=this.bitsAvailable,p=f>>3,f-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=f,this.bitsAvailable-=f)},T.readBits=function(f){var p=Math.min(this.bitsAvailable,f),u=this.word>>>32-p;return f>32&&S.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0?this.word<<=p:this.bytesAvailable>0&&this.loadWord(),p=f-p,p>0&&this.bitsAvailable?u<>>f)!==0)return this.word<<=f,this.bitsAvailable-=f,f;return this.loadWord(),f+this.skipLZ()},T.skipUEG=function(){this.skipBits(1+this.skipLZ())},T.skipEG=function(){this.skipBits(1+this.skipLZ())},T.readUEG=function(){var f=this.skipLZ();return this.readBits(f+1)-1},T.readEG=function(){var f=this.readUEG();return 1&f?1+f>>>1:-1*(f>>>1)},T.readBoolean=function(){return this.readBits(1)===1},T.readUByte=function(){return this.readBits(8)},T.readUShort=function(){return this.readBits(16)},T.readUInt=function(){return this.readBits(32)},T.skipScalingList=function(f){for(var p=8,u=8,o,i=0;i0?b.subarray(g,g+y):void 0},T=function(b,E){var g=0;return g=(b[E]&127)<<21,g|=(b[E+1]&127)<<14,g|=(b[E+2]&127)<<7,g|=b[E+3]&127,g},w=function(b,E){return S(b,E)&&T(b,E+6)+10<=b.length-E},f=function(b){for(var E=o(b),g=0;g>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(_);break;case 12:case 13:O=b[I++],P+=String.fromCharCode((_&31)<<6|O&63);break;case 14:O=b[I++],A=b[I++],P+=String.fromCharCode((_&15)<<12|(O&63)<<6|(A&63)<<0);break;default:}}return P},n={decodeTextFrame:s},c;function m(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/demux/base-audio-demuxer.ts"),D=j("./src/demux/id3.ts"),x=j("./src/utils/logger.ts"),T=j("./src/demux/mpegaudio.ts");function w(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,f(u,o)}function f(u,o){return f=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},f(u,o)}var p=function(u){w(o,u);function o(){return u.apply(this,arguments)||this}var i=o.prototype;return i.resetInitSegment=function(s,h,r){u.prototype.resetInitSegment.call(this,s,h,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:r,inputTimeScale:9e4,dropped:0}},o.probe=function(s){if(!s)return!1;for(var h=D.getID3Data(s,0)||[],r=h.length,t=s.length;r0},w.demux=function(p){var u=p,o=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(u=Object(S.appendUint8Array)(this.remainderData,p));var i=Object(S.segmentValidRange)(u);this.remainderData=i.remainder,o.samples=i.valid||new Uint8Array}else o.samples=u;return{audioTrack:Object(D.dummyTrack)(),avcTrack:o,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},w.flush=function(){var p=Object(D.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:p,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},w.demuxSampleAes=function(p,u,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},w.destroy=function(){},T}();x.minProbeByteLength=1024,Q.default=x},"./src/demux/mpegaudio.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"appendFrame",function(){return f}),j.d(Q,"parseHeader",function(){return p}),j.d(Q,"isHeaderPattern",function(){return u}),j.d(Q,"isHeader",function(){return o}),j.d(Q,"canParse",function(){return i}),j.d(Q,"probe",function(){return l});var S=null,D=[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],x=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],T=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function f(s,h,r,t,n){if(r+24>h.length)return;var c=p(h,r);if(c&&r+c.frameLength<=h.length){var m=c.samplesPerFrame*9e4/c.sampleRate,v=t+n*m,b={unit:h.subarray(r,r+c.frameLength),pts:v,dts:v};return s.config=[],s.channelCount=c.channelCount,s.samplerate=c.sampleRate,s.samples.push(b),{sample:b,length:c.frameLength,missing:0}}}function p(s,h){var r=s[h+1]>>3&3,t=s[h+1]>>1&3,n=s[h+2]>>4&15,c=s[h+2]>>2&3;if(r!==1&&n!==0&&n!==15&&c!==3){var m=s[h+2]>>1&1,v=s[h+3]>>6,b=r===3?3-t:t===3?3:4,E=D[b*14+n-1]*1e3,g=r===3?0:r===2?1:2,y=x[g*3+c],C=v===3?1:2,d=T[r][t],_=w[t],O=d*8*_,A=Math.floor(d*E/y+m)*_;if(S===null){var P=navigator.userAgent||"",I=P.match(/Chrome\/(\d+)/i);S=I?parseInt(I[1]):0}var W=!!S&&S<=87;return W&&t===2&&E>=224e3&&v===0&&(s[h+3]=s[h+3]|128),{sampleRate:y,channelCount:C,frameLength:A,samplesPerFrame:O}}}function u(s,h){return s[h]===255&&(s[h+1]&224)===224&&(s[h+1]&6)!==0}function o(s,h){return h+1=p.length){o();return}if(p[u].unit.length<32)continue;var i=this.decrypter.isSync();if(this.decryptAacSample(p,u,o,i),!i)return}},w.getAvcEncryptedData=function(p){for(var u=Math.floor((p.length-48)/160)*16+16,o=new Int8Array(u),i=0,l=32;l<=p.length-16;l+=160,i+=16)o.set(p.subarray(l,l+16),i);return o},w.getAvcDecryptedUnit=function(p,u){for(var o=new Uint8Array(u),i=0,l=32;l<=p.length-16;l+=160,i+=16)p.set(o.subarray(i,i+16),l);return p},w.decryptAvcSample=function(p,u,o,i,l,s){var h=Object(D.discardEPB)(l.data),r=this.getAvcEncryptedData(h),t=this;this.decryptBuffer(r.buffer,function(n){l.data=t.getAvcDecryptedUnit(h,n),s||t.decryptAvcSamples(p,u,o+1,i)})},w.decryptAvcSamples=function(p,u,o,i){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;u++,o=0){if(u>=p.length){i();return}for(var l=p[u].units;!(o>=l.length);o++){var s=l[o];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(p,u,o,i,s,h),!h)return}}},T}();Q.default=x},"./src/demux/transmuxer-interface.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l});var S=j("./node_modules/webworkify-webpack/index.js"),D=j.n(S),x=j("./src/events.ts"),T=j("./src/demux/transmuxer.ts"),w=j("./src/utils/logger.ts"),f=j("./src/errors.ts"),p=j("./src/utils/mediasource-helper.ts"),u=j("./node_modules/eventemitter3/index.js"),o=j.n(u),i=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function s(r,t,n,c){var m=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=r,this.id=t,this.onTransmuxComplete=n,this.onFlush=c;var v=r.config,b=function(d,_){_=_||{},_.frag=m.frag,_.id=m.id,r.trigger(d,_)};this.observer=new u.EventEmitter,this.observer.on(x.Events.FRAG_DECRYPTED,b),this.observer.on(x.Events.ERROR,b);var E={mp4:i.isTypeSupported("video/mp4"),mpeg:i.isTypeSupported("audio/mpeg"),mp3:i.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){w.logger.log("demuxing in webworker");var y;try{y=this.worker=S("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(C){r.trigger(x.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},y.postMessage({cmd:"init",typeSupported:E,vendor:g,id:t,config:JSON.stringify(v)})}catch(C){w.logger.warn("Error in worker:",C),w.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new T.default(this.observer,E,v,g,t),this.worker=null}}else this.transmuxer=new T.default(this.observer,E,v,g,t)}var h=s.prototype;return h.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},h.push=function(t,n,c,m,v,b,E,g,y,C){var d=this;y.transmuxing.start=self.performance.now();var _=this.transmuxer,O=this.worker,A=b?b.start:v.start,P=v.decryptdata,I=this.frag,W=!(I&&v.cc===I.cc),K=!(I&&y.level===I.level),te=I?y.sn-I.sn:-1,H=this.part?y.part-this.part.index:1,G=!K&&(te===1||te===0&&H===1),V=self.performance.now();(K||te||v.stats.parsing.start===0)&&(v.stats.parsing.start=V),b&&(H||!G)&&(b.stats.parsing.start=V);var re=new T.TransmuxState(W,G,g,K,A);if(!G||W){w.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+` discontinuity: `+W+` trackSwitch: `+K+` contiguous: `+G+` accurateTimeOffset: `+g+` timeOffset: `+A);var $=new T.TransmuxConfig(c,m,n,E,C);this.configureTransmuxer($)}if(this.frag=v,this.part=b,O)O.postMessage({cmd:"demux",data:t,decryptdata:P,chunkMeta:y,state:re},t instanceof ArrayBuffer?[t]:[]);else if(_){var ne=_.push(t,P,y,re);Object(T.isPromise)(ne)?ne.then(function(he){d.handleTransmuxComplete(he)}):this.handleTransmuxComplete(ne)}},h.flush=function(t){var n=this;t.transmuxing.start=self.performance.now();var c=this.transmuxer,m=this.worker;if(m)m.postMessage({cmd:"flush",chunkMeta:t});else if(c){var v=c.flush(t);Object(T.isPromise)(v)?v.then(function(b){n.handleFlushResult(b,t)}):this.handleFlushResult(v,t)}},h.handleFlushResult=function(t,n){var c=this;t.forEach(function(m){c.handleTransmuxComplete(m)}),this.onFlush(n)},h.onWorkerMessage=function(t){var n=t.data,c=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,c.trigger(n.event,n.data);break}}},h.configureTransmuxer=function(t){var n=this.worker,c=this.transmuxer;n?n.postMessage({cmd:"configure",config:t}):c&&c.configure(t)},h.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},s}()},"./src/demux/transmuxer-worker.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return f});var S=j("./src/demux/transmuxer.ts"),D=j("./src/events.ts"),x=j("./src/utils/logger.ts"),T=j("./node_modules/eventemitter3/index.js"),w=j.n(T);function f(l){var s=new T.EventEmitter,h=function(t,n){l.postMessage({event:t,data:n})};s.on(D.Events.FRAG_DECRYPTED,h),s.on(D.Events.ERROR,h),l.addEventListener("message",function(r){var t=r.data;switch(t.cmd){case"init":{var n=JSON.parse(t.config);l.transmuxer=new S.default(s,t.typeSupported,n,t.vendor,t.id),Object(x.enableLogs)(n.debug),h("init",null);break}case"configure":{l.transmuxer.configure(t.config);break}case"demux":{var c=l.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(S.isPromise)(c)?c.then(function(b){p(l,b)}):p(l,c);break}case"flush":{var m=t.chunkMeta,v=l.transmuxer.flush(m);Object(S.isPromise)(v)?v.then(function(b){o(l,b,m)}):o(l,v,m);break}default:break}})}function p(l,s){if(i(s.remuxResult))return;var h=[],r=s.remuxResult,t=r.audio,n=r.video;t&&u(h,t),n&&u(h,n),l.postMessage({event:"transmuxComplete",data:s},h)}function u(l,s){s.data1&&l.push(s.data1.buffer),s.data2&&l.push(s.data2.buffer)}function o(l,s,h){s.forEach(function(r){p(l,r)}),l.postMessage({event:"flush",data:h})}function i(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return n}),j.d(Q,"isPromise",function(){return v}),j.d(Q,"TransmuxConfig",function(){return b}),j.d(Q,"TransmuxState",function(){return E});var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/crypt/decrypter.ts"),T=j("./src/demux/aacdemuxer.ts"),w=j("./src/demux/mp4demuxer.ts"),f=j("./src/demux/tsdemuxer.ts"),p=j("./src/demux/mp3demuxer.ts"),u=j("./src/remux/mp4-remuxer.ts"),o=j("./src/remux/passthrough-remuxer.ts"),i=j("./src/demux/chunk-cache.ts"),l=j("./src/utils/mp4-tools.ts"),s=j("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(g){s.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var r=[{demux:f.default,remux:u.default},{demux:w.default,remux:o.default},{demux:T.default,remux:u.default},{demux:p.default,remux:u.default}],t=1024;r.forEach(function(g){var y=g.demux;t=Math.max(t,y.minProbeByteLength)});var n=function(){function g(C,d,_,O,A){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 i.default,this.observer=C,this.typeSupported=d,this.config=_,this.vendor=O,this.id=A}var y=g.prototype;return y.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},y.push=function(d,_,O,A){var P=this,I=O.transmuxing;I.executeStart=h();var W=new Uint8Array(d),K=this.cache,te=this.config,H=this.currentTransmuxState,G=this.transmuxConfig;A&&(this.currentTransmuxState=A);var V=c(W,_);if(V&&V.method==="AES-128"){var re=this.getDecrypter();if(te.enableSoftwareAES){var $=re.softwareDecrypt(W,V.key.buffer,V.iv.buffer);if(!$)return I.executeEnd=h(),m(O);W=new Uint8Array($)}else return this.decryptionPromise=re.webCryptoDecrypt(W,V.key.buffer,V.iv.buffer).then(function(Oe){var Ie=P.push(Oe,null,O);return P.decryptionPromise=null,Ie}),this.decryptionPromise}var ne=A||H,he=ne.contiguous,pe=ne.discontinuity,Te=ne.trackSwitch,we=ne.accurateTimeOffset,Me=ne.timeOffset,Ee=G.audioCodec,xe=G.videoCodec,Ge=G.defaultInitPts,je=G.duration,We=G.initSegmentData;if((pe||Te)&&this.resetInitSegment(We,Ee,xe,je),pe&&this.resetInitialTimestamp(Ge),he||this.resetContiguity(),this.needsProbing(W,pe,Te)){if(K.dataLength){var ze=K.flush();W=Object(l.appendUint8Array)(ze,W)}this.configureTransmuxer(W,G)}var de=this.transmux(W,V,Me,we,O),le=this.currentTransmuxState;return le.contiguous=!0,le.discontinuity=!1,le.trackSwitch=!1,I.executeEnd=h(),de},y.flush=function(d){var _=this,O=d.transmuxing;O.executeStart=h();var A=this.decrypter,P=this.cache,I=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return _.flush(d)});var K=[],te=I.timeOffset;if(A){var H=A.flush();H&&K.push(this.push(H,null,d))}var G=P.dataLength;P.reset();var V=this.demuxer,re=this.remuxer;if(!V||!re)return G>=t&&this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),O.executeEnd=h(),[m(d)];var $=V.flush(te);return v($)?$.then(function(ne){return _.flushRemux(K,ne,d),K}):(this.flushRemux(K,$,d),K)},y.flushRemux=function(d,_,O){var A=_.audioTrack,P=_.avcTrack,I=_.id3Track,W=_.textTrack,K=this.currentTransmuxState,te=K.accurateTimeOffset,H=K.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+O.sn+(O.part>-1?" p: "+O.part:"")+" of level "+O.level);var G=this.remuxer.remux(A,P,I,W,H,te,!0,this.id);d.push({remuxResult:G,chunkMeta:O}),O.transmuxing.executeEnd=h()},y.resetInitialTimestamp=function(d){var _=this.demuxer,O=this.remuxer;if(!_||!O)return;_.resetTimeStamp(d),O.resetTimeStamp(d)},y.resetContiguity=function(){var d=this.demuxer,_=this.remuxer;if(!d||!_)return;d.resetContiguity(),_.resetNextTimestamp()},y.resetInitSegment=function(d,_,O,A){var P=this.demuxer,I=this.remuxer;if(!P||!I)return;P.resetInitSegment(_,O,A),I.resetInitSegment(d,_,O)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(d,_,O,A,P){var I;return _&&_.method==="SAMPLE-AES"?I=this.transmuxSampleAes(d,_,O,A,P):I=this.transmuxUnencrypted(d,O,A,P),I},y.transmuxUnencrypted=function(d,_,O,A){var P=this.demuxer.demux(d,_,!1,!this.config.progressive),I=P.audioTrack,W=P.avcTrack,K=P.id3Track,te=P.textTrack,H=this.remuxer.remux(I,W,K,te,_,O,!1,this.id);return{remuxResult:H,chunkMeta:A}},y.transmuxSampleAes=function(d,_,O,A,P){var I=this;return this.demuxer.demuxSampleAes(d,_,O).then(function(W){var K=I.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,O,A,!1,I.id);return{remuxResult:K,chunkMeta:P}})},y.configureTransmuxer=function(d,_){for(var O=this.config,A=this.observer,P=this.typeSupported,I=this.vendor,W=_.audioCodec,K=_.defaultInitPts,te=_.duration,H=_.initSegmentData,G=_.videoCodec,V,re=0,$=r.length;re<$;re++)if(r[re].demux.probe(d)){V=r[re];break}V||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:w.default,remux:o.default});var ne=this.demuxer,he=this.remuxer,pe=V.remux,Te=V.demux;(!he||!(he instanceof pe))&&(this.remuxer=new pe(A,O,P,I)),(!ne||!(ne instanceof Te))&&(this.demuxer=new Te(A,O,P),this.probe=Te.probe),this.resetInitSegment(H,W,G,te),this.resetInitialTimestamp(K)},y.needsProbing=function(d,_,O){return!this.demuxer||!this.remuxer||_||O},y.getDecrypter=function(){var d=this.decrypter;return d||(d=this.decrypter=new x.default(this.observer,this.config)),d},g}();function c(g,y){var C=null;return g.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(C=y),C}var m=function(y){return{remuxResult:{},chunkMeta:y}};function v(g){return"then"in g&&g.then instanceof Function}var b=function(y,C,d,_,O){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=C,this.initSegmentData=d,this.duration=_,this.defaultInitPts=O},E=function(y,C,d,_,O){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=C,this.accurateTimeOffset=d,this.trackSwitch=_,this.timeOffset=O}},"./src/demux/tsdemuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"discardEPB",function(){return m});var S=j("./src/demux/adts.ts"),D=j("./src/demux/mpegaudio.ts"),x=j("./src/demux/exp-golomb.ts"),T=j("./src/demux/id3.ts"),w=j("./src/demux/sample-aes.ts"),f=j("./src/events.ts"),p=j("./src/utils/mp4-tools.ts"),u=j("./src/utils/logger.ts"),o=j("./src/errors.ts"),i={video:1,audio:2,id3:3,text:4},l=function(){function v(E,g,y){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=E,this.config=g,this.typeSupported=y}v.probe=function(g){var y=v.syncOffset(g);return y<0?!1:(y&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},v.syncOffset=function(g){for(var y=Math.min(1e3,g.length-3*188),C=0;C>4,Ee=void 0;if(Me>1){if(Ee=pe+5+g[pe+4],Ee===pe+188)continue}else Ee=pe+4;switch(we){case I:Te&&(W&&(_=t(W))&&this.parseAVCPES(_,!1),W={data:[],size:0}),W&&(W.data.push(g.subarray(Ee,pe+188)),W.size+=pe+188-Ee);break;case K:Te&&(H&&(_=t(H))&&(A.isAAC?this.parseAACPES(_):this.parseMPEGPES(_)),H={data:[],size:0}),H&&(H.data.push(g.subarray(Ee,pe+188)),H.size+=pe+188-Ee);break;case te:Te&&(G&&(_=t(G))&&this.parseID3PES(_),G={data:[],size:0}),G&&(G.data.push(g.subarray(Ee,pe+188)),G.size+=pe+188-Ee);break;case 0:Te&&(Ee+=g[Ee]+1),$=this._pmtId=h(g,Ee);break;case $:{Te&&(Ee+=g[Ee]+1);var xe=r(g,Ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);I=xe.avc,I>0&&(O.pid=I),K=xe.audio,K>0&&(A.pid=K,A.isAAC=xe.isAAC),te=xe.id3,te>0&&(P.pid=te),V&&!re&&(u.logger.log("reparse from beginning"),V=!1,pe=he-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(f.Events.ERROR,f.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});O.pesData=W,A.pesData=H,P.pesData=G;var Ge={audioTrack:A,avcTrack:O,id3Track:P,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(Ge),Ge},b.flush=function(){var g=this.remainderData;this.remainderData=null;var y;return g?y=this.demux(g,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},b.extractRemainingSamples=function(g){var y=g.audioTrack,C=g.avcTrack,d=g.id3Track,_=C.pesData,O=y.pesData,A=d.pesData,P;_&&(P=t(_))?(this.parseAVCPES(P,!0),C.pesData=null):C.pesData=_,O&&(P=t(O))?(y.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),y.pesData=null):(O!=null&&O.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=O),A&&(P=t(A))?(this.parseID3PES(P),d.pesData=null):d.pesData=A},b.demuxSampleAes=function(g,y,C){var d=this.demux(g,C,!0,!this.config.progressive),_=this.sampleAes=new w.default(this.observer,this.config,y);return this.decrypt(d,_)},b.decrypt=function(g,y){return new Promise(function(C){var d=g.audioTrack,_=g.avcTrack;d.samples&&d.isAAC?y.decryptAacSamples(d.samples,0,function(){_.samples?y.decryptAvcSamples(_.samples,0,0,function(){C(g)}):C(g)}):_.samples&&y.decryptAvcSamples(_.samples,0,0,function(){C(g)})})},b.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},b.parseAVCPES=function(g,y){var C=this,d=this._avcTrack,_=this.parseAVCNALu(g.data),O=!1,A=this.avcSample,P,I=!1;g.data=null,A&&_.length&&!d.audFound&&(n(A,d),A=this.avcSample=s(!1,g.pts,g.dts,"")),_.forEach(function(W){switch(W.type){case 1:{P=!0,A||(A=C.avcSample=s(!0,g.pts,g.dts,"")),O&&(A.debug+="NDR "),A.frame=!0;var K=W.data;if(I&&K.length>4){var te=new x.default(K).readSliceType();(te===2||te===4||te===7||te===9)&&(A.key=!0)}break}case 5:P=!0,A||(A=C.avcSample=s(!0,g.pts,g.dts,"")),O&&(A.debug+="IDR "),A.key=!0,A.frame=!0;break;case 6:{P=!0,O&&A&&(A.debug+="SEI ");var H=new x.default(m(W.data));H.readUByte();for(var G=0,V=0,re=!1,$=0;!re&&H.bytesAvailable>1;){G=0;do $=H.readUByte(),G+=$;while($===255);V=0;do $=H.readUByte(),V+=$;while($===255);if(G===4&&H.bytesAvailable!==0){re=!0;var ne=H.readUByte();if(ne===181){var he=H.readUShort();if(he===49){var pe=H.readUInt();if(pe===1195456820){var Te=H.readUByte();if(Te===3){for(var we=H.readUByte(),Me=H.readUByte(),Ee=31&we,xe=[we,Me],Ge=0;Ge16){for(var je=[],We=0;We<16;We++)je.push(H.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&je.push("-");for(var ze=V-16,de=new Uint8Array(ze),le=0;le=0){var H={data:g.subarray(K,A-d-1),type:te};O.push(H)}else{var G=this.getLastNalUnit();if(G&&(_&&A<=4-_&&(G.state&&(G.data=G.data.subarray(0,G.data.byteLength-_))),I=A-d-1,I>0)){var V=new Uint8Array(G.data.byteLength+I);V.set(G.data,0),V.set(g.subarray(0,I),G.data.byteLength),G.data=V,G.state=0}}A=0&&d>=0){var re={data:g.subarray(K,y),type:te,state:d};O.push(re)}if(O.length===0){var $=this.getLastNalUnit();if($){var ne=new Uint8Array($.data.byteLength+g.byteLength);ne.set($.data,0),ne.set(g,$.data.byteLength),$.data=ne}}return C.naluState=d,O},b.parseAACPES=function(g){var y=0,C=this._audioTrack,d=this.aacOverFlow,_=g.data;if(d){this.aacOverFlow=null;var O=d.sample.unit.byteLength,A=Math.min(d.missing,O),P=O-A;d.sample.unit.set(_.subarray(0,A),P),C.samples.push(d.sample),y=d.missing}var I,W;for(I=y,W=_.length;I1;){var O=new Uint8Array(_[0].length+_[1].length);O.set(_[0]),O.set(_[1],_[0].length),_[0]=O,_.splice(1,1)}E=_[0];var A=(E[0]<<16)+(E[1]<<8)+E[2];if(A===1){if(g=(E[4]<<8)+E[5],g&&g>v.size-6)return null;var P=E[7];P&192&&(C=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,P&64?(d=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,C-d>60*9e4&&(u.logger.warn(Math.round((C-d)/9e4)+"s delta between PTS and DTS, align them"),C=d)):d=C),y=E[8];var I=y+9;if(v.size<=I)return null;v.size-=I;for(var W=new Uint8Array(v.size),K=0,te=_.length;KH){I-=H;continue}else E=E.subarray(I),H-=I,I=0;W.set(E,b),b+=H}return g&&(g-=y+3),{data:W,pts:C,dts:d,len:g}}return null}function n(v,b){if(v.units.length&&v.frame){if(v.pts===void 0){var E=b.samples,g=E.length;if(g){var y=E[g-1];v.pts=y.pts,v.dts=y.dts}else{b.dropped++;return}}b.samples.push(v)}v.debug.length&&u.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function c(v,b){var E=v.length;if(E>0){if(b.pts>=v[E-1].pts)v.push(b);else for(var g=E-1;g>=0;g--)if(b.ptsC)return _;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,C=this.autoLevelCapping,d;return C===-1&&y&&y.length?d=y.length-1:d=C,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var C=this.audioTrackController;C&&(C.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var C=this.subtitleTrackController;C&&(C.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var C=this.subtitleTrackController;C&&(C.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{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 t.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return b.defaultConfig?b.defaultConfig:s.hlsDefaultConfig},set:function(y){b.defaultConfig=y}}]),b}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"isSupported",function(){return x}),j.d(Q,"changeTypeSupported",function(){return T});var S=j("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function x(){var w=Object(S.getMediaSource)();if(!w)return!1;var f=D(),p=w&&typeof w.isTypeSupported=="function"&&w.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),u=!f||f.prototype&&typeof f.prototype.appendBuffer=="function"&&typeof f.prototype.remove=="function";return!!p&&!!u}function T(){var w,f=D();return typeof(f==null||((w=f.prototype)===null||w===void 0)?void 0:w.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return l}),j.d(Q,"LoadError",function(){return h});var S=j("./src/polyfills/number.ts"),D=j("./src/errors.ts");function x(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,u(r,t)}function T(r){var t=typeof Map=="function"?new Map:void 0;return T=function(c){if(c===null||!p(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(c))return t.get(c);t.set(c,m)}function m(){return w(c,arguments,o(this).constructor)}return m.prototype=Object.create(c.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),u(m,c)},T(r)}function w(r,t,n){return f()?w=Reflect.construct:w=function(m,v,b){var E=[null];E.push.apply(E,v);var g=Function.bind.apply(m,E),y=new g;return b&&u(y,b.prototype),y},w.apply(null,arguments)}function f(){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(r){return!1}}function p(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function u(r,t){return u=Object.setPrototypeOf||function(c,m){return c.__proto__=m,c},u(r,t)}function o(r){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},o(r)}var i=Math.pow(2,17),l=function(){function r(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var t=r.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(c,m){var v=this,b=c.url;if(!b)return Promise.reject(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(b?"part list":"url")));this.abort();var E=this.config,g=E.fLoader,y=E.loader;return new Promise(function(C,d){v.loader&&v.loader.destroy();var _=v.loader=c.loader=g?new g(E):new y(E),O=s(c),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:i};c.stats=_.stats,_.load(O,A,{onSuccess:function(I,W,K,te){v.resetLoader(c,_),C({frag:c,part:null,payload:I.data,networkDetails:te})},onError:function(I,W,K){v.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:I,networkDetails:K}))},onAbort:function(I,W,K){v.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:K}))},onTimeout:function(I,W,K){v.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:K}))},onProgress:function(I,W,K,te){m&&m({frag:c,part:null,payload:K,networkDetails:te})}})})},t.loadPart=function(c,m,v){var b=this;this.abort();var E=this.config,g=E.fLoader,y=E.loader;return new Promise(function(C,d){b.loader&&b.loader.destroy();var _=b.loader=c.loader=g?new g(E):new y(E),O=s(c,m),A={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:i};m.stats=_.stats,_.load(O,A,{onSuccess:function(I,W,K,te){b.resetLoader(c,_),b.updateStatsFromPart(c,m);var H={frag:c,part:m,payload:I.data,networkDetails:te};v(H),C(H)},onError:function(I,W,K){b.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:m,response:I,networkDetails:K}))},onAbort:function(I,W,K){c.stats.aborted=m.stats.aborted,b.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:m,networkDetails:K}))},onTimeout:function(I,W,K){b.resetLoader(c,_),d(new h({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:m,networkDetails:K}))}})})},t.updateStatsFromPart=function(c,m){var v=c.stats,b=m.stats,E=b.total;if(v.loaded+=b.loaded,E){var g=Math.round(c.duration/m.duration),y=Math.min(Math.round(v.loaded/E),g),C=g-y,d=C*Math.round(v.loaded/y);v.total=v.loaded+d}else v.total=Math.max(v.loaded,v.total);var _=v.loading,O=b.loading;_.start?_.first+=O.first-O.start:(_.start=O.start,_.first=O.first),_.end=O.end},t.resetLoader=function(c,m){c.loader=null,this.loader===m&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),m.destroy()},r}();function s(r,t){t===void 0&&(t=null);var n=t||r,c={frag:r,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},m=n.byteRangeStartOffset,v=n.byteRangeEndOffset;return Object(S.isFiniteNumber)(m)&&Object(S.isFiniteNumber)(v)&&(c.rangeStart=m,c.rangeEnd=v),c}var h=function(r){x(t,r);function t(n){for(var c,m=arguments.length,v=new Array(m>1?m-1:0),b=1;b>8*(15-E)&255;return b},c.setDecryptDataFromLevelKey=function(v,b){var E=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(E=w.LevelKey.fromURI(v.uri),E.method=v.method,E.iv=this.createInitializationVector(b),E.keyFormat="identity"),E},c.setElementaryStreamInfo=function(v,b,E,g,y,C){C===void 0&&(C=!1);var d=this.elementaryStreams,_=d[v];if(!_){d[v]={startPTS:b,endPTS:E,startDTS:g,endDTS:y,partial:C};return}_.startPTS=Math.min(_.startPTS,b),_.endPTS=Math.max(_.endPTS,E),_.startDTS=Math.min(_.startDTS,g),_.endDTS=Math.max(_.endDTS,y)},c.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[l.AUDIO]=null,v[l.VIDEO]=null,v[l.AUDIOVIDEO]=null},i(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&T.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(S.isFiniteNumber)(this.programDateTime))return null;var v=Object(S.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),n}(s),r=function(t){p(n,t);function n(c,m,v,b,E){var g;g=t.call(this,v)||this,g.fragOffset=0,g.duration=0,g.gap=!1,g.independent=!1,g.relurl=void 0,g.fragment=void 0,g.index=void 0,g.stats=new f.LoadStats,g.duration=c.decimalFloatingPoint("DURATION"),g.gap=c.bool("GAP"),g.independent=c.bool("INDEPENDENT"),g.relurl=c.enumeratedString("URI"),g.fragment=m,g.index=b;var y=c.enumeratedString("BYTERANGE");return y&&g.setByteRange(y,E),E&&(g.fragOffset=E.fragOffset+E.duration),g}return i(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var m=this.elementaryStreams;return!!(m.audio||m.video||m.audiovideo)}}]),n}(s)},"./src/loader/key-loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return T});var S=j("./src/events.ts"),D=j("./src/errors.ts"),x=j("./src/utils/logger.ts"),T=function(){function w(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var f=w.prototype;return f._registerListeners=function(){this.hls.on(S.Events.KEY_LOADING,this.onKeyLoading,this)},f._unregisterListeners=function(){this.hls.off(S.Events.KEY_LOADING,this.onKeyLoading)},f.destroy=function(){this._unregisterListeners();for(var u in this.loaders){var o=this.loaders[u];o&&o.destroy()}this.loaders={}},f.onKeyLoading=function(u,o){var i=o.frag,l=i.type,s=this.loaders[l];if(!i.decryptdata){x.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=i.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(s&&(x.logger.warn("abort previous key loader for type:"+l),s.abort()),!h){x.logger.warn("key uri is falsy");return}var t=r.loader,n=i.loader=this.loaders[l]=new t(r);this.decrypturl=h,this.decryptkey=null;var c={url:h,frag:i,responseType:"arraybuffer"},m={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(c,m,v)}else this.decryptkey&&(i.decryptdata.key=this.decryptkey,this.hls.trigger(S.Events.KEY_LOADED,{frag:i}))},f.loadsuccess=function(u,o,i){var l=i.frag;if(!l.decryptdata){x.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(u.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(S.Events.KEY_LOADED,{frag:l})},f.loaderror=function(u,o){var i=o.frag,l=i.loader;l&&l.abort(),delete this.loaders[i.type],this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:i,response:u})},f.loadtimeout=function(u,o){var i=o.frag,l=i.loader;l&&l.abort(),delete this.loaders[i.type],this.hls.trigger(S.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})},w}()},"./src/loader/level-details.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"LevelDetails",function(){return w});var S=j("./src/polyfills/number.ts");function D(f,p){for(var u=0;uo.endSN||i>0||i===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(o.misses*.6):this.misses=o.misses+1,this.availabilityDelay=o.availabilityDelay},x(f,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(S.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||T}},{key:"drift",get:function(){var o=this.driftEndTime-this.driftStartTime;if(o>0){var i=this.driftEnd-this.driftStart;return i*1e3/o}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var o;return(o=this.fragments)!==null&&o!==void 0&&o.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 o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var o;return(o=this.partList)!==null&&o!==void 0&&o.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),f}()},"./src/loader/level-key.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"LevelKey",function(){return w});var S=j("./node_modules/url-toolkit/src/url-toolkit.js"),D=j.n(S);function x(f,p){for(var u=0;u2){var d=C.shift()+".";return d+=parseInt(C.shift()).toString(16),d+=("000"+parseInt(C.shift()).toString(16)).substr(-4),d}return y},E.resolve=function(y,C){return D.buildAbsoluteURL(C,y,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(y,C){var d=[],_={},O=!1;i.lastIndex=0;for(var A;(A=i.exec(y))!=null;)if(A[1]){var P=new p.AttrList(A[1]),I={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:E.resolve(A[2],C)},W=P.decimalResolution("RESOLUTION");W&&(I.width=W.width,I.height=W.height),c((P.CODECS||"").split(/[ ,]+/).filter(function(te){return te}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=E.convertAVC1ToAVCOTI(I.videoCodec)),d.push(I)}else if(A[3]){var K=new p.AttrList(A[3]);K["DATA-ID"]&&(O=!0,_[K["DATA-ID"]]=K)}return{levels:d,sessionData:O?_:null}},E.parseMasterPlaylistMedia=function(y,C,d,_){_===void 0&&(_=[]);var O,A=[],P=0;for(l.lastIndex=0;(O=l.exec(y))!==null;){var I=new p.AttrList(O[1]);if(I.TYPE===d){var W={attrs:I,bitrate:0,id:P++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:d,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?E.resolve(I.URI,C):""};if(_.length){var K=E.findGroup(_,W.groupId)||_[0];m(W,K,"audioCodec"),m(W,K,"textCodec")}A.push(W)}}return A},E.parseLevelPlaylist=function(y,C,d,_,O){var A=new w.LevelDetails(C),P=A.fragments,I=null,W=0,K=0,te=0,H=0,G=null,V=new T.Fragment(_,C),re,$,ne,he=-1,pe=!1;for(s.lastIndex=0,A.m3u8=y;(re=s.exec(y))!==null;){pe&&(pe=!1,V=new T.Fragment(_,C),V.start=te,V.sn=W,V.cc=H,V.level=d,I&&(V.initSegment=I,V.rawProgramDateTime=I.rawProgramDateTime));var Te=re[1];if(Te){V.duration=parseFloat(Te);var we=(" "+re[2]).slice(1);V.title=we||null,V.tagList.push(we?["INF",Te,we]:["INF",Te])}else if(re[3])Object(S.isFiniteNumber)(V.duration)&&(V.start=te,ne&&(V.levelkey=ne),V.sn=W,V.level=d,V.cc=H,V.urlId=O,P.push(V),V.relurl=(" "+re[3]).slice(1),b(V,G),G=V,te+=V.duration,W++,K=0,pe=!0);else if(re[4]){var Me=(" "+re[4]).slice(1);G?V.setByteRange(Me,G):V.setByteRange(Me)}else if(re[5])V.rawProgramDateTime=(" "+re[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),he===-1&&(he=P.length);else{if(re=re[0].match(h),!re){u.logger.warn("No matches on slow regex match for level playlist!");continue}for($=1;$-1){u.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}else if(q!=="identity")continue;Ie&&(ne=f.LevelKey.fromURL(C,qe),qe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(ne.method=Ie,ne.keyFormat=q,U&&(ne.keyID=U),k&&(ne.keyFormatVersions=k),ne.iv=ee));break}case"START":{var J=new p.AttrList(xe),be=J.decimalFloatingPoint("TIME-OFFSET");Object(S.isFiniteNumber)(be)&&(A.startTimeOffset=be);break}case"MAP":{var ke=new p.AttrList(xe);V.relurl=ke.URI,ke.BYTERANGE&&V.setByteRange(ke.BYTERANGE),V.level=d,V.sn="initSegment",ne&&(V.levelkey=ne),V.initSegment=null,I=V,pe=!0;break}case"SERVER-CONTROL":{var ct=new p.AttrList(xe);A.canBlockReload=ct.bool("CAN-BLOCK-RELOAD"),A.canSkipUntil=ct.optionalFloat("CAN-SKIP-UNTIL",0),A.canSkipDateRanges=A.canSkipUntil>0&&ct.bool("CAN-SKIP-DATERANGES"),A.partHoldBack=ct.optionalFloat("PART-HOLD-BACK",0),A.holdBack=ct.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var He=new p.AttrList(xe);A.partTarget=He.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=A.partList;Be||(Be=A.partList=[]);var Ze=K>0?Be[Be.length-1]:void 0,ht=K++,Qe=new T.Part(new p.AttrList(xe),V,C,ht,Ze);Be.push(Qe),V.duration+=Qe.duration;break}case"PRELOAD-HINT":{var Xe=new p.AttrList(xe);A.preloadHint=Xe;break}case"RENDITION-REPORT":{var Ke=new p.AttrList(xe);A.renditionReports=A.renditionReports||[],A.renditionReports.push(Ke);break}default:u.logger.warn("line parsed but not handled: "+re);break}}}G&&!G.relurl?(P.pop(),te-=G.duration,A.partList&&(A.fragmentHint=G)):A.partList&&(b(V,G),V.cc=H,A.fragmentHint=V);var Fe=P.length,Ue=P[0],_e=P[Fe-1];if(te+=A.skippedSegments*A.targetduration,te>0&&Fe&&_e){A.averagetargetduration=te/Fe;var Ce=_e.sn;A.endSN=Ce!=="initSegment"?Ce:0,Ue&&(A.startCC=Ue.cc,Ue.initSegment||A.fragments.every(function(Ne){return Ne.relurl&&t(Ne.relurl)})&&(u.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new T.Fragment(_,C),V.relurl=_e.relurl,V.level=d,V.sn="initSegment",Ue.initSegment=V,A.needSidxRanges=!0))}else A.endSN=0,A.startCC=0;return A.fragmentHint&&(te+=A.fragmentHint.duration),A.totalduration=te,A.endCC=H,he>0&&v(P,he),A},E}();function c(E,g){["video","audio","text"].forEach(function(y){var C=E.filter(function(_){return Object(o.isCodecType)(_,y)});if(C.length){var d=C.filter(function(_){return _.lastIndexOf("avc1",0)===0||_.lastIndexOf("mp4a",0)===0});g[y+"Codec"]=d.length>0?d[0]:C[0],E=E.filter(function(_){return C.indexOf(_)===-1})}}),g.unknownCodecs=E}function m(E,g,y){var C=g[y];C&&(E[y]=C)}function v(E,g){for(var y=E[g],C=g;C--;){var d=E[C];if(!d)return;d.programDateTime=y.programDateTime-d.duration*1e3,y=d}}function b(E,g){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):g!=null&&g.programDateTime&&(E.programDateTime=g.endProgramDateTime),Object(S.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/polyfills/number.ts"),D=j("./src/events.ts"),x=j("./src/errors.ts"),T=j("./src/utils/logger.ts"),w=j("./src/utils/mp4-tools.ts"),f=j("./src/loader/m3u8-parser.ts"),p=j("./src/types/loader.ts"),u=j("./src/utils/attr-list.ts");function o(s){var h=s.type;switch(h){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function i(s,h){var r=s.url;return(r===void 0||r.indexOf("data:")===0)&&(r=h.url),r}var l=function(){function s(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var h=s.prototype;return h.registerListeners=function(){var t=this.hls;t.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var t=this.hls;t.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(t){var n=this.hls.config,c=n.pLoader,m=n.loader,v=c||m,b=new v(n);return t.loader=b,this.loaders[t.type]=b,b},h.getInternalLoader=function(t){return this.loaders[t.type]},h.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},h.destroyInternalLoaders=function(){for(var t in this.loaders){var n=this.loaders[t];n&&n.destroy(),this.resetInternalLoader(t)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(t,n){var c=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},h.onLevelLoading=function(t,n){var c=n.id,m=n.level,v=n.url,b=n.deliveryDirectives;this.load({id:c,groupId:null,level:m,responseType:"text",type:p.PlaylistContextType.LEVEL,url:v,deliveryDirectives:b})},h.onAudioTrackLoading=function(t,n){var c=n.id,m=n.groupId,v=n.url,b=n.deliveryDirectives;this.load({id:c,groupId:m,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:b})},h.onSubtitleTrackLoading=function(t,n){var c=n.id,m=n.groupId,v=n.url,b=n.deliveryDirectives;this.load({id:c,groupId:m,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:b})},h.load=function(t){var n,c=this.hls.config,m=this.getInternalLoader(t);if(m){var v=m.context;if(v&&v.url===t.url){T.logger.trace("[playlist-loader]: playlist request ongoing");return}T.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),m.abort()}var b,E,g,y;switch(t.type){case p.PlaylistContextType.MANIFEST:b=c.manifestLoadingMaxRetry,E=c.manifestLoadingTimeOut,g=c.manifestLoadingRetryDelay,y=c.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:b=0,E=c.levelLoadingTimeOut;break;default:b=c.levelLoadingMaxRetry,E=c.levelLoadingTimeOut,g=c.levelLoadingRetryDelay,y=c.levelLoadingMaxRetryTimeout;break}if(m=this.createInternalLoader(t),(n=t.deliveryDirectives)!==null&&n!==void 0&&n.part){var C;if(t.type===p.PlaylistContextType.LEVEL&&t.level!==null?C=this.hls.levels[t.level].details:t.type===p.PlaylistContextType.AUDIO_TRACK&&t.id!==null?C=this.hls.audioTracks[t.id].details:t.type===p.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(C=this.hls.subtitleTracks[t.id].details),C){var d=C.partTarget,_=C.targetduration;d&&_&&(E=Math.min(Math.max(d*3,_*.8)*1e3,E))}}var O={timeout:E,maxRetry:b,retryDelay:g,maxRetryDelay:y,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};m.load(t,O,A)},h.loadsuccess=function(t,n,c,m){if(m===void 0&&(m=null),c.isSidxRequest){this.handleSidxRequest(t,c),this.handlePlaylistLoaded(t,n,c,m);return}this.resetInternalLoader(c.type);var v=t.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,c,"no EXTM3U delimiter",m);return}n.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,n,c,m):this.handleMasterPlaylist(t,n,c,m)},h.loaderror=function(t,n,c){c===void 0&&(c=null),this.handleNetworkError(n,c,!1,t)},h.loadtimeout=function(t,n,c){c===void 0&&(c=null),this.handleNetworkError(n,c,!0)},h.handleMasterPlaylist=function(t,n,c,m){var v=this.hls,b=t.data,E=i(t,c),g=f.default.parseMasterPlaylist(b,E),y=g.levels,C=g.sessionData;if(!y.length){this.handleManifestParsingError(t,c,"no level found in manifest",m);return}var d=y.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),_=y.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),O=f.default.parseMasterPlaylistMedia(b,E,"AUDIO",d),A=f.default.parseMasterPlaylistMedia(b,E,"SUBTITLES",_),P=f.default.parseMasterPlaylistMedia(b,E,"CLOSED-CAPTIONS");if(O.length){var I=O.some(function(W){return!W.url});!I&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(T.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),O.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))}v.trigger(D.Events.MANIFEST_LOADED,{levels:y,audioTracks:O,subtitles:A,captions:P,url:E,stats:n,networkDetails:m,sessionData:C})},h.handleTrackOrLevelPlaylist=function(t,n,c,m){var v=this.hls,b=c.id,E=c.level,g=c.type,y=i(t,c),C=Object(S.isFiniteNumber)(b)?b:0,d=Object(S.isFiniteNumber)(E)?E:C,_=o(c),O=f.default.parseLevelPlaylist(t.data,y,d,_,C);if(!O.fragments.length){v.trigger(D.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(g===p.PlaylistContextType.MANIFEST){var A={attrs:new u.AttrList({}),bitrate:0,details:O,name:"",url:y};v.trigger(D.Events.MANIFEST_LOADED,{levels:[A],audioTracks:[],url:y,stats:n,networkDetails:m,sessionData:null})}if(n.parsing.end=performance.now(),O.needSidxRanges){var P,I=(P=O.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:I,isSidxRequest:!0,type:g,level:E,levelDetails:O,id:b,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=O,this.handlePlaylistLoaded(t,n,c,m)},h.handleSidxRequest=function(t,n){var c=Object(w.parseSegmentIndex)(new Uint8Array(t.data));if(!c)return;var m=c.references,v=n.levelDetails;m.forEach(function(b,E){var g=b.info,y=v.fragments[E];y.byteRange.length===0&&y.setByteRange(String(1+g.end-g.start)+"@"+String(g.start)),y.initSegment&&y.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(t,n,c,m){this.hls.trigger(D.Events.ERROR,{type:x.ErrorTypes.NETWORK_ERROR,details:x.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===p.PlaylistContextType.MANIFEST,url:t.url,reason:c,response:t,context:n,networkDetails:m})},h.handleNetworkError=function(t,n,c,m){c===void 0&&(c=!1),T.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var v=x.ErrorDetails.UNKNOWN,b=!1,E=this.getInternalLoader(t);switch(t.type){case p.PlaylistContextType.MANIFEST:v=c?x.ErrorDetails.MANIFEST_LOAD_TIMEOUT:x.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case p.PlaylistContextType.LEVEL:v=c?x.ErrorDetails.LEVEL_LOAD_TIMEOUT:x.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.AUDIO_TRACK:v=c?x.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:x.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:v=c?x.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:x.ErrorDetails.SUBTITLE_LOAD_ERROR,b=!1;break}E&&this.resetInternalLoader(t.type);var g={type:x.ErrorTypes.NETWORK_ERROR,details:v,fatal:b,url:t.url,loader:E,context:t,networkDetails:n};m&&(g.response=m),this.hls.trigger(D.Events.ERROR,g)},h.handlePlaylistLoaded=function(t,n,c,m){var v=c.type,b=c.level,E=c.id,g=c.groupId,y=c.loader,C=c.levelDetails,d=c.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(t,c,"invalid target duration",m);return}if(!y)return;C.live&&(y.getCacheAge&&(C.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(v){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:C,level:b||0,id:E||0,stats:n,networkDetails:m,deliveryDirectives:d});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:C,id:E||0,groupId:g||"",stats:n,networkDetails:m,deliveryDirectives:d});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:C,id:E||0,groupId:g||"",stats:n,networkDetails:m,deliveryDirectives:d});break}},s}();Q.default=l},"./src/polyfills/number.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"isFiniteNumber",function(){return S}),j.d(Q,"MAX_SAFE_INTEGER",function(){return D});var S=Number.isFinite||function(x){return typeof x=="number"&&isFinite(x)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,Q,j){"use strict";j.r(Q);var S=function(){function D(){}return D.getSilentFrame=function(T,w){switch(T){case"mp4a.40.2":if(w===1)return new Uint8Array([0,200,0,128,35,128]);if(w===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(w===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(w===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(w===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(w===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(w===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(w===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(w===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},D}();Q.default=S},"./src/remux/mp4-generator.ts":function(ue,Q,j){"use strict";j.r(Q);var S=Math.pow(2,32)-1,D=function(){function x(){}return x.init=function(){x.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 w;for(w in x.types)x.types.hasOwnProperty(w)&&(x.types[w]=[w.charCodeAt(0),w.charCodeAt(1),w.charCodeAt(2),w.charCodeAt(3)]);var f=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]),p=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]);x.HDLR_TYPES={video:f,audio:p};var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o=new Uint8Array([0,0,0,0,0,0,0,0]);x.STTS=x.STSC=x.STCO=o,x.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),x.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),x.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),x.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var i=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);x.FTYP=x.box(x.types.ftyp,i,s,i,l),x.DINF=x.box(x.types.dinf,x.box(x.types.dref,u))},x.box=function(w){for(var f=8,p=arguments.length,u=new Array(p>1?p-1:0),o=1;o>24&255,s[1]=f>>16&255,s[2]=f>>8&255,s[3]=f&255,s.set(w,4),i=0,f=8;i>24&255,w>>16&255,w>>8&255,w&255,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&255,85,196,0,0]))},x.mdia=function(w){return x.box(x.types.mdia,x.mdhd(w.timescale,w.duration),x.hdlr(w.type),x.minf(w))},x.mfhd=function(w){return x.box(x.types.mfhd,new Uint8Array([0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255]))},x.minf=function(w){return w.type==="audio"?x.box(x.types.minf,x.box(x.types.smhd,x.SMHD),x.DINF,x.stbl(w)):x.box(x.types.minf,x.box(x.types.vmhd,x.VMHD),x.DINF,x.stbl(w))},x.moof=function(w,f,p){return x.box(x.types.moof,x.mfhd(w),x.traf(p,f))},x.moov=function(w){for(var f=w.length,p=[];f--;)p[f]=x.trak(w[f]);return x.box.apply(null,[x.types.moov,x.mvhd(w[0].timescale,w[0].duration)].concat(p).concat(x.mvex(w)))},x.mvex=function(w){for(var f=w.length,p=[];f--;)p[f]=x.trex(w[f]);return x.box.apply(null,[x.types.mvex].concat(p))},x.mvhd=function(w,f){f*=w;var p=Math.floor(f/(S+1)),u=Math.floor(f%(S+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,w>>24&255,w>>16&255,w>>8&255,w&255,p>>24,p>>16&255,p>>8&255,p&255,u>>24,u>>16&255,u>>8&255,u&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 x.box(x.types.mvhd,o)},x.sdtp=function(w){var f=w.samples||[],p=new Uint8Array(4+f.length),u,o;for(u=0;u>>8&255),f.push(i&255),f=f.concat(Array.prototype.slice.call(o));for(u=0;u>>8&255),p.push(i&255),p=p.concat(Array.prototype.slice.call(o));var l=x.box(x.types.avcC,new Uint8Array([1,f[3],f[4],f[5],252|3,224|w.sps.length].concat(f).concat([w.pps.length]).concat(p))),s=w.width,h=w.height,r=w.pixelRatio[0],t=w.pixelRatio[1];return x.box(x.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,h>>8&255,h&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]),l,x.box(x.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),x.box(x.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,t>>24,t>>16&255,t>>8&255,t&255])))},x.esds=function(w){var f=w.config.length;return new Uint8Array([0,0,0,0,3,23+f,0,1,0,4,15+f,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([f]).concat(w.config).concat([6,1,2]))},x.mp4a=function(w){var f=w.samplerate;return x.box(x.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,w.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]),x.box(x.types.esds,x.esds(w)))},x.mp3=function(w){var f=w.samplerate;return x.box(x.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,w.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]))},x.stsd=function(w){return w.type==="audio"?!w.isAAC&&w.codec==="mp3"?x.box(x.types.stsd,x.STSD,x.mp3(w)):x.box(x.types.stsd,x.STSD,x.mp4a(w)):x.box(x.types.stsd,x.STSD,x.avc1(w))},x.tkhd=function(w){var f=w.id,p=w.duration*w.timescale,u=w.width,o=w.height,i=Math.floor(p/(S+1)),l=Math.floor(p%(S+1));return x.box(x.types.tkhd,new Uint8Array([1,0,0,7,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,0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,l>>24,l>>16&255,l>>8&255,l&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,u>>8&255,u&255,0,0,o>>8&255,o&255,0,0]))},x.traf=function(w,f){var p=x.sdtp(w),u=w.id,o=Math.floor(f/(S+1)),i=Math.floor(f%(S+1));return x.box(x.types.traf,x.box(x.types.tfhd,new Uint8Array([0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255])),x.box(x.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,i>>24,i>>16&255,i>>8&255,i&255])),x.trun(w,p.length+16+20+8+16+8+8),p)},x.trak=function(w){return w.duration=w.duration||4294967295,x.box(x.types.trak,x.tkhd(w),x.mdia(w))},x.trex=function(w){var f=w.id;return x.box(x.types.trex,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},x.trun=function(w,f){var p=w.samples||[],u=p.length,o=12+16*u,i=new Uint8Array(o),l,s,h,r,t,n;for(f+=8+o,i.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255],0),l=0;l>>24&255,h>>>16&255,h>>>8&255,h&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*l);return x.box(x.types.trun,i)},x.initSegment=function(w){x.types||x.init();var f=x.moov(w),p=new Uint8Array(x.FTYP.byteLength+f.byteLength);return p.set(x.FTYP),p.set(f,x.FTYP.byteLength),p},x}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,Q.default=D},"./src/remux/mp4-remuxer.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return n}),j.d(Q,"normalizePts",function(){return c});var S=j("./src/polyfills/number.ts"),D=j("./src/remux/aac-helper.ts"),x=j("./src/remux/mp4-generator.ts"),T=j("./src/events.ts"),w=j("./src/errors.ts"),f=j("./src/utils/logger.ts"),p=j("./src/types/loader.ts"),u=j("./src/utils/timescale-conversion.ts");function o(){return o=Object.assign||function(E){for(var g=1;g0?O:A.pts},C[0].pts);return d&&f.logger.debug("PTS rollover detected"),_},g.remux=function(C,d,_,O,A,P,I,W){var K,te,H,G,V,re,$=A,ne=A,he=C.pid>-1,pe=d.pid>-1,Te=d.samples.length,we=C.samples.length>0,Me=Te>1,Ee=(!he||we)&&(!pe||Me)||this.ISGenerated||I;if(Ee){this.ISGenerated||(H=this.generateIS(C,d,A));var xe=this.isVideoContiguous,Ge=-1;if(Me&&(Ge=m(d.samples),!xe&&this.config.forceKeyFrameOnDiscontinuity))if(re=!0,Ge>0){f.logger.warn("[mp4-remuxer]: Dropped "+Ge+" out of "+Te+" video samples due to a missing keyframe");var je=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(Ge),d.dropped+=Ge,ne+=(d.samples[0].pts-je)/(d.timescale||9e4)}else Ge===-1&&(f.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),re=!1);if(this.ISGenerated){if(we&&Me){var We=this.getVideoStartPts(d.samples),ze=c(C.samples[0].pts,We)-We,de=ze/d.inputTimeScale;$+=Math.max(0,de),ne+=Math.max(0,-de)}if(we){if(C.samplerate||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(C,d,A)),te=this.remuxAudio(C,$,this.isAudioContiguous,P,pe||Me||W===p.PlaylistLevelType.AUDIO?ne:void 0),Me){var le=te?te.endPTS-te.startPTS:0;d.inputTimeScale||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(C,d,A)),K=this.remuxVideo(d,ne,xe,le)}}else Me&&(K=this.remuxVideo(d,ne,xe,0));K&&(K.firstKeyFrame=Ge,K.independent=Ge!==-1)}}return this.ISGenerated&&(_.samples.length&&(V=this.remuxID3(_,A)),O.samples.length&&(G=this.remuxText(O,A))),{audio:te,video:K,initSegment:H,independent:re,text:G,id3:V}},g.generateIS=function(C,d,_){var O=C.samples,A=d.samples,P=this.typeSupported,I={},W=!Object(S.isFiniteNumber)(this._initPTS),K="audio/mp4",te,H,G;if(W&&(te=H=Infinity),C.config&&O.length&&(C.timescale=C.samplerate,C.isAAC||(P.mpeg?(K="audio/mpeg",C.codec=""):P.mp3&&(C.codec="mp3")),I.audio={id:"audio",container:K,codec:C.codec,initSegment:!C.isAAC&&P.mpeg?new Uint8Array(0):x.default.initSegment([C]),metadata:{channelCount:C.channelCount}},W&&(G=C.inputTimeScale,te=H=O[0].pts-Math.round(G*_))),d.sps&&d.pps&&A.length&&(d.timescale=d.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:x.default.initSegment([d]),metadata:{width:d.width,height:d.height}},W)){G=d.inputTimeScale;var V=this.getVideoStartPts(A),re=Math.round(G*_);H=Math.min(H,c(A[0].dts,V)-re),te=Math.min(te,V-re)}if(Object.keys(I).length)return this.ISGenerated=!0,W&&(this._initPTS=te,this._initDTS=H),{tracks:I,initPTS:te,timescale:G}},g.remuxVideo=function(C,d,_,O){var A=C.inputTimeScale,P=C.samples,I=[],W=P.length,K=this._initPTS,te=this.nextAvcDts,H=8,G,V,re,$=Number.POSITIVE_INFINITY,ne=Number.NEGATIVE_INFINITY,he=0,pe=!1;if(!_||te===null){var Te=d*A,we=P[0].pts-c(P[0].dts,P[0].pts);te=Te-we}for(var Me=0;MeEe.pts){var xe=9e4*.2;he=Math.max(Math.min(he,Ee.pts-Ee.dts),-1*xe)}Ee.dts0?Me-1:Me].dts&&(pe=!0)}pe&&P.sort(function(Dt,lt){var pt=Dt.dts-lt.dts,ut=Dt.pts-lt.pts;return pt||ut}),V=P[0].dts,re=P[P.length-1].dts;var Ge=Math.round((re-V)/(W-1));if(he<0){if(heGe,Oe=de<-1;if(le||Oe){le?f.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(de,!0)+" ms ("+de+"dts) hole between fragments detected, filling it"):f.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-de,!0)+" ms ("+de+"dts) overlapping between fragments detected"),V=te;var Ie=P[0].pts-de;P[0].dts=V,P[0].pts=Ie,f.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(u.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(de,!0)+" ms")}}t&&(V=Math.max(0,V));for(var qe=0,ee=0,k=0;k0?Be-1:Be].dts;if(Ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var De=Math.floor(Ce.maxBufferHole*A),rt=(O?$+O*A:this.nextAudioPts)-Ze.pts;rt>De?(G=rt-Ne,G<0&&(G=Ne),f.logger.log("[mp4-remuxer]: It is approximately "+rt/90+" ms to the next segment; using duration "+G/90+" ms for the last video frame.")):G=Ne}else G=Ne}var tt=Math.round(Ze.pts-Ze.dts);I.push(new v(Ze.key,G,Qe,tt))}if(I.length&&h&&h<70){var xt=I[0].flags;xt.dependsOn=2,xt.isNonSync=0}console.assert(G!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=te=re+G,this.isVideoContiguous=!0;var Mt=x.default.moof(C.sequenceNumber++,V,o({},C,{samples:I})),Bt="video",It={data1:Mt,data2:ct,startPTS:$/A,endPTS:(ne+G)/A,startDTS:V/A,endDTS:te/A,type:Bt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(ct.length,"MDAT length must not be zero"),It},g.remuxAudio=function(C,d,_,O,A){var P=C.inputTimeScale,I=C.samplerate?C.samplerate:P,W=P/I,K=C.isAAC?l:s,te=K*W,H=this._initPTS,G=!C.isAAC&&this.typeSupported.mpeg,V=[],re=C.samples,$=G?0:8,ne=this.nextAudioPts||-1,he=d*P;if(this.isAudioContiguous=_=_||re.length&&ne>0&&(O&&Math.abs(he-ne)<9e3||Math.abs(c(re[0].pts-H,he)-ne)<20*te),re.forEach(function(Ue){Ue.pts=c(Ue.pts-H,he)}),!_||ne<0){if(re=re.filter(function(Ue){return Ue.pts>=0}),!re.length)return;A===0?ne=0:O?ne=Math.max(0,he):ne=re[0].pts}if(C.isAAC)for(var pe=A!==void 0,Te=this.config.maxAudioFramesDrift,we=0,Me=ne;we=Te*te&&je0){ee+=$;try{qe=new Uint8Array(ee)}catch(Ue){this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:w.ErrorTypes.MUX_ERROR,details:w.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ee,reason:"fail allocating audio mdat "+ee});return}if(!G){var ct=new DataView(qe.buffer);ct.setUint32(0,ee),qe.set(x.default.types.mdat,4)}}else return;qe.set(J,$);var He=J.byteLength;$+=He,V.push(new v(!0,K,He,0)),Ie=be}var Be=V.length;if(!Be)return;var Ze=V[V.length-1];this.nextAudioPts=ne=Ie+W*Ze.duration;var ht=G?new Uint8Array(0):x.default.moof(C.sequenceNumber++,Oe/W,o({},C,{samples:V}));C.samples=[];var Qe=Oe/P,Xe=ne/P,Ke="audio",Fe={data1:ht,data2:qe,startPTS:Qe,endPTS:Xe,startDTS:Qe,endDTS:Xe,type:Ke,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(qe.length,"MDAT length must not be zero"),Fe},g.remuxEmptyAudio=function(C,d,_,O){var A=C.inputTimeScale,P=C.samplerate?C.samplerate:A,I=A/P,W=this.nextAudioPts,K=(W!==null?W:O.startDTS*A)+this._initDTS,te=O.endDTS*A+this._initDTS,H=I*l,G=Math.ceil((te-K)/H),V=D.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(f.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){f.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var re=[],$=0;$4294967296;)E+=y;return E}function m(E){for(var g=0;g0?this.lastEndDTS=C:(T.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!E.audio,_=!!E.video,O="";d&&(O+="audio"),_&&(O+="video");var A={data1:v,startPTS:y,startDTS:y,endPTS:C,endDTS:C,type:O,hasAudio:d,hasVideo:_,nb:1,dropped:0};return m.audio=A.type==="audio"?A:void 0,m.video=A.type!=="audio"?A:void 0,m.text=r,m.id3=h,m.initSegment=b,m},u}(),f=function(o,i,l){return Object(D.getStartDTS)(o,i)-l};function p(u,o){var i=u==null?void 0:u.codec;return i&&i.length>4?i:i==="hvc1"?"hvc1.1.c.L120.90":i==="av01"?"av01.0.04M.08":i==="avc1"||o===x.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=w},"./src/task-loop.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"default",function(){return S});var S=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var x=D.prototype;return x.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},x.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},x.onHandlerDestroyed=function(){},x.hasInterval=function(){return!!this._tickInterval},x.hasNextTick=function(){return!!this._tickTimer},x.setInterval=function(w){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,w),!0)},x.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},x.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},x.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},x.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},x.doTick=function(){},D}()},"./src/types/cmcd.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"CMCDVersion",function(){return S}),j.d(Q,"CMCDObjectType",function(){return D}),j.d(Q,"CMCDStreamingFormat",function(){return x}),j.d(Q,"CMCDStreamType",function(){return T});var S=1,D;(function(w){w.MANIFEST="m",w.AUDIO="a",w.VIDEO="v",w.MUXED="av",w.INIT="i",w.CAPTION="c",w.TIMED_TEXT="tt",w.KEY="k",w.OTHER="o"})(D||(D={}));var x;(function(w){w.DASH="d",w.HLS="h",w.SMOOTH="s",w.OTHER="o"})(x||(x={}));var T;(function(w){w.VOD="v",w.LIVE="l"})(T||(T={}))},"./src/types/level.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"HlsSkip",function(){return x}),j.d(Q,"getSkipValue",function(){return T}),j.d(Q,"HlsUrlParameters",function(){return w}),j.d(Q,"Level",function(){return f});function S(p,u){for(var o=0;oNumber.MAX_SAFE_INTEGER?Infinity:u},w.hexadecimalInteger=function(p){if(this[p]){var u=(this[p]||"0x").slice(2);u=(u.length&1?"0":"")+u;for(var o=new Uint8Array(u.length/2),i=0;iNumber.MAX_SAFE_INTEGER?Infinity:u},w.decimalFloatingPoint=function(p){return parseFloat(this[p])},w.optionalFloat=function(p,u){var o=this[p];return o?parseFloat(o):u},w.enumeratedString=function(p){return this[p]},w.bool=function(p){return this[p]==="YES"},w.decimalResolution=function(p){var u=S.exec(this[p]);return u===null?void 0:{width:parseInt(u[1],10),height:parseInt(u[2],10)}},T.parseAttrList=function(p){var u,o={},i='"';for(D.lastIndex=0;(u=D.exec(p))!==null;){var l=u[2];l.indexOf(i)===0&&l.lastIndexOf(i)===l.length-1&&(l=l.slice(1,-1)),o[u[1]]=l}return o},T}()},"./src/utils/binary-search.ts":function(ue,Q,j){"use strict";j.r(Q);var S={search:function(x,T){for(var w=0,f=x.length-1,p=null,u=null;w<=f;){p=(w+f)/2|0,u=x[p];var o=T(u);if(o>0)w=p+1;else if(o<0)f=p-1;else return u}return null}};Q.default=S},"./src/utils/buffer-helper.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"BufferHelper",function(){return x});var S=j("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},x=function(){function T(){}return T.isBuffered=function(f,p){try{if(f){for(var u=T.getBuffered(f),o=0;o=u.start(o)&&p<=u.end(o))return!0}}catch(i){}return!1},T.bufferInfo=function(f,p,u){try{if(f){var o=T.getBuffered(f),i=[],l;for(l=0;ls&&(o[l-1].end=f[i].end):o.push(f[i])}else o.push(f[i])}else o=f;for(var h=0,r,t=p,n=p,c=0;c=m&&p=_&&S.logger.log(this.time+" ["+_+"] "+O)},y}(),h=function(C){for(var d=[],_=0;_w&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=w)},C.moveCursor=function(_){var O=this.pos+_;if(_>1)for(var A=this.pos+1;A=144&&this.backSpace();var O=x(_);if(this.pos>=w){this.logger.log(l.ERROR,"Cannot insert "+_.toString(16)+" ("+O+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(O,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(_){var O;for(O=_;O0&&(_?A="["+O.join(" | ")+"]":A=O.join(` `)),A},C.getTextAndFormat=function(){return this.rows},y}(),m=function(){function y(d,_,O){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=d,this.outputFilter=_,this.mode=null,this.verbose=0,this.displayedMemory=new c(O),this.nonDisplayedMemory=new c(O),this.lastOutputScreen=new c(O),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=O}var C=y.prototype;return C.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[T-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},C.getHandler=function(){return this.outputFilter},C.setHandler=function(_){this.outputFilter=_},C.setPAC=function(_){this.writeScreen.setPAC(_)},C.setBkgData=function(_){this.writeScreen.setBkgData(_)},C.setMode=function(_){if(_===this.mode)return;this.mode=_,this.logger.log(l.INFO,"MODE="+_),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=_},C.insertChars=function(_){for(var O=0;O<_.length;O++)this.writeScreen.insertChar(_[O]);var A=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,A+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(_){this.logger.log(l.INFO,"RU("+_+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(_)},C.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var _=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=_,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(_){this.logger.log(l.INFO,"TO("+_+") - Tab Offset"),this.writeScreen.moveCursor(_)},C.ccMIDROW=function(_){var O={flash:!1};if(O.underline=_%2===1,O.italics=_>=46,O.italics)O.foreground="white";else{var A=Math.floor(_/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];O.foreground=P[A]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(O)),this.writeScreen.setPen(O)},C.outputDataUpdate=function(_){_===void 0&&(_=!1);var O=this.logger.time;if(O===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=O:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,O,this.lastOutputScreen),_&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:O),this.lastOutputScreen.copy(this.displayedMemory))},C.cueSplitAtTime=function(_){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,_,this.displayedMemory),this.cueStartTime=_))},y}(),v=function(){function y(d,_,O){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var A=new s;this.channels=[null,new m(d,_,A),new m(d+1,O,A)],this.cmdHistory=g(),this.logger=A}var C=y.prototype;return C.getHandler=function(_){return this.channels[_].getHandler()},C.setHandler=function(_,O){this.channels[_].setHandler(O)},C.addData=function(_,O){var A,P,I,W=!1;this.logger.time=_;for(var K=0;K ("+h([P,I])+")"),A=this.parseCmd(P,I),A||(A=this.parseMidrow(P,I)),A||(A=this.parsePAC(P,I)),A||(A=this.parseBackgroundAttributes(P,I)),!A&&(W=this.parseChars(P,I),W)){var te=this.currentChannel;if(te&&te>0){var H=this.channels[te];H.insertChars(W)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!A&&!W&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+h([P,I])+" orig: "+h([O[K],O[K+1]]))}},C.parseCmd=function(_,O){var A=this.cmdHistory,P=(_===20||_===28||_===21||_===29)&&O>=32&&O<=47,I=(_===23||_===31)&&O>=33&&O<=35;if(!(P||I))return!1;if(E(_,O,A))return b(null,null,A),this.logger.log(l.DEBUG,"Repeated command ("+h([_,O])+") is dropped"),!0;var W=_===20||_===21||_===23?1:2,K=this.channels[W];return _===20||_===21||_===28||_===29?O===32?K.ccRCL():O===33?K.ccBS():O===34?K.ccAOF():O===35?K.ccAON():O===36?K.ccDER():O===37?K.ccRU(2):O===38?K.ccRU(3):O===39?K.ccRU(4):O===40?K.ccFON():O===41?K.ccRDC():O===42?K.ccTR():O===43?K.ccRTD():O===44?K.ccEDM():O===45?K.ccCR():O===46?K.ccENM():O===47&&K.ccEOC():K.ccTO(O-32),b(_,O,A),this.currentChannel=W,!0},C.parseMidrow=function(_,O){var A=0;if((_===17||_===25)&&O>=32&&O<=47){if(_===17?A=1:A=2,A!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[A];return P?(P.ccMIDROW(O),this.logger.log(l.DEBUG,"MIDROW ("+h([_,O])+")"),!0):!1}return!1},C.parsePAC=function(_,O){var A,P=this.cmdHistory,I=(_>=17&&_<=23||_>=25&&_<=31)&&O>=64&&O<=127,W=(_===16||_===24)&&O>=64&&O<=95;if(!(I||W))return!1;if(E(_,O,P))return b(null,null,P),!0;var K=_<=23?1:2;O>=64&&O<=95?A=K===1?f[_]:u[_]:A=K===1?p[_]:o[_];var te=this.channels[K];return te?(te.setPAC(this.interpretPAC(A,O)),b(_,O,P),this.currentChannel=K,!0):!1},C.interpretPAC=function(_,O){var A,P={color:null,italics:!1,indent:null,underline:!1,row:_};return O>95?A=O-96:A=O-64,P.underline=(A&1)===1,A<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(A/2)]:A<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((A-16)/2)*4,P},C.parseChars=function(_,O){var A,P=null,I=null;if(_>=25?(A=2,I=_-8):(A=1,I=_),I>=17&&I<=19){var W;I===17?W=O+80:I===18?W=O+112:W=O+144,this.logger.log(l.INFO,"Special char '"+x(W)+"' in channel "+A),P=[W]}else _>=32&&_<=127&&(P=O===0?[_]:[_,O]);if(P){var K=h(P);this.logger.log(l.DEBUG,"Char codes = "+K.join(",")),b(_,O,this.cmdHistory)}return P},C.parseBackgroundAttributes=function(_,O){var A=(_===16||_===24)&&O>=32&&O<=47,P=(_===23||_===31)&&O>=45&&O<=47;if(!(A||P))return!1;var I,W={};_===16||_===24?(I=Math.floor((O-32)/2),W.background=i[I],O%2===1&&(W.background=W.background+"_semi")):O===45?W.background="transparent":(W.foreground="black",O===47&&(W.underline=!0));var K=_<=23?1:2,te=this.channels[K];return te.setBkgData(W),b(_,O,this.cmdHistory),!0},C.reset=function(){for(var _=0;_=16?t--:t++;var b=Object(S.fixLineBreaks)(n.trim()),E=Object(D.generateCueId)(u,o,b);(!p||!p.cues||!p.cues.getCueById(E))&&(h=new c(u,o,b),h.id=E,h.line=m+1,h.align="left",h.position=10+Math.min(80,Math.floor(t*8/32)*10),l.push(h))}return p&&l.length&&(l.sort(function(g,y){return g.line==="auto"||y.line==="auto"?0:g.line>8&&y.line>8?y.line-g.line:g.line-y.line}),l.forEach(function(g){return Object(x.addCueToTrack)(p,g)})),l}};Q.default=w},"./src/utils/discontinuities.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"findFirstFragWithCC",function(){return T}),j.d(Q,"shouldAlignOnDiscontinuities",function(){return w}),j.d(Q,"findDiscontinuousReferenceFrag",function(){return f}),j.d(Q,"adjustSlidingStart",function(){return u}),j.d(Q,"alignStream",function(){return o}),j.d(Q,"alignPDT",function(){return l}),j.d(Q,"alignFragmentByPDTDelta",function(){return s}),j.d(Q,"alignMediaPlaylistByPDT",function(){return h});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/logger.ts"),x=j("./src/controller/level-helper.ts");function T(r,t){for(var n=null,c=0,m=r.length;cn.startCC||r&&r.cc=this.minWeight_},T.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},T.destroy=function(){},x}();Q.default=D},"./src/utils/ewma.ts":function(ue,Q,j){"use strict";j.r(Q);var S=function(){function D(T,w,f){w===void 0&&(w=0),f===void 0&&(f=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=T,this.alpha_=T?Math.exp(Math.log(.5)/T):0,this.estimate_=w,this.totalWeight_=f}var x=D.prototype;return x.sample=function(w,f){var p=Math.pow(this.alpha_,w);this.estimate_=f*(1-p)+p*this.estimate_,this.totalWeight_+=w},x.getTotalWeight=function(){return this.totalWeight_},x.getEstimate=function(){if(this.alpha_){var w=1-Math.pow(this.alpha_,this.totalWeight_);if(w)return this.estimate_/w}return this.estimate_},D}();Q.default=S},"./src/utils/fetch-loader.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"fetchSupported",function(){return s});var S=j("./src/polyfills/number.ts"),D=j("./src/loader/load-stats.ts"),x=j("./src/demux/chunk-cache.ts");function T(c,m){c.prototype=Object.create(m.prototype),c.prototype.constructor=c,o(c,m)}function w(c){var m=typeof Map=="function"?new Map:void 0;return w=function(b){if(b===null||!u(b))return b;if(typeof b!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m!="undefined"){if(m.has(b))return m.get(b);m.set(b,E)}function E(){return f(b,arguments,i(this).constructor)}return E.prototype=Object.create(b.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),o(E,b)},w(c)}function f(c,m,v){return p()?f=Reflect.construct:f=function(E,g,y){var C=[null];C.push.apply(C,g);var d=Function.bind.apply(E,C),_=new d;return y&&o(_,y.prototype),_},f.apply(null,arguments)}function p(){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(c){return!1}}function u(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function o(c,m){return o=Object.setPrototypeOf||function(b,E){return b.__proto__=E,b},o(c,m)}function i(c){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},i(c)}function l(){return l=Object.assign||function(c){for(var m=1;m=y&&C(E,g,d.flush(),b)):C(E,g,I,b),A()}).catch(function(){return Promise.reject()})};return O()},c}();function r(c,m){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:m,headers:new self.Headers(l({},c.headers))};return c.rangeEnd&&v.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),v}function t(c,m){return new self.Request(c.url,m)}var n=function(c){T(m,c);function m(v,b,E){var g;return g=c.call(this,v)||this,g.code=void 0,g.details=void 0,g.code=b,g.details=E,g}return m}(w(Error));Q.default=h},"./src/utils/imsc1-ttml-parser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"IMSC1_CODEC",function(){return u}),j.d(Q,"parseIMSC1",function(){return s});var S=j("./src/utils/mp4-tools.ts"),D=j("./src/utils/vttparser.ts"),x=j("./src/utils/vttcue.ts"),T=j("./src/demux/id3.ts"),w=j("./src/utils/timescale-conversion.ts"),f=j("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(y){for(var C=1;C"):S}function w(u){for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l>24,m[v+1]=b>>16&255,m[v+2]=b>>8&255,m[v+3]=b&255}function o(m,v){var b=[];if(!v.length)return b;var E,g,y;"data"in m?(E=m.data,g=m.start,y=m.end):(E=m,g=0,y=E.byteLength);for(var C=g;C1?C+d:y;if(_===v[0])if(v.length===1)b.push({data:E,start:C+8,end:O});else{var A=o({data:E,start:C+8,end:O},v.slice(1));A.length&&T.apply(b,A)}C=O}return b}function i(m){var v=o(m,["moov"]),b=v[0],E=b?b.end:null,g=o(m,["sidx"]);if(!g||!g[0])return null;var y=[],C=g[0],d=C.data[0],_=d===0?8:16,O=p(C,_);_+=4;var A=0,P=0;d===0?_+=8:_+=16,_+=2;var I=C.end+P,W=f(C,_);_+=2;for(var K=0;K>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var re=p(C,te);te+=4,y.push({referenceSize:G,subsegmentDuration:re,info:{duration:re/O,start:I,end:I+G-1}}),I+=G,te+=4,_=te}return{earliestPresentationTime:A,timescale:O,version:d,referencesCount:W,references:y,moovEndOffset:E}}function l(m){for(var v=[],b=o(m,["moov","trak"]),E=0;Ew)&&(this.startTime=w),this.endTime=f,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},x.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"sendAddTrackEvent",function(){return D}),j.d(Q,"addCueToTrack",function(){return x}),j.d(Q,"clearCurrentCues",function(){return T}),j.d(Q,"removeCuesInRange",function(){return w}),j.d(Q,"getCuesInRange",function(){return p});var S=j("./src/utils/logger.ts");function D(u,o){var i;try{i=new Event("addtrack")}catch(l){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=u,o.dispatchEvent(i)}function x(u,o){var i=u.mode;if(i==="disabled"&&(u.mode="hidden"),u.cues&&!u.cues.getCueById(o.id))try{if(u.addCue(o),!u.cues.getCueById(o.id))throw new Error("addCue is failed for: "+o)}catch(s){S.logger.debug("[texttrack-utils]: "+s);var l=new self.TextTrackCue(o.startTime,o.endTime,o.text);l.id=o.id,u.addCue(l)}i==="disabled"&&(u.mode=i)}function T(u){var o=u.mode;if(o==="disabled"&&(u.mode="hidden"),u.cues)for(var i=u.cues.length;i--;)u.removeCue(u.cues[i]);o==="disabled"&&(u.mode=o)}function w(u,o,i){var l=u.mode;if(l==="disabled"&&(u.mode="hidden"),u.cues&&u.cues.length>0)for(var s=p(u.cues,o,i),h=0;hu[i].endTime)return-1;for(var l=0,s=i;l<=s;){var h=Math.floor((s+l)/2);if(ou[h].startTime&&l-1)for(var h=s,r=u.length;h=o&&t.endTime<=i)l.push(t);else if(t.startTime>i)return l}return l}},"./src/utils/time-ranges.ts":function(ue,Q,j){"use strict";j.r(Q);var S={toString:function(x){for(var T="",w=x.length,f=0;f1?o-1:0),l=1;l100)throw new Error("Position must be between 0 and 100.");y=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",f({},s,{get:function(){return C},set:function(A){var P=w(A);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");C=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",f({},s,{get:function(){return d},set:function(A){if(A<0||A>100)throw new Error("Size must be between 0 and 100.");d=A,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",f({},s,{get:function(){return _},set:function(A){var P=w(A);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");_=P,this.hasBeenReset=!0}})),l.displayState=void 0}return p.prototype.getCueAsHTML=function(){var u=self.WebVTT;return u.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"parseTimeStamp",function(){return x}),j.d(Q,"fixLineBreaks",function(){return o}),j.d(Q,"VTTParser",function(){return i});var S=j("./src/utils/vttcue.ts"),D=function(){function l(){}var s=l.prototype;return s.decode=function(r,t){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},l}();function x(l){function s(r,t,n,c){return(r|0)*3600+(t|0)*60+(n|0)+parseFloat(c||0)}var h=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?s(h[2],h[3],0,h[4]):s(h[1],h[2],h[3],h[4]):null}var T=function(){function l(){this.values=Object.create(null)}var s=l.prototype;return s.set=function(r,t){!this.get(r)&&t!==""&&(this.values[r]=t)},s.get=function(r,t,n){return n?this.has(r)?this.values[r]:t[n]:this.has(r)?this.values[r]:t},s.has=function(r){return r in this.values},s.alt=function(r,t,n){for(var c=0;c=0&&n<=100)return this.set(r,n),!0}return!1},l}();function w(l,s,h,r){var t=r?l.split(r):[l];for(var n in t){if(typeof t[n]!="string")continue;var c=t[n].split(h);if(c.length!==2)continue;var m=c[0],v=c[1];s(m,v)}}var f=new S.default(0,0,""),p=f.align==="middle"?"middle":"center";function u(l,s,h){var r=l;function t(){var m=x(l);if(m===null)throw new Error("Malformed timestamp: "+r);return l=l.replace(/^[^\sa-zA-Z-]+/,""),m}function n(m,v){var b=new T;w(m,function(y,C){var d;switch(y){case"region":for(var _=h.length-1;_>=0;_--)if(h[_].id===C){b.set(y,h[_].region);break}break;case"vertical":b.alt(y,C,["rl","lr"]);break;case"line":d=C.split(","),b.integer(y,d[0]),b.percent(y,d[0])&&b.set("snapToLines",!1),b.alt(y,d[0],["auto"]),d.length===2&&b.alt("lineAlign",d[1],["start",p,"end"]);break;case"position":d=C.split(","),b.percent(y,d[0]),d.length===2&&b.alt("positionAlign",d[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":b.percent(y,C);break;case"align":b.alt(y,C,["start",p,"end","left","right"]);break}},/:/,/\s/),v.region=b.get("region",null),v.vertical=b.get("vertical","");var E=b.get("line","auto");E==="auto"&&f.line===-1&&(E=-1),v.line=E,v.lineAlign=b.get("lineAlign","start"),v.snapToLines=b.get("snapToLines",!0),v.size=b.get("size",100),v.align=b.get("align",p);var g=b.get("position","auto");g==="auto"&&f.position===50&&(g=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=g}function c(){l=l.replace(/^\s+/,"")}if(c(),s.startTime=t(),c(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);l=l.substr(3),c(),s.endTime=t(),c(),n(l,s)}function o(l){return l.replace(//gi,` `)}var i=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=l.prototype;return s.parse=function(r){var t=this;r&&(t.buffer+=t.decoder.decode(r,{stream:!0}));function n(){var g=t.buffer,y=0;for(g=o(g);y")===-1){t.cue.id=m;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{u(m,t.cue,t.regionList)}catch(g){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var E=m.indexOf("-->")!==-1;if(!m||E&&(b=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` `),t.cue.text+=m}continue;case"BADCUE":m||(t.state="ID")}}}catch(g){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=` `,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){r.onparsingerror&&r.onparsingerror(t)}return r.onflush&&r.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(ue,Q,j){"use strict";j.r(Q),j.d(Q,"generateCueId",function(){return i}),j.d(Q,"parseWebVTT",function(){return s});var S=j("./src/polyfills/number.ts"),D=j("./src/utils/vttparser.ts"),x=j("./src/demux/id3.ts"),T=j("./src/utils/timescale-conversion.ts"),w=j("./src/remux/mp4-remuxer.ts"),f=/\r\n|\n\r|\n|\r/g,p=function(r,t,n){return n===void 0&&(n=0),r.substr(n,t.length)===t},u=function(r){var t=parseInt(r.substr(-3)),n=parseInt(r.substr(-6,2)),c=parseInt(r.substr(-9,2)),m=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(S.isFiniteNumber)(t)||!Object(S.isFiniteNumber)(n)||!Object(S.isFiniteNumber)(c)||!Object(S.isFiniteNumber)(m))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return t+=1e3*n,t+=60*1e3*c,t+=60*60*1e3*m,t},o=function(r){for(var t=5381,n=r.length;n;)t=t*33^r.charCodeAt(--n);return(t>>>0).toString()};function i(h,r,t){return o(h.toString())+o(r.toString())+o(t)}var l=function(r,t,n){var c=r[t],m=r[c.prevCC];if(!m||!m.new&&c.new){r.ccOffset=r.presentationOffset=c.start,c.new=!1;return}for(;(v=m)!==null&&v!==void 0&&v.new;){var v;r.ccOffset+=c.start-m.start,c.new=!1,c=m,m=r[c.prevCC]}r.presentationOffset=n};function s(h,r,t,n,c,m,v,b){var E=new D.VTTParser,g=Object(x.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(f,` `).split(` `),y=[],C=Object(T.toMpegTsClockFromTimescale)(r,t),d="00:00.000",_=0,O=0,A,P=!0,I=!1;E.oncue=function(W){var K=n[c],te=n.ccOffset,H=(_-C)/9e4;if(K!=null&&K.new&&(O!==void 0?te=n.ccOffset=K.start:l(n,c,H)),H&&(te=H-n.presentationOffset),I){var G=W.endTime-W.startTime,V=Object(w.normalizePts)((W.startTime+te-O)*9e4,m*9e4)/9e4;W.startTime=V,W.endTime=V+G}var re=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(re)),W.id||(W.id=i(W.startTime,W.endTime,re)),W.endTime>0&&y.push(W)},E.onparsingerror=function(W){A=W},E.onflush=function(){if(A){b(A);return}v(y)},g.forEach(function(W){if(P)if(p(W,"X-TIMESTAMP-MAP=")){P=!1,I=!0,W.substr(16).split(",").forEach(function(K){p(K,"LOCAL:")?d=K.substr(6):p(K,"MPEGTS:")&&(_=parseInt(K.substr(7)))});try{O=u(d)/1e3}catch(K){I=!1,A=K}return}else W===""&&(P=!1);E.parse(W+` `)}),E.flush()}},"./src/utils/xhr-loader.ts":function(ue,Q,j){"use strict";j.r(Q);var S=j("./src/utils/logger.ts"),D=j("./src/loader/load-stats.ts"),x=/^age:\s*[\d.]+\s*$/m,T=function(){function w(p){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=p?p.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var f=w.prototype;return f.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},f.abortInternal=function(){var u=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),u&&(u.onreadystatechange=null,u.onprogress=null,u.readyState!==4&&(this.stats.aborted=!0,u.abort()))},f.abort=function(){var u;this.abortInternal(),(u=this.callbacks)!==null&&u!==void 0&&u.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},f.load=function(u,o,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=u,this.config=o,this.callbacks=i,this.retryDelay=o.retryDelay,this.loadInternal()},f.loadInternal=function(){var u=this.config,o=this.context;if(!u)return;var i=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var s=this.xhrSetup;try{if(s)try{s(i,o.url)}catch(t){i.open("GET",o.url,!0),s(i,o.url)}i.readyState||i.open("GET",o.url,!0);var h=this.context.headers;if(h)for(var r in h)i.setRequestHeader(r,h[r])}catch(t){this.callbacks.onError({code:i.status,text:t.message},o,i);return}o.rangeEnd&&i.setRequestHeader("Range","bytes="+o.rangeStart+"-"+(o.rangeEnd-1)),i.onreadystatechange=this.readystatechange.bind(this),i.onprogress=this.loadprogress.bind(this),i.responseType=o.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout),i.send()},f.readystatechange=function(){var u=this.context,o=this.loader,i=this.stats;if(!u||!o)return;var l=o.readyState,s=this.config;if(i.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start)),l===4){o.onreadystatechange=null,o.onprogress=null;var h=o.status;if(h>=200&&h<300){i.loading.end=Math.max(self.performance.now(),i.loading.first);var r,t;if(u.responseType==="arraybuffer"?(r=o.response,t=r.byteLength):(r=o.responseText,t=r.length),i.loaded=i.total=t,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(i,u,r,o),!this.callbacks)return;var c={url:o.responseURL,data:r};this.callbacks.onSuccess(c,i,u,o)}else i.retry>=s.maxRetry||h>=400&&h<499?(S.logger.error(h+" while loading "+u.url),this.callbacks.onError({code:h,text:o.statusText},u,o)):(S.logger.warn(h+" while loading "+u.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),i.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},f.loadtimeout=function(){S.logger.warn("timeout while loading "+this.context.url);var u=this.callbacks;u&&(this.abortInternal(),u.onTimeout(this.stats,this.context,this.loader))},f.loadprogress=function(u){var o=this.stats;o.loaded=u.loaded,u.lengthComputable&&(o.total=u.total)},f.getCacheAge=function(){var u=null;if(this.loader&&x.test(this.loader.getAllResponseHeaders())){var o=this.loader.getResponseHeader("age");u=o?parseFloat(o):null}return u},w}();Q.default=T}}).default})},vHTk:function(nt,Le,F){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(nt,Le,F){"use strict";F.d(Le,"a",function(){return J});var ue=F("rePB"),Q=F("VTBJ"),j=F("KQm4"),S=F("U8pU"),D=F("ODXe"),x=F("q1tI"),T=F("TSYQ"),w=F.n(T),f=F("Gytx"),p=F.n(f),u=F("Kwbf"),o=F("t23M"),i=F("qx4F"),l=F("6eGT"),s=F("IBYe"),h=F("Ff2n"),r=F("c+Xe"),t=F("fyJ8"),n=F("biw7");function c(He,Be,Ze,ht,Qe){var Xe=Ze[He]||{},Ke=Ze[Be]||{},Fe,Ue;Xe.fixed==="left"?Fe=ht.left[He]:Ke.fixed==="right"&&(Ue=ht.right[Be]);var _e=!1,Ce=!1,Ne=!1,De=!1,rt=Ze[Be+1],tt=Ze[He-1];if(Qe==="rtl"){if(Fe!==void 0){var xt=tt&&tt.fixed==="left";De=!xt}else if(Ue!==void 0){var Mt=rt&&rt.fixed==="right";Ne=!Mt}}else if(Fe!==void 0){var Bt=rt&&rt.fixed==="left";_e=!Bt}else if(Ue!==void 0){var It=tt&&tt.fixed==="right";Ce=!It}return{fixLeft:Fe,fixRight:Ue,lastFixLeft:_e,firstFixRight:Ce,lastFixRight:Ne,firstFixLeft:De,isSticky:ht.isSticky}}var m=F("sR1s");function v(He){var Be=He.cells,Ze=He.stickyOffsets,ht=He.flattenColumns,Qe=He.rowComponent,Xe=He.cellComponent,Ke=He.onHeaderRow,Fe=He.index,Ue=x.useContext(n.a),_e=Ue.prefixCls,Ce=Ue.direction,Ne;Ke&&(Ne=Ke(Be.map(function(rt){return rt.column}),Fe));var De=Object(m.a)(Be.map(function(rt){return rt.column}));return x.createElement(Qe,Object.assign({},Ne),Be.map(function(rt,tt){var xt=rt.column,Mt=c(rt.colStart,rt.colEnd,ht,Ze,Ce),Bt;return xt&&xt.onHeaderCell&&(Bt=rt.column.onHeaderCell(xt)),x.createElement(t.a,Object.assign({},rt,{ellipsis:xt.ellipsis,align:xt.align,component:Xe,prefixCls:_e,key:De[tt]},Mt,{additionalProps:Bt,rowType:"header"}))}))}v.displayName="HeaderRow";var b=v;function E(He){var Be=[];function Ze(Ke,Fe){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Be[Ue]=Be[Ue]||[];var _e=Fe,Ce=Ke.filter(Boolean).map(function(Ne){var De={key:Ne.key,className:Ne.className||"",children:Ne.title,column:Ne,colStart:_e},rt=1,tt=Ne.children;return tt&&tt.length>0&&(rt=Ze(tt,_e,Ue+1).reduce(function(xt,Mt){return xt+Mt},0),De.hasSubColumns=!0),"colSpan"in Ne&&(rt=Ne.colSpan),"rowSpan"in Ne&&(De.rowSpan=Ne.rowSpan),De.colSpan=rt,De.colEnd=De.colStart+rt-1,Be[Ue].push(De),_e+=rt,rt});return Ce}Ze(He,0);for(var ht=Be.length,Qe=function(Fe){Be[Fe].forEach(function(Ue){!("rowSpan"in Ue)&&!Ue.hasSubColumns&&(Ue.rowSpan=ht-Fe)})},Xe=0;Xe=0;Fe-=1){var Ue=Be[Fe],_e=Ze&&Ze[Fe],Ce=_e&&_e[C.a];(Ue||Ce||Ke)&&(Qe.unshift(x.createElement("col",Object.assign({key:Fe,style:{width:Ue,minWidth:Ue}},Ce))),Ke=!0)}return x.createElement("colgroup",null,Qe)}var _=d;function O(He,Be){return Object(x.useMemo)(function(){for(var Ze=[],ht=0;ht1?ae-1:0),se=1;se=Ne&&(Xt=Ne-De),Ke({scrollLeft:Xt/Ne*(Ce+2)}),It.current.x=it.pageX},st=function(){var it=Object(qe.b)(Xe.current).top,mt=it+Xe.current.offsetHeight,bt=document.documentElement.scrollTop+window.innerHeight;mt-Object(i.a)()<=bt||it>=bt-Fe?Bt(function(At){return Object(Q.a)(Object(Q.a)({},At),{},{isHiddenScrollBar:!0})}):Bt(function(At){return Object(Q.a)(Object(Q.a)({},At),{},{isHiddenScrollBar:!1})})},Nt=function(it){Bt(function(mt){return Object(Q.a)(Object(Q.a)({},mt),{},{scrollLeft:it/Ce*Ne||0})})};return x.useImperativeHandle(Ze,function(){return{setScrollLeft:Nt}}),x.useEffect(function(){var Ut=Object(Ie.a)(document.body,"mouseup",Pe,!1),it=Object(Ie.a)(document.body,"mousemove",yt,!1);return st(),function(){Ut.remove(),it.remove()}},[De,pt]),x.useEffect(function(){var Ut=Object(Ie.a)(window,"scroll",st,!1),it=Object(Ie.a)(window,"resize",st,!1);return function(){Ut.remove(),it.remove()}},[]),x.useEffect(function(){Mt.isHiddenScrollBar||Bt(function(Ut){var it,mt;return Object(Q.a)(Object(Q.a)({},Ut),{},{scrollLeft:Xe.current.scrollLeft/((it=Xe.current)===null||it===void 0?void 0:it.scrollWidth)*((mt=Xe.current)===null||mt===void 0?void 0:mt.clientWidth)})})},[Mt.isHiddenScrollBar]),Ce<=Ne||!De||Mt.isHiddenScrollBar?null:x.createElement("div",{style:{height:Object(i.a)(),width:Ne,bottom:Fe},className:"".concat(_e,"-sticky-scroll")},x.createElement("div",{onMouseDown:Ve,ref:rt,className:w()("".concat(_e,"-sticky-scroll-bar"),Object(ue.a)({},"".concat(_e,"-sticky-scroll-bar-active"),pt)),style:{width:"".concat(De,"px"),transform:"translate3d(".concat(Mt.scrollLeft,"px, 0, 0)")}}))},k=x.forwardRef(ee);function U(He,Be){return x.useMemo(function(){var Ze=!!He;return{isSticky:Ze,stickyClassName:Ze?"".concat(Be,"-sticky-header"):"",offsetHeader:Object(S.a)(He)==="object"&&He.offsetHeader||0,offsetScroll:Object(S.a)(He)==="object"&&He.offsetScroll||0}},[He,Be])}var q=[],Y={},J="rc-table-internal-hook",be=x.memo(function(He){var Be=He.children;return Be},function(He,Be){return p()(He.props,Be.props)?He.pingLeft!==Be.pingLeft||He.pingRight!==Be.pingRight:!1});function ke(He){var Be,Ze=He.prefixCls,ht=He.className,Qe=He.rowClassName,Xe=He.style,Ke=He.data,Fe=He.rowKey,Ue=He.scroll,_e=He.tableLayout,Ce=He.direction,Ne=He.title,De=He.footer,rt=He.summary,tt=He.id,xt=He.showHeader,Mt=He.components,Bt=He.emptyText,It=He.onRow,Dt=He.onHeaderRow,lt=He.internalHooks,pt=He.transformColumns,ut=He.internalRefs,Pe=He.sticky,Ve=Ke||q,yt=!!Ve.length,st=x.useState(0),Nt=Object(D.a)(st,2),Ut=Nt[0],it=Nt[1];x.useEffect(function(){it(Object(i.a)())});var mt=x.useMemo(function(){return Object(m.c)(Mt,{})},[Mt]),bt=x.useCallback(function(gt,Rt){return Object(m.b)(mt,gt)||Rt},[mt]),At=x.useMemo(function(){return typeof Fe=="function"?Fe:function(gt){var Rt=gt&>[Fe];return Rt}},[Fe]),Xt=Object(C.c)(He),Ae=Xt.expandIcon,ge=Xt.expandedRowKeys,z=Xt.defaultExpandedRowKeys,Z=Xt.defaultExpandAllRows,oe=Xt.expandedRowRender,me=Xt.onExpand,Re=Xt.onExpandedRowsChange,Je=Xt.expandRowByClick,at=Xt.rowExpandable,kt=Xt.expandIconColumnIndex,jt=Xt.expandedRowClassName,ot=Xt.childrenColumnName,wt=Xt.indentSize,Kt=Ae||le,Et=ot||"children",Qt=x.useMemo(function(){return oe?"row":He.expandable&<===J&&He.expandable.__PARENT_RENDER_ICON__||Ve.some(function(gt){return gt&&Object(S.a)(gt)==="object"&>[Et]})?"nest":!1},[!!oe,Ve]),Vt=x.useState(function(){return z||(Z?Oe(Ve,At,Et):[])}),ie=Object(D.a)(Vt,2),N=ie[0],B=ie[1],ae=x.useMemo(function(){return new Set(ge||N||[])},[ge,N]),fe=x.useCallback(function(gt){var Rt=At(gt,Ve.indexOf(gt)),Ht,mn=ae.has(Rt);mn?(ae.delete(Rt),Ht=Object(j.a)(ae)):Ht=[].concat(Object(j.a)(ae),[Rt]),B(Ht),me&&me(!mn,gt),Re&&Re(Ht)},[At,ae,Ve,me,Re]),se=x.useState(0),$e=Object(D.a)(se,2),St=$e[0],Pt=$e[1],$t=Object(Te.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},He),Xt),{},{expandable:!!oe,expandedKeys:ae,getRowKey:At,onTriggerExpand:fe,expandIcon:Kt,expandIconColumnIndex:kt,direction:Ce}),lt===J?pt:null),Ot=Object(D.a)($t,2),zt=Ot[0],an=Ot[1],jn=x.useMemo(function(){return{columns:zt,flattenColumns:an}},[zt,an]),Dr=x.useRef(),Cr=x.useRef(),Nn=x.useRef(),hr=x.useState(!1),mi=Object(D.a)(hr,2),Or=mi[0],yr=mi[1],pr=x.useState(!1),Yr=Object(D.a)(pr,2),Mr=Yr[0],Zr=Yr[1],wr=Ee(new Map),vi=Object(D.a)(wr,2),li=vi[0],Kr=vi[1],zr=Object(m.a)(an),xi=zr.map(function(gt){return li.get(gt)}),gi=x.useMemo(function(){return xi},[xi.join("_")]),Si=je(gi,an.length,Ce),Fn=Ue&&Object(m.d)(Ue.y),Sn=Ue&&Object(m.d)(Ue.x),_r=Sn&&an.some(function(gt){var Rt=gt.fixed;return Rt}),zn=x.useRef(),Lr=U(Pe,Ze),rr=Lr.isSticky,Ri=Lr.offsetHeader,Pr=Lr.offsetScroll,ni=Lr.stickyClassName,ji,ui,Di;Fn&&(ui={overflowY:"scroll",maxHeight:Ue.y}),Sn&&(ji={overflowX:"auto"},Fn||(ui={overflowY:"hidden"}),Di={width:Ue.x===!0?"auto":Ue.x,minWidth:"100%"});var ta=x.useCallback(function(gt,Rt){Kr(function(Ht){var mn=new Map(Ht);return mn.set(gt,Rt),mn})},[]),ci=xe(null),Fi=Object(D.a)(ci,2),Ci=Fi[0],zi=Fi[1];function qi(gt,Rt){if(!Rt)return;typeof Rt=="function"?Rt(gt):Rt.scrollLeft!==gt&&(Rt.scrollLeft=gt)}var yi=function(Rt){var Ht=Rt.currentTarget,mn=Rt.scrollLeft,fn=typeof mn=="number"?mn:Ht.scrollLeft,Ct=Ht||Y;if(!zi()||zi()===Ct){var _t;Ci(Ct),qi(fn,Cr.current),qi(fn,Nn.current),qi(fn,(_t=zn.current)===null||_t===void 0?void 0:_t.setScrollLeft)}if(Ht){var Zt=Ht.scrollWidth,Tt=Ht.clientWidth;yr(fn>0),Zr(fn0?[].concat(Object(Q.a)(h),Object(Q.a)(u(c).map(function(m){return Object(j.a)({fixed:n},m)}))):[].concat(Object(Q.a)(h),[Object(j.a)(Object(j.a)({},r),{},{fixed:n})])},[])}function o(s){for(var h=!0,r=0;r=0;c-=1){var m=s[c];if(n&&m.fixed!=="right")n=!1;else if(!n&&m.fixed==="right"){Object(T.a)(!1,"Index ".concat(c+1," of `columns` missing `fixed='right'` prop."));break}}}function i(s){return s.map(function(h){var r=h.fixed,t=Object(S.a)(h,["fixed"]),n=r;return r==="left"?n="right":r==="right"&&(n="left"),Object(j.a)({fixed:n},t)})}function l(s,h){var r=s.prefixCls,t=s.columns,n=s.children,c=s.expandable,m=s.expandedKeys,v=s.getRowKey,b=s.onTriggerExpand,E=s.expandIcon,g=s.rowExpandable,y=s.expandIconColumnIndex,C=s.direction,d=s.expandRowByClick,_=D.useMemo(function(){return t||p(n)},[t,n]),O=D.useMemo(function(){if(c){var I,W=y||0,K=_[W],te=(I={},Object(ue.a)(I,f.a,{className:"".concat(r,"-expand-icon-col")}),Object(ue.a)(I,"title",""),Object(ue.a)(I,"fixed",K?K.fixed:null),Object(ue.a)(I,"className","".concat(r,"-row-expand-icon-cell")),Object(ue.a)(I,"render",function(V,re,$){var ne=v(re,$),he=m.has(ne),pe=g?g(re):!0,Te=E({prefixCls:r,expanded:he,expandable:pe,record:re,onExpand:b});return d?D.createElement("span",{onClick:function(Me){return Me.stopPropagation()}},Te):Te}),I),H=_.slice();return W>=0&&H.splice(W,0,te),H}return _},[c,_,v,m,E,C]),A=D.useMemo(function(){var I=O;return h&&(I=h(I)),I.length||(I=[{render:function(){return null}}]),I},[h,O,C]),P=D.useMemo(function(){return C==="rtl"?i(u(A)):u(A)},[A,C]);return[A,P]}Le.b=l},wW8i:function(nt,Le,F){nt.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(nt,Le,F){"use strict";F.d(Le,"a",function(){return u}),F.d(Le,"b",function(){return i});var ue=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},j={cssFloat:1,styleFloat:1,float:1};function S(l){return l.nodeType===1?l.ownerDocument.defaultView.getComputedStyle(l,null):{}}function D(l,s,h){if(s=s.toLowerCase(),h==="auto"){if(s==="height")return l.offsetHeight;if(s==="width")return l.offsetWidth}return s in Q||(Q[s]=ue.test(s)),Q[s]?parseFloat(h)||0:h}function x(l,s){var h=arguments.length,r=S(l);return s=j[s]?"cssFloat"in l.style?"cssFloat":"styleFloat":s,h===1?r:D(l,s,r[s]||l.style[s])}function T(l,s,h){var r=arguments.length;if(s=j[s]?"cssFloat"in l.style?"cssFloat":"styleFloat":s,r===3)return typeof h=="number"&&ue.test(s)&&(h="".concat(h,"px")),l.style[s]=h,h;for(var t in s)s.hasOwnProperty(t)&&T(l,t,s[t]);return S(l)}function w(l){return l===document.body?document.documentElement.clientWidth:l.offsetWidth}function f(l){return l===document.body?window.innerHeight||document.documentElement.clientHeight:l.offsetHeight}function p(){var l=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:l,height:s}}function u(){var l=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:l,height:s}}function o(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function i(l){var s=l.getBoundingClientRect(),h=document.documentElement;return{left:s.left+(window.pageXOffset||h.scrollLeft)-(h.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||h.scrollTop)-(h.clientTop||document.body.clientTop||0)}}},ynwM:function(nt,Le,F){var ue=F("MFOe"),Q=ue.Global;nt.exports={name:"oldFF-globalStorage",read:S,write:D,each:x,remove:T,clearAll:w};var j=Q.globalStorage;function S(f){return j[f]}function D(f,p){j[f]=p}function x(f){for(var p=j.length-1;p>=0;p--){var u=j.key(p);f(j[u],u)}}function T(f){return j.removeItem(f)}function w(){x(function(f,p){delete j[f]})}}}]);