(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',N}(Xe),tt=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.strokeColor=fe.defaultColor,se.strokeWidth=fe.defaultStrokeWidth,se.strokeDasharray=fe.defaultStrokeDasharray,se.fillColor=fe.defaultFillColor,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.setOpacity=se.setOpacity.bind(se),se.createVisual=se.createVisual.bind(se),se.strokePanel=new ee("Line color",Ee(fe.defaultColorSet,["transparent"]),fe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new ee("Fill color",Ee(fe.defaultColorSet,["transparent"]),se.fillColor,De),se.fillPanel.onColorChanged=se.setFillColor,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.opacityPanel=new Ce("Opacity",fe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,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.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},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,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).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.fillColorChanged(B),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.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.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ie.prototype.getState.call(this));return B.typeName=N.typeName,B},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.typeName="EllipseMarker",N.title="Ellipse marker",N.icon='',N}(J),xt=function(ie){function N(B,ae,fe){return ie.call(this,B,ae,fe)||this}return Te(N,ie),Object.defineProperty(N.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(B){return!(!ie.prototype.ownsTarget.call(this,B)&&B!==this.tip1&&B!==this.tip2)},N.prototype.createTips=function(){this.tip1=xe.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=xe.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(xe.createTransform()),this.visual.appendChild(this.tip2)},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.tip1&&this.tip2&&(xe.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),xe.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var 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?`
`:"")+""+n+">",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?"/":"",l=f.getOption("autoCloseTags"),s=typeof l=="object"&&l.dontIndentOnSlash,h=0;h"&&(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]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable: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","?(?:tag)(?: +|\\n|/?>)|<(?: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","?(?:tag)(?: +|\\n|/?>)|<(?: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","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.pedantic=Me({},Ee.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\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:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\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:-]*\\s*>|^<[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+"
`},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+""+De+`>
`},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+""),`
`},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+""+Ne+`>
`},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='"+Ne+"",De},Fe.image=function(_e,Ce,Ne){if(_e=qe(this.options.sanitize,this.options.baseUrl,_e),_e===null)return Ne;var De='
":">",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(".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(".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(".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(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"+s+'>'),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",/^"),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",void(Y.state=U.TEXT);if(Y.script){if(Y.tagName!=="script")return Y.script+=""+Y.tagName+">",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+=""+Y.tagName+">",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+=""+J.tagName,J.tagName="",J.state=U.SCRIPT):(d(ke)||V(J,"Invalid tagname in closing tag"),J.state=U.CLOSE_TAG_SAW_WHITE);else{if(d(ke))continue;P(Ie,ke)?J.script?(J.script+=""+ke,J.state=U.SCRIPT):V(J,"Invalid tagname in closing tag."):J.tagName=ke}continue;case U.CLOSE_TAG_SAW_WHITE:if(d(ke))continue;ke===">"?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(">"+E.name+">"):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(""+E.name+">");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+""+E.name+">")}return this.stream.write(this.endline(E))},b.prototype.processingInstruction=function(E,g){return this.stream.write(this.space(g)+""+E.target),E.value&&this.stream.write(" "+E.value),this.stream.write(this.spacebeforeslash+"?>"+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+=">"+E.name+">"+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+=""+E.name+">"+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)+""+E.target,E.value&&(y+=" "+E.value),y+=this.spacebeforeslash+"?>"+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)+""+E.name+">"+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