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

    ".concat(ye,"

    "):'
    ').concat(we?ye:Object(l.escape)(ye,!0),`
    `):'
    '+(we?ye:Object(l.escape)(ye,!0))+"
    "},u.heading=function(ye,pe,we){var fe=this.options.headerPrefix+we.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:fe,level:pe,text:ye}),"'+ye+""},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:b,renderer:u});var I=f.a,F=B("SJMd"),z=B("ulZh"),ne=B.n(z),j=B("m3rI"),G=B("Oy/b"),X=B("p5ED"),Z=B("8hTe"),K=B.n(Z),q=/]*>/g;function ie(ye){var pe=document.createElement("div");return pe.innerHTML=ye,pe.childNodes.length===0?"":pe.childNodes[0].nodeValue}var oe=Ke.a=function(ye){var pe=ye.value,we=pe===void 0?"":pe,fe=ye.edit,Te=fe===void 0?!1:fe,Fe=ye.className,De=ye.showTextOnly,Me=ye.showLines,Ue=ye.replaces,ve=ye.zoomImg,ce=ye.hasMask,Ie=ye.style,Ne=Ie===void 0?{}:Ie,Xe=ye.stylesPrev,ee=Xe===void 0?{}:Xe,k=String(we),N=Object(C.useRef)(),$=Object(C.useRef)(),V=Object(C.useState)(""),Y=Object(S.a)(V,2),me=Y[0],Ae=Y[1],at=Object(C.useState)("office"),Le=Object(S.a)(at,2),ke=Le[0],Ye=Le[1],Ze=Object(C.useMemo)(function(){try{var Oe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,he=/\"\/api\/attachments\/|\"\/attachments\/download\//g,be=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;k=k.replace(Oe,"("+j.a.API_SERVER+"/api/attachments/").replace(he,'"'+j.a.API_SERVER+"/api/attachments/").replace(be,'"'+j.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(Qe){}var Ce=I(k),xe=E();if(k.match(/\[TOC\]/)&&(Ce=Ce.replace("

    [TOC]

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

    "+he+`

    `},Re.table=function(he,be){return be&&(be=""+be+""),` `+he+` `+be+`
    `},Re.tablerow=function(he){return` `+he+` `},Re.tablecell=function(he,be){var Ce=be.header?"th":"td",xe=be.align?"<"+Ce+' align="'+be.align+'">':"<"+Ce+">";return xe+he+" `},Re.strong=function(he){return""+he+""},Re.em=function(he){return""+he+""},Re.codespan=function(he){return""+he+""},Re.br=function(){return this.options.xhtml?"
    ":"
    "},Re.del=function(he){return""+he+""},Re.link=function(he,be,Ce){if(he=Xe(this.options.sanitize,this.options.baseUrl,he),he===null)return Ce;var xe='",xe},Re.image=function(he,be,Ce){if(he=Xe(this.options.sanitize,this.options.baseUrl,he),he===null)return Ce;var xe=''+Ce+'":">",xe},Re.text=function(he){return he},Pe}(),N=function(){function Pe(){}var Re=Pe.prototype;return Re.strong=function(he){return he},Re.em=function(he){return he},Re.codespan=function(he){return he},Re.del=function(he){return he},Re.html=function(he){return he},Re.text=function(he){return he},Re.link=function(he,be,Ce){return""+Ce},Re.image=function(he,be,Ce){return""+Ce},Re.br=function(){return""},Pe}(),$=function(){function Pe(){this.seen={}}var Re=Pe.prototype;return Re.slug=function(he){var be=he.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(be)){var Ce=be;do this.seen[Ce]++,be=Ce+"-"+this.seen[Ce];while(this.seen.hasOwnProperty(be))}return this.seen[be]=0,be},Pe}(),V=C.defaults,Y=ne.unescape,me=function(){function Pe(Oe){this.options=Oe||V,this.options.renderer=this.options.renderer||new k,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new N,this.slugger=new $}Pe.parse=function(he,be){var Ce=new Pe(be);return Ce.parse(he)};var Re=Pe.prototype;return Re.parse=function(he,be){be===void 0&&(be=!0);var Ce="",xe,Be,Qe,rt,dt,xt,_t,wt,st,ut,$e,_e,je,ct,et,At,Ct,lt,gt=he.length;for(xe=0;xe0&&et.tokens[0].type==="text"?(et.tokens[0].text=lt+" "+et.tokens[0].text,et.tokens[0].tokens&&et.tokens[0].tokens.length>0&&et.tokens[0].tokens[0].type==="text"&&(et.tokens[0].tokens[0].text=lt+" "+et.tokens[0].tokens[0].text)):et.tokens.unshift({type:"text",text:lt}):ct+=lt),ct+=this.parse(et.tokens,je),st+=this.renderer.listitem(ct,Ct,At);Ce+=this.renderer.list(st,$e,_e);continue}case"html":{Ce+=this.renderer.html(ut.text);continue}case"paragraph":{Ce+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(st=ut.tokens?this.parseInline(ut.tokens):ut.text;xe+1An error occurred:

    "+Le(Qe.message+"",!0)+"
    ";throw Qe}}Ve.options=Ve.setOptions=function(Pe){return Ae(Ve.defaults,Pe),Ye(Ve.defaults),Ve},Ve.getDefaults=ke,Ve.defaults=Ze,Ve.use=function(Pe){var Re=Ae({},Pe);if(Pe.renderer&&function(){var he=Ve.defaults.renderer||new k,be=function(Be){var Qe=he[Be];he[Be]=function(){for(var rt=arguments.length,dt=new Array(rt),xt=0;xt=0;a--){if(!U(l[a]))continue;var c=l[a].split("="),s=unescape(c[0]),u=unescape(c[1]);f(u,s)}}function C(f,l){if(!f)return;w.cookie=escape(f)+"="+escape(l)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function T(f){if(!f||!p(f))return;w.cookie=escape(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function h(){S(function(f,l){T(l)})}function p(f){return new RegExp("(?:^|;\\s*)"+escape(f).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(w.cookie)}},E2g8:function(Je,Ke,B){(function(ae,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(U,w){Je.exports=w()})(this,function(){"use strict";function U(k){var N=typeof k;return k!==null&&(N==="object"||N==="function")}function w(k){return typeof k=="function"}var P=void 0;Array.isArray?P=Array.isArray:P=function(k){return Object.prototype.toString.call(k)==="[object Array]"};var S=P,C=0,T=void 0,h=void 0,p=function(N,$){y[C]=N,y[C+1]=$,C+=2,C===2&&(h?h(_):g())};function f(k){h=k}function l(k){p=k}var a=typeof window!="undefined"?window:void 0,c=a||{},s=c.MutationObserver||c.WebKitMutationObserver,u=typeof self=="undefined"&&typeof ae!="undefined"&&{}.toString.call(ae)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function n(){return function(){return ae.nextTick(_)}}function t(){return typeof T!="undefined"?function(){T(_)}:b()}function d(){var k=0,N=new s(_),$=document.createTextNode("");return N.observe($,{characterData:!0}),function(){$.data=k=++k%2}}function v(){var k=new MessageChannel;return k.port1.onmessage=_,function(){return k.port2.postMessage(0)}}function b(){var k=setTimeout;return function(){return k(_,1)}}var y=new Array(1e3);function _(){for(var k=0;k`,triples:"",explode:"[]{}"},U=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(s,u,i){i&&i!=ae.Init&&(s.removeKeyMap(P),s.state.closeBrackets=null),u&&(S(w(u,"pairs")),s.state.closeBrackets=u,s.addKeyMap(P))});function w(s,u){return u=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[u]!=null?s[u]:Q[u]}var P={Backspace:h,Enter:p};function S(s){for(var u=0;u=0;t--){var v=n[t].head;s.replaceRange("",U(v.line,v.ch-1),U(v.line,v.ch+1),"+delete")}}function p(s){var u=T(s),i=u&&w(u,"explode");if(!i||s.getOption("disableInput"))return ae.Pass;for(var n=s.listSelections(),t=0;t0;return{anchor:new U(s.anchor.line,s.anchor.ch+(u?-1:1)),head:new U(s.head.line,s.head.ch+(u?1:-1))}}function l(s,u){var i=T(s);if(!i||s.getOption("disableInput"))return ae.Pass;var n=w(i,"pairs"),t=n.indexOf(u);if(t==-1)return ae.Pass;for(var d=w(i,"closeBefore"),v=w(i,"triples"),b=n.charAt(t+1)==u,y=s.listSelections(),_=t%2==0,m,g=0;g=0&&s.getRange(o,U(o.line,o.ch+3))==u+u+u?x="skipThree":x="skip";else if(b&&o.ch>1&&v.indexOf(u)>=0&&s.getRange(U(o.line,o.ch-2),o)==u+u){if(o.ch>2&&/\bstring/.test(s.getTokenTypeAt(U(o.line,o.ch-2))))return ae.Pass;x="addFour"}else if(b){var O=o.ch==0?" ":s.getRange(U(o.line,o.ch-1),o);if(!ae.isWordChar(A)&&O!=u&&!ae.isWordChar(O))x="both";else return ae.Pass}else if(_&&(A.length===0||/\s/.test(A)||d.indexOf(A)>-1))x="both";else return ae.Pass;if(!m)m=x;else if(m!=x)return ae.Pass}var D=t%2?n.charAt(t-1):u,I=t%2?u:n.charAt(t+1);s.operation(function(){if(m=="skip")s.execCommand("goCharRight");else if(m=="skipThree")for(var F=0;F<3;F++)s.execCommand("goCharRight");else if(m=="surround"){for(var z=s.getSelections(),F=0;F ").concat(J);if(Se.ENABLE_CALLBACK&&Se.emitter.emit("log","error",te),!Se.ENABLE_ERROR)return;console.error?console.error(te):console.warn?console.warn(te):console.log(te)}},{key:"i",value:function(W,J){(!W||Se.FORCE_GLOBAL_TAG)&&(W=Se.GLOBAL_TAG);var te="[".concat(W,"] > ").concat(J);if(Se.ENABLE_CALLBACK&&Se.emitter.emit("log","info",te),!Se.ENABLE_INFO)return;console.info?console.info(te):console.log(te)}},{key:"w",value:function(W,J){(!W||Se.FORCE_GLOBAL_TAG)&&(W=Se.GLOBAL_TAG);var te="[".concat(W,"] > ").concat(J);if(Se.ENABLE_CALLBACK&&Se.emitter.emit("log","warn",te),!Se.ENABLE_WARN)return;console.warn?console.warn(te):console.log(te)}},{key:"d",value:function(W,J){(!W||Se.FORCE_GLOBAL_TAG)&&(W=Se.GLOBAL_TAG);var te="[".concat(W,"] > ").concat(J);if(Se.ENABLE_CALLBACK&&Se.emitter.emit("log","debug",te),!Se.ENABLE_DEBUG)return;console.debug?console.debug(te):console.log(te)}},{key:"v",value:function(W,J){(!W||Se.FORCE_GLOBAL_TAG)&&(W=Se.GLOBAL_TAG);var te="[".concat(W,"] > ").concat(J);if(Se.ENABLE_CALLBACK&&Se.emitter.emit("log","verbose",te),!Se.ENABLE_VERBOSE)return;console.log(te)}}]),Se}();C.GLOBAL_TAG="flv.js",C.FORCE_GLOBAL_TAG=!1,C.ENABLE_ERROR=!0,C.ENABLE_INFO=!0,C.ENABLE_WARN=!0,C.ENABLE_DEBUG=!0,C.ENABLE_VERBOSE=!0,C.ENABLE_CALLBACK=!1,C.emitter=new S.a;var T=C,h=function(){function Se(){Object(ae.a)(this,Se),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)(Se,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(W){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=W,this._totalBytes+=W):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=W,this._totalBytes+=W):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=W,this._totalBytes+=W,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var W=(this._now()-this._lastCheckpoint)/1e3;return W==0&&(W=1),this._intervalBytes/W/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 W=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/W/1024}}]),Se}(),p=h,f=B("yKVA"),l=B("879j"),a=function(){function Se(de){Object(ae.a)(this,Se),this._message=de}return Object(Q.a)(Se,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Se}(),c=function(Se){Object(f.a)(W,Se);var de=Object(l.a)(W);function W(J){return Object(ae.a)(this,W),de.call(this,J)}return Object(Q.a)(W,[{key:"name",get:function(){return"IllegalStateException"}}]),W}(a),s=function(Se){Object(f.a)(W,Se);var de=Object(l.a)(W);function W(J){return Object(ae.a)(this,W),de.call(this,J)}return Object(Q.a)(W,[{key:"name",get:function(){return"InvalidArgumentException"}}]),W}(a),u=function(Se){Object(f.a)(W,Se);var de=Object(l.a)(W);function W(J){return Object(ae.a)(this,W),de.call(this,J)}return Object(Q.a)(W,[{key:"name",get:function(){return"NotImplementedException"}}]),W}(a),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},n={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},t=function(){function Se(de){Object(ae.a)(this,Se),this._type=de||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(Q.a)(Se,[{key:"destroy",value:function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===i.kConnecting||this._status===i.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(W){this._onContentLengthKnown=W}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(W){this._onURLRedirect=W}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(W){this._onDataArrival=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onComplete",get:function(){return this._onComplete},set:function(W){this._onComplete=W}},{key:"open",value:function(W,J){throw new u("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new u("Unimplemented abstract function!")}}]),Se}(),d=B("oZsa");function v(Se,de){for(;!Object.prototype.hasOwnProperty.call(Se,de)&&!(Se=Object(d.a)(Se),Se===null););return Se}function b(Se,de,W){return typeof Reflect!="undefined"&&Reflect.get?b=Reflect.get:b=function(te,se,Ee){var ze=v(te,se);if(!ze)return;var qe=Object.getOwnPropertyDescriptor(ze,se);return qe.get?qe.get.call(Ee):qe.value},b(Se,de,W||Se)}var y={};function _(){var Se=self.navigator.userAgent.toLowerCase(),de=/(edge)\/([\w.]+)/.exec(Se)||/(opr)[\/]([\w.]+)/.exec(Se)||/(chrome)[ \/]([\w.]+)/.exec(Se)||/(iemobile)[\/]([\w.]+)/.exec(Se)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Se)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Se)||/(webkit)[ \/]([\w.]+)/.exec(Se)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Se)||/(msie) ([\w.]+)/.exec(Se)||Se.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Se)||Se.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Se)||[],W=/(ipad)/.exec(Se)||/(ipod)/.exec(Se)||/(windows phone)/.exec(Se)||/(iphone)/.exec(Se)||/(kindle)/.exec(Se)||/(android)/.exec(Se)||/(windows)/.exec(Se)||/(mac)/.exec(Se)||/(linux)/.exec(Se)||/(cros)/.exec(Se)||[],J={browser:de[5]||de[3]||de[1]||"",version:de[2]||de[4]||"0",majorVersion:de[4]||de[2]||"0",platform:W[0]||""},te={};if(J.browser){te[J.browser]=!0;var se=J.majorVersion.split(".");te.version={major:parseInt(J.majorVersion,10),string:J.version},se.length>1&&(te.version.minor=parseInt(se[1],10)),se.length>2&&(te.version.build=parseInt(se[2],10))}if(J.platform&&(te[J.platform]=!0),(te.chrome||te.opr||te.safari)&&(te.webkit=!0),te.rv||te.iemobile){te.rv&&delete te.rv;var Ee="msie";J.browser=Ee,te[Ee]=!0}if(te.edge){delete te.edge;var ze="msedge";J.browser=ze,te[ze]=!0}if(te.opr){var qe="opera";J.browser=qe,te[qe]=!0}if(te.safari&&te.android){var St="android";J.browser=St,te[St]=!0}te.name=J.browser,te.platform=J.platform;for(var Lt in y)y.hasOwnProperty(Lt)&&delete y[Lt];Object.assign(y,te)}_();var m=y,g=function(Se){Object(f.a)(W,Se);var de=Object(l.a)(W);function W(J,te){var se;return Object(ae.a)(this,W),se=de.call(this,"fetch-stream-loader"),se.TAG="FetchStreamLoader",se._seekHandler=J,se._config=te,se._needStash=!0,se._requestAbort=!1,se._contentLength=null,se._receivedLength=0,se}return Object(Q.a)(W,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),b(Object(d.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function(te,se){var Ee=this;this._dataSource=te,this._range=se;var ze=te.url;this._config.reuseRedirectedURL&&te.redirectedURL!=null&&(ze=te.redirectedURL);var qe=this._seekHandler.getConfig(ze,se),St=new self.Headers;if(typeof qe.headers=="object"){var Lt=qe.headers;for(var it in Lt)Lt.hasOwnProperty(it)&&St.append(it,Lt[it])}var Tt={method:"GET",headers:St,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Qt in this._config.headers)St.append(Qt,this._config.headers[Qt]);te.cors===!1&&(Tt.mode="same-origin"),te.withCredentials&&(Tt.credentials="include"),te.referrerPolicy&&(Tt.referrerPolicy=te.referrerPolicy),this._status=i.kConnecting,self.fetch(qe.url,Tt).then(function(Et){if(Ee._requestAbort){Ee._requestAbort=!1,Ee._status=i.kIdle;return}if(Et.ok&&Et.status>=200&&Et.status<=299){if(Et.url!==qe.url&&Ee._onURLRedirect){var nn=Ee._seekHandler.removeURLParameters(Et.url);Ee._onURLRedirect(nn)}var Jt=Et.headers.get("Content-Length");return Jt!=null&&(Ee._contentLength=parseInt(Jt),Ee._contentLength!==0&&(Ee._onContentLengthKnown&&Ee._onContentLengthKnown(Ee._contentLength))),Ee._pump.call(Ee,Et.body.getReader())}else if(Ee._status=i.kError,Ee._onError)Ee._onError(n.HTTP_STATUS_CODE_INVALID,{code:Et.status,msg:Et.statusText});else throw new a("FetchStreamLoader: Http code invalid, "+Et.status+" "+Et.statusText)}).catch(function(Et){if(Ee._status=i.kError,Ee._onError)Ee._onError(n.EXCEPTION,{code:-1,msg:Et.message});else throw Et})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(te){var se=this;return te.read().then(function(Ee){if(Ee.done)if(se._contentLength!==null&&se._receivedLength=15048,se=m.msedge?te:!0;return self.fetch&&self.ReadableStream&&se}catch(Ee){return!1}}}]),W}(t),E=g,o=function(Se){Object(f.a)(W,Se);var de=Object(l.a)(W);function W(J,te){var se;return Object(ae.a)(this,W),se=de.call(this,"xhr-moz-chunked-loader"),se.TAG="MozChunkedLoader",se._seekHandler=J,se._config=te,se._needStash=!0,se._xhr=null,se._requestAbort=!1,se._contentLength=null,se._receivedLength=0,se}return Object(Q.a)(W,[{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),b(Object(d.a)(W.prototype),"destroy",this).call(this)}},{key:"open",value:function(te,se){this._dataSource=te,this._range=se;var Ee=te.url;this._config.reuseRedirectedURL&&te.redirectedURL!=null&&(Ee=te.redirectedURL);var ze=this._seekHandler.getConfig(Ee,se);this._requestURL=ze.url;var qe=this._xhr=new XMLHttpRequest;if(qe.open("GET",ze.url,!0),qe.responseType="moz-chunked-arraybuffer",qe.onreadystatechange=this._onReadyStateChange.bind(this),qe.onprogress=this._onProgress.bind(this),qe.onloadend=this._onLoadEnd.bind(this),qe.onerror=this._onXhrError.bind(this),te.withCredentials&&(qe.withCredentials=!0),typeof ze.headers=="object"){var St=ze.headers;for(var Lt in St)St.hasOwnProperty(Lt)&&qe.setRequestHeader(Lt,St[Lt])}if(typeof this._config.headers=="object"){var it=this._config.headers;for(var Tt in it)it.hasOwnProperty(Tt)&&qe.setRequestHeader(Tt,it[Tt])}this._status=i.kConnecting,qe.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.kComplete}},{key:"_onReadyStateChange",value:function(te){var se=te.target;if(se.readyState===2){if(se.responseURL!=null&&se.responseURL!==this._requestURL&&this._onURLRedirect){var Ee=this._seekHandler.removeURLParameters(se.responseURL);this._onURLRedirect(Ee)}if(se.status!==0&&(se.status<200||se.status>299))if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:se.status,msg:se.statusText});else throw new a("MozChunkedLoader: Http code invalid, "+se.status+" "+se.statusText);else this._status=i.kBuffering}}},{key:"_onProgress",value:function(te){if(this._status===i.kError)return;this._contentLength===null&&(te.total!==null&&te.total!==0&&(this._contentLength=te.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var se=te.target.response,Ee=this._range.from+this._receivedLength;this._receivedLength+=se.byteLength,this._onDataArrival&&this._onDataArrival(se,Ee,this._receivedLength)}},{key:"_onLoadEnd",value:function(te){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===i.kError)return;this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(te){this._status=i.kError;var se=0,Ee=null;if(this._contentLength&&te.loaded=200&&se.status<=299){if(this._status=i.kBuffering,se.responseURL!=null){var Ee=this._seekHandler.removeURLParameters(se.responseURL);se.responseURL!==this._currentRequestURL&&Ee!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ee,this._onURLRedirect&&this._onURLRedirect(Ee))}var ze=se.getResponseHeader("Content-Length");if(ze!=null&&this._contentLength==null){var qe=parseInt(ze);qe>0&&(this._contentLength=qe,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:se.status,msg:se.statusText});else throw new a("MSStreamLoader: Http code invalid, "+se.status+" "+se.statusText);else if(se.readyState===3&&(se.status>=200&&se.status<=299)){this._status=i.kBuffering;var St=se.response;this._reader.readAsArrayBuffer(St)}}},{key:"_xhrOnError",value:function(te){this._status=i.kError;var se=n.EXCEPTION,Ee={code:-1,msg:te.constructor.name+" "+te.type};if(this._onError)this._onError(se,Ee);else throw new a(Ee.msg)}},{key:"_msrOnProgress",value:function(te){var se=te.target,Ee=se.result;if(Ee==null){this._doReconnectIfNeeded();return}var ze=Ee.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Ee.byteLength;var qe=this._totalRange.from+this._receivedLength;this._receivedLength+=ze.byteLength,this._onDataArrival&&this._onDataArrival(ze,qe,this._receivedLength),Ee.byteLength>=this._bufferLimit&&(T.v(this.TAG,"MSStream buffer exceeded max size near ".concat(qe+ze.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(Ee=this._range.from+this._contentLength-1)),this._currentRequestRange={from:se,to:Ee},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(te,se){this._lastTimeLoaded=0;var Ee=te.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ee=this._currentRedirectedURL:te.redirectedURL!=null&&(Ee=te.redirectedURL));var ze=this._seekHandler.getConfig(Ee,se);this._currentRequestURL=ze.url;var qe=this._xhr=new XMLHttpRequest;if(qe.open("GET",ze.url,!0),qe.responseType="arraybuffer",qe.onreadystatechange=this._onReadyStateChange.bind(this),qe.onprogress=this._onProgress.bind(this),qe.onload=this._onLoad.bind(this),qe.onerror=this._onXhrError.bind(this),te.withCredentials&&(qe.withCredentials=!0),typeof ze.headers=="object"){var St=ze.headers;for(var Lt in St)St.hasOwnProperty(Lt)&&qe.setRequestHeader(Lt,St[Lt])}if(typeof this._config.headers=="object"){var it=this._config.headers;for(var Tt in it)it.hasOwnProperty(Tt)&&qe.setRequestHeader(Tt,it[Tt])}qe.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=i.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(te){var se=te.target;if(se.readyState===2){if(se.responseURL!=null){var Ee=this._seekHandler.removeURLParameters(se.responseURL);se.responseURL!==this._currentRequestURL&&Ee!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ee,this._onURLRedirect&&this._onURLRedirect(Ee))}if(se.status>=200&&se.status<=299){if(this._waitForTotalLength)return;this._status=i.kBuffering}else if(this._status=i.kError,this._onError)this._onError(n.HTTP_STATUS_CODE_INVALID,{code:se.status,msg:se.statusText});else throw new a("RangeLoader: Http code invalid, "+se.status+" "+se.statusText)}}},{key:"_onProgress",value:function(te){if(this._status===i.kError)return;if(this._contentLength===null){var se=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,se=!0;var Ee=te.total;this._internalAbort(),Ee!=null&Ee!==0&&(this._totalLength=Ee)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,se){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var ze=te.loaded-this._lastTimeLoaded;this._lastTimeLoaded=te.loaded,this._speedSampler.addBytes(ze)}},{key:"_normalizeSpeed",value:function(te){var se=this._chunkSizeKBList,Ee=se.length-1,ze=0,qe=0,St=Ee;if(te=se[ze]&&te=3&&(se=this._speedSampler.currentKBps)),se!==0){var Ee=this._normalizeSpeed(se);this._currentSpeedNormalized!==Ee&&(this._currentSpeedNormalized=Ee,this._currentChunkSizeKB=Ee)}var ze=te.target.response,qe=this._range.from+this._receivedLength;this._receivedLength+=ze.byteLength;var St=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var ze=te.split("&"),qe=0;qe0;St[0]!==this._startName&&St[0]!==this._endName&&(Lt&&(Ee+="&"),Ee+=ze[qe])}return Ee.length===0?J:J+"?"+Ee}}]),Se}(),X=G,Z=function(){function Se(de,W,J){Object(ae.a)(this,Se),this.TAG="IOController",this._config=W,this._extraData=J,this._stashInitialSize=1024*384,W.stashInitialSize!=null&&W.stashInitialSize>0&&(this._stashInitialSize=W.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,W.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=de,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(de.url),this._refTotalLength=de.filesize?de.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)(Se,[{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(W){this._extraData=W}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(W){this._onDataArrival=W}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(W){this._onSeeked=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onComplete",get:function(){return this._onComplete},set:function(W){this._onComplete=W}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(W){this._onRedirect=W}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(W){this._onRecoveredEarlyEof=W}},{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 W=this._config;if(W.seekType==="range")this._seekHandler=new j(this._config.rangeLoadZeroStart);else if(W.seekType==="param"){var J=W.seekParamStart||"bstart",te=W.seekParamEnd||"bend";this._seekHandler=new X(J,te)}else if(W.seekType==="custom"){if(typeof W.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new W.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(W.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=z;else if(E.isSupported())this._loaderClass=E;else if(x.isSupported())this._loaderClass=x;else if(I.isSupported())this._loaderClass=I;else throw new a("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(W){this._currentRange={from:0,to:-1},W&&(this._currentRange.from=W),this._speedSampler.reset(),W||(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 W=this._resumeFrom;this._resumeFrom=0,this._internalSeek(W,!0)}}},{key:"seek",value:function(W){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(W,!0)}},{key:"_internalSeek",value:function(W,J){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(J),this._loader.destroy(),this._loader=null;var te={from:W,to:-1};this._currentRange={from:te.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,te),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(W){if(!W||typeof W!="string"||W.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=W}},{key:"_expandBuffer",value:function(W){for(var J=this._stashSize;J+1024*1024*10){var se=new Uint8Array(this._stashBuffer,0,this._stashUsed),Ee=new Uint8Array(te,0,J);Ee.set(se,0)}this._stashBuffer=te,this._bufferSize=J}},{key:"_normalizeSpeed",value:function(W){var J=this._speedNormalizeList,te=J.length-1,se=0,Ee=0,ze=te;if(W=J[se]&&W=512&&W<=1024?J=Math.floor(W*1.5):J=W*2,J>8192&&(J=8192);var te=J*1024+1024*1024*1;this._bufferSize0){var nn=this._stashBuffer.slice(0,this._stashUsed),Jt=this._dispatchChunks(nn,this._stashByteStart);if(Jt0){var It=new Uint8Array(nn,Jt);Et.set(It,0),this._stashUsed=It.byteLength,this._stashByteStart+=Jt}}else this._stashUsed=0,this._stashByteStart+=Jt;this._stashUsed+W.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+W.byteLength),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength}else{var yt=this._dispatchChunks(W,J);if(ytthis._bufferSize&&(this._expandBuffer(Sn),Et=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Et.set(new Uint8Array(W,yt),0),this._stashUsed+=Sn,this._stashByteStart=J+yt}}}else if(this._stashUsed===0){var ze=this._dispatchChunks(W,J);if(zethis._bufferSize&&this._expandBuffer(qe);var St=new Uint8Array(this._stashBuffer,0,this._bufferSize);St.set(new Uint8Array(W,ze),0),this._stashUsed+=qe,this._stashByteStart=J+ze}}else{this._stashUsed+W.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+W.byteLength);var Lt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Lt.set(new Uint8Array(W),this._stashUsed),this._stashUsed+=W.byteLength;var it=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(it0){var Tt=new Uint8Array(this._stashBuffer,it);Lt.set(Tt,0)}this._stashUsed-=it,this._stashByteStart+=it}}},{key:"_flushStashBuffer",value:function(W){if(this._stashUsed>0){var J=this._stashBuffer.slice(0,this._stashUsed),te=this._dispatchChunks(J,this._stashByteStart),se=J.byteLength-te;if(te0){var Ee=new Uint8Array(this._stashBuffer,0,this._bufferSize),ze=new Uint8Array(J,te);Ee.set(ze,0),this._stashUsed=ze.byteLength,this._stashByteStart+=te}return 0}return this._stashUsed=0,this._stashByteStart=0,se}return 0}},{key:"_onLoaderComplete",value:function(W,J){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(W,J){T.e(this.TAG,"Loader error, code = ".concat(J.code,", msg = ").concat(J.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,W=n.UNRECOVERABLE_EARLY_EOF);switch(W){case n.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var te=this._currentRange.to+1;te0){var J=Se.getConfig();W.emit("change",J)}}},{key:"registerListener",value:function(W){Se.emitter.addListener("change",W)}},{key:"removeListener",value:function(W){Se.emitter.removeListener("change",W)}},{key:"addLogListener",value:function(W){T.emitter.addListener("log",W),T.emitter.listenerCount("log")>0&&(T.ENABLE_CALLBACK=!0,Se._notifyChange())}},{key:"removeLogListener",value:function(W){T.emitter.removeListener("log",W),T.emitter.listenerCount("log")===0&&(T.ENABLE_CALLBACK=!1,Se._notifyChange())}}]),Se}();fe.emitter=new S.a;var Te=fe,Fe=function(){function Se(){Object(ae.a)(this,Se),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)(Se,[{key:"isComplete",value:function(){var W=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,J=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&&W&&J}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(W){if(this.keyframesIndex==null)return null;var J=this.keyframesIndex,te=this._search(J.times,W);return{index:te,milliseconds:J.times[te],fileposition:J.filepositions[te]}}},{key:"_search",value:function(W,J){var te=0,se=W.length-1,Ee=0,ze=0,qe=se;for(J=W[Ee]&&J=128){de.push(String.fromCharCode(se&65535)),J+=2;continue}}}else if(W[J]<240){if(Me(W,J,2)){var Ee=(W[J]&15)<<12|(W[J+1]&63)<<6|W[J+2]&63;if(Ee>=2048&&(Ee&63488)!==55296){de.push(String.fromCharCode(Ee&65535)),J+=3;continue}}}else if(W[J]<248&&Me(W,J,3)){var ze=(W[J]&7)<<18|(W[J+1]&63)<<12|(W[J+2]&63)<<6|W[J+3]&63;if(ze>65536&&ze<1114112){ze-=65536,de.push(String.fromCharCode(ze>>>10|55296)),de.push(String.fromCharCode(ze&1023|56320)),J+=4;continue}}}de.push(String.fromCharCode(65533)),++J}return de.join("")}var ve=Ue,ce=function(){var Se=new ArrayBuffer(2);return new DataView(Se).setInt16(0,256,!0),new Int16Array(Se)[0]===256}(),Ie=function(){function Se(){Object(ae.a)(this,Se)}return Object(Q.a)(Se,null,[{key:"parseScriptData",value:function(W,J,te){var se={};try{var Ee=Se.parseValue(W,J,te),ze=Se.parseValue(W,J+Ee.size,te-Ee.size);se[Ee.data]=ze.data}catch(qe){T.e("AMF",qe.toString())}return se}},{key:"parseObject",value:function(W,J,te){if(te<3)throw new c("Data not enough when parse ScriptDataObject");var se=Se.parseString(W,J,te),Ee=Se.parseValue(W,J+se.size,te-se.size),ze=Ee.objectEnd;return{data:{name:se.data,value:Ee.data},size:se.size+Ee.size,objectEnd:ze}}},{key:"parseVariable",value:function(W,J,te){return Se.parseObject(W,J,te)}},{key:"parseString",value:function(W,J,te){if(te<2)throw new c("Data not enough when parse String");var se=new DataView(W,J,te),Ee=se.getUint16(0,!ce),ze;return Ee>0?ze=ve(new Uint8Array(W,J+2,Ee)):ze="",{data:ze,size:2+Ee}}},{key:"parseLongString",value:function(W,J,te){if(te<4)throw new c("Data not enough when parse LongString");var se=new DataView(W,J,te),Ee=se.getUint32(0,!ce),ze;return Ee>0?ze=ve(new Uint8Array(W,J+4,Ee)):ze="",{data:ze,size:4+Ee}}},{key:"parseDate",value:function(W,J,te){if(te<10)throw new c("Data size invalid when parse Date");var se=new DataView(W,J,te),Ee=se.getFloat64(0,!ce),ze=se.getInt16(8,!ce);return Ee+=ze*60*1e3,{data:new Date(Ee),size:8+2}}},{key:"parseValue",value:function(W,J,te){if(te<1)throw new c("Data not enough when parse Value");var se=new DataView(W,J,te),Ee=1,ze=se.getUint8(0),qe,St=!1;try{switch(ze){case 0:qe=se.getFloat64(1,!ce),Ee+=8;break;case 1:{var Lt=se.getUint8(1);qe=!!Lt,Ee+=1;break}case 2:{var it=Se.parseString(W,J+1,te-1);qe=it.data,Ee+=it.size;break}case 3:{qe={};var Tt=0;for((se.getUint32(te-4,!ce)&16777215)===9&&(Tt=3);Ee32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(W<=this._current_word_bits_left){var J=this._current_word>>>32-W;return this._current_word<<=W,this._current_word_bits_left-=W,J}var te=this._current_word_bits_left?this._current_word:0;te=te>>>32-this._current_word_bits_left;var se=W-this._current_word_bits_left;this._fillCurrentWord();var Ee=Math.min(se,this._current_word_bits_left),ze=this._current_word>>>32-Ee;return this._current_word<<=Ee,this._current_word_bits_left-=Ee,te=te<>>W)!==0)return this._current_word<<=W,this._current_word_bits_left-=W,W;return this._fillCurrentWord(),W+this._skipLeadingZero()}},{key:"readUEG",value:function(){var W=this._skipLeadingZero();return this.readBits(W+1)-1}},{key:"readSEG",value:function(){var W=this.readUEG();return W&1?W+1>>>1:-1*(W>>>1)}}]),Se}(),ee=Xe,k=function(){function Se(){Object(ae.a)(this,Se)}return Object(Q.a)(Se,null,[{key:"_ebsp2rbsp",value:function(W){for(var J=W,te=J.byteLength,se=new Uint8Array(te),Ee=0,ze=0;ze=2&&(J[ze]===3&&J[ze-1]===0&&J[ze-2]===0))continue;se[Ee]=J[ze],Ee++}return new Uint8Array(se.buffer,0,Ee)}},{key:"parseSPS",value:function(W){var J=Se._ebsp2rbsp(W),te=new ee(J);te.readByte();var se=te.readByte();te.readByte();var Ee=te.readByte();te.readUEG();var ze=Se.getProfileString(se),qe=Se.getLevelString(Ee),St=1,Lt=420,it=[0,420,422,444],Tt=8;if((se===100||se===110||se===122||se===244||se===44||se===83||se===86||se===118||se===128||se===138||se===144)&&(St=te.readUEG(),St===3&&te.readBits(1),St<=3&&(Lt=it[St]),Tt=te.readUEG()+8,te.readUEG(),te.readBits(1),te.readBool()))for(var Qt=St!==3?8:12,Et=0;Et0&&gr<16?(Cr=gi[gr-1],un=pr[gr-1]):gr===255&&(Cr=te.readByte()<<8|te.readByte(),un=te.readByte()<<8|te.readByte())}if(te.readBool()&&te.readBool(),te.readBool()&&(te.readBits(4),te.readBool()&&te.readBits(24)),te.readBool()&&(te.readUEG(),te.readUEG()),te.readBool()){var yr=te.readBits(32),Or=te.readBits(32);Nr=te.readBool(),Xr=Or,xr=yr*2,Mn=Xr/xr}}var Kr=1;(Cr!==1||un!==1)&&(Kr=Cr/un);var Sr=0,ui=0;if(St===0)Sr=1,ui=2-ln;else{var Pr=St===3?1:2,yi=St===1?2:1;Sr=Pr,ui=yi*(2-ln)}var ci=(Sn+1)*16,ni=(2-ln)*((mt+1)*16);ci-=(fn+Zn)*Sr,ni-=(rr+xn)*ui;var Di=Math.ceil(ci*Kr);return te.destroy(),te=null,{profile_string:ze,level_string:qe,bit_depth:Tt,ref_frames:yt,chroma_format:Lt,chroma_format_string:Se.getChromaFormatString(Lt),frame_rate:{fixed:Nr,fps:Mn,fps_den:xr,fps_num:Xr},sar_ratio:{width:Cr,height:un},codec_size:{width:ci,height:ni},present_size:{width:Di,height:ni}}}},{key:"_skipScalingList",value:function(W,J){for(var te=8,se=8,Ee=0,ze=0;ze>>8&255|(Se&255)<<8}function me(Se){return(Se&4278190080)>>>24|(Se&16711680)>>>8|(Se&65280)<<8|(Se&255)<<24}function Ae(Se,de){return Se[de]<<24|Se[de+1]<<16|Se[de+2]<<8|Se[de+3]}var at=function(){function Se(de,W){Object(ae.a)(this,Se),this.TAG="FLVDemuxer",this._config=W,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=de.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=de.hasAudioTrack,this._hasVideo=de.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new De,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 J=new ArrayBuffer(2);return new DataView(J).setInt16(0,256,!0),new Int16Array(J)[0]===256}()}return Object(Q.a)(Se,[{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(W){return W.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(W){this._onTrackMetadata=W}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(W){this._onMediaInfo=W}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(W){this._onMetaDataArrived=W}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(W){this._onScriptDataArrived=W}},{key:"onError",get:function(){return this._onError},set:function(W){this._onError=W}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(W){this._onDataAvailable=W}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(W){this._timestampBase=W}},{key:"overridedDuration",get:function(){return this._duration},set:function(W){this._durationOverrided=!0,this._duration=W,this._mediaInfo.duration=W}},{key:"overridedHasAudio",set:function(W){this._hasAudioFlagOverrided=!0,this._hasAudio=W,this._mediaInfo.hasAudio=W}},{key:"overridedHasVideo",set:function(W){this._hasVideoFlagOverrided=!0,this._hasVideo=W,this._mediaInfo.hasVideo=W}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new De}},{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(W,J){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new c("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var te=0,se=this._littleEndian;if(J===0)if(W.byteLength>13){var Ee=Se.probe(W);te=Ee.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,J+te!==this._dataOffset&&T.w(this.TAG,"First time parsing but chunk byteStart invalid!");var ze=new DataView(W,te),qe=ze.getUint32(0,!se);qe!==0&&T.w(this.TAG,"PrevTagSize0 !== 0 !!!"),te+=4}for(;teW.byteLength)break;var Lt=St.getUint8(0),it=St.getUint32(0,!se)&16777215;if(te+11+it+4>W.byteLength)break;if(Lt!==8&&Lt!==9&&Lt!==18){T.w(this.TAG,"Unsupported tag type ".concat(Lt,", skipped")),te+=11+it+4;continue}var Tt=St.getUint8(4),Qt=St.getUint8(5),Et=St.getUint8(6),nn=St.getUint8(7),Jt=Et|Qt<<8|Tt<<16|nn<<24,It=St.getUint32(7,!se)&16777215;It!==0&&T.w(this.TAG,"Meet tag which has StreamID != 0!");var yt=te+11;switch(Lt){case 8:this._parseAudioData(W,yt,it,Jt);break;case 9:this._parseVideoData(W,yt,it,Jt,J+te);break;case 18:this._parseScriptData(W,yt,it);break}var Sn=St.getUint32(11+it,!se);Sn!==11+it&&T.w(this.TAG,"Invalid PrevTagSize ".concat(Sn)),te+=11+it+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),te}},{key:"_parseScriptData",value:function(W,J,te){var se=Ne.parseScriptData(W,J,te);if(se.hasOwnProperty("onMetaData")){if(se.onMetaData==null||typeof se.onMetaData!="object"){T.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&T.w(this.TAG,"Found another onMetaData tag!"),this._metadata=se;var Ee=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Ee)),typeof Ee.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Ee.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Ee.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Ee.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Ee.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Ee.audiodatarate),typeof Ee.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Ee.videodatarate),typeof Ee.width=="number"&&(this._mediaInfo.width=Ee.width),typeof Ee.height=="number"&&(this._mediaInfo.height=Ee.height),typeof Ee.duration=="number"){if(!this._durationOverrided){var ze=Math.floor(Ee.duration*this._timescale);this._duration=ze,this._mediaInfo.duration=ze}}else this._mediaInfo.duration=0;if(typeof Ee.framerate=="number"){var qe=Math.floor(Ee.framerate*1e3);if(qe>0){var St=qe/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=St,this._referenceFrameRate.fps_num=qe,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=St}}if(typeof Ee.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Lt=Ee.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Lt),Ee.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Ee,T.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(se).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},se)))}},{key:"_parseKeyframesIndex",value:function(W){for(var J=[],te=[],se=1;se>>4;if(St!==2&&St!==10){this._onError(V.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+St);return}var Lt=0,it=(qe&12)>>>2;if(it>=0&&it<=4)Lt=this._flvSoundRateTable[it];else{this._onError(V.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+it);return}var Tt=(qe&2)>>>1,Qt=qe&1,Et=this._audioMetadata,nn=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=nn.id,Et.timescale=this._timescale,Et.duration=this._duration,Et.audioSampleRate=Lt,Et.channelCount=Qt===0?1:2),St===10){var Jt=this._parseAACAudioData(W,J+1,te-1);if(Jt==null)return;if(Jt.packetType===0){Et.config&&T.w(this.TAG,"Found another AudioSpecificConfig!");var It=Jt.data;Et.audioSampleRate=It.samplingRate,Et.channelCount=It.channelCount,Et.codec=It.codec,Et.originalCodec=It.originalCodec,Et.config=It.config,Et.refSampleDuration=1024/Et.audioSampleRate*Et.timescale,T.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 yt=this._mediaInfo;yt.audioCodec=Et.originalCodec,yt.audioSampleRate=Et.audioSampleRate,yt.audioChannelCount=Et.channelCount,yt.hasVideo?yt.videoCodec!=null&&(yt.mimeType='video/x-flv; codecs="'+yt.videoCodec+","+yt.audioCodec+'"'):yt.mimeType='video/x-flv; codecs="'+yt.audioCodec+'"',yt.isComplete()&&this._onMediaInfo(yt)}else if(Jt.packetType===1){var Sn=this._timestampBase+se,mt={unit:Jt.data,length:Jt.data.byteLength,dts:Sn,pts:Sn};nn.samples.push(mt),nn.length+=Jt.data.length}else T.e(this.TAG,"Flv: Unsupported AAC data type ".concat(Jt.packetType))}else if(St===2){if(!Et.codec){var ln=this._parseMP3AudioData(W,J+1,te-1,!0);if(ln==null)return;Et.audioSampleRate=ln.samplingRate,Et.channelCount=ln.channelCount,Et.codec=ln.codec,Et.originalCodec=ln.originalCodec,Et.refSampleDuration=1152/Et.audioSampleRate*Et.timescale,T.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Et);var fn=this._mediaInfo;fn.audioCodec=Et.codec,fn.audioSampleRate=Et.audioSampleRate,fn.audioChannelCount=Et.channelCount,fn.audioDataRate=ln.bitRate,fn.hasVideo?fn.videoCodec!=null&&(fn.mimeType='video/x-flv; codecs="'+fn.videoCodec+","+fn.audioCodec+'"'):fn.mimeType='video/x-flv; codecs="'+fn.audioCodec+'"',fn.isComplete()&&this._onMediaInfo(fn)}var Zn=this._parseMP3AudioData(W,J+1,te-1,!1);if(Zn==null)return;var rr=this._timestampBase+se,xn={unit:Zn,length:Zn.byteLength,dts:rr,pts:rr};nn.samples.push(xn),nn.length+=Zn.length}}},{key:"_parseAACAudioData",value:function(W,J,te){if(te<=1){T.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var se={},Ee=new Uint8Array(W,J,te);return se.packetType=Ee[0],Ee[0]===0?se.data=this._parseAACAudioSpecificConfig(W,J+1,te-1):se.data=Ee.subarray(1),se}},{key:"_parseAACAudioSpecificConfig",value:function(W,J,te){var se=new Uint8Array(W,J,te),Ee=null,ze=0,qe=0,St=null,Lt=0,it=null;if(ze=qe=se[0]>>>3,Lt=(se[0]&7)<<1|se[1]>>>7,Lt<0||Lt>=this._mpegSamplingRates.length){this._onError(V.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Tt=this._mpegSamplingRates[Lt],Qt=(se[1]&120)>>>3;if(Qt<0||Qt>=8){this._onError(V.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}ze===5&&(it=(se[1]&7)<<1|se[2]>>>7,St=(se[2]&124)>>>2);var Et=self.navigator.userAgent.toLowerCase();return Et.indexOf("firefox")!==-1?Lt>=6?(ze=5,Ee=new Array(4),it=Lt-3):(ze=2,Ee=new Array(2),it=Lt):Et.indexOf("android")!==-1?(ze=2,Ee=new Array(2),it=Lt):(ze=5,it=Lt,Ee=new Array(4),Lt>=6?it=Lt-3:Qt===1&&(ze=2,Ee=new Array(2),it=Lt)),Ee[0]=ze<<3,Ee[0]|=(Lt&15)>>>1,Ee[1]=(Lt&15)<<7,Ee[1]|=(Qt&15)<<3,ze===5&&(Ee[1]|=(it&15)>>>1,Ee[2]=(it&1)<<7,Ee[2]|=2<<2,Ee[3]=0),{config:Ee,samplingRate:Tt,channelCount:Qt,codec:"mp4a.40."+ze,originalCodec:"mp4a.40."+qe}}},{key:"_parseMP3AudioData",value:function(W,J,te,se){if(te<4){T.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Ee=this._littleEndian,ze=new Uint8Array(W,J,te),qe=null;if(se){if(ze[0]!==255)return;var St=ze[1]>>>3&3,Lt=(ze[1]&6)>>1,it=(ze[2]&240)>>>4,Tt=(ze[2]&12)>>>2,Qt=ze[3]>>>6&3,Et=Qt!==3?2:1,nn=0,Jt=0,It=34,yt="mp3";switch(St){case 0:nn=this._mpegAudioV25SampleRateTable[Tt];break;case 2:nn=this._mpegAudioV20SampleRateTable[Tt];break;case 3:nn=this._mpegAudioV10SampleRateTable[Tt];break}switch(Lt){case 1:It=34,it>>4,St=ze&15;if(St!==7){this._onError(V.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(St));return}this._parseAVCVideoPacket(W,J+1,te-1,se,Ee,qe)}},{key:"_parseAVCVideoPacket",value:function(W,J,te,se,Ee,ze){if(te<4){T.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var qe=this._littleEndian,St=new DataView(W,J,te),Lt=St.getUint8(0),it=St.getUint32(0,!qe)&16777215,Tt=it<<8>>8;if(Lt===0)this._parseAVCDecoderConfigurationRecord(W,J+4,te-4);else if(Lt===1)this._parseAVCVideoData(W,J+4,te-4,se,Ee,ze,Tt);else if(!(Lt===2)){this._onError(V.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Lt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(W,J,te){if(te<7){T.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var se=this._videoMetadata,Ee=this._videoTrack,ze=this._littleEndian,qe=new DataView(W,J,te);se?typeof se.avcc!="undefined"&&T.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),se=this._videoMetadata={},se.type="video",se.id=Ee.id,se.timescale=this._timescale,se.duration=this._duration);var St=qe.getUint8(0),Lt=qe.getUint8(1),it=qe.getUint8(2),Tt=qe.getUint8(3);if(St!==1||Lt===0){this._onError(V.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(qe.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(V.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Qt=qe.getUint8(5)&31;if(Qt===0){this._onError(V.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Qt>1&&T.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Qt));for(var Et=6,nn=0;nn1&&T.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Er));Et++;for(var Cr=0;Cr=te){T.w(this.TAG,"Malformed Nalu near timestamp ".concat(nn,", offset = ").concat(Qt,", dataSize = ").concat(te));break}var It=Lt.getUint32(Qt,!St);if(Et===3&&(It>>>=8),It>te-Et){T.w(this.TAG,"Malformed Nalus near timestamp ".concat(nn,", NaluSize > DataSize!"));return}var yt=Lt.getUint8(Qt+Et)&31;yt===5&&(Jt=!0);var Sn=new Uint8Array(W,J+Qt,Et+It),mt={type:yt,data:Sn};it.push(mt),Tt+=Sn.byteLength,Qt+=Et+It}if(it.length){var ln=this._videoTrack,fn={units:it,length:Tt,isKeyframe:Jt,dts:nn,cts:qe,pts:nn+qe};Jt&&(fn.fileposition=Ee),ln.samples.push(fn),ln.length+=Tt}}}],[{key:"probe",value:function(W){var J=new Uint8Array(W),te={match:!1};if(J[0]!==70||J[1]!==76||J[2]!==86||J[3]!==1)return te;var se=(J[4]&4)>>>2!==0,Ee=(J[4]&1)!==0,ze=Ae(J,5);return ze<9?te:{match:!0,consumed:ze,dataOffset:ze,hasAudioTrack:se,hasVideoTrack:Ee}}}]),Se}(),Le=at,ke=function(){function Se(){Object(ae.a)(this,Se)}return Object(Q.a)(Se,null,[{key:"init",value:function(){Se.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 W in Se.types)Se.types.hasOwnProperty(W)&&(Se.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var J=Se.constants={};J.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),J.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),J.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),J.STSC=J.STCO=J.STTS,J.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),J.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]),J.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]),J.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),J.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),J.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(W){for(var J=8,te=null,se=Array.prototype.slice.call(arguments,1),Ee=se.length,ze=0;ze>>24&255,te[1]=J>>>16&255,te[2]=J>>>8&255,te[3]=J&255,te.set(W,4);for(var qe=8,St=0;St>>24&255,W>>>16&255,W>>>8&255,W&255,J>>>24&255,J>>>16&255,J>>>8&255,J&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(W){return Se.box(Se.types.trak,Se.tkhd(W),Se.mdia(W))}},{key:"tkhd",value:function(W){var J=W.id,te=W.duration,se=W.presentWidth,Ee=W.presentHeight;return Se.box(Se.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&255,0,0,0,0,te>>>24&255,te>>>16&255,te>>>8&255,te&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,se>>>8&255,se&255,0,0,Ee>>>8&255,Ee&255,0,0]))}},{key:"mdia",value:function(W){return Se.box(Se.types.mdia,Se.mdhd(W),Se.hdlr(W),Se.minf(W))}},{key:"mdhd",value:function(W){var J=W.timescale,te=W.duration;return Se.box(Se.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&255,te>>>24&255,te>>>16&255,te>>>8&255,te&255,85,196,0,0]))}},{key:"hdlr",value:function(W){var J=null;return W.type==="audio"?J=Se.constants.HDLR_AUDIO:J=Se.constants.HDLR_VIDEO,Se.box(Se.types.hdlr,J)}},{key:"minf",value:function(W){var J=null;return W.type==="audio"?J=Se.box(Se.types.smhd,Se.constants.SMHD):J=Se.box(Se.types.vmhd,Se.constants.VMHD),Se.box(Se.types.minf,J,Se.dinf(),Se.stbl(W))}},{key:"dinf",value:function(){var W=Se.box(Se.types.dinf,Se.box(Se.types.dref,Se.constants.DREF));return W}},{key:"stbl",value:function(W){var J=Se.box(Se.types.stbl,Se.stsd(W),Se.box(Se.types.stts,Se.constants.STTS),Se.box(Se.types.stsc,Se.constants.STSC),Se.box(Se.types.stsz,Se.constants.STSZ),Se.box(Se.types.stco,Se.constants.STCO));return J}},{key:"stsd",value:function(W){return W.type==="audio"?W.codec==="mp3"?Se.box(Se.types.stsd,Se.constants.STSD_PREFIX,Se.mp3(W)):Se.box(Se.types.stsd,Se.constants.STSD_PREFIX,Se.mp4a(W)):Se.box(Se.types.stsd,Se.constants.STSD_PREFIX,Se.avc1(W))}},{key:"mp3",value:function(W){var J=W.channelCount,te=W.audioSampleRate,se=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,J,0,16,0,0,0,0,te>>>8&255,te&255,0,0]);return Se.box(Se.types[".mp3"],se)}},{key:"mp4a",value:function(W){var J=W.channelCount,te=W.audioSampleRate,se=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,J,0,16,0,0,0,0,te>>>8&255,te&255,0,0]);return Se.box(Se.types.mp4a,se,Se.esds(W))}},{key:"esds",value:function(W){var J=W.config||[],te=J.length,se=new Uint8Array([0,0,0,0,3,23+te,0,1,0,4,15+te,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([te]).concat(J).concat([6,1,2]));return Se.box(Se.types.esds,se)}},{key:"avc1",value:function(W){var J=W.avcc,te=W.codecWidth,se=W.codecHeight,Ee=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,te>>>8&255,te&255,se>>>8&255,se&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 Se.box(Se.types.avc1,Ee,Se.box(Se.types.avcC,J))}},{key:"mvex",value:function(W){return Se.box(Se.types.mvex,Se.trex(W))}},{key:"trex",value:function(W){var J=W.id,te=new Uint8Array([0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Se.box(Se.types.trex,te)}},{key:"moof",value:function(W,J){return Se.box(Se.types.moof,Se.mfhd(W.sequenceNumber),Se.traf(W,J))}},{key:"mfhd",value:function(W){var J=new Uint8Array([0,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255]);return Se.box(Se.types.mfhd,J)}},{key:"traf",value:function(W,J){var te=W.id,se=Se.box(Se.types.tfhd,new Uint8Array([0,0,0,0,te>>>24&255,te>>>16&255,te>>>8&255,te&255])),Ee=Se.box(Se.types.tfdt,new Uint8Array([0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&255])),ze=Se.sdtp(W),qe=Se.trun(W,ze.byteLength+16+16+8+16+8+8);return Se.box(Se.types.traf,se,Ee,qe,ze)}},{key:"sdtp",value:function(W){for(var J=W.samples||[],te=J.length,se=new Uint8Array(4+te),Ee=0;Ee>>24&255,se>>>16&255,se>>>8&255,se&255,J>>>24&255,J>>>16&255,J>>>8&255,J&255],0);for(var qe=0;qe>>24&255,St>>>16&255,St>>>8&255,St&255,Lt>>>24&255,Lt>>>16&255,Lt>>>8&255,Lt&255,it.isLeading<<2|it.dependsOn,it.isDependedOn<<6|it.hasRedundancy<<4|it.isNonSync,0,0,Tt>>>24&255,Tt>>>16&255,Tt>>>8&255,Tt&255],12+16*qe)}return Se.box(Se.types.trun,ze)}},{key:"mdat",value:function(W){return Se.box(Se.types.mdat,W)}}]),Se}();ke.init();var Ye=ke,Ze=function(){function Se(){Object(ae.a)(this,Se)}return Object(Q.a)(Se,null,[{key:"getSilentFrame",value:function(W,J){if(W==="mp4a.40.2"){if(J===1)return new Uint8Array([0,200,0,128,35,128]);if(J===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(J===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(J===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(J===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(J===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(J===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(J===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(J===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}}]),Se}(),Ve=Ze,He=function Se(de,W,J,te,se){Object(ae.a)(this,Se),this.dts=de,this.pts=W,this.duration=J,this.originalDts=te,this.isSyncPoint=se,this.fileposition=null},Pe=function(){function Se(){Object(ae.a)(this,Se),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)(Se,[{key:"appendSyncPoint",value:function(W){W.isSyncPoint=!0,this.syncPoints.push(W)}}]),Se}(),Re=function(){function Se(){Object(ae.a)(this,Se),this._list=[]}return Object(Q.a)(Se,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(W){var J=this._list;if(W.length===0)return;J.length>0&&W[0].originalDts=J[Ee].dts&&WJ[se].lastSample.originalDts&&W=J[se].lastSample.originalDts&&(se===J.length-1||se0&&(Ee=this._searchNearestSegmentBefore(te.originalBeginDts)+1),this._lastAppendLocation=Ee,this._list.splice(Ee,0,te)}},{key:"getLastSegmentBefore",value:function(W){var J=this._searchNearestSegmentBefore(W);return J>=0?this._list[J]:null}},{key:"getLastSampleBefore",value:function(W){var J=this.getLastSegmentBefore(W);return J!=null?J.lastSample:null}},{key:"getLastSyncPointBefore",value:function(W){for(var J=this._searchNearestSegmentBefore(W),te=this._list[J].syncPoints;te.length===0&&J>0;)J--,te=this._list[J].syncPoints;return te.length>0?te[te.length-1]:null}}]),Se}(),he=function(){function Se(de){Object(ae.a)(this,Se),this.TAG="MP4Remuxer",this._config=de,this._isLive=de.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 Oe("audio"),this._videoSegmentInfoList=new Oe("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661)),this._fillSilentAfterSeek=m.msedge||m.msie,this._mp3UseMpegAudio=!m.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(Q.a)(Se,[{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(W){return W.onDataAvailable=this.remux.bind(this),W.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(W){this._onInitSegment=W}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(W){this._onMediaSegment=W}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(W){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(W,J){if(!this._onMediaSegment)throw new c("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(W,J),this._remuxVideo(J),this._remuxAudio(W)}},{key:"_onTrackMetadataReceived",value:function(W,J){var te=null,se="mp4",Ee=J.codec;if(W==="audio")this._audioMeta=J,J.codec==="mp3"&&this._mp3UseMpegAudio?(se="mpeg",Ee="",te=new Uint8Array):te=Ye.generateInitSegment(J);else if(W==="video")this._videoMeta=J,te=Ye.generateInitSegment(J);else return;if(!this._onInitSegment)throw new c("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(W,{type:W,data:te.buffer,codec:Ee,container:"".concat(W,"/").concat(se),mediaDuration:J.duration})}},{key:"_calculateDtsBase",value:function(W,J){if(this._dtsBaseInited)return;W.samples&&W.samples.length&&(this._audioDtsBase=W.samples[0].dts),J.samples&&J.samples.length&&(this._videoDtsBase=J.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var W=this._videoStashedLastSample,J=this._audioStashedLastSample,te={type:"video",id:1,sequenceNumber:0,samples:[],length:0};W!=null&&(te.samples.push(W),te.length=W.length);var se={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};J!=null&&(se.samples.push(J),se.length=J.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(te,!0),this._remuxAudio(se,!0)}},{key:"_remuxAudio",value:function(W,J){if(this._audioMeta==null)return;var te=W,se=te.samples,Ee=void 0,ze=-1,qe=-1,St=-1,Lt=this._audioMeta.refSampleDuration,it=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Tt=this._dtsBaseInited&&this._audioNextDts===void 0,Qt=!1;if(!se||se.length===0)return;if(se.length===1&&!J)return;var Et=0,nn=null,Jt=0;it?(Et=0,Jt=te.length):(Et=8,Jt=8+te.length);var It=null;if(se.length>1&&(It=se.pop(),Jt-=It.length),this._audioStashedLastSample!=null){var yt=this._audioStashedLastSample;this._audioStashedLastSample=null,se.unshift(yt),Jt+=yt.length}It!=null&&(this._audioStashedLastSample=It);var Sn=se[0].dts-this._dtsBase;if(this._audioNextDts)Ee=Sn-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Ee=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Qt=!0));else{var mt=this._audioSegmentInfoList.getLastSampleBefore(Sn);if(mt!=null){var ln=Sn-(mt.originalDts+mt.duration);ln<=3&&(ln=0);var fn=mt.dts+mt.duration+ln;Ee=Sn-fn}else Ee=0}if(Qt){var Zn=Sn-Ee,rr=this._videoSegmentInfoList.getLastSegmentBefore(Sn);if(rr!=null&&rr.beginDts=1?gr=un[un.length-1].duration:gr=Math.floor(Lt);var yr=!1,Or=null;if(gr>Lt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!m.safari){yr=!0;var Kr=Math.abs(gr-Lt),Sr=Math.ceil(Kr/Lt),ui=ur+Lt;T.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. `+"dts: ".concat(ur+gr," ms, expected: ").concat(ur+Math.round(Lt)," ms, ")+"delta: ".concat(Math.round(Kr)," ms, generate: ").concat(Sr," frames"));var Pr=Ve.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Pr==null&&(T.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Pr=Xr),Or=[];for(var yi=0;yi0){var ni=Or[Or.length-1];ni.duration=ci-ni.dts}var Di={dts:ci,pts:ci,cts:0,unit:Pr,size:Pr.byteLength,duration:0,originalDts:xr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Or.push(Di),Jt+=Di.size,ui+=Lt}var Ni=Or[Or.length-1];Ni.duration=ur+gr-Ni.dts,gr=Math.round(Lt)}un.push({dts:ur,pts:ur,cts:0,unit:Nr.unit,size:Nr.unit.byteLength,duration:gr,originalDts:xr,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),yr&&un.push.apply(un,Or)}it?nn=new Uint8Array(Jt):(nn=new Uint8Array(Jt),nn[0]=Jt>>>24&255,nn[1]=Jt>>>16&255,nn[2]=Jt>>>8&255,nn[3]=Jt&255,nn.set(Ye.types.mdat,4));for(var Ui=0;Ui1&&(Et=se.pop(),Qt-=Et.length),this._videoStashedLastSample!=null){var nn=this._videoStashedLastSample;this._videoStashedLastSample=null,se.unshift(nn),Qt+=nn.length}Et!=null&&(this._videoStashedLastSample=Et);var Jt=se[0].dts-this._dtsBase;if(this._videoNextDts)Ee=Jt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Ee=0;else{var It=this._videoSegmentInfoList.getLastSampleBefore(Jt);if(It!=null){var yt=Jt-(It.originalDts+It.duration);yt<=3&&(yt=0);var Sn=It.dts+It.duration+yt;Ee=Jt-Sn}else Ee=0}for(var mt=new Pe,ln=[],fn=0;fn=1?Mn=ln[ln.length-1].duration:Mn=Math.floor(this._videoMeta.refSampleDuration);if(xn){var xr=new He(Er,un,Mn,Zn.dts,!0);xr.fileposition=Zn.fileposition,mt.appendSyncPoint(xr)}ln.push({dts:Er,pts:un,cts:Cr,units:Zn.units,size:Zn.length,isKeyframe:xn,duration:Mn,originalDts:rr,flags:{isLeading:0,dependsOn:xn?2:1,isDependedOn:xn?1:0,hasRedundancy:0,isNonSync:xn?0:1}})}Tt=new Uint8Array(Qt),Tt[0]=Qt>>>24&255,Tt[1]=Qt>>>16&255,Tt[2]=Qt>>>8&255,Tt[3]=Qt&255,Tt.set(Ye.types.mdat,4);for(var ur=0;ur0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Ee=this._demuxer.parseChunks(W,J);else if((se=Le.probe(W)).match){this._demuxer=new Le(se,this._config),this._remuxer||(this._remuxer=new be(this._config));var ze=this._mediaDataSource;ze.duration!=null&&!isNaN(ze.duration)&&(this._demuxer.overridedDuration=ze.duration),typeof ze.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=ze.hasAudio),typeof ze.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=ze.hasVideo),this._demuxer.timestampBase=ze.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),Ee=this._demuxer.parseChunks(W,J)}else se=null,T.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){te._internalAbort()}),this._emitter.emit(xe.DEMUX_ERROR,V.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Ee=0;return Ee}},{key:"_onMediaInfo",value:function(W){var J=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},W),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,De.prototype));var te=Object.assign({},W);Object.setPrototypeOf(te,De.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=te,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var se=J._pendingSeekTime;J._pendingSeekTime=null,J.seek(se)})}},{key:"_onMetaDataArrived",value:function(W){this._emitter.emit(xe.METADATA_ARRIVED,W)}},{key:"_onScriptDataArrived",value:function(W){this._emitter.emit(xe.SCRIPTDATA_ARRIVED,W)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(W){var J=W,te=J+1;te0&&te[0].originalDts===se&&(se=te[0].pts),this._emitter.emit(xe.RECOMMEND_SEEKPOINT,se)}}},{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(W){var J=this._mediaInfo.segments[W],te=Object.assign({},J);te.duration=this._mediaInfo.duration,te.segmentCount=this._mediaInfo.segmentCount,delete te.segments,delete te.keyframesIndex,this._emitter.emit(xe.MEDIA_INFO,te)}},{key:"_reportStatisticsInfo",value:function(){var W={};W.url=this._ioctl.currentURL,W.hasRedirect=this._ioctl.hasRedirect,W.hasRedirect&&(W.redirectedURL=this._ioctl.currentRedirectedURL),W.speed=this._ioctl.currentSpeed,W.loaderType=this._ioctl.loaderType,W.currentSegmentIndex=this._currentSegmentIndex,W.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(xe.STATISTICS_INFO,W)}}]),Se}(),Qe=Be,rt=function(de){var W="TransmuxingWorker",J=null,te=Jt.bind(this);w.install(),de.addEventListener("message",function(It){switch(It.data.cmd){case"init":J=new Qe(It.data.param[0],It.data.param[1]),J.on(xe.IO_ERROR,Qt.bind(this)),J.on(xe.DEMUX_ERROR,Et.bind(this)),J.on(xe.INIT_SEGMENT,se.bind(this)),J.on(xe.MEDIA_SEGMENT,Ee.bind(this)),J.on(xe.LOADING_COMPLETE,ze.bind(this)),J.on(xe.RECOVERED_EARLY_EOF,qe.bind(this)),J.on(xe.MEDIA_INFO,St.bind(this)),J.on(xe.METADATA_ARRIVED,Lt.bind(this)),J.on(xe.SCRIPTDATA_ARRIVED,it.bind(this)),J.on(xe.STATISTICS_INFO,Tt.bind(this)),J.on(xe.RECOMMEND_SEEKPOINT,nn.bind(this));break;case"destroy":J&&(J.destroy(),J=null),de.postMessage({msg:"destroyed"});break;case"start":J.start();break;case"stop":J.stop();break;case"seek":J.seek(It.data.param);break;case"pause":J.pause();break;case"resume":J.resume();break;case"logging_config":{var yt=It.data.param;Te.applyConfig(yt),yt.enableCallback===!0?Te.addLogListener(te):Te.removeLogListener(te);break}}});function se(It,yt){var Sn={msg:xe.INIT_SEGMENT,data:{type:It,data:yt}};de.postMessage(Sn,[yt.data])}function Ee(It,yt){var Sn={msg:xe.MEDIA_SEGMENT,data:{type:It,data:yt}};de.postMessage(Sn,[yt.data])}function ze(){var It={msg:xe.LOADING_COMPLETE};de.postMessage(It)}function qe(){var It={msg:xe.RECOVERED_EARLY_EOF};de.postMessage(It)}function St(It){var yt={msg:xe.MEDIA_INFO,data:It};de.postMessage(yt)}function Lt(It){var yt={msg:xe.METADATA_ARRIVED,data:It};de.postMessage(yt)}function it(It){var yt={msg:xe.SCRIPTDATA_ARRIVED,data:It};de.postMessage(yt)}function Tt(It){var yt={msg:xe.STATISTICS_INFO,data:It};de.postMessage(yt)}function Qt(It,yt){de.postMessage({msg:xe.IO_ERROR,data:{type:It,info:yt}})}function Et(It,yt){de.postMessage({msg:xe.DEMUX_ERROR,data:{type:It,info:yt}})}function nn(It){de.postMessage({msg:xe.RECOMMEND_SEEKPOINT,data:It})}function Jt(It,yt){de.postMessage({msg:"logcat_callback",data:{type:It,logcat:yt}})}},dt=rt,xt=function(){function Se(de,W){if(Object(ae.a)(this,Se),this.TAG="Transmuxer",this._emitter=new S.a,W.enableWorker&&typeof Worker!="undefined")try{var J=B("0r65");this._worker=J(dt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[de,W]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Te.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Te.getConfig()})}catch(se){T.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Qe(de,W)}else this._controller=new Qe(de,W);if(this._controller){var te=this._controller;te.on(xe.IO_ERROR,this._onIOError.bind(this)),te.on(xe.DEMUX_ERROR,this._onDemuxError.bind(this)),te.on(xe.INIT_SEGMENT,this._onInitSegment.bind(this)),te.on(xe.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),te.on(xe.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),te.on(xe.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),te.on(xe.MEDIA_INFO,this._onMediaInfo.bind(this)),te.on(xe.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),te.on(xe.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),te.on(xe.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),te.on(xe.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(Q.a)(Se,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Te.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,J){this._emitter.addListener(W,J)}},{key:"off",value:function(W,J){this._emitter.removeListener(W,J)}},{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(W){this._worker?this._worker.postMessage({cmd:"seek",param:W}):this._controller.seek(W)}},{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(W,J){var te=this;Promise.resolve().then(function(){te._emitter.emit(xe.INIT_SEGMENT,W,J)})}},{key:"_onMediaSegment",value:function(W,J){var te=this;Promise.resolve().then(function(){te._emitter.emit(xe.MEDIA_SEGMENT,W,J)})}},{key:"_onLoadingComplete",value:function(){var W=this;Promise.resolve().then(function(){W._emitter.emit(xe.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var W=this;Promise.resolve().then(function(){W._emitter.emit(xe.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(W){var J=this;Promise.resolve().then(function(){J._emitter.emit(xe.MEDIA_INFO,W)})}},{key:"_onMetaDataArrived",value:function(W){var J=this;Promise.resolve().then(function(){J._emitter.emit(xe.METADATA_ARRIVED,W)})}},{key:"_onScriptDataArrived",value:function(W){var J=this;Promise.resolve().then(function(){J._emitter.emit(xe.SCRIPTDATA_ARRIVED,W)})}},{key:"_onStatisticsInfo",value:function(W){var J=this;Promise.resolve().then(function(){J._emitter.emit(xe.STATISTICS_INFO,W)})}},{key:"_onIOError",value:function(W,J){var te=this;Promise.resolve().then(function(){te._emitter.emit(xe.IO_ERROR,W,J)})}},{key:"_onDemuxError",value:function(W,J){var te=this;Promise.resolve().then(function(){te._emitter.emit(xe.DEMUX_ERROR,W,J)})}},{key:"_onRecommendSeekpoint",value:function(W){var J=this;Promise.resolve().then(function(){J._emitter.emit(xe.RECOMMEND_SEEKPOINT,W)})}},{key:"_onLoggingConfigChanged",value:function(W){this._worker&&this._worker.postMessage({cmd:"logging_config",param:W})}},{key:"_onWorkerMessage",value:function(W){var J=W.data,te=J.data;if(J.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(J.msg){case xe.INIT_SEGMENT:case xe.MEDIA_SEGMENT:this._emitter.emit(J.msg,te.type,te.data);break;case xe.LOADING_COMPLETE:case xe.RECOVERED_EARLY_EOF:this._emitter.emit(J.msg);break;case xe.MEDIA_INFO:Object.setPrototypeOf(te,De.prototype),this._emitter.emit(J.msg,te);break;case xe.METADATA_ARRIVED:case xe.SCRIPTDATA_ARRIVED:case xe.STATISTICS_INFO:this._emitter.emit(J.msg,te);break;case xe.IO_ERROR:case xe.DEMUX_ERROR:this._emitter.emit(J.msg,te.type,te.info);break;case xe.RECOMMEND_SEEKPOINT:this._emitter.emit(J.msg,te);break;case"logcat_callback":T.emitter.emit("log",te.type,te.logcat);break;default:break}}}]),Se}(),_t=xt,wt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},st=wt,ut=function(){function Se(de){Object(ae.a)(this,Se),this.TAG="MSEController",this._config=de,this._emitter=new S.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 Re}return Object(Q.a)(Se,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(W,J){this._emitter.addListener(W,J)}},{key:"off",value:function(W,J){this._emitter.removeListener(W,J)}},{key:"attachMediaElement",value:function(W){if(this._mediaSource)throw new c("MediaSource has been attached to an HTMLMediaElement!");var J=this._mediaSource=new window.MediaSource;J.addEventListener("sourceopen",this.e.onSourceOpen),J.addEventListener("sourceended",this.e.onSourceEnded),J.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=W,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),W.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var W=this._mediaSource;for(var J in this._sourceBuffers){var te=this._pendingSegments[J];te.splice(0,te.length),this._pendingSegments[J]=null,this._pendingRemoveRanges[J]=null,this._lastInitSegments[J]=null;var se=this._sourceBuffers[J];if(se){if(W.readyState!=="closed"){try{W.removeSourceBuffer(se)}catch(Ee){T.e(this.TAG,Ee.message)}se.removeEventListener("error",this.e.onSourceBufferError),se.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[J]=null,this._sourceBuffers[J]=null}}if(W.readyState==="open")try{W.endOfStream()}catch(Ee){T.e(this.TAG,Ee.message)}W.removeEventListener("sourceopen",this.e.onSourceOpen),W.removeEventListener("sourceended",this.e.onSourceEnded),W.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(W,J){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(W),this._pendingSegments[W.type].push(W);return}var te=W,se="".concat(te.container);te.codec&&te.codec.length>0&&(se+=";codecs=".concat(te.codec));var Ee=!1;if(T.v(this.TAG,"Received Initialization Segment, mimeType: "+se),this._lastInitSegments[te.type]=te,se!==this._mimeTypes[te.type]){if(this._mimeTypes[te.type])T.v(this.TAG,"Notice: ".concat(te.type," mimeType changed, origin: ").concat(this._mimeTypes[te.type],", target: ").concat(se));else{Ee=!0;try{var ze=this._sourceBuffers[te.type]=this._mediaSource.addSourceBuffer(se);ze.addEventListener("error",this.e.onSourceBufferError),ze.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(qe){T.e(this.TAG,qe.message),this._emitter.emit(st.ERROR,{code:qe.code,msg:qe.message});return}}this._mimeTypes[te.type]=se}J||this._pendingSegments[te.type].push(te),Ee||this._sourceBuffers[te.type]&&!this._sourceBuffers[te.type].updating&&this._doAppendSegments(),m.safari&&te.container==="audio/mpeg"&&te.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=te.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(W){var J=W;this._pendingSegments[J.type].push(J),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var te=this._sourceBuffers[J.type];te&&!te.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(W){for(var J in this._sourceBuffers){if(!this._sourceBuffers[J])continue;var te=this._sourceBuffers[J];if(this._mediaSource.readyState==="open")try{te.abort()}catch(Lt){T.e(this.TAG,Lt.message)}this._idrList.clear();var se=this._pendingSegments[J];if(se.splice(0,se.length),this._mediaSource.readyState==="closed")continue;for(var Ee=0;Ee=1&&W-se.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var W=this._mediaElement.currentTime;for(var J in this._sourceBuffers){var te=this._sourceBuffers[J];if(te){for(var se=te.buffered,Ee=!1,ze=0;ze=this._config.autoCleanupMaxBackwardDuration){Ee=!0;var Lt=W-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[J].push({start:qe,end:Lt})}}else St0&&(isNaN(J)||te>J)&&(T.v(this.TAG,"Update MediaSource duration from ".concat(J," to ").concat(te)),this._mediaSource.duration=te),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var W in this._pendingRemoveRanges){if(!this._sourceBuffers[W]||this._sourceBuffers[W].updating)continue;for(var J=this._sourceBuffers[W],te=this._pendingRemoveRanges[W];te.length&&!J.updating;){var se=te.shift();J.remove(se.start,se.end)}}}},{key:"_doAppendSegments",value:function(){var W=this._pendingSegments;for(var J in W){if(!this._sourceBuffers[J]||this._sourceBuffers[J].updating)continue;if(W[J].length>0){var te=W[J].shift();if(te.timestampOffset){var se=this._sourceBuffers[J].timestampOffset,Ee=te.timestampOffset/1e3,ze=Math.abs(se-Ee);ze>.1&&(T.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(se," to ").concat(Ee)),this._sourceBuffers[J].timestampOffset=Ee),delete te.timestampOffset}if(!te.data||te.data.byteLength===0)continue;try{this._sourceBuffers[J].appendBuffer(te.data),this._isBufferFull=!1,J==="video"&&te.hasOwnProperty("info")&&this._idrList.appendArray(te.info.syncPoints)}catch(qe){this._pendingSegments[J].unshift(te),qe.code===22?(this._isBufferFull||this._emitter.emit(st.BUFFER_FULL),this._isBufferFull=!0):(T.e(this.TAG,qe.message),this._emitter.emit(st.ERROR,{code:qe.code,msg:qe.message}))}}}}},{key:"_onSourceOpen",value:function(){if(T.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var W=this._pendingSourceBufferInit;W.length;){var J=W.shift();this.appendInitSegment(J,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(st.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){T.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){T.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 W=this._pendingSegments;return W.video.length>0||W.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var W=this._pendingRemoveRanges;return W.video.length>0||W.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(st.UPDATE_END)}},{key:"_onSourceBufferError",value:function(W){T.e(this.TAG,"SourceBuffer Error: ".concat(W))}}]),Se}(),$e=ut,_e={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},je={NETWORK_EXCEPTION:n.EXCEPTION,NETWORK_STATUS_CODE_INVALID:n.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:n.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:n.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:V.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:V.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:V.CODEC_UNSUPPORTED},ct=function(){function Se(de,W){if(Object(ae.a)(this,Se),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new S.a,this._config=ie(),typeof W=="object"&&Object.assign(this._config,W),de.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");de.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=de,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 J=m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661);this._alwaysSeekKeyframe=!!(J||m.msedge||m.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(Q.a)(Se,[{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(W,J){var te=this;W===we.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){te._emitter.emit(we.MEDIA_INFO,te.mediaInfo)}):W===we.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){te._emitter.emit(we.STATISTICS_INFO,te.statisticsInfo)})),this._emitter.addListener(W,J)}},{key:"off",value:function(W,J){this._emitter.removeListener(W,J)}},{key:"attachMediaElement",value:function(W){var J=this;if(this._mediaElement=W,W.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),W.addEventListener("seeking",this.e.onvSeeking),W.addEventListener("canplay",this.e.onvCanPlay),W.addEventListener("stalled",this.e.onvStalled),W.addEventListener("progress",this.e.onvProgress),this._msectl=new $e(this._config),this._msectl.on(st.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(st.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(st.SOURCE_OPEN,function(){J._mseSourceOpened=!0,J._hasPendingLoad&&(J._hasPendingLoad=!1,J.load())}),this._msectl.on(st.ERROR,function(te){J._emitter.emit(we.ERROR,_e.MEDIA_ERROR,je.MEDIA_MSE_ERROR,te)}),this._msectl.attachMediaElement(W),this._pendingSeekTime!=null)try{W.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(te){}}},{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 W=this;if(!this._mediaElement)throw new c("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new c("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 _t(this._mediaDataSource,this._config),this._transmuxer.on(xe.INIT_SEGMENT,function(J,te){W._msectl.appendInitSegment(te)}),this._transmuxer.on(xe.MEDIA_SEGMENT,function(J,te){if(W._msectl.appendMediaSegment(te),W._config.lazyLoad&&!W._config.isLive){var se=W._mediaElement.currentTime;te.info.endDts>=(se+W._config.lazyLoadMaxDuration)*1e3&&(W._progressChecker==null&&(T.v(W.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),W._suspendTransmuxer()))}}),this._transmuxer.on(xe.LOADING_COMPLETE,function(){W._msectl.endOfStream(),W._emitter.emit(we.LOADING_COMPLETE)}),this._transmuxer.on(xe.RECOVERED_EARLY_EOF,function(){W._emitter.emit(we.RECOVERED_EARLY_EOF)}),this._transmuxer.on(xe.IO_ERROR,function(J,te){W._emitter.emit(we.ERROR,_e.NETWORK_ERROR,J,te)}),this._transmuxer.on(xe.DEMUX_ERROR,function(J,te){W._emitter.emit(we.ERROR,_e.MEDIA_ERROR,J,{code:-1,msg:te})}),this._transmuxer.on(xe.MEDIA_INFO,function(J){W._mediaInfo=J,W._emitter.emit(we.MEDIA_INFO,Object.assign({},J))}),this._transmuxer.on(xe.METADATA_ARRIVED,function(J){W._emitter.emit(we.METADATA_ARRIVED,J)}),this._transmuxer.on(xe.SCRIPTDATA_ARRIVED,function(J){W._emitter.emit(we.SCRIPTDATA_ARRIVED,J)}),this._transmuxer.on(xe.STATISTICS_INFO,function(J){W._statisticsInfo=W._fillStatisticsInfo(J),W._emitter.emit(we.STATISTICS_INFO,Object.assign({},W._statisticsInfo))}),this._transmuxer.on(xe.RECOMMEND_SEEKPOINT,function(J){W._mediaElement&&!W._config.accurateSeek&&(W._requestSetTime=!0,W._mediaElement.currentTime=J/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(W){this._mediaElement.volume=W}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(W){this._mediaElement.muted=W}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(W){this._mediaElement?this._internalSeek(W):this._pendingSeekTime=W}},{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(W){if(W.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return W;var J=!0,te=0,se=0;if(this._mediaElement.getVideoPlaybackQuality){var Ee=this._mediaElement.getVideoPlaybackQuality();te=Ee.totalVideoFrames,se=Ee.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(te=this._mediaElement.webkitDecodedFrameCount,se=this._mediaElement.webkitDroppedFrameCount):J=!1;return J&&(W.decodedFrames=te,W.droppedFrames=se),W}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var W=this._mediaElement.buffered,J=this._mediaElement.currentTime,te=0,se=0,Ee=0;Ee=J+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(T.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){T.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 W=this._mediaElement.currentTime,J=this._mediaElement.buffered,te=!1,se=0;se=Ee&&W=ze-this._config.lazyLoadRecoverDuration&&(te=!0);break}}te&&(window.clearInterval(this._progressChecker),this._progressChecker=null,te&&(T.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(W){for(var J=this._mediaElement.buffered,te=0;te=se&&W0){var Ee=this._mediaElement.buffered.start(0);(Ee<1&&W0&&J.currentTime0){var se=te.start(0);if(se<1&&J0&&(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(W){this._mediaElement.volume=W}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(W){this._mediaElement.muted=W}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(W){this._mediaElement?this._mediaElement.currentTime=W:this._pendingSeekTime=W}},{key:"mediaInfo",get:function(){var W=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",J={mimeType:W+this._mediaDataSource.type};return this._mediaElement&&(J.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(J.width=this._mediaElement.videoWidth,J.height=this._mediaElement.videoHeight)),J}},{key:"statisticsInfo",get:function(){var W={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return W;var J=!0,te=0,se=0;if(this._mediaElement.getVideoPlaybackQuality){var Ee=this._mediaElement.getVideoPlaybackQuality();te=Ee.totalVideoFrames,se=Ee.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(te=this._mediaElement.webkitDecodedFrameCount,se=this._mediaElement.webkitDroppedFrameCount):J=!1;return J&&(W.decodedFrames=te,W.droppedFrames=se),W}},{key:"_onvLoadedMetadata",value:function(W){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(we.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(we.STATISTICS_INFO,this.statisticsInfo)}}]),Se}(),Ct=At;w.install();function lt(Se,de){var W=Se;if(W==null||typeof W!="object")throw new s("MediaDataSource must be an javascript object!");if(!W.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(W.type){case"flv":return new et(W,de);default:return new Ct(W,de)}}function gt(){return ye.supportMSEH264Playback()}function kt(){return ye.getFeatureList()}var zt={};zt.createPlayer=lt,zt.isSupported=gt,zt.getFeatureList=kt,zt.BaseLoader=t,zt.LoaderStatus=i,zt.LoaderErrors=n,zt.Events=we,zt.ErrorTypes=_e,zt.ErrorDetails=je,zt.FlvPlayer=et,zt.NativePlayer=Ct,zt.LoggingControl=Te,Object.defineProperty(zt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var $t=Ke.a=zt},GgEA:function(Je,Ke,B){},Gytx:function(Je,Ke){Je.exports=function(ae,Q,U,w){var P=U?U.call(w,ae,Q):void 0;if(P!==void 0)return!!P;if(ae===Q)return!0;if(typeof ae!="object"||!ae||typeof Q!="object"||!Q)return!1;var S=Object.keys(ae),C=Object.keys(Q);if(S.length!==C.length)return!1;for(var T=Object.prototype.hasOwnProperty.bind(Q),h=0;h>>6)+h(128|I&63):h(224|I>>>12&15)+h(128|I>>>6&63)+h(128|I&63)}else{var I=65536+(D.charCodeAt(0)-55296)*1024+(D.charCodeAt(1)-56320);return h(240|I>>>18&7)+h(128|I>>>12&63)+h(128|I>>>6&63)+h(128|I&63)}},f=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(D){return D.replace(f,p)},a=function(D){var I=[0,2,1][D.length%3],F=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),z=[C.charAt(F>>>18),C.charAt(F>>>12&63),I>=2?"=":C.charAt(F>>>6&63),I>=1?"=":C.charAt(F&63)];return z.join("")},c=w.btoa&&typeof w.btoa=="function"?function(D){return w.btoa(D)}:function(D){if(D.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return D.replace(/[\s\S]{1,3}/g,a)},s=function(D){return c(l(String(D)))},u=function(D){return D.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},i=function(D,I){return I?u(s(D)):s(D)},n=function(D){return i(D,!0)},t;w.Uint8Array&&(t=function(D,I){for(var F="",z=0,ne=D.length;z>>18)+C.charAt(Z>>>12&63)+(typeof G!="undefined"?C.charAt(Z>>>6&63):"=")+(typeof X!="undefined"?C.charAt(Z&63):"=")}return I?u(F):F});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(D){switch(D.length){case 4:var I=(7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3),F=I-65536;return h((F>>>10)+55296)+h((F&1023)+56320);case 3:return h((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return h((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},b=function(D){return D.replace(d,v)},y=function(D){var I=D.length,F=I%4,z=(I>0?T[D.charAt(0)]<<18:0)|(I>1?T[D.charAt(1)]<<12:0)|(I>2?T[D.charAt(2)]<<6:0)|(I>3?T[D.charAt(3)]:0),ne=[h(z>>>16),h(z>>>8&255),h(z&255)];return ne.length-=[0,0,2,1][F],ne.join("")},_=w.atob&&typeof w.atob=="function"?function(D){return w.atob(D)}:function(D){return D.replace(/\S{1,4}/g,y)},m=function(D){return _(String(D).replace(/[^A-Za-z0-9\+\/]/g,""))},g=function(D){return b(_(D))},E=function(D){return String(D).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},o=function(D){return g(E(D))},x;w.Uint8Array&&(x=function(D){return Uint8Array.from(m(E(D)),function(I){return I.charCodeAt(0)})});var A=function(){var D=w.Base64;return w.Base64=P,D};if(w.Base64={VERSION:S,atob:m,btoa:c,fromBase64:o,toBase64:i,utob:l,encode:i,encodeURI:n,btou:b,decode:o,noConflict:A,fromUint8Array:t,toUint8Array:x},typeof Object.defineProperty=="function"){var O=function(D){return{value:D,enumerable:!1,writable:!0,configurable:!0}};w.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",O(function(){return o(this)})),Object.defineProperty(String.prototype,"toBase64",O(function(D){return i(this,D)})),Object.defineProperty(String.prototype,"toBase64URI",O(function(){return i(this,!0)}))}}return w.Meteor&&(Base64=w.Base64),Je.exports?Je.exports.Base64=w.Base64:!(Q=[],U=function(){return w.Base64}.apply(Ke,Q),U!==void 0&&(Je.exports=U)),{Base64:w.Base64}})}).call(this,B("IyRk"))},JOrW:function(Je,Ke,B){Je.exports=B.p+"static/gf.09d89ab3.svg"},LdHM:function(Je,Ke,B){"use strict";B.d(Ke,"b",function(){return d}),B.d(Ke,"a",function(){return b});var ae=B("1OyB"),Q=B("vuIU"),U=B("Ji7U"),w=B("LK+K"),P=B("cDcd"),S=B("rePB"),C=B("Ff2n"),T=B("ODXe"),h=B("4IlW"),p=B("bX4T"),f=B("YrtM"),l=B("TSYQ"),a=B.n(l),c=B("+nKL"),s=B("8OUc"),u=function(X,Z){var K=X.prefixCls,q=X.id,ie=X.flattenOptions,oe=X.childrenAsData,ye=X.values,pe=X.searchValue,we=X.multiple,fe=X.defaultActiveFirstOption,Te=X.height,Fe=X.itemHeight,De=X.notFoundContent,Me=X.open,Ue=X.menuItemSelectedIcon,ve=X.virtual,ce=X.onSelect,Ie=X.onToggleOpen,Ne=X.onActiveValue,Xe=X.onScroll,ee=X.onMouseEnter,k="".concat(K,"-item"),N=Object(f.a)(function(){return ie},[Me,ie],function(He,Pe){return Pe[0]&&He[1]!==Pe[1]}),$=P.useRef(null),V=function(Pe){Pe.preventDefault()},Y=function(Pe){$.current&&$.current.scrollTo({index:Pe})},me=function(Pe){for(var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=N.length,he=0;he1&&arguments[1]!==void 0?arguments[1]:!1;return Object(_.a)(G).map(function(Z,K){if(!P.isValidElement(Z)||!Z.type)return null;var q=Z.type.isSelectOptGroup,ie=Z.key,oe=Z.props,ye=oe.children,pe=Object(C.a)(oe,["children"]);return X||!q?m(Z):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(ie===null?K:ie,"__"),label:ie},pe),{},{options:g(ye)})}).filter(function(Z){return Z})}var E=B("2Qr1"),o=B("qNPg"),x=B("U8pU"),A=B("Kwbf"),O=B("WKfj");function D(G){var X=G.mode,Z=G.options,K=G.children,q=G.backfill,ie=G.allowClear,oe=G.placeholder,ye=G.getInputElement,pe=G.showSearch,we=G.onSearch,fe=G.defaultOpen,Te=G.autoFocus,Fe=G.labelInValue,De=G.value,Me=G.inputValue,Ue=G.optionLabelProp,ve=X==="multiple"||X==="tags",ce=pe!==void 0?pe:ve||X==="combobox",Ie=Z||g(K);if(Object(A.a)(X!=="tags"||Ie.every(function(k){return!k.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var Ne=Ie.some(function(k){return k.options?k.options.some(function(N){return typeof("value"in N?N.value:N.key)=="number"}):typeof("value"in k?k.value:k.key)=="number"});Object(A.a)(!Ne,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)(X!=="combobox"||!Ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)(X==="combobox"||!q,"`backfill` only works with `combobox` mode."),Object(A.a)(X==="combobox"||!ye,"`getInputElement` only work with `combobox` mode."),Object(A.b)(X!=="combobox"||!ye||!ie||!oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!ce&&X!=="combobox"&&X!=="tags"&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!fe||Te,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),De!=null){var Xe=Object(O.d)(De);Object(A.a)(!Fe||Xe.every(function(k){return Object(x.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(A.a)(!ve||Array.isArray(De),"`value` should be array when `mode` is `multiple` or `tags`")}if(K){var ee=null;Object(_.a)(K).some(function(k){if(!P.isValidElement(k)||!k.type)return!1;var N=k.type;if(N.isSelectOption)return!1;if(N.isSelectOptGroup){var $=Object(_.a)(k.props.children).every(function(V){return!P.isValidElement(V)||!k.type||V.type.isSelectOption?!0:(ee=V.type,!1)});return!$}return ee=N,!0}),ee&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ee.displayName||ee.name||ee,"`.")),Object(A.a)(Me===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=D,F=Object(o.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:g,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:I,fillOptionsWithMissingValue:E.a}),z=function(G){Object(U.a)(Z,G);var X=Object(w.a)(Z);function Z(){var K;return Object(ae.a)(this,Z),K=X.apply(this,arguments),K.selectRef=P.createRef(),K.focus=function(){K.selectRef.current.focus()},K.blur=function(){K.selectRef.current.blur()},K}return Object(Q.a)(Z,[{key:"render",value:function(){return P.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Z}(P.Component);z.Option=d,z.OptGroup=b;var ne=z,j=Ke.c=ne},M8RZ:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return h});var ae=B("fWQN"),Q=B("mtLc"),U=B("yKVA"),w=B("879j"),P=B("cDcd"),S=B.n(P),C=B("faye"),T=B.n(C),h=function(p){Object(U.a)(l,p);var f=Object(w.a)(l);function l(a){var c;Object(ae.a)(this,l),c=f.call(this,a);var s=window.document;return c.node=s.createElement("div"),s.body.appendChild(c.node),c}return Object(Q.a)(l,[{key:"render",value:function(){var c=this.props.children;return Object(C.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),l}(S.a.Component)},MFOe:function(Je,Ke,B){(function(ae){var Q=S(),U=C(),w=T(),P=typeof window!="undefined"?window:ae;Je.exports={assign:Q,create:U,trim:w,bind:h,slice:p,each:f,map:l,pluck:a,isList:c,isFunction:s,isObject:u,Global:P};function S(){return Object.assign?Object.assign:function(n,t,d,v){for(var b=1;b=0;u-=1){var i=T.get(u)||new Set;i.forEach(function(n){var t=n.parent,d=n.node;if(p(d)||!n.parent||s.has(n.parent.key))return;if(p(n.parent.node)){s.add(t.key);return}var v=!0,b=!1;(t.children||[]).filter(function(y){return!p(y.node)}).forEach(function(y){var _=y.key,m=f.has(_);v&&!m&&(v=!1),!b&&(m||l.has(_))&&(b=!0)}),v&&f.add(t.key),b&&l.add(t.key),s.add(t.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(Q(l,f))}}function P(C,T,h,p,f){for(var l=new Set(C),a=new Set(T),c=0;c<=p;c+=1){var s=h.get(c)||new Set;s.forEach(function(t){var d=t.key,v=t.node,b=t.children,y=b===void 0?[]:b;!l.has(d)&&!a.has(d)&&!f(v)&&y.filter(function(_){return!f(_.node)}).forEach(function(_){l.delete(_.key)})})}a=new Set;for(var u=new Set,i=p;i>=0;i-=1){var n=h.get(i)||new Set;n.forEach(function(t){var d=t.parent,v=t.node;if(f(v)||!t.parent||u.has(t.parent.key))return;if(f(t.parent.node)){u.add(d.key);return}var b=!0,y=!1;(d.children||[]).filter(function(_){return!f(_.node)}).forEach(function(_){var m=_.key,g=l.has(m);b&&!g&&(b=!1),!y&&(g||a.has(m))&&(y=!0)}),b||l.delete(d.key),y&&a.add(d.key),u.add(d.key)})}return{checkedKeys:Array.from(l),halfCheckedKeys:Array.from(Q(a,l))}}function S(C,T,h,p){var f=[],l;p?l=p:l=U;var a=new Set(C.filter(function(i){var n=!!h[i];return n||f.push(i),n})),c=new Map,s=0;Object.keys(h).forEach(function(i){var n=h[i],t=n.level,d=c.get(t);d||(d=new Set,c.set(t,d)),d.add(n),s=Math.max(s,t)}),Object(ae.a)(!f.length,"Tree missing follow keys: ".concat(f.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var u;return T===!0?u=w(a,c,s,l):u=P(a,T.halfCheckedKeys,c,s,l),u}},OLES:function(Je,Ke,B){"use strict";var ae=B("U8pU"),Q=B("VTBJ"),U=B("Ff2n"),w=B("cDcd"),P=B("uciX"),S=B("7ixt"),C=function(a){var c=a.overlay,s=a.prefixCls,u=a.id,i=a.overlayInnerStyle;return w.createElement("div",{className:"".concat(s,"-inner"),id:u,role:"tooltip",style:i},typeof c=="function"?c():c)},T=C,h=function(a,c){var s=a.overlayClassName,u=a.trigger,i=u===void 0?["hover"]:u,n=a.mouseEnterDelay,t=n===void 0?0:n,d=a.mouseLeaveDelay,v=d===void 0?.1:d,b=a.overlayStyle,y=a.prefixCls,_=y===void 0?"rc-tooltip":y,m=a.children,g=a.onVisibleChange,E=a.afterVisibleChange,o=a.transitionName,x=a.animation,A=a.placement,O=A===void 0?"right":A,D=a.align,I=D===void 0?{}:D,F=a.destroyTooltipOnHide,z=F===void 0?!1:F,ne=a.defaultVisible,j=a.getTooltipContainer,G=a.overlayInnerStyle,X=Object(U.a)(a,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Z=Object(w.useRef)(null);Object(w.useImperativeHandle)(c,function(){return Z.current});var K=Object(Q.a)({},X);"visible"in a&&(K.popupVisible=a.visible);var q=function(){var we=a.arrowContent,fe=we===void 0?null:we,Te=a.overlay,Fe=a.id;return[w.createElement("div",{className:"".concat(_,"-arrow"),key:"arrow"},fe),w.createElement(T,{key:"content",prefixCls:_,id:Fe,overlay:Te,overlayInnerStyle:G})]},ie=!1,oe=!1;if(typeof z=="boolean")ie=z;else if(z&&Object(ae.a)(z)==="object"){var ye=z.keepParent;ie=ye===!0,oe=ye===!1}return w.createElement(P.a,Object.assign({popupClassName:s,prefixCls:_,popup:q,action:i,builtinPlacements:S.a,popupPlacement:O,ref:Z,popupAlign:I,getPopupContainer:j,onPopupVisibleChange:g,afterPopupVisibleChange:E,popupTransitionName:o,popupAnimation:x,defaultPopupVisible:ne,destroyPopupOnHide:ie,autoDestroy:oe,mouseLeaveDelay:v,popupStyle:b,mouseEnterDelay:t},K),m)},p=Object(w.forwardRef)(h),f=Ke.a=p},OZM5:function(Je,Ke,B){"use strict";B.d(Ke,"b",function(){return p}),B.d(Ke,"a",function(){return f}),B.d(Ke,"k",function(){return l}),B.d(Ke,"h",function(){return a}),B.d(Ke,"i",function(){return c}),B.d(Ke,"g",function(){return s}),B.d(Ke,"c",function(){return u}),B.d(Ke,"d",function(){return i}),B.d(Ke,"j",function(){return d}),B.d(Ke,"e",function(){return v}),B.d(Ke,"f",function(){return b});var ae=B("KQm4"),Q=B("U8pU"),U=B("Ff2n"),w=B("cDcd"),P=B.n(w),S=B("Kwbf"),C=B("WaYH"),T=.25,h=2;function p(y,_){var m=y.slice(),g=m.indexOf(_);return g>=0&&m.splice(g,1),m}function f(y,_){var m=y.slice();return m.indexOf(_)===-1&&m.push(_),m}function l(y){return y.split("-")}function a(y,_){return"".concat(y,"-").concat(_)}function c(y){return y&&y.type&&y.type.isTreeNode}function s(y,_){var m=[y],g=_[y];function E(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(x){var A=x.key,O=x.children;m.push(A),E(O)})}return E(g.children),m}function u(y,_){var m=y.clientY,g=_.selectHandle.getBoundingClientRect(),E=g.top,o=g.bottom,x=g.height,A=Math.max(x*T,h);return m<=E+A?-1:m>=o-A?1:0}function i(y,_){if(!y)return;var m=_.multiple;return m?y.slice():y.length?[y[0]]:y}var n=function(_){return _};function t(y,_){if(!y)return[];var m=_||{},g=m.processProps,E=g===void 0?n:g,o=Array.isArray(y)?y:[y];return o.map(function(x){var A=x.children,O=Object(U.a)(x,["children"]),D=t(A,_);return P.a.createElement(C.a,Object.assign({},E(O)),D)})}function d(y){if(!y)return null;var _;if(Array.isArray(y))_={checkedKeys:y,halfCheckedKeys:void 0};else if(Object(Q.a)(y)==="object")_={checkedKeys:y.checked||void 0,halfCheckedKeys:y.halfChecked||void 0};else return Object(S.a)(!1,"`checkedKeys` is not an array or an object"),null;return _}function v(y,_){var m=new Set;function g(E){if(m.has(E))return;var o=_[E];if(!o)return;m.add(E);var x=o.parent,A=o.node;if(A.disabled)return;x&&g(x.key)}return(y||[]).forEach(function(E){g(E)}),Object(ae.a)(m)}function b(y){var _={};return Object.keys(y).forEach(function(m){(m.startsWith("data-")||m.startsWith("aria-"))&&(_[m]=y[m])}),_}},"OkW/":function(Je,Ke,B){},Ot1p:function(Je,Ke,B){"use strict";var ae=B("2qtc"),Q=B("kLXV"),U=B("rAM+"),w=B("miYZ"),P=B("tsqr"),S=B("9og8"),C=B("tJVT"),T=B("jrin"),h=B("WmNS"),p=B.n(h),f=B("cDcd"),l=B.n(f),a=B("VrN/"),c=B.n(a),s=B("bdgK"),u=B("p77/"),i=B("Bd2K"),n=B("ELLl"),t=B("19Vz"),d=B("lZu9"),v=B("+NIl"),b=B("kSUc"),y=B("9Bee"),_=function(Be){var Qe=Be.value,rt=Qe===void 0?"":Qe,dt=Be.className,xt=Be.showTextOnly,_t=Be.showLines,wt=Be.style,st=wt===void 0?{}:wt,ut=Object(f.useMemo)(function(){return""},[rt]);return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},m=B("0Owb"),g=B("dejd"),E=B("C+DQ"),o=B("1vsH"),x=B("m3rI"),A=[{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 O(Be){var Qe=Be.onActionCallback,rt=Be.title,dt=Be.icon,xt=Be.actionName,_t=Be.className,wt=_t===void 0?"":_t,st=Be.children;function ut(){Qe(xt)}return l.a.createElement("a",{title:rt,className:wt,onClick:ut},l.a.createElement("i",{className:"md-iconfont ".concat(dt)}),st)}var D=function(Be){var Qe=Be.watch,rt=Be.showNullButton,dt=Be.onActionCallback,xt=Be.fullScreen,_t=Be.insertTemp,wt=Be.hidetoolBar,st=Be.uuid,ut=Be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(o.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(o.G)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(x.a.PROXY_SERVER)));var $e=[].concat(A,[{title:"".concat(Qe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Qe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return l.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&$e.map(function(_e,je){return l.a.createElement("li",{key:je},_e.actionName?l.a.createElement(O,Object(m.a)({},_e,{onActionCallback:dt})):l.a.createElement("span",{className:"v-line"}))}),rt?l.a.createElement("li",null,l.a.createElement(O,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:dt},l.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,_t&&l.a.createElement("li",null,l.a.createElement(O,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(_t),onActionCallback:dt},l.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),l.a.createElement("li",{className:"btn-full-screen"},l.a.createElement(O,{icon:"".concat(xt?"icon-shrink":"icon-enlarge"),title:xt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:dt})))},I=B("M8RZ"),F=B("+L6B"),z=B("2/Rp"),ne=B("y8nQ"),j=B("Vl3Y"),G=B("5NDa"),X=B("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},K=function(Be){var Qe=Be.callback,rt=Be.onCancel;function dt(xt){Qe(xt)}return l.a.createElement(j.a,Object(m.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:dt}),l.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},l.a.createElement(X.a,null)),l.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},l.a.createElement(X.a,null)),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(z.a,{type:"ghost",onClick:rt},"\u53D6\u6D88")))},q=B("7ahc"),ie=B("HmJG"),oe=B("BjJ7"),ye=j.a.useForm,pe={width:280,marginRight:10},we={labelCol:{span:5},wrapperCol:{span:19}},fe=function(Be){var Qe=Be.callback,rt=Be.onCancel,dt=ye(),xt=Object(C.a)(dt,1),_t=xt[0];function wt($e){Qe($e)}function st($e,_e){if($e.status===-1){P.b.error($e.message);return}_t.setFieldsValue({src:"/api/attachments/".concat($e.id),type:_e.type})}function ut($e){var _e=$e.target.files[0];Fe(_e,st)}return l.a.createElement(j.a,Object(m.a)({form:_t},we,{className:"upload-image-panel",onFinish:wt}),l.a.createElement(j.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},l.a.createElement("div",{className:"flex-container"},l.a.createElement(j.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},l.a.createElement(X.a,{style:pe})),l.a.createElement(Te,{onFileChange:ut}))),l.a.createElement(j.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},l.a.createElement(X.a,{style:{width:264}})),l.a.createElement(j.a.Item,{style:{textAlign:"right"}},l.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(z.a,{type:"ghost",onClick:rt},"\u53D6\u6D88")))};function Te(Be){var Qe=Be.onFileChange;return l.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",l.a.createElement("input",{type:"file",onChange:Qe}))}function Fe(Be,Qe){if(!Be)throw new String("\u6CA1\u6709\u6587\u4EF6");var rt=new FormData;rt.append("editormd-image-file",Be),rt.append("file_param_name","editormd-image-file"),rt.append("byxhr","true");var dt=new window.XMLHttpRequest;dt.withCredentials=!0,dt.addEventListener("load",function(xt){Qe(JSON.parse(xt.target.responseText),Be)},!1),dt.addEventListener("error",function(xt){console.error(xt)},!1),dt.open("POST","".concat(oe.a,"/api/attachments.json")),dt.send(rt)}var De=B("giR+"),Me=B("fyUT"),Ue=B("7Kak"),ve=B("9yH6"),ce=ve.a.Group,Ie={margin:"0 8px"},Ne=function(Be){var Qe=Be.callback,rt=Be.onCancel;function dt(xt){Qe(xt)}return l.a.createElement(j.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:dt},l.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},l.a.createElement("span",{style:Ie},"\u5355\u5143\u683C\u6570\uFF1A"),l.a.createElement("span",{style:Ie},"\u884C\u6570"),l.a.createElement(j.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},l.a.createElement(Me.a,null)),l.a.createElement("span",{style:Ie},"\u5217\u6570"),l.a.createElement(j.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},l.a.createElement(Me.a,null))),l.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},l.a.createElement("span",{style:Ie},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),l.a.createElement(j.a.Item,{name:"align"},l.a.createElement(ce,null,l.a.createElement(ve.a,{value:"default"},l.a.createElement("i",{className:"fa fa-align-justify"})),l.a.createElement(ve.a,{value:"left"},l.a.createElement("i",{className:"fa fa-align-left"})),l.a.createElement(ve.a,{value:"center"},l.a.createElement("i",{className:"fa fa-align-center"})),l.a.createElement(ve.a,{value:"right"},l.a.createElement("i",{className:"fa fa-align-right"}))))),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(z.a,{type:"ghost",onClick:rt},"\u53D6\u6D88")))},Xe=B("ErOA"),ee=B("7Cbv"),k="link",N="upload-image",$="code-block",V="add-table",Y="------------",me={default:Y,left:":".concat(Y),center:":".concat(Y,":"),right:"".concat(Y,":")},Ae=B("9VGf"),at,Le;function ke(){}var Ye=0,Ze=1e4,Ve="\u2581",He=` **\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 Pe(Be){return/^\d+$/.test(Be)?"".concat(Be,"px"):Be}var Re=navigator.platform.toUpperCase().indexOf("MAC")>=0,Oe=Re?"Cmd":"Ctrl",he=["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"],be=(at={},Object(T.a)(at,Oe+"-B","bold"),Object(T.a)(at,Oe+"-I","italic"),at),Ce=(Le={},Object(T.a)(Le,k,"\u6DFB\u52A0\u94FE\u63A5"),Object(T.a)(Le,$,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(T.a)(Le,N,"\u6DFB\u52A0\u6587\u4EF6"),Object(T.a)(Le,V,"\u6DFB\u52A0\u8868\u683C"),Le),xe=Ke.a=function(Be){var Qe=Be.defaultValue,rt=Qe===void 0?"":Qe,dt=Be.onChange,xt=Be.width,_t=xt===void 0?"100%":xt,wt=Be.height,st=wt===void 0?400:wt,ut=Be.miniToolbar,$e=ut===void 0?!1:ut,_e=Be.isFocus,je=_e===void 0?!1:_e,ct=Be.watch,et=Be.insertTemp,At=Be.mode,Ct=At===void 0?"markdown":At,lt=Be.id,gt=lt===void 0?"markdown-editor-id":lt,kt=Be.showResizeBar,zt=kt===void 0?!1:kt,$t=Be.noStorage,Se=$t===void 0?!1:$t,de=Be.showNullButton,W=de===void 0?!1:de,J=Be.hidetoolBar,te=J===void 0?!1:J,se=Be.fullScreen,Ee=se===void 0?!1:se,ze=Be.onBlur,qe=Be.onCMBeforeChange,St=Be.onFullScreen,Lt=Be.className,it=Lt===void 0?"":Lt,Tt=Be.disablePaste,Qt=Tt===void 0?!1:Tt,Et=Be.placeholder,nn=Et===void 0?"":Et,Jt=Be.values,It=Jt===void 0?"":Jt,yt=Object(f.useState)(null),Sn=Object(C.a)(yt,2),mt=Sn[0],ln=Sn[1],fn=Object(f.useState)(rt),Zn=Object(C.a)(fn,2),rr=Zn[0],xn=Zn[1],Er=Object(f.useState)(ct),Cr=Object(C.a)(Er,2),un=Cr[0],Mn=Cr[1],Nr=Object(f.useState)(Ee),Xr=Object(C.a)(Nr,2),xr=Xr[0],ur=Xr[1],gr=Object(f.useState)(""),gi=Object(C.a)(gr,2),pr=gi[0],yr=gi[1],Or=Object(f.useState)(0),Kr=Object(C.a)(Or,2),Sr=Kr[0],ui=Kr[1],Pr=Object(f.useState)(st),yi=Object(C.a)(Pr,2),ci=yi[0],ni=yi[1],Di=Object(f.useState)(!1),Ni=Object(C.a)(Di,2),Ui=Ni[0],di=Ni[1],mr=Object(f.useRef)(Object(ee.a)()),dr=Object(f.useRef)(!1),qr=Object(f.useRef)(),ri=Object(f.useRef)(),fi=Object(f.useRef)(),ii=Object(f.useRef)(),Xi=Object(f.useRef)(),na=function(){var tn=Object(S.a)(p.a.mark(function yn(){var an,Rn;return p.a.wrap(function(or){for(;;)switch(or.prev=or.next){case 0:return or.next=2,Object(Xe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:mr.current}});case 2:Rn=or.sent,Rn!=null&&(an=Rn.attachments)!==null&&an!==void 0&&an.length&&(console.log("cm:",mt,ri),Rn.attachments.map(function(Vt){Vt.content_type.indexOf("image")>-1?mt.replaceSelection("![,](/api/attachments/".concat(Vt.id,"?type=").concat(Vt.content_type,")")):Vt.content_type.indexOf("video")>-1?mt.replaceSelection('')):Vt.content_type.indexOf("pdf")>-1?mt.replaceSelection('
    ').concat(Vt.name,"")):mt.replaceSelection("[".concat(Vt.name,"](").concat(x.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}));case 4:case"end":return or.stop()}},yn)}));return function(){return tn.apply(this,arguments)}}();Object(f.useEffect)(function(){xn(It),mt==null||mt.setValue(It)},[It]),Object(f.useEffect)(function(){St==null||St(xr)},[xr]),Object(f.useEffect)(function(){if(ri.current){var tn=c.a.fromTextArea(ri.current,{mode:Ct,lineNumbers:!$e,lineWrapping:!0,value:rt,autoCloseTags:!0,autoCloseBrackets:!0});je&&tn.focus();function yn(an,Rn){if(Qt){Rn.preventDefault();return}var Xn=Rn.clipboardData;if(Xn){var or=Xn.types.toString(),Vt=Xn.items;if(or==="Files"||Xn.types.indexOf("Files")>-1){if(Rn.preventDefault(),Ct=="stex")return;try{var br,Hr=Vt[1];((br=Vt[0])===null||br===void 0?void 0:br.kind)==="file"&&(Hr=Vt[0]);var kn=Hr.getAsFile(),Oi=kn.name.split(".").pop();Fe(kn,function(nr){if(nr.id){var Ur,nt,pt;(kn==null||((Ur=kn.type)===null||Ur===void 0)?void 0:Ur.indexOf("image"))>-1?tn.replaceSelection("![,](/api/attachments/".concat(nr.id,"?type=").concat(nr.content_type,")")):(kn==null||((nt=kn.type)===null||nt===void 0)?void 0:nt.indexOf("video"))>-1?tn.replaceSelection('')):(kn==null||((pt=kn.type)===null||pt===void 0)?void 0:pt.indexOf("pdf"))>-1?tn.replaceSelection('').concat(kn.name,"")):he.includes(Oi)?tn.replaceSelection('').concat(kn.name,"")):tn.replaceSelection("[".concat(kn.name,"](").concat(x.a.API_SERVER,"/api/attachments/").concat(nr.id,"?type=").concat(nr.content_type,")"))}else(nr==null?void 0:nr.status)===401&&(document.location.href="/user/login")})}catch(nr){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return tn.on("paste",yn),tn.on("dragleave",function(an,Rn){fi.current.classList.remove("mouse-hover-md")}),tn.on("dragover",function(an,Rn){fi.current.classList.add("mouse-hover-md")}),tn.on("drop",function(an,Rn){fi.current.classList.add("mouse-hover-md");var Xn;if(Xn=Rn.dataTransfer.files,Xn.length>0){Rn.preventDefault(),Rn.stopPropagation();for(var or=function(Hr){var kn=Xn[Hr],Oi=kn.name.split(".").pop();Fe(kn,function(nr){if(nr.id){var Ur,nt,pt;(kn==null||((Ur=kn.type)===null||Ur===void 0)?void 0:Ur.indexOf("image"))>-1?tn.replaceSelection("![,](/api/attachments/".concat(nr.id,"?type=").concat(nr.content_type,")")):(kn==null||((nt=kn.type)===null||nt===void 0)?void 0:nt.indexOf("video"))>-1?tn.replaceSelection('')):(kn==null||((pt=kn.type)===null||pt===void 0)?void 0:pt.indexOf("pdf"))>-1?tn.replaceSelection('').concat(kn.name,"")):he.includes(Oi)?tn.replaceSelection('').concat(kn.name,"")):tn.replaceSelection("[".concat(kn.name,"](").concat(x.a.API_SERVER,"/api/attachments/").concat(nr.id,"?type=").concat(nr.content_type,")"))}else(nr==null?void 0:nr.status)===401&&(document.location.href="/user/login")})},Vt=0;Vt0||Vt.target.offsetWidth>0)&&(ai(),mt.setSize("100%","100%"),mt.refresh())}}catch(br){Xn.e(br)}finally{Xn.f()}});return an.observe(ri.current.parentElement),an}if(mt){var yn=tn();return function(){yn.unobserve(ri.current.parentElement)}}},[mt,ai]),Object(f.useEffect)(function(){if(mt){for(var tn=[],yn=function(){var Vt=Rn[an];Xn=Object(C.a)(Vt,2);var br=Xn[0],Hr=Xn[1],kn=Object(T.a)({},br,function(){Yi(Hr)});tn.push(kn),mt.addKeyMap(kn)},an=0,Rn=Object.entries(be);an0){var tn=new Date().getTime(),yn=window.sessionStorage.getItem(gt);tn>=Sr+Ze&&(!yn||yn!==rr)&&(window.sessionStorage.setItem(gt,rr),di(!0))}},Ze),Object(f.useEffect)(function(){Mn(ct)},[mt,ct]),Object(f.useEffect)(function(){mt&&(je&&mt.focus())},[mt,je]),Object(f.useEffect)(function(){if(un&&mt){var tn=mt.getScrollerElement();function yn(an){var Rn=an.target;if(Xi.current){var Xn=Rn.scrollTop/Rn.scrollHeight;Xi.current.scrollTop=Xi.current.scrollHeight*Xn}}return tn.addEventListener("scroll",yn),function(){tn.removeEventListener("scroll",yn)}}},[mt,un]),Object(f.useEffect)(function(){if(mt&&qe){function tn(yn,an){qe(yn,an)}return mt.on("beforeChange",tn),function(){mt.off("beforeChange",tn)}}},[mt,qe]),Object(f.useEffect)(function(){if(mt&&ze){function tn(){ze(mt.getValue())}return mt.on("blur",tn),function(){mt.off("blur",tn)}}},[mt,ze]),Object(f.useEffect)(function(){if(mt){function tn(yn){var an=yn.getValue();xn(an),ui(new Date().getTime()),yn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),dt&&dt(an)}return mt.on("change",tn),function(){mt.off("change",tn)}}},[mt,dt]),Object(f.useEffect)(function(){mt&&(rt==null?(mt.setValue(""),xn("")):rt!==mt.getValue()&&(mt.setValue(rt),xn(rt),mt.setCursor(mt.lineCount(),0)))},[mt,rt]);var Yi=Object(f.useCallback)(function(tn){var yn=mt.getCursor(),an=mt.getSelection(),Rn=an.split(` `);switch(tn){case"bold":return mt.replaceSelection("**"+an+"**"),an===""&&mt.setCursor(yn.line,yn.ch+2),mt.focus();case"italic":return mt.replaceSelection("*"+an+"*"),an===""&&mt.setCursor(yn.line,yn.ch+1),mt.focus();case"code":return mt.replaceSelection("`"+an+"`"),an===""&&mt.setCursor(yn.line,yn.ch+1),mt.focus();case"inline-latex":return mt.replaceSelection("`$$"+an+"$$`"),an===""&&mt.setCursor(yn.line,yn.ch+3),mt.focus();case"latex":return mt.replaceSelection("```latex\n"+an+"\n```"),mt.setCursor(yn.line+1,an.length+1),mt.focus();case"line-break":return mt.replaceSelection(`
    `),mt.focus();case"list-ul":return an===""?mt.replaceSelection("- "+an):mt.replaceSelection(Rn.map(function(Xn){return Xn===""?"":"- ".concat(Xn)}).join(` `)),mt.focus();case"list-ol":return an===""?mt.replaceSelection("1. "+an):mt.replaceSelection(Rn.map(function(Xn,or){return Xn===""?"":"".concat(or+1,". ").concat(Xn)}).join(` `)),mt.focus();case"add-null-ch":return an===""&&mt.setCursor(yn.line,yn.ch+1),mt.replaceSelection(Ve),mt.focus();case"inster-template-1":return an===""&&mt.setCursor(yn.line,yn.ch),mt.replaceSelection(He),mt.focus();case"eraser":return mt.setValue(""),mt.focus();case"trigger-watch":return Mn(!un),mt.focus();case"trigger-full-screen":return ur(!xr),mt.focus();case k:yr(k);return;case $:yr($);return;case N:yr(N);return;case V:yr(V);return;default:throw new Error}},[mt,un,xr]),Zr=Object(f.useCallback)(function(tn){yr("");switch(pr){case k:var yn=tn.title,an=tn.link;return mt.replaceSelection("[".concat(yn,"](").concat(an,")")),mt.focus();case $:var Rn=tn.language,Xn=tn.content;return mt.replaceSelection(["```"+Rn,Xn,"```"].join(` `)),mt.focus();case N:var or=tn.src,Vt=tn.alt;return Vt?mt.replaceSelection("![ ".concat(Vt," ]( ").concat(or,' "').concat(Vt,'" )')):mt.replaceSelection("![,](".concat(or,")")),mt.focus();case V:for(var br=tn.row,Hr=tn.col,kn=tn.align,Oi=` `,nr=0;nr300&&(br=300);var Hr=st+br+"px";ni(Hr)}}return tn.addEventListener("mousedown",Rn),document.addEventListener("mousemove",or),document.addEventListener("mouseup",Xn),function(){tn.removeEventListener("mousedown",Rn),document.removeEventListener("mousemove",or),document.removeEventListener("mouseup",Xn)}}},[mt,ii]),Object(f.useEffect)(function(){ni(st)},[st]);var Ci=Pe(_t),$i=Pe(ci),bi={width:Ci,height:$i},Ji=Object(f.useMemo)(function(){if(Sr){var tn=new Date(Sr),yn=tn.getHours(),an=tn.getMinutes(),Rn=tn.getSeconds();return yn=yn<10?"0"+yn:yn,an=an<10?"0"+an:an,Rn=Rn<10?"0"+Rn:Rn,"".concat(yn,":").concat(an,":").concat(Rn)}return 0},[Sr]);function Qi(){window.sessionStorage.removeItem(gt),di(!1),ui(0)}function hi(){di(!1),ui(0),mt.setValue(window.sessionStorage.getItem(gt))}function Zi(tn,yn){var an=mt.getValue();an=an.replace(tn,yn),xn(an),mt==null||mt.setValue(an)}return l.a.createElement(f.Fragment,null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:fi},l.a.createElement("div",{className:"markdown-editor-container ".concat(it," ").concat(un?"on-preview":""," ").concat($e?"mini":""," ").concat(xr?"full-screen":""),style:bi},l.a.createElement(D,{insertTemp:et,watch:un,fullScreen:xr,showNullButton:W,onActionCallback:Yi,hidetoolBar:te,uuid:mr.current,setOpenPhones:function(){dr.current=!0}}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:ri,placeholder:nn})),un?l.a.createElement("div",{ref:Xi,className:"preview-container"},Ct==="stex"&&l.a.createElement(_,{value:rr}),Ct!=="stex"&&l.a.createElement(y.a,{edit:!0,value:rr,replaces:Zi})):null))),zt?l.a.createElement("a",{ref:ii,className:"editor-resize"}):null,l.a.createElement(I.a,null,Ce[pr]?l.a.createElement(Q.a,{centered:!0,title:Ce[pr],visible:!0,onCancel:Pi,footer:null,className:"markdown-popup-form"},Wi):null))}},P5Jw:function(Je,Ke,B){"use strict";var ae=B("rHrb"),Q=ae.CopyToClipboard;Q.CopyToClipboard=Q,Je.exports=Q},PD8m:function(Je,Ke){Je.exports={name:"memoryStorage",read:ae,write:Q,each:U,remove:w,clearAll:P};var B={};function ae(S){return B[S]}function Q(S,C){B[S]=C}function U(S){for(var C in B)B.hasOwnProperty(C)&&S(B[C],C)}function w(S){delete B[S]}function P(S){B={}}},RELg:function(Je,Ke,B){var ae=B("MFOe"),Q=ae.Global;Je.exports={name:"oldIE-userDataStorage",write:C,read:T,each:h,remove:p,clearAll:f};var U="storejs",w=Q.document,P=c(),S=(Q.navigator?Q.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function C(s,u){if(S)return;var i=a(s);P(function(n){n.setAttribute(i,u),n.save(U)})}function T(s){if(S)return;var u=a(s),i=null;return P(function(n){i=n.getAttribute(u)}),i}function h(s){P(function(u){for(var i=u.XMLDocument.documentElement.attributes,n=i.length-1;n>=0;n--){var t=i[n];s(u.getAttribute(t.name),t.name)}})}function p(s){var u=a(s);P(function(i){i.removeAttribute(u),i.save(U)})}function f(){P(function(s){var u=s.XMLDocument.documentElement.attributes;s.load(U);for(var i=u.length-1;i>=0;i--)s.removeAttribute(u[i].name);s.save(U)})}var l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function a(s){return s.replace(/^\d/,"___$&").replace(l,"___")}function c(){if(!w||!w.documentElement||!w.documentElement.addBehavior)return null;var s="script",u,i,n;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window'),i.close(),u=i.w.frames[0].document,n=u.createElement("div")}catch(t){n=w.createElement("div"),u=w.body}return function(t){var d=[].slice.call(arguments,0);d.unshift(n),u.appendChild(n),n.addBehavior("#default#userData"),n.load(U),t.apply(this,d),u.removeChild(n);return}}},RpDr:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return y}),B.d(Ke,"c",function(){return g});var ae=B("+L6B"),Q=B("2/Rp"),U=B("tJVT"),w=B("k1fw"),P=B("jrin"),S=B("5NDa"),C=B("5rEg"),T=B("cDcd"),h=B.n(T),p=B("8Skl"),f=B("y3Kf"),l=B("bdLU"),a=B("J66h"),c=B.n(a),s=B("++UQ"),u=B.n(s),i=B("IxHN"),n=B("9Bee"),t=B("1vsH"),d,v=C.a.TextArea,b={visible:!1,tabIndex:"0"},y=(d={},Object(P.a)(d,l.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(P.a)(d,l.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(P.a)(d,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(P.a)(d,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(P.a)(d,4,"\u7F16\u8BD1\u5931\u8D25"),Object(P.a)(d,5,"\u6267\u884C\u5931\u8D25"),d),_;(function(o){o[o.SET_VISIBLE=0]="SET_VISIBLE",o[o.SET_TABINDEX=1]="SET_TABINDEX"})(_||(_={}));function m(o,x){switch(x.type){case _.SET_VISIBLE:return Object(w.a)(Object(w.a)({},o),{},{visible:x.payload});case _.SET_TABINDEX:return Object(w.a)(Object(w.a)({},o),{},{tabIndex:x.payload});default:throw new Error}}function g(o){var x=o.status,A=o.error_msg,O=o.output,D=o.input,I=o.expected_output,F=o.is_file,z=o.input_file_url,ne=o.output_file_url,j=o.expected_output_file_url,G=null,X={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(x){case l.a.NOMATCH:G=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!F&&h.a.createElement(n.a,{value:D,style:X}),F&&h.a.createElement("div",{style:X},h.a.createElement("a",{onClick:function(){return Object(t.y)(z,D)}},D)),h.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!F&&h.a.createElement(n.a,{value:O&&a.Base64.decode(O)||"",style:X}),F&&h.a.createElement("div",{style:X},h.a.createElement("a",{onClick:function(){return Object(t.y)(ne,O)}},O)),h.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!F&&h.a.createElement(n.a,{value:I&&a.Base64.decode(I)||"",style:X}),F&&h.a.createElement("div",{style:X},h.a.createElement("a",{onClick:function(){return Object(t.y)(j,I)}},I)));break;case l.a.EXECUTEFAILURE:G=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&h.a.createElement(n.a,{value:D,style:X}),F&&h.a.createElement("div",{style:X},h.a.createElement("a",{onClick:function(){return Object(t.y)(z,D)}},D)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.COMPILEFAILURE:G=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&h.a.createElement(n.a,{value:D,style:X}),F&&h.a.createElement("div",{style:X},h.a.createElement("a",{onClick:function(){return Object(t.y)(z,D)}},D)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.PODFAILURE:G=h.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case l.a.TIMEOUT:G=h.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return h.a.createElement(h.a.Fragment,null," ",G," ")}function E(o){var x=o.status,A=o.error_msg,O=o.execute_time,D=o.output,I=o.input,F=o.expected_output,z=o.is_file,ne=o.input_file_url,j=o.output_file_url,G=o.expected_output_file_url,X=null;switch(x){case l.a.OK:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",O),h.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),h.a.createElement("pre",null,a.Base64.decode(D)));break;case l.a.NOMATCH:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u8F93\u5165\uFF1A",h.a.createElement("pre",null,I)),h.a.createElement("p",null,"\u8F93\u51FA\uFF1A",D&&a.Base64.decode(D)),h.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",F&&a.Base64.decode(F)));break;case l.a.EXECUTEFAILURE:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",h.a.createElement("pre",null,I)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.COMPILEFAILURE:X=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",h.a.createElement("pre",null,I)),h.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),h.a.createElement("pre",{className:"error"},a.Base64.decode(A)));break;case l.a.PODFAILURE:X=h.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case l.a.TIMEOUT:X=h.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return h.a.createElement(h.a.Fragment,null," ",X," ")}Ke.b=function(o){var x=o.id,A=o.input,O=o.debuging,D=o.submitting,I=o.executingMessage,F=o.debugResult,z=o.onChangeInput,ne=o.onDebugCode,j=o.onSubmitCode,G=Object(T.useReducer)(m,b),X=Object(U.a)(G,2),Z=X[0],K=X[1],q=Z.visible,ie=Z.tabIndex;Object(T.useEffect)(function(){K({type:_.SET_VISIBLE,payload:!1})},[x]);function oe(fe){var Te=fe.target.id;K({type:_.SET_TABINDEX,payload:Te})}function ye(){K({type:_.SET_VISIBLE,payload:!q})}var pe=Object(T.useMemo)(function(){if(F){var fe=F.status;return h.a.createElement(h.a.Fragment,null,E(F))}return null},[F]);function we(){K({type:_.SET_VISIBLE,payload:!0}),K({type:_.SET_TABINDEX,payload:"1"}),ne()}return h.a.createElement("div",{className:"test-case-panel"},h.a.createElement("div",{className:"test-case-panel-body ".concat(q?"active":"")},h.a.createElement("ul",{className:"s-navs"},h.a.createElement("li",null,h.a.createElement("a",{className:ie==="0"?"active":"",id:"0",onClick:oe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),h.a.createElement("li",null,h.a.createElement("a",{className:ie==="1"?"active":"",id:"1",onClick:oe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),h.a.createElement("div",{className:"tab-panel-body ".concat(ie==="0"?"":"hide")},h.a.createElement(v,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:A,onChange:z})),h.a.createElement("div",{className:"tab-panel-body ".concat(ie==="1"?"":"hide")},O?h.a.createElement(i.a,{message:I}):F?h.a.createElement("section",{style:{height:200}}," ",pe," "):h.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"))),h.a.createElement("a",{className:"btn-collapse ".concat(q?"up":""),onClick:ye},q?h.a.createElement(p.a,null):h.a.createElement(f.a,null)),h.a.createElement("footer",{className:"footer"},h.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),h.a.createElement("div",{className:"flex-container"},h.a.createElement(Q.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),h.a.createElement(Q.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),h.a.createElement(Q.a,{className:"btn-green",type:"ghost",loading:O,onClick:we},"\u8C03\u8BD5\u4EE3\u7801"),h.a.createElement(Q.a,{type:"primary",loading:D,disabled:D,onClick:function(){K({type:_.SET_VISIBLE,payload:!1}),j()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(Je,Ke,B){Je.exports=B.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Je,Ke,B){var ae=B("wTVA"),Q=B("EbDI"),U=B("ZhPi"),w=B("wkBT");function P(S){return ae(S)||Q(S)||U(S)||w()}Je.exports=P,Je.exports.__esModule=!0,Je.exports.default=Je.exports},SJMd:function(Je,Ke){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var B,ae,Q,U=!1,w,P;window.PR_SHOULD_USE_CONTINUATION=!0;var S,C;(function(){var T=window,h=["break,continue,do,else,for,if,return,while"],p=[h,"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"],f=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],l=[f,"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"],a=[f,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[f,"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",u=[f,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",n=[h,"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"],t=[h,"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"],d=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[l,c,a,u,i,n,t,d],b=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y="str",_="kwd",m="com",g="typ",E="lit",o="pun",x="pln",A="tag",O="dec",D="src",I="atn",F="atv",z="nocode",ne="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(ce){for(var Ie=0,Ne=!1,Xe=!1,ee=0,k=ce.length;ee122||(he<65||Oe>90||Ye.push([Math.max(65,Oe)|32,Math.min(he,90)|32]),he<97||Oe>122||Ye.push([Math.max(97,Oe)&~32,Math.min(he,122)&~32]))}}Ye.sort(function(Be,Qe){return Be[0]-Qe[0]||Qe[1]-Be[1]});for(var be=[],Ce=[],He=0;Hexe[0]&&(xe[1]+1>xe[0]&&Ve.push("-"),Ve.push(Y(xe[1])))}return Ve.push("]"),Ve.join("")}function Ae(Le){for(var ke=Le.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")),Ye=ke.length,Ze=[],Ve=0,He=0;Ve=2&&Oe==="["?ke[Ve]=me(Pe):Oe!=="\\"&&(ke[Ve]=Pe.replace(/[a-zA-Z]/g,function(Ce){var xe=Ce.charCodeAt(0);return"["+String.fromCharCode(xe&~32,xe|32)+"]"}))}return ke.join("")}for(var at=[],ee=0,k=ce.length;ee=0;)Ne[at.charAt(Le)]=Ae;var ke=Ae[1],Ye=""+ke;V.hasOwnProperty(Ye)||($.push(ke),V[Ye]=null)}$.push(/[\0-\uffff]/),Xe=j($)})();var ee=Ie.length,k=function(N){for(var $=N.sourceCode,V=N.basePos,Y=N.sourceNode,me=[V,x],Ae=0,at=$.match(Xe)||[],Le={},ke=0,Ye=at.length;ke=5&&Ve.substring(0,5)==="lang-",Pe&&!(He&&typeof He[1]=="string")&&(Pe=!1,Ve=D),Pe||(Le[Ze]=Ve)}var he=Ae;if(Ae+=Ze.length,!Pe)me.push(V+he,Ve);else{var be=He[1],Ce=Ze.indexOf(be),xe=Ce+be.length;He[2]&&(xe=Ze.length-He[2].length,Ce=xe-be.length);var Be=Ve.substring(5);X(Y,V+he,Ze.substring(0,Ce),k,me),X(Y,V+he+Ce,be,Te(Be,be),me),X(Y,V+he+xe,Ze.substring(xe),k,me)}}N.decorations=me};return k}function ie(ce){var Ie=[],Ne=[];ce.tripleQuotedStrings?Ie.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ce.multiLineStrings?Ie.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ie.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ce.verbatimStrings&&Ne.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Xe=ce.hashComments;Xe&&(ce.cStyleComments?(Xe>1?Ie.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ie.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ne.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ie.push([m,/^#[^\r\n]*/,null,"#"])),ce.cStyleComments&&(Ne.push([m,/^\/\/[^\r\n]*/,null]),Ne.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ee=ce.regexLiterals;if(ee){var k=ee>1?"":` \r`,N=k?".":"[\\S\\s]",$="/(?=[^/*"+k+"])(?:[^/\\x5B\\x5C"+k+"]|\\x5C"+N+"|\\x5B(?:[^\\x5C\\x5D"+k+"]|\\x5C"+N+")*(?:\\x5D|$))+/";Ne.push(["lang-regex",RegExp("^"+ne+"("+$+")")])}var V=ce.types;V&&Ne.push([g,V]);var Y=(""+ce.keywords).replace(/^ | $/g,"");Y.length&&Ne.push([_,new RegExp("^(?:"+Y.replace(/[\s,]+/g,"|")+")\\b"),null]),Ie.push([x,/^\s+/,null,` \r \xA0`]);var me="^.[^\\s\\w.$@'\"`/\\\\]*";return ce.regexLiterals&&(me+="(?!s*/)"),Ne.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[x,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[x,/^\\[\s\S]?/,null],[o,new RegExp(me),null]),q(Ie,Ne)}var oe=ie({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ye(ce,Ie,Ne){for(var Xe=/(?:^|\s)nocode(?:\s|$)/,ee=/\r\n?|\n/,k=ce.ownerDocument,N=k.createElement("li");ce.firstChild;)N.appendChild(ce.firstChild);var $=[N];function V(ke){var Ye=ke.nodeType;if(Ye==1&&!Xe.test(ke.className))if(ke.nodeName==="br")Y(ke),ke.parentNode&&ke.parentNode.removeChild(ke);else for(var Ze=ke.firstChild;Ze;Ze=Ze.nextSibling)V(Ze);else if((Ye==3||Ye==4)&&Ne){var Ve=ke.nodeValue,He=Ve.match(ee);if(He){var Pe=Ve.substring(0,He.index);ke.nodeValue=Pe;var Re=Ve.substring(He.index+He[0].length);if(Re){var Oe=ke.parentNode;Oe.insertBefore(k.createTextNode(Re),ke.nextSibling)}Y(ke),Pe||ke.parentNode.removeChild(ke)}}}function Y(ke){for(;!ke.nextSibling;)if(ke=ke.parentNode,!ke)return;function Ye(He,Pe){var Re=Pe?He.cloneNode(!1):He,Oe=He.parentNode;if(Oe){var he=Ye(Oe,1),be=He.nextSibling;he.appendChild(Re);for(var Ce=be;Ce;Ce=be)be=Ce.nextSibling,he.appendChild(Ce)}return Re}for(var Ze=Ye(ke.nextSibling,0),Ve;(Ve=Ze.parentNode)&&Ve.nodeType===1;)Ze=Ve;$.push(Ze)}for(var me=0;me<$.length;++me)V($[me]);Ie===(Ie|0)&&$[0].setAttribute("value",Ie);var Ae=k.createElement("ol");Ae.className="linenums";for(var at=Math.max(0,Ie-1|0)||0,me=0,Le=$.length;me=Oe&&(V+=2),k>=he&&(Ae+=2)}}finally{Ve&&(Ve.style.display=He)}}var we={};function fe(ce,Ie){for(var Ne=Ie.length;--Ne>=0;){var Xe=Ie[Ne];we.hasOwnProperty(Xe)?T.console&&console.warn("cannot override language handler %s",Xe):we[Xe]=ce}}function Te(ce,Ie){return ce&&we.hasOwnProperty(ce)||(ce=/^\s*]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[o,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),fe(q([[x,/^[\s]+/,null,` \r `],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[A,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[o,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),fe(q([],[[F,/^[\s\S]+/]]),["uq.val"]),fe(ie({keywords:l,hashComments:!0,cStyleComments:!0,types:b}),["c","cc","cpp","cxx","cyc","m"]),fe(ie({keywords:"null,true,false"}),["json"]),fe(ie({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:b}),["cs"]),fe(ie({keywords:a,cStyleComments:!0}),["java"]),fe(ie({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),fe(ie({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),fe(ie({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),fe(ie({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),fe(ie({keywords:u,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),fe(ie({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),fe(q([],[[y,/^[\s\S]+/]]),["regex"]);function Fe(ce){var Ie=ce.langExtension;try{var Ne=G(ce.sourceNode,ce.pre),Xe=Ne.sourceCode;ce.sourceCode=Xe,ce.spans=Ne.spans,ce.basePos=0,Te(Ie,Xe)(ce),pe(ce)}catch(ee){T.console&&console.log(ee&&ee.stack||ee)}}function De(ce,Ie,Ne){var Xe=Ne||!1,ee=Ie||null,k=document.createElement("div");k.innerHTML="
    "+ce+"
    ",k=k.firstChild,Xe&&ye(k,Xe,!0);var N={langExtension:ee,numberLines:Xe,sourceNode:k,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Fe(N),k.innerHTML}function Me(ce,Ie){var Ne=Ie||document.body,Xe=Ne.ownerDocument||document;function ee(Re){return Ne.getElementsByTagName(Re)}for(var k=[ee("pre"),ee("code"),ee("xmp")],N=[],$=0;$=15&&(l=!1,h=!0);var y=t&&(p||l&&(b==null||b<12.11)),_=U||C&&T>=9;function m(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,r){var R=e.className,L=m(r).exec(R);if(L){var M=R.slice(L.index+L[0].length);e.className=R.slice(0,L.index)+(M?L[1]+M:"")}};function E(e){for(var r=e.childNodes.length;r>0;--r)e.removeChild(e.firstChild);return e}function o(e,r){return E(e).appendChild(r)}function x(e,r,R,L){var M=document.createElement(e);if(R&&(M.className=R),L&&(M.style.cssText=L),typeof r=="string")M.appendChild(document.createTextNode(r));else if(r)for(var H=0;H=r)return re+(r-H);re+=le-H,re+=R-re%R,H=le+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,r){this.f=r;var R=+new Date+e;(!this.id||R=r)return L+Math.min(re,r-M);if(M+=H-L,M+=R-M%R,L=H+1,M>=r)return L}}var fe=[""];function Te(e){for(;fe.length<=e;)fe.push(Fe(fe)+" ");return fe[e]}function Fe(e){return e[e.length-1]}function De(e,r){for(var R=[],L=0;L"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ce.test(e))}function Ne(e,r){return r?r.source.indexOf("\\w")>-1&&Ie(e)?!0:r.test(e):Ie(e)}function Xe(e){for(var r in e)if(e.hasOwnProperty(r)&&e[r])return!1;return!0}var ee=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function k(e){return e.charCodeAt(0)>=768&&ee.test(e)}function N(e,r,R){for(;(R<0?r>0:rR?-1:1;;){if(r==R)return r;var M=(r+R)/2,H=L<0?Math.ceil(M):Math.floor(M);if(H==r)return e(H)?r:R;e(H)?R=H:r=H+L}}function V(e,r,R,L){if(!e)return L(r,R,"ltr",0);for(var M=!1,H=0;Hr||r==R&&re.to==r)&&(L(Math.max(re.from,r),Math.min(re.to,R),re.level==1?"rtl":"ltr",H),M=!0)}M||L(r,R,"ltr")}var Y=null;function me(e,r,R){var L;Y=null;for(var M=0;Mr)return M;H.to==r&&(H.from!=H.to&&R=="before"?L=M:Y=M),H.from==r&&(H.from!=H.to&&R!="before"?L=M:Y=M)}return L!=null?L:Y}var Ae=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function R(ge){return ge<=247?e.charAt(ge):1424<=ge&&ge<=1524?"R":1536<=ge&&ge<=1785?r.charAt(ge-1536):1774<=ge&&ge<=2220?"r":8192<=ge&&ge<=8203?"w":ge==8204?"b":"L"}var L=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,M=/[stwN]/,H=/[LRr]/,re=/[Lb1n]/,le=/[1n]/;function ue(ge,We,Ge){this.level=ge,this.from=We,this.to=Ge}return function(ge,We){var Ge=We=="ltr"?"L":"R";if(ge.length==0||We=="ltr"&&!L.test(ge))return!1;for(var ot=ge.length,tt=[],bt=0;bt-1&&(L[r]=M.slice(0,H).concat(M.slice(H+1)))}}}function Ve(e,r){var R=Ye(e,r);if(!R.length)return;for(var L=Array.prototype.slice.call(arguments,2),M=0;M0}function Oe(e){e.prototype.on=function(r,R){ke(this,r,R)},e.prototype.off=function(r,R){Ze(this,r,R)}}function he(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function be(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function xe(e){he(e),be(e)}function Be(e){return e.target||e.srcElement}function Qe(e){var r=e.which;return r==null&&(e.button&1?r=1:e.button&2?r=3:e.button&4&&(r=2)),t&&e.ctrlKey&&r==1&&(r=3),r}var rt=function(){if(C&&T<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}(),dt;function xt(e){if(dt==null){var r=x("span","\u200B");o(e,x("span",[r,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(dt=r.offsetWidth<=1&&r.offsetHeight>2&&!(C&&T<8))}var R=dt?x("span","\u200B"):x("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return R.setAttribute("cm-text",""),R}var _t;function wt(e){if(_t!=null)return _t;var r=o(e,document.createTextNode("A\u062EA")),R=O(r,0,1).getBoundingClientRect(),L=O(r,1,2).getBoundingClientRect();return E(e),!R||R.left==R.right?!1:_t=L.right-R.right<3}var st=` b`.split(/\n/).length!=3?function(e){for(var r=0,R=[],L=e.length;r<=L;){var M=e.indexOf(` `,r);M==-1&&(M=e.length);var H=e.slice(r,e.charAt(M-1)=="\r"?M-1:M),re=H.indexOf("\r");re!=-1?(R.push(H.slice(0,re)),r+=re+1):(R.push(H),r=M+1)}return R}:function(e){return e.split(/\r\n?|\n/)},ut=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(r){return!1}}:function(e){var r;try{r=e.ownerDocument.selection.createRange()}catch(R){}return!r||r.parentElement()!=e?!1:r.compareEndPoints("StartToEnd",r)!=0},$e=function(){var e=x("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_e=null;function je(e){if(_e!=null)return _e;var r=o(e,x("span","x")),R=r.getBoundingClientRect(),L=O(r,0,1).getBoundingClientRect();return _e=Math.abs(R.left-L.left)>1}var ct={},et={};function At(e,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),ct[e]=r}function Ct(e,r){et[e]=r}function lt(e){if(typeof e=="string"&&et.hasOwnProperty(e))e=et[e];else if(e&&typeof e.name=="string"&&et.hasOwnProperty(e.name)){var r=et[e.name];typeof r=="string"&&(r={name:r}),e=ve(r,e),e.name=r.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return lt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return lt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gt(e,r){r=lt(r);var R=ct[r.name];if(!R)return gt(e,"text/plain");var L=R(e,r);if(kt.hasOwnProperty(r.name)){var M=kt[r.name];for(var H in M){if(!M.hasOwnProperty(H))continue;L.hasOwnProperty(H)&&(L["_"+H]=L[H]),L[H]=M[H]}}if(L.name=r.name,r.helperType&&(L.helperType=r.helperType),r.modeProps)for(var re in r.modeProps)L[re]=r.modeProps[re];return L}var kt={};function zt(e,r){var R=kt.hasOwnProperty(e)?kt[e]:kt[e]={};G(r,R)}function $t(e,r){if(r===!0)return r;if(e.copyState)return e.copyState(r);var R={};for(var L in r){var M=r[L];M instanceof Array&&(M=M.concat([])),R[L]=M}return R}function Se(e,r){for(var R;e.innerMode&&!(R=e.innerMode(r),!R||R.mode==e);)r=R.state,e=R.mode;return R||{mode:e,state:r}}function de(e,r,R){return e.startState?e.startState(r,R):!0}var W=function(e,r,R){this.pos=this.start=0,this.string=e,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=R};W.prototype.eol=function(){return this.pos>=this.string.length},W.prototype.sol=function(){return this.pos==this.lineStart},W.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},W.prototype.next=function(){if(this.posr},W.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},W.prototype.skipToEnd=function(){this.pos=this.string.length},W.prototype.skipTo=function(e){var r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0},W.prototype.backUp=function(e){this.pos-=e},W.prototype.column=function(){return this.lastColumnPos0?null:(H&&r!==!1&&(this.pos+=H[0].length),H)}},W.prototype.current=function(){return this.string.slice(this.start,this.pos)},W.prototype.hideFirstChars=function(e,r){this.lineStart+=e;try{return r()}finally{this.lineStart-=e}},W.prototype.lookAhead=function(e){var r=this.lineOracle;return r&&r.lookAhead(e)},W.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function J(e,r){if(r-=e.first,r<0||r>=e.size)throw new Error("There is no line "+(r+e.first)+" in the document.");for(var R=e;!R.lines;)for(var L=0;;++L){var M=R.children[L],H=M.chunkSize();if(r=e.first&&rR?it(R,J(e,R).text.length):Sn(r,J(e,r.line).text.length)}function Sn(e,r){var R=e.ch;return R==null||R>r?it(e.line,r):R<0?it(e.line,0):e}function mt(e,r){for(var R=[],L=0;Lthis.maxLookAhead&&(this.maxLookAhead=e),r},fn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},fn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},fn.fromSaved=function(e,r,R){return r instanceof ln?new fn(e,$t(e.mode,r.state),R,r.lookAhead):new fn(e,$t(e.mode,r),R)},fn.prototype.save=function(e){var r=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ln(r,this.maxLookAhead):r};function Zn(e,r,R,L){var M=[e.state.modeGen],H={};xr(e,r.text,e.doc.mode,R,function(ge,We){return M.push(ge,We)},H,L);for(var re=R.state,le=function(ge){R.baseTokens=M;var We=e.state.overlays[ge],Ge=1,ot=0;R.state=!0,xr(e,r.text,We.mode,R,function(tt,bt){for(var Ot=Ge;ottt&&M.splice(Ge,1,tt,M[Ge+1],Mt),Ge+=2,ot=Math.min(tt,Mt)}if(!bt)return;if(We.opaque)M.splice(Ot,Ge-Ot,tt,"overlay "+bt),Ge=Ot+2;else for(;Ote.options.maxHighlightLength&&$t(e.doc.mode,L.state),H=Zn(e,r,L);M&&(L.state=M),r.stateAfter=L.save(!M),r.styles=H.styles,H.classes?r.styleClasses=H.classes:r.styleClasses&&(r.styleClasses=null),R===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return r.styles}function xn(e,r,R){var L=e.doc,M=e.display;if(!L.mode.startState)return new fn(L,!0,r);var H=ur(e,r,R),re=H>L.first&&J(L,H-1).stateAfter,le=re?fn.fromSaved(L,re,H):new fn(L,de(L.mode),H);return L.iter(H,r,function(ue){Er(e,ue.text,le);var ge=le.line;ue.stateAfter=ge==r-1||ge%5==0||ge>=M.viewFrom&&ger.start)return H}throw new Error("Mode "+e.name+" failed to advance stream.")}var Mn=function(e,r,R){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=r||null,this.state=R};function Nr(e,r,R,L){var M=e.doc,H=M.mode,re;r=yt(M,r);var le=J(M,r.line),ue=xn(e,r.line,R),ge=new W(le.text,e.options.tabSize,ue),We;for(L&&(We=[]);(L||ge.pose.options.maxHighlightLength?(le=!1,re&&Er(e,r,L,We.pos),We.pos=r.length,Ge=null):Ge=Xr(un(R,We,L.state,ot),H),ot){var tt=ot[0].name;tt&&(Ge="m-"+(Ge?tt+" "+Ge:tt))}if(!le||ge!=Ge){for(;uere;--le){if(le<=H.first)return H.first;var ue=J(H,le-1),ge=ue.stateAfter;if(ge&&(!R||le+(ge instanceof ln?ge.lookAhead:0)<=H.modeFrontier))return le;var We=X(ue.text,null,e.options.tabSize);(M==null||L>We)&&(M=le-1,L=We)}return M}function gr(e,r){if(e.modeFrontier=Math.min(e.modeFrontier,r),e.highlightFrontierR;L--){var M=J(e,L).stateAfter;if(M&&(!(M instanceof ln)||L+M.lookAhead=r:H.to>r);(L||(L=[])).push(new Kr(re,H.from,ue?null:H.to))}}return L}function ci(e,r,R){var L;if(e)for(var M=0;M=r:H.to>r);if(le||H.from==r&&re.type=="bookmark"&&(!R||H.marker.insertLeft)){var ue=H.from==null||(re.inclusiveLeft?H.from<=r:H.from0&&le)for(var en=0;en0)continue;var We=[ue,1],Ge=Tt(ge.from,le.from),ot=Tt(ge.to,le.to);(Ge<0||!re.inclusiveLeft&&!Ge)&&We.push({from:ge.from,to:le.from}),(ot>0||!re.inclusiveRight&&!ot)&&We.push({from:le.to,to:ge.to}),M.splice.apply(M,We),ue+=We.length-3}return M}function Ui(e){var r=e.markedSpans;if(!r)return;for(var R=0;Rr)&&(!L||qr(L,H.marker)<0)&&(L=H.marker)}return L}function na(e,r,R,L,M){var H=J(e,r),re=pr&&H.markedSpans;if(re)for(var le=0;le=0&&Ge<=0||We<=0&&Ge>=0)continue;if(We<=0&&(ue.marker.inclusiveRight&&M.inclusiveLeft?Tt(ge.to,R)>=0:Tt(ge.to,R)>0)||We>=0&&(ue.marker.inclusiveRight&&M.inclusiveLeft?Tt(ge.from,L)<=0:Tt(ge.from,L)<0))return!0}}function ai(e){for(var r;r=fi(e);)e=r.find(-1,!0).line;return e}function Yi(e){for(var r;r=ii(e);)e=r.find(1,!0).line;return e}function Zr(e){for(var r,R;r=ii(e);)e=r.find(1,!0).line,(R||(R=[])).push(e);return R}function Wi(e,r){var R=J(e,r),L=ai(R);return R==L?r:ze(L)}function Pi(e,r){if(r>e.lastLine())return r;var R=J(e,r),L;if(!Ci(e,R))return r;for(;L=ii(R);)R=L.find(1,!0).line;return ze(R)+1}function Ci(e,r){var R=pr&&r.markedSpans;if(R)for(var L=void 0,M=0;Mr.maxLineLength&&(r.maxLineLength=M,r.maxLine=L)})}var hi=function(e,r,R){this.text=e,di(this,r),this.height=R?R(this):1};hi.prototype.lineNo=function(){return ze(this)},Oe(hi);function Zi(e,r,R,L){e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ui(e),di(e,R);var M=L?L(e):1;M!=e.height&&Ee(e,M)}function tn(e){e.parent=null,Ui(e)}var yn={},an={};function Rn(e,r){if(!e||/^\s*$/.test(e))return null;var R=r.addModeClass?an:yn;return R[e]||(R[e]=e.replace(/\S+/g,"cm-$&"))}function Xn(e,r){var R=A("span",null,null,h?"padding-right: .1px":null),L={pre:A("pre",[R],"CodeMirror-line"),content:R,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};r.measure={};for(var M=0;M<=(r.rest?r.rest.length:0);M++){var H=M?r.rest[M-1]:r.line,re=void 0;L.pos=0,L.addToken=Vt,wt(e.display.measure)&&(re=at(H,e.doc.direction))&&(L.addToken=Hr(L.addToken,re)),L.map=[];var le=r!=e.display.externalMeasured&&ze(H);Oi(H,L,rr(e,H,le)),H.styleClasses&&(H.styleClasses.bgClass&&(L.bgClass=z(H.styleClasses.bgClass,L.bgClass||"")),H.styleClasses.textClass&&(L.textClass=z(H.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(xt(e.display.measure))),M==0?(r.measure.map=L.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(L.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(h){var ue=L.content.lastChild;(/\bcm-tab\b/.test(ue.className)||ue.querySelector&&ue.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return Ve(e,"renderLine",e,r.line,L.pre),L.pre.className&&(L.textClass=z(L.pre.className,L.textClass||"")),L}function or(e){var r=x("span","\u2022","cm-invalidchar");return r.title="\\u"+e.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function Vt(e,r,R,L,M,H,re){if(!r)return;var le=e.splitSpaces?br(r,e.trailingSpace):r,ue=e.cm.state.specialChars,ge=!1,We;if(!ue.test(r))e.col+=r.length,We=document.createTextNode(le),e.map.push(e.pos,e.pos+r.length,We),C&&T<9&&(ge=!0),e.pos+=r.length;else{We=document.createDocumentFragment();for(var Ge=0;;){ue.lastIndex=Ge;var ot=ue.exec(r),tt=ot?ot.index-Ge:r.length-Ge;if(tt){var bt=document.createTextNode(le.slice(Ge,Ge+tt));C&&T<9?We.appendChild(x("span",[bt])):We.appendChild(bt),e.map.push(e.pos,e.pos+tt,bt),e.col+=tt,e.pos+=tt}if(!ot)break;Ge+=tt+1;var Ot=void 0;if(ot[0]==" "){var Mt=e.cm.options.tabSize,Wt=Mt-e.col%Mt;Ot=We.appendChild(x("span",Te(Wt),"cm-tab")),Ot.setAttribute("role","presentation"),Ot.setAttribute("cm-text"," "),e.col+=Wt}else ot[0]=="\r"||ot[0]==` `?(Ot=We.appendChild(x("span",ot[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ot.setAttribute("cm-text",ot[0]),e.col+=1):(Ot=e.cm.options.specialCharPlaceholder(ot[0]),Ot.setAttribute("cm-text",ot[0]),C&&T<9?We.appendChild(x("span",[Ot])):We.appendChild(Ot),e.col+=1);e.map.push(e.pos,e.pos+1,Ot),e.pos++}}if(e.trailingSpace=le.charCodeAt(r.length-1)==32,R||L||M||ge||H||re){var Yt=R||"";L&&(Yt+=L),M&&(Yt+=M);var Kt=x("span",[We],Yt,H);if(re)for(var en in re)re.hasOwnProperty(en)&&en!="style"&&en!="class"&&Kt.setAttribute(en,re[en]);return e.content.appendChild(Kt)}e.content.appendChild(We)}function br(e,r){if(e.length>1&&!/ /.test(e))return e;for(var R=r,L="",M=0;Mge&&Ge.from<=ge);ot++);if(Ge.to>=We)return e(R,L,M,H,re,le,ue);e(R,L.slice(0,Ge.to-ge),M,H,null,le,ue),H=null,L=L.slice(Ge.to-ge),ge=Ge.to}}}function kn(e,r,R,L){var M=!L&&R.widgetNode;M&&e.map.push(e.pos,e.pos+r,M),!L&&e.cm.display.input.needsContentAttribute&&(M||(M=e.content.appendChild(document.createElement("span"))),M.setAttribute("cm-marker",R.id)),M&&(e.cm.display.input.setUneditable(M),e.content.appendChild(M)),e.pos+=r,e.trailingSpace=!1}function Oi(e,r,R){var L=e.markedSpans,M=e.text,H=0;if(!L){for(var re=1;reue||Gn.collapsed&&dn.to==ue&&dn.from==ue)){if(dn.to!=null&&dn.to!=ue&&tt>dn.to&&(tt=dn.to,Ot=""),Gn.className&&(bt+=" "+Gn.className),Gn.css&&(ot=(ot?ot+";":"")+Gn.css),Gn.startStyle&&dn.from==ue&&(Mt+=" "+Gn.startStyle),Gn.endStyle&&dn.to==tt&&(en||(en=[])).push(Gn.endStyle,dn.to),Gn.title&&((Yt||(Yt={})).title=Gn.title),Gn.attributes)for(var _r in Gn.attributes)(Yt||(Yt={}))[_r]=Gn.attributes[_r];Gn.collapsed&&(!Wt||qr(Wt.marker,Gn)<0)&&(Wt=dn)}else dn.from>ue&&tt>dn.from&&(tt=dn.from)}if(en)for(var Jr=0;Jr=le)break;for(var Ri=Math.min(le,tt);;){if(We){var Si=ue+We.length;if(!Wt){var Br=Si>Ri?We.slice(0,Ri-ue):We;r.addToken(r,Br,Ge?Ge+bt:bt,Mt,ue+Br.length==tt?Ot:"",ot,Yt)}if(Si>=Ri){We=We.slice(Ri-ue),ue=Ri;break}ue=Si,Mt=""}We=M.slice(H,H=R[ge++]),Ge=Rn(R[ge++],r.cm.options)}}}function nr(e,r,R){this.line=r,this.rest=Zr(r),this.size=this.rest?ze(Fe(this.rest))-R+1:1,this.node=this.text=null,this.hidden=Ci(e,r)}function Ur(e,r,R){for(var L=[],M,H=r;H2&&H.push((ue.bottom+ge.top)/2-R.top)}}H.push(R.bottom-R.top)}}function Ut(e,r,R){if(e.line==r)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;LR)return{map:e.measure.maps[M],cache:e.measure.caches[M],before:!0}}function cn(e,r){r=ai(r);var R=ze(r),L=e.display.externalMeasured=new nr(e.doc,r,R);L.lineN=R;var M=L.built=Xn(e,L);return L.text=M.pre,o(e.display.lineMeasure,M.pre),L}function tr(e,r,R,L){return Cn(e,qn(e,r),R,L)}function sr(e,r){if(r>=e.display.viewFrom&&r=R.lineN&&rr)&&(H=ue-le,M=H-1,r>=ue&&(re="right")),M!=null){if(L=e[ge+2],le==ue&&R==(L.insertLeft?"left":"right")&&(re=R),R=="left"&&M==0)for(;ge&&e[ge-2]==e[ge-3]&&e[ge-1].insertLeft;)L=e[(ge-=3)+2],re="left";if(R=="right"&&M==ue-le)for(;ge=0&&!((R=e[M]).left!=R.right);M--);return R}function Nt(e,r,R,L){var M=on(r.map,R,L),H=M.node,re=M.start,le=M.end,ue=M.collapse,ge;if(H.nodeType==3){for(var We=0;We<4;We++){for(;re&&k(r.line.text.charAt(M.coverStart+re));)--re;for(;M.coverStart+le0&&(ue=L="right");var Ge;e.options.lineWrapping&&(Ge=H.getClientRects()).length>1?ge=Ge[L=="right"?Ge.length-1:0]:ge=H.getBoundingClientRect()}if(C&&T<9&&!re&&(!ge||!ge.left&&!ge.right)){var ot=H.parentNode.getClientRects()[0];ot?ge={left:ot.left,right:ot.left+jn(e.display),top:ot.top,bottom:ot.bottom}:ge=Wn}for(var tt=ge.top-r.rect.top,bt=ge.bottom-r.rect.top,Ot=(tt+bt)/2,Mt=r.view.measure.heights,Wt=0;Wt=L.text.length?(ue=L.text.length,ge="before"):ue<=0&&(ue=0,ge="after"),!le)return re(ge=="before"?ue-1:ue,ge=="before");function We(bt,Ot,Mt){var Wt=le[Ot],Yt=Wt.level==1;return re(Mt?bt-1:bt,Yt!=Mt)}var Ge=me(le,ue,ge),ot=Y,tt=We(ue,Ge,ge=="before");return ot!=null&&(tt.other=We(ue,ot,ge!="before")),tt}function wr(e,r){var R=0;r=yt(e.doc,r),e.options.lineWrapping||(R=jn(e.display)*r.ch);var L=J(e.doc,r.line),M=bi(L)+Vn(e.display);return{left:R,right:R,top:M,bottom:M+L.height}}function jr(e,r,R,L,M){var H=it(e,r,R);return H.xRel=M,L&&(H.outside=L),H}function Ai(e,r,R){var L=e.doc;if(R+=e.display.viewOffset,R<0)return jr(L.first,0,null,-1,-1);var M=qe(L,R),H=L.first+L.size-1;if(M>H)return jr(L.first+L.size-1,J(L,H).text.length,null,1,1);r<0&&(r=0);for(var re=J(L,M);;){var le=Hi(e,re,M,r,R),ue=Xi(re,le.ch+(le.xRel>0||le.outside>0?1:0));if(!ue)return le;var ge=ue.find(1);if(ge.line==M)return ge;re=J(L,M=ge.line)}}function zr(e,r,R,L){L-=On(r);var M=r.text.length,H=$(function(re){return Cn(e,R,re-1).bottom<=L},M,0);return M=$(function(re){return Cn(e,R,re).top>L},H,M),{begin:H,end:M}}function Mi(e,r,R,L){R||(R=qn(e,r));var M=gn(e,r,Cn(e,R,L),"line").top;return zr(e,r,R,M)}function Ki(e,r,R,L){return e.bottom<=R?!1:e.top>R?!0:(L?e.left:e.right)>r}function Hi(e,r,R,L,M){M-=bi(r);var H=qn(e,r),re=On(r),le=0,ue=r.text.length,ge=!0,We=at(r,e.doc.direction);if(We){var Ge=(e.options.lineWrapping?_a:ji)(e,r,R,H,We,L,M);ge=Ge.level!=1,le=ge?Ge.from:Ge.to-1,ue=ge?Ge.to:Ge.from-1}var ot=null,tt=null,bt=$(function(bn){var dn=Cn(e,H,bn);return dn.top+=re,dn.bottom+=re,Ki(dn,L,M,!1)?(dn.top<=M&&dn.left<=L&&(ot=bn,tt=dn),!0):!1},le,ue),Ot,Mt,Wt=!1;if(tt){var Yt=L-tt.left=en.bottom?1:0}return bt=N(r.text,bt,1),jr(R,bt,Mt,Wt,L-Ot)}function ji(e,r,R,L,M,H,re){var le=$(function(Ge){var ot=M[Ge],tt=ot.level!=1;return Ki($n(e,it(R,tt?ot.to:ot.from,tt?"before":"after"),"line",r,L),H,re,!0)},0,M.length-1),ue=M[le];if(le>0){var ge=ue.level!=1,We=$n(e,it(R,ge?ue.from:ue.to,ge?"after":"before"),"line",r,L);Ki(We,H,re,!0)&&We.top>re&&(ue=M[le-1])}return ue}function _a(e,r,R,L,M,H,re){var le=zr(e,r,L,re),ue=le.begin,ge=le.end;/\s/.test(r.text.charAt(ge-1))&&ge--;for(var We=null,Ge=null,ot=0;ot=ge||tt.to<=ue)continue;var bt=tt.level!=1,Ot=Cn(e,L,bt?Math.min(ge,tt.to)-1:Math.max(ue,tt.from)).right,Mt=OtMt)&&(We=tt,Ge=Mt)}return We||(We=M[M.length-1]),We.fromge&&(We={from:We.from,to:ge,level:We.level}),We}var Un;function mn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Un==null){Un=x("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r)Un.appendChild(document.createTextNode("x")),Un.appendChild(x("br"));Un.appendChild(document.createTextNode("x"))}o(e.measure,Un);var R=Un.offsetHeight/50;return R>3&&(e.cachedTextHeight=R),E(e.measure),R||1}function jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var r=x("span","xxxxxxxxxx"),R=x("pre",[r],"CodeMirror-line-like");o(e.measure,R);var L=r.getBoundingClientRect(),M=(L.right-L.left)/10;return M>2&&(e.cachedCharWidth=M),M||10}function Jn(e){for(var r=e.display,R={},L={},M=r.gutters.clientLeft,H=r.gutters.firstChild,re=0;H;H=H.nextSibling,++re){var le=e.display.gutterSpecs[re].className;R[le]=H.offsetLeft+H.clientLeft+M,L[le]=H.clientWidth}return{fixedPos:Lr(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:R,gutterWidth:L,wrapperWidth:r.wrapper.clientWidth}}function Lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Kn(e){var r=mn(e.display),R=e.options.lineWrapping,L=R&&Math.max(5,e.display.scroller.clientWidth/jn(e.display)-3);return function(M){if(Ci(e.doc,M))return 0;var H=0;if(M.widgets)for(var re=0;re0&&(ge=J(e.doc,ue.line).text).length==ue.ch){var We=X(ge,ge.length,e.options.tabSize)-ge.length;ue=it(ue.line,Math.max(0,Math.round((H-vr(e.display).left)/jn(e.display))-We))}return ue}function Gr(e,r){if(r>=e.display.viewTo)return null;if(r-=e.display.viewFrom,r<0)return null;for(var R=e.display.view,L=0;Lr)&&(M.updateLineNumbers=r),e.curOp.viewChanged=!0,r>=M.viewTo)pr&&Wi(e.doc,r)M.viewFrom?ei(e):(M.viewFrom+=L,M.viewTo+=L);else if(r<=M.viewFrom&&R>=M.viewTo)ei(e);else if(r<=M.viewFrom){var H=Ln(e,R,R+L,1);H?(M.view=M.view.slice(H.index),M.viewFrom=H.lineN,M.viewTo+=L):ei(e)}else if(R>=M.viewTo){var re=Ln(e,r,r,-1);re?(M.view=M.view.slice(0,re.index),M.viewTo=re.lineN):ei(e)}else{var le=Ln(e,r,r,-1),ue=Ln(e,R,R+L,1);le&&ue?(M.view=M.view.slice(0,le.index).concat(Ur(e,le.lineN,ue.lineN)).concat(M.view.slice(ue.index)),M.viewTo+=L):ei(e)}var ge=M.externalMeasured;ge&&(R=M.lineN&&r=L.viewTo)return;var H=L.view[Gr(e,r)];if(H.node==null)return;var re=H.changes||(H.changes=[]);K(re,R)==-1&&re.push(R)}function ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ln(e,r,R,L){var M=Gr(e,r),H,re=e.display.view;if(!pr||R==e.doc.first+e.doc.size)return{index:M,lineN:R};for(var le=e.display.viewFrom,ue=0;ue0){if(M==re.length-1)return null;H=le+re[M].size-r,M++}else H=le-r;r+=H,R+=H}for(;Wi(e.doc,R)!=R;){if(M==(L<0?0:re.length-1))return null;R+=L*re[M-(L<0?1:0)].size,M+=L}return{index:M,lineN:R}}function En(e,r,R){var L=e.display,M=L.view;M.length==0||r>=L.viewTo||R<=L.viewFrom?(L.view=Ur(e,r,R),L.viewFrom=r):(L.viewFrom>r?L.view=Ur(e,r,L.viewFrom).concat(L.view):L.viewFromR&&(L.view=L.view.slice(0,Gr(e,R)))),L.viewTo=R}function Hn(e){for(var r=e.display.view,R=0,L=0;L=e.display.viewTo||le.to().line0?r.blinker=setInterval(function(){e.hasFocus()||Ei(e),r.cursorDiv.style.visibility=(R=!R)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(r.cursorDiv.style.visibility="hidden")}function sn(e){e.state.focused||(e.display.input.focus(),ha(e))}function ia(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ei(e))},100)}function ha(e,r){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ve(e,"focus",e,r),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),h&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ra(e)}function Ei(e,r){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ve(e,"blur",e,r),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Fi(e){for(var r=e.display,R=r.lineDiv.offsetTop,L=0;L.005||We<-.005)&&(Ee(M.line,re),Bi(M.line),M.rest))for(var Ge=0;Gee.display.sizerWidth){var ot=Math.ceil(le/jn(e.display));ot>e.display.maxLineLength&&(e.display.maxLineLength=ot,e.display.maxLine=M.line,e.display.maxLineChanged=!0)}}}function Bi(e){if(e.widgets)for(var r=0;r=re&&(H=qe(r,bi(J(r,ue))-e.wrapper.clientHeight),re=ue)}return{from:H,to:Math.max(re,H+1)}}function aa(e,r){if(He(e,"scrollCursorIntoView"))return;var R=e.display,L=R.sizer.getBoundingClientRect(),M=null;if(r.top+L.top<0?M=!0:r.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(M=!1),M!=null&&!s){var H=x("div","\u200B",null,`position: absolute; top: `+(r.top-R.viewOffset-Vn(e.display))+`px; height: `+(r.bottom-r.top+er(e)+R.barHeight)+`px; left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");e.display.lineSpace.appendChild(H),H.scrollIntoView(M),e.display.lineSpace.removeChild(H)}}function oa(e,r,R,L){L==null&&(L=0);var M;!e.options.lineWrapping&&r==R&&(r=r.ch?it(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r,R=r.sticky=="before"?it(r.line,r.ch+1,"before"):r);for(var H=0;H<5;H++){var re=!1,le=$n(e,r),ue=!R||R==r?le:$n(e,R);M={left:Math.min(le.left,ue.left),top:Math.min(le.top,ue.top)-L,right:Math.max(le.left,ue.left),bottom:Math.max(le.bottom,ue.bottom)+L};var ge=kr(e,M),We=e.doc.scrollTop,Ge=e.doc.scrollLeft;if(ge.scrollTop!=null&&(Ia(e,ge.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(re=!0)),ge.scrollLeft!=null&&(pa(e,ge.scrollLeft),Math.abs(e.doc.scrollLeft-Ge)>1&&(re=!0)),!re)break}return M}function go(e,r){var R=kr(e,r);R.scrollTop!=null&&Ia(e,R.scrollTop),R.scrollLeft!=null&&pa(e,R.scrollLeft)}function kr(e,r){var R=e.display,L=mn(e.display);r.top<0&&(r.top=0);var M=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:R.scroller.scrollTop,H=Qn(e),re={};r.bottom-r.top>H&&(r.bottom=r.top+H);var le=e.doc.height+cr(R),ue=r.tople-L;if(r.topM+H){var We=Math.min(r.top,(ge?le:r.bottom)-H);We!=M&&(re.scrollTop=We)}var Ge=e.options.fixedGutter?0:R.gutters.offsetWidth,ot=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:R.scroller.scrollLeft-Ge,tt=Dn(e)-R.gutters.offsetWidth,bt=r.right-r.left>tt;return bt&&(r.right=r.left+tt),r.left<10?re.scrollLeft=0:r.lefttt+ot-3&&(re.scrollLeft=r.right+(bt?0:10)-tt),re}function yo(e,r){if(r==null)return;eo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+r}function Ea(e){eo(e);var r=e.getCursor();e.curOp.scrollToPos={from:r,to:r,margin:e.options.cursorScrollMargin}}function ka(e,r,R){(r!=null||R!=null)&&eo(e),r!=null&&(e.curOp.scrollLeft=r),R!=null&&(e.curOp.scrollTop=R)}function Qs(e,r){eo(e),e.curOp.scrollToPos=r}function eo(e){var r=e.curOp.scrollToPos;if(r){e.curOp.scrollToPos=null;var R=wr(e,r.from),L=wr(e,r.to);Wo(e,R,L,r.margin)}}function Wo(e,r,R,L){var M=kr(e,{left:Math.min(r.left,R.left),top:Math.min(r.top,R.top)-L,right:Math.max(r.right,R.right),bottom:Math.max(r.bottom,R.bottom)+L});ka(e,M.scrollLeft,M.scrollTop)}function Ia(e,r){if(Math.abs(e.doc.scrollTop-r)<2)return;U||_o(e,{top:r}),Ko(e,r,!0),U&&_o(e),ja(e,100)}function Ko(e,r,R){if(r=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,r)),e.display.scroller.scrollTop==r&&!R)return;e.doc.scrollTop=r,e.display.scrollbars.setScrollTop(r),e.display.scroller.scrollTop!=r&&(e.display.scroller.scrollTop=r)}function pa(e,r,R,L){if(r=Math.max(0,Math.min(r,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(R?r==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-r)<2)&&!L)return;e.doc.scrollLeft=r,Xo(e),e.display.scroller.scrollLeft!=r&&(e.display.scroller.scrollLeft=r),e.display.scrollbars.setScrollLeft(r)}function Na(e){var r=e.display,R=r.gutters.offsetWidth,L=Math.round(e.doc.height+cr(e.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:e.options.fixedGutter?R:0,docHeight:L,scrollHeight:L+er(e)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:R}}var ma=function(e,r,R){this.cm=R;var L=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),M=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=M.tabIndex=-1,e(L),e(M),ke(L,"scroll",function(){L.clientHeight&&r(L.scrollTop,"vertical")}),ke(M,"scroll",function(){M.clientWidth&&r(M.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&T<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ma.prototype.update=function(e){var r=e.scrollWidth>e.clientWidth+1,R=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(R){this.vert.style.display="block",this.vert.style.bottom=r?L+"px":"0";var M=e.viewHeight-(r?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+M)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(r){this.horiz.style.display="block",this.horiz.style.right=R?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var H=e.viewWidth-e.barLeft-(R?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+H)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(L==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:R?L:0,bottom:r?L:0}},ma.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ma.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ma.prototype.zeroWidthHack=function(){var e=t&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},ma.prototype.enableZeroWidthBar=function(e,r,R){e.style.pointerEvents="auto";function L(){var M=e.getBoundingClientRect(),H=R=="vert"?document.elementFromPoint(M.right-1,(M.top+M.bottom)/2):document.elementFromPoint((M.right+M.left)/2,M.bottom-1);H!=e?e.style.pointerEvents="none":r.set(1e3,L)}r.set(1e3,L)},ma.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ua=function(){};Ua.prototype.update=function(){return{bottom:0,right:0}},Ua.prototype.setScrollLeft=function(){},Ua.prototype.setScrollTop=function(){},Ua.prototype.clear=function(){};function xa(e,r){r||(r=Na(e));var R=e.display.barWidth,L=e.display.barHeight;Ho(e,r);for(var M=0;M<4&&R!=e.display.barWidth||L!=e.display.barHeight;M++)R!=e.display.barWidth&&e.options.lineWrapping&&Fi(e),Ho(e,Na(e)),R=e.display.barWidth,L=e.display.barHeight}function Ho(e,r){var R=e.display,L=R.scrollbars.update(r);R.sizer.style.paddingRight=(R.barWidth=L.right)+"px",R.sizer.style.paddingBottom=(R.barHeight=L.bottom)+"px",R.heightForcer.style.borderBottom=L.bottom+"px solid transparent",L.right&&L.bottom?(R.scrollbarFiller.style.display="block",R.scrollbarFiller.style.height=L.bottom+"px",R.scrollbarFiller.style.width=L.right+"px"):R.scrollbarFiller.style.display="",L.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(R.gutterFiller.style.display="block",R.gutterFiller.style.height=L.bottom+"px",R.gutterFiller.style.width=r.gutterWidth+"px"):R.gutterFiller.style.display=""}var zo={native:ma,null:Ua};function Go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zo[e.options.scrollbarStyle](function(r){e.display.wrapper.insertBefore(r,e.display.scrollbarFiller),ke(r,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),r.setAttribute("cm-not-content","true")},function(r,R){R=="horizontal"?pa(e,r):Ia(e,r)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function va(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zs},pt(e.curOp)}function ga(e){var r=e.curOp;r&&Dt(r,function(R){for(var L=0;L=R.viewTo)||R.maxLineChanged&&r.options.lineWrapping,e.update=e.mustUpdate&&new to(r,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nl(e){e.updatedDisplay=e.mustUpdate&&bo(e.cm,e.update)}function rl(e){var r=e.cm,R=r.display;e.updatedDisplay&&Fi(r),e.barMeasure=Na(r),R.maxLineChanged&&!r.options.lineWrapping&&(e.adjustWidthTo=tr(r,R.maxLine,R.maxLine.text.length).left+3,r.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(R.scroller.clientWidth,R.sizer.offsetLeft+e.adjustWidthTo+er(r)+r.display.barWidth),e.maxScrollLeft=Math.max(0,R.sizer.offsetLeft+e.adjustWidthTo-Dn(r))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=R.input.prepareSelection())}function il(e){var r=e.cm;e.adjustWidthTo!=null&&(r.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var R=+new Date+e.options.workTime,L=xn(e,r.highlightFrontier),M=[];r.iter(L.line,Math.min(r.first+r.size,e.display.viewTo+500),function(H){if(L.line>=e.display.viewFrom){var re=H.styles,le=H.text.length>e.options.maxHighlightLength?$t(r.mode,L.state):null,ue=Zn(e,H,L,!0);le&&(L.state=le),H.styles=ue.styles;var ge=H.styleClasses,We=ue.classes;We?H.styleClasses=We:ge&&(H.styleClasses=null);for(var Ge=!re||re.length!=H.styles.length||ge!=We&&(!ge||!We||ge.bgClass!=We.bgClass||ge.textClass!=We.textClass),ot=0;!Ge&&otR)return ja(e,e.options.workDelay),!0}),r.highlightFrontier=L.line,r.modeFrontier=Math.max(r.modeFrontier,L.line),M.length&&Li(e,function(){for(var H=0;H=R.viewFrom&&r.visible.to<=R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo)&&R.renderedView==R.view&&Hn(e)==0)return!1;Yo(e)&&(ei(e),r.dims=Jn(e));var M=L.first+L.size,H=Math.max(r.visible.from-e.options.viewportMargin,L.first),re=Math.min(M,r.visible.to+e.options.viewportMargin);R.viewFromre&&R.viewTo-re<20&&(re=Math.min(M,R.viewTo)),pr&&(H=Wi(e.doc,H),re=Pi(e.doc,re));var le=H!=R.viewFrom||re!=R.viewTo||R.lastWrapHeight!=r.wrapperHeight||R.lastWrapWidth!=r.wrapperWidth;En(e,H,re),R.viewOffset=bi(J(e.doc,R.viewFrom)),e.display.mover.style.top=R.viewOffset+"px";var ue=Hn(e);if(!le&&ue==0&&!r.force&&R.renderedView==R.view&&(R.updateLineNumbers==null||R.updateLineNumbers>=R.viewTo))return!1;var ge=ll(e);return ue>4&&(R.lineDiv.style.display="none"),cl(e,R.updateLineNumbers,r.dims),ue>4&&(R.lineDiv.style.display=""),R.renderedView=R.view,ul(ge),E(R.cursorDiv),E(R.selectionDiv),R.gutters.style.height=R.sizer.style.minHeight=0,le&&(R.lastWrapHeight=r.wrapperHeight,R.lastWrapWidth=r.wrapperWidth,ja(e,400)),R.updateLineNumbers=null,!0}function Vo(e,r){for(var R=r.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||r.oldDisplayWidth==Dn(e)){if(R&&R.top!=null&&(R={top:Math.min(e.doc.height+cr(e.display)-Qn(e),R.top)}),r.visible=zi(e.display,e.doc,R),r.visible.from>=e.display.viewFrom&&r.visible.to<=e.display.viewTo)break}else L&&(r.visible=zi(e.display,e.doc,R));if(!bo(e,r))break;Fi(e);var M=Na(e);Gt(e),xa(e,M),xo(e,M),r.force=!1}r.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(r.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _o(e,r){var R=new to(e,r);if(bo(e,R)){Fi(e),Vo(e,R);var L=Na(e);Gt(e),xa(e,L),xo(e,L),R.finish()}}function cl(e,r,R){var L=e.display,M=e.options.lineNumbers,H=L.lineDiv,re=H.firstChild;function le(bt){var Ot=bt.nextSibling;return h&&t&&e.display.currentWheelTarget==bt?bt.style.display="none":bt.parentNode.removeChild(bt),Ot}for(var ue=L.view,ge=L.viewFrom,We=0;We-1&&(tt=!1),ft(e,Ge,ge,R)),tt&&(E(Ge.lineNumber),Ge.lineNumber.appendChild(document.createTextNode(Lt(e.options,ge)))),re=Ge.node.nextSibling}ge+=Ge.size}for(;re;)re=le(re)}function Eo(e){var r=e.gutters.offsetWidth;e.sizer.style.marginLeft=r+"px"}function xo(e,r){e.display.sizer.style.minHeight=r.docHeight+"px",e.display.heightForcer.style.top=r.docHeight+"px",e.display.gutters.style.height=r.docHeight+e.display.barHeight+er(e)+"px"}function Xo(e){var r=e.display,R=r.view;if(!r.alignWidgets&&(!r.gutters.firstChild||!e.options.fixedGutter))return;for(var L=Lr(r)-r.scroller.scrollLeft+e.doc.scrollLeft,M=r.gutters.offsetWidth,H=L+"px",re=0;rere.clientWidth,ue=re.scrollHeight>re.clientHeight;if(!(L&&le||M&&ue))return;if(M&&t&&h){e:for(var ge=r.target,We=H.view;ge!=re;ge=ge.parentNode)for(var Ge=0;Ge=0&&Tt(e,L.to())<=0)return R}return-1};var lr=function(e,r){this.anchor=e,this.head=r};lr.prototype.from=function(){return Jt(this.anchor,this.head)},lr.prototype.to=function(){return nn(this.anchor,this.head)},lr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Gi(e,r,R){var L=e&&e.options.selectionsMayTouch,M=r[R];r.sort(function(ot,tt){return Tt(ot.from(),tt.from())}),R=K(r,M);for(var H=1;H0:ue>=0){var ge=Jt(le.from(),re.from()),We=nn(le.to(),re.to()),Ge=le.empty()?re.from()==re.head:le.from()==le.head;H<=R&&--R,r.splice(--H,2,new lr(Ge?We:ge,Ge?ge:We))}}return new Ii(r,R)}function sa(e,r){return new Ii([new lr(e,r||e)],0)}function la(e){return e.text?it(e.from.line+e.text.length-1,Fe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,r){if(Tt(e,r.from)<0)return e;if(Tt(e,r.to)<=0)return la(r);var R=e.line+r.text.length-(r.to.line-r.from.line)-1,L=e.ch;return e.line==r.to.line&&(L+=la(r).ch-r.to.ch),it(R,L)}function wo(e,r){for(var R=[],L=0;L1&&e.remove(le.line+1,bt-1),e.insert(le.line+1,Wt)}jt(e,"change",e,r)}function ua(e,r,R){function L(M,H,re){if(M.linked)for(var le=0;le1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Fe(e.done)}function is(e,r,R,L){var M=e.history;M.undone.length=0;var H=+new Date,re,le;if((M.lastOp==L||M.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&M.lastModTime>H-(e.cm?e.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(re=ml(M,M.lastOp==L)))le=Fe(re.changes),Tt(r.from,r.to)==0&&Tt(r.from,le.to)==0?le.to=la(r):re.changes.push(Oo(e,r));else{var ue=Fe(M.done);for((!ue||!ue.ranges)&&io(e.sel,M.done),re={changes:[Oo(e,r)],generation:M.generation},M.done.push(re);M.done.length>M.undoDepth;)M.done.shift(),M.done[0].ranges||M.done.shift()}M.done.push(R),M.generation=++M.maxGeneration,M.lastModTime=M.lastSelTime=H,M.lastOp=M.lastSelOp=L,M.lastOrigin=M.lastSelOrigin=r.origin,le||Ve(e,"historyAdded")}function vl(e,r,R,L){var M=r.charAt(0);return M=="*"||M=="+"&&R.ranges.length==L.ranges.length&&R.somethingSelected()==L.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,r,R,L){var M=e.history,H=L&&L.origin;R==M.lastSelOp||H&&M.lastSelOrigin==H&&(M.lastModTime==M.lastSelTime&&M.lastOrigin==H||vl(e,H,Fe(M.done),r))?M.done[M.done.length-1]=r:io(r,M.done),M.lastSelTime=+new Date,M.lastSelOrigin=H,M.lastSelOp=R,L&&L.clearRedo!==!1&&rs(M.undone)}function io(e,r){var R=Fe(r);R&&R.ranges&&R.equals(e)||r.push(e)}function as(e,r,R,L){var M=r["spans_"+e.id],H=0;e.iter(Math.max(e.first,R),Math.min(e.first+e.size,L),function(re){re.markedSpans&&((M||(M=r["spans_"+e.id]={}))[H]=re.markedSpans),++H})}function yl(e){if(!e)return null;for(var r,R=0;R-1&&(Fe(le)[Ge]=ge[Ge],delete ge[Ge]))}}return L}function Ao(e,r,R,L){if(L){var M=e.anchor;if(R){var H=Tt(r,M)<0;H!=Tt(R,M)<0?(M=r,r=R):H!=Tt(r,R)<0&&(r=R)}return new lr(M,r)}else return new lr(R||r,r)}function ao(e,r,R,L,M){M==null&&(M=e.cm&&(e.cm.display.shift||e.extend)),si(e,new Ii([Ao(e.sel.primary(),r,R,M)],0),L)}function ss(e,r,R){for(var L=[],M=e.cm&&(e.cm.display.shift||e.extend),H=0;H=r.ch:le.to>r.ch))){if(M&&(Ve(ue,"beforeCursorEnter"),ue.explicitlyCleared))if(H.markedSpans){--re;continue}else break;if(!ue.atomic)continue;if(R){var Ge=ue.find(L<0?1:-1),ot=void 0;if((L<0?We:ge)&&(Ge=hs(e,Ge,-L,Ge&&Ge.line==r.line?H:null)),Ge&&Ge.line==r.line&&(ot=Tt(Ge,R))&&(L<0?ot<0:ot>0))return wa(e,Ge,r,L,M)}var tt=ue.find(L<0?-1:1);return(L<0?ge:We)&&(tt=hs(e,tt,L,tt.line==r.line?H:null)),tt?wa(e,tt,r,L,M):null}}return r}function so(e,r,R,L,M){var H=L||1,re=wa(e,r,R,H,M)||!M&&wa(e,r,R,H,!0)||wa(e,r,R,-H,M)||!M&&wa(e,r,R,-H,!0);return re||(e.cantEdit=!0,it(e.first,0))}function hs(e,r,R,L){return R<0&&r.ch==0?r.line>e.first?yt(e,it(r.line-1)):null:R>0&&r.ch==(L||J(e,r.line)).text.length?r.line=0;--M)vs(e,{from:L[M].from,to:L[M].to,text:M?[""]:r.text,origin:r.origin});else vs(e,r)}function vs(e,r){if(r.text.length==1&&r.text[0]==""&&Tt(r.from,r.to)==0)return;var R=wo(e,r);is(e,r,R,e.cm?e.cm.curOp.id:NaN),Wa(e,r,R,ni(e,r));var L=[];ua(e,function(M,H){!H&&K(L,M.history)==-1&&(_s(M.history,r),L.push(M.history)),Wa(M,r,null,ni(M,r))})}function lo(e,r,R){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!R)return;for(var M=e.history,H,re=e.sel,le=r=="undo"?M.done:M.undone,ue=r=="undo"?M.undone:M.done,ge=0;ge=0;--tt){var bt=ot(tt);if(bt)return bt.v}}function gs(e,r){if(r==0)return;if(e.first+=r,e.sel=new Ii(De(e.sel.ranges,function(M){return new lr(it(M.anchor.line+r,M.anchor.ch),it(M.head.line+r,M.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-r,r);for(var R=e.cm.display,L=R.viewFrom;Le.lastLine())return;if(r.from.lineH&&(r={from:r.from,to:it(H,J(e,H).text.length),text:[r.text[0]],origin:r.origin}),r.removed=te(e,r.from,r.to),R||(R=wo(e,r)),e.cm?El(e.cm,r,L):Co(e,r,L),oo(e,R,oe),e.cantEdit&&so(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,r,R){var L=e.doc,M=e.display,H=r.from,re=r.to,le=!1,ue=H.line;e.options.lineWrapping||(ue=ze(ai(J(L,H.line))),L.iter(ue,re.line+1,function(tt){if(tt==M.maxLine)return le=!0,!0})),L.sel.contains(r.from,r.to)>-1&&Pe(e),Co(L,r,R,Kn(e)),e.options.lineWrapping||(L.iter(ue,H.line+r.text.length,function(tt){var bt=Ji(tt);bt>M.maxLineLength&&(M.maxLine=tt,M.maxLineLength=bt,M.maxLineChanged=!0,le=!1)}),le&&(e.curOp.updateMaxLine=!0)),gr(L,H.line),ja(e,400);var ge=r.text.length-(re.line-H.line)-1;r.full?Mr(e):H.line==re.line&&r.text.length==1&&!es(e.doc,r)?oi(e,H.line,"text"):Mr(e,H.line,re.line+1,ge);var We=Re(e,"changes"),Ge=Re(e,"change");if(Ge||We){var ot={from:H,to:re,text:r.text,removed:r.removed,origin:r.origin};Ge&&jt(e,"change",e,ot),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ot)}e.display.selForContextMenu=null}function Ca(e,r,R,L,M){var H;L||(L=R),Tt(L,R)<0&&(H=[L,R],R=H[0],L=H[1]),typeof r=="string"&&(r=e.splitLines(r)),Ta(e,{from:R,to:L,text:r,origin:M})}function ys(e,r,R,L){R1||!(this.children[0]instanceof Ha))){var le=[];this.collapse(le),this.children=[new Ha(le)],this.children[0].parent=this}},collapse:function(e){for(var r=0;r50){for(var re=M.lines.length%25+25,le=re;le10);e.parent.maybeSpill()},iterN:function(e,r,R){for(var L=0;Le.display.maxLineLength&&(e.display.maxLine=ge,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&Mr(e,L,M+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&jt(e,"markerCleared",e,this,L,M),r&&ga(e),this.parent&&this.parent.clear()},ca.prototype.find=function(e,r){e==null&&this.type=="bookmark"&&(e=1);for(var R,L,M=0;M0||re==0&&H.clearWhenEmpty!==!1)return H;if(H.replacedWith&&(H.collapsed=!0,H.widgetNode=A("span",[H.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||H.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(H.widgetNode.insertLeft=!0)),H.collapsed){if(na(e,r.line,r,R,H)||r.line!=R.line&&na(e,R.line,r,R,H))throw new Error("Inserting collapsed marker partially overlapping an existing one");Or()}H.addToHistory&&is(e,{from:r,to:R,origin:"markText"},e.sel,NaN);var le=r.line,ue=e.cm,ge;if(e.iter(le,R.line+1,function(Ge){ue&&H.collapsed&&!ue.options.lineWrapping&&ai(Ge)==ue.display.maxLine&&(ge=!0),H.collapsed&&le!=r.line&&Ee(Ge,0),Pr(Ge,new Kr(H,le==r.line?r.ch:null,le==R.line?R.ch:null)),++le}),H.collapsed&&e.iter(r.line,R.line+1,function(Ge){Ci(e,Ge)&&Ee(Ge,0)}),H.clearOnEnter&&ke(H,"beforeCursorEnter",function(){return H.clear()}),H.readOnly&&(yr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),H.collapsed&&(H.id=++xs,H.atomic=!0),ue){if(ge&&(ue.curOp.updateMaxLine=!0),H.collapsed)Mr(ue,r.line,R.line+1);else if(H.className||H.startStyle||H.endStyle||H.css||H.attributes||H.title)for(var We=r.line;We<=R.line;We++)oi(ue,We,"text");H.atomic&&ds(ue.doc),jt(ue,"markerAdded",ue,H)}return H}var Va=function(e,r){this.markers=e,this.primary=r;for(var R=0;R=0;ue--)Ta(this,L[ue]);le?us(this,le):this.cm&&Ea(this.cm)}),undo:$r(function(){lo(this,"undo")}),redo:$r(function(){lo(this,"redo")}),undoSelection:$r(function(){lo(this,"undo",!0)}),redoSelection:$r(function(){lo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,r=0,R=0,L=0;L=e.ch)&&r.push(M.marker.parent||M.marker)}return r},findMarks:function(e,r,R){e=yt(this,e),r=yt(this,r);var L=[],M=e.line;return this.iter(e.line,r.line+1,function(H){var re=H.markedSpans;if(re)for(var le=0;le=ue.to||ue.from==null&&M!=e.line||ue.from!=null&&M==r.line&&ue.from>=r.ch)&&(!R||R(ue.marker))&&L.push(ue.marker.parent||ue.marker)}++M}),L},getAllMarks:function(){var e=[];return this.iter(function(r){var R=r.markedSpans;if(R)for(var L=0;Le)return r=e,!0;e-=H,++R}),yt(this,it(R,r))},indexFromPos:function(e){e=yt(this,e);var r=e.ch;if(e.liner&&(r=e.from),e.to!=null&&e.to-1){r.state.draggingText(e),setTimeout(function(){return r.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Ge;if(r.state.draggingText&&!r.state.draggingText.copy&&(Ge=r.listSelections()),oo(r.doc,sa(R,R)),Ge)for(var ot=0;ot=0;le--)Ca(e.doc,"",L[le].from,L[le].to,"+delete");Ea(e)})}function Ro(e,r,R){var L=N(e.text,r+R,R);return L<0||L>e.text.length?null:L}function Do(e,r,R){var L=Ro(e,r.ch,R);return L==null?null:new it(r.line,L,R<0?"after":"before")}function Po(e,r,R,L,M){if(e){r.doc.direction=="rtl"&&(M=-M);var H=at(R,r.doc.direction);if(H){var re=M<0?Fe(H):H[0],le=M<0==(re.level==1),ue=le?"after":"before",ge;if(re.level>0||r.doc.direction=="rtl"){var We=qn(r,R);ge=M<0?R.text.length-1:0;var Ge=Cn(r,We,ge).top;ge=$(function(ot){return Cn(r,We,ot).top==Ge},M<0==(re.level==1)?re.from:re.to-1,ge),ue=="before"&&(ge=Ro(R,ge,1))}else ge=M<0?re.to:re.from;return new it(L,ge,ue)}}return new it(L,M<0?R.text.length:0,M<0?"before":"after")}function Il(e,r,R,L){var M=at(r,e.doc.direction);if(!M)return Do(r,R,L);R.ch>=r.text.length?(R.ch=r.text.length,R.sticky="before"):R.ch<=0&&(R.ch=0,R.sticky="after");var H=me(M,R.ch,R.sticky),re=M[H];if(e.doc.direction=="ltr"&&re.level%2==0&&(L>0?re.to>R.ch:re.from=re.from&&ot>=We.begin)){var tt=Ge?"before":"after";return new it(R.line,ot,tt)}}var bt=function(Wt,Yt,Kt){for(var en=function(_r,Jr){return Jr?new it(R.line,le(_r,1),"before"):new it(R.line,_r,"after")};Wt>=0&&Wt0==(bn.level!=1),Gn=dn?Kt.begin:le(Kt.end,-1);if(bn.from<=Gn&&Gn0?We.end:le(We.begin,-1);return Mt!=null&&!(L>0&&Mt==r.text.length)&&(Ot=bt(L>0?0:M.length-1,L,ge(Mt)),Ot)?Ot:null}var $a={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),oe)},killLine:function(e){return La(e,function(r){if(r.empty()){var R=J(e.doc,r.head.line).text.length;return r.head.ch==R&&r.head.line0)M=new it(M.line,M.ch+1),e.replaceRange(H.charAt(M.ch-1)+H.charAt(M.ch-2),it(M.line,M.ch-2),M,"+transpose");else if(M.line>e.doc.first){var re=J(e.doc,M.line-1).text;re&&(M=new it(M.line,1),e.replaceRange(H.charAt(0)+e.doc.lineSeparator()+re.charAt(re.length-1),it(M.line-1,re.length-1),M,"+transpose"))}}R.push(new lr(M,M))}e.setSelections(R)})},newlineAndIndent:function(e){return Li(e,function(){for(var r=e.listSelections(),R=r.length-1;R>=0;R--)e.replaceRange(e.doc.lineSeparator(),r[R].anchor,r[R].head,"+input");r=e.listSelections();for(var L=0;Le&&Tt(r,this.pos)==0&&R==this.button};var Qa,qa;function Kl(e,r){var R=+new Date;return qa&&qa.compare(R,e,r)?(Qa=qa=null,"triple"):Qa&&Qa.compare(R,e,r)?(qa=new ko(R,e,r),Qa=null,"double"):(Qa=new ko(R,e,r),qa=null,"single")}function js(e){var r=this,R=r.display;if(He(r,e)||R.activeTouch&&R.input.supportsTouch())return;if(R.input.ensurePolled(),R.shift=e.shiftKey,ir(R,e)){h||(R.scroller.draggable=!1,setTimeout(function(){return R.scroller.draggable=!0},100));return}if(Io(r,e))return;var L=pi(r,e),M=Qe(e),H=L?Kl(L,M):"single";if(window.focus(),M==1&&r.state.selectingText&&r.state.selectingText(e),L&&Hl(r,M,L,H,e))return;M==1?L?Gl(r,L,H,e):Be(e)==R.scroller&&he(e):M==2?(L&&ao(r.doc,L),setTimeout(function(){return R.input.focus()},20)):M==3&&(_?r.display.input.onContextMenu(e):ia(r))}function Hl(e,r,R,L,M){var H="Click";return L=="double"?H="Double"+H:L=="triple"&&(H="Triple"+H),H=(r==1?"Left":r==2?"Middle":"Right")+H,Ja(e,Ls(H,M),M,function(re){if(typeof re=="string"&&(re=$a[re]),!re)return!1;var le=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),le=re(e,R)!=ie}finally{e.state.suppressEdits=!1}return le})}function zl(e,r,R){var L=e.getOption("configureMouse"),M=L?L(e,r,R):{};if(M.unit==null){var H=d?R.shiftKey&&R.metaKey:R.altKey;M.unit=H?"rectangle":r=="single"?"char":r=="double"?"word":"line"}return(M.extend==null||e.doc.extend)&&(M.extend=e.doc.extend||R.shiftKey),M.addNew==null&&(M.addNew=t?R.metaKey:R.ctrlKey),M.moveOnDrag==null&&(M.moveOnDrag=!(t?R.altKey:R.ctrlKey)),M}function Gl(e,r,R,L){C?setTimeout(j(sn,e),0):e.curOp.focus=I();var M=zl(e,R,L),H=e.doc.sel,re;e.options.dragDrop&&rt&&!e.isReadOnly()&&R=="single"&&(re=H.contains(r))>-1&&(Tt((re=H.ranges[re]).from(),r)<0||r.xRel>0)&&(Tt(re.to(),r)>0||r.xRel<0)?Vl(e,L,r,M):Xl(e,L,r,M)}function Vl(e,r,R,L){var M=e.display,H=!1,re=Yr(e,function(ge){h&&(M.scroller.draggable=!1),e.state.draggingText=!1,Ze(M.wrapper.ownerDocument,"mouseup",re),Ze(M.wrapper.ownerDocument,"mousemove",le),Ze(M.scroller,"dragstart",ue),Ze(M.scroller,"drop",re),H||(he(ge),L.addNew||ao(e.doc,R,null,null,L.extend),h&&!a||C&&T==9?setTimeout(function(){M.wrapper.ownerDocument.body.focus({preventScroll:!0}),M.input.focus()},20):M.input.focus())}),le=function(ge){H=H||Math.abs(r.clientX-ge.clientX)+Math.abs(r.clientY-ge.clientY)>=10},ue=function(){return H=!0};h&&(M.scroller.draggable=!0),e.state.draggingText=re,re.copy=!L.moveOnDrag,M.scroller.dragDrop&&M.scroller.dragDrop(),ke(M.wrapper.ownerDocument,"mouseup",re),ke(M.wrapper.ownerDocument,"mousemove",le),ke(M.scroller,"dragstart",ue),ke(M.scroller,"drop",re),ia(e),setTimeout(function(){return M.input.focus()},20)}function Fs(e,r,R){if(R=="char")return new lr(r,r);if(R=="word")return e.findWordAt(r);if(R=="line")return new lr(it(r.line,0),yt(e.doc,it(r.line+1,0)));var L=R(e,r);return new lr(L.from,L.to)}function Xl(e,r,R,L){var M=e.display,H=e.doc;he(r);var re,le,ue=H.sel,ge=ue.ranges;if(L.addNew&&!L.extend?(le=H.sel.contains(R),le>-1?re=ge[le]:re=new lr(R,R)):(re=H.sel.primary(),le=H.sel.primIndex),L.unit=="rectangle")L.addNew||(re=new lr(R,R)),R=pi(e,r,!0,!0),le=-1;else{var We=Fs(e,R,L.unit);L.extend?re=Ao(re,We.anchor,We.head,L.extend):re=We}L.addNew?le==-1?(le=ge.length,si(H,Gi(e,ge.concat([re]),le),{scroll:!1,origin:"*mouse"})):ge.length>1&&ge[le].empty()&&L.unit=="char"&&!L.extend?(si(H,Gi(e,ge.slice(0,le).concat(ge.slice(le+1)),0),{scroll:!1,origin:"*mouse"}),ue=H.sel):Lo(H,le,re,ye):(le=0,si(H,new Ii([re],0),ye),ue=H.sel);var Ge=R;function ot(Kt){if(Tt(Ge,Kt)==0)return;if(Ge=Kt,L.unit=="rectangle"){for(var en=[],bn=e.options.tabSize,dn=X(J(H,R.line).text,R.ch,bn),Gn=X(J(H,Kt.line).text,Kt.ch,bn),_r=Math.min(dn,Gn),Jr=Math.max(dn,Gn),Ar=Math.min(R.line,Kt.line),Ri=Math.min(e.lastLine(),Math.max(R.line,Kt.line));Ar<=Ri;Ar++){var Si=J(H,Ar).text,Br=we(Si,_r,bn);_r==Jr?en.push(new lr(it(Ar,Br),it(Ar,Br))):Si.length>Br&&en.push(new lr(it(Ar,Br),it(Ar,we(Si,Jr,bn))))}en.length||en.push(new lr(R,R)),si(H,Gi(e,ue.ranges.slice(0,le).concat(en),le),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Kt)}else{var wi=re,ti=Fs(e,Kt,L.unit),Vr=wi.anchor,Wr;Tt(ti.anchor,Vr)>0?(Wr=ti.head,Vr=Jt(wi.from(),ti.anchor)):(Wr=ti.anchor,Vr=nn(wi.to(),ti.head));var Dr=ue.ranges.slice(0);Dr[le]=Yl(e,new lr(yt(H,Vr),Wr)),si(H,Gi(e,Dr,le),ye)}}var tt=M.wrapper.getBoundingClientRect(),bt=0;function Ot(Kt){var en=++bt,bn=pi(e,Kt,!0,L.unit=="rectangle");if(!bn)return;if(Tt(bn,Ge)!=0){e.curOp.focus=I(),ot(bn);var dn=zi(M,H);(bn.line>=dn.to||bn.linett.bottom?20:0;Gn&&setTimeout(Yr(e,function(){if(bt!=en)return;M.scroller.scrollTop+=Gn,Ot(Kt)}),50)}}function Mt(Kt){e.state.selectingText=!1,bt=Infinity,Kt&&(he(Kt),M.input.focus()),Ze(M.wrapper.ownerDocument,"mousemove",Wt),Ze(M.wrapper.ownerDocument,"mouseup",Yt),H.history.lastSelOrigin=null}var Wt=Yr(e,function(Kt){Kt.buttons===0||!Qe(Kt)?Mt(Kt):Ot(Kt)}),Yt=Yr(e,Mt);e.state.selectingText=Yt,ke(M.wrapper.ownerDocument,"mousemove",Wt),ke(M.wrapper.ownerDocument,"mouseup",Yt)}function Yl(e,r){var R=r.anchor,L=r.head,M=J(e.doc,R.line);if(Tt(R,L)==0&&R.sticky==L.sticky)return r;var H=at(M);if(!H)return r;var re=me(H,R.ch,R.sticky),le=H[re];if(le.from!=R.ch&&le.to!=R.ch)return r;var ue=re+(le.from==R.ch==(le.level!=1)?0:1);if(ue==0||ue==H.length)return r;var ge;if(L.line!=R.line)ge=(L.line-R.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=me(H,L.ch,L.sticky),Ge=We-re||(L.ch-R.ch)*(le.level==1?-1:1);We==ue-1||We==ue?ge=Ge<0:ge=Ge>0}var ot=H[ue+(ge?-1:0)],tt=ge==(ot.level==1),bt=tt?ot.from:ot.to,Ot=tt?"after":"before";return R.ch==bt&&R.sticky==Ot?r:new lr(new it(R.line,bt,Ot),L)}function Bs(e,r,R,L){var M,H;if(r.touches)M=r.touches[0].clientX,H=r.touches[0].clientY;else try{M=r.clientX,H=r.clientY}catch(ot){return!1}if(M>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&he(r);var re=e.display,le=re.lineDiv.getBoundingClientRect();if(H>le.bottom||!Re(e,R))return Ce(r);H-=le.top-re.viewOffset;for(var ue=0;ue=M){var We=qe(e.doc,H),Ge=e.display.gutterSpecs[ue];return Ve(e,R,e,We,Ge.className,r),Ce(r)}}}function Io(e,r){return Bs(e,r,"gutterClick",!0)}function Ws(e,r){if(ir(e.display,r)||$l(e,r))return;if(He(e,r,"contextmenu"))return;_||e.display.input.onContextMenu(r)}function $l(e,r){return Re(e,"gutterContextMenu")?Bs(e,r,"gutterContextMenu",!1):!1}function Ks(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qt(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Hs={},ho={};function Jl(e){var r=e.optionHandlers;function R(L,M,H,re){e.defaults[L]=M,H&&(r[L]=re?function(le,ue,ge){ge!=Ra&&H(le,ue,ge)}:H)}e.defineOption=R,e.Init=Ra,R("value","",function(L,M){return L.setValue(M)},!0),R("mode",null,function(L,M){L.doc.modeOption=M,To(L)},!0),R("indentUnit",2,To,!0),R("indentWithTabs",!1),R("smartIndent",!0),R("tabSize",4,function(L){Ba(L),qt(L),Mr(L)},!0),R("lineSeparator",null,function(L,M){if(L.doc.lineSep=M,!M)return;var H=[],re=L.doc.first;L.doc.iter(function(ue){for(var ge=0;;){var We=ue.text.indexOf(M,ge);if(We==-1)break;ge=We+M.length,H.push(it(re,We))}re++});for(var le=H.length-1;le>=0;le--)Ca(L.doc,M,H[le],it(H[le].line,H[le].ch+M.length))}),R("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,M,H){L.state.specialChars=new RegExp(M.source+(M.test(" ")?"":"| "),"g"),H!=Ra&&L.refresh()}),R("specialCharPlaceholder",or,function(L){return L.refresh()},!0),R("electricChars",!0),R("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),R("spellcheck",!1,function(L,M){return L.getInputField().spellcheck=M},!0),R("autocorrect",!1,function(L,M){return L.getInputField().autocorrect=M},!0),R("autocapitalize",!1,function(L,M){return L.getInputField().autocapitalize=M},!0),R("rtlMoveVisually",!v),R("wholeLineUpdateBefore",!0),R("theme","default",function(L){Ks(L),Fa(L)},!0),R("keyMap","default",function(L,M,H){var re=co(M),le=H!=Ra&&co(H);le&&le.detach&&le.detach(L,re),re.attach&&re.attach(L,le||null)}),R("extraKeys",null),R("configureMouse",null),R("lineWrapping",!1,ql,!0),R("gutters",[],function(L,M){L.display.gutterSpecs=So(M,L.options.lineNumbers),Fa(L)},!0),R("fixedGutter",!0,function(L,M){L.display.gutters.style.left=M?Lr(L.display)+"px":"0",L.refresh()},!0),R("coverGutterNextToScrollbar",!1,function(L){return xa(L)},!0),R("scrollbarStyle","native",function(L){Go(L),xa(L),L.display.scrollbars.setScrollTop(L.doc.scrollTop),L.display.scrollbars.setScrollLeft(L.doc.scrollLeft)},!0),R("lineNumbers",!1,function(L,M){L.display.gutterSpecs=So(L.options.gutters,M),Fa(L)},!0),R("firstLineNumber",1,Fa,!0),R("lineNumberFormatter",function(L){return L},Fa,!0),R("showCursorWhenSelecting",!1,Gt,!0),R("resetSelectionOnContextMenu",!0),R("lineWiseCopyCut",!0),R("pasteLinesPerSelection",!0),R("selectionsMayTouch",!1),R("readOnly",!1,function(L,M){M=="nocursor"&&(Ei(L),L.display.input.blur()),L.display.input.readOnlyChanged(M)}),R("screenReaderLabel",null,function(L,M){M=M===""?null:M,L.display.input.screenReaderLabelChanged(M)}),R("disableInput",!1,function(L,M){M||L.display.input.reset()},!0),R("dragDrop",!0,Ql),R("allowDropFileTypes",null),R("cursorBlinkRate",530),R("cursorScrollMargin",0),R("cursorHeight",1,Gt,!0),R("singleCursorHeightPerLine",!0,Gt,!0),R("workTime",100),R("workDelay",100),R("flattenSpans",!0,Ba,!0),R("addModeClass",!1,Ba,!0),R("pollInterval",100),R("undoDepth",200,function(L,M){return L.doc.history.undoDepth=M}),R("historyEventDelay",1250),R("viewportMargin",10,function(L){return L.refresh()},!0),R("maxHighlightLength",1e4,Ba,!0),R("moveInputWithCursor",!0,function(L,M){M||L.display.input.resetPosition()}),R("tabindex",null,function(L,M){return L.display.input.getField().tabIndex=M||""}),R("autofocus",null),R("direction","ltr",function(L,M){return L.doc.setDirection(M)},!0),R("phrases",null)}function Ql(e,r,R){var L=R&&R!=Ra;if(!r!=!L){var M=e.display.dragFunctions,H=r?ke:Ze;H(e.display.scroller,"dragstart",M.start),H(e.display.scroller,"dragenter",M.enter),H(e.display.scroller,"dragover",M.over),H(e.display.scroller,"dragleave",M.leave),H(e.display.scroller,"drop",M.drop)}}function ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),Qi(e)),_i(e),Mr(e),qt(e),setTimeout(function(){return xa(e)},100)}function Tr(e,r){var R=this;if(!(this instanceof Tr))return new Tr(e,r);this.options=r=r?G(r):{},G(Hs,r,!1);var L=r.value;typeof L=="string"?L=new xi(L,r.mode,null,r.lineSeparator,r.direction):r.mode&&(L.modeOption=r.mode),this.doc=L;var M=new Tr.inputStyles[r.inputStyle](this),H=this.display=new dl(e,L,M,r);H.wrapper.CodeMirror=this,Ks(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Go(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},r.autofocus&&!n&&H.input.focus(),C&&T<11&&setTimeout(function(){return R.display.input.reset(!0)},20),Zl(this),Rl(),va(this),this.curOp.forceUpdate=!0,ts(this,L),r.autofocus&&!n||this.hasFocus()?setTimeout(function(){R.hasFocus()&&!R.state.focused&&ha(R)},20):Ei(this);for(var re in ho)ho.hasOwnProperty(re)&&ho[re](this,r[re],Ra);Yo(this),r.finishInit&&r.finishInit(this);for(var le=0;le20*20}ke(r.scroller,"touchstart",function(ue){if(!He(e,ue)&&!H(ue)&&!Io(e,ue)){r.input.ensurePolled(),clearTimeout(R);var ge=+new Date;r.activeTouch={start:ge,moved:!1,prev:ge-L.end<=300?L:null},ue.touches.length==1&&(r.activeTouch.left=ue.touches[0].pageX,r.activeTouch.top=ue.touches[0].pageY)}}),ke(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),ke(r.scroller,"touchend",function(ue){var ge=r.activeTouch;if(ge&&!ir(r,ue)&&ge.left!=null&&!ge.moved&&new Date-ge.start<300){var We=e.coordsChar(r.activeTouch,"page"),Ge;!ge.prev||re(ge,ge.prev)?Ge=new lr(We,We):!ge.prev.prev||re(ge,ge.prev.prev)?Ge=e.findWordAt(We):Ge=new lr(it(We.line,0),yt(e.doc,it(We.line+1,0))),e.setSelection(Ge.anchor,Ge.head),e.focus(),he(ue)}M()}),ke(r.scroller,"touchcancel",M),ke(r.scroller,"scroll",function(){r.scroller.clientHeight&&(Ia(e,r.scroller.scrollTop),pa(e,r.scroller.scrollLeft,!0),Ve(e,"scroll",e))}),ke(r.scroller,"mousewheel",function(ue){return Qo(e,ue)}),ke(r.scroller,"DOMMouseScroll",function(ue){return Qo(e,ue)}),ke(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(ue){He(e,ue)||xe(ue)},over:function(ue){He(e,ue)||(Ll(e,ue),xe(ue))},start:function(ue){return Al(e,ue)},drop:Yr(e,Ol),leave:function(ue){He(e,ue)||Ts(e)}};var le=r.input.getField();ke(le,"keyup",function(ue){return Ns.call(e,ue)}),ke(le,"keydown",Yr(e,Is)),ke(le,"keypress",Yr(e,Us)),ke(le,"focus",function(ue){return ha(e,ue)}),ke(le,"blur",function(ue){return Ei(e,ue)})}var No=[];Tr.defineInitHook=function(e){return No.push(e)};function Za(e,r,R,L){var M=e.doc,H;R==null&&(R="add"),R=="smart"&&(M.mode.indent?H=xn(e,r).state:R="prev");var re=e.options.tabSize,le=J(M,r),ue=X(le.text,null,re);le.stateAfter&&(le.stateAfter=null);var ge=le.text.match(/^\s*/)[0],We;if(!L&&!/\S/.test(le.text))We=0,R="not";else if(R=="smart"&&(We=M.mode.indent(H,le.text.slice(ge.length),le.text),We==ie||We>150)){if(!L)return;R="prev"}R=="prev"?r>M.first?We=X(J(M,r-1).text,null,re):We=0:R=="add"?We=ue+e.options.indentUnit:R=="subtract"?We=ue-e.options.indentUnit:typeof R=="number"&&(We=ue+R),We=Math.max(0,We);var Ge="",ot=0;if(e.options.indentWithTabs)for(var tt=Math.floor(We/re);tt;--tt)ot+=re,Ge+=" ";if(otre,ue=st(r),ge=null;if(le&&L.ranges.length>1)if(Vi&&Vi.text.join(` `)==r){if(L.ranges.length%Vi.text.length==0){ge=[];for(var We=0;We=0;ot--){var tt=L.ranges[ot],bt=tt.from(),Ot=tt.to();tt.empty()&&(R&&R>0?bt=it(bt.line,bt.ch-R):e.state.overwrite&&!le?Ot=it(Ot.line,Math.min(J(H,Ot.line).text.length,Ot.ch+Fe(ue).length)):le&&Vi&&Vi.lineWise&&Vi.text.join(` `)==ue.join(` `)&&(bt=Ot=it(bt.line,0)));var Mt={from:bt,to:Ot,text:ge?ge[ot%ge.length]:ue,origin:M||(le?"paste":e.state.cutIncoming>re?"cut":"+input")};Ta(e.doc,Mt),jt(e,"inputRead",e,Mt)}r&&!le&&Gs(e,r),Ea(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ge),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function zs(e,r){var R=e.clipboardData&&e.clipboardData.getData("Text");if(R)return e.preventDefault(),!r.isReadOnly()&&!r.options.disableInput&&Li(r,function(){return Uo(r,R,0,null,"paste")}),!0}function Gs(e,r){if(!e.options.electricChars||!e.options.smartIndent)return;for(var R=e.doc.sel,L=R.ranges.length-1;L>=0;L--){var M=R.ranges[L];if(M.head.ch>100||L&&R.ranges[L-1].head.line==M.head.line)continue;var H=e.getModeAt(M.head),re=!1;if(H.electricChars){for(var le=0;le-1){re=Za(e,M.head.line,"smart");break}}else H.electricInput&&(H.electricInput.test(J(e.doc,M.head.line).text.slice(0,M.head.ch))&&(re=Za(e,M.head.line,"smart")));re&&jt(e,"electricInput",e,M.head.line)}}function Vs(e){for(var r=[],R=[],L=0;LH&&(Za(this,le.head.line,L,!0),H=le.head.line,re==this.doc.sel.primIndex&&Ea(this));else{var ue=le.from(),ge=le.to(),We=Math.max(H,ue.line);H=Math.min(this.lastLine(),ge.line-(ge.ch?0:1))+1;for(var Ge=We;Ge0&&Lo(this.doc,re,new lr(ue,ot[re].to()),oe)}}}),getTokenAt:function(L,M){return Nr(this,L,M)},getLineTokens:function(L,M){return Nr(this,it(L),M,!0)},getTokenTypeAt:function(L){L=yt(this.doc,L);var M=rr(this,J(this.doc,L.line)),H=0,re=(M.length-1)/2,le=L.ch,ue;if(le==0)ue=M[2];else for(;;){var ge=H+re>>1;if((ge?M[ge*2-1]:0)>=le)re=ge;else if(M[ge*2+1]ue&&(L=ue,re=!0),le=J(this.doc,L)}else le=L;return gn(this,le,{top:0,left:0},M||"page",H||re).top+(re?this.doc.height-bi(le):0)},defaultTextHeight:function(){return mn(this.display)},defaultCharWidth:function(){return jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(L,M,H,re,le){var ue=this.display;L=$n(this,yt(this.doc,L));var ge=L.bottom,We=L.left;if(M.style.position="absolute",M.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(M),ue.sizer.appendChild(M),re=="over")ge=L.top;else if(re=="above"||re=="near"){var Ge=Math.max(ue.wrapper.clientHeight,this.doc.height),ot=Math.max(ue.sizer.clientWidth,ue.lineSpace.clientWidth);(re=="above"||L.bottom+M.offsetHeight>Ge)&&L.top>M.offsetHeight?ge=L.top-M.offsetHeight:L.bottom+M.offsetHeight<=Ge&&(ge=L.bottom),We+M.offsetWidth>ot&&(We=ot-M.offsetWidth)}M.style.top=ge+"px",M.style.left=M.style.right="",le=="right"?(We=ue.sizer.clientWidth-M.offsetWidth,M.style.right="0px"):(le=="left"?We=0:le=="middle"&&(We=(ue.sizer.clientWidth-M.offsetWidth)/2),M.style.left=We+"px"),H&&go(this,{left:We,top:ge,right:We+M.offsetWidth,bottom:ge+M.offsetHeight})},triggerOnKeyDown:mi(Is),triggerOnKeyPress:mi(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:mi(js),execCommand:function(L){if($a.hasOwnProperty(L))return $a[L].call(null,this)},triggerElectric:mi(function(L){Gs(this,L)}),findPosH:function(L,M,H,re){var le=1;M<0&&(le=-1,M=-M);for(var ue=yt(this.doc,L),ge=0;ge0&&We(H.charAt(re-1));)--re;for(;le.5||this.options.lineWrapping)&&_i(this),Ve(this,"refresh",this)}),swapDoc:mi(function(L){var M=this.doc;return M.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),qt(this),this.display.input.reset(),ka(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,jt(this,"swapDoc",this,M),M}),phrase:function(L){var M=this.options.phrases;return M&&Object.prototype.hasOwnProperty.call(M,L)?M[L]:L},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Oe(e),e.registerHelper=function(L,M,H){R.hasOwnProperty(L)||(R[L]=e[L]={_global:[]}),R[L][M]=H},e.registerGlobalHelper=function(L,M,H,re){e.registerHelper(L,M,re),R[L]._global.push({pred:H,val:re})}}function jo(e,r,R,L,M){var H=r,re=R,le=J(e,r.line),ue=M&&e.direction=="rtl"?-R:R;function ge(){var Yt=r.line+ue;return Yt=e.first+e.size?!1:(r=new it(Yt,r.ch,r.sticky),le=J(e,Yt))}function We(Yt){var Kt;if(L=="codepoint"){var en=le.text.charCodeAt(r.ch+(L>0?0:-1));isNaN(en)?Kt=null:Kt=new it(r.line,Math.max(0,Math.min(le.text.length,r.ch+R*(en>=55296&&en<56320?2:1))),-R)}else M?Kt=Il(e.cm,le,r,R):Kt=Do(le,r,R);if(Kt==null)if(!Yt&&ge())r=Po(M,e.cm,le,r.line,ue);else return!1;else r=Kt;return!0}if(L=="char"||L=="codepoint")We();else if(L=="column")We(!0);else if(L=="word"||L=="group")for(var Ge=null,ot=L=="group",tt=e.cm&&e.cm.getHelper(r,"wordChars"),bt=!0;!(R<0&&!We(!bt));bt=!1){var Ot=le.text.charAt(r.ch)||` `,Mt=Ne(Ot,tt)?"w":ot&&Ot==` `?"n":!ot||/\s/.test(Ot)?null:"p";if(ot&&!bt&&!Mt&&(Mt="s"),Ge&&Ge!=Mt){R<0&&(R=1,We(),r.sticky="after");break}if(Mt&&(Ge=Mt),R>0&&!We(!bt))break}var Wt=so(e,r,H,re,!0);return Qt(H,Wt)&&(Wt.hitSide=!0),Wt}function $s(e,r,R,L){var M=e.doc,H=r.left,re;if(L=="page"){var le=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ue=Math.max(le-.5*mn(e.display),3);re=(R>0?r.bottom:r.top)+R*ue}else L=="line"&&(re=R>0?r.bottom+3:r.top-3);for(var ge;!(ge=Ai(e,H,re),!ge.outside);){if(R<0?re<=0:re>=M.height){ge.hitSide=!0;break}re+=R*5}return ge}var hr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};hr.prototype.init=function(e){var r=this,R=this,L=R.cm,M=R.div=e.lineDiv;Xs(M,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function H(le){for(var ue=le.target;ue;ue=ue.parentNode){if(ue==M)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ue.className))break}return!1}ke(M,"paste",function(le){if(!H(le)||He(L,le)||zs(le,L))return;T<=11&&setTimeout(Yr(L,function(){return r.updateFromDOM()}),20)}),ke(M,"compositionstart",function(le){r.composing={data:le.data,done:!1}}),ke(M,"compositionupdate",function(le){r.composing||(r.composing={data:le.data,done:!1})}),ke(M,"compositionend",function(le){r.composing&&(le.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),ke(M,"touchstart",function(){return R.forceCompositionEnd()}),ke(M,"input",function(){r.composing||r.readFromDOMSoon()});function re(le){if(!H(le)||He(L,le))return;if(L.somethingSelected())po({lineWise:!1,text:L.getSelections()}),le.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ue=Vs(L);po({lineWise:!0,text:ue.text}),le.type=="cut"&&L.operation(function(){L.setSelections(ue.ranges,0,oe),L.replaceSelection("",null,"cut")})}else return;if(le.clipboardData){le.clipboardData.clearData();var ge=Vi.text.join(` `);if(le.clipboardData.setData("Text",ge),le.clipboardData.getData("Text")==ge){le.preventDefault();return}}var We=Ys(),Ge=We.firstChild;L.display.lineSpace.insertBefore(We,L.display.lineSpace.firstChild),Ge.value=Vi.text.join(` `);var ot=document.activeElement;ne(Ge),setTimeout(function(){L.display.lineSpace.removeChild(We),ot.focus(),ot==M&&R.showPrimarySelection()},50)}ke(M,"copy",re),ke(M,"cut",re)},hr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},hr.prototype.prepareSelection=function(){var e=An(this.cm,!1);return e.focus=document.activeElement==this.div,e},hr.prototype.showSelection=function(e,r){if(!e||!this.cm.display.view.length)return;(e.focus||r)&&this.showPrimarySelection(),this.showMultipleSelections(e)},hr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},hr.prototype.showPrimarySelection=function(){var e=this.getSelection(),r=this.cm,R=r.doc.sel.primary(),L=R.from(),M=R.to();if(r.display.viewTo==r.display.viewFrom||L.line>=r.display.viewTo||M.line=r.display.viewFrom&&Js(r,L)||{node:le[0].measure.map[2],offset:0},ge=M.linee.firstLine()&&(L=it(L.line-1,J(e.doc,L.line-1).length)),M.ch==J(e.doc,M.line).text.length&&M.liner.viewTo-1)return!1;var H,re,le;L.line==r.viewFrom||(H=Gr(e,L.line))==0?(re=ze(r.view[0].line),le=r.view[0].node):(re=ze(r.view[H].line),le=r.view[H-1].node.nextSibling);var ue=Gr(e,M.line),ge,We;if(ue==r.view.length-1?(ge=r.viewTo-1,We=r.lineDiv.lastChild):(ge=ze(r.view[ue+1].line)-1,We=r.view[ue+1].node.previousSibling),!le)return!1;for(var Ge=e.doc.splitLines(nu(e,le,We,re,ge)),ot=te(e.doc,it(re,0),it(ge,J(e.doc,ge).text.length));Ge.length>1&&ot.length>1;)if(Fe(Ge)==Fe(ot))Ge.pop(),ot.pop(),ge--;else if(Ge[0]==ot[0])Ge.shift(),ot.shift(),re++;else break;for(var tt=0,bt=0,Ot=Ge[0],Mt=ot[0],Wt=Math.min(Ot.length,Mt.length);ttL.ch&&Yt.charCodeAt(Yt.length-bt-1)==Kt.charCodeAt(Kt.length-bt-1);)tt--,bt++;Ge[Ge.length-1]=Yt.slice(0,Yt.length-bt).replace(/^\u200b+/,""),Ge[0]=Ge[0].slice(tt).replace(/\u200b+$/,"");var bn=it(re,tt),dn=it(ge,ot.length?Fe(ot).length-bt:0);if(Ge.length>1||Ge[0]||Tt(bn,dn))return Ca(e.doc,Ge,bn,dn,"+input"),!0},hr.prototype.ensurePolled=function(){this.forceCompositionEnd()},hr.prototype.reset=function(){this.forceCompositionEnd()},hr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},hr.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},hr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Li(this.cm,function(){return Mr(e.cm)})},hr.prototype.setUneditable=function(e){e.contentEditable="false"},hr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Yr(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},hr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},hr.prototype.onContextMenu=function(){},hr.prototype.resetPosition=function(){},hr.prototype.needsContentAttribute=!0;function Js(e,r){var R=sr(e,r.line);if(!R||R.hidden)return null;var L=J(e.doc,r.line),M=Ut(R,L,r.line),H=at(L,e.doc.direction),re="left";if(H){var le=me(H,r.ch);re=le%2?"right":"left"}var ue=on(M.map,r.ch,re);return ue.offset=ue.collapse=="right"?ue.end:ue.start,ue}function tu(e){for(var r=e;r;r=r.parentNode)if(/CodeMirror-gutter-wrapper/.test(r.className))return!0;return!1}function Da(e,r){return r&&(e.bad=!0),e}function nu(e,r,R,L,M){var H="",re=!1,le=e.doc.lineSeparator(),ue=!1;function ge(tt){return function(bt){return bt.id==tt}}function We(){re&&(H+=le,ue&&(H+=le),re=ue=!1)}function Ge(tt){tt&&(We(),H+=tt)}function ot(tt){if(tt.nodeType==1){var bt=tt.getAttribute("cm-text");if(bt){Ge(bt);return}var Ot=tt.getAttribute("cm-marker"),Mt;if(Ot){var Wt=e.findMarks(it(L,0),it(M+1,0),ge(+Ot));Wt.length&&(Mt=Wt[0].find(0))&&Ge(te(e.doc,Mt.from,Mt.to).join(le));return}if(tt.getAttribute("contenteditable")=="false")return;var Yt=/^(pre|div|p|li|table|br)$/i.test(tt.nodeName);if(!/^br$/i.test(tt.nodeName)&&tt.textContent.length==0)return;Yt&&We();for(var Kt=0;Kt=9&&r.hasSelection&&(r.hasSelection=null),R.poll()}),ke(M,"paste",function(re){if(He(L,re)||zs(re,L))return;L.state.pasteIncoming=+new Date,R.fastPoll()});function H(re){if(He(L,re))return;if(L.somethingSelected())po({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var le=Vs(L);po({lineWise:!0,text:le.text}),re.type=="cut"?L.setSelections(le.ranges,null,oe):(R.prevInput="",M.value=le.text.join(` `),ne(M))}else return;re.type=="cut"&&(L.state.cutIncoming=+new Date)}ke(M,"cut",H),ke(M,"copy",H),ke(e.scroller,"paste",function(re){if(ir(e,re)||He(L,re))return;if(!M.dispatchEvent){L.state.pasteIncoming=+new Date,R.focus();return}var le=new Event("paste");le.clipboardData=re.clipboardData,M.dispatchEvent(le)}),ke(e.lineSpace,"selectstart",function(re){ir(e,re)||he(re)}),ke(M,"compositionstart",function(){var re=L.getCursor("from");R.composing&&R.composing.range.clear(),R.composing={start:re,range:L.markText(re,L.getCursor("to"),{className:"CodeMirror-composing"})}}),ke(M,"compositionend",function(){R.composing&&(R.poll(),R.composing.range.clear(),R.composing=null)})},Ir.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Ir.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ir.prototype.prepareSelection=function(){var e=this.cm,r=e.display,R=e.doc,L=An(e);if(e.options.moveInputWithCursor){var M=$n(e,R.sel.primary().head,"div"),H=r.wrapper.getBoundingClientRect(),re=r.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,M.top+re.top-H.top)),L.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,M.left+re.left-H.left))}return L},Ir.prototype.showSelection=function(e){var r=this.cm,R=r.display;o(R.cursorDiv,e.cursors),o(R.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ir.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var r=this.cm;if(r.somethingSelected()){this.prevInput="";var R=r.getSelection();this.textarea.value=R,r.state.focused&&ne(this.textarea),C&&T>=9&&(this.hasSelection=R)}else e||(this.prevInput=this.textarea.value="",C&&T>=9&&(this.hasSelection=null))},Ir.prototype.getField=function(){return this.textarea},Ir.prototype.supportsTouch=function(){return!1},Ir.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ir.prototype.blur=function(){this.textarea.blur()},Ir.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ir.prototype.receivedFocus=function(){this.slowPoll()},Ir.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ir.prototype.fastPoll=function(){var e=!1,r=this;r.pollingFast=!0;function R(){var L=r.poll();!L&&!e?(e=!0,r.polling.set(60,R)):(r.pollingFast=!1,r.slowPoll())}r.polling.set(20,R)},Ir.prototype.poll=function(){var e=this,r=this.cm,R=this.textarea,L=this.prevInput;if(this.contextMenuPending||!r.state.focused||ut(R)&&!L&&!this.composing||r.isReadOnly()||r.options.disableInput||r.state.keySeq)return!1;var M=R.value;if(M==L&&!r.somethingSelected())return!1;if(C&&T>=9&&this.hasSelection===M||t&&/[\uf700-\uf7ff]/.test(M))return r.display.input.reset(),!1;if(r.doc.sel==r.display.selForContextMenu){var H=M.charCodeAt(0);if(H==8203&&!L&&(L="\u200B"),H==8666)return this.reset(),this.cm.execCommand("undo")}for(var re=0,le=Math.min(L.length,M.length);re1e3||M.indexOf(` `)>-1?R.value=e.prevInput="":e.prevInput=M,e.composing&&(e.composing.range.clear(),e.composing.range=r.markText(e.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ir.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ir.prototype.onKeyPress=function(){C&&T>=9&&(this.hasSelection=null),this.fastPoll()},Ir.prototype.onContextMenu=function(e){var r=this,R=r.cm,L=R.display,M=r.textarea;r.contextMenuPending&&r.contextMenuPending();var H=pi(R,e),re=L.scroller.scrollTop;if(!H||l)return;var le=R.options.resetSelectionOnContextMenu;le&&R.doc.sel.contains(H)==-1&&Yr(R,si)(R.doc,sa(H),oe);var ue=M.style.cssText,ge=r.wrapper.style.cssText,We=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",M.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px; z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ge;h&&(Ge=window.scrollY),L.input.focus(),h&&window.scrollTo(null,Ge),L.input.reset(),R.somethingSelected()||(M.value=r.prevInput=" "),r.contextMenuPending=tt,L.selForContextMenu=R.doc.sel,clearTimeout(L.detectingSelectAll);function ot(){if(M.selectionStart!=null){var Ot=R.somethingSelected(),Mt="\u200B"+(Ot?M.value:"");M.value="\u21DA",M.value=Mt,r.prevInput=Ot?"":"\u200B",M.selectionStart=1,M.selectionEnd=Mt.length,L.selForContextMenu=R.doc.sel}}function tt(){if(r.contextMenuPending!=tt)return;if(r.contextMenuPending=!1,r.wrapper.style.cssText=ge,M.style.cssText=ue,C&&T<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=re),M.selectionStart!=null){(!C||C&&T<9)&&ot();var Ot=0,Mt=function(){L.selForContextMenu==R.doc.sel&&M.selectionStart==0&&M.selectionEnd>0&&r.prevInput=="\u200B"?Yr(R,ps)(R):Ot++<10?L.detectingSelectAll=setTimeout(Mt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(Mt,200)}}if(C&&T>=9&&ot(),_){xe(e);var bt=function(){Ze(window,"mouseup",bt),setTimeout(tt,20)};ke(window,"mouseup",bt)}else setTimeout(tt,50)},Ir.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ir.prototype.setUneditable=function(){},Ir.prototype.needsContentAttribute=!1;function iu(e,r){if(r=r?G(r):{},r.value=e.value,!r.tabindex&&e.tabIndex&&(r.tabindex=e.tabIndex),!r.placeholder&&e.placeholder&&(r.placeholder=e.placeholder),r.autofocus==null){var R=I();r.autofocus=R==e||e.getAttribute("autofocus")!=null&&R==document.body}function L(){e.value=le.getValue()}var M;if(e.form&&(ke(e.form,"submit",L),!r.leaveSubmitMethodAlone)){var H=e.form;M=H.submit;try{var re=H.submit=function(){L(),H.submit=M,H.submit(),H.submit=re}}catch(ue){}}r.finishInit=function(ue){ue.save=L,ue.getTextArea=function(){return e},ue.toTextArea=function(){ue.toTextArea=isNaN,L(),e.parentNode.removeChild(ue.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",L),!r.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=M))}},e.style.display="none";var le=Tr(function(ue){return e.parentNode.insertBefore(ue,e.nextSibling)},r);return le}function au(e){e.off=Ze,e.on=ke,e.wheelEventPixels=fl,e.Doc=xi,e.splitLines=st,e.countColumn=X,e.findColumn=we,e.isWordChar=Ie,e.Pass=ie,e.signal=Ve,e.Line=hi,e.changeEnd=la,e.scrollbarModel=zo,e.Pos=it,e.cmpPos=Tt,e.modes=ct,e.mimeModes=et,e.resolveMode=lt,e.getMode=gt,e.modeExtensions=kt,e.extendMode=zt,e.copyState=$t,e.startState=de,e.innerMode=Se,e.commands=$a,e.keyMap=ea,e.keyName=Rs,e.isModifierKey=As,e.lookupKey=Aa,e.normalizeKeyMap=kl,e.StringStream=W,e.SharedTextMarker=Va,e.TextMarker=ca,e.LineWidget=Ga,e.e_preventDefault=he,e.e_stopPropagation=be,e.e_stop=xe,e.addClass=F,e.contains=D,e.rmClass=g,e.keyNames=da}Jl(Tr),eu(Tr);var ou="iter insert remove copy getEditor constructor".split(" ");for(var vo in xi.prototype)xi.prototype.hasOwnProperty(vo)&&K(ou,vo)<0&&(Tr.prototype[vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(xi.prototype[vo]));return Oe(xi),Tr.inputStyles={textarea:Ir,contenteditable:hr},Tr.defineMode=function(e){!Tr.defaults.mode&&e!="null"&&(Tr.defaults.mode=e),At.apply(this,arguments)},Tr.defineMIME=Ct,Tr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Tr.defineMIME("text/plain","null"),Tr.defineExtension=function(e,r){Tr.prototype[e]=r},Tr.defineDocExtension=function(e,r){xi.prototype[e]=r},Tr.fromTextArea=iu,au(Tr),Tr.version="5.58.2",Tr})},W7jJ:function(Je,Ke,B){"use strict";B.r(Ke);var ae=B("0Owb"),Q=B("PpiC"),U=B("OaEy"),w=B("2fM7"),P=B("T2oS"),S=B("W9HT"),C=B("miYZ"),T=B("tsqr"),h=B("2qtc"),p=B("kLXV"),f=B("9og8"),l=B("tJVT"),a=B("k1fw"),c=B("aHsQ"),s=B("sGsY"),u=B("WmNS"),i=B.n(u),n=B("cDcd"),t=B.n(n),d=B("Fvcw"),v=B("GIiI"),b=B("Ty5D"),y=B("9kvl"),_=B("55Ip"),m=B("7qur"),g=B("cDPC"),E=B("m3rI"),o=B("RCxd"),x=B("EHPI"),A=B("J66h"),O=B("uMZB"),D=B.n(O),I=B("sNtx"),F=B("RpDr"),z=B("+L6B"),ne=B("2/Rp"),j=B("y8nQ"),G=B("Vl3Y"),X=B("5NDa"),Z=B("5rEg"),K=Z.a.TextArea,q=5e3,ie=function(nt){var pt=nt.callback,Pt=nt.onCancel,Dt=nt.notes;function Ht(jt){pt(jt)}return t.a.createElement(G.a,{className:"note-form-panel",onFinish:Ht,initialValues:{notes:Dt}},t.a.createElement(G.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:q,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(q)}]},t.a.createElement(K,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),t.a.createElement(G.a.Item,{style:{textAlign:"right"}},t.a.createElement(ne.a,{type:"ghost",onClick:Pt,style:{marginRight:10}}," \u53D6\u6D88 "),t.a.createElement(ne.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},oe=B("ZsLC"),ye=B.n(oe),pe=B("DjyN"),we=B("NUBc"),fe=B("g9YV"),Te=B("wCAj"),Fe=B("Hw79"),De=B.n(Fe),Me=B("ye1Q"),Ue=B("lfch"),ve=B("bdLU"),ce=B("1vsH"),Ie=B("wd/R"),Ne=B.n(Ie),Xe=Te.a.Column,ee=function(nt){var pt=nt.submitResult,Pt=nt.submitting,Dt=nt.submitRecords,Ht=nt.page,jt=nt.onPageChange,ht=nt.topicId,ft=pt||{},Ft=ft.status,vt=ft.id,Zt=ft.input,Rt=ft.output,rn=ft.expected_output,Fn=ft.is_file,wn=ft.input_file_url,vn=ft.output_file_url,zn=ft.expected_output_file_url,Tn=ft.error_msg,Bn=Dt||{},In=Bn.records,ir=Bn.records_count,Vn=Object(b.i)();function cr(){Fn?navigator.clipboard.writeText(A.Base64.decode(Tn)).then(function(){T.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(A.Base64.decode(Rt)).then(function(){T.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return t.a.createElement(S.a,{spinning:Pt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:t.a.createElement(Me.a,{style:{fontSize:24},spin:!0})},vt?t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:De.a.info},t.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",t.a.createElement("span",{className:Ft===ve.a.OK?"c-green":"c-red"},F.a[Ft])),t.a.createElement("li",{className:De.a.error},t.a.createElement("a",{onClick:cr},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",t.a.createElement(Ue.a,null)," ")),t.a.createElement("li",null,t.a.createElement(_.a,{to:"/problems/".concat(ht,"/record-detail/").concat(vt,"?backId=").concat(Vn==null?void 0:Vn.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Ft!==ve.a.OK?t.a.createElement(t.a.Fragment,null,t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),t.a.createElement("pre",null,!Fn&&Zt,Fn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(ce.y)(wn,Zt)}},Zt)),t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,(Ft===4||Ft===5)&&A.Base64.decode(Tn),Ft!=4&&Ft!=5&&(Fn?t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(ce.y)(vn,Rt)}},Rt):A.Base64.decode(Rt))),t.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,!Fn&&A.Base64.decode(rn),Fn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(ce.y)(zn,rn)}},rn))):null):null,(In==null?void 0:In.length)>0?t.a.createElement(Te.a,{dataSource:In,rowKey:"id",pagination:!1},t.a.createElement(Xe,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(er,Dn){return t.a.createElement("span",null," ",Ne()(er).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(Xe,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(er,Dn){var Qn;return t.a.createElement(_.a,{className:er===0?"c-green":"c-red",to:"/problems/".concat(ht,"/record-detail/").concat(Dn.id,"?backId=").concat(Vn==null?void 0:Vn.save_identifier)},(Qn=F.a[er])===null||Qn===void 0?void 0:Qn.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),t.a.createElement(Xe,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),t.a.createElement(Xe,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),t.a.createElement(Xe,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,ir>15?t.a.createElement(we.a,{className:De.a.pagination,current:Ht,pageSize:15,total:ir,onChange:jt}):null)},k=B("BdwD"),N=B("DYRE"),$=B("zeV3"),V=B("+BJd"),Y=B("mr32"),me=B("TcMa"),Ae=B.n(me),at=B("9Bee"),Le={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ke=function(nt){var pt=nt.hack,Pt=nt.onTriggerPraise,Dt=nt.toDiscuss,Ht=pt.language,jt=pt.difficulty,ht=pt.time_limit,ft=pt.username,Ft=pt.user_path,vt=pt.user_praise,Zt=pt.comments_count,Rt=pt.praises_count,rn=pt.description,Fn=pt.pass_count,wn=pt.submit_count,vn=Object(b.h)();console.log(pt.language,"language");var zn=Le[jt];return t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:Ae.a.info},t.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",t.a.createElement(Y.a,{color:zn.color},zn.name)),t.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",t.a.createElement("b",null,ht,"\u79D2"))),t.a.createElement(at.a,{value:rn,className:Ae.a.desc}),t.a.createElement("ul",{className:Ae.a["commit-info"]},t.a.createElement("li",null,t.a.createElement($.a,{size:4},t.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",t.a.createElement("b",null,Fn))),t.a.createElement("li",null,t.a.createElement($.a,{size:4},t.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",t.a.createElement("b",null,wn))," "),t.a.createElement("li",{style:{flex:"1 0 0"}}),t.a.createElement("li",null,t.a.createElement($.a,{size:4},t.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Dt})," ",t.a.createElement("b",null,Zt))," ")))},Ye=B("dhSg"),Ze=B("ps8w"),Ve=B.n(Ze),He=B("oBTY"),Pe=B("M8RZ"),Re=B("OkW/"),Oe=B("ErOA");function he(nt){return Object(Oe.c)("comments.json",nt)}function be(nt){return Object(Oe.f)("/discusses/".concat(nt,"/plus.json"),{container_type:"Discuss",type:1})}function Ce(nt){return Object(Oe.f)("comments/reply.json",nt)}function xe(nt){return Object(Oe.f)("comments.json",nt)}function Be(nt){return Object(Oe.f)("comments/".concat(nt==null?void 0:nt.id,"/hidden.json"),nt)}function Qe(nt){return Object(Oe.b)("comments/".concat(nt==null?void 0:nt.id,".json"))}var rt=B("GgEA"),dt=B("AMnG"),xt=B("xKgJ");function _t(nt){var pt=nt.author;return t.a.createElement("a",{href:"/users/".concat(pt.login),target:"_blank"},t.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(E.a.IMG_SERVER,"/images/").concat(pt.image_url),width:"50"}))}function wt(nt){var pt=nt.data,Pt=nt.index,Dt=nt.parentDiscussIndex,Ht=nt.user,jt=nt.onSetActionType,ht=pt.author,ft=pt.can_delete,Ft=pt.content,vt=pt.id,Zt=pt.time;function Rt(){jt({id:vt,index:Pt,type:"delete-discuss",parentDiscussIndex:Dt,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var rn=Ht.admin||ft||ht.user_id===Ht.user_id;return t.a.createElement("div",{className:"discuss-item-container second-discuss "},t.a.createElement(_t,{author:ht}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(ht.login),target:"_blank"},ht.name),t.a.createElement("span",{className:"grey"},Zt),t.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},rn?t.a.createElement("a",{onClick:Rt,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),t.a.createElement(at.a,{className:"discuss-content",value:Ft})))}var st=function(nt){var pt=nt.user,Pt=nt.data,Dt=nt.index,Ht=nt.onPlusDiscuss,jt=nt.onSetActionType,ht=nt.activeDiscussIndex,ft=nt.onReplyDiscuss,Ft=nt.onSetActiveDiscussIndex,vt=Pt.content,Zt=Pt.children,Rt=Pt.hidden,rn=Pt.id,Fn=Pt.praise_count,wn=Pt.time,vn=Pt.user_praise,zn=Pt.can_delete,Tn=Pt.author;console.log(zn&&(!Zt||Zt.length==0),"children22");function Bn(){Ft(rn)}function In(){Ht(rn,!vn,Dt)}function ir(){jt({id:rn,index:Dt,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Vn(){jt({id:rn,index:Dt,params:{hidden:Rt?"0":"1"},type:"hidden-discuss",message:Rt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var cr=pt.admin||pt.user_id===Tn.user_id;return t.a.createElement("div",{className:"discuss-item-container",key:rn},t.a.createElement(_t,{author:Tn}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Tn.login),target:"_blank"}," ",Tn.name," "),t.a.createElement("span",{className:"grey"},wn)),t.a.createElement(at.a,{className:"discuss-content",value:vt}),Zt&&Zt.length>0?t.a.createElement("div",{className:"reply-discuss-container"},Zt.map(function(vr,er){return t.a.createElement(wt,{key:vr.id,data:vr,index:er,user:pt,onSetActionType:jt,parentDiscussIndex:Dt})})):null,t.a.createElement("div",{className:"btn-group"},Object(xt.v)()?t.a.createElement("a",{onClick:Vn,title:Rt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},t.a.createElement("i",{className:Rt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,zn&&(!Zt||Zt.length==0)?t.a.createElement("a",{onClick:ir,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null,t.a.createElement("a",{onClick:Bn,title:"\u56DE\u590D"}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," "),t.a.createElement("a",{onClick:In,className:vn?"c-orange":""},t.a.createElement("i",{className:vn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),t.a.createElement("span",null,Fn||""))),t.a.createElement(dt.a,{id:rn,activeDiscussIndex:ht,onReplyDiscuss:ft})))},ut=B("kaH+"),$e=B("Wx9E"),_e=B("Ot1p"),je=function(nt){var pt=nt.user_praise,Pt=nt.praise_count,Dt=nt.praisePlus,Ht=nt.onCreateDiscuss,jt=nt.discuss_count,ht=Object(n.useState)(!1),ft=Object(l.a)(ht,2),Ft=ft[0],vt=ft[1],Zt=Object(n.useState)(""),Rt=Object(l.a)(Zt,2),rn=Rt[0],Fn=Rt[1];function wn(In){Fn(In)}function vn(){vt(!0)}function zn(){vt(!1)}function Tn(){return Bn.apply(this,arguments)}function Bn(){return Bn=Object(f.a)(i.a.mark(function In(){return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:Ht(rn),Fn(""),vt(!1);case 3:case"end":return Vn.stop()}},In)})),Bn.apply(this,arguments)}return t.a.createElement("div",{className:"dis-input-editor-container ".concat(Ft?"active":""," ")},t.a.createElement("div",{className:Ft?"text-area hide":"text-area"},t.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:vn}),t.a.createElement("a",{style:{alignItems:"center"}}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",jt," "),t.a.createElement("a",{className:"c-light-black",onClick:Dt,style:{alignItems:"center"},title:pt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},t.a.createElement("i",{className:"mr3 ".concat(pt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Pt?t.a.createElement("span",null,Pt):"")),Ft?t.a.createElement("div",{className:"input-mask",onClick:zn}):null,t.a.createElement("div",{className:Ft?"md-container":"md-container hide"},t.a.createElement(_e.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:rn,height:240,onChange:wn}),t.a.createElement("div",{className:"tip-container",onClick:zn},t.a.createElement("a",{className:"btn-send",onClick:Tn}," \u53D1\u9001 "))))},ct={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},et;(function(nt){nt[nt.GET_DISCUSSES=0]="GET_DISCUSSES",nt[nt.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",nt[nt.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",nt[nt.PLUS_DISCUSS=3]="PLUS_DISCUSS",nt[nt.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",nt[nt.SET_PAGE=5]="SET_PAGE",nt[nt.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(et||(et={}));function At(nt,pt){switch(pt.type){case et.SHOW_DISCUSSES_LOADING:return Object(a.a)(Object(a.a)({},nt),{},{loading:!0});case et.GET_DISCUSSES:return Object(a.a)(Object(a.a)({},nt),pt.payload);case et.TOP_OR_DOWN_DISCUSS:return Object(a.a)(Object(a.a)({},nt),pt.payload);case et.SET_ACTION_TYPE:return Object(a.a)(Object(a.a)({},nt),pt.payload);case et.PLUS_DISCUSS:return Object(a.a)(Object(a.a)({},nt),pt.payload);case et.SET_PAGE:return Object(a.a)(Object(a.a)({},nt),{},{page:pt.payload});case et.ACTIVE_DISCUSS_INDEX:return Object(a.a)(Object(a.a)({},nt),pt.payload);default:throw new Error}}var Ct=function(nt){var pt=nt.user,Pt=nt.identifier,Dt=nt.hack,Ht=nt.onTriggerPraise,jt=nt.setDiscussTotal,ht=Object(n.useReducer)(At,ct),ft=Object(l.a)(ht,2),Ft=ft[0],vt=ft[1],Zt=Ft.loading,Rt=Ft.page,rn=Ft.data,Fn=Ft.count,wn=Ft.actionType,vn=Ft.activeDiscussIndex,zn=Object(n.useCallback)(Object(f.a)(i.a.mark(function cn(){var tr,sr,qn;return i.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return vt({type:et.SHOW_DISCUSSES_LOADING}),Wn.next=3,he({container_type:"Practice",container_identifier:Pt,limit:10,page:Rt});case 3:tr=Wn.sent,sr=tr.comments,qn=tr.disscuss_count,vt({type:et.GET_DISCUSSES,payload:{data:sr,count:qn,loading:!1}}),jt(qn);case 7:case"end":return Wn.stop()}},cn)})),[Rt,Pt]);Object(n.useEffect)(function(){zn()},[Pt,Rt]);function Tn(cn){vt({type:et.SET_PAGE,page:cn})}function Bn(cn){vt({type:et.SET_ACTION_TYPE,payload:{actionType:cn}})}function In(cn){vn===cn?vt({type:et.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):vt({type:et.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:cn}})}function ir(cn,tr,sr){return Vn.apply(this,arguments)}function Vn(){return Vn=Object(f.a)(i.a.mark(function cn(tr,sr,qn){var Cn;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.prev=0,on.next=3,be(tr);case 3:Cn=on.sent,rn[qn].user_praise=sr,rn[qn].praise_count=Cn.praise_count,vt({type:et.PLUS_DISCUSS,payload:{data:Object(He.a)(rn)}}),on.next=12;break;case 9:on.prev=9,on.t0=on.catch(0),console.log(on.t0);case 12:case"end":return on.stop()}},cn,null,[[0,9]])})),Vn.apply(this,arguments)}function cr(){return vr.apply(this,arguments)}function vr(){return vr=Object(f.a)(i.a.mark(function cn(){var tr,sr,qn,Cn,Wn;return i.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(tr=wn.id,sr=wn.params,qn=wn.type,Cn=wn.index,Wn=wn.parentDiscussIndex,!(qn==="hidden-discuss")){_n.next=7;break}return console.log(sr,"params"),_n.next=5,Be(Object(a.a)({id:tr,container_type:"Practice",container_identifier:Pt},sr));case 5:Wn?rn[Wn].children[Cn].hidden=sr.hidden==1:rn[Cn].hidden=sr.hidden==1,vt({type:et.SET_ACTION_TYPE,payload:{actionType:null,data:Object(He.a)(rn)}});case 7:if(!(qn==="delete-discuss")){_n.next=13;break}return _n.next=10,Qe({id:tr,container_type:"Practice",container_identifier:Pt});case 10:return vt({type:et.SET_ACTION_TYPE,payload:{actionType:null}}),_n.next=13,zn();case 13:case"end":return _n.stop()}},cn)})),vr.apply(this,arguments)}function er(){vt({type:et.SET_ACTION_TYPE,payload:{actionType:null}})}function Dn(cn,tr){return Qn.apply(this,arguments)}function Qn(){return Qn=Object(f.a)(i.a.mark(function cn(tr,sr){return i.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.prev=0,Cn.next=3,Ce({container_type:"Practice",container_identifier:Pt,comments:{content:sr,parent_id:tr}});case 3:zn(),Cn.next=9;break;case 6:Cn.prev=6,Cn.t0=Cn.catch(0),console.log(Cn.t0);case 9:case"end":return Cn.stop()}},cn,null,[[0,6]])})),Qn.apply(this,arguments)}function Pn(cn){return Ut.apply(this,arguments)}function Ut(){return Ut=Object(f.a)(i.a.mark(function cn(tr){return i.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return vt({type:et.SHOW_DISCUSSES_LOADING}),qn.next=3,xe({comments:{content:tr},container_type:"Practice",container_identifier:Pt});case 3:zn();case 4:case"end":return qn.stop()}},cn)})),Ut.apply(this,arguments)}return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:"discuss-panel"},rn.length===0?t.a.createElement(k.a,null):rn.map(function(cn,tr){return t.a.createElement(st,{onReplyDiscuss:Dn,onPlusDiscuss:ir,onSetActiveDiscussIndex:In,onSetActionType:Bn,data:cn,index:tr,user:pt,activeDiscussIndex:vn})}),Fn>10?t.a.createElement("div",{className:"pagination-container"},t.a.createElement(we.a,{showQuickJumper:!0,onChange:Tn,current:Rt,total:Fn})):null),t.a.createElement(je,{user_praise:Dt.user_praise,praise_count:Dt.praises_count,praisePlus:Ht,discuss_count:Dt.comments_count,onCreateDiscuss:Pn}),t.a.createElement(Pe.a,null,t.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!wn,onOk:cr,onCancel:er},t.a.createElement("p",null,wn?wn.message:"")),t.a.createElement(ut.a,null)))},lt=B("1FX+"),gt=B.n(lt),kt=B("pYxM"),zt=B.n(kt),$t=B("sB/4"),Se=B.n($t),de=B("Wtmd"),W=B.n(de),J=B("CNDd"),te=B.n(J),se=B("nCk5"),Ee=B.n(se),ze=B("kovY"),qe=B.n(ze),St=function(pt){var Pt=pt.style,Dt=Pt===void 0?{}:Pt,Ht=pt.onClick,jt=pt.onAssist,ht=pt.onHide,ft=pt.data,Ft=pt.active,vt=pt.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:Ft===(ft==null?void 0:ft.id)?"".concat(zt.a.list," ").concat(zt.a.active):zt.a.list,style:Dt,onClick:function(){return Ht(ft)}},(ft==null?void 0:ft.video)&&t.a.createElement("div",{className:zt.a.left},t.a.createElement("img",{src:ft==null?void 0:ft.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Se.a}),t.a.createElement("span",null,ft==null?void 0:ft.video_duration)),t.a.createElement("div",{className:zt.a.mask})),t.a.createElement("div",{className:zt.a.right},t.a.createElement("div",{className:zt.a.name},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(ft==null?void 0:ft.image_url),width:30,height:30}),t.a.createElement("div",{title:ft==null?void 0:ft.name,className:zt.a.title},ft==null?void 0:ft.name),(ft==null?void 0:ft.is_authority)&&t.a.createElement("div",{className:zt.a.b},"\u5B98\u65B9"),(ft==null?void 0:ft.is_excellent)&&t.a.createElement("div",{className:zt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:zt.a.des},t.a.createElement(at.a,{showLines:2,showTextOnly:!0,value:(ft==null?void 0:ft.content)||"\u6682\u65E0\u5185\u5BB9"})),t.a.createElement("div",{className:zt.a.tag},t.a.createElement("span",{className:"current",onClick:function(Rt){Rt.stopPropagation(),jt(ft)}},t.a.createElement("img",{src:ft!=null&&ft.user_liker?te.a:W.a}),t.a.createElement("span",{style:{color:ft!=null&&ft.user_liker?"#0152d9":"#656f87"}},ft==null?void 0:ft.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ee.a}),t.a.createElement("span",null,ft==null?void 0:ft.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:qe.a}),t.a.createElement("span",null,ft==null?void 0:ft.viewed_count)),Object(xt.v)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Rt){Rt.stopPropagation(),ht(ft)}},ft!=null&&ft.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),vt&&t.a.createElement("div",{className:zt.a.line}))},Lt=St,it=B("5Dmo"),Tt=B("3S7+"),Qt=B("Z8dc"),Et=B.n(Qt),nn=B("Aky1"),Jt=B("7+5b"),It=B.n(Jt),yt=B("twBr"),Sn=B.n(yt),mt=B("oE5q"),ln=B.n(mt),fn=function(pt,Pt){var Dt,Ht,jt,ht=Pt.payload.uploadInfo,ft=ht===void 0?{}:ht;switch(Pt.type){case"addVideo":return{videoList:[].concat(Object(He.a)(pt.videoList),[{name:ft.file.name,size:ft.file.size,type:ft.file.type,fileHash:ft.fileHash,state:ft.state,video_id:ft.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:pt.videoList.filter(function(Ft){return Ft.name!==Pt.payload.name})};case"replaceVideo":return{videoList:Pt.payload};case"removeAll":return[];case"updateProgress":return{videoList:pt.videoList.map(function(Ft){return Ft.name===Pt.payload.uploadInfo.file.name?Object(a.a)(Object(a.a)({},Ft),{loaded:Pt.payload.progressPercent,video_id:ft.videoId,fileHash:ft.fileHash}):Ft})};case"updateTitle":return{videoList:(Dt=pt.videoList)===null||Dt===void 0?void 0:Dt.map(function(Ft){return Ft.name===Pt.payload.item.name?Object(a.a)(Object(a.a)({},Ft),{title:Pt.payload.title}):Ft})};case"updateImg":return{videoList:(Ht=pt.videoList)===null||Ht===void 0?void 0:Ht.map(function(Ft){return Ft.name===Pt.payload.item.name?Object(a.a)(Object(a.a)({},Ft),{attachment_id:Pt.payload.attachment_id}):Ft})};case"updateImg":return{videoList:(jt=pt.videoList)===null||jt===void 0?void 0:jt.map(function(Ft){return Ft.name===Pt.payload.item.name?Object(a.a)(Object(a.a)({},Ft),{attachment_id:Pt.payload.attachment_id}):Ft})};default:return[]}},Zn=function(pt){var Pt,Dt,Ht=pt.onClose,jt=pt.onOk,ht=pt.identifier,ft=pt.active,Ft=G.a.useForm(),vt=Object(l.a)(Ft,1),Zt=vt[0],Rt=Object(n.useState)({}),rn=Object(l.a)(Rt,2),Fn=rn[0],wn=rn[1],vn=Object(n.useState)(!1),zn=Object(l.a)(vn,2),Tn=zn[0],Bn=zn[1],In=Object(n.useState)(!1),ir=Object(l.a)(In,2),Vn=ir[0],cr=ir[1],vr=Object(n.useReducer)(fn,{videoList:[]}),er=Object(l.a)(vr,2),Dn=er[0],Qn=er[1],Pn=Object(xt.x)(),Ut=Object(b.i)(),cn=Object(n.useRef)();Object(n.useEffect)(function(){ft&&tr()},[ft]);var tr=function(){var pn=Object(f.a)(i.a.mark(function On(){var gn,ar,Yn,$n,wr,jr,Ai,zr,Mi,Ki,Hi,ji;return i.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Object(m.k)(ht,{active:ft});case 2:gn=Un.sent,(gn==null?void 0:gn.status)===0&&(jr={name:gn==null||((ar=gn.data)===null||ar===void 0)?void 0:ar.name,content:gn==null||((Yn=gn.data)===null||Yn===void 0)?void 0:Yn.content},Zt.setFieldsValue(jr),wn(jr),gn!=null&&($n=gn.data)!==null&&$n!==void 0&&(wr=$n.videos)!==null&&wr!==void 0&&wr[0]&&Qn({type:"replaceVideo",payload:[{video_id:gn==null||((Ai=gn.data)===null||Ai===void 0||((zr=Ai.videos)===null||zr===void 0||((Mi=zr[0])===null||Mi===void 0)))?void 0:Mi.video_id,name:gn==null||((Ki=gn.data)===null||Ki===void 0||((Hi=Ki.videos)===null||Hi===void 0||((ji=Hi[0])===null||ji===void 0)))?void 0:ji.title,loaded:100}]}));case 4:case"end":return Un.stop()}},On)}));return function(){return pn.apply(this,arguments)}}(),sr=function(On,gn){wn(Object(a.a)({},gn))},qn=function(){var pn=Object(f.a)(i.a.mark(function On(gn){var ar,Yn,$n,wr,jr;return i.a.wrap(function(zr){for(;;)switch(zr.prev=zr.next){case 0:if(Yn={videos:Dn.videoList,articles:gn},cr(!0),!ft){zr.next=9;break}return Yn.active=ft,zr.next=6,Object(m.j)(ht,Yn);case 6:$n=zr.sent,zr.next=12;break;case 9:return zr.next=11,Object(m.a)(ht,Yn);case 11:$n=zr.sent;case 12:((ar=$n)===null||ar===void 0?void 0:ar.status)===0&&(console.log(ft||((wr=$n)===null||wr===void 0?void 0:wr.id),44),jt(ft||((jr=$n)===null||jr===void 0?void 0:jr.id))),cr(!1);case 14:case"end":return zr.stop()}},On)}));return function(gn){return pn.apply(this,arguments)}}(),Cn=function(){var On=document.getElementById("fileUpload");On.value=""},Wn=function(On){var gn='{"Vod":{}}';if(Bn(!0),cn.current){cn.current.addFile(On,null,null,null,gn);return}Object(nn.a)(Pn==null?void 0:Pn.login,"",{create:!cn,addFileSuccess:function(Yn){Qn({type:"addVideo",payload:{uploadInfo:Yn}})},onUploadProgress:function(Yn,$n,wr){var jr=Math.ceil(wr*100);Qn({type:"updateProgress",payload:{uploadInfo:Yn,progressPercent:jr}}),Cn()},onUploadFailed:function(Yn){T.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(Yn){Bn(!1)},onUploadSucceed:function(Yn){Bn(!1)},onUploadError:function(Yn){Bn(!1)},gotUploader:function(Yn){Yn.addFile(On,null,null,null,gn),cn.current=Yn}})},on=function(On){var gn,ar=1024,Yn=On.target.files[0];if(!Yn){Cn();return}var $n=Yn.name.toLowerCase();if($n&&$n.indexOf(".avi")==-1&&$n.indexOf(".flv")==-1&&$n.indexOf(".f4v")==-1&&$n.indexOf(".m4v")==-1&&$n.indexOf(".mov")==-1&&$n.indexOf(".mp4")==-1&&$n.indexOf(".rmvb")==-1&&$n.indexOf(".swf")==-1&&$n.indexOf(".webm")==-1&&$n.indexOf(".wmv")==-1){T.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Cn();return}if(Yn.size>ar*1024*1024){T.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(ar,"M")),Cn();return}if((gn=Dn.videoList)!==null&&gn!==void 0&&gn.find(function(wr){return wr.name===Yn.name})){T.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),Cn();return}Wn(Yn)},_n=function(On,gn){p.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",gn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Cn(),Qn({type:"removeVideo",payload:{name:On}})}})},Nt=function(){return t.a.createElement("label",{htmlFor:"fileUpload",className:Et.a.main},t.a.createElement("img",{src:It.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},Bt=function(On){return t.a.createElement("div",{className:Et.a.mainLoading},t.a.createElement("div",{className:Et.a.proWarp},t.a.createElement("div",{className:Et.a.pro},t.a.createElement("div",{style:{width:On}})),t.a.createElement("span",null,On||0,"%")),t.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),t.a.createElement("div",{className:Et.a.tip},t.a.createElement(Tt.a,{getPopupContainer:function(ar){return ar.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:ln.a,alt:""}))))},Xt=function(On){return t.a.createElement("div",{className:Et.a.mainSucceed},t.a.createElement("img",{src:Sn.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),t.a.createElement("div",{className:Et.a.tip},t.a.createElement(Tt.a,{getPopupContainer:function(ar){return ar.parentNode},title:t.a.createElement("div",null,t.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",t.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),t.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),t.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},t.a.createElement("img",{src:ln.a,alt:""}))),t.a.createElement("div",{className:Et.a.del,onClick:function(){return _n(On.name,On.loaded==100)}},t.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},hn=function(){var On;return t.a.createElement(t.a.Fragment,null,(On=Dn.videoList)===null||On===void 0?void 0:On.map(function(gn,ar){return t.a.createElement(t.a.Fragment,{key:ar},gn.loaded==100?Xt(gn):Bt(gn.loaded))}))},qt=function(){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:Ht})},Nn=(Pt=Dn.videoList)===null||Pt===void 0?void 0:Pt.length;return t.a.createElement("div",{className:Et.a.listForm},t.a.createElement("header",null,ft?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),t.a.createElement("section",{className:Et.a.scroll,id:"sss"},t.a.createElement("div",{className:Et.a.formWrap}," ",t.a.createElement(G.a,{form:Zt,scrollToFirstError:!0,layout:"vertical",onValuesChange:sr,onFinish:qn},t.a.createElement(G.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},t.a.createElement(Z.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Dt=Fn.name)===null||Dt===void 0?void 0:Dt.length)||0,"/60")})),t.a.createElement(G.a.Item,{name:"content",label:"\u5185\u5BB9:"},t.a.createElement(_e.a,{defaultValue:Fn.content||"",watch:!0})))),t.a.createElement("div",{className:Et.a.upload},Nn?hn():Nt(),t.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:on,accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}))),t.a.createElement("div",{className:Et.a.btns},t.a.createElement(ne.a,{onClick:qt,type:"primary",ghost:!0},"\u5173\u95ED"),t.a.createElement(ne.a,{loading:Vn,disabled:Tn,onClick:function(){return Zt.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},rr=Zn,xn=B("cWXX"),Er=B("/ezw"),Cr=B("CaVn"),un=B.n(Cr),Mn=B("s8/Y"),Nr=B.n(Mn),Xr=B("JOrW"),xr=B.n(Xr),ur=B("gqXR"),gr=B.n(ur),gi=B("14J3"),pr=B("BMrR"),yr=B("jCWc"),Or=B("kPKH"),Kr=B("wW8i"),Sr=B.n(Kr),ui=B("MVJL"),Pr=B.n(ui),yi=function(pt){var Pt=pt.id,Dt=pt.cb,Ht=Object(n.useState)(""),jt=Object(l.a)(Ht,2),ht=jt[0],ft=jt[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(_e.a,{defaultValue:ht,id:"writeForumsReviewId",onChange:function(vt){ft(vt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(pr.a,null,t.a.createElement(Or.a,{flex:"1"}),t.a.createElement(Or.a,null,t.a.createElement(ne.a,{type:"primary",size:"large",onClick:Object(f.a)(i.a.mark(function Ft(){return i.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:ht===""?T.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):Dt(Pt,ht);case 1:case"end":return Zt.stop()}},Ft)}))},"\u53D1\u9001"))))},ci=function(pt){var Pt,Dt=pt.data;return t.a.createElement("div",{className:Pr.a.thirdlyLevelDiscuss},t.a.createElement("span",{className:"c-grey-333"},t.a.createElement("span",{className:"font 14 c-light-primary"},Dt==null||((Pt=Dt.author)===null||Pt===void 0)?void 0:Pt.name),"@",t.a.createElement("span",{className:"font 14 c-light-primary"},Dt==null?void 0:Dt.parent_name),":"),t.a.createElement(at.a,{value:Dt==null?void 0:Dt.content}))},ni=function(pt){var Pt,Dt,Ht,jt,ht=pt.data,ft=pt.onReplyDiscuss,Ft=pt.thirdlyReply,vt=pt.setThirdlyReply,Zt=Object(xt.x)();return console.log(Zt,"user"),t.a.createElement("div",{className:Pr.a.list},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(ht==null||((Pt=ht.author)===null||Pt===void 0)?void 0:Pt.image_url)}),t.a.createElement("div",{className:Pr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333"},ht==null||((Dt=ht.author)===null||Dt===void 0)?void 0:Dt.name),(Zt==null?void 0:Zt.login)!==(ht==null||((Ht=ht.author)===null||Ht===void 0)?void 0:Ht.login)&&t.a.createElement("span",{onClick:function(){return vt(ht==null?void 0:ht.id)},className:"c-grey-999 current",style:{float:"right"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),t.a.createElement("span",null,"\u56DE\u590D"))),t.a.createElement(at.a,{value:ht==null?void 0:ht.content}),ht==null||((jt=ht.children)===null||jt===void 0)?void 0:jt.map(function(Rt){return t.a.createElement(ci,{key:Rt.id,data:Rt})}),Ft===(ht==null?void 0:ht.id)&&t.a.createElement("div",null,t.a.createElement(yi,{id:ht==null?void 0:ht.id,cb:ft}),t.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return vt(null)},className:"c-light-primary current"},t.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),t.a.createElement("div",{className:Pr.a.line})))},Di=function(pt){var Pt,Dt,Ht,jt,ht=pt.data,ft=pt.onReplyDiscuss,Ft=pt.secondReply,vt=pt.setSecondReply,Zt=pt.thirdlyReply,Rt=pt.setThirdlyReply,rn=pt.onPlusDiscuss,Fn=Object(n.useState)(!1),wn=Object(l.a)(Fn,2),vn=wn[0],zn=wn[1];return console.log(ht,"data"),t.a.createElement("div",{className:Pr.a.discussItem},t.a.createElement("div",{className:Pr.a.list},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(ht==null||((Pt=ht.author)===null||Pt===void 0)?void 0:Pt.image_url)}),t.a.createElement("div",{className:Pr.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333 mr30"},ht==null||((Dt=ht.author)===null||Dt===void 0)?void 0:Dt.name),t.a.createElement("span",{className:"c-grey-999"},ht==null?void 0:ht.time)),t.a.createElement(at.a,{value:ht==null?void 0:ht.content}),t.a.createElement("div",{className:Pr.a.btns},t.a.createElement("div",{onClick:function(){return rn(ht==null?void 0:ht.id)},className:ht!=null&&ht.user_praise?"c-light-primary":"c-grey-999"},t.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),t.a.createElement("span",null,ht==null?void 0:ht.praise_count)),t.a.createElement("div",{onClick:function(){var Bn;if((ht==null||((Bn=ht.children)===null||Bn===void 0)?void 0:Bn.length)===0)return;vt(null),zn(!vn)},style:{color:vn?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,vn?"\u6536\u8D77\u8BC4\u8BBA":ht==null||((Ht=ht.children)===null||Ht===void 0)?void 0:Ht.length)),t.a.createElement("div",{onClick:function(){zn(!1),vt(Ft===(ht==null?void 0:ht.id)?null:ht==null?void 0:ht.id)},style:{color:Ft===(ht==null?void 0:ht.id)?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),t.a.createElement("span",null,Ft===(ht==null?void 0:ht.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Ft===(ht==null?void 0:ht.id)&&t.a.createElement(yi,{id:ht==null?void 0:ht.id,cb:function(Bn,In){ft(Bn,In),zn(!0)}}),vn&&t.a.createElement("div",{className:Pr.a.secondLevelDiscuss},ht==null||((jt=ht.children)===null||jt===void 0)?void 0:jt.map(function(Tn){return t.a.createElement(ni,{thirdlyReply:Zt,setThirdlyReply:Rt,key:Tn.id,data:Tn,onReplyDiscuss:ft})})))))},Ni=Di,Ui=function(pt){var Pt=pt.identifier,Dt=pt.active,Ht=pt.onOk,jt=Object(n.useState)(""),ht=Object(l.a)(jt,2),ft=ht[0],Ft=ht[1],vt=Object(n.useState)(1),Zt=Object(l.a)(vt,2),Rt=Zt[0],rn=Zt[1],Fn=Object(n.useState)([]),wn=Object(l.a)(Fn,2),vn=wn[0],zn=wn[1],Tn=Object(n.useState)(0),Bn=Object(l.a)(Tn,2),In=Bn[0],ir=Bn[1],Vn=Object(n.useState)(null),cr=Object(l.a)(Vn,2),vr=cr[0],er=cr[1],Dn=Object(n.useState)(null),Qn=Object(l.a)(Dn,2),Pn=Qn[0],Ut=Qn[1];Object(n.useEffect)(function(){cn(1),rn(1)},[Dt]);var cn=function(){var Wn=Object(f.a)(i.a.mark(function on(_n){var Nt;return i.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,he({container_type:"QuestionSolutionArticle",container_identifier:Dt,limit:5,page:_n});case 2:Nt=Xt.sent,Nt!=null&&Nt.comments&&(zn((Nt==null?void 0:Nt.comments)||[]),rn(_n),ir(Nt==null?void 0:Nt.disscuss_count));case 4:case"end":return Xt.stop()}},on)}));return function(_n){return Wn.apply(this,arguments)}}(),tr=function(){var Wn=Object(f.a)(i.a.mark(function on(){var _n;return i.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(!(ft==="")){Bt.next=3;break}return T.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Bt.abrupt("return");case 3:return Bt.next=5,xe({comments:{content:ft},container_type:"QuestionSolutionArticle",container_identifier:Dt});case 5:_n=Bt.sent,_n!=null&&_n.discuss&&(Ft(""),cn(Rt),Ht());case 7:case"end":return Bt.stop()}},on)}));return function(){return Wn.apply(this,arguments)}}(),sr=function(){var Wn=Object(f.a)(i.a.mark(function on(_n,Nt,Bt){var Xt;return i.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Ce({container_type:"QuestionSolutionArticle",container_identifier:Dt,comments:{content:Nt,parent_id:_n}});case 2:Xt=qt.sent,er(null),Ut(null),cn(Rt);case 6:case"end":return qt.stop()}},on)}));return function(_n,Nt,Bt){return Wn.apply(this,arguments)}}(),qn=function(){var Wn=Object(f.a)(i.a.mark(function on(_n){var Nt;return i.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,be(_n);case 2:Nt=Xt.sent,cn(Rt);case 4:case"end":return Xt.stop()}},on)}));return function(_n){return Wn.apply(this,arguments)}}(),Cn=function(on){rn(on),cn(on)};return t.a.createElement("div",{className:Sr.a.discuss},t.a.createElement("aside",{className:Sr.a.reply,style:{borderWidth:In?1:0}},t.a.createElement(_e.a,{defaultValue:ft,id:"writeForumsReviewId",onChange:function(on){Ft(on)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(pr.a,null,t.a.createElement(Or.a,{flex:"1"}),t.a.createElement(Or.a,null,t.a.createElement(ne.a,{type:"primary",size:"large",onClick:function(){return tr()}},"\u53D1\u9001")))),vn==null?void 0:vn.map(function(Wn){return t.a.createElement(Ni,{secondReply:vr,setSecondReply:er,thirdlyReply:Pn,setThirdlyReply:Ut,key:Wn.id,data:Wn,onReplyDiscuss:sr,onPlusDiscuss:qn})}),t.a.createElement(we.a,{className:Sr.a.pagination,showTotal:function(on){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},on),"\u6761\u6570\u636E")},current:Rt,onChange:Cn,total:In,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},di=Ui,mr=B("hgre"),dr=function(pt){var Pt,Dt,Ht,jt,ht,ft,Ft,vt,Zt,Rt,rn=pt.active,Fn=pt.identifier,wn=pt.onAssist,vn=pt.onEdit,zn=pt.onArticlesSkip,Tn=pt.onClose,Bn=pt.onOk,In=pt.onDelete,ir=pt.detailsIndex,Vn=pt.btnShowStatus,cr=Object(n.useState)(!0),vr=Object(l.a)(cr,2),er=vr[0],Dn=vr[1],Qn=Object(n.useState)({}),Pn=Object(l.a)(Qn,2),Ut=Pn[0],cn=Pn[1];Object(n.useEffect)(function(){rn&&tr()},[rn,ir]);var tr=function(){var on=Object(f.a)(i.a.mark(function _n(){var Nt,Bt,Xt=arguments;return i.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return Nt=Xt.length>0&&Xt[0]!==void 0?Xt[0]:!0,Nt&&Dn(!0),qt.next=4,Object(m.d)(Fn,{active:rn});case 4:Bt=qt.sent,(Bt==null?void 0:Bt.status)===0&&cn((Bt==null?void 0:Bt.data)||{}),Dn(!1);case 7:case"end":return qt.stop()}},_n)}));return function(){return on.apply(this,arguments)}}(),sr=function(){var on=Object(f.a)(i.a.mark(function _n(Nt){var Bt;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(m.g)(Fn,Object(a.a)({active:rn},Nt));case 2:Bt=hn.sent,(Bt==null?void 0:Bt.status)===0&&(tr(!1),Bn());case 4:case"end":return hn.stop()}},_n)}));return function(Nt){return on.apply(this,arguments)}}(),qn=function(){var on=Object(f.a)(i.a.mark(function _n(Nt){var Bt;return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(m.c)(Fn,{active:Nt==null?void 0:Nt.id});case 2:Bt=hn.sent,Bt.status===0&&(tr(!1),Bn());case 4:case"end":return hn.stop()}},_n)}));return function(Nt){return on.apply(this,arguments)}}(),Cn=function(_n){p.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return In(_n)}})},Wn=function(){tr(!1),Bn()};return t.a.createElement("div",{className:un.a.listDetails},t.a.createElement(Er.a,{className:"pt20 pl20 pr20",loading:er,active:!0,paragraph:{rows:5}},t.a.createElement("div",{className:un.a.head},t.a.createElement("div",{className:un.a.name},t.a.createElement("div",{title:Ut==null?void 0:Ut.name,className:un.a.title},Ut==null?void 0:Ut.name),(Ut==null?void 0:Ut.is_authority)&&t.a.createElement("div",{className:un.a.b},"\u5B98\u65B9"),(Ut==null?void 0:Ut.is_excellent)&&t.a.createElement("div",{className:un.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:un.a.tag},t.a.createElement("img",{src:E.a.IMG_SERVER+"/images/"+(Ut==null?void 0:Ut.image_url)}),t.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Ut==null?void 0:Ut.username),t.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",Ne()(Ut==null?void 0:Ut.created_at).format("YYYY-MM-DD")),t.a.createElement("span",null,t.a.createElement("img",{src:W.a}),t.a.createElement("span",null,Ut==null?void 0:Ut.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ee.a}),t.a.createElement("span",null,Ut==null?void 0:Ut.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:qe.a}),t.a.createElement("span",null,Ut==null?void 0:Ut.viewed_count)),t.a.createElement("div",{className:un.a.btn},(Object(xt.v)()||(Ut==null?void 0:Ut.is_self))&&t.a.createElement(t.a.Fragment,null,t.a.createElement(ne.a,{onClick:function(){return Cn(Ut)},type:"primary",ghost:!0},"\u5220\u9664"),t.a.createElement(ne.a,{onClick:function(){return vn(Ut)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(xt.v)()&&t.a.createElement(ne.a,{onClick:function(){return sr({is_authority:!(Ut!=null&&Ut.is_authority)})},type:"primary"},t.a.createElement("img",{src:xr.a}),Ut!=null&&Ut.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(xt.v)()&&t.a.createElement(ne.a,{onClick:function(){return sr({is_excellent:!(Ut!=null&&Ut.is_excellent)})},type:"primary"},t.a.createElement("img",{src:Nr.a}),Ut!=null&&Ut.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),t.a.createElement("div",{className:un.a.scroll},(Ut==null||((Pt=Ut.videos)===null||Pt===void 0||((Dt=Pt[0])===null||Dt===void 0))?void 0:Dt.id)&&t.a.createElement("div",{className:un.a.video},t.a.createElement(S.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Ut!=null&&(Ht=Ut.videos)!==null&&Ht!==void 0&&(jt=Ht[0])!==null&&jt!==void 0&&jt.transcoded)},t.a.createElement(mr.a,{poster:Ut==null||((ht=Ut.videos)===null||ht===void 0||((ft=ht[0])===null||ft===void 0))?void 0:ft.cover_url,src:(Ut==null||((Ft=Ut.videos)===null||Ft===void 0||((vt=Ft[0])===null||vt===void 0))?void 0:vt.play_url)||"",videoId:Ut==null||((Zt=Ut.videos)===null||Zt===void 0||((Rt=Zt[0])===null||Rt===void 0))?void 0:Rt.id,logWatchHistory:function(){}}))),t.a.createElement(at.a,{className:un.a.html,value:(Ut==null?void 0:Ut.content)||""}),t.a.createElement("div",{onClick:function(){return qn(Ut)},className:un.a.g},t.a.createElement("img",{className:"mr10",src:(Ut!=null&&Ut.user_liker,gr.a)}),t.a.createElement("span",null,Ut==null?void 0:Ut.praises_count)),t.a.createElement(di,{onOk:Wn,active:rn,identifier:Fn})),t.a.createElement("div",{className:un.a.btns},t.a.createElement(ne.a,{onClick:function(){return Tn()},type:"primary",ghost:!0},"\u5173\u95ED"),Vn[0]&&t.a.createElement(ne.a,{onClick:function(_n){return zn(_n,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Vn[1]&&t.a.createElement(ne.a,{onClick:function(_n){return zn(_n,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},qr=dr,ri=B("3tLw"),fi=B.n(ri),ii=B("ek7X"),Xi=B("0NbB"),na=function(pt){var Pt=pt.identifier,Dt=pt.tabStatus,Ht=pt.setFilterListTotal,jt=pt.setListStatus,ht={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},ft=Object(n.useState)(Object(a.a)({},ht)),Ft=Object(l.a)(ft,2),vt=Ft[0],Zt=Ft[1],Rt=Object(n.useState)(!1),rn=Object(l.a)(Rt,2),Fn=rn[0],wn=rn[1],vn=Object(n.useState)(0),zn=Object(l.a)(vn,2),Tn=zn[0],Bn=zn[1],In=Object(n.useState)(1),ir=Object(l.a)(In,2),Vn=ir[0],cr=ir[1],vr=Object(n.useState)(null),er=Object(l.a)(vr,2),Dn=er[0],Qn=er[1],Pn=Object(n.useState)([]),Ut=Object(l.a)(Pn,2),cn=Ut[0],tr=Ut[1],sr=Object(n.useState)([!0,!0]),qn=Object(l.a)(sr,2),Cn=qn[0],Wn=qn[1],on=Object(n.useState)(0),_n=Object(l.a)(on,2),Nt=_n[0],Bt=_n[1],Xt=Object(n.useRef)(null);Object(n.useEffect)(function(){wr()},[Dt]),Object(n.useEffect)(function(){hn()},[Dn]),Object(n.useEffect)(function(){Nn(Object(a.a)({},ht)),wr()},[Pt]),Object(n.useEffect)(function(){return window.addEventListener("resize",qt),jt(Nt),function(){window.removeEventListener("resize",qt)}},[Nt]);var hn=function(){var Un=Object(f.a)(i.a.mark(function mn(){var jn,Jn;return i.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if(Dn){Kn.next=3;break}return Wn([!0,!0]),Kn.abrupt("return");case 3:jn=[!0,!0],Jn=cn==null?void 0:cn.findIndex(function(_i){return _i.id===Dn}),Jn===0&&vt.page===1&&(jn[0]=!1),(vt.page-1)*vt.limit+(Jn+1)===vt.total&&(jn[1]=!1),Wn(jn);case 8:case"end":return Kn.stop()}},mn)}));return function(){return Un.apply(this,arguments)}}(),qt=function(){if(Nt){var mn,jn=window.innerWidth-((mn=Xt.current)===null||mn===void 0?void 0:mn.clientWidth);Bn(jn)}},Nn=function(){var Un=Object(f.a)(i.a.mark(function mn(jn){var Jn,Lr,Kn,_i;return i.a.wrap(function(Gr){for(;;)switch(Gr.prev=Gr.next){case 0:return wn(!0),Gr.next=3,Object(m.f)(Pt,jn);case 3:return Jn=Gr.sent,(Jn==null?void 0:Jn.status)===0&&(tr((Jn==null||((Lr=Jn.data)===null||Lr===void 0)?void 0:Lr.articles)||[]),Zt(Object(a.a)(Object(a.a)({},jn),{},{total:Jn==null||((Kn=Jn.data)===null||Kn===void 0)?void 0:Kn.articles_count})),Ht(Jn==null||((_i=Jn.data)===null||_i===void 0)?void 0:_i.articles_count)),wn(!1),Gr.abrupt("return",Jn);case 7:case"end":return Gr.stop()}},mn)}));return function(jn){return Un.apply(this,arguments)}}(),pn=function(){(vt==null?void 0:vt.sort_direction)===null?vt.sort_direction="asc":(vt==null?void 0:vt.sort_direction)==="asc"?vt.sort_direction="desc":(vt==null?void 0:vt.sort_direction)==="desc"&&(vt.sort_direction=null),vt.page=1,wr(),Zt(Object(a.a)({},vt)),Nn(vt)},On=function(){vt.page=1,vt.search=vt==null?void 0:vt.save_search,wr(),Zt(Object(a.a)({},vt)),Nn(vt)},gn=function(){var mn,jn=document.getElementsByClassName("btn-resize");jn[0].style.visibility="hidden";var Jn=window.innerWidth-((mn=Xt.current)===null||mn===void 0?void 0:mn.clientWidth);Bn(Jn)},ar=function(){gn(),Bt(1)},Yn=function(mn){gn(),Qn(mn==null?void 0:mn.id),Bt(3)},$n=function(mn){gn(),Qn(mn==null?void 0:mn.id),Bt(2)},wr=function(){var mn=document.getElementsByClassName("btn-resize");mn[0].style.visibility="visible",Bn(0),Bt(0),Qn(null)},jr=function(mn){Bt(3),Qn(mn),vt.page=1,Zt(Object(a.a)({},vt)),Nn(vt)},Ai=function(mn){Bt(3),Qn(mn),Zt(Object(a.a)({},vt)),Nn(vt)},zr=function(mn){Zt(Object(a.a)({},vt)),Nn(vt)},Mi=function(){var Un=Object(f.a)(i.a.mark(function mn(jn){var Jn;return i.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(m.c)(Pt,{active:jn==null?void 0:jn.id});case 2:Jn=Kn.sent,Jn.status===0&&(Nn(vt),cr(Vn+1));case 4:case"end":return Kn.stop()}},mn)}));return function(jn){return Un.apply(this,arguments)}}(),Ki=function(){var Un=Object(f.a)(i.a.mark(function mn(jn){var Jn;return i.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(m.e)(Pt,{active:jn==null?void 0:jn.id});case 2:Jn=Kn.sent,Jn.status===0&&(Nn(vt),cr(Vn+1));case 4:case"end":return Kn.stop()}},mn)}));return function(jn){return Un.apply(this,arguments)}}(),Hi=function(){var Un=Object(f.a)(i.a.mark(function mn(jn){var Jn;return i.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(m.i)(Pt,{active:jn==null?void 0:jn.id});case 2:Jn=Kn.sent,Jn.status===0&&(wr(),Nn(vt));case 4:case"end":return Kn.stop()}},mn)}));return function(jn){return Un.apply(this,arguments)}}(),ji=function(mn){vt.page=mn,Zt(Object(a.a)({},vt)),Nn(vt)},_a=function(){var Un=Object(f.a)(i.a.mark(function mn(jn,Jn){var Lr,Kn,_i,pi,Gr,Mr,oi,ei,Ln,En,Hn;return i.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if(Lr=cn==null?void 0:cn.findIndex(function(fr){return fr.id===Dn}),console.log(Lr,Jn,22),!(Jn==="prev")){An.next=21;break}if(!(Lr===void 0)){An.next=6;break}return T.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),An.abrupt("return");case 6:if(!(Lr===0)){An.next=19;break}if(!(vt.page===1)){An.next=10;break}return T.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),An.abrupt("return");case 10:if(!(vt.page!==1)){An.next=17;break}return vt.page=vt.page-1,Zt(Object(a.a)({},vt)),An.next=15,Nn(vt);case 15:Kn=An.sent,(Kn==null?void 0:Kn.status)===0&&(Mr=Kn==null||((_i=Kn.data)===null||_i===void 0)?void 0:_i.articles[(Kn==null||((pi=Kn.data)===null||pi===void 0||((Gr=pi.articles)===null||Gr===void 0))?void 0:Gr.length)-1],Qn(Mr==null?void 0:Mr.id),console.log(jn.target,555));case 17:An.next=21;break;case 19:oi=cn[Lr-1],Qn(oi==null?void 0:oi.id);case 21:if(!(Jn==="next")){An.next=39;break}if(!(Lr===void 0)){An.next=25;break}return T.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),An.abrupt("return");case 25:if(!((vt.page-1)*vt.limit+(Lr+1)===vt.total)){An.next=28;break}return T.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),An.abrupt("return");case 28:if(!(Lr+1===vt.limit)){An.next=37;break}return vt.page=vt.page+1,Zt(Object(a.a)({},vt)),An.next=33,Nn(vt);case 33:ei=An.sent,(ei==null?void 0:ei.status)===0&&(En=ei==null||((Ln=ei.data)===null||Ln===void 0)?void 0:Ln.articles[0],Qn(En==null?void 0:En.id)),An.next=39;break;case 37:Hn=cn[Lr+1],Qn(Hn==null?void 0:Hn.id);case 39:case"end":return An.stop()}},mn)}));return function(jn,Jn){return Un.apply(this,arguments)}}();return t.a.createElement("div",{className:gt.a.wrap,ref:Xt},t.a.createElement("div",{className:gt.a.head},t.a.createElement("div",{className:gt.a.sort,onClick:pn},t.a.createElement("span",null,"\u6700\u65B0"),t.a.createElement("aside",null,t.a.createElement(ii.a,{style:{color:(vt==null?void 0:vt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),t.a.createElement(Xi.a,{style:{color:(vt==null?void 0:vt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),t.a.createElement(Z.a.Search,{value:vt.save_search,className:gt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(mn){vt.save_search=mn.target.value,Zt(Object(a.a)({},vt))},onSearch:On}),t.a.createElement("div",{onClick:ar,className:gt.a.btn},t.a.createElement("img",{src:fi.a}),"\u5199\u9898\u89E3")),t.a.createElement("div",{className:gt.a.listWarp},t.a.createElement(S.a,{spinning:Fn,className:"mt20"},cn==null?void 0:cn.map(function(Un,mn){var jn=!0;return mn+1===cn.length&&mn!==0&&(jn=!1),t.a.createElement(Lt,{active:Dn,key:Un.id,data:Un,showLine:jn,onClick:Yn,onAssist:Mi,onHide:Ki})}),(cn==null?void 0:cn.length)===0&&t.a.createElement(k.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),t.a.createElement(we.a,{className:gt.a.pagination,showTotal:function(mn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},mn),"\u6761\u6570\u636E")},total:vt.total,showSizeChanger:!1,current:vt==null?void 0:vt.page,onChange:ji,hideOnSinglePage:!0,showQuickJumper:!0}),Nt>0&&t.a.createElement("div",{className:gt.a.fixedRight,style:{width:Tn}},Nt===1&&t.a.createElement(rr,{identifier:Pt,onClose:wr,onOk:jr}),Nt===2&&t.a.createElement(rr,{active:Dn,identifier:Pt,onClose:wr,onOk:Ai}),Nt===3&&t.a.createElement(qr,{btnShowStatus:Cn,onArticlesSkip:_a,detailsIndex:Vn,active:Dn,identifier:Pt,onClose:wr,onOk:zr,onEdit:$n,onAssist:Mi,onDelete:Hi})))},ai=na,Yi=B("VEzc"),Zr=B.n(Yi),Wi=function(pt){var Pt,Dt=pt.visible,Ht=pt.onVisible,jt=pt.value,ht=pt.onChange,ft=pt.setIndex,Ft={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},vt=Object(n.useState)(Ft),Zt=Object(l.a)(vt,2),Rt=Zt[0],rn=Zt[1],Fn=Object(n.useState)([]),wn=Object(l.a)(Fn,2),vn=wn[0],zn=wn[1],Tn=Object(n.useState)([]),Bn=Object(l.a)(Tn,2),In=Bn[0],ir=Bn[1],Vn=Object(n.useState)(!1),cr=Object(l.a)(Vn,2),vr=cr[0],er=cr[1],Dn=Object(n.useRef)([]),Qn=Object(n.useRef)(null),Pn=Object(b.i)();Object(n.useEffect)(function(){return Pn!=null&&Pn.id&&(Qn.current=setInterval(function(){Ut(30)},3e4)),function(){clearInterval(Qn.current)}},[]);var Ut=function(){var Nt=Object(f.a)(i.a.mark(function Bt(Xt){var hn;return i.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,Object(m.r)(Pn==null?void 0:Pn.id,{practice_time:Xt});case 2:hn=Nn.sent;case 3:case"end":return Nn.stop()}},Bt)}));return function(Xt){return Nt.apply(this,arguments)}}();Object(n.useEffect)(function(){Wn(Rt),qn()},[]),Object(n.useEffect)(function(){return window.addEventListener("click",tr),function(){window.removeEventListener("click",tr)}},[Pn==null?void 0:Pn.save_identifier,Dt]),Object(n.useEffect)(function(){var Nt=Dn.current.findIndex(function(Nn){return Nn.identifier===(Pn==null?void 0:Pn.save_identifier)}),Bt=Dn.current[Nt-1],Xt=Dn.current[Nt+1],hn=document.getElementById("oj-prev"),qt=document.getElementById("oj-next");Bt?hn.style.display="block":hn.style.display="none",Xt?qt.style.display="block":qt.style.display="none"},[Pn==null?void 0:Pn.save_identifier,Dn.current]);var cn=function(Bt,Xt){if(Bt.id===Xt)return Bt;for(var hn=0,qt=Bt;qt=qt.parentNode;hn++){if(qt.id===Xt)return qt;if(qt==document.documentElement)return!1}},tr=function(){var Nt=Object(f.a)(i.a.mark(function Bt(Xt){var hn,qt,Nn;return i.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!cn(Xt.target,"oj-drawer")&&Dt&&Ht(!1),hn=Dn.current.findIndex(function(gn){return gn.identifier===(Pn==null?void 0:Pn.save_identifier)}),qt=Dn.current[hn-1],Nn=Dn.current[hn+1],!(Xt.target.id==="oj-prev")){On.next=14;break}if(!(!qt||hn===-1)){On.next=8;break}return T.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),On.abrupt("return");case 8:return Xt.target.style.pointerEvents="none",Xt.target.style.cursor="not-allowed",On.next=12,on(qt==null?void 0:qt.identifier);case 12:ft("0"),setTimeout(function(){Xt.target.style.pointerEvents="auto",Xt.target.style.cursor="pointer"},400);case 14:if(!(Xt.target.id==="oj-next"||Xt.target.id==="oj-modal-next")){On.next=24;break}if(!(!Nn||hn===-1)){On.next=18;break}return T.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),On.abrupt("return");case 18:return Xt.target.style.pointerEvents="none",Xt.target.style.cursor="not-allowed",On.next=22,on(Nn==null?void 0:Nn.identifier);case 22:ft("0"),setTimeout(function(){Xt.target.style.pointerEvents="auto",Xt.target.style.cursor="pointer"},400);case 24:case"end":return On.stop()}},Bt)}));return function(Xt){return Nt.apply(this,arguments)}}();Object(n.useEffect)(function(){ht(Pn==null?void 0:Pn.save_identifier);var Nt=In.findIndex(function(Bt){return Bt.some(function(Xt){return Xt.identifier===(Pn==null?void 0:Pn.save_identifier)})});Nt===-1?rn(Object(a.a)(Object(a.a)({},Rt),{},{page:1})):rn(Object(a.a)(Object(a.a)({},Rt),{},{page:Nt+1}))},[Pn==null?void 0:Pn.save_identifier,In]);var sr=function(Bt){Rt.page=1,Rt.tag_discipline_id=Bt,rn(Object(a.a)({},Rt)),Wn(Rt)},qn=function(){var Nt=Object(f.a)(i.a.mark(function Bt(){var Xt;return i.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(Oe.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:Xt=qt.sent,zn(Xt.tag_disciplines||[]);case 4:case"end":return qt.stop()}},Bt)}));return function(){return Nt.apply(this,arguments)}}(),Cn=function(Bt){Rt.page=1,Rt.difficulty=typeof Bt=="number"?Bt:null,rn(Object(a.a)({},Rt)),Wn(Rt)},Wn=function(){var Nt=Object(f.a)(i.a.mark(function Bt(Xt){var hn,qt,Nn,pn,On,gn;return i.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return er(!0),Yn.next=3,Object(m.p)(Xt);case 3:if(hn=Yn.sent,hn!=null&&hn.practices_list){for(Nn=hn==null||((qt=hn.practices_list)===null||qt===void 0)?void 0:qt.length,pn=[],On=0;On(An+3)*1e3,Fi!==0&&!aa&&setTimeout(Rr,1e3),!aa){kr.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),ft({type:Vt.SET_SUBMITING,payload:!1}),kr.abrupt("return");case 12:if(!(Fi===0)){kr.next=19;break}return Bi.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),kr.next=16,Object(m.o)(vt,{limit:15,page:In});case 16:oa=kr.sent,ft({type:Vt.SET_SUBMIT_RESULT,payload:Object(a.a)(Object(a.a)({},ht),{},{submitResult:Bi,submitting:!1,submitRecords:oa})}),(Bi==null?void 0:Bi.status)===0&&Xt(!0);case 19:case"end":return kr.stop()}},ha)})),Fr.apply(this,arguments)},Rr=function(){return Fr.apply(this,arguments)},Hn={},sn.next=14,Object(m.s)(vt,Hn);case 14:if(Gt=sn.sent,!(Gt.status===-1)){sn.next=18;break}return window.parent.location.href="/classrooms/".concat(Rt.query.coursesId,"/exercise/").concat(Rt.query.exercisesId,"/detail"),sn.abrupt("return");case 18:An=pn.time_limit,fr=br(),Rr();case 21:sn.next=26;break;case 23:sn.prev=23,sn.t0=sn.catch(3),ft({type:Vt.SET_SUBMITING,payload:!1});case 26:case"end":return sn.stop()}},Ln,null,[[3,23]])})),Mi.apply(this,arguments)}function Ki(){return Hi.apply(this,arguments)}function Hi(){return Hi=Object(f.a)(i.a.mark(function Ln(){var En,Hn,Gt,An,fr,Rr,Fr;return i.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return ht.debuging=!0,ft({type:Vt.SET_DEBUGING,payload:!0}),sn.prev=2,sn.next=5,jr();case 5:if(En=sn.sent,!(En.status===0)){sn.next=21;break}return Fr=function(){return Fr=Object(f.a)(i.a.mark(function ha(){var Ei,Fi,Bi,zi,aa,oa;return i.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(m.l)(vt,"debug");case 2:if(Ei=kr.sent,Fi=Ei.status,Bi=Ei.message,zi=Ei.data,aa=br(),oa=aa-fr>(Hn+3)*1e3,Fi!==0&&!oa&&(ft({type:Vt.SET_EXECUTE_MESSAGE,payload:Bi}),setTimeout(Rr,1e3)),!oa){kr.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),ft({type:Vt.SET_DEBUGING,payload:!1}),kr.abrupt("return");case 13:Fi===0&&(ft({type:Vt.SET_DEBUGING,payload:!1}),zi.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),ft({type:Vt.SET_EXECUTE_RESULT,payload:Object(a.a)(Object(a.a)({},ht),{},{debugResult:zi,debuging:!1})}));case 14:case"end":return kr.stop()}},ha)})),Fr.apply(this,arguments)},Rr=function(){return Fr.apply(this,arguments)},Hn=pn.time_limit,Gt={input:encodeURIComponent(vn.test_case.input)},sn.next=13,Object(m.h)(vt,Gt);case 13:if(An=sn.sent,!(An.status===-1)){sn.next=17;break}return window.parent.location.href="/classrooms/".concat(Rt.query.coursesId,"/exercise/").concat(Rt.query.exercisesId,"/detail"),sn.abrupt("return");case 17:fr=br(),Rr(),sn.next=22;break;case 21:ft({type:Vt.SET_DEBUGING,payload:!1});case 22:sn.next=27;break;case 24:sn.prev=24,sn.t0=sn.catch(2),console.log(sn.t0);case 27:return sn.prev=27,sn.finish(27);case 29:case"end":return sn.stop()}},Ln,null,[[2,24,27,29]])})),Hi.apply(this,arguments)}function ji(Ln){var En;clearTimeout(hn.current),hn.current=setTimeout(function(){var Hn;jr({code:A.Base64.encode(Ln),language:qt==null||((Hn=qt.current)===null||Hn===void 0)?void 0:Hn.language})},2e3),ft({type:Vt.SET_DATA,payload:Object(a.a)(Object(a.a)({},qt==null?void 0:qt.current),{},{hack:Object(a.a)(Object(a.a)({},qt==null||((En=qt.current)===null||En===void 0)?void 0:En.hack),{},{code:Ln})})})}function _a(Ln){var En=Ln.target.value;ft({type:Vt.SET_DATA,payload:Object(a.a)(Object(a.a)({},vn),{},{test_case:{input:En}})})}var Un=function(){var Ln=Object(f.a)(i.a.mark(function En(Hn){var Gt,An,fr,Rr,Fr;return i.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return ft({type:Vt.SET_LOADING,payload:!0}),sn.next=3,jr();case 3:if(Gt=sn.sent,!(Gt.status===0)){sn.next=14;break}return ft({type:Vt.SET_SUBMIT_RESULT,payload:{languageValue:Hn}}),qt.current.language=Hn,An="".concat(Nn==null?void 0:Nn.login,"-language"),localStorage.setItem(An,Hn),sn.next=11,Object(m.w)(vt);case 11:fr=sn.sent,fr.status===0&&(Fr=fr==null||((Rr=fr.data)===null||Rr===void 0)?void 0:Rr.find(function(ia){return ia.language===Hn}),ji(A.Base64.decode(Fr.code))),setTimeout(function(){ft({type:Vt.SET_LOADING,payload:!1})},300);case 14:case"end":return sn.stop()}},En)}));return function(Hn){return Ln.apply(this,arguments)}}();function mn(){return jn.apply(this,arguments)}function jn(){return jn=Object(f.a)(i.a.mark(function Ln(){var En;return i.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.prev=0,Gt.next=3,Object(m.q)(vt,{language:rn});case 3:En=Gt.sent,En.status===401?Zt.replace("/login",{from:Rt.pathname}):(ji(A.Base64.decode(En.code)),Yn()),Gt.next=10;break;case 7:Gt.prev=7,Gt.t0=Gt.catch(0),console.log(Gt.t0);case 10:case"end":return Gt.stop()}},Ln,null,[[0,7]])})),jn.apply(this,arguments)}function Jn(){p.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:t.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",t.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(f.a)(i.a.mark(function En(){var Hn;return i.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return An.next=2,Object(m.t)(vt,{language:rn});case 2:Hn=An.sent,Hn.status===401?Zt.replace("/login",{from:Rt.pathname}):ji(A.Base64.decode(Hn.code));case 4:case"end":return An.stop()}},En)}))()}})}function Lr(){ft({type:Vt.SET_SHOW_NOTE,payload:!0})}function Kn(){ft({type:Vt.SET_SHOW_NOTE,payload:!1})}function _i(Ln){return pi.apply(this,arguments)}function pi(){return pi=Object(f.a)(i.a.mark(function Ln(En){return i.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(m.b)(vt,En);case 2:ft({type:Vt.GET_DATA,payload:{showNote:!1,data:Object(a.a)(Object(a.a)({},vn),{},{hack:Object(a.a)(Object(a.a)({},pn),{},{notes:En.notes})})}});case 3:case"end":return Gt.stop()}},Ln)})),pi.apply(this,arguments)}var Gr={input:vn==null||((pt=vn.test_case)===null||pt===void 0)?void 0:pt.input,language:pn==null?void 0:pn.language,code:pn==null?void 0:pn.code,title:"main."+or[pn==null?void 0:pn.language],modify_code:pn==null?void 0:pn.modify_code,notes:pn==null?void 0:pn.notes,debugResult:zn,debuging:Vn,submitting:cr,executingMessage:vr,id:vt,languageValue:rn,languageList:Fn,onChangeLanguage:Un,onCancelNote:Kn,onAddNote:_i,showNote:ir,onShowNote:Lr,onSubmitCode:zr,onChangeCode:ji,onChangeInput:_a,onDebugCode:Ki,onResetCode:mn,onSyncCode:Jn,onUpdateCode:jr};function Mr(){return oi.apply(this,arguments)}function oi(){return oi=Object(f.a)(i.a.mark(function Ln(){var En,Hn,Gt;return i.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return fr.next=2,Object(m.u)(pn.id,{container_type:"Hack",type:1});case 2:En=fr.sent,Hn=En.praise_count,Gt=Object(a.a)(Object(a.a)({},vn),{},{hack:Object(a.a)(Object(a.a)({},pn),{},{praises_count:Hn,user_praise:!pn.user_praise})}),ft({type:Vt.SET_DATA,payload:Gt});case 6:case"end":return fr.stop()}},Ln)})),oi.apply(this,arguments)}var ei={topicId:vt,submitResult:Tn,submitRecords:Bn,submitting:cr,page:In,onPageChange:wr,hack:pn,user:vn==null?void 0:vn.user,onTriggerPraise:Mr};return console.log(vn,qt==null?void 0:qt.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(S.a,{className:"oj-custom-large-spin",size:"large",spinning:wn},vn?t.a.createElement("div",{className:"oj-custom-warp"},t.a.createElement("header",{className:D.a.header,style:{minWidth:1200}},t.a.createElement("div",null,t.a.createElement("img",{src:"".concat(E.a.IMG_SERVER,"/images/").concat(Nn.image_url),alt:"user",width:30}),t.a.createElement("span",null,Nn.name)),t.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},t.a.createElement("div",null,pn.name),t.a.createElement($i.a,{onChange:function(En){},className:"font12 c-grey-999"})),t.a.createElement(Rn.CopyToClipboard,{text:"".concat((Pt=window.location)===null||Pt===void 0?void 0:Pt.origin,"/problems/").concat(pn.identifier,"/share"),onCopy:function(){return T.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},t.a.createElement("span",{className:D.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",t.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),pn.edit_privilege?t.a.createElement(_.a,{className:D.a.btn_back,to:"/problems/".concat(pn.identifier,"/ojedit"),style:{marginRight:10}}," ",t.a.createElement(d.a,null)," \u7F16\u8F91"):null,t.a.createElement(_.a,{className:D.a.btn_back,onClick:function(){},to:"/problems"}," ",t.a.createElement(v.a,null),"\u9000\u51FA")),t.a.createElement(g.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:t.a.createElement(Ci,ei),rightChild:t.a.createElement(Ur,Gr)})):null),t.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:Bt,className:"oj-modal"},t.a.createElement("section",{className:"oj-modal-content"},t.a.createElement("div",{className:"oj-modal-head"},t.a.createElement("img",{src:Ji.a,alt:""}),t.a.createElement("i",{onClick:function(){return Xt(!1)},className:"iconfont icon-guanbi1"})),t.a.createElement("aside",null,t.a.createElement("img",{className:"mr30",src:tn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",t.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Tn==null?void 0:Tn.execute_time,"s"),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Tn==null?void 0:Tn.time_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("aside",{className:"mb50"},t.a.createElement("img",{src:hi.a,className:"mr30"}),t.a.createElement("span",{className:"oj-modal-tt"},t.a.createElement("span",null,t.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),t.a.createElement("span",{className:"c-light-primary"},Tn==null?void 0:Tn.execute_memory,"mb")),t.a.createElement("span",null,t.a.createElement("span",null))),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Tn==null?void 0:Tn.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function nr(nt){var pt=nt.languageValue,Pt=nt.languageList,Dt=nt.onChangeLanguage,Ht=nt.title,jt=nt.modify_code,ht=nt.onSyncCode,ft=nt.onShowCodeSetting,Ft=nt.onResetCode,vt=Object(b.h)(),Zt=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:t.a.createElement(o.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Ft})};return t.a.createElement("div",{className:"action-bar"},t.a.createElement(w.a,{className:"oj-select",value:pt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Dt},Pt==null?void 0:Pt.map(function(Rt){return t.a.createElement(w.a.Option,{key:Rt.language,value:Rt.language},Rt.language)})),t.a.createElement("span",null),t.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Zt},t.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),t.a.createElement("a",{onClick:ft},t.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Ur(nt){var pt=nt.id,Pt=nt.input,Dt=nt.showNote,Ht=nt.onShowNote,jt=nt.notes,ht=nt.onCancelNote,ft=nt.onAddNote,Ft=nt.debugResult,vt=nt.language,Zt=nt.debuging,Rt=nt.submitting,rn=nt.executingMessage,Fn=nt.code,wn=nt.onSubmitCode,vn=nt.onDebugCode,zn=nt.onChangeCode,Tn=nt.onChangeInput,Bn=nt.onUpdateCode,In=Object(Q.a)(nt,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function ir(cr){return t.a.createElement(nr,Object(ae.a)({},In,{onShowCodeSetting:cr}))}var Vn={id:pt,input:Pt,debugResult:Ft,debuging:Zt,submitting:Rt,executingMessage:rn,onDebugCode:vn,onChangeCode:zn,onSubmitCode:wn,onChangeInput:Tn};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(x.a,{language:vt,value:Fn,onChange:zn,ActionBarRender:ir}),t.a.createElement("div",{className:"note-form-area ".concat(Dt?"active":"")},t.a.createElement(ie,{onCancel:ht,notes:jt,callback:ft})),t.a.createElement(F.b,Vn))}},WaYH:function(Je,Ke,B){"use strict";var ae=B("rePB"),Q=B("Ff2n"),U=B("VTBJ"),w=B("1OyB"),P=B("vuIU"),S=B("JX7q"),C=B("Ji7U"),T=B("LK+K"),h=B("cDcd"),p=B("TSYQ"),f=B.n(p),l=B("sboe"),a=B("OZM5"),c=function(_){var m=_.prefixCls,g=_.level,E=_.isStart,o=_.isEnd;if(!g)return null;for(var x="".concat(m,"-indent-unit"),A=[],O=0;O1&&arguments[1]!==void 0?arguments[1]:!1,pe=oe.getAttribute("id")||oe.getAttribute("data-reactid")||oe.getAttribute("name");if(ye&&I[pe])return I[pe];var we=window.getComputedStyle(oe),fe=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),Te=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),Fe=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),De=D.map(function(Ue){return"".concat(Ue,":").concat(we.getPropertyValue(Ue))}).join(";"),Me={sizingStyle:De,paddingSize:Te,borderSize:Fe,boxSizing:fe};return ye&&pe&&(I[pe]=Me),Me}function ne(oe){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),oe.getAttribute("wrap")?F.setAttribute("wrap",oe.getAttribute("wrap")):F.removeAttribute("wrap");var fe=z(oe,ye),Te=fe.paddingSize,Fe=fe.borderSize,De=fe.boxSizing,Me=fe.sizingStyle;F.setAttribute("style","".concat(Me,";").concat(O)),F.value=oe.value||oe.placeholder||"";var Ue=Number.MIN_SAFE_INTEGER,ve=Number.MAX_SAFE_INTEGER,ce=F.scrollHeight,Ie;if(De==="border-box"?ce+=Fe:De==="content-box"&&(ce-=Te),pe!==null||we!==null){F.value=" ";var Ne=F.scrollHeight-Te;pe!==null&&(Ue=Ne*pe,De==="border-box"&&(Ue=Ue+Te+Fe),ce=Math.max(Ue,ce)),we!==null&&(ve=Ne*we,De==="border-box"&&(ve=ve+Te+Fe),Ie=ce>ve?"":"hidden",ce=Math.min(ve,ce))}return{height:ce,minHeight:Ue,maxHeight:ve,overflowY:Ie,resize:"none"}}var j=B("Gytx"),G=B.n(j),X;(function(oe){oe[oe.NONE=0]="NONE",oe[oe.RESIZING=1]="RESIZING",oe[oe.RESIZED=2]="RESIZED"})(X||(X={}));var Z=function(oe){Object(w.a)(pe,oe);var ye=Object(P.a)(pe);function pe(we){var fe;return Object(Q.a)(this,pe),fe=ye.call(this,we),fe.nextFrameActionId=void 0,fe.resizeFrameId=void 0,fe.textArea=void 0,fe.saveTextArea=function(Te){fe.textArea=Te},fe.handleResize=function(Te){var Fe=fe.state.resizeStatus,De=fe.props,Me=De.autoSize,Ue=De.onResize;if(Fe!==X.NONE)return;typeof Ue=="function"&&Ue(Te),Me&&fe.resizeOnNextFrame()},fe.resizeOnNextFrame=function(){cancelAnimationFrame(fe.nextFrameActionId),fe.nextFrameActionId=requestAnimationFrame(fe.resizeTextarea)},fe.resizeTextarea=function(){var Te=fe.props.autoSize;if(!Te||!fe.textArea)return;var Fe=Te.minRows,De=Te.maxRows,Me=ne(fe.textArea,!1,Fe,De);fe.setState({textareaStyles:Me,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(fe.resizeFrameId),fe.resizeFrameId=requestAnimationFrame(function(){fe.setState({resizeStatus:X.RESIZED},function(){fe.resizeFrameId=requestAnimationFrame(function(){fe.setState({resizeStatus:X.NONE}),fe.fixFirefoxAutoScroll()})})})})},fe.renderTextArea=function(){var Te=fe.props,Fe=Te.prefixCls,De=Fe===void 0?"rc-textarea":Fe,Me=Te.autoSize,Ue=Te.onResize,ve=Te.className,ce=Te.disabled,Ie=fe.state,Ne=Ie.textareaStyles,Xe=Ie.resizeStatus,ee=Object(o.a)(fe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),k=A()(De,ve,Object(T.a)({},"".concat(De,"-disabled"),ce));"value"in ee&&(ee.value=ee.value||"");var N=Object(C.a)(Object(C.a)(Object(C.a)({},fe.props.style),Ne),Xe===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return S.createElement(E,{onResize:fe.handleResize,disabled:!(Me||Ue)},S.createElement("textarea",Object(ae.a)({},ee,{className:k,style:N,ref:fe.saveTextArea})))},fe.state={textareaStyles:{},resizeStatus:X.NONE},fe}return Object(U.a)(pe,[{key:"componentDidUpdate",value:function(fe){(fe.value!==this.props.value||!G()(fe.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var fe=this.textArea.selectionStart,Te=this.textArea.selectionEnd;this.textArea.setSelectionRange(fe,Te)}}catch(Fe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),pe}(S.Component),K=Z,q=function(oe){Object(w.a)(pe,oe);var ye=Object(P.a)(pe);function pe(we){var fe;Object(Q.a)(this,pe),fe=ye.call(this,we),fe.resizableTextArea=void 0,fe.focus=function(){fe.resizableTextArea.textArea.focus()},fe.saveTextArea=function(Fe){fe.resizableTextArea=Fe},fe.handleChange=function(Fe){var De=fe.props.onChange;fe.setValue(Fe.target.value,function(){fe.resizableTextArea.resizeTextarea()}),De&&De(Fe)},fe.handleKeyDown=function(Fe){var De=fe.props,Me=De.onPressEnter,Ue=De.onKeyDown;Fe.keyCode===13&&Me&&Me(Fe),Ue&&Ue(Fe)};var Te=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return fe.state={value:Te},fe}return Object(U.a)(pe,[{key:"setValue",value:function(fe,Te){"value"in this.props||this.setState({value:fe},Te)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return S.createElement(K,Object(ae.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(fe){return"value"in fe?{value:fe.value}:null}}]),pe}(S.Component),ie=Ke.default=q},Z8dc:function(Je,Ke,B){Je.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(Je,Ke,B){"use strict";var ae=B("BoS7"),Q=B("Sdc0"),U=B("OaEy"),w=B("2fM7"),P=B("cDcd"),S=B.n(P),C=B("lOMy"),T=B.n(C),h=w.a.Option;Ke.a=function(p){var f=p.onFontSizeChange,l=p.cmFontSize,a=p.cmCodeMode,c=p.onCodeModeChange,s=p.onTabToSpace,u=p.className,i=u===void 0?"":u,n=p.tabToSpace,t=p.children;return S.a.createElement("div",{className:"tpi-code-setting ".concat(i)},S.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),S.a.createElement("section",null,S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),S.a.createElement(w.a,{bordered:!1,size:"small",value:a,onChange:c},S.a.createElement(h,{value:"vs"},"\u767D\u8272\u80CC\u666F"),S.a.createElement(h,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),S.a.createElement(w.a,{bordered:!1,size:"small",value:l,onChange:f},S.a.createElement(h,{value:12},"12px"),S.a.createElement(h,{value:14},"14px"),S.a.createElement(h,{value:16},"16px"),S.a.createElement(h,{value:18},"18px"),S.a.createElement(h,{value:20},"20px"),S.a.createElement(h,{value:22},"22px"))),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"Tab\u8F6C\u6362"),S.a.createElement(Q.a,{checked:n,onChange:s}))),S.a.createElement("h3",null,"\u5FEB\u6377\u952E"),S.a.createElement("section",null,S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),S.a.createElement("span",null,"Ctrl + S")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),S.a.createElement("span",null,"F1 / Alt + F1")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),S.a.createElement("span",null,"Ctrl + ]/[")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),S.a.createElement("span",null,"Ctrl + Shift + \\")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),S.a.createElement("span",null,"Home")),S.a.createElement("div",{className:"file-item"},S.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),S.a.createElement("span",null,"End"))),t)}},ZW9T:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return b});var ae=B("k1fw"),Q=B("miYZ"),U=B("tsqr"),w=B("rAM+"),P=B("tJVT"),S=B("PpiC"),C=B("cDcd"),T=B.n(C),h=B("bdgK");function p(y,_,m,g,E){var o=_.getWordUntilPosition(m),x={startLineNumber:m.lineNumber,endLineNumber:m.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},A=g.map(function(O){return{label:O,kind:y.languages.CompletionItemKind.Keyword,insertText:O,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:x}});return E.map(function(O){A.push(Object(ae.a)(Object(ae.a)({},O),{},{range:x}))}),A}var f=function(y){var _={label:"ifelse",kind:y.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet},m=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(x,A){var O=p(y,x,A,m,[_]);return{suggestions:O}}});var g=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(x,A){var O=[{label:"print",kind:y.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}],D=p(y,x,A,g,O);return{suggestions:D}}});var E=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(x,A){var O=[_,{label:"main",kind:y.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:y.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}],D=p(y,x,A,E,O);return{suggestions:D}}})},l="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=B("LvDl"),c=B("+ua5");function s(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function u(){}var i=!1,n={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function t(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=y;if(Array.isArray(y)){for(var m=0;m0||wt.target.offsetWidth>0)&&Xe.current.instance.layout()}}catch(st){xt.e(st)}finally{xt.f()}}),rt.observe(Ne.current)),rt}function at(){U.b.warn(decodeURIComponent(l))}var Le=function(){var dt=Xe.current.instance;if(o!=null&&dt&&Y){var xt=dt.getModel();xt&&o!==xt.getValue()&&(i=!0,xt.setValue(o),dt.layout(),i=!1)}};Object(C.useEffect)(function(){ee.current&&clearTimeout(ee.current),ee.current=setTimeout(function(){Le()},500)},[o,Y,Xe.current]),Object(C.useEffect)(function(){if(Ue&&Xe.current&&Xe.current.instance){var rt=Xe.current.instance;rt.changeViewZones(function(xt){var _t=document.createElement("div");_t.style.padding="10px 20px",_t.style.width="calc(100% - 20px)",_t.className="my-error-line-wrp",_t.innerHTML=ce,xt.addZone({afterLineNumber:Ue||11,heightInLines:3,domNode:_t})});var dt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};rt.addOverlayWidget(dt),rt.revealPositionInCenter({lineNumber:20,column:1})}},[Ue,Xe.current,Y]);function ke(){var rt=Xe.current.instance;if(rt){var dt=rt.getSelection(),xt=Xe.current.pastePos||{},_t=new d.Range(xt.startLineNumber||dt.endLineNumber,xt.startColumn||dt.endColumn,xt.endLineNumber||dt.endLineNumber,xt.endColumn||dt.endColumn);setTimeout(function(){rt.executeEdits("",[{range:_t,text:""}])},300)}}function Ye(rt){(window.navigator.platform.match("Mac")?rt.metaKey:rt.ctrlKey)&&rt.keyCode==83&&(rt.preventDefault(),Z())}var Ze=function(){if(q&&Xe.current.instance){var dt=Xe.current.instance.getContentHeight();Be(dt0||we.target.offsetWidth>0)&&q.layout()}}catch(fe){ye.e(fe)}finally{ye.f()}}),ie.observe(I.current)),ie}Object(C.useEffect)(function(){I.current&&B.e(27).then(B.t.bind(null,"M/lh",7)).then(function(q){d=q;var ie=d.editor.createDiffEditor(I.current,Object(ae.a)(Object(ae.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},D),{},{wordWrap:!0}));j(ie);var oe=G(ie);return function(){ie.dispose();var ye=ie.getModel();ye&&ye.dispose(),oe.unobserve(I.current)}})},[]),Object(C.useEffect)(function(){ne&&ne.setModel({original:d.editor.createModel(o,A),modified:d.editor.createModel(x,A)})},[o,x,A,ne]);var X=s(m),Z=s(E),K={width:X,height:Z};return T.a.createElement("div",{className:"my-diff-editor",ref:I,style:K})}},ZpRC:function(Je,Ke,B){"use strict";function ae(f){return typeof f=="object"&&f!=null&&f.nodeType===1}function Q(f,l){return(!l||f!=="hidden")&&f!=="visible"&&f!=="clip"}function U(f,l){if(f.clientHeightl||u>f&&i=l&&n>=a?u-f-c:i>l&&na?i-l+s:0}var P=function(f,l){var a=window,c=l.scrollMode,s=l.block,u=l.inline,i=l.boundary,n=l.skipOverflowHiddenElements,t=typeof i=="function"?i:function(Ne){return Ne!==i};if(!ae(f))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,v=[],b=f;ae(b)&&t(b);){if((b=b.parentElement)===d){v.push(b);break}b!=null&&b===document.body&&U(b)&&!U(document.documentElement)||b!=null&&U(b,n)&&v.push(b)}for(var y=a.visualViewport?a.visualViewport.width:innerWidth,_=a.visualViewport?a.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,E=f.getBoundingClientRect(),o=E.height,x=E.width,A=E.top,O=E.right,D=E.bottom,I=E.left,F=s==="start"||s==="nearest"?A:s==="end"?D:A+o/2,z=u==="center"?I+x/2:u==="end"?O:I,ne=[],j=0;j=0&&I>=0&&D<=_&&O<=y&&A>=q&&D<=oe&&I>=ye&&O<=ie)return ne;var pe=getComputedStyle(G),we=parseInt(pe.borderLeftWidth,10),fe=parseInt(pe.borderTopWidth,10),Te=parseInt(pe.borderRightWidth,10),Fe=parseInt(pe.borderBottomWidth,10),De=0,Me=0,Ue="offsetWidth"in G?G.offsetWidth-G.clientWidth-we-Te:0,ve="offsetHeight"in G?G.offsetHeight-G.clientHeight-fe-Fe:0;if(d===G)De=s==="start"?F:s==="end"?F-_:s==="nearest"?w(g,g+_,_,fe,Fe,g+F,g+F+o,o):F-_/2,Me=u==="start"?z:u==="center"?z-y/2:u==="end"?z-y:w(m,m+y,y,we,Te,m+z,m+z+x,x),De=Math.max(0,De+g),Me=Math.max(0,Me+m);else{De=s==="start"?F-q-fe:s==="end"?F-oe+Fe+ve:s==="nearest"?w(q,oe,Z,fe,Fe+ve,F,F+o,o):F-(q+Z/2)+ve/2,Me=u==="start"?z-ye-we:u==="center"?z-(ye+K/2)+Ue/2:u==="end"?z-ie+Te+Ue:w(ye,ie,K,we,Te+Ue,z,z+x,x);var ce=G.scrollLeft,Ie=G.scrollTop;F+=Ie-(De=Math.max(0,Math.min(Ie+De,G.scrollHeight-Z+ve))),z+=ce-(Me=Math.max(0,Math.min(ce+Me,G.scrollWidth-K+Ue)))}ne.push({el:G,top:De,left:Me})}return ne};function S(f){return f===Object(f)&&Object.keys(f).length!==0}function C(f,l){l===void 0&&(l="auto");var a="scrollBehavior"in document.body.style;f.forEach(function(c){var s=c.el,u=c.top,i=c.left;s.scroll&&a?s.scroll({top:u,left:i,behavior:l}):(s.scrollTop=u,s.scrollLeft=i)})}function T(f){return f===!1?{block:"end",inline:"nearest"}:S(f)?f:{block:"start",inline:"nearest"}}function h(f,l){var a=!f.ownerDocument.documentElement.contains(f);if(S(l)&&typeof l.behavior=="function")return l.behavior(a?[]:P(f,l));if(a)return;var c=T(l);return C(P(f,c),c.behavior)}var p=Ke.a=h},ZsLC:function(Je,Ke,B){Je.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(Je,Ke,B){"use strict";B.d(Ke,"b",function(){return w}),B.d(Ke,"a",function(){return P});var ae=B("je13"),Q=B.n(ae),U=!1;function w(S,C){var T=Q.a.get("__ec");T||(T={}),T[S]=C,Q.a.set("__ec",T)}function P(S,C){var T=Q.a.get("__ec");return T?T[S]===void 0?C:T[S]:C}},bT9E:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return Q});var ae=B("VTBJ");function Q(U,w){var P=Object(ae.a)({},U);return Array.isArray(w)&&w.forEach(function(S){delete P[S]}),P}},bdLU:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return ae});var ae;(function(Q){Q[Q.NOMATCH=-1]="NOMATCH",Q[Q.OK=0]="OK",Q[Q.TIMEOUT=2]="TIMEOUT",Q[Q.PODFAILURE=3]="PODFAILURE",Q[Q.COMPILEFAILURE=4]="COMPILEFAILURE",Q[Q.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ae||(ae={}))},biw7:function(Je,Ke,B){"use strict";var ae=B("cDcd"),Q=B.n(ae),U=ae.createContext(null);Ke.a=U},c5Ni:function(Je,Ke,B){},cDPC:function(Je,Ke,B){"use strict";var ae=B("tJVT"),Q=B("cDcd"),U=B.n(Q),w=B("i3hx"),P=B.n(w);Ke.a=function(S){var C=S.defaultX,T=C===void 0?"40%":C,h=S.leftChild,p=S.rightChild,f=S.className,l=S.hideResize,a=l===void 0?!1:l,c=Object(Q.useState)(T),s=Object(ae.a)(c,2),u=s[0],i=s[1],n=Object(Q.useRef)();function t(){n.current=!0}Object(Q.useEffect)(function(){function b(_){n.current&&i(_.pageX)}function y(){n.current=!1}return window.addEventListener("mousemove",b),window.addEventListener("mouseup",y),function(){window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",y)}},[]);var d=typeof u=="number"&&u!==.01?"".concat(u,"px"):T,v="calc(100% - ".concat(a?"0px":"4px"," - ").concat(d,")");return U.a.createElement("div",{className:"split-panel-container ".concat(f)},U.a.createElement("section",{style:{width:d,display:u===.01?"none":""}},h),U.a.createElement("section",{className:"resize-x-bar",onMouseDown:t},U.a.createElement("a",{className:"btn-resize"},U.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},U.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),U.a.createElement("section",{style:{width:v}},p))}},dejd:function(Je,Ke,B){},dmUQ:function(Je,Ke,B){"use strict";var ae=B("Ff2n"),Q=B("rePB"),U=B("1OyB"),w=B("vuIU"),P=B("Ji7U"),S=B("md7G"),C=B("foSv"),T=B("cDcd"),h=B.n(T),p=B("TSYQ"),f=B.n(p),l=B("4IlW");function a(o,x){var A=Object.keys(o);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(o);x&&(O=O.filter(function(D){return Object.getOwnPropertyDescriptor(o,D).enumerable})),A.push.apply(A,O)}return A}function c(o){for(var x=1;x1?K-1:0),ie=1;ie1?j-1:0),X=1;X=0)return parseInt(ne.slice(ne.indexOf("e-")+2),10);var j=0;return ne.indexOf(".")>=0&&(j=ne.length-ne.indexOf(".")-1),j},D.getInputDisplayValue=function(z){var ne=z||D.state,j=ne.focused,G=ne.inputValue,X=ne.value,Z;j?Z=G:Z=D.toPrecisionAsStep(X),Z==null&&(Z="");var K=D.formatWrapper(Z);return y(D.props.decimalSeparator)&&(K=K.toString().replace(".",D.props.decimalSeparator)),K},D.recordCursorPosition=function(){try{D.cursorStart=D.input.selectionStart,D.cursorEnd=D.input.selectionEnd,D.currentValue=D.input.value,D.cursorBefore=D.input.value.substring(0,D.cursorStart),D.cursorAfter=D.input.value.substring(D.cursorEnd)}catch(z){}},D.restoreByAfter=function(z){if(z===void 0)return!1;var ne=D.input.value,j=ne.lastIndexOf(z);if(j===-1)return!1;var G=D.cursorBefore.length;return D.lastKeyCode===l.a.DELETE&&D.cursorBefore.charAt(G-1)===z[0]?(D.fixCaret(G,G),!0):j+z.length===ne.length?(D.fixCaret(j,j),!0):!1},D.partRestoreByAfter=function(z){return z===void 0?!1:Array.prototype.some.call(z,function(ne,j){var G=z.substring(j);return D.restoreByAfter(G)})},D.isNotCompleteNumber=function(z){return isNaN(z)||z===""||z===null||z&&z.toString().indexOf(".")===z.toString().length-1},D.stop=function(){D.autoStepTimer&&clearTimeout(D.autoStepTimer)},D.down=function(z,ne,j){D.pressingUpOrDown=!0,D.step("down",z,ne,j)},D.up=function(z,ne,j){D.pressingUpOrDown=!0,D.step("up",z,ne,j)},D.saveInput=function(z){D.input=z};var I=O.value;I===void 0&&(I=O.defaultValue),D.state={focused:O.autoFocus};var F=D.getValidValue(D.toNumber(I));return D.state=c(c({},D.state),{},{inputValue:D.toPrecisionAsStep(F),value:F}),D}return Object(w.a)(A,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(D){var I=this.props,F=I.value,z=I.onChange,ne=I.max,j=I.min,G=this.state.focused;if(D){if(!_(D.value,F)||!_(D.max,ne)||!_(D.min,j)){var X=G?F:this.getValidValue(F),Z;this.pressingUpOrDown?Z=X:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(X),this.setState({value:X,inputValue:Z})}var K="value"in this.props?F:this.state.value;"max"in this.props&&D.max!==ne&&typeof K=="number"&&K>ne&&z&&z(ne),"min"in this.props&&D.min!==j&&typeof K=="number"&&K1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,z=parseFloat(D);return isNaN(z)?D:(zF&&(z=F),z)}},{key:"setValue",value:function(D,I){var F=this.props.precision,z=this.isNotCompleteNumber(parseFloat(D))?null:parseFloat(D),ne=this.state.value,j=ne===void 0?null:ne,G=this.state.inputValue,X=G===void 0?null:G,Z=typeof z=="number"?z.toFixed(F):"".concat(z),K=z!==j||Z!=="".concat(X);return"value"in this.props?(X=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:X},I)):this.setState({value:z,inputValue:this.toPrecisionAsStep(D)},I),K&&this.props.onChange(z),z}},{key:"getMaxPrecision",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,z=F.precision,ne=F.step;if(y(z))return z;var j=this.getPrecision(I),G=this.getPrecision(ne),X=this.getPrecision(D);return D?Math.max(X,j+G):j+G}},{key:"getPrecisionFactor",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(D,I);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(D){return this.props.formatter?this.props.formatter(D):D}},{key:"toPrecisionAsStep",value:function(D){if(this.isNotCompleteNumber(D)||D==="")return D;var I=Math.abs(this.getMaxPrecision(D));return isNaN(I)?D.toString():Number(D).toFixed(I)}},{key:"toNumber",value:function(D){var I=this.props.precision,F=this.state.focused,z=D&&D.length>16&&F;return this.isNotCompleteNumber(D)||z?D:y(I)?Math.round(D*Math.pow(10,I))/Math.pow(10,I):Number(D)}},{key:"upStep",value:function(D,I){var F=this.props.step,z=this.getPrecisionFactor(D,I),ne=Math.abs(this.getMaxPrecision(D,I)),j=((z*D+z*F*I)/z).toFixed(ne);return this.toNumber(j)}},{key:"downStep",value:function(D,I){var F=this.props.step,z=this.getPrecisionFactor(D,I),ne=Math.abs(this.getMaxPrecision(D,I)),j=((z*D-z*F*I)/z).toFixed(ne);return this.toNumber(j)}},{key:"step",value:function(D,I){var F=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,ne=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var j=this.props;if(j.disabled)return;var G=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(G))return;var X=this["".concat(D,"Step")](G,z),Z=X>j.max||Xj.max?X=j.max:X=q),He=(Ae||Ae===0)&&(isNaN(Ae)||Number(Ae)<=ie),Pe=Ve||z||ne,Re=He||z||ne,Oe=f()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(Q.a)({},"".concat(F,"-handler-up-disabled"),Pe)),he=f()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(Q.a)({},"".concat(F,"-handler-down-disabled"),Re)),be=j?{onTouchStart:Pe?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Pe?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ce=j?{onTouchStart:Re?i:this.down,onTouchEnd:this.stop}:{onMouseDown:Re?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:Le,style:oe,title:ye,onMouseEnter:pe,onMouseLeave:we,onMouseOver:fe,onMouseOut:Te,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(F,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},be,{role:"button","aria-label":"Increase Value","aria-disabled":Pe,className:Oe}),X||h.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:n})),h.a.createElement("span",Object.assign({unselectable:"on"},Ce,{role:"button","aria-label":"Decrease Value","aria-disabled":Re,className:he}),Z||h.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:n}))),h.a.createElement("div",{className:"".concat(F,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ie,"aria-valuemax":q,"aria-valuenow":Ae,required:Fe,type:Ue,placeholder:ve,onPaste:$,onClick:De,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Me,autoComplete:G,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ye?this.onKeyDown:i,onKeyUp:Ye?this.onKeyUp:i,autoFocus:k,maxLength:ee,readOnly:ne,disabled:z,max:q,min:ie,step:Xe,name:N,title:ye,id:ce,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:Ne,inputMode:Ie,onInput:V},ke))))}}]),A}(h.a.Component);m.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:b,min:-b,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:t,required:!1,autoComplete:"off"};var g=m,E=Ke.a=g},fcSX:function(Je,Ke,B){"use strict";var ae=B("Ff2n"),Q=B("1OyB"),U=B("vuIU"),w=B("Ji7U"),P=B("md7G"),S=B("foSv"),C=B("1W/9"),T=B("cDcd"),h=B("rePB"),p=B("JX7q"),f=B("TSYQ"),l=B.n(f),a=B("qx4F"),c=B("4IlW");function s(z){return Array.isArray(z)?z:[z]}var u={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(u).filter(function(z){if(typeof document=="undefined")return!1;var ne=document.getElementsByTagName("html")[0];return z in(ne?ne.style:{})})[0],n=u[i];function t(z,ne,j,G){z.addEventListener?z.addEventListener(ne,j,G):z.attachEvent&&z.attachEvent("on".concat(ne),j)}function d(z,ne,j,G){z.removeEventListener?z.removeEventListener(ne,j,G):z.attachEvent&&z.detachEvent("on".concat(ne),j)}function v(z,ne){var j=typeof z=="function"?z(ne):z;return Array.isArray(j)?j.length===2?j:[j[0],j[1]]:[j]}var b=function(ne){return!isNaN(parseFloat(ne))&&isFinite(ne)},y=!(typeof window!="undefined"&&window.document&&window.document.createElement),_=function z(ne,j,G,X){if(!j||j===document||j instanceof Document)return!1;if(j===ne.parentNode)return!0;var Z=Math.max(Math.abs(G),Math.abs(X))===Math.abs(X),K=Math.max(Math.abs(G),Math.abs(X))===Math.abs(G),q=j.scrollHeight-j.clientHeight,ie=j.scrollWidth-j.clientWidth,oe=document.defaultView.getComputedStyle(j),ye=oe.overflowY==="auto"||oe.overflowY==="scroll",pe=oe.overflowX==="auto"||oe.overflowX==="scroll",we=q&&ye,fe=ie&&pe;return Z&&(!we||we&&(j.scrollTop>=q&&X<0||j.scrollTop<=0&&X>0))||K&&(!fe||fe&&(j.scrollLeft>=ie&&G<0||j.scrollLeft<=0&&G>0))?z(ne,j.parentNode,G,X):!1};function m(z){var ne=g();return function(){var G=Object(S.a)(z),X;if(ne){var Z=Object(S.a)(this).constructor;X=Reflect.construct(G,arguments,Z)}else X=G.apply(this,arguments);return Object(P.a)(this,X)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(z){return!1}}var E={},o=function(z){Object(w.a)(j,z);var ne=m(j);function j(G){var X;return Object(Q.a)(this,j),X=ne.call(this,G),X.domFocus=function(){X.dom&&X.dom.focus()},X.removeStartHandler=function(Z){if(Z.touches.length>1)return;X.startPos={x:Z.touches[0].clientX,y:Z.touches[0].clientY}},X.removeMoveHandler=function(Z){if(Z.changedTouches.length>1)return;var K=Z.currentTarget,q=Z.changedTouches[0].clientX-X.startPos.x,ie=Z.changedTouches[0].clientY-X.startPos.y;(K===X.maskDom||K===X.handlerDom||K===X.contentDom&&_(K,Z.target,q,ie))&&Z.cancelable&&Z.preventDefault()},X.transitionEnd=function(Z){var K=Z.target;d(K,n,X.transitionEnd),K.style.transition=""},X.onKeyDown=function(Z){if(Z.keyCode===c.a.ESC){var K=X.props.onClose;Z.stopPropagation(),K&&K(Z)}},X.onWrapperTransitionEnd=function(Z){var K=X.props,q=K.open,ie=K.afterVisibleChange;Z.target===X.contentWrapper&&Z.propertyName.match(/transform$/)&&(X.dom.style.transition="",!q&&X.getCurrentDrawerSome()&&(document.body.style.overflowX="",X.maskDom&&(X.maskDom.style.left="",X.maskDom.style.width="")),ie&&ie(!!q))},X.openLevelTransition=function(){var Z=X.props,K=Z.open,q=Z.width,ie=Z.height,oe=X.getHorizontalBoolAndPlacementName(),ye=oe.isHorizontal,pe=oe.placementName,we=X.contentDom?X.contentDom.getBoundingClientRect()[ye?"width":"height"]:0,fe=(ye?q:ie)||we;X.setLevelAndScrolling(K,pe,fe)},X.setLevelTransform=function(Z,K,q,ie){var oe=X.props,ye=oe.placement,pe=oe.levelMove,we=oe.duration,fe=oe.ease,Te=oe.showMask;X.levelDom.forEach(function(Fe){Fe.style.transition="transform ".concat(we," ").concat(fe),t(Fe,n,X.transitionEnd);var De=Z?q:0;if(pe){var Me=v(pe,{target:Fe,open:Z});De=Z?Me[0]:Me[1]||0}var Ue=typeof De=="number"?"".concat(De,"px"):De,ve=ye==="left"||ye==="top"?Ue:"-".concat(Ue);ve=Te&&ye==="right"&&ie?"calc(".concat(ve," + ").concat(ie,"px)"):ve,Fe.style.transform=De?"".concat(K,"(").concat(ve,")"):""})},X.setLevelAndScrolling=function(Z,K,q){var ie=X.props.onChange;if(!y){var oe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(a.a)(!0):0;X.setLevelTransform(Z,K,q,oe),X.toggleScrollingToDrawerAndBody(oe)}ie&&ie(Z)},X.toggleScrollingToDrawerAndBody=function(Z){var K=X.props,q=K.getOpenCount,ie=K.getContainer,oe=K.showMask,ye=K.open,pe=ie&&ie(),we=q&&q();if(pe&&pe.parentNode===document.body&&oe){var fe=["touchstart"],Te=[document.body,X.maskDom,X.handlerDom,X.contentDom];ye&&document.body.style.overflow!=="hidden"?(Z&&X.addScrollingEffect(Z),we===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Te.forEach(function(Fe,De){if(!Fe)return;t(Fe,fe[De]||"touchmove",De?X.removeMoveHandler:X.removeStartHandler,X.passive)})):X.getCurrentDrawerSome()&&(we||(document.body.style.overflow=""),document.body.style.touchAction="",Z&&X.remScrollingEffect(Z),Te.forEach(function(Fe,De){if(!Fe)return;d(Fe,fe[De]||"touchmove",De?X.removeMoveHandler:X.removeStartHandler,X.passive)}))}},X.addScrollingEffect=function(Z){var K=X.props,q=K.placement,ie=K.duration,oe=K.ease,ye=K.getOpenCount,pe=K.switchScrollingEffect,we=ye&&ye();we===1&&pe();var fe="width ".concat(ie," ").concat(oe),Te="transform ".concat(ie," ").concat(oe);X.dom.style.transition="none";switch(q){case"right":X.dom.style.transform="translateX(-".concat(Z,"px)");break;case"top":case"bottom":X.dom.style.width="calc(100% - ".concat(Z,"px)"),X.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(X.timeout),X.timeout=setTimeout(function(){X.dom&&(X.dom.style.transition="".concat(Te,",").concat(fe),X.dom.style.width="",X.dom.style.transform="")})},X.remScrollingEffect=function(Z){var K=X.props,q=K.placement,ie=K.duration,oe=K.ease,ye=K.getOpenCount,pe=K.switchScrollingEffect,we=ye&&ye();we||pe(!0),i&&(document.body.style.overflowX="hidden"),X.dom.style.transition="none";var fe,Te="width ".concat(ie," ").concat(oe),Fe="transform ".concat(ie," ").concat(oe);switch(q){case"left":{X.dom.style.width="100%",Te="width 0s ".concat(oe," ").concat(ie);break}case"right":{X.dom.style.transform="translateX(".concat(Z,"px)"),X.dom.style.width="100%",Te="width 0s ".concat(oe," ").concat(ie),X.maskDom&&(X.maskDom.style.left="-".concat(Z,"px"),X.maskDom.style.width="calc(100% + ".concat(Z,"px)"));break}case"top":case"bottom":{X.dom.style.width="calc(100% + ".concat(Z,"px)"),X.dom.style.height="100%",X.dom.style.transform="translateZ(0)",fe="height 0s ".concat(oe," ").concat(ie);break}default:break}clearTimeout(X.timeout),X.timeout=setTimeout(function(){X.dom&&(X.dom.style.transition="".concat(Fe,",").concat(fe?"".concat(fe,","):"").concat(Te),X.dom.style.transform="",X.dom.style.width="",X.dom.style.height="")})},X.getCurrentDrawerSome=function(){return!Object.keys(E).some(function(Z){return E[Z]})},X.getLevelDom=function(Z){var K=Z.level,q=Z.getContainer;if(y)return;var ie=q&&q(),oe=ie?ie.parentNode:null;if(X.levelDom=[],K==="all"){var ye=oe?Array.prototype.slice.call(oe.children):[];ye.forEach(function(pe){pe.nodeName!=="SCRIPT"&&pe.nodeName!=="STYLE"&&pe.nodeName!=="LINK"&&pe!==ie&&X.levelDom.push(pe)})}else K&&s(K).forEach(function(pe){document.querySelectorAll(pe).forEach(function(we){X.levelDom.push(we)})})},X.getHorizontalBoolAndPlacementName=function(){var Z=X.props.placement,K=Z==="left"||Z==="right",q="translate".concat(K?"X":"Y");return{isHorizontal:K,placementName:q}},X.state={_self:Object(p.a)(X)},X}return Object(U.a)(j,[{key:"componentDidMount",value:function(){var X=this;if(!y){var Z=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Z=!0,null}}))}catch(ye){}this.passive=Z?{passive:!1}:!1}var K=this.props,q=K.open,ie=K.getContainer,oe=ie&&ie();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),q&&(oe&&oe.parentNode===document.body&&(E[this.drawerId]=q),this.openLevelTransition(),this.forceUpdate(function(){X.domFocus()}))}},{key:"componentDidUpdate",value:function(X){var Z=this.props,K=Z.open,q=Z.getContainer,ie=q&&q();K!==X.open&&(K&&this.domFocus(),ie&&ie.parentNode===document.body&&(E[this.drawerId]=!!K),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var X=this.props,Z=X.getOpenCount,K=X.open,q=X.switchScrollingEffect,ie=typeof Z=="function"&&Z();delete E[this.drawerId],K&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ie||(document.body.style.overflow="",q(!0))}},{key:"render",value:function(){var X,Z=this,K=this.props,q=K.className,ie=K.children,oe=K.style,ye=K.width,pe=K.height,we=K.defaultOpen,fe=K.open,Te=K.prefixCls,Fe=K.placement,De=K.level,Me=K.levelMove,Ue=K.ease,ve=K.duration,ce=K.getContainer,Ie=K.handler,Ne=K.onChange,Xe=K.afterVisibleChange,ee=K.showMask,k=K.maskClosable,N=K.maskStyle,$=K.onClose,V=K.onHandleClick,Y=K.keyboard,me=K.getOpenCount,Ae=K.switchScrollingEffect,at=Object(ae.a)(K,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Le=this.dom?fe:!1,ke=l()(Te,(X={},Object(h.a)(X,"".concat(Te,"-").concat(Fe),!0),Object(h.a)(X,"".concat(Te,"-open"),Le),Object(h.a)(X,q||"",!!q),Object(h.a)(X,"no-mask",!ee),X)),Ye=this.getHorizontalBoolAndPlacementName(),Ze=Ye.placementName,Ve=Fe==="left"||Fe==="top"?"-100%":"100%",He=Le?"":"".concat(Ze,"(").concat(Ve,")"),Pe=Ie&&T.cloneElement(Ie,{onClick:function(Oe){Ie.props.onClick&&Ie.props.onClick(),V&&V(Oe)},ref:function(Oe){Z.handlerDom=Oe}});return T.createElement("div",Object.assign({},at,{tabIndex:-1,className:ke,style:oe,ref:function(Oe){Z.dom=Oe},onKeyDown:Le&&Y?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),ee&&T.createElement("div",{className:"".concat(Te,"-mask"),onClick:k?$:void 0,style:N,ref:function(Oe){Z.maskDom=Oe}}),T.createElement("div",{className:"".concat(Te,"-content-wrapper"),style:{transform:He,msTransform:He,width:b(ye)?"".concat(ye,"px"):ye,height:b(pe)?"".concat(pe,"px"):pe},ref:function(Oe){Z.contentWrapper=Oe}},T.createElement("div",{className:"".concat(Te,"-content"),ref:function(Oe){Z.contentDom=Oe},onTouchStart:Le&&ee?this.removeStartHandler:void 0,onTouchMove:Le&&ee?this.removeMoveHandler:void 0},ie),Pe))}}],[{key:"getDerivedStateFromProps",value:function(X,Z){var K=Z.prevProps,q=Z._self,ie={prevProps:X};if(K!==void 0){var oe=X.placement,ye=X.level;oe!==K.placement&&(q.contentDom=null),ye!==K.level&&q.getLevelDom(X)}return ie}}]),j}(T.Component);o.defaultProps={switchScrollingEffect:function(){}};var x=o;function A(z){var ne=O();return function(){var G=Object(S.a)(z),X;if(ne){var Z=Object(S.a)(this).constructor;X=Reflect.construct(G,arguments,Z)}else X=G.apply(this,arguments);return Object(P.a)(this,X)}}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(z){return!1}}var D=function(z){Object(w.a)(j,z);var ne=A(j);function j(G){var X;Object(Q.a)(this,j),X=ne.call(this,G),X.onHandleClick=function(K){var q=X.props,ie=q.onHandleClick,oe=q.open;if(ie&&ie(K),typeof oe=="undefined"){var ye=X.state.open;X.setState({open:!ye})}},X.onClose=function(K){var q=X.props,ie=q.onClose,oe=q.open;ie&&ie(K),typeof oe=="undefined"&&X.setState({open:!1})};var Z=typeof G.open!="undefined"?G.open:!!G.defaultOpen;return X.state={open:Z},"onMaskClick"in G&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),X}return Object(U.a)(j,[{key:"render",value:function(){var X=this,Z=this.props,K=Z.defaultOpen,q=Z.getContainer,ie=Z.wrapperClassName,oe=Z.forceRender,ye=Z.handler,pe=Object(ae.a)(Z,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),we=this.state.open;if(!q)return T.createElement("div",{className:ie,ref:function(Fe){X.dom=Fe}},T.createElement(x,Object.assign({},pe,{open:we,handler:ye,getContainer:function(){return X.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var fe=!!ye||oe;return T.createElement(C.a,{visible:we,forceRender:fe,getContainer:q,wrapperClassName:ie},function(Te){var Fe=Te.visible,De=Te.afterClose,Me=Object(ae.a)(Te,["visible","afterClose"]);return T.createElement(x,Object.assign({},pe,Me,{open:Fe!==void 0?Fe:we,afterVisibleChange:De!==void 0?De:pe.afterVisibleChange,handler:ye,onClose:X.onClose,onHandleClick:X.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(X,Z){var K=Z.prevProps,q={prevProps:X};return typeof K!="undefined"&&X.open!==K.open&&(q.open=X.open),q}}]),j}(T.Component);D.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:T.createElement("div",{className:"drawer-handle"},T.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var I=D,F=Ke.a=I},fcyK:function(Je,Ke,B){},fyJ8:function(Je,Ke,B){"use strict";var ae=B("rePB"),Q=B("VTBJ"),U=B("Ff2n"),w=B("U8pU"),P=B("cDcd"),S=B.n(P),C=B("TSYQ"),T=B.n(C),h=B("c+Xe"),p=B("sR1s");function f(u){return u&&Object(w.a)(u)==="object"&&!Array.isArray(u)&&!P.isValidElement(u)}function l(u){return typeof u=="string"?!0:Object(h.c)(u)}function a(u,i){var n,t=u.prefixCls,d=u.className,v=u.record,b=u.index,y=u.dataIndex,_=u.render,m=u.children,g=u.component,E=g===void 0?"td":g,o=u.colSpan,x=u.rowSpan,A=u.fixLeft,O=u.fixRight,D=u.firstFixLeft,I=u.lastFixLeft,F=u.firstFixRight,z=u.lastFixRight,ne=u.appendNode,j=u.additionalProps,G=j===void 0?{}:j,X=u.ellipsis,Z=u.align,K=u.rowType,q=u.isSticky,ie="".concat(t,"-cell"),oe,ye;if(m)ye=m;else{var pe=Object(p.b)(v,y);if(ye=pe,_){var we=_(pe,v,b);f(we)?(ye=we.children,oe=we.props):ye=we}}Object(w.a)(ye)==="object"&&!Array.isArray(ye)&&!P.isValidElement(ye)&&(ye=null),X&&(I||F)&&(ye=P.createElement("span",{className:"".concat(ie,"-content")},ye));var fe=oe||{},Te=fe.colSpan,Fe=fe.rowSpan,De=fe.style,Me=fe.className,Ue=Object(U.a)(fe,["colSpan","rowSpan","style","className"]),ve=Te!==void 0?Te:o,ce=Fe!==void 0?Fe:x;if(ve===0||ce===0)return null;var Ie={},Ne=typeof A=="number",Xe=typeof O=="number";Ne&&(Ie.position="sticky",Ie.left=A),Xe&&(Ie.position="sticky",Ie.right=O);var ee={};Z&&(ee.textAlign=Z);var k,N=X===!0?{showTitle:!0}:X;N&&(N.showTitle||K==="header")&&(typeof ye=="string"||typeof ye=="number"?k=ye.toString():P.isValidElement(ye)&&typeof ye.props.children=="string"&&(k=ye.props.children));var $=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:k},Ue),G),{},{colSpan:ve&&ve!==1?ve:null,rowSpan:ce&&ce!==1?ce:null,className:T()(ie,d,(n={},Object(ae.a)(n,"".concat(ie,"-fix-left"),Ne),Object(ae.a)(n,"".concat(ie,"-fix-left-first"),D),Object(ae.a)(n,"".concat(ie,"-fix-left-last"),I),Object(ae.a)(n,"".concat(ie,"-fix-right"),Xe),Object(ae.a)(n,"".concat(ie,"-fix-right-first"),F),Object(ae.a)(n,"".concat(ie,"-fix-right-last"),z),Object(ae.a)(n,"".concat(ie,"-ellipsis"),X),Object(ae.a)(n,"".concat(ie,"-with-append"),ne),Object(ae.a)(n,"".concat(ie,"-fix-sticky"),(Ne||Xe)&&q),n),G.className,Me),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},G.style),ee),Ie),De),ref:l(E)?i:null});return P.createElement(E,Object.assign({},$),ne,ye)}var c=P.forwardRef(a);c.displayName="Cell";var s=P.memo(c,function(u,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,u.record):!1});Ke.a=s},gRFJ:function(Je,Ke,B){Je.exports=[B("rdUC"),B("ynwM"),B("RELg"),B("DlR+"),B("CrYA"),B("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Je){return Je<10?"0"+Je:Je}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Je){return rx_escapable.lastIndex=0,rx_escapable.test(Je)?'"'+Je.replace(rx_escapable,function(Ke){var B=meta[Ke];return typeof B=="string"?B:"\\u"+("0000"+Ke.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Je+'"'}function str(Je,Ke){var B,ae,Q,U,w=gap,P,S=Ke[Je];S&&typeof S=="object"&&typeof S.toJSON=="function"&&(S=S.toJSON(Je)),typeof rep=="function"&&(S=rep.call(Ke,Je,S));switch(typeof S){case"string":return quote(S);case"number":return isFinite(S)?String(S):"null";case"boolean":case"null":return String(S);case"object":if(!S)return"null";if(gap+=indent,P=[],Object.prototype.toString.apply(S)==="[object Array]"){for(U=S.length,B=0;B0&&!this.paused&&!this.ended&&this.readyState>2}});function n(v,b){return v-b}function t(v){v.sort(n);for(var b=0,y=0;y1&&arguments[1]!==void 0?arguments[1]:!1,Oe={point:K.current.currentTime};$?(Oe.log_id=$,Oe.watch_duration=t(Le),Oe.total_duration=k):(x?(Oe.video_id=parseInt(g,10),Oe.course_id=x):Oe.video_id=g,Oe.duration=ee,Oe.device=Ie),Re&&(Oe.ed="1");function he(){return be.apply(this,arguments)}function be(){return be=Object(U.a)(P.a.mark(function Ce(){var xe;return P.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Ae=!0,Qe.next=3,E(Oe);case 3:xe=Qe.sent,$=xe,Ae=!1,Pe&&Pe();case 7:case"end":return Qe.stop()}},Ce)})),be.apply(this,arguments)}he()},[g,x]);Object(S.useEffect)(function(){Q.b.destroy();var Pe=null;return T.a.isSupported&&Z&&_&&(_==null?void 0:_.indexOf(".m3u8"))<0?(Pe=T.a.createPlayer({type:"flv",volume:.8,cors:!0,url:_,muted:!1}),K.current&&(Pe.attachMediaElement(K.current),Pe.load())):K.current.setAttribute("src",_),Ze(),function(){Pe&&(Pe.unload(),Pe.pause(),Pe.destroy(),Pe=null)}},[K,Z,_]);function Ye(){K.current.paused?(oe.current.style.display="none",ye.current.style.display="block"):(oe.current.style.display="block",ye.current.style.display="none")}function Ze(){De.current.style.display="none",Ue.current.style.display="none",Me.current.style.display="none",K.current.muted||K.current.volume===0?De.current.style.display="block":K.current.volume>0&&K.current.volume<=.5?Ue.current.style.display="block":Me.current.style.display="block"}Object(S.useEffect)(function(){var Pe=document.getElementById("play"),Re=document.querySelectorAll(".playback-icons use");function Oe(){F(),A&&!Ne.current&&(K.current.currentTime=A),Ne.current=!0,Le.push(K.current.currentTime),V||(V=!0,m&&ke())}function he(){return be.apply(this,arguments)}function be(){return be=Object(U.a)(P.a.mark(function $e(){return P.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:Ye(),Le.push(K.current.currentTime),m&&ke(function(){$=null,N=0,V=!1,Ae=!1,at=!1,Le=[],k=0,me=1},!0);case 3:case"end":return je.stop()}},$e)})),be.apply(this,arguments)}function Ce(){pe.current.value=Math.round(K.current.currentTime),we.current.value=Math.round(K.current.currentTime)}function xe(){var $e=i(Math.round(K.current.currentTime));Te.current.innerText="".concat($e.hour>0?$e.hour+":":"").concat($e.minutes,":").concat($e.seconds),Te.current.setAttribute("datetime","".concat($e.hour>0?" "+$e.hour+" ":"").concat($e.minutes,"m ").concat($e.seconds,"s"))}function Be(){var $e=Math.round(K.current.duration);pe.current.setAttribute("max",$e),we.current.setAttribute("max",$e);var _e=i($e);fe.current.innerText="".concat(_e.hour>0?_e.hour+":":"").concat(_e.minutes,":").concat(_e.seconds),fe.current.setAttribute("datetime","".concat(_e.hour>0?" "+_e.hour+" ":"").concat(_e.minutes,"m ").concat(_e.seconds,"s"))}function Qe(){var $e=Math.round(K.current.duration);pe.current.setAttribute("max",$e),we.current.setAttribute("max",$e);var _e=i($e);fe.current.innerText="".concat(_e.hour>0?_e.hour+":":"").concat(_e.minutes,":").concat(_e.seconds),fe.current.setAttribute("datetime","".concat(_e.hour>0?" "+_e.hour+" ":"").concat(_e.minutes,"m ").concat(_e.seconds,"s")),Ce(),xe();var je=q.current.getBoundingClientRect(),ct=je.width,et=je.height,At=je.x,Ct=je.y;if(At<0||Ct<0||!ct)return;if(!at){var lt=K.current.currentTime,gt=lt-N;Math.abs(gt)<10?(k+=Math.abs(gt),N=lt,Ae||k-me*Y>=0&&(me++,Le.push(N),m&&ke())):(N=lt,m&&ke())}}function rt(){at=!0}function dt(){K.current.playing&&Le.push(K.current.currentTime,N),N=K.current.currentTime,at=!1}function xt(){ee=K.current.duration,ee<=20&&(Y=ee/3),K.current.addEventListener("play",Oe)}function _t($e){$e.preventDefault(),Object(c.a)()?(K.current.style.width="100%",K.current.style.height="100%"):K.current.style.cssText=""}function wt(){D()}function st($e){var _e=$e.target.dataset.seek?$e.target.dataset.seek:$e.target.value;K.current.currentTime=_e,we.current.value=_e,pe.current.value=_e}function ut($e){var _e=Math.round($e.offsetX/$e.target.clientWidth*parseInt($e.target.getAttribute("max"),10));pe.current.setAttribute("data-seek",_e);var je=i(_e);Fe.current.textContent="".concat(je.hour>0?je.hour+":":"").concat(je.minutes,":").concat(je.seconds);var ct=K.current.getBoundingClientRect();Fe.current.style.left="".concat($e.pageX-ct.left,"px")}return ie.current.addEventListener(Object(c.c)(),_t),K.current.addEventListener("canplay",xt),K.current.addEventListener("ended",he),K.current.addEventListener("seeking",rt),K.current.addEventListener("seeked",dt),K.current.addEventListener("loadedmetadata",Be),pe.current.addEventListener("mousemove",ut),pe.current.addEventListener("input",st),K.current.addEventListener("timeupdate",Qe),K.current.addEventListener("pause",wt),K.current.addEventListener("volumechange",Ze),function(){K.current.removeEventListener("canplay",xt),K.current.removeEventListener("play",Oe),K.current.removeEventListener("ended",he),K.current.removeEventListener("seeking",rt),K.current.removeEventListener("seeked",dt),pe.current.removeEventListener("mousemove",ut),pe.current.removeEventListener("input",st),K.current.removeEventListener("timeupdate",Qe),K.current.removeEventListener("pause",wt),K.current.removeEventListener("loadedmetadata",Be),K.current.removeEventListener("volumechange",Ze),K.current.playing&&(Le.push(N,K.current.currentTime),m&&ke())}},[K,_]),Object(S.useEffect)(function(){if(K.current.onended=function(){ne(K)},K.current.oncontextmenu=function(){return!1},(_==null?void 0:_.indexOf(".m3u8"))>-1){if(K.current.canPlayType("application/vnd.apple.mpegurl"))K.current.src=_;else if(p.a.isSupported()){var Pe=new p.a;Pe.loadSource(_),Pe.attachMedia(K.current)}}},[_]),Object(S.useEffect)(function(){K.current.playbackRate=G},[G]);var Ve=function(){K.current.paused||K.current.ended?K.current.play():K.current.pause(),Ye()};function He(){K.current.muted=!K.current.muted,K.current.muted?(ve.current.setAttribute("data-volume",volume.value),ve.current.value=0):ve.current.value=ve.current.dataset.volume}return C.a.createElement("div",{style:{position:"relative"},ref:ie},C.a.createElement("div",{ref:q,className:"".concat(u.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(u.a.animate__loop)},Xe?Xe.login:" "),C.a.createElement("div",{className:u.a.container},C.a.createElement("div",{className:u.a["video-container"],id:"video-container"},C.a.createElement("div",{className:u.a["playback-animation"],id:"playback-animation"},C.a.createElement("svg",{className:u.a["playback-icons"]},C.a.createElement("use",{className:"hidden",href:"#play-icon"}),C.a.createElement("use",{href:"#pause"}))),C.a.createElement("video",{className:u.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:K,autoPlay:!1}),C.a.createElement("div",{className:"".concat(u.a["video-controls"]," "),id:"video-controls"},C.a.createElement("div",{className:u.a["bottom-controls"]},C.a.createElement("div",{className:u.a["left-controls"]},C.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ve},C.a.createElement("svg",{className:u.a["playback-icons"]},C.a.createElement("use",{ref:ye,href:"#play-icon"}),C.a.createElement("use",{ref:oe,style:{display:"none"},href:"#pause"}))),C.a.createElement("div",{className:u.a.time},C.a.createElement("time",{id:"time-elapsed",ref:Te},"00:00"),C.a.createElement("span",null," / "),C.a.createElement("time",{id:"duration",ref:fe},"00:00"))),C.a.createElement("div",{className:u.a["right-controls"]},C.a.createElement(l.CopyToClipboard,{text:_,onCopy:function(){return Q.b.success("\u590D\u5236\u6210\u529F")}},C.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},C.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),C.a.createElement("div",{className:u.a["volume-controls"]},C.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:u.a["volume-button"],id:"volume-button",onClick:He},C.a.createElement("i",{ref:De,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),C.a.createElement("i",{ref:Ue,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),C.a.createElement("i",{ref:Me,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),C.a.createElement("input",{className:u.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:ve,style:{display:"none"},onClick:Ze})),C.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:u.a["fullscreen-button"],onClick:function(){Object(c.a)()?Object(c.b)():Object(c.d)(ie.current)}},C.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),C.a.createElement("div",{className:u.a["video-progress"]},C.a.createElement("progress",{ref:we,value:"0",min:"0"}),C.a.createElement("input",{className:u.a.seek,ref:pe,value:"0",min:"0",type:"range",step:"1"}),C.a.createElement("div",{className:u.a["seek-tooltip"],ref:Fe,id:"seek-tooltip"},"00:00"))))),C.a.createElement("svg",{style:{display:"none"}},C.a.createElement("defs",null,C.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),C.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),C.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),C.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),C.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),C.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),C.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),C.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},C.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(Je,Ke,B){},je13:function(Je,Ke,B){var ae=B("5nXd"),Q=B("gRFJ"),U=[B("uQRt")];Je.exports=ae.createStore(Q,U)},kSUc:function(Je,Ke,B){},"kaH+":function(Je,Ke,B){"use strict";var ae=B("+L6B"),Q=B("2/Rp"),U=B("tJVT"),w=B("cDcd"),P=B.n(w),S=B("UZu5"),C=B.n(S),T=B("dhSg"),h=B("rLCj"),p=B("dF/Y"),f=B("4i/N");Ke.a=function(){var l=Object(w.useState)(""),a=Object(U.a)(l,2),c=a[0],s=a[1],u=Object(w.useState)(0),i=Object(U.a)(u,2),n=i[0],t=i[1],d=Object(w.useRef)("");Object(w.useEffect)(function(){var E=T.a.subscribe("preview-image",function(o){s(o),document.body.style.overflow="hidden"});return E},[]),Object(w.useEffect)(function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}},[]),Object(w.useEffect)(function(){d.current=c},[c]);function v(E){E.keyCode==27&&d.current&&b()}function b(){document.body.style.overflow="auto",s("")}function y(){t(n+90)}var _=Object(w.useRef)(),m=Object(w.useRef)(),g=function(o){(o.nativeEvent.target===_.current||o.nativeEvent.target===m.current)&&b()};return P.a.createElement(w.Fragment,null,c?P.a.createElement("div",{className:"image-preview-container",ref:_,onClick:g},P.a.createElement("div",{className:"button-group"},P.a.createElement(Q.a,{onClick:y},"\u65CB\u8F6C",P.a.createElement(h.a,null)),P.a.createElement(Q.a,{href:c},"\u4E0B\u8F7D",P.a.createElement(p.a,null)),P.a.createElement(Q.a,{onClick:b},"\u5173\u95ED",P.a.createElement(f.a,null))),P.a.createElement("div",{className:"preview-wrp-group",ref:m},P.a.createElement("img",{className:"image-preview",src:c,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(n,"deg)")}}))):null)}},kovY:function(Je,Ke,B){Je.exports=B.p+"static/e.eabfa286.svg"},lOMy:function(Je,Ke,B){},lZu9:function(Je,Ke,B){(function(ae){ae(B("VrN/"),B("1eCo"),B("8EBN"))})(function(ae){"use strict";ae.defineMode("markdown",function(Q,U){var w=ae.getMode(Q,"text/html"),P=w.name=="null";function S(j){if(ae.findModeByName){var G=ae.findModeByName(j);G&&(j=G.mime||G.mimes[0])}var X=ae.getMode(Q,j);return X.name=="null"?null:X}U.highlightFormatting===void 0&&(U.highlightFormatting=!1),U.maxBlockquoteDepth===void 0&&(U.maxBlockquoteDepth=0),U.taskLists===void 0&&(U.taskLists=!1),U.strikethrough===void 0&&(U.strikethrough=!1),U.emoji===void 0&&(U.emoji=!1),U.fencedCodeBlockHighlighting===void 0&&(U.fencedCodeBlockHighlighting=!0),U.fencedCodeBlockDefaultMode===void 0&&(U.fencedCodeBlockDefaultMode="text/plain"),U.xml===void 0&&(U.xml=!0),U.tokenTypeOverrides===void 0&&(U.tokenTypeOverrides={});var C={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var T in C)C.hasOwnProperty(T)&&U.tokenTypeOverrides[T]&&(C[T]=U.tokenTypeOverrides[T]);var h=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,f=/^\[(x| )\](?=\s)/i,l=U.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,a=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,u=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,n=" ";function t(j,G,X){return G.f=G.inline=X,X(j,G)}function d(j,G,X){return G.f=G.block=X,X(j,G)}function v(j){return!j||!/\S/.test(j.string)}function b(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==_){var G=P;if(!G){var X=ae.innerMode(w,j.htmlState);G=X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText}G&&(j.f=o,j.block=y,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function y(j,G){var X=j.column()===G.indentation,Z=v(G.prevLine.stream),K=G.indentedCode,q=G.prevLine.hr,ie=G.list!==!1,oe=(G.listStack[G.listStack.length-1]||0)+3;G.indentedCode=!1;var ye=G.indentation;if(G.indentationDiff===null&&(G.indentationDiff=G.indentation,ie)){for(G.list=null;ye=4&&(K||G.prevLine.fencedCodeEnd||G.prevLine.header||Z))return j.skipToEnd(),G.indentedCode=!0,C.code;if(j.eatSpace())return null;if(X&&G.indentation<=oe&&(fe=j.match(l))&&fe[1].length<=6)return G.quote=0,G.header=fe[1].length,G.thisLine.header=!0,U.highlightFormatting&&(G.formatting="header"),G.f=G.inline,g(G);if(G.indentation<=oe&&j.eat(">"))return G.quote=X?1:G.quote+1,U.highlightFormatting&&(G.formatting="quote"),j.eatSpace(),g(G);if(!we&&!G.setext&&X&&G.indentation<=oe&&(fe=j.match(p))){var Te=fe[1]?"ol":"ul";return G.indentation=ye+j.current().length,G.list=!0,G.quote=0,G.listStack.push(G.indentation),G.em=!1,G.strong=!1,G.code=!1,G.strikethrough=!1,U.taskLists&&j.match(f,!1)&&(G.taskList=!0),G.f=G.inline,U.highlightFormatting&&(G.formatting=["list","list-"+Te]),g(G)}else{if(X&&G.indentation<=oe&&(fe=j.match(s,!0)))return G.quote=0,G.fencedEndRE=new RegExp(fe[1]+"+ *$"),G.localMode=U.fencedCodeBlockHighlighting&&S(fe[2]||U.fencedCodeBlockDefaultMode),G.localMode&&(G.localState=ae.startState(G.localMode)),G.f=G.block=m,U.highlightFormatting&&(G.formatting="code-block"),G.code=-1,g(G);if(G.setext||(!pe||!ie)&&!G.quote&&G.list===!1&&!G.code&&!we&&!u.test(j.string)&&(fe=j.lookAhead(1))&&(fe=fe.match(a)))return G.setext?(G.header=G.setext,G.setext=0,j.skipToEnd(),U.highlightFormatting&&(G.formatting="header")):(G.header=fe[0].charAt(0)=="="?1:2,G.setext=G.header),G.thisLine.header=!0,G.f=G.inline,g(G);if(we)return j.skipToEnd(),G.hr=!0,G.thisLine.hr=!0,C.hr;if(j.peek()==="[")return t(j,G,I)}return t(j,G,G.inline)}function _(j,G){var X=w.token(j,G.htmlState);if(!P){var Z=ae.innerMode(w,G.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||G.md_inside&&j.current().indexOf(">")>-1)&&(G.f=o,G.block=y,G.htmlState=null)}return X}function m(j,G){var X=G.listStack[G.listStack.length-1]||0,Z=G.indentation=j.quote?G.push(C.formatting+"-"+j.formatting[X]+"-"+j.quote):G.push("error"))}if(j.taskOpen)return G.push("meta"),G.length?G.join(" "):null;if(j.taskClosed)return G.push("property"),G.length?G.join(" "):null;if(j.linkHref?G.push(C.linkHref,"url"):(j.strong&&G.push(C.strong),j.em&&G.push(C.em),j.strikethrough&&G.push(C.strikethrough),j.emoji&&G.push(C.emoji),j.linkText&&G.push(C.linkText),j.code&&G.push(C.code),j.image&&G.push(C.image),j.imageAltText&&G.push(C.imageAltText,"link"),j.imageMarker&&G.push(C.imageMarker)),j.header&&G.push(C.header,C.header+"-"+j.header),j.quote&&(G.push(C.quote),!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=j.quote?G.push(C.quote+"-"+j.quote):G.push(C.quote+"-"+U.maxBlockquoteDepth)),j.list!==!1){var Z=(j.listStack.length-1)%3;Z?Z===1?G.push(C.list2):G.push(C.list3):G.push(C.list1)}return j.trailingSpaceNewLine?G.push("trailing-space-new-line"):j.trailingSpace&&G.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),G.length?G.join(" "):null}function E(j,G){return j.match(c,!0)?g(G):void 0}function o(j,G){var X=G.text(j,G);if(typeof X!="undefined")return X;if(G.list)return G.list=null,g(G);if(G.taskList){var Z=j.match(f,!0)[1]===" ";return Z?G.taskOpen=!0:G.taskClosed=!0,U.highlightFormatting&&(G.formatting="task"),G.taskList=!1,g(G)}if(G.taskOpen=!1,G.taskClosed=!1,G.header&&j.match(/^#+$/,!0))return U.highlightFormatting&&(G.formatting="header"),g(G);var K=j.next();if(G.linkTitle){G.linkTitle=!1;var q=K;K==="("&&(q=")"),q=(q+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ie="^\\s*(?:[^"+q+"\\\\]+|\\\\\\\\|\\\\.)"+q;if(j.match(new RegExp(ie),!0))return C.linkHref}if(K==="`"){var oe=G.formatting;U.highlightFormatting&&(G.formatting="code"),j.eatWhile("`");var ye=j.current().length;if(G.code==0&&(!G.quote||ye==1))return G.code=ye,g(G);if(ye==G.code){var pe=g(G);return G.code=0,pe}else return G.formatting=oe,g(G)}else if(G.code)return g(G);if(K==="\\"&&(j.next(),U.highlightFormatting)){var we=g(G),fe=C.formatting+"-escape";return we?we+" "+fe:fe}if(K==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return G.imageMarker=!0,G.image=!0,U.highlightFormatting&&(G.formatting="image"),g(G);if(K==="["&&G.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return G.imageMarker=!1,G.imageAltText=!0,U.highlightFormatting&&(G.formatting="image"),g(G);if(K==="]"&&G.imageAltText){U.highlightFormatting&&(G.formatting="image");var we=g(G);return G.imageAltText=!1,G.image=!1,G.inline=G.f=A,we}if(K==="["&&!G.image)return G.linkText&&j.match(/^.*?\]/)||(G.linkText=!0,U.highlightFormatting&&(G.formatting="link")),g(G);if(K==="]"&&G.linkText){U.highlightFormatting&&(G.formatting="link");var we=g(G);return G.linkText=!1,G.inline=G.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?A:o,we}if(K==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){G.f=G.inline=x,U.highlightFormatting&&(G.formatting="link");var we=g(G);return we?we+=" ":we="",we+C.linkInline}if(K==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){G.f=G.inline=x,U.highlightFormatting&&(G.formatting="link");var we=g(G);return we?we+=" ":we="",we+C.linkEmail}if(U.xml&&K==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Te=j.string.indexOf(">",j.pos);if(Te!=-1){var Fe=j.string.substring(j.start,Te);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Fe)&&(G.md_inside=!0)}return j.backUp(1),G.htmlState=ae.startState(w),d(j,G,_)}if(U.xml&&K==="<"&&j.match(/^\/\w*?>/))return G.md_inside=!1,"tag";if(K==="*"||K==="_"){for(var De=1,Me=j.pos==1?" ":j.string.charAt(j.pos-2);De<3&&j.eat(K);)De++;var Ue=j.peek()||" ",ve=!/\s/.test(Ue)&&(!i.test(Ue)||/\s/.test(Me)||i.test(Me)),ce=!/\s/.test(Me)&&(!i.test(Me)||/\s/.test(Ue)||i.test(Ue)),Ie=null,Ne=null;if(De%2&&(!G.em&&ve&&(K==="*"||!ce||i.test(Me))?Ie=!0:G.em==K&&ce&&(K==="*"||!ve||i.test(Ue))&&(Ie=!1)),De>1&&(!G.strong&&ve&&(K==="*"||!ce||i.test(Me))?Ne=!0:G.strong==K&&ce&&(K==="*"||!ve||i.test(Ue))&&(Ne=!1)),Ne!=null||Ie!=null){U.highlightFormatting&&(G.formatting=Ie==null?"strong":Ne==null?"em":"strong em"),Ie===!0&&(G.em=K),Ne===!0&&(G.strong=K);var pe=g(G);return Ie===!1&&(G.em=!1),Ne===!1&&(G.strong=!1),pe}}else if(K===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return g(G);j.backUp(1)}if(U.strikethrough){if(K==="~"&&j.eatWhile(K)){if(G.strikethrough){U.highlightFormatting&&(G.formatting="strikethrough");var pe=g(G);return G.strikethrough=!1,pe}else if(j.match(/^[^\s]/,!1))return G.strikethrough=!0,U.highlightFormatting&&(G.formatting="strikethrough"),g(G)}else if(K===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return g(G);j.backUp(2)}}if(U.emoji&&K===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){G.emoji=!0,U.highlightFormatting&&(G.formatting="emoji");var Xe=g(G);return G.emoji=!1,Xe}return K===" "&&(j.match(/^ +$/,!1)?G.trailingSpace++:G.trailingSpace&&(G.trailingSpaceNewLine=!0)),g(G)}function x(j,G){var X=j.next();if(X===">"){G.f=G.inline=o,U.highlightFormatting&&(G.formatting="link");var Z=g(G);return Z?Z+=" ":Z="",Z+C.linkInline}return j.match(/^[^>]+/,!0),C.linkInline}function A(j,G){if(j.eatSpace())return null;var X=j.next();return X==="("||X==="["?(G.f=G.inline=D(X==="("?")":"]"),U.highlightFormatting&&(G.formatting="link-string"),G.linkHref=!0,g(G)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(j){return function(G,X){var Z=G.next();if(Z===j){X.f=X.inline=o,U.highlightFormatting&&(X.formatting="link-string");var K=g(X);return X.linkHref=!1,K}return G.match(O[j]),X.linkHref=!0,g(X)}}function I(j,G){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(G.f=F,j.next(),U.highlightFormatting&&(G.formatting="link"),G.linkText=!0,g(G)):t(j,G,o)}function F(j,G){if(j.match(/^\]:/,!0)){G.f=G.inline=z,U.highlightFormatting&&(G.formatting="link");var X=g(G);return G.linkText=!1,X}return j.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function z(j,G){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?G.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),G.f=G.inline=o,C.linkHref+" url")}var ne={startState:function(){return{f:y,prevLine:{stream:null},thisLine:{stream:null},block:y,htmlState:null,indentation:0,inline:o,text:E,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&ae.copyState(w,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?ae.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,G){if(G.formatting=!1,j!=G.thisLine.stream){if(G.header=0,G.hr=!1,j.match(/^\s*$/,!0))return b(G),null;if(G.prevLine=G.thisLine,G.thisLine={stream:j},G.taskList=!1,G.trailingSpace=0,G.trailingSpaceNewLine=!1,!G.localState&&(G.f=G.block,G.f!=_)){var X=j.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(G.indentation=X,G.indentationDiff=null,X>0)return null}}return G.f(j,G)},innerMode:function(j){return j.block==_?{state:j.htmlState,mode:w}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:ne}},indent:function(j,G,X){return j.block==_&&w.indent?w.indent(j.htmlState,G,X):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,G,X):ae.Pass},blankLine:b,getType:g,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return ne},"xml"),ae.defineMIME("text/markdown","markdown"),ae.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return T});var ae=B("cDcd"),Q=B("biw7"),U=B("fyJ8");function w(h){var p=h.className,f=h.index,l=h.children,a=h.colSpan,c=h.rowSpan,s=ae.useContext(Q.a),u=s.prefixCls,i=s.fixedInfoList,n=i[f];return ae.createElement(U.a,Object.assign({className:p,index:f,component:"td",prefixCls:u,record:null,dataIndex:null,render:function(){return{children:l,props:{colSpan:a,rowSpan:c}}}},n))}function P(h){return ae.createElement("tr",Object.assign({},h))}function S(h){var p=h.children,f=ae.useContext(Q.a),l=f.prefixCls;return ae.createElement("tfoot",{className:"".concat(l,"-summary")},p)}var C=Ke.b=S,T={Cell:w,Row:P}},nCk5:function(Je,Ke,B){Je.exports=B.p+"static/d.53bf6ae3.svg"},nWbc:function(Je,Ke,B){},oE5q:function(Je,Ke,B){Je.exports=B.p+"static/t.0b94c5c3.svg"},oFv4:function(Je,Ke,B){Je.exports=B.p+"static/internal.da228387.png"},osHv:function(Je,Ke,B){(function(ae){ae(B("VrN/"))})(function(ae){"use strict";var Q=ae.Pos;function U(i,n){return i.line-n.line||i.ch-n.ch}var w="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",P=w+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",S=new RegExp("<(/?)(["+w+"]["+P+"]*)","g");function C(i,n,t,d){this.line=n,this.ch=t,this.cm=i,this.text=i.getLine(n),this.min=d?Math.max(d.from,i.firstLine()):i.firstLine(),this.max=d?Math.min(d.to-1,i.lastLine()):i.lastLine()}function T(i,n){var t=i.cm.getTokenTypeAt(Q(i.line,n));return t&&/\btag\b/.test(t)}function h(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function p(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function f(i){for(;;){var n=i.text.indexOf(">",i.ch);if(n==-1){if(h(i))continue;return}if(!T(i,n+1)){i.ch=n+1;continue}var t=i.text.lastIndexOf("/",n),d=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,d?"selfClose":"regular"}}function l(i){for(;;){var n=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(n==-1){if(p(i))continue;return}if(!T(i,n+1)){i.ch=n;continue}S.lastIndex=n,i.ch=n;var t=S.exec(i.text);if(t&&t.index==n)return t}}function a(i){for(;;){S.lastIndex=i.ch;var n=S.exec(i.text);if(!n){if(h(i))continue;return}if(!T(i,n.index+1)){i.ch=n.index+1;continue}return i.ch=n.index+n[0].length,n}}function c(i){for(;;){var n=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(n==-1){if(p(i))continue;return}if(!T(i,n+1)){i.ch=n;continue}var t=i.text.lastIndexOf("/",n),d=t>-1&&!/\S/.test(i.text.slice(t+1,n));return i.ch=n+1,d?"selfClose":"regular"}}function s(i,n){for(var t=[];;){var d=a(i),v,b=i.line,y=i.ch-(d?d[0].length:0);if(!d||!(v=f(i)))return;if(v=="selfClose")continue;if(d[1]){for(var _=t.length-1;_>=0;--_)if(t[_]==d[2]){t.length=_;break}if(_<0&&(!n||n==d[2]))return{tag:d[2],from:Q(b,y),to:Q(i.line,i.ch)}}else t.push(d[2])}}function u(i,n){for(var t=[];;){var d=c(i);if(!d)return;if(d=="selfClose"){l(i);continue}var v=i.line,b=i.ch,y=l(i);if(!y)return;if(y[1])t.push(y[2]);else{for(var _=t.length-1;_>=0;--_)if(t[_]==y[2]){t.length=_;break}if(_<0&&(!n||n==y[2]))return{tag:y[2],from:Q(i.line,i.ch),to:Q(v,b)}}}}ae.registerHelper("fold","xml",function(i,n){for(var t=new C(i,n.line,0);;){var d=a(t);if(!d||t.line!=n.line)return;var v=f(t);if(!v)return;if(!d[1]&&v!="selfClose"){var b=Q(t.line,t.ch),y=s(t,d[2]);return y&&U(y.from,b)>0?{from:b,to:y.from}:null}}}),ae.findMatchingTag=function(i,n,t){var d=new C(i,n.line,n.ch,t);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var v=f(d),b=v&&Q(d.line,d.ch),y=v&&l(d);if(!v||!y||U(d,n)>0)return;var _={from:Q(d.line,d.ch),to:b,tag:y[2]};return v=="selfClose"?{open:_,close:null,at:"open"}:y[1]?{open:u(d,y[2]),close:_,at:"close"}:(d=new C(i,b.line,b.ch,t),{open:_,close:s(d,y[2]),at:"open"})},ae.findEnclosingTag=function(i,n,t,d){for(var v=new C(i,n.line,n.ch,t);;){var b=u(v,d);if(!b)break;var y=new C(i,n.line,n.ch,t),_=s(y,b.tag);if(_)return{open:b,close:_}}},ae.scanForClosingTag=function(i,n,t,d){var v=new C(i,n.line,n.ch,d?{from:0,to:d}:null);return s(v,t)}})},p5ED:function(Je,Ke,B){"use strict";var ae=B("+L6B"),Q=B("2/Rp"),U=B("5Dmo"),w=B("3S7+"),P=B("k1fw"),S=B("tJVT"),C=B("cDcd"),T=B.n(C),h=B("vHTk"),p=B.n(h),f=B("yEEn"),l=B("ZW9T"),a=B("1vsH");Ke.a=function(c){var s=c.name,u=c.data,i=c.theme,n=c.type,t=c.filename,d=c.monacoEditor,v=c.className,b=c.style,y=c.close,_=c.onClose,m=c.hasMask,g=Object(C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(S.a)(g,2),o=E[0],x=E[1],A=Object(C.useState)(""),O=Object(S.a)(A,2),D=O[0],I=O[1],F,z=1024*1024,ne=10*z,j=Object(C.useRef)();n==="office"&&(F=Object(a.V)(u).filesize,F>ne&&(n="other")),t&&(d.filename=t),Object(C.useEffect)(function(){var Z,K,q=(Z=document.cookie)===null||Z===void 0||((K=Z.replace(/\s/g,""))===null||K===void 0)?void 0:K.split(";");q==null||q.map(function(ie){var oe=ie.split("=");oe[0]==="_educoder_session"&&I(oe[1])})},[]);var G=function(){if(u.startsWith("http")||u.startsWith("blob:")){X();return}Object(a.z)(t||"educoder",u,t)},X=function(){Object(a.x)(t||"educoder",decodeURIComponent(u))};return console.log("data:",u,"fileanme:",t," name:",s),T.a.createElement("div",{style:Object(P.a)({},b||{}),className:"".concat(m&&p.a.bgBlack," ").concat(n?p.a.wrp:"hide")},y&&T.a.createElement("div",{className:p.a.close,ref:j},T.a.createElement(w.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return j.current}},T.a.createElement("span",{onClick:X},T.a.createElement("i",{className:"icon-quxiaozhiding"}))),T.a.createElement(w.a,{title:"\u5173\u95ED",getPopupContainer:function(){return j.current}},T.a.createElement("span",{className:"",onClick:_},T.a.createElement("i",{className:"icon-guanbi1"})))),T.a.createElement("div",{className:"".concat(p.a[v]," ").concat(v," ").concat(p.a.monaco," ").concat(n==="txt"?"show":"hide")},n==="txt"&&T.a.createElement(l.b,d)),n==="audio"&&T.a.createElement("audio",{src:"".concat(u!=null&&u.startsWith("/")||(u==null?void 0:u.indexOf("https://"))>-1?u:"data:audio/mp3;base64,").concat(u),autoPlay:!0}),n==="video"&&T.a.createElement(T.a.Fragment,null,u!=null&&u.startsWith("/")?T.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):T.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),n==="html"&&T.a.createElement("iframe",{src:u+"&disposition=inline"}),n==="html"&&T.a.createElement("iframe",{src:u+"&disposition=inline"}),n==="pdf"&&T.a.createElement("embed",{className:p.a.embed,src:u}),n==="image"&&T.a.createElement(T.a.Fragment,null,T.a.createElement("img",{src:"".concat(u!=null&&u.startsWith("/")||(u==null?void 0:u.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(u)})),n==="other"&&T.a.createElement("div",null,T.a.createElement(Q.a,{type:"primary",size:"large",onClick:G},T.a.createElement(f.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(n==="download"||n==="office")&&T.a.createElement(Q.a,{type:"primary",size:"large",onClick:G},T.a.createElement(f.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Je,Ke,B){},pYxM:function(Je,Ke,B){Je.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ppsT:function(Je,Ke,B){(function(ae){var Q,Q;!function(U){if(!0)window.OSS=U(),Je.exports=U();else var w}(function(){var U;return function(){function w(P,S,C){function T(f,l){if(!S[f]){if(!P[f]){var a=typeof Q=="function"&&Q;if(!l&&a)return Q(f,!0);if(h)return h(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var s=S[f]={exports:{}};P[f][0].call(s.exports,function(u){return T(P[f][1][u]||u)},s,s.exports,w,P,S,C)}return S[f].exports}for(var h=typeof Q=="function"&&Q,p=0;p0?K["Content-Type"]=Z.mime:K["Content-Type"]=y.getType(Z.mime||v.extname(Z.object||""))||"application/octet-stream"),Z.content&&(K["Content-Md5"]=d.createHash("md5").update(new T(Z.content,"utf8")).digest("base64"),K["Content-Length"]||(K["Content-Length"]=Z.content.length));var q=this._getResource(Z);K.authorization=this.authorization(Z.method,q,Z.subres,K);var ie=this._getReqUrl(Z);t("request %s %s, with headers %j, !!stream: %s",Z.method,ie,K,!!Z.stream);var oe=Z.timeout||this.options.timeout;return{url:ie,params:{agent:this.agent,method:Z.method,content:Z.content,stream:Z.stream,headers:K,timeout:oe,writeStream:Z.writeStream,customResponse:Z.customResponse,ctx:Z.ctx||this.ctx}}},X.request=u.default.mark(function Z(K){var q,ie,oe,ye;return u.default.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return q=this.createRequest(K),ie=void 0,oe=void 0,pe.prev=3,pe.next=6,this.urllib.request(q.url,q.params);case 6:ie=pe.sent,t("response %s %s, got %s, headers: %j",K.method,q.url,ie.status,ie.headers),pe.next=13;break;case 10:pe.prev=10,pe.t0=pe.catch(3),oe=pe.t0;case 13:if(ye=void 0,!ie||!K.successStatuses||K.successStatuses.indexOf(ie.status)!==-1){pe.next=26;break}return pe.next=17,this.requestError(ie);case 17:if(ye=pe.sent,ye.code!=="RequestTimeTooSkewed"){pe.next=23;break}return this.options.amendTimeSkewed=+new Date(ye.serverTime)-new Date,pe.next=22,this.request(K);case 22:return pe.abrupt("return",pe.sent);case 23:ye.params=K,pe.next=30;break;case 26:if(!oe){pe.next=30;break}return pe.next=29,this.requestError(oe);case 29:ye=pe.sent;case 30:if(!ye){pe.next=32;break}throw ye;case 32:if(!K.xmlResponse){pe.next=36;break}return pe.next=35,this.parseXML(ie.data);case 35:ie.data=pe.sent;case 36:return pe.abrupt("return",ie);case 37:case"end":return pe.stop()}},Z,this,[[3,10]])}),X._getResource=function(Z){var K="/";return Z.bucket&&(K+=Z.bucket+"/"),Z.object&&(K+=Z.object),K},X._isIP=function(Z){return j._isIP(Z)},X._escape=function(Z){return O.encodeURIComponent(Z).replace(/%2F/g,"/")},X._getReqUrl=function(Z){var K={};b(this.options.endpoint).to(K);var q=this._isIP(K.hostname),ie=this.options.cname;!Z.bucket||ie||q||(K.host=Z.bucket+"."+K.host);var oe="/";Z.bucket&&q&&(oe+=Z.bucket+"/"),Z.object&&(oe+=this._escape(Z.object).replace(/\+/g,"%2B")),K.pathname=oe;var ye={};if(Z.query&&E(ye,Z.query),Z.subres){var pe={};x.string(Z.subres)?pe[Z.subres]="":x.array(Z.subres)?Z.subres.forEach(function(we){pe[we]=""}):pe=Z.subres,E(ye,pe)}return K.query=ye,o.format(K)},X._getUserAgent=function(){var Z=C&&C.browser?"js":"nodejs",K="aliyun-sdk-"+Z+"/"+I.version,q=A.description;return!q&&C&&(q="Node.js "+C.version.slice(1)+" on "+C.platform+" "+C.arch),this._checkUserAgent(K+" "+q)},X._checkUserAgent=function(Z){return Z.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},X.checkBrowserAndVersion=function(Z,K){return z.name===Z&&z.version.split(".")[0]===K},X.parseXML=function(Z){return function(K){T.isBuffer(Z)&&(Z=Z.toString()),_.parseString(Z,{explicitRoot:!1,explicitArray:!1},K)}},X.requestError=u.default.mark(function Z(K){var q,ie,oe,ye;return u.default.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:if(q=null,K.data&&K.data.length){pe.next=5;break}K.status===-1||K.status===-2?(q=new Error(K.message),q.name=K.name,q.status=K.status,q.code=K.name):(K.status===404?(q=new Error("Object not exists"),q.name="NoSuchKeyError",q.status=404,q.code="NoSuchKey"):K.status===412?(q=new Error("Pre condition failed"),q.name="PreconditionFailedError",q.status=412,q.code="PreconditionFailed"):(q=new Error("Unknow error, status: "+K.status),q.name="UnknowError",q.status=K.status),q.requestId=K.headers["x-oss-request-id"],q.host=""),pe.next=30;break;case 5:return ie=String(K.data),t("request response error data: %s",ie),oe=void 0,pe.prev=8,pe.next=11,this.parseXML(ie)||{};case 11:oe=pe.sent,pe.next=21;break;case 14:return pe.prev=14,pe.t0=pe.catch(8),t(ie),pe.t0.message+=` raw xml: `+ie,pe.t0.status=K.status,pe.t0.requestId=K.headers["x-oss-request-id"],pe.abrupt("return",pe.t0);case 21:ye=oe.Message||"unknow request error, status: "+K.status,oe.Condition&&(ye+=" (condition: "+oe.Condition+")"),q=new Error(ye),q.name=oe.Code?oe.Code+"Error":"UnknowError",q.status=K.status,q.code=oe.Code,q.requestId=oe.RequestId,q.hostId=oe.HostId,q.serverTime=oe.ServerTime;case 30:return t("generate error %j",q),pe.abrupt("return",q);case 32:case"end":return pe.stop()}},Z,this,[[8,14]])})}).call(this,w("_process"),w("buffer").Buffer)},{"../common/multipart":8,"../common/signUtils":9,"../common/thunkpool.js":10,"../common/utils":11,"./../../shims/crypto/crypto.js":237,"./managed_upload":3,"./object":4,"./version":5,"./wrapper":6,_process:173,agentkeepalive:12,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,bowser:35,buffer:38,"copy-to":43,dateformat:154,debug:155,"humanize-ms":160,"is-type-of":165,"merge-descriptors":168,mime:242,path:170,platform:171,url:203,urllib:244,utility:243,xml2js:213}],3:[function(w,P,S){(function(C){"use strict";function T(b){return b&&b.__esModule?b:{default:b}}function h(b,y){if(!(this instanceof h))return new h(b,y);v.call(this,y),this.file=b,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=w("babel-runtime/core-js/array/from"),f=T(p),l=w("babel-runtime/regenerator"),a=T(l),c=w("is-type-of"),s=w("util"),u=w("path"),i=w("mime"),n=w("copy-to"),t=S;t.multipartUpload=a.default.mark(function b(y,_,m){var g,E,o,x,A,O,D,I,F;return a.default.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(this.resetCancelFlag(),m=m||{},!m.checkpoint||!m.checkpoint.uploadId){z.next=6;break}return z.next=5,this._resumeMultipart(m.checkpoint,m);case 5:return z.abrupt("return",z.sent);case 6:return g=102400,m.mime||(c.file(_)?m.mime=i.getType(u.extname(_.name)):c.blob(_)?m.mime=_.type:m.mime=i.getType(u.extname(_))),m.headers=m.headers||{},this._convertMetaToHeaders(m.meta,m.headers),z.next=12,this._getFileSize(_);case 12:if(!((E=z.sent)0&&n(x).to(O),D=this._divideParts(g,E),I=D.length,F=!1,z=a.default.mark(function we(fe,Te){var Fe,De,Me;return a.default.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(fe.isCancel()){Ue.next=21;break}return Ue.prev=1,Fe=D[Te-1],De={stream:fe._createStream(m,Fe.start,Fe.end),size:Fe.end-Fe.start},Ue.next=6,fe._uploadPart(A,o,Te,De);case 6:if(Me=Ue.sent,fe.isCancel()||F){Ue.next=13;break}if(y.doneParts.push({number:Te,etag:Me.res.headers.etag}),O.push({number:Te,etag:Me.res.headers.etag}),!_||!_.progress){Ue.next=13;break}return Ue.next=13,_.progress(x.length/I,y,Me.res);case 13:Ue.next=21;break;case 15:if(Ue.prev=15,Ue.t0=Ue.catch(1),fe.isCancel()){Ue.next=21;break}throw fe.cancel(),Ue.t0.partNum=Te,Ue.t0;case 21:case"end":return Ue.stop()}},we,this,[[1,15]])}),ne=(0,f.default)(new Array(I),function(we,fe){return fe+1}),j=O.map(function(we){return we.number}),G=ne.filter(function(we){return j.indexOf(we)<0}),X=5,Z=_.parallel||X,!this.checkBrowserAndVersion("Internet Explorer","10")&&Z!==1){pe.next=26;break}K=0;case 16:if(!(K0)){pe.next=37;break}throw this.resetCancelFlag(),ye=oe[0],ye.message="Failed to upload some parts with error: "+ye.toString()+" part_num: "+ye.partNum,ye;case 37:if(!this.isCancel()){pe.next=40;break}throw q=null,this._makeCancelEvent();case 40:return pe.next=42,this.completeMultipartUpload(A,o,O,_);case 42:return pe.abrupt("return",pe.sent);case 43:case"end":return pe.stop()}},b,this)}),c.file=function(b){return typeof File!="undefined"&&b instanceof File},c.blob=function(b){return typeof Blob!="undefined"&&b instanceof Blob},t._getFileSize=a.default.mark(function b(y){var _;return a.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!c.buffer(y)){m.next=4;break}return m.abrupt("return",y.length);case 4:if(!c.blob(y)&&!c.file(y)){m.next=6;break}return m.abrupt("return",y.size);case 6:if(!c.string(y)){m.next=11;break}return m.next=9,this._statFile(y);case 9:return _=m.sent,m.abrupt("return",_.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return m.stop()}},b,this)});var d=w("stream"),v=d.Readable;s.inherits(h,v),h.prototype.readFileAndPush=function(b){if(this.fileBuffer)for(var y=!0;y&&this.fileBuffer&&this.startthis.fileBuffer.length?this.fileBuffer.length:m,this.start=m,y=this.push(this.fileBuffer.slice(_,m))}},h.prototype._read=function(b){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||this.start===0&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);b=b||16384;var y=this;this.reader.onload=function(_){y.fileBuffer=new C(new Uint8Array(_.target.result)),y.file=null,y.readFileAndPush(b)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(b)},t._createStream=function(b,y,_){if(c.blob(b)||c.file(b))return new h(b.slice(y,_));throw new Error("_createStream requires File/String.")},t._getPartSize=function(b,y){return y?Math.max(Math.ceil(b/1e4),y):1048576},t._divideParts=function(b,y){for(var _=Math.ceil(b/y),m=[],g=0;g<_;g++){var E=y*g,o=Math.min(E+y,b);m.push({start:E,end:o})}return m},t._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,w("buffer").Buffer)},{"babel-runtime/core-js/array/from":16,"babel-runtime/regenerator":33,buffer:38,"copy-to":43,"is-type-of":165,mime:242,path:170,stream:195,util:207}],4:[function(w,P,S){"use strict";function C(y){return y&&y.__esModule?y:{default:y}}var T=w("babel-runtime/core-js/object/keys"),h=C(T),p=w("babel-runtime/regenerator"),f=C(p),l=w("debug")("ali-oss:object"),a=w("utility"),c=w("fs"),s=w("is-type-of"),u=w("url"),i=w("copy-to"),n=w("path"),t=w("mime"),d=w("../common/callback"),v=w("../common/signUtils"),b=S;b.append=f.default.mark(function y(_,m,g){var E;return f.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return g=g||{},g.position===void 0&&(g.position="0"),g.subres={append:"",position:g.position},g.method="POST",o.next=6,this.put(_,m,g);case 6:return E=o.sent,E.nextAppendPosition=E.res.headers["x-oss-next-append-position"],o.abrupt("return",E);case 9:case"end":return o.stop()}},y,this)}),b.put=f.default.mark(function y(_,m,g){var E,o,x,A,O,D;return f.default.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(E=void 0,g=g||{},!s.buffer(m)){I.next=6;break}E=m,I.next=18;break;case 6:if(!s.blob(m)&&!s.file(m)){I.next=17;break}return g.mime||(s.file(m)?g.mime=t.getType(n.extname(m.name)):g.mime=m.type),o=this._createStream(m,0,m.size),I.next=11,this._getFileSize(m);case 11:return g.contentLength=I.sent,I.next=14,this.putStream(_,o,g);case 14:return I.abrupt("return",I.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return g.headers=g.headers||{},this._convertMetaToHeaders(g.meta,g.headers),x=g.method||"PUT",A=this._objectRequestParams(x,_,g),d.encodeCallback(A,g),A.mime=g.mime,A.content=E,A.successStatuses=[200],I.next=28,this.request(A);case 28:return O=I.sent,D={name:_,url:this._objectUrl(_),res:O.res},A.headers&&A.headers["x-oss-callback"]&&(D.data=JSON.parse(O.data.toString())),I.abrupt("return",D);case 32:case"end":return I.stop()}},y,this)}),b.putStream=f.default.mark(function y(_,m,g){var E,o,x,A;return f.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return g=g||{},g.headers=g.headers||{},g.contentLength?g.headers["Content-Length"]=g.contentLength:g.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(g.meta,g.headers),E=g.method||"PUT",o=this._objectRequestParams(E,_,g),d.encodeCallback(o,g),o.mime=g.mime,o.stream=m,o.successStatuses=[200],O.next=12,this.request(o);case 12:return x=O.sent,A={name:_,url:this._objectUrl(_),res:x.res},o.headers&&o.headers["x-oss-callback"]&&(A.data=JSON.parse(x.data.toString())),O.abrupt("return",A);case 16:case"end":return O.stop()}},y,this)}),b.head=f.default.mark(function y(_,m){var g,E,o;return f.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return g=this._objectRequestParams("HEAD",_,m),g.successStatuses=[200,304],x.next=4,this.request(g);case 4:return E=x.sent,o={meta:null,res:E.res,status:E.status},E.status===200&&(0,h.default)(E.headers).forEach(function(A){A.indexOf("x-oss-meta-")===0&&(o.meta||(o.meta={}),o.meta[A.substring(11)]=E.headers[A])}),x.abrupt("return",o);case 8:case"end":return x.stop()}},y,this)}),b.get=f.default.mark(function y(_,m,g){var E,o,x,A;return f.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return E=null,o=!1,s.writableStream(m)?E=m:s.string(m)?(E=c.createWriteStream(m),o=!0):g=m,g=g||{},g.process&&(g.subres=g.subres||{},g.subres["x-oss-process"]=g.process),x=void 0,O.prev=6,A=this._objectRequestParams("GET",_,g),A.writeStream=E,A.successStatuses=[200,206,304],O.next=12,this.request(A);case 12:x=O.sent,o&&E.destroy(),O.next=24;break;case 16:if(O.prev=16,O.t0=O.catch(6),!o){O.next=23;break}return E.destroy(),l("get error: %s, delete the exists file %s",O.t0,m),O.next=23,this._deleteFileSafe(m);case 23:throw O.t0;case 24:return O.abrupt("return",{res:x.res,content:x.data});case 25:case"end":return O.stop()}},y,this,[[6,16]])}),b.getStream=f.default.mark(function y(_,m){var g,E;return f.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},g=this._objectRequestParams("GET",_,m),g.customResponse=!0,g.successStatuses=[200,206,304],o.next=6,this.request(g);case 6:return E=o.sent,o.abrupt("return",{stream:E.res,res:{status:E.status,headers:E.headers}});case 8:case"end":return o.stop()}},y,this)}),b.delete=f.default.mark(function y(_,m){var g,E;return f.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return g=this._objectRequestParams("DELETE",_,m),g.successStatuses=[204],o.next=4,this.request(g);case 4:return E=o.sent,o.abrupt("return",{res:E.res});case 6:case"end":return o.stop()}},y,this)}),b.deleteMulti=f.default.mark(function y(_,m){var g,E,o,x,A,O;return f.default.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:for(m=m||{},g=` `,m.quiet?g+=` true `:g+=` false `,E=0;E<_.length;E++)g+=" "+a.escape(this._objectName(_[E]))+` `;return g+="",l("delete multi objects: %s",g),m.subres="delete",o=this._objectRequestParams("POST","",m),o.mime="xml",o.content=g,o.xmlResponse=!0,o.successStatuses=[200],D.next=14,this.request(o);case 14:return x=D.sent,A=x.data,O=A&&A.Deleted||null,O&&(Array.isArray(O)||(O=[O]),O=O.map(function(I){return I.Key})),D.abrupt("return",{res:x.res,deleted:O});case 19:case"end":return D.stop()}},y,this)}),b.copy=f.default.mark(function y(_,m,g){var E,o,x;return f.default.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return g=g||{},g.headers=g.headers||{},(0,h.default)(g.headers).forEach(function(O){g.headers["x-oss-copy-source-"+O.toLowerCase()]=g.headers[O]}),g.meta&&(g.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(g.meta,g.headers),m=m[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(m):"/"+encodeURIComponent(m.slice(1)),g.headers["x-oss-copy-source"]=m,E=this._objectRequestParams("PUT",_,g),E.xmlResponse=!0,E.successStatuses=[200,304],A.next=12,this.request(E);case 12:return o=A.sent,x=o.data,x&&(x={etag:x.ETag,lastModified:x.LastModified}),A.abrupt("return",{data:x,res:o.res});case 16:case"end":return A.stop()}},y,this)}),b.putMeta=f.default.mark(function y(_,m,g){return f.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,this.copy(_,_,{meta:m||{},timeout:g&&g.timeout,ctx:g&&g.ctx});case 2:return E.abrupt("return",E.sent);case 3:case"end":return E.stop()}},y,this)}),b.list=f.default.mark(function y(_,m){var g,E,o,x,A;return f.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return g=this._objectRequestParams("GET","",m),g.query=_,g.xmlResponse=!0,g.successStatuses=[200],O.next=6,this.request(g);case 6:return E=O.sent,o=E.data.Contents,x=this,o&&(Array.isArray(o)||(o=[o]),o=o.map(function(D){return{name:D.Key,url:x._objectUrl(D.Key),lastModified:D.LastModified,etag:D.ETag,type:D.Type,size:Number(D.Size),storageClass:D.StorageClass,owner:{id:D.Owner.ID,displayName:D.Owner.DisplayName}}})),A=E.data.CommonPrefixes||null,A&&(Array.isArray(A)||(A=[A]),A=A.map(function(D){return D.Prefix})),O.abrupt("return",{res:E.res,objects:o,prefixes:A,nextMarker:E.data.NextMarker||null,isTruncated:E.data.IsTruncated==="true"});case 13:case"end":return O.stop()}},y,this)}),b.putACL=f.default.mark(function y(_,m,g){var E,o;return f.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return g=g||{},g.subres="acl",g.headers=g.headers||{},g.headers["x-oss-object-acl"]=m,_=this._objectName(_),E=this._objectRequestParams("PUT",_,g),E.successStatuses=[200],x.next=9,this.request(E);case 9:return o=x.sent,x.abrupt("return",{res:o.res});case 11:case"end":return x.stop()}},y,this)}),b.getACL=f.default.mark(function y(_,m){var g,E;return f.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},m.subres="acl",_=this._objectName(_),g=this._objectRequestParams("GET",_,m),g.successStatuses=[200],g.xmlResponse=!0,o.next=8,this.request(g);case 8:return E=o.sent,o.abrupt("return",{acl:E.data.AccessControlList.Grant,owner:{id:E.data.Owner.ID,displayName:E.data.Owner.DisplayName},res:E.res});case 10:case"end":return o.stop()}},y,this)}),b.restore=f.default.mark(function y(_,m){var g,E;return f.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return m=m||{},m.subres="restore",g=this._objectRequestParams("POST",_,m),g.successStatuses=[202],o.next=6,this.request(g);case 6:return E=o.sent,o.abrupt("return",{res:E.res});case 8:case"end":return o.stop()}},y,this)}),b.signatureUrl=function(y,_){_=_||{},y=this._objectName(y),_.method=_.method||"GET";var m=a.timestamp()+(_.expires||1800),g={bucket:this.options.bucket,object:y},E=this._getResource(g);this.options.stsToken&&(_["security-token"]=this.options.stsToken);var o=v._signatureForURL(this.options.accessKeySecret,_,E,m),x=u.parse(this._getReqUrl(g));return x.query={OSSAccessKeyId:this.options.accessKeyId,Expires:m,Signature:o.Signature},i(o.subResource).to(x.query),x.format()},b.getObjectUrl=function(y,_){return _?_[_.length-1]!=="/"&&(_+="/"):_=this.options.endpoint.format(),_+this._escape(this._objectName(y))},b._objectUrl=function(y){return this._getReqUrl({bucket:this.options.bucket,object:y})},b.generateObjectUrl=function(y,_){if(_)_[_.length-1]!=="/"&&(_+="/");else{_=this.options.endpoint.format();var m=u.parse(_),g=this.options.bucket;m.hostname=g+"."+m.hostname,m.host=g+"."+m.host,_=m.format()}return _+this._escape(this._objectName(y))},b._objectRequestParams=function(y,_,m){if(!this.options.bucket)throw new Error("Please create a bucket first");m=m||{},_=this._objectName(_);var g={object:_,bucket:this.options.bucket,method:y,subres:m&&m.subres,timeout:m&&m.timeout,ctx:m&&m.ctx};return m.headers&&(g.headers={},i(m.headers).to(g.headers)),g},b._objectName=function(y){return y.replace(/^\/+/,"")},b._statFile=function(y){return function(_){c.stat(y,_)}},b._convertMetaToHeaders=function(y,_){y&&(0,h.default)(y).forEach(function(m){_["x-oss-meta-"+m]=y[m]})},b._deleteFileSafe=function(y){return function(_){c.exists(y,function(m){m?c.unlink(y,function(g){g&&l("unlink %j error: %s",y,g),_()}):_()})}}},{"../common/callback":7,"../common/signUtils":9,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,"copy-to":43,debug:155,fs:36,"is-type-of":165,mime:242,path:170,url:203,utility:243}],5:[function(w,P,S){"use strict";S.version="5.3.1"},{}],6:[function(w,P,S){"use strict";function C(n){return n&&n.__esModule?n:{default:n}}function T(n){return n&&typeof n.next=="function"&&typeof n.throw=="function"}function h(n){if(!n)return!1;var t=n.constructor;return!!t&&(t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction"||T(t.prototype)||T(n.prototype))}function p(n,t){var d=new n(t),v=(0,s.default)(d),b=(0,s.default)((0,a.default)(d));v.concat(b).forEach(function(y){h(d[y])?this[y]=u.wrap(d[y]).bind(d):this[y]=d[y]},this)}function f(n){if(!(this instanceof f))return new f(n);p.call(this,i,n)}var l=w("babel-runtime/core-js/object/get-prototype-of"),a=C(l),c=w("babel-runtime/core-js/object/keys"),s=C(c),u=w("co"),i=w("./client");P.exports=f,f.STS=function n(t){if(!(this instanceof n))return new n(t);p.call(this,i.STS,t)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(w,P,S){(function(C){"use strict";function T(a){return a&&a.__esModule?a:{default:a}}var h=w("babel-runtime/core-js/object/keys"),p=T(h),f=w("babel-runtime/core-js/json/stringify"),l=T(f);S.encodeCallback=function(a,c){if(a.headers=a.headers||{},!Object.prototype.hasOwnProperty.call(a.headers,"x-oss-callback")&&c.callback){var s={callbackUrl:encodeURI(c.callback.url),callbackBody:c.callback.body};c.callback.host&&(s.callbackHost=c.callback.host),c.callback.contentType&&(s.callbackBodyType=c.callback.contentType);var u=new C((0,l.default)(s)).toString("base64");if(a.headers["x-oss-callback"]=u,c.callback.customValue){var i={};(0,p.default)(c.callback.customValue).forEach(function(n){i["x:"+n]=c.callback.customValue[n]}),a.headers["x-oss-callback-var"]=new C((0,l.default)(i)).toString("base64")}}}}).call(this,w("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(w,P,S){"use strict";var C=w("babel-runtime/regenerator"),T=function(l){return l&&l.__esModule?l:{default:l}}(C),h=w("copy-to"),p=w("./callback"),f=S;f.listUploads=T.default.mark(function l(a,c){var s,u,i,n;return T.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=c||{},s={},h(c).to(s),s.subres="uploads",u=this._objectRequestParams("GET","",s),u.query=a,u.xmlResponse=!0,u.successStatuses=[200],t.next=10,this.request(u);case 10:return i=t.sent,n=i.data.Upload||[],Array.isArray(n)||(n=[n]),n=n.map(function(d){return{name:d.Key,uploadId:d.UploadId,initiated:d.Initiated}}),t.abrupt("return",{res:i.res,uploads:n,bucket:i.data.Bucket,nextKeyMarker:i.data.NextKeyMarker,nextUploadIdMarker:i.data.NextUploadIdMarker,isTruncated:i.data.IsTruncated==="true"});case 15:case"end":return t.stop()}},l,this)}),f.listParts=T.default.mark(function l(a,c,s,u){var i,n,t;return T.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=u||{},i={},h(u).to(i),i.subres={uploadId:c},n=this._objectRequestParams("GET",a,i),n.query=s,n.xmlResponse=!0,n.successStatuses=[200],d.next=10,this.request(n);case 10:return t=d.sent,d.abrupt("return",{res:t.res,uploadId:t.data.UploadId,bucket:t.data.Bucket,name:t.data.Key,partNumberMarker:t.data.PartNumberMarker,nextPartNumberMarker:t.data.NextPartNumberMarker,maxParts:t.data.MaxParts,isTruncated:t.data.IsTruncated,parts:t.data.Part||[]});case 12:case"end":return d.stop()}},l,this)}),f.abortMultipartUpload=T.default.mark(function l(a,c,s){var u,i,n;return T.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancel(),s=s||{},u={},h(s).to(u),u.subres={uploadId:c},i=this._objectRequestParams("DELETE",a,u),i.successStatuses=[204],t.next=9,this.request(i);case 9:return n=t.sent,t.abrupt("return",{res:n.res});case 11:case"end":return t.stop()}},l,this)}),f.initMultipartUpload=T.default.mark(function l(a,c){var s,u,i;return T.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return c=c||{},s={},h(c).to(s),s.headers=s.headers||{},this._convertMetaToHeaders(c.meta,s.headers),s.subres="uploads",u=this._objectRequestParams("POST",a,s),u.mime=c.mime,u.xmlResponse=!0,u.successStatuses=[200],n.next=12,this.request(u);case 12:return i=n.sent,n.abrupt("return",{res:i.res,bucket:i.data.Bucket,name:i.data.Key,uploadId:i.data.UploadId});case 14:case"end":return n.stop()}},l,this)}),f.uploadPart=T.default.mark(function l(a,c,s,u,i,n,t){var d;return T.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return d={stream:this._createStream(u,i,n),size:n-i},v.next=3,this._uploadPart(a,c,s,d,t);case 3:return v.abrupt("return",v.sent);case 4:case"end":return v.stop()}},l,this)}),f.completeMultipartUpload=T.default.mark(function l(a,c,s,u){var i,n,t,d,v,b,y,_;return T.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:for(i=s.concat().sort(function(g,E){return g.number-E.number}).filter(function(g,E,o){return!E||g.number!==o[E-1].number}),n=` `,t=0;t `,n+=""+d.number+` `,n+=""+d.etag+` `,n+=` `;return n+="",u=u||{},v={},h(u).to(v),v.subres={uploadId:c},b=this._objectRequestParams("POST",a,v),p.encodeCallback(b,v),b.mime="xml",b.content=n,b.headers&&b.headers["x-oss-callback"]||(b.xmlResponse=!0),b.successStatuses=[200],m.next=16,this.request(b);case 16:return y=m.sent,_={res:y.res,bucket:b.bucket,name:a,etag:y.res.headers.etag},b.headers&&b.headers["x-oss-callback"]&&(_.data=JSON.parse(y.data.toString())),m.abrupt("return",_);case 20:case"end":return m.stop()}},l,this)}),f._uploadPart=T.default.mark(function l(a,c,s,u,i){var n,t,d;return T.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return i=i||{},n={},h(i).to(n),n.headers={"Content-Length":u.size},n.subres={partNumber:s,uploadId:c},t=this._objectRequestParams("PUT",a,n),t.mime=n.mime,t.stream=u.stream,t.successStatuses=[200],v.next=11,this.request(t);case 11:return d=v.sent,u.stream=null,t.stream=null,v.abrupt("return",{name:a,etag:d.res.headers.etag,res:d.res});case 15:case"end":return v.stop()}},l,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(w,P,S){(function(C){"use strict";function T(s){return s&&s.__esModule?s:{default:s}}var h=w("babel-runtime/core-js/json/stringify"),p=T(h),f=w("babel-runtime/core-js/object/keys"),l=T(f),a=w("./../../shims/crypto/crypto.js"),c=w("is-type-of");S.buildCanonicalizedResource=function(s,u){var i=""+s,n="?";if(c.string(u)&&u.trim()!=="")i+=n+u;else if(c.array(u))u.sort(),i+=n+u.join("&");else if(u){var t=function(v,b){return v[0]>b[0]?1:v[0]0)throw new Error("Invalid string. Length must be a multiple of 4");var b=d.indexOf("=");return b===-1&&(b=v),[b,b===v?0:4-b%4]}function T(d){var v=C(d),b=v[0],y=v[1];return 3*(b+y)/4-y}function h(d,v,b){return 3*(v+b)/4-b}function p(d){for(var v,b=C(d),y=b[0],_=b[1],m=new u(h(d,y,_)),g=0,E=_>0?y-4:y,o=0;o>16&255,m[g++]=v>>8&255,m[g++]=255&v;return _===2&&(v=s[d.charCodeAt(o)]<<2|s[d.charCodeAt(o+1)]>>4,m[g++]=255&v),_===1&&(v=s[d.charCodeAt(o)]<<10|s[d.charCodeAt(o+1)]<<4|s[d.charCodeAt(o+2)]>>2,m[g++]=v>>8&255,m[g++]=255&v),m}function f(d){return c[d>>18&63]+c[d>>12&63]+c[d>>6&63]+c[63&d]}function l(d,v,b){for(var y,_=[],m=v;mg?g:m+16383));return y===1?(v=d[b-1],_.push(c[v>>2]+c[v<<4&63]+"==")):y===2&&(v=(d[b-2]<<8)+d[b-1],_.push(c[v>>10]+c[v>>4&63]+c[v<<2&63]+"=")),_.join("")}S.byteLength=T,S.toByteArray=p,S.fromByteArray=a;for(var c=[],s=[],u=typeof Uint8Array!="undefined"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,t=i.length;n1&&K[1]||""}function i(Z){var K=s.match(Z);return K&&K.length>1&&K[2]||""}var n,t=u(/(ipod|iphone|ipad)/i).toLowerCase(),d=/like android/i.test(s),v=!d&&/android/i.test(s),b=/nexus\s*[0-6]\s*/i.test(s),y=!b&&/nexus\s*[0-9]+/i.test(s),_=/CrOS/.test(s),m=/silk/i.test(s),g=/sailfish/i.test(s),E=/tizen/i.test(s),o=/(web|hpw)os/i.test(s),x=/windows phone/i.test(s),A=(/SamsungBrowser/i.test(s),!x&&/windows/i.test(s)),O=!t&&!m&&/macintosh/i.test(s),D=!v&&!g&&!E&&!o&&/linux/i.test(s),I=i(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),F=u(/version\/(\d+(\.\d+)?)/i),z=/tablet/i.test(s)&&!/tablet pc/i.test(s),ne=!z&&/[^-]mobi/i.test(s),j=/xbox/i.test(s);/opera/i.test(s)?n={name:"Opera",opera:a,version:F||u(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(s)?n={name:"Opera",opera:a,version:u(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||F}:/SamsungBrowser/i.test(s)?n={name:"Samsung Internet for Android",samsungBrowser:a,version:F||u(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(s)?n={name:"Opera Coast",coast:a,version:F||u(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(s)?n={name:"Yandex Browser",yandexbrowser:a,version:F||u(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(s)?n={name:"UC Browser",ucbrowser:a,version:u(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(s)?n={name:"Maxthon",maxthon:a,version:u(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(s)?n={name:"Epiphany",epiphany:a,version:u(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(s)?n={name:"Puffin",puffin:a,version:u(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(s)?n={name:"Sleipnir",sleipnir:a,version:u(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(s)?n={name:"K-Meleon",kMeleon:a,version:u(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:x?(n={name:"Windows Phone",osname:"Windows Phone",windowsphone:a},I?(n.msedge=a,n.version=I):(n.msie=a,n.version=u(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(s)?n={name:"Internet Explorer",msie:a,version:u(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:_?n={name:"Chrome",osname:"Chrome OS",chromeos:a,chromeBook:a,chrome:a,version:u(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(s)?n={name:"Microsoft Edge",msedge:a,version:I}:/vivaldi/i.test(s)?n={name:"Vivaldi",vivaldi:a,version:u(/vivaldi\/(\d+(\.\d+)?)/i)||F}:g?n={name:"Sailfish",osname:"Sailfish OS",sailfish:a,version:u(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(s)?n={name:"SeaMonkey",seamonkey:a,version:u(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(s)?(n={name:"Firefox",firefox:a,version:u(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(s)&&(n.firefoxos=a,n.osname="Firefox OS")):m?n={name:"Amazon Silk",silk:a,version:u(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(s)?n={name:"PhantomJS",phantom:a,version:u(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(s)?n={name:"SlimerJS",slimer:a,version:u(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(s)||/rim\stablet/i.test(s)?n={name:"BlackBerry",osname:"BlackBerry OS",blackberry:a,version:F||u(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:o?(n={name:"WebOS",osname:"WebOS",webos:a,version:F||u(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(s)&&(n.touchpad=a)):/bada/i.test(s)?n={name:"Bada",osname:"Bada",bada:a,version:u(/dolfin\/(\d+(\.\d+)?)/i)}:E?n={name:"Tizen",osname:"Tizen",tizen:a,version:u(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||F}:/qupzilla/i.test(s)?n={name:"QupZilla",qupzilla:a,version:u(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||F}:/chromium/i.test(s)?n={name:"Chromium",chromium:a,version:u(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||F}:/chrome|crios|crmo/i.test(s)?n={name:"Chrome",chrome:a,version:u(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:v?n={name:"Android",version:F}:/safari|applewebkit/i.test(s)?(n={name:"Safari",safari:a},F&&(n.version=F)):t?(n={name:t=="iphone"?"iPhone":t=="ipad"?"iPad":"iPod"},F&&(n.version=F)):n=/googlebot/i.test(s)?{name:"Googlebot",googlebot:a,version:u(/googlebot\/(\d+(\.\d+))/i)||F}:{name:u(/^(.*)\/(.*) /),version:i(/^(.*)\/(.*) /)},!n.msedge&&/(apple)?webkit/i.test(s)?(/(apple)?webkit\/537\.36/i.test(s)?(n.name=n.name||"Blink",n.blink=a):(n.name=n.name||"Webkit",n.webkit=a),!n.version&&F&&(n.version=F)):!n.opera&&/gecko\//i.test(s)&&(n.name=n.name||"Gecko",n.gecko=a,n.version=n.version||u(/gecko\/(\d+(\.\d+)?)/i)),n.windowsphone||!v&&!n.silk?!n.windowsphone&&t?(n[t]=a,n.ios=a,n.osname="iOS"):O?(n.mac=a,n.osname="macOS"):j?(n.xbox=a,n.osname="Xbox"):A?(n.windows=a,n.osname="Windows"):D&&(n.linux=a,n.osname="Linux"):(n.android=a,n.osname="Android");var G="";n.windows?G=function(Z){switch(Z){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(u(/Windows ((NT|XP)( \d\d?.\d)?)/i)):n.windowsphone?G=u(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):n.mac?(G=u(/Mac OS X (\d+([_\.\s]\d+)*)/i),G=G.replace(/[_\s]/g,".")):t?(G=u(/os (\d+([_\s]\d+)*) like mac os x/i),G=G.replace(/[_\s]/g,".")):v?G=u(/android[ \/-](\d+(\.\d+)*)/i):n.webos?G=u(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):n.blackberry?G=u(/rim\stablet\sos\s(\d+(\.\d+)*)/i):n.bada?G=u(/bada\/(\d+(\.\d+)*)/i):n.tizen&&(G=u(/tizen[\/\s](\d+(\.\d+)*)/i)),G&&(n.osversion=G);var X=!n.windows&&G.split(".")[0];return z||y||t=="ipad"||v&&(X==3||X>=4&&!ne)||n.silk?n.tablet=a:(ne||t=="iphone"||t=="ipod"||v||b||n.blackberry||n.webos||n.bada)&&(n.mobile=a),n.msedge||n.msie&&n.version>=10||n.yandexbrowser&&n.version>=15||n.vivaldi&&n.version>=1||n.chrome&&n.version>=20||n.samsungBrowser&&n.version>=4||n.firefox&&n.version>=20||n.safari&&n.version>=6||n.opera&&n.version>=10||n.ios&&n.osversion&&n.osversion.split(".")[0]>=6||n.blackberry&&n.version>=10.1||n.chromium&&n.version>=20?n.a=a:n.msie&&n.version<10||n.chrome&&n.version<20||n.firefox&&n.version<20||n.safari&&n.version<6||n.opera&&n.version<10||n.ios&&n.osversion&&n.osversion.split(".")[0]<6||n.chromium&&n.version<20?n.c=a:n.x=a,n}function T(s){return s.split(".").length}function h(s,u){var i,n=[];if(Array.prototype.map)return Array.prototype.map.call(s,u);for(i=0;i=0;){if(i[0][u]>i[1][u])return 1;if(i[0][u]!==i[1][u])return-1;if(u===0)return 0}}function f(s,u,i){var n=c;typeof u=="string"&&(i=u,u=void 0),u===void 0&&(u=!1),i&&(n=C(i));var t=""+n.version;for(var d in s)if(s.hasOwnProperty(d)&&n[d]){if(typeof s[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(s));return p([t,s[d]])<0}return u}function l(s,u,i){return!f(s,u,i)}var a=!0,c=C(typeof navigator!="undefined"&&navigator.userAgent||"");return c.test=function(s){for(var u=0;u=this.charLength-this.charReceived?this.charLength-this.charReceived:c.length;if(c.copy(this.charBuffer,this.charReceived,0,u),this.charReceived+=u,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,c.length===0)return s;break}this.charLength+=this.surrogateSize,s=""}this.detectIncompleteChar(c);var i=c.length;this.charLength&&(c.copy(this.charBuffer,0,c.length-this.charReceived,i),i-=this.charReceived),s+=c.toString(this.encoding,0,i);var i=s.length-1,n=s.charCodeAt(i);if(n>=55296&&n<=56319){var t=this.surrogateSize;return this.charLength+=t,this.charReceived+=t,this.charBuffer.copy(this.charBuffer,t,0,t),c.copy(this.charBuffer,0,0,t),s.substring(0,i)}return s},a.prototype.detectIncompleteChar=function(c){for(var s=c.length>=3?3:c.length;s>0;s--){var u=c[c.length-s];if(s==1&&u>>5==6){this.charLength=2;break}if(s<=2&&u>>4==14){this.charLength=3;break}if(s<=3&&u>>3==30){this.charLength=4;break}}this.charReceived=s},a.prototype.end=function(c){var s="";if(c&&c.length&&(s=this.write(c)),this.charReceived){var u=this.charReceived,i=this.charBuffer,n=this.encoding;s+=i.slice(0,u).toString(n)}return s}},{buffer:38}],38:[function(w,P,S){(function(C){"use strict";function T(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(k,N){if(T()=T())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T().toString(16)+" bytes");return 0|k}function d(k){return+k!=k&&(k=0),p.alloc(+k)}function v(k,N){if(p.isBuffer(k))return k.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(k)||k instanceof ArrayBuffer))return k.byteLength;typeof k!="string"&&(k=""+k);var $=k.length;if($===0)return 0;for(var V=!1;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":case void 0:return Te(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*$;case"hex":return $>>>1;case"base64":return Me(k).length;default:if(V)return Te(k).length;N=(""+N).toLowerCase(),V=!0}}function b(k,N,$){var V=!1;if((N===void 0||N<0)&&(N=0),N>this.length)return"";if(($===void 0||$>this.length)&&($=this.length),$<=0)return"";if($>>>=0,N>>>=0,$<=N)return"";for(k||(k="utf8");;)switch(k){case"hex":return j(this,N,$);case"utf8":case"utf-8":return I(this,N,$);case"ascii":return z(this,N,$);case"latin1":case"binary":return ne(this,N,$);case"base64":return D(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,N,$);default:if(V)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),V=!0}}function y(k,N,$){var V=k[N];k[N]=k[$],k[$]=V}function _(k,N,$,V,Y){if(k.length===0)return-1;if(typeof $=="string"?(V=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,isNaN($)&&($=Y?0:k.length-1),$<0&&($=k.length+$),$>=k.length){if(Y)return-1;$=k.length-1}else if($<0){if(!Y)return-1;$=0}if(typeof N=="string"&&(N=p.from(N,V)),p.isBuffer(N))return N.length===0?-1:m(k,N,$,V,Y);if(typeof N=="number")return N&=255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(k,N,$):Uint8Array.prototype.lastIndexOf.call(k,N,$):m(k,[N],$,V,Y);throw new TypeError("val must be string, number or Buffer")}function m(k,N,$,V,Y){function me(He,Pe){return Ae===1?He[Pe]:He.readUInt16BE(Pe*Ae)}var Ae=1,at=k.length,Le=N.length;if(V!==void 0&&((V=String(V).toLowerCase())==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(k.length<2||N.length<2)return-1;Ae=2,at/=2,Le/=2,$/=2}var ke;if(Y){var Ye=-1;for(ke=$;keat&&($=at-Le),ke=$;ke>=0;ke--){for(var Ze=!0,Ve=0;VeY&&(V=Y):V=Y;var me=N.length;if(me%2!=0)throw new TypeError("Invalid hex string");V>me/2&&(V=me/2);for(var Ae=0;Ae239?4:me>223?3:me>191?2:1;if(Y+at<=$){var Le,ke,Ye,Ze;switch(at){case 1:me<128&&(Ae=me);break;case 2:Le=k[Y+1],(192&Le)==128&&(Ze=(31&me)<<6|63&Le)>127&&(Ae=Ze);break;case 3:Le=k[Y+1],ke=k[Y+2],(192&Le)==128&&(192&ke)==128&&(Ze=(15&me)<<12|(63&Le)<<6|63&ke)>2047&&(Ze<55296||Ze>57343)&&(Ae=Ze);break;case 4:Le=k[Y+1],ke=k[Y+2],Ye=k[Y+3],(192&Le)==128&&(192&ke)==128&&(192&Ye)==128&&(Ze=(15&me)<<18|(63&Le)<<12|(63&ke)<<6|63&Ye)>65535&&Ze<1114112&&(Ae=Ze)}}Ae===null?(Ae=65533,at=1):Ae>65535&&(Ae-=65536,V.push(Ae>>>10&1023|55296),Ae=56320|1023&Ae),V.push(Ae),Y+=at}return F(V)}function F(k){var N=k.length;if(N<=Xe)return String.fromCharCode.apply(String,k);for(var $="",V=0;VV)&&($=V);for(var Y="",me=N;me<$;++me)Y+=fe(k[me]);return Y}function G(k,N,$){for(var V=k.slice(N,$),Y="",me=0;me$)throw new RangeError("Trying to access beyond buffer length")}function Z(k,N,$,V,Y,me){if(!p.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>Y||Nk.length)throw new RangeError("Index out of range")}function K(k,N,$,V){N<0&&(N=65535+N+1);for(var Y=0,me=Math.min(k.length-$,2);Y>>8*(V?Y:1-Y)}function q(k,N,$,V){N<0&&(N=4294967295+N+1);for(var Y=0,me=Math.min(k.length-$,4);Y>>8*(V?Y:3-Y)&255}function ie(k,N,$,V,Y,me){if($+V>k.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function oe(k,N,$,V,Y){return Y||ie(k,N,$,4,34028234663852886e22,-34028234663852886e22),Ie.write(k,N,$,V,23,4),$+4}function ye(k,N,$,V,Y){return Y||ie(k,N,$,8,17976931348623157e292,-17976931348623157e292),Ie.write(k,N,$,V,52,8),$+8}function pe(k){if(k=we(k).replace(ee,""),k.length<2)return"";for(;k.length%4!=0;)k+="=";return k}function we(k){return k.trim?k.trim():k.replace(/^\s+|\s+$/g,"")}function fe(k){return k<16?"0"+k.toString(16):k.toString(16)}function Te(k,N){N=N||1/0;for(var $,V=k.length,Y=null,me=[],Ae=0;Ae55295&&$<57344){if(!Y){if($>56319){(N-=3)>-1&&me.push(239,191,189);continue}if(Ae+1===V){(N-=3)>-1&&me.push(239,191,189);continue}Y=$;continue}if($<56320){(N-=3)>-1&&me.push(239,191,189),Y=$;continue}$=65536+(Y-55296<<10|$-56320)}else Y&&(N-=3)>-1&&me.push(239,191,189);if(Y=null,$<128){if((N-=1)<0)break;me.push($)}else if($<2048){if((N-=2)<0)break;me.push($>>6|192,63&$|128)}else if($<65536){if((N-=3)<0)break;me.push($>>12|224,$>>6&63|128,63&$|128)}else{if(!($<1114112))throw new Error("Invalid code point");if((N-=4)<0)break;me.push($>>18|240,$>>12&63|128,$>>6&63|128,63&$|128)}}return me}function Fe(k){for(var N=[],$=0;$>8,Y=$%256,me.push(Y),me.push(V);return me}function Me(k){return ce.toByteArray(pe(k))}function Ue(k,N,$,V){for(var Y=0;Y=N.length||Y>=k.length);++Y)N[Y+$]=k[Y];return Y}function ve(k){return k!==k}var ce=w("base64-js"),Ie=w("ieee754"),Ne=w("isarray");S.Buffer=p,S.SlowBuffer=d,S.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=C.TYPED_ARRAY_SUPPORT!==void 0?C.TYPED_ARRAY_SUPPORT:function(){try{var k=new Uint8Array(1);return k.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},k.foo()===42&&typeof k.subarray=="function"&&k.subarray(1,1).byteLength===0}catch(N){return!1}}(),S.kMaxLength=T(),p.poolSize=8192,p._augment=function(k){return k.__proto__=p.prototype,k},p.from=function(k,N,$){return f(null,k,N,$)},p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0})),p.alloc=function(k,N,$){return a(null,k,N,$)},p.allocUnsafe=function(k){return c(null,k)},p.allocUnsafeSlow=function(k){return c(null,k)},p.isBuffer=function(k){return!(k==null||!k._isBuffer)},p.compare=function(k,N){if(!p.isBuffer(k)||!p.isBuffer(N))throw new TypeError("Arguments must be Buffers");if(k===N)return 0;for(var $=k.length,V=N.length,Y=0,me=Math.min($,V);Y0&&(k=this.toString("hex",0,N).match(/.{2}/g).join(" "),this.length>N&&(k+=" ... ")),""},p.prototype.compare=function(k,N,$,V,Y){if(!p.isBuffer(k))throw new TypeError("Argument must be a Buffer");if(N===void 0&&(N=0),$===void 0&&($=k?k.length:0),V===void 0&&(V=0),Y===void 0&&(Y=this.length),N<0||$>k.length||V<0||Y>this.length)throw new RangeError("out of range index");if(V>=Y&&N>=$)return 0;if(V>=Y)return-1;if(N>=$)return 1;if(N>>>=0,$>>>=0,V>>>=0,Y>>>=0,this===k)return 0;for(var me=Y-V,Ae=$-N,at=Math.min(me,Ae),Le=this.slice(V,Y),ke=k.slice(N,$),Ye=0;YeY)&&($=Y),k.length>0&&($<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");for(var me=!1;;)switch(V){case"hex":return g(this,k,N,$);case"utf8":case"utf-8":return E(this,k,N,$);case"ascii":return o(this,k,N,$);case"latin1":case"binary":return x(this,k,N,$);case"base64":return A(this,k,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,k,N,$);default:if(me)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),me=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Xe=4096;p.prototype.slice=function(k,N){var $=this.length;k=~~k,N=N===void 0?$:~~N,k<0?(k+=$)<0&&(k=0):k>$&&(k=$),N<0?(N+=$)<0&&(N=0):N>$&&(N=$),N0&&(Y*=256);)V+=this[k+--N]*Y;return V},p.prototype.readUInt8=function(k,N){return N||X(k,1,this.length),this[k]},p.prototype.readUInt16LE=function(k,N){return N||X(k,2,this.length),this[k]|this[k+1]<<8},p.prototype.readUInt16BE=function(k,N){return N||X(k,2,this.length),this[k]<<8|this[k+1]},p.prototype.readUInt32LE=function(k,N){return N||X(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+16777216*this[k+3]},p.prototype.readUInt32BE=function(k,N){return N||X(k,4,this.length),16777216*this[k]+(this[k+1]<<16|this[k+2]<<8|this[k+3])},p.prototype.readIntLE=function(k,N,$){k|=0,N|=0,$||X(k,N,this.length);for(var V=this[k],Y=1,me=0;++me=Y&&(V-=Math.pow(2,8*N)),V},p.prototype.readIntBE=function(k,N,$){k|=0,N|=0,$||X(k,N,this.length);for(var V=N,Y=1,me=this[k+--V];V>0&&(Y*=256);)me+=this[k+--V]*Y;return Y*=128,me>=Y&&(me-=Math.pow(2,8*N)),me},p.prototype.readInt8=function(k,N){return N||X(k,1,this.length),128&this[k]?-1*(255-this[k]+1):this[k]},p.prototype.readInt16LE=function(k,N){N||X(k,2,this.length);var $=this[k]|this[k+1]<<8;return 32768&$?4294901760|$:$},p.prototype.readInt16BE=function(k,N){N||X(k,2,this.length);var $=this[k+1]|this[k]<<8;return 32768&$?4294901760|$:$},p.prototype.readInt32LE=function(k,N){return N||X(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},p.prototype.readInt32BE=function(k,N){return N||X(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},p.prototype.readFloatLE=function(k,N){return N||X(k,4,this.length),Ie.read(this,k,!0,23,4)},p.prototype.readFloatBE=function(k,N){return N||X(k,4,this.length),Ie.read(this,k,!1,23,4)},p.prototype.readDoubleLE=function(k,N){return N||X(k,8,this.length),Ie.read(this,k,!0,52,8)},p.prototype.readDoubleBE=function(k,N){return N||X(k,8,this.length),Ie.read(this,k,!1,52,8)},p.prototype.writeUIntLE=function(k,N,$,V){(k=+k,N|=0,$|=0,!V)&&Z(this,k,N,$,Math.pow(2,8*$)-1,0);var Y=1,me=0;for(this[N]=255&k;++me<$&&(Y*=256);)this[N+me]=k/Y&255;return N+$},p.prototype.writeUIntBE=function(k,N,$,V){(k=+k,N|=0,$|=0,!V)&&Z(this,k,N,$,Math.pow(2,8*$)-1,0);var Y=$-1,me=1;for(this[N+Y]=255&k;--Y>=0&&(me*=256);)this[N+Y]=k/me&255;return N+$},p.prototype.writeUInt8=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,1,255,0),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),this[N]=255&k,N+1},p.prototype.writeUInt16LE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[N]=255&k,this[N+1]=k>>>8):K(this,k,N,!0),N+2},p.prototype.writeUInt16BE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[N]=k>>>8,this[N+1]=255&k):K(this,k,N,!1),N+2},p.prototype.writeUInt32LE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[N+3]=k>>>24,this[N+2]=k>>>16,this[N+1]=k>>>8,this[N]=255&k):q(this,k,N,!0),N+4},p.prototype.writeUInt32BE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[N]=k>>>24,this[N+1]=k>>>16,this[N+2]=k>>>8,this[N+3]=255&k):q(this,k,N,!1),N+4},p.prototype.writeIntLE=function(k,N,$,V){if(k=+k,N|=0,!V){var Y=Math.pow(2,8*$-1);Z(this,k,N,$,Y-1,-Y)}var me=0,Ae=1,at=0;for(this[N]=255&k;++me<$&&(Ae*=256);)k<0&&at===0&&this[N+me-1]!==0&&(at=1),this[N+me]=(k/Ae>>0)-at&255;return N+$},p.prototype.writeIntBE=function(k,N,$,V){if(k=+k,N|=0,!V){var Y=Math.pow(2,8*$-1);Z(this,k,N,$,Y-1,-Y)}var me=$-1,Ae=1,at=0;for(this[N+me]=255&k;--me>=0&&(Ae*=256);)k<0&&at===0&&this[N+me+1]!==0&&(at=1),this[N+me]=(k/Ae>>0)-at&255;return N+$},p.prototype.writeInt8=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,1,127,-128),p.TYPED_ARRAY_SUPPORT||(k=Math.floor(k)),k<0&&(k=255+k+1),this[N]=255&k,N+1},p.prototype.writeInt16LE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[N]=255&k,this[N+1]=k>>>8):K(this,k,N,!0),N+2},p.prototype.writeInt16BE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[N]=k>>>8,this[N+1]=255&k):K(this,k,N,!1),N+2},p.prototype.writeInt32LE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[N]=255&k,this[N+1]=k>>>8,this[N+2]=k>>>16,this[N+3]=k>>>24):q(this,k,N,!0),N+4},p.prototype.writeInt32BE=function(k,N,$){return k=+k,N|=0,$||Z(this,k,N,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),p.TYPED_ARRAY_SUPPORT?(this[N]=k>>>24,this[N+1]=k>>>16,this[N+2]=k>>>8,this[N+3]=255&k):q(this,k,N,!1),N+4},p.prototype.writeFloatLE=function(k,N,$){return oe(this,k,N,!0,$)},p.prototype.writeFloatBE=function(k,N,$){return oe(this,k,N,!1,$)},p.prototype.writeDoubleLE=function(k,N,$){return ye(this,k,N,!0,$)},p.prototype.writeDoubleBE=function(k,N,$){return ye(this,k,N,!1,$)},p.prototype.copy=function(k,N,$,V){if($||($=0),V||V===0||(V=this.length),N>=k.length&&(N=k.length),N||(N=0),V>0&&V<$&&(V=$),V===$)return 0;if(k.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("sourceStart out of bounds");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),k.length-N=0;--Y)k[Y+N]=this[Y+$];else if(me<1e3||!p.TYPED_ARRAY_SUPPORT)for(Y=0;Y>>=0,$=$===void 0?this.length:$>>>0,k||(k=0);var me;if(typeof k=="number")for(me=N;me<$;++me)this[me]=k;else{var Ae=p.isBuffer(k)?k:Te(new p(k,V).toString()),at=Ae.length;for(me=0;me<$-N;++me)this[me+N]=Ae[me%at]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(w,P,S){P.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],40:[function(w,P,S){"use strict";var C=function(){this.buffer=[],this.fns=[]};C.prototype.push=function(h,p){if(this.fns.length)return this.fns.shift()(null,h);var f={data:h,priority:p},l=T(this.buffer,f,function(a){return a.priority});this.buffer.splice(l,0,f)},C.prototype.next=function(){var h=this;return function(p){if(h.buffer.length)return p(null,h.buffer.pop().data);h.fns.push(p)}};var T=function(h,p,f){p=f(p);for(var l=0,a=h?h.length:l;l>>1;f(h[c])2&&(b=u.call(arguments,1)),t(b)})})}function p(i){return Promise.all(i.map(T,this))}function f(i){for(var n=new i.constructor,t=Object.keys(i),d=[],v=0;vi;)if((c=s[i++])!=c)return!0}else for(;u>i;i++)if((p||i in s)&&s[i]===l)return p||i||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(w,P,S){var C=w("./_cof"),T=w("./_wks")("toStringTag"),h=C(function(){return arguments}())=="Arguments",p=function(f,l){try{return f[l]}catch(a){}};P.exports=function(f){var l,a,c;return f===void 0?"Undefined":f===null?"Null":typeof(a=p(l=Object(f),T))=="string"?a:h?C(l):(c=C(l))=="Object"&&typeof l.callee=="function"?"Arguments":c}},{"./_cof":64,"./_wks":131}],64:[function(w,P,S){var C={}.toString;P.exports=function(T){return C.call(T).slice(8,-1)}},{}],65:[function(w,P,S){var C=P.exports={version:"2.5.7"};typeof __e=="number"&&(__e=C)},{}],66:[function(w,P,S){"use strict";var C=w("./_object-dp"),T=w("./_property-desc");P.exports=function(h,p,f){p in h?C.f(h,p,T(0,f)):h[p]=f}},{"./_object-dp":98,"./_property-desc":111}],67:[function(w,P,S){var C=w("./_a-function");P.exports=function(T,h,p){if(C(T),h===void 0)return T;switch(p){case 1:return function(f){return T.call(h,f)};case 2:return function(f,l){return T.call(h,f,l)};case 3:return function(f,l,a){return T.call(h,f,l,a)}}return function(){return T.apply(h,arguments)}}},{"./_a-function":58}],68:[function(w,P,S){P.exports=function(C){if(C==null)throw TypeError("Can't call method on "+C);return C}},{}],69:[function(w,P,S){P.exports=!w("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(w,P,S){var C=w("./_is-object"),T=w("./_global").document,h=C(T)&&C(T.createElement);P.exports=function(p){return h?T.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(w,P,S){P.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(w,P,S){var C=w("./_object-keys"),T=w("./_object-gops"),h=w("./_object-pie");P.exports=function(p){var f=C(p),l=T.f;if(l)for(var a,c=l(p),s=h.f,u=0;c.length>u;)s.call(p,a=c[u++])&&f.push(a);return f}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(w,P,S){var C=w("./_global"),T=w("./_core"),h=w("./_ctx"),p=w("./_hide"),f=w("./_has"),l=function(a,c,s){var u,i,n,t=a&l.F,d=a&l.G,v=a&l.S,b=a&l.P,y=a&l.B,_=a&l.W,m=d?T:T[c]||(T[c]={}),g=m.prototype,E=d?C:v?C[c]:(C[c]||{}).prototype;d&&(s=c);for(u in s)(i=!t&&E&&E[u]!==void 0)&&f(m,u)||(n=i?E[u]:s[u],m[u]=d&&typeof E[u]!="function"?s[u]:y&&i?h(n,C):_&&E[u]==n?function(o){var x=function(A,O,D){if(this instanceof o){switch(arguments.length){case 0:return new o;case 1:return new o(A);case 2:return new o(A,O)}return new o(A,O,D)}return o.apply(this,arguments)};return x.prototype=o.prototype,x}(n):b&&typeof n=="function"?h(Function.call,n):n,b&&((m.virtual||(m.virtual={}))[u]=n,a&l.R&&g&&!g[u]&&p(g,u,n)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,P.exports=l},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(w,P,S){P.exports=function(C){try{return!!C()}catch(T){return!0}}},{}],75:[function(w,P,S){var C=w("./_ctx"),T=w("./_iter-call"),h=w("./_is-array-iter"),p=w("./_an-object"),f=w("./_to-length"),l=w("./core.get-iterator-method"),a={},c={},S=P.exports=function(s,u,i,n,t){var d,v,b,y,_=t?function(){return s}:l(s),m=C(i,n,u?2:1),g=0;if(typeof _!="function")throw TypeError(s+" is not iterable!");if(h(_)){for(d=f(s.length);d>g;g++)if((y=u?m(p(v=s[g])[0],v[1]):m(s[g]))===a||y===c)return y}else for(b=_.call(s);!(v=b.next()).done;)if((y=T(b,m,v.value,u))===a||y===c)return y};S.BREAK=a,S.RETURN=c},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(w,P,S){var C=P.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=C)},{}],77:[function(w,P,S){var C={}.hasOwnProperty;P.exports=function(T,h){return C.call(T,h)}},{}],78:[function(w,P,S){var C=w("./_object-dp"),T=w("./_property-desc");P.exports=w("./_descriptors")?function(h,p,f){return C.f(h,p,T(1,f))}:function(h,p,f){return h[p]=f,h}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(w,P,S){var C=w("./_global").document;P.exports=C&&C.documentElement},{"./_global":76}],80:[function(w,P,S){P.exports=!w("./_descriptors")&&!w("./_fails")(function(){return Object.defineProperty(w("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(w,P,S){P.exports=function(C,T,h){var p=h===void 0;switch(T.length){case 0:return p?C():C.call(h);case 1:return p?C(T[0]):C.call(h,T[0]);case 2:return p?C(T[0],T[1]):C.call(h,T[0],T[1]);case 3:return p?C(T[0],T[1],T[2]):C.call(h,T[0],T[1],T[2]);case 4:return p?C(T[0],T[1],T[2],T[3]):C.call(h,T[0],T[1],T[2],T[3])}return C.apply(h,T)}},{}],82:[function(w,P,S){var C=w("./_cof");P.exports=Object("z").propertyIsEnumerable(0)?Object:function(T){return C(T)=="String"?T.split(""):Object(T)}},{"./_cof":64}],83:[function(w,P,S){var C=w("./_iterators"),T=w("./_wks")("iterator"),h=Array.prototype;P.exports=function(p){return p!==void 0&&(C.Array===p||h[T]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(w,P,S){var C=w("./_cof");P.exports=Array.isArray||function(T){return C(T)=="Array"}},{"./_cof":64}],85:[function(w,P,S){P.exports=function(C){return typeof C=="object"?C!==null:typeof C=="function"}},{}],86:[function(w,P,S){var C=w("./_an-object");P.exports=function(T,h,p,f){try{return f?h(C(p)[0],p[1]):h(p)}catch(a){var l=T.return;throw l!==void 0&&C(l.call(T)),a}}},{"./_an-object":61}],87:[function(w,P,S){"use strict";var C=w("./_object-create"),T=w("./_property-desc"),h=w("./_set-to-string-tag"),p={};w("./_hide")(p,w("./_wks")("iterator"),function(){return this}),P.exports=function(f,l,a){f.prototype=C(p,{next:T(1,a)}),h(f,l+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(w,P,S){"use strict";var C=w("./_library"),T=w("./_export"),h=w("./_redefine"),p=w("./_hide"),f=w("./_iterators"),l=w("./_iter-create"),a=w("./_set-to-string-tag"),c=w("./_object-gpo"),s=w("./_wks")("iterator"),u=!([].keys&&"next"in[].keys()),i=function(){return this};P.exports=function(n,t,d,v,b,y,_){l(d,t,v);var m,g,E,o=function(j){if(!u&&j in D)return D[j];switch(j){case"keys":case"values":return function(){return new d(this,j)}}return function(){return new d(this,j)}},x=t+" Iterator",A=b=="values",O=!1,D=n.prototype,I=D[s]||D["@@iterator"]||b&&D[b],F=I||o(b),z=b?A?o("entries"):F:void 0,ne=t=="Array"&&D.entries||I;if(ne&&(E=c(ne.call(new n)))!==Object.prototype&&E.next&&(a(E,x,!0),C||typeof E[s]=="function"||p(E,s,i)),A&&I&&I.name!=="values"&&(O=!0,F=function(){return I.call(this)}),C&&!_||!u&&!O&&D[s]||p(D,s,F),f[t]=F,f[x]=i,b)if(m={values:A?F:o("values"),keys:y?F:o("keys"),entries:z},_)for(g in m)g in D||h(D,g,m[g]);else T(T.P+T.F*(u||O),t,m);return m}},{"./_export":73,"./_hide":78,"./_iter-create":87,"./_iterators":91,"./_library":92,"./_object-gpo":104,"./_redefine":113,"./_set-to-string-tag":115,"./_wks":131}],89:[function(w,P,S){var C=w("./_wks")("iterator"),T=!1;try{var h=[7][C]();h.return=function(){T=!0},Array.from(h,function(){throw 2})}catch(p){}P.exports=function(p,f){if(!f&&!T)return!1;var l=!1;try{var a=[7],c=a[C]();c.next=function(){return{done:l=!0}},a[C]=function(){return c},p(a)}catch(s){}return l}},{"./_wks":131}],90:[function(w,P,S){P.exports=function(C,T){return{value:T,done:!!C}}},{}],91:[function(w,P,S){P.exports={}},{}],92:[function(w,P,S){P.exports=!0},{}],93:[function(w,P,S){var C=w("./_uid")("meta"),T=w("./_is-object"),h=w("./_has"),p=w("./_object-dp").f,f=0,l=Object.isExtensible||function(){return!0},a=!w("./_fails")(function(){return l(Object.preventExtensions({}))}),c=function(t){p(t,C,{value:{i:"O"+ ++f,w:{}}})},s=function(t,d){if(!T(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!h(t,C)){if(!l(t))return"F";if(!d)return"E";c(t)}return t[C].i},u=function(t,d){if(!h(t,C)){if(!l(t))return!0;if(!d)return!1;c(t)}return t[C].w},i=function(t){return a&&n.NEED&&l(t)&&!h(t,C)&&c(t),t},n=P.exports={KEY:C,NEED:!1,fastKey:s,getWeak:u,onFreeze:i}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(w,P,S){var C=w("./_global"),T=w("./_task").set,h=C.MutationObserver||C.WebKitMutationObserver,p=C.process,f=C.Promise,l=w("./_cof")(p)=="process";P.exports=function(){var a,c,s,u=function(){var d,v;for(l&&(d=p.domain)&&d.exit();a;){v=a.fn,a=a.next;try{v()}catch(b){throw a?s():c=void 0,b}}c=void 0,d&&d.enter()};if(l)s=function(){p.nextTick(u)};else if(!h||C.navigator&&C.navigator.standalone)if(f&&f.resolve){var i=f.resolve(void 0);s=function(){i.then(u)}}else s=function(){T.call(C,u)};else{var n=!0,t=document.createTextNode("");new h(u).observe(t,{characterData:!0}),s=function(){t.data=n=!n}}return function(d){var v={fn:d,next:void 0};c&&(c.next=v),a||(a=v,s()),c=v}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(w,P,S){"use strict";function C(h){var p,f;this.promise=new h(function(l,a){if(p!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");p=l,f=a}),this.resolve=T(p),this.reject=T(f)}var T=w("./_a-function");P.exports.f=function(h){return new C(h)}},{"./_a-function":58}],96:[function(w,P,S){"use strict";var C=w("./_object-keys"),T=w("./_object-gops"),h=w("./_object-pie"),p=w("./_to-object"),f=w("./_iobject"),l=Object.assign;P.exports=!l||w("./_fails")(function(){var a={},c={},s=Symbol(),u="abcdefghijklmnopqrst";return a[s]=7,u.split("").forEach(function(i){c[i]=i}),l({},a)[s]!=7||Object.keys(l({},c)).join("")!=u})?function(a,c){for(var s=p(a),u=arguments.length,i=1,n=T.f,t=h.f;u>i;)for(var d,v=f(arguments[i++]),b=n?C(v).concat(n(v)):C(v),y=b.length,_=0;y>_;)t.call(v,d=b[_++])&&(s[d]=v[d]);return s}:l},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(w,P,S){var C=w("./_an-object"),T=w("./_object-dps"),h=w("./_enum-bug-keys"),p=w("./_shared-key")("IE_PROTO"),f=function(){},l=function(){var a,c=w("./_dom-create")("iframe"),s=h.length;for(c.style.display="none",w("./_html").appendChild(c),c.src="javascript:",a=c.contentWindow.document,a.open(),a.write(""),a.close(),l=a.F;s--;)delete l.prototype[h[s]];return l()};P.exports=Object.create||function(a,c){var s;return a!==null?(f.prototype=C(a),s=new f,f.prototype=null,s[p]=a):s=l(),c===void 0?s:T(s,c)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(w,P,S){var C=w("./_an-object"),T=w("./_ie8-dom-define"),h=w("./_to-primitive"),p=Object.defineProperty;S.f=w("./_descriptors")?Object.defineProperty:function(f,l,a){if(C(f),l=h(l,!0),C(a),T)try{return p(f,l,a)}catch(c){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(f[l]=a.value),f}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(w,P,S){var C=w("./_object-dp"),T=w("./_an-object"),h=w("./_object-keys");P.exports=w("./_descriptors")?Object.defineProperties:function(p,f){T(p);for(var l,a=h(f),c=a.length,s=0;c>s;)C.f(p,l=a[s++],f[l]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(w,P,S){var C=w("./_object-pie"),T=w("./_property-desc"),h=w("./_to-iobject"),p=w("./_to-primitive"),f=w("./_has"),l=w("./_ie8-dom-define"),a=Object.getOwnPropertyDescriptor;S.f=w("./_descriptors")?a:function(c,s){if(c=h(c),s=p(s,!0),l)try{return a(c,s)}catch(u){}if(f(c,s))return T(!C.f.call(c,s),c[s])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(w,P,S){var C=w("./_to-iobject"),T=w("./_object-gopn").f,h={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],f=function(l){try{return T(l)}catch(a){return p.slice()}};P.exports.f=function(l){return p&&h.call(l)=="[object Window]"?f(l):T(C(l))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(w,P,S){var C=w("./_object-keys-internal"),T=w("./_enum-bug-keys").concat("length","prototype");S.f=Object.getOwnPropertyNames||function(h){return C(h,T)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(w,P,S){S.f=Object.getOwnPropertySymbols},{}],104:[function(w,P,S){var C=w("./_has"),T=w("./_to-object"),h=w("./_shared-key")("IE_PROTO"),p=Object.prototype;P.exports=Object.getPrototypeOf||function(f){return f=T(f),C(f,h)?f[h]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(w,P,S){var C=w("./_has"),T=w("./_to-iobject"),h=w("./_array-includes")(!1),p=w("./_shared-key")("IE_PROTO");P.exports=function(f,l){var a,c=T(f),s=0,u=[];for(a in c)a!=p&&C(c,a)&&u.push(a);for(;l.length>s;)C(c,a=l[s++])&&(~h(u,a)||u.push(a));return u}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(w,P,S){var C=w("./_object-keys-internal"),T=w("./_enum-bug-keys");P.exports=Object.keys||function(h){return C(h,T)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(w,P,S){S.f={}.propertyIsEnumerable},{}],108:[function(w,P,S){var C=w("./_export"),T=w("./_core"),h=w("./_fails");P.exports=function(p,f){var l=(T.Object||{})[p]||Object[p],a={};a[p]=f(l),C(C.S+C.F*h(function(){l(1)}),"Object",a)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(w,P,S){P.exports=function(C){try{return{e:!1,v:C()}}catch(T){return{e:!0,v:T}}}},{}],110:[function(w,P,S){var C=w("./_an-object"),T=w("./_is-object"),h=w("./_new-promise-capability");P.exports=function(p,f){if(C(p),T(f)&&f.constructor===p)return f;var l=h.f(p);return(0,l.resolve)(f),l.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(w,P,S){P.exports=function(C,T){return{enumerable:!(1&C),configurable:!(2&C),writable:!(4&C),value:T}}},{}],112:[function(w,P,S){var C=w("./_hide");P.exports=function(T,h,p){for(var f in h)p&&T[f]?T[f]=h[f]:C(T,f,h[f]);return T}},{"./_hide":78}],113:[function(w,P,S){P.exports=w("./_hide")},{"./_hide":78}],114:[function(w,P,S){"use strict";var C=w("./_global"),T=w("./_core"),h=w("./_object-dp"),p=w("./_descriptors"),f=w("./_wks")("species");P.exports=function(l){var a=typeof T[l]=="function"?T[l]:C[l];p&&a&&!a[f]&&h.f(a,f,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(w,P,S){var C=w("./_object-dp").f,T=w("./_has"),h=w("./_wks")("toStringTag");P.exports=function(p,f,l){p&&!T(p=l?p:p.prototype,h)&&C(p,h,{configurable:!0,value:f})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(w,P,S){var C=w("./_shared")("keys"),T=w("./_uid");P.exports=function(h){return C[h]||(C[h]=T(h))}},{"./_shared":117,"./_uid":127}],117:[function(w,P,S){var C=w("./_core"),T=w("./_global"),h=T["__core-js_shared__"]||(T["__core-js_shared__"]={});(P.exports=function(p,f){return h[p]||(h[p]=f!==void 0?f:{})})("versions",[]).push({version:C.version,mode:w("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(w,P,S){var C=w("./_an-object"),T=w("./_a-function"),h=w("./_wks")("species");P.exports=function(p,f){var l,a=C(p).constructor;return a===void 0||(l=C(a)[h])==null?f:T(l)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(w,P,S){var C=w("./_to-integer"),T=w("./_defined");P.exports=function(h){return function(p,f){var l,a,c=String(T(p)),s=C(f),u=c.length;return s<0||s>=u?h?"":void 0:(l=c.charCodeAt(s),l<55296||l>56319||s+1===u||(a=c.charCodeAt(s+1))<56320||a>57343?h?c.charAt(s):l:h?c.slice(s,s+2):a-56320+(l-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(w,P,S){var C,T,h,p=w("./_ctx"),f=w("./_invoke"),l=w("./_html"),a=w("./_dom-create"),c=w("./_global"),s=c.process,u=c.setImmediate,i=c.clearImmediate,n=c.MessageChannel,t=c.Dispatch,d=0,v={},b=function(){var _=+this;if(v.hasOwnProperty(_)){var m=v[_];delete v[_],m()}},y=function(_){b.call(_.data)};u&&i||(u=function(_){for(var m=[],g=1;arguments.length>g;)m.push(arguments[g++]);return v[++d]=function(){f(typeof _=="function"?_:Function(_),m)},C(d),d},i=function(_){delete v[_]},w("./_cof")(s)=="process"?C=function(_){s.nextTick(p(b,_,1))}:t&&t.now?C=function(_){t.now(p(b,_,1))}:n?(T=new n,h=T.port2,T.port1.onmessage=y,C=p(h.postMessage,h,1)):c.addEventListener&&typeof postMessage=="function"&&!c.importScripts?(C=function(_){c.postMessage(_+"","*")},c.addEventListener("message",y,!1)):C="onreadystatechange"in a("script")?function(_){l.appendChild(a("script")).onreadystatechange=function(){l.removeChild(this),b.call(_)}}:function(_){setTimeout(p(b,_,1),0)}),P.exports={set:u,clear:i}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(w,P,S){var C=w("./_to-integer"),T=Math.max,h=Math.min;P.exports=function(p,f){return p=C(p),p<0?T(p+f,0):h(p,f)}},{"./_to-integer":122}],122:[function(w,P,S){var C=Math.ceil,T=Math.floor;P.exports=function(h){return isNaN(h=+h)?0:(h>0?T:C)(h)}},{}],123:[function(w,P,S){var C=w("./_iobject"),T=w("./_defined");P.exports=function(h){return C(T(h))}},{"./_defined":68,"./_iobject":82}],124:[function(w,P,S){var C=w("./_to-integer"),T=Math.min;P.exports=function(h){return h>0?T(C(h),9007199254740991):0}},{"./_to-integer":122}],125:[function(w,P,S){var C=w("./_defined");P.exports=function(T){return Object(C(T))}},{"./_defined":68}],126:[function(w,P,S){var C=w("./_is-object");P.exports=function(T,h){if(!C(T))return T;var p,f;if(h&&typeof(p=T.toString)=="function"&&!C(f=p.call(T)))return f;if(typeof(p=T.valueOf)=="function"&&!C(f=p.call(T)))return f;if(!h&&typeof(p=T.toString)=="function"&&!C(f=p.call(T)))return f;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(w,P,S){var C=0,T=Math.random();P.exports=function(h){return"Symbol(".concat(h===void 0?"":h,")_",(++C+T).toString(36))}},{}],128:[function(w,P,S){var C=w("./_global"),T=C.navigator;P.exports=T&&T.userAgent||""},{"./_global":76}],129:[function(w,P,S){var C=w("./_global"),T=w("./_core"),h=w("./_library"),p=w("./_wks-ext"),f=w("./_object-dp").f;P.exports=function(l){var a=T.Symbol||(T.Symbol=h?{}:C.Symbol||{});l.charAt(0)=="_"||l in a||f(a,l,{value:p.f(l)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(w,P,S){S.f=w("./_wks")},{"./_wks":131}],131:[function(w,P,S){var C=w("./_shared")("wks"),T=w("./_uid"),h=w("./_global").Symbol,p=typeof h=="function";(P.exports=function(f){return C[f]||(C[f]=p&&h[f]||(p?h:T)("Symbol."+f))}).store=C},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(w,P,S){var C=w("./_classof"),T=w("./_wks")("iterator"),h=w("./_iterators");P.exports=w("./_core").getIteratorMethod=function(p){if(p!=null)return p[T]||p["@@iterator"]||h[C(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(w,P,S){"use strict";var C=w("./_ctx"),T=w("./_export"),h=w("./_to-object"),p=w("./_iter-call"),f=w("./_is-array-iter"),l=w("./_to-length"),a=w("./_create-property"),c=w("./core.get-iterator-method");T(T.S+T.F*!w("./_iter-detect")(function(s){Array.from(s)}),"Array",{from:function(s){var u,i,n,t,d=h(s),v=typeof this=="function"?this:Array,b=arguments.length,y=b>1?arguments[1]:void 0,_=y!==void 0,m=0,g=c(d);if(_&&(y=C(y,b>2?arguments[2]:void 0,2)),g==null||v==Array&&f(g))for(u=l(d.length),i=new v(u);u>m;m++)a(i,m,_?y(d[m],m):d[m]);else for(t=g.call(d),i=new v;!(n=t.next()).done;m++)a(i,m,_?p(t,y,[n.value,m],!0):n.value);return i.length=m,i}})},{"./_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(w,P,S){"use strict";var C=w("./_add-to-unscopables"),T=w("./_iter-step"),h=w("./_iterators"),p=w("./_to-iobject");P.exports=w("./_iter-define")(Array,"Array",function(f,l){this._t=p(f),this._i=0,this._k=l},function(){var f=this._t,l=this._k,a=this._i++;return!f||a>=f.length?(this._t=void 0,T(1)):l=="keys"?T(0,a):l=="values"?T(0,f[a]):T(0,[a,f[a]])},"values"),h.Arguments=h.Array,C("keys"),C("values"),C("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(w,P,S){"use strict";var C=w("./_is-object"),T=w("./_object-gpo"),h=w("./_wks")("hasInstance"),p=Function.prototype;h in p||w("./_object-dp").f(p,h,{value:function(f){if(typeof this!="function"||!C(f))return!1;if(!C(this.prototype))return f instanceof this;for(;f=T(f);)if(this.prototype===f)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(w,P,S){var C=w("./_export");C(C.S+C.F,"Object",{assign:w("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(w,P,S){var C=w("./_export");C(C.S,"Object",{create:w("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(w,P,S){var C=w("./_export");C(C.S+C.F*!w("./_descriptors"),"Object",{defineProperty:w("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(w,P,S){w("./_object-sap")("getOwnPropertyNames",function(){return w("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(w,P,S){var C=w("./_to-object"),T=w("./_object-gpo");w("./_object-sap")("getPrototypeOf",function(){return function(h){return T(C(h))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(w,P,S){var C=w("./_to-object"),T=w("./_object-keys");w("./_object-sap")("keys",function(){return function(h){return T(C(h))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(w,P,S){arguments[4][36][0].apply(S,arguments)},{dup:36}],143:[function(w,P,S){"use strict";var C,T,h,p,f=w("./_library"),l=w("./_global"),a=w("./_ctx"),c=w("./_classof"),s=w("./_export"),u=w("./_is-object"),i=w("./_a-function"),n=w("./_an-instance"),t=w("./_for-of"),d=w("./_species-constructor"),v=w("./_task").set,b=w("./_microtask")(),y=w("./_new-promise-capability"),_=w("./_perform"),m=w("./_user-agent"),g=w("./_promise-resolve"),E=l.TypeError,o=l.process,x=o&&o.versions,A=x&&x.v8||"",O=l.Promise,D=c(o)=="process",I=function(){},F=T=y.f,z=!!function(){try{var ie=O.resolve(1),oe=(ie.constructor={})[w("./_wks")("species")]=function(ye){ye(I,I)};return(D||typeof PromiseRejectionEvent=="function")&&ie.then(I)instanceof oe&&A.indexOf("6.6")!==0&&m.indexOf("Chrome/66")===-1}catch(ye){}}(),ne=function(ie){var oe;return!(!u(ie)||typeof(oe=ie.then)!="function")&&oe},j=function(ie,oe){if(!ie._n){ie._n=!0;var ye=ie._c;b(function(){for(var pe=ie._v,we=ie._s==1,fe=0;ye.length>fe;)!function(Te){var Fe,De,Me,Ue=we?Te.ok:Te.fail,ve=Te.resolve,ce=Te.reject,Ie=Te.domain;try{Ue?(we||(ie._h==2&&Z(ie),ie._h=1),Ue===!0?Fe=pe:(Ie&&Ie.enter(),Fe=Ue(pe),Ie&&(Ie.exit(),Me=!0)),Fe===Te.promise?ce(E("Promise-chain cycle")):(De=ne(Fe))?De.call(Fe,ve,ce):ve(Fe)):ce(pe)}catch(Ne){Ie&&!Me&&Ie.exit(),ce(Ne)}}(ye[fe++]);ie._c=[],ie._n=!1,oe&&!ie._h&&G(ie)})}},G=function(ie){v.call(l,function(){var oe,ye,pe,we=ie._v,fe=X(ie);if(fe&&(oe=_(function(){D?o.emit("unhandledRejection",we,ie):(ye=l.onunhandledrejection)?ye({promise:ie,reason:we}):(pe=l.console)&&pe.error&&pe.error("Unhandled promise rejection",we)}),ie._h=D||X(ie)?2:1),ie._a=void 0,fe&&oe.e)throw oe.v})},X=function(ie){return ie._h!==1&&(ie._a||ie._c).length===0},Z=function(ie){v.call(l,function(){var oe;D?o.emit("rejectionHandled",ie):(oe=l.onrejectionhandled)&&oe({promise:ie,reason:ie._v})})},K=function(ie){var oe=this;oe._d||(oe._d=!0,oe=oe._w||oe,oe._v=ie,oe._s=2,oe._a||(oe._a=oe._c.slice()),j(oe,!0))},q=function(ie){var oe,ye=this;if(!ye._d){ye._d=!0,ye=ye._w||ye;try{if(ye===ie)throw E("Promise can't be resolved itself");(oe=ne(ie))?b(function(){var pe={_w:ye,_d:!1};try{oe.call(ie,a(q,pe,1),a(K,pe,1))}catch(we){K.call(pe,we)}}):(ye._v=ie,ye._s=1,j(ye,!1))}catch(pe){K.call({_w:ye,_d:!1},pe)}}};z||(O=function(ie){n(this,O,"Promise","_h"),i(ie),C.call(this);try{ie(a(q,this,1),a(K,this,1))}catch(oe){K.call(this,oe)}},C=function(ie){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},C.prototype=w("./_redefine-all")(O.prototype,{then:function(ie,oe){var ye=F(d(this,O));return ye.ok=typeof ie!="function"||ie,ye.fail=typeof oe=="function"&&oe,ye.domain=D?o.domain:void 0,this._c.push(ye),this._a&&this._a.push(ye),this._s&&j(this,!1),ye.promise},catch:function(ie){return this.then(void 0,ie)}}),h=function(){var ie=new C;this.promise=ie,this.resolve=a(q,ie,1),this.reject=a(K,ie,1)},y.f=F=function(ie){return ie===O||ie===p?new h(ie):T(ie)}),s(s.G+s.W+s.F*!z,{Promise:O}),w("./_set-to-string-tag")(O,"Promise"),w("./_set-species")("Promise"),p=w("./_core").Promise,s(s.S+s.F*!z,"Promise",{reject:function(ie){var oe=F(this);return(0,oe.reject)(ie),oe.promise}}),s(s.S+s.F*(f||!z),"Promise",{resolve:function(ie){return g(f&&this===p?O:this,ie)}}),s(s.S+s.F*!(z&&w("./_iter-detect")(function(ie){O.all(ie).catch(I)})),"Promise",{all:function(ie){var oe=this,ye=F(oe),pe=ye.resolve,we=ye.reject,fe=_(function(){var Te=[],Fe=0,De=1;t(ie,!1,function(Me){var Ue=Fe++,ve=!1;Te.push(void 0),De++,oe.resolve(Me).then(function(ce){ve||(ve=!0,Te[Ue]=ce,--De||pe(Te))},we)}),--De||pe(Te)});return fe.e&&we(fe.v),ye.promise},race:function(ie){var oe=this,ye=F(oe),pe=ye.reject,we=_(function(){t(ie,!1,function(fe){oe.resolve(fe).then(ye.resolve,pe)})});return we.e&&pe(we.v),ye.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(w,P,S){var C=w("./_export"),T=w("./_to-absolute-index"),h=String.fromCharCode,p=String.fromCodePoint;C(C.S+C.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(f){for(var l,a=[],c=arguments.length,s=0;c>s;){if(l=+arguments[s++],T(l,1114111)!==l)throw RangeError(l+" is not a valid code point");a.push(l<65536?h(l):h(55296+((l-=65536)>>10),l%1024+56320))}return a.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(w,P,S){"use strict";var C=w("./_string-at")(!0);w("./_iter-define")(String,"String",function(T){this._t=String(T),this._i=0},function(){var T,h=this._t,p=this._i;return p>=h.length?{value:void 0,done:!0}:(T=C(h,p),this._i+=T.length,{value:T,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(w,P,S){"use strict";var C=w("./_global"),T=w("./_has"),h=w("./_descriptors"),p=w("./_export"),f=w("./_redefine"),l=w("./_meta").KEY,a=w("./_fails"),c=w("./_shared"),s=w("./_set-to-string-tag"),u=w("./_uid"),i=w("./_wks"),n=w("./_wks-ext"),t=w("./_wks-define"),d=w("./_enum-keys"),v=w("./_is-array"),b=w("./_an-object"),y=w("./_is-object"),_=w("./_to-iobject"),m=w("./_to-primitive"),g=w("./_property-desc"),E=w("./_object-create"),o=w("./_object-gopn-ext"),x=w("./_object-gopd"),A=w("./_object-dp"),O=w("./_object-keys"),D=x.f,I=A.f,F=o.f,z=C.Symbol,ne=C.JSON,j=ne&&ne.stringify,G=i("_hidden"),X=i("toPrimitive"),Z={}.propertyIsEnumerable,K=c("symbol-registry"),q=c("symbols"),ie=c("op-symbols"),oe=Object.prototype,ye=typeof z=="function",pe=C.QObject,we=!pe||!pe.prototype||!pe.prototype.findChild,fe=h&&a(function(){return E(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a!=7})?function($,V,Y){var me=D(oe,V);me&&delete oe[V],I($,V,Y),me&&$!==oe&&I(oe,V,me)}:I,Te=function($){var V=q[$]=E(z.prototype);return V._k=$,V},Fe=ye&&typeof z.iterator=="symbol"?function($){return typeof $=="symbol"}:function($){return $ instanceof z},De=function($,V,Y){return $===oe&&De(ie,V,Y),b($),V=m(V,!0),b(Y),T(q,V)?(Y.enumerable?(T($,G)&&$[G][V]&&($[G][V]=!1),Y=E(Y,{enumerable:g(0,!1)})):(T($,G)||I($,G,g(1,{})),$[G][V]=!0),fe($,V,Y)):I($,V,Y)},Me=function($,V){b($);for(var Y,me=d(V=_(V)),Ae=0,at=me.length;at>Ae;)De($,Y=me[Ae++],V[Y]);return $},Ue=function($,V){return V===void 0?E($):Me(E($),V)},ve=function($){var V=Z.call(this,$=m($,!0));return!(this===oe&&T(q,$)&&!T(ie,$))&&(!(V||!T(this,$)||!T(q,$)||T(this,G)&&this[G][$])||V)},ce=function($,V){if($=_($),V=m(V,!0),$!==oe||!T(q,V)||T(ie,V)){var Y=D($,V);return!Y||!T(q,V)||T($,G)&&$[G][V]||(Y.enumerable=!0),Y}},Ie=function($){for(var V,Y=F(_($)),me=[],Ae=0;Y.length>Ae;)T(q,V=Y[Ae++])||V==G||V==l||me.push(V);return me},Ne=function($){for(var V,Y=$===oe,me=F(Y?ie:_($)),Ae=[],at=0;me.length>at;)!T(q,V=me[at++])||Y&&!T(oe,V)||Ae.push(q[V]);return Ae};ye||(z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var $=u(arguments.length>0?arguments[0]:void 0),V=function(Y){this===oe&&V.call(ie,Y),T(this,G)&&T(this[G],$)&&(this[G][$]=!1),fe(this,$,g(1,Y))};return h&&we&&fe(oe,$,{configurable:!0,set:V}),Te($)},f(z.prototype,"toString",function(){return this._k}),x.f=ce,A.f=De,w("./_object-gopn").f=o.f=Ie,w("./_object-pie").f=ve,w("./_object-gops").f=Ne,h&&!w("./_library")&&f(oe,"propertyIsEnumerable",ve,!0),n.f=function($){return Te(i($))}),p(p.G+p.W+p.F*!ye,{Symbol:z});for(var Xe="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Xe.length>ee;)i(Xe[ee++]);for(var k=O(i.store),N=0;k.length>N;)t(k[N++]);p(p.S+p.F*!ye,"Symbol",{for:function($){return T(K,$+="")?K[$]:K[$]=z($)},keyFor:function($){if(!Fe($))throw TypeError($+" is not a symbol!");for(var V in K)if(K[V]===$)return V},useSetter:function(){we=!0},useSimple:function(){we=!1}}),p(p.S+p.F*!ye,"Object",{create:Ue,defineProperty:De,defineProperties:Me,getOwnPropertyDescriptor:ce,getOwnPropertyNames:Ie,getOwnPropertySymbols:Ne}),ne&&p(p.S+p.F*(!ye||a(function(){var $=z();return j([$])!="[null]"||j({a:$})!="{}"||j(Object($))!="{}"})),"JSON",{stringify:function($){for(var V,Y,me=[$],Ae=1;arguments.length>Ae;)me.push(arguments[Ae++]);if(Y=V=me[1],(y(V)||$!==void 0)&&!Fe($))return v(V)||(V=function(at,Le){if(typeof Y=="function"&&(Le=Y.call(this,at,Le)),!Fe(Le))return Le}),me[1]=V,j.apply(ne,me)}}),z.prototype[X]||w("./_hide")(z.prototype,X,z.prototype.valueOf),s(z,"Symbol"),s(Math,"Math",!0),s(C.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(w,P,S){"use strict";var C=w("./_export"),T=w("./_core"),h=w("./_global"),p=w("./_species-constructor"),f=w("./_promise-resolve");C(C.P+C.R,"Promise",{finally:function(l){var a=p(this,T.Promise||h.Promise),c=typeof l=="function";return this.then(c?function(s){return f(a,l()).then(function(){return s})}:l,c?function(s){return f(a,l()).then(function(){throw s})}:l)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(w,P,S){"use strict";var C=w("./_export"),T=w("./_new-promise-capability"),h=w("./_perform");C(C.S,"Promise",{try:function(p){var f=T.f(this),l=h(p);return(l.e?f.reject:f.resolve)(l.v),f.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(w,P,S){w("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(w,P,S){w("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(w,P,S){w("./es6.array.iterator");for(var C=w("./_global"),T=w("./_hide"),h=w("./_iterators"),p=w("./_wks")("toStringTag"),f="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(","),l=0;l0?"-":"+")+p(100*Math.floor(Math.abs(D)/60)+Math.abs(D)%60,4),S:["th","st","nd","rd"][_%10>3?0:(_%100-_%10!=10)*_%10],W:I,N:F};return t.replace(s,function(ne){return ne in z?z[ne]:ne.slice(1,ne.length-1)})}}();c.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"},c.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 U=="function"&&U.amd?U(function(){return c}):(S===void 0?"undefined":(0,T.default)(S))==="object"?P.exports=c:h.dateFormat=c}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(w,P,S){(function(C){function T(){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 h(a){var c=this.useColors;if(a[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+a[0]+(c?"%c ":" ")+"+"+S.humanize(this.diff),c){var s="color: "+this.color;a.splice(1,0,s,"color: inherit");var u=0,i=0;a[0].replace(/%[a-zA-Z%]/g,function(n){n!=="%%"&&(u++,n==="%c"&&(i=u))}),a.splice(i,0,s)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function f(a){try{a==null?S.storage.removeItem("debug"):S.storage.debug=a}catch(c){}}function l(){var a;try{a=S.storage.debug}catch(c){}return!a&&C!==void 0&&"env"in C&&(a=C.env.DEBUG),a}S=P.exports=w("./debug"),S.log=p,S.formatArgs=h,S.save=f,S.load=l,S.useColors=T,S.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(a){}}(),S.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],S.formatters.j=function(a){try{return JSON.stringify(a)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}},S.enable(l())}).call(this,w("_process"))},{"./debug":156,_process:173}],156:[function(w,P,S){function C(c){var s,u=0;for(s in c)u=(u<<5)-u+c.charCodeAt(s),u|=0;return S.colors[Math.abs(u)%S.colors.length]}function T(c){function s(){if(s.enabled){var u=s,i=+new Date,n=i-(a||i);u.diff=n,u.prev=a,u.curr=i,a=i;for(var t=new Array(arguments.length),d=0;d]/;P.exports=C},{}],158:[function(w,P,S){function C(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function T(l){return typeof l=="function"}function h(l){return typeof l=="number"}function p(l){return typeof l=="object"&&l!==null}function f(l){return l===void 0}P.exports=C,C.EventEmitter=C,C.prototype._events=void 0,C.prototype._maxListeners=void 0,C.defaultMaxListeners=10,C.prototype.setMaxListeners=function(l){if(!h(l)||l<0||isNaN(l))throw TypeError("n must be a positive number");return this._maxListeners=l,this},C.prototype.emit=function(l){var a,c,s,u,i,n;if(this._events||(this._events={}),l==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((a=arguments[1])instanceof Error)throw a;var t=new Error('Uncaught, unspecified "error" event. ('+a+")");throw t.context=a,t}if(c=this._events[l],f(c))return!1;if(T(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:u=Array.prototype.slice.call(arguments,1),c.apply(this,u)}else if(p(c))for(u=Array.prototype.slice.call(arguments,1),n=c.slice(),s=n.length,i=0;i0&&this._events[l].length>c&&(this._events[l].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[l].length),typeof console.trace=="function"&&console.trace()),this},C.prototype.on=C.prototype.addListener,C.prototype.once=function(l,a){function c(){this.removeListener(l,c),s||(s=!0,a.apply(this,arguments))}if(!T(a))throw TypeError("listener must be a function");var s=!1;return c.listener=a,this.on(l,c),this},C.prototype.removeListener=function(l,a){var c,s,u,i;if(!T(a))throw TypeError("listener must be a function");if(!this._events||!this._events[l])return this;if(c=this._events[l],u=c.length,s=-1,c===a||T(c.listener)&&c.listener===a)delete this._events[l],this._events.removeListener&&this.emit("removeListener",l,a);else if(p(c)){for(i=u;i-- >0;)if(c[i]===a||c[i].listener&&c[i].listener===a){s=i;break}if(s<0)return this;c.length===1?(c.length=0,delete this._events[l]):c.splice(s,1),this._events.removeListener&&this.emit("removeListener",l,a)}return this},C.prototype.removeAllListeners=function(l){var a,c;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[l]&&delete this._events[l],this;if(arguments.length===0){for(a in this._events)a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[l],T(c))this.removeListener(l,c);else if(c)for(;c.length;)this.removeListener(l,c[c.length-1]);return delete this._events[l],this},C.prototype.listeners=function(l){return this._events&&this._events[l]?T(this._events[l])?[this._events[l]]:this._events[l].slice():[]},C.prototype.listenerCount=function(l){if(this._events){var a=this._events[l];if(T(a))return 1;if(a)return a.length}return 0},C.listenerCount=function(l,a){return l.listenerCount(a)}},{}],159:[function(w,P,S){var C=w("http"),T=P.exports;for(var h in C)C.hasOwnProperty(h)&&(T[h]=C[h]);T.request=function(p,f){return p||(p={}),p.scheme="https",p.protocol="https:",C.request.call(this,p,f)}},{http:196}],160:[function(w,P,S){"use strict";var C=w("util"),T=w("ms");P.exports=function(h){if(typeof h=="number")return h;var p=T(h);if(p===void 0){var f=new Error(C.format("humanize-ms(%j) result undefined",h));console.warn(f.stack)}return p}},{ms:169,util:207}],161:[function(w,P,S){S.read=function(C,T,h,p,f){var l,a,c=8*f-p-1,s=(1<>1,i=-7,n=h?f-1:0,t=h?-1:1,d=C[T+n];for(n+=t,l=d&(1<<-i)-1,d>>=-i,i+=c;i>0;l=256*l+C[T+n],n+=t,i-=8);for(a=l&(1<<-i)-1,l>>=-i,i+=p;i>0;a=256*a+C[T+n],n+=t,i-=8);if(l===0)l=1-u;else{if(l===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,p),l-=u}return(d?-1:1)*a*Math.pow(2,l-p)},S.write=function(C,T,h,p,f,l){var a,c,s,u=8*l-f-1,i=(1<>1,t=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=p?0:l-1,v=p?1:-1,b=T<0||T===0&&1/T<0?1:0;for(T=Math.abs(T),isNaN(T)||T===1/0?(c=isNaN(T)?1:0,a=i):(a=Math.floor(Math.log(T)/Math.LN2),T*(s=Math.pow(2,-a))<1&&(a--,s*=2),T+=a+n>=1?t/s:t*Math.pow(2,1-n),T*s>=2&&(a++,s/=2),a+n>=i?(c=0,a=i):a+n>=1?(c=(T*s-1)*Math.pow(2,f),a+=n):(c=T*Math.pow(2,n-1)*Math.pow(2,f),a=0));f>=8;C[h+d]=255&c,d+=v,c/=256,f-=8);for(a=a<0;C[h+d]=255&a,d+=v,a/=256,u-=8);C[h+d-v]|=128*b}},{}],162:[function(w,P,S){typeof Object.create=="function"?P.exports=function(C,T){C.super_=T,C.prototype=Object.create(T.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}})}:P.exports=function(C,T){C.super_=T;var h=function(){};h.prototype=T.prototype,C.prototype=new h,C.prototype.constructor=C}},{}],163:[function(w,P,S){function C(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function T(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&C(h.slice(0,0))}P.exports=function(h){return h!=null&&(C(h)||T(h)||!!h._isBuffer)}},{}],164:[function(w,P,S){!function(C){function T(f){return p.call(f).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function h(f){return typeof f=="function"&&(/^class(\s|\{\}$)/.test(p.call(f))||/^.*classCallCheck\(/.test(T(f)))}var p=Function.prototype.toString;S!==void 0?(P!==void 0&&P.exports&&(S=P.exports=h),S.isClass=h):typeof U=="function"&&U.amd?U([],function(){return h}):C.isClass=h}(this)},{}],165:[function(w,P,S){"use strict";function C(l){var a=l.slice(2);return a=a[0].toLowerCase()+a.slice(1)}var T=w("core-util-is"),h=w("isstream"),p=w("is-class");Object.keys(T).map(function(l){S[C(l)]=T[l]}),S.stream=h,S.readableStream=h.isReadable,S.writableStream=h.isWritable,S.duplexStream=h.isDuplex,S.class=p,S.finite=function(l){return Number.isFinite(l)},S.NaN=function(l){return Number.isNaN(l)},S.generator=function(l){return l&&typeof l.next=="function"&&typeof l.throw=="function"},S.generatorFunction=function(l){return l&&l.constructor&&l.constructor.name==="GeneratorFunction"},S.asyncFunction=function(l){return l&&l.constructor&&l.constructor.name==="AsyncFunction"},S.promise=function(l){return l&&typeof l.then=="function"};var f=Math.pow(2,31);S.int=function(l){return T.isNumber(l)&&l%1==0},S.int32=function(l){return S.int(l)&&l=-f},S.long=function(l){return S.int(l)&&(l>=f||l<-f)},S.Long=function(l){return S.object(l)&&S.number(l.high)&&S.number(l.low)},S.double=function(l){return T.isNumber(l)&&!isNaN(l)&&l%1!=0},S.date=function(l){return l instanceof Date},S.regExp=function(l){return l instanceof RegExp},S.regexp=S.regExp,S.error=function(l){return l instanceof Error},S.array=function(l){return Array.isArray(l)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(w,P,S){var C={}.toString;P.exports=Array.isArray||function(T){return C.call(T)=="[object Array]"}},{}],167:[function(w,P,S){function C(l){return l instanceof f.Stream}function T(l){return C(l)&&typeof l._read=="function"&&typeof l._readableState=="object"}function h(l){return C(l)&&typeof l._write=="function"&&typeof l._writableState=="object"}function p(l){return T(l)&&h(l)}var f=w("stream");P.exports=C,P.exports.isReadable=T,P.exports.isWritable=h,P.exports.isDuplex=p},{stream:195}],168:[function(w,P,S){"use strict";function C(h,p,f){if(!h)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return f===void 0&&(f=!0),Object.getOwnPropertyNames(p).forEach(function(l){if(f||!T.call(h,l)){var a=Object.getOwnPropertyDescriptor(p,l);Object.defineProperty(h,l,a)}}),h}P.exports=C;var T=Object.prototype.hasOwnProperty},{}],169:[function(w,P,S){function C(u){if(u=String(u),!(u.length>100)){var i=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(i){var n=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*s;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*l;case"seconds":case"second":case"secs":case"sec":case"s":return n*f;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function T(u){return u>=c?Math.round(u/c)+"d":u>=a?Math.round(u/a)+"h":u>=l?Math.round(u/l)+"m":u>=f?Math.round(u/f)+"s":u+"ms"}function h(u){return p(u,c,"day")||p(u,a,"hour")||p(u,l,"minute")||p(u,f,"second")||u+" ms"}function p(u,i,n){if(!(u0)return C(u);if(n==="number"&&isNaN(u)===!1)return i.long?h(u):T(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))}},{}],170:[function(w,P,S){(function(C){function T(l,a){for(var c=0,s=l.length-1;s>=0;s--){var u=l[s];u==="."?l.splice(s,1):u===".."?(l.splice(s,1),c++):c&&(l.splice(s,1),c--)}if(a)for(;c--;c)l.unshift("..");return l}function h(l){typeof l!="string"&&(l+="");var a,c=0,s=-1,u=!0;for(a=l.length-1;a>=0;--a)if(l.charCodeAt(a)===47){if(!u){c=a+1;break}}else s===-1&&(u=!1,s=a+1);return s===-1?"":l.slice(c,s)}function p(l,a){if(l.filter)return l.filter(a);for(var c=[],s=0;s=-1&&!a;c--){var s=c>=0?arguments[c]:C.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");s&&(l=s+"/"+l,a=s.charAt(0)==="/")}return l=T(p(l.split("/"),function(u){return!!u}),!a).join("/"),(a?"/":"")+l||"."},S.normalize=function(l){var a=S.isAbsolute(l),c=f(l,-1)==="/";return l=T(p(l.split("/"),function(s){return!!s}),!a).join("/"),l||a||(l="."),l&&c&&(l+="/"),(a?"/":"")+l},S.isAbsolute=function(l){return l.charAt(0)==="/"},S.join=function(){var l=Array.prototype.slice.call(arguments,0);return S.normalize(p(l,function(a,c){if(typeof a!="string")throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},S.relative=function(l,a){function c(v){for(var b=0;b=0&&v[y]==="";y--);return b>y?[]:v.slice(b,y-b+1)}l=S.resolve(l).substr(1),a=S.resolve(a).substr(1);for(var s=c(l.split("/")),u=c(a.split("/")),i=Math.min(s.length,u.length),n=i,t=0;t=1;--i)if((a=l.charCodeAt(i))===47){if(!u){s=i;break}}else u=!1;return s===-1?c?"/":".":c&&s===1?"/":l.slice(0,s)},S.basename=function(l,a){var c=h(l);return a&&c.substr(-1*a.length)===a&&(c=c.substr(0,c.length-a.length)),c},S.extname=function(l){typeof l!="string"&&(l+="");for(var a=-1,c=0,s=-1,u=!0,i=0,n=l.length-1;n>=0;--n){var t=l.charCodeAt(n);if(t!==47)s===-1&&(u=!1,s=n+1),t===46?a===-1?a=n:i!==1&&(i=1):a!==-1&&(i=-1);else if(!u){c=n+1;break}}return a===-1||s===-1||i===0||i===1&&a===s-1&&a===c+1?"":l.slice(a,s)};var f="ab".substr(-1)==="b"?function(l,a,c){return l.substr(a,c)}:function(l,a,c){return a<0&&(a=l.length+a),l.substr(a,c)}}).call(this,w("_process"))},{_process:173}],171:[function(w,P,S){(function(C){(function(){"use strict";function T(A){return A=String(A),A.charAt(0).toUpperCase()+A.slice(1)}function h(A,O,D){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 O&&D&&/^Win/i.test(A)&&!/^Windows Phone /i.test(A)&&(I=I[/[\d.]+$/.exec(A)])&&(A="Windows "+I),A=String(A),O&&D&&(A=A.replace(RegExp(O,"i"),D)),A=f(A.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(A,O){var D=-1,I=A?A.length:0;if(typeof I=="number"&&I>-1&&I<=_)for(;++D3&&"WebKit"||/\bOpera\b/.test(Ne)&&(/\bOPR\b/.test(A)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(A)&&!/^(?:Trident|EdgeHTML)$/.test(Ie)&&"WebKit"||!Ie&&/\bMSIE\b/i.test(A)&&(k=="Mac OS"?"Tasman":"Trident")||Ie=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(Ne)&&"NetFront")&&(Ie=[j]),Ne=="IE"&&(j=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(A)||0)[1])?(Ne+=" Mobile",k="Windows Phone "+(/\+$/.test(j)?j:j+".x"),Me.unshift("desktop mode")):/\bWPDesktop\b/i.test(A)?(Ne="IE Mobile",k="Windows Phone 8.x",Me.unshift("desktop mode"),ce||(ce=(/\brv:([\d.]+)/.exec(A)||0)[1])):Ne!="IE"&&Ie=="Trident"&&(j=/\brv:([\d.]+)/.exec(A))&&(Ne&&Me.push("identifying as "+Ne+(ce?" "+ce:"")),Ne="IE",ce=j[1]),ve){if(c(I,"global"))if(oe&&(j=oe.lang.System,De=j.getProperty("os.arch"),k=k||j.getProperty("os.name")+" "+j.getProperty("os.version")),ye){try{ce=I.require("ringo/engine").version.join("."),Ne="RingoJS"}catch($){(j=I.system)&&j.global.system==I.system&&(Ne="Narwhal",k||(k=j[0].os||null))}Ne||(Ne="Rhino")}else typeof I.process=="object"&&!I.process.browser&&(j=I.process)&&(typeof j.versions=="object"&&(typeof j.versions.electron=="string"?(Me.push("Node "+j.versions.node),Ne="Electron",ce=j.versions.electron):typeof j.versions.nw=="string"&&(Me.push("Chromium "+ce,"Node "+j.versions.node),Ne="NW.js",ce=j.versions.nw)),Ne||(Ne="Node.js",De=j.arch,k=j.platform,ce=/[\d.]+/.exec(j.version),ce=ce?ce[0]:null));else a(j=I.runtime)==Z?(Ne="Adobe AIR",k=j.flash.system.Capabilities.os):a(j=I.phantom)==ie?(Ne="PhantomJS",ce=(j=j.version||null)&&j.major+"."+j.minor+"."+j.patch):typeof fe.documentMode=="number"&&(j=/\bTrident\/(\d+)/i.exec(A))?(ce=[ce,fe.documentMode],(j=+j[1]+4)!=ce[1]&&(Me.push("IE "+ce[1]+" mode"),Ie&&(Ie[1]=""),ce[1]=j),ce=Ne=="IE"?String(ce[1].toFixed(1)):ce[0]):typeof fe.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(Ne)&&(Me.push("masking as "+Ne+" "+ce),Ne="IE",ce="11.0",Ie=["Trident"],k="Windows");k=k&&f(k)}if(ce&&(j=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(ce)||/(?:alpha|beta)(?: ?\d)?/i.exec(A+";"+(ve&&z.appMinorVersion))||/\bMinefield\b/i.test(A)&&"a")&&(Ue=/b/i.test(j)?"beta":"alpha",ce=ce.replace(RegExp(j+"\\+?$"),"")+(Ue=="beta"?we:pe)+(/\d+\+?/.exec(j)||"")),Ne=="Fennec"||Ne=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(k))Ne="Firefox Mobile";else if(Ne=="Maxthon"&&ce)ce=ce.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(Xe))Xe=="Xbox 360"&&(k=null),Xe=="Xbox 360"&&/\bIEMobile\b/.test(A)&&Me.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(Ne)&&(!Ne||Xe||/Browser|Mobi/.test(Ne))||k!="Windows CE"&&!/Mobi/i.test(A))if(Ne=="IE"&&ve)try{I.external===null&&Me.unshift("platform preview")}catch($){Me.unshift("embedded")}else(/\bBlackBerry\b/.test(Xe)||/\bBB10\b/.test(A))&&(j=(RegExp(Xe.replace(/ +/g," *")+"/([.\\d]+)","i").exec(A)||0)[1]||ce)?(j=[j,/BB10/.test(A)],k=(j[1]?(Xe=null,ee="BlackBerry"):"Device Software")+" "+j[0],ce=null):this!=l&&Xe!="Wii"&&(ve&&Te||/Opera/.test(Ne)&&/\b(?:MSIE|Firefox)\b/i.test(A)||Ne=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(k)||Ne=="IE"&&(k&&!/^Win/.test(k)&&ce>5.5||/\bWindows XP\b/.test(k)&&ce>8||ce==8&&!/\bTrident\b/.test(A)))&&!m.test(j=n.call(l,A.replace(m,"")+";"))&&j.name&&(j="ing as "+j.name+((j=j.version)?" "+j:""),m.test(Ne)?(/\bIE\b/.test(j)&&k=="Mac OS"&&(k=null),j="identify"+j):(j="mask"+j,Ne=Fe?f(Fe.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(j)&&(k=null),ve||(ce=null)),Ie=["Presto"],Me.push(j));else Ne+=" Mobile";(j=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(A)||0)[1])&&(j=[parseFloat(j.replace(/\.(\d)$/,".0$1")),j],Ne=="Safari"&&j[1].slice(-1)=="+"?(Ne="WebKit Nightly",Ue="alpha",ce=j[1].slice(0,-1)):ce!=j[1]&&ce!=(j[2]=(/\bSafari\/([\d.]+\+?)/i.exec(A)||0)[1])||(ce=null),j[1]=(/\bChrome\/([\d.]+)/i.exec(A)||0)[1],j[0]==537.36&&j[2]==537.36&&parseFloat(j[1])>=28&&Ie=="WebKit"&&(Ie=["Blink"]),ve&&(X||j[1])?(Ie&&(Ie[1]="like Chrome"),j=j[1]||(j=j[0],j<530?1:j<532?2:j<532.05?3:j<533?4:j<534.03?5:j<534.07?6:j<534.1?7:j<534.13?8:j<534.16?9:j<534.24?10:j<534.3?11:j<535.01?12:j<535.02?"13+":j<535.07?15:j<535.11?16:j<535.19?17:j<536.05?18:j<536.1?19:j<537.01?20:j<537.11?"21+":j<537.13?23:j<537.18?24:j<537.24?25:j<537.36?26:Ie!="Blink"?"27":"28")):(Ie&&(Ie[1]="like Safari"),j=j[0],j=j<400?1:j<500?2:j<526?3:j<533?4:j<534?"4+":j<535?5:j<537?6:j<538?7:j<601?8:"8"),Ie&&(Ie[1]+=" "+(j+=typeof j=="number"?".x":/[.+]/.test(j)?"":"+")),Ne=="Safari"&&(!ce||parseInt(ce)>45)&&(ce=j)),Ne=="Opera"&&(j=/\bzbov|zvav$/.exec(k))?(Ne+=" ",Me.unshift("desktop mode"),j=="zvav"?(Ne+="Mini",ce=null):Ne+="Mobile",k=k.replace(RegExp(" *"+j+"$"),"")):Ne=="Safari"&&/\bChrome\b/.exec(Ie&&Ie[1])&&(Me.unshift("desktop mode"),Ne="Chrome Mobile",ce=null,/\bOS X\b/.test(k)?(ee="Apple",k="iOS 4.3+"):k=null),ce&&ce.indexOf(j=/[\d.]+$/.exec(k))==0&&A.indexOf("/"+j+"-")>-1&&(k=i(k.replace(j,""))),Ie&&!/\b(?:Avant|Nook)\b/.test(Ne)&&(/Browser|Lunascape|Maxthon/.test(Ne)||Ne!="Safari"&&/^iOS/.test(k)&&/\bSafari\b/.test(Ie[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(Ne)&&Ie[1])&&(j=Ie[Ie.length-1])&&Me.push(j),Me.length&&(Me=["("+Me.join("; ")+")"]),ee&&Xe&&Xe.indexOf(ee)<0&&Me.push("on "+ee),Xe&&Me.push((/^on /.test(Me[Me.length-1])?"":"on ")+Xe),k&&(j=/ ([\d.+]+)$/.exec(k),G=j&&k.charAt(k.length-j[0].length-1)=="/",k={architecture:32,family:j&&!G?k.replace(j[0],""):k,version:j?j[1]:null,toString:function(){var $=this.version;return this.family+($&&!G?" "+$:"")+(this.architecture==64?" 64-bit":"")}}),(j=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(De))&&!/\bi686\b/i.test(De)?(k&&(k.architecture=64,k.family=k.family.replace(RegExp(" *"+j),"")),Ne&&(/\bWOW64\b/i.test(A)||ve&&/\w(?:86|32)$/.test(z.cpuClass||z.platform)&&!/\bWin64; x64\b/i.test(A))&&Me.unshift("32-bit")):k&&/^OS X/.test(k.family)&&Ne=="Chrome"&&parseFloat(ce)>=39&&(k.architecture=64),A||(A=null);var N={};return N.description=A,N.layout=Ie&&Ie[0],N.manufacturer=ee,N.name=Ne,N.prerelease=Ue,N.product=Xe,N.ua=A,N.version=Ne&&ce,N.os=k||{architecture:null,family:null,version:null,toString:function(){return"null"}},N.parse=n,N.toString=D,N.version&&Me.unshift(ce),N.name&&Me.unshift(Ne),k&&Ne&&(k!=String(k).split(" ")[0]||k!=Ne.split(" ")[0]&&!Xe)&&Me.push(Xe?"("+k+")":"on "+k),Me.length&&(N.description=Me.join(" ")),N}var t={function:!0,object:!0},d=t[typeof window]&&window||this,v=t[typeof S]&&S,b=t[typeof P]&&P&&!P.nodeType&&P,y=v&&b&&typeof C=="object"&&C;!y||y.global!==y&&y.window!==y&&y.self!==y||(d=y);var _=Math.pow(2,53)-1,m=/\bOpera/,g=Object.prototype,E=g.hasOwnProperty,o=g.toString,x=n();typeof U=="function"&&typeof U.amd=="object"&&U.amd?(d.platform=x,U(function(){return x})):v&&b?l(x,function(A,O){v[O]=A}):d.platform=x}).call(this)}).call(this,typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(w,P,S){(function(C){"use strict";function T(h,p,f,l){if(typeof h!="function")throw new TypeError('"callback" argument must be a function');var a,c,s=arguments.length;switch(s){case 0:case 1:return C.nextTick(h);case 2:return C.nextTick(function(){h.call(null,p)});case 3:return C.nextTick(function(){h.call(null,p,f)});case 4:return C.nextTick(function(){h.call(null,p,f,l)});default:for(a=new Array(s-1),c=0;c1)for(var _=1;_1&&(ye=oe[0]+"@",q=oe[1]),q=q.replace(j,"."),ye+p(q.split("."),ie).join(".")}function l(q){for(var ie,oe,ye=[],pe=0,we=q.length;pe=55296&&ie<=56319&&pe65535&&(ie-=65536,oe+=K(ie>>>10&1023|55296),ie=56320|1023&ie),oe+=K(ie)}).join("")}function c(q){return q-48<10?q-22:q-65<26?q-65:q-97<26?q-97:E}function s(q,ie){return q+22+75*(q<26)-((ie!=0)<<5)}function u(q,ie,oe){var ye=0;for(q=oe?Z(q/O):q>>1,q+=Z(q/ie);q>X*x>>1;ye+=E)q=Z(q/X);return Z(ye+(X+1)*q/(q+A))}function i(q){var ie,oe,ye,pe,we,fe,Te,Fe,De,Me,Ue=[],ve=q.length,ce=0,Ie=I,Ne=D;for(oe=q.lastIndexOf(F),oe<0&&(oe=0),ye=0;ye=128&&h("not-basic"),Ue.push(q.charCodeAt(ye));for(pe=oe>0?oe+1:0;pe=ve&&h("invalid-input"),Fe=c(q.charCodeAt(pe++)),(Fe>=E||Fe>Z((g-ce)/fe))&&h("overflow"),ce+=Fe*fe,De=Te<=Ne?o:Te>=Ne+x?x:Te-Ne,!(FeZ(g/Me)&&h("overflow"),fe*=Me;ie=Ue.length+1,Ne=u(ce-we,ie,we==0),Z(ce/ie)>g-Ie&&h("overflow"),Ie+=Z(ce/ie),ce%=ie,Ue.splice(ce++,0,Ie)}return a(Ue)}function n(q){var ie,oe,ye,pe,we,fe,Te,Fe,De,Me,Ue,ve,ce,Ie,Ne,Xe=[];for(q=l(q),ve=q.length,ie=I,oe=0,we=D,fe=0;fe=ie&&UeZ((g-oe)/ce)&&h("overflow"),oe+=(Te-ie)*ce,ie=Te,fe=0;feg&&h("overflow"),Ue==ie){for(Fe=oe,De=E;Me=De<=we?o:De>=we+x?x:De-we,!(Fe= 0x80 (not a basic code point)","invalid-input":"Invalid input"},X=E-o,Z=Math.floor,K=String.fromCharCode;if(_={version:"1.4.1",ucs2:{decode:l,encode:a},decode:i,encode:n,toASCII:d,toUnicode:t},typeof U=="function"&&typeof U.amd=="object"&&U.amd)U("punycode",function(){return _});else if(v&&b)if(P.exports==v)b.exports=_;else for(m in _)_.hasOwnProperty(m)&&(v[m]=_[m]);else T.punycode=_}(this)}).call(this,typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(w,P,S){"use strict";function C(h,p){return Object.prototype.hasOwnProperty.call(h,p)}P.exports=function(h,p,f,l){p=p||"&",f=f||"=";var a={};if(typeof h!="string"||h.length===0)return a;var c=/\+/g;h=h.split(p);var s=1e3;l&&typeof l.maxKeys=="number"&&(s=l.maxKeys);var u=h.length;s>0&&u>s&&(u=s);for(var i=0;i=0?(n=b.substr(0,y),t=b.substr(y+1)):(n=b,t=""),d=decodeURIComponent(n),v=decodeURIComponent(t),C(a,d)?T(a[d])?a[d].push(v):a[d]=[a[d],v]:a[d]=v}return a};var T=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"}},{}],176:[function(w,P,S){"use strict";function C(f,l){if(f.map)return f.map(l);for(var a=[],c=0;c0?(typeof ce=="string"||ee.objectMode||(0,G.default)(ce)===oe.prototype||(ce=h(ce)),Ne?ee.endEmitted?ve.emit("error",new Error("stream.unshift() after end event")):s(ve,ee,ce,!0):ee.ended?ve.emit("error",new Error("stream.push() after EOF")):(ee.reading=!1,ee.decoder&&!Ie?(ce=ee.decoder.write(ce),ee.objectMode||ce.length!==0?s(ve,ee,ce,!1):y(ve,ee)):s(ve,ee,ce,!1))):Ne||(ee.reading=!1)}return i(ee)}function s(ve,ce,Ie,Ne){ce.flowing&&ce.length===0&&!ce.sync?(ve.emit("data",Ie),ve.read(0)):(ce.length+=ce.objectMode?1:Ie.length,Ne?ce.buffer.unshift(Ie):ce.buffer.push(Ie),ce.needReadable&&v(ve)),y(ve,ce)}function u(ve,ce){var Ie;return p(ce)||typeof ce=="string"||ce===void 0||ve.objectMode||(Ie=new TypeError("Invalid non-string/buffer chunk")),Ie}function i(ve){return!ve.ended&&(ve.needReadable||ve.length=Ue?ve=Ue:(ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++),ve}function t(ve,ce){return ve<=0||ce.length===0&&ce.ended?0:ce.objectMode?1:ve!==ve?ce.flowing&&ce.length?ce.buffer.head.data.length:ce.length:(ve>ce.highWaterMark&&(ce.highWaterMark=n(ve)),ve<=ce.length?ve:ce.ended?ce.length:(ce.needReadable=!0,0))}function d(ve,ce){if(!ce.ended){if(ce.decoder){var Ie=ce.decoder.end();Ie&&Ie.length&&(ce.buffer.push(Ie),ce.length+=ce.objectMode?1:Ie.length)}ce.ended=!0,v(ve)}}function v(ve){var ce=ve._readableState;ce.needReadable=!1,ce.emittedReadable||(fe("emitReadable",ce.flowing),ce.emittedReadable=!0,ce.sync?X.nextTick(b,ve):b(ve))}function b(ve){fe("emit readable"),ve.emit("readable"),x(ve)}function y(ve,ce){ce.readingMore||(ce.readingMore=!0,X.nextTick(_,ve,ce))}function _(ve,ce){for(var Ie=ce.length;!ce.reading&&!ce.flowing&&!ce.ended&&ce.length=ce.length?(Ie=ce.decoder?ce.buffer.join(""):ce.buffer.length===1?ce.buffer.head.data:ce.buffer.concat(ce.length),ce.buffer.clear()):Ie=O(ve,ce.buffer,ce.decoder),Ie}function O(ve,ce,Ie){var Ne;return veee.length?ee.length:ve;if(k===ee.length?Xe+=ee:Xe+=ee.slice(0,ve),(ve-=k)===0){k===ee.length?(++Ne,Ie.next?ce.head=Ie.next:ce.head=ce.tail=null):(ce.head=Ie,Ie.data=ee.slice(k));break}++Ne}return ce.length-=Ne,Xe}function I(ve,ce){var Ie=oe.allocUnsafe(ve),Ne=ce.head,Xe=1;for(Ne.data.copy(Ie),ve-=Ne.data.length;Ne=Ne.next;){var ee=Ne.data,k=ve>ee.length?ee.length:ve;if(ee.copy(Ie,Ie.length-ve,0,k),(ve-=k)===0){k===ee.length?(++Xe,Ne.next?ce.head=Ne.next:ce.head=ce.tail=null):(ce.head=Ne,Ne.data=ee.slice(k));break}++Xe}return ce.length-=Xe,Ie}function F(ve){var ce=ve._readableState;if(ce.length>0)throw new Error('"endReadable()" called on non-empty stream');ce.endEmitted||(ce.ended=!0,X.nextTick(z,ce,ve))}function z(ve,ce){ve.endEmitted||ve.length!==0||(ve.endEmitted=!0,ce.readable=!1,ce.emit("end"))}function ne(ve,ce){for(var Ie=0,Ne=ve.length;Ie=ce.highWaterMark||ce.ended))return fe("read: emitReadable",ce.length,ce.ended),ce.length===0&&ce.ended?F(this):v(this),null;if((ve=t(ve,ce))===0&&ce.ended)return ce.length===0&&F(this),null;var Ne=ce.needReadable;fe("need readable",Ne),(ce.length===0||ce.length-ve0?A(ve,ce):null,Xe===null?(ce.needReadable=!0,ve=0):ce.length-=ve,ce.length===0&&(ce.ended||(ce.needReadable=!0),Ie!==ve&&ce.ended&&F(this)),Xe!==null&&this.emit("data",Xe),Xe},a.prototype._read=function(ve){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(ve,ce){function Ie(Ze,Ve){fe("onunpipe"),Ze===Y&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,Xe())}function Ne(){fe("onend"),ve.end()}function Xe(){fe("cleanup"),ve.removeListener("close",N),ve.removeListener("finish",$),ve.removeListener("drain",Le),ve.removeListener("error",k),ve.removeListener("unpipe",Ie),Y.removeListener("end",Ne),Y.removeListener("end",V),Y.removeListener("data",ee),ke=!0,!me.awaitDrain||ve._writableState&&!ve._writableState.needDrain||Le()}function ee(Ze){fe("ondata"),Ye=!1,ve.write(Ze)!==!1||Ye||((me.pipesCount===1&&me.pipes===ve||me.pipesCount>1&&ne(me.pipes,ve)!==-1)&&!ke&&(fe("false write response, pause",Y._readableState.awaitDrain),Y._readableState.awaitDrain++,Ye=!0),Y.pause())}function k(Ze){fe("onerror",Ze),V(),ve.removeListener("error",k),q(ve,"error")===0&&ve.emit("error",Ze)}function N(){ve.removeListener("finish",$),V()}function $(){fe("onfinish"),ve.removeListener("close",N),V()}function V(){fe("unpipe"),Y.unpipe(ve)}var Y=this,me=this._readableState;switch(me.pipesCount){case 0:me.pipes=ve;break;case 1:me.pipes=[me.pipes,ve];break;default:me.pipes.push(ve)}me.pipesCount+=1,fe("pipe count=%d opts=%j",me.pipesCount,ce);var Ae=(!ce||ce.end!==!1)&&ve!==C.stdout&&ve!==C.stderr,at=Ae?Ne:V;me.endEmitted?X.nextTick(at):Y.once("end",at),ve.on("unpipe",Ie);var Le=m(Y);ve.on("drain",Le);var ke=!1,Ye=!1;return Y.on("data",ee),f(ve,"error",k),ve.once("close",N),ve.once("finish",$),ve.emit("pipe",Y),me.flowing||(fe("pipe resume"),Y.resume()),ve},a.prototype.unpipe=function(ve){var ce=this._readableState,Ie={hasUnpiped:!1};if(ce.pipesCount===0)return this;if(ce.pipesCount===1)return ve&&ve!==ce.pipes?this:(ve||(ve=ce.pipes),ce.pipes=null,ce.pipesCount=0,ce.flowing=!1,ve&&ve.emit("unpipe",this,Ie),this);if(!ve){var Ne=ce.pipes,Xe=ce.pipesCount;ce.pipes=null,ce.pipesCount=0,ce.flowing=!1;for(var ee=0;ee-1?Z.default:K.nextTick;s.WritableState=c;var oe=w("core-util-is");oe.inherits=w("inherits");var ye={deprecate:w("util-deprecate")},pe=w("./internal/streams/stream"),we=w("safe-buffer").Buffer,fe=T.Uint8Array||function(){},Te=w("./internal/streams/destroy");oe.inherits(s,pe),c.prototype.getBuffer=function(){for(var De=this.bufferedRequest,Me=[];De;)Me.push(De),De=De.next;return Me},function(){try{Object.defineProperty(c.prototype,"buffer",{get:ye.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(De){}}();var Fe;typeof G.default=="function"&&ne.default&&typeof Function.prototype[ne.default]=="function"?(Fe=Function.prototype[ne.default],(0,F.default)(s,ne.default,{value:function(De){return!!Fe.call(this,De)||this===s&&De&&De._writableState instanceof c}})):Fe=function(De){return De instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(De,Me,Ue){var ve=this._writableState,ce=!1,Ie=!ve.objectMode&&l(De);return Ie&&!we.isBuffer(De)&&(De=f(De)),typeof Me=="function"&&(Ue=Me,Me=null),Ie?Me="buffer":Me||(Me=ve.defaultEncoding),typeof Ue!="function"&&(Ue=a),ve.ended?u(this,Ue):(Ie||i(this,ve,De,Ue))&&(ve.pendingcb++,ce=t(this,ve,Ie,De,Me,Ue)),ce},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var De=this._writableState;De.corked&&(De.corked--,De.writing||De.corked||De.finished||De.bufferProcessing||!De.bufferedRequest||g(this,De))},s.prototype.setDefaultEncoding=function(De){if(typeof De=="string"&&(De=De.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((De+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+De);return this._writableState.defaultEncoding=De,this},Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),s.prototype._write=function(De,Me,Ue){Ue(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(De,Me,Ue){var ve=this._writableState;typeof De=="function"?(Ue=De,De=null,Me=null):typeof Me=="function"&&(Ue=Me,Me=null),De!=null&&this.write(De,Me),ve.corked&&(ve.corked=1,this.uncork()),ve.ending||ve.finished||O(this,ve,Ue)},Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(De){this._writableState&&(this._writableState.destroyed=De)}}),s.prototype.destroy=Te.destroy,s.prototype._undestroy=Te.undestroy,s.prototype._destroy=function(De,Me){this.end(),Me(De)}}).call(this,w("_process"),typeof ae!="undefined"?ae: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(w,P,S){"use strict";function C(f,l){if(!(f instanceof l))throw new TypeError("Cannot call a class as a function")}function T(f,l,a){f.copy(l,a)}var h=w("safe-buffer").Buffer,p=w("util");P.exports=function(){function f(){C(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(l){var a={data:l,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},f.prototype.unshift=function(l){var a={data:l,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length},f.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(l){if(this.length===0)return"";for(var a=this.head,c=""+a.data;a=a.next;)c+=l+a.data;return c},f.prototype.concat=function(l){if(this.length===0)return h.alloc(0);if(this.length===1)return this.head.data;for(var a=h.allocUnsafe(l>>>0),c=this.head,s=0;c;)T(c.data,a,s),s+=c.data.length,c=c.next;return a},f}(),p&&p.inspect&&p.inspect.custom&&(P.exports.prototype[p.inspect.custom]=function(){var f=p.inspect({length:this.length});return this.constructor.name+" "+f})},{"safe-buffer":193,util:36}],185:[function(w,P,S){"use strict";function C(f,l){var a=this,c=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return c||s?(l?l(f):!f||this._writableState&&this._writableState.errorEmitted||p.nextTick(h,this,f),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(u){!l&&u?(p.nextTick(h,a,u),a._writableState&&(a._writableState.errorEmitted=!0)):l&&l(u)}),this)}function T(){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 h(f,l){f.emit("error",l)}var p=w("process-nextick-args");P.exports={destroy:C,undestroy:T}},{"process-nextick-args":172}],186:[function(w,P,S){"use strict";P.exports=w("events").EventEmitter},{events:158}],187:[function(w,P,S){P.exports=w("./readable").PassThrough},{"./readable":188}],188:[function(w,P,S){S=P.exports=w("./lib/_stream_readable.js"),S.Stream=S,S.Readable=S,S.Writable=w("./lib/_stream_writable.js"),S.Duplex=w("./lib/_stream_duplex.js"),S.Transform=w("./lib/_stream_transform.js"),S.PassThrough=w("./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(w,P,S){P.exports=w("./readable").Transform},{"./readable":188}],190:[function(w,P,S){P.exports=w("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(w,P,S){var C=function(){return this}()||Function("return this")(),T=C.regeneratorRuntime&&Object.getOwnPropertyNames(C).indexOf("regeneratorRuntime")>=0,h=T&&C.regeneratorRuntime;if(C.regeneratorRuntime=void 0,P.exports=w("./runtime"),T)C.regeneratorRuntime=h;else try{delete C.regeneratorRuntime}catch(p){C.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(w,P,S){!function(C){"use strict";function T(Z,K,q,ie){var oe=K&&K.prototype instanceof p?K:p,ye=Object.create(oe.prototype),pe=new t(ie||[]);return ye._invoke=s(Z,q,pe),ye}function h(Z,K,q){try{return{type:"normal",arg:Z.call(K,q)}}catch(ie){return{type:"throw",arg:ie}}}function p(){}function f(){}function l(){}function a(Z){["next","throw","return"].forEach(function(K){Z[K]=function(q){return this._invoke(K,q)}})}function c(Z){function K(oe,ye,pe,we){var fe=h(Z[oe],Z,ye);if(fe.type!=="throw"){var Te=fe.arg,Fe=Te.value;return Fe&&typeof Fe=="object"&&_.call(Fe,"__await")?Promise.resolve(Fe.__await).then(function(De){K("next",De,pe,we)},function(De){K("throw",De,pe,we)}):Promise.resolve(Fe).then(function(De){Te.value=De,pe(Te)},we)}we(fe.arg)}function q(oe,ye){function pe(){return new Promise(function(we,fe){K(oe,ye,we,fe)})}return ie=ie?ie.then(pe,pe):pe()}var ie;this._invoke=q}function s(Z,K,q){var ie=O;return function(oe,ye){if(ie===I)throw new Error("Generator is already running");if(ie===F){if(oe==="throw")throw ye;return v()}for(q.method=oe,q.arg=ye;;){var pe=q.delegate;if(pe){var we=u(pe,q);if(we){if(we===z)continue;return we}}if(q.method==="next")q.sent=q._sent=q.arg;else if(q.method==="throw"){if(ie===O)throw ie=F,q.arg;q.dispatchException(q.arg)}else q.method==="return"&&q.abrupt("return",q.arg);ie=I;var fe=h(Z,K,q);if(fe.type==="normal"){if(ie=q.done?F:D,fe.arg===z)continue;return{value:fe.arg,done:q.done}}fe.type==="throw"&&(ie=F,q.method="throw",q.arg=fe.arg)}}}function u(Z,K){var q=Z.iterator[K.method];if(q===b){if(K.delegate=null,K.method==="throw"){if(Z.iterator.return&&(K.method="return",K.arg=b,u(Z,K),K.method==="throw"))return z;K.method="throw",K.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var ie=h(q,Z.iterator,K.arg);if(ie.type==="throw")return K.method="throw",K.arg=ie.arg,K.delegate=null,z;var oe=ie.arg;return oe?oe.done?(K[Z.resultName]=oe.value,K.next=Z.nextLoc,K.method!=="return"&&(K.method="next",K.arg=b),K.delegate=null,z):oe:(K.method="throw",K.arg=new TypeError("iterator result is not an object"),K.delegate=null,z)}function i(Z){var K={tryLoc:Z[0]};1 in Z&&(K.catchLoc=Z[1]),2 in Z&&(K.finallyLoc=Z[2],K.afterLoc=Z[3]),this.tryEntries.push(K)}function n(Z){var K=Z.completion||{};K.type="normal",delete K.arg,Z.completion=K}function t(Z){this.tryEntries=[{tryLoc:"root"}],Z.forEach(i,this),this.reset(!0)}function d(Z){if(Z){var K=Z[g];if(K)return K.call(Z);if(typeof Z.next=="function")return Z;if(!isNaN(Z.length)){var q=-1,ie=function oe(){for(;++q=0;--ie){var oe=this.tryEntries[ie],ye=oe.completion;if(oe.tryLoc==="root")return K("end");if(oe.tryLoc<=this.prev){var pe=_.call(oe,"catchLoc"),we=_.call(oe,"finallyLoc");if(pe&&we){if(this.prev=0;--q){var ie=this.tryEntries[q];if(ie.tryLoc<=this.prev&&_.call(ie,"finallyLoc")&&this.prev=0;--K){var q=this.tryEntries[K];if(q.finallyLoc===Z)return this.complete(q.completion,q.afterLoc),n(q),z}},catch:function(Z){for(var K=this.tryEntries.length-1;K>=0;--K){var q=this.tryEntries[K];if(q.tryLoc===Z){var ie=q.completion;if(ie.type==="throw"){var oe=ie.arg;n(q)}return oe}}throw new Error("illegal catch attempt")},delegateYield:function(Z,K,q){return this.delegate={iterator:d(Z),resultName:K,nextLoc:q},this.method==="next"&&(this.arg=b),z}}}(function(){return this}()||Function("return this")())},{}],193:[function(w,P,S){function C(f,l){for(var a in f)l[a]=f[a]}function T(f,l,a){return p(f,l,a)}var h=w("buffer"),p=h.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?P.exports=h:(C(h,S),S.Buffer=T),C(p,T),T.from=function(f,l,a){if(typeof f=="number")throw new TypeError("Argument must not be a number");return p(f,l,a)},T.alloc=function(f,l,a){if(typeof f!="number")throw new TypeError("Argument must be a number");var c=p(f);return l!==void 0?typeof a=="string"?c.fill(l,a):c.fill(l):c.fill(0),c},T.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return p(f)},T.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return h.SlowBuffer(f)}},{buffer:38}],194:[function(w,P,S){(function(C){"use strict";function T(v){return v&&v.__esModule?v:{default:v}}var h=w("babel-runtime/core-js/string/from-code-point"),p=T(h),f=w("babel-runtime/core-js/json/stringify"),l=T(f),a=w("babel-runtime/helpers/typeof"),c=T(a),s=w("babel-runtime/core-js/object/define-property"),u=T(s),i=w("babel-runtime/core-js/object/keys"),n=T(i),t=w("babel-runtime/core-js/object/create"),d=T(t);!function(v){function b(V,Y){if(!(this instanceof b))return new b(V,Y);var me=this;_(me),me.q=me.c="",me.bufferCheckPosition=v.MAX_BUFFER_LENGTH,me.opt=Y||{},me.opt.lowercase=me.opt.lowercase||me.opt.lowercasetags,me.looseCase=me.opt.lowercase?"toLowerCase":"toUpperCase",me.tags=[],me.closed=me.closedRoot=me.sawRoot=!1,me.tag=me.error=null,me.strict=!!V,me.noscript=!(!V&&!me.opt.noscript),me.state=N.BEGIN,me.strictEntities=me.opt.strictEntities,me.ENTITIES=me.strictEntities?(0,d.default)(v.XML_ENTITIES):(0,d.default)(v.ENTITIES),me.attribList=[],me.opt.xmlns&&(me.ns=(0,d.default)(Ie)),me.trackPosition=me.opt.position!==!1,me.trackPosition&&(me.position=me.line=me.column=0),I(me,"onready")}function y(V){for(var Y=Math.max(v.MAX_BUFFER_LENGTH,10),me=0,Ae=0,at=Te.length;AeY)switch(Te[Ae]){case"textNode":z(V);break;case"cdata":F(V,"oncdata",V.cdata),V.cdata="";break;case"script":F(V,"onscript",V.script),V.script="";break;default:j(V,"Max buffer length exceeded: "+Te[Ae])}me=Math.max(me,Le)}var ke=v.MAX_BUFFER_LENGTH-me;V.bufferCheckPosition=ke+V.position}function _(V){for(var Y=0,me=Te.length;Y"||o(V)}function O(V,Y){return V.test(Y)}function D(V,Y){return!O(V,Y)}function I(V,Y,me){V[Y]&&V[Y](me)}function F(V,Y,me){V.textNode&&z(V),I(V,Y,me)}function z(V){V.textNode=ne(V.opt,V.textNode),V.textNode&&I(V,"ontext",V.textNode),V.textNode=""}function ne(V,Y){return V.trim&&(Y=Y.trim()),V.normalize&&(Y=Y.replace(/\s+/g," ")),Y}function j(V,Y){return z(V),V.trackPosition&&(Y+=` Line: `+V.line+` Column: `+V.column+` Char: `+V.c),Y=new Error(Y),V.error=Y,I(V,"onerror",Y),V}function G(V){return V.sawRoot&&!V.closedRoot&&X(V,"Unclosed root tag"),V.state!==N.BEGIN&&V.state!==N.BEGIN_WHITESPACE&&V.state!==N.TEXT&&j(V,"Unexpected end"),z(V),V.c="",V.closed=!0,I(V,"onend"),b.call(V,V.strict,V.opt),V}function X(V,Y){if((V===void 0?"undefined":(0,c.default)(V))!=="object"||!(V instanceof b))throw new Error("bad call to strictFail");V.strict&&j(V,Y)}function Z(V){V.strict||(V.tagName=V.tagName[V.looseCase]());var Y=V.tags[V.tags.length-1]||V,me=V.tag={name:V.tagName,attributes:{}};V.opt.xmlns&&(me.ns=Y.ns),V.attribList.length=0,F(V,"onopentagstart",me)}function K(V,Y){var me=V.indexOf(":"),Ae=me<0?["",V]:V.split(":"),at=Ae[0],Le=Ae[1];return Y&&V==="xmlns"&&(at="xmlns",Le=""),{prefix:at,local:Le}}function q(V){if(V.strict||(V.attribName=V.attribName[V.looseCase]()),V.attribList.indexOf(V.attribName)!==-1||V.tag.attributes.hasOwnProperty(V.attribName))return void(V.attribName=V.attribValue="");if(V.opt.xmlns){var Y=K(V.attribName,!0),me=Y.prefix,Ae=Y.local;if(me==="xmlns")if(Ae==="xml"&&V.attribValue!==ve)X(V,"xml: prefix must be bound to "+ve+` Actual: `+V.attribValue);else if(Ae==="xmlns"&&V.attribValue!==ce)X(V,"xmlns: prefix must be bound to "+ce+` Actual: `+V.attribValue);else{var at=V.tag,Le=V.tags[V.tags.length-1]||V;at.ns===Le.ns&&(at.ns=(0,d.default)(Le.ns)),at.ns[Ae]=V.attribValue}V.attribList.push([V.attribName,V.attribValue])}else V.tag.attributes[V.attribName]=V.attribValue,F(V,"onattribute",{name:V.attribName,value:V.attribValue});V.attribName=V.attribValue=""}function ie(V,Y){if(V.opt.xmlns){var me=V.tag,Ae=K(V.tagName);me.prefix=Ae.prefix,me.local=Ae.local,me.uri=me.ns[Ae.prefix]||"",me.prefix&&!me.uri&&(X(V,"Unbound namespace prefix: "+(0,l.default)(V.tagName)),me.uri=Ae.prefix);var at=V.tags[V.tags.length-1]||V;me.ns&&at.ns!==me.ns&&(0,n.default)(me.ns).forEach(function(be){F(V,"onopennamespace",{prefix:be,uri:me.ns[be]})});for(var Le=0,ke=V.attribList.length;Le",V.tagName="",void(V.state=N.SCRIPT);F(V,"onscript",V.script),V.script=""}var Y=V.tags.length,me=V.tagName;V.strict||(me=me[V.looseCase]());for(var Ae=me;Y--&&!(V.tags[Y].name===Ae);)X(V,"Unexpected close tag");if(Y<0)return X(V,"Unmatched closing tag: "+V.tagName),V.textNode+="",void(V.state=N.TEXT);V.tagName=me;for(var at=V.tags.length;at-- >Y;){var Le=V.tag=V.tags.pop();V.tagName=V.tag.name,F(V,"onclosetag",V.tagName);var ke={};for(var Ye in Le.ns)ke[Ye]=Le.ns[Ye];var Ze=V.tags[V.tags.length-1]||V;V.opt.xmlns&&Le.ns!==Ze.ns&&(0,n.default)(Le.ns).forEach(function(Ve){var He=Le.ns[Ve];F(V,"onclosenamespace",{prefix:Ve,uri:He})})}Y===0&&(V.closedRoot=!0),V.tagName=V.attribValue=V.attribName="",V.attribList.length=0,V.state=N.TEXT}function ye(V){var Y,me=V.entity,Ae=me.toLowerCase(),at="";return V.ENTITIES[me]?V.ENTITIES[me]:V.ENTITIES[Ae]?V.ENTITIES[Ae]:(me=Ae,me.charAt(0)==="#"&&(me.charAt(1)==="x"?(me=me.slice(2),Y=parseInt(me,16),at=Y.toString(16)):(me=me.slice(1),Y=parseInt(me,10),at=Y.toString(10))),me=me.replace(/^0+/,""),isNaN(Y)||at.toLowerCase()!==me?(X(V,"Invalid character entity"),"&"+V.entity+";"):(0,p.default)(Y))}function pe(V,Y){Y==="<"?(V.state=N.OPEN_WAKA,V.startTagPosition=V.position):o(Y)||(X(V,"Non-whitespace before first tag."),V.textNode=Y,V.state=N.TEXT)}function we(V,Y){var me="";return Y"?(F(Y,"onsgmldeclaration",Y.sgmlDecl),Y.sgmlDecl="",Y.state=N.TEXT):(x(Ae)&&(Y.state=N.SGML_DECL_QUOTED),Y.sgmlDecl+=Ae);continue;case N.SGML_DECL_QUOTED:Ae===Y.q&&(Y.state=N.SGML_DECL,Y.q=""),Y.sgmlDecl+=Ae;continue;case N.DOCTYPE:Ae===">"?(Y.state=N.TEXT,F(Y,"ondoctype",Y.doctype),Y.doctype=!0):(Y.doctype+=Ae,Ae==="["?Y.state=N.DOCTYPE_DTD:x(Ae)&&(Y.state=N.DOCTYPE_QUOTED,Y.q=Ae));continue;case N.DOCTYPE_QUOTED:Y.doctype+=Ae,Ae===Y.q&&(Y.q="",Y.state=N.DOCTYPE);continue;case N.DOCTYPE_DTD:Y.doctype+=Ae,Ae==="]"?Y.state=N.DOCTYPE:x(Ae)&&(Y.state=N.DOCTYPE_DTD_QUOTED,Y.q=Ae);continue;case N.DOCTYPE_DTD_QUOTED:Y.doctype+=Ae,Ae===Y.q&&(Y.state=N.DOCTYPE_DTD,Y.q="");continue;case N.COMMENT:Ae==="-"?Y.state=N.COMMENT_ENDING:Y.comment+=Ae;continue;case N.COMMENT_ENDING:Ae==="-"?(Y.state=N.COMMENT_ENDED,Y.comment=ne(Y.opt,Y.comment),Y.comment&&F(Y,"oncomment",Y.comment),Y.comment=""):(Y.comment+="-"+Ae,Y.state=N.COMMENT);continue;case N.COMMENT_ENDED:Ae!==">"?(X(Y,"Malformed comment"),Y.comment+="--"+Ae,Y.state=N.COMMENT):Y.state=N.TEXT;continue;case N.CDATA:Ae==="]"?Y.state=N.CDATA_ENDING:Y.cdata+=Ae;continue;case N.CDATA_ENDING:Ae==="]"?Y.state=N.CDATA_ENDING_2:(Y.cdata+="]"+Ae,Y.state=N.CDATA);continue;case N.CDATA_ENDING_2:Ae===">"?(Y.cdata&&F(Y,"oncdata",Y.cdata),F(Y,"onclosecdata"),Y.cdata="",Y.state=N.TEXT):Ae==="]"?Y.cdata+="]":(Y.cdata+="]]"+Ae,Y.state=N.CDATA);continue;case N.PROC_INST:Ae==="?"?Y.state=N.PROC_INST_ENDING:o(Ae)?Y.state=N.PROC_INST_BODY:Y.procInstName+=Ae;continue;case N.PROC_INST_BODY:if(!Y.procInstBody&&o(Ae))continue;Ae==="?"?Y.state=N.PROC_INST_ENDING:Y.procInstBody+=Ae;continue;case N.PROC_INST_ENDING:Ae===">"?(F(Y,"onprocessinginstruction",{name:Y.procInstName,body:Y.procInstBody}),Y.procInstName=Y.procInstBody="",Y.state=N.TEXT):(Y.procInstBody+="?"+Ae,Y.state=N.PROC_INST_BODY);continue;case N.OPEN_TAG:O(Xe,Ae)?Y.tagName+=Ae:(Z(Y),Ae===">"?ie(Y):Ae==="/"?Y.state=N.OPEN_TAG_SLASH:(o(Ae)||X(Y,"Invalid character in tag name"),Y.state=N.ATTRIB));continue;case N.OPEN_TAG_SLASH:Ae===">"?(ie(Y,!0),oe(Y)):(X(Y,"Forward-slash in opening tag not followed by >"),Y.state=N.ATTRIB);continue;case N.ATTRIB:if(o(Ae))continue;Ae===">"?ie(Y):Ae==="/"?Y.state=N.OPEN_TAG_SLASH:O(Ne,Ae)?(Y.attribName=Ae,Y.attribValue="",Y.state=N.ATTRIB_NAME):X(Y,"Invalid attribute name");continue;case N.ATTRIB_NAME:Ae==="="?Y.state=N.ATTRIB_VALUE:Ae===">"?(X(Y,"Attribute without value"),Y.attribValue=Y.attribName,q(Y),ie(Y)):o(Ae)?Y.state=N.ATTRIB_NAME_SAW_WHITE:O(Xe,Ae)?Y.attribName+=Ae:X(Y,"Invalid attribute name");continue;case N.ATTRIB_NAME_SAW_WHITE:if(Ae==="=")Y.state=N.ATTRIB_VALUE;else{if(o(Ae))continue;X(Y,"Attribute without value"),Y.tag.attributes[Y.attribName]="",Y.attribValue="",F(Y,"onattribute",{name:Y.attribName,value:""}),Y.attribName="",Ae===">"?ie(Y):O(Ne,Ae)?(Y.attribName=Ae,Y.state=N.ATTRIB_NAME):(X(Y,"Invalid attribute name"),Y.state=N.ATTRIB)}continue;case N.ATTRIB_VALUE:if(o(Ae))continue;x(Ae)?(Y.q=Ae,Y.state=N.ATTRIB_VALUE_QUOTED):(X(Y,"Unquoted attribute value"),Y.state=N.ATTRIB_VALUE_UNQUOTED,Y.attribValue=Ae);continue;case N.ATTRIB_VALUE_QUOTED:if(Ae!==Y.q){Ae==="&"?Y.state=N.ATTRIB_VALUE_ENTITY_Q:Y.attribValue+=Ae;continue}q(Y),Y.q="",Y.state=N.ATTRIB_VALUE_CLOSED;continue;case N.ATTRIB_VALUE_CLOSED:o(Ae)?Y.state=N.ATTRIB:Ae===">"?ie(Y):Ae==="/"?Y.state=N.OPEN_TAG_SLASH:O(Ne,Ae)?(X(Y,"No whitespace between attributes"),Y.attribName=Ae,Y.attribValue="",Y.state=N.ATTRIB_NAME):X(Y,"Invalid attribute name");continue;case N.ATTRIB_VALUE_UNQUOTED:if(!A(Ae)){Ae==="&"?Y.state=N.ATTRIB_VALUE_ENTITY_U:Y.attribValue+=Ae;continue}q(Y),Ae===">"?ie(Y):Y.state=N.ATTRIB;continue;case N.CLOSE_TAG:if(Y.tagName)Ae===">"?oe(Y):O(Xe,Ae)?Y.tagName+=Ae:Y.script?(Y.script+=""?oe(Y):X(Y,"Invalid characters in closing tag");continue;case N.TEXT_ENTITY:case N.ATTRIB_VALUE_ENTITY_Q:case N.ATTRIB_VALUE_ENTITY_U:var ke,Ye;switch(Y.state){case N.TEXT_ENTITY:ke=N.TEXT,Ye="textNode";break;case N.ATTRIB_VALUE_ENTITY_Q:ke=N.ATTRIB_VALUE_QUOTED,Ye="attribValue";break;case N.ATTRIB_VALUE_ENTITY_U:ke=N.ATTRIB_VALUE_UNQUOTED,Ye="attribValue"}Ae===";"?(Y[Ye]+=ye(Y),Y.entity="",Y.state=ke):O(Y.entity.length?k:ee,Ae)?Y.entity+=Ae:(X(Y,"Invalid character in entity name"),Y[Ye]+="&"+Y.entity+Ae,Y.entity="",Y.state=ke);continue;default:throw new Error(Y,"Unknown state: "+Y.state)}return Y.position>=Y.bufferCheckPosition&&y(Y),Y}v.parser=function(V,Y){return new b(V,Y)},v.SAXParser=b,v.SAXStream=E,v.createStream=g,v.MAX_BUFFER_LENGTH=65536;var Te=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];v.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],d.default||(Object.create=function(V){function Y(){}return Y.prototype=V,new Y}),n.default||(Object.keys=function(V){var Y=[];for(var me in V)V.hasOwnProperty(me)&&Y.push(me);return Y}),b.prototype={end:function(){G(this)},write:fe,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){m(this)}};var Fe;try{Fe=w("stream").Stream}catch(V){Fe=function(){}}var De=v.EVENTS.filter(function(V){return V!=="error"&&V!=="end"});E.prototype=(0,d.default)(Fe.prototype,{constructor:{value:E}}),E.prototype.write=function(V){if(typeof C=="function"&&typeof C.isBuffer=="function"&&C.isBuffer(V)){if(!this._decoder){var Y=w("string_decoder").StringDecoder;this._decoder=new Y("utf8")}V=this._decoder.write(V)}return this._parser.write(V.toString()),this.emit("data",V),!0},E.prototype.end=function(V){return V&&V.length&&this.write(V),this._parser.end(),!0},E.prototype.on=function(V,Y){var me=this;return me._parser["on"+V]||De.indexOf(V)===-1||(me._parser["on"+V]=function(){var Ae=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);Ae.splice(0,0,V),me.emit.apply(me,Ae)}),Fe.prototype.on.call(me,V,Y)};var Me="[CDATA[",Ue="DOCTYPE",ve="http://www.w3.org/XML/1998/namespace",ce="http://www.w3.org/2000/xmlns/",Ie={xml:ve,xmlns:ce},Ne=/[:_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]/,Xe=/[:_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-]/,N=0;v.STATE={BEGIN:N++,BEGIN_WHITESPACE:N++,TEXT:N++,TEXT_ENTITY:N++,OPEN_WAKA:N++,SGML_DECL:N++,SGML_DECL_QUOTED:N++,DOCTYPE:N++,DOCTYPE_QUOTED:N++,DOCTYPE_DTD:N++,DOCTYPE_DTD_QUOTED:N++,COMMENT_STARTING:N++,COMMENT:N++,COMMENT_ENDING:N++,COMMENT_ENDED:N++,CDATA:N++,CDATA_ENDING:N++,CDATA_ENDING_2:N++,PROC_INST:N++,PROC_INST_BODY:N++,PROC_INST_ENDING:N++,OPEN_TAG:N++,OPEN_TAG_SLASH:N++,ATTRIB:N++,ATTRIB_NAME:N++,ATTRIB_NAME_SAW_WHITE:N++,ATTRIB_VALUE:N++,ATTRIB_VALUE_QUOTED:N++,ATTRIB_VALUE_CLOSED:N++,ATTRIB_VALUE_UNQUOTED:N++,ATTRIB_VALUE_ENTITY_Q:N++,ATTRIB_VALUE_ENTITY_U:N++,CLOSE_TAG:N++,CLOSE_TAG_SAW_WHITE:N++,SCRIPT:N++,SCRIPT_ENDING:N++},v.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},v.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,n.default)(v.ENTITIES).forEach(function(V){var Y=v.ENTITIES[V],me=typeof Y=="number"?String.fromCharCode(Y):Y;v.ENTITIES[V]=me});for(var $ in v.STATE)v.STATE[v.STATE[$]]=$;N=v.STATE,p.default||function(){var V=String.fromCharCode,Y=Math.floor,me=function(){var Ae,at,Le=[],ke=-1,Ye=arguments.length;if(!Ye)return"";for(var Ze="";++ke1114111||Y(Ve)!==Ve)throw RangeError("Invalid code point: "+Ve);Ve<=65535?Le.push(Ve):(Ve-=65536,Ae=55296+(Ve>>10),at=Ve%1024+56320,Le.push(Ae,at)),(ke+1===Ye||Le.length>16384)&&(Ze+=V.apply(null,Le),Le.length=0)}return Ze};u.default?Object.defineProperty(String,"fromCodePoint",{value:me,configurable:!0,writable:!0}):String.fromCodePoint=me}()}(S===void 0?(void 0).sax={}:S)}).call(this,w("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(w,P,S){function C(){T.call(this)}P.exports=C;var T=w("events").EventEmitter;w("inherits")(C,T),C.Readable=w("readable-stream/readable.js"),C.Writable=w("readable-stream/writable.js"),C.Duplex=w("readable-stream/duplex.js"),C.Transform=w("readable-stream/transform.js"),C.PassThrough=w("readable-stream/passthrough.js"),C.Stream=C,C.prototype.pipe=function(h,p){function f(t){h.writable&&h.write(t)===!1&&i.pause&&i.pause()}function l(){i.readable&&i.resume&&i.resume()}function a(){n||(n=!0,h.end())}function c(){n||(n=!0,typeof h.destroy=="function"&&h.destroy())}function s(t){if(u(),T.listenerCount(this,"error")===0)throw t}function u(){i.removeListener("data",f),h.removeListener("drain",l),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",s),h.removeListener("error",s),i.removeListener("end",u),i.removeListener("close",u),h.removeListener("close",u)}var i=this;i.on("data",f),h.on("drain",l),h._isStdio||p&&p.end===!1||(i.on("end",a),i.on("close",c));var n=!1;return i.on("error",s),h.on("error",s),i.on("end",u),i.on("close",u),h.on("close",u),h.emit("pipe",i),h}},{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(w,P,S){(function(C){var T=w("./lib/request"),h=w("./lib/response"),p=w("xtend"),f=w("builtin-status-codes"),l=w("url"),a=S;a.request=function(c,s){c=typeof c=="string"?l.parse(c):p(c);var u=C.location.protocol.search(/^https?:$/)===-1?"http:":"",i=c.protocol||u,n=c.hostname||c.host,t=c.port,d=c.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),c.url=(n?i+"//"+n:"")+(t?":"+t:"")+d,c.method=(c.method||"GET").toUpperCase(),c.headers=c.headers||{};var v=new T(c);return s&&v.on("response",s),v},a.get=function(c,s){var u=a.request(c,s);return u.end(),u},a.ClientRequest=T,a.IncomingMessage=h.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=f,a.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 ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(w,P,S){(function(C){"use strict";function T(){if(f!==void 0)return f;if(C.XMLHttpRequest){f=new C.XMLHttpRequest;try{f.open("GET",C.XDomainRequest?"/":"https://example.com")}catch(c){f=null}}else f=null;return f}function h(c){var s=T();if(!s)return!1;try{return s.responseType=c,s.responseType===c}catch(u){}return!1}function p(c){return typeof c=="function"}S.fetch=p(C.fetch)&&p(C.ReadableStream),S.writableStream=p(C.WritableStream),S.abortController=p(C.AbortController),S.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),S.blobConstructor=!0}catch(c){}var f,l=C.ArrayBuffer!==void 0,a=l&&p(C.ArrayBuffer.prototype.slice);S.arraybuffer=S.fetch||l&&h("arraybuffer"),S.msstream=!S.fetch&&a&&h("ms-stream"),S.mozchunkedarraybuffer=!S.fetch&&l&&h("moz-chunked-arraybuffer"),S.overrideMimeType=S.fetch||!!T()&&p(T().overrideMimeType),S.vbArray=p(C.VBArray),f=null}).call(this,typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(w,P,S){(function(C,T,h){"use strict";function p(y,_){return c.fetch&&_?"fetch":c.mozchunkedarraybuffer?"moz-chunked-arraybuffer":c.msstream?"ms-stream":c.arraybuffer&&y?"arraybuffer":c.vbArray&&y?"text:vbarray":"text"}function f(y){try{var _=y.status;return _!==null&&_!==0}catch(m){return!1}}var l=w("babel-runtime/core-js/object/keys"),a=function(y){return y&&y.__esModule?y:{default:y}}(l),c=w("./capability"),s=w("inherits"),u=w("./response"),i=w("readable-stream"),n=w("to-arraybuffer"),t=u.IncomingMessage,d=u.readyStates,v=P.exports=function(y){var _=this;i.Writable.call(_),_._opts=y,_._body=[],_._headers={},y.auth&&_.setHeader("Authorization","Basic "+new h(y.auth).toString("base64")),(0,a.default)(y.headers).forEach(function(E){_.setHeader(E,y.headers[E])});var m,g=!0;if(y.mode==="disable-fetch"||"requestTimeout"in y&&!c.abortController)g=!1,m=!0;else if(y.mode==="prefer-streaming")m=!1;else if(y.mode==="allow-wrong-content-type")m=!c.overrideMimeType;else{if(y.mode&&y.mode!=="default"&&y.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");m=!0}_._mode=p(m,g),_._fetchTimer=null,_.on("finish",function(){_._onFinish()})};s(v,i.Writable),v.prototype.setHeader=function(y,_){var m=this,g=y.toLowerCase();b.indexOf(g)===-1&&(m._headers[g]={name:y,value:_})},v.prototype.getHeader=function(y){var _=this._headers[y.toLowerCase()];return _?_.value:null},v.prototype.removeHeader=function(y){delete this._headers[y.toLowerCase()]},v.prototype._onFinish=function(){var y=this;if(!y._destroyed){var _=y._opts,m=y._headers,g=null;_.method!=="GET"&&_.method!=="HEAD"&&(g=c.arraybuffer?n(h.concat(y._body)):c.blobConstructor?new T.Blob(y._body.map(function(O){return n(O)}),{type:(m["content-type"]||{}).value||""}):h.concat(y._body).toString());var E=[];if((0,a.default)(m).forEach(function(O){var D=m[O].name,I=m[O].value;Array.isArray(I)?I.forEach(function(F){E.push([D,F])}):E.push([D,I])}),y._mode==="fetch"){var o=null;if(c.abortController){var x=new AbortController;o=x.signal,y._fetchAbortController=x,"requestTimeout"in _&&_.requestTimeout!==0&&(y._fetchTimer=T.setTimeout(function(){y.emit("requestTimeout"),y._fetchAbortController&&y._fetchAbortController.abort()},_.requestTimeout))}T.fetch(y._opts.url,{method:y._opts.method,headers:E,body:g||void 0,mode:"cors",credentials:_.withCredentials?"include":"same-origin",signal:o}).then(function(O){y._fetchResponse=O,y._connect()},function(O){T.clearTimeout(y._fetchTimer),y._destroyed||y.emit("error",O)})}else{var A=y._xhr=new T.XMLHttpRequest;try{A.open(y._opts.method,y._opts.url,!0)}catch(O){return void C.nextTick(function(){y.emit("error",O)})}"responseType"in A&&(A.responseType=y._mode.split(":")[0]),"withCredentials"in A&&(A.withCredentials=!!_.withCredentials),y._mode==="text"&&"overrideMimeType"in A&&A.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in _&&(A.timeout=_.requestTimeout,A.ontimeout=function(){y.emit("requestTimeout")}),E.forEach(function(O){A.setRequestHeader(O[0],O[1])}),y._response=null,A.onreadystatechange=function(){switch(A.readyState){case d.LOADING:case d.DONE:y._onXHRProgress()}},y._mode==="moz-chunked-arraybuffer"&&(A.onprogress=function(){y._onXHRProgress()}),A.onerror=function(){y._destroyed||y.emit("error",new Error("XHR error"))};try{A.send(g)}catch(O){return void C.nextTick(function(){y.emit("error",O)})}}}},v.prototype._onXHRProgress=function(){var y=this;f(y._xhr)&&!y._destroyed&&(y._response||y._connect(),y._response._onXHRProgress())},v.prototype._connect=function(){var y=this;y._destroyed||(y._response=new t(y._xhr,y._fetchResponse,y._mode,y._fetchTimer),y._response.on("error",function(_){y.emit("error",_)}),y.emit("response",y._response))},v.prototype._write=function(y,_,m){this._body.push(y),m()},v.prototype.abort=v.prototype.destroy=function(){var y=this;y._destroyed=!0,T.clearTimeout(y._fetchTimer),y._response&&(y._response._destroyed=!0),y._xhr?y._xhr.abort():y._fetchAbortController&&y._fetchAbortController.abort()},v.prototype.end=function(y,_,m){var g=this;typeof y=="function"&&(m=y,y=void 0),i.Writable.prototype.end.call(g,y,_,m)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var b=["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,w("_process"),typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("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(w,P,S){(function(C,T,h){"use strict";var p=w("babel-runtime/core-js/promise"),f=function(i){return i&&i.__esModule?i:{default:i}}(p),l=w("./capability"),a=w("inherits"),c=w("readable-stream"),s=S.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=S.IncomingMessage=function(i,n,t,d){var v=this;if(c.Readable.call(v),v._mode=t,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){C.nextTick(function(){v.emit("close")})}),t==="fetch"){if(v._fetchResponse=n,v.url=n.url,v.statusCode=n.status,v.statusMessage=n.statusText,n.headers.forEach(function(g,E){v.headers[E.toLowerCase()]=g,v.rawHeaders.push(E,g)}),l.writableStream){var b=new WritableStream({write:function(g){return new f.default(function(E,o){v._destroyed?o():v.push(new h(g))?E():v._resumeFetch=E})},close:function(){T.clearTimeout(d),v._destroyed||v.push(null)},abort:function(g){v._destroyed||v.emit("error",g)}});try{return void n.body.pipeTo(b).catch(function(g){T.clearTimeout(d),v._destroyed||v.emit("error",g)})}catch(g){}}var y=n.body.getReader();!function g(){y.read().then(function(E){if(!v._destroyed){if(E.done)return T.clearTimeout(d),void v.push(null);v.push(new h(E.value)),g()}}).catch(function(E){T.clearTimeout(d),v._destroyed||v.emit("error",E)})}()}else if(v._xhr=i,v._pos=0,v.url=i.responseURL,v.statusCode=i.status,v.statusMessage=i.statusText,i.getAllResponseHeaders().split(/\r?\n/).forEach(function(g){var E=g.match(/^([^:]+):\s*(.*)/);if(E){var o=E[1].toLowerCase();o==="set-cookie"?(v.headers[o]===void 0&&(v.headers[o]=[]),v.headers[o].push(E[2])):v.headers[o]!==void 0?v.headers[o]+=", "+E[2]:v.headers[o]=E[2],v.rawHeaders.push(E[1],E[2])}}),v._charset="x-user-defined",!l.overrideMimeType){var _=v.rawHeaders["mime-type"];if(_){var m=_.match(/;\s*charset=([^;])(;|$)/);m&&(v._charset=m[1].toLowerCase())}v._charset||(v._charset="utf-8")}};a(u,c.Readable),u.prototype._read=function(){var i=this,n=i._resumeFetch;n&&(i._resumeFetch=null,n())},u.prototype._onXHRProgress=function(){var i=this,n=i._xhr,t=null;switch(i._mode){case"text:vbarray":if(n.readyState!==s.DONE)break;try{t=new T.VBArray(n.responseBody).toArray()}catch(_){}if(t!==null){i.push(new h(t));break}case"text":try{t=n.responseText}catch(_){i._mode="text:vbarray";break}if(t.length>i._pos){var d=t.substr(i._pos);if(i._charset==="x-user-defined"){for(var v=new h(d.length),b=0;bi._pos&&(i.push(new h(new Uint8Array(y.result.slice(i._pos)))),i._pos=y.result.byteLength)},y.onload=function(){i.push(null)},y.readAsArrayBuffer(t)}i._xhr.readyState===s.DONE&&i._mode!=="ms-stream"&&i.push(null)}}).call(this,w("_process"),typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{},w("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(w,P,S){"use strict";function C(_){if(!_)return"utf8";for(var m;;)switch(_){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 _;default:if(m)return;_=(""+_).toLowerCase(),m=!0}}function T(_){var m=C(_);if(typeof m!="string"&&(b.isEncoding===y||!y(_)))throw new Error("Unknown encoding: "+_);return m||_}function h(_){this.encoding=T(_);var m;switch(this.encoding){case"utf16le":this.text=u,this.end=i,m=4;break;case"utf8":this.fillLast=a,m=4;break;case"base64":this.text=n,this.end=t,m=3;break;default:return this.write=d,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=b.allocUnsafe(m)}function p(_){return _<=127?0:_>>5==6?2:_>>4==14?3:_>>3==30?4:_>>6==2?-1:-2}function f(_,m,g){var E=m.length-1;if(E=0?(o>0&&(_.lastNeed=o-1),o):--E=0?(o>0&&(_.lastNeed=o-2),o):--E=0?(o>0&&(o===2?o=0:_.lastNeed=o-3),o):0)}function l(_,m,g){if((192&m[0])!=128)return _.lastNeed=0,"\u951F\uFFFD";if(_.lastNeed>1&&m.length>1){if((192&m[1])!=128)return _.lastNeed=1,"\u951F\uFFFD";if(_.lastNeed>2&&m.length>2&&(192&m[2])!=128)return _.lastNeed=2,"\u951F\uFFFD"}}function a(_){var m=this.lastTotal-this.lastNeed,g=l(this,_,m);return g!==void 0?g:this.lastNeed<=_.length?(_.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(_.copy(this.lastChar,m,0,_.length),void(this.lastNeed-=_.length))}function c(_,m){var g=f(this,_,m);if(!this.lastNeed)return _.toString("utf8",m);this.lastTotal=g;var E=_.length-(g-this.lastNeed);return _.copy(this.lastChar,0,E),_.toString("utf8",m,E)}function s(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+"\u951F\uFFFD":m}function u(_,m){if((_.length-m)%2==0){var g=_.toString("utf16le",m);if(g){var E=g.charCodeAt(g.length-1);if(E>=55296&&E<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",m,_.length-1)}function i(_){var m=_&&_.length?this.write(_):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,g)}return m}function n(_,m){var g=(_.length-m)%3;return g===0?_.toString("base64",m):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",m,_.length-g))}function t(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function d(_){return _.toString(this.encoding)}function v(_){return _&&_.length?this.write(_):""}var b=w("safe-buffer").Buffer,y=b.isEncoding||function(_){switch((_=""+_)&&_.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}};S.StringDecoder=h,h.prototype.write=function(_){if(_.length===0)return"";var m,g;if(this.lastNeed){if((m=this.fillLast(_))===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;return g<_.length?m?m+this.text(_,g):this.text(_,g):m||""},h.prototype.end=s,h.prototype.text=c,h.prototype.fillLast=function(_){if(this.lastNeed<=_.length)return _.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_.length),this.lastNeed-=_.length}},{"safe-buffer":193}],201:[function(w,P,S){(function(C,T){function h(s,u){this._id=s,this._clearFn=u}var p=w("process/browser.js").nextTick,f=Function.prototype.apply,l=Array.prototype.slice,a={},c=0;S.setTimeout=function(){return new h(f.call(setTimeout,window,arguments),clearTimeout)},S.setInterval=function(){return new h(f.call(setInterval,window,arguments),clearInterval)},S.clearTimeout=S.clearInterval=function(s){s.close()},h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},S.enroll=function(s,u){clearTimeout(s._idleTimeoutId),s._idleTimeout=u},S.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},S._unrefActive=S.active=function(s){clearTimeout(s._idleTimeoutId);var u=s._idleTimeout;u>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},u))},S.setImmediate=typeof C=="function"?C:function(s){var u=c++,i=!(arguments.length<2)&&l.call(arguments,1);return a[u]=!0,p(function(){a[u]&&(i?s.apply(null,i):s.call(null),S.clearImmediate(u))}),u},S.clearImmediate=typeof T=="function"?T:function(s){delete a[s]}}).call(this,w("timers").setImmediate,w("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(w,P,S){var C=w("buffer").Buffer;P.exports=function(T){if(T instanceof Uint8Array){if(T.byteOffset===0&&T.byteLength===T.buffer.byteLength)return T.buffer;if(typeof T.buffer.slice=="function")return T.buffer.slice(T.byteOffset,T.byteOffset+T.byteLength)}if(C.isBuffer(T)){for(var h=new Uint8Array(T.length),p=T.length,f=0;f",'"',"`"," ","\r",` `," "],n=["{","}","|","\\","^","`"].concat(i),t=["'"].concat(n),d=["%","/","?",";","#"].concat(t),v=["/","?","#"],b=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=w("querystring");C.prototype.parse=function(o,x,A){if(!a.isString(o))throw new TypeError("Parameter 'url' must be a string, not "+typeof o);var O=o.indexOf("?"),D=O!==-1&&O127?Te+="x":Te+=fe[Fe];if(!Te.match(b)){var Me=pe.slice(0,K),Ue=pe.slice(K+1),ve=fe.match(y);ve&&(Me.push(ve[1]),Ue.unshift(ve[2])),Ue.length&&(z="/"+Ue.join(".")+z),this.hostname=Me.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ye||(this.hostname=l.toASCII(this.hostname));var ce=this.port?":"+this.port:"",Ie=this.hostname||"";this.host=Ie+ce,this.href+=this.host,ye&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),z[0]!=="/"&&(z="/"+z))}if(!_[G])for(var K=0,we=t.length;K0)&&A.host.split("@");Te&&(A.auth=Te.shift(),A.host=A.hostname=Te.shift())}return A.search=o.search,A.query=o.query,a.isNull(A.pathname)&&a.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.href=A.format(),A}if(!pe.length)return A.pathname=null,A.search?A.path="/"+A.search:A.path=null,A.href=A.format(),A;for(var Fe=pe.slice(-1)[0],De=(A.host||o.host||pe.length>1)&&(Fe==="."||Fe==="..")||Fe==="",Me=0,Ue=pe.length;Ue>=0;Ue--)Fe=pe[Ue],Fe==="."?pe.splice(Ue,1):Fe===".."?(pe.splice(Ue,1),Me++):Me&&(pe.splice(Ue,1),Me--);if(!oe&&!ye)for(;Me--;Me)pe.unshift("..");!oe||pe[0]===""||pe[0]&&pe[0].charAt(0)==="/"||pe.unshift(""),De&&pe.join("/").substr(-1)!=="/"&&pe.push("");var ve=pe[0]===""||pe[0]&&pe[0].charAt(0)==="/";if(fe){A.hostname=A.host=ve?"":pe.length?pe.shift():"";var Te=!!(A.host&&A.host.indexOf("@")>0)&&A.host.split("@");Te&&(A.auth=Te.shift(),A.host=A.hostname=Te.shift())}return oe=oe||A.host&&pe.length,oe&&!ve&&pe.unshift(""),pe.length?A.pathname=pe.join("/"):(A.pathname=null,A.path=null),a.isNull(A.pathname)&&a.isNull(A.search)||(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.auth=o.auth||A.auth,A.slashes=A.slashes||o.slashes,A.href=A.format(),A},C.prototype.parseHost=function(){var o=this.host,x=s.exec(o);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),o=o.substr(0,o.length-x.length)),o&&(this.hostname=o)}},{"./util":204,punycode:174,querystring:177}],204:[function(w,P,S){"use strict";P.exports={isString:function(C){return typeof C=="string"},isObject:function(C){return typeof C=="object"&&C!==null},isNull:function(C){return C===null},isNullOrUndefined:function(C){return C==null}}},{}],205:[function(w,P,S){(function(C){function T(p,f){function l(){if(!a){if(h("throwDeprecation"))throw new Error(f);h("traceDeprecation")?console.trace(f):console.warn(f),a=!0}return p.apply(this,arguments)}if(h("noDeprecation"))return p;var a=!1;return l}function h(p){try{if(!C.localStorage)return!1}catch(l){return!1}var f=C.localStorage[p];return f!=null&&String(f).toLowerCase()==="true"}P.exports=T}).call(this,typeof ae!="undefined"?ae:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(w,P,S){P.exports=function(C){return C&&typeof C=="object"&&typeof C.copy=="function"&&typeof C.fill=="function"&&typeof C.readUInt8=="function"}},{}],207:[function(w,P,S){(function(C,T){function h(K,q){var ie={seen:[],stylize:f};return arguments.length>=3&&(ie.depth=arguments[2]),arguments.length>=4&&(ie.colors=arguments[3]),d(q)?ie.showHidden=q:q&&S._extend(ie,q),g(ie.showHidden)&&(ie.showHidden=!1),g(ie.depth)&&(ie.depth=2),g(ie.colors)&&(ie.colors=!1),g(ie.customInspect)&&(ie.customInspect=!0),ie.colors&&(ie.stylize=p),a(ie,K,ie.depth)}function p(K,q){var ie=h.styles[q];return ie?"["+h.colors[ie][0]+"m"+K+"["+h.colors[ie][1]+"m":K}function f(K,q){return K}function l(K){var q={};return K.forEach(function(ie,oe){q[ie]=!0}),q}function a(K,q,ie){if(K.customInspect&&q&&O(q.inspect)&&q.inspect!==S.inspect&&(!q.constructor||q.constructor.prototype!==q)){var oe=q.inspect(ie,K);return _(oe)||(oe=a(K,oe,ie)),oe}var ye=c(K,q);if(ye)return ye;var pe=Object.keys(q),we=l(pe);if(K.showHidden&&(pe=Object.getOwnPropertyNames(q)),A(q)&&(pe.indexOf("message")>=0||pe.indexOf("description")>=0))return s(q);if(pe.length===0){if(O(q)){var fe=q.name?": "+q.name:"";return K.stylize("[Function"+fe+"]","special")}if(E(q))return K.stylize(RegExp.prototype.toString.call(q),"regexp");if(x(q))return K.stylize(Date.prototype.toString.call(q),"date");if(A(q))return s(q)}var Te="",Fe=!1,De=["{","}"];if((t(q)&&(Fe=!0,De=["[","]"]),O(q))&&(Te=" [Function"+(q.name?": "+q.name:"")+"]"),E(q)&&(Te=" "+RegExp.prototype.toString.call(q)),x(q)&&(Te=" "+Date.prototype.toUTCString.call(q)),A(q)&&(Te=" "+s(q)),pe.length===0&&(!Fe||q.length==0))return De[0]+Te+De[1];if(ie<0)return E(q)?K.stylize(RegExp.prototype.toString.call(q),"regexp"):K.stylize("[Object]","special");K.seen.push(q);var Me;return Me=Fe?u(K,q,ie,we,pe):pe.map(function(Ue){return i(K,q,ie,we,Ue,Fe)}),K.seen.pop(),n(Me,Te,De)}function c(K,q){if(g(q))return K.stylize("undefined","undefined");if(_(q)){var ie="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return K.stylize(ie,"string")}return y(q)?K.stylize(""+q,"number"):d(q)?K.stylize(""+q,"boolean"):v(q)?K.stylize("null","null"):void 0}function s(K){return"["+Error.prototype.toString.call(K)+"]"}function u(K,q,ie,oe,ye){for(var pe=[],we=0,fe=q.length;we-1&&(fe=pe?fe.split(` `).map(function(Fe){return" "+Fe}).join(` `).substr(2):` `+fe.split(` `).map(function(Fe){return" "+Fe}).join(` `))):fe=K.stylize("[Circular]","special")),g(we)){if(pe&&ye.match(/^\d+$/))return fe;we=JSON.stringify(""+ye),we.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(we=we.substr(1,we.length-2),we=K.stylize(we,"name")):(we=we.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),we=K.stylize(we,"string"))}return we+": "+fe}function n(K,q,ie){var oe=0;return K.reduce(function(ye,pe){return oe++,pe.indexOf(` `)>=0&&oe++,ye+pe.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?ie[0]+(q===""?"":q+` `)+" "+K.join(`, `)+" "+ie[1]:ie[0]+q+" "+K.join(", ")+" "+ie[1]}function t(K){return Array.isArray(K)}function d(K){return typeof K=="boolean"}function v(K){return K===null}function b(K){return K==null}function y(K){return typeof K=="number"}function _(K){return typeof K=="string"}function m(K){return typeof K=="symbol"}function g(K){return K===void 0}function E(K){return o(K)&&I(K)==="[object RegExp]"}function o(K){return typeof K=="object"&&K!==null}function x(K){return o(K)&&I(K)==="[object Date]"}function A(K){return o(K)&&(I(K)==="[object Error]"||K instanceof Error)}function O(K){return typeof K=="function"}function D(K){return K===null||typeof K=="boolean"||typeof K=="number"||typeof K=="string"||typeof K=="symbol"||K===void 0}function I(K){return Object.prototype.toString.call(K)}function F(K){return K<10?"0"+K.toString(10):K.toString(10)}function z(){var K=new Date,q=[F(K.getHours()),F(K.getMinutes()),F(K.getSeconds())].join(":");return[K.getDate(),Z[K.getMonth()],q].join(" ")}function ne(K,q){return Object.prototype.hasOwnProperty.call(K,q)}var j=/%[sdj%]/g;S.format=function(K){if(!_(K)){for(var q=[],ie=0;ie=ye)return Te;switch(Te){case"%s":return String(oe[ie++]);case"%d":return Number(oe[ie++]);case"%j":try{return JSON.stringify(oe[ie++])}catch(Fe){return"[Circular]"}default:return Te}}),we=oe[ie];ie=0||n.indexOf(">")>=0||n.indexOf("<")>=0)},u=function(n){return""},c=function(n){return n.replace("]]>","]]]]>")},S.Builder=function(){function n(t){var d,v,b;this.options={},v=a[.2];for(d in v)i.call(v,d)&&(b=v[d],this.options[d]=b);for(d in t)i.call(t,d)&&(b=t[d],this.options[d]=b)}return n.prototype.buildObject=function(t){var d,v,b,y,_;return d=this.options.attrkey,v=this.options.charkey,(0,f.default)(t).length===1&&this.options.rootName===a[.2].rootName?(_=(0,f.default)(t)[0],t=t[_]):_=this.options.rootName,b=function(m){return function(g,E){var o,x,A,O,D,I;if((E===void 0?"undefined":(0,h.default)(E))!=="object")m.options.cdata&&s(E)?g.raw(u(E)):g.txt(E);else if(Array.isArray(E)){for(O in E)if(i.call(E,O)){x=E[O];for(D in x)A=x[D],g=b(g.ele(D),A).up()}}else for(D in E)if(i.call(E,D))if(x=E[D],D===d){if((x===void 0?"undefined":(0,h.default)(x))==="object")for(o in x)I=x[o],g=g.att(o,I)}else if(D===v)g=m.options.cdata&&s(x)?g.raw(u(x)):g.txt(x);else if(Array.isArray(x))for(O in x)i.call(x,O)&&(A=x[O],g=typeof A=="string"?m.options.cdata&&s(A)?g.ele(D).raw(u(A)).up():g.ele(D,A).up():b(g.ele(D),A).up());else(x===void 0?"undefined":(0,h.default)(x))==="object"?g=b(g.ele(D),x).up():typeof x=="string"&&m.options.cdata&&s(x)?g=g.ele(D).raw(u(x)).up():(x==null&&(x=""),g=g.ele(D,x.toString()).up());return g}}(this),y=l.create(_,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),b(y,t).end(this.options.renderOpts)},n}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(w,P,S){"use strict";(function(){S.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(w,P,S){"use strict";function C(c){return c&&c.__esModule?c:{default:c}}var T=w("babel-runtime/core-js/object/get-own-property-names"),h=C(T),p=w("babel-runtime/core-js/object/keys"),f=C(p),l=w("babel-runtime/helpers/typeof"),a=C(l);(function(){var c,s,u,i,n,t,d,v,b=function(m,g){return function(){return m.apply(g,arguments)}},y=function(m,g){function E(){this.constructor=m}for(var o in g)_.call(g,o)&&(m[o]=g[o]);return E.prototype=g.prototype,m.prototype=new E,m.__super__=g.prototype,m},_={}.hasOwnProperty;d=w("sax"),u=w("events"),c=w("./bom"),t=w("./processors"),v=w("timers").setImmediate,s=w("./defaults").defaults,i=function(m){return(m===void 0?"undefined":(0,a.default)(m))==="object"&&m!=null&&(0,f.default)(m).length===0},n=function(m,g,E){var o,x,A;for(o=0,x=m.length;o0&&(z[O.options.childkey]=j),j=z;return A.length>0?O.assignOrPush(Z,ne,j):(O.options.explicitRoot&&(X=j,j={},j[ne]=X),O.resultObject=j,O.saxParser.ended=!0,O.emit("end",O.resultObject))}}(this),x=function(O){return function(D){var I,F;if(F=A[A.length-1])return F[o]+=D,O.options.explicitChildren&&O.options.preserveChildrenOrder&&O.options.charsAsChildren&&(O.options.includeWhiteChars||D.replace(/\\n/g,"").trim()!=="")&&(F[O.options.childkey]=F[O.options.childkey]||[],I={"#name":"__text__"},I[o]=D,O.options.normalize&&(I[o]=I[o].replace(/\s{2,}/g," ").trim()),F[O.options.childkey].push(I)),F}}(this),this.saxParser.ontext=x,this.saxParser.oncdata=function(O){return function(D){var I;if(I=x(D))return I.cdata=!0}}()},g.prototype.parseString=function(E,o){var x;o!=null&&typeof o=="function"&&(this.on("end",function(A){return this.reset(),o(null,A)}),this.on("error",function(A){return this.reset(),o(A)}));try{return E=E.toString(),E.trim()===""?(this.emit("end",null),!0):(E=c.stripBOM(E),this.options.async?(this.remaining=E,v(this.processAsync),this.saxParser):this.saxParser.write(E).close())}catch(A){if(x=A,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",x),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw x}},g}(u.EventEmitter),S.parseString=function(m,g,E){var o,x,A;return E!=null?(typeof E=="function"&&(o=E),(g===void 0?"undefined":(0,a.default)(g))==="object"&&(x=g)):(typeof g=="function"&&(o=g),x={}),A=new S.Parser(x),A.parseString(m,o)}}).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(w,P,S){"use strict";(function(){var C;C=new RegExp(/(?!xmlns)^.*:/),S.normalize=function(T){return T.toLowerCase()},S.firstCharLowerCase=function(T){return T.charAt(0).toLowerCase()+T.slice(1)},S.stripPrefix=function(T){return T.replace(C,"")},S.parseNumbers=function(T){return isNaN(T)||(T=T%1==0?parseInt(T,10):parseFloat(T)),T},S.parseBooleans=function(T){return/^(?:true|false)$/i.test(T)&&(T=T.toLowerCase()==="true"),T}}).call(void 0)},{}],213:[function(w,P,S){"use strict";(function(){var C,T,h,p,f=function(a,c){function s(){this.constructor=a}for(var u in c)l.call(c,u)&&(a[u]=c[u]);return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},l={}.hasOwnProperty;T=w("./defaults"),C=w("./builder"),h=w("./parser"),p=w("./processors"),S.defaults=T.defaults,S.processors=p,S.ValidationError=function(a){function c(s){this.message=s}return f(c,a),c}(Error),S.Builder=C.Builder,S.Parser=h.Parser,S.parseString=h.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(w,P,S){"use strict";function C(c){return c&&c.__esModule?c:{default:c}}var T=w("babel-runtime/core-js/object/get-prototype-of"),h=C(T),p=w("babel-runtime/helpers/typeof"),f=C(p),l=w("babel-runtime/core-js/object/assign"),a=C(l);(function(){var c,s,u,i,n,t,d=[].slice,v={}.hasOwnProperty;c=function(){var b,y,_,m,g,E;if(E=arguments[0],g=2<=arguments.length?d.call(arguments,1):[],i(a.default))a.default.apply(null,arguments);else for(b=0,_=g.length;b<_;b++)if((m=g[b])!=null)for(y in m)v.call(m,y)&&(E[y]=m[y]);return E},i=function(b){return!!b&&Object.prototype.toString.call(b)==="[object Function]"},n=function(b){var y;return!!b&&((y=b===void 0?"undefined":(0,f.default)(b))==="function"||y==="object")},s=function(b){return i(Array.isArray)?Array.isArray(b):Object.prototype.toString.call(b)==="[object Array]"},u=function(b){var y;if(s(b))return!b.length;for(y in b)if(v.call(b,y))return!1;return!0},t=function(b){var y,_;return n(b)&&(_=(0,h.default)(b))&&(y=_.constructor)&&typeof y=="function"&&y instanceof y&&Function.prototype.toString.call(y)===Function.prototype.toString.call(Object)},P.exports.assign=c,P.exports.isFunction=i,P.exports.isObject=n,P.exports.isArray=s,P.exports.isEmpty=u,P.exports.isPlainObject=t}).call(void 0)},{"babel-runtime/core-js/object/assign":18,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/helpers/typeof":32}],215:[function(w,P,S){"use strict";var C=w("babel-runtime/core-js/object/create"),T=function(h){return h&&h.__esModule?h:{default:h}}(C);(function(){P.exports=function(){function h(p,f,l){if(this.options=p.options,this.stringify=p.stringify,f==null)throw new Error("Missing attribute name of element "+p.name);if(l==null)throw new Error("Missing attribute value for attribute "+f+" of element "+p.name);this.name=this.stringify.attName(f),this.value=this.stringify.attValue(l)}return h.prototype.clone=function(){return(0,T.default)(this)},h.prototype.toString=function(p){return this.options.writer.set(p).attribute(this)},h}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(w,P,S){"use strict";var C=w("babel-runtime/core-js/object/create"),T=function(h){return h&&h.__esModule?h:{default:h}}(C);(function(){var h,p=function(l,a){function c(){this.constructor=l}for(var s in a)f.call(a,s)&&(l[s]=a[s]);return c.prototype=a.prototype,l.prototype=new c,l.__super__=a.prototype,l},f={}.hasOwnProperty;h=w("./XMLNode"),P.exports=function(l){function a(c,s){if(a.__super__.constructor.call(this,c),s==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(s)}return p(a,l),a.prototype.clone=function(){return(0,T.default)(this)},a.prototype.toString=function(c){return this.options.writer.set(c).cdata(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(w,P,S){"use strict";var C=w("babel-runtime/core-js/object/create"),T=function(h){return h&&h.__esModule?h:{default:h}}(C);(function(){var h,p=function(l,a){function c(){this.constructor=l}for(var s in a)f.call(a,s)&&(l[s]=a[s]);return c.prototype=a.prototype,l.prototype=new c,l.__super__=a.prototype,l},f={}.hasOwnProperty;h=w("./XMLNode"),P.exports=function(l){function a(c,s){if(a.__super__.constructor.call(this,c),s==null)throw new Error("Missing comment text");this.text=this.stringify.comment(s)}return p(a,l),a.prototype.clone=function(){return(0,T.default)(this)},a.prototype.toString=function(c){return this.options.writer.set(c).comment(this)},a}(h)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(w,P,S){"use strict";(function(){var C,T=function(p,f){function l(){this.constructor=p}for(var a in f)h.call(f,a)&&(p[a]=f[a]);return l.prototype=f.prototype,p.prototype=new l,p.__super__=f.prototype,p},h={}.hasOwnProperty;C=w("./XMLNode"),P.exports=function(p){function f(l,a,c,s,u,i){if(f.__super__.constructor.call(this,l),a==null)throw new Error("Missing DTD element name");if(c==null)throw new Error("Missing DTD attribute name");if(!s)throw new Error("Missing DTD attribute type");if(!u)throw new Error("Missing DTD attribute default");if(u.indexOf("#")!==0&&(u="#"+u),!u.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(i&&!u.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(a),this.attributeName=this.stringify.attName(c),this.attributeType=this.stringify.dtdAttType(s),this.defaultValue=this.stringify.dtdAttDefault(i),this.defaultValueType=u}return T(f,p),f.prototype.toString=function(l){return this.options.writer.set(l).dtdAttList(this)},f}(C)}).call(void 0)},{"./XMLNode":227}],219:[function(w,P,S){"use strict";(function(){var C,T=function(p,f){function l(){this.constructor=p}for(var a in f)h.call(f,a)&&(p[a]=f[a]);return l.prototype=f.prototype,p.prototype=new l,p.__super__=f.prototype,p},h={}.hasOwnProperty;C=w("./XMLNode"),P.exports=function(p){function f(l,a,c){if(f.__super__.constructor.call(this,l),a==null)throw new Error("Missing DTD element name");c||(c="(#PCDATA)"),Array.isArray(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.eleName(a),this.value=this.stringify.dtdElementValue(c)}return T(f,p),f.prototype.toString=function(l){return this.options.writer.set(l).dtdElement(this)},f}(C)}).call(void 0)},{"./XMLNode":227}],220:[function(w,P,S){"use strict";(function(){var C,T,h=function(f,l){function a(){this.constructor=f}for(var c in l)p.call(l,c)&&(f[c]=l[c]);return a.prototype=l.prototype,f.prototype=new a,f.__super__=l.prototype,f},p={}.hasOwnProperty;T=w("./Utility").isObject,C=w("./XMLNode"),P.exports=function(f){function l(a,c,s,u){if(l.__super__.constructor.call(this,a),s==null)throw new Error("Missing entity name");if(u==null)throw new Error("Missing entity value");if(this.pe=!!c,this.name=this.stringify.eleName(s),T(u)){if(!u.pubID&&!u.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(u.pubID&&!u.sysID)throw new Error("System identifier is required for a public external entity");if(u.pubID!=null&&(this.pubID=this.stringify.dtdPubID(u.pubID)),u.sysID!=null&&(this.sysID=this.stringify.dtdSysID(u.sysID)),u.nData!=null&&(this.nData=this.stringify.dtdNData(u.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(u)}return h(l,f),l.prototype.toString=function(a){return this.options.writer.set(a).dtdEntity(this)},l}(C)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(w,P,S){"use strict";(function(){var C,T=function(p,f){function l(){this.constructor=p}for(var a in f)h.call(f,a)&&(p[a]=f[a]);return l.prototype=f.prototype,p.prototype=new l,p.__super__=f.prototype,p},h={}.hasOwnProperty;C=w("./XMLNode"),P.exports=function(p){function f(l,a,c){if(f.__super__.constructor.call(this,l),a==null)throw new Error("Missing notation name");if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(a),c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return T(f,p),f.prototype.toString=function(l){return this.options.writer.set(l).dtdNotation(this)},f}(C)}).call(void 0)},{"./XMLNode":227}],222:[function(w,P,S){"use strict";(function(){var C,T,h=function(f,l){function a(){this.constructor=f}for(var c in l)p.call(l,c)&&(f[c]=l[c]);return a.prototype=l.prototype,f.prototype=new a,f.__super__=l.prototype,f},p={}.hasOwnProperty;T=w("./Utility").isObject,C=w("./XMLNode"),P.exports=function(f){function l(a,c,s,u){var i;l.__super__.constructor.call(this,a),T(c)&&(i=c,c=i.version,s=i.encoding,u=i.standalone),c||(c="1.0"),this.version=this.stringify.xmlVersion(c),s!=null&&(this.encoding=this.stringify.xmlEncoding(s)),u!=null&&(this.standalone=this.stringify.xmlStandalone(u))}return h(l,f),l.prototype.toString=function(a){return this.options.writer.set(a).declaration(this)},l}(C)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(w,P,S){"use strict";(function(){var C,T,h,p,f,l,a=function(s,u){function i(){this.constructor=s}for(var n in u)c.call(u,n)&&(s[n]=u[n]);return i.prototype=u.prototype,s.prototype=new i,s.__super__=u.prototype,s},c={}.hasOwnProperty;l=w("./Utility").isObject,f=w("./XMLNode"),C=w("./XMLDTDAttList"),h=w("./XMLDTDEntity"),T=w("./XMLDTDElement"),p=w("./XMLDTDNotation"),P.exports=function(s){function u(i,n,t){var d,v;u.__super__.constructor.call(this,i),this.documentObject=i,l(n)&&(d=n,n=d.pubID,t=d.sysID),t==null&&(v=[n,t],t=v[0],n=v[1]),n!=null&&(this.pubID=this.stringify.dtdPubID(n)),t!=null&&(this.sysID=this.stringify.dtdSysID(t))}return a(u,s),u.prototype.element=function(i,n){var t;return t=new T(this,i,n),this.children.push(t),this},u.prototype.attList=function(i,n,t,d,v){var b;return b=new C(this,i,n,t,d,v),this.children.push(b),this},u.prototype.entity=function(i,n){var t;return t=new h(this,!1,i,n),this.children.push(t),this},u.prototype.pEntity=function(i,n){var t;return t=new h(this,!0,i,n),this.children.push(t),this},u.prototype.notation=function(i,n){var t;return t=new p(this,i,n),this.children.push(t),this},u.prototype.toString=function(i){return this.options.writer.set(i).docType(this)},u.prototype.ele=function(i,n){return this.element(i,n)},u.prototype.att=function(i,n,t,d,v){return this.attList(i,n,t,d,v)},u.prototype.ent=function(i,n){return this.entity(i,n)},u.prototype.pent=function(i,n){return this.pEntity(i,n)},u.prototype.not=function(i,n){return this.notation(i,n)},u.prototype.up=function(){return this.root()||this.documentObject},u}(f)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(w,P,S){"use strict";(function(){var C,T,h,p,f=function(a,c){function s(){this.constructor=a}for(var u in c)l.call(c,u)&&(a[u]=c[u]);return s.prototype=c.prototype,a.prototype=new s,a.__super__=c.prototype,a},l={}.hasOwnProperty;p=w("./Utility").isPlainObject,C=w("./XMLNode"),h=w("./XMLStringifier"),T=w("./XMLStringWriter"),P.exports=function(a){function c(s){c.__super__.constructor.call(this,null),s||(s={}),s.writer||(s.writer=new T),this.options=s,this.stringify=new h(s),this.isDocument=!0}return f(c,a),c.prototype.end=function(s){var u;return s?p(s)&&(u=s,s=this.options.writer.set(u)):s=this.options.writer,s.document(this)},c.prototype.toString=function(s){return this.options.writer.set(s).document(this)},c}(C)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(w,P,S){"use strict";(function(){var C,T,h,p,f,l,a,c,s,u,i,n,t,d,v,b,y,_,m,g={}.hasOwnProperty;m=w("./Utility"),y=m.isObject,b=m.isFunction,_=m.isPlainObject,u=w("./XMLElement"),T=w("./XMLCData"),h=w("./XMLComment"),n=w("./XMLRaw"),v=w("./XMLText"),i=w("./XMLProcessingInstruction"),c=w("./XMLDeclaration"),s=w("./XMLDocType"),p=w("./XMLDTDAttList"),l=w("./XMLDTDEntity"),f=w("./XMLDTDElement"),a=w("./XMLDTDNotation"),C=w("./XMLAttribute"),d=w("./XMLStringifier"),t=w("./XMLStringWriter"),P.exports=function(){function E(o,x,A){var O;o||(o={}),o.writer?_(o.writer)&&(O=o.writer,o.writer=new t(O)):o.writer=new t(o),this.options=o,this.writer=o.writer,this.stringify=new d(o),this.onDataCallback=x||function(){},this.onEndCallback=A||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return E.prototype.node=function(o,x,A){var O;if(o==null)throw new Error("Missing node name");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node");return this.openCurrent(),o=o.valueOf(),x==null&&(x={}),x=x.valueOf(),y(x)||(O=[x,A],A=O[0],x=O[1]),this.currentNode=new u(this,o,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,A!=null&&this.text(A),this},E.prototype.element=function(o,x,A){return this.currentNode&&this.currentNode instanceof s?this.dtdElement.apply(this,arguments):this.node(o,x,A)},E.prototype.attribute=function(o,x){var A,O;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(o!=null&&(o=o.valueOf()),y(o))for(A in o)g.call(o,A)&&(O=o[A],this.attribute(A,O));else b(x)&&(x=x.apply()),this.options.skipNullAttributes&&x==null||(this.currentNode.attributes[o]=new C(this,o,x));return this},E.prototype.text=function(o){var x;return this.openCurrent(),x=new v(this,o),this.onData(this.writer.text(x,this.currentLevel+1)),this},E.prototype.cdata=function(o){var x;return this.openCurrent(),x=new T(this,o),this.onData(this.writer.cdata(x,this.currentLevel+1)),this},E.prototype.comment=function(o){var x;return this.openCurrent(),x=new h(this,o),this.onData(this.writer.comment(x,this.currentLevel+1)),this},E.prototype.raw=function(o){var x;return this.openCurrent(),x=new n(this,o),this.onData(this.writer.raw(x,this.currentLevel+1)),this},E.prototype.instruction=function(o,x){var A,O,D,I,F;if(this.openCurrent(),o!=null&&(o=o.valueOf()),x!=null&&(x=x.valueOf()),Array.isArray(o))for(A=0,I=o.length;A=0;)this.up();return this.onEnd()},E.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},E.prototype.openNode=function(o){if(!o.isOpen)return!this.root&&this.currentLevel===0&&o instanceof u&&(this.root=o),this.onData(this.writer.openNode(o,this.currentLevel)),o.isOpen=!0},E.prototype.closeNode=function(o){if(!o.isClosed)return this.onData(this.writer.closeNode(o,this.currentLevel)),o.isClosed=!0},E.prototype.onData=function(o){return this.documentStarted=!0,this.onDataCallback(o)},E.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},E.prototype.ele=function(){return this.element.apply(this,arguments)},E.prototype.nod=function(o,x,A){return this.node(o,x,A)},E.prototype.txt=function(o){return this.text(o)},E.prototype.dat=function(o){return this.cdata(o)},E.prototype.com=function(o){return this.comment(o)},E.prototype.ins=function(o,x){return this.instruction(o,x)},E.prototype.dec=function(o,x,A){return this.declaration(o,x,A)},E.prototype.dtd=function(o,x,A){return this.doctype(o,x,A)},E.prototype.e=function(o,x,A){return this.element(o,x,A)},E.prototype.n=function(o,x,A){return this.node(o,x,A)},E.prototype.t=function(o){return this.text(o)},E.prototype.d=function(o){return this.cdata(o)},E.prototype.c=function(o){return this.comment(o)},E.prototype.r=function(o){return this.raw(o)},E.prototype.i=function(o,x){return this.instruction(o,x)},E.prototype.att=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},E.prototype.a=function(){return this.currentNode&&this.currentNode instanceof s?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},E.prototype.ent=function(o,x){return this.entity(o,x)},E.prototype.pent=function(o,x){return this.pEntity(o,x)},E.prototype.not=function(o,x){return this.notation(o,x)},E}()}).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(w,P,S){"use strict";var C=w("babel-runtime/core-js/object/create"),T=function(h){return h&&h.__esModule?h:{default:h}}(C);(function(){var h,p,f,l,a,c=function(u,i){function n(){this.constructor=u}for(var t in i)s.call(i,t)&&(u[t]=i[t]);return n.prototype=i.prototype,u.prototype=new n,u.__super__=i.prototype,u},s={}.hasOwnProperty;a=w("./Utility"),l=a.isObject,f=a.isFunction,p=w("./XMLNode"),h=w("./XMLAttribute"),P.exports=function(u){function i(n,t,d){if(i.__super__.constructor.call(this,n),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},d!=null&&this.attribute(d),n.isDocument&&(this.isRoot=!0,this.documentObject=n,n.rootObject=this)}return c(i,u),i.prototype.clone=function(){var n,t,d,v;d=(0,T.default)(this),d.isRoot&&(d.documentObject=null),d.attributes={},v=this.attributes;for(t in v)s.call(v,t)&&(n=v[t],d.attributes[t]=n.clone());return d.children=[],this.children.forEach(function(b){var y;return y=b.clone(),y.parent=d,d.children.push(y)}),d},i.prototype.attribute=function(n,t){var d,v;if(n!=null&&(n=n.valueOf()),l(n))for(d in n)s.call(n,d)&&(v=n[d],this.attribute(d,v));else f(t)&&(t=t.apply()),this.options.skipNullAttributes&&t==null||(this.attributes[n]=new h(this,n,t));return this},i.prototype.removeAttribute=function(n){var t,d,v;if(n==null)throw new Error("Missing attribute name");if(n=n.valueOf(),Array.isArray(n))for(d=0,v=n.length;d"+this.endline(_))},y.prototype.comment=function(_,m){return this.stream.write(this.space(m)+""+this.endline(_))},y.prototype.declaration=function(_,m){return this.stream.write(this.space(m)),this.stream.write('"),this.stream.write(this.endline(_))},y.prototype.docType=function(_,m){var g,E,o,x;if(m||(m=0),this.stream.write(this.space(m)),this.stream.write("0){for(this.stream.write(" ["),this.stream.write(this.endline(_)),x=_.children,E=0,o=x.length;E"),this.stream.write(this.endline(_))},y.prototype.element=function(_,m){var g,E,o,x,A,O,D,I;m||(m=0),I=this.space(m),this.stream.write(I+"<"+_.name),O=_.attributes;for(A in O)v.call(O,A)&&(g=O[A],this.attribute(g));if(_.children.length===0||_.children.every(function(F){return F.value===""}))this.allowEmpty?this.stream.write(">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&_.children.length===1&&_.children[0].value!=null)this.stream.write(">"),this.stream.write(_.children[0].value),this.stream.write("");else{for(this.stream.write(">"+this.newline),D=_.children,o=0,x=D.length;o")}return this.stream.write(this.endline(_))},y.prototype.processingInstruction=function(_,m){return this.stream.write(this.space(m)+""+this.endline(_))},y.prototype.raw=function(_,m){return this.stream.write(this.space(m)+_.value+this.endline(_))},y.prototype.text=function(_,m){return this.stream.write(this.space(m)+_.value+this.endline(_))},y.prototype.dtdAttList=function(_,m){return this.stream.write(this.space(m)+""+this.endline(_))},y.prototype.dtdElement=function(_,m){return this.stream.write(this.space(m)+""+this.endline(_))},y.prototype.dtdEntity=function(_,m){return this.stream.write(this.space(m)+""+this.endline(_))},y.prototype.dtdNotation=function(_,m){return this.stream.write(this.space(m)+""+this.endline(_))},y.prototype.endline=function(_){return _.isLastRootNode?"":this.newline},y}(t)}).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(w,P,S){"use strict";(function(){var C,T,h,p,f,l,a,c,s,u,i,n,t,d=function(b,y){function _(){this.constructor=b}for(var m in y)v.call(y,m)&&(b[m]=y[m]);return _.prototype=y.prototype,b.prototype=new _,b.__super__=y.prototype,b},v={}.hasOwnProperty;a=w("./XMLDeclaration"),c=w("./XMLDocType"),C=w("./XMLCData"),T=w("./XMLComment"),s=w("./XMLElement"),i=w("./XMLRaw"),n=w("./XMLText"),u=w("./XMLProcessingInstruction"),h=w("./XMLDTDAttList"),p=w("./XMLDTDElement"),f=w("./XMLDTDEntity"),l=w("./XMLDTDNotation"),t=w("./XMLWriterBase"),P.exports=function(b){function y(_){y.__super__.constructor.call(this,_)}return d(y,b),y.prototype.document=function(_){var m,g,E,o,x;for(this.textispresent=!1,o="",x=_.children,g=0,E=x.length;g"+this.newline},y.prototype.comment=function(_,m){return this.space(m)+""+this.newline},y.prototype.declaration=function(_,m){var g;return g=this.space(m),g+='",g+=this.newline},y.prototype.docType=function(_,m){var g,E,o,x,A;if(m||(m=0),x=this.space(m),x+="0){for(x+=" [",x+=this.newline,A=_.children,E=0,o=A.length;E",x+=this.newline},y.prototype.element=function(_,m){var g,E,o,x,A,O,D,I,F,z,ne,j,G;m||(m=0),G=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),j=this.space(m),I="",I+=j+"<"+_.name,F=_.attributes;for(D in F)v.call(F,D)&&(g=F[D],I+=this.attribute(g));if(_.children.length===0||_.children.every(function(X){return X.value===""}))this.allowEmpty?I+=">"+this.newline:I+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&_.children.length===1&&_.children[0].value!=null)I+=">",I+=_.children[0].value,I+=""+this.newline;else{if(this.dontprettytextnodes){for(z=_.children,o=0,A=z.length;o"+this.newline,ne=_.children,x=0,O=ne.length;x"+this.newline}return I},y.prototype.processingInstruction=function(_,m){var g;return g=this.space(m)+""+this.newline},y.prototype.raw=function(_,m){return this.space(m)+_.value+this.newline},y.prototype.text=function(_,m){return this.space(m)+_.value+this.newline},y.prototype.dtdAttList=function(_,m){var g;return g=this.space(m)+""+this.newline},y.prototype.dtdElement=function(_,m){return this.space(m)+""+this.newline},y.prototype.dtdEntity=function(_,m){var g;return g=this.space(m)+""+this.newline},y.prototype.dtdNotation=function(_,m){var g;return g=this.space(m)+""+this.newline},y.prototype.openNode=function(_,m){var g,E,o,x;if(m||(m=0),_ instanceof s){o=this.space(m)+"<"+_.name,x=_.attributes;for(E in x)v.call(x,E)&&(g=x[E],o+=this.attribute(g));return o+=(_.children?">":"/>")+this.newline}return o=this.space(m)+"")+this.newline},y.prototype.closeNode=function(_,m){switch(m||(m=0),!1){case!(_ instanceof s):return this.space(m)+""+this.newline;case!(_ instanceof c):return this.space(m)+"]>"+this.newline}},y}(t)}).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(w,P,S){"use strict";(function(){var C=function(h,p){return function(){return h.apply(p,arguments)}},T={}.hasOwnProperty;P.exports=function(){function h(p){this.assertLegalChar=C(this.assertLegalChar,this);var f,l,a;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,l=p.stringify||{};for(f in l)T.call(l,f)&&(a=l[f],this[f]=a)}return h.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},h.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},h.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]>"),this.assertLegalChar(p)},h.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},h.prototype.raw=function(p){return""+p||""},h.prototype.attName=function(p){return p=""+p||""},h.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},h.prototype.insTarget=function(p){return""+p||""},h.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},h.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},h.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},h.prototype.xmlStandalone=function(p){return p?"yes":"no"},h.prototype.dtdPubID=function(p){return""+p||""},h.prototype.dtdSysID=function(p){return""+p||""},h.prototype.dtdElementValue=function(p){return""+p||""},h.prototype.dtdAttType=function(p){return""+p||""},h.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},h.prototype.dtdEntityValue=function(p){return""+p||""},h.prototype.dtdNData=function(p){return""+p||""},h.prototype.convertAttKey="@",h.prototype.convertPIKey="?",h.prototype.convertTextKey="#text",h.prototype.convertCDataKey="#cdata",h.prototype.convertCommentKey="#comment",h.prototype.convertRawKey="#raw",h.prototype.assertLegalChar=function(p){var f;if(f=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+f.index);return p},h.prototype.elEscape=function(p){var f;return f=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(f,"&").replace(//g,">").replace(/\r/g," ")},h.prototype.attEscape=function(p){var f;return f=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(f,"&").replace(/0?new Array(p).join(this.indent):""):""},T}()}).call(void 0)},{}],235:[function(w,P,S){"use strict";(function(){var C,T,h,p,f,l,a;a=w("./Utility"),f=a.assign,l=a.isFunction,C=w("./XMLDocument"),T=w("./XMLDocumentCB"),p=w("./XMLStringWriter"),h=w("./XMLStreamWriter"),P.exports.create=function(c,s,u,i){var n,t;if(c==null)throw new Error("Root element needs a name");return i=f({},s,u,i),n=new C(i),t=n.element(c),i.headless||(n.declaration(i),i.pubID==null&&i.sysID==null||n.doctype(i)),t},P.exports.begin=function(c,s,u){var i;return l(c)&&(i=[c,s],s=i[0],u=i[1],c={}),s?new T(c,s,u):new C(c)},P.exports.stringWriter=function(c){return new p(c)},P.exports.streamWriter=function(c,s){return new h(c,s)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(w,P,S){function C(){for(var h={},p=0;ps?n=i(n):n.length>5]|=128<>>9<<4)]=i;for(var n=1732584193,t=-271733879,d=-1732584194,v=271733878,b=0;b>16)+(i>>16)+(n>>16)<<16|65535&n}function c(u,i){return u<>>32-i}var s=w("./helpers");P.exports=function(u){return s.hash(u,C,16)}},{"./helpers":238}],240:[function(w,P,S){"use strict";function C(a,c){a[c>>5]|=128<<24-c%32,a[15+(c+64>>9<<4)]=c;for(var s=Array(80),u=1732584193,i=-271733879,n=-1732584194,t=271733878,d=-1009589776,v=0;v>16)+(c>>16)+(s>>16)<<16|65535&s}function f(a,c){return a<>>32-c}var l=w("./helpers");P.exports=function(a){return l.hash(a,C,20,!0)}},{"./helpers":238}],241:[function(w,P,S){"use strict";var C=w("./helpers"),T=function(n,t){var d=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(d>>16)<<16|65535&d},h=function(n,t){return n>>>t|n<<32-t},p=function(n,t){return n>>>t},f=function(n,t,d){return n&t^~n&d},l=function(n,t,d){return n&t^n&d^t&d},a=function(n){return h(n,2)^h(n,13)^h(n,22)},c=function(n){return h(n,6)^h(n,11)^h(n,25)},s=function(n){return h(n,7)^h(n,18)^p(n,3)},u=function(n){return h(n,17)^h(n,19)^p(n,10)},i=function(n,t){var d,v,b,y,_,m,g,E,o,x,A,O,D=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),F=new Array(64);n[t>>5]|=128<<24-t%32,n[15+(t+64>>9<<4)]=t;for(var o=0;o=0)return v("Request#%d %s: got digest auth header WWW-Authenticate: %s",X,E,be),o.headers=o.headers||{},o.headers.Authorization=digestAuthHeader(fe.method,fe.path,be,o.digestAuth),v("Request#%d %s: auth with digest header: %s",X,E,o.headers.Authorization),Re.headers["set-cookie"]&&(o.headers.Cookie=Re.headers["set-cookie"].join(";")),S.requestWithCallback(E,o,Oe)}var Ce=Date.now()-q;Le&&(Le.contentDownload=Ce),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Ce,V,Y,fe.method,fe.host,fe.path,$,Le);var xe={status:Y,statusCode:Y,headers:he,size:V,aborted:me,rt:Ce,keepAliveSocket:$,data:Pe,requestUrls:o.requestUrls,timing:Le,remoteAddress:Ae,remotePort:at};if(He){var Be="";pe&&typeof pe.getCurrentStatus=="function"&&(Be=", agent status: "+(0,c.default)(pe.getCurrentStatus())),He.message+=", "+fe.method+" "+E+" "+Y+" (connected: "+N+", keepalive socket: "+$+Be+`) headers: `+(0,c.default)(he),He.data=Pe,He.path=fe.path,He.status=Y,He.headers=he,He.res=xe}Oe(He,Pe,o.streaming?Re:xe),o.emitter&&(Z.url=E,Z.socket=Ve&&Ve.connection,Z.options=fe,Z.size=Ie,o.emitter.emit("response",{requestId:X,error:He,ctx:o.ctx,req:Z,res:xe}))}function I(He){var Pe=null;if(o.followRedirect&&statuses.redirect[He.statusCode]){o._followRedirectCount=(o._followRedirectCount||0)+1;var Re=He.headers.location;if(Re){if(!(o._followRedirectCount>o.maxRedirects)){var Oe=o.formatRedirectUrl?o.formatRedirectUrl(E,Re):n.resolve(E,Re);v("Request#%d %s: `redirected` from %s to %s",X,fe.path,E,Oe),O(),o.headers&&o.headers.Host&&m.test(Re)&&(o.headers.Host=null);var he=x;return x=null,S.requestWithCallback(Oe,o,he),{redirect:!0,error:null}}Pe=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+E),Pe.name="MaxRedirectError"}else Pe=new Error("Got statusCode "+He.statusCode+" but cannot resolve next location from headers"),Pe.name="FollowRedirectError"}return{redirect:!1,error:Pe}}function F(He,Pe,Re){return Re(null,Pe,He.headers["content-encoding"])}function z(He){if(Le&&(Le.waiting=Date.now()-q),v("Request#%d %s `req response` event emit: status %d, headers: %j",X,E,He.statusCode,He.headers),o.streaming){var Pe=I(He);return Pe.redirect?void He.resume():Pe.error?(He.resume(),D(Pe.error,null,He)):D(null,null,He)}if(He.on("close",function(){v("Request#%d %s: `res close` event emit, total size %d",X,E,V)}),He.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",X,E,V)}),He.on("aborted",function(){me=!0,v("Request#%d %s: `res aborted` event emit, total size %d",X,E,V)}),ke){var Pe=I(He);return Pe.redirect?void He.resume():Pe.error?(He.resume(),ke.end(),D(Pe.error,null,He)):(o.consumeWriteStream===!1?He.on("end",D.bind(null,null,null,He)):isNode010||isNode012?first([[ke,"close"],[He,"aborted"]],function(he,be,Ce){v("Request#%d %s: writeStream or res %s event emitted",X,E,Ce),D(k||null,null,He)}):ke.on("close",function(){v("Request#%d %s: writeStream close event emitted",X,E),D(k||null,null,He)}),He.pipe(ke))}var Re=[];He.on("data",function(Oe){v("Request#%d %s: `res data` event emit, size %d",X,E,Oe.length),V+=Oe.length,Re.push(Oe)}),He.on("end",function(){var Oe=T.concat(Re,V);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",X,E,V,He._dumped),k)return D(k,Oe,He);var he=I(He);if(he.error)return D(he.error,Oe,He);he.redirect||F(He,Oe,function(be,Ce,xe){if(be)return D(be,Oe,He);if(!xe&&g.indexOf(o.dataType)>=0){try{Ce=decodeBodyByCharset(Ce,He)}catch(Qe){return v("decodeBodyByCharset error: %s",Qe),D(null,Ce,He)}if(o.dataType==="json")if(V===0)Ce=null;else{var Be=parseJSON(Ce,we);Be.error?be=Be.error:Ce=Be.data}}me&&v("Request#%d %s: Remote socket was terminated before `response.end()` was called",X,E),D(be,Ce,He)})})}function ne(){v("Response timer ticking, timeout: %d",Ze),ee=setTimeout(function(){ee=null;var He="Response timeout for "+Ze+"ms";k=new Error(He),k.name="ResponseTimeoutError",k.requestId=X,v("ResponseTimeout: Request#%d %s %s: %s, connected: %s",X,E,k.name,He,N),j()},Ze)}function j(){v("Request#%d %s abort, connected: %s",X,E,N),Ve.socket||(k.noSocket=!0,D(k)),Ve.abort()}if(!E||typeof E!="string"&&(E===void 0?"undefined":(0,u.default)(E))!=="object"){var G=i.format("expect request url to be a string or a http request options, but got %j",E);throw new Error(G)}arguments.length===2&&typeof o=="function"&&(x=o,o=null),o=o||{},y>=_&&(y=0);var X=++y;o.requestUrls=o.requestUrls||[];var Z={requestId:X,url:E,args:o,ctx:o.ctx};o.emitter&&o.emitter.emit("request",Z),o.timeout=o.timeout||S.TIMEOUTS,o.maxRedirects=o.maxRedirects||10,o.streaming=o.streaming||o.customResponse;var K,q=Date.now();typeof E=="string"?(m.test(E)||(E="http://"+E),K=n.parse(E)):K=E;var ie=(o.type||o.method||K.method||"GET").toUpperCase(),oe=K.port||80,ye=t,pe=p(o.agent,S.agent),we=o.fixJSONCtlChars;K.protocol==="https:"&&(ye=d,pe=p(o.httpsAgent,S.httpsAgent),K.port||(oe=443));var fe={host:K.hostname||K.host||"localhost",path:K.path||"/",method:ie,port:oe,agent:pe,headers:o.headers||{},lookup:o.lookup};Array.isArray(o.timeout)?fe.requestTimeout=o.timeout[o.timeout.length-1]:o.timeout!==void 0&&(fe.requestTimeout=o.timeout);for(var Te=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Fe=0;Fe>>2]>>>24-m%4*8&255;v[y+m>>>2]|=g<<24-(y+m)%4*8}else for(var m=0;m<_;m+=4)v[y+m>>>2]=b[m>>>2];return this.sigBytes+=_,this},clamp:function(){var d=this.words,v=this.sigBytes;d[v>>>2]&=4294967295<<32-v%4*8,d.length=C.ceil(v/4)},clone:function(){var d=l.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var v,b=[],y=0;y>16)&E,m=18e3*(65535&m)+(m>>16)&E;var o=(g<<16)+m&E;return o/=4294967296,(o+=.5)*(C.random()>.5?1:-1)}}(4294967296*(v||C.random()));v=987654071*_(),b.push(4294967296*_()|0)}return new a.init(b,d)}}),c=p.enc={},s=c.Hex={stringify:function(d){for(var v=d.words,b=d.sigBytes,y=[],_=0;_>>2]>>>24-_%4*8&255;y.push((m>>>4).toString(16)),y.push((15&m).toString(16))}return y.join("")},parse:function(d){for(var v=d.length,b=[],y=0;y>>3]|=parseInt(d.substr(y,2),16)<<24-y%8*4;return new a.init(b,v/2)}},u=c.Latin1={stringify:function(d){for(var v=d.words,b=d.sigBytes,y=[],_=0;_>>2]>>>24-_%4*8&255;y.push(String.fromCharCode(m))}return y.join("")},parse:function(d){for(var v=d.length,b=[],y=0;y>>2]|=(255&d.charCodeAt(y))<<24-y%4*8;return new a.init(b,v)}},i=c.Utf8={stringify:function(d){try{return decodeURIComponent(escape(u.stringify(d)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(d){return u.parse(unescape(encodeURIComponent(d)))}},n=f.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=i.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var v=this._data,b=v.words,y=v.sigBytes,_=this.blockSize,m=4*_,g=y/m;g=d?C.ceil(g):C.max((0|g)-this._minBufferSize,0);var E=g*_,o=C.min(4*E,y);if(E){for(var x=0;x",l[0];)p++;return p>4&&p}},{key:"extend",value:function(p,f){for(var l in f)Object.prototype.hasOwnProperty.call(f,l)&&f[l]&&(p[l]=f[l])}},{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 f(l){return l<10?"0"+l:l}return p.getUTCFullYear()+"-"+f(p.getUTCMonth()+1)+"-"+f(p.getUTCDate())+"T"+f(p.getUTCHours())+":"+f(p.getUTCMinutes())+":"+f(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),h}();w.default=T},function(U,w,P){!function(S,C){U.exports=w=C(P(0))}(0,function(S){return function(C){function T(t,d,v,b,y,_,m){var g=t+(d&v|~d&b)+y+m;return(g<<_|g>>>32-_)+d}function h(t,d,v,b,y,_,m){var g=t+(d&b|v&~b)+y+m;return(g<<_|g>>>32-_)+d}function p(t,d,v,b,y,_,m){var g=t+(d^v^b)+y+m;return(g<<_|g>>>32-_)+d}function f(t,d,v,b,y,_,m){var g=t+(v^(d|~b))+y+m;return(g<<_|g>>>32-_)+d}var l=S,a=l.lib,c=a.WordArray,s=a.Hasher,u=l.algo,i=[];!function(){for(var t=0;t<64;t++)i[t]=4294967296*C.abs(C.sin(t+1))|0}();var n=u.MD5=s.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,d){for(var v=0;v<16;v++){var b=d+v,y=t[b];t[b]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8)}var _=this._hash.words,m=t[d+0],g=t[d+1],E=t[d+2],o=t[d+3],x=t[d+4],A=t[d+5],O=t[d+6],D=t[d+7],I=t[d+8],F=t[d+9],z=t[d+10],ne=t[d+11],j=t[d+12],G=t[d+13],X=t[d+14],Z=t[d+15],K=_[0],q=_[1],ie=_[2],oe=_[3];K=T(K,q,ie,oe,m,7,i[0]),oe=T(oe,K,q,ie,g,12,i[1]),ie=T(ie,oe,K,q,E,17,i[2]),q=T(q,ie,oe,K,o,22,i[3]),K=T(K,q,ie,oe,x,7,i[4]),oe=T(oe,K,q,ie,A,12,i[5]),ie=T(ie,oe,K,q,O,17,i[6]),q=T(q,ie,oe,K,D,22,i[7]),K=T(K,q,ie,oe,I,7,i[8]),oe=T(oe,K,q,ie,F,12,i[9]),ie=T(ie,oe,K,q,z,17,i[10]),q=T(q,ie,oe,K,ne,22,i[11]),K=T(K,q,ie,oe,j,7,i[12]),oe=T(oe,K,q,ie,G,12,i[13]),ie=T(ie,oe,K,q,X,17,i[14]),q=T(q,ie,oe,K,Z,22,i[15]),K=h(K,q,ie,oe,g,5,i[16]),oe=h(oe,K,q,ie,O,9,i[17]),ie=h(ie,oe,K,q,ne,14,i[18]),q=h(q,ie,oe,K,m,20,i[19]),K=h(K,q,ie,oe,A,5,i[20]),oe=h(oe,K,q,ie,z,9,i[21]),ie=h(ie,oe,K,q,Z,14,i[22]),q=h(q,ie,oe,K,x,20,i[23]),K=h(K,q,ie,oe,F,5,i[24]),oe=h(oe,K,q,ie,X,9,i[25]),ie=h(ie,oe,K,q,o,14,i[26]),q=h(q,ie,oe,K,I,20,i[27]),K=h(K,q,ie,oe,G,5,i[28]),oe=h(oe,K,q,ie,E,9,i[29]),ie=h(ie,oe,K,q,D,14,i[30]),q=h(q,ie,oe,K,j,20,i[31]),K=p(K,q,ie,oe,A,4,i[32]),oe=p(oe,K,q,ie,I,11,i[33]),ie=p(ie,oe,K,q,ne,16,i[34]),q=p(q,ie,oe,K,X,23,i[35]),K=p(K,q,ie,oe,g,4,i[36]),oe=p(oe,K,q,ie,x,11,i[37]),ie=p(ie,oe,K,q,D,16,i[38]),q=p(q,ie,oe,K,z,23,i[39]),K=p(K,q,ie,oe,G,4,i[40]),oe=p(oe,K,q,ie,m,11,i[41]),ie=p(ie,oe,K,q,o,16,i[42]),q=p(q,ie,oe,K,O,23,i[43]),K=p(K,q,ie,oe,F,4,i[44]),oe=p(oe,K,q,ie,j,11,i[45]),ie=p(ie,oe,K,q,Z,16,i[46]),q=p(q,ie,oe,K,E,23,i[47]),K=f(K,q,ie,oe,m,6,i[48]),oe=f(oe,K,q,ie,D,10,i[49]),ie=f(ie,oe,K,q,X,15,i[50]),q=f(q,ie,oe,K,A,21,i[51]),K=f(K,q,ie,oe,j,6,i[52]),oe=f(oe,K,q,ie,o,10,i[53]),ie=f(ie,oe,K,q,z,15,i[54]),q=f(q,ie,oe,K,g,21,i[55]),K=f(K,q,ie,oe,I,6,i[56]),oe=f(oe,K,q,ie,Z,10,i[57]),ie=f(ie,oe,K,q,O,15,i[58]),q=f(q,ie,oe,K,G,21,i[59]),K=f(K,q,ie,oe,x,6,i[60]),oe=f(oe,K,q,ie,ne,10,i[61]),ie=f(ie,oe,K,q,E,15,i[62]),q=f(q,ie,oe,K,F,21,i[63]),_[0]=_[0]+K|0,_[1]=_[1]+q|0,_[2]=_[2]+ie|0,_[3]=_[3]+oe|0},_doFinalize:function(){var t=this._data,d=t.words,v=8*this._nDataBytes,b=8*t.sigBytes;d[b>>>5]|=128<<24-b%32;var y=C.floor(v/4294967296),_=v;d[15+(b+64>>>9<<4)]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8),d[14+(b+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),t.sigBytes=4*(d.length+1),this._process();for(var m=this._hash,g=m.words,E=0;E<4;E++){var o=g[E];g[E]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return m},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});l.MD5=s._createHelper(n),l.HmacMD5=s._createHmacHelper(n)}(Math),S.MD5})},function(U,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},w.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},w.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(U,w,P){"use strict";function S(n){return n&&n.__esModule?n:{default:n}}function C(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function n(t,d){for(var v=0;v-1)return"Baiduspider";if(c.indexOf("PlayStation")>-1)return"PS4";var u=navigator.platform=="Win32"||navigator.platform=="Windows"||c.indexOf("Windows")>-1,i=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return i&&(s="macOS"),navigator.platform=="X11"&&!u&&!i&&(s="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(s="Linux"),u?"windows":s},h=function(){var a=navigator.userAgent,c="";return(a.indexOf("Windows NT 5.0")>-1||a.indexOf("Windows 2000")>-1)&&(c="2000"),(a.indexOf("Windows NT 5.1")>-1||a.indexOf("Windows XP")>-1)&&(c="XP"),(a.indexOf("Windows NT 5.2")>-1||a.indexOf("Windows 2003")>-1)&&(c="2003"),(a.indexOf("Windows NT 6.0")>-1||a.indexOf("Windows Vista")>-1)&&(c="Vista"),(a.indexOf("Windows NT 6.1")>-1||a.indexOf("Windows 7")>-1)&&(c="7"),(a.indexOf("Windows NT 6.2")>-1||a.indexOf("Windows 8")>-1)&&(c="8"),(a.indexOf("Windows NT 6.3")>-1||a.indexOf("Windows 8.1")>-1)&&(c="8.1"),(a.indexOf("Windows NT 10")>-1||a.indexOf("Windows 10")>-1)&&(c="10"),c},p=function(a){var c=navigator.userAgent.toLowerCase();return a.chrome?"Chrome":a.firefox?"Firefox":a.safari?"Safari":a.webview?"webview":a.ie?/edge/.test(c)?"Edge":"IE":/baiduspider/.test(c)?"Baiduspider":/ucweb/.test(c)||/UCBrowser/.test(c)?"UC":/opera/.test(c)?"Opera":/ucweb/.test(c)?"UC":/360se/.test(c)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(c)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(c)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(c)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(c)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(c)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(c)?"PS4\u6D4F\u89C8\u5668":void 0},f=function(){var a={},c={},s=navigator.userAgent,u=navigator.platform,i=s.match(/Web[kK]it[\/]{0,1}([\d.]+)/),n=s.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!s.match(/\(Macintosh\; Intel /),d=s.match(/(iPad).*OS\s([\d_]+)/),v=s.match(/(iPod)(.*OS\s([\d_]+))?/),b=!d&&s.match(/(iPhone\sOS)\s([\d_]+)/),y=s.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),_=/Win\d{2}|Windows/.test(u),m=s.match(/Windows Phone ([\d.]+)/),g=y&&s.match(/TouchPad/),E=s.match(/Kindle\/([\d.]+)/),o=s.match(/Silk\/([\d._]+)/),x=s.match(/(BlackBerry).*Version\/([\d.]+)/),A=s.match(/(BB10).*Version\/([\d.]+)/),O=s.match(/(RIM\sTablet\sOS)\s([\d.]+)/),D=s.match(/PlayBook/),I=s.match(/Chrome\/([\d.]+)/)||s.match(/CriOS\/([\d.]+)/),F=s.match(/Firefox\/([\d.]+)/),z=s.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),ne=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),j=!I&&s.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),G=j||s.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((c.webkit=!!i)&&(c.version=i[1]),n&&(a.android=!0,a.version=n[2]),b&&!v&&(a.ios=a.iphone=!0,a.version=b[2].replace(/_/g,".")),d&&(a.ios=a.ipad=!0,a.version=d[2].replace(/_/g,".")),v&&(a.ios=a.ipod=!0,a.version=v[3]?v[3].replace(/_/g,"."):null),m&&(a.wp=!0,a.version=m[1]),y&&(a.webos=!0,a.version=y[2]),g&&(a.touchpad=!0),x&&(a.blackberry=!0,a.version=x[2]),A&&(a.bb10=!0,a.version=A[2]),O&&(a.rimtabletos=!0,a.version=O[2]),D&&(c.playbook=!0),E&&(a.kindle=!0,a.version=E[1]),o&&(c.silk=!0,c.version=o[1]),!o&&a.android&&s.match(/Kindle Fire/)&&(c.silk=!0),I&&(c.chrome=!0,c.version=I[1]),F&&(c.firefox=!0,c.version=F[1]),z&&(a.firefoxos=!0,a.version=z[1]),ne&&(c.ie=!0,c.version=ne[1]),G&&(t||a.ios||_||n)&&(c.safari=!0,a.ios||(c.version=G[1])),j&&(c.webview=!0),t){var X=s.match(/[\d]*_[\d]*_[\d]*/);X&&X.length>0&&X[0]&&(a.version=X[0].replace(/_/g,"."))}return a.tablet=!!(d||D||n&&!s.match(/Mobile/)||F&&s.match(/Tablet/)||ne&&!s.match(/Phone/)&&s.match(/Touch/)),a.phone=!(a.tablet||a.ipod||!(n||b||y||x||A||I&&s.match(/Android/)||I&&s.match(/CriOS\/([\d.]+)/)||F&&s.match(/Mobile/)||ne&&s.match(/Touch/))),a.pc=!a.tablet&&!a.phone,t?a.name="macOS":_?(a.name="windows",a.version=h()):a.name=T(a),c.name=p(c),{os:a,browser:c}}(),l=function(){function a(){S(this,a)}return C(a,null,[{key:"getHost",value:function(c){var s="";if(c===void 0||c==null||c=="")return"";var u=c.indexOf("//"),i=c;u>-1&&(i=c.substring(u+2));var s=i,n=i.split("/");return n&&n.length>0&&(s=n[0]),n=s.split(":"),n&&n.length>0&&(s=n[0]),s}},{key:"os",get:function(){return f.os}},{key:"browser",get:function(){var c=f.browser;return c.name||(c.name=p()),c}}]),a}();w.default=l},function(U,w,P){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function h(p,f){for(var l=0;l0){X._invalidUserId=!0;var ie=q.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(ie)}}catch(oe){console.log(oe)}})})}z&&(G.videoInfo=z?JSON.parse(z).Vod:{},G.userData=c.default.encode(z)),G.ri=b.default.create(),this._uploadList.push(G),this._reportLog("20001",G,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(G)}catch(Z){console.log(Z)}return!0}},{key:"deleteFile",value:function(O){return!!this.cancelFile(O)&&(this._uploadList.splice(O,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(O){if(this.options,O<0||O>=this._uploadList.length)return!1;var D=this._uploadList[O];if(O==this._curIndex&&D.state==h.UPLOADSTATE.UPLOADING){D.state=h.UPLOADSTATE.CANCELED;var I=this._getCheckoutpoint(D);I&&I.checkpoint&&(I=I.checkpoint),I&&this._ossUpload.abort(D),this._removeCheckoutpoint(D),this.nextUpload()}else D.state!=h.UPLOADSTATE.SUCCESS&&(D.state=h.UPLOADSTATE.CANCELED);return this._reportLog("20008",D),!0}},{key:"resumeFile",value:function(O){if(this.options,O<0||O>=this._uploadList.length)return!1;var D=this._uploadList[O];return D.state==h.UPLOADSTATE.CANCELED&&(D.state=h.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(O){return this._getCheckoutpoint({file:O})}},{key:"startUpload",value:function(O){if(this._retryCount=0,this.options,this._state==h.VODSTATE.START||this._state==h.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=h.VODSTATE.END);var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D),this._state=h.VODSTATE.START}},{key:"nextUpload",value:function(){var O=this.options;if(this._state==h.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var D=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(D)}else{this._state=h.VODSTATE.END;try{O.onUploadEnd&&O.onUploadEnd(D)}catch(I){console.log(I)}}}},{key:"clear",value:function(O){for(var D=this.options,I=0,F=0;Fthis._curIndex&&(z=this._uploadList[this._curIndex]),z&&(this.init(O,D,I,F),this._state=h.VODSTATE.START,this._ossUpload=null,this._uploadCore(z,z.retry),z.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(O,D,I){if(this._curIndex==-1)return!1;if(this._state!=h.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var F=this._uploadList[this._curIndex];F.object?this._refreshSTSTokenUpload(F,O,D,I):this.setSTSToken(F,O,D,I)}}},{key:"setSTSTokenDirectlyUpload",value:function(O,D,I,F,z){if(!(D&&I&&F&&z))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var ne=O;this.init(D,I,F,z),ne.endpoint=ne._endpoint,ne.bucket=ne._bucket,ne.object=ne._object,this._ossUpload=null,this._uploadCore(ne,O.retry),O.retry=!1}},{key:"setSTSToken",value:function(O,D,I,F){if(!D||!I||!F)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var z=O.videoInfo,ne={accessKeyId:D,securityToken:F,accessKeySecret:I,fileName:O.file.name,title:z.Title,requestId:O.ri,region:this.options.region};z.ImageType&&(ne.imageType=z.ImageType),z.ImageExt&&(ne.imageExt=z.ImageExt),z.FileSize&&(ne.fileSize=z.FileSize),z.Description&&(ne.description=z.Description),z.CateId&&(ne.cateId=z.CateId),z.Tags&&(ne.tags=z.Tags),z.TemplateGroupId&&(ne.templateGroupId=z.TemplateGroupId),z.StorageLocation&&(ne.storageLocation=z.StorageLocation),z.CoverURL&&(ne.coverUrl=z.CoverURL),z.TransCodeMode&&(ne.transCodeMode=z.TransCodeMode),z.UserData&&(ne.userData=z.UserData);var j=this,G="getUploadAuth";O.videoId?(ne.videoId=O.videoId,G="refreshUploadAuth"):O.isImage&&(G="getImageUploadAuth"),_.default[G](ne,function(X){O.videoId=X.VideoId?X.VideoId:O.videoId,j.setUploadAuthAndAddress(O,X.UploadAuth,X.UploadAddress),j._state=h.VODSTATE.START},function(X){j._error(O,{name:X.Code,code:X.Code,message:X.Message,requestId:X.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(O,D,I,F){if(!O||!D||!I)return!1;var z=JSON.parse(c.default.decode(D));if(!(z.AccessKeyId&&z.AccessKeySecret&&z.SecurityToken&&z.Expiration))return console.error("uploadauth is invalid"),!1;var ne={},j=O;if(I){if(ne=JSON.parse(c.default.decode(I)),!ne.Endpoint||!ne.Bucket||!ne.FileName)return console.error("uploadAddress is invalid"),!1}else ne.Endpoint=j.endpoint,ne.Bucket=j.bucket,ne.FileName=j.object;this._ut="vod",this._uploadWay="vod",this.options.region=z.Region||this.options.region,this.init(z.AccessKeyId,z.AccessKeySecret,z.SecurityToken,z.Expiration),j.endpoint=j._endpoint?j._endpoint:ne.Endpoint,j.bucket=j._bucket?j._bucket:ne.Bucket,j.object=j._object?j._object:ne.FileName,j.region=this.options.region,F&&(j.videoId=F),this._ossUpload=null,this._uploadCore(j,O.retry),O.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(O,D,I,F){if(!D||!I||!F)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var z={accessKeyId:D,securityToken:F,accessKeySecret:I,videoId:O.object,requestId:O.ri,region:this.options.region},ne=this,j="refreshUploadAuth";O.isImage&&(j="getImageUploadAuth"),_.default[j](z,function(G){ne.setUploadAuthAndAddress(O,G.UploadAuth,UploadAddress),ne._state=h.VODSTATE.START},function(G){ne._error(O,{name:G.Code,code:G.Code,message:G.Message,requestId:G.RequestId})})}},{key:"_upload",value:function(O){var D=arguments.length>1&&arguments[1]!==void 0&&arguments[1],I=this.options;if(O.retry=D,I.onUploadstarted&&!D)try{var F=this._getCheckoutpoint(O);F&&F.state!=h.UPLOADSTATE.UPLOADING&&(O.checkpoint=F,O.videoId=F.videoId),I.onUploadstarted(O)}catch(z){console.log(z)}}},{key:"_uploadCore",value:function(O){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(O.state=h.UPLOADSTATE.UPLOADING,!this._ossUpload){O.endpoint=O.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var D=this;this._ossUpload=new l.default({bucket:O.bucket,endpoint:O.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(X,Z){D._error.call(D,X,Z)},oncomplete:function(X,Z){D._complete.call(D,X,Z)},onprogress:function(X,Z,K){D._progress.call(D,X,Z,K)}})}var I=d.default.getFileType(O.file.name),F=this._getCheckoutpoint(O),z="",ne="";F&&F.checkpoint&&(ne=F.state,z=F.videoId,F=F.checkpoint),F&&z==O.videoId&&ne!=h.UPLOADSTATE.UPLOADING&&(F.file=O.file,O.checkpoint=F,F.uploadId);var j=this._adjustPartSize(O);this._reportLog("20002",O,{ft:I,fs:O.file.size,bu:O.bucket,ok:O.object,vid:O.videoId||"",fn:O.file.name,fw:null,fh:null,ps:j});var G={headers:{"x-oss-notification":O.userData?O.userData:""},partSize:j,parallel:this.options.parallel};this._ossUpload.upload(O,G)}},{key:"_findUploadIndex",value:function(){for(var O=-1,D=0;D0||D.name=="SignatureDoesNotMatchError"||D.code=="SecurityTokenExpired"||D.code=="InvalidSecurityToken.Expired"||D.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=h.VODSTATE.EXPIRE,O.state=h.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(O,D)}catch(F){console.log(F)}}return}if((D.name=="RequestTimeoutError"||D.name=="ConnectionTimeout"||D.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var I=this;return setTimeout(function(){I._uploadCore(O,!0)},1e3*I._retryDuration),void this._retryCount++}D.name=="NoSuchUploadError"&&this._removeCheckoutpoint(O),this._handleError(O,D)}}},{key:"_handleError",value:function(O,D){var I=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],F=h.UPLOADSTATE.FAIlURE;if(O.state!=h.UPLOADSTATE.CANCELED&&(O.state=h.UPLOADSTATE.FAIlURE,this._state=h.VODSTATE.FAILURE,this.options.onUploadFailed&&D&&D.code&&D.message))try{this.options.onUploadFailed(O,D.code,D.message)}catch(ne){console.log(ne)}if(I&&this._changeState(O,F),this._reportLog("20006",O,{code:D.name,message:D.message,requestId:D.requestId,fs:O.file.size,bu:O.bucket,ok:O.object,fn:O.file.name}),this._reportLog("20004",O,{requestId:D.requestId,fs:O.file.size,bu:O.bucket,ok:O.object,fn:O.file.name}),O.ri=b.default.create(),this._findUploadIndex()!=-1){var z=this;this._state=h.VODSTATE.START,setTimeout(function(){z.nextUpload()},100)}}},{key:"_complete",value:function(O,D){if(O.state=h.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(O)}catch(z){console.log(z)}var I=0;D&&D.res&&D.res.headers&&(I=D.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(O);var F=this;setTimeout(function(){F.nextUpload()},100),this._retryCount=0,this._reportLog("20003",O,{requestId:I})}},{key:"_progress",value:function(O,D,I){if(this.options.onUploadProgress)try{O.loaded=D.loaded,this.options.onUploadProgress(O,D.total,D.loaded)}catch(Z){console.log(Z)}var F=D.checkpoint,z=0;F&&(O.checkpoint=F,this._saveCheckoutpoint(O,F,h.UPLOADSTATE.UPLOADING),z=F.uploadId),this._retryCount=0;var ne=this._getPortNumber(F),j=0;if(I&&I.headers&&(j=I.headers["x-oss-request-id"]),D.loaded!=0&&this._reportLog("20007",O,{pn:ne,requestId:j}),D.loaded!=1&&this._reportLog("20005",O,{UploadId:z,pn:ne+1,pr:O.retry?1:0,fs:O.file.size,bu:O.bucket,ok:O.object,fn:O.file.name}),!this._invalidUserId&&!O.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var G={file:O.file,checkpoint:D,userId:this.options.userId,videoId:O.videoId,region:this.options.region,fileHash:O.fileHash};try{var X=this;g.default.upload(G,function(){},function(Z){if((Z=JSON.parse(Z))&&Z.Code=="InvalidParameter"&&Z.Message.indexOf("UserId")>0){X._invalidUserId=!0;var K=Z.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(K)}})}catch(Z){console.log(Z)}}}},{key:"_getPortNumber",value:function(O){if(O){var D=O.doneParts;if(D&&D.length>0)return D[D.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(O){var D=this._getCheckoutpointKey(O);u.default.remove(D)}},{key:"_getCheckoutpoint",value:function(O){var D=this._getCheckoutpointKey(O),I=u.default.get(D);if(I)try{return JSON.parse(I)}catch(F){}return""}},{key:"_saveCheckoutpoint",value:function(O,D,I){if(D){var F=this._getCheckoutpointKey(O),z=O.file,ne={fileName:z.name,lastModified:z.lastModified,size:z.size,object:O.object,videoId:O.videoId,bucket:O.bucket,endpoint:O.endpoint,checkpoint:D,loaded:O.loaded,state:I};u.default.set(F,JSON.stringify(ne))}}},{key:"_changeState",value:function(O,D){var I=this._getCheckoutpoint(O);I&&((this._onbeforeunload=!0)&&(D=h.UPLOADSTATE.STOPED),this._saveCheckoutpoint(O,I.checkpoint,D))}},{key:"_getCheckoutpointKey",value:function(O){return"upload_"+O.file.lastModified+"_"+O.file.name+"_"+O.file.size}},{key:"_getCheckoutpointFromCloud",value:function(O,D,I){var F={userId:this.options.userId,uploadInfoList:[{FileName:O.file.name,FileSize:O.file.size,FileCreateTime:O.file.lastModified,FileHash:O.fileHash}],region:this.options.region};g.default.get(F,function(z){D(z)},I)}},{key:"_reportLog",value:function(O,D,I){I||(I={}),I.ri=D.ri,this._ut&&(I.ut=this._ut),this._log.log(O,I)}},{key:"_initEvent",value:function(){var O=this;window&&(window.onbeforeunload=function(D){if(O._onbeforeunload=!0,O._curIndex!=-1&&O._uploadList.length>O._curIndex){var I=O._uploadList[O._curIndex];O._changeState(I,h.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var O=0;O1e4?O.file.size/9999:this.options.partSize}}]),A}());w.default=x},function(U,w,P){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},w.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(U,w,P){"use strict";function S(a){return a&&a.__esModule?a:{default:a}}function C(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var T=function(){function a(c,s){for(var u=0;u=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return 0|ee}function t(ee){return+ee!=ee&&(ee=0),h.alloc(+ee)}function d(ee,k){if(h.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 N=ee.length;if(N===0)return 0;for(var $=!1;;)switch(k){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":case void 0:return fe(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*N;case"hex":return N>>>1;case"base64":return De(ee).length;default:if($)return fe(ee).length;k=(""+k).toLowerCase(),$=!0}}function v(ee,k,N){var $=!1;if((k===void 0||k<0)&&(k=0),k>this.length)return"";if((N===void 0||N>this.length)&&(N=this.length),N<=0)return"";if(N>>>=0,k>>>=0,N<=k)return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return ne(this,k,N);case"utf8":case"utf-8":return D(this,k,N);case"ascii":return F(this,k,N);case"latin1":case"binary":return z(this,k,N);case"base64":return O(this,k,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,k,N);default:if($)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),$=!0}}function b(ee,k,N){var $=ee[k];ee[k]=ee[N],ee[N]=$}function y(ee,k,N,$,V){if(ee.length===0)return-1;if(typeof N=="string"?($=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,isNaN(N)&&(N=V?0:ee.length-1),N<0&&(N=ee.length+N),N>=ee.length){if(V)return-1;N=ee.length-1}else if(N<0){if(!V)return-1;N=0}if(typeof k=="string"&&(k=h.from(k,$)),h.isBuffer(k))return k.length===0?-1:_(ee,k,N,$,V);if(typeof k=="number")return k&=255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(ee,k,N):Uint8Array.prototype.lastIndexOf.call(ee,k,N):_(ee,[k],N,$,V);throw new TypeError("val must be string, number or Buffer")}function _(ee,k,N,$,V){function Y(Ve,He){return me===1?Ve[He]:Ve.readUInt16BE(He*me)}var me=1,Ae=ee.length,at=k.length;if($!==void 0&&(($=String($).toLowerCase())==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(ee.length<2||k.length<2)return-1;me=2,Ae/=2,at/=2,N/=2}var Le;if(V){var ke=-1;for(Le=N;LeAe&&(N=Ae-at),Le=N;Le>=0;Le--){for(var Ye=!0,Ze=0;ZeV&&($=V):$=V;var Y=k.length;if(Y%2!=0)throw new TypeError("Invalid hex string");$>Y/2&&($=Y/2);for(var me=0;me<$;++me){var Ae=parseInt(k.substr(2*me,2),16);if(isNaN(Ae))return me;ee[N+me]=Ae}return me}function g(ee,k,N,$){return Me(fe(k,ee.length-N),ee,N,$)}function E(ee,k,N,$){return Me(Te(k),ee,N,$)}function o(ee,k,N,$){return E(ee,k,N,$)}function x(ee,k,N,$){return Me(De(k),ee,N,$)}function A(ee,k,N,$){return Me(Fe(k,ee.length-N),ee,N,$)}function O(ee,k,N){return k===0&&N===ee.length?ve.fromByteArray(ee):ve.fromByteArray(ee.slice(k,N))}function D(ee,k,N){N=Math.min(ee.length,N);for(var $=[],V=k;V239?4:Y>223?3:Y>191?2:1;if(V+Ae<=N){var at,Le,ke,Ye;switch(Ae){case 1:Y<128&&(me=Y);break;case 2:at=ee[V+1],(192&at)==128&&(Ye=(31&Y)<<6|63&at)>127&&(me=Ye);break;case 3:at=ee[V+1],Le=ee[V+2],(192&at)==128&&(192&Le)==128&&(Ye=(15&Y)<<12|(63&at)<<6|63&Le)>2047&&(Ye<55296||Ye>57343)&&(me=Ye);break;case 4:at=ee[V+1],Le=ee[V+2],ke=ee[V+3],(192&at)==128&&(192&Le)==128&&(192&ke)==128&&(Ye=(15&Y)<<18|(63&at)<<12|(63&Le)<<6|63&ke)>65535&&Ye<1114112&&(me=Ye)}}me===null?(me=65533,Ae=1):me>65535&&(me-=65536,$.push(me>>>10&1023|55296),me=56320|1023&me),$.push(me),V+=Ae}return I($)}function I(ee){var k=ee.length;if(k<=Ne)return String.fromCharCode.apply(String,ee);for(var N="",$=0;$$)&&(N=$);for(var V="",Y=k;YN)throw new RangeError("Trying to access beyond buffer length")}function X(ee,k,N,$,V,Y){if(!h.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>V||kee.length)throw new RangeError("Index out of range")}function Z(ee,k,N,$){k<0&&(k=65535+k+1);for(var V=0,Y=Math.min(ee.length-N,2);V>>8*($?V:1-V)}function K(ee,k,N,$){k<0&&(k=4294967295+k+1);for(var V=0,Y=Math.min(ee.length-N,4);V>>8*($?V:3-V)&255}function q(ee,k,N,$,V,Y){if(N+$>ee.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function ie(ee,k,N,$,V){return V||q(ee,k,N,4,34028234663852886e22,-34028234663852886e22),ce.write(ee,k,N,$,23,4),N+4}function oe(ee,k,N,$,V){return V||q(ee,k,N,8,17976931348623157e292,-17976931348623157e292),ce.write(ee,k,N,$,52,8),N+8}function ye(ee){if(ee=pe(ee).replace(Xe,""),ee.length<2)return"";for(;ee.length%4!=0;)ee+="=";return ee}function pe(ee){return ee.trim?ee.trim():ee.replace(/^\s+|\s+$/g,"")}function we(ee){return ee<16?"0"+ee.toString(16):ee.toString(16)}function fe(ee,k){k=k||1/0;for(var N,$=ee.length,V=null,Y=[],me=0;me<$;++me){if((N=ee.charCodeAt(me))>55295&&N<57344){if(!V){if(N>56319){(k-=3)>-1&&Y.push(239,191,189);continue}if(me+1===$){(k-=3)>-1&&Y.push(239,191,189);continue}V=N;continue}if(N<56320){(k-=3)>-1&&Y.push(239,191,189),V=N;continue}N=65536+(V-55296<<10|N-56320)}else V&&(k-=3)>-1&&Y.push(239,191,189);if(V=null,N<128){if((k-=1)<0)break;Y.push(N)}else if(N<2048){if((k-=2)<0)break;Y.push(N>>6|192,63&N|128)}else if(N<65536){if((k-=3)<0)break;Y.push(N>>12|224,N>>6&63|128,63&N|128)}else{if(!(N<1114112))throw new Error("Invalid code point");if((k-=4)<0)break;Y.push(N>>18|240,N>>12&63|128,N>>6&63|128,63&N|128)}}return Y}function Te(ee){for(var k=[],N=0;N>8,V=N%256,Y.push(V),Y.push($);return Y}function De(ee){return ve.toByteArray(ye(ee))}function Me(ee,k,N,$){for(var V=0;V<$&&!(V+N>=k.length||V>=ee.length);++V)k[V+N]=ee[V];return V}function Ue(ee){return ee!==ee}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */var ve=P(21),ce=P(22),Ie=P(23);w.Buffer=h,w.SlowBuffer=t,w.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=S.TYPED_ARRAY_SUPPORT!==void 0?S.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}}(),w.kMaxLength=C(),h.poolSize=8192,h._augment=function(ee){return ee.__proto__=h.prototype,ee},h.from=function(ee,k,N){return p(null,ee,k,N)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(ee,k,N){return l(null,ee,k,N)},h.allocUnsafe=function(ee){return a(null,ee)},h.allocUnsafeSlow=function(ee){return a(null,ee)},h.isBuffer=function(ee){return!(ee==null||!ee._isBuffer)},h.compare=function(ee,k){if(!h.isBuffer(ee)||!h.isBuffer(k))throw new TypeError("Arguments must be Buffers");if(ee===k)return 0;for(var N=ee.length,$=k.length,V=0,Y=Math.min(N,$);V0&&(ee=this.toString("hex",0,k).match(/.{2}/g).join(" "),this.length>k&&(ee+=" ... ")),""},h.prototype.compare=function(ee,k,N,$,V){if(!h.isBuffer(ee))throw new TypeError("Argument must be a Buffer");if(k===void 0&&(k=0),N===void 0&&(N=ee?ee.length:0),$===void 0&&($=0),V===void 0&&(V=this.length),k<0||N>ee.length||$<0||V>this.length)throw new RangeError("out of range index");if($>=V&&k>=N)return 0;if($>=V)return-1;if(k>=N)return 1;if(k>>>=0,N>>>=0,$>>>=0,V>>>=0,this===ee)return 0;for(var Y=V-$,me=N-k,Ae=Math.min(Y,me),at=this.slice($,V),Le=ee.slice(k,N),ke=0;keV)&&(N=V),ee.length>0&&(N<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");for(var Y=!1;;)switch($){case"hex":return m(this,ee,k,N);case"utf8":case"utf-8":return g(this,ee,k,N);case"ascii":return E(this,ee,k,N);case"latin1":case"binary":return o(this,ee,k,N);case"base64":return x(this,ee,k,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,ee,k,N);default:if(Y)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),Y=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ne=4096;h.prototype.slice=function(ee,k){var N=this.length;ee=~~ee,k=k===void 0?N:~~k,ee<0?(ee+=N)<0&&(ee=0):ee>N&&(ee=N),k<0?(k+=N)<0&&(k=0):k>N&&(k=N),k0&&(V*=256);)$+=this[ee+--k]*V;return $},h.prototype.readUInt8=function(ee,k){return k||G(ee,1,this.length),this[ee]},h.prototype.readUInt16LE=function(ee,k){return k||G(ee,2,this.length),this[ee]|this[ee+1]<<8},h.prototype.readUInt16BE=function(ee,k){return k||G(ee,2,this.length),this[ee]<<8|this[ee+1]},h.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]},h.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])},h.prototype.readIntLE=function(ee,k,N){ee|=0,k|=0,N||G(ee,k,this.length);for(var $=this[ee],V=1,Y=0;++Y=V&&($-=Math.pow(2,8*k)),$},h.prototype.readIntBE=function(ee,k,N){ee|=0,k|=0,N||G(ee,k,this.length);for(var $=k,V=1,Y=this[ee+--$];$>0&&(V*=256);)Y+=this[ee+--$]*V;return V*=128,Y>=V&&(Y-=Math.pow(2,8*k)),Y},h.prototype.readInt8=function(ee,k){return k||G(ee,1,this.length),128&this[ee]?-1*(255-this[ee]+1):this[ee]},h.prototype.readInt16LE=function(ee,k){k||G(ee,2,this.length);var N=this[ee]|this[ee+1]<<8;return 32768&N?4294901760|N:N},h.prototype.readInt16BE=function(ee,k){k||G(ee,2,this.length);var N=this[ee+1]|this[ee]<<8;return 32768&N?4294901760|N:N},h.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},h.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]},h.prototype.readFloatLE=function(ee,k){return k||G(ee,4,this.length),ce.read(this,ee,!0,23,4)},h.prototype.readFloatBE=function(ee,k){return k||G(ee,4,this.length),ce.read(this,ee,!1,23,4)},h.prototype.readDoubleLE=function(ee,k){return k||G(ee,8,this.length),ce.read(this,ee,!0,52,8)},h.prototype.readDoubleBE=function(ee,k){return k||G(ee,8,this.length),ce.read(this,ee,!1,52,8)},h.prototype.writeUIntLE=function(ee,k,N,$){(ee=+ee,k|=0,N|=0,!$)&&X(this,ee,k,N,Math.pow(2,8*N)-1,0);var V=1,Y=0;for(this[k]=255ⅇ++Y=0&&(Y*=256);)this[k+V]=ee/Y&255;return k+N},h.prototype.writeUInt8=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,1,255,0),h.TYPED_ARRAY_SUPPORT||(ee=Math.floor(ee)),this[k]=255&ee,k+1},h.prototype.writeUInt16LE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8):Z(this,ee,k,!0),k+2},h.prototype.writeUInt16BE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>8,this[k+1]=255&ee):Z(this,ee,k,!1),k+2},h.prototype.writeUInt32LE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[k+3]=ee>>>24,this[k+2]=ee>>>16,this[k+1]=ee>>>8,this[k]=255&ee):K(this,ee,k,!0),k+4},h.prototype.writeUInt32BE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>24,this[k+1]=ee>>>16,this[k+2]=ee>>>8,this[k+3]=255&ee):K(this,ee,k,!1),k+4},h.prototype.writeIntLE=function(ee,k,N,$){if(ee=+ee,k|=0,!$){var V=Math.pow(2,8*N-1);X(this,ee,k,N,V-1,-V)}var Y=0,me=1,Ae=0;for(this[k]=255ⅇ++Y>0)-Ae&255;return k+N},h.prototype.writeIntBE=function(ee,k,N,$){if(ee=+ee,k|=0,!$){var V=Math.pow(2,8*N-1);X(this,ee,k,N,V-1,-V)}var Y=N-1,me=1,Ae=0;for(this[k+Y]=255ⅇ--Y>=0&&(me*=256);)ee<0&&Ae===0&&this[k+Y+1]!==0&&(Ae=1),this[k+Y]=(ee/me>>0)-Ae&255;return k+N},h.prototype.writeInt8=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,1,127,-128),h.TYPED_ARRAY_SUPPORT||(ee=Math.floor(ee)),ee<0&&(ee=255+ee+1),this[k]=255&ee,k+1},h.prototype.writeInt16LE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8):Z(this,ee,k,!0),k+2},h.prototype.writeInt16BE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>8,this[k+1]=255&ee):Z(this,ee,k,!1),k+2},h.prototype.writeInt32LE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[k]=255&ee,this[k+1]=ee>>>8,this[k+2]=ee>>>16,this[k+3]=ee>>>24):K(this,ee,k,!0),k+4},h.prototype.writeInt32BE=function(ee,k,N){return ee=+ee,k|=0,N||X(this,ee,k,4,2147483647,-2147483648),ee<0&&(ee=4294967295+ee+1),h.TYPED_ARRAY_SUPPORT?(this[k]=ee>>>24,this[k+1]=ee>>>16,this[k+2]=ee>>>8,this[k+3]=255&ee):K(this,ee,k,!1),k+4},h.prototype.writeFloatLE=function(ee,k,N){return ie(this,ee,k,!0,N)},h.prototype.writeFloatBE=function(ee,k,N){return ie(this,ee,k,!1,N)},h.prototype.writeDoubleLE=function(ee,k,N){return oe(this,ee,k,!0,N)},h.prototype.writeDoubleBE=function(ee,k,N){return oe(this,ee,k,!1,N)},h.prototype.copy=function(ee,k,N,$){if(N||(N=0),$||$===0||($=this.length),k>=ee.length&&(k=ee.length),k||(k=0),$>0&&$=this.length)throw new RangeError("sourceStart out of bounds");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),ee.length-k<$-N&&($=ee.length-k+N);var V,Y=$-N;if(this===ee&&N=0;--V)ee[V+k]=this[V+N];else if(Y<1e3||!h.TYPED_ARRAY_SUPPORT)for(V=0;V>>=0,N=N===void 0?this.length:N>>>0,ee||(ee=0);var Y;if(typeof ee=="number")for(Y=k;Y0)throw new Error("Invalid string. Length must be a multiple of 4");return n[t-2]==="="?2:n[t-1]==="="?1:0}function C(n){return 3*n.length/4-S(n)}function T(n){var t,d,v,b,y,_=n.length;b=S(n),y=new c(3*_/4-b),d=b>0?_-4:_;var m=0;for(t=0;t>16&255,y[m++]=v>>8&255,y[m++]=255&v;return b===2?(v=a[n.charCodeAt(t)]<<2|a[n.charCodeAt(t+1)]>>4,y[m++]=255&v):b===1&&(v=a[n.charCodeAt(t)]<<10|a[n.charCodeAt(t+1)]<<4|a[n.charCodeAt(t+2)]>>2,y[m++]=v>>8&255,y[m++]=255&v),y}function h(n){return l[n>>18&63]+l[n>>12&63]+l[n>>6&63]+l[63&n]}function p(n,t,d){for(var v,b=[],y=t;ym?m:_+16383));return v===1?(t=n[d-1],b+=l[t>>2],b+=l[t<<4&63],b+="=="):v===2&&(t=(n[d-2]<<8)+n[d-1],b+=l[t>>10],b+=l[t>>4&63],b+=l[t<<2&63],b+="="),y.push(b),y.join("")}w.byteLength=C,w.toByteArray=T,w.fromByteArray=f;for(var l=[],a=[],c=typeof Uint8Array!="undefined"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,i=s.length;u>1,s=-7,u=C?h-1:0,i=C?-1:1,n=P[S+u];for(u+=i,p=n&(1<<-s)-1,n>>=-s,s+=l;s>0;p=256*p+P[S+u],u+=i,s-=8);for(f=p&(1<<-s)-1,p>>=-s,s+=T;s>0;f=256*f+P[S+u],u+=i,s-=8);if(p===0)p=1-c;else{if(p===a)return f?NaN:1/0*(n?-1:1);f+=Math.pow(2,T),p-=c}return(n?-1:1)*f*Math.pow(2,p-T)},w.write=function(P,S,C,T,h,p){var f,l,a,c=8*p-h-1,s=(1<>1,i=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,n=T?0:p-1,t=T?1:-1,d=S<0||S===0&&1/S<0?1:0;for(S=Math.abs(S),isNaN(S)||S===1/0?(l=isNaN(S)?1:0,f=s):(f=Math.floor(Math.log(S)/Math.LN2),S*(a=Math.pow(2,-f))<1&&(f--,a*=2),S+=f+u>=1?i/a:i*Math.pow(2,1-u),S*a>=2&&(f++,a/=2),f+u>=s?(l=0,f=s):f+u>=1?(l=(S*a-1)*Math.pow(2,h),f+=u):(l=S*Math.pow(2,u-1)*Math.pow(2,h),f=0));h>=8;P[C+n]=255&l,n+=t,l/=256,h-=8);for(f=f<0;P[C+n]=255&f,n+=t,f/=256,c-=8);P[C+n-t]|=128*d}},function(U,w){var P={}.toString;U.exports=Array.isArray||function(S){return P.call(S)=="[object Array]"}},function(U,w,P){"use strict";function S(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function h(p,f){for(var l=0;l>>31}var _=(i<<5|i>>>27)+v+l[b];_+=b<20?1518500249+(n&t|~n&d):b<40?1859775393+(n^t^d):b<60?(n&t|n&d|t&d)-1894007588:(n^t^d)-899497514,v=d,d=t,t=n<<30|n>>>2,n=i,i=_}u[0]=u[0]+i|0,u[1]=u[1]+n|0,u[2]=u[2]+t|0,u[3]=u[3]+d|0,u[4]=u[4]+v|0},_doFinalize:function(){var c=this._data,s=c.words,u=8*this._nDataBytes,i=8*c.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=Math.floor(u/4294967296),s[15+(i+64>>>9<<4)]=u,c.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var c=p.clone.call(this);return c._hash=this._hash.clone(),c}});C.SHA1=p._createHelper(a),C.HmacSHA1=p._createHmacHelper(a)}(),S.SHA1})},function(U,w,P){!function(S,C){U.exports=w=C(P(0))}(0,function(S){!function(){var C=S,T=C.lib,h=T.Base,p=C.enc,f=p.Utf8,l=C.algo;l.HMAC=h.extend({init:function(a,c){a=this._hasher=new a.init,typeof c=="string"&&(c=f.parse(c));var s=a.blockSize,u=4*s;c.sigBytes>u&&(c=a.finalize(c)),c.clamp();for(var i=this._oKey=c.clone(),n=this._iKey=c.clone(),t=i.words,d=n.words,v=0;v>>6-i%4*2;s[u>>>2]|=(n|t)<<24-u%4*8,u++}return p.create(s,u)}var T=S,h=T.lib,p=h.WordArray,f=T.enc;f.Base64={stringify:function(l){var a=l.words,c=l.sigBytes,s=this._map;l.clamp();for(var u=[],i=0;i>>2]>>>24-i%4*8&255,t=a[i+1>>>2]>>>24-(i+1)%4*8&255,d=a[i+2>>>2]>>>24-(i+2)%4*8&255,v=n<<16|t<<8|d,b=0;b<4&&i+.75*b>>6*(3-b)&63));var y=s.charAt(64);if(y)for(;u.length%4;)u.push(y);return u.join("")},parse:function(l){var a=l.length,c=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var u=0;u0&&(G=j.UploadProgress.UploadProgressList[0],X=G.ClientId),c.default.setClientId(X),E&&E(G)},function(j){j&&(o(j),console.log(j))})}}]),m}();w.default=_},function(U,w,P){"use strict";function S(f,l){if(!(f instanceof l))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(w,"__esModule",{value:!0});var C=function(){function f(l,a){for(var c=0;c=U.length?{done:!0}:{done:!1,value:U[S++]}},e:function(l){throw l},f:C}}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 T=!0,h=!1,p;return{s:function(){P=U[Symbol.iterator]()},n:function(){var l=P.next();return T=l.done,l},e:function(l){h=!0,p=l},f:function(){try{!T&&P.return!=null&&P.return()}finally{if(h)throw p}}}}},rHrb:function(Je,Ke,B){"use strict";Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.CopyToClipboard=void 0;var ae=U(B("cDcd")),Q=U(B("+QRC"));function U(t){return t&&t.__esModule?t:{default:t}}function w(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(v){return typeof v}:w=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},w(t)}function P(t,d){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(t);d&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(t,y).enumerable})),v.push.apply(v,b)}return v}function S(t){for(var d=1;d=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,b))continue;v[b]=t[b]}}return v}function T(t,d){if(t==null)return{};var v={},b=Object.keys(t),y,_;for(_=0;_=0)continue;v[y]=t[y]}return v}function h(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}function p(t,d){for(var v=0;v"']/,ae=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,w={"&":"&","<":"<",">":">",'"':""","'":"'"},P=m=>w[m];function S(m,g){if(g){if(B.test(m))return m.replace(ae,P)}else if(Q.test(m))return m.replace(U,P);return m}const C=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function T(m){return m.replace(C,(g,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const h=/(^|[^\[])\^/g;function p(m,g){m=m.source||m,g=g||"";const E={replace:(o,x)=>(x=x.source||x,x=x.replace(h,"$1"),m=m.replace(o,x),E),getRegex:()=>new RegExp(m,g)};return E}const f=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function a(m,g,E){if(m){let o;try{o=decodeURIComponent(T(E)).replace(f,"").toLowerCase()}catch(x){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}g&&!l.test(E)&&(E=n(g,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(o){return null}return E}const c={},s=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(m,g){c[" "+m]||(s.test(m)?c[" "+m]=m+"/":c[" "+m]=b(m,"/",!0)),m=c[" "+m];const E=m.indexOf(":")===-1;return g.substring(0,2)==="//"?E?g:m.replace(u,"$1")+g:g.charAt(0)==="/"?E?g:m.replace(i,"$1")+g:m+g}const t={exec:function(){}};function d(m){let g=1,E,o;for(;g{let I=!1,F=O;for(;--F>=0&&D[F]==="\\";)I=!I;return I?"|":" |"}),o=E.split(/ \|/);let x=0;if(o.length>g)o.splice(g);else for(;o.length=0;p--){var f=U().key(p);h(w(f),f)}}function C(h){return U().removeItem(h)}function T(){return U().clear()}},"s8/Y":function(Je,Ke,B){Je.exports=B.p+"static/jx.6713fc81.svg"},"sB/4":function(Je,Ke,B){Je.exports=B.p+"static/b.7405990c.svg"},sNtx:function(Je,Ke,B){},sR1s:function(Je,Ke,B){"use strict";B.d(Ke,"b",function(){return w}),B.d(Ke,"a",function(){return P}),B.d(Ke,"c",function(){return S}),B.d(Ke,"d",function(){return C});var ae=B("U8pU"),Q="RC_TABLE_KEY";function U(T){return T==null?[]:Array.isArray(T)?T:[T]}function w(T,h){if(!h&&typeof h!="number")return T;for(var p=U(h),f=T,l=0;l1)Object(p.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(p.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=d[0];if(S.isValidElement(v)&&Object(f.c)(v)){var b=v.ref;d[0]=S.cloneElement(v,{ref:Object(f.a)(b,this.setChildNode)})}return d.length===1?d[0]:d.map(function(y,_){return!S.isValidElement(y)||"key"in y&&y.key!==null?y:S.cloneElement(y,{key:"".concat(a,"-").concat(_)})})}}]),i}(S.Component);c.displayName="ResizeObserver",Ke.a=c},twBr:function(Je,Ke,B){Je.exports=B.p+"static/s.1f286590.svg"},uMZB:function(Je,Ke,B){Je.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(Je,Ke,B){Je.exports=ae;function ae(){return B("gaXo"),{}}},ulZh:function(Je,Ke,B){typeof window!="undefined"&&function(Q,U){Je.exports=U()}(this,function(){return function(ae){var Q={};function U(w){if(Q[w])return Q[w].exports;var P=Q[w]={i:w,l:!1,exports:{}};return ae[w].call(P.exports,P,P.exports,U),P.l=!0,P.exports}return U.m=ae,U.c=Q,U.d=function(w,P,S){U.o(w,P)||Object.defineProperty(w,P,{enumerable:!0,get:S})},U.r=function(w){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},U.t=function(w,P){if(P&1&&(w=U(w)),P&8)return w;if(P&4&&typeof w=="object"&&w&&w.__esModule)return w;var S=Object.create(null);if(U.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:w}),P&2&&typeof w!="string")for(var C in w)U.d(S,C,function(T){return w[T]}.bind(null,C));return S},U.n=function(w){var P=w&&w.__esModule?function(){return w.default}:function(){return w};return U.d(P,"a",P),P},U.o=function(w,P){return Object.prototype.hasOwnProperty.call(w,P)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ae,Q,U){"use strict";var w=Object.prototype.hasOwnProperty,P="~";function S(){}Object.create&&(S.prototype=Object.create(null),new S().__proto__||(P=!1));function C(f,l,a){this.fn=f,this.context=l,this.once=a||!1}function T(f,l,a,c,s){if(typeof a!="function")throw new TypeError("The listener must be a function");var u=new C(a,c||f,s),i=P?P+l:l;return f._events[i]?f._events[i].fn?f._events[i]=[f._events[i],u]:f._events[i].push(u):(f._events[i]=u,f._eventsCount++),f}function h(f,l){--f._eventsCount===0?f._events=new S:delete f._events[l]}function p(){this._events=new S,this._eventsCount=0}p.prototype.eventNames=function(){var l=[],a,c;if(this._eventsCount===0)return l;for(c in a=this._events)w.call(a,c)&&l.push(P?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},p.prototype.listeners=function(l){var a=P?P+l:l,c=this._events[a];if(!c)return[];if(c.fn)return[c.fn];for(var s=0,u=c.length,i=new Array(u);s0},!1)}function f(l,a){for(var c={main:[a]},s={main:[]},u={main:{}};p(c);)for(var i=Object.keys(c),n=0;n=2*_/g||D<=F)return;var z=Number.POSITIVE_INFINITY,ne;for(ne=i.level-1;ne>o;ne--){var j=E[ne].maxBitrate;if(z=_*j/(8*.8*O),z=D)return;var G=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+i.sn+(n?" part "+n.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+ne+` Current BW estimate: `+(Object(w.isFiniteNumber)(G)?(G/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+D.toFixed(3)+` s Estimated load time for the next fragment: `+z.toFixed(3)+` s Time to underbuffer: `+F.toFixed(3)+" s"),t.nextLoadLevel=ne,this.bwEstimator.sample(m,y.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),t.trigger(S.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:y})},s.onFragLoaded=function(i,n){var t=n.frag,d=n.part;if(t.type===h.PlaylistLevelType.MAIN&&Object(w.isFiniteNumber)(t.sn)){var v=d?d.stats:t.stats,b=d?d.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var y=this.hls.levels[t.level],_=(y.loaded?y.loaded.bytes:0)+v.loaded,m=(y.loaded?y.loaded.duration:0)+b;y.loaded={bytes:_,duration:m},y.realBitrate=Math.round(8*_/m)}if(t.bitrateTest){var g={stats:v,frag:t,part:d,id:t.type};this.onFragBuffered(S.Events.FRAG_BUFFERED,g),t.bitrateTest=!1}}},s.onFragBuffered=function(i,n){var t=n.frag,d=n.part,v=d?d.stats:t.stats;if(v.aborted)return;if(t.type!==h.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var b=v.parsing.end-v.loading.start;this.bwEstimator.sample(b,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=b/1e3:this.bitrateTestDelay=0},s.onError=function(i,n){switch(n.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,n=this.partCurrent,t=this.hls,d=t.maxAutoLevel,v=t.config,b=t.minAutoLevel,y=t.media,_=n?n.duration:i?i.duration:0,m=y?y.currentTime:0,g=y&&y.playbackRate!==0?Math.abs(y.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,o=(C.BufferHelper.bufferInfo(y,m,v.maxBufferHole).end-m)/g,x=this.findBestLevel(E,b,d,o,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(x>=0)return x;p.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var A=_?Math.min(_,v.maxStarvationDelay):v.maxStarvationDelay,O=v.abrBandWidthFactor,D=v.abrBandWidthUpFactor;if(!o){var I=this.bitrateTestDelay;if(I){var F=_?Math.min(_,v.maxLoadingDelay):v.maxLoadingDelay;A=F-I,p.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*A)+" ms"),O=D=1}}return x=this.findBestLevel(E,b,d,o+A,O,D),Math.max(x,0)},s.findBestLevel=function(i,n,t,d,v,b){for(var y,_=this.fragCurrent,m=this.partCurrent,g=this.lastLoadedFragLevel,E=this.hls.levels,o=E[g],x=!!(o!=null&&(y=o.details)!==null&&y!==void 0&&y.live),A=o==null?void 0:o.codecSet,O=m?m.duration:_?_.duration:0,D=t;D>=n;D--){var I=E[D];if(!I||A&&I.codecSet!==A)continue;var F=I.details,z=(m?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||O,ne=void 0;D<=g?ne=v*i:ne=b*i;var j=E[D].maxBitrate,G=j*z/ne;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(ne)+"/"+j+"/"+z+"/"+d+"/"+G),ne>j&&(!G||x&&!this.bitrateTestDelay||G0&&o===-1?(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()},g.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var o,x=this.levels,A=this.trackId,O=x==null||((o=x[A])===null||o===void 0)?void 0:o.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var D,I=performance.now(),F=this.retryDate;(!F||I>=F||(D=this.media)!==null&&D!==void 0&&D.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var z=this.waitingData;if(z){var ne=z.frag,j=z.part,G=z.cache,X=z.complete;if(this.initPTS[ne.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var Z=G.flush(),K={frag:ne,part:j,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(K),X&&_.prototype._handleFragmentLoadComplete.call(this,K)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+ne.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var q=this.getLoadPosition(),ie=C.BufferHelper.bufferInfo(this.mediaBuffer,q,this.config.maxBufferHole),oe=Object(s.fragmentWithinToleranceTest)(ie.end,this.config.maxFragLookUpTolerance,ne);oe<0&&(n.logger.log("Waiting fragment cc ("+ne.cc+") @ "+ne.start+" cancelled because another fragment at "+ie.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var o=this.waitingData;o&&(this.fragmentTracker.removeFragment(o.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},g.onTickEnd=function(){var o=this.media;if(!o||!o.readyState)return;var x=this.mediaBuffer?this.mediaBuffer:o,A=x.buffered;!this.loadedmetadata&&A.length&&(this.loadedmetadata=!0),this.lastCurrentTime=o.currentTime},g.doTickIdle=function(){var o,x,A=this.hls,O=this.levels,D=this.media,I=this.trackId,F=A.config;if(!O||!O[I])return;if(!D&&(this.startFragRequested||!F.startFragPrefetch))return;var z=O[I],ne=z.details;if(!ne||ne.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(ne)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,f.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(j===null)return;var G=j.len,X=this.getMaxBufferLength(),Z=this.audioSwitch;if(G>=X&&!Z)return;if(!Z&&this._streamEnded(j,ne)){A.trigger(S.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var K=ne.fragments,q=K[0].start,ie=j.end;if(Z){var oe=this.getLoadPosition();ie=oe,ne.PTSKnown&&oeq||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),D.currentTime=q+.05))}var ye=this.getNextFragment(ie,ne);if(!ye){this.bufferFlushed=!0;return}((o=ye.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((x=ye.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ye,ne):this.loadFragment(ye,ne,ie)},g.getMaxBufferLength=function(){var o=_.prototype.getMaxBufferLength.call(this),x=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return x===null?o:Math.max(o,x.len)},g.onMediaDetaching=function(){this.videoBuffer=null,_.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(o,x){var A=x.audioTracks;this.resetTransmuxer(),this.levels=A.map(function(O){return new h.Level(O)})},g.onAudioTrackSwitching=function(o,x){var A=!!x.url;this.trackId=x.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),A?this.setInterval(b):this.resetTransmuxer(),A?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(o,x){this.mainDetails=x.details},g.onAudioTrackLoaded=function(o,x){var A,O=this.levels,D=x.details,I=x.id;if(!O){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+D.startSN+","+D.endSN+"],duration:"+D.totalduration);var F=O[I],z=0;if(D.live||(A=F.details)!==null&&A!==void 0&&A.live){var ne=this.mainDetails;if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed||!ne)return;!F.details&&D.hasProgramDateTime&&ne.hasProgramDateTime?(Object(u.alignMediaPlaylistByPDT)(D,ne),z=D.fragments[0].start):z=this.alignPlaylists(D,F.details)}F.details=D,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!D.live)&&this.setStartPosition(F.details,z),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(D)&&(this.state=P.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(o){var x,A=o.frag,O=o.part,D=o.payload,I=this.config,F=this.trackId,z=this.levels;if(!z){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+A.sn+" of level "+A.level+" will not be buffered");return}var ne=z[F];console.assert(ne,"Audio track is defined on fragment load progress");var j=ne.details;console.assert(j,"Audio track details are defined on fragment load progress");var G=I.defaultAudioCodec||ne.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new a.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[A.cc],K=(x=A.initSegment)===null||x===void 0?void 0:x.data;if(Z!==void 0){var q=!1,ie=O?O.index:-1,oe=ie!==-1,ye=new c.ChunkMetadata(A.level,A.sn,A.stats.chunkCount,D.byteLength,ie,oe);X.push(D,K,G,"",A,O,j.totalduration,q,ye,Z)}else{n.logger.log("Unknown video PTS for cc "+A.cc+", waiting for video PTS before demuxing audio frag "+A.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+F);var pe=this.waitingData=this.waitingData||{frag:A,part:O,cache:new l.default,complete:!1},we=pe.cache;we.push(new Uint8Array(D)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(o){if(this.waitingData){this.waitingData.complete=!0;return}_.prototype._handleFragmentLoadComplete.call(this,o)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(o,x){var A=x.tracks.audio;A&&(this.mediaBuffer=A.buffer),x.tracks.video&&(this.videoBuffer=x.tracks.video.buffer)},g.onFragBuffered=function(o,x){var A=x.frag,O=x.part;if(A.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(A)){this.warn("Fragment "+A.sn+(O?" p: "+O.index:"")+" of level "+A.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}A.sn!=="initSegment"&&(this.fragPrevious=A,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(A,O)},g.onError=function(o,x){switch(x.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,x);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=x.fatal?P.State.ERROR:P.State.IDLE,this.warn(x.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var A=!0,O=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);O&&O.len>.5&&(A=!this.reduceMaxBufferLength(O.len)),A&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,_.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},g.onBufferFlushed=function(o,x){var A=x.type;A===f.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(o){var x,A="audio",O=this.hls,D=o.remuxResult,I=o.chunkMeta,F=this.getCurrentContext(I);if(!F){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 z=F.frag,ne=F.part,j=D.audio,G=D.text,X=D.id3,Z=D.initSegment;if(this.fragContextChanged(z))return;if(this.state=P.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,z,I),O.trigger(S.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:A,tracks:Z.tracks})),j){var K=j.startPTS,q=j.endPTS,ie=j.startDTS,oe=j.endDTS;ne&&(ne.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:K,endPTS:q,startDTS:ie,endDTS:oe}),z.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,K,q,ie,oe),this.bufferFragmentData(j,z,ne,I)}if(X!=null&&(x=X.samples)!==null&&x!==void 0&&x.length){var ye=t({frag:z,id:A},X);O.trigger(S.Events.FRAG_PARSING_METADATA,ye)}if(G){var pe=t({frag:z,id:A},G);O.trigger(S.Events.FRAG_PARSING_USERDATA,pe)}},g._bufferInitSegment=function(o,x,A){if(this.state!==P.State.PARSING)return;o.video&&delete o.video;var O=o.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(S.Events.BUFFER_CODECS,o);var D=O.initSegment;if(D!=null&&D.byteLength){var I={type:"audio",frag:x,part:null,chunkMeta:A,parent:x.type,data:D};this.hls.trigger(S.Events.BUFFER_APPENDING,I)}this.tick()},g.loadFragment=function(o,x,A){var O=this.fragmentTracker.getState(o);this.fragCurrent=o,(this.audioSwitch||O===T.FragmentState.NOT_LOADED||O===T.FragmentState.PARTIAL)&&(o.sn==="initSegment"?this._loadInitSegment(o):x.live&&!Object(w.isFiniteNumber)(this.initPTS[o.cc])?(this.log("Waiting for video PTS in continuity counter "+o.cc+" of live stream before loading audio fragment "+o.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,_.prototype.loadFragment.call(this,o,x,A)))},g.completeAudioSwitch=function(){var o=this.hls,x=this.media,A=this.trackId;x&&(this.log("Switching audio track : flushing all audio"),_.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,o.trigger(S.Events.AUDIO_TRACK_SWITCHED,{id:A})},m}(P.default);Q.default=y},"./src/controller/audio-track-controller.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/events.ts"),P=U("./src/errors.ts"),S=U("./src/controller/base-playlist-controller.ts"),C=U("./src/types/loader.ts");function T(a,c){for(var s=0;s=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=n[this.trackId];this.log("Now switching to audio-track index "+i);var d=n[i],v=d.id,b=d.groupId,y=b===void 0?"":b,_=d.name,m=d.type,g=d.url;if(this.trackId=i,this.trackName=_,this.selectDefaultTrack=!1,this.hls.trigger(w.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:y,name:_,type:m,url:g}),d.details&&!d.details.live)return;var E=this.switchParams(d.url,t==null?void 0:t.details);this.loadPlaylist(E)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,t=this.findTrackId(n)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var n=this.tracksInGroup,t=0;tc.partTarget&&(d+=1)}if(Object(w.isFiniteNumber)(t))return new P.HlsUrlParameters(t,Object(w.isFiniteNumber)(d)?d:void 0,P.HlsSkip.No)}}},f.loadPlaylist=function(a){},f.shouldLoadTrack=function(a){return this.canLoad&&a&&!!a.url&&(!a.details||a.details.live)},f.playlistLoaded=function(a,c,s){var u=this,i=c.details,n=c.stats,t=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(i.advancedDateTime=Date.now()-t,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+a+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(S.mergeDetails)(s,i),!this.canLoad||!i.live)return;var d,v=void 0,b=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var y=this.hls.config.lowLatencyMode,_=i.lastPartSn,m=i.endSN,g=i.lastPartIndex,E=g!==-1,o=_===m,x=y?0:g;E?(v=o?m+1:_,b=o?x:g+1):v=m+1;var A=i.age,O=A+i.ageHeader,D=Math.min(O-i.partTarget,i.targetduration*1.5);if(D>0){if(s&&D>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+D+" with playlist age: "+i.age),D=0;else{var I=Math.floor(D/i.targetduration);if(v+=I,b!==void 0){var F=Math.round(D%i.targetduration/i.partTarget);b+=F}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+D+" skip sn "+I+" to part "+b)}i.tuneInGoal=D}if(d=this.getDeliveryDirectives(i,c.deliveryDirectives,v,b),y||!o){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(i,c.deliveryDirectives,v,b);var z=Object(S.computeReloadInterval)(i,n);v!==void 0&&i.canBlockReload&&(z-=i.partTarget||1),this.log("reload live playlist "+a+" in "+Math.round(z)+" ms"),this.timer=self.setTimeout(function(){return u.loadPlaylist(d)},z)}else this.clearTimer()},f.getDeliveryDirectives=function(a,c,s,u){var i=Object(P.getSkipValue)(a,s);return c!=null&&c.skip&&a.deltaUpdateFailed&&(s=c.msn,u=c.part,i=P.HlsSkip.No),new P.HlsUrlParameters(s,u,i)},f.retryLoadingOrFail=function(a){var c=this,s=this.hls.config,u=this.retryCount-1&&(i=a.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+a.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+a.details+'"')}}else this.warn('cannot recover from error "'+a.details+'"'),this.clearTimer(),a.fatal=!0;return u},p}()},"./src/controller/base-stream-controller.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"State",function(){return m}),U.d(Q,"default",function(){return g});var w=U("./src/polyfills/number.ts"),P=U("./src/task-loop.ts"),S=U("./src/controller/fragment-tracker.ts"),C=U("./src/utils/buffer-helper.ts"),T=U("./src/utils/logger.ts"),h=U("./src/events.ts"),p=U("./src/errors.ts"),f=U("./src/types/transmuxer.ts"),l=U("./src/utils/mp4-tools.ts"),a=U("./src/utils/discontinuities.ts"),c=U("./src/controller/fragment-finders.ts"),s=U("./src/controller/level-helper.ts"),u=U("./src/loader/fragment-loader.ts"),i=U("./src/crypt/decrypter.ts"),n=U("./src/utils/time-ranges.ts"),t=U("./src/types/loader.ts");function d(E,o){for(var x=0;xZ;(ne0&&ne&&ne.key&&ne.iv&&ne.method==="AES-128"){var j=self.performance.now();return D.decrypter.webCryptoDecrypt(new Uint8Array(z),ne.key.buffer,ne.iv.buffer).then(function(G){var X=self.performance.now();return F.trigger(h.Events.FRAG_DECRYPTED,{frag:O,payload:G,stats:{tstart:j,tdecrypt:X}}),I.payload=G,I})}return I}).then(function(I){var F=D.fragCurrent,z=D.hls,ne=D.levels;if(!ne)throw new Error("init load aborted, missing levels");var j=ne[O.level].details;console.assert(j,"Level details are defined when init segment is loaded");var G=O.stats;D.state=m.IDLE,D.fragLoadError=0,O.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===F&&z.trigger(h.Events.FRAG_BUFFERED,{stats:G,frag:F,part:null,id:O.type}),D.tick()}).catch(function(I){D.warn(I),D.resetFragmentLoading(O)})},x.fragContextChanged=function(O){var D=this.fragCurrent;return!O||!D||O.level!==D.level||O.sn!==D.sn||O.urlId!==D.urlId},x.fragBufferedComplete=function(O,D){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(D?" part: "+D.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+n.default.toString(C.BufferHelper.getBuffered(I))),this.state=m.IDLE,this.tick()},x._handleFragmentLoadComplete=function(O){var D=this.transmuxer;if(!D)return;var I=O.frag,F=O.part,z=O.partsLoaded,ne=!z||z.length===0||z.some(function(G){return!G}),j=new f.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,F?F.index:-1,!ne);D.flush(j)},x._handleFragmentLoadProgress=function(O){},x._doFragLoad=function(O,D,I,F){var z=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(O.start,I||0),this.config.lowLatencyMode&&D){var ne=D.partList;if(ne&&F){I>O.end&&D.fragmentHint&&(O=D.fragmentHint);var j=this.getNextPart(ne,O,I);if(j>-1){var G=ne[j];return this.log("Loading part sn: "+O.sn+" p: "+G.index+" cc: "+O.cc+" of playlist ["+D.startSN+"-"+D.endSN+"] parts [0-"+j+"-"+(ne.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=G.start+G.duration,this.state=m.FRAG_LOADING,this.hls.trigger(h.Events.FRAG_LOADING,{frag:O,part:ne[j],targetBufferTime:I}),this.doFragPartsLoad(O,ne,j,F).catch(function(X){return z.handleFragLoadError(X)})}else if(!O.url||this.loadedEndOfParts(ne,I))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(D?"of ["+D.startSN+"-"+D.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(I.toFixed(3))),Object(w.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=m.FRAG_LOADING,this.hls.trigger(h.Events.FRAG_LOADING,{frag:O,targetBufferTime:I}),this.fragmentLoader.load(O,F).catch(function(X){return z.handleFragLoadError(X)})},x.doFragPartsLoad=function(O,D,I,F){var z=this;return new Promise(function(ne,j){var G=[],X=function Z(K){var q=D[K];z.fragmentLoader.loadPart(O,q,F).then(function(ie){G[q.index]=ie;var oe=ie.part;z.hls.trigger(h.Events.FRAG_LOADED,ie);var ye=D[K+1];if(ye&&ye.fragment===O)Z(K+1);else return ne({frag:O,part:oe,partsLoaded:G})}).catch(j)};X(I)})},x.handleFragLoadError=function(O){var D=O.data;return D&&D.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(D.frag,D.part):this.hls.trigger(h.Events.ERROR,D),null},x._handleTransmuxerFlush=function(O){var D=this.getCurrentContext(O);if(!D||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var I=D.frag,F=D.part,z=D.level,ne=self.performance.now();I.stats.parsing.end=ne,F&&(F.stats.parsing.end=ne),this.updateLevelTiming(I,F,z,O.partial)},x.getCurrentContext=function(O){var D=this.levels,I=O.level,F=O.sn,z=O.part;if(!D||!D[I])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+I+". The current chunk will not be buffered."),null;var ne=D[I],j=z>-1?Object(s.getPartWith)(ne,F,z):null,G=j?j.fragment:Object(s.getFragmentWithSN)(ne,F,this.fragCurrent);return G?{frag:G,part:j,level:ne}:null},x.bufferFragmentData=function(O,D,I,F){if(!O||this.state!==m.PARSING)return;var z=O.data1,ne=O.data2,j=z;if(z&&ne&&(j=Object(l.appendUint8Array)(z,ne)),!j||!j.length)return;var G={type:O.type,frag:D,part:I,chunkMeta:F,parent:D.type,data:j};this.hls.trigger(h.Events.BUFFER_APPENDING,G),O.dropped&&O.independent&&!I&&this.flushBufferGap(D)},x.flushBufferGap=function(O){var D=this.media;if(!D)return;if(!C.BufferHelper.isBuffered(D,D.currentTime)){this.flushMainBuffer(0,O.start);return}var I=D.currentTime,F=C.BufferHelper.bufferInfo(D,I,0),z=O.duration,ne=Math.min(this.config.maxFragLookUpTolerance*2,z*.25),j=Math.max(Math.min(O.start-ne,F.end-ne),I+ne);O.start-j>ne&&this.flushMainBuffer(j,O.start)},x.getFwdBufferInfo=function(O,D){var I=this.config,F=this.getLoadPosition();if(!Object(w.isFiniteNumber)(F))return null;var z=C.BufferHelper.bufferInfo(O,F,I.maxBufferHole);if(z.len===0&&z.nextStart!==void 0){var ne=this.fragmentTracker.getBufferedFrag(F,D);if(ne&&z.nextStart=I?(D.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+D.maxMaxBufferLength+"s"),!0):!1},x.getNextFragment=function(O,D){var I,F,z=D.fragments,ne=z.length;if(!ne)return null;var j=this.config,G=z[0].start,X;if(D.live){var Z=j.initialLiveManifestSize;if(ne-1&&II.start&&I.loaded},x.getInitialLiveFragment=function(O,D){var I=this.fragPrevious,F=null;if(I){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),F=Object(c.findFragmentByPDT)(D,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var z=I.sn+1;if(z>=O.startSN&&z<=O.endSN){var ne=D[z-O.startSN];I.cc===ne.cc&&(F=ne,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(c.findFragWithCC)(D,I.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(F=this.getFragmentAtPosition(j,this.bitrateTest?O.fragmentEnd:O.edge,O))}return F},x.getFragmentAtPosition=function(O,D,I){var F=this.config,z=this.fragPrevious,ne=I.fragments,j=I.endSN,G=I.fragmentHint,X=F.maxFragLookUpTolerance,Z=!!(F.lowLatencyMode&&I.partList&&G);Z&&G&&!this.bitrateTest&&(ne=ne.concat(G),j=G.sn);var K;if(OD-X?0:X;K=Object(c.findFragmentByPTS)(z,ne,O,q)}else K=ne[ne.length-1];if(K){var ie=K.sn-I.startSN,oe=z&&K.level===z.level,ye=ne[ie+1],pe=this.fragmentTracker.getState(K);if(pe===S.FragmentState.BACKTRACKED){K=null;for(var we=ie;ne[we]&&this.fragmentTracker.getState(ne[we])===S.FragmentState.BACKTRACKED;)z?K=ne[we--]:K=ne[--we];K||(K=ye)}else z&&K.sn===z.sn&&!Z&&(oe&&(K.sn=ne-D.maxFragLookUpTolerance&&z<=j;if(F!==null&&I.duration>F&&(z"+O.startSN+" prev-sn: "+(z?z.sn:"na")+" fragments: "+j),K}return G},x.waitForCdnTuneIn=function(O){var D=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*D)},x.setStartPosition=function(O,D){var I=this.startPosition;if(I"+O))}}]),o}(P.default)},"./src/controller/buffer-controller.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return c});var w=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),S=U("./src/utils/logger.ts"),C=U("./src/errors.ts"),T=U("./src/utils/buffer-helper.ts"),h=U("./src/utils/mediasource-helper.ts"),p=U("./src/loader/fragment.ts"),f=U("./src/controller/buffer-operation-queue.ts"),l=Object(h.getMediaSource)(),a=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function s(i){var n=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 t=n.hls,d=n.media,v=n.mediaSource;S.logger.log("[buffer-controller]: Media source opened"),d&&(n.updateMediaElementDuration(),t.trigger(P.Events.MEDIA_ATTACHED,{media:d})),v&&v.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){S.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){S.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var u=s.prototype;return u.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},u.destroy=function(){this.unregisterListeners(),this.details=null},u.registerListeners=function(){var n=this.hls;n.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(P.Events.BUFFER_RESET,this.onBufferReset,this),n.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(P.Events.BUFFER_EOS,this.onBufferEos,this),n.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(P.Events.FRAG_PARSED,this.onFragParsed,this),n.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},u.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(P.Events.BUFFER_RESET,this.onBufferReset,this),n.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(P.Events.BUFFER_EOS,this.onBufferEos,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(P.Events.FRAG_PARSED,this.onFragParsed,this),n.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},u._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new f.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},u.onManifestParsed=function(n,t){var d=2;(t.audio&&!t.video||!t.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,S.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(n,t){var d=this.media=t.media;if(d&&l){var v=this.mediaSource=new l;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(v),this._objectUrl=d.src}},u.onMediaDetaching=function(){var n=this.media,t=this.mediaSource,d=this._objectUrl;if(t){if(S.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){S.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(d&&self.URL.revokeObjectURL(d),n.src===d?(n.removeAttribute("src"),n.load()):S.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(P.Events.MEDIA_DETACHED,void 0)},u.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(t){var d=n.sourceBuffer[t];try{d&&(n.removeBufferListeners(t),n.mediaSource&&n.mediaSource.removeSourceBuffer(d),n.sourceBuffer[t]=void 0)}catch(v){S.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},u.onBufferCodecs=function(n,t){var d=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(b){if(v){var y=d.tracks[b];if(y&&typeof y.buffer.changeType=="function"){var _=t[b],m=_.codec,g=_.levelCodec,E=_.container,o=(y.levelCodec||y.codec).replace(a,"$1"),x=(g||m).replace(a,"$1");if(o!==x){var A=E+";codecs="+(g||m);d.appendChangeType(b,A)}}}else d.pendingTracks[b]=t[b]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},u.appendChangeType=function(n,t){var d=this,v=this.operationQueue,b={execute:function(){var _=d.sourceBuffer[n];_&&(S.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+t),_.changeType(t)),v.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(_){S.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",_)}};v.append(b,n)},u.onBufferAppending=function(n,t){var d=this,v=this.hls,b=this.operationQueue,y=this.tracks,_=t.data,m=t.type,g=t.frag,E=t.part,o=t.chunkMeta,x=o.buffering[m],A=self.performance.now();x.start=A;var O=g.stats.buffering,D=E?E.stats.buffering:null;O.start===0&&(O.start=A),D&&D.start===0&&(D.start=A);var I=y.audio,F=m==="audio"&&o.id===1&&(I==null?void 0:I.container)==="audio/mpeg",z={execute:function(){if(x.executeStart=self.performance.now(),F){var j=d.sourceBuffer[m];if(j){var G=g.start-j.timestampOffset;Math.abs(G)>=.1&&(S.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+G+") sn: "+g.sn+")"),j.timestampOffset=g.start)}}d.appendExecutor(_,m)},onStart:function(){},onComplete:function(){var j=self.performance.now();x.executeEnd=x.end=j,O.first===0&&(O.first=j),D&&D.first===0&&(D.first=j);var G=d.sourceBuffer,X={};for(var Z in G)X[Z]=T.BufferHelper.getBuffered(G[Z]);d.appendError=0,d.hls.trigger(P.Events.BUFFER_APPENDED,{type:m,frag:g,part:E,chunkMeta:o,parent:g.type,timeRanges:X})},onError:function(j){S.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",j);var G={type:C.ErrorTypes.MEDIA_ERROR,parent:g.type,details:C.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?G.details=C.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,G.details=C.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>v.config.appendErrorMaxRetry&&(S.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),G.fatal=!0)),v.trigger(P.Events.ERROR,G)}};b.append(z,m)},u.onBufferFlushing=function(n,t){var d=this,v=this.operationQueue,b=function(_){return{execute:d.removeExecutor.bind(d,_,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(P.Events.BUFFER_FLUSHED,{type:_})},onError:function(g){S.logger.warn("[buffer-controller]: Failed to remove from "+_+" SourceBuffer",g)}}};t.type?v.append(b(t.type),t.type):this.getSourceBufferTypes().forEach(function(y){v.append(b(y),y)})},u.onFragParsed=function(n,t){var d=this,v=t.frag,b=t.part,y=[],_=b?b.elementaryStreams:v.elementaryStreams;_[p.ElementaryStreamTypes.AUDIOVIDEO]?y.push("audiovideo"):(_[p.ElementaryStreamTypes.AUDIO]&&y.push("audio"),_[p.ElementaryStreamTypes.VIDEO]&&y.push("video"));var m=function(){var E=self.performance.now();v.stats.buffering.end=E,b&&(b.stats.buffering.end=E);var o=b?b.stats:v.stats;d.hls.trigger(P.Events.FRAG_BUFFERED,{frag:v,part:b,stats:o,id:v.type})};y.length===0&&S.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(m,y)},u.onFragChanged=function(n,t){this.flushBackBuffer()},u.onBufferEos=function(n,t){var d=this,v=this.getSourceBufferTypes().reduce(function(b,y){var _=d.sourceBuffer[y];return(!t.type||t.type===y)&&(_&&!_.ended&&(_.ended=!0,S.logger.log("[buffer-controller]: "+y+" sourceBuffer now EOS"))),b&&!!(!_||_.ended)},!0);v&&this.blockBuffers(function(){var b=d.mediaSource;if(!b||b.readyState!=="open")return;b.endOfStream()})},u.onLevelUpdated=function(n,t){var d=t.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},u.flushBackBuffer=function(){var n=this.hls,t=this.details,d=this.media,v=this.sourceBuffer;if(!d||t===null)return;var b=this.getSourceBufferTypes();if(!b.length)return;var y=t.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(w.isFiniteNumber)(y)||y<0)return;var _=d.currentTime,m=t.levelTargetDuration,g=Math.max(y,m),E=Math.floor(_/m)*m-g;b.forEach(function(o){var x=v[o];if(x){var A=T.BufferHelper.getBuffered(x);A.length>0&&E>A.start(0)&&(n.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),t.live&&n.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),n.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:o}))}})},u.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,t=this.hls,d=this.media,v=this.mediaSource,b=n.fragments[0].start+n.totalduration,y=d.duration,_=Object(w.isFiniteNumber)(v.duration)?v.duration:0;n.live&&t.config.liveDurationInfinity?(S.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(n)):(b>_&&b>y||!Object(w.isFiniteNumber)(y))&&(S.logger.log("[buffer-controller]: Updating Media Source duration to "+b.toFixed(3)),v.duration=b)},u.updateSeekableRange=function(n){var t=this.mediaSource,d=n.fragments,v=d.length;if(v&&n.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var b=Math.max(0,d[0].start),y=Math.max(b,b+n.totalduration);t.setLiveSeekableRange(b,y)}},u.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,t=this.operationQueue,d=this.pendingTracks,v=Object.keys(d).length;if(v&&!n||v===2){this.createSourceBuffers(d),this.pendingTracks={};var b=this.getSourceBufferTypes();if(b.length===0){this.hls.trigger(P.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}b.forEach(function(y){t.executeNext(y)})}},u.createSourceBuffers=function(n){var t=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var b in n)if(!t[b]){var y=n[b];if(!y)throw Error("source buffer exists for track "+b+", however track does not");var _=y.levelCodec||y.codec,m=y.container+";codecs="+_;S.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var g=t[b]=d.addSourceBuffer(m),E=b;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[b]={buffer:g,codec:_,container:y.container,levelCodec:y.levelCodec,id:y.id},v++}catch(o){S.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(P.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:m})}}v&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},u._onSBUpdateStart=function(n){var t=this.operationQueue,d=t.current(n);d.onStart()},u._onSBUpdateEnd=function(n){var t=this.operationQueue,d=t.current(n);d.onComplete(),t.shiftAndExecuteNext(n)},u._onSBUpdateError=function(n,t){S.logger.error("[buffer-controller]: "+n+" SourceBuffer error",t),this.hls.trigger(P.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(n);d&&d.onError(t)},u.removeExecutor=function(n,t,d){var v=this.media,b=this.mediaSource,y=this.operationQueue,_=this.sourceBuffer,m=_[n];if(!v||!b||!m){S.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),y.shiftAndExecuteNext(n);return}var g=Object(w.isFiniteNumber)(v.duration)?v.duration:Infinity,E=Object(w.isFiniteNumber)(b.duration)?b.duration:Infinity,o=Math.max(0,t),x=Math.min(d,g,E);x>o?(S.logger.log("[buffer-controller]: Removing ["+o+","+x+"] from the "+n+" SourceBuffer"),console.assert(!m.updating,n+" sourceBuffer must not be updating"),m.remove(o,x)):y.shiftAndExecuteNext(n)},u.appendExecutor=function(n,t){var d=this.operationQueue,v=this.sourceBuffer,b=v[t];if(!b){S.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(t);return}b.ended=!1,console.assert(!b.updating,t+" sourceBuffer must not be updating"),b.appendBuffer(n)},u.blockBuffers=function(n,t){var d=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){S.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var v=this.operationQueue,b=t.map(function(y){return v.appendBlocker(y)});Promise.all(b).then(function(){n(),t.forEach(function(y){var _=d.sourceBuffer[y];(!_||!_.updating)&&v.shiftAndExecuteNext(y)})})},u.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},u.addBufferListener=function(n,t,d){var v=this.sourceBuffer[n];if(!v)return;var b=d.bind(this,n);this.listeners[n].push({event:t,listener:b}),v.addEventListener(t,b)},u.removeBufferListeners=function(n){var t=this.sourceBuffer[n];if(!t)return;this.listeners[n].forEach(function(d){t.removeEventListener(d.event,d.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return P});var w=U("./src/utils/logger.ts"),P=function(){function S(T){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=T}var C=S.prototype;return C.append=function(h,p){var f=this.queues[p];f.push(h),f.length===1&&this.buffers[p]&&this.executeNext(p)},C.insertAbort=function(h,p){var f=this.queues[p];f.unshift(h),this.executeNext(p)},C.appendBlocker=function(h){var p,f=new Promise(function(a){p=a}),l={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(l,h),f},C.executeNext=function(h){var p=this.buffers,f=this.queues,l=p[h],a=f[h];if(a.length){var c=a[0];try{c.execute()}catch(s){w.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(s),(!l||!l.updating)&&(a.shift(),this.executeNext(h))}}},C.shiftAndExecuteNext=function(h){this.queues[h].shift(),this.executeNext(h)},C.current=function(h){return this.queues[h][0]},S}()},"./src/controller/cap-level-controller.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/events.ts");function P(T,h){for(var p=0;p0&&this.mediaWidth>0){var f=this.hls.levels;if(f.length){var l=this.hls;l.autoLevelCapping=this.getMaxLevel(f.length-1),l.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=l.autoLevelCapping}}},h.getMaxLevel=function(f){var l=this,a=this.hls.levels;if(!a.length)return-1;var c=a.filter(function(s,u){return T.isLevelAllowed(u,l.restrictedLevels)&&u<=f});return this.clientRect=null,T.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},h.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()},h.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},h.getDimensions=function(){if(this.clientRect)return this.clientRect;var f=this.media,l={width:0,height:0};if(f){var a=f.getBoundingClientRect();l.width=a.width,l.height=a.height,!l.width&&!l.height&&(l.width=a.right-a.left||f.width||0,l.height=a.bottom-a.top||f.height||0)}return this.clientRect=l,l},T.isLevelAllowed=function(f,l){return l===void 0&&(l=[]),l.indexOf(f)===-1},T.getMaxLevelByMediaSize=function(f,l,a){if(!f||!f.length)return-1;for(var c=function(t,d){return d?t.width!==d.width||t.height!==d.height:!0},s=f.length-1,u=0;u=l||i.height>=a)&&c(i,f[u+1])){s=u;break}}return s},S(T,[{key:"mediaWidth",get:function(){return this.getDimensions().width*T.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*T.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var f=1;try{f=self.devicePixelRatio}catch(l){}return f}}]),T}();Q.default=C},"./src/controller/cmcd-controller.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return c});var w=U("./src/events.ts"),P=U("./src/types/cmcd.ts"),S=U("./src/utils/buffer-helper.ts"),C=U("./src/utils/logger.ts");function T(s,u){for(var i=0;i=s.length?{done:!0}:{done:!1,value:s[n++]}}}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 f(s,u){if(!s)return;if(typeof s=="string")return l(s,u);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(s,u)}function l(s,u){(u==null||u>s.length)&&(u=s.length);for(var i=0,n=new Array(u);it&&(t=y.bitrate)}return t>0?t:NaN},u.getBufferLength=function(n){var t=this.hls.media,d=n===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!t)return NaN;var v=S.BufferHelper.bufferInfo(d,t.currentTime,this.config.maxBufferHole);return v.len*1e3},u.createPlaylistLoader=function(){var n=this.config.pLoader,t=this.applyPlaylistData,d=n||this.config.loader;return function(){function v(y){this.loader=void 0,this.loader=new d(y)}var b=v.prototype;return b.destroy=function(){this.loader.destroy()},b.abort=function(){this.loader.abort()},b.load=function(_,m,g){t(_),this.loader.load(_,m,g)},h(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},u.createFragmentLoader=function(){var n=this.config.fLoader,t=this.applyFragmentData,d=n||this.config.loader;return function(){function v(y){this.loader=void 0,this.loader=new d(y)}var b=v.prototype;return b.destroy=function(){this.loader.destroy()},b.abort=function(){this.loader.abort()},b.load=function(_,m,g){t(_),this.loader.load(_,m,g)},h(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},s.uuid=function(){var n=URL.createObjectURL(new Blob),t=n.toString();return URL.revokeObjectURL(n),t.substr(t.lastIndexOf("/")+1)},s.serialize=function(n){for(var t=[],d=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},v=function(F){return Math.round(F)},b=function(F){return v(F/100)*100},y=function(F){return encodeURIComponent(F)},_={br:v,d:v,bl:b,dl:b,mtp:b,nor:y,rtp:b,tb:v},m=Object.keys(n||{}).sort(),g=p(m),E;!(E=g()).done;){var o=E.value,x=n[o];if(!d(x))continue;if(o==="v"&&x===1)continue;if(o=="pr"&&x===1)continue;var A=_[o];A&&(x=A(x));var O=typeof x,D=void 0;o==="ot"||o==="sf"||o==="st"?D=o+"="+x:O==="boolean"?D=o:O==="number"?D=o+"="+x:D=o+"="+JSON.stringify(x),t.push(D)}return t.join(",")},s.toHeaders=function(n){for(var t=Object.keys(n),d={},v=["Object","Request","Session","Status"],b=[{},{},{},{}],y={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},_=0,m=t;_p){this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var y=p-this._requestLicenseFailureCount+1;S.logger.warn("Retrying license request, "+y+" attempts left"),this._requestLicense(t,d)}break}},s._generateLicenseRequestChallenge=function(i,n){switch(i.mediaKeySystemDomain){case C.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,n){S.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){S.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(d,i,n);S.logger.log("Sending license request to URL: "+d);var b=this._generateLicenseRequestChallenge(t,i);v.send(b)}catch(y){S.logger.error("Failure requesting DRM license: "+y),this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,n){if(!this._emeEnabled)return;var t=n.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,n=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,n){if(!this._emeEnabled)return;var t=n.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),d=n.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(C.KeySystems.WIDEVINE,t,d)},h(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();Q.default=a},"./src/controller/fps-controller.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/events.ts"),P=U("./src/utils/logger.ts"),S=function(){function C(h){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=h,this.registerListeners()}var T=C.prototype;return T.setStreamController=function(p){this.streamController=p},T.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},T.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching)},T.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},T.onMediaAttaching=function(p,f){var l=this.hls.config;if(l.capLevelOnFPSDrop){var a=f.media instanceof self.HTMLVideoElement?f.media:null;this.media=a,a&&typeof a.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),l.fpsDroppedMonitoringPeriod)}},T.checkFPS=function(p,f,l){var a=performance.now();if(f){if(this.lastTime){var c=a-this.lastTime,s=l-this.lastDroppedFrames,u=f-this.lastDecodedFrames,i=1e3*s/c,n=this.hls;if(n.trigger(w.Events.FPS_DROP,{currentDropped:s,currentDecoded:u,totalDroppedFrames:l}),i>0&&s>n.config.fpsDroppedMonitoringThreshold*u){var t=n.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=t)&&(t=t-1,n.trigger(w.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:n.currentLevel}),n.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=l,this.lastDecodedFrames=f}},T.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var f=p.getVideoPlaybackQuality();this.checkFPS(p,f.totalVideoFrames,f.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},C}();Q.default=S},"./src/controller/fragment-finders.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"findFragmentByPDT",function(){return S}),U.d(Q,"findFragmentByPTS",function(){return C}),U.d(Q,"fragmentWithinToleranceTest",function(){return T}),U.d(Q,"pdtWithinToleranceTest",function(){return h}),U.d(Q,"findFragWithCC",function(){return p});var w=U("./src/polyfills/number.ts"),P=U("./src/utils/binary-search.ts");function S(f,l,a){if(l===null||!Array.isArray(f)||!f.length||!Object(w.isFiniteNumber)(l))return null;var c=f[0].programDateTime;if(l<(c||0))return null;var s=f[f.length-1].endProgramDateTime;if(l>=(s||0))return null;a=a||0;for(var u=0;uf&&a.start?-1:0}function h(f,l,a){var c=Math.min(l,a.duration+(a.deltaPTS?a.deltaPTS:0))*1e3,s=a.endProgramDateTime||0;return s-c>f}function p(f,l){return P.default.search(f,function(a){return a.ccl?-1:0})}},"./src/controller/fragment-tracker.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"FragmentState",function(){return S}),U.d(Q,"FragmentTracker",function(){return C});var w=U("./src/events.ts"),P=U("./src/types/loader.ts"),S;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(S||(S={}));var C=function(){function p(l){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=l,this._registerListeners()}var f=p.prototype;return f._registerListeners=function(){var a=this.hls;a.on(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.on(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(w.Events.FRAG_LOADED,this.onFragLoaded,this)},f._unregisterListeners=function(){var a=this.hls;a.off(w.Events.BUFFER_APPENDED,this.onBufferAppended,this),a.off(w.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(w.Events.FRAG_LOADED,this.onFragLoaded,this)},f.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},f.getAppendedFrag=function(a,c){if(c===P.PlaylistLevelType.MAIN){var s=this.activeFragment,u=this.activeParts;if(!s)return null;if(u)for(var i=u.length;i--;){var n=u[i],t=n?n.end:s.appendedPTS;if(n.start<=a&&t!==void 0&&a<=t)return i>9&&(this.activeParts=u.slice(i-9)),n}else if(s.start<=a&&s.appendedPTS!==void 0&&a<=s.appendedPTS)return s}return this.getBufferedFrag(a,c)},f.getBufferedFrag=function(a,c){for(var s=this.fragments,u=Object.keys(s),i=u.length;i--;){var n=s[u[i]];if((n==null?void 0:n.body.type)===c&&n.buffered){var t=n.body;if(t.start<=a&&a<=t.end)return t}}return null},f.detectEvictedFragments=function(a,c,s){var u=this;Object.keys(this.fragments).forEach(function(i){var n=u.fragments[i];if(!n)return;if(!n.buffered){n.body.type===s&&u.removeFragment(n.body);return}var t=n.range[a];if(!t)return;t.time.some(function(d){var v=!u.isTimeBuffered(d.startPTS,d.endPTS,c);return v&&u.removeFragment(n.body),v})})},f.detectPartialFragments=function(a){var c=this,s=this.timeRanges,u=a.frag,i=a.part;if(!s||u.sn==="initSegment")return;var n=h(u),t=this.fragments[n];if(!t)return;Object.keys(s).forEach(function(d){var v=u.elementaryStreams[d];if(!v)return;var b=s[d],y=i!==null||v.partial===!0;t.range[d]=c.getBufferedTimes(u,i,y,b)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},f.fragBuffered=function(a){var c=h(a),s=this.fragments[c];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},f.getBufferedTimes=function(a,c,s,u){for(var i={time:[],partial:s},n=c?c.start:a.start,t=c?c.end:a.end,d=a.minEndPTS||t,v=a.maxStartPTS||n,b=0;b=y&&d<=_){i.time.push({startPTS:Math.max(n,u.start(b)),endPTS:Math.min(t,u.end(b))});break}else if(n<_&&t>y)i.partial=!0,i.time.push({startPTS:Math.max(n,u.start(b)),endPTS:Math.min(t,u.end(b))});else if(t<=y)break}return i},f.getPartialFragment=function(a){var c=null,s,u,i,n=0,t=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(v){var b=d[v];if(!b)return;T(b)&&(u=b.body.start-t,i=b.body.end+t,a>=u&&a<=i&&(s=Math.min(a-u,i-a),n<=s&&(c=b.body,n=s)))}),c},f.getState=function(a){var c=h(a),s=this.fragments[c];return s?s.buffered?T(s)?S.PARTIAL:S.OK:s.backtrack?S.BACKTRACKED:S.APPENDING:S.NOT_LOADED},f.backtrack=function(a,c){var s=h(a),u=this.fragments[s];if(!u||u.backtrack)return null;var i=u.backtrack=c||u.loaded;return u.loaded=null,i},f.getBacktrackData=function(a){var c=h(a),s=this.fragments[c];if(s){var u,i=s.backtrack;if(i!=null&&(u=i.payload)!==null&&u!==void 0&&u.byteLength)return i;this.removeFragment(a)}return null},f.isTimeBuffered=function(a,c,s){for(var u,i,n=0;n=u&&c<=i)return!0;if(c<=u)return!1}return!1},f.onFragLoaded=function(a,c){var s=c.frag,u=c.part;if(s.sn==="initSegment"||s.bitrateTest||u)return;var i=h(s);this.fragments[i]={body:s,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},f.onBufferAppended=function(a,c){var s=this,u=c.frag,i=c.part,n=c.timeRanges;if(u.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=u,i){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(i)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(d){var v=n[d];if(s.detectEvictedFragments(d,v),!i)for(var b=0;ba&&u.removeFragment(t)}})},f.removeFragment=function(a){var c=h(a);a.stats.loaded=0,a.clearElementaryStreamInfo(),delete this.fragments[c]},f.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function T(p){var f,l;return p.buffered&&(((f=p.range.video)===null||f===void 0?void 0:f.partial)||((l=p.range.audio)===null||l===void 0?void 0:l.partial))}function h(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return T}),U.d(Q,"MAX_START_GAP_JUMP",function(){return h}),U.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),U.d(Q,"SKIP_BUFFER_RANGE_START",function(){return f}),U.d(Q,"default",function(){return l});var w=U("./src/utils/buffer-helper.ts"),P=U("./src/errors.ts"),S=U("./src/events.ts"),C=U("./src/utils/logger.ts"),T=250,h=2,p=.1,f=.05,l=function(){function a(s,u,i,n){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=u,this.fragmentTracker=i,this.hls=n}var c=a.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(u){var i=this.config,n=this.media,t=this.stalled,d=n.currentTime,v=n.seeking,b=this.seeking&&!v,y=!this.seeking&&v;if(this.seeking=v,d!==u){if(this.moved=!0,t!==null){if(this.stallReported){var _=self.performance.now()-t;C.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(_)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((y||b)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!w.BufferHelper.getBuffered(n).length)return;var m=w.BufferHelper.bufferInfo(n,d,0),g=m.len>0,E=m.nextStart||0;if(!g&&!E)return;if(v){var o=m.len>h,x=!E||E-d>h&&!this.fragmentTracker.getPartialFragment(d);if(o||x)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var A,O=Math.max(E,m.start||0)-d,D=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=D==null||((A=D.details)===null||A===void 0)?void 0:A.live,F=I?D.details.targetduration*2:h;if(O>0&&O<=F){this._trySkipBufferHole(null);return}}var z=self.performance.now();if(t===null){this.stalled=z;return}var ne=z-t;!v&&ne>=T&&this._reportStall(m.len);var j=w.BufferHelper.bufferInfo(n,d,i.maxBufferHole);this._tryFixBufferStall(j,ne)},c._tryFixBufferStall=function(u,i){var n=this.config,t=this.fragmentTracker,d=this.media,v=d.currentTime,b=t.getPartialFragment(v);if(b){var y=this._trySkipBufferHole(b);if(y)return}u.len>n.maxBufferHole&&i>n.highBufferWatchdogPeriod*1e3&&(C.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(u){var i=this.hls,n=this.media,t=this.stallReported;t||(this.stallReported=!0,C.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+u+")"),i.trigger(S.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:u}))},c._trySkipBufferHole=function(u){for(var i=this.config,n=this.hls,t=this.media,d=t.currentTime,v=0,b=w.BufferHelper.getBuffered(t),y=0;y=v&&d<_){var m=Math.max(_+f,t.currentTime+p);return C.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+m),this.moved=!0,this.stalled=null,t.currentTime=m,u&&n.trigger(S.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+m,frag:u}),m}v=b.end(y)}return 0},c._tryNudgeBuffer=function(){var u=this.config,i=this.hls,n=this.media,t=n.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d.05&&this.forwardBufferLength>1){var y=Math.min(2,Math.max(1,n)),_=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;a.playbackRate=Math.min(y,Math.max(1,_))}else a.playbackRate!==1&&a.playbackRate!==0&&(a.playbackRate=1)},f.estimateLiveEdge=function(){var a=this.levelDetails;return a===null?null:a.edge+a.age},f.computeLatency=function(){var a=this.estimateLiveEdge();return a===null?null:a-this.currentTime},T(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var a=this.config,c=this.levelDetails;return a.liveMaxLatencyDuration!==void 0?a.liveMaxLatencyDuration:c?a.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var a=this.levelDetails;if(a===null)return null;var c=a.holdBack,s=a.partHoldBack,u=a.targetduration,i=this.config,n=i.liveSyncDuration,t=i.liveSyncDurationCount,d=i.lowLatencyMode,v=this.hls.userConfig,b=d&&s||c;(v.liveSyncDuration||v.liveSyncDurationCount||b===0)&&(b=n!==void 0?n:t*u);var y=u,_=1;return b+Math.min(this.stallCount*_,y)}},{key:"liveSyncPosition",get:function(){var a=this.estimateLiveEdge(),c=this.targetLatency,s=this.levelDetails;if(a===null||c===null||s===null)return null;var u=s.edge,i=a-c-this.edgeStalled,n=u-s.totalduration,t=u-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,i),t)}},{key:"drift",get:function(){var a=this.levelDetails;return a===null?1:a.drift}},{key:"edgeStalled",get:function(){var a=this.levelDetails;if(a===null)return 0;var c=(this.config.lowLatencyMode&&a.partTarget||a.targetduration)*3;return Math.max(a.age-c,0)}},{key:"forwardBufferLength",get:function(){var a=this.media,c=this.levelDetails;if(!a||!c)return 0;var s=a.buffered.length;return s?a.buffered.end(s-1):c.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return i});var w=U("./src/types/level.ts"),P=U("./src/events.ts"),S=U("./src/errors.ts"),C=U("./src/utils/codecs.ts"),T=U("./src/controller/level-helper.ts"),h=U("./src/controller/base-playlist-controller.ts"),p=U("./src/types/loader.ts");function f(){return f=Object.assign||function(n){for(var t=1;t0){E=_[0].bitrate,_.sort(function(ne,j){return ne.bitrate-j.bitrate}),this._levels=_;for(var I=0;I<_.length;I++)if(_[I].bitrate===E){this._firstLevel=I,this.log("manifest loaded, "+_.length+" level(s) found, first bitrate: "+E);break}var F=D&&!O,z={levels:_,audioTracks:m,subtitleTracks:g,firstLevel:this._firstLevel,stats:y.stats,audio:D,video:O,altAudio:!F&&m.some(function(ne){return!!ne.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,z),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:y.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(b,y){if(n.prototype.onError.call(this,b,y),y.fatal)return;var _=y.context,m=this._levels[this.currentLevelIndex];if(_&&(_.type===p.PlaylistContextType.AUDIO_TRACK&&m.audioGroupIds&&_.groupId===m.audioGroupIds[m.urlId]||_.type===p.PlaylistContextType.SUBTITLE_TRACK&&m.textGroupIds&&_.groupId===m.textGroupIds[m.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,E=!0,o;switch(y.details){case S.ErrorDetails.FRAG_LOAD_ERROR:case S.ErrorDetails.FRAG_LOAD_TIMEOUT:case S.ErrorDetails.KEY_LOAD_ERROR:case S.ErrorDetails.KEY_LOAD_TIMEOUT:if(y.frag){var x=this._levels[y.frag.level];x?(x.fragmentError++,x.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=y.frag.level)):o=y.frag.level}break;case S.ErrorDetails.LEVEL_LOAD_ERROR:case S.ErrorDetails.LEVEL_LOAD_TIMEOUT:_&&(_.deliveryDirectives&&(E=!1),o=_.level),g=!0;break;case S.ErrorDetails.REMUX_ALLOC_ERROR:o=y.level,g=!0;break}o!==void 0&&this.recoverLevel(y,o,g,E)},d.recoverLevel=function(b,y,_,m){var g=b.details,E=this._levels[y];if(E.loadError++,_){var o=this.retryLoadingOrFail(b);if(o)b.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var x=E.url.length;if(x>1&&E.loadError1){var m=(y.urlId+1)%_;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(g){g.urlId=m}),this.level=b}},d.onFragLoaded=function(b,y){var _=y.frag;if(_!==void 0&&_.type===p.PlaylistLevelType.MAIN){var m=this._levels[_.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},d.onLevelLoaded=function(b,y){var _,m=y.level,g=y.details,E=this._levels[m];if(!E){var o;this.warn("Invalid level index "+m),(o=y.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(g.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(m,y,E.details)):(_=y.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(g.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(b,y){var _=this.hls.levels[this.currentLevelIndex];if(!_)return;if(_.audioGroupIds){for(var m=-1,g=this.hls.audioTracks[y.id].groupId,E=0;E<_.audioGroupIds.length;E++)if(_.audioGroupIds[E]===g){m=E;break}m!==_.urlId&&(_.urlId=m,this.startLoad())}},d.loadPlaylist=function(b){var y=this.currentLevelIndex,_=this._levels[y];if(this.canLoad&&_&&_.url.length>0){var m=_.urlId,g=_.url[m];if(b)try{g=b.addDirectives(g)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+y+(b?" at sn "+b.msn+" part "+b.part:"")+" with URL-id "+m+" "+g),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:g,level:y,id:m,deliveryDirectives:b||null})}},d.removeLevel=function(b,y){var _=function(E,o){return o!==y},m=this._levels.filter(function(g,E){return E!==b?!0:g.url.length>1&&y!==void 0?(g.url=g.url.filter(_),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(_)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(_)),g.urlId=0,!0):!1}).map(function(g,E){var o=g.details;return o!=null&&o.fragments&&o.fragments.forEach(function(x){x.level=E}),g});this._levels=m,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:m})},a(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(b){var y,_=this._levels;if(_.length===0)return;if(this.currentLevelIndex===b&&(y=_[b])!==null&&y!==void 0&&y.details)return;if(b<0||b>=_.length){var m=b<0;if(this.hls.trigger(P.Events.ERROR,{type:S.ErrorTypes.OTHER_ERROR,details:S.ErrorDetails.LEVEL_SWITCH_ERROR,level:b,fatal:m,reason:"invalid level idx"}),m)return;b=Math.min(b,_.length-1)}this.clearTimer();var g=this.currentLevelIndex,E=_[g],o=_[b];this.log("switching to level "+b+" from "+g),this.currentLevelIndex=b;var x=f({},o,{level:b,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete x._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,x);var A=o.details;if(!A||A.live){var O=this.switchParams(o.uri,E==null?void 0:E.details);this.loadPlaylist(O)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(b){this.manualLevelIndex=b,this._startLevel===void 0&&(this._startLevel=b),b!==-1&&(this.level=b)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(b){this._firstLevel=b}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var b=this.hls.config.startLevel;return b!==void 0?b:this._firstLevel}else return this._startLevel},set:function(b){this._startLevel=b}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(b){this.level=b,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=b)}}]),t}(h.default)},"./src/controller/level-helper.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"addGroupId",function(){return S}),U.d(Q,"assignTrackIdsByGroup",function(){return C}),U.d(Q,"updatePTS",function(){return T}),U.d(Q,"updateFragPTSDTS",function(){return p}),U.d(Q,"mergeDetails",function(){return f}),U.d(Q,"mapPartIntersection",function(){return l}),U.d(Q,"mapFragmentIntersection",function(){return a}),U.d(Q,"adjustSliding",function(){return c}),U.d(Q,"addSliding",function(){return s}),U.d(Q,"computeReloadInterval",function(){return u}),U.d(Q,"getFragmentWithSN",function(){return i}),U.d(Q,"getPartWith",function(){return n});var w=U("./src/polyfills/number.ts"),P=U("./src/utils/logger.ts");function S(t,d,v){switch(d){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(v);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(v);break}}function C(t){var d={};t.forEach(function(v){var b=v.groupId||"";v.id=d[b]=d[b]||0,d[b]++})}function T(t,d,v){var b=t[d],y=t[v];h(b,y)}function h(t,d){var v=d.startPTS;if(Object(w.isFiniteNumber)(v)){var b=0,y;d.sn>t.sn?(b=v-t.start,y=t):(b=t.start-v,y=d),y.duration!==b&&(y.duration=b)}else if(d.sn>t.sn){var _=t.cc===d.cc;_&&t.minEndPTS?d.start=t.start+(t.minEndPTS-t.start):d.start=t.start+t.duration}else d.start=Math.max(t.start-d.duration,0)}function p(t,d,v,b,y,_){var m=b-v;m<=0&&(P.logger.warn("Fragment should have a positive duration",d),b=v+d.duration,_=y+d.duration);var g=v,E=b,o=d.startPTS,x=d.endPTS;if(Object(w.isFiniteNumber)(o)){var A=Math.abs(o-v);Object(w.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(A,d.deltaPTS):d.deltaPTS=A,g=Math.max(v,o),v=Math.min(v,o),y=Math.min(y,d.startDTS),E=Math.min(b,x),b=Math.max(b,x),_=Math.max(_,d.endDTS)}d.duration=b-v;var O=v-d.start;d.appendedPTS=b,d.start=d.startPTS=v,d.maxStartPTS=g,d.startDTS=y,d.endPTS=b,d.minEndPTS=E,d.endDTS=_;var D=d.sn;if(!t||Dt.endSN)return 0;var I,F=D-t.startSN,z=t.fragments;for(z[F]=d,I=F;I>0;I--)h(z[I],z[I-1]);for(I=F;I=0;y--){var _=b[y].initSegment;if(_){v=_;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var m=0,g;if(a(t,d,function(I,F){I.relurl&&(m=I.cc-F.cc),Object(w.isFiniteNumber)(I.startPTS)&&Object(w.isFiniteNumber)(I.endPTS)&&(F.start=F.startPTS=I.startPTS,F.startDTS=I.startDTS,F.appendedPTS=I.appendedPTS,F.maxStartPTS=I.maxStartPTS,F.endPTS=I.endPTS,F.endDTS=I.endDTS,F.minEndPTS=I.minEndPTS,F.duration=I.endPTS-I.startPTS,F.duration&&(g=F),d.PTSKnown=d.alignedSliding=!0),F.elementaryStreams=I.elementaryStreams,F.loader=I.loader,F.stats=I.stats,F.urlId=I.urlId,I.initSegment&&(F.initSegment=I.initSegment,v=I.initSegment)}),v){var E=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;E.forEach(function(I){var F;(!I.initSegment||I.initSegment.relurl===((F=v)===null||F===void 0?void 0:F.relurl))&&(I.initSegment=v)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(I){return!I}),d.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var o=d.skippedSegments;o--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var x=d.fragments;if(m){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var A=0;A=b.length)return;s(d,b[v].start)}function s(t,d){if(d){for(var v=t.fragments,b=t.skippedSegments;b0&&y0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),E=o),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,y.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var E,o=this.levels,x=this.level,A=o==null||((E=o[x])===null||E===void 0)?void 0:E.details;if(A&&(!A.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(A))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var O,D=self.performance.now(),I=this.retryDate;(!I||D>=I||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){y.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var E,o,x=this.hls,A=this.levelLastLoaded,O=this.levels,D=this.media,I=x.config,F=x.nextLoadLevel;if(A===null||!D&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[F])return;var z=O[F];this.level=x.nextLoadLevel=F;var ne=z.details;if(!ne||this.state===P.State.WAITING_LEVEL||ne.live&&this.levelLastLoaded!==F){this.state=P.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:D,p.PlaylistLevelType.MAIN);if(j===null)return;var G=j.len,X=this.getMaxBufferLength(z.maxBitrate);if(G>=X)return;if(this._streamEnded(j,ne)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(C.Events.BUFFER_EOS,Z),this.state=P.State.ENDED;return}var K=j.end,q=this.getNextFragment(K,ne);if(this.couldBacktrack&&!this.fragPrevious&&q&&q.sn!=="initSegment"){var ie=q.sn-ne.startSN;ie>1&&(q=ne.fragments[ie-1],this.fragmentTracker.removeFragment(q))}if(q&&this.fragmentTracker.getState(q)===h.FragmentState.OK&&this.nextLoadPosition>K){var oe=this.audioOnly&&!this.altAudio?f.ElementaryStreamTypes.AUDIO:f.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(D,oe,p.PlaylistLevelType.MAIN),q=this.getNextFragment(this.nextLoadPosition,ne)}if(!q)return;q.initSegment&&!q.initSegment.data&&!this.bitrateTest&&(q=q.initSegment),((E=q.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((o=q.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(q,ne):this.loadFragment(q,ne,K)},m.loadFragment=function(E,o,x){var A,O=this.fragmentTracker.getState(E);if(this.fragCurrent=E,O===h.FragmentState.BACKTRACKED){var D=this.fragmentTracker.getBacktrackData(E);if(D){this._handleFragmentLoadProgress(D),this._handleFragmentLoadComplete(D);return}else O=h.FragmentState.NOT_LOADED}O===h.FragmentState.NOT_LOADED||O===h.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,E,o,x)):O===h.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((A=this.media)===null||A===void 0?void 0:A.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(E){var o=this.fragmentTracker.getAppendedFrag(E,p.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},m.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,p.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var E=this.levels,o=this.media;if(o!=null&&o.readyState){var x,A=this.getAppendedFrag(o.currentTime);if(A&&A.start>1&&this.flushMainBuffer(0,A.start-1),!o.paused&&E){var O=this.hls.nextLoadLevel,D=E[O],I=this.fragLastKbps;I&&this.fragCurrent?x=this.fragCurrent.duration*D.maxBitrate/(1e3*I)+1:x=0}else x=0;var F=this.getBufferedFrag(o.currentTime+x);if(F){var z=this.followingBufferedFrag(F);if(z){this.abortCurrentFrag();var ne=z.maxStartPTS?z.maxStartPTS:z.start,j=z.duration,G=Math.max(F.end,ne+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(G,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(E,o){y.prototype.flushMainBuffer.call(this,E,o,this.altAudio?"video":null)},m.onMediaAttached=function(E,o){y.prototype.onMediaAttached.call(this,E,o);var x=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),x.addEventListener("playing",this.onvplaying),x.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,x,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),y.prototype.onMediaDetaching.call(this)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var E=this.media,o=E?E.currentTime:null;Object(w.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(C.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},m.onManifestParsed=function(E,o){var x=!1,A=!1,O;o.levels.forEach(function(D){O=D.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(x=!0),O.indexOf("mp4a.40.5")!==-1&&(A=!0))}),this.audioCodecSwitch=x&&A&&!Object(S.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=o.levels,this.startFragRequested=!1},m.onLevelLoading=function(E,o){var x=this.levels;if(!x||this.state!==P.State.IDLE)return;var A=x[o.level];(!A.details||A.details.live&&this.levelLastLoaded!==o.level||this.waitForCdnTuneIn(A.details))&&(this.state=P.State.WAITING_LEVEL)},m.onLevelLoaded=function(E,o){var x,A=this.levels,O=o.level,D=o.details,I=D.totalduration;if(!A){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+D.startSN+","+D.endSN+"], cc ["+D.startCC+", "+D.endCC+"] duration:"+I);var F=this.fragCurrent;F&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==o.level&&F.loader&&(this.state=P.State.IDLE,F.loader.abort()));var z=A[O],ne=0;if(D.live||(x=z.details)!==null&&x!==void 0&&x.live){if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed)return;ne=this.alignPlaylists(D,z.details)}if(z.details=D,this.levelLastLoaded=O,this.hls.trigger(C.Events.LEVEL_UPDATED,{details:D,level:O}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(D))return;this.state=P.State.IDLE}this.startFragRequested?D.live&&this.synchronizeToLiveEdge(D):this.setStartPosition(D,ne),this.tick()},m._handleFragmentLoadProgress=function(E){var o,x=E.frag,A=E.part,O=E.payload,D=this.levels;if(!D){this.warn("Levels were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var I=D[x.level],F=I.details;if(!F){this.warn("Dropping fragment "+x.sn+" of level "+x.level+" after level details were reset");return}var z=I.videoCodec,ne=F.PTSKnown||!F.live,j=(o=x.initSegment)===null||o===void 0?void 0:o.data,G=this._getAudioCodec(I),X=this.transmuxer=this.transmuxer||new l.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=A?A.index:-1,K=Z!==-1,q=new a.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,O.byteLength,Z,K),ie=this.initPTS[x.cc];X.push(O,j,G,z,x,A,F.totalduration,ne,q,ie)},m.onAudioTrackSwitching=function(E,o){var x=this.altAudio,A=!!o.url,O=o.id;if(!A){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var D=this.fragCurrent;D!=null&&D.loader&&(this.log("Switching to main audio track, cancel main fragment load"),D.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;x&&I.trigger(C.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:O})}},m.onAudioTrackSwitched=function(E,o){var x=o.id,A=!!this.hls.audioTracks[x].url;if(A){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=A,this.tick()},m.onBufferCreated=function(E,o){var x=o.tracks,A,O,D=!1;for(var I in x){var F=x[I];if(F.id==="main"){if(O=I,A=F,I==="video"){var z=x[I];z&&(this.videoBuffer=z.buffer)}}else D=!0}D&&A?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=A.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(E,o){var x=o.frag,A=o.part;if(x&&x.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(A?" p: "+A.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var O=A?A.stats:x.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),x.sn!=="initSegment"&&(this.fragPrevious=x),this.fragBufferedComplete(x,A)},m.onError=function(E,o){switch(o.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.MAIN,o);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(o.fatal?(this.warn(""+o.details),this.state=P.State.ERROR):!o.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var x=!0,A=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);A&&A.len>.5&&(x=!this.reduceMaxBufferLength(A.len)),x&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var E=this.media,o=this.gapController;if(!E||!o||!E.readyState)return;var x=T.BufferHelper.getBuffered(E);!this.loadedmetadata&&x.length?(this.loadedmetadata=!0,this.seekToStartPos()):o.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(E,o){var x=o.type;if(x!==f.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var A=(x===f.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(A,x,p.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(E,o){this.levels=o.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var E=this.media,o=E.currentTime,x=this.startPosition;if(x>=0&&o0&&(D1&&E.seeking===!1){var x=E.currentTime;if(T.BufferHelper.isBuffered(E,x)?o=this.getAppendedFrag(x):T.BufferHelper.isBuffered(E,x+.1)&&(o=this.getAppendedFrag(x+.1)),o){var A=this.fragPlaying,O=o.level;(!A||o.sn!==A.sn||A.level!==O||o.urlId!==A.urlId)&&(this.hls.trigger(C.Events.FRAG_CHANGED,{frag:o}),(!A||A.level!==O)&&this.hls.trigger(C.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=o)}}},n(_,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var o=this.getAppendedFrag(E.currentTime);if(o)return o.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var o=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(o)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),_}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"SubtitleStreamController",function(){return t});var w=U("./src/events.ts"),P=U("./src/utils/logger.ts"),S=U("./src/utils/buffer-helper.ts"),C=U("./src/controller/fragment-finders.ts"),T=U("./src/utils/discontinuities.ts"),h=U("./src/controller/level-helper.ts"),p=U("./src/controller/fragment-tracker.ts"),f=U("./src/controller/base-stream-controller.ts"),l=U("./src/types/loader.ts"),a=U("./src/types/level.ts");function c(d,v){for(var b=0;b=o[O].start&&A<=o[O].end){x=o[O];break}var D=g.start+g.duration;x?x.end=D:(x={start:A,end:D},o.push(x)),this.fragmentTracker.fragBuffered(g)},b.onBufferFlushing=function(_,m){var g=m.startOffset,E=m.endOffset;if(g===0&&E!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,x=this.levels;if(!x.length||!x[o]||!x[o].details)return;var A=x[o].details,O=A.targetduration,D=E-O;if(D<=0)return;m.endOffsetSubtitles=Math.max(0,D),this.tracksBuffered.forEach(function(I){for(var F=0;F=A.length||o!==x||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(g=O.details)!==null&&g!==void 0&&g.live){var D=this.mainDetails;if(E.deltaUpdateFailed||!D)return;var I=D.fragments[0];if(!O.details)E.hasProgramDateTime&&D.hasProgramDateTime?Object(T.alignMediaPlaylistByPDT)(E,D):I&&Object(h.addSliding)(E,I.start);else{var F=this.alignPlaylists(E,O.details);F===0&&I&&Object(h.addSliding)(E,I.start)}}if(O.details=E,this.levelLastLoaded=o,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===f.State.IDLE){var z=Object(C.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);z||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},b._handleFragmentLoadComplete=function(_){var m=_.frag,g=_.payload,E=m.decryptdata,o=this.hls;if(this.fragContextChanged(m))return;if(g&&g.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var x=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),E.key.buffer,E.iv.buffer).then(function(A){var O=performance.now();o.trigger(w.Events.FRAG_DECRYPTED,{frag:m,payload:A,stats:{tstart:x,tdecrypt:O}})})}},b.doTick=function(){if(!this.media){this.state=f.State.IDLE;return}if(this.state===f.State.IDLE){var _,m=this.currentTrackId,g=this.levels;if(!g.length||!g[m]||!g[m].details)return;var E=g[m].details,o=E.targetduration,x=this.config,A=this.media,O=S.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,A.currentTime-o,x.maxBufferHole),D=O.end,I=O.len,F=this.getMaxBufferLength()+o;if(I>F)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var z=E.fragments,ne=z.length,j=E.edge,G,X=this.fragPrevious;if(D-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},u.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},u.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var n=a(this.media.textTracks);n.forEach(function(t){Object(P.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(n,t){this.tracks=t.subtitleTracks},u.onSubtitleTrackLoaded=function(n,t){var d=t.id,v=t.details,b=this.trackId,y=this.tracksInGroup[b];if(!y){this.warn("Invalid subtitle track id "+d);return}var _=y.details;y.details=t.details,this.log("subtitle track "+d+" loaded ["+v.startSN+"-"+v.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,t,_))},u.onLevelLoading=function(n,t){this.switchLevel(t.level)},u.onLevelSwitching=function(n,t){this.switchLevel(t.level)},u.switchLevel=function(n){var t=this.hls.levels[n];if(!(t!=null&&t.textGroupIds))return;var d=t.textGroupIds[t.urlId];if(this.groupId!==d){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,b=this.tracks.filter(function(m){return!d||m.groupId===d});this.tracksInGroup=b;var y=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=d;var _={subtitleTracks:b};this.log("Updating subtitle tracks, "+b.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(w.Events.SUBTITLE_TRACKS_UPDATED,_),y!==-1&&this.setSubtitleTrack(y,v)}},u.findTrackId=function(n){for(var t=this.tracksInGroup,d=0;d=v.length)return;this.clearTimer();var b=v[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,b){var y=b.id,_=b.groupId,m=_===void 0?"":_,g=b.name,E=b.type,o=b.url;this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:y,groupId:m,name:g,type:E,url:o});var x=this.switchParams(b.url,t==null?void 0:t.details);this.loadPlaylist(x)}else this.hls.trigger(w.Events.SUBTITLE_TRACK_SWITCH,{id:n})},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,t=a(this.media.textTracks),d=0;d=0&&(E[0]=Math.min(E[0],v),E[1]=Math.max(E[1],b),m=!0,o/(b-v)>.5))return}if(m||_.push([v,b]),this.config.renderTextTracksNatively){var x=this.captionsTracks[d];this.Cues.newCue(x,v,b,y)}else{var A=this.Cues.newCue(null,v,b,y);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:A,track:d})}},n.onInitPtsFound=function(d,v){var b=this,y=v.frag,_=v.id,m=v.initPTS,g=v.timescale,E=this.unparsedVttFrags;_==="main"&&(this.initPTS[y.cc]=m,this.timescale[y.cc]=g),E.length&&(this.unparsedVttFrags=[],E.forEach(function(o){b.onFragLoaded(P.Events.FRAG_LOADED,o)}))},n.getExistingTrack=function(d){var v=this.media;if(v)for(var b=0;b>>8^g&255^99,p[y]=g,f[g]=y;var E=b[y],o=b[E],x=b[o],A=b[g]*257^g*16843008;a[y]=A<<24|A>>>8,c[y]=A<<16|A>>>16,s[y]=A<<8|A>>>24,u[y]=A,A=x*16843009^o*65537^E*257^y*16843008,n[g]=A<<24|A>>>8,t[g]=A<<16|A>>>16,d[g]=A<<8|A>>>24,v[g]=A,y?(y=E^b[b[b[x^E]]],_^=b[b[_]]):y=_=1}},T.expandKey=function(p){for(var f=this.uint8ArrayToUint32Array_(p),l=!0,a=0;a>>6)+1;var A=(d[v+2]&60)>>>2;if(A>x.length-1){t.trigger(S.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return m=(d[v+2]&1)<<2,m|=(d[v+3]&192)>>>6,w.logger.log("manifest codec:"+b+", ADTS type:"+y+", samplingIndex:"+A),/firefox/i.test(E)?A>=6?(y=5,g=new Array(4),_=A-3):(y=2,g=new Array(2),_=A):E.indexOf("android")!==-1?(y=2,g=new Array(2),_=A):(y=5,g=new Array(4),b&&(b.indexOf("mp4a.40.29")!==-1||b.indexOf("mp4a.40.5")!==-1)||!b&&A>=6?_=A-3:((b&&b.indexOf("mp4a.40.2")!==-1&&(A>=6&&m===1||/vivaldi/i.test(E))||!b&&m===1)&&(y=2,g=new Array(2)),_=A)),g[0]=y<<3,g[0]|=(A&14)>>1,g[1]|=(A&1)<<7,g[1]|=m<<3,y===5&&(g[1]|=(_&14)>>1,g[2]=(_&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:x[A],channelCount:m,codec:"mp4a.40."+y,manifestCodec:o}}function T(t,d){return t[d]===255&&(t[d+1]&246)===240}function h(t,d){return t[d+1]&1?7:9}function p(t,d){return(t[d+3]&3)<<11|t[d+4]<<3|(t[d+5]&224)>>>5}function f(t,d){return d+5=t.length)return!1;var b=p(t,d);if(b<=v)return!1;var y=d+b;return y===t.length||l(t,y)}return!1}function s(t,d,v,b,y){if(!t.samplerate){var _=C(d,v,b,y);if(!_)return;t.config=_.config,t.samplerate=_.samplerate,t.channelCount=_.channelCount,t.codec=_.codec,t.manifestCodec=_.manifestCodec,w.logger.log("parsed codec:"+t.codec+", rate:"+_.samplerate+", channels:"+_.channelCount)}}function u(t){return 1024*9e4/t}function i(t,d,v,b,y){var _=h(t,d),m=p(t,d);if(m-=_,m>0){var g=v+b*y;return{headerLength:_,frameLength:m,stamp:g}}}function n(t,d,v,b,y){var _=u(t.samplerate),m=i(d,v,b,y,_);if(m){var g=m.frameLength,E=m.headerLength,o=m.stamp,x=E+g,A=Math.max(0,v+x-d.length),O;A?(O=new Uint8Array(x-E),O.set(d.subarray(v+E,d.length),0)):O=d.subarray(v+E,v+x);var D={unit:O,pts:o};return A||t.samples.push(D),{sample:D,length:x,missing:A}}}},"./src/demux/base-audio-demuxer.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"initPTSFn",function(){return p});var w=U("./src/polyfills/number.ts"),P=U("./src/demux/id3.ts"),S=U("./src/demux/dummy-demuxed-track.ts"),C=U("./src/utils/mp4-tools.ts"),T=U("./src/utils/typed-array.ts"),h=function(){function f(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var l=f.prototype;return l.resetInitSegment=function(c,s,u){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},l.resetTimeStamp=function(){},l.resetContiguity=function(){},l.canParse=function(c,s){return!1},l.appendFrame=function(c,s,u){},l.demux=function(c,s){this.cachedData&&(c=Object(C.appendUint8Array)(this.cachedData,c),this.cachedData=null);var u=P.getID3Data(c,0),i=u?u.length:0,n,t,d=this._audioTrack,v=this._id3Track,b=u?P.getTimeStamp(u):void 0,y=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(b,s)),u&&u.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:u}),t=this.initPTS;ih?(this.word<<=h,this.bitsAvailable-=h):(h-=this.bitsAvailable,p=h>>3,h-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=h,this.bitsAvailable-=h)},C.readBits=function(h){var p=Math.min(this.bitsAvailable,h),f=this.word>>>32-p;return h>32&&w.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0?this.word<<=p:this.bytesAvailable>0&&this.loadWord(),p=h-p,p>0&&this.bitsAvailable?f<>>h)!==0)return this.word<<=h,this.bitsAvailable-=h,h;return this.loadWord(),h+this.skipLZ()},C.skipUEG=function(){this.skipBits(1+this.skipLZ())},C.skipEG=function(){this.skipBits(1+this.skipLZ())},C.readUEG=function(){var h=this.skipLZ();return this.readBits(h+1)-1},C.readEG=function(){var h=this.readUEG();return 1&h?1+h>>>1:-1*(h>>>1)},C.readBoolean=function(){return this.readBits(1)===1},C.readUByte=function(){return this.readBits(8)},C.readUShort=function(){return this.readBits(16)},C.readUInt=function(){return this.readBits(32)},C.skipScalingList=function(h){for(var p=8,f=8,l,a=0;a0?y.subarray(m,m+g):void 0},C=function(y,_){var m=0;return m=(y[_]&127)<<21,m|=(y[_+1]&127)<<14,m|=(y[_+2]&127)<<7,m|=y[_+3]&127,m},T=function(y,_){return w(y,_)&&C(y,_+6)+10<=y.length-_},h=function(y){for(var _=l(y),m=0;m<_.length;m++){var g=_[m];if(p(g))return i(g)}return},p=function(y){return y&&y.key==="PRIV"&&y.info==="com.apple.streaming.transportStreamTimestamp"},f=function(y){var _=String.fromCharCode(y[0],y[1],y[2],y[3]),m=C(y,4),g=10;return{type:_,size:m,data:y.subarray(g,g+m)}},l=function(y){for(var _=0,m=[];w(y,_);){var g=C(y,_+6);_+=10;for(var E=_+g;_+8>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:D+=String.fromCharCode(x);break;case 12:case 13:A=y[I++],D+=String.fromCharCode((x&31)<<6|A&63);break;case 14:A=y[I++],O=y[I++],D+=String.fromCharCode((x&15)<<12|(A&63)<<6|(O&63)<<0);break;default:}}return D},t={decodeTextFrame:s},d;function v(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/demux/base-audio-demuxer.ts"),P=U("./src/demux/id3.ts"),S=U("./src/utils/logger.ts"),C=U("./src/demux/mpegaudio.ts");function T(f,l){f.prototype=Object.create(l.prototype),f.prototype.constructor=f,h(f,l)}function h(f,l){return h=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},h(f,l)}var p=function(f){T(l,f);function l(){return f.apply(this,arguments)||this}var a=l.prototype;return a.resetInitSegment=function(s,u,i){f.prototype.resetInitSegment.call(this,s,u,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},l.probe=function(s){if(!s)return!1;for(var u=P.getID3Data(s,0)||[],i=u.length,n=s.length;i0},T.demux=function(p){var f=p,l=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(f=Object(w.appendUint8Array)(this.remainderData,p));var a=Object(w.segmentValidRange)(f);this.remainderData=a.remainder,l.samples=a.valid||new Uint8Array}else l.samples=f;return{audioTrack:Object(P.dummyTrack)(),avcTrack:l,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},T.flush=function(){var p=Object(P.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:p,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},T.demuxSampleAes=function(p,f,l){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},T.destroy=function(){},C}();S.minProbeByteLength=1024,Q.default=S},"./src/demux/mpegaudio.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"appendFrame",function(){return h}),U.d(Q,"parseHeader",function(){return p}),U.d(Q,"isHeaderPattern",function(){return f}),U.d(Q,"isHeader",function(){return l}),U.d(Q,"canParse",function(){return a}),U.d(Q,"probe",function(){return c});var w=null,P=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],S=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],T=[0,1,1,4];function h(s,u,i,n,t){if(i+24>u.length)return;var d=p(u,i);if(d&&i+d.frameLength<=u.length){var v=d.samplesPerFrame*9e4/d.sampleRate,b=n+t*v,y={unit:u.subarray(i,i+d.frameLength),pts:b,dts:b};return s.config=[],s.channelCount=d.channelCount,s.samplerate=d.sampleRate,s.samples.push(y),{sample:y,length:d.frameLength,missing:0}}}function p(s,u){var i=s[u+1]>>3&3,n=s[u+1]>>1&3,t=s[u+2]>>4&15,d=s[u+2]>>2&3;if(i!==1&&t!==0&&t!==15&&d!==3){var v=s[u+2]>>1&1,b=s[u+3]>>6,y=i===3?3-n:n===3?3:4,_=P[y*14+t-1]*1e3,m=i===3?0:i===2?1:2,g=S[m*3+d],E=b===3?1:2,o=C[i][n],x=T[n],A=o*8*x,O=Math.floor(o*_/g+v)*x;if(w===null){var D=navigator.userAgent||"",I=D.match(/Chrome\/(\d+)/i);w=I?parseInt(I[1]):0}var F=!!w&&w<=87;return F&&n===2&&_>=224e3&&b===0&&(s[u+3]=s[u+3]|128),{sampleRate:g,channelCount:E,frameLength:O,samplesPerFrame:A}}}function f(s,u){return s[u]===255&&(s[u+1]&224)===224&&(s[u+1]&6)!==0}function l(s,u){return u+1=p.length){l();return}if(p[f].unit.length<32)continue;var a=this.decrypter.isSync();if(this.decryptAacSample(p,f,l,a),!a)return}},T.getAvcEncryptedData=function(p){for(var f=Math.floor((p.length-48)/160)*16+16,l=new Int8Array(f),a=0,c=32;c<=p.length-16;c+=160,a+=16)l.set(p.subarray(c,c+16),a);return l},T.getAvcDecryptedUnit=function(p,f){for(var l=new Uint8Array(f),a=0,c=32;c<=p.length-16;c+=160,a+=16)p.set(l.subarray(a,a+16),c);return p},T.decryptAvcSample=function(p,f,l,a,c,s){var u=Object(P.discardEPB)(c.data),i=this.getAvcEncryptedData(u),n=this;this.decryptBuffer(i.buffer,function(t){c.data=n.getAvcDecryptedUnit(u,t),s||n.decryptAvcSamples(p,f,l+1,a)})},T.decryptAvcSamples=function(p,f,l,a){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;f++,l=0){if(f>=p.length){a();return}for(var c=p[f].units;!(l>=c.length);l++){var s=c[l];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var u=this.decrypter.isSync();if(this.decryptAvcSample(p,f,l,a,s,u),!u)return}}},C}();Q.default=S},"./src/demux/transmuxer-interface.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return c});var w=U("./node_modules/webworkify-webpack/index.js"),P=U.n(w),S=U("./src/events.ts"),C=U("./src/demux/transmuxer.ts"),T=U("./src/utils/logger.ts"),h=U("./src/errors.ts"),p=U("./src/utils/mediasource-helper.ts"),f=U("./node_modules/eventemitter3/index.js"),l=U.n(f),a=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function s(i,n,t,d){var v=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=n,this.onTransmuxComplete=t,this.onFlush=d;var b=i.config,y=function(o,x){x=x||{},x.frag=v.frag,x.id=v.id,i.trigger(o,x)};this.observer=new f.EventEmitter,this.observer.on(S.Events.FRAG_DECRYPTED,y),this.observer.on(S.Events.ERROR,y);var _={mp4:a.isTypeSupported("video/mp4"),mpeg:a.isTypeSupported("audio/mpeg"),mp3:a.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(b.enableWorker&&typeof Worker!="undefined"){T.logger.log("demuxing in webworker");var g;try{g=this.worker=w("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(E){i.trigger(S.Events.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},g.postMessage({cmd:"init",typeSupported:_,vendor:m,id:n,config:JSON.stringify(b)})}catch(E){T.logger.warn("Error in worker:",E),T.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new C.default(this.observer,_,b,m,n),this.worker=null}}else this.transmuxer=new C.default(this.observer,_,b,m,n)}var u=s.prototype;return u.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},u.push=function(n,t,d,v,b,y,_,m,g,E){var o=this;g.transmuxing.start=self.performance.now();var x=this.transmuxer,A=this.worker,O=y?y.start:b.start,D=b.decryptdata,I=this.frag,F=!(I&&b.cc===I.cc),z=!(I&&g.level===I.level),ne=I?g.sn-I.sn:-1,j=this.part?g.part-this.part.index:1,G=!z&&(ne===1||ne===0&&j===1),X=self.performance.now();(z||ne||b.stats.parsing.start===0)&&(b.stats.parsing.start=X),y&&(j||!G)&&(y.stats.parsing.start=X);var Z=new C.TransmuxState(F,G,m,z,O);if(!G||F){T.logger.log("[transmuxer-interface, "+b.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+` discontinuity: `+F+` trackSwitch: `+z+` contiguous: `+G+` accurateTimeOffset: `+m+` timeOffset: `+O);var K=new C.TransmuxConfig(d,v,t,_,E);this.configureTransmuxer(K)}if(this.frag=b,this.part=y,A)A.postMessage({cmd:"demux",data:n,decryptdata:D,chunkMeta:g,state:Z},n instanceof ArrayBuffer?[n]:[]);else if(x){var q=x.push(n,D,g,Z);Object(C.isPromise)(q)?q.then(function(ie){o.handleTransmuxComplete(ie)}):this.handleTransmuxComplete(q)}},u.flush=function(n){var t=this;n.transmuxing.start=self.performance.now();var d=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:n});else if(d){var b=d.flush(n);Object(C.isPromise)(b)?b.then(function(y){t.handleFlushResult(y,n)}):this.handleFlushResult(b,n)}},u.handleFlushResult=function(n,t){var d=this;n.forEach(function(v){d.handleTransmuxComplete(v)}),this.onFlush(t)},u.onWorkerMessage=function(n){var t=n.data,d=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,d.trigger(t.event,t.data);break}}},u.configureTransmuxer=function(n){var t=this.worker,d=this.transmuxer;t?t.postMessage({cmd:"configure",config:n}):d&&d.configure(n)},u.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},s}()},"./src/demux/transmuxer-worker.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return h});var w=U("./src/demux/transmuxer.ts"),P=U("./src/events.ts"),S=U("./src/utils/logger.ts"),C=U("./node_modules/eventemitter3/index.js"),T=U.n(C);function h(c){var s=new C.EventEmitter,u=function(n,t){c.postMessage({event:n,data:t})};s.on(P.Events.FRAG_DECRYPTED,u),s.on(P.Events.ERROR,u),c.addEventListener("message",function(i){var n=i.data;switch(n.cmd){case"init":{var t=JSON.parse(n.config);c.transmuxer=new w.default(s,n.typeSupported,t,n.vendor,n.id),Object(S.enableLogs)(t.debug),u("init",null);break}case"configure":{c.transmuxer.configure(n.config);break}case"demux":{var d=c.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(w.isPromise)(d)?d.then(function(y){p(c,y)}):p(c,d);break}case"flush":{var v=n.chunkMeta,b=c.transmuxer.flush(v);Object(w.isPromise)(b)?b.then(function(y){l(c,y,v)}):l(c,b,v);break}default:break}})}function p(c,s){if(a(s.remuxResult))return;var u=[],i=s.remuxResult,n=i.audio,t=i.video;n&&f(u,n),t&&f(u,t),c.postMessage({event:"transmuxComplete",data:s},u)}function f(c,s){s.data1&&c.push(s.data1.buffer),s.data2&&c.push(s.data2.buffer)}function l(c,s,u){s.forEach(function(i){p(c,i)}),c.postMessage({event:"flush",data:u})}function a(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return t}),U.d(Q,"isPromise",function(){return b}),U.d(Q,"TransmuxConfig",function(){return y}),U.d(Q,"TransmuxState",function(){return _});var w=U("./src/events.ts"),P=U("./src/errors.ts"),S=U("./src/crypt/decrypter.ts"),C=U("./src/demux/aacdemuxer.ts"),T=U("./src/demux/mp4demuxer.ts"),h=U("./src/demux/tsdemuxer.ts"),p=U("./src/demux/mp3demuxer.ts"),f=U("./src/remux/mp4-remuxer.ts"),l=U("./src/remux/passthrough-remuxer.ts"),a=U("./src/demux/chunk-cache.ts"),c=U("./src/utils/mp4-tools.ts"),s=U("./src/utils/logger.ts"),u;try{u=self.performance.now.bind(self.performance)}catch(m){s.logger.debug("Unable to use Performance API on this environment"),u=self.Date.now}var i=[{demux:h.default,remux:f.default},{demux:T.default,remux:l.default},{demux:C.default,remux:f.default},{demux:p.default,remux:f.default}],n=1024;i.forEach(function(m){var g=m.demux;n=Math.max(n,g.minProbeByteLength)});var t=function(){function m(E,o,x,A,O){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new a.default,this.observer=E,this.typeSupported=o,this.config=x,this.vendor=A,this.id=O}var g=m.prototype;return g.configure=function(o){this.transmuxConfig=o,this.decrypter&&this.decrypter.reset()},g.push=function(o,x,A,O){var D=this,I=A.transmuxing;I.executeStart=u();var F=new Uint8Array(o),z=this.cache,ne=this.config,j=this.currentTransmuxState,G=this.transmuxConfig;O&&(this.currentTransmuxState=O);var X=d(F,x);if(X&&X.method==="AES-128"){var Z=this.getDecrypter();if(ne.enableSoftwareAES){var K=Z.softwareDecrypt(F,X.key.buffer,X.iv.buffer);if(!K)return I.executeEnd=u(),v(A);F=new Uint8Array(K)}else return this.decryptionPromise=Z.webCryptoDecrypt(F,X.key.buffer,X.iv.buffer).then(function(Ie){var Ne=D.push(Ie,null,A);return D.decryptionPromise=null,Ne}),this.decryptionPromise}var q=O||j,ie=q.contiguous,oe=q.discontinuity,ye=q.trackSwitch,pe=q.accurateTimeOffset,we=q.timeOffset,fe=G.audioCodec,Te=G.videoCodec,Fe=G.defaultInitPts,De=G.duration,Me=G.initSegmentData;if((oe||ye)&&this.resetInitSegment(Me,fe,Te,De),oe&&this.resetInitialTimestamp(Fe),ie||this.resetContiguity(),this.needsProbing(F,oe,ye)){if(z.dataLength){var Ue=z.flush();F=Object(c.appendUint8Array)(Ue,F)}this.configureTransmuxer(F,G)}var ve=this.transmux(F,X,we,pe,A),ce=this.currentTransmuxState;return ce.contiguous=!0,ce.discontinuity=!1,ce.trackSwitch=!1,I.executeEnd=u(),ve},g.flush=function(o){var x=this,A=o.transmuxing;A.executeStart=u();var O=this.decrypter,D=this.cache,I=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return x.flush(o)});var z=[],ne=I.timeOffset;if(O){var j=O.flush();j&&z.push(this.push(j,null,o))}var G=D.dataLength;D.reset();var X=this.demuxer,Z=this.remuxer;if(!X||!Z)return G>=n&&this.observer.emit(w.Events.ERROR,w.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),A.executeEnd=u(),[v(o)];var K=X.flush(ne);return b(K)?K.then(function(q){return x.flushRemux(z,q,o),z}):(this.flushRemux(z,K,o),z)},g.flushRemux=function(o,x,A){var O=x.audioTrack,D=x.avcTrack,I=x.id3Track,F=x.textTrack,z=this.currentTransmuxState,ne=z.accurateTimeOffset,j=z.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+A.sn+(A.part>-1?" p: "+A.part:"")+" of level "+A.level);var G=this.remuxer.remux(O,D,I,F,j,ne,!0,this.id);o.push({remuxResult:G,chunkMeta:A}),A.transmuxing.executeEnd=u()},g.resetInitialTimestamp=function(o){var x=this.demuxer,A=this.remuxer;if(!x||!A)return;x.resetTimeStamp(o),A.resetTimeStamp(o)},g.resetContiguity=function(){var o=this.demuxer,x=this.remuxer;if(!o||!x)return;o.resetContiguity(),x.resetNextTimestamp()},g.resetInitSegment=function(o,x,A,O){var D=this.demuxer,I=this.remuxer;if(!D||!I)return;D.resetInitSegment(x,A,O),I.resetInitSegment(o,x,A)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(o,x,A,O,D){var I;return x&&x.method==="SAMPLE-AES"?I=this.transmuxSampleAes(o,x,A,O,D):I=this.transmuxUnencrypted(o,A,O,D),I},g.transmuxUnencrypted=function(o,x,A,O){var D=this.demuxer.demux(o,x,!1,!this.config.progressive),I=D.audioTrack,F=D.avcTrack,z=D.id3Track,ne=D.textTrack,j=this.remuxer.remux(I,F,z,ne,x,A,!1,this.id);return{remuxResult:j,chunkMeta:O}},g.transmuxSampleAes=function(o,x,A,O,D){var I=this;return this.demuxer.demuxSampleAes(o,x,A).then(function(F){var z=I.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,A,O,!1,I.id);return{remuxResult:z,chunkMeta:D}})},g.configureTransmuxer=function(o,x){for(var A=this.config,O=this.observer,D=this.typeSupported,I=this.vendor,F=x.audioCodec,z=x.defaultInitPts,ne=x.duration,j=x.initSegmentData,G=x.videoCodec,X,Z=0,K=i.length;Z0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(E=g),E}var v=function(g){return{remuxResult:{},chunkMeta:g}};function b(m){return"then"in m&&m.then instanceof Function}var y=function(g,E,o,x,A){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=E,this.initSegmentData=o,this.duration=x,this.defaultInitPts=A},_=function(g,E,o,x,A){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=E,this.accurateTimeOffset=o,this.trackSwitch=x,this.timeOffset=A}},"./src/demux/tsdemuxer.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"discardEPB",function(){return v});var w=U("./src/demux/adts.ts"),P=U("./src/demux/mpegaudio.ts"),S=U("./src/demux/exp-golomb.ts"),C=U("./src/demux/id3.ts"),T=U("./src/demux/sample-aes.ts"),h=U("./src/events.ts"),p=U("./src/utils/mp4-tools.ts"),f=U("./src/utils/logger.ts"),l=U("./src/errors.ts"),a={video:1,audio:2,id3:3,text:4},c=function(){function b(_,m,g){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=_,this.config=m,this.typeSupported=g}b.probe=function(m){var g=b.syncOffset(m);return g<0?!1:(g&&f.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},b.syncOffset=function(m){for(var g=Math.min(1e3,m.length-3*188),E=0;E>4,fe=void 0;if(we>1){if(fe=oe+5+m[oe+4],fe===oe+188)continue}else fe=oe+4;switch(pe){case I:ye&&(F&&(x=n(F))&&this.parseAVCPES(x,!1),F={data:[],size:0}),F&&(F.data.push(m.subarray(fe,oe+188)),F.size+=oe+188-fe);break;case z:ye&&(j&&(x=n(j))&&(O.isAAC?this.parseAACPES(x):this.parseMPEGPES(x)),j={data:[],size:0}),j&&(j.data.push(m.subarray(fe,oe+188)),j.size+=oe+188-fe);break;case ne:ye&&(G&&(x=n(G))&&this.parseID3PES(x),G={data:[],size:0}),G&&(G.data.push(m.subarray(fe,oe+188)),G.size+=oe+188-fe);break;case 0:ye&&(fe+=m[fe]+1),K=this._pmtId=u(m,fe);break;case K:{ye&&(fe+=m[fe]+1);var Te=i(m,fe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);I=Te.avc,I>0&&(A.pid=I),z=Te.audio,z>0&&(O.pid=z,O.isAAC=Te.isAAC),ne=Te.id3,ne>0&&(D.pid=ne),X&&!Z&&(f.logger.log("reparse from beginning"),X=!1,oe=ie-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(h.Events.ERROR,h.Events.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});A.pesData=F,O.pesData=j,D.pesData=G;var Fe={audioTrack:O,avcTrack:A,id3Track:D,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(Fe),Fe},y.flush=function(){var m=this.remainderData;this.remainderData=null;var g;return m?g=this.demux(m,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},y.extractRemainingSamples=function(m){var g=m.audioTrack,E=m.avcTrack,o=m.id3Track,x=E.pesData,A=g.pesData,O=o.pesData,D;x&&(D=n(x))?(this.parseAVCPES(D,!0),E.pesData=null):E.pesData=x,A&&(D=n(A))?(g.isAAC?this.parseAACPES(D):this.parseMPEGPES(D),g.pesData=null):(A!=null&&A.size&&f.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=A),O&&(D=n(O))?(this.parseID3PES(D),o.pesData=null):o.pesData=O},y.demuxSampleAes=function(m,g,E){var o=this.demux(m,E,!0,!this.config.progressive),x=this.sampleAes=new T.default(this.observer,this.config,g);return this.decrypt(o,x)},y.decrypt=function(m,g){return new Promise(function(E){var o=m.audioTrack,x=m.avcTrack;o.samples&&o.isAAC?g.decryptAacSamples(o.samples,0,function(){x.samples?g.decryptAvcSamples(x.samples,0,0,function(){E(m)}):E(m)}):x.samples&&g.decryptAvcSamples(x.samples,0,0,function(){E(m)})})},y.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},y.parseAVCPES=function(m,g){var E=this,o=this._avcTrack,x=this.parseAVCNALu(m.data),A=!1,O=this.avcSample,D,I=!1;m.data=null,O&&x.length&&!o.audFound&&(t(O,o),O=this.avcSample=s(!1,m.pts,m.dts,"")),x.forEach(function(F){switch(F.type){case 1:{D=!0,O||(O=E.avcSample=s(!0,m.pts,m.dts,"")),A&&(O.debug+="NDR "),O.frame=!0;var z=F.data;if(I&&z.length>4){var ne=new S.default(z).readSliceType();(ne===2||ne===4||ne===7||ne===9)&&(O.key=!0)}break}case 5:D=!0,O||(O=E.avcSample=s(!0,m.pts,m.dts,"")),A&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{D=!0,A&&O&&(O.debug+="SEI ");var j=new S.default(v(F.data));j.readUByte();for(var G=0,X=0,Z=!1,K=0;!Z&&j.bytesAvailable>1;){G=0;do K=j.readUByte(),G+=K;while(K===255);X=0;do K=j.readUByte(),X+=K;while(K===255);if(G===4&&j.bytesAvailable!==0){Z=!0;var q=j.readUByte();if(q===181){var ie=j.readUShort();if(ie===49){var oe=j.readUInt();if(oe===1195456820){var ye=j.readUByte();if(ye===3){for(var pe=j.readUByte(),we=j.readUByte(),fe=31&pe,Te=[pe,we],Fe=0;Fe16){for(var De=[],Me=0;Me<16;Me++)De.push(j.readUByte().toString(16)),(Me===3||Me===5||Me===7||Me===9)&&De.push("-");for(var Ue=X-16,ve=new Uint8Array(Ue),ce=0;ce=0){var j={data:m.subarray(z,O-o-1),type:ne};A.push(j)}else{var G=this.getLastNalUnit();if(G&&(x&&O<=4-x&&(G.state&&(G.data=G.data.subarray(0,G.data.byteLength-x))),I=O-o-1,I>0)){var X=new Uint8Array(G.data.byteLength+I);X.set(G.data,0),X.set(m.subarray(0,I),G.data.byteLength),G.data=X,G.state=0}}O=0&&o>=0){var Z={data:m.subarray(z,g),type:ne,state:o};A.push(Z)}if(A.length===0){var K=this.getLastNalUnit();if(K){var q=new Uint8Array(K.data.byteLength+m.byteLength);q.set(K.data,0),q.set(m,K.data.byteLength),K.data=q}}return E.naluState=o,A},y.parseAACPES=function(m){var g=0,E=this._audioTrack,o=this.aacOverFlow,x=m.data;if(o){this.aacOverFlow=null;var A=o.sample.unit.byteLength,O=Math.min(o.missing,A),D=A-O;o.sample.unit.set(x.subarray(0,O),D),E.samples.push(o.sample),g=o.missing}var I,F;for(I=g,F=x.length;I1;){var A=new Uint8Array(x[0].length+x[1].length);A.set(x[0]),A.set(x[1],x[0].length),x[0]=A,x.splice(1,1)}_=x[0];var O=(_[0]<<16)+(_[1]<<8)+_[2];if(O===1){if(m=(_[4]<<8)+_[5],m&&m>b.size-6)return null;var D=_[7];D&192&&(E=(_[9]&14)*536870912+(_[10]&255)*4194304+(_[11]&254)*16384+(_[12]&255)*128+(_[13]&254)/2,D&64?(o=(_[14]&14)*536870912+(_[15]&255)*4194304+(_[16]&254)*16384+(_[17]&255)*128+(_[18]&254)/2,E-o>60*9e4&&(f.logger.warn(Math.round((E-o)/9e4)+"s delta between PTS and DTS, align them"),E=o)):o=E),g=_[8];var I=g+9;if(b.size<=I)return null;b.size-=I;for(var F=new Uint8Array(b.size),z=0,ne=x.length;zj){I-=j;continue}else _=_.subarray(I),j-=I,I=0;F.set(_,y),y+=j}return m&&(m-=g+3),{data:F,pts:E,dts:o,len:m}}return null}function t(b,y){if(b.units.length&&b.frame){if(b.pts===void 0){var _=y.samples,m=_.length;if(m){var g=_[m-1];b.pts=g.pts,b.dts=g.dts}else{y.dropped++;return}}y.samples.push(b)}b.debug.length&&f.logger.log(b.pts+"/"+b.dts+":"+b.debug)}function d(b,y){var _=b.length;if(_>0){if(y.pts>=b[_-1].pts)b.push(y);else for(var m=_-1;m>=0;m--)if(y.ptsE)return x;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,E=this.autoLevelCapping,o;return E===-1&&g&&g.length?o=g.length-1:o=E,o}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var E=this.audioTrackController;E&&(E.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var E=this.subtitleTrackController;E&&(E.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return n.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return y.defaultConfig?y.defaultConfig:s.hlsDefaultConfig},set:function(g){y.defaultConfig=g}}]),y}();b.defaultConfig=void 0},"./src/is-supported.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"isSupported",function(){return S}),U.d(Q,"changeTypeSupported",function(){return C});var w=U("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function S(){var T=Object(w.getMediaSource)();if(!T)return!1;var h=P(),p=T&&typeof T.isTypeSupported=="function"&&T.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),f=!h||h.prototype&&typeof h.prototype.appendBuffer=="function"&&typeof h.prototype.remove=="function";return!!p&&!!f}function C(){var T,h=P();return typeof(h==null||((T=h.prototype)===null||T===void 0)?void 0:T.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return c}),U.d(Q,"LoadError",function(){return u});var w=U("./src/polyfills/number.ts"),P=U("./src/errors.ts");function S(i,n){i.prototype=Object.create(n.prototype),i.prototype.constructor=i,f(i,n)}function C(i){var n=typeof Map=="function"?new Map:void 0;return C=function(d){if(d===null||!p(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(d))return n.get(d);n.set(d,v)}function v(){return T(d,arguments,l(this).constructor)}return v.prototype=Object.create(d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),f(v,d)},C(i)}function T(i,n,t){return h()?T=Reflect.construct:T=function(v,b,y){var _=[null];_.push.apply(_,b);var m=Function.bind.apply(v,_),g=new m;return y&&f(g,y.prototype),g},T.apply(null,arguments)}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function p(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function f(i,n){return f=Object.setPrototypeOf||function(d,v){return d.__proto__=v,d},f(i,n)}function l(i){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(i)}var a=Math.pow(2,17),c=function(){function i(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var n=i.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(d,v){var b=this,y=d.url;if(!y)return Promise.reject(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(y?"part list":"url")));this.abort();var _=this.config,m=_.fLoader,g=_.loader;return new Promise(function(E,o){b.loader&&b.loader.destroy();var x=b.loader=d.loader=m?new m(_):new g(_),A=s(d),O={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:a};d.stats=x.stats,x.load(A,O,{onSuccess:function(I,F,z,ne){b.resetLoader(d,x),E({frag:d,part:null,payload:I.data,networkDetails:ne})},onError:function(I,F,z){b.resetLoader(d,x),o(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:I,networkDetails:z}))},onAbort:function(I,F,z){b.resetLoader(d,x),o(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:z}))},onTimeout:function(I,F,z){b.resetLoader(d,x),o(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:z}))},onProgress:function(I,F,z,ne){v&&v({frag:d,part:null,payload:z,networkDetails:ne})}})})},n.loadPart=function(d,v,b){var y=this;this.abort();var _=this.config,m=_.fLoader,g=_.loader;return new Promise(function(E,o){y.loader&&y.loader.destroy();var x=y.loader=d.loader=m?new m(_):new g(_),A=s(d,v),O={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:a};v.stats=x.stats,x.load(A,O,{onSuccess:function(I,F,z,ne){y.resetLoader(d,x),y.updateStatsFromPart(d,v);var j={frag:d,part:v,payload:I.data,networkDetails:ne};b(j),E(j)},onError:function(I,F,z){y.resetLoader(d,x),o(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:v,response:I,networkDetails:z}))},onAbort:function(I,F,z){d.stats.aborted=v.stats.aborted,y.resetLoader(d,x),o(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:v,networkDetails:z}))},onTimeout:function(I,F,z){y.resetLoader(d,x),o(new u({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:v,networkDetails:z}))}})})},n.updateStatsFromPart=function(d,v){var b=d.stats,y=v.stats,_=y.total;if(b.loaded+=y.loaded,_){var m=Math.round(d.duration/v.duration),g=Math.min(Math.round(b.loaded/_),m),E=m-g,o=E*Math.round(b.loaded/g);b.total=b.loaded+o}else b.total=Math.max(b.loaded,b.total);var x=b.loading,A=y.loading;x.start?x.first+=A.first-A.start:(x.start=A.start,x.first=A.first),x.end=A.end},n.resetLoader=function(d,v){d.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},i}();function s(i,n){n===void 0&&(n=null);var t=n||i,d={frag:i,part:n,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},v=t.byteRangeStartOffset,b=t.byteRangeEndOffset;return Object(w.isFiniteNumber)(v)&&Object(w.isFiniteNumber)(b)&&(d.rangeStart=v,d.rangeEnd=b),d}var u=function(i){S(n,i);function n(t){for(var d,v=arguments.length,b=new Array(v>1?v-1:0),y=1;y>8*(15-_)&255;return y},d.setDecryptDataFromLevelKey=function(b,y){var _=b;return(b==null?void 0:b.method)==="AES-128"&&b.uri&&!b.iv&&(_=T.LevelKey.fromURI(b.uri),_.method=b.method,_.iv=this.createInitializationVector(y),_.keyFormat="identity"),_},d.setElementaryStreamInfo=function(b,y,_,m,g,E){E===void 0&&(E=!1);var o=this.elementaryStreams,x=o[b];if(!x){o[b]={startPTS:y,endPTS:_,startDTS:m,endDTS:g,partial:E};return}x.startPTS=Math.min(x.startPTS,y),x.endPTS=Math.max(x.endPTS,_),x.startDTS=Math.min(x.startDTS,m),x.endDTS=Math.max(x.endDTS,g)},d.clearElementaryStreamInfo=function(){var b=this.elementaryStreams;b[c.AUDIO]=null,b[c.VIDEO]=null,b[c.AUDIOVIDEO]=null},a(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var b=this.sn;typeof b!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&C.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),b=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,b)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(w.isFiniteNumber)(this.programDateTime))return null;var b=Object(w.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+b*1e3}},{key:"encrypted",get:function(){var b;return!!((b=this.decryptdata)!==null&&b!==void 0&&b.keyFormat&&this.decryptdata.uri)}}]),t}(s),i=function(n){p(t,n);function t(d,v,b,y,_){var m;m=n.call(this,b)||this,m.fragOffset=0,m.duration=0,m.gap=!1,m.independent=!1,m.relurl=void 0,m.fragment=void 0,m.index=void 0,m.stats=new h.LoadStats,m.duration=d.decimalFloatingPoint("DURATION"),m.gap=d.bool("GAP"),m.independent=d.bool("INDEPENDENT"),m.relurl=d.enumeratedString("URI"),m.fragment=v,m.index=y;var g=d.enumeratedString("BYTERANGE");return g&&m.setByteRange(g,_),_&&(m.fragOffset=_.fragOffset+_.duration),m}return a(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),t}(s)},"./src/loader/key-loader.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return C});var w=U("./src/events.ts"),P=U("./src/errors.ts"),S=U("./src/utils/logger.ts"),C=function(){function T(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var h=T.prototype;return h._registerListeners=function(){this.hls.on(w.Events.KEY_LOADING,this.onKeyLoading,this)},h._unregisterListeners=function(){this.hls.off(w.Events.KEY_LOADING,this.onKeyLoading)},h.destroy=function(){this._unregisterListeners();for(var f in this.loaders){var l=this.loaders[f];l&&l.destroy()}this.loaders={}},h.onKeyLoading=function(f,l){var a=l.frag,c=a.type,s=this.loaders[c];if(!a.decryptdata){S.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var u=a.decryptdata.uri;if(u!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(S.logger.warn("abort previous key loader for type:"+c),s.abort()),!u){S.logger.warn("key uri is falsy");return}var n=i.loader,t=a.loader=this.loaders[c]=new n(i);this.decrypturl=u,this.decryptkey=null;var d={url:u,frag:a,responseType:"arraybuffer"},v={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(d,v,b)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(w.Events.KEY_LOADED,{frag:a}))},h.loadsuccess=function(f,l,a){var c=a.frag;if(!c.decryptdata){S.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(f.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(w.Events.KEY_LOADED,{frag:c})},h.loaderror=function(f,l){var a=l.frag,c=a.loader;c&&c.abort(),delete this.loaders[a.type],this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:a,response:f})},h.loadtimeout=function(f,l){var a=l.frag,c=a.loader;c&&c.abort(),delete this.loaders[a.type],this.hls.trigger(w.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:a})},T}()},"./src/loader/level-details.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"LevelDetails",function(){return T});var w=U("./src/polyfills/number.ts");function P(h,p){for(var f=0;fl.endSN||a>0||a===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(l.misses*.6):this.misses=l.misses+1,this.availabilityDelay=l.availabilityDelay},S(h,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(w.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||C}},{key:"drift",get:function(){var l=this.driftEndTime-this.driftStartTime;if(l>0){var a=this.driftEnd-this.driftStart;return a*1e3/l}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var l;return(l=this.fragments)!==null&&l!==void 0&&l.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var l;return(l=this.partList)!==null&&l!==void 0&&l.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),h}()},"./src/loader/level-key.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"LevelKey",function(){return T});var w=U("./node_modules/url-toolkit/src/url-toolkit.js"),P=U.n(w);function S(h,p){for(var f=0;f2){var o=E.shift()+".";return o+=parseInt(E.shift()).toString(16),o+=("000"+parseInt(E.shift()).toString(16)).substr(-4),o}return g},_.resolve=function(g,E){return P.buildAbsoluteURL(E,g,{alwaysNormalize:!0})},_.parseMasterPlaylist=function(g,E){var o=[],x={},A=!1;a.lastIndex=0;for(var O;(O=a.exec(g))!=null;)if(O[1]){var D=new p.AttrList(O[1]),I={attrs:D,bitrate:D.decimalInteger("AVERAGE-BANDWIDTH")||D.decimalInteger("BANDWIDTH"),name:D.NAME,url:_.resolve(O[2],E)},F=D.decimalResolution("RESOLUTION");F&&(I.width=F.width,I.height=F.height),d((D.CODECS||"").split(/[ ,]+/).filter(function(ne){return ne}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=_.convertAVC1ToAVCOTI(I.videoCodec)),o.push(I)}else if(O[3]){var z=new p.AttrList(O[3]);z["DATA-ID"]&&(A=!0,x[z["DATA-ID"]]=z)}return{levels:o,sessionData:A?x:null}},_.parseMasterPlaylistMedia=function(g,E,o,x){x===void 0&&(x=[]);var A,O=[],D=0;for(c.lastIndex=0;(A=c.exec(g))!==null;){var I=new p.AttrList(A[1]);if(I.TYPE===o){var F={attrs:I,bitrate:0,id:D++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:o,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?_.resolve(I.URI,E):""};if(x.length){var z=_.findGroup(x,F.groupId)||x[0];v(F,z,"audioCodec"),v(F,z,"textCodec")}O.push(F)}}return O},_.parseLevelPlaylist=function(g,E,o,x,A){var O=new T.LevelDetails(E),D=O.fragments,I=null,F=0,z=0,ne=0,j=0,G=null,X=new C.Fragment(x,E),Z,K,q,ie=-1,oe=!1;for(s.lastIndex=0,O.m3u8=g;(Z=s.exec(g))!==null;){oe&&(oe=!1,X=new C.Fragment(x,E),X.start=ne,X.sn=F,X.cc=j,X.level=o,I&&(X.initSegment=I,X.rawProgramDateTime=I.rawProgramDateTime));var ye=Z[1];if(ye){X.duration=parseFloat(ye);var pe=(" "+Z[2]).slice(1);X.title=pe||null,X.tagList.push(pe?["INF",ye,pe]:["INF",ye])}else if(Z[3])Object(w.isFiniteNumber)(X.duration)&&(X.start=ne,q&&(X.levelkey=q),X.sn=F,X.level=o,X.cc=j,X.urlId=A,D.push(X),X.relurl=(" "+Z[3]).slice(1),y(X,G),G=X,ne+=X.duration,F++,z=0,oe=!0);else if(Z[4]){var we=(" "+Z[4]).slice(1);G?X.setByteRange(we,G):X.setByteRange(we)}else if(Z[5])X.rawProgramDateTime=(" "+Z[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),ie===-1&&(ie=D.length);else{if(Z=Z[0].match(u),!Z){f.logger.warn("No matches on slow regex match for level playlist!");continue}for(K=1;K-1){f.logger.warn("Keyformat "+$+" is not supported from the manifest");continue}else if($!=="identity")continue;Ne&&(q=h.LevelKey.fromURL(E,Xe),Xe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ne)>=0&&(q.method=Ne,q.keyFormat=$,N&&(q.keyID=N),k&&(q.keyFormatVersions=k),q.iv=ee));break}case"START":{var Y=new p.AttrList(Te),me=Y.decimalFloatingPoint("TIME-OFFSET");Object(w.isFiniteNumber)(me)&&(O.startTimeOffset=me);break}case"MAP":{var Ae=new p.AttrList(Te);X.relurl=Ae.URI,Ae.BYTERANGE&&X.setByteRange(Ae.BYTERANGE),X.level=o,X.sn="initSegment",q&&(X.levelkey=q),X.initSegment=null,I=X,oe=!0;break}case"SERVER-CONTROL":{var at=new p.AttrList(Te);O.canBlockReload=at.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=at.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&at.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=at.optionalFloat("PART-HOLD-BACK",0),O.holdBack=at.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Le=new p.AttrList(Te);O.partTarget=Le.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ke=O.partList;ke||(ke=O.partList=[]);var Ye=z>0?ke[ke.length-1]:void 0,Ze=z++,Ve=new C.Part(new p.AttrList(Te),X,E,Ze,Ye);ke.push(Ve),X.duration+=Ve.duration;break}case"PRELOAD-HINT":{var He=new p.AttrList(Te);O.preloadHint=He;break}case"RENDITION-REPORT":{var Pe=new p.AttrList(Te);O.renditionReports=O.renditionReports||[],O.renditionReports.push(Pe);break}default:f.logger.warn("line parsed but not handled: "+Z);break}}}G&&!G.relurl?(D.pop(),ne-=G.duration,O.partList&&(O.fragmentHint=G)):O.partList&&(y(X,G),X.cc=j,O.fragmentHint=X);var Re=D.length,Oe=D[0],he=D[Re-1];if(ne+=O.skippedSegments*O.targetduration,ne>0&&Re&&he){O.averagetargetduration=ne/Re;var be=he.sn;O.endSN=be!=="initSegment"?be:0,Oe&&(O.startCC=Oe.cc,Oe.initSegment||O.fragments.every(function(Ce){return Ce.relurl&&n(Ce.relurl)})&&(f.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new C.Fragment(x,E),X.relurl=he.relurl,X.level=o,X.sn="initSegment",Oe.initSegment=X,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(ne+=O.fragmentHint.duration),O.totalduration=ne,O.endCC=j,ie>0&&b(D,ie),O},_}();function d(_,m){["video","audio","text"].forEach(function(g){var E=_.filter(function(x){return Object(l.isCodecType)(x,g)});if(E.length){var o=E.filter(function(x){return x.lastIndexOf("avc1",0)===0||x.lastIndexOf("mp4a",0)===0});m[g+"Codec"]=o.length>0?o[0]:E[0],_=_.filter(function(x){return E.indexOf(x)===-1})}}),m.unknownCodecs=_}function v(_,m,g){var E=m[g];E&&(_[g]=E)}function b(_,m){for(var g=_[m],E=m;E--;){var o=_[E];if(!o)return;o.programDateTime=g.programDateTime-o.duration*1e3,g=o}}function y(_,m){_.rawProgramDateTime?_.programDateTime=Date.parse(_.rawProgramDateTime):m!=null&&m.programDateTime&&(_.programDateTime=m.endProgramDateTime),Object(w.isFiniteNumber)(_.programDateTime)||(_.programDateTime=null,_.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),S=U("./src/errors.ts"),C=U("./src/utils/logger.ts"),T=U("./src/utils/mp4-tools.ts"),h=U("./src/loader/m3u8-parser.ts"),p=U("./src/types/loader.ts"),f=U("./src/utils/attr-list.ts");function l(s){var u=s.type;switch(u){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function a(s,u){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=u.url),i}var c=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var u=s.prototype;return u.registerListeners=function(){var n=this.hls;n.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},u.createInternalLoader=function(n){var t=this.hls.config,d=t.pLoader,v=t.loader,b=d||v,y=new b(t);return n.loader=y,this.loaders[n.type]=y,y},u.getInternalLoader=function(n){return this.loaders[n.type]},u.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},u.destroyInternalLoaders=function(){for(var n in this.loaders){var t=this.loaders[n];t&&t.destroy(),this.resetInternalLoader(n)}},u.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},u.onManifestLoading=function(n,t){var d=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},u.onLevelLoading=function(n,t){var d=t.id,v=t.level,b=t.url,y=t.deliveryDirectives;this.load({id:d,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:b,deliveryDirectives:y})},u.onAudioTrackLoading=function(n,t){var d=t.id,v=t.groupId,b=t.url,y=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:b,deliveryDirectives:y})},u.onSubtitleTrackLoading=function(n,t){var d=t.id,v=t.groupId,b=t.url,y=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:b,deliveryDirectives:y})},u.load=function(n){var t,d=this.hls.config,v=this.getInternalLoader(n);if(v){var b=v.context;if(b&&b.url===n.url){C.logger.trace("[playlist-loader]: playlist request ongoing");return}C.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),v.abort()}var y,_,m,g;switch(n.type){case p.PlaylistContextType.MANIFEST:y=d.manifestLoadingMaxRetry,_=d.manifestLoadingTimeOut,m=d.manifestLoadingRetryDelay,g=d.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:y=0,_=d.levelLoadingTimeOut;break;default:y=d.levelLoadingMaxRetry,_=d.levelLoadingTimeOut,m=d.levelLoadingRetryDelay,g=d.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(n),(t=n.deliveryDirectives)!==null&&t!==void 0&&t.part){var E;if(n.type===p.PlaylistContextType.LEVEL&&n.level!==null?E=this.hls.levels[n.level].details:n.type===p.PlaylistContextType.AUDIO_TRACK&&n.id!==null?E=this.hls.audioTracks[n.id].details:n.type===p.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(E=this.hls.subtitleTracks[n.id].details),E){var o=E.partTarget,x=E.targetduration;o&&x&&(_=Math.min(Math.max(o*3,x*.8)*1e3,_))}}var A={timeout:_,maxRetry:y,retryDelay:m,maxRetryDelay:g,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(n,A,O)},u.loadsuccess=function(n,t,d,v){if(v===void 0&&(v=null),d.isSidxRequest){this.handleSidxRequest(n,d),this.handlePlaylistLoaded(n,t,d,v);return}this.resetInternalLoader(d.type);var b=n.data;if(b.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,d,"no EXTM3U delimiter",v);return}t.parsing.start=performance.now(),b.indexOf("#EXTINF:")>0||b.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,t,d,v):this.handleMasterPlaylist(n,t,d,v)},u.loaderror=function(n,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!1,n)},u.loadtimeout=function(n,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!0)},u.handleMasterPlaylist=function(n,t,d,v){var b=this.hls,y=n.data,_=a(n,d),m=h.default.parseMasterPlaylist(y,_),g=m.levels,E=m.sessionData;if(!g.length){this.handleManifestParsingError(n,d,"no level found in manifest",v);return}var o=g.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),x=g.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),A=h.default.parseMasterPlaylistMedia(y,_,"AUDIO",o),O=h.default.parseMasterPlaylistMedia(y,_,"SUBTITLES",x),D=h.default.parseMasterPlaylistMedia(y,_,"CLOSED-CAPTIONS");if(A.length){var I=A.some(function(F){return!F.url});!I&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(C.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),A.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new f.AttrList({}),bitrate:0,url:""}))}b.trigger(P.Events.MANIFEST_LOADED,{levels:g,audioTracks:A,subtitles:O,captions:D,url:_,stats:t,networkDetails:v,sessionData:E})},u.handleTrackOrLevelPlaylist=function(n,t,d,v){var b=this.hls,y=d.id,_=d.level,m=d.type,g=a(n,d),E=Object(w.isFiniteNumber)(y)?y:0,o=Object(w.isFiniteNumber)(_)?_:E,x=l(d),A=h.default.parseLevelPlaylist(n.data,g,o,x,E);if(!A.fragments.length){b.trigger(P.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(m===p.PlaylistContextType.MANIFEST){var O={attrs:new f.AttrList({}),bitrate:0,details:A,name:"",url:g};b.trigger(P.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:g,stats:t,networkDetails:v,sessionData:null})}if(t.parsing.end=performance.now(),A.needSidxRanges){var D,I=(D=A.fragments[0].initSegment)===null||D===void 0?void 0:D.url;this.load({url:I,isSidxRequest:!0,type:m,level:_,levelDetails:A,id:y,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=A,this.handlePlaylistLoaded(n,t,d,v)},u.handleSidxRequest=function(n,t){var d=Object(T.parseSegmentIndex)(new Uint8Array(n.data));if(!d)return;var v=d.references,b=t.levelDetails;v.forEach(function(y,_){var m=y.info,g=b.fragments[_];g.byteRange.length===0&&g.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),g.initSegment&&g.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},u.handleManifestParsingError=function(n,t,d,v){this.hls.trigger(P.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===p.PlaylistContextType.MANIFEST,url:n.url,reason:d,response:n,context:t,networkDetails:v})},u.handleNetworkError=function(n,t,d,v){d===void 0&&(d=!1),C.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var b=S.ErrorDetails.UNKNOWN,y=!1,_=this.getInternalLoader(n);switch(n.type){case p.PlaylistContextType.MANIFEST:b=d?S.ErrorDetails.MANIFEST_LOAD_TIMEOUT:S.ErrorDetails.MANIFEST_LOAD_ERROR,y=!0;break;case p.PlaylistContextType.LEVEL:b=d?S.ErrorDetails.LEVEL_LOAD_TIMEOUT:S.ErrorDetails.LEVEL_LOAD_ERROR,y=!1;break;case p.PlaylistContextType.AUDIO_TRACK:b=d?S.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,y=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:b=d?S.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:S.ErrorDetails.SUBTITLE_LOAD_ERROR,y=!1;break}_&&this.resetInternalLoader(n.type);var m={type:S.ErrorTypes.NETWORK_ERROR,details:b,fatal:y,url:n.url,loader:_,context:n,networkDetails:t};v&&(m.response=v),this.hls.trigger(P.Events.ERROR,m)},u.handlePlaylistLoaded=function(n,t,d,v){var b=d.type,y=d.level,_=d.id,m=d.groupId,g=d.loader,E=d.levelDetails,o=d.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(n,d,"invalid target duration",v);return}if(!g)return;E.live&&(g.getCacheAge&&(E.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(b){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:E,level:y||0,id:_||0,stats:t,networkDetails:v,deliveryDirectives:o});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:E,id:_||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:o});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:E,id:_||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:o});break}},s}();Q.default=c},"./src/polyfills/number.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"isFiniteNumber",function(){return w}),U.d(Q,"MAX_SAFE_INTEGER",function(){return P});var w=Number.isFinite||function(S){return typeof S=="number"&&isFinite(S)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ae,Q,U){"use strict";U.r(Q);var w=function(){function P(){}return P.getSilentFrame=function(C,T){switch(C){case"mp4a.40.2":if(T===1)return new Uint8Array([0,200,0,128,35,128]);if(T===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(T===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(T===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(T===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(T===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(T===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(T===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(T===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},P}();Q.default=w},"./src/remux/mp4-generator.ts":function(ae,Q,U){"use strict";U.r(Q);var w=Math.pow(2,32)-1,P=function(){function S(){}return S.init=function(){S.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var T;for(T in S.types)S.types.hasOwnProperty(T)&&(S.types[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);var h=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),p=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);S.HDLR_TYPES={video:h,audio:p};var f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),l=new Uint8Array([0,0,0,0,0,0,0,0]);S.STTS=S.STSC=S.STCO=l,S.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),S.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),S.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),S.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);S.FTYP=S.box(S.types.ftyp,a,s,a,c),S.DINF=S.box(S.types.dinf,S.box(S.types.dref,f))},S.box=function(T){for(var h=8,p=arguments.length,f=new Array(p>1?p-1:0),l=1;l>24&255,s[1]=h>>16&255,s[2]=h>>8&255,s[3]=h&255,s.set(T,4),a=0,h=8;a>24&255,T>>16&255,T>>8&255,T&255,p>>24,p>>16&255,p>>8&255,p&255,f>>24,f>>16&255,f>>8&255,f&255,85,196,0,0]))},S.mdia=function(T){return S.box(S.types.mdia,S.mdhd(T.timescale,T.duration),S.hdlr(T.type),S.minf(T))},S.mfhd=function(T){return S.box(S.types.mfhd,new Uint8Array([0,0,0,0,T>>24,T>>16&255,T>>8&255,T&255]))},S.minf=function(T){return T.type==="audio"?S.box(S.types.minf,S.box(S.types.smhd,S.SMHD),S.DINF,S.stbl(T)):S.box(S.types.minf,S.box(S.types.vmhd,S.VMHD),S.DINF,S.stbl(T))},S.moof=function(T,h,p){return S.box(S.types.moof,S.mfhd(T),S.traf(p,h))},S.moov=function(T){for(var h=T.length,p=[];h--;)p[h]=S.trak(T[h]);return S.box.apply(null,[S.types.moov,S.mvhd(T[0].timescale,T[0].duration)].concat(p).concat(S.mvex(T)))},S.mvex=function(T){for(var h=T.length,p=[];h--;)p[h]=S.trex(T[h]);return S.box.apply(null,[S.types.mvex].concat(p))},S.mvhd=function(T,h){h*=T;var p=Math.floor(h/(w+1)),f=Math.floor(h%(w+1)),l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,T>>24&255,T>>16&255,T>>8&255,T&255,p>>24,p>>16&255,p>>8&255,p&255,f>>24,f>>16&255,f>>8&255,f&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return S.box(S.types.mvhd,l)},S.sdtp=function(T){var h=T.samples||[],p=new Uint8Array(4+h.length),f,l;for(f=0;f>>8&255),h.push(a&255),h=h.concat(Array.prototype.slice.call(l));for(f=0;f>>8&255),p.push(a&255),p=p.concat(Array.prototype.slice.call(l));var c=S.box(S.types.avcC,new Uint8Array([1,h[3],h[4],h[5],252|3,224|T.sps.length].concat(h).concat([T.pps.length]).concat(p))),s=T.width,u=T.height,i=T.pixelRatio[0],n=T.pixelRatio[1];return S.box(S.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,S.box(S.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),S.box(S.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,n>>24,n>>16&255,n>>8&255,n&255])))},S.esds=function(T){var h=T.config.length;return new Uint8Array([0,0,0,0,3,23+h,0,1,0,4,15+h,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([h]).concat(T.config).concat([6,1,2]))},S.mp4a=function(T){var h=T.samplerate;return S.box(S.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,T.channelCount,0,16,0,0,0,0,h>>8&255,h&255,0,0]),S.box(S.types.esds,S.esds(T)))},S.mp3=function(T){var h=T.samplerate;return S.box(S.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,T.channelCount,0,16,0,0,0,0,h>>8&255,h&255,0,0]))},S.stsd=function(T){return T.type==="audio"?!T.isAAC&&T.codec==="mp3"?S.box(S.types.stsd,S.STSD,S.mp3(T)):S.box(S.types.stsd,S.STSD,S.mp4a(T)):S.box(S.types.stsd,S.STSD,S.avc1(T))},S.tkhd=function(T){var h=T.id,p=T.duration*T.timescale,f=T.width,l=T.height,a=Math.floor(p/(w+1)),c=Math.floor(p%(w+1));return S.box(S.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,h>>24&255,h>>16&255,h>>8&255,h&255,0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,c>>24,c>>16&255,c>>8&255,c&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,f>>8&255,f&255,0,0,l>>8&255,l&255,0,0]))},S.traf=function(T,h){var p=S.sdtp(T),f=T.id,l=Math.floor(h/(w+1)),a=Math.floor(h%(w+1));return S.box(S.types.traf,S.box(S.types.tfhd,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255])),S.box(S.types.tfdt,new Uint8Array([1,0,0,0,l>>24,l>>16&255,l>>8&255,l&255,a>>24,a>>16&255,a>>8&255,a&255])),S.trun(T,p.length+16+20+8+16+8+8),p)},S.trak=function(T){return T.duration=T.duration||4294967295,S.box(S.types.trak,S.tkhd(T),S.mdia(T))},S.trex=function(T){var h=T.id;return S.box(S.types.trex,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},S.trun=function(T,h){var p=T.samples||[],f=p.length,l=12+16*f,a=new Uint8Array(l),c,s,u,i,n,t;for(h+=8+l,a.set([0,0,15,1,f>>>24&255,f>>>16&255,f>>>8&255,f&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255],0),c=0;c>>24&255,u>>>16&255,u>>>8&255,u&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*c);return S.box(S.types.trun,a)},S.initSegment=function(T){S.types||S.init();var h=S.moov(T),p=new Uint8Array(S.FTYP.byteLength+h.byteLength);return p.set(S.FTYP),p.set(h,S.FTYP.byteLength),p},S}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,Q.default=P},"./src/remux/mp4-remuxer.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return t}),U.d(Q,"normalizePts",function(){return d});var w=U("./src/polyfills/number.ts"),P=U("./src/remux/aac-helper.ts"),S=U("./src/remux/mp4-generator.ts"),C=U("./src/events.ts"),T=U("./src/errors.ts"),h=U("./src/utils/logger.ts"),p=U("./src/types/loader.ts"),f=U("./src/utils/timescale-conversion.ts");function l(){return l=Object.assign||function(_){for(var m=1;m0?A:O.pts},E[0].pts);return o&&h.logger.debug("PTS rollover detected"),x},m.remux=function(E,o,x,A,O,D,I,F){var z,ne,j,G,X,Z,K=O,q=O,ie=E.pid>-1,oe=o.pid>-1,ye=o.samples.length,pe=E.samples.length>0,we=ye>1,fe=(!ie||pe)&&(!oe||we)||this.ISGenerated||I;if(fe){this.ISGenerated||(j=this.generateIS(E,o,O));var Te=this.isVideoContiguous,Fe=-1;if(we&&(Fe=v(o.samples),!Te&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,Fe>0){h.logger.warn("[mp4-remuxer]: Dropped "+Fe+" out of "+ye+" video samples due to a missing keyframe");var De=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(Fe),o.dropped+=Fe,q+=(o.samples[0].pts-De)/(o.timescale||9e4)}else Fe===-1&&(h.logger.warn("[mp4-remuxer]: No keyframe found out of "+ye+" video samples"),Z=!1);if(this.ISGenerated){if(pe&&we){var Me=this.getVideoStartPts(o.samples),Ue=d(E.samples[0].pts,Me)-Me,ve=Ue/o.inputTimeScale;K+=Math.max(0,ve),q+=Math.max(0,-ve)}if(pe){if(E.samplerate||(h.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(E,o,O)),ne=this.remuxAudio(E,K,this.isAudioContiguous,D,oe||we||F===p.PlaylistLevelType.AUDIO?q:void 0),we){var ce=ne?ne.endPTS-ne.startPTS:0;o.inputTimeScale||(h.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(E,o,O)),z=this.remuxVideo(o,q,Te,ce)}}else we&&(z=this.remuxVideo(o,q,Te,0));z&&(z.firstKeyFrame=Fe,z.independent=Fe!==-1)}}return this.ISGenerated&&(x.samples.length&&(X=this.remuxID3(x,O)),A.samples.length&&(G=this.remuxText(A,O))),{audio:ne,video:z,initSegment:j,independent:Z,text:G,id3:X}},m.generateIS=function(E,o,x){var A=E.samples,O=o.samples,D=this.typeSupported,I={},F=!Object(w.isFiniteNumber)(this._initPTS),z="audio/mp4",ne,j,G;if(F&&(ne=j=Infinity),E.config&&A.length&&(E.timescale=E.samplerate,E.isAAC||(D.mpeg?(z="audio/mpeg",E.codec=""):D.mp3&&(E.codec="mp3")),I.audio={id:"audio",container:z,codec:E.codec,initSegment:!E.isAAC&&D.mpeg?new Uint8Array(0):S.default.initSegment([E]),metadata:{channelCount:E.channelCount}},F&&(G=E.inputTimeScale,ne=j=A[0].pts-Math.round(G*x))),o.sps&&o.pps&&O.length&&(o.timescale=o.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:S.default.initSegment([o]),metadata:{width:o.width,height:o.height}},F)){G=o.inputTimeScale;var X=this.getVideoStartPts(O),Z=Math.round(G*x);j=Math.min(j,d(O[0].dts,X)-Z),ne=Math.min(ne,X-Z)}if(Object.keys(I).length)return this.ISGenerated=!0,F&&(this._initPTS=ne,this._initDTS=j),{tracks:I,initPTS:ne,timescale:G}},m.remuxVideo=function(E,o,x,A){var O=E.inputTimeScale,D=E.samples,I=[],F=D.length,z=this._initPTS,ne=this.nextAvcDts,j=8,G,X,Z,K=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,ie=0,oe=!1;if(!x||ne===null){var ye=o*O,pe=D[0].pts-d(D[0].dts,D[0].pts);ne=ye-pe}for(var we=0;wefe.pts){var Te=9e4*.2;ie=Math.max(Math.min(ie,fe.pts-fe.dts),-1*Te)}fe.dts0?we-1:we].dts&&(oe=!0)}oe&&D.sort(function(wt,st){var ut=wt.dts-st.dts,$e=wt.pts-st.pts;return ut||$e}),X=D[0].dts,Z=D[D.length-1].dts;var Fe=Math.round((Z-X)/(F-1));if(ie<0){if(ieFe,Ie=ve<-1;if(ce||Ie){ce?h.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(ve,!0)+" ms ("+ve+"dts) hole between fragments detected, filling it"):h.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(-ve,!0)+" ms ("+ve+"dts) overlapping between fragments detected"),X=ne;var Ne=D[0].pts-ve;D[0].dts=X,D[0].pts=Ne,h.logger.log("Video: First PTS/DTS adjusted: "+Object(f.toMsFromMpegTsClock)(Ne,!0)+"/"+Object(f.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(f.toMsFromMpegTsClock)(ve,!0)+" ms")}}n&&(X=Math.max(0,X));for(var Xe=0,ee=0,k=0;k0?ke-1:ke].dts;if(be.stretchShortVideoTrack&&this.nextAudioPts!==null){var xe=Math.floor(be.maxBufferHole*O),Be=(A?K+A*O:this.nextAudioPts)-Ye.pts;Be>xe?(G=Be-Ce,G<0&&(G=Ce),h.logger.log("[mp4-remuxer]: It is approximately "+Be/90+" ms to the next segment; using duration "+G/90+" ms for the last video frame.")):G=Ce}else G=Ce}var Qe=Math.round(Ye.pts-Ye.dts);I.push(new b(Ye.key,G,Ve,Qe))}if(I.length&&u&&u<70){var rt=I[0].flags;rt.dependsOn=2,rt.isNonSync=0}console.assert(G!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=ne=Z+G,this.isVideoContiguous=!0;var dt=S.default.moof(E.sequenceNumber++,X,l({},E,{samples:I})),xt="video",_t={data1:dt,data2:at,startPTS:K/O,endPTS:(q+G)/O,startDTS:X/O,endDTS:ne/O,type:xt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(at.length,"MDAT length must not be zero"),_t},m.remuxAudio=function(E,o,x,A,O){var D=E.inputTimeScale,I=E.samplerate?E.samplerate:D,F=D/I,z=E.isAAC?c:s,ne=z*F,j=this._initPTS,G=!E.isAAC&&this.typeSupported.mpeg,X=[],Z=E.samples,K=G?0:8,q=this.nextAudioPts||-1,ie=o*D;if(this.isAudioContiguous=x=x||Z.length&&q>0&&(A&&Math.abs(ie-q)<9e3||Math.abs(d(Z[0].pts-j,ie)-q)<20*ne),Z.forEach(function(Oe){Oe.pts=d(Oe.pts-j,ie)}),!x||q<0){if(Z=Z.filter(function(Oe){return Oe.pts>=0}),!Z.length)return;O===0?q=0:A?q=Math.max(0,ie):q=Z[0].pts}if(E.isAAC)for(var oe=O!==void 0,ye=this.config.maxAudioFramesDrift,pe=0,we=q;pe=ye*ne&&De0){ee+=K;try{Xe=new Uint8Array(ee)}catch(Oe){this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:T.ErrorTypes.MUX_ERROR,details:T.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ee,reason:"fail allocating audio mdat "+ee});return}if(!G){var at=new DataView(Xe.buffer);at.setUint32(0,ee),Xe.set(S.default.types.mdat,4)}}else return;Xe.set(Y,K);var Le=Y.byteLength;K+=Le,X.push(new b(!0,z,Le,0)),Ne=me}var ke=X.length;if(!ke)return;var Ye=X[X.length-1];this.nextAudioPts=q=Ne+F*Ye.duration;var Ze=G?new Uint8Array(0):S.default.moof(E.sequenceNumber++,Ie/F,l({},E,{samples:X}));E.samples=[];var Ve=Ie/D,He=q/D,Pe="audio",Re={data1:Ze,data2:Xe,startPTS:Ve,endPTS:He,startDTS:Ve,endDTS:He,type:Pe,hasAudio:!0,hasVideo:!1,nb:ke};return this.isAudioContiguous=!0,console.assert(Xe.length,"MDAT length must not be zero"),Re},m.remuxEmptyAudio=function(E,o,x,A){var O=E.inputTimeScale,D=E.samplerate?E.samplerate:O,I=O/D,F=this.nextAudioPts,z=(F!==null?F:A.startDTS*O)+this._initDTS,ne=A.endDTS*O+this._initDTS,j=I*c,G=Math.ceil((ne-z)/j),X=P.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(h.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){h.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],K=0;K4294967296;)_+=g;return _}function v(_){for(var m=0;m<_.length;m++)if(_[m].key)return m;return-1}var b=function(m,g,E,o){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=E,this.cts=o,this.flags=new y(m)},y=function(m){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=m?2:1,this.isNonSync=m?0:1}},"./src/remux/passthrough-remuxer.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/polyfills/number.ts"),P=U("./src/utils/mp4-tools.ts"),S=U("./src/loader/fragment.ts"),C=U("./src/utils/logger.ts"),T=function(){function f(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var l=f.prototype;return l.destroy=function(){},l.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},l.resetNextTimestamp=function(){this.lastEndDTS=null},l.resetInitSegment=function(c,s,u){this.audioCodec=s,this.videoCodec=u,this.generateInitSegment(c),this.emitInitSegment=!0},l.generateInitSegment=function(c){var s=this.audioCodec,u=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(P.parseInitSegment)(c);s||(s=p(i.audio,S.ElementaryStreamTypes.AUDIO)),u||(u=p(i.video,S.ElementaryStreamTypes.VIDEO));var n={};i.audio&&i.video?n.audiovideo={container:"video/mp4",codec:s+","+u,initSegment:c,id:"main"}:i.audio?n.audio={container:"audio/mp4",codec:s,initSegment:c,id:"audio"}:i.video?n.video={container:"video/mp4",codec:u,initSegment:c,id:"main"}:C.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},l.remux=function(c,s,u,i,n){var t=this.initPTS,d=this.lastEndDTS,v={audio:void 0,video:void 0,text:i,id3:u,initSegment:void 0};Object(w.isFiniteNumber)(d)||(d=this.lastEndDTS=n||0);var b=s.samples;if(!b||!b.length)return v;var y={initPTS:void 0,timescale:1},_=this.initData;if((!_||!_.length)&&(this.generateInitSegment(b),_=this.initData),!_||!_.length)return C.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(y.tracks=this.initTracks,this.emitInitSegment=!1),Object(w.isFiniteNumber)(t)||(this.initPTS=y.initPTS=t=h(_,b,d));var m=Object(P.getDuration)(b,_),g=d,E=m+g;Object(P.offsetStartDTS)(_,b,t),m>0?this.lastEndDTS=E:(C.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var o=!!_.audio,x=!!_.video,A="";o&&(A+="audio"),x&&(A+="video");var O={data1:b,startPTS:g,startDTS:g,endPTS:E,endDTS:E,type:A,hasAudio:o,hasVideo:x,nb:1,dropped:0};return v.audio=O.type==="audio"?O:void 0,v.video=O.type!=="audio"?O:void 0,v.text=i,v.id3=u,v.initSegment=y,v},f}(),h=function(l,a,c){return Object(P.getStartDTS)(l,a)-c};function p(f,l){var a=f==null?void 0:f.codec;return a&&a.length>4?a:a==="hvc1"?"hvc1.1.c.L120.90":a==="av01"?"av01.0.04M.08":a==="avc1"||l===S.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=T},"./src/task-loop.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"default",function(){return w});var w=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var S=P.prototype;return S.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},S.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},S.onHandlerDestroyed=function(){},S.hasInterval=function(){return!!this._tickInterval},S.hasNextTick=function(){return!!this._tickTimer},S.setInterval=function(T){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,T),!0)},S.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},S.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},S.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},S.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},S.doTick=function(){},P}()},"./src/types/cmcd.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"CMCDVersion",function(){return w}),U.d(Q,"CMCDObjectType",function(){return P}),U.d(Q,"CMCDStreamingFormat",function(){return S}),U.d(Q,"CMCDStreamType",function(){return C});var w=1,P;(function(T){T.MANIFEST="m",T.AUDIO="a",T.VIDEO="v",T.MUXED="av",T.INIT="i",T.CAPTION="c",T.TIMED_TEXT="tt",T.KEY="k",T.OTHER="o"})(P||(P={}));var S;(function(T){T.DASH="d",T.HLS="h",T.SMOOTH="s",T.OTHER="o"})(S||(S={}));var C;(function(T){T.VOD="v",T.LIVE="l"})(C||(C={}))},"./src/types/level.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"HlsSkip",function(){return S}),U.d(Q,"getSkipValue",function(){return C}),U.d(Q,"HlsUrlParameters",function(){return T}),U.d(Q,"Level",function(){return h});function w(p,f){for(var l=0;lNumber.MAX_SAFE_INTEGER?Infinity:f},T.hexadecimalInteger=function(p){if(this[p]){var f=(this[p]||"0x").slice(2);f=(f.length&1?"0":"")+f;for(var l=new Uint8Array(f.length/2),a=0;aNumber.MAX_SAFE_INTEGER?Infinity:f},T.decimalFloatingPoint=function(p){return parseFloat(this[p])},T.optionalFloat=function(p,f){var l=this[p];return l?parseFloat(l):f},T.enumeratedString=function(p){return this[p]},T.bool=function(p){return this[p]==="YES"},T.decimalResolution=function(p){var f=w.exec(this[p]);return f===null?void 0:{width:parseInt(f[1],10),height:parseInt(f[2],10)}},C.parseAttrList=function(p){var f,l={},a='"';for(P.lastIndex=0;(f=P.exec(p))!==null;){var c=f[2];c.indexOf(a)===0&&c.lastIndexOf(a)===c.length-1&&(c=c.slice(1,-1)),l[f[1]]=c}return l},C}()},"./src/utils/binary-search.ts":function(ae,Q,U){"use strict";U.r(Q);var w={search:function(S,C){for(var T=0,h=S.length-1,p=null,f=null;T<=h;){p=(T+h)/2|0,f=S[p];var l=C(f);if(l>0)T=p+1;else if(l<0)h=p-1;else return f}return null}};Q.default=w},"./src/utils/buffer-helper.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"BufferHelper",function(){return S});var w=U("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},S=function(){function C(){}return C.isBuffered=function(h,p){try{if(h){for(var f=C.getBuffered(h),l=0;l=f.start(l)&&p<=f.end(l))return!0}}catch(a){}return!1},C.bufferInfo=function(h,p,f){try{if(h){var l=C.getBuffered(h),a=[],c;for(c=0;cs&&(l[c-1].end=h[a].end):l.push(h[a])}else l.push(h[a])}else l=h;for(var u=0,i,n=p,t=p,d=0;d=v&&p=x&&w.logger.log(this.time+" ["+x+"] "+A)},g}(),u=function(E){for(var o=[],x=0;xT&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=T)},E.moveCursor=function(x){var A=this.pos+x;if(x>1)for(var O=this.pos+1;O=144&&this.backSpace();var A=S(x);if(this.pos>=T){this.logger.log(c.ERROR,"Cannot insert "+x.toString(16)+" ("+A+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(A,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(x){var A;for(A=x;A0&&(x?O="["+A.join(" | ")+"]":O=A.join(` `)),O},E.getTextAndFormat=function(){return this.rows},g}(),v=function(){function g(o,x,A){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=o,this.outputFilter=x,this.mode=null,this.verbose=0,this.displayedMemory=new d(A),this.nonDisplayedMemory=new d(A),this.lastOutputScreen=new d(A),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=A}var E=g.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[C-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(x){this.outputFilter=x},E.setPAC=function(x){this.writeScreen.setPAC(x)},E.setBkgData=function(x){this.writeScreen.setBkgData(x)},E.setMode=function(x){if(x===this.mode)return;this.mode=x,this.logger.log(c.INFO,"MODE="+x),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=x},E.insertChars=function(x){for(var A=0;A=46,A.italics)A.foreground="white";else{var O=Math.floor(x/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];A.foreground=D[O]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(A)),this.writeScreen.setPen(A)},E.outputDataUpdate=function(x){x===void 0&&(x=!1);var A=this.logger.time;if(A===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=A:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,A,this.lastOutputScreen),x&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:A),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(x){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,x,this.displayedMemory),this.cueStartTime=x))},g}(),b=function(){function g(o,x,A){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new s;this.channels=[null,new v(o,x,O),new v(o+1,A,O)],this.cmdHistory=m(),this.logger=O}var E=g.prototype;return E.getHandler=function(x){return this.channels[x].getHandler()},E.setHandler=function(x,A){this.channels[x].setHandler(A)},E.addData=function(x,A){var O,D,I,F=!1;this.logger.time=x;for(var z=0;z ("+u([D,I])+")"),O=this.parseCmd(D,I),O||(O=this.parseMidrow(D,I)),O||(O=this.parsePAC(D,I)),O||(O=this.parseBackgroundAttributes(D,I)),!O&&(F=this.parseChars(D,I),F)){var ne=this.currentChannel;if(ne&&ne>0){var j=this.channels[ne];j.insertChars(F)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!F&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+u([D,I])+" orig: "+u([A[z],A[z+1]]))}},E.parseCmd=function(x,A){var O=this.cmdHistory,D=(x===20||x===28||x===21||x===29)&&A>=32&&A<=47,I=(x===23||x===31)&&A>=33&&A<=35;if(!(D||I))return!1;if(_(x,A,O))return y(null,null,O),this.logger.log(c.DEBUG,"Repeated command ("+u([x,A])+") is dropped"),!0;var F=x===20||x===21||x===23?1:2,z=this.channels[F];return x===20||x===21||x===28||x===29?A===32?z.ccRCL():A===33?z.ccBS():A===34?z.ccAOF():A===35?z.ccAON():A===36?z.ccDER():A===37?z.ccRU(2):A===38?z.ccRU(3):A===39?z.ccRU(4):A===40?z.ccFON():A===41?z.ccRDC():A===42?z.ccTR():A===43?z.ccRTD():A===44?z.ccEDM():A===45?z.ccCR():A===46?z.ccENM():A===47&&z.ccEOC():z.ccTO(A-32),y(x,A,O),this.currentChannel=F,!0},E.parseMidrow=function(x,A){var O=0;if((x===17||x===25)&&A>=32&&A<=47){if(x===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[O];return D?(D.ccMIDROW(A),this.logger.log(c.DEBUG,"MIDROW ("+u([x,A])+")"),!0):!1}return!1},E.parsePAC=function(x,A){var O,D=this.cmdHistory,I=(x>=17&&x<=23||x>=25&&x<=31)&&A>=64&&A<=127,F=(x===16||x===24)&&A>=64&&A<=95;if(!(I||F))return!1;if(_(x,A,D))return y(null,null,D),!0;var z=x<=23?1:2;A>=64&&A<=95?O=z===1?h[x]:f[x]:O=z===1?p[x]:l[x];var ne=this.channels[z];return ne?(ne.setPAC(this.interpretPAC(O,A)),y(x,A,D),this.currentChannel=z,!0):!1},E.interpretPAC=function(x,A){var O,D={color:null,italics:!1,indent:null,underline:!1,row:x};return A>95?O=A-96:O=A-64,D.underline=(O&1)===1,O<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((O-16)/2)*4,D},E.parseChars=function(x,A){var O,D=null,I=null;if(x>=25?(O=2,I=x-8):(O=1,I=x),I>=17&&I<=19){var F;I===17?F=A+80:I===18?F=A+112:F=A+144,this.logger.log(c.INFO,"Special char '"+S(F)+"' in channel "+O),D=[F]}else x>=32&&x<=127&&(D=A===0?[x]:[x,A]);if(D){var z=u(D);this.logger.log(c.DEBUG,"Char codes = "+z.join(",")),y(x,A,this.cmdHistory)}return D},E.parseBackgroundAttributes=function(x,A){var O=(x===16||x===24)&&A>=32&&A<=47,D=(x===23||x===31)&&A>=45&&A<=47;if(!(O||D))return!1;var I,F={};x===16||x===24?(I=Math.floor((A-32)/2),F.background=a[I],A%2===1&&(F.background=F.background+"_semi")):A===45?F.background="transparent":(F.foreground="black",A===47&&(F.underline=!0));var z=x<=23?1:2,ne=this.channels[z];return ne.setBkgData(F),y(x,A,this.cmdHistory),!0},E.reset=function(){for(var x=0;x=16?n--:n++;var y=Object(w.fixLineBreaks)(t.trim()),_=Object(P.generateCueId)(f,l,y);(!p||!p.cues||!p.cues.getCueById(_))&&(u=new d(f,l,y),u.id=_,u.line=v+1,u.align="left",u.position=10+Math.min(80,Math.floor(n*8/32)*10),c.push(u))}return p&&c.length&&(c.sort(function(m,g){return m.line==="auto"||g.line==="auto"?0:m.line>8&&g.line>8?g.line-m.line:m.line-g.line}),c.forEach(function(m){return Object(S.addCueToTrack)(p,m)})),c}};Q.default=T},"./src/utils/discontinuities.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"findFirstFragWithCC",function(){return C}),U.d(Q,"shouldAlignOnDiscontinuities",function(){return T}),U.d(Q,"findDiscontinuousReferenceFrag",function(){return h}),U.d(Q,"adjustSlidingStart",function(){return f}),U.d(Q,"alignStream",function(){return l}),U.d(Q,"alignPDT",function(){return c}),U.d(Q,"alignFragmentByPDTDelta",function(){return s}),U.d(Q,"alignMediaPlaylistByPDT",function(){return u});var w=U("./src/polyfills/number.ts"),P=U("./src/utils/logger.ts"),S=U("./src/controller/level-helper.ts");function C(i,n){for(var t=null,d=0,v=i.length;dt.startCC||i&&i.cc=this.minWeight_},C.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},C.destroy=function(){},S}();Q.default=P},"./src/utils/ewma.ts":function(ae,Q,U){"use strict";U.r(Q);var w=function(){function P(C,T,h){T===void 0&&(T=0),h===void 0&&(h=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=C,this.alpha_=C?Math.exp(Math.log(.5)/C):0,this.estimate_=T,this.totalWeight_=h}var S=P.prototype;return S.sample=function(T,h){var p=Math.pow(this.alpha_,T);this.estimate_=h*(1-p)+p*this.estimate_,this.totalWeight_+=T},S.getTotalWeight=function(){return this.totalWeight_},S.getEstimate=function(){if(this.alpha_){var T=1-Math.pow(this.alpha_,this.totalWeight_);if(T)return this.estimate_/T}return this.estimate_},P}();Q.default=w},"./src/utils/fetch-loader.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"fetchSupported",function(){return s});var w=U("./src/polyfills/number.ts"),P=U("./src/loader/load-stats.ts"),S=U("./src/demux/chunk-cache.ts");function C(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,l(d,v)}function T(d){var v=typeof Map=="function"?new Map:void 0;return T=function(y){if(y===null||!f(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(y))return v.get(y);v.set(y,_)}function _(){return h(y,arguments,a(this).constructor)}return _.prototype=Object.create(y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),l(_,y)},T(d)}function h(d,v,b){return p()?h=Reflect.construct:h=function(_,m,g){var E=[null];E.push.apply(E,m);var o=Function.bind.apply(_,E),x=new o;return g&&l(x,g.prototype),x},h.apply(null,arguments)}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function f(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function l(d,v){return l=Object.setPrototypeOf||function(y,_){return y.__proto__=_,y},l(d,v)}function a(d){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},a(d)}function c(){return c=Object.assign||function(d){for(var v=1;v=g&&E(_,m,o.flush(),y)):E(_,m,I,y),O()}).catch(function(){return Promise.reject()})};return A()},d}();function i(d,v){var b={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(c({},d.headers))};return d.rangeEnd&&b.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),b}function n(d,v){return new self.Request(d.url,v)}var t=function(d){C(v,d);function v(b,y,_){var m;return m=d.call(this,b)||this,m.code=void 0,m.details=void 0,m.code=y,m.details=_,m}return v}(T(Error));Q.default=u},"./src/utils/imsc1-ttml-parser.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"IMSC1_CODEC",function(){return f}),U.d(Q,"parseIMSC1",function(){return s});var w=U("./src/utils/mp4-tools.ts"),P=U("./src/utils/vttparser.ts"),S=U("./src/utils/vttcue.ts"),C=U("./src/demux/id3.ts"),T=U("./src/utils/timescale-conversion.ts"),h=U("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(g){for(var E=1;E"):w}function T(f){for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c>24,v[b+1]=y>>16&255,v[b+2]=y>>8&255,v[b+3]=y&255}function l(v,b){var y=[];if(!b.length)return y;var _,m,g;"data"in v?(_=v.data,m=v.start,g=v.end):(_=v,m=0,g=_.byteLength);for(var E=m;E1?E+o:g;if(x===b[0])if(b.length===1)y.push({data:_,start:E+8,end:A});else{var O=l({data:_,start:E+8,end:A},b.slice(1));O.length&&C.apply(y,O)}E=A}return y}function a(v){var b=l(v,["moov"]),y=b[0],_=y?y.end:null,m=l(v,["sidx"]);if(!m||!m[0])return null;var g=[],E=m[0],o=E.data[0],x=o===0?8:16,A=p(E,x);x+=4;var O=0,D=0;o===0?x+=8:x+=16,x+=2;var I=E.end+D,F=h(E,x);x+=2;for(var z=0;z>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=p(E,ne);ne+=4,g.push({referenceSize:G,subsegmentDuration:Z,info:{duration:Z/A,start:I,end:I+G-1}}),I+=G,ne+=4,x=ne}return{earliestPresentationTime:O,timescale:A,version:o,referencesCount:F,references:g,moovEndOffset:_}}function c(v){for(var b=[],y=l(v,["moov","trak"]),_=0;_T)&&(this.startTime=T),this.endTime=h,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},S.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"sendAddTrackEvent",function(){return P}),U.d(Q,"addCueToTrack",function(){return S}),U.d(Q,"clearCurrentCues",function(){return C}),U.d(Q,"removeCuesInRange",function(){return T}),U.d(Q,"getCuesInRange",function(){return p});var w=U("./src/utils/logger.ts");function P(f,l){var a;try{a=new Event("addtrack")}catch(c){a=document.createEvent("Event"),a.initEvent("addtrack",!1,!1)}a.track=f,l.dispatchEvent(a)}function S(f,l){var a=f.mode;if(a==="disabled"&&(f.mode="hidden"),f.cues&&!f.cues.getCueById(l.id))try{if(f.addCue(l),!f.cues.getCueById(l.id))throw new Error("addCue is failed for: "+l)}catch(s){w.logger.debug("[texttrack-utils]: "+s);var c=new self.TextTrackCue(l.startTime,l.endTime,l.text);c.id=l.id,f.addCue(c)}a==="disabled"&&(f.mode=a)}function C(f){var l=f.mode;if(l==="disabled"&&(f.mode="hidden"),f.cues)for(var a=f.cues.length;a--;)f.removeCue(f.cues[a]);l==="disabled"&&(f.mode=l)}function T(f,l,a){var c=f.mode;if(c==="disabled"&&(f.mode="hidden"),f.cues&&f.cues.length>0)for(var s=p(f.cues,l,a),u=0;uf[a].endTime)return-1;for(var c=0,s=a;c<=s;){var u=Math.floor((s+c)/2);if(lf[u].startTime&&c-1)for(var u=s,i=f.length;u=l&&n.endTime<=a)c.push(n);else if(n.startTime>a)return c}return c}},"./src/utils/time-ranges.ts":function(ae,Q,U){"use strict";U.r(Q);var w={toString:function(S){for(var C="",T=S.length,h=0;h1?l-1:0),c=1;c100)throw new Error("Position must be between 0 and 100.");g=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",h({},s,{get:function(){return E},set:function(O){var D=T(O);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");E=D,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",h({},s,{get:function(){return o},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");o=O,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",h({},s,{get:function(){return x},set:function(O){var D=T(O);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");x=D,this.hasBeenReset=!0}})),c.displayState=void 0}return p.prototype.getCueAsHTML=function(){var f=self.WebVTT;return f.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"parseTimeStamp",function(){return S}),U.d(Q,"fixLineBreaks",function(){return l}),U.d(Q,"VTTParser",function(){return a});var w=U("./src/utils/vttcue.ts"),P=function(){function c(){}var s=c.prototype;return s.decode=function(i,n){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},c}();function S(c){function s(i,n,t,d){return(i|0)*3600+(n|0)*60+(t|0)+parseFloat(d||0)}var u=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return u?parseFloat(u[2])>59?s(u[2],u[3],0,u[4]):s(u[1],u[2],u[3],u[4]):null}var C=function(){function c(){this.values=Object.create(null)}var s=c.prototype;return s.set=function(i,n){!this.get(i)&&n!==""&&(this.values[i]=n)},s.get=function(i,n,t){return t?this.has(i)?this.values[i]:n[t]:this.has(i)?this.values[i]:n},s.has=function(i){return i in this.values},s.alt=function(i,n,t){for(var d=0;d=0&&t<=100)return this.set(i,t),!0}return!1},c}();function T(c,s,u,i){var n=i?c.split(i):[c];for(var t in n){if(typeof n[t]!="string")continue;var d=n[t].split(u);if(d.length!==2)continue;var v=d[0],b=d[1];s(v,b)}}var h=new w.default(0,0,""),p=h.align==="middle"?"middle":"center";function f(c,s,u){var i=c;function n(){var v=S(c);if(v===null)throw new Error("Malformed timestamp: "+i);return c=c.replace(/^[^\sa-zA-Z-]+/,""),v}function t(v,b){var y=new C;T(v,function(g,E){var o;switch(g){case"region":for(var x=u.length-1;x>=0;x--)if(u[x].id===E){y.set(g,u[x].region);break}break;case"vertical":y.alt(g,E,["rl","lr"]);break;case"line":o=E.split(","),y.integer(g,o[0]),y.percent(g,o[0])&&y.set("snapToLines",!1),y.alt(g,o[0],["auto"]),o.length===2&&y.alt("lineAlign",o[1],["start",p,"end"]);break;case"position":o=E.split(","),y.percent(g,o[0]),o.length===2&&y.alt("positionAlign",o[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":y.percent(g,E);break;case"align":y.alt(g,E,["start",p,"end","left","right"]);break}},/:/,/\s/),b.region=y.get("region",null),b.vertical=y.get("vertical","");var _=y.get("line","auto");_==="auto"&&h.line===-1&&(_=-1),b.line=_,b.lineAlign=y.get("lineAlign","start"),b.snapToLines=y.get("snapToLines",!0),b.size=y.get("size",100),b.align=y.get("align",p);var m=y.get("position","auto");m==="auto"&&h.position===50&&(m=b.align==="start"||b.align==="left"?0:b.align==="end"||b.align==="right"?100:50),b.position=m}function d(){c=c.replace(/^\s+/,"")}if(d(),s.startTime=n(),d(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);c=c.substr(3),d(),s.endTime=n(),d(),t(c,s)}function l(c){return c.replace(//gi,` `)}var a=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=c.prototype;return s.parse=function(i){var n=this;i&&(n.buffer+=n.decoder.decode(i,{stream:!0}));function t(){var m=n.buffer,g=0;for(m=l(m);g")===-1){n.cue.id=v;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{f(v,n.cue,n.regionList)}catch(m){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var _=v.indexOf("-->")!==-1;if(!v||_&&(y=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=` `),n.cue.text+=v}continue;case"BADCUE":v||(n.state="ID")}}}catch(m){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=` `,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){i.onparsingerror&&i.onparsingerror(n)}return i.onflush&&i.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(ae,Q,U){"use strict";U.r(Q),U.d(Q,"generateCueId",function(){return a}),U.d(Q,"parseWebVTT",function(){return s});var w=U("./src/polyfills/number.ts"),P=U("./src/utils/vttparser.ts"),S=U("./src/demux/id3.ts"),C=U("./src/utils/timescale-conversion.ts"),T=U("./src/remux/mp4-remuxer.ts"),h=/\r\n|\n\r|\n|\r/g,p=function(i,n,t){return t===void 0&&(t=0),i.substr(t,n.length)===n},f=function(i){var n=parseInt(i.substr(-3)),t=parseInt(i.substr(-6,2)),d=parseInt(i.substr(-9,2)),v=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(w.isFiniteNumber)(n)||!Object(w.isFiniteNumber)(t)||!Object(w.isFiniteNumber)(d)||!Object(w.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return n+=1e3*t,n+=60*1e3*d,n+=60*60*1e3*v,n},l=function(i){for(var n=5381,t=i.length;t;)n=n*33^i.charCodeAt(--t);return(n>>>0).toString()};function a(u,i,n){return l(u.toString())+l(i.toString())+l(n)}var c=function(i,n,t){var d=i[n],v=i[d.prevCC];if(!v||!v.new&&d.new){i.ccOffset=i.presentationOffset=d.start,d.new=!1;return}for(;(b=v)!==null&&b!==void 0&&b.new;){var b;i.ccOffset+=d.start-v.start,d.new=!1,d=v,v=i[d.prevCC]}i.presentationOffset=t};function s(u,i,n,t,d,v,b,y){var _=new P.VTTParser,m=Object(S.utf8ArrayToStr)(new Uint8Array(u)).trim().replace(h,` `).split(` `),g=[],E=Object(C.toMpegTsClockFromTimescale)(i,n),o="00:00.000",x=0,A=0,O,D=!0,I=!1;_.oncue=function(F){var z=t[d],ne=t.ccOffset,j=(x-E)/9e4;if(z!=null&&z.new&&(A!==void 0?ne=t.ccOffset=z.start:c(t,d,j)),j&&(ne=j-t.presentationOffset),I){var G=F.endTime-F.startTime,X=Object(T.normalizePts)((F.startTime+ne-A)*9e4,v*9e4)/9e4;F.startTime=X,F.endTime=X+G}var Z=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Z)),F.id||(F.id=a(F.startTime,F.endTime,Z)),F.endTime>0&&g.push(F)},_.onparsingerror=function(F){O=F},_.onflush=function(){if(O){y(O);return}b(g)},m.forEach(function(F){if(D)if(p(F,"X-TIMESTAMP-MAP=")){D=!1,I=!0,F.substr(16).split(",").forEach(function(z){p(z,"LOCAL:")?o=z.substr(6):p(z,"MPEGTS:")&&(x=parseInt(z.substr(7)))});try{A=f(o)/1e3}catch(z){I=!1,O=z}return}else F===""&&(D=!1);_.parse(F+` `)}),_.flush()}},"./src/utils/xhr-loader.ts":function(ae,Q,U){"use strict";U.r(Q);var w=U("./src/utils/logger.ts"),P=U("./src/loader/load-stats.ts"),S=/^age:\s*[\d.]+\s*$/m,C=function(){function T(p){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=p?p.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var h=T.prototype;return h.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},h.abortInternal=function(){var f=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),f&&(f.onreadystatechange=null,f.onprogress=null,f.readyState!==4&&(this.stats.aborted=!0,f.abort()))},h.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},h.load=function(f,l,a){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=f,this.config=l,this.callbacks=a,this.retryDelay=l.retryDelay,this.loadInternal()},h.loadInternal=function(){var f=this.config,l=this.context;if(!f)return;var a=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var s=this.xhrSetup;try{if(s)try{s(a,l.url)}catch(n){a.open("GET",l.url,!0),s(a,l.url)}a.readyState||a.open("GET",l.url,!0);var u=this.context.headers;if(u)for(var i in u)a.setRequestHeader(i,u[i])}catch(n){this.callbacks.onError({code:a.status,text:n.message},l,a);return}l.rangeEnd&&a.setRequestHeader("Range","bytes="+l.rangeStart+"-"+(l.rangeEnd-1)),a.onreadystatechange=this.readystatechange.bind(this),a.onprogress=this.loadprogress.bind(this),a.responseType=l.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout),a.send()},h.readystatechange=function(){var f=this.context,l=this.loader,a=this.stats;if(!f||!l)return;var c=l.readyState,s=this.config;if(a.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start)),c===4){l.onreadystatechange=null,l.onprogress=null;var u=l.status;if(u>=200&&u<300){a.loading.end=Math.max(self.performance.now(),a.loading.first);var i,n;if(f.responseType==="arraybuffer"?(i=l.response,n=i.byteLength):(i=l.responseText,n=i.length),a.loaded=a.total=n,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(a,f,i,l),!this.callbacks)return;var d={url:l.responseURL,data:i};this.callbacks.onSuccess(d,a,f,l)}else a.retry>=s.maxRetry||u>=400&&u<499?(w.logger.error(u+" while loading "+f.url),this.callbacks.onError({code:u,text:l.statusText},f,l)):(w.logger.warn(u+" while loading "+f.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),a.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},h.loadtimeout=function(){w.logger.warn("timeout while loading "+this.context.url);var f=this.callbacks;f&&(this.abortInternal(),f.onTimeout(this.stats,this.context,this.loader))},h.loadprogress=function(f){var l=this.stats;l.loaded=f.loaded,f.lengthComputable&&(l.total=f.total)},h.getCacheAge=function(){var f=null;if(this.loader&&S.test(this.loader.getAllResponseHeaders())){var l=this.loader.getResponseHeader("age");f=l?parseFloat(l):null}return f},T}();Q.default=C}}).default})},vHTk:function(Je,Ke,B){Je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return Y});var ae=B("rePB"),Q=B("VTBJ"),U=B("KQm4"),w=B("U8pU"),P=B("ODXe"),S=B("cDcd"),C=B("TSYQ"),T=B.n(C),h=B("Gytx"),p=B.n(h),f=B("Kwbf"),l=B("t23M"),a=B("qx4F"),c=B("6eGT"),s=B("IBYe"),u=B("Ff2n"),i=B("c+Xe"),n=B("fyJ8"),t=B("biw7");function d(Le,ke,Ye,Ze,Ve){var He=Ye[Le]||{},Pe=Ye[ke]||{},Re,Oe;He.fixed==="left"?Re=Ze.left[Le]:Pe.fixed==="right"&&(Oe=Ze.right[ke]);var he=!1,be=!1,Ce=!1,xe=!1,Be=Ye[ke+1],Qe=Ye[Le-1];if(Ve==="rtl"){if(Re!==void 0){var rt=Qe&&Qe.fixed==="left";xe=!rt}else if(Oe!==void 0){var dt=Be&&Be.fixed==="right";Ce=!dt}}else if(Re!==void 0){var xt=Be&&Be.fixed==="left";he=!xt}else if(Oe!==void 0){var _t=Qe&&Qe.fixed==="right";be=!_t}return{fixLeft:Re,fixRight:Oe,lastFixLeft:he,firstFixRight:be,lastFixRight:Ce,firstFixLeft:xe,isSticky:Ze.isSticky}}var v=B("sR1s");function b(Le){var ke=Le.cells,Ye=Le.stickyOffsets,Ze=Le.flattenColumns,Ve=Le.rowComponent,He=Le.cellComponent,Pe=Le.onHeaderRow,Re=Le.index,Oe=S.useContext(t.a),he=Oe.prefixCls,be=Oe.direction,Ce;Pe&&(Ce=Pe(ke.map(function(Be){return Be.column}),Re));var xe=Object(v.a)(ke.map(function(Be){return Be.column}));return S.createElement(Ve,Object.assign({},Ce),ke.map(function(Be,Qe){var rt=Be.column,dt=d(Be.colStart,Be.colEnd,Ze,Ye,be),xt;return rt&&rt.onHeaderCell&&(xt=Be.column.onHeaderCell(rt)),S.createElement(n.a,Object.assign({},Be,{ellipsis:rt.ellipsis,align:rt.align,component:He,prefixCls:he,key:xe[Qe]},dt,{additionalProps:xt,rowType:"header"}))}))}b.displayName="HeaderRow";var y=b;function _(Le){var ke=[];function Ye(Pe,Re){var Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;ke[Oe]=ke[Oe]||[];var he=Re,be=Pe.filter(Boolean).map(function(Ce){var xe={key:Ce.key,className:Ce.className||"",children:Ce.title,column:Ce,colStart:he},Be=1,Qe=Ce.children;return Qe&&Qe.length>0&&(Be=Ye(Qe,he,Oe+1).reduce(function(rt,dt){return rt+dt},0),xe.hasSubColumns=!0),"colSpan"in Ce&&(Be=Ce.colSpan),"rowSpan"in Ce&&(xe.rowSpan=Ce.rowSpan),xe.colSpan=Be,xe.colEnd=xe.colStart+Be-1,ke[Oe].push(xe),he+=Be,Be});return be}Ye(Le,0);for(var Ze=ke.length,Ve=function(Re){ke[Re].forEach(function(Oe){!("rowSpan"in Oe)&&!Oe.hasSubColumns&&(Oe.rowSpan=Ze-Re)})},He=0;He=0;Re-=1){var Oe=ke[Re],he=Ye&&Ye[Re],be=he&&he[E.a];(Oe||be||Pe)&&(Ve.unshift(S.createElement("col",Object.assign({key:Re,style:{width:Oe,minWidth:Oe}},be))),Pe=!0)}return S.createElement("colgroup",null,Ve)}var x=o;function A(Le,ke){return Object(S.useMemo)(function(){for(var Ye=[],Ze=0;Ze1?mt-1:0),fn=1;fn=Ce&&($t=Ce-xe),Pe({scrollLeft:$t/Ce*(be+2)}),_t.current.x=lt.pageX},et=function(){var lt=Object(Xe.b)(He.current).top,gt=lt+He.current.offsetHeight,kt=document.documentElement.scrollTop+window.innerHeight;gt-Object(a.a)()<=kt||lt>=kt-Re?xt(function(zt){return Object(Q.a)(Object(Q.a)({},zt),{},{isHiddenScrollBar:!0})}):xt(function(zt){return Object(Q.a)(Object(Q.a)({},zt),{},{isHiddenScrollBar:!1})})},At=function(lt){xt(function(gt){return Object(Q.a)(Object(Q.a)({},gt),{},{scrollLeft:lt/be*Ce||0})})};return S.useImperativeHandle(Ye,function(){return{setScrollLeft:At}}),S.useEffect(function(){var Ct=Object(Ne.a)(document.body,"mouseup",_e,!1),lt=Object(Ne.a)(document.body,"mousemove",ct,!1);return et(),function(){Ct.remove(),lt.remove()}},[xe,ut]),S.useEffect(function(){var Ct=Object(Ne.a)(window,"scroll",et,!1),lt=Object(Ne.a)(window,"resize",et,!1);return function(){Ct.remove(),lt.remove()}},[]),S.useEffect(function(){dt.isHiddenScrollBar||xt(function(Ct){var lt,gt;return Object(Q.a)(Object(Q.a)({},Ct),{},{scrollLeft:He.current.scrollLeft/((lt=He.current)===null||lt===void 0?void 0:lt.scrollWidth)*((gt=He.current)===null||gt===void 0?void 0:gt.clientWidth)})})},[dt.isHiddenScrollBar]),be<=Ce||!xe||dt.isHiddenScrollBar?null:S.createElement("div",{style:{height:Object(a.a)(),width:Ce,bottom:Re},className:"".concat(he,"-sticky-scroll")},S.createElement("div",{onMouseDown:je,ref:Be,className:T()("".concat(he,"-sticky-scroll-bar"),Object(ae.a)({},"".concat(he,"-sticky-scroll-bar-active"),ut)),style:{width:"".concat(xe,"px"),transform:"translate3d(".concat(dt.scrollLeft,"px, 0, 0)")}}))},k=S.forwardRef(ee);function N(Le,ke){return S.useMemo(function(){var Ye=!!Le;return{isSticky:Ye,stickyClassName:Ye?"".concat(ke,"-sticky-header"):"",offsetHeader:Object(w.a)(Le)==="object"&&Le.offsetHeader||0,offsetScroll:Object(w.a)(Le)==="object"&&Le.offsetScroll||0}},[Le,ke])}var $=[],V={},Y="rc-table-internal-hook",me=S.memo(function(Le){var ke=Le.children;return ke},function(Le,ke){return p()(Le.props,ke.props)?Le.pingLeft!==ke.pingLeft||Le.pingRight!==ke.pingRight:!1});function Ae(Le){var ke,Ye=Le.prefixCls,Ze=Le.className,Ve=Le.rowClassName,He=Le.style,Pe=Le.data,Re=Le.rowKey,Oe=Le.scroll,he=Le.tableLayout,be=Le.direction,Ce=Le.title,xe=Le.footer,Be=Le.summary,Qe=Le.id,rt=Le.showHeader,dt=Le.components,xt=Le.emptyText,_t=Le.onRow,wt=Le.onHeaderRow,st=Le.internalHooks,ut=Le.transformColumns,$e=Le.internalRefs,_e=Le.sticky,je=Pe||$,ct=!!je.length,et=S.useState(0),At=Object(P.a)(et,2),Ct=At[0],lt=At[1];S.useEffect(function(){lt(Object(a.a)())});var gt=S.useMemo(function(){return Object(v.c)(dt,{})},[dt]),kt=S.useCallback(function(Dt,Ht){return Object(v.b)(gt,Dt)||Ht},[gt]),zt=S.useMemo(function(){return typeof Re=="function"?Re:function(Dt){var Ht=Dt&&Dt[Re];return Ht}},[Re]),$t=Object(E.c)(Le),Se=$t.expandIcon,de=$t.expandedRowKeys,W=$t.defaultExpandedRowKeys,J=$t.defaultExpandAllRows,te=$t.expandedRowRender,se=$t.onExpand,Ee=$t.onExpandedRowsChange,ze=$t.expandRowByClick,qe=$t.rowExpandable,St=$t.expandIconColumnIndex,Lt=$t.expandedRowClassName,it=$t.childrenColumnName,Tt=$t.indentSize,Qt=Se||ce,Et=it||"children",nn=S.useMemo(function(){return te?"row":Le.expandable&&st===Y&&Le.expandable.__PARENT_RENDER_ICON__||je.some(function(Dt){return Dt&&Object(w.a)(Dt)==="object"&&Dt[Et]})?"nest":!1},[!!te,je]),Jt=S.useState(function(){return W||(J?Ie(je,zt,Et):[])}),It=Object(P.a)(Jt,2),yt=It[0],Sn=It[1],mt=S.useMemo(function(){return new Set(de||yt||[])},[de,yt]),ln=S.useCallback(function(Dt){var Ht=zt(Dt,je.indexOf(Dt)),jt,ht=mt.has(Ht);ht?(mt.delete(Ht),jt=Object(U.a)(mt)):jt=[].concat(Object(U.a)(mt),[Ht]),Sn(jt),se&&se(!ht,Dt),Ee&&Ee(jt)},[zt,mt,je,se,Ee]),fn=S.useState(0),Zn=Object(P.a)(fn,2),rr=Zn[0],xn=Zn[1],Er=Object(ye.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},Le),$t),{},{expandable:!!te,expandedKeys:mt,getRowKey:zt,onTriggerExpand:ln,expandIcon:Qt,expandIconColumnIndex:St,direction:be}),st===Y?ut:null),Cr=Object(P.a)(Er,2),un=Cr[0],Mn=Cr[1],Nr=S.useMemo(function(){return{columns:un,flattenColumns:Mn}},[un,Mn]),Xr=S.useRef(),xr=S.useRef(),ur=S.useRef(),gr=S.useState(!1),gi=Object(P.a)(gr,2),pr=gi[0],yr=gi[1],Or=S.useState(!1),Kr=Object(P.a)(Or,2),Sr=Kr[0],ui=Kr[1],Pr=fe(new Map),yi=Object(P.a)(Pr,2),ci=yi[0],ni=yi[1],Di=Object(v.a)(Mn),Ni=Di.map(function(Dt){return ci.get(Dt)}),Ui=S.useMemo(function(){return Ni},[Ni.join("_")]),di=De(Ui,Mn.length,be),mr=Oe&&Object(v.d)(Oe.y),dr=Oe&&Object(v.d)(Oe.x),qr=dr&&Mn.some(function(Dt){var Ht=Dt.fixed;return Ht}),ri=S.useRef(),fi=N(_e,Ye),ii=fi.isSticky,Xi=fi.offsetHeader,na=fi.offsetScroll,ai=fi.stickyClassName,Yi,Zr,Wi;mr&&(Zr={overflowY:"scroll",maxHeight:Oe.y}),dr&&(Yi={overflowX:"auto"},mr||(Zr={overflowY:"hidden"}),Wi={width:Oe.x===!0?"auto":Oe.x,minWidth:"100%"});var Pi=S.useCallback(function(Dt,Ht){ni(function(jt){var ht=new Map(jt);return ht.set(Dt,Ht),ht})},[]),Ci=Te(null),$i=Object(P.a)(Ci,2),bi=$i[0],Ji=$i[1];function Qi(Dt,Ht){if(!Ht)return;typeof Ht=="function"?Ht(Dt):Ht.scrollLeft!==Dt&&(Ht.scrollLeft=Dt)}var hi=function(Ht){var jt=Ht.currentTarget,ht=Ht.scrollLeft,ft=typeof ht=="number"?ht:jt.scrollLeft,Ft=jt||V;if(!Ji()||Ji()===Ft){var vt;bi(Ft),Qi(ft,xr.current),Qi(ft,ur.current),Qi(ft,(vt=ri.current)===null||vt===void 0?void 0:vt.setScrollLeft)}if(jt){var Zt=jt.scrollWidth,Rt=jt.clientWidth;yr(ft>0),ui(ft0?[].concat(Object(Q.a)(u),Object(Q.a)(f(d).map(function(v){return Object(U.a)({fixed:t},v)}))):[].concat(Object(Q.a)(u),[Object(U.a)(Object(U.a)({},i),{},{fixed:t})])},[])}function l(s){for(var u=!0,i=0;i=0;d-=1){var v=s[d];if(t&&v.fixed!=="right")t=!1;else if(!t&&v.fixed==="right"){Object(C.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function a(s){return s.map(function(u){var i=u.fixed,n=Object(w.a)(u,["fixed"]),t=i;return i==="left"?t="right":i==="right"&&(t="left"),Object(U.a)({fixed:t},n)})}function c(s,u){var i=s.prefixCls,n=s.columns,t=s.children,d=s.expandable,v=s.expandedKeys,b=s.getRowKey,y=s.onTriggerExpand,_=s.expandIcon,m=s.rowExpandable,g=s.expandIconColumnIndex,E=s.direction,o=s.expandRowByClick,x=P.useMemo(function(){return n||p(t)},[n,t]),A=P.useMemo(function(){if(d){var I,F=g||0,z=x[F],ne=(I={},Object(ae.a)(I,h.a,{className:"".concat(i,"-expand-icon-col")}),Object(ae.a)(I,"title",""),Object(ae.a)(I,"fixed",z?z.fixed:null),Object(ae.a)(I,"className","".concat(i,"-row-expand-icon-cell")),Object(ae.a)(I,"render",function(X,Z,K){var q=b(Z,K),ie=v.has(q),oe=m?m(Z):!0,ye=_({prefixCls:i,expanded:ie,expandable:oe,record:Z,onExpand:y});return o?P.createElement("span",{onClick:function(we){return we.stopPropagation()}},ye):ye}),I),j=x.slice();return F>=0&&j.splice(F,0,ne),j}return x},[d,x,b,v,_,E]),O=P.useMemo(function(){var I=A;return u&&(I=u(I)),I.length||(I=[{render:function(){return null}}]),I},[u,A,E]),D=P.useMemo(function(){return E==="rtl"?a(f(O)):f(O)},[O,E]);return[O,D]}Ke.b=c},wW8i:function(Je,Ke,B){Je.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(Je,Ke,B){"use strict";B.d(Ke,"a",function(){return f}),B.d(Ke,"b",function(){return a});var ae=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},U={cssFloat:1,styleFloat:1,float:1};function w(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function P(c,s,u){if(s=s.toLowerCase(),u==="auto"){if(s==="height")return c.offsetHeight;if(s==="width")return c.offsetWidth}return s in Q||(Q[s]=ae.test(s)),Q[s]?parseFloat(u)||0:u}function S(c,s){var u=arguments.length,i=w(c);return s=U[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,u===1?i:P(c,s,i[s]||c.style[s])}function C(c,s,u){var i=arguments.length;if(s=U[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,i===3)return typeof u=="number"&&ae.test(s)&&(u="".concat(u,"px")),c.style[s]=u,u;for(var n in s)s.hasOwnProperty(n)&&C(c,n,s[n]);return w(c)}function T(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function h(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function p(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:s}}function f(){var c=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:s}}function l(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function a(c){var s=c.getBoundingClientRect(),u=document.documentElement;return{left:s.left+(window.pageXOffset||u.scrollLeft)-(u.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||u.scrollTop)-(u.clientTop||document.body.clientTop||0)}}},ynwM:function(Je,Ke,B){var ae=B("MFOe"),Q=ae.Global;Je.exports={name:"oldFF-globalStorage",read:w,write:P,each:S,remove:C,clearAll:T};var U=Q.globalStorage;function w(h){return U[h]}function P(h,p){U[h]=p}function S(h){for(var p=U.length-1;p>=0;p--){var f=U.key(p);h(U[f],f)}}function C(h){return U.removeItem(h)}function T(){S(function(h,p){delete U[h]})}}}]);