|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[214,3,5,7,8,19],{"++UQ":function(nt,Xe,V){},"+NIl":function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";ce.defineMode("stex",function(ie,W){"use strict";function C(o,r){o.cmdState.push(r)}function D(o){return o.cmdState.length>0?o.cmdState[o.cmdState.length-1]:null}function T(o){var r=o.cmdState.pop();r&&r.closeBracket()}function A(o){for(var r=o.cmdState,l=r.length-1;l>=0;l--){var a=r[l];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function O(o,r,l){return function(){this.name=o,this.bracketNo=0,this.style=r,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var f={};f.importmodule=O("importmodule","tag",["string","builtin"]),f.documentclass=O("documentclass","tag",["","atom"]),f.usepackage=O("usepackage","tag",["atom"]),f.begin=O("begin","tag",["atom"]),f.end=O("end","tag",["atom"]),f.label=O("label","tag",["atom"]),f.ref=O("ref","tag",["atom"]),f.eqref=O("eqref","tag",["atom"]),f.cite=O("cite","tag",["atom"]),f.bibitem=O("bibitem","tag",["atom"]),f.Bibitem=O("Bibitem","tag",["atom"]),f.RBibitem=O("RBibitem","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function p(o,r){o.f=r}function c(o,r){var l;if(o.match(/^\\[a-zA-Z@]+/)){var a=o.current().slice(1);return l=f.hasOwnProperty(a)?f[a]:f.DEFAULT,l=new l,C(r,l),p(r,n),l.style}if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/\\]/))return"tag";if(o.match("\\["))return p(r,function(t,d){return s(t,d,"\\]")}),"keyword";if(o.match("\\("))return p(r,function(t,d){return s(t,d,"\\)")}),"keyword";if(o.match("$$"))return p(r,function(t,d){return s(t,d,"$$")}),"keyword";if(o.match("$"))return p(r,function(t,d){return s(t,d,"$")}),"keyword";var i=o.next();if(i=="%")return o.skipToEnd(),"comment";if(i=="}"||i=="]"){if(l=D(r),l)l.closeBracket(i),p(r,n);else return"error";return"bracket"}else return i=="{"||i=="["?(l=f.DEFAULT,l=new l,C(r,l),"bracket"):/\d/.test(i)?(o.eatWhile(/[\w.%]/),"atom"):(o.eatWhile(/[\w\-_]/),l=A(r),l.name=="begin"&&(l.argument=o.current()),l.styleIdentifier())}function s(o,r,l){if(o.eatSpace())return null;if(l&&o.match(l))return p(r,c),"keyword";if(o.match(/^\\[a-zA-Z@]+/))return"tag";if(o.match(/^[a-zA-Z]+/))return"variable-2";if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/]/))return"tag";if(o.match(/^[\^_&]/))return"tag";if(o.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(o.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=o.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(o.skipToEnd(),"comment"):"error"}function n(o,r){var l=o.peek(),a;return l=="{"||l=="["?(a=D(r),a.openBracket(l),o.eat(l),p(r,c),"bracket"):/[ \t\r]/.test(l)?(o.eat(l),null):(p(r,c),T(r),c(o,r))}return{startState:function(){var o=W.inMathMode?function(r,l){return s(r,l)}:c;return{cmdState:[],f:o}},copyState:function(o){return{cmdState:o.cmdState.slice(),f:o.f}},token:function(o,r){return r.f(o,r)},blankLine:function(o){o.f=c,o.cmdState.length=0},lineComment:"%"}}),ce.defineMIME("text/x-stex","stex"),ce.defineMIME("text/x-latex","stex")})},"+QRC":function(nt,Xe,V){"use strict";var ce=V("E9nw"),ie={"text/plain":"Text","text/html":"Url",default:"Text"},W="Copy to clipboard: #{key}, Enter";function C(T){var A=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return T.replace(/#{\s*key\s*}/g,A)}function D(T,A){var O,f,p,c,s,n,o=!1;A||(A={}),O=A.debug||!1;try{p=ce(),c=document.createRange(),s=document.getSelection(),n=document.createElement("span"),n.textContent=T,n.style.all="unset",n.style.position="fixed",n.style.top=0,n.style.clip="rect(0, 0, 0, 0)",n.style.whiteSpace="pre",n.style.webkitUserSelect="text",n.style.MozUserSelect="text",n.style.msUserSelect="text",n.style.userSelect="text",n.addEventListener("copy",function(l){if(l.stopPropagation(),A.format)if(l.preventDefault(),typeof l.clipboardData=="undefined"){O&&console.warn("unable to use e.clipboardData"),O&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=ie[A.format]||ie.default;window.clipboardData.setData(a,T)}else l.clipboardData.clearData(),l.clipboardData.setData(A.format,T);A.onCopy&&(l.preventDefault(),A.onCopy(l.clipboardData))}),document.body.appendChild(n),c.selectNodeContents(n),s.addRange(c);var r=document.execCommand("copy");if(!r)throw new Error("copy command was unsuccessful");o=!0}catch(l){O&&console.error("unable to copy using execCommand: ",l),O&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(A.format||"text",T),A.onCopy&&A.onCopy(window.clipboardData),o=!0}catch(a){O&&console.error("unable to copy using clipboardData: ",a),O&&console.error("falling back to prompt"),f=C("message"in A?A.message:W),window.prompt(f,T)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(c):s.removeAllRanges()),n&&document.body.removeChild(n),p()}return o}nt.exports=D},"+aKw":function(nt,Xe,V){"use strict";var ce=V("tJVT"),ie=V("cDcd"),W=V.n(ie),C=function(A){return String(A).length===1?"0".concat(A):A},D=function(A){var O=A.className,f=O===void 0?"":O,p=A.onChange,c=A.defaultValue,s=c===void 0?0:c,n=Object(ie.useState)(s),o=Object(ce.a)(n,2),r=o[0],l=o[1];Object(ie.useEffect)(function(){var d=setTimeout(function(){l(r+1e3)},1e3);return p(r+1e3),function(){clearInterval(d)}},[r]);var a=parseInt(r/(60*6e4))||"00",i=parseInt(r%(60*6e4)/6e4)||"00",t=parseInt(r%6e4/1e3)||"00";return W.a.createElement("div",{className:f},C(a),":",C(i),":",C(t))};Xe.a=D},"+ua5":function(nt,Xe,V){},"07cG":function(nt,Xe,V){nt.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(nt,Xe){var V=arguments[3],ce=arguments[4],ie=arguments[5],W=JSON.stringify;nt.exports=function(C,D){for(var T,A=Object.keys(ie),O=0,f=A.length;O<f;O++){var p=A[O],c=ie[p].exports;if(c===C||c&&c.default===C){T=p;break}}if(!T){T=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var s={},O=0,f=A.length;O<f;O++){var p=A[O];s[p]=p}ce[T]=["function(require,module,exports){"+C+"(self); }",s]}var n=Math.floor(Math.pow(16,8)*Math.random()).toString(16),o={};o[T]=T,ce[n]=["function(require,module,exports){var f = require("+W(T)+");(f.default ? f.default : f)(self);}",o];var r={};l(n);function l(y){r[y]=!0;for(var b in ce[y][1]){var g=ce[y][1][b];r[g]||l(g)}}var a="("+V+")({"+Object.keys(r).map(function(y){return W(y)+":["+ce[y][0]+","+W(ce[y][1])+"]"}).join(",")+"},{},["+W(n)+"])",i=window.URL||window.webkitURL||window.mozURL||window.msURL,t=new Blob([a],{type:"text/javascript"});if(D&&D.bare)return t;var d=i.createObjectURL(t),v=new Worker(d);return v.objectURL=d,v}},"19Vz":function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){ce.defineOption("placeholder","",function(O,f,p){var c=p&&p!=ce.Init;if(f&&!c)O.on("blur",D),O.on("change",T),O.on("swapDoc",T),ce.on(O.getInputField(),"compositionupdate",O.state.placeholderCompose=function(){C(O)}),T(O);else if(!f&&c){O.off("blur",D),O.off("change",T),O.off("swapDoc",T),ce.off(O.getInputField(),"compositionupdate",O.state.placeholderCompose),ie(O);var s=O.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}f&&!O.hasFocus()&&D(O)});function ie(O){O.state.placeholder&&(O.state.placeholder.parentNode.removeChild(O.state.placeholder),O.state.placeholder=null)}function W(O){ie(O);var f=O.state.placeholder=document.createElement("pre");f.style.cssText="height: 0; overflow: visible",f.style.direction=O.getOption("direction"),f.className="CodeMirror-placeholder CodeMirror-line-like";var p=O.getOption("placeholder");typeof p=="string"&&(p=document.createTextNode(p)),f.appendChild(p),O.display.lineSpace.insertBefore(f,O.display.lineSpace.firstChild)}function C(O){setTimeout(function(){var f=!1,p=O.getInputField();p.nodeName=="TEXTAREA"?f=!p.value:O.lineCount()==1&&(f=!/[^\u200b]/.test(p.querySelector(".CodeMirror-line").textContent)),f?W(O):ie(O)},20)}function D(O){A(O)&&W(O)}function T(O){var f=O.getWrapperElement(),p=A(O);f.className=f.className.replace(" CodeMirror-empty","")+(p?" CodeMirror-empty":""),p?W(O):ie(O)}function A(O){return O.lineCount()===1&&O.getLine(0)===""}})},"1FX+":function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";var ie={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},W={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ce.defineMode("xml",function(C,D){var T=C.indentUnit,A={},O=D.htmlMode?ie:W;for(var f in O)A[f]=O[f];for(var f in D)A[f]=D[f];var p,c;function s(E,S){function w(F){return S.tokenize=F,F(E,S)}var R=E.next();if(R=="<")return E.eat("!")?E.eat("[")?E.match("CDATA[")?w(r("atom","]]>")):null:E.match("--")?w(r("comment","-->")):E.match("DOCTYPE",!0,!0)?(E.eatWhile(/[\w\._\-]/),w(l(1))):null:E.eat("?")?(E.eatWhile(/[\w\._\-]/),S.tokenize=r("meta","?>"),"meta"):(p=E.eat("/")?"closeTag":"openTag",S.tokenize=n,"tag bracket");if(R=="&"){var N;return E.eat("#")?E.eat("x")?N=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";"):N=E.eatWhile(/[\d]/)&&E.eat(";"):N=E.eatWhile(/[\w\.\-:]/)&&E.eat(";"),N?"atom":"error"}else return E.eatWhile(/[^&<]/),null}s.isInText=!0;function n(E,S){var w=E.next();if(w==">"||w=="/"&&E.eat(">"))return S.tokenize=s,p=w==">"?"endTag":"selfcloseTag","tag bracket";if(w=="=")return p="equals",null;if(w=="<"){S.tokenize=s,S.state=d,S.tagName=S.tagStart=null;var R=S.tokenize(E,S);return R?R+" tag error":"tag error"}else return/[\'\"]/.test(w)?(S.tokenize=o(w),S.stringStartCol=E.column(),S.tokenize(E,S)):(E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(E){var S=function(w,R){for(;!w.eol();)if(w.next()==E){R.tokenize=n;break}return"string"};return S.isInAttribute=!0,S}function r(E,S){return function(w,R){for(;!w.eol();){if(w.match(S)){R.tokenize=s;break}w.next()}return E}}function l(E){return function(S,w){for(var R;(R=S.next())!=null;){if(R=="<")return w.tokenize=l(E+1),w.tokenize(S,w);if(R==">")if(E==1){w.tokenize=s;break}else return w.tokenize=l(E-1),w.tokenize(S,w)}return"meta"}}function a(E,S,w){this.prev=E.context,this.tagName=S,this.indent=E.indented,this.startOfLine=w,(A.doNotIndent.hasOwnProperty(S)||E.context&&E.context.noIndent)&&(this.noIndent=!0)}function i(E){E.context&&(E.context=E.context.prev)}function t(E,S){for(var w;;){if(!E.context)return;if(w=E.context.tagName,!A.contextGrabbers.hasOwnProperty(w)||!A.contextGrabbers[w].hasOwnProperty(S))return;i(E)}}function d(E,S,w){return E=="openTag"?(w.tagStart=S.column(),v):E=="closeTag"?y:d}function v(E,S,w){return E=="word"?(w.tagName=S.current(),c="tag",m):A.allowMissingTagName&&E=="endTag"?(c="tag bracket",m(E,S,w)):(c="error",v)}function y(E,S,w){if(E=="word"){var R=S.current();return w.context&&w.context.tagName!=R&&A.implicitlyClosed.hasOwnProperty(w.context.tagName)&&i(w),w.context&&w.context.tagName==R||A.matchClosing===!1?(c="tag",b):(c="tag error",g)}else return A.allowMissingTagName&&E=="endTag"?(c="tag bracket",b(E,S,w)):(c="error",g)}function b(E,S,w){return E!="endTag"?(c="error",b):(i(w),d)}function g(E,S,w){return c="error",b(E,S,w)}function m(E,S,w){if(E=="word")return c="attribute",_;if(E=="endTag"||E=="selfcloseTag"){var R=w.tagName,N=w.tagStart;return w.tagName=w.tagStart=null,E=="selfcloseTag"||A.autoSelfClosers.hasOwnProperty(R)?t(w,R):(t(w,R),w.context=new a(w,R,N==w.indented)),d}return c="error",m}function _(E,S,w){return E=="equals"?x:(A.allowMissing||(c="error"),m(E,S,w))}function x(E,S,w){return E=="string"?h:E=="word"&&A.allowUnquoted?(c="string",m):(c="error",m(E,S,w))}function h(E,S,w){return E=="string"?h:m(E,S,w)}return{startState:function(E){var S={tokenize:s,state:d,indented:E||0,tagName:null,tagStart:null,context:null};return E!=null&&(S.baseIndent=E),S},token:function(E,S){if(!S.tagName&&E.sol()&&(S.indented=E.indentation()),E.eatSpace())return null;p=null;var w=S.tokenize(E,S);return(w||p)&&w!="comment"&&(c=null,S.state=S.state(p||w,E,S),c&&(w=c=="error"?w+" error":c)),w},indent:function(E,S,w){var R=E.context;if(E.tokenize.isInAttribute)return E.tagStart==E.indented?E.stringStartCol+1:E.indented+T;if(R&&R.noIndent)return ce.Pass;if(E.tokenize!=n&&E.tokenize!=s)return w?w.match(/^(\s*)/)[0].length:0;if(E.tagName)return A.multilineTagIndentPastTag!==!1?E.tagStart+E.tagName.length+2:E.tagStart+T*(A.multilineTagIndentFactor||1);if(A.alignCDATA&&/<!\[CDATA\[/.test(S))return 0;var N=S&&/^<(\/)?([\w_:\.-]*)/.exec(S);if(N&&N[1])for(;R;)if(R.tagName==N[2]){R=R.prev;break}else if(A.implicitlyClosed.hasOwnProperty(R.tagName))R=R.prev;else break;else if(N)for(;R;){var F=A.contextGrabbers[R.tagName];if(F&&F.hasOwnProperty(N[2]))R=R.prev;else break}for(;R&&R.prev&&!R.startOfLine;)R=R.prev;return R?R.indent+T:E.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:A.htmlMode?"html":"xml",helperType:A.htmlMode?"html":"xml",skipAttribute:function(E){E.state==x&&(E.state=m)},xmlCurrentTag:function(E){return E.tagName?{name:E.tagName,close:E.type=="closeTag"}:null},xmlCurrentContext:function(E){for(var S=[],w=E.context;w;w=w.prev)w.tagName&&S.push(w.tagName);return S.reverse()}}}),ce.defineMIME("text/xml","xml"),ce.defineMIME("application/xml","xml"),ce.mimeModes.hasOwnProperty("text/html")||ce.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(nt,Xe,V){"use strict";V.d(Xe,"d",function(){return ee}),V.d(Xe,"b",function(){return Ve}),V.d(Xe,"c",function(){return _t}),V.d(Xe,"a",function(){return Bt});var ce=V("VTBJ"),ie=V("1OyB"),W=V("vuIU"),C=V("JX7q"),D=V("Ji7U"),T=V("LK+K"),A=V("cDcd"),O=V("I8Z2"),f=V("BGR+"),p=V("wx14"),c=V("rePB"),s=V("4IlW"),n=V("2GS6"),o=V("Gytx"),r=V.n(o),l=V("TSYQ"),a=V.n(l),i=V("U8pU"),t=V("ODXe"),d=/iPhone/i,v=/iPod/i,y=/iPad/i,b=/\bAndroid(?:.+)Mobile\b/i,g=/Android/i,m=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,x=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,E=/BlackBerry/i,S=/BB10/i,w=/Opera Mini/i,R=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function F(At,pt){return At.test(pt)}function z(At){var pt=At||(typeof navigator!="undefined"?navigator.userAgent:""),gt=pt.split("[FBAN");if(typeof gt[1]!="undefined"){var rt=gt,Oe=Object(t.a)(rt,1);pt=Oe[0]}if(gt=pt.split("Twitter"),typeof gt[1]!="undefined"){var ze=gt,vt=Object(t.a)(ze,1);pt=vt[0]}var st={apple:{phone:F(d,pt)&&!F(x,pt),ipod:F(v,pt),tablet:!F(d,pt)&&F(y,pt)&&!F(x,pt),device:(F(d,pt)||F(v,pt)||F(y,pt))&&!F(x,pt)},amazon:{phone:F(m,pt),tablet:!F(m,pt)&&F(_,pt),device:F(m,pt)||F(_,pt)},android:{phone:!F(x,pt)&&F(m,pt)||!F(x,pt)&&F(b,pt),tablet:!F(x,pt)&&!F(m,pt)&&!F(b,pt)&&(F(_,pt)||F(g,pt)),device:!F(x,pt)&&(F(m,pt)||F(_,pt)||F(b,pt)||F(g,pt))||F(/\bokhttp\b/i,pt)},windows:{phone:F(x,pt),tablet:F(h,pt),device:F(x,pt)||F(h,pt)},other:{blackberry:F(E,pt),blackberry10:F(S,pt),opera:F(w,pt),firefox:F(N,pt),chrome:F(R,pt),device:F(E,pt)||F(S,pt)||F(w,pt)||F(N,pt)||F(R,pt)},any:null,phone:null,tablet:null};return st.any=st.apple.device||st.android.device||st.windows.device||st.other.device,st.phone=st.apple.phone||st.android.phone||st.windows.phone,st.tablet=st.apple.tablet||st.android.tablet||st.windows.tablet,st}var q=Object(ce.a)(Object(ce.a)({},z()),{},{isMobile:z}),B=q;function M(){}function G(At,pt,gt){var rt=pt||"";return At.key||"".concat(rt,"item_").concat(gt)}function J(At){return"".concat(At,"-menu-")}function K(At,pt){var gt=-1;A.Children.forEach(At,function(rt){gt+=1,rt&&rt.type&&rt.type.isMenuItemGroup?A.Children.forEach(rt.props.children,function(Oe){gt+=1,pt(Oe,gt)}):pt(rt,gt)})}function Z(At,pt,gt){if(!At||gt.find)return;A.Children.forEach(At,function(rt){if(rt){var Oe=rt.type;if(!Oe||!(Oe.isSubMenu||Oe.isMenuItem||Oe.isMenuItemGroup))return;pt.indexOf(rt.key)!==-1?gt.find=!0:rt.props.children&&Z(rt.props.children,pt,gt)}})}var le=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],de=function(pt){var gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rt=pt&&typeof pt.getBoundingClientRect=="function"&&pt.getBoundingClientRect().width;if(rt){if(gt){var Oe=getComputedStyle(pt),ze=Oe.marginLeft,vt=Oe.marginRight;rt+=+ze.replace("px","")+ +vt.replace("px","")}rt=+rt.toFixed(6)}return rt||0},Te=function(pt,gt,rt){pt&&Object(i.a)(pt.style)==="object"&&(pt.style[gt]=rt)},we=function(){return B.any},Ie=V("KQm4"),_e=V("Ff2n"),ye=V("faye"),Ke=V("bdgK"),Me=V("uciX"),Fe=V("8XRh"),Ge={adjustX:1,adjustY:1},Ee={topLeft:{points:["bl","tl"],overflow:Ge,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ge,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Ge,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Ge,offset:[4,0]}},me={topLeft:{points:["bl","tl"],overflow:Ge,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ge,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Ge,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Ge,offset:[4,0]}},We=Ee,He=0,it={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},re=function(pt,gt,rt){var Oe=J(gt),ze=pt.getState();pt.setState({defaultActiveFirst:Object(ce.a)(Object(ce.a)({},ze.defaultActiveFirst),{},Object(c.a)({},Oe,rt))})},P=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(rt){var Oe;Object(ie.a)(this,gt),Oe=pt.call(this,rt),Oe.onDestroy=function(Ze){Oe.props.onDestroy(Ze)},Oe.onKeyDown=function(Ze){var mt=Ze.keyCode,Lt=Oe.menuInstance,Mt=Oe.props,$t=Mt.isOpen,Re=Mt.store;if(mt===s.a.ENTER)return Oe.onTitleClick(Ze),re(Re,Oe.props.eventKey,!0),!0;if(mt===s.a.RIGHT)return $t?Lt.onKeyDown(Ze):(Oe.triggerOpenChange(!0),re(Re,Oe.props.eventKey,!0)),!0;if(mt===s.a.LEFT){var ve;if($t)ve=Lt.onKeyDown(Ze);else return;return ve||(Oe.triggerOpenChange(!1),ve=!0),ve}return $t&&(mt===s.a.UP||mt===s.a.DOWN)?Lt.onKeyDown(Ze):void 0},Oe.onOpenChange=function(Ze){Oe.props.onOpenChange(Ze)},Oe.onPopupVisibleChange=function(Ze){Oe.triggerOpenChange(Ze,Ze?"mouseenter":"mouseleave")},Oe.onMouseEnter=function(Ze){var mt=Oe.props,Lt=mt.eventKey,Mt=mt.onMouseEnter,$t=mt.store;re($t,Oe.props.eventKey,!1),Mt({key:Lt,domEvent:Ze})},Oe.onMouseLeave=function(Ze){var mt=Oe.props,Lt=mt.parentMenu,Mt=mt.eventKey,$t=mt.onMouseLeave;Lt.subMenuInstance=Object(C.a)(Oe),$t({key:Mt,domEvent:Ze})},Oe.onTitleMouseEnter=function(Ze){var mt=Oe.props,Lt=mt.eventKey,Mt=mt.onItemHover,$t=mt.onTitleMouseEnter;Mt({key:Lt,hover:!0}),$t({key:Lt,domEvent:Ze})},Oe.onTitleMouseLeave=function(Ze){var mt=Oe.props,Lt=mt.parentMenu,Mt=mt.eventKey,$t=mt.onItemHover,Re=mt.onTitleMouseLeave;Lt.subMenuInstance=Object(C.a)(Oe),$t({key:Mt,hover:!1}),Re({key:Mt,domEvent:Ze})},Oe.onTitleClick=function(Ze){var mt=Object(C.a)(Oe),Lt=mt.props;if(Lt.onTitleClick({key:Lt.eventKey,domEvent:Ze}),Lt.triggerSubMenuAction==="hover")return;Oe.triggerOpenChange(!Lt.isOpen,"click"),re(Lt.store,Oe.props.eventKey,!1)},Oe.onSubMenuClick=function(Ze){typeof Oe.props.onClick=="function"&&Oe.props.onClick(Oe.addKeyPath(Ze))},Oe.onSelect=function(Ze){Oe.props.onSelect(Ze)},Oe.onDeselect=function(Ze){Oe.props.onDeselect(Ze)},Oe.getPrefixCls=function(){return"".concat(Oe.props.rootPrefixCls,"-submenu")},Oe.getActiveClassName=function(){return"".concat(Oe.getPrefixCls(),"-active")},Oe.getDisabledClassName=function(){return"".concat(Oe.getPrefixCls(),"-disabled")},Oe.getSelectedClassName=function(){return"".concat(Oe.getPrefixCls(),"-selected")},Oe.getOpenClassName=function(){return"".concat(Oe.props.rootPrefixCls,"-submenu-open")},Oe.saveMenuInstance=function(Ze){Oe.menuInstance=Ze},Oe.addKeyPath=function(Ze){return Object(ce.a)(Object(ce.a)({},Ze),{},{keyPath:(Ze.keyPath||[]).concat(Oe.props.eventKey)})},Oe.triggerOpenChange=function(Ze,mt){var Lt=Oe.props.eventKey,Mt=function(){Oe.onOpenChange({key:Lt,item:Object(C.a)(Oe),trigger:mt,open:Ze})};mt==="mouseenter"?Oe.mouseenterTimeout=setTimeout(function(){Mt()},0):Mt()},Oe.isChildrenSelected=function(){var Ze={find:!1};return Z(Oe.props.children,Oe.props.selectedKeys,Ze),Ze.find},Oe.isOpen=function(){return Oe.props.openKeys.indexOf(Oe.props.eventKey)!==-1},Oe.adjustWidth=function(){if(!Oe.subMenuTitle||!Oe.menuInstance)return;var Ze=ye.findDOMNode(Oe.menuInstance);if(Ze.offsetWidth>=Oe.subMenuTitle.offsetWidth)return;Ze.style.minWidth="".concat(Oe.subMenuTitle.offsetWidth,"px")},Oe.saveSubMenuTitle=function(Ze){Oe.subMenuTitle=Ze},Oe.getBaseProps=function(){var Ze=Object(C.a)(Oe),mt=Ze.props;return{mode:mt.mode==="horizontal"?"vertical":mt.mode,visible:Oe.props.isOpen,level:mt.level+1,inlineIndent:mt.inlineIndent,focusable:!1,onClick:Oe.onSubMenuClick,onSelect:Oe.onSelect,onDeselect:Oe.onDeselect,onDestroy:Oe.onDestroy,selectedKeys:mt.selectedKeys,eventKey:"".concat(mt.eventKey,"-menu-"),openKeys:mt.openKeys,motion:mt.motion,onOpenChange:Oe.onOpenChange,subMenuOpenDelay:mt.subMenuOpenDelay,parentMenu:Object(C.a)(Oe),subMenuCloseDelay:mt.subMenuCloseDelay,forceSubMenuRender:mt.forceSubMenuRender,triggerSubMenuAction:mt.triggerSubMenuAction,builtinPlacements:mt.builtinPlacements,defaultActiveFirst:mt.store.getState().defaultActiveFirst[J(mt.eventKey)],multiple:mt.multiple,prefixCls:mt.rootPrefixCls,id:Oe.internalMenuId,manualRef:Oe.saveMenuInstance,itemIcon:mt.itemIcon,expandIcon:mt.expandIcon,direction:mt.direction}},Oe.getMotion=function(Ze,mt){var Lt=Object(C.a)(Oe),Mt=Lt.haveRendered,$t=Oe.props,Re=$t.motion,ve=$t.rootPrefixCls,X=Object(ce.a)(Object(ce.a)({},Re),{},{leavedClassName:"".concat(ve,"-hidden"),removeOnLeave:!1,motionAppear:Mt||!mt||Ze!=="inline"});return X};var ze=rt.store,vt=rt.eventKey,st=ze.getState(),It=st.defaultActiveFirst;Oe.isRootMenu=!1;var Pt=!1;return It&&(Pt=It[vt]),re(ze,vt,Pt),Oe}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Oe=this,ze=this.props,vt=ze.mode,st=ze.parentMenu,It=ze.manualRef;if(It&&It(this),vt!=="horizontal"||!st.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return Oe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Oe=this.props,ze=Oe.onDestroy,vt=Oe.eventKey;ze&&ze(vt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(Oe){var ze=this,vt=this.getBaseProps(),st=this.getMotion(vt.mode,vt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||vt.visible||vt.forceSubMenuRender,!this.haveOpened)return A.createElement("div",null);var It=vt.direction;return A.createElement(Fe.default,Object.assign({visible:vt.visible},st),function(Pt){var Ze=Pt.className,mt=Pt.style,Lt=a()("".concat(vt.prefixCls,"-sub"),Ze,Object(c.a)({},"".concat(vt.prefixCls,"-rtl"),It==="rtl"));return A.createElement(je,Object.assign({},vt,{id:ze.internalMenuId,className:Lt,style:mt}),Oe)})}},{key:"render",value:function(){var Oe,ze=Object(ce.a)({},this.props),vt=ze.isOpen,st=this.getPrefixCls(),It=ze.mode==="inline",Pt=a()(st,"".concat(st,"-").concat(ze.mode),(Oe={},Object(c.a)(Oe,ze.className,!!ze.className),Object(c.a)(Oe,this.getOpenClassName(),vt),Object(c.a)(Oe,this.getActiveClassName(),ze.active||vt&&!It),Object(c.a)(Oe,this.getDisabledClassName(),ze.disabled),Object(c.a)(Oe,this.getSelectedClassName(),this.isChildrenSelected()),Oe));this.internalMenuId||(ze.eventKey?this.internalMenuId="".concat(ze.eventKey,"$Menu"):(He+=1,this.internalMenuId="$__$".concat(He,"$Menu")));var Ze={},mt={},Lt={};ze.disabled||(Ze={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mt={onClick:this.onTitleClick},Lt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Mt={},$t=ze.direction;It&&($t==="rtl"?Mt.paddingRight=ze.inlineIndent*ze.level:Mt.paddingLeft=ze.inlineIndent*ze.level);var Re={};this.props.isOpen&&(Re={"aria-owns":this.internalMenuId});var ve=null;ze.mode!=="horizontal"&&(ve=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ve=A.createElement(this.props.expandIcon,Object(ce.a)({},this.props))));var X=A.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Mt,className:"".concat(st,"-title"),role:"button"},Lt,mt,{"aria-expanded":vt},Re,{"aria-haspopup":"true",title:typeof ze.title=="string"?ze.title:void 0}),ze.title,ve||A.createElement("i",{className:"".concat(st,"-arrow")})),ne=this.renderChildren(ze.children),oe=ze.parentMenu.isRootMenu?ze.parentMenu.props.getPopupContainer:function(hn){return hn.parentNode},he=it[ze.mode],Ae=ze.popupOffset?{offset:ze.popupOffset}:{},Qe=ze.mode==="inline"?"":ze.popupClassName;Qe+=$t==="rtl"?" ".concat(st,"-rtl"):"";var ot=ze.disabled,Rt=ze.triggerSubMenuAction,Nt=ze.subMenuOpenDelay,ht=ze.forceSubMenuRender,Dt=ze.subMenuCloseDelay,sn=ze.builtinPlacements;le.forEach(function(hn){return delete ze[hn]}),delete ze.onClick;var Ct=$t==="rtl"?Object.assign({},me,sn):Object.assign({},Ee,sn);return delete ze.direction,A.createElement("li",Object.assign({},ze,Ze,{className:Pt,role:"menuitem"}),It&&X,It&&ne,!It&&A.createElement(Me.a,{prefixCls:st,popupClassName:a()("".concat(st,"-popup"),Qe),getPopupContainer:oe,builtinPlacements:Ct,popupPlacement:he,popupVisible:vt,popupAlign:Ae,popup:ne,action:ot?[]:[Rt],mouseEnterDelay:Nt,mouseLeaveDelay:Dt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ht},X))}}]),gt}(A.Component);P.defaultProps={onMouseEnter:M,onMouseLeave:M,onTitleMouseEnter:M,onTitleMouseLeave:M,onTitleClick:M,manualRef:M,mode:"vertical",title:""};var j=Object(O.b)(function(At,pt){var gt=At.openKeys,rt=At.activeKey,Oe=At.selectedKeys,ze=pt.eventKey,vt=pt.subMenuKey;return{isOpen:gt.indexOf(ze)>-1,active:rt[vt]===ze,selectedKeys:Oe}})(P);j.isSubMenu=!0;var ee=j,$="menuitem-overflowed",Q=.5,xe=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(){var rt;return Object(ie.a)(this,gt),rt=pt.apply(this,arguments),rt.resizeObserver=null,rt.mutationObserver=null,rt.originalTotalWidth=0,rt.overflowedItems=[],rt.menuItemSizes=[],rt.cancelFrameId=null,rt.state={lastVisibleIndex:void 0},rt.getMenuItemNodes=function(){var Oe=rt.props.prefixCls,ze=ye.findDOMNode(Object(C.a)(rt));return ze?[].slice.call(ze.children).filter(function(vt){return vt.className.split(" ").indexOf("".concat(Oe,"-overflowed-submenu"))<0}):[]},rt.getOverflowedSubMenuItem=function(Oe,ze,vt){var st=rt.props,It=st.overflowedIndicator,Pt=st.level,Ze=st.mode,mt=st.prefixCls,Lt=st.theme;if(Pt!==1||Ze!=="horizontal")return null;var Mt=rt.props.children[0],$t=Mt.props,Re=$t.children,ve=$t.title,X=$t.style,ne=Object(_e.a)($t,["children","title","style"]),oe=Object(ce.a)({},X),he="".concat(Oe,"-overflowed-indicator"),Ae="".concat(Oe,"-overflowed-indicator");ze.length===0&&vt!==!0?oe=Object(ce.a)(Object(ce.a)({},oe),{},{display:"none"}):vt&&(oe=Object(ce.a)(Object(ce.a)({},oe),{},{visibility:"hidden",position:"absolute"}),he="".concat(he,"-placeholder"),Ae="".concat(Ae,"-placeholder"));var Qe=Lt?"".concat(mt,"-").concat(Lt):"",ot={};return le.forEach(function(Rt){ne[Rt]!==void 0&&(ot[Rt]=ne[Rt])}),A.createElement(ee,Object.assign({title:It,className:"".concat(mt,"-overflowed-submenu"),popupClassName:Qe},ot,{key:he,eventKey:Ae,disabled:!1,style:oe}),ze)},rt.setChildrenWidthAndResize=function(){if(rt.props.mode!=="horizontal")return;var Oe=ye.findDOMNode(Object(C.a)(rt));if(!Oe)return;var ze=Oe.children;if(!ze||ze.length===0)return;var vt=Oe.children[ze.length-1];Te(vt,"display","inline-block");var st=rt.getMenuItemNodes(),It=st.filter(function(Pt){return Pt.className.split(" ").indexOf($)>=0});It.forEach(function(Pt){Te(Pt,"display","inline-block")}),rt.menuItemSizes=st.map(function(Pt){return de(Pt,!0)}),It.forEach(function(Pt){Te(Pt,"display","none")}),rt.overflowedIndicatorWidth=de(Oe.children[Oe.children.length-1],!0),rt.originalTotalWidth=rt.menuItemSizes.reduce(function(Pt,Ze){return Pt+Ze},0),rt.handleResize(),Te(vt,"display","none")},rt.handleResize=function(){if(rt.props.mode!=="horizontal")return;var Oe=ye.findDOMNode(Object(C.a)(rt));if(!Oe)return;var ze=de(Oe);rt.overflowedItems=[];var vt=0,st;rt.originalTotalWidth>ze+Q&&(st=-1,rt.menuItemSizes.forEach(function(It){vt+=It,vt+rt.overflowedIndicatorWidth<=ze&&(st+=1)})),rt.setState({lastVisibleIndex:st})},rt}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){var Oe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ze=ye.findDOMNode(this);if(!ze)return;this.resizeObserver=new Ke.default(function(vt){vt.forEach(function(){var st=Oe.cancelFrameId;cancelAnimationFrame(st),Oe.cancelFrameId=requestAnimationFrame(Oe.setChildrenWidthAndResize)})}),[].slice.call(ze.children).concat(ze).forEach(function(vt){Oe.resizeObserver.observe(vt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Oe.resizeObserver.disconnect(),[].slice.call(ze.children).concat(ze).forEach(function(vt){Oe.resizeObserver.observe(vt)}),Oe.setChildrenWidthAndResize()}),this.mutationObserver.observe(ze,{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(Oe){var ze=this,vt=this.state.lastVisibleIndex;return(Oe||[]).reduce(function(st,It,Pt){var Ze=It;if(ze.props.mode==="horizontal"){var mt=ze.getOverflowedSubMenuItem(It.props.eventKey,[]);vt!==void 0&&ze.props.className.indexOf("".concat(ze.props.prefixCls,"-root"))!==-1&&(Pt>vt&&(Ze=A.cloneElement(It,{style:{display:"none"},eventKey:"".concat(It.props.eventKey,"-hidden"),className:"".concat($)})),Pt===vt+1&&(ze.overflowedItems=Oe.slice(vt+1).map(function(Mt){return A.cloneElement(Mt,{key:Mt.props.eventKey,mode:"vertical-left"})}),mt=ze.getOverflowedSubMenuItem(It.props.eventKey,ze.overflowedItems)));var Lt=[].concat(Object(Ie.a)(st),[mt,Ze]);return Pt===Oe.length-1&&Lt.push(ze.getOverflowedSubMenuItem(It.props.eventKey,[],!0)),Lt}return[].concat(Object(Ie.a)(st),[Ze])},[])}},{key:"render",value:function(){var Oe=this.props,ze=Oe.visible,vt=Oe.prefixCls,st=Oe.overflowedIndicator,It=Oe.mode,Pt=Oe.level,Ze=Oe.tag,mt=Oe.children,Lt=Oe.theme,Mt=Object(_e.a)(Oe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),$t=Ze;return A.createElement($t,Object.assign({},Mt),this.renderChildren(mt))}}]),gt}(A.Component);xe.defaultProps={tag:"div",className:""};var De=xe;function dt(At){return At.length?At.every(function(pt){return!!pt.props.disabled}):!0}function Ne(At,pt,gt){var rt=At.getState();At.setState({activeKey:Object(ce.a)(Object(ce.a)({},rt.activeKey),{},Object(c.a)({},pt,gt))})}function Be(At){return At.eventKey||"0-menu-"}function tt(At,pt){var gt=pt,rt=At.children,Oe=At.eventKey;if(gt){var ze;if(K(rt,function(vt,st){vt&&vt.props&&!vt.props.disabled&>===G(vt,Oe,st)&&(ze=!0)}),ze)return gt}return gt=null,At.defaultActiveFirst&&K(rt,function(vt,st){!gt&&vt&&!vt.props.disabled&&(gt=G(vt,Oe,st))}),gt}function lt(At){if(At){var pt=this.instanceArray.indexOf(At);pt!==-1?this.instanceArray[pt]=At:this.instanceArray.push(At)}}var qe=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(rt){var Oe;return Object(ie.a)(this,gt),Oe=pt.call(this,rt),Oe.onKeyDown=function(ze,vt){var st=ze.keyCode,It;if(Oe.getFlatInstanceArray().forEach(function(Ze){Ze&&Ze.props.active&&Ze.onKeyDown&&(It=Ze.onKeyDown(ze))}),It)return 1;var Pt=null;return(st===s.a.UP||st===s.a.DOWN)&&(Pt=Oe.step(st===s.a.UP?-1:1)),Pt?(ze.preventDefault(),Ne(Oe.props.store,Be(Oe.props),Pt.props.eventKey),typeof vt=="function"&&vt(Pt),1):void 0},Oe.onItemHover=function(ze){var vt=ze.key,st=ze.hover;Ne(Oe.props.store,Be(Oe.props),st?vt:null)},Oe.onDeselect=function(ze){Oe.props.onDeselect(ze)},Oe.onSelect=function(ze){Oe.props.onSelect(ze)},Oe.onClick=function(ze){Oe.props.onClick(ze)},Oe.onOpenChange=function(ze){Oe.props.onOpenChange(ze)},Oe.onDestroy=function(ze){Oe.props.onDestroy(ze)},Oe.getFlatInstanceArray=function(){return Oe.instanceArray},Oe.step=function(ze){var vt=Oe.getFlatInstanceArray(),st=Oe.props.store.getState().activeKey[Be(Oe.props)],It=vt.length;if(!It)return null;ze<0&&(vt=vt.concat().reverse());var Pt=-1;if(vt.every(function(Mt,$t){return Mt&&Mt.props.eventKey===st?(Pt=$t,!1):!0}),!Oe.props.defaultActiveFirst&&Pt!==-1&&dt(vt.slice(Pt,It-1)))return;var Ze=(Pt+1)%It,mt=Ze;do{var Lt=vt[mt];if(!Lt||Lt.props.disabled)mt=(mt+1)%It;else return Lt}while(mt!==Ze);return null},Oe.renderCommonMenuItem=function(ze,vt,st){var It=Oe.props.store.getState(),Pt=Object(C.a)(Oe),Ze=Pt.props,mt=G(ze,Ze.eventKey,vt),Lt=ze.props;if(!Lt||typeof ze.type=="string")return ze;var Mt=mt===It.activeKey,$t=Object(ce.a)(Object(ce.a)({mode:Lt.mode||Ze.mode,level:Ze.level,inlineIndent:Ze.inlineIndent,renderMenuItem:Oe.renderMenuItem,rootPrefixCls:Ze.prefixCls,index:vt,parentMenu:Ze.parentMenu,manualRef:Lt.disabled?void 0:Object(n.a)(ze.ref,lt.bind(Object(C.a)(Oe))),eventKey:mt,active:!Lt.disabled&&Mt,multiple:Ze.multiple,onClick:function(ve){(Lt.onClick||M)(ve),Oe.onClick(ve)},onItemHover:Oe.onItemHover,motion:Ze.motion,subMenuOpenDelay:Ze.subMenuOpenDelay,subMenuCloseDelay:Ze.subMenuCloseDelay,forceSubMenuRender:Ze.forceSubMenuRender,onOpenChange:Oe.onOpenChange,onDeselect:Oe.onDeselect,onSelect:Oe.onSelect,builtinPlacements:Ze.builtinPlacements,itemIcon:Lt.itemIcon||Oe.props.itemIcon,expandIcon:Lt.expandIcon||Oe.props.expandIcon},st),{},{direction:Ze.direction});return(Ze.mode==="inline"||we())&&($t.triggerSubMenuAction="click"),A.cloneElement(ze,$t)},Oe.renderMenuItem=function(ze,vt,st){if(!ze)return null;var It=Oe.props.store.getState(),Pt={openKeys:It.openKeys,selectedKeys:It.selectedKeys,triggerSubMenuAction:Oe.props.triggerSubMenuAction,subMenuKey:st};return Oe.renderCommonMenuItem(ze,vt,Pt)},rt.store.setState({activeKey:Object(ce.a)(Object(ce.a)({},rt.store.getState().activeKey),{},Object(c.a)({},rt.eventKey,tt(rt,rt.activeKey)))}),Oe.instanceArray=[],Oe}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Oe){return this.props.visible||Oe.visible||this.props.className!==Oe.className||!r()(this.props.style,Oe.style)}},{key:"componentDidUpdate",value:function(Oe){var ze=this.props,vt="activeKey"in ze?ze.activeKey:ze.store.getState().activeKey[Be(ze)],st=tt(ze,vt);if(st!==vt)Ne(ze.store,Be(ze),st);else if("activeKey"in Oe){var It=tt(Oe,Oe.activeKey);st!==It&&Ne(ze.store,Be(ze),st)}}},{key:"render",value:function(){var Oe=this,ze=Object(p.a)({},this.props);this.instanceArray=[];var vt=a()(ze.prefixCls,ze.className,"".concat(ze.prefixCls,"-").concat(ze.mode)),st={className:vt,role:ze.role||"menu"};ze.id&&(st.id=ze.id),ze.focusable&&(st.tabIndex=0,st.onKeyDown=this.onKeyDown);var It=ze.prefixCls,Pt=ze.eventKey,Ze=ze.visible,mt=ze.level,Lt=ze.mode,Mt=ze.overflowedIndicator,$t=ze.theme;return le.forEach(function(Re){return delete ze[Re]}),delete ze.onClick,A.createElement(De,Object.assign({},ze,{prefixCls:It,mode:Lt,tag:"ul",level:mt,theme:$t,visible:Ze,overflowedIndicator:Mt},st),A.Children.map(ze.children,function(Re,ve){return Oe.renderMenuItem(Re,ve,Pt||"0-menu-")}))}}]),gt}(A.Component);qe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:M};var Ye=Object(O.b)()(qe),je=Ye,Ue=V("Kwbf");function ke(At,pt,gt){var rt=At.prefixCls,Oe=At.motion,ze=At.defaultMotions,vt=ze===void 0?{}:ze,st=At.openAnimation,It=At.openTransitionName,Pt=pt.switchingModeFromInline;if(Oe)return Oe;if(Object(i.a)(st)==="object"&&st)Object(Ue.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof st=="string")return{motionName:"".concat(rt,"-open-").concat(st)};if(It)return{motionName:It};var Ze=vt[gt];return Ze||(Pt?null:vt.other)}var be=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(rt){var Oe;Object(ie.a)(this,gt),Oe=pt.call(this,rt),Oe.inlineOpenKeys=[],Oe.onSelect=function(st){var It=Object(C.a)(Oe),Pt=It.props;if(Pt.selectable){var Ze=Oe.store.getState(),mt=Ze.selectedKeys,Lt=st.key;Pt.multiple?mt=mt.concat([Lt]):mt=[Lt],"selectedKeys"in Pt||Oe.store.setState({selectedKeys:mt}),Pt.onSelect(Object(ce.a)(Object(ce.a)({},st),{},{selectedKeys:mt}))}},Oe.onClick=function(st){var It=Oe.getRealMenuMode(),Pt=Object(C.a)(Oe),Ze=Pt.store,mt=Pt.props.onOpenChange;It!=="inline"&&!("openKeys"in Oe.props)&&(Ze.setState({openKeys:[]}),mt([])),Oe.props.onClick(st)},Oe.onKeyDown=function(st,It){Oe.innerMenu.getWrappedInstance().onKeyDown(st,It)},Oe.onOpenChange=function(st){var It=Object(C.a)(Oe),Pt=It.props,Ze=Oe.store.getState().openKeys.concat(),mt=!1,Lt=function($t){var Re=!1;if($t.open)Re=Ze.indexOf($t.key)===-1,Re&&Ze.push($t.key);else{var ve=Ze.indexOf($t.key);Re=ve!==-1,Re&&Ze.splice(ve,1)}mt=mt||Re};Array.isArray(st)?st.forEach(Lt):Lt(st),mt&&("openKeys"in Oe.props||Oe.store.setState({openKeys:Ze}),Pt.onOpenChange(Ze))},Oe.onDeselect=function(st){var It=Object(C.a)(Oe),Pt=It.props;if(Pt.selectable){var Ze=Oe.store.getState().selectedKeys.concat(),mt=st.key,Lt=Ze.indexOf(mt);Lt!==-1&&Ze.splice(Lt,1),"selectedKeys"in Pt||Oe.store.setState({selectedKeys:Ze}),Pt.onDeselect(Object(ce.a)(Object(ce.a)({},st),{},{selectedKeys:Ze}))}},Oe.onMouseEnter=function(st){Oe.restoreModeVerticalFromInline();var It=Oe.props.onMouseEnter;It&&It(st)},Oe.onTransitionEnd=function(st){var It=st.propertyName==="width"&&st.target===st.currentTarget,Pt=st.target.className,Ze=Object.prototype.toString.call(Pt)==="[object SVGAnimatedString]"?Pt.animVal:Pt,mt=st.propertyName==="font-size"&&Ze.indexOf("anticon")>=0;(It||mt)&&Oe.restoreModeVerticalFromInline()},Oe.setInnerMenu=function(st){Oe.innerMenu=st},Oe.isRootMenu=!0;var ze=rt.defaultSelectedKeys,vt=rt.defaultOpenKeys;return"selectedKeys"in rt&&(ze=rt.selectedKeys||[]),"openKeys"in rt&&(vt=rt.openKeys||[]),Oe.store=Object(O.c)({selectedKeys:ze,openKeys:vt,activeKey:{"0-menu-":tt(rt,rt.activeKey)}}),Oe.state={switchingModeFromInline:!1},Oe}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Oe){this.updateOpentKeysWhenSwitchMode(Oe),this.updateMiniStore();var ze=this.props,vt=ze.siderCollapsed,st=ze.inlineCollapsed,It=ze.onOpenChange;(!Oe.inlineCollapsed&&st||!Oe.siderCollapsed&&vt)&&It([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(Oe){var ze=this.props,vt=this.store,st=this.inlineOpenKeys,It=vt.getState(),Pt={};Oe.mode==="inline"&&ze.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in ze||((ze.inlineCollapsed&&!Oe.inlineCollapsed||ze.siderCollapsed&&!Oe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=It.openKeys.concat(),Pt.openKeys=[]),(!ze.inlineCollapsed&&Oe.inlineCollapsed||!ze.siderCollapsed&&Oe.siderCollapsed)&&(Pt.openKeys=st,this.inlineOpenKeys=[])),Object.keys(Pt).length&&vt.setState(Pt)}},{key:"updateMenuDisplay",value:function(){var Oe=this.props.collapsedWidth,ze=this.store,vt=this.prevOpenKeys,st=this.getInlineCollapsed()&&(Oe===0||Oe==="0"||Oe==="0px");st?(this.prevOpenKeys=ze.getState().openKeys.concat(),this.store.setState({openKeys:[]})):vt&&(this.store.setState({openKeys:vt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Oe=this.props.mode,ze=this.state.switchingModeFromInline,vt=this.getInlineCollapsed();return ze&&vt?"inline":vt?"vertical":Oe}},{key:"getInlineCollapsed",value:function(){var Oe=this.props,ze=Oe.inlineCollapsed,vt=Oe.siderCollapsed;return vt!==void 0?vt:ze}},{key:"restoreModeVerticalFromInline",value:function(){var Oe=this.state.switchingModeFromInline;Oe&&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 Oe=Object(ce.a)({},Object(f.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ze=this.getRealMenuMode();return Oe.className+=" ".concat(Oe.prefixCls,"-root"),Oe.direction==="rtl"&&(Oe.className+=" ".concat(Oe.prefixCls,"-rtl")),Oe=Object(ce.a)(Object(ce.a)({},Oe),{},{mode:ze,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ke(this.props,this.state,ze)}),delete Oe.openAnimation,delete Oe.openTransitionName,A.createElement(O.a,{store:this.store},A.createElement(je,Object.assign({},Oe,{ref:this.setInnerMenu}),this.props.children))}}]),gt}(A.Component);be.defaultProps={selectable:!0,onClick:M,onSelect:M,onOpenChange:M,onDeselect:M,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:A.createElement("span",null,"\xB7\xB7\xB7")};var Ce=be,Pe=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(){var rt;return Object(ie.a)(this,gt),rt=pt.apply(this,arguments),rt.onKeyDown=function(Oe){var ze=Oe.keyCode;return ze===s.a.ENTER?(rt.onClick(Oe),!0):void 0},rt.onMouseLeave=function(Oe){var ze=rt.props,vt=ze.eventKey,st=ze.onItemHover,It=ze.onMouseLeave;st({key:vt,hover:!1}),It({key:vt,domEvent:Oe})},rt.onMouseEnter=function(Oe){var ze=rt.props,vt=ze.eventKey,st=ze.onItemHover,It=ze.onMouseEnter;st({key:vt,hover:!0}),It({key:vt,domEvent:Oe})},rt.onClick=function(Oe){var ze=rt.props,vt=ze.eventKey,st=ze.multiple,It=ze.onClick,Pt=ze.onSelect,Ze=ze.onDeselect,mt=ze.isSelected,Lt={key:vt,keyPath:[vt],item:Object(C.a)(rt),domEvent:Oe};It(Lt),st?mt?Ze(Lt):Pt(Lt):mt||Pt(Lt)},rt.saveNode=function(Oe){rt.node=Oe},rt}return Object(W.a)(gt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Oe=this.props;Oe.onDestroy&&Oe.onDestroy(Oe.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 Oe,ze=Object(ce.a)({},this.props),vt=a()(this.getPrefixCls(),ze.className,(Oe={},Object(c.a)(Oe,this.getActiveClassName(),!ze.disabled&&ze.active),Object(c.a)(Oe,this.getSelectedClassName(),ze.isSelected),Object(c.a)(Oe,this.getDisabledClassName(),ze.disabled),Oe)),st=Object(ce.a)(Object(ce.a)({},ze.attribute),{},{title:typeof ze.title=="string"?ze.title:void 0,className:vt,role:ze.role||"menuitem","aria-disabled":ze.disabled});ze.role==="option"?st=Object(ce.a)(Object(ce.a)({},st),{},{role:"option","aria-selected":ze.isSelected}):(ze.role===null||ze.role==="none")&&(st.role="none");var It={onClick:ze.disabled?null:this.onClick,onMouseLeave:ze.disabled?null:this.onMouseLeave,onMouseEnter:ze.disabled?null:this.onMouseEnter},Pt=Object(ce.a)({},ze.style);ze.mode==="inline"&&(ze.direction==="rtl"?Pt.paddingRight=ze.inlineIndent*ze.level:Pt.paddingLeft=ze.inlineIndent*ze.level),le.forEach(function(mt){return delete ze[mt]}),delete ze.direction;var Ze=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ze=A.createElement(this.props.itemIcon,this.props)),A.createElement("li",Object.assign({},Object(f.default)(ze,["onClick","onMouseEnter","onMouseLeave","onSelect"]),st,It,{style:Pt,ref:this.saveNode}),ze.children,Ze)}}]),gt}(A.Component);Pe.isMenuItem=!0,Pe.defaultProps={onSelect:M,onMouseEnter:M,onMouseLeave:M,manualRef:M};var Le=Object(O.b)(function(At,pt){var gt=At.activeKey,rt=At.selectedKeys,Oe=pt.eventKey,ze=pt.subMenuKey;return{active:gt[ze]===Oe,isSelected:rt.indexOf(Oe)!==-1}})(Pe),Ve=Le,at=function(At){Object(D.a)(gt,At);var pt=Object(T.a)(gt);function gt(){var rt;return Object(ie.a)(this,gt),rt=pt.apply(this,arguments),rt.renderInnerMenuItem=function(Oe){var ze=rt.props,vt=ze.renderMenuItem,st=ze.index;return vt(Oe,st,rt.props.subMenuKey)},rt}return Object(W.a)(gt,[{key:"render",value:function(){var Oe=Object(p.a)({},this.props),ze=Oe.className,vt=ze===void 0?"":ze,st=Oe.rootPrefixCls,It="".concat(st,"-item-group-title"),Pt="".concat(st,"-item-group-list"),Ze=Oe.title,mt=Oe.children;return le.forEach(function(Lt){return delete Oe[Lt]}),delete Oe.onClick,delete Oe.direction,A.createElement("li",Object.assign({},Oe,{className:"".concat(vt," ").concat(st,"-item-group")}),A.createElement("div",{className:It,title:typeof Ze=="string"?Ze:void 0},Ze),A.createElement("ul",{className:Pt},A.Children.map(mt,this.renderInnerMenuItem)))}}]),gt}(A.Component);at.isMenuItemGroup=!0,at.defaultProps={disabled:!0};var _t=at,kt=function(pt){var gt=pt.className,rt=pt.rootPrefixCls,Oe=pt.style;return A.createElement("li",{className:"".concat(gt," ").concat(rt,"-item-divider"),style:Oe})};kt.defaultProps={disabled:!0,className:"",style:{}};var Bt=kt,jt=Xe.e=Ce},"3tLw":function(nt,Xe,V){nt.exports=V.p+"static/a.39070d50.svg"},"4xil":function(nt,Xe,V){nt.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","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(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return t});var ce=V("Ty5D"),ie=V("dI71"),W=V("cDcd"),C=V.n(W),D=V("YS25"),T=V("17x9"),A=V.n(T),O=V("wx14"),f=V("zLVn"),p=V("9R94"),c=function(x){Object(ie.a)(h,x);function h(){for(var S,w=arguments.length,R=new Array(w),N=0;N<w;N++)R[N]=arguments[N];return S=x.call.apply(x,[this].concat(R))||this,S.history=Object(D.a)(S.props),S}var E=h.prototype;return E.render=function(){return C.a.createElement(ce.c,{history:this.history,children:this.props.children})},h}(C.a.Component),s=function(x){Object(ie.a)(h,x);function h(){for(var S,w=arguments.length,R=new Array(w),N=0;N<w;N++)R[N]=arguments[N];return S=x.call.apply(x,[this].concat(R))||this,S.history=Object(D.b)(S.props),S}var E=h.prototype;return E.render=function(){return C.a.createElement(ce.c,{history:this.history,children:this.props.children})},h}(C.a.Component),n=function(h,E){return typeof h=="function"?h(E):h},o=function(h,E){return typeof h=="string"?Object(D.c)(h,null,null,E):h},r=function(h){return h},l=C.a.forwardRef;typeof l=="undefined"&&(l=r);function a(x){return!!(x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)}var i=l(function(x,h){var E=x.innerRef,S=x.navigate,w=x.onClick,R=Object(f.a)(x,["innerRef","navigate","onClick"]),N=R.target,F=Object(O.a)({},R,{onClick:function(q){try{w&&w(q)}catch(B){throw q.preventDefault(),B}!q.defaultPrevented&&q.button===0&&(!N||N==="_self")&&!a(q)&&(q.preventDefault(),S())}});return r!==l?F.ref=h||E:F.ref=E,C.a.createElement("a",F)}),t=l(function(x,h){var E=x.component,S=E===void 0?i:E,w=x.replace,R=x.to,N=x.innerRef,F=Object(f.a)(x,["component","replace","to","innerRef"]);return C.a.createElement(ce.e.Consumer,null,function(z){z||Object(p.a)(!1);var q=z.history,B=o(n(R,z.location),z.location),M=B?q.createHref(B):"",G=Object(O.a)({},F,{href:M,navigate:function(){var K=n(R,z.location),Z=w?q.replace:q.push;Z(K)}});return r!==l?G.ref=h||N:G.innerRef=N,C.a.createElement(S,G)})});if(!1)var d,v;var y=function(h){return h},b=C.a.forwardRef;typeof b=="undefined"&&(b=y);function g(){for(var x=arguments.length,h=new Array(x),E=0;E<x;E++)h[E]=arguments[E];return h.filter(function(S){return S}).join(" ")}var m=b(function(x,h){var E=x["aria-current"],S=E===void 0?"page":E,w=x.activeClassName,R=w===void 0?"active":w,N=x.activeStyle,F=x.className,z=x.exact,q=x.isActive,B=x.location,M=x.sensitive,G=x.strict,J=x.style,K=x.to,Z=x.innerRef,le=Object(f.a)(x,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return C.a.createElement(ce.e.Consumer,null,function(de){de||Object(p.a)(!1);var Te=B||de.location,we=o(n(K,Te),Te),Ie=we.pathname,_e=Ie&&Ie.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ye=_e?Object(ce.f)(Te.pathname,{path:_e,exact:z,sensitive:M,strict:G}):null,Ke=!!(q?q(ye,Te):ye),Me=Ke?g(F,R):F,Fe=Ke?Object(O.a)({},J,{},N):J,Ge=Object(O.a)({"aria-current":Ke&&S||null,className:Me,style:Fe,to:we},le);return y!==b?Ge.ref=h||Z:Ge.innerRef=Z,C.a.createElement(t,Ge)})});if(!1)var _},"5VLF":function(nt,Xe,V){"use strict";var ce,ie;function W(C,D,T){var A=function(O,f){return C.js_beautify(O,f)};return A.js=C.js_beautify,A.css=D.css_beautify,A.html=T.html_beautify,A.js_beautify=C.js_beautify,A.css_beautify=D.css_beautify,A.html_beautify=T.html_beautify,A}!(ce=[V("6UM0"),V("TXwP"),V("psGv")],ie=function(C,D,T){return W(C,D,T)}.apply(Xe,ce),ie!==void 0&&(nt.exports=ie))},"5nXd":function(nt,Xe,V){var ce=V("MFOe"),ie=ce.slice,W=ce.pluck,C=ce.each,D=ce.bind,T=ce.create,A=ce.isList,O=ce.isFunction,f=ce.isObject;nt.exports={createStore:s};var p={version:"2.0.12",enabled:!1,get:function(n,o){var r=this.storage.read(this._namespacePrefix+n);return this._deserialize(r,o)},set:function(n,o){return o===void 0?this.remove(n):(this.storage.write(this._namespacePrefix+n,this._serialize(o)),o)},remove:function(n){this.storage.remove(this._namespacePrefix+n)},each:function(n){var o=this;this.storage.each(function(r,l){n.call(o,o._deserialize(r),(l||"").replace(o._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(n){return this._namespacePrefix=="__storejs_"+n+"_"},createStore:function(){return s.apply(this,arguments)},addPlugin:function(n){this._addPlugin(n)},namespace:function(n){return s(this.storage,this.plugins,n)}};function c(){var n=typeof console=="undefined"?null:console;if(!n)return;var o=n.warn?n.warn:n.log;o.apply(n,arguments)}function s(n,o,r){r||(r=""),n&&!A(n)&&(n=[n]),o&&!A(o)&&(o=[o]);var l=r?"__storejs_"+r+"_":"",a=r?new RegExp("^"+l):null,i=/^[a-zA-Z0-9_\-]*$/;if(!i.test(r))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var t={_namespacePrefix:l,_namespaceRegexp:a,_testStorage:function(v){try{var y="__storejs__test__";v.write(y,y);var b=v.read(y)===y;return v.remove(y),b}catch(g){return!1}},_assignPluginFnProp:function(v,y){var b=this[y];this[y]=function(){var m=ie(arguments,0),_=this;function x(){return b?(C(arguments,function(E,S){m[S]=E}),b.apply(_,m)):void 0}var h=[x].concat(m);return v.apply(_,h)}},_serialize:function(v){return JSON.stringify(v)},_deserialize:function(v,y){if(!v)return y;var b="";try{b=JSON.parse(v)}catch(g){b=v}return b!==void 0?b:y},_addStorage:function(v){if(this.enabled)return;this._testStorage(v)&&(this.storage=v,this.enabled=!0)},_addPlugin:function(v){var y=this;if(A(v)){C(v,function(m){y._addPlugin(m)});return}var b=W(this.plugins,function(m){return v===m});if(b)return;if(this.plugins.push(v),!O(v))throw new Error("Plugins must be function values that return objects");var g=v.call(this);if(!f(g))throw new Error("Plugins must return an object of function properties");C(g,function(m,_){if(!O(m))throw new Error("Bad plugin property: "+_+" from plugin "+v.name+". Plugins should only return functions.");y._assignPluginFnProp(m,_)})},addStorage:function(v){c("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(v)}},d=T(t,p,{plugins:[]});return d.raw={},C(d,function(v,y){O(v)&&(d.raw[y]=D(d,v))}),C(n,function(v){d._addStorage(v)}),C(o,function(v){d._addPlugin(v)}),d}},"6+eU":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return b});var ce=V("wx14"),ie=V("rePB"),W=V("VTBJ"),C=V("1OyB"),D=V("vuIU"),T=V("Ji7U"),A=V("LK+K"),O=V("cDcd"),f=V.n(O),p=V("TSYQ"),c=V.n(p),s=function(m){var _,x="".concat(m.rootPrefixCls,"-item"),h=c()(x,"".concat(x,"-").concat(m.page),(_={},Object(ie.a)(_,"".concat(x,"-active"),m.active),Object(ie.a)(_,m.className,!!m.className),Object(ie.a)(_,"".concat(x,"-disabled"),!m.page),_)),E=function(){m.onClick(m.page)},S=function(R){m.onKeyPress(R,m.onClick,m.page)};return f.a.createElement("li",{title:m.showTitle?m.page:null,className:h,onClick:E,onKeyPress:S,tabIndex:"0"},m.itemRender(m.page,"page",f.a.createElement("a",{rel:"nofollow"},m.page)))},n=s,o={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},r=function(g){Object(T.a)(_,g);var m=Object(A.a)(_);function _(){var x;Object(C.a)(this,_);for(var h=arguments.length,E=new Array(h),S=0;S<h;S++)E[S]=arguments[S];return x=m.call.apply(m,[this].concat(E)),x.state={goInputText:""},x.buildOptionText=function(w){return"".concat(w," ").concat(x.props.locale.items_per_page)},x.changeSize=function(w){x.props.changeSize(Number(w))},x.handleChange=function(w){x.setState({goInputText:w.target.value})},x.handleBlur=function(w){var R=x.props,N=R.goButton,F=R.quickGo,z=R.rootPrefixCls,q=x.state.goInputText;if(N||q==="")return;if(w.relatedTarget&&(w.relatedTarget.className.indexOf("".concat(z,"-prev"))>=0||w.relatedTarget.className.indexOf("".concat(z,"-next"))>=0))return;x.setState({goInputText:""}),F(x.getValidValue())},x.go=function(w){var R=x.state.goInputText;if(R==="")return;(w.keyCode===o.ENTER||w.type==="click")&&(x.setState({goInputText:""}),x.props.quickGo(x.getValidValue()))},x}return Object(D.a)(_,[{key:"getValidValue",value:function(){var h=this.state,E=h.goInputText,S=h.current;return!E||isNaN(E)?S:Number(E)}},{key:"getPageSizeOptions",value:function(){var h=this.props,E=h.pageSize,S=h.pageSizeOptions;return S.some(function(w){return w.toString()===E.toString()})?S:S.concat([E.toString()]).sort(function(w,R){var N=isNaN(Number(w))?0:Number(w),F=isNaN(Number(R))?0:Number(R);return N-F})}},{key:"render",value:function(){var h=this,E=this.props,S=E.pageSize,w=E.locale,R=E.rootPrefixCls,N=E.changeSize,F=E.quickGo,z=E.goButton,q=E.selectComponentClass,B=E.buildOptionText,M=E.selectPrefixCls,G=E.disabled,J=this.state.goInputText,K="".concat(R,"-options"),Z=q,le=null,de=null,Te=null;if(!N&&!F)return null;var we=this.getPageSizeOptions();if(N&&Z){var Ie=we.map(function(_e,ye){return f.a.createElement(Z.Option,{key:ye,value:_e.toString()},(B||h.buildOptionText)(_e))});le=f.a.createElement(Z,{disabled:G,prefixCls:M,showSearch:!1,className:"".concat(K,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(S||we[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ye){return ye.parentNode}},Ie)}return F&&(z&&(Te=typeof z=="boolean"?f.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:G,className:"".concat(K,"-quick-jumper-button")},w.jump_to_confirm):f.a.createElement("span",{onClick:this.go,onKeyUp:this.go},z)),de=f.a.createElement("div",{className:"".concat(K,"-quick-jumper")},w.jump_to,f.a.createElement("input",{disabled:G,type:"text",value:J,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),w.page,Te)),f.a.createElement("li",{className:"".concat(K)},le,de)}}]),_}(f.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=r,a=V("N2Kk");function i(){}function t(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function d(g,m,_){return _}function v(g,m,_){var x=typeof g=="undefined"?m.pageSize:g;return Math.floor((_.total-1)/x)+1}var y=function(g){Object(T.a)(_,g);var m=Object(A.a)(_);function _(x){var h;Object(C.a)(this,_),h=m.call(this,x),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(v(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(N,F){var z=h.props.prefixCls,q=N||f.a.createElement("button",{type:"button","aria-label":F,className:"".concat(z,"-item-link")});return typeof N=="function"&&(q=f.a.createElement(N,Object(W.a)({},h.props))),q},h.savePaginationNode=function(N){h.paginationNode=N},h.isValid=function(N){return t(N)&&N!==h.state.current},h.shouldDisplayQuickJumper=function(){var N=h.props,F=N.showQuickJumper,z=N.pageSize,q=N.total;return q<=z?!1:F},h.handleKeyDown=function(N){(N.keyCode===o.ARROW_UP||N.keyCode===o.ARROW_DOWN)&&N.preventDefault()},h.handleKeyUp=function(N){var F=h.getValidValue(N),z=h.state.currentInputValue;F!==z&&h.setState({currentInputValue:F}),N.keyCode===o.ENTER?h.handleChange(F):N.keyCode===o.ARROW_UP?h.handleChange(F-1):N.keyCode===o.ARROW_DOWN&&h.handleChange(F+1)},h.changePageSize=function(N){var F=h.state.current,z=v(N,h.state,h.props);F=F>z?z:F,z===0&&(F=h.state.current),typeof N=="number"&&("pageSize"in h.props||h.setState({pageSize:N}),"current"in h.props||h.setState({current:F,currentInputValue:F})),h.props.onShowSizeChange(F,N),"onChange"in h.props&&h.props.onChange&&h.props.onChange(F,N)},h.handleChange=function(N){var F=h.props.disabled,z=N;if(h.isValid(z)&&!F){var q=v(void 0,h.state,h.props);z>q?z=q:z<1&&(z=1),"current"in h.props||h.setState({current:z,currentInputValue:z});var B=h.state.pageSize;return h.props.onChange(z,B),z}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<v(void 0,h.state,h.props)},h.runIfEnter=function(N,F){if(N.key==="Enter"||N.charCode===13){for(var z=arguments.length,q=new Array(z>2?z-2:0),B=2;B<z;B++)q[B-2]=arguments[B];F.apply(void 0,q)}},h.runIfEnterPrev=function(N){h.runIfEnter(N,h.prev)},h.runIfEnterNext=function(N){h.runIfEnter(N,h.next)},h.runIfEnterJumpPrev=function(N){h.runIfEnter(N,h.jumpPrev)},h.runIfEnterJumpNext=function(N){h.runIfEnter(N,h.jumpNext)},h.handleGoTO=function(N){(N.keyCode===o.ENTER||N.type==="click")&&h.handleChange(h.state.currentInputValue)};var E=x.onChange!==i,S="current"in x;S&&!E&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var w=x.defaultCurrent;"current"in x&&(w=x.current);var R=x.defaultPageSize;return"pageSize"in x&&(R=x.pageSize),w=Math.min(w,v(R,void 0,x)),h.state={current:w,currentInputValue:w,pageSize:R},h}return Object(D.a)(_,[{key:"componentDidUpdate",value:function(h,E){var S=this.props.prefixCls;if(E.current!==this.state.current&&this.paginationNode){var w=this.paginationNode.querySelector(".".concat(S,"-item-").concat(E.current));w&&document.activeElement===w&&w.blur()}}},{key:"getValidValue",value:function(h){var E=h.target.value,S=v(void 0,this.state,this.props),w=this.state.currentInputValue,R;return E===""?R=E:isNaN(Number(E))?R=w:E>=S?R=S:R=Number(E),R}},{key:"getShowSizeChanger",value:function(){var h=this.props,E=h.showSizeChanger,S=h.total,w=h.totalBoundaryShowSizeChanger;return typeof E!="undefined"?E:S>w}},{key:"renderPrev",value:function(h){var E=this.props,S=E.prevIcon,w=E.itemRender,R=w(h,"prev",this.getItemIcon(S,"prev page")),N=!this.hasPrev();return Object(O.isValidElement)(R)?Object(O.cloneElement)(R,{disabled:N}):R}},{key:"renderNext",value:function(h){var E=this.props,S=E.nextIcon,w=E.itemRender,R=w(h,"next",this.getItemIcon(S,"next page")),N=!this.hasNext();return Object(O.isValidElement)(R)?Object(O.cloneElement)(R,{disabled:N}):R}},{key:"render",value:function(){var h=this,E=this.props,S=E.prefixCls,w=E.className,R=E.style,N=E.disabled,F=E.hideOnSinglePage,z=E.total,q=E.locale,B=E.showQuickJumper,M=E.showLessItems,G=E.showTitle,J=E.showTotal,K=E.simple,Z=E.itemRender,le=E.showPrevNextJumpers,de=E.jumpPrevIcon,Te=E.jumpNextIcon,we=E.selectComponentClass,Ie=E.selectPrefixCls,_e=E.pageSizeOptions,ye=this.state,Ke=ye.current,Me=ye.pageSize,Fe=ye.currentInputValue;if(F===!0&&z<=Me)return null;var Ge=v(void 0,this.state,this.props),Ee=[],me=null,We=null,He=null,it=null,re=null,P=B&&B.goButton,j=M?1:2,ee=Ke-1>0?Ke-1:0,$=Ke+1<Ge?Ke+1:Ge,Q=Object.keys(this.props).reduce(function(be,Ce){return(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role")&&(be[Ce]=h.props[Ce]),be},{});if(K)return P&&(typeof P=="boolean"?re=f.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},q.jump_to_confirm):re=f.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},P),re=f.a.createElement("li",{title:G?"".concat(q.jump_to).concat(Ke,"/").concat(Ge):null,className:"".concat(S,"-simple-pager")},re)),f.a.createElement("ul",Object(ce.a)({className:c()(S,"".concat(S,"-simple"),Object(ie.a)({},"".concat(S,"-disabled"),N),w),style:R,ref:this.savePaginationNode},Q),f.a.createElement("li",{title:G?q.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:c()("".concat(S,"-prev"),Object(ie.a)({},"".concat(S,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ee)),f.a.createElement("li",{title:G?"".concat(Ke,"/").concat(Ge):null,className:"".concat(S,"-simple-pager")},f.a.createElement("input",{type:"text",value:Fe,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),f.a.createElement("span",{className:"".concat(S,"-slash")},"/"),Ge),f.a.createElement("li",{title:G?q.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:c()("".concat(S,"-next"),Object(ie.a)({},"".concat(S,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext($)),re);if(Ge<=3+j*2){var xe={locale:q,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:G,itemRender:Z};Ge||Ee.push(f.a.createElement(n,Object(ce.a)({},xe,{key:"noPager",page:Ge,className:"".concat(S,"-disabled")})));for(var De=1;De<=Ge;De+=1){var dt=Ke===De;Ee.push(f.a.createElement(n,Object(ce.a)({},xe,{key:De,page:De,active:dt})))}}else{var Ne=M?q.prev_3:q.prev_5,Be=M?q.next_3:q.next_5;le&&(me=f.a.createElement("li",{title:G?Ne:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:c()("".concat(S,"-jump-prev"),Object(ie.a)({},"".concat(S,"-jump-prev-custom-icon"),!!de))},Z(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(de,"prev page"))),We=f.a.createElement("li",{title:G?Be:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:c()("".concat(S,"-jump-next"),Object(ie.a)({},"".concat(S,"-jump-next-custom-icon"),!!Te))},Z(this.getJumpNextPage(),"jump-next",this.getItemIcon(Te,"next page")))),it=f.a.createElement(n,{locale:q,last:!0,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ge,page:Ge,active:!1,showTitle:G,itemRender:Z}),He=f.a.createElement(n,{locale:q,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:G,itemRender:Z});var tt=Math.max(1,Ke-j),lt=Math.min(Ke+j,Ge);Ke-1<=j&&(lt=1+j*2),Ge-Ke<=j&&(tt=Ge-j*2);for(var qe=tt;qe<=lt;qe+=1){var Ye=Ke===qe;Ee.push(f.a.createElement(n,{locale:q,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:qe,page:qe,active:Ye,showTitle:G,itemRender:Z}))}Ke-1>=j*2&&Ke!==1+2&&(Ee[0]=Object(O.cloneElement)(Ee[0],{className:"".concat(S,"-item-after-jump-prev")}),Ee.unshift(me)),Ge-Ke>=j*2&&Ke!==Ge-2&&(Ee[Ee.length-1]=Object(O.cloneElement)(Ee[Ee.length-1],{className:"".concat(S,"-item-before-jump-next")}),Ee.push(We)),tt!==1&&Ee.unshift(He),lt!==Ge&&Ee.push(it)}var je=null;J&&(je=f.a.createElement("li",{className:"".concat(S,"-total-text")},J(z,[z===0?0:(Ke-1)*Me+1,Ke*Me>z?z:Ke*Me])));var Ue=!this.hasPrev()||!Ge,ke=!this.hasNext()||!Ge;return f.a.createElement("ul",Object(ce.a)({className:c()(S,w,Object(ie.a)({},"".concat(S,"-disabled"),N)),style:R,unselectable:"unselectable",ref:this.savePaginationNode},Q),je,f.a.createElement("li",{title:G?q.prev_page:null,onClick:this.prev,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(S,"-prev"),Object(ie.a)({},"".concat(S,"-disabled"),Ue)),"aria-disabled":Ue},this.renderPrev(ee)),Ee,f.a.createElement("li",{title:G?q.next_page:null,onClick:this.next,tabIndex:ke?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(S,"-next"),Object(ie.a)({},"".concat(S,"-disabled"),ke)),"aria-disabled":ke},this.renderNext($)),f.a.createElement(l,{disabled:N,locale:q,rootPrefixCls:S,selectComponentClass:we,selectPrefixCls:Ie,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ke,pageSize:Me,pageSizeOptions:_e,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:P}))}}],[{key:"getDerivedStateFromProps",value:function(h,E){var S={};if("current"in h&&(S.current=h.current,h.current!==E.current&&(S.currentInputValue=S.current)),"pageSize"in h&&h.pageSize!==E.pageSize){var w=E.current,R=v(h.pageSize,E,h);w=w>R?R:w,"current"in h||(S.current=w,S.currentInputValue=w),S.pageSize=h.pageSize}return S}}]),_}(f.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:i,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:i,locale:a.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var b=y},"6RRn":function(nt,Xe,V){"use strict";var ce=V("wCXF"),ie=V("n6Qo");V.d(Xe,"b",function(){return ie.a});var W=V("IBYe"),C=V("6eGT"),D=V("hW8S");V.d(Xe,"a",function(){return D.a}),Xe.c=ce.b},"6UM0":function(nt,Xe,V){var ce,ie;(function(){var W;(function(){"use strict";var D=[function(f,p,c){var s=c(1).Beautifier,n=c(5).Options;function o(r,l){var a=new s(r,l);return a.beautify()}f.exports=o,f.exports.defaultOptions=function(){return new n}},function(f,p,c){var s=c(2).Output,n=c(3).Token,o=c(4),r=c(5).Options,l=c(7).Tokenizer,a=c(7).line_starters,i=c(7).positionable_operators,t=c(7).TOKEN;function d(M,G){return G.indexOf(M)!==-1}function v(M){return M.replace(/^\s+/g,"")}function y(M){for(var G={},J=0;J<M.length;J++)G[M[J].replace(/-/g,"_")]=M[J];return G}function b(M,G){return M&&M.type===t.RESERVED&&M.text===G}function g(M,G){return M&&M.type===t.RESERVED&&d(M.text,G)}var m=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],x=y(_),h=[x.before_newline,x.preserve_newline],E={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function S(M,G){if(G.multiline_frame||G.mode===E.ForInitializer||G.mode===E.Conditional)return;M.remove_indent(G.start_line_index)}function w(M){M=M.replace(o.allLineBreaks,`
|
|
|
`);for(var G=[],J=M.indexOf(`
|
|
|
`);J!==-1;)G.push(M.substring(0,J)),M=M.substring(J+1),J=M.indexOf(`
|
|
|
`);return M.length&&G.push(M),G}function R(M){return M===E.ArrayLiteral}function N(M){return d(M,[E.Expression,E.ForInitializer,E.Conditional])}function F(M,G){for(var J=0;J<M.length;J++){var K=M[J].trim();if(K.charAt(0)!==G)return!1}return!0}function z(M,G){for(var J=0,K=M.length,Z;J<K;J++)if(Z=M[J],Z&&Z.indexOf(G)!==0)return!1;return!0}function q(M,G){G=G||{},this._source_text=M||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(G)}q.prototype.create_flags=function(M,G){var J=0;M&&(J=M.indentation_level,!this._output.just_added_newline()&&M.line_indent_level>J&&(J=M.line_indent_level));var K={mode:G,parent:M,last_token:M?M.last_token:new n(t.START_BLOCK,""),last_word:M?M.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:J,alignment:0,line_indent_level:M?M.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return K},q.prototype._reset=function(M){var G=M.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new s(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(E.BlockStatement);var J=new l(M,this._options);return this._tokens=J.tokenize(),M},q.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M,G=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
|
|
|
`,G&&o.lineBreak.test(G||"")&&(J=G.match(o.lineBreak)[0]));for(var K=this._tokens.next();K;)this.handle_token(K),this._last_last_text=this._flags.last_token.text,this._flags.last_token=K,K=this._tokens.next();return M=this._output.get_code(J),M},q.prototype.handle_token=function(M,G){M.type===t.START_EXPR?this.handle_start_expr(M):M.type===t.END_EXPR?this.handle_end_expr(M):M.type===t.START_BLOCK?this.handle_start_block(M):M.type===t.END_BLOCK?this.handle_end_block(M):M.type===t.WORD?this.handle_word(M):M.type===t.RESERVED?this.handle_word(M):M.type===t.SEMICOLON?this.handle_semicolon(M):M.type===t.STRING?this.handle_string(M):M.type===t.EQUALS?this.handle_equals(M):M.type===t.OPERATOR?this.handle_operator(M):M.type===t.COMMA?this.handle_comma(M):M.type===t.BLOCK_COMMENT?this.handle_block_comment(M,G):M.type===t.COMMENT?this.handle_comment(M,G):M.type===t.DOT?this.handle_dot(M):M.type===t.EOF?this.handle_eof(M):M.type===t.UNKNOWN?this.handle_unknown(M,G):this.handle_unknown(M,G)},q.prototype.handle_whitespace_and_comments=function(M,G){var J=M.newlines,K=this._options.keep_array_indentation&&R(this._flags.mode);if(M.comments_before)for(var Z=M.comments_before.next();Z;)this.handle_whitespace_and_comments(Z,G),this.handle_token(Z,G),Z=M.comments_before.next();if(K)for(var le=0;le<J;le+=1)this.print_newline(le>0,G);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,G);for(var de=1;de<J;de+=1)this.print_newline(!0,G)}};var B=["async","break","continue","return","throw","yield"];q.prototype.allow_wrap_or_preserved_newline=function(M,G){if(G=G===void 0?!1:G,this._output.just_added_newline())return;var J=this._options.preserve_newlines&&M.newlines||G,K=d(this._flags.last_token.text,i)||d(M.text,i);if(K){var Z=d(this._flags.last_token.text,i)&&d(this._options.operator_position,h)||d(M.text,i);J=J&&Z}if(J)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(g(this._flags.last_token,B))return;this._output.set_wrap_point()}},q.prototype.print_newline=function(M,G){if(!G&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var J=this._tokens.peek();this._flags.mode===E.Statement&&!(this._flags.if_block&&b(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(M)&&(this._flags.multiline_frame=!0)},q.prototype.print_token_line_indentation=function(M){this._output.just_added_newline()&&(this._options.keep_array_indentation&&M.newlines&&(M.text==="["||R(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(M.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},q.prototype.print_token=function(M){if(this._output.raw){this._output.add_raw_token(M);return}if(this._options.comma_first&&M.previous&&M.previous.type===t.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var G=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(G),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(M),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(M),this._output.non_breaking_space=!0,this._output.add_token(M.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},q.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},q.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},q.prototype.set_mode=function(M){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,M),this._flags=this.create_flags(this._previous_flags,M),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},q.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===E.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},q.prototype.start_of_object_property=function(){return this._flags.parent.mode===E.ObjectLiteral&&this._flags.mode===E.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||g(this._flags.last_token,["get","set"]))},q.prototype.start_of_statement=function(M){var G=!1;return G=G||g(this._flags.last_token,["var","let","const"])&&M.type===t.WORD,G=G||b(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===E.ObjectLiteral&&this._flags.mode===E.Statement)&&g(this._flags.last_token,B)&&!M.newlines,G=G||b(this._flags.last_token,"else")&&!(b(M,"if")&&!M.comments_before),G=G||this._flags.last_token.type===t.END_EXPR&&(this._previous_flags.mode===E.ForInitializer||this._previous_flags.mode===E.Conditional),G=G||this._flags.last_token.type===t.WORD&&this._flags.mode===E.BlockStatement&&!this._flags.in_case&&!(M.text==="--"||M.text==="++")&&this._last_last_text!=="function"&&M.type!==t.WORD&&M.type!==t.RESERVED,G=G||this._flags.mode===E.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||g(this._flags.last_token,["get","set"])),G?(this.set_mode(E.Statement),this.indent(),this.handle_whitespace_and_comments(M,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M,g(M,["do","for","if","while"])),!0):!1},q.prototype.handle_start_expr=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M);var G=E.Expression;if(M.text==="["){if(this._flags.last_token.type===t.WORD||this._flags.last_token.text===")"){g(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(M),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=E.ArrayLiteral,R(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[t.START_EXPR,t.END_EXPR,t.WORD,t.OPERATOR,t.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===t.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=E.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=E.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&M.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,a)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M);else if(this._flags.last_token.type===t.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var K=this._tokens.peek(-4);g(J,["async","function"])||J.text==="*"&&g(K,["async","function"])?this._output.space_before_token=!0:this._flags.mode===E.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(K.text==="{"||K.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(M);(this._flags.last_token.type===t.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===E.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===t.START_BLOCK?this.print_newline():(this._flags.last_token.type===t.END_EXPR||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===t.COMMA)&&this.allow_wrap_or_preserved_newline(M,M.newlines),this.print_token(M),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},q.prototype.handle_end_expr=function(M){for(;this._flags.mode===E.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(M,M.text==="]"&&R(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===t.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(M),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===E.Conditional&&(this._previous_flags.mode=E.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},q.prototype.handle_start_block=function(M){this.handle_whitespace_and_comments(M);var G=this._tokens.peek(),J=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===t.END_EXPR?(this.set_mode(E.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(E.BlockStatement):J&&(d(J.text,[":",","])&&d(G.type,[t.STRING,t.WORD,t.RESERVED])||d(G.text,["get","set","..."])&&d(J.type,[t.WORD,t.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(J.text,[":",","])?this.set_mode(E.BlockStatement):this.set_mode(E.ObjectLiteral):this._flags.last_token.type===t.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(E.BlockStatement):d(this._flags.last_token.type,[t.EQUALS,t.START_EXPR,t.COMMA,t.OPERATOR])||g(this._flags.last_token,["return","throw","import","default"])?this.set_mode(E.ObjectLiteral):this.set_mode(E.BlockStatement),this._flags.last_token&&(g(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var K=!G.comments_before&&G.text==="}",Z=K&&this._flags.last_word==="function"&&this._flags.last_token.type===t.END_EXPR;if(this._options.brace_preserve_inline){var le=0,de=null;this._flags.inline_frame=!0;do if(le+=1,de=this._tokens.peek(le-1),de.newlines){this._flags.inline_frame=!1;break}while(de.type!==t.EOF&&!(de.type===t.END_BLOCK&&de.opened===M))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==t.OPERATOR&&(Z||this._flags.last_token.type===t.EQUALS||g(this._flags.last_token,m)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(R(this._previous_flags.mode)&&(this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.COMMA)&&((this._flags.last_token.type===t.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(M),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==t.OPERATOR&&this._flags.last_token.type!==t.START_EXPR&&(this._flags.last_token.type===t.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(M),this.indent(),!K&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},q.prototype.handle_end_block=function(M){for(this.handle_whitespace_and_comments(M);this._flags.mode===E.Statement;)this.restore_mode();var G=this._flags.last_token.type===t.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(R(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(M)},q.prototype.handle_word=function(M){if(M.type===t.RESERVED){if(d(M.text,["set","get"])&&this._flags.mode!==E.ObjectLiteral)M.type=t.WORD;else if(M.text==="import"&&d(this._tokens.peek().text,["(","."]))M.type=t.WORD;else if(d(M.text,["as","from"])&&!this._flags.import_block)M.type=t.WORD;else if(this._flags.mode===E.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(M.type=t.WORD)}}if(this.start_of_statement(M)?g(this._flags.last_token,["var","let","const"])&&M.type===t.WORD&&(this._flags.declaration_statement=!0):M.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==t.EQUALS&&(this._options.preserve_newlines||!g(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(M),this.print_newline()):this.handle_whitespace_and_comments(M),this._flags.do_block&&!this._flags.do_while)if(b(M,"while")){this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&b(M,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===E.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&g(M,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(M),this._flags.in_case=!0;return}if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M)),b(M,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===t.OPERATOR))&&(!this._output.just_added_blankline()&&!M.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD?g(this._flags.last_token,["get","set","new","export"])||g(this._flags.last_token,B)?this._output.space_before_token=!0:b(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===t.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||R(this._flags.mode))||this.print_newline(),this.print_token(M),this._flags.last_word=M.text;return}var J="NONE";if(this._flags.last_token.type===t.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":g(M,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&this._flags.mode===E.BlockStatement?J="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&N(this._flags.mode)?J="SPACE":this._flags.last_token.type===t.STRING?J="NEWLINE":this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===E.ObjectLiteral&&d(this._last_last_text,["{",","]))?J="SPACE":this._flags.last_token.type===t.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===t.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),g(M,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),g(M,["else","catch","finally"]))if((!(this._flags.last_token.type===t.END_BLOCK&&this._previous_flags.mode===E.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var K=this._output.current_line;K.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?g(this._flags.last_token,m)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&g(M,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==t.END_EXPR?(this._flags.last_token.type!==t.START_EXPR||!g(M,["var","let","const"]))&&this._flags.last_token.text!==":"&&(b(M,"if")&&b(M.previous,"else")?this._output.space_before_token=!0:this.print_newline()):g(M,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&R(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():J==="SPACE"&&(this._output.space_before_token=!0);M.previous&&(M.previous.type===t.WORD||M.previous.type===t.RESERVED)&&(this._output.space_before_token=!0),this.print_token(M),this._flags.last_word=M.text,M.type===t.RESERVED&&(M.text==="do"?this._flags.do_block=!0:M.text==="if"?this._flags.if_block=!0:M.text==="import"?this._flags.import_block=!0:this._flags.import_block&&b(M,"from")&&(this._flags.import_block=!1))},q.prototype.handle_semicolon=function(M){this.start_of_statement(M)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(M);for(var G=this._tokens.peek();this._flags.mode===E.Statement&&!(this._flags.if_block&&b(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(M)},q.prototype.handle_string=function(M){M.text.startsWith("`")&&M.newlines===0&&M.whitespace_before===""&&(M.previous.text===")"||this._flags.last_token.type===t.WORD)||(this.start_of_statement(M)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(M),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M):M.text.startsWith("`")&&this._flags.last_token.type===t.END_EXPR&&(M.previous.text==="]"||M.previous.text===")")&&M.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(M)},q.prototype.handle_equals=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0},q.prototype.handle_comma=function(M){this.handle_whitespace_and_comments(M,!0),this.print_token(M),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(M)):this._flags.mode===E.ObjectLiteral||this._flags.mode===E.Statement&&this._flags.parent.mode===E.ObjectLiteral?(this._flags.mode===E.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(M)},q.prototype.handle_operator=function(M){var G=M.text==="*"&&(g(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[t.START_BLOCK,t.COMMA,t.END_BLOCK,t.SEMICOLON])),J=d(M.text,["-","+"])&&(d(this._flags.last_token.type,[t.START_BLOCK,t.START_EXPR,t.EQUALS,t.OPERATOR])||d(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(M)){var K=!G;this.handle_whitespace_and_comments(M,K)}if(M.text==="*"&&this._flags.last_token.type===t.DOT){this.print_token(M);return}if(M.text==="::"){this.print_token(M);return}if(this._flags.last_token.type===t.OPERATOR&&d(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(M),M.text===":"&&this._flags.in_case){this.print_token(M),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==t.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Z=!0,le=!0,de=!1;if(M.text===":"?this._flags.ternary_depth===0?Z=!1:(this._flags.ternary_depth-=1,de=!0):M.text==="?"&&(this._flags.ternary_depth+=1),!J&&!G&&this._options.preserve_newlines&&d(M.text,i)){var Te=M.text===":",we=Te&&de,Ie=Te&&!de;switch(this._options.operator_position){case x.before_newline:this._output.space_before_token=!Ie,this.print_token(M),(!Te||we)&&this.allow_wrap_or_preserved_newline(M),this._output.space_before_token=!0;return;case x.after_newline:this._output.space_before_token=!0,!Te||we?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(M):this._output.space_before_token=!1,this.print_token(M),this._output.space_before_token=!0;return;case x.preserve_newline:Ie||this.allow_wrap_or_preserved_newline(M),Z=!(this._output.just_added_newline()||Ie),this._output.space_before_token=Z,this.print_token(M),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(M),Z=!1;var _e=this._tokens.peek();le=_e&&d(_e.type,[t.WORD,t.RESERVED])}else if(M.text==="...")this.allow_wrap_or_preserved_newline(M),Z=this._flags.last_token.type===t.START_BLOCK,le=!1;else if(d(M.text,["--","++","!","~"])||J){if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR)&&this.allow_wrap_or_preserved_newline(M),Z=!1,le=!1,M.newlines&&(M.text==="--"||M.text==="++"||M.text==="~")){var ye=g(this._flags.last_token,m)&&M.newlines;ye&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ye,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(Z=!0),this._flags.last_token.type===t.RESERVED?Z=!0:this._flags.last_token.type===t.END_EXPR?Z=!(this._flags.last_token.text==="]"&&(M.text==="--"||M.text==="++")):this._flags.last_token.type===t.OPERATOR&&(Z=d(M.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(M.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(le=!0)),(this._flags.mode===E.BlockStatement&&!this._flags.inline_frame||this._flags.mode===E.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Z,this.print_token(M),this._output.space_before_token=le},q.prototype.handle_block_comment=function(M,G){if(this._output.raw){this._output.add_raw_token(M),M.directives&&M.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(M.directives){this.print_newline(!1,G),this.print_token(M),M.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!o.newline.test(M.text)&&!M.newlines){this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0;return}else this.print_block_commment(M,G)},q.prototype.print_block_commment=function(M,G){var J=w(M.text),K,Z=!1,le=!1,de=M.whitespace_before,Te=de.length;if(this.print_newline(!1,G),this.print_token_line_indentation(M),this._output.add_token(J[0]),this.print_newline(!1,G),J.length>1){for(J=J.slice(1),Z=F(J,"*"),le=z(J,de),Z&&(this._flags.alignment=1),K=0;K<J.length;K++)Z?(this.print_token_line_indentation(M),this._output.add_token(v(J[K]))):le&&J[K]?(this.print_token_line_indentation(M),this._output.add_token(J[K].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(J[K])),this.print_newline(!1,G);this._flags.alignment=0}},q.prototype.handle_comment=function(M,G){M.newlines?this.print_newline(!1,G):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(M),this.print_newline(!1,G)},q.prototype.handle_dot=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),g(this._flags.last_token,m)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(M,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(M)},q.prototype.handle_unknown=function(M,G){this.print_token(M),M.text[M.text.length-1]===`
|
|
|
`&&this.print_newline(!1,G)},q.prototype.handle_eof=function(M){for(;this._flags.mode===E.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M)},f.exports.Beautifier=q},function(f){function p(n){this.__parent=n,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var n=new p(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},p.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},p.prototype.has_match=function(n){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(n))return!0;return!1},p.prototype.set_indent=function(n,o){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(n){this.__items.push(n);var o=n.lastIndexOf(`
|
|
|
`);o!==-1?this.__character_count=n.length-o:this.__character_count+=n.length},p.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function c(n,o){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),o=o||"",n.indent_level>0&&(o=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}c.prototype.get_indent_size=function(n,o){var r=this.__base_string_length;return o=o||0,n<0&&(r=0),r+=n*this.__indent_size,r+=o,r},c.prototype.get_indent_string=function(n,o){var r=this.__base_string;return o=o||0,n<0&&(n=0,r=""),o+=n*this.__indent_size,this.__ensure_cache(o),r+=this.__cache[o],r},c.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var n=this.__cache.length,o=0,r="";this.__indent_size&&n>=this.__indent_size&&(o=Math.floor(n/this.__indent_size),n-=o*this.__indent_size,r=new Array(o+1).join(this.__indent_string)),n&&(r+=new Array(n+1).join(" ")),this.__cache.push(r)};function s(n,o){this.__indent_cache=new c(n,o),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(n,o){return this.__indent_cache.get_indent_string(n,o)},s.prototype.get_indent_size=function(n,o){return this.__indent_cache.get_indent_size(n,o)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(n){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
|
|
|
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
|
`);return n!==`
|
|
|
`&&(r=r.replace(/[\n]/g,n)),r},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(n,o){return n=n||0,o=o||0,this.next_line.set_indent(n,o),this.__lines.length>1?(this.current_line.set_indent(n,o),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(n){for(var o=0;o<n.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},s.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},s.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},s.prototype.remove_indent=function(n){for(var o=this.__lines.length;n<o;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},s.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(n,o){for(var r=this.__lines.length-2;r>=0;){var l=this.__lines[r];if(l.is_empty())break;if(l.item(0).indexOf(n)!==0&&l.item(-1)!==o){this.__lines.splice(r+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},f.exports.Output=s},function(f){function p(c,s,n,o){this.type=c,this.text=s,this.comments_before=null,this.newlines=n||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=p},function(f,p){var c="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",s="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",o="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",r="(?:\\\\u[0-9a-fA-F]{4}|["+c+n+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+s+n+o+"])*";p.identifier=new RegExp(r+l,"g"),p.identifierStart=new RegExp(r),p.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+s+n+o+"])+");var a=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;p.newline=/[\n\r\u2028\u2029]/,p.lineBreak=new RegExp(`\r
|
|
|
|`+p.newline.source),p.allLineBreaks=new RegExp(p.lineBreak.source,"g")},function(f,p,c){var s=c(6).Options,n=["before-newline","after-newline","preserve-newline"];function o(r){s.call(this,r,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var i=0;i<a.length;i++)a[i]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=a[i];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",n),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}o.prototype=new s,f.exports.Options=o},function(f){function p(n,o){this.raw_options=c(n,o),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(n,o){var r=this.raw_options[n],l=o||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(l=r.concat()):typeof r=="string"&&(l=r.split(/[^a-zA-Z0-9_\/\-]+/)),l},p.prototype._get_boolean=function(n,o){var r=this.raw_options[n],l=r===void 0?!!o:!!r;return l},p.prototype._get_characters=function(n,o){var r=this.raw_options[n],l=o||"";return typeof r=="string"&&(l=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),l},p.prototype._get_number=function(n,o){var r=this.raw_options[n];o=parseInt(o,10),isNaN(o)&&(o=0);var l=parseInt(r,10);return isNaN(l)&&(l=o),l},p.prototype._get_selection=function(n,o,r){var l=this._get_selection_list(n,o,r);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
|
|
|
`+o+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return l[0]},p.prototype._get_selection_list=function(n,o,r){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[o[0]],!this._is_valid_selection(r,o))throw new Error("Invalid Default Value!");var l=this._get_array(n,r);if(!this._is_valid_selection(l,o))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
|
|
|
`+o+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return l},p.prototype._is_valid_selection=function(n,o){return n.length&&o.length&&!n.some(function(r){return o.indexOf(r)===-1})};function c(n,o){var r={};n=s(n);var l;for(l in n)l!==o&&(r[l]=n[l]);if(o&&n[o])for(l in n[o])r[l]=n[o][l];return r}function s(n){var o={},r;for(r in n){var l=r.replace(/-/g,"_");o[l]=n[r]}return o}f.exports.Options=p,f.exports.normalizeOpts=s,f.exports.mergeOpts=c},function(f,p,c){var s=c(8).InputScanner,n=c(9).Tokenizer,o=c(9).TOKEN,r=c(13).Directives,l=c(4),a=c(12).Pattern,i=c(14).TemplatablePattern;function t(F,z){return z.indexOf(F)!==-1}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},v=new r(/\/\*/,/\*\//),y=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,b=/[0-9]/,g=/[^\d\.]/,m=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var x=new RegExp(_),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),E=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+E.join("|")+")$"),w,R=function(F,z){n.call(this,F,z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var q=new a(this._input),B=new i(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(l.identifier).matching(l.identifierMatch),number:q.matching(y),punct:q.matching(x),comment:q.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:q.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:q.matching(/<!--/),html_comment_end:q.matching(/-->/),include:q.starting_with(/#include/).until_after(l.lineBreak),shebang:q.starting_with(/#!/).until_after(l.lineBreak),xml:q.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};R.prototype=new n,R.prototype._is_comment=function(F){return F.type===d.COMMENT||F.type===d.BLOCK_COMMENT||F.type===d.UNKNOWN},R.prototype._is_opening=function(F){return F.type===d.START_BLOCK||F.type===d.START_EXPR},R.prototype._is_closing=function(F,z){return(F.type===d.END_BLOCK||F.type===d.END_EXPR)&&z&&(F.text==="]"&&z.text==="["||F.text===")"&&z.text==="("||F.text==="}"&&z.text==="{")},R.prototype._reset=function(){w=!1},R.prototype._get_next_token=function(F,z){var q=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(d.EOF,""):(q=q||this._read_non_javascript(B),q=q||this._read_string(B),q=q||this._read_word(F),q=q||this._read_singles(B),q=q||this._read_comment(B),q=q||this._read_regexp(B,F),q=q||this._read_xml(B,F),q=q||this._read_punctuation(),q=q||this._create_token(d.UNKNOWN,this._input.next()),q)},R.prototype._read_word=function(F){var z;if(z=this.__patterns.identifier.read(),z!=="")return z=z.replace(l.allLineBreaks,`
|
|
|
`),!(F.type===d.DOT||F.type===d.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(z)?(z==="in"||z==="of")&&(F.type===d.WORD||F.type===d.STRING)?this._create_token(d.OPERATOR,z):this._create_token(d.RESERVED,z):this._create_token(d.WORD,z);if(z=this.__patterns.number.read(),z!=="")return this._create_token(d.WORD,z)},R.prototype._read_singles=function(F){var z=null;return F==="("||F==="["?z=this._create_token(d.START_EXPR,F):F===")"||F==="]"?z=this._create_token(d.END_EXPR,F):F==="{"?z=this._create_token(d.START_BLOCK,F):F==="}"?z=this._create_token(d.END_BLOCK,F):F===";"?z=this._create_token(d.SEMICOLON,F):F==="."&&g.test(this._input.peek(1))?z=this._create_token(d.DOT,F):F===","&&(z=this._create_token(d.COMMA,F)),z&&this._input.next(),z},R.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(d.EQUALS,F):F==="?."?this._create_token(d.DOT,F):this._create_token(d.OPERATOR,F)},R.prototype._read_non_javascript=function(F){var z="";if(F==="#"){if(this._is_first_token()&&(z=this.__patterns.shebang.read(),z))return this._create_token(d.UNKNOWN,z.trim()+`
|
|
|
`);if(z=this.__patterns.include.read(),z)return this._create_token(d.UNKNOWN,z.trim()+`
|
|
|
`);F=this._input.next();var q="#";if(this._input.hasNext()&&this._input.testChar(b)){do F=this._input.next(),q+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(q+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(q+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,q)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(z=this.__patterns.html_comment_start.read(),z){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)z+=this._input.next();return w=!0,this._create_token(d.COMMENT,z)}}else if(w&&F==="-"&&(z=this.__patterns.html_comment_end.read(),z))return w=!1,this._create_token(d.COMMENT,z);return null},R.prototype._read_comment=function(F){var z=null;if(F==="/"){var q="";if(this._input.peek(1)==="*"){q=this.__patterns.block_comment.read();var B=v.get_directives(q);B&&B.ignore==="start"&&(q+=v.readIgnored(this._input)),q=q.replace(l.allLineBreaks,`
|
|
|
`),z=this._create_token(d.BLOCK_COMMENT,q),z.directives=B}else this._input.peek(1)==="/"&&(q=this.__patterns.comment.read(),z=this._create_token(d.COMMENT,q))}return z},R.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var z=this._input.next();return this.has_char_escapes=!1,F==="`"?z+=this._read_string_recursive("`",!0,"${"):z+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(z=N(z)),this._input.peek()===F&&(z+=this._input.next()),z=z.replace(l.allLineBreaks,`
|
|
|
`),this._create_token(d.STRING,z)}return null},R.prototype._allow_regexp_or_xml=function(F){return F.type===d.RESERVED&&t(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===d.END_EXPR&&F.text===")"&&F.opened.previous.type===d.RESERVED&&t(F.opened.previous.text,["if","while","for"])||t(F.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},R.prototype._read_regexp=function(F,z){if(F==="/"&&this._allow_regexp_or_xml(z)){for(var q=this._input.next(),B=!1,M=!1;this._input.hasNext()&&(B||M||this._input.peek()!==F)&&!this._input.testChar(l.newline);)q+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?M=!0:this._input.peek()==="]"&&(M=!1)),this._input.next();return this._input.peek()===F&&(q+=this._input.next(),q+=this._input.read(l.identifier)),this._create_token(d.STRING,q)}return null},R.prototype._read_xml=function(F,z){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(z)){var q="",B=this.__patterns.xml.read_match();if(B){for(var M=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=M.indexOf("{")===0,J=0;B;){var K=!!B[1],Z=B[2],le=!!B[B.length-1]||Z.slice(0,8)==="![CDATA[";if(!le&&(Z===M||G&&Z.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(K?--J:++J),q+=B[0],J<=0)break;B=this.__patterns.xml.read_match()}return B||(q+=this._input.match(/[\s\S]*/g)[0]),q=q.replace(l.allLineBreaks,`
|
|
|
`),this._create_token(d.STRING,q)}}return null};function N(F){for(var z="",q=0,B=new s(F),M=null;B.hasNext();)if(M=B.match(/([\s]|[^\\]|\\\\)+/g),M&&(z+=M[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")M=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")M=B.match(/u([0-9A-Fa-f]{4})/g);else{z+="\\",B.hasNext()&&(z+=B.next());continue}if(!M)return F;if(q=parseInt(M[1],16),q>126&&q<=255&&M[0].indexOf("x")===0)return F;if(q>=0&&q<32){z+="\\"+M[0];continue}else q===34||q===39||q===92?z+="\\"+String.fromCharCode(q):z+=String.fromCharCode(q)}return z}R.prototype._read_string_recursive=function(F,z,q){var B,M;F==="'"?M=this.__patterns.single_quote:F==='"'?M=this.__patterns.double_quote:F==="`"?M=this.__patterns.template_text:F==="}"&&(M=this.__patterns.template_expression);for(var G=M.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===F||!z&&l.newline.test(J)){this._input.back();break}else J==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
|
|
|
`&&this._input.next(),J+=this._input.next()):q&&(q==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),q===J&&(F==="`"?J+=this._read_string_recursive("}",z,"`"):J+=this._read_string_recursive("`",z,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=M.read(),G+=J}return G},f.exports.Tokenizer=R,f.exports.TOKEN=d,f.exports.positionable_operators=m.slice(),f.exports.line_starters=h.slice()},function(f){var p=RegExp.prototype.hasOwnProperty("sticky");function c(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position<this.__input_length},c.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},c.prototype.peek=function(s){var n=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(n=this.__input.charAt(s)),n},c.prototype.__match=function(s,n){s.lastIndex=n;var o=s.exec(this.__input);return o&&!(p&&s.sticky)&&(o.index!==n&&(o=null)),o},c.prototype.test=function(s,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(s,n):!1},c.prototype.testChar=function(s,n){var o=this.peek(n);return s.lastIndex=0,o!==null&&s.test(o)},c.prototype.match=function(s){var n=this.__match(s,this.__position);return n?this.__position+=n[0].length:n=null,n},c.prototype.read=function(s,n,o){var r="",l;return s&&(l=this.match(s),l&&(r+=l[0])),n&&(l||!s)&&(r+=this.readUntil(n,o)),r},c.prototype.readUntil=function(s,n){var o="",r=this.__position;s.lastIndex=this.__position;var l=s.exec(this.__input);return l?(r=l.index,n&&(r+=l[0].length)):r=this.__input_length,o=this.__input.substring(this.__position,r),this.__position=r,o},c.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},c.prototype.get_regexp=function(s,n){var o=null,r="g";return n&&p&&(r="y"),typeof s=="string"&&s!==""?o=new RegExp(s,r):s&&(o=new RegExp(s.source,r)),o},c.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},c.prototype.peekUntilAfter=function(s){var n=this.__position,o=this.readUntilAfter(s);return this.__position=n,o},c.prototype.lookBack=function(s){var n=this.__position-1;return n>=s.length&&this.__input.substring(n-s.length,n).toLowerCase()===s},f.exports.InputScanner=c},function(f,p,c){var s=c(8).InputScanner,n=c(3).Token,o=c(10).TokenStream,r=c(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(i,t){this._input=new s(i),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var i,t=new n(l.START,""),d=null,v=[],y=new o;t.type!==l.EOF;){for(i=this._get_next_token(t,d);this._is_comment(i);)y.add(i),i=this._get_next_token(t,d);y.isEmpty()||(i.comments_before=y,y=new o),i.parent=d,this._is_opening(i)?(v.push(d),d=i):d&&this._is_closing(i,d)&&(i.opened=d,d.closed=i,d=v.pop(),i.parent=d),i.previous=t,t.next=i,this.__tokens.add(i),t=i}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(i,t){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(l.RAW,d):this._create_token(l.EOF,"")},a.prototype._is_comment=function(i){return!1},a.prototype._is_opening=function(i){return!1},a.prototype._is_closing=function(i,t){return!1},a.prototype._create_token=function(i,t){var d=new n(i,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=a,f.exports.TOKEN=l},function(f){function p(c){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=c}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__tokens[this.__position],this.__position+=1),c},p.prototype.peek=function(c){var s=null;return c=c||0,c+=this.__position,c>=0&&c<this.__tokens_length&&(s=this.__tokens[c]),s},p.prototype.add=function(c){this.__parent_token&&(c.parent=this.__parent_token),this.__tokens.push(c),this.__tokens_length+=1},f.exports.TokenStream=p},function(f,p,c){var s=c(12).Pattern;function n(o,r){s.call(this,o,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new s,n.prototype.__set_whitespace_patterns=function(o,r){o+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var r=this.__split(this._newline_regexp,o);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return o},n.prototype.matching=function(o,r){var l=this._create();return l.__set_whitespace_patterns(o,r),l._update(),l},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(o,r){o.lastIndex=0;for(var l=0,a=[],i=o.exec(r);i;)a.push(r.substring(l,i.index)),l=i.index+i[0].length,i=o.exec(r);return l<r.length?a.push(r.substring(l,r.length)):a.push(""),a},f.exports.WhitespacePattern=n},function(f){function p(c,s){this._input=c,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,s&&(this._starting_pattern=this._input.get_regexp(s._starting_pattern,!0),this._match_pattern=this._input.get_regexp(s._match_pattern,!0),this._until_pattern=this._input.get_regexp(s._until_pattern),this._until_after=s._until_after)}p.prototype.read=function(){var c=this._input.read(this._starting_pattern);return(!this._starting_pattern||c)&&(c+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),c},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(c){var s=this._create();return s._until_after=!0,s._until_pattern=this._input.get_regexp(c),s._update(),s},p.prototype.until=function(c){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(c),s._update(),s},p.prototype.starting_with=function(c){var s=this._create();return s._starting_pattern=this._input.get_regexp(c,!0),s._update(),s},p.prototype.matching=function(c){var s=this._create();return s._match_pattern=this._input.get_regexp(c,!0),s._update(),s},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},f.exports.Pattern=p},function(f){function p(c,s){c=typeof c=="string"?c:c.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(c+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(c+/\sbeautify\signore:end\s/.source+s,"g")}p.prototype.get_directives=function(c){if(!c.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(c);n;)s[n[1]]=n[2],n=this.__directive_pattern.exec(c);return s},p.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=p},function(f,p,c){var s=c(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(r,l){s.call(this,r,l),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var a=new s(r);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new s,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(r){var l=this._create();return l._disabled[r]=!0,l._update(),l},o.prototype.read_options=function(r){var l=this._create();for(var a in n)l._disabled[a]=r.templating.indexOf(a)===-1;return l._update(),l},o.prototype.exclude=function(r){var l=this._create();return l._excluded[r]=!0,l._update(),l},o.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),r+=l,l=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},o.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},o.prototype._read_template=function(){var r="",l=this._input.peek();if(l==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(r=r||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},f.exports.TemplatablePattern=o}],T={};function A(f){var p=T[f];if(p!==void 0)return p.exports;var c=T[f]={exports:{}};return D[f](c,c.exports,A),c.exports}var O=A(0);W=O})();var C=W;!(ce=[],ie=function(){return{js_beautify:C}}.apply(Xe,ce),ie!==void 0&&(nt.exports=ie))})()},"6eGT":function(nt,Xe,V){"use strict";function ce(ie){return null}Xe.a=ce},"7+5b":function(nt,Xe,V){nt.exports=V.p+"static/v.e7f297d6.svg"},"7Cbv":function(nt,Xe,V){"use strict";var ce=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ie=new Uint8Array(16);function W(){if(!ce)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ce(ie)}var C=/^(?:[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 D(n){return typeof n=="string"&&C.test(n)}for(var T=D,A=[],O=0;O<256;++O)A.push((O+256).toString(16).substr(1));function f(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(A[n[o+0]]+A[n[o+1]]+A[n[o+2]]+A[n[o+3]]+"-"+A[n[o+4]]+A[n[o+5]]+"-"+A[n[o+6]]+A[n[o+7]]+"-"+A[n[o+8]]+A[n[o+9]]+"-"+A[n[o+10]]+A[n[o+11]]+A[n[o+12]]+A[n[o+13]]+A[n[o+14]]+A[n[o+15]]).toLowerCase();if(!T(r))throw TypeError("Stringified UUID is invalid");return r}var p=f;function c(n,o,r){n=n||{};var l=n.random||(n.rng||W)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,o){r=r||0;for(var a=0;a<16;++a)o[r+a]=l[a];return o}return p(l)}var s=Xe.a=c},"7ahc":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return v});var ce=V("k1fw"),ie=V("0Owb"),W=V("+L6B"),C=V("2/Rp"),D=V("y8nQ"),T=V("Vl3Y"),A=V("tJVT"),O=V("OaEy"),f=V("2fM7"),p=V("cDcd"),c=V.n(p),s=V("VrN/"),n=V.n(s),o=V("p77/"),r=V.n(o),l=V("c5Ni"),a=V.n(l),i=f.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"]};Xe.b=function(y){var b=y.callback,g=y.onCancel,m=Object(p.useState)("python"),_=Object(A.a)(m,2),x=_[0],h=_[1];function E(w){h(d[w][1])}function S(w){b(w)}return c.a.createElement(T.a,Object(ie.a)({},t,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),c.a.createElement(T.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(f.a,{onChange:E},Object.keys(d).map(function(w){return c.a.createElement(i,{key:w,value:w},d[w][0])}))),c.a.createElement(T.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(v,{mode:x})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(C.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function v(y){var b=y.value,g=y.onChange,m=y.mode,_=y.options,x=_===void 0?{}:_,h=Object(p.useRef)(),E=Object(p.useState)(),S=Object(A.a)(E,2),w=S[0],R=S[1];return Object(p.useEffect)(function(){if(w){function N(F){var z=F.getValue();g&&g(z)}return w.on("change",N),function(){w.off("change",N)}}},[w,g]),Object(p.useEffect)(function(){w&&w.setOption("mode",m)},[w,m]),Object(p.useEffect)(function(){w&&((b!==w.getValue()||b==="")&&setTimeout(function(){w.setValue(b||" ")},300))},[w,b]),Object(p.useEffect)(function(){if(h.current&&!w){var N=n.a.fromTextArea(h.current,Object(ce.a)({mode:m,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));R(N)}},[h.current,w]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:h}))}},"7ixt":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return W});var ce={adjustX:1,adjustY:1},ie=[0,0],W={left:{points:["cr","cl"],overflow:ce,offset:[-4,0],targetOffset:ie},right:{points:["cl","cr"],overflow:ce,offset:[4,0],targetOffset:ie},top:{points:["bc","tc"],overflow:ce,offset:[0,-4],targetOffset:ie},bottom:{points:["tc","bc"],overflow:ce,offset:[0,4],targetOffset:ie},topLeft:{points:["bl","tl"],overflow:ce,offset:[0,-4],targetOffset:ie},leftTop:{points:["tr","tl"],overflow:ce,offset:[-4,0],targetOffset:ie},topRight:{points:["br","tr"],overflow:ce,offset:[0,-4],targetOffset:ie},rightTop:{points:["tl","tr"],overflow:ce,offset:[4,0],targetOffset:ie},bottomRight:{points:["tr","br"],overflow:ce,offset:[0,4],targetOffset:ie},rightBottom:{points:["bl","br"],overflow:ce,offset:[4,0],targetOffset:ie},bottomLeft:{points:["tl","bl"],overflow:ce,offset:[0,4],targetOffset:ie},leftBottom:{points:["br","bl"],overflow:ce,offset:[-4,0],targetOffset:ie}},C=W},"7qur":function(nt,Xe,V){"use strict";V.d(Xe,"m",function(){return ie}),V.d(Xe,"s",function(){return W}),V.d(Xe,"h",function(){return C}),V.d(Xe,"o",function(){return D}),V.d(Xe,"n",function(){return T}),V.d(Xe,"l",function(){return A}),V.d(Xe,"b",function(){return O}),V.d(Xe,"q",function(){return f}),V.d(Xe,"t",function(){return p}),V.d(Xe,"v",function(){return c}),V.d(Xe,"w",function(){return s}),V.d(Xe,"u",function(){return n}),V.d(Xe,"p",function(){return o}),V.d(Xe,"f",function(){return r}),V.d(Xe,"a",function(){return l}),V.d(Xe,"j",function(){return a}),V.d(Xe,"k",function(){return i}),V.d(Xe,"d",function(){return t}),V.d(Xe,"g",function(){return d}),V.d(Xe,"c",function(){return v}),V.d(Xe,"e",function(){return y}),V.d(Xe,"i",function(){return b}),V.d(Xe,"r",function(){return g});var ce=V("ErOA");function ie(m){return Object(ce.c)("mypractices/".concat(m,".json"),{hidePopLogin:!0})}function W(m,_){return Object(ce.f)("mypractices/".concat(m,"/code_submit.json"),_)}function C(m,_){return Object(ce.c)("mypractices/".concat(m,"/code_debug.json"),_)}function D(m,_){return Object(ce.c)("mypractices/".concat(m,"/submit_records.json"),_)}function T(m){return Object(ce.c)("mypractices/record_detail.json",{id:m})}function A(m,_){return Object(ce.c)("mypractices/".concat(m,"/result.json"),{mode:_})}function O(m,_){return Object(ce.f)("mypractices/".concat(m,"/add_notes.json"),_)}function f(m,_){return Object(ce.f)("mypractices/".concat(m,"/restore_initial_code.json"),_)}function p(m,_){return Object(ce.f)("mypractices/".concat(m,"/sync_code.json"),_)}function c(m,_){return Object(ce.f)("mypractices/".concat(m,"/update_code.json"),_)}function s(m){return Object(ce.f)("mypractices/".concat(m,"/initial_codes.json"))}function n(m,_){return Object(ce.f)("discusses/".concat(m,"/plus.json"),_)}function o(m){return Object(ce.c)("practices/practices_list.json",m)}function r(m,_){return Object(ce.c)("practices/".concat(m,"/question_solution_articles"),_)}function l(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles"),_)}function a(m,_){return Object(ce.g)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active),_)}function i(m,_){return Object(ce.c)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/edit"),_)}function t(m,_){return Object(ce.c)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active),_)}function d(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/set_authority_or_excellent"),_)}function v(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/praise_or_treads"),_)}function y(m,_){return Object(ce.f)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active,"/hide"))}function b(m,_){return Object(ce.b)("practices/".concat(m,"/question_solution_articles/").concat(_==null?void 0:_.active),_)}function g(m,_){return Object(ce.f)("mypractices/".concat(m,"/update_practice_time_sum"),_)}},"815F":function(nt,Xe,V){"use strict";V.d(Xe,"e",function(){return A}),V.d(Xe,"c",function(){return f}),V.d(Xe,"d",function(){return p}),V.d(Xe,"a",function(){return s}),V.d(Xe,"f",function(){return n}),V.d(Xe,"b",function(){return o});var ce=V("KQm4"),ie=V("VTBJ"),W=V("Ff2n"),C=V("Zm9Q"),D=V("Kwbf"),T=V("OZM5");function A(r,l){return r!=null?r:l}function O(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function a(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(i||[]).forEach(function(d){var v=d.key,y=d.children;Object(D.a)(v!=null,"Tree node must have a certain key: [".concat(t).concat(v,"]"));var b=String(v);Object(D.a)(!l.has(b)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(b)),l.set(b,!0),a(y,"".concat(t).concat(b," > "))})}a(r)}function f(r){function l(a){var i=Object(C.a)(a);return i.map(function(t){if(!Object(T.i)(t))return Object(D.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var d=t.key,v=t.props,y=v.children,b=Object(W.a)(v,["children"]),g=Object(ie.a)({key:d},b),m=l(y);return m.length&&(g.children=m),g}).filter(function(t){return t})}return l(r)}function p(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(l===!0?[]:l),i=[];function t(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(y,b){var g=Object(T.h)(v?v.pos:"0",b),m=A(y.key,g),_=Object(ie.a)(Object(ie.a)({},y),{},{parent:v,pos:g,children:null,data:y,isStart:[].concat(Object(ce.a)(v?v.isStart:[]),[b===0]),isEnd:[].concat(Object(ce.a)(v?v.isEnd:[]),[b===d.length-1])});return i.push(_),l===!0||a.has(m)?_.children=t(y.children||[],_):_.children=[],_})}return t(r),i}function c(r,l,a){var i;a?typeof a=="string"?i=function(v){return v[a]}:typeof a=="function"&&(i=function(v){return a(v)}):i=function(v,y){return A(v.key,y)};function t(d,v,y){var b=d?d.children:r,g=d?Object(T.h)(y.pos,v):"0";if(d){var m=i(d,g),_={node:d,index:v,pos:g,key:m,parentPos:y.node?y.pos:null,level:y.level+1};l(_)}b&&b.forEach(function(x,h){t(x,h,{node:d,pos:g,level:y?y.level+1:-1})})}t(null)}function s(r){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=l.initWrapper,i=l.processEntity,t=l.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,v={},y={},b={posEntities:v,keyEntities:y};return a&&(b=a(b)||b),c(r,function(g){var m=g.node,_=g.index,x=g.pos,h=g.key,E=g.parentPos,S=g.level,w={node:m,index:_,key:h,pos:x,level:S},R=A(h,x);v[x]=w,y[R]=w,w.parent=v[E],w.parent&&(w.parent.children=w.parent.children||[],w.parent.children.push(w)),i&&i(w,b)},d),t&&t(b),b}function n(r,l){var a=l.expandedKeys,i=l.selectedKeys,t=l.loadedKeys,d=l.loadingKeys,v=l.checkedKeys,y=l.halfCheckedKeys,b=l.dragOverNodeKey,g=l.dropPosition,m=l.keyEntities,_=m[r],x={eventKey:r,expanded:a.indexOf(r)!==-1,selected:i.indexOf(r)!==-1,loaded:t.indexOf(r)!==-1,loading:d.indexOf(r)!==-1,checked:v.indexOf(r)!==-1,halfChecked:y.indexOf(r)!==-1,pos:String(_?_.pos:""),dragOver:b===r&&g===0,dragOverGapTop:b===r&&g===-1,dragOverGapBottom:b===r&&g===1};return x}function o(r){var l=r.data,a=r.expanded,i=r.selected,t=r.checked,d=r.loaded,v=r.loading,y=r.halfChecked,b=r.dragOver,g=r.dragOverGapTop,m=r.dragOverGapBottom,_=r.pos,x=r.active,h=Object(ie.a)(Object(ie.a)({},l),{},{expanded:a,selected:i,checked:t,loaded:d,loading:v,halfChecked:y,dragOver:b,dragOverGapTop:g,dragOverGapBottom:m,pos:_,active:x});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(D.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),r}}),h}},"8EBN":function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";ce.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 ie=0;ie<ce.modeInfo.length;ie++){var W=ce.modeInfo[ie];W.mimes&&(W.mime=W.mimes[0])}ce.findModeByMIME=function(C){C=C.toLowerCase();for(var D=0;D<ce.modeInfo.length;D++){var T=ce.modeInfo[D];if(T.mime==C)return T;if(T.mimes){for(var A=0;A<T.mimes.length;A++)if(T.mimes[A]==C)return T}}if(/\+xml$/.test(C))return ce.findModeByMIME("application/xml");if(/\+json$/.test(C))return ce.findModeByMIME("application/json")},ce.findModeByExtension=function(C){C=C.toLowerCase();for(var D=0;D<ce.modeInfo.length;D++){var T=ce.modeInfo[D];if(T.ext){for(var A=0;A<T.ext.length;A++)if(T.ext[A]==C)return T}}},ce.findModeByFileName=function(C){for(var D=0;D<ce.modeInfo.length;D++){var T=ce.modeInfo[D];if(T.file&&T.file.test(C))return T}var A=C.lastIndexOf("."),O=A>-1&&C.substring(A+1,C.length);if(O)return ce.findModeByExtension(O)},ce.findModeByName=function(C){C=C.toLowerCase();for(var D=0;D<ce.modeInfo.length;D++){var T=ce.modeInfo[D];if(T.name.toLowerCase()==C)return T;if(T.alias){for(var A=0;A<T.alias.length;A++)if(T.alias[A].toLowerCase()==C)return T}}}})},"8hTe":function(nt,Xe,V){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,Xe,V){"use strict";var ce=V("DYRE"),ie=V("zeV3"),W=V("+L6B"),C=V("2/Rp"),D=V("k1fw"),T=V("9og8"),A=V("tJVT"),O=V("WmNS"),f=V.n(O),p=V("cDcd"),c=V.n(p),s=V("vg9a"),n=V("DlQD"),o=V.n(n),r=V("rUJ1");function l(ae,U){var H=ae.match(/^(\s+)(?:```)/);if(H===null)return U;var te=H[1];return U.split(`
|
|
|
`).map(function(pe){var se=pe.match(/^\s+/);if(se===null)return pe;var $e=Object(A.a)(se,1),yt=$e[0];return yt.length>=te.length?pe.slice(te.length):pe}).join(`
|
|
|
`)}var a=[],i=["<ul>"],t=new o.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){a.length=0,i=["<ul>"]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(ae,U,H,te){if(U>=ae.length||ae[U].level<=H)return U;var pe=ae[U];te.push("<li><a href='#"+pe.anchor+"'>"+pe.text+"</a>"),U++;var se=[];return U=b(ae,U,pe.level,se),se.length>0&&(te.push("<ul>"),se.forEach(function($e){te.push($e)}),te.push("</ul>")),te.push("</li>"),U=b(ae,U,H,te),U}function g(){return b(a,0,0,i),i.push("</ul>"),i.join("")}var m={heading:function(U){var H=d.exec(U);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(U){var H=this.rules.block.fences.exec(U);if(H){var te=H[0],pe=l(te,H[3]||""),se=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf(se)>=0){var $e=h(),yt=pe;pe=$e,E[$e]={type:"block",expression:yt}}return{type:"code",raw:te,lang:se,text:pe}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,h=function(){return"__special_katext_id_".concat(x++,"__")},E={};function S(){return E}function w(){x=0,E={}}function R(ae){return ae=ae.replace(_,function(U,H){var te=h();return E[te]={type:"inline",expression:H},te}),ae}var N=t.listitem;t.listitem=function(ae){return N(R(ae))};var F=t.paragraph;t.paragraph=function(ae){return F(R(ae))};var z=t.tablecell;t.tablecell=function(ae,U){return z(R(ae),U)},t.code=function(ae,U,H){var te=(U||"").match(/\S*/)[0];return te?["latex","katex","math"].indexOf(te)>=0?"<p class='editormd-tex'>".concat(ae,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(U,'">').concat(H?ae:Object(r.escape)(ae,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(H?ae:Object(r.escape)(ae,!0))+"</code></pre>"},t.heading=function(ae,U,H){var te=this.options.headerPrefix+H.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:te,level:U,text:ae}),"<h"+U+' id="'+te+'">'+ae+"</h"+U+">"},o.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),o.a.use({tokenizer:m,renderer:t});var q=o.a,B=V("SJMd"),M=V("ulZh"),G=V.n(M),J=V("m3rI"),K=V("Oy/b"),Z=V("p5ED"),le=V("ErOA");/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var de=function(ae,U){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,te){H.__proto__=te}||function(H,te){for(var pe in te)Object.prototype.hasOwnProperty.call(te,pe)&&(H[pe]=te[pe])})(ae,U)};function Te(ae,U){function H(){this.constructor=ae}de(ae,U),ae.prototype=U===null?Object.create(U):(H.prototype=U.prototype,new H)}function we(ae,U,H,te){return new(H||(H=Promise))(function(pe,se){function $e(Yt){try{Ot(te.next(Yt))}catch(St){se(St)}}function yt(Yt){try{Ot(te.throw(Yt))}catch(St){se(St)}}function Ot(Yt){var St;Yt.done?pe(Yt.value):(St=Yt.value,St instanceof H?St:new H(function(Wt){Wt(St)})).then($e,yt)}Ot((te=te.apply(ae,U||[])).next())})}function Ie(ae,U){var H,te,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:yt(0),throw:yt(1),return:yt(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function yt(Ot){return function(Yt){return function(St){if(H)throw new TypeError("Generator is already executing.");for(;$e;)try{if(H=1,te&&(pe=2&St[0]?te.return:St[0]?te.throw||((pe=te.return)&&pe.call(te),0):te.next)&&!(pe=pe.call(te,St[1])).done)return pe;switch(te=0,pe&&(St=[2&St[0],pe.value]),St[0]){case 0:case 1:pe=St;break;case 4:return $e.label++,{value:St[1],done:!1};case 5:$e.label++,te=St[1],St=[0];continue;case 7:St=$e.ops.pop(),$e.trys.pop();continue;default:if(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||St[0]!==6&&St[0]!==2)){$e=0;continue}if(St[0]===3&&(!pe||St[1]>pe[0]&&St[1]<pe[3])){$e.label=St[1];break}if(St[0]===6&&$e.label<pe[1]){$e.label=pe[1],pe=St;break}if(pe&&$e.label<pe[2]){$e.label=pe[2],$e.ops.push(St);break}pe[2]&&$e.ops.pop(),$e.trys.pop();continue}St=U.call(ae,$e)}catch(Wt){St=[6,Wt],te=0}finally{H=pe=0}if(5&St[0])throw St[1];return{value:St[0]?St[1]:void 0,done:!0}}([Ot,Yt])}}}function _e(){for(var ae=0,U=0,H=arguments.length;U<H;U++)ae+=arguments[U].length;var te=Array(ae),pe=0;for(U=0;U<H;U++)for(var se=arguments[U],$e=0,yt=se.length;$e<yt;$e++,pe++)te[pe]=se[$e];return te}var ye=function(){function ae(){}return ae.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ae.setAttributes=function(U,H){for(var te=0,pe=H;te<pe.length;te++){var se=pe[te],$e=se[0],yt=se[1];U.setAttribute($e,yt)}},ae.createRect=function(U,H,te){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",U.toString()),pe.setAttribute("height",H.toString()),te&&ae.setAttributes(pe,te),pe},ae.createLine=function(U,H,te,pe,se){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",U.toString()),$e.setAttribute("y1",H.toString()),$e.setAttribute("x2",te.toString()),$e.setAttribute("y2",pe.toString()),se&&ae.setAttributes($e,se),$e},ae.createPolygon=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","polygon");return te.setAttribute("points",U),H&&ae.setAttributes(te,H),te},ae.createCircle=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","circle");return te.setAttribute("cx",(U/2).toString()),te.setAttribute("cy",(U/2).toString()),te.setAttribute("r",U.toString()),H&&ae.setAttributes(te,H),te},ae.createEllipse=function(U,H,te){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(U/2).toString()),pe.setAttribute("cy",(H/2).toString()),pe.setAttribute("rx",(U/2).toString()),pe.setAttribute("ry",(H/2).toString()),te&&ae.setAttributes(pe,te),pe},ae.createGroup=function(U){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return U&&ae.setAttributes(H,U),H},ae.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ae.createMarker=function(U,H,te,pe,se,$e,yt){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return ae.setAttributes(Ot,[["id",U],["orient",H],["markerWidth",te.toString()],["markerHeight",pe.toString()],["refX",se.toString()],["refY",$e.toString()]]),Ot.appendChild(yt),Ot},ae.createText=function(U){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),U&&ae.setAttributes(H,U),H},ae.createTSpan=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","tspan");return te.textContent=U,H&&ae.setAttributes(te,H),te},ae.createImage=function(U){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return U&&ae.setAttributes(H,U),H},ae.createPoint=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return te.x=U,te.y=H,te},ae.createPath=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","path");return te.setAttribute("d",U),H&&ae.setAttributes(te,H),te},ae}(),Ke=function(){function ae(){}return ae.addKey=function(U){ae.key=U},Object.defineProperty(ae,"isLicensed",{get:function(){return!!ae.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ae.key)},enumerable:!1,configurable:!0}),ae}(),Me=function(){function ae(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ae.prototype.rasterize=function(U,H,te){var pe=this;return new Promise(function(se){var $e=te!==void 0?te:document.createElement("canvas");U===null&&(pe.markersOnly=!0,pe.naturalSize=!1);var yt=document.createElementNS("http://www.w3.org/2000/svg","svg");yt.setAttribute("xmlns","http://www.w3.org/2000/svg"),yt.setAttribute("width",H.width.baseVal.valueAsString),yt.setAttribute("height",H.height.baseVal.valueAsString),yt.setAttribute("viewBox","0 0 "+H.viewBox.baseVal.width.toString()+" "+H.viewBox.baseVal.height.toString()),yt.innerHTML=H.innerHTML,pe.naturalSize===!0?(yt.width.baseVal.value=U.naturalWidth,yt.height.baseVal.value=U.naturalHeight):pe.width!==void 0&&pe.height!==void 0&&(yt.width.baseVal.value=pe.width,yt.height.baseVal.value=pe.height),$e.width=yt.width.baseVal.value,$e.height=yt.height.baseVal.value;var Ot=yt.outerHTML,Yt=$e.getContext("2d");pe.markersOnly!==!0&&Yt.drawImage(U,0,0,$e.width,$e.height);var St=window.URL,Wt=new Image($e.width,$e.height);Wt.setAttribute("crossOrigin","anonymous");var ln=new Blob([Ot],{type:"image/svg+xml"}),Bn=St.createObjectURL(ln);Wt.onload=function(){Yt.drawImage(Wt,0,0),St.revokeObjectURL(Bn);var Oi=$e.toDataURL(pe.imageType,pe.imageQuality);se(Oi)},Wt.src=Bn})},ae}(),Fe=function(){},Ge=function(){function ae(U){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+U+"_"}return Object.defineProperty(ae.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ae.prototype.addClass=function(U){return this.styleSheet===void 0&&this.addStyleSheet(),U.name=""+this.classNamePrefix+U.localName,this.classes.push(U),this.styleSheet.sheet.insertRule("."+U.name+" {"+U.style+"}",this.styleSheet.sheet.cssRules.length),U},ae.prototype.addRule=function(U){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(U),this.styleSheet.sheet.insertRule(U.selector+" {"+U.style+"}",this.styleSheet.sheet.cssRules.length)},ae.prototype.addStyleSheet=function(){var U;this.styleSheet=document.createElement("style"),((U=this.styleSheetRoot)!==null&&U!==void 0?U:document.head).appendChild(this.styleSheet),this.addRule(new Ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new me("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new me("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ae.prototype.removeStyleSheet=function(){var U;this.styleSheet&&(((U=this.styleSheetRoot)!==null&&U!==void 0?U:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ae}(),Ee=function(ae,U){this.selector=ae,this.style=U},me=function(ae,U){this.localName=ae,this.style=U},We=function(){function ae(U,H,te,pe,se){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=U,this.displayMode=H,this.markerItems=te,this.uiStyleSettings=pe,this.styles=se,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ae.prototype.show=function(U){var H=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=U,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var te=document.createElement("div");te.className=this.toolbarBlockStyleClass.name,te.style.whiteSpace="nowrap",this.uiContainer.appendChild(te),this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(se){var $e=document.createElement("div");$e.className=""+H.toolbarButtonStyleClass.name,$e.setAttribute("data-type-name",se.typeName),$e.innerHTML=se.icon,$e.addEventListener("click",function(){H.markerToolbarButtonClicked($e,se)}),H.buttons.push($e),H.markerButtons.push($e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ae.prototype.addButtonClickListener=function(U){this.buttonClickListeners.push(U)},ae.prototype.removeButtonClickListener=function(U){this.buttonClickListeners.indexOf(U)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(U),1)},ae.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ae.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var U=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var H=0;H<this.markerButtons.length;H++)H<U||H===U&&this.markerButtons.length-1===U?this.markerButtonBlock.appendChild(this.markerButtons[H]):(H===U&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[H]))}},ae.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ae.prototype.resetButtonStyles=function(){var U=this;this.buttons.forEach(function(H){H.className=H.className.replace(U.uiStyleSettings.toolbarButtonStyleColorsClassName?U.uiStyleSettings.toolbarButtonStyleColorsClassName:U.toolbarButtonStyleColorsClass.name,"").trim(),H.className=H.className.replace(U.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?U.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:U.toolbarActiveButtonStyleColorsClass.name,"").trim(),H.className+=" "+(U.uiStyleSettings.toolbarButtonStyleColorsClassName?U.uiStyleSettings.toolbarButtonStyleColorsClassName:U.toolbarButtonStyleColorsClass.name)})},ae.prototype.addActionButton=function(U,H,te){var pe=this,se=document.createElement("div");switch(se.className=""+this.toolbarButtonStyleClass.name,se.innerHTML=H,se.setAttribute("data-action",te),se.addEventListener("click",function(){pe.actionToolbarButtonClicked(se,te)}),te){case"select":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":se.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":se.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":se.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":se.style.fill=this.uiStyleSettings.closeButtonColor}U.appendChild(se),this.buttons.push(se)},ae.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new me("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new me("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new me("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new me("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new me("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var U=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new me("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*U)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*U)+`px;
|
|
|
padding: `+U+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new me("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Ee("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Ee("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},ae.prototype.markerToolbarButtonClicked=function(U,H){this.setActiveButton(U),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(te){return te("marker",H)}),this.markerButtonOverflowBlock.style.display="none"},ae.prototype.actionToolbarButtonClicked=function(U,H){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(te){return te("action",H)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ae.prototype.setActiveButton=function(U){this.resetButtonStyles(),U.className=U.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),U.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ae.prototype.setActiveMarkerButton=function(U){var H=this.markerButtons.find(function(te){return te.getAttribute("data-type-name")===U});H&&this.setActiveButton(H)},ae.prototype.setCurrentMarker=function(U){var H=this;this.currentMarker=U,this.buttons.filter(function(te){return/delete|notes/.test(te.getAttribute("data-action"))}).forEach(function(te){H.currentMarker===void 0?(te.style.fillOpacity="0.4",te.style.pointerEvents="none"):(te.style.fillOpacity="1",te.style.pointerEvents="all")})},ae}(),He=function(){function ae(U,H,te,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=U,this.displayMode=H,this.uiStyleSettings=te,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ae.prototype.addStyles=function(){var U;this.toolboxStyleClass=this.styles.addClass(new me("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new me("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var H=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new me("toolbox-panel-row_colors",`
|
|
|
background-color: `+((U=this.uiStyleSettings.toolboxBackgroundColor)!==null&&U!==void 0?U:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new me("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
|
|
|
padding: `+H+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new me("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},ae.prototype.show=function(U){var H;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=U,this.uiContainer.className=this.toolboxStyleClass.name+" "+((H=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ae.prototype.setPanelButtons=function(U){var H,te,pe=this;this.panels=U,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((te=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&te!==void 0?te:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(se){var $e;se.uiStyleSettings=pe.uiStyleSettings;var yt=document.createElement("div");yt.className=pe.toolboxButtonStyleClass.name+" "+(($e=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$e!==void 0?$e:pe.toolboxButtonStyleColorsClass.name),yt.innerHTML=se.icon,yt.title=se.title,yt.addEventListener("click",function(){pe.panelButtonClick(se)}),pe.panelButtons.push(yt),pe.buttonRow.appendChild(yt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ae.prototype.panelButtonClick=function(U){var H=this,te=-1;if(U!==this.activePanel){te=this.panels.indexOf(U),this.panelRow.innerHTML="";var pe=U.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=U}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){H.displayMode==="inline"?H.panelRow.style.display="none":H.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(se,$e){var yt,Ot;se.className=H.toolboxButtonStyleClass.name+" "+($e===te?""+((yt=H.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&yt!==void 0?yt:H.toolboxActiveButtonStyleColorsClass.name):""+((Ot=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:H.toolboxButtonStyleColorsClass.name))})},ae}(),it=function(ae,U){this.title=ae,this.icon=U},re=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return $e.colors=[],$e.addTransparent=!1,$e.colorBoxes=[],$e.colors=te,$e.currentColor=pe,$e.setCurrentColor=$e.setCurrentColor.bind($e),$e.getColorBox=$e.getColorBox.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.overflow="hidden",te.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var se=H.getColorBox(pe);te.appendChild(se),H.colorBoxes.push(se)}),te},U.prototype.getColorBox=function(H){var te=this,pe=this.uiStyleSettings.toolbarHeight/4,se=this.uiStyleSettings.toolbarHeight-pe,$e=document.createElement("div");$e.style.display="inline-block",$e.style.boxSizing="content-box",$e.style.width=se-2+"px",$e.style.height=se-2+"px",$e.style.padding="1px",$e.style.marginRight="2px",$e.style.marginBottom="2px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderRadius=(se+2)/2+"px",$e.style.borderColor=H===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){te.setCurrentColor(H,$e)});var yt=document.createElement("div");return yt.style.display="inline-block",yt.style.width=se-2+"px",yt.style.height=se-2+"px",yt.style.backgroundColor=H,yt.style.borderRadius=se/2+"px",H==="transparent"&&(yt.style.fill=this.uiStyleSettings.toolboxAccentColor,yt.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),$e.appendChild(yt),$e},U.prototype.setCurrentColor=function(H,te){var pe=this;this.currentColor=H,this.colorBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(H)},U}(it),P=function(){function ae(U,H,te){this._state="new",this._isSelected=!1,this._container=U,this._overlayContainer=H,this.globalSettings=te,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ae.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ae.prototype.ownsTarget=function(U){return!1},Object.defineProperty(ae.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ae.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ae.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ae.prototype.pointerDown=function(U,H){},ae.prototype.dblClick=function(U,H){},ae.prototype.manipulate=function(U){},ae.prototype.pointerUp=function(U){this.stateChanged()},ae.prototype.dispose=function(){},ae.prototype.addMarkerVisualToContainer=function(U){this.container.childNodes.length>0?this.container.insertBefore(U,this.container.childNodes[0]):this.container.appendChild(U)},ae.prototype.getState=function(){return{typeName:ae.typeName,state:this.state,notes:this.notes}},ae.prototype.restoreState=function(U){this._state=U.state,this.notes=U.notes},ae.prototype.scale=function(U,H){},ae.prototype.colorChanged=function(U){this.onColorChanged&&this.onColorChanged(U),this.stateChanged()},ae.prototype.fillColorChanged=function(U){this.onFillColorChanged&&this.onFillColorChanged(U),this.stateChanged()},ae.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var U=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),U.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(U)&&this.onStateChanged(this)}},ae.typeName="MarkerBase",ae}(),j=function(){function ae(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ae.prototype.findGripByVisual=function(U){return this.topLeft.ownsTarget(U)?this.topLeft:this.topCenter.ownsTarget(U)?this.topCenter:this.topRight.ownsTarget(U)?this.topRight:this.centerLeft.ownsTarget(U)?this.centerLeft:this.centerRight.ownsTarget(U)?this.centerRight:this.bottomLeft.ownsTarget(U)?this.bottomLeft:this.bottomCenter.ownsTarget(U)?this.bottomCenter:this.bottomRight.ownsTarget(U)?this.bottomRight:void 0},ae}(),ee=function(){function ae(){this.GRIP_SIZE=10,this.visual=ye.createGroup(),this.visual.appendChild(ye.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ye.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(U){return U===this.visual||U===this.visual.childNodes[0]||U===this.visual.childNodes[1]},ae}(),$=function(){function ae(){}return ae.toITransformMatrix=function(U){return{a:U.a,b:U.b,c:U.c,d:U.d,e:U.e,f:U.f}},ae.toSVGMatrix=function(U,H){return U.a=H.a,U.b=H.b,U.c=H.c,U.d=H.d,U.e=H.e,U.f=H.f,U},ae}(),Q=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.left=0,se.top=0,se.width=0,se.height=0,se.defaultSize={x:50,y:20},se.offsetX=0,se.offsetY=0,se.rotationAngle=0,se.CB_DISTANCE=10,se._suppressMarkerCreateEvent=!1,se.container.transform.baseVal.appendItem(ye.createTransform()),se.setupControlBox(),se}return Te(U,ae),Object.defineProperty(U.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"visual",{get:function(){return this._visual},set:function(H){this._visual=H;var te=ye.createTransform();this._visual.transform.baseVal.appendItem(te)},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(H){return!!ae.prototype.ownsTarget.call(this,H)||!!(this.controlGrips.findGripByVisual(H)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H))},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.left=H.x,this.top=H.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var pe=this.unrotatePoint(H);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(te),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(te)){this.activeGrip=this.rotatorGrip;var se=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=se.x-this.width/2,this.top=se.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $e=this.container.transform.baseVal.getItem(0);$e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},U.prototype.pointerUp=function(H){var te=this.state;ae.prototype.pointerUp.call(this,H),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(H),this._state="select",te==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},U.prototype.moveVisual=function(H){this.visual.style.transform="translate("+H.x+"px, "+H.y+"px)"},U.prototype.manipulate=function(H){var te=this.unrotatePoint(H);this.state==="creating"?this.resize(H):this.state==="move"?(this.left=this.manipulationStartLeft+(te.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(te.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(te):this.state==="rotate"&&this.rotate(H)},U.prototype.resize=function(H){var te=this.manipulationStartLeft,pe=this.manipulationStartWidth,se=this.manipulationStartTop,$e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:te=this.manipulationStartLeft+H.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-te;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=this.manipulationStartWidth+H.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:se=this.manipulationStartTop+H.y-this.manipulationStartY,$e=this.manipulationStartHeight+this.manipulationStartTop-se;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$e=this.manipulationStartHeight+H.y-this.manipulationStartY}pe>=0?(this.left=te,this.width=pe):(this.left=te+pe,this.width=-pe),$e>=0?(this.top=se,this.height=$e):(this.top=se+$e,this.height=-$e),this.setSize()},U.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},U.prototype.rotate=function(H){if(Math.abs(H.x-this.centerX)>.1){var te=Math.sign(H.x-this.centerX);this.rotationAngle=180*Math.atan((H.y-this.centerY)/(H.x-this.centerX))/Math.PI+90*te,this.applyRotation()}},U.prototype.applyRotation=function(){var H=this.container.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(H,0)},U.prototype.rotatePoint=function(H){if(this.rotationAngle===0)return H;var te=this.container.getCTM(),pe=ye.createPoint(H.x,H.y);return{x:(pe=pe.matrixTransform(te)).x,y:pe.y}},U.prototype.unrotatePoint=function(H){if(this.rotationAngle===0)return H;var te=this.container.getCTM();te=te.inverse();var pe=ye.createPoint(H.x,H.y);return{x:(pe=pe.matrixTransform(te)).x,y:pe.y}},U.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},U.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},U.prototype.setupControlBox=function(){this.controlBox=ye.createGroup();var H=ye.createTransform();H.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(H),this.container.appendChild(this.controlBox),this.controlRect=ye.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ye.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new j,this.addControlGrips(),this.controlBox.style.display="none"},U.prototype.adjustControlBox=function(){var H=this.controlBox.transform.baseVal.getItem(0);H.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(H,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},U.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},U.prototype.createGrip=function(){var H=new ee;return H.visual.transform.baseVal.appendItem(ye.createTransform()),this.controlBox.appendChild(H.visual),H},U.prototype.positionGrips=function(){var H=this.controlGrips.topLeft.GRIP_SIZE,te=-H/2,pe=te,se=(this.width+this.CB_DISTANCE)/2-H/2,$e=(this.height+this.CB_DISTANCE)/2-H/2,yt=this.height+this.CB_DISTANCE-H/2,Ot=this.width+this.CB_DISTANCE-H/2;this.positionGrip(this.controlGrips.topLeft.visual,te,pe),this.positionGrip(this.controlGrips.topCenter.visual,se,pe),this.positionGrip(this.controlGrips.topRight.visual,Ot,pe),this.positionGrip(this.controlGrips.centerLeft.visual,te,$e),this.positionGrip(this.controlGrips.centerRight.visual,Ot,$e),this.positionGrip(this.controlGrips.bottomLeft.visual,te,yt),this.positionGrip(this.controlGrips.bottomCenter.visual,se,yt),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,yt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,se,pe-3*this.CB_DISTANCE)},U.prototype.positionGrip=function(H,te,pe){var se=H.transform.baseVal.getItem(0);se.setTranslate(te,pe),H.transform.baseVal.replaceItem(se,0)},U.prototype.hideControlBox=function(){this.controlBox.style.display="none"},U.prototype.showControlBox=function(){this.controlBox.style.display=""},U.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:$.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:$.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ae.prototype.getState.call(this))},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.left=te.left,this.top=te.top,this.width=te.width,this.height=te.height,this.rotationAngle=te.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,te.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix($.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,te.containerTransformMatrix))},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te);var pe=this.rotatePoint({x:this.left,y:this.top}),se=this.unrotatePoint({x:pe.x*H,y:pe.y*te});this.left=se.x,this.top=se.y,this.width=this.width*H,this.height=this.height*te,this.adjustControlBox()},U}(P),xe=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.createVisual=se.createVisual.bind(se),se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual)},U.prototype.createVisual=function(){this.visual=ye.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},U.prototype.manipulate=function(H){ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),this.setSize()},U.prototype.setSize=function(){ae.prototype.setSize.call(this),ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(H){ae.prototype.pointerUp.call(this,H),this.setSize()},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&ye.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},U.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&ye.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&ye.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&ye.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},U.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this))},U.prototype.restoreState=function(H){var te=H;this.fillColor=te.fillColor,this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.opacity=te.opacity,this.createVisual(),ae.prototype.restoreState.call(this,H),this.setSize()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setSize()},U.title="Rectangle marker",U}(Q),De=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return $e.widths=[],$e.widthBoxes=[],$e.widths=te,$e.currentWidth=pe,$e.setCurrentWidth=$e.setCurrentWidth.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2",this.widths.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.flexGrow="2",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=pe===H.currentWidth?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentWidth(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.innerText=pe.toString(),$e.style.marginRight="5px",se.appendChild($e);var yt=document.createElement("div");yt.style.minHeight="20px",yt.style.flexGrow="2",yt.style.display="flex",yt.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=pe+"px solid "+H.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",yt.appendChild(Ot),se.appendChild(yt),H.widthBoxes.push(se)}),te},U.prototype.setCurrentWidth=function(H,te){var pe=this;this.currentWidth=H,this.widthBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},U}(it),dt=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return $e.styles=[],$e.styleBoxes=[],$e.styles=te,$e.currentStyle=pe,$e.setCurrentStyle=$e.setCurrentStyle.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2",this.styles.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/H.styles.length-5+"%",se.style.borderColor=pe===H.currentStyle?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentStyle(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.overflow="hidden";var yt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+H.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(pe!==""?'stroke-dasharray="'+pe+'"':"")+` />
|
|
|
</svg>`;$e.innerHTML=yt,se.appendChild($e),H.styleBoxes.push(se)}),te},U.prototype.setCurrentStyle=function(H,te){var pe=this;this.currentStyle=H,this.styleBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},U}(it),Ne=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(U,ae),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="FrameMarker",U.title="Frame marker",U.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',U}(xe),Be=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},tt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.x1=0,se.y1=0,se.x2=0,se.y2=0,se.defaultLength=50,se.manipulationStartX=0,se.manipulationStartY=0,se.manipulationStartX1=0,se.manipulationStartY1=0,se.manipulationStartX2=0,se.manipulationStartY2=0,se.setupControlBox(),se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!!ae.prototype.ownsTarget.call(this,H)||!(!this.grip1.ownsTarget(H)&&!this.grip2.ownsTarget(H))},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.manipulationStartX=H.x,this.manipulationStartY=H.y,this.state==="new"&&(this.x1=H.x,this.y1=H.y,this.x2=H.x,this.y2=H.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(te)?this.activeGrip=this.grip1:this.grip2.ownsTarget(te)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},U.prototype.pointerUp=function(H){var te=this.state;ae.prototype.pointerUp.call(this,H),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(H),this._state="select",te==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},U.prototype.adjustVisual=function(){},U.prototype.manipulate=function(H){this.state==="creating"?this.resize(H):this.state==="move"?(this.x1=this.manipulationStartX1+H.x-this.manipulationStartX,this.y1=this.manipulationStartY1+H.y-this.manipulationStartY,this.x2=this.manipulationStartX2+H.x-this.manipulationStartX,this.y2=this.manipulationStartY2+H.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(H)},U.prototype.resize=function(H){switch(this.activeGrip){case this.grip1:this.x1=H.x,this.y1=H.y;break;case this.grip2:case void 0:this.x2=H.x,this.y2=H.y}this.adjustVisual(),this.adjustControlBox()},U.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},U.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},U.prototype.setupControlBox=function(){this.controlBox=ye.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},U.prototype.adjustControlBox=function(){this.positionGrips()},U.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},U.prototype.createGrip=function(){var H=new ee;return H.visual.transform.baseVal.appendItem(ye.createTransform()),this.controlBox.appendChild(H.visual),H},U.prototype.positionGrips=function(){var H=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-H/2,this.y1-H/2),this.positionGrip(this.grip2.visual,this.x2-H/2,this.y2-H/2)},U.prototype.positionGrip=function(H,te,pe){var se=H.transform.baseVal.getItem(0);se.setTranslate(te,pe),H.transform.baseVal.replaceItem(se,0)},U.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ae.prototype.getState.call(this))},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.x1=te.x1,this.y1=te.y1,this.x2=te.x2,this.y2=te.y2},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.x1=this.x1*H,this.y1=this.y1*te,this.x2=this.x2*H,this.y2=this.y2*te,this.adjustVisual(),this.adjustControlBox()},U}(P),lt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorLine&&H!==this.visibleLine)},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.selectorLine=ye.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ye.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},U.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ye.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ye.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.createVisual(),this.adjustVisual()},U.typeName="LineMarker",U.title="Line marker",U.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',U}(tt),qe=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return $e.fonts=[],$e.fontBoxes=[],$e.fonts=te,$e.currentFont=pe,$e.setCurrentFont=$e.setCurrentFont.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.overflow="hidden",te.style.flexGrow="2",this.fonts.forEach(function(pe){var se=document.createElement("div");se.style.display="inline-block",se.style.alignItems="center",se.style.justifyContent="space-between",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.overflow="hidden",se.style.maxWidth=100/H.fonts.length-5+"%",se.style.borderColor=pe===H.currentFont?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentFont(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.style.display="flex",$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.fontFamily=pe,$e.style.overflow="hidden";var yt=document.createElement("div");yt.style.whiteSpace="nowrap",yt.style.overflow="hidden",yt.style.textOverflow="ellipsis",yt.innerHTML="The quick brown fox jumps over the lazy dog",$e.appendChild(yt),se.appendChild($e),H.fontBoxes.push(se)}),te},U.prototype.setCurrentFont=function(H,te){var pe=this;this.currentFont=H,this.fontBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},U}(it),Ye=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.color="transparent",se.padding=5,se.DEFAULT_TEXT="your text here",se.text=se.DEFAULT_TEXT,se.isMoved=!1,se.color=pe.defaultColor,se.fontFamily=pe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setColor=se.setColor.bind(se),se.setFont=se.setFont.bind(se),se.renderText=se.renderText.bind(se),se.sizeText=se.sizeText.bind(se),se.textEditDivClicked=se.textEditDivClicked.bind(se),se.showTextEditor=se.showTextEditor.bind(se),se.setSize=se.setSize.bind(se),se.positionTextEditor=se.positionTextEditor.bind(se),se.colorPanel=new re("Color",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.fontFamilyPanel=new qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se}return Te(U,ae),U.prototype.ownsTarget=function(H){if(ae.prototype.ownsTarget.call(this,H)||H===this.visual||H===this.textElement||H===this.bgRectangle)return!0;var te=!1;return this.textElement.childNodes.forEach(function(pe){pe===H&&(te=!0)}),te},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.bgRectangle=ye.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ye.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ye.createTransform()),this.textElement.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.isMoved=!1,this.pointerDownPoint=H,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},U.prototype.renderText=function(){var H=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(te){H.textElement.appendChild(ye.createTSpan(te.trim()===""?" ":te.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},U.prototype.getTextScale=function(){var H=this.textElement.getBBox(),te=1;if(H.width>0&&H.height>0){var pe=(1*this.width-this.width*this.padding*2/100)/H.width,se=(1*this.height-this.height*this.padding*2/100)/H.height;te=Math.min(pe,se)}return te},U.prototype.getTextPosition=function(H){var te=this.textElement.getBBox(),pe=0,se=0;return te.width>0&&te.height>0&&(pe=(this.width-te.width*H)/2,se=this.height/2-te.height*H/2),{x:pe,y:se}},U.prototype.sizeText=function(){var H=this.textElement.getBBox(),te=this.getTextScale(),pe=this.getTextPosition(te);pe.y-=H.y*te,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+te+", "+te+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(te,te))},U.prototype.manipulate=function(H){ae.prototype.manipulate.call(this,H),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(H.x-this.pointerDownPoint.x)>5||Math.abs(H.y-this.pointerDownPoint.y)>5)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),this.isMoved=!0,this.setSize(),this.sizeText()},U.prototype.setSize=function(){ae.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},U.prototype.pointerUp=function(H){var te=this.state;te==="creating"&&(this._suppressMarkerCreateEvent=!0),ae.prototype.pointerUp.call(this,H),this.setSize(),(te==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},U.prototype.showTextEditor=function(){var H=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(te){te.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var te=Number.parseFloat(H.textEditor.style.fontSize);H.textEditor.clientWidth>=Number.parseInt(H.textEditor.style.maxWidth)&&te>.9;)te-=.1,H.textEditor.style.fontSize=Math.max(te,.9)+"em"}),this.textEditor.addEventListener("keyup",function(te){te.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(te){if(te.clipboardData){var pe=te.clipboardData.getData("text"),se=window.getSelection();if(!se.rangeCount)return!1;se.deleteFromDocument(),se.getRangeAt(0).insertNode(document.createTextNode(pe)),te.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){H.textEditDivClicked(H.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},U.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var H=this.getTextScale(),te=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),pe=this.textElement.getBBox(),se={x:pe.width*H,y:pe.height*H};te.x-=se.x/2,te.y-=se.y/2,this.textEditor.style.top=te.y+"px",this.textEditor.style.left=te.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-te.x+"px",this.textEditor.style.fontSize=Math.max(16*H,12)+"px",this.textElement.style.display="none"}},U.prototype.textEditDivClicked=function(H){this.text=H.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},U.prototype.select=function(){ae.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},U.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ae.prototype.deselect.call(this)},U.prototype.dblClick=function(H,te){ae.prototype.dblClick.call(this,H,te),this.showTextEditor()},U.prototype.setColor=function(H){this.textElement&&ye.setAttributes(this.textElement,[["fill",H]]),this.color=H,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(H)},U.prototype.setFont=function(H){this.textElement&&ye.setAttributes(this.textElement,[["font-family",H]]),this.fontFamily=H,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},U.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},U.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){var te=H;this.color=te.color,this.fontFamily=te.fontFamily,this.padding=te.padding,this.text=te.text,this.createVisual(),ae.prototype.restoreState.call(this,H),this.setSize()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setSize(),this.sizeText(),this.positionTextEditor()},U.typeName="TextMarker",U.title="Text marker",U.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',U}(Q),je=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.color="transparent",se.lineWidth=3,se.drawing=!1,se.pixelRatio=1,se.color=pe.defaultColor,se.lineWidth=pe.defaultStrokeWidth,se.pixelRatio=pe.freehandPixelRatio,se.setColor=se.setColor.bind(se),se.addCanvas=se.addCanvas.bind(se),se.finishCreation=se.finishCreation.bind(se),se.setLineWidth=se.setLineWidth.bind(se),se.colorPanel=new re("Color",pe.defaultColorSet,pe.defaultColor),se.colorPanel.onColorChanged=se.setColor,se.lineWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.lineWidthPanel.onWidthChanged=se.setLineWidth,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.drawingImage)},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.drawingImage=ye.createImage(),this.visual.appendChild(this.drawingImage);var H=ye.createTransform();this.visual.transform.baseVal.appendItem(H),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(H.x,H.y),this.drawing=!0):ae.prototype.pointerDown.call(this,H,te)},U.prototype.manipulate=function(H){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(H.x,H.y),this.canvasContext.stroke()):ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},U.prototype.pointerUp=function(H){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ae.prototype.pointerUp.call(this,H)},U.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},U.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.select.call(this)},U.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.deselect.call(this)},U.prototype.finishCreation=function(){for(var H=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),te=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=te[0],se=te[1],$e=te[2],yt=te[3],Ot=!1,Yt=0;Yt<this.canvasElement.height;Yt++)for(var St=0;St<this.canvasElement.width;St++)H.data[Yt*this.canvasElement.width*4+4*St+3]>0&&(Ot=!0,Yt<se&&(se=Yt),St<pe&&(pe=St),Yt>yt&&(yt=Yt),St>$e&&($e=St));if(Ot){this.left=pe/this.pixelRatio,this.top=se/this.pixelRatio,this.width=($e-pe)/this.pixelRatio,this.height=(yt-se)/this.pixelRatio;var Wt=document.createElement("canvas");Wt.width=$e-pe,Wt.height=yt-se,Wt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,se,$e-pe,yt-se),0,0),this.drawingImgUrl=Wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},U.prototype.setDrawingImage=function(){ye.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},U.prototype.setColor=function(H){this.color=H,this.colorChanged(H)},U.prototype.setLineWidth=function(H){this.lineWidth=H},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({drawingImgUrl:this.drawingImgUrl},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){this.createVisual(),ae.prototype.restoreState.call(this,H),this.drawingImgUrl=H.drawingImgUrl,this.setDrawingImage()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setDrawingImage()},U.typeName="FreehandMarker",U.title="Freehand marker",U.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',U}(Q),Ue=function(ae){function U(H,te,pe){var se=ae.call(this,H,pe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return se.typeBoxes=[],se.currentType=te,se.setCurrentType=se.setCurrentType.bind(se),se}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2";for(var pe=function(yt){var Ot="both";switch(yt){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var Yt=document.createElement("div");if(Yt.style.display="flex",Yt.style.flexGrow="2",Yt.style.alignItems="center",Yt.style.justifyContent="space-between",Yt.style.padding="5px",Yt.style.borderWidth="2px",Yt.style.borderStyle="solid",Yt.style.borderColor=Ot===se.currentType?se.uiStyleSettings.toolboxAccentColor:"transparent",Yt.addEventListener("click",function(){H.setCurrentType(Ot,Yt)}),te.appendChild(Yt),Ot==="both"||Ot==="start"){var St=document.createElement("div");St.style.display="flex",St.style.alignItems="center",St.style.minHeight="20px",St.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,St.style.marginLeft="5px",Yt.appendChild(St)}var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.style.flexGrow="2";var ln=document.createElement("hr");if(ln.style.minWidth="20px",ln.style.border="0px",ln.style.borderTop="3px solid "+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee"),ln.style.flexGrow="2",Wt.appendChild(ln),Yt.appendChild(Wt),Ot==="both"||Ot==="end"){var Bn=document.createElement("div");Bn.style.display="flex",Bn.style.alignItems="center",Bn.style.minHeight="20px",Bn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,Bn.style.marginRight="5px",Yt.appendChild(Bn)}se.typeBoxes.push(Yt)},se=this,$e=0;$e<4;$e++)pe($e);return te},U.prototype.setCurrentType=function(H,te){var pe=this;this.currentType=H,this.typeBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},U}(it),ke=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.arrowType="end",se.arrowBaseHeight=10,se.arrowBaseWidth=10,se.getArrowPoints=se.getArrowPoints.bind(se),se.setArrowType=se.setArrowType.bind(se),se.arrowTypePanel=new Ue("Arrow type","end"),se.arrowTypePanel.onArrowTypeChanged=se.setArrowType,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.arrow1&&H!==this.arrow2)},U.prototype.getArrowPoints=function(H,te){var pe=this.arrowBaseWidth+2*this.strokeWidth,se=this.arrowBaseHeight+2*this.strokeWidth;return H-pe/2+","+(te+se/2)+" "+H+","+(te-se/2)+" "+(H+pe/2)+","+(te+se/2)},U.prototype.createTips=function(){this.arrow1=ye.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ye.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.arrow2)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="creating"&&this.createTips()},U.prototype.adjustVisual=function(){if(ae.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ye.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ye.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),te=this.arrow1.transform.baseVal.getItem(0);te.setRotate(H,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(te,0);var pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(H+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,0)}},U.prototype.setArrowType=function(H){this.arrowType=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({arrowType:this.arrowType},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.arrowType=te.arrowType,this.createTips(),this.adjustVisual()},U.typeName="ArrowMarker",U.title="Arrow marker",U.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',U}(lt),be=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.fillColor=pe.defaultFillColor,se.strokeWidth=0,se.fillPanel=new re("Color",pe.defaultColorSet,pe.defaultFillColor),se.fillPanel.onColorChanged=se.setFillColor,se}return Te(U,ae),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="CoverMarker",U.title="Cover marker",U.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',U}(xe),Ce=function(ae){function U(H,te,pe,se){var $e=ae.call(this,H,se||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return $e.opacities=[],$e.opacityBoxes=[],$e.opacities=te,$e.currentOpacity=pe,$e.setCurrentOpacity=$e.setCurrentOpacity.bind($e),$e}return Te(U,ae),U.prototype.getUi=function(){var H=this,te=document.createElement("div");return te.style.display="flex",te.style.overflow="hidden",te.style.flexGrow="2",te.style.justifyContent="space-between",this.opacities.forEach(function(pe){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",se.style.padding="5px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderColor=pe===H.currentOpacity?H.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){H.setCurrentOpacity(pe,se)}),te.appendChild(se);var $e=document.createElement("div");$e.innerText=100*pe+"%",se.appendChild($e),H.opacityBoxes.push(se)}),te},U.prototype.setCurrentOpacity=function(H,te){var pe=this;this.currentOpacity=H,this.opacityBoxes.forEach(function(se){se.style.borderColor=se===te?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},U}(it),Pe=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.setOpacity=se.setOpacity.bind(se),se.fillColor=pe.defaultHighlightColor,se.strokeWidth=0,se.opacity=pe.defaultHighlightOpacity,se.fillPanel=new re("Color",pe.defaultColorSet,se.fillColor),se.fillPanel.onColorChanged=se.setFillColor,se.opacityPanel=new Ce("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Te(U,ae),U.prototype.setOpacity=function(H){this.opacity=H,this.visual&&ye.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="HighlightMarker",U.title="Highlight marker",U.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',U}(be),Le='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ve=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.bgColor="transparent",se.tipPosition={x:0,y:0},se.tipBase1Position={x:0,y:0},se.tipBase2Position={x:0,y:0},se.tipMoving=!1,se.color=pe.defaultStrokeColor,se.bgColor=pe.defaultFillColor,se.fontFamily=pe.defaultFontFamily,se.defaultSize={x:100,y:30},se.setBgColor=se.setBgColor.bind(se),se.getTipPoints=se.getTipPoints.bind(se),se.positionTip=se.positionTip.bind(se),se.setTipPoints=se.setTipPoints.bind(se),se.colorPanel=new re("Text color",pe.defaultColorSet,se.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),se.colorPanel.onColorChanged=se.setColor,se.bgColorPanel=new re("Fill color",pe.defaultColorSet,se.bgColor,Le),se.bgColorPanel.onColorChanged=se.setBgColor,se.fontFamilyPanel=new qe("Font",pe.defaultFontFamilies,pe.defaultFontFamily),se.fontFamilyPanel.onFontChanged=se.setFont,se.tipGrip=new ee,se.tipGrip.visual.transform.baseVal.appendItem(ye.createTransform()),se.controlBox.appendChild(se.tipGrip.visual),se}return Te(U,ae),U.prototype.ownsTarget=function(H){return ae.prototype.ownsTarget.call(this,H)||this.tipGrip.ownsTarget(H)||this.tip===H},U.prototype.createTip=function(){ye.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ye.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},U.prototype.pointerDown=function(H,te){this.state==="new"&&ae.prototype.pointerDown.call(this,H,te),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(te)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ae.prototype.pointerDown.call(this,H,te)},U.prototype.pointerUp=function(H){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ae.prototype.pointerUp.call(this,H);else{var te=this.state==="creating";ae.prototype.pointerUp.call(this,H),this.setTipPoints(te),this.positionTip()}},U.prototype.manipulate=function(H){if(this.tipMoving){var te=this.unrotatePoint(H);this.tipPosition={x:te.x-this.manipulationStartLeft,y:te.y-this.manipulationStartTop},this.positionTip()}else ae.prototype.manipulate.call(this,H)},U.prototype.setBgColor=function(H){this.bgRectangle&&this.tip&&(ye.setAttributes(this.bgRectangle,[["fill",H]]),ye.setAttributes(this.tip,[["fill",H]])),this.bgColor=H,this.fillColorChanged(H)},U.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},U.prototype.setTipPoints=function(H){H===void 0&&(H=!1);var te=Math.min(this.height/2,15),pe=this.height/5;H&&(this.tipPosition={x:te+pe/2,y:this.height+20});var se=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,te=Math.min(this.width/2,15),this.tipBase1Position={x:te,y:0},this.tipBase2Position={x:te+pe,y:0}):(this.tipBase1Position={x:0,y:te},this.tipBase2Position={x:0,y:te+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?se<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,te=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-te-pe,y:0},this.tipBase2Position={x:this.width-te,y:0}):(this.tipBase1Position={x:this.width,y:te},this.tipBase2Position={x:this.width,y:te+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?se<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,te=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-te-pe,y:this.height},this.tipBase2Position={x:this.width-te,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-te-pe},this.tipBase2Position={x:this.width,y:this.height-te}):se<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,te=Math.min(this.width/2,15),this.tipBase1Position={x:te,y:this.height},this.tipBase2Position={x:te+pe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-te},this.tipBase2Position={x:0,y:this.height-te-pe})},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),this.positionTip()},U.prototype.positionTip=function(){ye.setAttributes(this.tip,[["points",this.getTipPoints()]]);var H=this.tipGrip.visual.transform.baseVal.getItem(0);H.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(H,0)},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),U.prototype.select=function(){this.positionTip(),ae.prototype.select.call(this)},U.prototype.getState=function(){var H=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){var te=H;this.bgColor=te.bgColor,this.tipPosition=te.tipPosition,ae.prototype.restoreState.call(this,H),this.createTip(),this.setTipPoints()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.tipPosition={x:this.tipPosition.x*H,y:this.tipPosition.y*te},this.positionTip()},U.typeName="CalloutMarker",U.title="Callout marker",U.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',U}(Ye),at=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.fillColor="transparent",se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.opacity=1,se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.fillColor=pe.defaultFillColor,se.setStrokeColor=se.setStrokeColor.bind(se),se.setFillColor=se.setFillColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.setOpacity=se.setOpacity.bind(se),se.createVisual=se.createVisual.bind(se),se.strokePanel=new re("Line color",_e(pe.defaultColorSet,["transparent"]),pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.fillPanel=new re("Fill color",_e(pe.defaultColorSet,["transparent"]),se.fillColor,Le),se.fillPanel.onColorChanged=se.setFillColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se.opacityPanel=new Ce("Opacity",pe.defaultOpacitySteps,se.opacity),se.opacityPanel.onOpacityChanged=se.setOpacity,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual)},U.prototype.createVisual=function(){this.visual=ye.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},U.prototype.manipulate=function(H){ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){ae.prototype.resize.call(this,H),this.setSize()},U.prototype.setSize=function(){ae.prototype.setSize.call(this),ye.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},U.prototype.pointerUp=function(H){ae.prototype.pointerUp.call(this,H),this.setSize()},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&ye.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},U.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&ye.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(H),this.stateChanged()},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&ye.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&ye.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},U.prototype.setOpacity=function(H){this.opacity=H,this.visual&&ye.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){var te=H;this.fillColor=te.fillColor,this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.opacity=te.opacity,this.createVisual(),ae.prototype.restoreState.call(this,H),this.setSize()},U.prototype.scale=function(H,te){ae.prototype.scale.call(this,H,te),this.setSize()},U.typeName="EllipseMarker",U.title="Ellipse marker",U.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',U}(Q),_t=function(ae){function U(H,te,pe){return ae.call(this,H,te,pe)||this}return Te(U,ae),Object.defineProperty(U.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.tip1&&H!==this.tip2)},U.prototype.createTips=function(){this.tip1=ye.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ye.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.tip2)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.state==="creating"&&this.createTips()},U.prototype.adjustVisual=function(){if(ae.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ye.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),te=this.tip1.transform.baseVal.getItem(0);te.setRotate(H,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(te,0);var pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(H+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,0)}},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H),this.createTips(),this.adjustVisual()},U.typeName="MeasurementMarker",U.title="Measurement marker",U.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',U}(lt),kt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokePanel.colors=pe.defaultColorSet,se.fillColor="transparent",se}return Te(U,ae),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=ae.prototype.getState.call(this);return H.typeName=U.typeName,H},U.typeName="EllipseFrameMarker",U.title="Ellipse frame marker",U.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',U}(at),Bt=function(){function ae(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ae.prototype.addUndoStep=function(U){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(U)||(this.undoStack.push(U),JSON.stringify(this.lastRedoStep)!==JSON.stringify(U)&&this.redoStack.splice(0,this.redoStack.length))},ae.prototype.replaceLastUndoStep=function(U){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=U)},ae.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ae.prototype.undo=function(){if(this.undoStack.length>1){var U=this.undoStack.pop();return U!==void 0&&this.redoStack.push(U),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ae.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ae}(),jt=function(ae){function U(H,te,pe){var se=ae.call(this,H,te,pe)||this;return se.strokeColor="transparent",se.strokeWidth=0,se.strokeDasharray="",se.curveX=0,se.curveY=0,se.manipulationStartCurveX=0,se.manipulationStartCurveY=0,se.setStrokeColor=se.setStrokeColor.bind(se),se.setStrokeWidth=se.setStrokeWidth.bind(se),se.setStrokeDasharray=se.setStrokeDasharray.bind(se),se.positionGrips=se.positionGrips.bind(se),se.addControlGrips=se.addControlGrips.bind(se),se.adjustVisual=se.adjustVisual.bind(se),se.setupControlBox=se.setupControlBox.bind(se),se.resize=se.resize.bind(se),se.strokeColor=pe.defaultColor,se.strokeWidth=pe.defaultStrokeWidth,se.strokeDasharray=pe.defaultStrokeDasharray,se.strokePanel=new re("Line color",pe.defaultColorSet,pe.defaultColor),se.strokePanel.onColorChanged=se.setStrokeColor,se.strokeWidthPanel=new De("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),se.strokeWidthPanel.onWidthChanged=se.setStrokeWidth,se.strokeStylePanel=new dt("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),se.strokeStylePanel.onStyleChanged=se.setStrokeDasharray,se}return Te(U,ae),U.prototype.ownsTarget=function(H){return!(!ae.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorCurve&&H!==this.visibleCurve&&!this.curveGrip.ownsTarget(H))},U.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},U.prototype.createVisual=function(){this.visual=ye.createGroup(),this.selectorCurve=ye.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ye.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},U.prototype.pointerDown=function(H,te){ae.prototype.pointerDown.call(this,H,te),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=H.x,this.curveY=H.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(te)&&(this.activeGrip=this.curveGrip,this._state="resize")},U.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ye.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ye.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},U.prototype.setupControlBox=function(){ae.prototype.setupControlBox.call(this),this.curveControlLine1=ye.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ye.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},U.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ae.prototype.addControlGrips.call(this)},U.prototype.positionGrips=function(){ae.prototype.positionGrips.call(this);var H=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-H/2,this.curveY-H/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},U.prototype.manipulate=function(H){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+H.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+H.y-this.manipulationStartY),ae.prototype.manipulate.call(this,H)},U.prototype.resize=function(H){this.activeGrip===this.curveGrip&&(this.curveX=H.x,this.curveY=H.y),ae.prototype.resize.call(this,H),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},U.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},U.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},U.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual()},U.prototype.scale=function(H,te){this.curveX=this.curveX*H,this.curveY=this.curveY*te,ae.prototype.scale.call(this,H,te)},Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),U.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ae.prototype.getState.call(this));return H.typeName=U.typeName,H},U.prototype.restoreState=function(H){ae.prototype.restoreState.call(this,H);var te=H;this.strokeColor=te.strokeColor,this.strokeWidth=te.strokeWidth,this.strokeDasharray=te.strokeDasharray,this.curveX=te.curveX,this.curveY=te.curveY,this.createVisual(),this.adjustVisual()},U.typeName="CurveMarker",U.title="Curve marker",U.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',U}(tt),At=function(){function ae(U,H){H===void 0&&(H=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=U,this.cancelable=H}return Object.defineProperty(ae.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ae.prototype.preventDefault=function(){this._defaultPrevented=!0},ae}(),pt=function(ae){function U(H,te,pe){var se=ae.call(this,H,!1)||this;return se.dataUrl=te,se.state=pe,se}return Te(U,ae),U}(At),gt=function(ae){function U(H,te,pe){pe===void 0&&(pe=!1);var se=ae.call(this,H,pe)||this;return se.marker=te,se}return Te(U,ae),U}(At),rt=function(){function ae(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ae.prototype.addEventListener=function(U,H){this[U].push(H)},ae.prototype.removeEventListener=function(U,H){var te=this[U].indexOf(H);te>-1&&this[U].splice(te,1)},ae}(),Oe=function(){function ae(U){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new Bt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ae.instanceCounter++,this.styles=new Ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=U,this.targetRoot=document.body,this.width=U.clientWidth,this.height=U.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ae.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ne,je,ke,Ye,kt,at,Pe,Ve,_t,be,lt,jt]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ne,je,ke,Ye,at,Pe,Ve]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ne,je,ke,Ye,Pe]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(U){var H=this;this._availableMarkerTypes.splice(0),U.forEach(function(te){if(typeof te=="string"){var pe=H.ALL_MARKER_TYPES.find(function(se){return se.typeName===te});pe!==void 0&&H._availableMarkerTypes.push(pe)}else H._availableMarkerTypes.push(te)})},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(U){this._zoomLevel=U,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ae.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ae.prototype.show=function(){var U=this;this.styles.styleSheetRoot===void 0&&Fe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Fe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(H){return H(new At(U))})},ae.prototype.render=function(){return we(this,void 0,void 0,function(){var U;return Ie(this,function(H){switch(H.label){case 0:return this.setCurrentMarker(),(U=new Me).naturalSize=this.renderAtNaturalSize,U.imageType=this.renderImageType,U.imageQuality=this.renderImageQuality,U.markersOnly=this.renderMarkersOnly,U.width=this.renderWidth,U.height=this.renderHeight,[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return H.sent(),[4,U.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,H.sent()]}})})},ae.prototype.close=function(U){var H=this;if(U===void 0&&(U=!1),this.isOpen){var te=!1;U||this.eventListeners.beforeclose.forEach(function(pe){var se=new At(H,!0);pe(se),se.defaultPrevented&&(te=!0)}),te||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(pe){return pe(new At(H))}),this.detachEvents(),this._isOpen=!1)}},ae.prototype.addMarkersToToolbar=function(){for(var U,H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];(U=this._availableMarkerTypes).push.apply(U,H)},ae.prototype.addRenderEventListener=function(U){this.addEventListener("render",function(H){U(H.dataUrl,H.state)})},ae.prototype.removeRenderEventListener=function(U){},ae.prototype.addCloseEventListener=function(U){this.addEventListener("close",function(){U()})},ae.prototype.removeCloseEventListener=function(U){},ae.prototype.setupResizeObserver=function(){var U=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){U.resize(U.target.clientWidth,U.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return U.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ae.prototype.onPopupTargetResize=function(){var U=1*this.target.clientWidth/this.target.clientHeight,H=this.editorCanvas.clientWidth/U>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*U:this.editorCanvas.clientWidth,te=H<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/U;this.resize(H,te)},ae.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ae.prototype.resize=function(U,H){this._isResizing=!0;var te=U/this.imageWidth,pe=H/this.imageHeight;this.imageWidth=Math.round(U),this.imageHeight=Math.round(H),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(te,pe),this._isResizing=!1},ae.prototype.scaleMarkers=function(U,H){var te,pe=this;this._currentMarker&&this._currentMarker instanceof Ye?this._currentMarker.scale(U,H):(te=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(se){se!==pe._currentMarker&&se.scale(U,H)}),te!==void 0&&this.setCurrentMarker(te)},ae.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ae.prototype.setTopLeft=function(){var U=this.editingTarget.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=U.left-H.left,this.top=U.top-H.top},ae.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ae.prototype.addDefs=function(){for(var U,H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];this.defs=ye.createDefs(),this.addDefsToImage(),(U=this.defs).append.apply(U,H)},ae.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ae.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ae.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ae.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ae.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ae.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ae.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ae.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var U=document.createElement("a");U.href="https://markerjs.com/",U.target="_blank",U.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',U.title="Powered by marker.js",U.style.display="grid",U.style.alignItems="center",U.style.justifyItems="center",U.style.padding="3px",U.style.width="20px",U.style.height="20px",this.logoUI.appendChild(U),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ae.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ae.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ae.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ae.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var U=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new We(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new He(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ae.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ae.prototype.removeMarker=function(U){this.markerImage.removeChild(U.container),this.markers.indexOf(U)>-1&&this.markers.splice(this.markers.indexOf(U),1),U.dispose()},ae.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ae.prototype.toolbarButtonClicked=function(U,H){if(U==="marker"&&H!==void 0)this.createNewMarker(H);else if(U==="action")switch(H){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ae.prototype.deleteSelectedMarker=function(){var U=this;if(this._currentMarker!==void 0){var H=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var se=new gt(U,U._currentMarker,!0);pe(se),se.defaultPrevented&&(H=!0)}),!H){var te=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(pe){return pe(new gt(U,te))})}}},ae.prototype.clear=function(){var U=this,H=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($e){var yt=new gt(U,void 0,!0);$e(yt),yt.defaultPrevented&&(H=!0)}),!H)){this.setCurrentMarker();for(var te=function($e){var yt=pe.markers[$e];pe.setCurrentMarker(pe.markers[$e]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(Ot){return Ot(new gt(U,yt))})},pe=this,se=this.markers.length-1;se>=0;se--)te(se);this.addUndoStep()}},Object.defineProperty(ae.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ae.prototype.showNotesEditor=function(){var U;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(U=this._currentMarker.notes)!==null&&U!==void 0?U:"",this.overlayContainer.appendChild(this.notesArea))},ae.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ae.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ae.prototype.addUndoStep=function(){var U=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var H=this.getState(),te=this.undoRedoManager.getLastUndoStep();if(!te||te.width===H.width&&te.height===H.height){var pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(H),pe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(se){return se(new At(U))})}else this.undoRedoManager.replaceLastUndoStep(H),this.eventListeners.statechange.forEach(function(se){return se(new At(U))})}},ae.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ae.prototype.undoStep=function(){var U=this,H=this.undoRedoManager.undo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(te){return te(new At(U))}))},ae.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ae.prototype.redoStep=function(){var U=this,H=this.undoRedoManager.redo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(te){return te(new At(U))}))},ae.prototype.stepZoom=function(){var U=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=U<this.zoomSteps.length-1?this.zoomSteps[U+1]:this.zoomSteps[0]},ae.prototype.panTo=function(U){this.contentDiv.scrollBy({left:this.prevPanPoint.x-U.x,top:this.prevPanPoint.y-U.y}),this.prevPanPoint=U},ae.prototype.startRenderAndClose=function(){return we(this,void 0,void 0,function(){var U,H,te=this;return Ie(this,function(pe){switch(pe.label){case 0:return[4,this.render()];case 1:return U=pe.sent(),H=this.getState(),this.eventListeners.render.forEach(function(se){return se(new pt(te,U,H))}),this.close(!0),[2]}})})},ae.prototype.getState=function(U){U===!0&&this.setCurrentMarker();var H={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(te){return H.markers.push(te.getState())}),H},ae.prototype.restoreState=function(U){var H=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);U.markers.forEach(function(te){var pe=H._availableMarkerTypes.find(function($e){return $e.typeName===te.typeName});if(pe!==void 0){var se=H.addNewMarker(pe);se.restoreState(te),H.markers.push(se)}}),U.width&&U.height&&(U.width!==this.imageWidth||U.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/U.width,this.imageHeight/U.height),this.eventListeners.restorestate.forEach(function(te){return te(new At(H))})},ae.prototype.addNewMarker=function(U){var H=ye.createGroup();return this.markerImage.appendChild(H),new U(H,this.overlayContainer,this.settings)},ae.prototype.createNewMarker=function(U){var H,te=this;(H=typeof U=="string"?this._availableMarkerTypes.find(function(pe){return pe.typeName===U}):U)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(H),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(H.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(pe){return pe(new gt(te,te._currentMarker))}))},ae.prototype.markerCreated=function(U){var H=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(U),this.setCurrentMarker(U),U instanceof je&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(je):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(te){return te(new gt(H,H._currentMarker))})},ae.prototype.colorChanged=function(U){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=U,this.settings.defaultStrokeColor=U)},ae.prototype.fillColorChanged=function(U){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=U)},ae.prototype.markerStateChanged=function(U){var H=this;this.eventListeners.markerchange.forEach(function(te){return te(new gt(H,U))})},ae.prototype.setCurrentMarker=function(U){var H=this;this._currentMarker!==U&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(te){return te(new gt(H,H._currentMarker))})),this._currentMarker=U,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(te){return te(new gt(H,H._currentMarker))}))},ae.prototype.onPointerDown=function(U){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||U.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var H=this.markers.find(function(te){return te.ownsTarget(U.target)});H!==void 0?(this.setCurrentMarker(H),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(U.clientX,U.clientY),U.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:U.clientX,y:U.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(U.clientX,U.clientY))},ae.prototype.onDblClick=function(U){if(this._isFocused||this.focus(),this.mode==="select"){var H=this.markers.find(function(te){return te.ownsTarget(U.target)});H!==void 0&&H!==this._currentMarker&&this.setCurrentMarker(H),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(U.clientX,U.clientY),U.target):this.setCurrentMarker()}},ae.prototype.onPointerMove=function(U){this.touchPoints!==1&&U.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||U.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(U.clientX,U.clientY)):this.zoomLevel>1&&this.panTo({x:U.clientX,y:U.clientY}))},ae.prototype.onPointerUp=function(U){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(U.clientX,U.clientY)),this.isDragging=!1,this.addUndoStep()},ae.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ae.prototype.onKeyUp=function(U){this._currentMarker===void 0||this.notesArea!==void 0||U.key!=="Delete"&&U.key!=="Backspace"||this.deleteSelectedMarker()},ae.prototype.clientToLocalCoordinates=function(U,H){var te=this.markerImage.getBoundingClientRect();return{x:(U-te.left)/this.zoomLevel,y:(H-te.top)/this.zoomLevel}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var U=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ae.prototype.addLicenseKey=function(U){Ke.addKey(U)},ae.prototype.addEventListener=function(U,H){this.eventListeners.addEventListener(U,H)},ae.prototype.removeEventListener=function(U,H){this.eventListeners.removeEventListener(U,H)},ae.prototype.renderState=function(U){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(U),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ae.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ae.prototype.focus=function(){var U=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(H){return H(new At(U))}))},ae.prototype.blur=function(){var U=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(H){return H(new At(U))}))},ae.instanceCounter=0,ae}();/* **********************************
|
|
|
cropro version 1.2.0
|
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
|
|
copyright Alan Mendelevich
|
|
|
see README and LICENSE for details
|
|
|
********************************** *//*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */var ze=function(ae,U){return(ze=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,te){H.__proto__=te}||function(H,te){for(var pe in te)Object.prototype.hasOwnProperty.call(te,pe)&&(H[pe]=te[pe])})(ae,U)};function vt(ae,U){if(typeof U!="function"&&U!==null)throw new TypeError("Class extends value "+String(U)+" is not a constructor or null");function H(){this.constructor=ae}ze(ae,U),ae.prototype=U===null?Object.create(U):(H.prototype=U.prototype,new H)}function st(ae,U,H,te){return new(H||(H=Promise))(function(pe,se){function $e(Yt){try{Ot(te.next(Yt))}catch(St){se(St)}}function yt(Yt){try{Ot(te.throw(Yt))}catch(St){se(St)}}function Ot(Yt){var St;Yt.done?pe(Yt.value):(St=Yt.value,St instanceof H?St:new H(function(Wt){Wt(St)})).then($e,yt)}Ot((te=te.apply(ae,U||[])).next())})}function It(ae,U){var H,te,pe,se,$e={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return se={next:yt(0),throw:yt(1),return:yt(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function yt(Ot){return function(Yt){return function(St){if(H)throw new TypeError("Generator is already executing.");for(;$e;)try{if(H=1,te&&(pe=2&St[0]?te.return:St[0]?te.throw||((pe=te.return)&&pe.call(te),0):te.next)&&!(pe=pe.call(te,St[1])).done)return pe;switch(te=0,pe&&(St=[2&St[0],pe.value]),St[0]){case 0:case 1:pe=St;break;case 4:return $e.label++,{value:St[1],done:!1};case 5:$e.label++,te=St[1],St=[0];continue;case 7:St=$e.ops.pop(),$e.trys.pop();continue;default:if(!(pe=$e.trys,(pe=pe.length>0&&pe[pe.length-1])||St[0]!==6&&St[0]!==2)){$e=0;continue}if(St[0]===3&&(!pe||St[1]>pe[0]&&St[1]<pe[3])){$e.label=St[1];break}if(St[0]===6&&$e.label<pe[1]){$e.label=pe[1],pe=St;break}if(pe&&$e.label<pe[2]){$e.label=pe[2],$e.ops.push(St);break}pe[2]&&$e.ops.pop(),$e.trys.pop();continue}St=U.call(ae,$e)}catch(Wt){St=[6,Wt],te=0}finally{H=pe=0}if(5&St[0])throw St[1];return{value:St[0]?St[1]:void 0,done:!0}}([Ot,Yt])}}}var Pt=function(){function ae(){}return ae.addKey=function(U){ae.key=U},Object.defineProperty(ae,"isLicensed",{get:function(){return!!ae.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ae.key)},enumerable:!1,configurable:!0}),ae}(),Ze=function(){function ae(){}return ae.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ae.setAttributes=function(U,H){for(var te=0,pe=H;te<pe.length;te++){var se=pe[te],$e=se[0],yt=se[1];U.setAttribute($e,yt)}},ae.createRect=function(U,H,te){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",U.toString()),pe.setAttribute("height",H.toString()),te&&ae.setAttributes(pe,te),pe},ae.createLine=function(U,H,te,pe,se){var $e=document.createElementNS("http://www.w3.org/2000/svg","line");return $e.setAttribute("x1",U.toString()),$e.setAttribute("y1",H.toString()),$e.setAttribute("x2",te.toString()),$e.setAttribute("y2",pe.toString()),se&&ae.setAttributes($e,se),$e},ae.createPolygon=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","polygon");return te.setAttribute("points",U),H&&ae.setAttributes(te,H),te},ae.createCircle=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","circle");return te.setAttribute("cx",(U/2).toString()),te.setAttribute("cy",(U/2).toString()),te.setAttribute("r",U.toString()),H&&ae.setAttributes(te,H),te},ae.createEllipse=function(U,H,te){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(U/2).toString()),pe.setAttribute("cy",(H/2).toString()),pe.setAttribute("rx",(U/2).toString()),pe.setAttribute("ry",(H/2).toString()),te&&ae.setAttributes(pe,te),pe},ae.createGroup=function(U){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return U&&ae.setAttributes(H,U),H},ae.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ae.createMarker=function(U,H,te,pe,se,$e,yt){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return ae.setAttributes(Ot,[["id",U],["orient",H],["markerWidth",te.toString()],["markerHeight",pe.toString()],["refX",se.toString()],["refY",$e.toString()]]),Ot.appendChild(yt),Ot},ae.createText=function(U){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),U&&ae.setAttributes(H,U),H},ae.createTSpan=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","tspan");return te.textContent=U,H&&ae.setAttributes(te,H),te},ae.createImage=function(U){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return U&&ae.setAttributes(H,U),H},ae.createPoint=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return te.x=U,te.y=H,te},ae.createPath=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg","path");return te.setAttribute("d",U),H&&ae.setAttributes(te,H),te},ae.createElement=function(U,H){var te=document.createElementNS("http://www.w3.org/2000/svg",U);return H&&ae.setAttributes(te,H),te},ae.getHollowRectanglePath=function(U,H,te,pe,se,$e,yt,Ot){return"M"+U+","+H+"V"+(H+pe)+"H"+(U+te)+"V"+H+"H"+se+"V"+$e+"H"+(se+yt)+"V"+($e+Ot)+"H"+se+"V"+H+"Z"},ae}(),mt=function(){function ae(U){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+U+"_"}return Object.defineProperty(ae.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ae.prototype.addClass=function(U){return this.styleSheet===void 0&&this.addStyleSheet(),U.name=""+this.classNamePrefix+U.localName,this.classes.push(U),this.styleSheet.sheet.insertRule("."+U.name+" {"+U.style+"}",this.styleSheet.sheet.cssRules.length),U},ae.prototype.addRule=function(U){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(U),this.styleSheet.sheet.insertRule(U.selector+" {"+U.style+"}",this.styleSheet.sheet.cssRules.length)},ae.prototype.addStyleSheet=function(){var U;this.styleSheet=document.createElement("style"),((U=this.styleSheetRoot)!==null&&U!==void 0?U:document.head).appendChild(this.styleSheet),this.addRule(new Lt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Lt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new Lt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new Mt("_fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new Mt("_fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ae.prototype.removeStyleSheet=function(){var U;this.styleSheet&&(((U=this.styleSheetRoot)!==null&&U!==void 0?U:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ae}(),Lt=function(ae,U){this.selector=ae,this.style=U},Mt=function(ae,U){this.localName=ae,this.style=U},$t=function(){function ae(){this.blocks=[],this.display=""}return ae.prototype.addButtonBlock=function(U){U.className=this.blockClassName,U.buttonClassName=this.buttonClassName,U.buttonColorsClassName=this.buttonColorsClassName,U.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(U)},ae.prototype.addElementBlock=function(U){U.className===void 0&&(U.className=this.blockClassName),this.blocks.push(U)},ae.prototype.getUI=function(){var U=document.createElement("div");return U.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,U.style.display=this.display,this.blocks.forEach(function(H){return U.appendChild(H.getUI())}),U},ae}(),Re=function(){function ae(){}return ae.prototype.getUI=function(){var U=document.createElement("div");if(U.className=this.className,this.minWidth!==void 0&&(U.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":U.style.justifyContent="flex-start";break;case"center":U.style.justifyContent="center";break;case"end":U.style.justifyContent="flex-end"}return U.style.whiteSpace="nowrap",U},ae}(),ve=function(ae){function U(){var H=ae!==null&&ae.apply(this,arguments)||this;return H.buttons=[],H}return vt(U,ae),U.prototype.addButton=function(H){H.className=this.buttonClassName,H.colorsClassName=this.buttonColorsClassName,H.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(H)},U.prototype.getUI=function(){var H=ae.prototype.getUI.call(this);return this.buttons.forEach(function(te){return H.appendChild(te.getUI())}),H},U}(Re),X=function(){function ae(U,H){this._isActive=!1,this._isHidden=!1,this._icon=U,this.title=H,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ae.prototype,"icon",{get:function(){return this._icon},set:function(U){this._icon=U,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isActive",{get:function(){return this._isActive},set:function(U){this._isActive=U,this.adjustClassName()},enumerable:!1,configurable:!0}),ae.prototype.getUI=function(){var U=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return U.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ae.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ae.prototype.hide=function(){this._isHidden=!0},ae}(),ne=function(ae){function U(){var H=ae!==null&&ae.apply(this,arguments)||this;return H.elements=[],H}return vt(U,ae),U.prototype.addElement=function(H){this.elements.push(H)},U.prototype.getUI=function(){var H=ae.prototype.getUI.call(this);return this.elements.forEach(function(te){return H.appendChild(te)}),H},U}(Re),oe=function(){function ae(U,H){this.horizontal=U,this.vertical=H}return Object.defineProperty(ae.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ae.prototype.getVerticalLength=function(U){return U/this.ratio},ae.prototype.getHorizontalLength=function(U){return U*this.ratio},ae}(),he=function(){function ae(){}return ae.getIcon=function(U,H){if(U>0&&H>0){var te=new oe(U,H),pe=te.ratio>=1?20:te.getHorizontalLength(20),se=te.ratio<1?20:te.getVerticalLength(20),$e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("xmlns","http://www.w3.org/2000/svg"),$e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($e);var yt=Ze.createDefs();$e.appendChild(yt);var Ot=Ze.createElement("clipPath",[["id","text-bg-clip"]]);yt.appendChild(Ot);var Yt=Ze.createPath(Ze.getHollowRectanglePath((24-pe)/2,(24-se)/2,pe,se,(24-pe)/2+2,(24-se)/2+2,pe-4,se-4));$e.appendChild(Yt);var St=Ze.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);St.appendChild(Ze.createTSpan(U+":"+H)),$e.appendChild(St);var Wt=St.getBBox();Ze.setAttributes(St,[["x",((24-Wt.width)/2).toString()],["y",((24-Wt.height)/2-Wt.y).toString()]]);var ln=Ze.createPath(Ze.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Wt.width))/2,(24-Math.ceil(Wt.height))/2,Math.ceil(Wt.width),Math.ceil(Wt.height)));return Ot.appendChild(ln),Ze.setAttributes(Yt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($e),$e.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ae}(),Ae=function(ae){function U(H,te,pe){var se=ae.call(this,H,te)||this;return se.isDropdownOpen=!1,se.onClick=se.dropdownButtonClicked,se.dropdownButtons=pe,se}return vt(U,ae),U.prototype.setupDropdown=function(){var H=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(te){te.className=H.className,te.colorsClassName=H.colorsClassName,H.dropdownBlock.appendChild(te.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},U.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},U.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},U.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},U.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},U.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},U}(X),Qe=function(){function ae(U,H){this.GRIP_SIZE=10,this.color=U,this.fillColor=H,this.visual=Ze.createGroup(),this.visual.appendChild(Ze.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ze.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(U){return U===this.visual||U===this.visual.childNodes[0]||U===this.visual.childNodes[1]},ae.prototype.setCenter=function(U,H){this.visual.childNodes.forEach(function(te){return Ze.setAttributes(te,[["cx",U.toString()],["cy",H.toString()]])})},ae}(),ot=function(){function ae(U,H,te,pe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=U,this.canvasHeight=H,this.margin=te,this.container=pe,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ae.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(U){this._aspectRatio=U,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(U){this._isGridVisible=U,this.gridContainer&&Ze.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(U){this._zoomFactor=U,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ae.prototype.open=function(){var U=this;this.cropShadeElement=Ze.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ze.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var H=0;H<this.numberOfGridLines;H++)this.horizontalGridLines.push(Ze.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ze.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(te){return U.gridContainer.appendChild(te)}),this.verticalGridLines.forEach(function(te){return U.gridContainer.appendChild(te)}),this.cropRectElement=Ze.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ae.prototype.setCropRectangle=function(U){this.cropRect=U;var H=Object.assign({},this.cropRect);this.zoomFactor!==1&&(H.width=this.cropRect.width*this.zoomFactor,H.height=this.cropRect.height*this.zoomFactor,H.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-H.width/2,H.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-H.height/2),Ze.setAttributes(this.cropRectElement,[["x",H.x.toString()],["y",H.y.toString()],["width",H.width.toString()],["height",H.height.toString()]]);var te=H.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(se,$e){var yt=H.y+te*($e+1);Ze.setAttributes(se,[["x1",""+H.x],["y1",""+yt],["x2",""+(H.x+H.width)],["y2",""+yt]])});var pe=H.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(se,$e){var yt=H.x+pe*($e+1);Ze.setAttributes(se,[["x1",""+yt],["y1",""+H.y],["x2",""+yt],["y2",""+(H.y+H.height)]])}),Ze.setAttributes(this.cropShadeElement,[["d",Ze.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,H.x,H.y,H.width,H.height)]]),this.topLeftGrip.setCenter(H.x,H.y),this.topRightGrip.setCenter(H.x+H.width,H.y),this.bottomLeftGrip.setCenter(H.x,H.y+H.height),this.bottomRightGrip.setCenter(H.x+H.width,H.y+H.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ae.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ae.prototype.clientToLocalCoordinates=function(U,H){var te=this.container.getBoundingClientRect();return{x:U-te.left+this.margin,y:H-te.top+this.margin}},ae.prototype.onPointerDown=function(U){this.container.setPointerCapture(U.pointerId),this.previousPoint=this.clientToLocalCoordinates(U.clientX,U.clientY),this.cropRectElement===U.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(U.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(U.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(U.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(U.target)&&(this.activeGrip=this.bottomRightGrip)},ae.prototype.onPointerMove=function(U){if(this.isMoving)this.move(this.clientToLocalCoordinates(U.clientX,U.clientY));else if(this.activeGrip){var H=this.clientToLocalCoordinates(U.clientX,U.clientY);this.resize(H)}U.preventDefault()},ae.prototype.onPointerUp=function(U){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(U.pointerId)},ae.prototype.move=function(U){var H=U.x-this.previousPoint.x,te=U.y-this.previousPoint.y;this.zoomFactor!==1&&(H=-H/this.zoomFactor,te=-te/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+H),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+te),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=U},ae.prototype.resize=function(U){var H=Object.assign({},this.cropRect),te=U.x-this.previousPoint.x,pe=U.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:H.x+te<this.margin&&(te=this.margin-H.x),H.x+=te,H.width=this.cropRect.x+this.cropRect.width-H.x;break;case this.bottomRightGrip:case this.topRightGrip:H.width+te>this.canvasWidth*this.zoomFactor&&(te=this.canvasWidth*this.zoomFactor-H.width),H.width+=te}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(H.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(te),H.height=this.aspectRatio.getVerticalLength(H.width)):(H.y+=pe,H.height=this.cropRect.y+this.cropRect.height-H.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?H.height=this.aspectRatio.getVerticalLength(H.width):H.height+=pe}H.width<10&&(H.x=this.cropRect.x,H.width=10),H.height<10&&(H.y=this.cropRect.y,H.height=10),this.previousPoint=U,H.x>=this.margin&&H.y>=this.margin&&H.x-this.margin+H.width<=this.canvasWidth&&H.y-this.margin+H.height<=this.canvasHeight&&(this.cropRect=H,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ae.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var U=this.cropRect.x+this.cropRect.width/2,H=this.cropRect.y+this.cropRect.height/2,te=this.aspectRatio.getHorizontalLength(this.cropRect.height),pe=this.aspectRatio.getVerticalLength(this.cropRect.width);te/this.canvasWidth<pe/this.canvasHeight?this.cropRect.width=te:this.cropRect.height=pe,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=U-this.cropRect.width/2,this.cropRect.y=H-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ae.prototype.getRescaledRect=function(U,H,te,pe,se,$e){var yt=te/U,Ot=pe/H;return{x:(se.x-$e)*yt+$e,y:(se.y-$e)*Ot+$e,width:se.width*yt,height:se.height*Ot}},ae.prototype.scaleCanvas=function(U,H){var te=this.getRescaledRect(this.canvasWidth,this.canvasHeight,U,H,this.cropRect,this.margin);this.canvasWidth=U,this.canvasHeight=H,this.onCropChange&&this.onCropChange(te),this.setCropRectangle(te)},ae}(),Rt=function(){function ae(U){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=U,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ae.prototype,"angle",{get:function(){return this._angle},set:function(U){this._angle=U,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ae.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ae.prototype.onPointerDown=function(U){this.controlContainer.setPointerCapture(U.pointerId),this.isDragging=!0,this.previousPoint={x:U.clientX,y:U.clientY}},ae.prototype.onPointerMove=function(U){this.isDragging&&(this.onAngleChange&&this.onAngleChange((U.clientX-this.previousPoint.x)/5),this.previousPoint.x=U.clientX)},ae.prototype.onPointerUp=function(U){this.isDragging&&this.onAngleChange&&this.onAngleChange((U.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(U.pointerId)},ae.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var U=this.angleLabelText.getBBox();Ze.setAttributes(this.angleLabelElement,[["x",((this.width-U.width)/2).toString()],["y",(this.height/2).toString()]])}},ae.prototype.positionScaleShape=function(){if(this.scaleShape){var U=this.scaleShape.transform.baseVal.getItem(0);U.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(U,0)}},ae.prototype.getVisual=function(){var U=document.createElementNS("http://www.w3.org/2000/svg","svg");U.setAttribute("xmlns","http://www.w3.org/2000/svg"),U.setAttribute("width",this.width+"px"),U.setAttribute("height",this.height+"px"),U.setAttribute("viewBox","0 0 "+this.width+" "+this.height),U.style.flexShrink="0",document.body.appendChild(U);for(var H="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,te=1;te<=this.width/5+10;te++){var pe=te%5==0?this.height/3:this.height/6;H+="h4v"+-pe+"h1v"+pe}H+="v1H0Z",this.scaleShape=Ze.createPath(H);var se=Ze.createTransform();this.scaleShape.transform.baseVal.appendItem(se),U.appendChild(this.scaleShape),this.angleLabelElement=Ze.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ze.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $e=Ze.createTSpan("");return $e.innerHTML="°",this.angleLabelElement.appendChild($e),U.appendChild(this.angleLabelElement),document.body.removeChild(U),U},ae}(),Nt=function(){function ae(){this.naturalSize=!1,this.imageType="image/png"}return ae.prototype.rasterize=function(U,H,te,pe,se,$e,yt){var Ot=this;return new Promise(function(Yt){var St=document.createElement("canvas");St.width=U.width.baseVal.value-2*pe,St.height=U.height.baseVal.value-2*pe;var Wt=1,ln=1;Ot.naturalSize===!0?(Wt=H.naturalWidth/(U.width.baseVal.value-2*pe)/$e,ln=H.naturalHeight/(U.height.baseVal.value-2*pe)/yt,St.width=H.naturalWidth/$e,St.height=H.naturalHeight/yt):Ot.width!==void 0&&Ot.height!==void 0&&(Wt=Ot.width/te.width,ln=Ot.height/te.height,St.width*=Wt,St.height*=ln);var Bn=St.getContext("2d");Bn.translate(St.width/2,St.height/2),Bn.rotate(se*Math.PI/180),Bn.scale($e,yt),Bn.translate(-St.width/2,-St.height/2),Bn.drawImage(H,0,0,St.width,St.height);var Oi=document.createElement("canvas");Oi.width=te.width*Wt,Oi.height=te.height*ln,Oi.getContext("2d").putImageData(Bn.getImageData((te.x-pe)*Wt,(te.y-pe)*ln,te.width*Wt,te.height*ln),0,0),Yt(Oi.toDataURL(Ot.imageType,Ot.imageQuality))})},ae}(),ht=function(){function ae(U){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ae.instanceCounter++,this.styles=new mt(this.instanceNo),this.target=U,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(U){this._zoomToCropEnabled=U,U?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(U){this._isGridVisible=U,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"gridLines",{get:function(){return this._gridLines},set:function(U){this._gridLines=U,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(U){this._rotationAngle=U,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"aspectRatio",{get:function(){var U;return(U=this._aspectRatio)!==null&&U!==void 0?U:this.aspectRatios[0]},set:function(U){this._aspectRatio=U},enumerable:!1,configurable:!0}),ae.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ae.prototype.show=function(){this.showUI(),this.open()},ae.prototype.close=function(U){U===void 0&&(U=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),U||this.closeEventListeners.forEach(function(H){return H()}),this._isOpen=!1)},ae.prototype.addRenderEventListener=function(U){this.renderEventListeners.push(U)},ae.prototype.removeRenderEventListener=function(U){this.renderEventListeners.indexOf(U)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(U),1)},ae.prototype.addCloseEventListener=function(U){this.closeEventListeners.push(U)},ae.prototype.removeCloseEventListener=function(U){this.closeEventListeners.indexOf(U)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(U),1)},ae.prototype.setupResizeObserver=function(){var U=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){U.resize(U.target.clientWidth,U.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ae.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var U=1*this.target.clientWidth/this.target.clientHeight,H=this.contentDiv.clientWidth/U>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*U:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,te=H+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/U;this.resize(H,te)}},ae.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ae.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Ze.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ae.prototype.resize=function(U,H){this.imageWidth=Math.round(U),this.imageHeight=Math.round(H),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ae.prototype.setEditingTarget=function(){var U=document.createElement("canvas");U.width=this.target.naturalWidth,U.height=this.target.naturalHeight,U.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var H=U.toDataURL();Ze.setAttributes(this.editingTarget,[["href",H]]),this.setEditingTargetSize()},ae.prototype.setTopLeft=function(){var U=this.target.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=U.left-H.left-this.CANVAS_MARGIN,this.top=U.top-H.top-this.CANVAS_MARGIN},ae.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Ze.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ze.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ze.createGroup(),this.editingTargetRotationScaleContainer=Ze.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var U=Ze.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(U);var H=Ze.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(H),this.editingTargetContainer=Ze.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ae.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ae.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ze.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ot(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ae.prototype.zoomToCrop=function(){if(this.cropRect){var U=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,H=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=U+"px "+H+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-U+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-H+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ae.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ae.prototype.cropRectChanged=function(U){this.cropRect=U,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ae.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ae.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ae.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ae.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var U=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,H=this.target.offsetTop>U+this.CANVAS_MARGIN?this.target.offsetTop-(U+this.CANVAS_MARGIN):0;this.coverDiv.style.top=H+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ae.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ae.prototype.addTopToolbar=function(){var U=this;this.topToolbar=new $t,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new ve;H.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(H);var te=[];this.aspectRatios.forEach(function(ln){var Bn=new X(he.getIcon(ln.horizontal,ln.vertical),ln.horizontal===0&&ln.vertical===0?"FREE":ln.horizontal+":"+ln.vertical);Bn.onClick=function(){return U.ratioButtonClicked(ln)},te.push(Bn)}),this.aspectRatioButton=new Ae(he.getIcon(0,0),"Aspect ratio",te),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,H.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var pe=new X('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");pe.isActive=this.isGridVisible,pe.onClick=function(){U.isGridVisible=!U.isGridVisible,pe.isActive=U.isGridVisible},H.addButton(pe);var se=new X('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(se.isActive=this.zoomToCropEnabled,se.onClick=function(){U.zoomToCropEnabled=!U.zoomToCropEnabled,se.isActive=U.zoomToCropEnabled},H.addButton(se),!Pt.isLicensed){var $e=new ne;this.topToolbar.addElementBlock($e);var yt=document.createElement("div");yt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ot=document.createElement("a");Ot.style.color="currentColor",Ot.href="https://markerjs.com/products/cropro",Ot.target="_blank",Ot.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',yt.appendChild(Ot),$e.addElement(yt)}var Yt=new ve;Yt.minWidth=3*this.toolbarHeight+"px",Yt.contentAlign="end",this.topToolbar.addButtonBlock(Yt);var St=new X('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");St.onClick=this.startRenderAndClose,Yt.addButton(St),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(St.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Wt=new X('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Wt.onClick=this.close,Yt.addButton(Wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ae.prototype.addBottomToolbar=function(){var U=this;this.bottomToolbar=new $t,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new ve;H.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(H);var te=new X('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");te.onClick=this.rotateLeftButtonClicked,H.addButton(te);var pe=new X('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");pe.onClick=this.rotateRightButtonClicked,H.addButton(pe);var se=new ne;se.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(se),this.straightener=new Rt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Yt){U.rotateBy(Yt),U.straightener.angle=U.rotationAngle},se.addElement(this.straightener.getUI());var $e=new ve;$e.minWidth=2*this.toolbarHeight+"px",$e.contentAlign="end",this.bottomToolbar.addButtonBlock($e);var yt=new X('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");yt.onClick=this.flipHorizontallyButtonClicked,$e.addButton(yt);var Ot=new X('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Ot.onClick=this.flipVerticallyButtonClicked,$e.addButton(Ot)},ae.prototype.ratioButtonClicked=function(U){this.aspectRatio=U,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ae.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=he.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ae.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ae.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ae.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ae.prototype.restoreState=function(U){if(U){var H=this.cropLayer.getRescaledRect(U.width,U.height,this.imageWidth,this.imageHeight,U.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(H),this.cropRectChanged(H),this.flippedHorizontally=U.flippedHorizontally,this.flippedVertically=U.flippedVertically,this.applyFlip(),this.rotationAngle=U.rotationAngle,this.applyRotation()}},ae.prototype.clientToLocalCoordinates=function(U,H){var te=this.cropImage.getBoundingClientRect();return{x:U-te.left,y:H-te.top}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var U=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=U+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ae.prototype.rotateLeftButtonClicked=function(){var U=this.rotationAngle-90;this.rotationAngle%90!=0&&(U+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(U)},ae.prototype.rotateRightButtonClicked=function(){var U=this.rotationAngle+90;this.rotationAngle%90!=0&&(U-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(U)},ae.prototype.rotateTo=function(U){U=(U=U>180?U-360:U)<=-180?U+360:U,this.rotationAngle=U,this.applyRotation()},ae.prototype.rotateBy=function(U){this.rotateTo((this.rotationAngle+U)%360)},ae.prototype.applyRotation=function(){var U=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var H=this.editingTargetRotationContainer.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(H,0);var te=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/te.width,this.imageHeight/te.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=U},ae.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ae.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ae.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ae.prototype.startRenderAndClose=function(){return st(this,void 0,void 0,function(){var U,H;return It(this,function(te){switch(te.label){case 0:return[4,this.render()];case 1:return U=te.sent(),H=this.getState(),this.renderEventListeners.forEach(function(pe){return pe(U,H)}),this.close(!0),[2]}})})},ae.prototype.render=function(){return st(this,void 0,void 0,function(){var U;return It(this,function(H){switch(H.label){case 0:return(U=new Nt).naturalSize=this.renderAtNaturalSize,U.imageType=this.renderImageType,U.imageQuality=this.renderImageQuality,U.width=this.renderWidth,U.height=this.renderHeight,this.unzoomFromCrop(),Ze.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,U.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return H.sent(),[4,U.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,H.sent()]}})})},ae.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Mt("toolbar",`
|
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
overflow: hidden;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Mt("toolbar_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Mt("toolbar-block",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
box-sizing: content-box;
|
|
|
`));var U=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Mt("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.toolbarHeight-2*U)+`px;
|
|
|
height: `+(this.toolbarHeight-2*U)+`px;
|
|
|
padding: `+U+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_button_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Mt("toolbar_active_button",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
|
`)),this.styles.addRule(new Lt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new Lt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Mt("toolbar_dropdown",`
|
|
|
position: absolute;
|
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
|
z-index: 20;
|
|
|
white-space: normal;
|
|
|
box-sizing: content-box;
|
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
|
line-height: 0px;
|
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Mt("toolbar_dropdown_colors",`
|
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Mt("toolbar_straightener_block",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Mt("toolbar_straightener",`
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
justify-content: center;
|
|
|
height: `+(this.toolbarHeight-2*U)+`px;
|
|
|
padding: `+U+`px;
|
|
|
cursor: default;
|
|
|
user-select: none;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Mt("toolbar_straightener_colors",`
|
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
|
fill: currentColor;
|
|
|
`))},ae.instanceCounter=0,ae}(),Dt=V("8hTe"),sn=V.n(Dt),Ct=/<pre[^>]*>/g;function hn(ae){var U=document.createElement("div");return U.innerHTML=ae,U.childNodes.length===0?"":U.childNodes[0].nodeValue}var rn=Xe.a=function(ae){var U=ae.value,H=U===void 0?"":U,te=ae.edit,pe=te===void 0?!1:te,se=ae.className,$e=ae.showTextOnly,yt=ae.showLines,Ot=ae.replaces,Yt=ae.zoomImg,St=ae.hasMask,Wt=ae.style,ln=Wt===void 0?{}:Wt,Bn=ae.stylesPrev,Oi=Bn===void 0?{}:Bn,mi=String(H),Wn=Object(p.useRef)(),di=Object(p.useRef)(),hr=Object(p.useState)(""),vi=Object(A.a)(hr,2),gi=vi[0],xi=vi[1],Bi=Object(p.useState)("office"),Ai=Object(A.a)(Bi,2),sr=Ai[0],Di=Ai[1],fr=function(){var wn=new ht(di.current);wn.displayMode="popup",wn.addRenderEventListener(function(){var wi=Object(T.a)(f.a.mark(function Mn(Ri){var oi;return f.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:return Wn.current.style.display="none",Ni.next=3,Object(le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ri}});case 3:oi=Ni.sent,oi!=null&&oi.id&&Ot(di.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(oi==null?void 0:oi.id,"?type=").concat(oi.content_type));case 5:case"end":return Ni.stop()}},Mn)}));return function(Mn){return wi.apply(this,arguments)}}()),wn.show()},lr=function(){var wn=new Oe(di.current);wn.settings.displayMode="popup",wn.addEventListener("render",function(){var wi=Object(T.a)(f.a.mark(function Mn(Ri){var oi;return f.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:if(Wn.current.style.display="none",!di.current){Ni.next=6;break}return Ni.next=4,Object(le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ri.dataUrl}});case 4:oi=Ni.sent,oi!=null&&oi.id&&Ot(di.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(oi==null?void 0:oi.id,"?type=").concat(oi.content_type));case 6:case"end":return Ni.stop()}},Mn)}));return function(Mn){return wi.apply(this,arguments)}}()),wn.show(),window.markerArea=wn},Wi=Object(p.useMemo)(function(){Wn.current&&(Wn.current.style.zIndex=-1);try{var Hn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,wi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;mi=mi.replace(Hn,"("+J.a.API_SERVER+"/api/attachments/").replace(wn,'"'+J.a.API_SERVER+"/api/attachments/").replace(wi,'"'+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(Lr){}var Mn=q(mi),Ri=S();if(mi.match(/\[TOC\]/)&&(Mn=Mn.replace("<p>[TOC]</p>",g()),v()),Mn=Mn.replace(/(__special_katext_id_\d+__)/g,function(Lr,Ni){var Qi=Ri[Ni],Br=Qi.type,qi=Qi.expression;return Object(K.renderToString)(hn(qi)||"",{displayMode:Br==="block",throwOnError:!1,output:"html"})}),Mn=Mn.replace(/▁/g,"\u2581\u2581\u2581"),w(),$e){var oi=document.createElement("div");return oi.innerHTML=Mn,oi.innerText}return setTimeout(function(){return Rr()},500),Mn},[mi]),Gi=Object(p.useRef)();y.WebkitLineClamp=yt,yt&&(ln=Object(D.a)(Object(D.a)({},ln),y));function vr(Hn){var wn=Hn.target;if(wn.tagName.toUpperCase()==="IMG"){if(Yt){var wi=wn.getAttribute("src");xi(wi),Di("image")}}else if(wn.tagName.toUpperCase()==="A"){var Mn=wn.getAttribute("href");if(Mn.indexOf("office")>-1)Hn.preventDefault(),xi(Mn),Di("office");else if(Mn.indexOf("application/pdf")>-1)Hn.preventDefault(),xi(Mn),Di("pdf");else if(Mn.indexOf("text/html")>-1)Hn.preventDefault(),xi(Mn),Di("html");else if(Mn.startsWith("#")){Hn.preventDefault();var Ri=document.getElementById(Mn.replace("#",""));Ri&&Ri.scrollIntoView(!0)}}}var Rr=function(){var wn,wi=(wn=Gi.current)===null||wn===void 0?void 0:wn.querySelectorAll("video");wi==null||wi.forEach(function(Mn){if(Mn.oncontextmenu=function(){return!1},Mn.src.indexOf(".m3u8")>-1&&!Mn.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var Ri=new G.a;Ri.loadSource(Mn.src),Ri.attachMedia(Mn)}}})};Object(p.useEffect)(function(){if(Gi.current&&Wi&&(Wi.match(Ct)&&window.PR.prettyPrint()),Gi.current)return Gi.current.addEventListener("click",vr),function(){Gi.current.removeEventListener("click",vr),w(),v()}},[Wi,Gi.current,vr]);var ur=function(wn){if(!pe)return;wn.target.nodeName==="IMG"?(Wn.current.style.zIndex=1,Wn.current.style.display="flex",Wn.current.style.width=wn.target.clientWidth+"px",Wn.current.style.height=wn.target.clientHeight+"px",Wn.current.style.top=wn.target.offsetTop+"px",Wn.current.style.left=wn.target.offsetLeft+"px",di.current.src=wn.target.getAttribute("src")):Wn.current.style.display="none"};return c.a.createElement("div",{style:{position:"relative"}},c.a.createElement("div",{ref:Gi,style:Object(D.a)({},ln),className:"".concat(se||""," markdown-body ").concat(sn.a.mdBody),onMouseOver:ur,dangerouslySetInnerHTML:{__html:Wi}}),c.a.createElement("div",{ref:Wn,className:sn.a.button},c.a.createElement(ie.a,null,c.a.createElement(C.a,{onClick:function(){return fr()}},"\u88C1\u526A"),c.a.createElement(C.a,{onClick:function(){return lr()}},"\u7F16\u8F91"))),c.a.createElement("img",{ref:di,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),c.a.createElement(Z.a,{close:!0,data:gi,type:gi!=null&&gi.length?sr:"",style:Object(D.a)({},Oi),onClose:function(){return xi("")}}))}},"9VGf":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return W});var ce=V("cDcd"),ie=V.n(ce);function W(C,D){var T=Object(ce.useRef)();Object(ce.useEffect)(function(){T.current=C}),Object(ce.useEffect)(function(){function A(){T.current()}if(D!==null){var O=setInterval(A,D);return function(){return clearInterval(O)}}},[D])}},AMnG:function(nt,Xe,V){"use strict";var ce=V("miYZ"),ie=V("tsqr"),W=V("tJVT"),C=V("cDcd"),D=V.n(C),T=V("nWbc"),A=V.n(T),O=V("Ot1p");Xe.a=function(f){var p=f.id,c=f.activeDiscussIndex,s=f.onReplyDiscuss,n=Object(C.useState)(""),o=Object(W.a)(n,2),r=o[0],l=o[1];function a(t){l(t)}function i(){if(!r){ie.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}s(p,r),l("")}return D.a.createElement("div",{key:p,className:"discuss-item-editor",style:{display:c===p?"block":"none",width:"100%"}},D.a.createElement(O.a,{miniToolbar:!0,startInit:c===p,defaultValue:r,id:p,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:a}),D.a.createElement("a",{onClick:i,className:"btn-send"},"\u53D1\u9001"))}},Aky1:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return f});var ce=V("ErOA"),ie=V("ppsT"),W=V.n(ie),C="",D,T="";function A(p){O(p)}function O(p){D=new W.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:1829848226361863,enableUploadProgress:!1,addFileSuccess:function(s){console.log("addFileSuccess: "+s.file.name),p.addFileSuccess&&p.addFileSuccess(s),D.startUpload()},onUploadstarted:function(s){var n=s.file.name;if(s.videoId){var l="/api/users/".concat(C,"/video_auths.json");Object(ce.a)(l,{method:"put",body:{video_id:s.videoId,title:n,file_name:n,virtual_classroom_id:T}}).then(function(a){if(a.status==-1){p.onUploadError&&p.onUploadError(s);return}var i=a.data,t=i.UploadAuth,d=i.UploadAddress,v=i.VideoId;D.setUploadAuthAndAddress(s,t,d)}).catch(function(a){D.deleteFile(D._curIndex),D.nextUpload(),console.log(a)})}else{var o="/api/users/".concat(C,"/video_auths.json"),r="";Object(ce.a)(o,{method:"Post",body:{title:r+n,file_name:r+n,virtual_classroom_id:T}}).then(function(a){if(a){var i=a.data,t=i.UploadAuth,d=i.UploadAddress,v=i.VideoId;D.setUploadAuthAndAddress(s,t,d,v)}}).catch(function(a){D.deleteFile(D._curIndex),D.nextUpload(),console.log(a)}),console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...")}},onUploadSucceed:function(s){p.onUploadSucceed&&p.onUploadSucceed(s),console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!")},onUploadFailed:function(s,n,o){p.onUploadFailed&&p.onUploadFailed(s),console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!")},onUploadCanceled:function(s,n,o){console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!")},onUploadProgress:function(s,n,o){p.onUploadProgress&&p.onUploadProgress(s,n,o);var r=Math.ceil(o*100);console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...")},onUploadTokenExpired:function(s){console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");var n="/api/users/".concat(C,"/video_auths.json");Object(ce.a)(n,{method:"put",body:{video_id:s.videoId}}).then(function(o){var r=o.data,l=r.UploadAuth;D.resumeUploadWithAuth(l)}).catch(function(o){console.log(o)})},onUploadEnd:function(s){p.onUploadEnd&&p.onUploadEnd(s),console.log("onUploadEnd: uploaded all the files")}}),p.gotUploader&&p.gotUploader(D)}function f(p,c,s){p&&(C=p),c&&(T=c),A(s)}},BU3w:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return T});var ce=V("MNnm"),ie="rc-util-key";function W(A){if(A.attachTo)return A.attachTo;var O=document.querySelector("head");return O||document.body}function C(A){var O,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ce.a)())return null;var p=document.createElement("style");if((O=f.csp)===null||O===void 0?void 0:O.nonce){var c;p.nonce=(c=f.csp)===null||c===void 0?void 0:c.nonce}p.innerHTML=A;var s=W(f),n=s.firstChild;return f.prepend&&s.prepend?s.prepend(p):f.prepend&&n?s.insertBefore(p,n):s.appendChild(p),p}var D=new Map;function T(A,O){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=W(f);if(!D.has(p)){var c=C("",f),s=c.parentNode;D.set(p,s),s.removeChild(c)}var n=Array.from(D.get(p).children).find(function(i){return i.tagName==="STYLE"&&i[ie]===O});if(n){var o,r;if(((o=f.csp)===null||o===void 0?void 0:o.nonce)&&n.nonce!==((r=f.csp)===null||r===void 0?void 0:r.nonce)){var l;n.nonce=(l=f.csp)===null||l===void 0?void 0:l.nonce}return n.innerHTML!==A&&(n.innerHTML=A),n}var a=C(A,f);return a[ie]=O,a}},Bd2K:function(nt,Xe,V){(function(ce){ce(V("VrN/"),V("osHv"))})(function(ce){ce.defineOption("autoCloseTags",!1,function(f,p,c){if(c!=ce.Init&&c&&f.removeKeyMap("autoCloseTags"),!p)return;var s={name:"autoCloseTags"};(typeof p!="object"||p.whenClosing!==!1)&&(s["'/'"]=function(n){return T(n)}),(typeof p!="object"||p.whenOpening!==!1)&&(s["'>'"]=function(n){return C(n)}),f.addKeyMap(s)});var ie=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],W=["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 C(f){if(f.getOption("disableInput"))return ce.Pass;for(var p=f.listSelections(),c=[],s=f.getOption("autoCloseTags"),n=0;n<p.length;n++){if(!p[n].empty())return ce.Pass;var o=p[n].head,r=f.getTokenAt(o),l=ce.innerMode(f.getMode(),r.state),a=l.state,i=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(a),t=i&&i.name;if(!t)return ce.Pass;var d=l.mode.configuration=="html",v=typeof s=="object"&&s.dontCloseTags||d&&ie,y=typeof s=="object"&&s.indentTags||d&&W;r.end>o.ch&&(t=t.slice(0,t.length-r.end+o.ch));var b=t.toLowerCase();if(!t||r.type=="string"&&(r.end!=o.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&i.close||r.string.indexOf("/")==o.ch-r.start-1||v&&A(v,b)>-1||O(f,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(a)||[],t,o,!0))return ce.Pass;var g=typeof s=="object"&&s.emptyTags;if(g&&A(g,t)>-1){c[n]={text:"/>",newPos:ce.Pos(o.line,o.ch+2)};continue}var m=y&&A(y,b)>-1;c[n]={indent:m,text:">"+(m?`
|
|
|
|
|
|
`:"")+"</"+t+">",newPos:m?ce.Pos(o.line+1,0):ce.Pos(o.line,o.ch+1)}}for(var _=typeof s=="object"&&s.dontIndentOnAutoClose,n=p.length-1;n>=0;n--){var x=c[n];f.replaceRange(x.text,p[n].head,p[n].anchor,"+insert");var h=f.listSelections().slice(0);h[n]={head:x.newPos,anchor:x.newPos},f.setSelections(h),!_&&x.indent&&(f.indentLine(x.newPos.line,null,!0),f.indentLine(x.newPos.line+1,null,!0))}}function D(f,p){for(var c=f.listSelections(),s=[],n=p?"/":"</",o=f.getOption("autoCloseTags"),r=typeof o=="object"&&o.dontIndentOnSlash,l=0;l<c.length;l++){if(!c[l].empty())return ce.Pass;var a=c[l].head,i=f.getTokenAt(a),t=ce.innerMode(f.getMode(),i.state),d=t.state;if(p&&(i.type=="string"||i.string.charAt(0)!="<"||i.start!=a.ch-1))return ce.Pass;var v,y=t.mode.name!="xml"&&f.getMode().name=="htmlmixed";if(y&&t.mode.name=="javascript")v=n+"script";else if(y&&t.mode.name=="css")v=n+"style";else{var b=t.mode.xmlCurrentContext&&t.mode.xmlCurrentContext(d);if(!b||b.length&&O(f,b,b[b.length-1],a))return ce.Pass;v=n+b[b.length-1]}f.getLine(a.line).charAt(i.end)!=">"&&(v+=">"),s[l]=v}if(f.replaceSelections(s),c=f.listSelections(),!r)for(var l=0;l<c.length;l++)(l==c.length-1||c[l].head.line<c[l+1].head.line)&&f.indentLine(c[l].head.line)}function T(f){return f.getOption("disableInput")?ce.Pass:D(f,!0)}ce.commands.closeTag=function(f){return D(f)};function A(f,p){if(f.indexOf)return f.indexOf(p);for(var c=0,s=f.length;c<s;++c)if(f[c]==p)return c;return-1}function O(f,p,c,s,n){if(!ce.scanForClosingTag)return!1;var o=Math.min(f.lastLine()+1,s.line+500),r=ce.scanForClosingTag(f,s,null,o);if(!r||r.tag!=c)return!1;for(var l=n?1:0,a=p.length-1;a>=0&&p[a]==c;a--)++l;s=r.to;for(var a=1;a<l;a++){var i=ce.scanForClosingTag(f,s,null,o);if(!i||i.tag!=c)return!1;s=i.to}return!0}})},BdwD:function(nt,Xe,V){"use strict";var ce=V("+L6B"),ie=V("2/Rp"),W=V("0Owb"),C=V("k1fw"),D=V("cDcd"),T=V.n(D),A=V("FOrL"),O=V.n(A),f=function(c){var s=c.buttonProps,n=s===void 0?{}:s,o=c.styles,r=o===void 0?{}:o,l=c.customText,a=c.ButtonText,i=c.ButtonClick,t=c.Buttonclass,d=c.ButtonTwo;return T.a.createElement("section",{className:"tc animated fadeIn",style:Object(C.a)(Object(C.a)({},{color:"#999",margin:"200px auto"}),r)},T.a.createElement("img",{src:O.a}),T.a.createElement("p",{className:"mt20 font14"},l||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),a&&T.a.createElement(ie.a,Object(W.a)({className:t,onClick:i},n),a),d&&d)};Xe.a=f},BjJ7:function(nt,Xe,V){"use strict";V.d(Xe,"d",function(){return ie}),V.d(Xe,"c",function(){return W}),V.d(Xe,"e",function(){return C}),V.d(Xe,"b",function(){return D}),V.d(Xe,"a",function(){return A});var ce=V("m3rI");function ie(O){var f=!0;if(O.length>0){for(var p=0;p<O.length;p++)if(O[p].compile_success==0||!O[p].compile_success){f=!1;break}}else f=!1;return f}function W(O){for(var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",p=[],c=0;c<O.length;c++){var s=O[c],n=f?"".concat(f,"/").concat(s.name):"".concat(s.name);p.push({title:s.name,isLeaf:!(s.type==="tree"),key:n})}return p}function C(O,f,p){for(var c=0;c<O.length;c++){var s=O[c];if(s.key===f){s.children=p;break}s.children&&C(s.children,f,p)}return O}function D(O,f,p){var c;return function(){var s=this,n=arguments,o=function(){c=null,p||O.apply(s,n)},r=p&&!c;clearTimeout(c),c=setTimeout(o,f),r&&O.apply(s,n)}}var T=!0,A=ce.a.API_SERVER},"C+DQ":function(nt,Xe,V){},CNDd:function(nt,Xe,V){nt.exports=V.p+"static/c1.7850f139.svg"},CaVn:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},CrYA:function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global;nt.exports={name:"sessionStorage",read:C,write:D,each:T,remove:A,clearAll:O};function W(){return ie.sessionStorage}function C(f){return W().getItem(f)}function D(f,p){return W().setItem(f,p)}function T(f){for(var p=W().length-1;p>=0;p--){var c=W().key(p);f(C(c),c)}}function A(f){return W().removeItem(f)}function O(){return W().clear()}},DlQD:function(nt,Xe,V){(function(ce,ie){nt.exports=ie()})(this,function(){"use strict";function ce(je,Ue){for(var ke=0;ke<Ue.length;ke++){var be=Ue[ke];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(je,be.key,be)}}function ie(je,Ue,ke){return Ue&&ce(je.prototype,Ue),ke&&ce(je,ke),je}function W(je,Ue){if(!je)return;if(typeof je=="string")return C(je,Ue);var ke=Object.prototype.toString.call(je).slice(8,-1);if(ke==="Object"&&je.constructor&&(ke=je.constructor.name),ke==="Map"||ke==="Set")return Array.from(je);if(ke==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ke))return C(je,Ue)}function C(je,Ue){(Ue==null||Ue>je.length)&&(Ue=je.length);for(var ke=0,be=new Array(Ue);ke<Ue;ke++)be[ke]=je[ke];return be}function D(je,Ue){var ke;if(typeof Symbol=="undefined"||je[Symbol.iterator]==null){if(Array.isArray(je)||(ke=W(je))||Ue&&je&&typeof je.length=="number"){ke&&(je=ke);var be=0;return function(){return be>=je.length?{done:!0}:{done:!1,value:je[be++]}}}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 ke=je[Symbol.iterator](),ke.next.bind(ke)}function T(je,Ue){return Ue={exports:{}},je(Ue,Ue.exports),Ue.exports}var A=T(function(je){function Ue(){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 ke(be){je.exports.defaults=be}je.exports={defaults:Ue(),getDefaults:Ue,changeDefaults:ke}}),O=A.defaults,f=A.getDefaults,p=A.changeDefaults,c=/[&<>"']/,s=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},l=function(Ue){return r[Ue]};function a(je,Ue){if(Ue){if(c.test(je))return je.replace(s,l)}else if(n.test(je))return je.replace(o,l);return je}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(je){return je.replace(i,function(Ue,ke){return ke=ke.toLowerCase(),ke==="colon"?":":ke.charAt(0)==="#"?ke.charAt(1)==="x"?String.fromCharCode(parseInt(ke.substring(2),16)):String.fromCharCode(+ke.substring(1)):""})}var d=/(^|[^\[])\^/g;function v(je,Ue){je=je.source||je,Ue=Ue||"";var ke={replace:function(Ce,Pe){return Pe=Pe.source||Pe,Pe=Pe.replace(d,"$1"),je=je.replace(Ce,Pe),ke},getRegex:function(){return new RegExp(je,Ue)}};return ke}var y=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(je,Ue,ke){if(je){var be;try{be=decodeURIComponent(t(ke)).replace(y,"").toLowerCase()}catch(Ce){return null}if(be.indexOf("javascript:")===0||be.indexOf("vbscript:")===0||be.indexOf("data:")===0)return null}Ue&&!b.test(ke)&&(ke=E(Ue,ke));try{ke=encodeURI(ke).replace(/%25/g,"%")}catch(Ce){return null}return ke}var m={},_=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function E(je,Ue){m[" "+je]||(_.test(je)?m[" "+je]=je+"/":m[" "+je]=N(je,"/",!0)),je=m[" "+je];var ke=je.indexOf(":")===-1;return Ue.substring(0,2)==="//"?ke?Ue:je.replace(x,"$1")+Ue:Ue.charAt(0)==="/"?ke?Ue:je.replace(h,"$1")+Ue:je+Ue}var S={exec:function(){}};function w(je){for(var Ue=1,ke,be;Ue<arguments.length;Ue++){ke=arguments[Ue];for(be in ke)Object.prototype.hasOwnProperty.call(ke,be)&&(je[be]=ke[be])}return je}function R(je,Ue){var ke=je.replace(/\|/g,function(Pe,Le,Ve){for(var at=!1,_t=Le;--_t>=0&&Ve[_t]==="\\";)at=!at;return at?"|":" |"}),be=ke.split(/ \|/),Ce=0;if(be.length>Ue)be.splice(Ue);else for(;be.length<Ue;)be.push("");for(;Ce<be.length;Ce++)be[Ce]=be[Ce].trim().replace(/\\\|/g,"|");return be}function N(je,Ue,ke){var be=je.length;if(be===0)return"";for(var Ce=0;Ce<be;){var Pe=je.charAt(be-Ce-1);if(Pe===Ue&&!ke)Ce++;else if(Pe!==Ue&&ke)Ce++;else break}return je.substr(0,be-Ce)}function F(je,Ue){if(je.indexOf(Ue[1])===-1)return-1;for(var ke=je.length,be=0,Ce=0;Ce<ke;Ce++)if(je[Ce]==="\\")Ce++;else if(je[Ce]===Ue[0])be++;else if(je[Ce]===Ue[1]&&(be--,be<0))return Ce;return-1}function z(je){je&&je.sanitize&&!je.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var q={escape:a,unescape:t,edit:v,cleanUrl:g,resolveUrl:E,noopTest:S,merge:w,splitCells:R,rtrim:N,findClosingBracket:F,checkSanitizeDeprecation:z},B=A.defaults,M=q.rtrim,G=q.splitCells,J=q.escape,K=q.findClosingBracket;function Z(je,Ue,ke){var be=Ue.href,Ce=Ue.title?J(Ue.title):null,Pe=je[1].replace(/\\([\[\]])/g,"$1");return je[0].charAt(0)!=="!"?{type:"link",raw:ke,href:be,title:Ce,text:Pe}:{type:"image",raw:ke,href:be,title:Ce,text:J(Pe)}}function le(je,Ue){var ke=je.match(/^(\s+)(?:```)/);if(ke===null)return Ue;var be=ke[1];return Ue.split(`
|
|
|
`).map(function(Ce){var Pe=Ce.match(/^\s+/);if(Pe===null)return Ce;var Le=Pe[0];return Le.length>=be.length?Ce.slice(be.length):Ce}).join(`
|
|
|
`)}var de=function(){function je(ke){this.options=ke||B}var Ue=je.prototype;return Ue.space=function(be){var Ce=this.rules.block.newline.exec(be);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:`
|
|
|
`}},Ue.code=function(be,Ce){var Pe=this.rules.block.code.exec(be);if(Pe){var Le=Ce[Ce.length-1];if(Le&&Le.type==="paragraph")return{raw:Pe[0],text:Pe[0].trimRight()};var Ve=Pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:Pe[0],codeBlockStyle:"indented",text:this.options.pedantic?Ve:M(Ve,`
|
|
|
`)}}},Ue.fences=function(be){var Ce=this.rules.block.fences.exec(be);if(Ce){var Pe=Ce[0],Le=le(Pe,Ce[3]||"");return{type:"code",raw:Pe,lang:Ce[2]?Ce[2].trim():Ce[2],text:Le}}},Ue.heading=function(be){var Ce=this.rules.block.heading.exec(be);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},Ue.nptable=function(be){var Ce=this.rules.block.nptable.exec(be);if(Ce){var Pe={type:"table",header:G(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Ce[0]};if(Pe.header.length===Pe.align.length){var Le=Pe.align.length,Ve;for(Ve=0;Ve<Le;Ve++)/^ *-+: *$/.test(Pe.align[Ve])?Pe.align[Ve]="right":/^ *:-+: *$/.test(Pe.align[Ve])?Pe.align[Ve]="center":/^ *:-+ *$/.test(Pe.align[Ve])?Pe.align[Ve]="left":Pe.align[Ve]=null;for(Le=Pe.cells.length,Ve=0;Ve<Le;Ve++)Pe.cells[Ve]=G(Pe.cells[Ve],Pe.header.length);return Pe}}},Ue.hr=function(be){var Ce=this.rules.block.hr.exec(be);if(Ce)return{type:"hr",raw:Ce[0]}},Ue.blockquote=function(be){var Ce=this.rules.block.blockquote.exec(be);if(Ce){var Pe=Ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ce[0],text:Pe}}},Ue.list=function(be){var Ce=this.rules.block.list.exec(be);if(Ce){for(var Pe=Ce[0],Le=Ce[2],Ve=Le.length>1,at=Le[Le.length-1]===")",_t={type:"list",raw:Pe,ordered:Ve,start:Ve?+Le.slice(0,-1):"",loose:!1,items:[]},kt=Ce[0].match(this.rules.block.item),Bt=!1,jt,At,pt,gt,rt,Oe,ze,vt=kt.length,st=0;st<vt;st++)jt=kt[st],Pe=jt,At=jt.length,jt=jt.replace(/^ *([*+-]|\d+[.)]) */,""),~jt.indexOf(`
|
|
|
`)&&(At-=jt.length,jt=this.options.pedantic?jt.replace(/^ {1,4}/gm,""):jt.replace(new RegExp("^ {1,"+At+"}","gm"),"")),st!==vt-1&&(pt=this.rules.block.bullet.exec(kt[st+1])[0],(Ve?pt.length===1||!at&&pt[pt.length-1]===")":pt.length>1||this.options.smartLists&&pt!==Le)&&(gt=kt.slice(st+1).join(`
|
|
|
`),_t.raw=_t.raw.substring(0,_t.raw.length-gt.length),st=vt-1)),rt=Bt||/\n\n(?!\s*$)/.test(jt),st!==vt-1&&(Bt=jt.charAt(jt.length-1)===`
|
|
|
`,rt||(rt=Bt)),rt&&(_t.loose=!0),Oe=/^\[[ xX]\] /.test(jt),ze=void 0,Oe&&(ze=jt[1]!==" ",jt=jt.replace(/^\[[ xX]\] +/,"")),_t.items.push({type:"list_item",raw:Pe,task:Oe,checked:ze,loose:rt,text:jt});return _t}},Ue.html=function(be){var Ce=this.rules.block.html.exec(be);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):J(Ce[0]):Ce[0]}},Ue.def=function(be){var Ce=this.rules.block.def.exec(be);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var Pe=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Pe,raw:Ce[0],href:Ce[2],title:Ce[3]}}},Ue.table=function(be){var Ce=this.rules.block.table.exec(be);if(Ce){var Pe={type:"table",header:G(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Pe.header.length===Pe.align.length){Pe.raw=Ce[0];var Le=Pe.align.length,Ve;for(Ve=0;Ve<Le;Ve++)/^ *-+: *$/.test(Pe.align[Ve])?Pe.align[Ve]="right":/^ *:-+: *$/.test(Pe.align[Ve])?Pe.align[Ve]="center":/^ *:-+ *$/.test(Pe.align[Ve])?Pe.align[Ve]="left":Pe.align[Ve]=null;for(Le=Pe.cells.length,Ve=0;Ve<Le;Ve++)Pe.cells[Ve]=G(Pe.cells[Ve].replace(/^ *\| *| *\| *$/g,""),Pe.header.length);return Pe}}},Ue.lheading=function(be){var Ce=this.rules.block.lheading.exec(be);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[2].charAt(0)==="="?1:2,text:Ce[1]}},Ue.paragraph=function(be){var Ce=this.rules.block.paragraph.exec(be);if(Ce)return{type:"paragraph",raw:Ce[0],text:Ce[1].charAt(Ce[1].length-1)===`
|
|
|
`?Ce[1].slice(0,-1):Ce[1]}},Ue.text=function(be,Ce){var Pe=this.rules.block.text.exec(be);if(Pe){var Le=Ce[Ce.length-1];return Le&&Le.type==="text"?{raw:Pe[0],text:Pe[0]}:{type:"text",raw:Pe[0],text:Pe[0]}}},Ue.escape=function(be){var Ce=this.rules.inline.escape.exec(be);if(Ce)return{type:"escape",raw:Ce[0],text:J(Ce[1])}},Ue.tag=function(be,Ce,Pe){var Le=this.rules.inline.tag.exec(be);if(Le)return!Ce&&/^<a /i.test(Le[0])?Ce=!0:Ce&&/^<\/a>/i.test(Le[0])&&(Ce=!1),!Pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(Le[0])?Pe=!0:Pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Le[0])&&(Pe=!1),{type:this.options.sanitize?"text":"html",raw:Le[0],inLink:Ce,inRawBlock:Pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Le[0]):J(Le[0]):Le[0]}},Ue.link=function(be){var Ce=this.rules.inline.link.exec(be);if(Ce){var Pe=K(Ce[2],"()");if(Pe>-1){var Le=Ce[0].indexOf("!")===0?5:4,Ve=Le+Ce[1].length+Pe;Ce[2]=Ce[2].substring(0,Pe),Ce[0]=Ce[0].substring(0,Ve).trim(),Ce[3]=""}var at=Ce[2],_t="";if(this.options.pedantic){var kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(at);kt?(at=kt[1],_t=kt[3]):_t=""}else _t=Ce[3]?Ce[3].slice(1,-1):"";at=at.trim().replace(/^<([\s\S]*)>$/,"$1");var Bt=Z(Ce,{href:at&&at.replace(this.rules.inline._escapes,"$1"),title:_t&&_t.replace(this.rules.inline._escapes,"$1")},Ce[0]);return Bt}},Ue.reflink=function(be,Ce){var Pe;if((Pe=this.rules.inline.reflink.exec(be))||(Pe=this.rules.inline.nolink.exec(be))){var Le=(Pe[2]||Pe[1]).replace(/\s+/g," ");if(Le=Ce[Le.toLowerCase()],!Le||!Le.href){var Ve=Pe[0].charAt(0);return{type:"text",raw:Ve,text:Ve}}var at=Z(Pe,Le,Pe[0]);return at}},Ue.strong=function(be,Ce,Pe){Pe===void 0&&(Pe="");var Le=this.rules.inline.strong.start.exec(be);if(Le&&(!Le[1]||Le[1]&&(Pe===""||this.rules.inline.punctuation.exec(Pe)))){Ce=Ce.slice(-1*be.length);var Ve=Le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ve.lastIndex=0;for(var at;(Le=Ve.exec(Ce))!=null;)if(at=this.rules.inline.strong.middle.exec(Ce.slice(0,Le.index+3)),at)return{type:"strong",raw:be.slice(0,at[0].length),text:be.slice(2,at[0].length-2)}}},Ue.em=function(be,Ce,Pe){Pe===void 0&&(Pe="");var Le=this.rules.inline.em.start.exec(be);if(Le&&(!Le[1]||Le[1]&&(Pe===""||this.rules.inline.punctuation.exec(Pe)))){Ce=Ce.slice(-1*be.length);var Ve=Le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ve.lastIndex=0;for(var at;(Le=Ve.exec(Ce))!=null;)if(at=this.rules.inline.em.middle.exec(Ce.slice(0,Le.index+2)),at)return{type:"em",raw:be.slice(0,at[0].length),text:be.slice(1,at[0].length-1)}}},Ue.codespan=function(be){var Ce=this.rules.inline.code.exec(be);if(Ce){var Pe=Ce[2].replace(/\n/g," "),Le=/[^ ]/.test(Pe),Ve=Pe.startsWith(" ")&&Pe.endsWith(" ");return Le&&Ve&&(Pe=Pe.substring(1,Pe.length-1)),Pe=J(Pe,!0),{type:"codespan",raw:Ce[0],text:Pe}}},Ue.br=function(be){var Ce=this.rules.inline.br.exec(be);if(Ce)return{type:"br",raw:Ce[0]}},Ue.del=function(be){var Ce=this.rules.inline.del.exec(be);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},Ue.autolink=function(be,Ce){var Pe=this.rules.inline.autolink.exec(be);if(Pe){var Le,Ve;return Pe[2]==="@"?(Le=J(this.options.mangle?Ce(Pe[1]):Pe[1]),Ve="mailto:"+Le):(Le=J(Pe[1]),Ve=Le),{type:"link",raw:Pe[0],text:Le,href:Ve,tokens:[{type:"text",raw:Le,text:Le}]}}},Ue.url=function(be,Ce){var Pe;if(Pe=this.rules.inline.url.exec(be)){var Le,Ve;if(Pe[2]==="@")Le=J(this.options.mangle?Ce(Pe[0]):Pe[0]),Ve="mailto:"+Le;else{var at;do at=Pe[0],Pe[0]=this.rules.inline._backpedal.exec(Pe[0])[0];while(at!==Pe[0]);Le=J(Pe[0]),Pe[1]==="www."?Ve="http://"+Le:Ve=Le}return{type:"link",raw:Pe[0],text:Le,href:Ve,tokens:[{type:"text",raw:Le,text:Le}]}}},Ue.inlineText=function(be,Ce,Pe){var Le=this.rules.inline.text.exec(be);if(Le){var Ve;return Ce?Ve=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Le[0]):J(Le[0]):Le[0]:Ve=J(this.options.smartypants?Pe(Le[0]):Le[0]),{type:"text",raw:Le[0],text:Ve}}},je}(),Te=q.noopTest,we=q.edit,Ie=q.merge,_e={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_e.def=we(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex(),_e.bullet=/(?:[*+-]|\d{1,9}[.)])/,_e.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,_e.item=we(_e.item,"gm").replace(/bull/g,_e.bullet).getRegex(),_e.list=we(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex(),_e._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",_e._comment=/<!--(?!-?>)[\s\S]*?-->/,_e.html=we(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e.paragraph=we(_e._paragraph).replace("hr",_e.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",_e._tag).getRegex(),_e.blockquote=we(_e.blockquote).replace("paragraph",_e.paragraph).getRegex(),_e.normal=Ie({},_e),_e.gfm=Ie({},_e.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*|$)"}),_e.gfm.nptable=we(_e.gfm.nptable).replace("hr",_e.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",_e._tag).getRegex(),_e.gfm.table=we(_e.gfm.table).replace("hr",_e.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",_e._tag).getRegex(),_e.pedantic=Ie({},_e.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Te,paragraph:we(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ye._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ye.punctuation=we(ye.punctuation).replace(/punctuation/g,ye._punctuation).getRegex(),ye._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ye._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ye.em.start=we(ye.em.start).replace(/punctuation/g,ye._punctuation).getRegex(),ye.em.middle=we(ye.em.middle).replace(/punctuation/g,ye._punctuation).replace(/overlapSkip/g,ye._overlapSkip).getRegex(),ye.em.endAst=we(ye.em.endAst,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.em.endUnd=we(ye.em.endUnd,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.start=we(ye.strong.start).replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.middle=we(ye.strong.middle).replace(/punctuation/g,ye._punctuation).replace(/blockSkip/g,ye._blockSkip).getRegex(),ye.strong.endAst=we(ye.strong.endAst,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.endUnd=we(ye.strong.endUnd,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.blockSkip=we(ye._blockSkip,"g").getRegex(),ye.overlapSkip=we(ye._overlapSkip,"g").getRegex(),ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ye._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])?)+(?![-_])/,ye.autolink=we(ye.autolink).replace("scheme",ye._scheme).replace("email",ye._email).getRegex(),ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ye.tag=we(ye.tag).replace("comment",_e._comment).replace("attribute",ye._attribute).getRegex(),ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ye._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ye.link=we(ye.link).replace("label",ye._label).replace("href",ye._href).replace("title",ye._title).getRegex(),ye.reflink=we(ye.reflink).replace("label",ye._label).getRegex(),ye.reflinkSearch=we(ye.reflinkSearch,"g").replace("reflink",ye.reflink).replace("nolink",ye.nolink).getRegex(),ye.normal=Ie({},ye),ye.pedantic=Ie({},ye.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",ye._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ye._label).getRegex()}),ye.gfm=Ie({},ye.normal,{escape:we(ye.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ye.gfm.url=we(ye.gfm.url,"i").replace("email",ye.gfm._extended_email).getRegex(),ye.breaks=Ie({},ye.gfm,{br:we(ye.br).replace("{2,}","*").getRegex(),text:we(ye.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ke={block:_e,inline:ye},Me=A.defaults,Fe=Ke.block,Ge=Ke.inline;function Ee(je){return je.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function me(je){var Ue="",ke,be,Ce=je.length;for(ke=0;ke<Ce;ke++)be=je.charCodeAt(ke),Math.random()>.5&&(be="x"+be.toString(16)),Ue+="&#"+be+";";return Ue}var We=function(){function je(ke){this.tokens=[],this.tokens.links=Object.create(null),this.options=ke||Me,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var be={block:Fe.normal,inline:Ge.normal};this.options.pedantic?(be.block=Fe.pedantic,be.inline=Ge.pedantic):this.options.gfm&&(be.block=Fe.gfm,this.options.breaks?be.inline=Ge.breaks:be.inline=Ge.gfm),this.tokenizer.rules=be}je.lex=function(be,Ce){var Pe=new je(Ce);return Pe.lex(be)};var Ue=je.prototype;return Ue.lex=function(be){return be=be.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(be,this.tokens,!0),this.inline(this.tokens),this.tokens},Ue.blockTokens=function(be,Ce,Pe){Ce===void 0&&(Ce=[]),Pe===void 0&&(Pe=!0),be=be.replace(/^ +$/gm,"");for(var Le,Ve,at,_t;be;){if(Le=this.tokenizer.space(be)){be=be.substring(Le.raw.length),Le.type&&Ce.push(Le);continue}if(Le=this.tokenizer.code(be,Ce)){be=be.substring(Le.raw.length),Le.type?Ce.push(Le):(_t=Ce[Ce.length-1],_t.raw+=`
|
|
|
`+Le.raw,_t.text+=`
|
|
|
`+Le.text);continue}if(Le=this.tokenizer.fences(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.heading(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.nptable(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.hr(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.blockquote(be)){be=be.substring(Le.raw.length),Le.tokens=this.blockTokens(Le.text,[],Pe),Ce.push(Le);continue}if(Le=this.tokenizer.list(be)){for(be=be.substring(Le.raw.length),at=Le.items.length,Ve=0;Ve<at;Ve++)Le.items[Ve].tokens=this.blockTokens(Le.items[Ve].text,[],!1);Ce.push(Le);continue}if(Le=this.tokenizer.html(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Pe&&(Le=this.tokenizer.def(be))){be=be.substring(Le.raw.length),this.tokens.links[Le.tag]||(this.tokens.links[Le.tag]={href:Le.href,title:Le.title});continue}if(Le=this.tokenizer.table(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.lheading(be)){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Pe&&(Le=this.tokenizer.paragraph(be))){be=be.substring(Le.raw.length),Ce.push(Le);continue}if(Le=this.tokenizer.text(be,Ce)){be=be.substring(Le.raw.length),Le.type?Ce.push(Le):(_t=Ce[Ce.length-1],_t.raw+=`
|
|
|
`+Le.raw,_t.text+=`
|
|
|
`+Le.text);continue}if(be){var kt="Infinite loop on byte: "+be.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return Ce},Ue.inline=function(be){var Ce,Pe,Le,Ve,at,_t,kt=be.length;for(Ce=0;Ce<kt;Ce++){_t=be[Ce];switch(_t.type){case"paragraph":case"text":case"heading":{_t.tokens=[],this.inlineTokens(_t.text,_t.tokens);break}case"table":{for(_t.tokens={header:[],cells:[]},Ve=_t.header.length,Pe=0;Pe<Ve;Pe++)_t.tokens.header[Pe]=[],this.inlineTokens(_t.header[Pe],_t.tokens.header[Pe]);for(Ve=_t.cells.length,Pe=0;Pe<Ve;Pe++)for(at=_t.cells[Pe],_t.tokens.cells[Pe]=[],Le=0;Le<at.length;Le++)_t.tokens.cells[Pe][Le]=[],this.inlineTokens(at[Le],_t.tokens.cells[Pe][Le]);break}case"blockquote":{this.inline(_t.tokens);break}case"list":{for(Ve=_t.items.length,Pe=0;Pe<Ve;Pe++)this.inline(_t.items[Pe].tokens);break}}}return be},Ue.inlineTokens=function(be,Ce,Pe,Le,Ve){Ce===void 0&&(Ce=[]),Pe===void 0&&(Pe=!1),Le===void 0&&(Le=!1),Ve===void 0&&(Ve="");var at,_t=be,kt;if(this.tokens.links){var Bt=Object.keys(this.tokens.links);if(Bt.length>0)for(;(kt=this.tokenizer.rules.inline.reflinkSearch.exec(_t))!=null;)Bt.includes(kt[0].slice(kt[0].lastIndexOf("[")+1,-1))&&(_t=_t.slice(0,kt.index)+"["+"a".repeat(kt[0].length-2)+"]"+_t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(kt=this.tokenizer.rules.inline.blockSkip.exec(_t))!=null;)_t=_t.slice(0,kt.index)+"["+"a".repeat(kt[0].length-2)+"]"+_t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;be;){if(at=this.tokenizer.escape(be)){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.tag(be,Pe,Le)){be=be.substring(at.raw.length),Pe=at.inLink,Le=at.inRawBlock,Ce.push(at);continue}if(at=this.tokenizer.link(be)){be=be.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,Le)),Ce.push(at);continue}if(at=this.tokenizer.reflink(be,this.tokens.links)){be=be.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,Le)),Ce.push(at);continue}if(at=this.tokenizer.strong(be,_t,Ve)){be=be.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],Pe,Le),Ce.push(at);continue}if(at=this.tokenizer.em(be,_t,Ve)){be=be.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],Pe,Le),Ce.push(at);continue}if(at=this.tokenizer.codespan(be)){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.br(be)){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.del(be)){be=be.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],Pe,Le),Ce.push(at);continue}if(at=this.tokenizer.autolink(be,me)){be=be.substring(at.raw.length),Ce.push(at);continue}if(!Pe&&(at=this.tokenizer.url(be,me))){be=be.substring(at.raw.length),Ce.push(at);continue}if(at=this.tokenizer.inlineText(be,Le,Ee)){be=be.substring(at.raw.length),Ve=at.raw.slice(-1),Ce.push(at);continue}if(be){var jt="Infinite loop on byte: "+be.charCodeAt(0);if(this.options.silent){console.error(jt);break}else throw new Error(jt)}}return Ce},ie(je,null,[{key:"rules",get:function(){return{block:Fe,inline:Ge}}}]),je}(),He=A.defaults,it=q.cleanUrl,re=q.escape,P=function(){function je(ke){this.options=ke||He}var Ue=je.prototype;return Ue.code=function(be,Ce,Pe){var Le=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var Ve=this.options.highlight(be,Le);Ve!=null&&Ve!==be&&(Pe=!0,be=Ve)}return Le?'<pre><code class="'+this.options.langPrefix+re(Le,!0)+'">'+(Pe?be:re(be,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Pe?be:re(be,!0))+`</code></pre>
|
|
|
`},Ue.blockquote=function(be){return`<blockquote>
|
|
|
`+be+`</blockquote>
|
|
|
`},Ue.html=function(be){return be},Ue.heading=function(be,Ce,Pe,Le){return this.options.headerIds?"<h"+Ce+' id="'+this.options.headerPrefix+Le.slug(Pe)+'">'+be+"</h"+Ce+`>
|
|
|
`:"<h"+Ce+">"+be+"</h"+Ce+`>
|
|
|
`},Ue.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Ue.list=function(be,Ce,Pe){var Le=Ce?"ol":"ul",Ve=Ce&&Pe!==1?' start="'+Pe+'"':"";return"<"+Le+Ve+`>
|
|
|
`+be+"</"+Le+`>
|
|
|
`},Ue.listitem=function(be){return"<li>"+be+`</li>
|
|
|
`},Ue.checkbox=function(be){return"<input "+(be?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ue.paragraph=function(be){return"<p>"+be+`</p>
|
|
|
`},Ue.table=function(be,Ce){return Ce&&(Ce="<tbody>"+Ce+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+be+`</thead>
|
|
|
`+Ce+`</table>
|
|
|
`},Ue.tablerow=function(be){return`<tr>
|
|
|
`+be+`</tr>
|
|
|
`},Ue.tablecell=function(be,Ce){var Pe=Ce.header?"th":"td",Le=Ce.align?"<"+Pe+' align="'+Ce.align+'">':"<"+Pe+">";return Le+be+"</"+Pe+`>
|
|
|
`},Ue.strong=function(be){return"<strong>"+be+"</strong>"},Ue.em=function(be){return"<em>"+be+"</em>"},Ue.codespan=function(be){return"<code>"+be+"</code>"},Ue.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ue.del=function(be){return"<del>"+be+"</del>"},Ue.link=function(be,Ce,Pe){if(be=it(this.options.sanitize,this.options.baseUrl,be),be===null)return Pe;var Le='<a href="'+re(be)+'"';return Ce&&(Le+=' title="'+Ce+'"'),Le+=">"+Pe+"</a>",Le},Ue.image=function(be,Ce,Pe){if(be=it(this.options.sanitize,this.options.baseUrl,be),be===null)return Pe;var Le='<img src="'+be+'" alt="'+Pe+'"';return Ce&&(Le+=' title="'+Ce+'"'),Le+=this.options.xhtml?"/>":">",Le},Ue.text=function(be){return be},je}(),j=function(){function je(){}var Ue=je.prototype;return Ue.strong=function(be){return be},Ue.em=function(be){return be},Ue.codespan=function(be){return be},Ue.del=function(be){return be},Ue.html=function(be){return be},Ue.text=function(be){return be},Ue.link=function(be,Ce,Pe){return""+Pe},Ue.image=function(be,Ce,Pe){return""+Pe},Ue.br=function(){return""},je}(),ee=function(){function je(){this.seen={}}var Ue=je.prototype;return Ue.slug=function(be){var Ce=be.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var Pe=Ce;do this.seen[Pe]++,Ce=Pe+"-"+this.seen[Pe];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},je}(),$=A.defaults,Q=q.unescape,xe=function(){function je(ke){this.options=ke||$,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new j,this.slugger=new ee}je.parse=function(be,Ce){var Pe=new je(Ce);return Pe.parse(be)};var Ue=je.prototype;return Ue.parse=function(be,Ce){Ce===void 0&&(Ce=!0);var Pe="",Le,Ve,at,_t,kt,Bt,jt,At,pt,gt,rt,Oe,ze,vt,st,It,Pt,Ze,mt=be.length;for(Le=0;Le<mt;Le++){gt=be[Le];switch(gt.type){case"space":continue;case"hr":{Pe+=this.renderer.hr();continue}case"heading":{Pe+=this.renderer.heading(this.parseInline(gt.tokens),gt.depth,Q(this.parseInline(gt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Pe+=this.renderer.code(gt.text,gt.lang,gt.escaped);continue}case"table":{for(At="",jt="",_t=gt.header.length,Ve=0;Ve<_t;Ve++)jt+=this.renderer.tablecell(this.parseInline(gt.tokens.header[Ve]),{header:!0,align:gt.align[Ve]});for(At+=this.renderer.tablerow(jt),pt="",_t=gt.cells.length,Ve=0;Ve<_t;Ve++){for(Bt=gt.tokens.cells[Ve],jt="",kt=Bt.length,at=0;at<kt;at++)jt+=this.renderer.tablecell(this.parseInline(Bt[at]),{header:!1,align:gt.align[at]});pt+=this.renderer.tablerow(jt)}Pe+=this.renderer.table(At,pt);continue}case"blockquote":{pt=this.parse(gt.tokens),Pe+=this.renderer.blockquote(pt);continue}case"list":{for(rt=gt.ordered,Oe=gt.start,ze=gt.loose,_t=gt.items.length,pt="",Ve=0;Ve<_t;Ve++)st=gt.items[Ve],It=st.checked,Pt=st.task,vt="",st.task&&(Ze=this.renderer.checkbox(It),ze?st.tokens.length>0&&st.tokens[0].type==="text"?(st.tokens[0].text=Ze+" "+st.tokens[0].text,st.tokens[0].tokens&&st.tokens[0].tokens.length>0&&st.tokens[0].tokens[0].type==="text"&&(st.tokens[0].tokens[0].text=Ze+" "+st.tokens[0].tokens[0].text)):st.tokens.unshift({type:"text",text:Ze}):vt+=Ze),vt+=this.parse(st.tokens,ze),pt+=this.renderer.listitem(vt,Pt,It);Pe+=this.renderer.list(pt,rt,Oe);continue}case"html":{Pe+=this.renderer.html(gt.text);continue}case"paragraph":{Pe+=this.renderer.paragraph(this.parseInline(gt.tokens));continue}case"text":{for(pt=gt.tokens?this.parseInline(gt.tokens):gt.text;Le+1<mt&&be[Le+1].type==="text";)gt=be[++Le],pt+=`
|
|
|
`+(gt.tokens?this.parseInline(gt.tokens):gt.text);Pe+=Ce?this.renderer.paragraph(pt):pt;continue}default:{var Lt='Token with "'+gt.type+'" type was not found.';if(this.options.silent){console.error(Lt);return}else throw new Error(Lt)}}}return Pe},Ue.parseInline=function(be,Ce){Ce=Ce||this.renderer;var Pe="",Le,Ve,at=be.length;for(Le=0;Le<at;Le++){Ve=be[Le];switch(Ve.type){case"escape":{Pe+=Ce.text(Ve.text);break}case"html":{Pe+=Ce.html(Ve.text);break}case"link":{Pe+=Ce.link(Ve.href,Ve.title,this.parseInline(Ve.tokens,Ce));break}case"image":{Pe+=Ce.image(Ve.href,Ve.title,Ve.text);break}case"strong":{Pe+=Ce.strong(this.parseInline(Ve.tokens,Ce));break}case"em":{Pe+=Ce.em(this.parseInline(Ve.tokens,Ce));break}case"codespan":{Pe+=Ce.codespan(Ve.text);break}case"br":{Pe+=Ce.br();break}case"del":{Pe+=Ce.del(this.parseInline(Ve.tokens,Ce));break}case"text":{Pe+=Ce.text(Ve.text);break}default:{var _t='Token with "'+Ve.type+'" type was not found.';if(this.options.silent){console.error(_t);return}else throw new Error(_t)}}}return Pe},je}(),De=q.merge,dt=q.checkSanitizeDeprecation,Ne=q.escape,Be=A.getDefaults,tt=A.changeDefaults,lt=A.defaults;function qe(je,Ue,ke){if(typeof je=="undefined"||je===null)throw new Error("marked(): input parameter is undefined or null");if(typeof je!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(je)+", string expected");if(typeof Ue=="function"&&(ke=Ue,Ue=null),Ue=De({},qe.defaults,Ue||{}),dt(Ue),ke){var be=Ue.highlight,Ce;try{Ce=We.lex(je,Ue)}catch(at){return ke(at)}var Pe=function(_t){var kt;if(!_t)try{kt=xe.parse(Ce,Ue)}catch(Bt){_t=Bt}return Ue.highlight=be,_t?ke(_t):ke(null,kt)};if(!be||be.length<3)return Pe();if(delete Ue.highlight,!Ce.length)return Pe();var Le=0;qe.walkTokens(Ce,function(at){at.type==="code"&&(Le++,setTimeout(function(){be(at.text,at.lang,function(_t,kt){if(_t)return Pe(_t);kt!=null&&kt!==at.text&&(at.text=kt,at.escaped=!0),Le--,Le===0&&Pe()})},0))}),Le===0&&Pe();return}try{var Ve=We.lex(je,Ue);return Ue.walkTokens&&qe.walkTokens(Ve,Ue.walkTokens),xe.parse(Ve,Ue)}catch(at){if(at.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Ue.silent)return"<p>An error occurred:</p><pre>"+Ne(at.message+"",!0)+"</pre>";throw at}}qe.options=qe.setOptions=function(je){return De(qe.defaults,je),tt(qe.defaults),qe},qe.getDefaults=Be,qe.defaults=lt,qe.use=function(je){var Ue=De({},je);if(je.renderer&&function(){var be=qe.defaults.renderer||new P,Ce=function(Ve){var at=be[Ve];be[Ve]=function(){for(var _t=arguments.length,kt=new Array(_t),Bt=0;Bt<_t;Bt++)kt[Bt]=arguments[Bt];var jt=je.renderer[Ve].apply(be,kt);return jt===!1&&(jt=at.apply(be,kt)),jt}};for(var Pe in je.renderer)Ce(Pe);Ue.renderer=be}(),je.tokenizer&&function(){var be=qe.defaults.tokenizer||new de,Ce=function(Ve){var at=be[Ve];be[Ve]=function(){for(var _t=arguments.length,kt=new Array(_t),Bt=0;Bt<_t;Bt++)kt[Bt]=arguments[Bt];var jt=je.tokenizer[Ve].apply(be,kt);return jt===!1&&(jt=at.apply(be,kt)),jt}};for(var Pe in je.tokenizer)Ce(Pe);Ue.tokenizer=be}(),je.walkTokens){var ke=qe.defaults.walkTokens;Ue.walkTokens=function(be){je.walkTokens(be),ke&&ke(be)}}qe.setOptions(Ue)},qe.walkTokens=function(je,Ue){for(var ke=D(je),be;!(be=ke()).done;){var Ce=be.value;Ue(Ce);switch(Ce.type){case"table":{for(var Pe=D(Ce.tokens.header),Le;!(Le=Pe()).done;){var Ve=Le.value;qe.walkTokens(Ve,Ue)}for(var at=D(Ce.tokens.cells),_t;!(_t=at()).done;)for(var kt=_t.value,Bt=D(kt),jt;!(jt=Bt()).done;){var At=jt.value;qe.walkTokens(At,Ue)}break}case"list":{qe.walkTokens(Ce.items,Ue);break}default:Ce.tokens&&qe.walkTokens(Ce.tokens,Ue)}}},qe.Parser=xe,qe.parser=xe.parse,qe.Renderer=P,qe.TextRenderer=j,qe.Lexer=We,qe.lexer=We.lex,qe.Tokenizer=de,qe.Slugger=ee,qe.parse=qe;var Ye=qe;return Ye})},"DlR+":function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global,W=ce.trim;nt.exports={name:"cookieStorage",read:D,write:A,each:T,remove:O,clearAll:f};var C=ie.document;function D(c){if(!c||!p(c))return null;var s="(?:^|.*;\\s*)"+escape(c).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(C.cookie.replace(new RegExp(s),"$1"))}function T(c){for(var s=C.cookie.split(/; ?/g),n=s.length-1;n>=0;n--){if(!W(s[n]))continue;var o=s[n].split("="),r=unescape(o[0]),l=unescape(o[1]);c(l,r)}}function A(c,s){if(!c)return;C.cookie=escape(c)+"="+escape(s)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function O(c){if(!c||!p(c))return;C.cookie=escape(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function f(){T(function(c,s){O(s)})}function p(c){return new RegExp("(?:^|;\\s*)"+escape(c).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(C.cookie)}},E2g8:function(nt,Xe,V){(function(ce,ie){/*!
|
|
|
* @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(W,C){nt.exports=C()})(this,function(){"use strict";function W(P){var j=typeof P;return P!==null&&(j==="object"||j==="function")}function C(P){return typeof P=="function"}var D=void 0;Array.isArray?D=Array.isArray:D=function(P){return Object.prototype.toString.call(P)==="[object Array]"};var T=D,A=0,O=void 0,f=void 0,p=function(j,ee){b[A]=j,b[A+1]=ee,A+=2,A===2&&(f?f(g):_())};function c(P){f=P}function s(P){p=P}var n=typeof window!="undefined"?window:void 0,o=n||{},r=o.MutationObserver||o.WebKitMutationObserver,l=typeof self=="undefined"&&typeof ce!="undefined"&&{}.toString.call(ce)==="[object process]",a=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function i(){return function(){return ce.nextTick(g)}}function t(){return typeof O!="undefined"?function(){O(g)}:y()}function d(){var P=0,j=new r(g),ee=document.createTextNode("");return j.observe(ee,{characterData:!0}),function(){ee.data=P=++P%2}}function v(){var P=new MessageChannel;return P.port1.onmessage=g,function(){return P.port2.postMessage(0)}}function y(){var P=setTimeout;return function(){return P(g,1)}}var b=new Array(1e3);function g(){for(var P=0;P<A;P+=2){var j=b[P],ee=b[P+1];j(ee),b[P]=void 0,b[P+1]=void 0}A=0}function m(){try{var P=Function("return this")().require("vertx");return O=P.runOnLoop||P.runOnContext,t()}catch(j){return y()}}var _=void 0;l?_=i():r?_=d():a?_=v():n===void 0&&!0?_=m():_=y();function x(P,j){var ee=this,$=new this.constructor(S);$[E]===void 0&&Ke($);var Q=ee._state;if(Q){var xe=arguments[Q-1];p(function(){return we(Q,$,xe,ee._result)})}else de(ee,$,P,j);return $}function h(P){var j=this;if(P&&typeof P=="object"&&P.constructor===j)return P;var ee=new j(S);return J(ee,P),ee}var E=Math.random().toString(36).substring(2);function S(){}var w=void 0,R=1,N=2;function F(){return new TypeError("You cannot resolve a promise with itself")}function z(){return new TypeError("A promises callback cannot return that same promise.")}function q(P,j,ee,$){try{P.call(j,ee,$)}catch(Q){return Q}}function B(P,j,ee){p(function($){var Q=!1,xe=q(ee,j,function(De){if(Q)return;Q=!0,j!==De?J($,De):Z($,De)},function(De){if(Q)return;Q=!0,le($,De)},"Settle: "+($._label||" unknown promise"));!Q&&xe&&(Q=!0,le($,xe))},P)}function M(P,j){j._state===R?Z(P,j._result):j._state===N?le(P,j._result):de(j,void 0,function(ee){return J(P,ee)},function(ee){return le(P,ee)})}function G(P,j,ee){j.constructor===P.constructor&&ee===x&&j.constructor.resolve===h?M(P,j):ee===void 0?Z(P,j):C(ee)?B(P,j,ee):Z(P,j)}function J(P,j){if(P===j)le(P,F());else if(W(j)){var ee=void 0;try{ee=j.then}catch($){le(P,$);return}G(P,j,ee)}else Z(P,j)}function K(P){P._onerror&&P._onerror(P._result),Te(P)}function Z(P,j){if(P._state!==w)return;P._result=j,P._state=R,P._subscribers.length!==0&&p(Te,P)}function le(P,j){if(P._state!==w)return;P._state=N,P._result=j,p(K,P)}function de(P,j,ee,$){var Q=P._subscribers,xe=Q.length;P._onerror=null,Q[xe]=j,Q[xe+R]=ee,Q[xe+N]=$,xe===0&&P._state&&p(Te,P)}function Te(P){var j=P._subscribers,ee=P._state;if(j.length===0)return;for(var $=void 0,Q=void 0,xe=P._result,De=0;De<j.length;De+=3)$=j[De],Q=j[De+ee],$?we(ee,$,Q,xe):Q(xe);P._subscribers.length=0}function we(P,j,ee,$){var Q=C(ee),xe=void 0,De=void 0,dt=!0;if(Q){try{xe=ee($)}catch(Ne){dt=!1,De=Ne}if(j===xe){le(j,z());return}}else xe=$;j._state!==w||(Q&&dt?J(j,xe):dt===!1?le(j,De):P===R?Z(j,xe):P===N&&le(j,xe))}function Ie(P,j){try{j(function($){J(P,$)},function($){le(P,$)})}catch(ee){le(P,ee)}}var _e=0;function ye(){return _e++}function Ke(P){P[E]=_e++,P._state=void 0,P._result=void 0,P._subscribers=[]}function Me(){return new Error("Array Methods must be provided an Array")}var Fe=function(){function P(j,ee){this._instanceConstructor=j,this.promise=new j(S),this.promise[E]||Ke(this.promise),T(ee)?(this.length=ee.length,this._remaining=ee.length,this._result=new Array(this.length),this.length===0?Z(this.promise,this._result):(this.length=this.length||0,this._enumerate(ee),this._remaining===0&&Z(this.promise,this._result))):le(this.promise,Me())}return P.prototype._enumerate=function(ee){for(var $=0;this._state===w&&$<ee.length;$++)this._eachEntry(ee[$],$)},P.prototype._eachEntry=function(ee,$){var Q=this._instanceConstructor,xe=Q.resolve;if(xe===h){var De=void 0,dt=void 0,Ne=!1;try{De=ee.then}catch(tt){Ne=!0,dt=tt}if(De===x&&ee._state!==w)this._settledAt(ee._state,$,ee._result);else if(typeof De!="function")this._remaining--,this._result[$]=ee;else if(Q===it){var Be=new Q(S);Ne?le(Be,dt):G(Be,ee,De),this._willSettleAt(Be,$)}else this._willSettleAt(new Q(function(tt){return tt(ee)}),$)}else this._willSettleAt(xe(ee),$)},P.prototype._settledAt=function(ee,$,Q){var xe=this.promise;xe._state===w&&(this._remaining--,ee===N?le(xe,Q):this._result[$]=Q),this._remaining===0&&Z(xe,this._result)},P.prototype._willSettleAt=function(ee,$){var Q=this;de(ee,void 0,function(xe){return Q._settledAt(R,$,xe)},function(xe){return Q._settledAt(N,$,xe)})},P}();function Ge(P){return new Fe(this,P).promise}function Ee(P){var j=this;return T(P)?new j(function(ee,$){for(var Q=P.length,xe=0;xe<Q;xe++)j.resolve(P[xe]).then(ee,$)}):new j(function(ee,$){return $(new TypeError("You must pass an array to race."))})}function me(P){var j=this,ee=new j(S);return le(ee,P),ee}function We(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function He(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var it=function(){function P(j){this[E]=ye(),this._result=this._state=void 0,this._subscribers=[],S!==j&&(typeof j!="function"&&We(),this instanceof P?Ie(this,j):He())}return P.prototype.catch=function(ee){return this.then(null,ee)},P.prototype.finally=function(ee){var $=this,Q=$.constructor;return C(ee)?$.then(function(xe){return Q.resolve(ee()).then(function(){return xe})},function(xe){return Q.resolve(ee()).then(function(){throw xe})}):$.then(ee,ee)},P}();it.prototype.then=x,it.all=Ge,it.race=Ee,it.resolve=h,it.reject=me,it._setScheduler=c,it._setAsap=s,it._asap=p;function re(){var P=void 0;if(typeof ie!="undefined")P=ie;else if(typeof self!="undefined")P=self;else try{P=Function("return this")()}catch($){throw new Error("polyfill failed because global object is unavailable in this environment")}var j=P.Promise;if(j){var ee=null;try{ee=Object.prototype.toString.call(j.resolve())}catch($){}if(ee==="[object Promise]"&&!j.cast)return}P.Promise=it}return it.polyfill=re,it.Promise=it,it})}).call(this,V("Q2Ig"),V("IyRk"))},E9nw:function(nt,Xe){nt.exports=function(){var V=document.getSelection();if(!V.rangeCount)return function(){};for(var ce=document.activeElement,ie=[],W=0;W<V.rangeCount;W++)ie.push(V.getRangeAt(W));switch(ce.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":ce.blur();break;default:ce=null;break}return V.removeAllRanges(),function(){V.type==="Caret"&&V.removeAllRanges(),V.rangeCount||ie.forEach(function(C){V.addRange(C)}),ce&&ce.focus()}}},EHPI:function(nt,Xe,V){"use strict";var ce=V("bbsP"),ie=V("/wGt"),W=V("tJVT"),C=V("k1fw"),D=V("cDcd"),T=V.n(D),A=V("ZW9T"),O=V("ZD9Y"),f=V("M8RZ"),p=V("bCnd"),c=V("fcyK"),s=V.n(c),n={theme:Object(p.a)("cmCodeMode","vs-dark"),fontSize:Object(p.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(p.a)("cmTabToSpace",!0)},o;(function(a){a[a.set_font_size=0]="set_font_size",a[a.set_theme=1]="set_theme",a[a.on_tab_to_space=2]="on_tab_to_space",a[a.set_show_editor_setting=3]="set_show_editor_setting"})(o||(o={}));function r(a,i){switch(i.type){case o.set_show_editor_setting:return Object(C.a)(Object(C.a)({},a),{},{showEditorSetting:i.payload});case o.set_theme:return Object(C.a)(Object(C.a)({},a),{},{theme:i.payload});case o.set_font_size:return Object(C.a)(Object(C.a)({},a),{},{fontSize:i.payload});case o.on_tab_to_space:return Object(C.a)(Object(C.a)({},a),{},{tabToSpace:i.payload});default:throw new Error}}Xe.a=function(a){var i=a.isLoading,t=a.value,d=a.onChange,v=a.language,y=a.ActionBarRender,b=y===void 0?function(q){return T.a.createElement(l,{onShowCodeSetting:q})}:y,g=Object(D.useReducer)(r,n),m=Object(W.a)(g,2),_=m[0],x=m[1],h=_.theme,E=_.fontSize,S=_.showEditorSetting,w=_.tabToSpace,R={onFontSizeChange:function(B){x({type:o.set_font_size,payload:B}),Object(p.b)("cmFontSize",B)},tabToSpace:w,cmFontSize:E,className:"oj",cmCodeMode:h,onTabToSpace:function(B){x({type:o.on_tab_to_space,payload:B}),Object(p.b)("cmTabToSpace",B)},onCodeModeChange:function(B){x({type:o.set_theme,payload:B}),Object(p.b)("cmCodeMode",B)}};function N(){x({type:o.set_show_editor_setting,payload:!1})}function F(){x({type:o.set_show_editor_setting,payload:!0})}var z={value:t,language:v,onChange:d,theme:h,height:"calc(100% - 56px)",options:{fontSize:E,insertSpaces:w}};return T.a.createElement(D.Fragment,null,T.a.createElement("div",{className:"code-panel-container"},b(F),!i&&T.a.createElement(A.b,z)),T.a.createElement(f.a,null,T.a.createElement(ie.a,{className:"oj",title:null,placement:"right",closable:!1,visible:S,onClose:N},T.a.createElement(O.a,R))))};function l(a){var i=a.onShowCodeSetting;return T.a.createElement("div",{className:"action-bar"},T.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),T.a.createElement("a",{onClick:i},T.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){var ie={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},W=ce.Pos;ce.defineOption("autoCloseBrackets",!1,function(r,l,a){a&&a!=ce.Init&&(r.removeKeyMap(D),r.state.closeBrackets=null),l&&(T(C(l,"pairs")),r.state.closeBrackets=l,r.addKeyMap(D))});function C(r,l){return l=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[l]!=null?r[l]:ie[l]}var D={Backspace:f,Enter:p};function T(r){for(var l=0;l<r.length;l++){var a=r.charAt(l),i="'"+a+"'";D[i]||(D[i]=A(a))}}T(ie.pairs+"`");function A(r){return function(l){return s(l,r)}}function O(r){var l=r.state.closeBrackets;if(!l||l.override)return l;var a=r.getModeAt(r.getCursor());return a.closeBrackets||l}function f(r){var l=O(r);if(!l||r.getOption("disableInput"))return ce.Pass;for(var a=C(l,"pairs"),i=r.listSelections(),t=0;t<i.length;t++){if(!i[t].empty())return ce.Pass;var d=n(r,i[t].head);if(!d||a.indexOf(d)%2!=0)return ce.Pass}for(var t=i.length-1;t>=0;t--){var v=i[t].head;r.replaceRange("",W(v.line,v.ch-1),W(v.line,v.ch+1),"+delete")}}function p(r){var l=O(r),a=l&&C(l,"explode");if(!a||r.getOption("disableInput"))return ce.Pass;for(var i=r.listSelections(),t=0;t<i.length;t++){if(!i[t].empty())return ce.Pass;var d=n(r,i[t].head);if(!d||a.indexOf(d)%2!=0)return ce.Pass}r.operation(function(){var v=r.lineSeparator()||`
|
|
|
`;r.replaceSelection(v+v,null),r.execCommand("goCharLeft"),i=r.listSelections();for(var y=0;y<i.length;y++){var b=i[y].head.line;r.indentLine(b,null,!0),r.indentLine(b+1,null,!0)}})}function c(r){var l=ce.cmpPos(r.anchor,r.head)>0;return{anchor:new W(r.anchor.line,r.anchor.ch+(l?-1:1)),head:new W(r.head.line,r.head.ch+(l?1:-1))}}function s(r,l){var a=O(r);if(!a||r.getOption("disableInput"))return ce.Pass;var i=C(a,"pairs"),t=i.indexOf(l);if(t==-1)return ce.Pass;for(var d=C(a,"closeBefore"),v=C(a,"triples"),y=i.charAt(t+1)==l,b=r.listSelections(),g=t%2==0,m,_=0;_<b.length;_++){var x=b[_],h=x.head,E,S=r.getRange(h,W(h.line,h.ch+1));if(g&&!x.empty())E="surround";else if((y||!g)&&S==l)y&&o(r,h)?E="both":v.indexOf(l)>=0&&r.getRange(h,W(h.line,h.ch+3))==l+l+l?E="skipThree":E="skip";else if(y&&h.ch>1&&v.indexOf(l)>=0&&r.getRange(W(h.line,h.ch-2),h)==l+l){if(h.ch>2&&/\bstring/.test(r.getTokenTypeAt(W(h.line,h.ch-2))))return ce.Pass;E="addFour"}else if(y){var w=h.ch==0?" ":r.getRange(W(h.line,h.ch-1),h);if(!ce.isWordChar(S)&&w!=l&&!ce.isWordChar(w))E="both";else return ce.Pass}else if(g&&(S.length===0||/\s/.test(S)||d.indexOf(S)>-1))E="both";else return ce.Pass;if(!m)m=E;else if(m!=E)return ce.Pass}var R=t%2?i.charAt(t-1):l,N=t%2?l:i.charAt(t+1);r.operation(function(){if(m=="skip")r.execCommand("goCharRight");else if(m=="skipThree")for(var F=0;F<3;F++)r.execCommand("goCharRight");else if(m=="surround"){for(var z=r.getSelections(),F=0;F<z.length;F++)z[F]=R+z[F]+N;r.replaceSelections(z,"around"),z=r.listSelections().slice();for(var F=0;F<z.length;F++)z[F]=c(z[F]);r.setSelections(z)}else m=="both"?(r.replaceSelection(R+N,null),r.triggerElectric(R+N),r.execCommand("goCharLeft")):m=="addFour"&&(r.replaceSelection(R+R+R+R,"before"),r.execCommand("goCharRight"))})}function n(r,l){var a=r.getRange(W(l.line,l.ch-1),W(l.line,l.ch+1));return a.length==2?a:null}function o(r,l){var a=r.getTokenAt(W(l.line,l.ch+1));return/\bstring/.test(a.type)&&a.start==l.ch&&(l.ch==0||!/\bstring/.test(r.getTokenTypeAt(l)))}})},FOrL:function(nt,Xe,V){nt.exports=V.p+"static/nodata.a6b3f948.png"},GUcZ:function(nt,Xe,V){"use strict";var ce=V("fWQN"),ie=V("mtLc"),W=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(X,ne){return X.__proto__=ne,X},Object.assign=Object.assign||function(X){if(X==null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(X),oe=1;oe<arguments.length;oe++){var he=arguments[oe];if(he!=null)for(var Ae in he)he.hasOwnProperty(Ae)&&(ne[Ae]=he[Ae])}return ne},typeof self.Promise!="function"&&V("E2g8").polyfill()}}]),Re}();W.install();var C=W,D=V("+qE3"),T=V.n(D),A=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"e",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","error",oe),!Re.ENABLE_ERROR)return;console.error?console.error(oe):console.warn?console.warn(oe):console.log(oe)}},{key:"i",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","info",oe),!Re.ENABLE_INFO)return;console.info?console.info(oe):console.log(oe)}},{key:"w",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","warn",oe),!Re.ENABLE_WARN)return;console.warn?console.warn(oe):console.log(oe)}},{key:"d",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","debug",oe),!Re.ENABLE_DEBUG)return;console.debug?console.debug(oe):console.log(oe)}},{key:"v",value:function(X,ne){(!X||Re.FORCE_GLOBAL_TAG)&&(X=Re.GLOBAL_TAG);var oe="[".concat(X,"] > ").concat(ne);if(Re.ENABLE_CALLBACK&&Re.emitter.emit("log","verbose",oe),!Re.ENABLE_VERBOSE)return;console.log(oe)}}]),Re}();A.GLOBAL_TAG="flv.js",A.FORCE_GLOBAL_TAG=!1,A.ENABLE_ERROR=!0,A.ENABLE_INFO=!0,A.ENABLE_WARN=!0,A.ENABLE_DEBUG=!0,A.ENABLE_VERBOSE=!0,A.ENABLE_CALLBACK=!1,A.emitter=new T.a;var O=A,f=function(){function Re(){Object(ce.a)(this,Re),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(ie.a)(Re,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(X){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=X,this._totalBytes+=X):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=X,this._totalBytes+=X):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=X,this._totalBytes+=X,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var X=(this._now()-this._lastCheckpoint)/1e3;return X==0&&(X=1),this._intervalBytes/X/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 X=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/X/1024}}]),Re}(),p=f,c=V("yKVA"),s=V("879j"),n=function(){function Re(ve){Object(ce.a)(this,Re),this._message=ve}return Object(ie.a)(Re,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),Re}(),o=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne){return Object(ce.a)(this,X),ve.call(this,ne)}return Object(ie.a)(X,[{key:"name",get:function(){return"IllegalStateException"}}]),X}(n),r=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne){return Object(ce.a)(this,X),ve.call(this,ne)}return Object(ie.a)(X,[{key:"name",get:function(){return"InvalidArgumentException"}}]),X}(n),l=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne){return Object(ce.a)(this,X),ve.call(this,ne)}return Object(ie.a)(X,[{key:"name",get:function(){return"NotImplementedException"}}]),X}(n),a={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},i={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},t=function(){function Re(ve){Object(ce.a)(this,Re),this._type=ve||"undefined",this._status=a.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._status=a.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===a.kConnecting||this._status===a.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(X){this._onContentLengthKnown=X}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(X){this._onURLRedirect=X}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(X){this._onDataArrival=X}},{key:"onError",get:function(){return this._onError},set:function(X){this._onError=X}},{key:"onComplete",get:function(){return this._onComplete},set:function(X){this._onComplete=X}},{key:"open",value:function(X,ne){throw new l("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new l("Unimplemented abstract function!")}}]),Re}(),d=V("oZsa");function v(Re,ve){for(;!Object.prototype.hasOwnProperty.call(Re,ve)&&!(Re=Object(d.a)(Re),Re===null););return Re}function y(Re,ve,X){return typeof Reflect!="undefined"&&Reflect.get?y=Reflect.get:y=function(oe,he,Ae){var Qe=v(oe,he);if(!Qe)return;var ot=Object.getOwnPropertyDescriptor(Qe,he);return ot.get?ot.get.call(Ae):ot.value},y(Re,ve,X||Re)}var b={};function g(){var Re=self.navigator.userAgent.toLowerCase(),ve=/(edge)\/([\w.]+)/.exec(Re)||/(opr)[\/]([\w.]+)/.exec(Re)||/(chrome)[ \/]([\w.]+)/.exec(Re)||/(iemobile)[\/]([\w.]+)/.exec(Re)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Re)||/(webkit)[ \/]([\w.]+)/.exec(Re)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Re)||/(msie) ([\w.]+)/.exec(Re)||Re.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Re)||Re.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Re)||[],X=/(ipad)/.exec(Re)||/(ipod)/.exec(Re)||/(windows phone)/.exec(Re)||/(iphone)/.exec(Re)||/(kindle)/.exec(Re)||/(android)/.exec(Re)||/(windows)/.exec(Re)||/(mac)/.exec(Re)||/(linux)/.exec(Re)||/(cros)/.exec(Re)||[],ne={browser:ve[5]||ve[3]||ve[1]||"",version:ve[2]||ve[4]||"0",majorVersion:ve[4]||ve[2]||"0",platform:X[0]||""},oe={};if(ne.browser){oe[ne.browser]=!0;var he=ne.majorVersion.split(".");oe.version={major:parseInt(ne.majorVersion,10),string:ne.version},he.length>1&&(oe.version.minor=parseInt(he[1],10)),he.length>2&&(oe.version.build=parseInt(he[2],10))}if(ne.platform&&(oe[ne.platform]=!0),(oe.chrome||oe.opr||oe.safari)&&(oe.webkit=!0),oe.rv||oe.iemobile){oe.rv&&delete oe.rv;var Ae="msie";ne.browser=Ae,oe[Ae]=!0}if(oe.edge){delete oe.edge;var Qe="msedge";ne.browser=Qe,oe[Qe]=!0}if(oe.opr){var ot="opera";ne.browser=ot,oe[ot]=!0}if(oe.safari&&oe.android){var Rt="android";ne.browser=Rt,oe[Rt]=!0}oe.name=ne.browser,oe.platform=ne.platform;for(var Nt in b)b.hasOwnProperty(Nt)&&delete b[Nt];Object.assign(b,oe)}g();var m=b,_=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne,oe){var he;return Object(ce.a)(this,X),he=ve.call(this,"fetch-stream-loader"),he.TAG="FetchStreamLoader",he._seekHandler=ne,he._config=oe,he._needStash=!0,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(ie.a)(X,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){var Ae=this;this._dataSource=oe,this._range=he;var Qe=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Qe=oe.redirectedURL);var ot=this._seekHandler.getConfig(Qe,he),Rt=new self.Headers;if(typeof ot.headers=="object"){var Nt=ot.headers;for(var ht in Nt)Nt.hasOwnProperty(ht)&&Rt.append(ht,Nt[ht])}var Dt={method:"GET",headers:Rt,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var sn in this._config.headers)Rt.append(sn,this._config.headers[sn]);oe.cors===!1&&(Dt.mode="same-origin"),oe.withCredentials&&(Dt.credentials="include"),oe.referrerPolicy&&(Dt.referrerPolicy=oe.referrerPolicy),this._status=a.kConnecting,self.fetch(ot.url,Dt).then(function(Ct){if(Ae._requestAbort){Ae._requestAbort=!1,Ae._status=a.kIdle;return}if(Ct.ok&&Ct.status>=200&&Ct.status<=299){if(Ct.url!==ot.url&&Ae._onURLRedirect){var hn=Ae._seekHandler.removeURLParameters(Ct.url);Ae._onURLRedirect(hn)}var rn=Ct.headers.get("Content-Length");return rn!=null&&(Ae._contentLength=parseInt(rn),Ae._contentLength!==0&&(Ae._onContentLengthKnown&&Ae._onContentLengthKnown(Ae._contentLength))),Ae._pump.call(Ae,Ct.body.getReader())}else if(Ae._status=a.kError,Ae._onError)Ae._onError(i.HTTP_STATUS_CODE_INVALID,{code:Ct.status,msg:Ct.statusText});else throw new n("FetchStreamLoader: Http code invalid, "+Ct.status+" "+Ct.statusText)}).catch(function(Ct){if(Ae._status=a.kError,Ae._onError)Ae._onError(i.EXCEPTION,{code:-1,msg:Ct.message});else throw Ct})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(oe){var he=this;return oe.read().then(function(Ae){if(Ae.done)if(he._contentLength!==null&&he._receivedLength<he._contentLength){he._status=a.kError;var Qe=i.EARLY_EOF,ot={code:-1,msg:"Fetch stream meet Early-EOF"};if(he._onError)he._onError(Qe,ot);else throw new n(ot.msg)}else he._status=a.kComplete,he._onComplete&&he._onComplete(he._range.from,he._range.from+he._receivedLength-1);else{if(he._requestAbort===!0)return he._requestAbort=!1,he._status=a.kComplete,oe.cancel();he._status=a.kBuffering;var Rt=Ae.value.buffer,Nt=he._range.from+he._receivedLength;he._receivedLength+=Rt.byteLength,he._onDataArrival&&he._onDataArrival(Rt,Nt,he._receivedLength),he._pump(oe)}}).catch(function(Ae){if(Ae.code===11&&m.msedge)return;he._status=a.kError;var Qe=0,ot=null;if((Ae.code===19||Ae.message==="network error")&&(he._contentLength===null||he._contentLength!==null&&he._receivedLength<he._contentLength)?(Qe=i.EARLY_EOF,ot={code:Ae.code,msg:"Fetch stream meet Early-EOF"}):(Qe=i.EXCEPTION,ot={code:Ae.code,msg:Ae.message}),he._onError)he._onError(Qe,ot);else throw new n(ot.msg)})}}],[{key:"isSupported",value:function(){try{var oe=m.msedge&&m.version.minor>=15048,he=m.msedge?oe:!0;return self.fetch&&self.ReadableStream&&he}catch(Ae){return!1}}}]),X}(t),x=_,h=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne,oe){var he;return Object(ce.a)(this,X),he=ve.call(this,"xhr-moz-chunked-loader"),he.TAG="MozChunkedLoader",he._seekHandler=ne,he._config=oe,he._needStash=!0,he._xhr=null,he._requestAbort=!1,he._contentLength=null,he._receivedLength=0,he}return Object(ie.a)(X,[{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),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){this._dataSource=oe,this._range=he;var Ae=oe.url;this._config.reuseRedirectedURL&&oe.redirectedURL!=null&&(Ae=oe.redirectedURL);var Qe=this._seekHandler.getConfig(Ae,he);this._requestURL=Qe.url;var ot=this._xhr=new XMLHttpRequest;if(ot.open("GET",Qe.url,!0),ot.responseType="moz-chunked-arraybuffer",ot.onreadystatechange=this._onReadyStateChange.bind(this),ot.onprogress=this._onProgress.bind(this),ot.onloadend=this._onLoadEnd.bind(this),ot.onerror=this._onXhrError.bind(this),oe.withCredentials&&(ot.withCredentials=!0),typeof Qe.headers=="object"){var Rt=Qe.headers;for(var Nt in Rt)Rt.hasOwnProperty(Nt)&&ot.setRequestHeader(Nt,Rt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Dt in ht)ht.hasOwnProperty(Dt)&&ot.setRequestHeader(Dt,ht[Dt])}this._status=a.kConnecting,ot.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.kComplete}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null&&he.responseURL!==this._requestURL&&this._onURLRedirect){var Ae=this._seekHandler.removeURLParameters(he.responseURL);this._onURLRedirect(Ae)}if(he.status!==0&&(he.status<200||he.status>299))if(this._status=a.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new n("MozChunkedLoader: Http code invalid, "+he.status+" "+he.statusText);else this._status=a.kBuffering}}},{key:"_onProgress",value:function(oe){if(this._status===a.kError)return;this._contentLength===null&&(oe.total!==null&&oe.total!==0&&(this._contentLength=oe.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var he=oe.target.response,Ae=this._range.from+this._receivedLength;this._receivedLength+=he.byteLength,this._onDataArrival&&this._onDataArrival(he,Ae,this._receivedLength)}},{key:"_onLoadEnd",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===a.kError)return;this._status=a.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(oe){this._status=a.kError;var he=0,Ae=null;if(this._contentLength&&oe.loaded<this._contentLength?(he=i.EARLY_EOF,Ae={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(he=i.EXCEPTION,Ae={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(he,Ae);else throw new n(Ae.msg)}}],[{key:"isSupported",value:function(){try{var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="moz-chunked-arraybuffer",oe.responseType==="moz-chunked-arraybuffer"}catch(he){return O.w("MozChunkedLoader",he.message),!1}}}]),X}(t),E=h,S=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne,oe){var he;return Object(ce.a)(this,X),he=ve.call(this,"xhr-msstream-loader"),he.TAG="MSStreamLoader",he._seekHandler=ne,he._config=oe,he._needStash=!0,he._xhr=null,he._reader=null,he._totalRange=null,he._currentRange=null,he._currentRequestURL=null,he._currentRedirectedURL=null,he._contentLength=null,he._receivedLength=0,he._bufferLimit=16*1024*1024,he._lastTimeBufferSize=0,he._isReconnecting=!1,he}return Object(ie.a)(X,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe,he){this._internalOpen(oe,he,!1)}},{key:"_internalOpen",value:function(oe,he,Ae){this._dataSource=oe,Ae?this._currentRange=he:this._totalRange=he;var Qe=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Qe=this._currentRedirectedURL:oe.redirectedURL!=null&&(Qe=oe.redirectedURL));var ot=this._seekHandler.getConfig(Qe,he);this._currentRequestURL=ot.url;var Rt=this._reader=new self.MSStreamReader;Rt.onprogress=this._msrOnProgress.bind(this),Rt.onload=this._msrOnLoad.bind(this),Rt.onerror=this._msrOnError.bind(this);var Nt=this._xhr=new XMLHttpRequest;if(Nt.open("GET",ot.url,!0),Nt.responseType="ms-stream",Nt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Nt.onerror=this._xhrOnError.bind(this),oe.withCredentials&&(Nt.withCredentials=!0),typeof ot.headers=="object"){var ht=ot.headers;for(var Dt in ht)ht.hasOwnProperty(Dt)&&Nt.setRequestHeader(Dt,ht[Dt])}if(typeof this._config.headers=="object"){var sn=this._config.headers;for(var Ct in sn)sn.hasOwnProperty(Ct)&&Nt.setRequestHeader(Ct,sn[Ct])}this._isReconnecting?this._isReconnecting=!1:this._status=a.kConnecting,Nt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=a.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2)if(he.status>=200&&he.status<=299){if(this._status=a.kBuffering,he.responseURL!=null){var Ae=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Ae!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ae,this._onURLRedirect&&this._onURLRedirect(Ae))}var Qe=he.getResponseHeader("Content-Length");if(Qe!=null&&this._contentLength==null){var ot=parseInt(Qe);ot>0&&(this._contentLength=ot,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=a.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new n("MSStreamLoader: Http code invalid, "+he.status+" "+he.statusText);else if(he.readyState===3&&(he.status>=200&&he.status<=299)){this._status=a.kBuffering;var Rt=he.response;this._reader.readAsArrayBuffer(Rt)}}},{key:"_xhrOnError",value:function(oe){this._status=a.kError;var he=i.EXCEPTION,Ae={code:-1,msg:oe.constructor.name+" "+oe.type};if(this._onError)this._onError(he,Ae);else throw new n(Ae.msg)}},{key:"_msrOnProgress",value:function(oe){var he=oe.target,Ae=he.result;if(Ae==null){this._doReconnectIfNeeded();return}var Qe=Ae.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=Ae.byteLength;var ot=this._totalRange.from+this._receivedLength;this._receivedLength+=Qe.byteLength,this._onDataArrival&&this._onDataArrival(Qe,ot,this._receivedLength),Ae.byteLength>=this._bufferLimit&&(O.v(this.TAG,"MSStream buffer exceeded max size near ".concat(ot+Qe.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var oe={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,oe,!0)}}},{key:"_msrOnLoad",value:function(oe){this._status=a.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(oe){this._status=a.kError;var he=0,Ae=null;if(this._contentLength&&this._receivedLength<this._contentLength?(he=i.EARLY_EOF,Ae={code:-1,msg:"MSStream meet Early-Eof"}):(he=i.EARLY_EOF,Ae={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(he,Ae);else throw new n(Ae.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="ms-stream",oe.responseType==="ms-stream"}catch(he){return O.w("MSStreamLoader",he.message),!1}}}]),X}(t),w=S,R=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(ne,oe){var he;return Object(ce.a)(this,X),he=ve.call(this,"xhr-range-loader"),he.TAG="RangeLoader",he._seekHandler=ne,he._config=oe,he._needStash=!1,he._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],he._currentChunkSizeKB=384,he._currentSpeedNormalized=0,he._zeroSpeedChunkCount=0,he._xhr=null,he._speedSampler=new p,he._requestAbort=!1,he._waitForTotalLength=!1,he._totalLengthReceived=!1,he._currentRequestURL=null,he._currentRedirectedURL=null,he._currentRequestRange=null,he._totalLength=null,he._contentLength=null,he._receivedLength=0,he._lastTimeLoaded=0,he}return Object(ie.a)(X,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(oe,he){this._dataSource=oe,this._range=he,this._status=a.kConnecting;var Ae=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(Ae=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!Ae?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var oe=this._currentChunkSizeKB*1024,he=this._range.from+this._receivedLength,Ae=he+oe;this._contentLength!=null&&(Ae-this._range.from>=this._contentLength&&(Ae=this._range.from+this._contentLength-1)),this._currentRequestRange={from:he,to:Ae},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(oe,he){this._lastTimeLoaded=0;var Ae=oe.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Ae=this._currentRedirectedURL:oe.redirectedURL!=null&&(Ae=oe.redirectedURL));var Qe=this._seekHandler.getConfig(Ae,he);this._currentRequestURL=Qe.url;var ot=this._xhr=new XMLHttpRequest;if(ot.open("GET",Qe.url,!0),ot.responseType="arraybuffer",ot.onreadystatechange=this._onReadyStateChange.bind(this),ot.onprogress=this._onProgress.bind(this),ot.onload=this._onLoad.bind(this),ot.onerror=this._onXhrError.bind(this),oe.withCredentials&&(ot.withCredentials=!0),typeof Qe.headers=="object"){var Rt=Qe.headers;for(var Nt in Rt)Rt.hasOwnProperty(Nt)&&ot.setRequestHeader(Nt,Rt[Nt])}if(typeof this._config.headers=="object"){var ht=this._config.headers;for(var Dt in ht)ht.hasOwnProperty(Dt)&&ot.setRequestHeader(Dt,ht[Dt])}ot.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=a.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(oe){var he=oe.target;if(he.readyState===2){if(he.responseURL!=null){var Ae=this._seekHandler.removeURLParameters(he.responseURL);he.responseURL!==this._currentRequestURL&&Ae!==this._currentRedirectedURL&&(this._currentRedirectedURL=Ae,this._onURLRedirect&&this._onURLRedirect(Ae))}if(he.status>=200&&he.status<=299){if(this._waitForTotalLength)return;this._status=a.kBuffering}else if(this._status=a.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:he.status,msg:he.statusText});else throw new n("RangeLoader: Http code invalid, "+he.status+" "+he.statusText)}}},{key:"_onProgress",value:function(oe){if(this._status===a.kError)return;if(this._contentLength===null){var he=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,he=!0;var Ae=oe.total;this._internalAbort(),Ae!=null&Ae!==0&&(this._totalLength=Ae)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,he){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Qe=oe.loaded-this._lastTimeLoaded;this._lastTimeLoaded=oe.loaded,this._speedSampler.addBytes(Qe)}},{key:"_normalizeSpeed",value:function(oe){var he=this._chunkSizeKBList,Ae=he.length-1,Qe=0,ot=0,Rt=Ae;if(oe<he[0])return he[0];for(;ot<=Rt;){if(Qe=ot+Math.floor((Rt-ot)/2),Qe===Ae||oe>=he[Qe]&&oe<he[Qe+1])return he[Qe];he[Qe]<oe?ot=Qe+1:Rt=Qe-1}}},{key:"_onLoad",value:function(oe){if(this._status===a.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var he=this._speedSampler.lastSecondKBps;if(he===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(he=this._speedSampler.currentKBps)),he!==0){var Ae=this._normalizeSpeed(he);this._currentSpeedNormalized!==Ae&&(this._currentSpeedNormalized=Ae,this._currentChunkSizeKB=Ae)}var Qe=oe.target.response,ot=this._range.from+this._receivedLength;this._receivedLength+=Qe.byteLength;var Rt=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():Rt=!0,this._onDataArrival&&this._onDataArrival(Qe,ot,this._receivedLength),Rt&&(this._status=a.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(oe){this._status=a.kError;var he=0,Ae=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(he=i.EARLY_EOF,Ae={code:-1,msg:"RangeLoader meet Early-Eof"}):(he=i.EXCEPTION,Ae={code:-1,msg:oe.constructor.name+" "+oe.type}),this._onError)this._onError(he,Ae);else throw new n(Ae.msg)}}],[{key:"isSupported",value:function(){try{var oe=new XMLHttpRequest;return oe.open("GET","https://example.com",!0),oe.responseType="arraybuffer",oe.responseType==="arraybuffer"}catch(he){return O.w("RangeLoader",he.message),!1}}}]),X}(t),N=R,F=function(Re){Object(c.a)(X,Re);var ve=Object(s.a)(X);function X(){var ne;return Object(ce.a)(this,X),ne=ve.call(this,"websocket-loader"),ne.TAG="WebSocketLoader",ne._needStash=!0,ne._ws=null,ne._requestAbort=!1,ne._receivedLength=0,ne}return Object(ie.a)(X,[{key:"destroy",value:function(){this._ws&&this.abort(),y(Object(d.a)(X.prototype),"destroy",this).call(this)}},{key:"open",value:function(oe){try{var he=this._ws=new self.WebSocket(oe.url);he.binaryType="arraybuffer",he.onopen=this._onWebSocketOpen.bind(this),he.onclose=this._onWebSocketClose.bind(this),he.onmessage=this._onWebSocketMessage.bind(this),he.onerror=this._onWebSocketError.bind(this),this._status=a.kConnecting}catch(Qe){this._status=a.kError;var Ae={code:Qe.code,msg:Qe.message};if(this._onError)this._onError(i.EXCEPTION,Ae);else throw new n(Ae.msg)}}},{key:"abort",value:function(){var oe=this._ws;oe&&(oe.readyState===0||oe.readyState===1)&&(this._requestAbort=!0,oe.close()),this._ws=null,this._status=a.kComplete}},{key:"_onWebSocketOpen",value:function(oe){this._status=a.kBuffering}},{key:"_onWebSocketClose",value:function(oe){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=a.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(oe){var he=this;if(oe.data instanceof ArrayBuffer)this._dispatchArrayBuffer(oe.data);else if(oe.data instanceof Blob){var Ae=new FileReader;Ae.onload=function(){he._dispatchArrayBuffer(Ae.result)},Ae.readAsArrayBuffer(oe.data)}else{this._status=a.kError;var Qe={code:-1,msg:"Unsupported WebSocket message type: "+oe.data.constructor.name};if(this._onError)this._onError(i.EXCEPTION,Qe);else throw new n(Qe.msg)}}},{key:"_dispatchArrayBuffer",value:function(oe){var he=oe,Ae=this._receivedLength;this._receivedLength+=he.byteLength,this._onDataArrival&&this._onDataArrival(he,Ae,this._receivedLength)}},{key:"_onWebSocketError",value:function(oe){this._status=a.kError;var he={code:oe.code,msg:oe.message};if(this._onError)this._onError(i.EXCEPTION,he);else throw new n(he.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(oe){return!1}}}]),X}(t),z=F,q=function(){function Re(ve){Object(ce.a)(this,Re),this._zeroStart=ve||!1}return Object(ie.a)(Re,[{key:"getConfig",value:function(X,ne){var oe={};if(ne.from!==0||ne.to!==-1){var he;ne.to!==-1?he="bytes=".concat(ne.from.toString(),"-").concat(ne.to.toString()):he="bytes=".concat(ne.from.toString(),"-"),oe.Range=he}else this._zeroStart&&(oe.Range="bytes=0-");return{url:X,headers:oe}}},{key:"removeURLParameters",value:function(X){return X}}]),Re}(),B=q,M=function(){function Re(ve,X){Object(ce.a)(this,Re),this._startName=ve,this._endName=X}return Object(ie.a)(Re,[{key:"getConfig",value:function(X,ne){var oe=X;if(ne.from!==0||ne.to!==-1){var he=!0;oe.indexOf("?")===-1&&(oe+="?",he=!1),he&&(oe+="&"),oe+="".concat(this._startName,"=").concat(ne.from.toString()),ne.to!==-1&&(oe+="&".concat(this._endName,"=").concat(ne.to.toString()))}return{url:oe,headers:{}}}},{key:"removeURLParameters",value:function(X){var ne=X.split("?")[0],oe=void 0,he=X.indexOf("?");he!==-1&&(oe=X.substring(he+1));var Ae="";if(oe!=null&&oe.length>0)for(var Qe=oe.split("&"),ot=0;ot<Qe.length;ot++){var Rt=Qe[ot].split("="),Nt=ot>0;Rt[0]!==this._startName&&Rt[0]!==this._endName&&(Nt&&(Ae+="&"),Ae+=Qe[ot])}return Ae.length===0?ne:ne+"?"+Ae}}]),Re}(),G=M,J=function(){function Re(ve,X,ne){Object(ce.a)(this,Re),this.TAG="IOController",this._config=X,this._extraData=ne,this._stashInitialSize=1024*384,X.stashInitialSize!=null&&X.stashInitialSize>0&&(this._stashInitialSize=X.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,X.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=ve,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(ve.url),this._refTotalLength=ve.filesize?ve.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(ie.a)(Re,[{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(X){this._extraData=X}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(X){this._onDataArrival=X}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(X){this._onSeeked=X}},{key:"onError",get:function(){return this._onError},set:function(X){this._onError=X}},{key:"onComplete",get:function(){return this._onComplete},set:function(X){this._onComplete=X}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(X){this._onRedirect=X}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(X){this._onRecoveredEarlyEof=X}},{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===N?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var X=this._config;if(X.seekType==="range")this._seekHandler=new B(this._config.rangeLoadZeroStart);else if(X.seekType==="param"){var ne=X.seekParamStart||"bstart",oe=X.seekParamEnd||"bend";this._seekHandler=new G(ne,oe)}else if(X.seekType==="custom"){if(typeof X.customSeekHandler!="function")throw new r("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new X.customSeekHandler}else throw new r("Invalid seekType in config: ".concat(X.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=z;else if(x.isSupported())this._loaderClass=x;else if(E.isSupported())this._loaderClass=E;else if(N.isSupported())this._loaderClass=N;else throw new n("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(X){this._currentRange={from:0,to:-1},X&&(this._currentRange.from=X),this._speedSampler.reset(),X||(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 X=this._resumeFrom;this._resumeFrom=0,this._internalSeek(X,!0)}}},{key:"seek",value:function(X){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(X,!0)}},{key:"_internalSeek",value:function(X,ne){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(ne),this._loader.destroy(),this._loader=null;var oe={from:X,to:-1};this._currentRange={from:oe.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,oe),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(X){if(!X||typeof X!="string"||X.length===0)throw new r("Url must be a non-empty string!");this._dataSource.url=X}},{key:"_expandBuffer",value:function(X){for(var ne=this._stashSize;ne+1024*1024*1<X;)ne*=2;if(ne+=1024*1024*1,ne===this._bufferSize)return;var oe=new ArrayBuffer(ne);if(this._stashUsed>0){var he=new Uint8Array(this._stashBuffer,0,this._stashUsed),Ae=new Uint8Array(oe,0,ne);Ae.set(he,0)}this._stashBuffer=oe,this._bufferSize=ne}},{key:"_normalizeSpeed",value:function(X){var ne=this._speedNormalizeList,oe=ne.length-1,he=0,Ae=0,Qe=oe;if(X<ne[0])return ne[0];for(;Ae<=Qe;){if(he=Ae+Math.floor((Qe-Ae)/2),he===oe||X>=ne[he]&&X<ne[he+1])return ne[he];ne[he]<X?Ae=he+1:Qe=he-1}}},{key:"_adjustStashSize",value:function(X){var ne=0;this._config.isLive||X<512?ne=X:X>=512&&X<=1024?ne=Math.floor(X*1.5):ne=X*2,ne>8192&&(ne=8192);var oe=ne*1024+1024*1024*1;this._bufferSize<oe&&this._expandBuffer(oe),this._stashSize=ne*1024}},{key:"_dispatchChunks",value:function(X,ne){return this._currentRange.to=ne+X.byteLength-1,this._onDataArrival(X,ne)}},{key:"_onURLRedirect",value:function(X){this._redirectedURL=X,this._onRedirect&&this._onRedirect(X)}},{key:"_onContentLengthKnown",value:function(X){X&&this._fullRequestFlag&&(this._totalLength=X,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(X,ne,oe){if(!this._onDataArrival)throw new o("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(X.byteLength);var he=this._speedSampler.lastSecondKBps;if(he!==0){var Ae=this._normalizeSpeed(he);this._speedNormalized!==Ae&&(this._speedNormalized=Ae,this._adjustStashSize(Ae))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=ne),this._stashUsed+X.byteLength<=this._stashSize){var sn=new Uint8Array(this._stashBuffer,0,this._stashSize);sn.set(new Uint8Array(X),this._stashUsed),this._stashUsed+=X.byteLength}else{var Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var hn=this._stashBuffer.slice(0,this._stashUsed),rn=this._dispatchChunks(hn,this._stashByteStart);if(rn<hn.byteLength){if(rn>0){var ae=new Uint8Array(hn,rn);Ct.set(ae,0),this._stashUsed=ae.byteLength,this._stashByteStart+=rn}}else this._stashUsed=0,this._stashByteStart+=rn;this._stashUsed+X.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+X.byteLength),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(X),this._stashUsed),this._stashUsed+=X.byteLength}else{var U=this._dispatchChunks(X,ne);if(U<X.byteLength){var H=X.byteLength-U;H>this._bufferSize&&(this._expandBuffer(H),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(X,U),0),this._stashUsed+=H,this._stashByteStart=ne+U}}}else if(this._stashUsed===0){var Qe=this._dispatchChunks(X,ne);if(Qe<X.byteLength){var ot=X.byteLength-Qe;ot>this._bufferSize&&this._expandBuffer(ot);var Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Rt.set(new Uint8Array(X,Qe),0),this._stashUsed+=ot,this._stashByteStart=ne+Qe}}else{this._stashUsed+X.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+X.byteLength);var Nt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Nt.set(new Uint8Array(X),this._stashUsed),this._stashUsed+=X.byteLength;var ht=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ht<this._stashUsed&&ht>0){var Dt=new Uint8Array(this._stashBuffer,ht);Nt.set(Dt,0)}this._stashUsed-=ht,this._stashByteStart+=ht}}},{key:"_flushStashBuffer",value:function(X){if(this._stashUsed>0){var ne=this._stashBuffer.slice(0,this._stashUsed),oe=this._dispatchChunks(ne,this._stashByteStart),he=ne.byteLength-oe;if(oe<ne.byteLength)if(X)O.w(this.TAG,"".concat(he," bytes unconsumed data remain when flush buffer, dropped"));else{if(oe>0){var Ae=new Uint8Array(this._stashBuffer,0,this._bufferSize),Qe=new Uint8Array(ne,oe);Ae.set(Qe,0),this._stashUsed=Qe.byteLength,this._stashByteStart+=oe}return 0}return this._stashUsed=0,this._stashByteStart=0,he}return 0}},{key:"_onLoaderComplete",value:function(X,ne){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(X,ne){O.e(this.TAG,"Loader error, code = ".concat(ne.code,", msg = ").concat(ne.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,X=i.UNRECOVERABLE_EARLY_EOF);switch(X){case i.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var oe=this._currentRange.to+1;oe<this._totalLength&&(O.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(oe,!1));return}X=i.UNRECOVERABLE_EARLY_EOF;break}case i.UNRECOVERABLE_EARLY_EOF:case i.CONNECTING_TIMEOUT:case i.HTTP_STATUS_CODE_INVALID:case i.EXCEPTION:break}if(this._onError)this._onError(X,ne);else throw new n("IOException: "+ne.msg)}}]),Re}(),K=J,Z={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function le(){return Object.assign({},Z)}var de=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var X=new K({},le()),ne=X.loaderType;return X.destroy(),ne=="fetch-stream-loader"||ne=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var X=new K({},le()),ne=X.loaderType;return X.destroy(),ne}},{key:"supportNativeMediaPlayback",value:function(X){Re.videoElement==null&&(Re.videoElement=window.document.createElement("video"));var ne=Re.videoElement.canPlayType(X);return ne==="probably"||ne=="maybe"}},{key:"getFeatureList",value:function(){var X={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return X.mseFlvPlayback=Re.supportMSEH264Playback(),X.networkStreamIO=Re.supportNetworkStreamIO(),X.networkLoaderName=Re.getNetworkLoaderTypeName(),X.mseLiveFlvPlayback=X.mseFlvPlayback&&X.networkStreamIO,X.nativeMP4H264Playback=Re.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),X.nativeWebmVP8Playback=Re.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),X.nativeWebmVP9Playback=Re.supportNativeMediaPlayback('video/webm; codecs="vp9"'),X}}]),Re}(),Te=de,we={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},Ie=we,_e=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"forceGlobalTag",get:function(){return O.FORCE_GLOBAL_TAG},set:function(X){O.FORCE_GLOBAL_TAG=X,Re._notifyChange()}},{key:"globalTag",get:function(){return O.GLOBAL_TAG},set:function(X){O.GLOBAL_TAG=X,Re._notifyChange()}},{key:"enableAll",get:function(){return O.ENABLE_VERBOSE&&O.ENABLE_DEBUG&&O.ENABLE_INFO&&O.ENABLE_WARN&&O.ENABLE_ERROR},set:function(X){O.ENABLE_VERBOSE=X,O.ENABLE_DEBUG=X,O.ENABLE_INFO=X,O.ENABLE_WARN=X,O.ENABLE_ERROR=X,Re._notifyChange()}},{key:"enableDebug",get:function(){return O.ENABLE_DEBUG},set:function(X){O.ENABLE_DEBUG=X,Re._notifyChange()}},{key:"enableVerbose",get:function(){return O.ENABLE_VERBOSE},set:function(X){O.ENABLE_VERBOSE=X,Re._notifyChange()}},{key:"enableInfo",get:function(){return O.ENABLE_INFO},set:function(X){O.ENABLE_INFO=X,Re._notifyChange()}},{key:"enableWarn",get:function(){return O.ENABLE_WARN},set:function(X){O.ENABLE_WARN=X,Re._notifyChange()}},{key:"enableError",get:function(){return O.ENABLE_ERROR},set:function(X){O.ENABLE_ERROR=X,Re._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:O.GLOBAL_TAG,forceGlobalTag:O.FORCE_GLOBAL_TAG,enableVerbose:O.ENABLE_VERBOSE,enableDebug:O.ENABLE_DEBUG,enableInfo:O.ENABLE_INFO,enableWarn:O.ENABLE_WARN,enableError:O.ENABLE_ERROR,enableCallback:O.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(X){O.GLOBAL_TAG=X.globalTag,O.FORCE_GLOBAL_TAG=X.forceGlobalTag,O.ENABLE_VERBOSE=X.enableVerbose,O.ENABLE_DEBUG=X.enableDebug,O.ENABLE_INFO=X.enableInfo,O.ENABLE_WARN=X.enableWarn,O.ENABLE_ERROR=X.enableError,O.ENABLE_CALLBACK=X.enableCallback}},{key:"_notifyChange",value:function(){var X=Re.emitter;if(X.listenerCount("change")>0){var ne=Re.getConfig();X.emit("change",ne)}}},{key:"registerListener",value:function(X){Re.emitter.addListener("change",X)}},{key:"removeListener",value:function(X){Re.emitter.removeListener("change",X)}},{key:"addLogListener",value:function(X){O.emitter.addListener("log",X),O.emitter.listenerCount("log")>0&&(O.ENABLE_CALLBACK=!0,Re._notifyChange())}},{key:"removeLogListener",value:function(X){O.emitter.removeListener("log",X),O.emitter.listenerCount("log")===0&&(O.ENABLE_CALLBACK=!1,Re._notifyChange())}}]),Re}();_e.emitter=new T.a;var ye=_e,Ke=function(){function Re(){Object(ce.a)(this,Re),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(ie.a)(Re,[{key:"isComplete",value:function(){var X=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,ne=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&&X&&ne}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(X){if(this.keyframesIndex==null)return null;var ne=this.keyframesIndex,oe=this._search(ne.times,X);return{index:oe,milliseconds:ne.times[oe],fileposition:ne.filepositions[oe]}}},{key:"_search",value:function(X,ne){var oe=0,he=X.length-1,Ae=0,Qe=0,ot=he;for(ne<X[0]&&(oe=0,Qe=ot+1);Qe<=ot;)if(Ae=Qe+Math.floor((ot-Qe)/2),Ae===he||ne>=X[Ae]&&ne<X[Ae+1]){oe=Ae;break}else X[Ae]<ne?Qe=Ae+1:ot=Ae-1;return oe}}]),Re}(),Me=Ke;function Fe(Re,ve,X){var ne=Re;if(ve+X<ne.length){for(;X--;)if((ne[++ve]&192)!==128)return!1;return!0}else return!1}function Ge(Re){for(var ve=[],X=Re,ne=0,oe=Re.length;ne<oe;){if(X[ne]<128){ve.push(String.fromCharCode(X[ne])),++ne;continue}else if(!(X[ne]<192)){if(X[ne]<224){if(Fe(X,ne,1)){var he=(X[ne]&31)<<6|X[ne+1]&63;if(he>=128){ve.push(String.fromCharCode(he&65535)),ne+=2;continue}}}else if(X[ne]<240){if(Fe(X,ne,2)){var Ae=(X[ne]&15)<<12|(X[ne+1]&63)<<6|X[ne+2]&63;if(Ae>=2048&&(Ae&63488)!==55296){ve.push(String.fromCharCode(Ae&65535)),ne+=3;continue}}}else if(X[ne]<248&&Fe(X,ne,3)){var Qe=(X[ne]&7)<<18|(X[ne+1]&63)<<12|(X[ne+2]&63)<<6|X[ne+3]&63;if(Qe>65536&&Qe<1114112){Qe-=65536,ve.push(String.fromCharCode(Qe>>>10|55296)),ve.push(String.fromCharCode(Qe&1023|56320)),ne+=4;continue}}}ve.push(String.fromCharCode(65533)),++ne}return ve.join("")}var Ee=Ge,me=function(){var Re=new ArrayBuffer(2);return new DataView(Re).setInt16(0,256,!0),new Int16Array(Re)[0]===256}(),We=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"parseScriptData",value:function(X,ne,oe){var he={};try{var Ae=Re.parseValue(X,ne,oe),Qe=Re.parseValue(X,ne+Ae.size,oe-Ae.size);he[Ae.data]=Qe.data}catch(ot){O.e("AMF",ot.toString())}return he}},{key:"parseObject",value:function(X,ne,oe){if(oe<3)throw new o("Data not enough when parse ScriptDataObject");var he=Re.parseString(X,ne,oe),Ae=Re.parseValue(X,ne+he.size,oe-he.size),Qe=Ae.objectEnd;return{data:{name:he.data,value:Ae.data},size:he.size+Ae.size,objectEnd:Qe}}},{key:"parseVariable",value:function(X,ne,oe){return Re.parseObject(X,ne,oe)}},{key:"parseString",value:function(X,ne,oe){if(oe<2)throw new o("Data not enough when parse String");var he=new DataView(X,ne,oe),Ae=he.getUint16(0,!me),Qe;return Ae>0?Qe=Ee(new Uint8Array(X,ne+2,Ae)):Qe="",{data:Qe,size:2+Ae}}},{key:"parseLongString",value:function(X,ne,oe){if(oe<4)throw new o("Data not enough when parse LongString");var he=new DataView(X,ne,oe),Ae=he.getUint32(0,!me),Qe;return Ae>0?Qe=Ee(new Uint8Array(X,ne+4,Ae)):Qe="",{data:Qe,size:4+Ae}}},{key:"parseDate",value:function(X,ne,oe){if(oe<10)throw new o("Data size invalid when parse Date");var he=new DataView(X,ne,oe),Ae=he.getFloat64(0,!me),Qe=he.getInt16(8,!me);return Ae+=Qe*60*1e3,{data:new Date(Ae),size:8+2}}},{key:"parseValue",value:function(X,ne,oe){if(oe<1)throw new o("Data not enough when parse Value");var he=new DataView(X,ne,oe),Ae=1,Qe=he.getUint8(0),ot,Rt=!1;try{switch(Qe){case 0:ot=he.getFloat64(1,!me),Ae+=8;break;case 1:{var Nt=he.getUint8(1);ot=!!Nt,Ae+=1;break}case 2:{var ht=Re.parseString(X,ne+1,oe-1);ot=ht.data,Ae+=ht.size;break}case 3:{ot={};var Dt=0;for((he.getUint32(oe-4,!me)&16777215)===9&&(Dt=3);Ae<oe-4;){var sn=Re.parseObject(X,ne+Ae,oe-Ae-Dt);if(sn.objectEnd)break;ot[sn.data.name]=sn.data.value,Ae+=sn.size}if(Ae<=oe-3){var Ct=he.getUint32(Ae-1,!me)&16777215;Ct===9&&(Ae+=3)}break}case 8:{ot={},Ae+=4;var hn=0;for((he.getUint32(oe-4,!me)&16777215)===9&&(hn=3);Ae<oe-8;){var rn=Re.parseVariable(X,ne+Ae,oe-Ae-hn);if(rn.objectEnd)break;ot[rn.data.name]=rn.data.value,Ae+=rn.size}if(Ae<=oe-3){var ae=he.getUint32(Ae-1,!me)&16777215;ae===9&&(Ae+=3)}break}case 9:ot=void 0,Ae=1,Rt=!0;break;case 10:{ot=[];var U=he.getUint32(1,!me);Ae+=4;for(var H=0;H<U;H++){var te=Re.parseValue(X,ne+Ae,oe-Ae);ot.push(te.data),Ae+=te.size}break}case 11:{var pe=Re.parseDate(X,ne+1,oe-1);ot=pe.data,Ae+=pe.size;break}case 12:{var se=Re.parseString(X,ne+1,oe-1);ot=se.data,Ae+=se.size;break}default:Ae=oe,O.w("AMF","Unsupported AMF value type "+Qe)}}catch($e){O.e("AMF",$e.toString())}return{data:ot,size:Ae,objectEnd:Rt}}}]),Re}(),He=We,it=function(){function Re(ve){Object(ce.a)(this,Re),this.TAG="ExpGolomb",this._buffer=ve,this._buffer_index=0,this._total_bytes=ve.byteLength,this._total_bits=ve.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var X=this._total_bytes-this._buffer_index;if(X<=0)throw new o("ExpGolomb: _fillCurrentWord() but no bytes available");var ne=Math.min(4,X),oe=new Uint8Array(4);oe.set(this._buffer.subarray(this._buffer_index,this._buffer_index+ne)),this._current_word=new DataView(oe.buffer).getUint32(0,!1),this._buffer_index+=ne,this._current_word_bits_left=ne*8}},{key:"readBits",value:function(X){if(X>32)throw new r("ExpGolomb: readBits() bits exceeded max 32bits!");if(X<=this._current_word_bits_left){var ne=this._current_word>>>32-X;return this._current_word<<=X,this._current_word_bits_left-=X,ne}var oe=this._current_word_bits_left?this._current_word:0;oe=oe>>>32-this._current_word_bits_left;var he=X-this._current_word_bits_left;this._fillCurrentWord();var Ae=Math.min(he,this._current_word_bits_left),Qe=this._current_word>>>32-Ae;return this._current_word<<=Ae,this._current_word_bits_left-=Ae,oe=oe<<Ae|Qe,oe}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var X;for(X=0;X<this._current_word_bits_left;X++)if((this._current_word&2147483648>>>X)!==0)return this._current_word<<=X,this._current_word_bits_left-=X,X;return this._fillCurrentWord(),X+this._skipLeadingZero()}},{key:"readUEG",value:function(){var X=this._skipLeadingZero();return this.readBits(X+1)-1}},{key:"readSEG",value:function(){var X=this.readUEG();return X&1?X+1>>>1:-1*(X>>>1)}}]),Re}(),re=it,P=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"_ebsp2rbsp",value:function(X){for(var ne=X,oe=ne.byteLength,he=new Uint8Array(oe),Ae=0,Qe=0;Qe<oe;Qe++){if(Qe>=2&&(ne[Qe]===3&&ne[Qe-1]===0&&ne[Qe-2]===0))continue;he[Ae]=ne[Qe],Ae++}return new Uint8Array(he.buffer,0,Ae)}},{key:"parseSPS",value:function(X){var ne=Re._ebsp2rbsp(X),oe=new re(ne);oe.readByte();var he=oe.readByte();oe.readByte();var Ae=oe.readByte();oe.readUEG();var Qe=Re.getProfileString(he),ot=Re.getLevelString(Ae),Rt=1,Nt=420,ht=[0,420,422,444],Dt=8;if((he===100||he===110||he===122||he===244||he===44||he===83||he===86||he===118||he===128||he===138||he===144)&&(Rt=oe.readUEG(),Rt===3&&oe.readBits(1),Rt<=3&&(Nt=ht[Rt]),Dt=oe.readUEG()+8,oe.readUEG(),oe.readBits(1),oe.readBool()))for(var sn=Rt!==3?8:12,Ct=0;Ct<sn;Ct++)oe.readBool()&&(Ct<6?Re._skipScalingList(oe,16):Re._skipScalingList(oe,64));oe.readUEG();var hn=oe.readUEG();if(hn===0)oe.readUEG();else if(hn===1){oe.readBits(1),oe.readSEG(),oe.readSEG();for(var rn=oe.readUEG(),ae=0;ae<rn;ae++)oe.readSEG()}var U=oe.readUEG();oe.readBits(1);var H=oe.readUEG(),te=oe.readUEG(),pe=oe.readBits(1);pe===0&&oe.readBits(1),oe.readBits(1);var se=0,$e=0,yt=0,Ot=0,Yt=oe.readBool();Yt&&(se=oe.readUEG(),$e=oe.readUEG(),yt=oe.readUEG(),Ot=oe.readUEG());var St=1,Wt=1,ln=0,Bn=!0,Oi=0,mi=0,Wn=oe.readBool();if(Wn){if(oe.readBool()){var di=oe.readByte(),hr=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],vi=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];di>0&&di<16?(St=hr[di-1],Wt=vi[di-1]):di===255&&(St=oe.readByte()<<8|oe.readByte(),Wt=oe.readByte()<<8|oe.readByte())}if(oe.readBool()&&oe.readBool(),oe.readBool()&&(oe.readBits(4),oe.readBool()&&oe.readBits(24)),oe.readBool()&&(oe.readUEG(),oe.readUEG()),oe.readBool()){var gi=oe.readBits(32),xi=oe.readBits(32);Bn=oe.readBool(),Oi=xi,mi=gi*2,ln=Oi/mi}}var Bi=1;(St!==1||Wt!==1)&&(Bi=St/Wt);var Ai=0,sr=0;if(Rt===0)Ai=1,sr=2-pe;else{var Di=Rt===3?1:2,fr=Rt===1?2:1;Ai=Di,sr=fr*(2-pe)}var lr=(H+1)*16,Wi=(2-pe)*((te+1)*16);lr-=(se+$e)*Ai,Wi-=(yt+Ot)*sr;var Gi=Math.ceil(lr*Bi);return oe.destroy(),oe=null,{profile_string:Qe,level_string:ot,bit_depth:Dt,ref_frames:U,chroma_format:Nt,chroma_format_string:Re.getChromaFormatString(Nt),frame_rate:{fixed:Bn,fps:ln,fps_den:mi,fps_num:Oi},sar_ratio:{width:St,height:Wt},codec_size:{width:lr,height:Wi},present_size:{width:Gi,height:Wi}}}},{key:"_skipScalingList",value:function(X,ne){for(var oe=8,he=8,Ae=0,Qe=0;Qe<ne;Qe++)he!==0&&(Ae=X.readSEG(),he=(oe+Ae+256)%256),oe=he===0?oe:he}},{key:"getProfileString",value:function(X){switch(X){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(X){return(X/10).toFixed(1)}},{key:"getChromaFormatString",value:function(X){switch(X){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),Re}(),j=P,ee={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},$=ee;function Q(Re){return Re>>>8&255|(Re&255)<<8}function xe(Re){return(Re&4278190080)>>>24|(Re&16711680)>>>8|(Re&65280)<<8|(Re&255)<<24}function De(Re,ve){return Re[ve]<<24|Re[ve+1]<<16|Re[ve+2]<<8|Re[ve+3]}var dt=function(){function Re(ve,X){Object(ce.a)(this,Re),this.TAG="FLVDemuxer",this._config=X,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=ve.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=ve.hasAudioTrack,this._hasVideo=ve.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Me,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 ne=new ArrayBuffer(2);return new DataView(ne).setInt16(0,256,!0),new Int16Array(ne)[0]===256}()}return Object(ie.a)(Re,[{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(X){return X.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(X){this._onTrackMetadata=X}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(X){this._onMediaInfo=X}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(X){this._onMetaDataArrived=X}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(X){this._onScriptDataArrived=X}},{key:"onError",get:function(){return this._onError},set:function(X){this._onError=X}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(X){this._onDataAvailable=X}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(X){this._timestampBase=X}},{key:"overridedDuration",get:function(){return this._duration},set:function(X){this._durationOverrided=!0,this._duration=X,this._mediaInfo.duration=X}},{key:"overridedHasAudio",set:function(X){this._hasAudioFlagOverrided=!0,this._hasAudio=X,this._mediaInfo.hasAudio=X}},{key:"overridedHasVideo",set:function(X){this._hasVideoFlagOverrided=!0,this._hasVideo=X,this._mediaInfo.hasVideo=X}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new Me}},{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(X,ne){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new o("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var oe=0,he=this._littleEndian;if(ne===0)if(X.byteLength>13){var Ae=Re.probe(X);oe=Ae.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,ne+oe!==this._dataOffset&&O.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Qe=new DataView(X,oe),ot=Qe.getUint32(0,!he);ot!==0&&O.w(this.TAG,"PrevTagSize0 !== 0 !!!"),oe+=4}for(;oe<X.byteLength;){this._dispatch=!0;var Rt=new DataView(X,oe);if(oe+11+4>X.byteLength)break;var Nt=Rt.getUint8(0),ht=Rt.getUint32(0,!he)&16777215;if(oe+11+ht+4>X.byteLength)break;if(Nt!==8&&Nt!==9&&Nt!==18){O.w(this.TAG,"Unsupported tag type ".concat(Nt,", skipped")),oe+=11+ht+4;continue}var Dt=Rt.getUint8(4),sn=Rt.getUint8(5),Ct=Rt.getUint8(6),hn=Rt.getUint8(7),rn=Ct|sn<<8|Dt<<16|hn<<24,ae=Rt.getUint32(7,!he)&16777215;ae!==0&&O.w(this.TAG,"Meet tag which has StreamID != 0!");var U=oe+11;switch(Nt){case 8:this._parseAudioData(X,U,ht,rn);break;case 9:this._parseVideoData(X,U,ht,rn,ne+oe);break;case 18:this._parseScriptData(X,U,ht);break}var H=Rt.getUint32(11+ht,!he);H!==11+ht&&O.w(this.TAG,"Invalid PrevTagSize ".concat(H)),oe+=11+ht+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),oe}},{key:"_parseScriptData",value:function(X,ne,oe){var he=He.parseScriptData(X,ne,oe);if(he.hasOwnProperty("onMetaData")){if(he.onMetaData==null||typeof he.onMetaData!="object"){O.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&O.w(this.TAG,"Found another onMetaData tag!"),this._metadata=he;var Ae=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},Ae)),typeof Ae.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=Ae.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof Ae.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=Ae.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof Ae.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=Ae.audiodatarate),typeof Ae.videodatarate=="number"&&(this._mediaInfo.videoDataRate=Ae.videodatarate),typeof Ae.width=="number"&&(this._mediaInfo.width=Ae.width),typeof Ae.height=="number"&&(this._mediaInfo.height=Ae.height),typeof Ae.duration=="number"){if(!this._durationOverrided){var Qe=Math.floor(Ae.duration*this._timescale);this._duration=Qe,this._mediaInfo.duration=Qe}}else this._mediaInfo.duration=0;if(typeof Ae.framerate=="number"){var ot=Math.floor(Ae.framerate*1e3);if(ot>0){var Rt=ot/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Rt,this._referenceFrameRate.fps_num=ot,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Rt}}if(typeof Ae.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Nt=Ae.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Nt),Ae.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=Ae,O.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(he).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},he)))}},{key:"_parseKeyframesIndex",value:function(X){for(var ne=[],oe=[],he=1;he<X.times.length;he++){var Ae=this._timestampBase+Math.floor(X.times[he]*1e3);ne.push(Ae),oe.push(X.filepositions[he])}return{times:ne,filepositions:oe}}},{key:"_parseAudioData",value:function(X,ne,oe,he){if(oe<=1){O.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var Ae=this._littleEndian,Qe=new DataView(X,ne,oe),ot=Qe.getUint8(0),Rt=ot>>>4;if(Rt!==2&&Rt!==10){this._onError($.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Rt);return}var Nt=0,ht=(ot&12)>>>2;if(ht>=0&&ht<=4)Nt=this._flvSoundRateTable[ht];else{this._onError($.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ht);return}var Dt=(ot&2)>>>1,sn=ot&1,Ct=this._audioMetadata,hn=this._audioTrack;if(Ct||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ct=this._audioMetadata={},Ct.type="audio",Ct.id=hn.id,Ct.timescale=this._timescale,Ct.duration=this._duration,Ct.audioSampleRate=Nt,Ct.channelCount=sn===0?1:2),Rt===10){var rn=this._parseAACAudioData(X,ne+1,oe-1);if(rn==null)return;if(rn.packetType===0){Ct.config&&O.w(this.TAG,"Found another AudioSpecificConfig!");var ae=rn.data;Ct.audioSampleRate=ae.samplingRate,Ct.channelCount=ae.channelCount,Ct.codec=ae.codec,Ct.originalCodec=ae.originalCodec,Ct.config=ae.config,Ct.refSampleDuration=1024/Ct.audioSampleRate*Ct.timescale,O.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",Ct);var U=this._mediaInfo;U.audioCodec=Ct.originalCodec,U.audioSampleRate=Ct.audioSampleRate,U.audioChannelCount=Ct.channelCount,U.hasVideo?U.videoCodec!=null&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.audioCodec+'"',U.isComplete()&&this._onMediaInfo(U)}else if(rn.packetType===1){var H=this._timestampBase+he,te={unit:rn.data,length:rn.data.byteLength,dts:H,pts:H};hn.samples.push(te),hn.length+=rn.data.length}else O.e(this.TAG,"Flv: Unsupported AAC data type ".concat(rn.packetType))}else if(Rt===2){if(!Ct.codec){var pe=this._parseMP3AudioData(X,ne+1,oe-1,!0);if(pe==null)return;Ct.audioSampleRate=pe.samplingRate,Ct.channelCount=pe.channelCount,Ct.codec=pe.codec,Ct.originalCodec=pe.originalCodec,Ct.refSampleDuration=1152/Ct.audioSampleRate*Ct.timescale,O.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ct);var se=this._mediaInfo;se.audioCodec=Ct.codec,se.audioSampleRate=Ct.audioSampleRate,se.audioChannelCount=Ct.channelCount,se.audioDataRate=pe.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var $e=this._parseMP3AudioData(X,ne+1,oe-1,!1);if($e==null)return;var yt=this._timestampBase+he,Ot={unit:$e,length:$e.byteLength,dts:yt,pts:yt};hn.samples.push(Ot),hn.length+=$e.length}}},{key:"_parseAACAudioData",value:function(X,ne,oe){if(oe<=1){O.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var he={},Ae=new Uint8Array(X,ne,oe);return he.packetType=Ae[0],Ae[0]===0?he.data=this._parseAACAudioSpecificConfig(X,ne+1,oe-1):he.data=Ae.subarray(1),he}},{key:"_parseAACAudioSpecificConfig",value:function(X,ne,oe){var he=new Uint8Array(X,ne,oe),Ae=null,Qe=0,ot=0,Rt=null,Nt=0,ht=null;if(Qe=ot=he[0]>>>3,Nt=(he[0]&7)<<1|he[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError($.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var Dt=this._mpegSamplingRates[Nt],sn=(he[1]&120)>>>3;if(sn<0||sn>=8){this._onError($.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Qe===5&&(ht=(he[1]&7)<<1|he[2]>>>7,Rt=(he[2]&124)>>>2);var Ct=self.navigator.userAgent.toLowerCase();return Ct.indexOf("firefox")!==-1?Nt>=6?(Qe=5,Ae=new Array(4),ht=Nt-3):(Qe=2,Ae=new Array(2),ht=Nt):Ct.indexOf("android")!==-1?(Qe=2,Ae=new Array(2),ht=Nt):(Qe=5,ht=Nt,Ae=new Array(4),Nt>=6?ht=Nt-3:sn===1&&(Qe=2,Ae=new Array(2),ht=Nt)),Ae[0]=Qe<<3,Ae[0]|=(Nt&15)>>>1,Ae[1]=(Nt&15)<<7,Ae[1]|=(sn&15)<<3,Qe===5&&(Ae[1]|=(ht&15)>>>1,Ae[2]=(ht&1)<<7,Ae[2]|=2<<2,Ae[3]=0),{config:Ae,samplingRate:Dt,channelCount:sn,codec:"mp4a.40."+Qe,originalCodec:"mp4a.40."+ot}}},{key:"_parseMP3AudioData",value:function(X,ne,oe,he){if(oe<4){O.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var Ae=this._littleEndian,Qe=new Uint8Array(X,ne,oe),ot=null;if(he){if(Qe[0]!==255)return;var Rt=Qe[1]>>>3&3,Nt=(Qe[1]&6)>>1,ht=(Qe[2]&240)>>>4,Dt=(Qe[2]&12)>>>2,sn=Qe[3]>>>6&3,Ct=sn!==3?2:1,hn=0,rn=0,ae=34,U="mp3";switch(Rt){case 0:hn=this._mpegAudioV25SampleRateTable[Dt];break;case 2:hn=this._mpegAudioV20SampleRateTable[Dt];break;case 3:hn=this._mpegAudioV10SampleRateTable[Dt];break}switch(Nt){case 1:ae=34,ht<this._mpegAudioL3BitRateTable.length&&(rn=this._mpegAudioL3BitRateTable[ht]);break;case 2:ae=33,ht<this._mpegAudioL2BitRateTable.length&&(rn=this._mpegAudioL2BitRateTable[ht]);break;case 3:ae=32,ht<this._mpegAudioL1BitRateTable.length&&(rn=this._mpegAudioL1BitRateTable[ht]);break}ot={bitRate:rn,samplingRate:hn,channelCount:Ct,codec:U,originalCodec:U}}else ot=Qe;return ot}},{key:"_parseVideoData",value:function(X,ne,oe,he,Ae){if(oe<=1){O.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Qe=new Uint8Array(X,ne,oe)[0],ot=(Qe&240)>>>4,Rt=Qe&15;if(Rt!==7){this._onError($.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Rt));return}this._parseAVCVideoPacket(X,ne+1,oe-1,he,Ae,ot)}},{key:"_parseAVCVideoPacket",value:function(X,ne,oe,he,Ae,Qe){if(oe<4){O.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var ot=this._littleEndian,Rt=new DataView(X,ne,oe),Nt=Rt.getUint8(0),ht=Rt.getUint32(0,!ot)&16777215,Dt=ht<<8>>8;if(Nt===0)this._parseAVCDecoderConfigurationRecord(X,ne+4,oe-4);else if(Nt===1)this._parseAVCVideoData(X,ne+4,oe-4,he,Ae,Qe,Dt);else if(!(Nt===2)){this._onError($.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Nt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(X,ne,oe){if(oe<7){O.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var he=this._videoMetadata,Ae=this._videoTrack,Qe=this._littleEndian,ot=new DataView(X,ne,oe);he?typeof he.avcc!="undefined"&&O.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),he=this._videoMetadata={},he.type="video",he.id=Ae.id,he.timescale=this._timescale,he.duration=this._duration);var Rt=ot.getUint8(0),Nt=ot.getUint8(1),ht=ot.getUint8(2),Dt=ot.getUint8(3);if(Rt!==1||Nt===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(ot.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError($.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var sn=ot.getUint8(5)&31;if(sn===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else sn>1&&O.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(sn));for(var Ct=6,hn=0;hn<sn;hn++){var rn=ot.getUint16(Ct,!Qe);if(Ct+=2,rn===0)continue;var ae=new Uint8Array(X,ne+Ct,rn);Ct+=rn;var U=j.parseSPS(ae);if(hn!==0)continue;he.codecWidth=U.codec_size.width,he.codecHeight=U.codec_size.height,he.presentWidth=U.present_size.width,he.presentHeight=U.present_size.height,he.profile=U.profile_string,he.level=U.level_string,he.bitDepth=U.bit_depth,he.chromaFormat=U.chroma_format,he.sarRatio=U.sar_ratio,he.frameRate=U.frame_rate,(U.frame_rate.fixed===!1||U.frame_rate.fps_num===0||U.frame_rate.fps_den===0)&&(he.frameRate=this._referenceFrameRate);var H=he.frameRate.fps_den,te=he.frameRate.fps_num;he.refSampleDuration=he.timescale*(H/te);for(var pe=ae.subarray(1,4),se="avc1.",$e=0;$e<3;$e++){var yt=pe[$e].toString(16);yt.length<2&&(yt="0"+yt),se+=yt}he.codec=se;var Ot=this._mediaInfo;Ot.width=he.codecWidth,Ot.height=he.codecHeight,Ot.fps=he.frameRate.fps,Ot.profile=he.profile,Ot.level=he.level,Ot.refFrames=U.ref_frames,Ot.chromaFormat=U.chroma_format_string,Ot.sarNum=he.sarRatio.width,Ot.sarDen=he.sarRatio.height,Ot.videoCodec=se,Ot.hasAudio?Ot.audioCodec!=null&&(Ot.mimeType='video/x-flv; codecs="'+Ot.videoCodec+","+Ot.audioCodec+'"'):Ot.mimeType='video/x-flv; codecs="'+Ot.videoCodec+'"',Ot.isComplete()&&this._onMediaInfo(Ot)}var Yt=ot.getUint8(Ct);if(Yt===0){this._onError($.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Yt>1&&O.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Yt));Ct++;for(var St=0;St<Yt;St++){var Wt=ot.getUint16(Ct,!Qe);if(Ct+=2,Wt===0)continue;Ct+=Wt}he.avcc=new Uint8Array(oe),he.avcc.set(new Uint8Array(X,ne,oe),0),O.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",he)}},{key:"_parseAVCVideoData",value:function(X,ne,oe,he,Ae,Qe,ot){for(var Rt=this._littleEndian,Nt=new DataView(X,ne,oe),ht=[],Dt=0,sn=0,Ct=this._naluLengthSize,hn=this._timestampBase+he,rn=Qe===1;sn<oe;){if(sn+4>=oe){O.w(this.TAG,"Malformed Nalu near timestamp ".concat(hn,", offset = ").concat(sn,", dataSize = ").concat(oe));break}var ae=Nt.getUint32(sn,!Rt);if(Ct===3&&(ae>>>=8),ae>oe-Ct){O.w(this.TAG,"Malformed Nalus near timestamp ".concat(hn,", NaluSize > DataSize!"));return}var U=Nt.getUint8(sn+Ct)&31;U===5&&(rn=!0);var H=new Uint8Array(X,ne+sn,Ct+ae),te={type:U,data:H};ht.push(te),Dt+=H.byteLength,sn+=Ct+ae}if(ht.length){var pe=this._videoTrack,se={units:ht,length:Dt,isKeyframe:rn,dts:hn,cts:ot,pts:hn+ot};rn&&(se.fileposition=Ae),pe.samples.push(se),pe.length+=Dt}}}],[{key:"probe",value:function(X){var ne=new Uint8Array(X),oe={match:!1};if(ne[0]!==70||ne[1]!==76||ne[2]!==86||ne[3]!==1)return oe;var he=(ne[4]&4)>>>2!==0,Ae=(ne[4]&1)!==0,Qe=De(ne,5);return Qe<9?oe:{match:!0,consumed:Qe,dataOffset:Qe,hasAudioTrack:he,hasVideoTrack:Ae}}}]),Re}(),Ne=dt,Be=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"init",value:function(){Re.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 X in Re.types)Re.types.hasOwnProperty(X)&&(Re.types[X]=[X.charCodeAt(0),X.charCodeAt(1),X.charCodeAt(2),X.charCodeAt(3)]);var ne=Re.constants={};ne.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),ne.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),ne.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),ne.STSC=ne.STCO=ne.STTS,ne.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ne.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]),ne.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]),ne.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ne.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ne.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(X){for(var ne=8,oe=null,he=Array.prototype.slice.call(arguments,1),Ae=he.length,Qe=0;Qe<Ae;Qe++)ne+=he[Qe].byteLength;oe=new Uint8Array(ne),oe[0]=ne>>>24&255,oe[1]=ne>>>16&255,oe[2]=ne>>>8&255,oe[3]=ne&255,oe.set(X,4);for(var ot=8,Rt=0;Rt<Ae;Rt++)oe.set(he[Rt],ot),ot+=he[Rt].byteLength;return oe}},{key:"generateInitSegment",value:function(X){var ne=Re.box(Re.types.ftyp,Re.constants.FTYP),oe=Re.moov(X),he=new Uint8Array(ne.byteLength+oe.byteLength);return he.set(ne,0),he.set(oe,ne.byteLength),he}},{key:"moov",value:function(X){var ne=Re.mvhd(X.timescale,X.duration),oe=Re.trak(X),he=Re.mvex(X);return Re.box(Re.types.moov,ne,oe,he)}},{key:"mvhd",value:function(X,ne){return Re.box(Re.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&255,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&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(X){return Re.box(Re.types.trak,Re.tkhd(X),Re.mdia(X))}},{key:"tkhd",value:function(X){var ne=X.id,oe=X.duration,he=X.presentWidth,Ae=X.presentHeight;return Re.box(Re.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,he>>>8&255,he&255,0,0,Ae>>>8&255,Ae&255,0,0]))}},{key:"mdia",value:function(X){return Re.box(Re.types.mdia,Re.mdhd(X),Re.hdlr(X),Re.minf(X))}},{key:"mdhd",value:function(X){var ne=X.timescale,oe=X.duration;return Re.box(Re.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255,85,196,0,0]))}},{key:"hdlr",value:function(X){var ne=null;return X.type==="audio"?ne=Re.constants.HDLR_AUDIO:ne=Re.constants.HDLR_VIDEO,Re.box(Re.types.hdlr,ne)}},{key:"minf",value:function(X){var ne=null;return X.type==="audio"?ne=Re.box(Re.types.smhd,Re.constants.SMHD):ne=Re.box(Re.types.vmhd,Re.constants.VMHD),Re.box(Re.types.minf,ne,Re.dinf(),Re.stbl(X))}},{key:"dinf",value:function(){var X=Re.box(Re.types.dinf,Re.box(Re.types.dref,Re.constants.DREF));return X}},{key:"stbl",value:function(X){var ne=Re.box(Re.types.stbl,Re.stsd(X),Re.box(Re.types.stts,Re.constants.STTS),Re.box(Re.types.stsc,Re.constants.STSC),Re.box(Re.types.stsz,Re.constants.STSZ),Re.box(Re.types.stco,Re.constants.STCO));return ne}},{key:"stsd",value:function(X){return X.type==="audio"?X.codec==="mp3"?Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp3(X)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.mp4a(X)):Re.box(Re.types.stsd,Re.constants.STSD_PREFIX,Re.avc1(X))}},{key:"mp3",value:function(X){var ne=X.channelCount,oe=X.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,ne,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types[".mp3"],he)}},{key:"mp4a",value:function(X){var ne=X.channelCount,oe=X.audioSampleRate,he=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,ne,0,16,0,0,0,0,oe>>>8&255,oe&255,0,0]);return Re.box(Re.types.mp4a,he,Re.esds(X))}},{key:"esds",value:function(X){var ne=X.config||[],oe=ne.length,he=new Uint8Array([0,0,0,0,3,23+oe,0,1,0,4,15+oe,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([oe]).concat(ne).concat([6,1,2]));return Re.box(Re.types.esds,he)}},{key:"avc1",value:function(X){var ne=X.avcc,oe=X.codecWidth,he=X.codecHeight,Ae=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,oe>>>8&255,oe&255,he>>>8&255,he&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 Re.box(Re.types.avc1,Ae,Re.box(Re.types.avcC,ne))}},{key:"mvex",value:function(X){return Re.box(Re.types.mvex,Re.trex(X))}},{key:"trex",value:function(X){var ne=X.id,oe=new Uint8Array([0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return Re.box(Re.types.trex,oe)}},{key:"moof",value:function(X,ne){return Re.box(Re.types.moof,Re.mfhd(X.sequenceNumber),Re.traf(X,ne))}},{key:"mfhd",value:function(X){var ne=new Uint8Array([0,0,0,0,X>>>24&255,X>>>16&255,X>>>8&255,X&255]);return Re.box(Re.types.mfhd,ne)}},{key:"traf",value:function(X,ne){var oe=X.id,he=Re.box(Re.types.tfhd,new Uint8Array([0,0,0,0,oe>>>24&255,oe>>>16&255,oe>>>8&255,oe&255])),Ae=Re.box(Re.types.tfdt,new Uint8Array([0,0,0,0,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255])),Qe=Re.sdtp(X),ot=Re.trun(X,Qe.byteLength+16+16+8+16+8+8);return Re.box(Re.types.traf,he,Ae,ot,Qe)}},{key:"sdtp",value:function(X){for(var ne=X.samples||[],oe=ne.length,he=new Uint8Array(4+oe),Ae=0;Ae<oe;Ae++){var Qe=ne[Ae].flags;he[Ae+4]=Qe.isLeading<<6|Qe.dependsOn<<4|Qe.isDependedOn<<2|Qe.hasRedundancy}return Re.box(Re.types.sdtp,he)}},{key:"trun",value:function(X,ne){var oe=X.samples||[],he=oe.length,Ae=12+16*he,Qe=new Uint8Array(Ae);ne+=8+Ae,Qe.set([0,0,15,1,he>>>24&255,he>>>16&255,he>>>8&255,he&255,ne>>>24&255,ne>>>16&255,ne>>>8&255,ne&255],0);for(var ot=0;ot<he;ot++){var Rt=oe[ot].duration,Nt=oe[ot].size,ht=oe[ot].flags,Dt=oe[ot].cts;Qe.set([Rt>>>24&255,Rt>>>16&255,Rt>>>8&255,Rt&255,Nt>>>24&255,Nt>>>16&255,Nt>>>8&255,Nt&255,ht.isLeading<<2|ht.dependsOn,ht.isDependedOn<<6|ht.hasRedundancy<<4|ht.isNonSync,0,0,Dt>>>24&255,Dt>>>16&255,Dt>>>8&255,Dt&255],12+16*ot)}return Re.box(Re.types.trun,Qe)}},{key:"mdat",value:function(X){return Re.box(Re.types.mdat,X)}}]),Re}();Be.init();var tt=Be,lt=function(){function Re(){Object(ce.a)(this,Re)}return Object(ie.a)(Re,null,[{key:"getSilentFrame",value:function(X,ne){if(X==="mp4a.40.2"){if(ne===1)return new Uint8Array([0,200,0,128,35,128]);if(ne===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(ne===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(ne===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(ne===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(ne===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(ne===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(ne===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(ne===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}}]),Re}(),qe=lt,Ye=function Re(ve,X,ne,oe,he){Object(ce.a)(this,Re),this.dts=ve,this.pts=X,this.duration=ne,this.originalDts=oe,this.isSyncPoint=he,this.fileposition=null},je=function(){function Re(){Object(ce.a)(this,Re),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(ie.a)(Re,[{key:"appendSyncPoint",value:function(X){X.isSyncPoint=!0,this.syncPoints.push(X)}}]),Re}(),Ue=function(){function Re(){Object(ce.a)(this,Re),this._list=[]}return Object(ie.a)(Re,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(X){var ne=this._list;if(X.length===0)return;ne.length>0&&X[0].originalDts<ne[ne.length-1].originalDts&&this.clear(),Array.prototype.push.apply(ne,X)}},{key:"getLastSyncPointBeforeDts",value:function(X){if(this._list.length==0)return null;var ne=this._list,oe=0,he=ne.length-1,Ae=0,Qe=0,ot=he;for(X<ne[0].dts&&(oe=0,Qe=ot+1);Qe<=ot;)if(Ae=Qe+Math.floor((ot-Qe)/2),Ae===he||X>=ne[Ae].dts&&X<ne[Ae+1].dts){oe=Ae;break}else ne[Ae].dts<X?Qe=Ae+1:ot=Ae-1;return this._list[oe]}}]),Re}(),ke=function(){function Re(ve){Object(ce.a)(this,Re),this._type=ve,this._list=[],this._lastAppendLocation=-1}return Object(ie.a)(Re,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(X){var ne=this._list;if(ne.length===0)return-2;var oe=ne.length-1,he=0,Ae=0,Qe=oe,ot=0;if(X<ne[0].originalBeginDts)return ot=-1,ot;for(;Ae<=Qe;)if(he=Ae+Math.floor((Qe-Ae)/2),he===oe||X>ne[he].lastSample.originalDts&&X<ne[he+1].originalBeginDts){ot=he;break}else ne[he].originalBeginDts<X?Ae=he+1:Qe=he-1;return ot}},{key:"_searchNearestSegmentAfter",value:function(X){return this._searchNearestSegmentBefore(X)+1}},{key:"append",value:function(X){var ne=this._list,oe=X,he=this._lastAppendLocation,Ae=0;he!==-1&&he<ne.length&&oe.originalBeginDts>=ne[he].lastSample.originalDts&&(he===ne.length-1||he<ne.length-1&&oe.originalBeginDts<ne[he+1].originalBeginDts)?Ae=he+1:ne.length>0&&(Ae=this._searchNearestSegmentBefore(oe.originalBeginDts)+1),this._lastAppendLocation=Ae,this._list.splice(Ae,0,oe)}},{key:"getLastSegmentBefore",value:function(X){var ne=this._searchNearestSegmentBefore(X);return ne>=0?this._list[ne]:null}},{key:"getLastSampleBefore",value:function(X){var ne=this.getLastSegmentBefore(X);return ne!=null?ne.lastSample:null}},{key:"getLastSyncPointBefore",value:function(X){for(var ne=this._searchNearestSegmentBefore(X),oe=this._list[ne].syncPoints;oe.length===0&&ne>0;)ne--,oe=this._list[ne].syncPoints;return oe.length>0?oe[oe.length-1]:null}}]),Re}(),be=function(){function Re(ve){Object(ce.a)(this,Re),this.TAG="MP4Remuxer",this._config=ve,this._isLive=ve.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 ke("audio"),this._videoSegmentInfoList=new ke("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(ie.a)(Re,[{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(X){return X.onDataAvailable=this.remux.bind(this),X.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(X){this._onInitSegment=X}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(X){this._onMediaSegment=X}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(X){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(X,ne){if(!this._onMediaSegment)throw new o("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(X,ne),this._remuxVideo(ne),this._remuxAudio(X)}},{key:"_onTrackMetadataReceived",value:function(X,ne){var oe=null,he="mp4",Ae=ne.codec;if(X==="audio")this._audioMeta=ne,ne.codec==="mp3"&&this._mp3UseMpegAudio?(he="mpeg",Ae="",oe=new Uint8Array):oe=tt.generateInitSegment(ne);else if(X==="video")this._videoMeta=ne,oe=tt.generateInitSegment(ne);else return;if(!this._onInitSegment)throw new o("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(X,{type:X,data:oe.buffer,codec:Ae,container:"".concat(X,"/").concat(he),mediaDuration:ne.duration})}},{key:"_calculateDtsBase",value:function(X,ne){if(this._dtsBaseInited)return;X.samples&&X.samples.length&&(this._audioDtsBase=X.samples[0].dts),ne.samples&&ne.samples.length&&(this._videoDtsBase=ne.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var X=this._videoStashedLastSample,ne=this._audioStashedLastSample,oe={type:"video",id:1,sequenceNumber:0,samples:[],length:0};X!=null&&(oe.samples.push(X),oe.length=X.length);var he={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};ne!=null&&(he.samples.push(ne),he.length=ne.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(oe,!0),this._remuxAudio(he,!0)}},{key:"_remuxAudio",value:function(X,ne){if(this._audioMeta==null)return;var oe=X,he=oe.samples,Ae=void 0,Qe=-1,ot=-1,Rt=-1,Nt=this._audioMeta.refSampleDuration,ht=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Dt=this._dtsBaseInited&&this._audioNextDts===void 0,sn=!1;if(!he||he.length===0)return;if(he.length===1&&!ne)return;var Ct=0,hn=null,rn=0;ht?(Ct=0,rn=oe.length):(Ct=8,rn=8+oe.length);var ae=null;if(he.length>1&&(ae=he.pop(),rn-=ae.length),this._audioStashedLastSample!=null){var U=this._audioStashedLastSample;this._audioStashedLastSample=null,he.unshift(U),rn+=U.length}ae!=null&&(this._audioStashedLastSample=ae);var H=he[0].dts-this._dtsBase;if(this._audioNextDts)Ae=H-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())Ae=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(sn=!0));else{var te=this._audioSegmentInfoList.getLastSampleBefore(H);if(te!=null){var pe=H-(te.originalDts+te.duration);pe<=3&&(pe=0);var se=te.dts+te.duration+pe;Ae=H-se}else Ae=0}if(sn){var $e=H-Ae,yt=this._videoSegmentInfoList.getLastSegmentBefore(H);if(yt!=null&&yt.beginDts<$e){var Ot=qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Ot){var Yt=yt.beginDts,St=$e-yt.beginDts;O.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Yt,", duration: ").concat(St)),he.unshift({unit:Ot,dts:Yt,pts:Yt}),rn+=Ot.byteLength}}else sn=!1}for(var Wt=[],ln=0;ln<he.length;ln++){var Bn=he[ln],Oi=Bn.unit,mi=Bn.dts-this._dtsBase,Wn=mi-Ae;Qe===-1&&(Qe=Wn);var di=0;if(ln!==he.length-1){var hr=he[ln+1].dts-this._dtsBase-Ae;di=hr-Wn}else if(ae!=null){var vi=ae.dts-this._dtsBase-Ae;di=vi-Wn}else Wt.length>=1?di=Wt[Wt.length-1].duration:di=Math.floor(Nt);var gi=!1,xi=null;if(di>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!m.safari){gi=!0;var Bi=Math.abs(di-Nt),Ai=Math.ceil(Bi/Nt),sr=Wn+Nt;O.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
|
`+"dts: ".concat(Wn+di," ms, expected: ").concat(Wn+Math.round(Nt)," ms, ")+"delta: ".concat(Math.round(Bi)," ms, generate: ").concat(Ai," frames"));var Di=qe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Di==null&&(O.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Di=Oi),xi=[];for(var fr=0;fr<Ai;fr++){var lr=Math.round(sr);if(xi.length>0){var Wi=xi[xi.length-1];Wi.duration=lr-Wi.dts}var Gi={dts:lr,pts:lr,cts:0,unit:Di,size:Di.byteLength,duration:0,originalDts:mi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};xi.push(Gi),rn+=Gi.size,sr+=Nt}var vr=xi[xi.length-1];vr.duration=Wn+di-vr.dts,di=Math.round(Nt)}Wt.push({dts:Wn,pts:Wn,cts:0,unit:Bn.unit,size:Bn.unit.byteLength,duration:di,originalDts:mi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),gi&&Wt.push.apply(Wt,xi)}ht?hn=new Uint8Array(rn):(hn=new Uint8Array(rn),hn[0]=rn>>>24&255,hn[1]=rn>>>16&255,hn[2]=rn>>>8&255,hn[3]=rn&255,hn.set(tt.types.mdat,4));for(var Rr=0;Rr<Wt.length;Rr++){var ur=Wt[Rr].unit;hn.set(ur,Ct),Ct+=ur.byteLength}var Hn=Wt[Wt.length-1];ot=Hn.dts+Hn.duration,this._audioNextDts=ot;var wn=new je;wn.beginDts=Qe,wn.endDts=ot,wn.beginPts=Qe,wn.endPts=ot,wn.originalBeginDts=Wt[0].originalDts,wn.originalEndDts=Hn.originalDts+Hn.duration,wn.firstSample=new Ye(Wt[0].dts,Wt[0].pts,Wt[0].duration,Wt[0].originalDts,!1),wn.lastSample=new Ye(Hn.dts,Hn.pts,Hn.duration,Hn.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(wn),oe.samples=Wt,oe.sequenceNumber++;var wi=null;ht?wi=new Uint8Array:wi=tt.moof(oe,Qe),oe.samples=[],oe.length=0;var Mn={type:"audio",data:this._mergeBoxes(wi,hn).buffer,sampleCount:Wt.length,info:wn};ht&&Dt&&(Mn.timestampOffset=Qe),this._onMediaSegment("audio",Mn)}},{key:"_remuxVideo",value:function(X,ne){if(this._videoMeta==null)return;var oe=X,he=oe.samples,Ae=void 0,Qe=-1,ot=-1,Rt=-1,Nt=-1;if(!he||he.length===0)return;if(he.length===1&&!ne)return;var ht=8,Dt=null,sn=8+X.length,Ct=null;if(he.length>1&&(Ct=he.pop(),sn-=Ct.length),this._videoStashedLastSample!=null){var hn=this._videoStashedLastSample;this._videoStashedLastSample=null,he.unshift(hn),sn+=hn.length}Ct!=null&&(this._videoStashedLastSample=Ct);var rn=he[0].dts-this._dtsBase;if(this._videoNextDts)Ae=rn-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())Ae=0;else{var ae=this._videoSegmentInfoList.getLastSampleBefore(rn);if(ae!=null){var U=rn-(ae.originalDts+ae.duration);U<=3&&(U=0);var H=ae.dts+ae.duration+U;Ae=rn-H}else Ae=0}for(var te=new je,pe=[],se=0;se<he.length;se++){var $e=he[se],yt=$e.dts-this._dtsBase,Ot=$e.isKeyframe,Yt=yt-Ae,St=$e.cts,Wt=Yt+St;Qe===-1&&(Qe=Yt,Rt=Wt);var ln=0;if(se!==he.length-1){var Bn=he[se+1].dts-this._dtsBase-Ae;ln=Bn-Yt}else if(Ct!=null){var Oi=Ct.dts-this._dtsBase-Ae;ln=Oi-Yt}else pe.length>=1?ln=pe[pe.length-1].duration:ln=Math.floor(this._videoMeta.refSampleDuration);if(Ot){var mi=new Ye(Yt,Wt,ln,$e.dts,!0);mi.fileposition=$e.fileposition,te.appendSyncPoint(mi)}pe.push({dts:Yt,pts:Wt,cts:St,units:$e.units,size:$e.length,isKeyframe:Ot,duration:ln,originalDts:yt,flags:{isLeading:0,dependsOn:Ot?2:1,isDependedOn:Ot?1:0,hasRedundancy:0,isNonSync:Ot?0:1}})}Dt=new Uint8Array(sn),Dt[0]=sn>>>24&255,Dt[1]=sn>>>16&255,Dt[2]=sn>>>8&255,Dt[3]=sn&255,Dt.set(tt.types.mdat,4);for(var Wn=0;Wn<pe.length;Wn++)for(var di=pe[Wn].units;di.length;){var hr=di.shift(),vi=hr.data;Dt.set(vi,ht),ht+=vi.byteLength}var gi=pe[pe.length-1];if(ot=gi.dts+gi.duration,Nt=gi.pts+gi.duration,this._videoNextDts=ot,te.beginDts=Qe,te.endDts=ot,te.beginPts=Rt,te.endPts=Nt,te.originalBeginDts=pe[0].originalDts,te.originalEndDts=gi.originalDts+gi.duration,te.firstSample=new Ye(pe[0].dts,pe[0].pts,pe[0].duration,pe[0].originalDts,pe[0].isKeyframe),te.lastSample=new Ye(gi.dts,gi.pts,gi.duration,gi.originalDts,gi.isKeyframe),this._isLive||this._videoSegmentInfoList.append(te),oe.samples=pe,oe.sequenceNumber++,this._forceFirstIDR){var xi=pe[0].flags;xi.dependsOn=2,xi.isNonSync=0}var Bi=tt.moof(oe,Qe);oe.samples=[],oe.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Bi,Dt).buffer,sampleCount:pe.length,info:te})}},{key:"_mergeBoxes",value:function(X,ne){var oe=new Uint8Array(X.byteLength+ne.byteLength);return oe.set(X,0),oe.set(ne,X.byteLength),oe}}]),Re}(),Ce=be,Pe={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},Le=Pe,Ve=function(){function Re(ve,X){Object(ce.a)(this,Re),this.TAG="TransmuxingController",this._emitter=new T.a,this._config=X,ve.segments||(ve.segments=[{duration:ve.duration,filesize:ve.filesize,url:ve.url}]),typeof ve.cors!="boolean"&&(ve.cors=!0),typeof ve.withCredentials!="boolean"&&(ve.withCredentials=!1),this._mediaDataSource=ve,this._currentSegmentIndex=0;var ne=0;this._mediaDataSource.segments.forEach(function(oe){oe.timestampBase=ne,ne+=oe.duration,oe.cors=ve.cors,oe.withCredentials=ve.withCredentials,X.referrerPolicy&&(oe.referrerPolicy=X.referrerPolicy)}),!isNaN(ne)&&this._mediaDataSource.duration!==ne&&(this._mediaDataSource.duration=ne),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(X,ne){this._currentSegmentIndex=X;var oe=this._mediaDataSource.segments[X],he=this._ioctl=new K(oe,this._config,X);he.onError=this._onIOException.bind(this),he.onSeeked=this._onIOSeeked.bind(this),he.onComplete=this._onIOComplete.bind(this),he.onRedirect=this._onIORedirect.bind(this),he.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),ne?this._demuxer.bindDataSource(this._ioctl):he.onDataArrival=this._onInitChunkArrival.bind(this),he.open(ne)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(X){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var ne=this._searchSegmentIndexContains(X);if(ne===this._currentSegmentIndex){var oe=this._mediaInfo.segments[ne];if(oe==null)this._pendingSeekTime=X;else{var he=oe.getNearestKeyframe(X);this._remuxer.seek(he.milliseconds),this._ioctl.seek(he.fileposition),this._pendingResolveSeekPoint=he.milliseconds}}else{var Ae=this._mediaInfo.segments[ne];if(Ae==null)this._pendingSeekTime=X,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(ne);else{var Qe=Ae.getNearestKeyframe(X);this._internalAbort(),this._remuxer.seek(X),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[ne].timestampBase,this._loadSegment(ne,Qe.fileposition),this._pendingResolveSeekPoint=Qe.milliseconds,this._reportSegmentMediaInfo(ne)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(X){for(var ne=this._mediaDataSource.segments,oe=ne.length-1,he=0;he<ne.length;he++)if(X<ne[he].timestampBase){oe=he-1;break}return oe}},{key:"_onInitChunkArrival",value:function(X,ne){var oe=this,he=null,Ae=0;if(ne>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,Ae=this._demuxer.parseChunks(X,ne);else if((he=Ne.probe(X)).match){this._demuxer=new Ne(he,this._config),this._remuxer||(this._remuxer=new Ce(this._config));var Qe=this._mediaDataSource;Qe.duration!=null&&!isNaN(Qe.duration)&&(this._demuxer.overridedDuration=Qe.duration),typeof Qe.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Qe.hasAudio),typeof Qe.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Qe.hasVideo),this._demuxer.timestampBase=Qe.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),Ae=this._demuxer.parseChunks(X,ne)}else he=null,O.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){oe._internalAbort()}),this._emitter.emit(Le.DEMUX_ERROR,$.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),Ae=0;return Ae}},{key:"_onMediaInfo",value:function(X){var ne=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},X),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Me.prototype));var oe=Object.assign({},X);Object.setPrototypeOf(oe,Me.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=oe,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var he=ne._pendingSeekTime;ne._pendingSeekTime=null,ne.seek(he)})}},{key:"_onMetaDataArrived",value:function(X){this._emitter.emit(Le.METADATA_ARRIVED,X)}},{key:"_onScriptDataArrived",value:function(X){this._emitter.emit(Le.SCRIPTDATA_ARRIVED,X)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(X){var ne=X,oe=ne+1;oe<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(oe)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Le.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(X){var ne=this._ioctl.extraData;this._mediaDataSource.segments[ne].redirectedURL=X}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(Le.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(X,ne){O.e(this.TAG,"IOException: type = ".concat(X,", code = ").concat(ne.code,", msg = ").concat(ne.msg)),this._emitter.emit(Le.IO_ERROR,X,ne),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(X,ne){O.e(this.TAG,"DemuxException: type = ".concat(X,", info = ").concat(ne)),this._emitter.emit(Le.DEMUX_ERROR,X,ne)}},{key:"_onRemuxerInitSegmentArrival",value:function(X,ne){this._emitter.emit(Le.INIT_SEGMENT,X,ne)}},{key:"_onRemuxerMediaSegmentArrival",value:function(X,ne){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(Le.MEDIA_SEGMENT,X,ne),this._pendingResolveSeekPoint!=null&&X==="video"){var oe=ne.info.syncPoints,he=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,m.safari&&oe.length>0&&oe[0].originalDts===he&&(he=oe[0].pts),this._emitter.emit(Le.RECOMMEND_SEEKPOINT,he)}}},{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(X){var ne=this._mediaInfo.segments[X],oe=Object.assign({},ne);oe.duration=this._mediaInfo.duration,oe.segmentCount=this._mediaInfo.segmentCount,delete oe.segments,delete oe.keyframesIndex,this._emitter.emit(Le.MEDIA_INFO,oe)}},{key:"_reportStatisticsInfo",value:function(){var X={};X.url=this._ioctl.currentURL,X.hasRedirect=this._ioctl.hasRedirect,X.hasRedirect&&(X.redirectedURL=this._ioctl.currentRedirectedURL),X.speed=this._ioctl.currentSpeed,X.loaderType=this._ioctl.loaderType,X.currentSegmentIndex=this._currentSegmentIndex,X.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Le.STATISTICS_INFO,X)}}]),Re}(),at=Ve,_t=function(ve){var X="TransmuxingWorker",ne=null,oe=rn.bind(this);C.install(),ve.addEventListener("message",function(ae){switch(ae.data.cmd){case"init":ne=new at(ae.data.param[0],ae.data.param[1]),ne.on(Le.IO_ERROR,sn.bind(this)),ne.on(Le.DEMUX_ERROR,Ct.bind(this)),ne.on(Le.INIT_SEGMENT,he.bind(this)),ne.on(Le.MEDIA_SEGMENT,Ae.bind(this)),ne.on(Le.LOADING_COMPLETE,Qe.bind(this)),ne.on(Le.RECOVERED_EARLY_EOF,ot.bind(this)),ne.on(Le.MEDIA_INFO,Rt.bind(this)),ne.on(Le.METADATA_ARRIVED,Nt.bind(this)),ne.on(Le.SCRIPTDATA_ARRIVED,ht.bind(this)),ne.on(Le.STATISTICS_INFO,Dt.bind(this)),ne.on(Le.RECOMMEND_SEEKPOINT,hn.bind(this));break;case"destroy":ne&&(ne.destroy(),ne=null),ve.postMessage({msg:"destroyed"});break;case"start":ne.start();break;case"stop":ne.stop();break;case"seek":ne.seek(ae.data.param);break;case"pause":ne.pause();break;case"resume":ne.resume();break;case"logging_config":{var U=ae.data.param;ye.applyConfig(U),U.enableCallback===!0?ye.addLogListener(oe):ye.removeLogListener(oe);break}}});function he(ae,U){var H={msg:Le.INIT_SEGMENT,data:{type:ae,data:U}};ve.postMessage(H,[U.data])}function Ae(ae,U){var H={msg:Le.MEDIA_SEGMENT,data:{type:ae,data:U}};ve.postMessage(H,[U.data])}function Qe(){var ae={msg:Le.LOADING_COMPLETE};ve.postMessage(ae)}function ot(){var ae={msg:Le.RECOVERED_EARLY_EOF};ve.postMessage(ae)}function Rt(ae){var U={msg:Le.MEDIA_INFO,data:ae};ve.postMessage(U)}function Nt(ae){var U={msg:Le.METADATA_ARRIVED,data:ae};ve.postMessage(U)}function ht(ae){var U={msg:Le.SCRIPTDATA_ARRIVED,data:ae};ve.postMessage(U)}function Dt(ae){var U={msg:Le.STATISTICS_INFO,data:ae};ve.postMessage(U)}function sn(ae,U){ve.postMessage({msg:Le.IO_ERROR,data:{type:ae,info:U}})}function Ct(ae,U){ve.postMessage({msg:Le.DEMUX_ERROR,data:{type:ae,info:U}})}function hn(ae){ve.postMessage({msg:Le.RECOMMEND_SEEKPOINT,data:ae})}function rn(ae,U){ve.postMessage({msg:"logcat_callback",data:{type:ae,logcat:U}})}},kt=_t,Bt=function(){function Re(ve,X){if(Object(ce.a)(this,Re),this.TAG="Transmuxer",this._emitter=new T.a,X.enableWorker&&typeof Worker!="undefined")try{var ne=V("0r65");this._worker=ne(kt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[ve,X]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ye.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ye.getConfig()})}catch(he){O.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new at(ve,X)}else this._controller=new at(ve,X);if(this._controller){var oe=this._controller;oe.on(Le.IO_ERROR,this._onIOError.bind(this)),oe.on(Le.DEMUX_ERROR,this._onDemuxError.bind(this)),oe.on(Le.INIT_SEGMENT,this._onInitSegment.bind(this)),oe.on(Le.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),oe.on(Le.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),oe.on(Le.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),oe.on(Le.MEDIA_INFO,this._onMediaInfo.bind(this)),oe.on(Le.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),oe.on(Le.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),oe.on(Le.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),oe.on(Le.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ye.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{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(X){this._worker?this._worker.postMessage({cmd:"seek",param:X}):this._controller.seek(X)}},{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(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.INIT_SEGMENT,X,ne)})}},{key:"_onMediaSegment",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.MEDIA_SEGMENT,X,ne)})}},{key:"_onLoadingComplete",value:function(){var X=this;Promise.resolve().then(function(){X._emitter.emit(Le.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var X=this;Promise.resolve().then(function(){X._emitter.emit(Le.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.MEDIA_INFO,X)})}},{key:"_onMetaDataArrived",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.METADATA_ARRIVED,X)})}},{key:"_onScriptDataArrived",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.SCRIPTDATA_ARRIVED,X)})}},{key:"_onStatisticsInfo",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.STATISTICS_INFO,X)})}},{key:"_onIOError",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.IO_ERROR,X,ne)})}},{key:"_onDemuxError",value:function(X,ne){var oe=this;Promise.resolve().then(function(){oe._emitter.emit(Le.DEMUX_ERROR,X,ne)})}},{key:"_onRecommendSeekpoint",value:function(X){var ne=this;Promise.resolve().then(function(){ne._emitter.emit(Le.RECOMMEND_SEEKPOINT,X)})}},{key:"_onLoggingConfigChanged",value:function(X){this._worker&&this._worker.postMessage({cmd:"logging_config",param:X})}},{key:"_onWorkerMessage",value:function(X){var ne=X.data,oe=ne.data;if(ne.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(ne.msg){case Le.INIT_SEGMENT:case Le.MEDIA_SEGMENT:this._emitter.emit(ne.msg,oe.type,oe.data);break;case Le.LOADING_COMPLETE:case Le.RECOVERED_EARLY_EOF:this._emitter.emit(ne.msg);break;case Le.MEDIA_INFO:Object.setPrototypeOf(oe,Me.prototype),this._emitter.emit(ne.msg,oe);break;case Le.METADATA_ARRIVED:case Le.SCRIPTDATA_ARRIVED:case Le.STATISTICS_INFO:this._emitter.emit(ne.msg,oe);break;case Le.IO_ERROR:case Le.DEMUX_ERROR:this._emitter.emit(ne.msg,oe.type,oe.info);break;case Le.RECOMMEND_SEEKPOINT:this._emitter.emit(ne.msg,oe);break;case"logcat_callback":O.emitter.emit("log",oe.type,oe.logcat);break;default:break}}}]),Re}(),jt=Bt,At={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},pt=At,gt=function(){function Re(ve){Object(ce.a)(this,Re),this.TAG="MSEController",this._config=ve,this._emitter=new T.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 Ue}return Object(ie.a)(Re,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"attachMediaElement",value:function(X){if(this._mediaSource)throw new o("MediaSource has been attached to an HTMLMediaElement!");var ne=this._mediaSource=new window.MediaSource;ne.addEventListener("sourceopen",this.e.onSourceOpen),ne.addEventListener("sourceended",this.e.onSourceEnded),ne.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=X,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),X.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var X=this._mediaSource;for(var ne in this._sourceBuffers){var oe=this._pendingSegments[ne];oe.splice(0,oe.length),this._pendingSegments[ne]=null,this._pendingRemoveRanges[ne]=null,this._lastInitSegments[ne]=null;var he=this._sourceBuffers[ne];if(he){if(X.readyState!=="closed"){try{X.removeSourceBuffer(he)}catch(Ae){O.e(this.TAG,Ae.message)}he.removeEventListener("error",this.e.onSourceBufferError),he.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[ne]=null,this._sourceBuffers[ne]=null}}if(X.readyState==="open")try{X.endOfStream()}catch(Ae){O.e(this.TAG,Ae.message)}X.removeEventListener("sourceopen",this.e.onSourceOpen),X.removeEventListener("sourceended",this.e.onSourceEnded),X.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(X,ne){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(X),this._pendingSegments[X.type].push(X);return}var oe=X,he="".concat(oe.container);oe.codec&&oe.codec.length>0&&(he+=";codecs=".concat(oe.codec));var Ae=!1;if(O.v(this.TAG,"Received Initialization Segment, mimeType: "+he),this._lastInitSegments[oe.type]=oe,he!==this._mimeTypes[oe.type]){if(this._mimeTypes[oe.type])O.v(this.TAG,"Notice: ".concat(oe.type," mimeType changed, origin: ").concat(this._mimeTypes[oe.type],", target: ").concat(he));else{Ae=!0;try{var Qe=this._sourceBuffers[oe.type]=this._mediaSource.addSourceBuffer(he);Qe.addEventListener("error",this.e.onSourceBufferError),Qe.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(ot){O.e(this.TAG,ot.message),this._emitter.emit(pt.ERROR,{code:ot.code,msg:ot.message});return}}this._mimeTypes[oe.type]=he}ne||this._pendingSegments[oe.type].push(oe),Ae||this._sourceBuffers[oe.type]&&!this._sourceBuffers[oe.type].updating&&this._doAppendSegments(),m.safari&&oe.container==="audio/mpeg"&&oe.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=oe.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(X){var ne=X;this._pendingSegments[ne.type].push(ne),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var oe=this._sourceBuffers[ne.type];oe&&!oe.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(X){for(var ne in this._sourceBuffers){if(!this._sourceBuffers[ne])continue;var oe=this._sourceBuffers[ne];if(this._mediaSource.readyState==="open")try{oe.abort()}catch(Nt){O.e(this.TAG,Nt.message)}this._idrList.clear();var he=this._pendingSegments[ne];if(he.splice(0,he.length),this._mediaSource.readyState==="closed")continue;for(var Ae=0;Ae<oe.buffered.length;Ae++){var Qe=oe.buffered.start(Ae),ot=oe.buffered.end(Ae);this._pendingRemoveRanges[ne].push({start:Qe,end:ot})}if(oe.updating||this._doRemoveRanges(),m.safari){var Rt=this._lastInitSegments[ne];Rt&&(this._pendingSegments[ne].push(Rt),oe.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var X=this._mediaSource,ne=this._sourceBuffers;if(!X||X.readyState!=="open"){X&&X.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}ne.video&&ne.video.updating||ne.audio&&ne.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,X.endOfStream())}},{key:"getNearestKeyframe",value:function(X){return this._idrList.getLastSyncPointBeforeDts(X)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var X=this._mediaElement.currentTime;for(var ne in this._sourceBuffers){var oe=this._sourceBuffers[ne];if(oe){var he=oe.buffered;if(he.length>=1&&X-he.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var X=this._mediaElement.currentTime;for(var ne in this._sourceBuffers){var oe=this._sourceBuffers[ne];if(oe){for(var he=oe.buffered,Ae=!1,Qe=0;Qe<he.length;Qe++){var ot=he.start(Qe),Rt=he.end(Qe);if(ot<=X&&X<Rt+3){if(X-ot>=this._config.autoCleanupMaxBackwardDuration){Ae=!0;var Nt=X-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[ne].push({start:ot,end:Nt})}}else Rt<X&&(Ae=!0,this._pendingRemoveRanges[ne].push({start:ot,end:Rt}))}Ae&&!oe.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var X=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(X.video&&X.video.updating||X.audio&&X.audio.updating)return;var ne=this._mediaSource.duration,oe=this._pendingMediaDuration;oe>0&&(isNaN(ne)||oe>ne)&&(O.v(this.TAG,"Update MediaSource duration from ".concat(ne," to ").concat(oe)),this._mediaSource.duration=oe),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var X in this._pendingRemoveRanges){if(!this._sourceBuffers[X]||this._sourceBuffers[X].updating)continue;for(var ne=this._sourceBuffers[X],oe=this._pendingRemoveRanges[X];oe.length&&!ne.updating;){var he=oe.shift();ne.remove(he.start,he.end)}}}},{key:"_doAppendSegments",value:function(){var X=this._pendingSegments;for(var ne in X){if(!this._sourceBuffers[ne]||this._sourceBuffers[ne].updating)continue;if(X[ne].length>0){var oe=X[ne].shift();if(oe.timestampOffset){var he=this._sourceBuffers[ne].timestampOffset,Ae=oe.timestampOffset/1e3,Qe=Math.abs(he-Ae);Qe>.1&&(O.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(he," to ").concat(Ae)),this._sourceBuffers[ne].timestampOffset=Ae),delete oe.timestampOffset}if(!oe.data||oe.data.byteLength===0)continue;try{this._sourceBuffers[ne].appendBuffer(oe.data),this._isBufferFull=!1,ne==="video"&&oe.hasOwnProperty("info")&&this._idrList.appendArray(oe.info.syncPoints)}catch(ot){this._pendingSegments[ne].unshift(oe),ot.code===22?(this._isBufferFull||this._emitter.emit(pt.BUFFER_FULL),this._isBufferFull=!0):(O.e(this.TAG,ot.message),this._emitter.emit(pt.ERROR,{code:ot.code,msg:ot.message}))}}}}},{key:"_onSourceOpen",value:function(){if(O.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var X=this._pendingSourceBufferInit;X.length;){var ne=X.shift();this.appendInitSegment(ne,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(pt.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){O.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){O.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 X=this._pendingSegments;return X.video.length>0||X.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var X=this._pendingRemoveRanges;return X.video.length>0||X.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(pt.UPDATE_END)}},{key:"_onSourceBufferError",value:function(X){O.e(this.TAG,"SourceBuffer Error: ".concat(X))}}]),Re}(),rt=gt,Oe={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},ze={NETWORK_EXCEPTION:i.EXCEPTION,NETWORK_STATUS_CODE_INVALID:i.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:i.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:i.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:$.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:$.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:$.CODEC_UNSUPPORTED},vt=function(){function Re(ve,X){if(Object(ce.a)(this,Re),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new T.a,this._config=le(),typeof X=="object"&&Object.assign(this._config,X),ve.type.toLowerCase()!=="flv")throw new r("FlvPlayer requires an flv MediaDataSource input!");ve.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=ve,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 ne=m.chrome&&(m.version.major<50||m.version.major===50&&m.version.build<2661);this._alwaysSeekKeyframe=!!(ne||m.msedge||m.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(ie.a)(Re,[{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(X,ne){var oe=this;X===Ie.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Ie.MEDIA_INFO,oe.mediaInfo)}):X===Ie.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){oe._emitter.emit(Ie.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"attachMediaElement",value:function(X){var ne=this;if(this._mediaElement=X,X.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),X.addEventListener("seeking",this.e.onvSeeking),X.addEventListener("canplay",this.e.onvCanPlay),X.addEventListener("stalled",this.e.onvStalled),X.addEventListener("progress",this.e.onvProgress),this._msectl=new rt(this._config),this._msectl.on(pt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(pt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(pt.SOURCE_OPEN,function(){ne._mseSourceOpened=!0,ne._hasPendingLoad&&(ne._hasPendingLoad=!1,ne.load())}),this._msectl.on(pt.ERROR,function(oe){ne._emitter.emit(Ie.ERROR,Oe.MEDIA_ERROR,ze.MEDIA_MSE_ERROR,oe)}),this._msectl.attachMediaElement(X),this._pendingSeekTime!=null)try{X.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(oe){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var X=this;if(!this._mediaElement)throw new o("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new o("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 jt(this._mediaDataSource,this._config),this._transmuxer.on(Le.INIT_SEGMENT,function(ne,oe){X._msectl.appendInitSegment(oe)}),this._transmuxer.on(Le.MEDIA_SEGMENT,function(ne,oe){if(X._msectl.appendMediaSegment(oe),X._config.lazyLoad&&!X._config.isLive){var he=X._mediaElement.currentTime;oe.info.endDts>=(he+X._config.lazyLoadMaxDuration)*1e3&&(X._progressChecker==null&&(O.v(X.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),X._suspendTransmuxer()))}}),this._transmuxer.on(Le.LOADING_COMPLETE,function(){X._msectl.endOfStream(),X._emitter.emit(Ie.LOADING_COMPLETE)}),this._transmuxer.on(Le.RECOVERED_EARLY_EOF,function(){X._emitter.emit(Ie.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Le.IO_ERROR,function(ne,oe){X._emitter.emit(Ie.ERROR,Oe.NETWORK_ERROR,ne,oe)}),this._transmuxer.on(Le.DEMUX_ERROR,function(ne,oe){X._emitter.emit(Ie.ERROR,Oe.MEDIA_ERROR,ne,{code:-1,msg:oe})}),this._transmuxer.on(Le.MEDIA_INFO,function(ne){X._mediaInfo=ne,X._emitter.emit(Ie.MEDIA_INFO,Object.assign({},ne))}),this._transmuxer.on(Le.METADATA_ARRIVED,function(ne){X._emitter.emit(Ie.METADATA_ARRIVED,ne)}),this._transmuxer.on(Le.SCRIPTDATA_ARRIVED,function(ne){X._emitter.emit(Ie.SCRIPTDATA_ARRIVED,ne)}),this._transmuxer.on(Le.STATISTICS_INFO,function(ne){X._statisticsInfo=X._fillStatisticsInfo(ne),X._emitter.emit(Ie.STATISTICS_INFO,Object.assign({},X._statisticsInfo))}),this._transmuxer.on(Le.RECOMMEND_SEEKPOINT,function(ne){X._mediaElement&&!X._config.accurateSeek&&(X._requestSetTime=!0,X._mediaElement.currentTime=ne/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(X){this._mediaElement.volume=X}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(X){this._mediaElement.muted=X}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(X){this._mediaElement?this._internalSeek(X):this._pendingSeekTime=X}},{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(X){if(X.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return X;var ne=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Ae=this._mediaElement.getVideoPlaybackQuality();oe=Ae.totalVideoFrames,he=Ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):ne=!1;return ne&&(X.decodedFrames=oe,X.droppedFrames=he),X}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var X=this._mediaElement.buffered,ne=this._mediaElement.currentTime,oe=0,he=0,Ae=0;Ae<X.length;Ae++){var Qe=X.start(Ae),ot=X.end(Ae);if(Qe<=ne&&ne<ot){oe=Qe,he=ot;break}}he>=ne+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(O.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){O.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 X=this._mediaElement.currentTime,ne=this._mediaElement.buffered,oe=!1,he=0;he<ne.length;he++){var Ae=ne.start(he),Qe=ne.end(he);if(X>=Ae&&X<Qe){X>=Qe-this._config.lazyLoadRecoverDuration&&(oe=!0);break}}oe&&(window.clearInterval(this._progressChecker),this._progressChecker=null,oe&&(O.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(X){for(var ne=this._mediaElement.buffered,oe=0;oe<ne.length;oe++){var he=ne.start(oe),Ae=ne.end(oe);if(X>=he&&X<Ae)return!0}return!1}},{key:"_internalSeek",value:function(X){var ne=this._isTimepointBuffered(X),oe=!1,he=0;if(X<1&&this._mediaElement.buffered.length>0){var Ae=this._mediaElement.buffered.start(0);(Ae<1&&X<Ae||m.safari)&&(oe=!0,he=m.safari?.1:Ae)}if(oe)this._requestSetTime=!0,this._mediaElement.currentTime=he;else if(ne){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=X;else{var Qe=this._msectl.getNearestKeyframe(Math.floor(X*1e3));this._requestSetTime=!0,Qe!=null?this._mediaElement.currentTime=Qe.dts/1e3:this._mediaElement.currentTime=X}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(X),this._transmuxer.seek(Math.floor(X*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=X)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var X=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(X)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(X),this._transmuxer.seek(Math.floor(X*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=X))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(X){var ne=this._mediaElement;if(X||!this._receivedCanPlay||ne.readyState<2){var oe=ne.buffered;oe.length>0&&ne.currentTime<oe.start(0)&&(O.w(this.TAG,"Playback seems stuck at ".concat(ne.currentTime,", seek to ").concat(oe.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=oe.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(X){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(X){var ne=this._mediaElement.currentTime,oe=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(ne<1&&oe.length>0){var he=oe.start(0);if(he<1&&ne<he||m.safari){this._requestSetTime=!0,this._mediaElement.currentTime=m.safari?.1:he;return}}if(this._isTimepointBuffered(ne)){if(this._alwaysSeekKeyframe){var Ae=this._msectl.getNearestKeyframe(Math.floor(ne*1e3));Ae!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=Ae.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:ne,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(X){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(X){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(X){this._checkAndResumeStuckPlayback()}}]),Re}(),st=vt,It=function(){function Re(ve,X){if(Object(ce.a)(this,Re),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new T.a,this._config=le(),typeof X=="object"&&Object.assign(this._config,X),ve.type.toLowerCase()==="flv")throw new r("NativePlayer does't support flv MediaDataSource input!");if(ve.hasOwnProperty("segments"))throw new r("NativePlayer(".concat(ve.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=ve,this._mediaElement=null}return Object(ie.a)(Re,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(X,ne){var oe=this;X===Ie.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){oe._emitter.emit(Ie.MEDIA_INFO,oe.mediaInfo)}):X===Ie.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){oe._emitter.emit(Ie.STATISTICS_INFO,oe.statisticsInfo)})),this._emitter.addListener(X,ne)}},{key:"off",value:function(X,ne){this._emitter.removeListener(X,ne)}},{key:"attachMediaElement",value:function(X){if(this._mediaElement=X,X.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{X.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(ne){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new o("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(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(X){this._mediaElement.volume=X}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(X){this._mediaElement.muted=X}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(X){this._mediaElement?this._mediaElement.currentTime=X:this._pendingSeekTime=X}},{key:"mediaInfo",get:function(){var X=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",ne={mimeType:X+this._mediaDataSource.type};return this._mediaElement&&(ne.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(ne.width=this._mediaElement.videoWidth,ne.height=this._mediaElement.videoHeight)),ne}},{key:"statisticsInfo",get:function(){var X={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return X;var ne=!0,oe=0,he=0;if(this._mediaElement.getVideoPlaybackQuality){var Ae=this._mediaElement.getVideoPlaybackQuality();oe=Ae.totalVideoFrames,he=Ae.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(oe=this._mediaElement.webkitDecodedFrameCount,he=this._mediaElement.webkitDroppedFrameCount):ne=!1;return ne&&(X.decodedFrames=oe,X.droppedFrames=he),X}},{key:"_onvLoadedMetadata",value:function(X){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Ie.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Ie.STATISTICS_INFO,this.statisticsInfo)}}]),Re}(),Pt=It;C.install();function Ze(Re,ve){var X=Re;if(X==null||typeof X!="object")throw new r("MediaDataSource must be an javascript object!");if(!X.hasOwnProperty("type"))throw new r("MediaDataSource must has type field to indicate video file type!");switch(X.type){case"flv":return new st(X,ve);default:return new Pt(X,ve)}}function mt(){return Te.supportMSEH264Playback()}function Lt(){return Te.getFeatureList()}var Mt={};Mt.createPlayer=Ze,Mt.isSupported=mt,Mt.getFeatureList=Lt,Mt.BaseLoader=t,Mt.LoaderStatus=a,Mt.LoaderErrors=i,Mt.Events=Ie,Mt.ErrorTypes=Oe,Mt.ErrorDetails=ze,Mt.FlvPlayer=st,Mt.NativePlayer=Pt,Mt.LoggingControl=ye,Object.defineProperty(Mt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var $t=Xe.a=Mt},GgEA:function(nt,Xe,V){},Gytx:function(nt,Xe){nt.exports=function(ce,ie,W,C){var D=W?W.call(C,ce,ie):void 0;if(D!==void 0)return!!D;if(ce===ie)return!0;if(typeof ce!="object"||!ce||typeof ie!="object"||!ie)return!1;var T=Object.keys(ce),A=Object.keys(ie);if(T.length!==A.length)return!1;for(var O=Object.prototype.hasOwnProperty.bind(ie),f=0;f<T.length;f++){var p=T[f];if(!O(p))return!1;var c=ce[p],s=ie[p];if(D=W?W.call(C,c,s,p):void 0,D===!1||D===void 0&&c!==s)return!1}return!0}},HmJG:function(nt,Xe,V){},Hw79:function(nt,Xe,V){nt.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return C}),V.d(Xe,"b",function(){return n}),V.d(Xe,"c",function(){return r});var ce=V("cDcd"),ie=function(){var l=function(a,i){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var v in d)d.hasOwnProperty(v)&&(t[v]=d[v])},l(a,i)};return function(a,i){l(a,i);function t(){this.constructor=a}a.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),W=ce.createContext(null),C=function(l){ie(a,l);function a(){return l!==null&&l.apply(this,arguments)||this}return a.prototype.render=function(){return ce.createElement(W.Provider,{value:this.props.store},this.props.children)},a}(ce.Component),D=V("Gytx"),T=V.n(D),A=V("2mql"),O=V.n(A),f=function(){var l=function(a,i){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var v in d)d.hasOwnProperty(v)&&(t[v]=d[v])},l(a,i)};return function(a,i){l(a,i);function t(){this.constructor=a}a.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),p=function(){return p=Object.assign||function(l){for(var a,i=1,t=arguments.length;i<t;i++){a=arguments[i];for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(l[d]=a[d])}return l},p.apply(this,arguments)};function c(l){return l.displayName||l.name||"Component"}var s=function(){return{}};function n(l,a){a===void 0&&(a={});var i=!!l,t=l||s;return function(v){var y=function(g){f(m,g);function m(_,x){var h=g.call(this,_,x)||this;return h.unsubscribe=null,h.handleChange=function(){if(!h.unsubscribe)return;var E=t(h.store.getState(),h.props);h.setState({subscribed:E})},h.store=h.context,h.state={subscribed:t(h.store.getState(),_),store:h.store,props:_},h}return m.getDerivedStateFromProps=function(_,x){return l&&l.length===2&&_!==x.props?{subscribed:t(x.store.getState(),_),props:_}:{props:_}},m.prototype.componentDidMount=function(){this.trySubscribe()},m.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},m.prototype.shouldComponentUpdate=function(_,x){return!T()(this.props,_)||!T()(this.state.subscribed,x.subscribed)},m.prototype.trySubscribe=function(){i&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},m.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},m.prototype.render=function(){var _=p(p(p({},this.props),this.state.subscribed),{store:this.store});return ce.createElement(v,p({},_,{ref:this.props.miniStoreForwardedRef}))},m.displayName="Connect("+c(v)+")",m.contextType=W,m}(ce.Component);if(a.forwardRef){var b=ce.forwardRef(function(g,m){return ce.createElement(y,p({},g,{miniStoreForwardedRef:m}))});return O()(b,v)}return O()(y,v)}}var o=function(){return o=Object.assign||function(l){for(var a,i=1,t=arguments.length;i<t;i++){a=arguments[i];for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(l[d]=a[d])}return l},o.apply(this,arguments)};function r(l){var a=l,i=[];function t(y){a=o(o({},a),y);for(var b=0;b<i.length;b++)i[b]()}function d(){return a}function v(y){return i.push(y),function(){var g=i.indexOf(y);i.splice(g,1)}}return{setState:t,getState:d,subscribe:v}}},IBYe:function(nt,Xe,V){"use strict";function ce(ie){return null}Xe.a=ce},IxHN:function(nt,Xe,V){"use strict";var ce=V("cDcd"),ie=V.n(ce),W=V("07cG"),C=V.n(W);Xe.a=function(D){var T=D.message,A=D.className,O=D.children,f=D.style,p=f===void 0?{}:f;return ie.a.createElement("div",{className:"".concat(C.a.idsRingWrapper," ").concat(A)},ie.a.createElement("div",{className:C.a.ldsRing},ie.a.createElement("div",null),ie.a.createElement("div",null),ie.a.createElement("div",null),ie.a.createElement("div",null)),T?ie.a.createElement("p",{style:p},T):null,O)}},J66h:function(nt,Xe,V){(function(ce){var ie,W;(function(C,D){nt.exports=D(C)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ce!="undefined"?ce:this,function(C){"use strict";C=C||{};var D=C.Base64,T="2.6.4",A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=function(R){for(var N={},F=0,z=R.length;F<z;F++)N[R.charAt(F)]=F;return N}(A),f=String.fromCharCode,p=function(R){if(R.length<2){var N=R.charCodeAt(0);return N<128?R:N<2048?f(192|N>>>6)+f(128|N&63):f(224|N>>>12&15)+f(128|N>>>6&63)+f(128|N&63)}else{var N=65536+(R.charCodeAt(0)-55296)*1024+(R.charCodeAt(1)-56320);return f(240|N>>>18&7)+f(128|N>>>12&63)+f(128|N>>>6&63)+f(128|N&63)}},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(R){return R.replace(c,p)},n=function(R){var N=[0,2,1][R.length%3],F=R.charCodeAt(0)<<16|(R.length>1?R.charCodeAt(1):0)<<8|(R.length>2?R.charCodeAt(2):0),z=[A.charAt(F>>>18),A.charAt(F>>>12&63),N>=2?"=":A.charAt(F>>>6&63),N>=1?"=":A.charAt(F&63)];return z.join("")},o=C.btoa&&typeof C.btoa=="function"?function(R){return C.btoa(R)}:function(R){if(R.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return R.replace(/[\s\S]{1,3}/g,n)},r=function(R){return o(s(String(R)))},l=function(R){return R.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},a=function(R,N){return N?l(r(R)):r(R)},i=function(R){return a(R,!0)},t;C.Uint8Array&&(t=function(R,N){for(var F="",z=0,q=R.length;z<q;z+=3){var B=R[z],M=R[z+1],G=R[z+2],J=B<<16|M<<8|G;F+=A.charAt(J>>>18)+A.charAt(J>>>12&63)+(typeof M!="undefined"?A.charAt(J>>>6&63):"=")+(typeof G!="undefined"?A.charAt(J&63):"=")}return N?l(F):F});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(R){switch(R.length){case 4:var N=(7&R.charCodeAt(0))<<18|(63&R.charCodeAt(1))<<12|(63&R.charCodeAt(2))<<6|63&R.charCodeAt(3),F=N-65536;return f((F>>>10)+55296)+f((F&1023)+56320);case 3:return f((15&R.charCodeAt(0))<<12|(63&R.charCodeAt(1))<<6|63&R.charCodeAt(2));default:return f((31&R.charCodeAt(0))<<6|63&R.charCodeAt(1))}},y=function(R){return R.replace(d,v)},b=function(R){var N=R.length,F=N%4,z=(N>0?O[R.charAt(0)]<<18:0)|(N>1?O[R.charAt(1)]<<12:0)|(N>2?O[R.charAt(2)]<<6:0)|(N>3?O[R.charAt(3)]:0),q=[f(z>>>16),f(z>>>8&255),f(z&255)];return q.length-=[0,0,2,1][F],q.join("")},g=C.atob&&typeof C.atob=="function"?function(R){return C.atob(R)}:function(R){return R.replace(/\S{1,4}/g,b)},m=function(R){return g(String(R).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(R){return y(g(R))},x=function(R){return String(R).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(R){return _(x(R))},E;C.Uint8Array&&(E=function(R){return Uint8Array.from(m(x(R)),function(N){return N.charCodeAt(0)})});var S=function(){var R=C.Base64;return C.Base64=D,R};if(C.Base64={VERSION:T,atob:m,btoa:o,fromBase64:h,toBase64:a,utob:s,encode:a,encodeURI:i,btou:y,decode:h,noConflict:S,fromUint8Array:t,toUint8Array:E},typeof Object.defineProperty=="function"){var w=function(R){return{value:R,enumerable:!1,writable:!0,configurable:!0}};C.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",w(function(){return h(this)})),Object.defineProperty(String.prototype,"toBase64",w(function(R){return a(this,R)})),Object.defineProperty(String.prototype,"toBase64URI",w(function(){return a(this,!0)}))}}return C.Meteor&&(Base64=C.Base64),nt.exports?nt.exports.Base64=C.Base64:!(ie=[],W=function(){return C.Base64}.apply(Xe,ie),W!==void 0&&(nt.exports=W)),{Base64:C.Base64}})}).call(this,V("IyRk"))},JOrW:function(nt,Xe,V){nt.exports=V.p+"static/gf.09d89ab3.svg"},LdHM:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return d}),V.d(Xe,"a",function(){return y});var ce=V("1OyB"),ie=V("vuIU"),W=V("Ji7U"),C=V("LK+K"),D=V("cDcd"),T=V("rePB"),A=V("Ff2n"),O=V("ODXe"),f=V("4IlW"),p=V("bX4T"),c=V("YrtM"),s=V("TSYQ"),n=V.n(s),o=V("+nKL"),r=V("8OUc"),l=function(G,J){var K=G.prefixCls,Z=G.id,le=G.flattenOptions,de=G.childrenAsData,Te=G.values,we=G.searchValue,Ie=G.multiple,_e=G.defaultActiveFirstOption,ye=G.height,Ke=G.itemHeight,Me=G.notFoundContent,Fe=G.open,Ge=G.menuItemSelectedIcon,Ee=G.virtual,me=G.onSelect,We=G.onToggleOpen,He=G.onActiveValue,it=G.onScroll,re=G.onMouseEnter,P="".concat(K,"-item"),j=Object(c.a)(function(){return le},[Fe,le],function(Ye,je){return je[0]&&Ye[1]!==je[1]}),ee=D.useRef(null),$=function(je){je.preventDefault()},Q=function(je){ee.current&&ee.current.scrollTo({index:je})},xe=function(je){for(var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ke=j.length,be=0;be<ke;be+=1){var Ce=(je+be*Ue+ke)%ke,Pe=j[Ce],Le=Pe.group,Ve=Pe.data;if(!Le&&!Ve.disabled)return Ce}return-1},De=D.useState(function(){return xe(0)}),dt=Object(O.a)(De,2),Ne=dt[0],Be=dt[1],tt=function(je){Be(je);var Ue=j[je];if(!Ue){He(null,-1);return}He(Ue.data.value,je)};D.useEffect(function(){tt(_e!==!1?xe(0):-1)},[j.length,we]),D.useEffect(function(){var Ye=setTimeout(function(){if(!Ie&&Fe&&Te.size===1){var je=Array.from(Te)[0],Ue=j.findIndex(function(ke){var be=ke.data;return be.value===je});tt(Ue),Q(Ue)}});return function(){return clearTimeout(Ye)}},[Fe]);var lt=function(je){je!==void 0&&me(je,{selected:!Te.has(je)}),Ie||We(!1)};if(D.useImperativeHandle(J,function(){return{onKeyDown:function(je){var Ue=je.which;switch(Ue){case f.a.UP:case f.a.DOWN:{var ke=0;if(Ue===f.a.UP?ke=-1:Ue===f.a.DOWN&&(ke=1),ke!==0){var be=xe(Ne+ke,ke);Q(be),tt(be)}break}case f.a.ENTER:{var Ce=j[Ne];Ce&&!Ce.data.disabled?lt(Ce.data.value):lt(void 0),Fe&&je.preventDefault();break}case f.a.ESC:We(!1)}},onKeyUp:function(){},scrollTo:function(je){Q(je)}}}),j.length===0)return D.createElement("div",{role:"listbox",id:"".concat(Z,"_list"),className:"".concat(P,"-empty"),onMouseDown:$},Me);function qe(Ye){var je=j[Ye];if(!je)return null;var Ue=je.data||{},ke=Ue.value,be=Ue.label,Ce=Ue.children,Pe=Object(p.a)(Ue,!0),Le=de?Ce:be;return je?D.createElement("div",Object.assign({"aria-label":typeof Le=="string"?Le:null},Pe,{key:Ye,role:"option",id:"".concat(Z,"_list_").concat(Ye),"aria-selected":Te.has(ke)}),ke):null}return D.createElement(D.Fragment,null,D.createElement("div",{role:"listbox",id:"".concat(Z,"_list"),style:{height:0,width:0,overflow:"hidden"}},qe(Ne-1),qe(Ne),qe(Ne+1)),D.createElement(o.a,{itemKey:"key",ref:ee,data:j,height:ye,itemHeight:Ke,fullHeight:!1,onMouseDown:$,onScroll:it,virtual:Ee,onMouseEnter:re},function(Ye,je){var Ue,ke=Ye.group,be=Ye.groupOption,Ce=Ye.data,Pe=Ce.label,Le=Ce.key;if(ke)return D.createElement("div",{className:n()(P,"".concat(P,"-group"))},Pe!==void 0?Pe:Le);var Ve=Ce.disabled,at=Ce.value,_t=Ce.title,kt=Ce.children,Bt=Ce.style,jt=Ce.className,At=Object(A.a)(Ce,["disabled","value","title","children","style","className"]),pt=Te.has(at),gt="".concat(P,"-option"),rt=n()(P,gt,jt,(Ue={},Object(T.a)(Ue,"".concat(gt,"-grouped"),be),Object(T.a)(Ue,"".concat(gt,"-active"),Ne===je&&!Ve),Object(T.a)(Ue,"".concat(gt,"-disabled"),Ve),Object(T.a)(Ue,"".concat(gt,"-selected"),pt),Ue)),Oe=de?kt:Pe,ze=!Ge||typeof Ge=="function"||pt;return D.createElement("div",Object.assign({},At,{"aria-selected":pt,className:rt,title:_t,onMouseMove:function(){if(Ne===je||Ve)return;tt(je)},onClick:function(){Ve||lt(at)},style:Bt}),D.createElement("div",{className:"".concat(gt,"-content")},Oe||at),D.isValidElement(Ge)||pt,ze&&D.createElement(r.a,{className:"".concat(P,"-option-state"),customizeIcon:Ge,customizeIconProps:{isSelected:pt}},pt?"\u2713":null))}))},a=D.forwardRef(l);a.displayName="OptionList";var i=a,t=function(){return null};t.isSelectOption=!0;var d=t,v=function(){return null};v.isSelectOptGroup=!0;var y=v,b=V("VTBJ"),g=V("Zm9Q");function m(M){var G=M.key,J=M.props,K=J.children,Z=J.value,le=Object(A.a)(J,["children","value"]);return Object(b.a)({key:G,value:Z!==void 0?Z:G,children:K},le)}function _(M){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(M).map(function(J,K){if(!D.isValidElement(J)||!J.type)return null;var Z=J.type.isSelectOptGroup,le=J.key,de=J.props,Te=de.children,we=Object(A.a)(de,["children"]);return G||!Z?m(J):Object(b.a)(Object(b.a)({key:"__RC_SELECT_GRP__".concat(le===null?K:le,"__"),label:le},we),{},{options:_(Te)})}).filter(function(J){return J})}var x=V("2Qr1"),h=V("qNPg"),E=V("U8pU"),S=V("Kwbf"),w=V("WKfj");function R(M){var G=M.mode,J=M.options,K=M.children,Z=M.backfill,le=M.allowClear,de=M.placeholder,Te=M.getInputElement,we=M.showSearch,Ie=M.onSearch,_e=M.defaultOpen,ye=M.autoFocus,Ke=M.labelInValue,Me=M.value,Fe=M.inputValue,Ge=M.optionLabelProp,Ee=G==="multiple"||G==="tags",me=we!==void 0?we:Ee||G==="combobox",We=J||_(K);if(Object(S.a)(G!=="tags"||We.every(function(P){return!P.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var He=We.some(function(P){return P.options?P.options.some(function(j){return typeof("value"in j?j.value:j.key)=="number"}):typeof("value"in P?P.value:P.key)=="number"});Object(S.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(G!=="combobox"||!Ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(G==="combobox"||!Z,"`backfill` only works with `combobox` mode."),Object(S.a)(G==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(S.b)(G!=="combobox"||!Te||!le||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ie&&!me&&G!=="combobox"&&G!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!_e||ye,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Me!=null){var it=Object(w.d)(Me);Object(S.a)(!Ke||it.every(function(P){return Object(E.a)(P)==="object"&&("key"in P||"value"in P)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ee||Array.isArray(Me),"`value` should be array when `mode` is `multiple` or `tags`")}if(K){var re=null;Object(g.a)(K).some(function(P){if(!D.isValidElement(P)||!P.type)return!1;var j=P.type;if(j.isSelectOption)return!1;if(j.isSelectOptGroup){var ee=Object(g.a)(P.props.children).every(function($){return!D.isValidElement($)||!P.type||$.type.isSelectOption?!0:(re=$.type,!1)});return!ee}return re=j,!0}),re&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(re.displayName||re.name||re,"`.")),Object(S.a)(Fe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=R,F=Object(h.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:_,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:N,fillOptionsWithMissingValue:x.a}),z=function(M){Object(W.a)(J,M);var G=Object(C.a)(J);function J(){var K;return Object(ce.a)(this,J),K=G.apply(this,arguments),K.selectRef=D.createRef(),K.focus=function(){K.selectRef.current.focus()},K.blur=function(){K.selectRef.current.blur()},K}return Object(ie.a)(J,[{key:"render",value:function(){return D.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),J}(D.Component);z.Option=d,z.OptGroup=y;var q=z,B=Xe.c=q},M8RZ:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return f});var ce=V("fWQN"),ie=V("mtLc"),W=V("yKVA"),C=V("879j"),D=V("cDcd"),T=V.n(D),A=V("faye"),O=V.n(A),f=function(p){Object(W.a)(s,p);var c=Object(C.a)(s);function s(n){var o;Object(ce.a)(this,s),o=c.call(this,n);var r=window.document;return o.node=r.createElement("div"),r.body.appendChild(o.node),o}return Object(ie.a)(s,[{key:"render",value:function(){var o=this.props.children;return Object(A.createPortal)(o,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),s}(T.a.Component)},MFOe:function(nt,Xe,V){(function(ce){var ie=T(),W=A(),C=O(),D=typeof window!="undefined"?window:ce;nt.exports={assign:ie,create:W,trim:C,bind:f,slice:p,each:c,map:s,pluck:n,isList:o,isFunction:r,isObject:l,Global:D};function T(){return Object.assign?Object.assign:function(i,t,d,v){for(var y=1;y<arguments.length;y++)c(Object(arguments[y]),function(b,g){i[g]=b});return i}}function A(){if(Object.create)return function(t,d,v,y){var b=p(arguments,1);return ie.apply(this,[Object.create(t)].concat(b))};{function a(){}return function(t,d,v,y){var b=p(arguments,1);return a.prototype=t,ie.apply(this,[new a].concat(b))}}}function O(){return String.prototype.trim?function(i){return String.prototype.trim.call(i)}:function(i){return i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function f(a,i){return function(){return i.apply(a,Array.prototype.slice.call(arguments,0))}}function p(a,i){return Array.prototype.slice.call(a,i||0)}function c(a,i){n(a,function(t,d){return i(t,d),!1})}function s(a,i){var t=o(a)?[]:{};return n(a,function(d,v){return t[v]=i(d,v),!1}),t}function n(a,i){if(o(a)){for(var t=0;t<a.length;t++)if(i(a[t],t))return a[t]}else for(var d in a)if(a.hasOwnProperty(d)&&i(a[d],d))return a[d]}function o(a){return a!=null&&typeof a!="function"&&typeof a.length=="number"}function r(a){return a&&{}.toString.call(a)==="[object Function]"}function l(a){return a&&{}.toString.call(a)==="[object Object]"}}).call(this,V("IyRk"))},MVJL:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},NvD2:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return T});var ce=V("Kwbf");function ie(A,O){var f=new Set;return A.forEach(function(p){O.has(p)||f.add(p)}),f}function W(A){var O=A||{},f=O.disabled,p=O.disableCheckbox,c=O.checkable;return!!(f||p)||c===!1}function C(A,O,f,p){for(var c=new Set(A),s=new Set,n=0;n<=f;n+=1){var o=O.get(n)||new Set;o.forEach(function(i){var t=i.key,d=i.node,v=i.children,y=v===void 0?[]:v;c.has(t)&&!p(d)&&y.filter(function(b){return!p(b.node)}).forEach(function(b){c.add(b.key)})})}for(var r=new Set,l=f;l>=0;l-=1){var a=O.get(l)||new Set;a.forEach(function(i){var t=i.parent,d=i.node;if(p(d)||!i.parent||r.has(i.parent.key))return;if(p(i.parent.node)){r.add(t.key);return}var v=!0,y=!1;(t.children||[]).filter(function(b){return!p(b.node)}).forEach(function(b){var g=b.key,m=c.has(g);v&&!m&&(v=!1),!y&&(m||s.has(g))&&(y=!0)}),v&&c.add(t.key),y&&s.add(t.key),r.add(t.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(ie(s,c))}}function D(A,O,f,p,c){for(var s=new Set(A),n=new Set(O),o=0;o<=p;o+=1){var r=f.get(o)||new Set;r.forEach(function(t){var d=t.key,v=t.node,y=t.children,b=y===void 0?[]:y;!s.has(d)&&!n.has(d)&&!c(v)&&b.filter(function(g){return!c(g.node)}).forEach(function(g){s.delete(g.key)})})}n=new Set;for(var l=new Set,a=p;a>=0;a-=1){var i=f.get(a)||new Set;i.forEach(function(t){var d=t.parent,v=t.node;if(c(v)||!t.parent||l.has(t.parent.key))return;if(c(t.parent.node)){l.add(d.key);return}var y=!0,b=!1;(d.children||[]).filter(function(g){return!c(g.node)}).forEach(function(g){var m=g.key,_=s.has(m);y&&!_&&(y=!1),!b&&(_||n.has(m))&&(b=!0)}),y||s.delete(d.key),b&&n.add(d.key),l.add(d.key)})}return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(ie(n,s))}}function T(A,O,f,p){var c=[],s;p?s=p:s=W;var n=new Set(A.filter(function(a){var i=!!f[a];return i||c.push(a),i})),o=new Map,r=0;Object.keys(f).forEach(function(a){var i=f[a],t=i.level,d=o.get(t);d||(d=new Set,o.set(t,d)),d.add(i),r=Math.max(r,t)}),Object(ce.a)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var l;return O===!0?l=C(n,o,r,s):l=D(n,O.halfCheckedKeys,o,r,s),l}},OLES:function(nt,Xe,V){"use strict";var ce=V("U8pU"),ie=V("VTBJ"),W=V("Ff2n"),C=V("cDcd"),D=V("uciX"),T=V("7ixt"),A=function(n){var o=n.overlay,r=n.prefixCls,l=n.id,a=n.overlayInnerStyle;return C.createElement("div",{className:"".concat(r,"-inner"),id:l,role:"tooltip",style:a},typeof o=="function"?o():o)},O=A,f=function(n,o){var r=n.overlayClassName,l=n.trigger,a=l===void 0?["hover"]:l,i=n.mouseEnterDelay,t=i===void 0?0:i,d=n.mouseLeaveDelay,v=d===void 0?.1:d,y=n.overlayStyle,b=n.prefixCls,g=b===void 0?"rc-tooltip":b,m=n.children,_=n.onVisibleChange,x=n.afterVisibleChange,h=n.transitionName,E=n.animation,S=n.placement,w=S===void 0?"right":S,R=n.align,N=R===void 0?{}:R,F=n.destroyTooltipOnHide,z=F===void 0?!1:F,q=n.defaultVisible,B=n.getTooltipContainer,M=n.overlayInnerStyle,G=Object(W.a)(n,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),J=Object(C.useRef)(null);Object(C.useImperativeHandle)(o,function(){return J.current});var K=Object(ie.a)({},G);"visible"in n&&(K.popupVisible=n.visible);var Z=function(){var Ie=n.arrowContent,_e=Ie===void 0?null:Ie,ye=n.overlay,Ke=n.id;return[C.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},_e),C.createElement(O,{key:"content",prefixCls:g,id:Ke,overlay:ye,overlayInnerStyle:M})]},le=!1,de=!1;if(typeof z=="boolean")le=z;else if(z&&Object(ce.a)(z)==="object"){var Te=z.keepParent;le=Te===!0,de=Te===!1}return C.createElement(D.a,Object.assign({popupClassName:r,prefixCls:g,popup:Z,action:a,builtinPlacements:T.a,popupPlacement:w,ref:J,popupAlign:N,getPopupContainer:B,onPopupVisibleChange:_,afterPopupVisibleChange:x,popupTransitionName:h,popupAnimation:E,defaultPopupVisible:q,destroyPopupOnHide:le,autoDestroy:de,mouseLeaveDelay:v,popupStyle:y,mouseEnterDelay:t},K),m)},p=Object(C.forwardRef)(f),c=Xe.a=p},OZM5:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return p}),V.d(Xe,"a",function(){return c}),V.d(Xe,"k",function(){return s}),V.d(Xe,"h",function(){return n}),V.d(Xe,"i",function(){return o}),V.d(Xe,"g",function(){return r}),V.d(Xe,"c",function(){return l}),V.d(Xe,"d",function(){return a}),V.d(Xe,"j",function(){return d}),V.d(Xe,"e",function(){return v}),V.d(Xe,"f",function(){return y});var ce=V("KQm4"),ie=V("U8pU"),W=V("Ff2n"),C=V("cDcd"),D=V.n(C),T=V("Kwbf"),A=V("WaYH"),O=.25,f=2;function p(b,g){var m=b.slice(),_=m.indexOf(g);return _>=0&&m.splice(_,1),m}function c(b,g){var m=b.slice();return m.indexOf(g)===-1&&m.push(g),m}function s(b){return b.split("-")}function n(b,g){return"".concat(b,"-").concat(g)}function o(b){return b&&b.type&&b.type.isTreeNode}function r(b,g){var m=[b],_=g[b];function x(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(E){var S=E.key,w=E.children;m.push(S),x(w)})}return x(_.children),m}function l(b,g){var m=b.clientY,_=g.selectHandle.getBoundingClientRect(),x=_.top,h=_.bottom,E=_.height,S=Math.max(E*O,f);return m<=x+S?-1:m>=h-S?1:0}function a(b,g){if(!b)return;var m=g.multiple;return m?b.slice():b.length?[b[0]]:b}var i=function(g){return g};function t(b,g){if(!b)return[];var m=g||{},_=m.processProps,x=_===void 0?i:_,h=Array.isArray(b)?b:[b];return h.map(function(E){var S=E.children,w=Object(W.a)(E,["children"]),R=t(S,g);return D.a.createElement(A.a,Object.assign({},x(w)),R)})}function d(b){if(!b)return null;var g;if(Array.isArray(b))g={checkedKeys:b,halfCheckedKeys:void 0};else if(Object(ie.a)(b)==="object")g={checkedKeys:b.checked||void 0,halfCheckedKeys:b.halfChecked||void 0};else return Object(T.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function v(b,g){var m=new Set;function _(x){if(m.has(x))return;var h=g[x];if(!h)return;m.add(x);var E=h.parent,S=h.node;if(S.disabled)return;E&&_(E.key)}return(b||[]).forEach(function(x){_(x)}),Object(ce.a)(m)}function y(b){var g={};return Object.keys(b).forEach(function(m){(m.startsWith("data-")||m.startsWith("aria-"))&&(g[m]=b[m])}),g}},"OkW/":function(nt,Xe,V){},Ot1p:function(nt,Xe,V){"use strict";var ce=V("2qtc"),ie=V("kLXV"),W=V("rAM+"),C=V("miYZ"),D=V("tsqr"),T=V("9og8"),A=V("tJVT"),O=V("jrin"),f=V("WmNS"),p=V.n(f),c=V("cDcd"),s=V.n(c),n=V("VrN/"),o=V.n(n),r=V("bdgK"),l=V("p77/"),a=V("Bd2K"),i=V("ELLl"),t=V("19Vz"),d=V("lZu9"),v=V("+NIl"),y=V("kSUc"),b=V("9Bee"),g=function(Ve){var at=Ve.value,_t=at===void 0?"":at,kt=Ve.className,Bt=Ve.showTextOnly,jt=Ve.showLines,At=Ve.style,pt=At===void 0?{}:At,gt=Object(c.useMemo)(function(){return""},[_t]);return s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{dangerouslySetInnerHTML:{__html:gt}}))},m=V("0Owb"),_=V("dejd"),x=V("C+DQ"),h=V("1vsH"),E=V("m3rI"),S=[{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 w(Ve){var at=Ve.onActionCallback,_t=Ve.title,kt=Ve.icon,Bt=Ve.actionName,jt=Ve.className,At=jt===void 0?"":jt,pt=Ve.children;function gt(){at(Bt)}return s.a.createElement("a",{title:_t,className:At,onClick:gt},s.a.createElement("i",{className:"md-iconfont ".concat(kt)}),pt)}var R=function(Ve){var at=Ve.watch,_t=Ve.showNullButton,kt=Ve.onActionCallback,Bt=Ve.fullScreen,jt=Ve.insertTemp,At=Ve.hidetoolBar,pt=Ve.uuid,gt=Ve.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.G)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(E.a.PROXY_SERVER)));var rt=[].concat(S,[{title:"".concat(at?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(at?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return s.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&rt.map(function(Oe,ze){return s.a.createElement("li",{key:ze},Oe.actionName?s.a.createElement(w,Object(m.a)({},Oe,{onActionCallback:kt})):s.a.createElement("span",{className:"v-line"}))}),_t?s.a.createElement("li",null,s.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:kt},s.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,jt&&s.a.createElement("li",null,s.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(jt),onActionCallback:kt},s.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),s.a.createElement("li",{className:"btn-full-screen"},s.a.createElement(w,{icon:"".concat(Bt?"icon-shrink":"icon-enlarge"),title:Bt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:kt})))},N=V("M8RZ"),F=V("+L6B"),z=V("2/Rp"),q=V("y8nQ"),B=V("Vl3Y"),M=V("5NDa"),G=V("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},K=function(Ve){var at=Ve.callback,_t=Ve.onCancel;function kt(Bt){at(Bt)}return s.a.createElement(B.a,Object(m.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:kt}),s.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},s.a.createElement(G.a,null)),s.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},s.a.createElement(G.a,null)),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(z.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},Z=V("7ahc"),le=V("HmJG"),de=V("BjJ7"),Te=B.a.useForm,we={width:280,marginRight:10},Ie={labelCol:{span:5},wrapperCol:{span:19}},_e=function(Ve){var at=Ve.callback,_t=Ve.onCancel,kt=Te(),Bt=Object(A.a)(kt,1),jt=Bt[0];function At(rt){at(rt)}function pt(rt,Oe){if(rt.status===-1){D.b.error(rt.message);return}jt.setFieldsValue({src:"/api/attachments/".concat(rt.id),type:Oe.type})}function gt(rt){var Oe=rt.target.files[0];Ke(Oe,pt)}return s.a.createElement(B.a,Object(m.a)({form:jt},Ie,{className:"upload-image-panel",onFinish:At}),s.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},s.a.createElement("div",{className:"flex-container"},s.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},s.a.createElement(G.a,{style:we})),s.a.createElement(ye,{onFileChange:gt}))),s.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},s.a.createElement(G.a,{style:{width:264}})),s.a.createElement(B.a.Item,{style:{textAlign:"right"}},s.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(z.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))};function ye(Ve){var at=Ve.onFileChange;return s.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",s.a.createElement("input",{type:"file",onChange:at}))}function Ke(Ve,at){if(!Ve)throw new String("\u6CA1\u6709\u6587\u4EF6");var _t=new FormData;_t.append("editormd-image-file",Ve),_t.append("file_param_name","editormd-image-file"),_t.append("byxhr","true");var kt=new window.XMLHttpRequest;kt.withCredentials=!0,kt.addEventListener("load",function(Bt){at(JSON.parse(Bt.target.responseText),Ve)},!1),kt.addEventListener("error",function(Bt){console.error(Bt)},!1),kt.open("POST","".concat(de.a,"/api/attachments.json")),kt.send(_t)}var Me=V("giR+"),Fe=V("fyUT"),Ge=V("7Kak"),Ee=V("9yH6"),me=Ee.a.Group,We={margin:"0 8px"},He=function(Ve){var at=Ve.callback,_t=Ve.onCancel;function kt(Bt){at(Bt)}return s.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:kt},s.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},s.a.createElement("span",{style:We},"\u5355\u5143\u683C\u6570\uFF1A"),s.a.createElement("span",{style:We},"\u884C\u6570"),s.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},s.a.createElement(Fe.a,null)),s.a.createElement("span",{style:We},"\u5217\u6570"),s.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},s.a.createElement(Fe.a,null))),s.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},s.a.createElement("span",{style:We},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),s.a.createElement(B.a.Item,{name:"align"},s.a.createElement(me,null,s.a.createElement(Ee.a,{value:"default"},s.a.createElement("i",{className:"fa fa-align-justify"})),s.a.createElement(Ee.a,{value:"left"},s.a.createElement("i",{className:"fa fa-align-left"})),s.a.createElement(Ee.a,{value:"center"},s.a.createElement("i",{className:"fa fa-align-center"})),s.a.createElement(Ee.a,{value:"right"},s.a.createElement("i",{className:"fa fa-align-right"}))))),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(z.a,{type:"ghost",onClick:_t},"\u53D6\u6D88")))},it=V("ErOA"),re=V("7Cbv"),P="link",j="upload-image",ee="code-block",$="add-table",Q="------------",xe={default:Q,left:":".concat(Q),center:":".concat(Q,":"),right:"".concat(Q,":")},De=V("9VGf"),dt,Ne;function Be(){}var tt=0,lt=1e4,qe="\u2581",Ye=`
|
|
|
**\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 je(Ve){return/^\d+$/.test(Ve)?"".concat(Ve,"px"):Ve}var Ue=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=Ue?"Cmd":"Ctrl",be=["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"],Ce=(dt={},Object(O.a)(dt,ke+"-B","bold"),Object(O.a)(dt,ke+"-I","italic"),dt),Pe=(Ne={},Object(O.a)(Ne,P,"\u6DFB\u52A0\u94FE\u63A5"),Object(O.a)(Ne,ee,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(O.a)(Ne,j,"\u6DFB\u52A0\u6587\u4EF6"),Object(O.a)(Ne,$,"\u6DFB\u52A0\u8868\u683C"),Ne),Le=Xe.a=function(Ve){var at=Ve.defaultValue,_t=at===void 0?"":at,kt=Ve.onChange,Bt=Ve.width,jt=Bt===void 0?"100%":Bt,At=Ve.height,pt=At===void 0?400:At,gt=Ve.miniToolbar,rt=gt===void 0?!1:gt,Oe=Ve.isFocus,ze=Oe===void 0?!1:Oe,vt=Ve.watch,st=Ve.insertTemp,It=Ve.mode,Pt=It===void 0?"markdown":It,Ze=Ve.id,mt=Ze===void 0?"markdown-editor-id":Ze,Lt=Ve.showResizeBar,Mt=Lt===void 0?!1:Lt,$t=Ve.noStorage,Re=$t===void 0?!1:$t,ve=Ve.showNullButton,X=ve===void 0?!1:ve,ne=Ve.hidetoolBar,oe=ne===void 0?!1:ne,he=Ve.fullScreen,Ae=he===void 0?!1:he,Qe=Ve.onBlur,ot=Ve.onCMBeforeChange,Rt=Ve.onFullScreen,Nt=Ve.className,ht=Nt===void 0?"":Nt,Dt=Ve.disablePaste,sn=Dt===void 0?!1:Dt,Ct=Ve.placeholder,hn=Ct===void 0?"":Ct,rn=Ve.values,ae=rn===void 0?"":rn,U=Object(c.useState)(null),H=Object(A.a)(U,2),te=H[0],pe=H[1],se=Object(c.useState)(_t),$e=Object(A.a)(se,2),yt=$e[0],Ot=$e[1],Yt=Object(c.useState)(vt),St=Object(A.a)(Yt,2),Wt=St[0],ln=St[1],Bn=Object(c.useState)(Ae),Oi=Object(A.a)(Bn,2),mi=Oi[0],Wn=Oi[1],di=Object(c.useState)(""),hr=Object(A.a)(di,2),vi=hr[0],gi=hr[1],xi=Object(c.useState)(0),Bi=Object(A.a)(xi,2),Ai=Bi[0],sr=Bi[1],Di=Object(c.useState)(pt),fr=Object(A.a)(Di,2),lr=fr[0],Wi=fr[1],Gi=Object(c.useState)(!1),vr=Object(A.a)(Gi,2),Rr=vr[0],ur=vr[1],Hn=Object(c.useRef)(Object(re.a)()),wn=Object(c.useRef)(!1),wi=Object(c.useRef)(),Mn=Object(c.useRef)(),Ri=Object(c.useRef)(),oi=Object(c.useRef)(),Lr=Object(c.useRef)(),Ni=function(){var fn=Object(T.a)(p.a.mark(function Cn(){var mn,Un;return p.a.wrap(function(_i){for(;;)switch(_i.prev=_i.next){case 0:return _i.next=2,Object(it.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Hn.current}});case 2:Un=_i.sent,Un!=null&&(mn=Un.attachments)!==null&&mn!==void 0&&mn.length&&(console.log("cm:",te,Mn),Un.attachments.map(function(nn){nn.content_type.indexOf("image")>-1?te.replaceSelection(".concat(nn.content_type,")")):nn.content_type.indexOf("video")>-1?te.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):nn.content_type.indexOf("pdf")>-1?te.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(nn.id,"?type=").concat(nn.content_type,'&disposition=inline" target="_blank">').concat(nn.name,"</a>")):te.replaceSelection("[".concat(nn.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(nn.id,"?type=").concat(nn.content_type,")"))}));case 4:case"end":return _i.stop()}},Cn)}));return function(){return fn.apply(this,arguments)}}();Object(c.useEffect)(function(){Ot(ae),te==null||te.setValue(ae)},[ae]),Object(c.useEffect)(function(){Rt==null||Rt(mi)},[mi]),Object(c.useEffect)(function(){if(Mn.current){var fn=o.a.fromTextArea(Mn.current,{mode:Pt,lineNumbers:!rt,lineWrapping:!0,value:_t,autoCloseTags:!0,autoCloseBrackets:!0});ze&&fn.focus();function Cn(mn,Un){if(sn){Un.preventDefault();return}var ni=Un.clipboardData;if(ni){var _i=ni.types.toString(),nn=ni.items;if(_i==="Files"||ni.types.indexOf("Files")>-1){if(Un.preventDefault(),Pt=="stex")return;try{var Li,Zi=nn[1];((Li=nn[0])===null||Li===void 0?void 0:Li.kind)==="file"&&(Zi=nn[0]);var zn=Zi.getAsFile(),Dr=zn.name.split(".").pop();Ke(zn,function(hi){if(hi.id){var Vi,ct,xt;(zn==null||((Vi=zn.type)===null||Vi===void 0)?void 0:Vi.indexOf("image"))>-1?fn.replaceSelection(".concat(hi.content_type,")")):(zn==null||((ct=zn.type)===null||ct===void 0)?void 0:ct.indexOf("video"))>-1?fn.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,'"></video>')):(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("pdf"))>-1?fn.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,"?type=").concat(zn.type,'&disposition=inline" target="_blank">').concat(zn.name,"</a>")):be.includes(Dr)?fn.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,'?type=office&disposition=inline" target="_blank">').concat(zn.name,"</a>")):fn.replaceSelection("[".concat(zn.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,"?type=").concat(hi.content_type,")"))}else(hi==null?void 0:hi.status)===401&&(document.location.href="/user/login")})}catch(hi){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return fn.on("paste",Cn),fn.on("dragleave",function(mn,Un){Ri.current.classList.remove("mouse-hover-md")}),fn.on("dragover",function(mn,Un){Ri.current.classList.add("mouse-hover-md")}),fn.on("drop",function(mn,Un){Ri.current.classList.add("mouse-hover-md");var ni;if(ni=Un.dataTransfer.files,ni.length>0){Un.preventDefault(),Un.stopPropagation();for(var _i=function(Zi){var zn=ni[Zi],Dr=zn.name.split(".").pop();Ke(zn,function(hi){if(hi.id){var Vi,ct,xt;(zn==null||((Vi=zn.type)===null||Vi===void 0)?void 0:Vi.indexOf("image"))>-1?fn.replaceSelection(".concat(hi.content_type,")")):(zn==null||((ct=zn.type)===null||ct===void 0)?void 0:ct.indexOf("video"))>-1?fn.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,'"></video>')):(zn==null||((xt=zn.type)===null||xt===void 0)?void 0:xt.indexOf("pdf"))>-1?fn.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,"?type=").concat(zn.type,'&disposition=inline" target="_blank">').concat(zn.name,"</a>")):be.includes(Dr)?fn.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,'?type=office&disposition=inline" target="_blank">').concat(zn.name,"</a>")):fn.replaceSelection("[".concat(zn.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(hi.id,"?type=").concat(hi.content_type,")"))}else(hi==null?void 0:hi.status)===401&&(document.location.href="/user/login")})},nn=0;nn<ni.length;nn++)_i(nn)}}),pe(fn),function(){fn.off("paste",Cn)}}},[]);var Qi=Object(c.useCallback)(function(){if(Ri.current)try{}catch(fn){console.log(fn,"---- to set md editor body height")}},[lr,Ri,mi]);Object(c.useEffect)(function(){function fn(){var mn=new r.default(function(Un){var ni=Object(W.a)(Un),_i;try{for(ni.s();!(_i=ni.n()).done;){var nn=_i.value;(nn.target.offsetHeight>0||nn.target.offsetWidth>0)&&(Qi(),te.setSize("100%","100%"),te.refresh())}}catch(Li){ni.e(Li)}finally{ni.f()}});return mn.observe(Mn.current.parentElement),mn}if(te){var Cn=fn();return function(){Cn.unobserve(Mn.current.parentElement)}}},[te,Qi]),Object(c.useEffect)(function(){if(te){for(var fn=[],Cn=function(){var nn=Un[mn];ni=Object(A.a)(nn,2);var Li=ni[0],Zi=ni[1],zn=Object(O.a)({},Li,function(){Br(Zi)});fn.push(zn),te.addKeyMap(zn)},mn=0,Un=Object.entries(Ce);mn<Un.length;mn++){var ni;Cn()}return wi.current=setInterval(function(){wn.current&&Ni()},4e3),function(){clearInterval(wi.current);var _i=Object(W.a)(fn),nn;try{for(_i.s();!(nn=_i.n()).done;){var Li=nn.value;te.removeKeyMap(Li)}}catch(Zi){_i.e(Zi)}finally{_i.f()}}}},[te]),Object(c.useEffect)(function(){Ae!==mi&&Wn(Ae)},[Ae]),Object(De.a)(function(){if(!Re&&Ai>0){var fn=new Date().getTime(),Cn=window.sessionStorage.getItem(mt);fn>=Ai+lt&&(!Cn||Cn!==yt)&&(window.sessionStorage.setItem(mt,yt),ur(!0))}},lt),Object(c.useEffect)(function(){ln(vt)},[te,vt]),Object(c.useEffect)(function(){te&&(ze&&te.focus())},[te,ze]),Object(c.useEffect)(function(){if(Wt&&te){var fn=te.getScrollerElement();function Cn(mn){var Un=mn.target;if(Lr.current){var ni=Un.scrollTop/Un.scrollHeight;Lr.current.scrollTop=Lr.current.scrollHeight*ni}}return fn.addEventListener("scroll",Cn),function(){fn.removeEventListener("scroll",Cn)}}},[te,Wt]),Object(c.useEffect)(function(){if(te&&ot){function fn(Cn,mn){ot(Cn,mn)}return te.on("beforeChange",fn),function(){te.off("beforeChange",fn)}}},[te,ot]),Object(c.useEffect)(function(){if(te&&Qe){function fn(){Qe(te.getValue())}return te.on("blur",fn),function(){te.off("blur",fn)}}},[te,Qe]),Object(c.useEffect)(function(){if(te){function fn(Cn){var mn=Cn.getValue();Ot(mn),sr(new Date().getTime()),Cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),kt&&kt(mn)}return te.on("change",fn),function(){te.off("change",fn)}}},[te,kt]),Object(c.useEffect)(function(){te&&(_t==null?(te.setValue(""),Ot("")):_t!==te.getValue()&&(te.setValue(_t),Ot(_t),te.setCursor(te.lineCount(),0)))},[te,_t]);var Br=Object(c.useCallback)(function(fn){var Cn=te.getCursor(),mn=te.getSelection(),Un=mn.split(`
|
|
|
`);switch(fn){case"bold":return te.replaceSelection("**"+mn+"**"),mn===""&&te.setCursor(Cn.line,Cn.ch+2),te.focus();case"italic":return te.replaceSelection("*"+mn+"*"),mn===""&&te.setCursor(Cn.line,Cn.ch+1),te.focus();case"code":return te.replaceSelection("`"+mn+"`"),mn===""&&te.setCursor(Cn.line,Cn.ch+1),te.focus();case"inline-latex":return te.replaceSelection("`$$"+mn+"$$`"),mn===""&&te.setCursor(Cn.line,Cn.ch+3),te.focus();case"latex":return te.replaceSelection("```latex\n"+mn+"\n```"),te.setCursor(Cn.line+1,mn.length+1),te.focus();case"line-break":return te.replaceSelection(`<br/>
|
|
|
`),te.focus();case"list-ul":return mn===""?te.replaceSelection("- "+mn):te.replaceSelection(Un.map(function(ni){return ni===""?"":"- ".concat(ni)}).join(`
|
|
|
`)),te.focus();case"list-ol":return mn===""?te.replaceSelection("1. "+mn):te.replaceSelection(Un.map(function(ni,_i){return ni===""?"":"".concat(_i+1,". ").concat(ni)}).join(`
|
|
|
`)),te.focus();case"add-null-ch":return mn===""&&te.setCursor(Cn.line,Cn.ch+1),te.replaceSelection(qe),te.focus();case"inster-template-1":return mn===""&&te.setCursor(Cn.line,Cn.ch),te.replaceSelection(Ye),te.focus();case"eraser":return te.setValue(""),te.focus();case"trigger-watch":return ln(!Wt),te.focus();case"trigger-full-screen":return Wn(!mi),te.focus();case P:gi(P);return;case ee:gi(ee);return;case j:gi(j);return;case $:gi($);return;default:throw new Error}},[te,Wt,mi]),qi=Object(c.useCallback)(function(fn){gi("");switch(vi){case P:var Cn=fn.title,mn=fn.link;return te.replaceSelection("[".concat(Cn,"](").concat(mn,")")),te.focus();case ee:var Un=fn.language,ni=fn.content;return te.replaceSelection(["```"+Un,ni,"```"].join(`
|
|
|
`)),te.focus();case j:var _i=fn.src,nn=fn.alt;return nn?te.replaceSelection(".concat(_i,' "').concat(nn,'" )')):te.replaceSelection("")),te.focus();case $:for(var Li=fn.row,Zi=fn.col,zn=fn.align,Dr=`
|
|
|
`,hi=0;hi<Li;hi++){for(var Vi=[],ct=[],xt=0;xt<Zi;xt++)hi===1&&ct.push(xe[zn]),Vi.push(" ");hi===1&&(Dr+="| ".concat(ct.join(" | "),` |
|
|
|
`)),Dr+="| ".concat(Vi.join(Zi===1?"":" | "),` |
|
|
|
`)}return te.replaceSelection(Dr+`
|
|
|
`),te.focus();default:throw new Error}},[te,vi]),Kr=Object(c.useMemo)(function(){switch(vi){case P:return s.a.createElement(K,{callback:qi,onCancel:Nr});case ee:return s.a.createElement(Z.b,{callback:qi,onCancel:Nr});case j:return s.a.createElement(_e,{callback:qi,onCancel:Nr});case $:return s.a.createElement(He,{callback:qi,onCancel:Nr});default:return null}},[vi]);function Nr(){gi("")}Object(c.useEffect)(function(){if(oi.current){var fn=oi.current,Cn=!1,mn=0;function Un(nn){Cn=!0,mn=nn.pageY}function ni(){Cn=!1}function _i(nn){if(Cn){var Li=nn.pageY-mn;Li<0&&(Li=0),Li>300&&(Li=300);var Zi=pt+Li+"px";Wi(Zi)}}return fn.addEventListener("mousedown",Un),document.addEventListener("mousemove",_i),document.addEventListener("mouseup",ni),function(){fn.removeEventListener("mousedown",Un),document.removeEventListener("mousemove",_i),document.removeEventListener("mouseup",ni)}}},[te,oi]),Object(c.useEffect)(function(){Wi(pt)},[pt]);var Ir=je(jt),Jr=je(lr),xr={width:Ir,height:Jr},Qr=Object(c.useMemo)(function(){if(Ai){var fn=new Date(Ai),Cn=fn.getHours(),mn=fn.getMinutes(),Un=fn.getSeconds();return Cn=Cn<10?"0"+Cn:Cn,mn=mn<10?"0"+mn:mn,Un=Un<10?"0"+Un:Un,"".concat(Cn,":").concat(mn,":").concat(Un)}return 0},[Ai]);function qr(){window.sessionStorage.removeItem(mt),ur(!1),sr(0)}function _r(){ur(!1),sr(0),te.setValue(window.sessionStorage.getItem(mt))}function ea(fn,Cn){var mn=te.getValue();mn=mn.replace(fn,Cn),Ot(mn),te==null||te.setValue(mn)}return s.a.createElement(c.Fragment,null,s.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ri},s.a.createElement("div",{className:"markdown-editor-container ".concat(ht," ").concat(Wt?"on-preview":""," ").concat(rt?"mini":""," ").concat(mi?"full-screen":""),style:xr},s.a.createElement(R,{insertTemp:st,watch:Wt,fullScreen:mi,showNullButton:X,onActionCallback:Br,hidetoolBar:oe,uuid:Hn.current,setOpenPhones:function(){wn.current=!0}}),s.a.createElement("div",{className:"markdown-editor-body"},s.a.createElement("div",{className:"codemirror-container"},s.a.createElement("textarea",{ref:Mn,placeholder:hn})),Wt?s.a.createElement("div",{ref:Lr,className:"preview-container"},Pt==="stex"&&s.a.createElement(g,{value:yt}),Pt!=="stex"&&s.a.createElement(b.a,{edit:!0,value:yt,replaces:ea})):null))),Mt?s.a.createElement("a",{ref:oi,className:"editor-resize"}):null,s.a.createElement(N.a,null,Pe[vi]?s.a.createElement(ie.a,{centered:!0,title:Pe[vi],visible:!0,onCancel:Nr,footer:null,className:"markdown-popup-form"},Kr):null))}},P5Jw:function(nt,Xe,V){"use strict";var ce=V("rHrb"),ie=ce.CopyToClipboard;ie.CopyToClipboard=ie,nt.exports=ie},PD8m:function(nt,Xe){nt.exports={name:"memoryStorage",read:ce,write:ie,each:W,remove:C,clearAll:D};var V={};function ce(T){return V[T]}function ie(T,A){V[T]=A}function W(T){for(var A in V)V.hasOwnProperty(A)&&T(V[A],A)}function C(T){delete V[T]}function D(T){V={}}},RELg:function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global;nt.exports={name:"oldIE-userDataStorage",write:A,read:O,each:f,remove:p,clearAll:c};var W="storejs",C=ie.document,D=o(),T=(ie.navigator?ie.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function A(r,l){if(T)return;var a=n(r);D(function(i){i.setAttribute(a,l),i.save(W)})}function O(r){if(T)return;var l=n(r),a=null;return D(function(i){a=i.getAttribute(l)}),a}function f(r){D(function(l){for(var a=l.XMLDocument.documentElement.attributes,i=a.length-1;i>=0;i--){var t=a[i];r(l.getAttribute(t.name),t.name)}})}function p(r){var l=n(r);D(function(a){a.removeAttribute(l),a.save(W)})}function c(){D(function(r){var l=r.XMLDocument.documentElement.attributes;r.load(W);for(var a=l.length-1;a>=0;a--)r.removeAttribute(l[a].name);r.save(W)})}var s=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function n(r){return r.replace(/^\d/,"___$&").replace(s,"___")}function o(){if(!C||!C.documentElement||!C.documentElement.addBehavior)return null;var r="script",l,a,i;try{a=new ActiveXObject("htmlfile"),a.open(),a.write("<"+r+">document.w=window</"+r+'><iframe src="/favicon.ico"></iframe>'),a.close(),l=a.w.frames[0].document,i=l.createElement("div")}catch(t){i=C.createElement("div"),l=C.body}return function(t){var d=[].slice.call(arguments,0);d.unshift(i),l.appendChild(i),i.addBehavior("#default#userData"),i.load(W),t.apply(this,d),l.removeChild(i);return}}},RpDr:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return b}),V.d(Xe,"c",function(){return _});var ce=V("+L6B"),ie=V("2/Rp"),W=V("tJVT"),C=V("k1fw"),D=V("jrin"),T=V("5NDa"),A=V("5rEg"),O=V("cDcd"),f=V.n(O),p=V("8Skl"),c=V("y3Kf"),s=V("bdLU"),n=V("J66h"),o=V.n(n),r=V("++UQ"),l=V.n(r),a=V("IxHN"),i=V("9Bee"),t=V("1vsH"),d,v=A.a.TextArea,y={visible:!1,tabIndex:"0"},b=(d={},Object(D.a)(d,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(D.a)(d,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(D.a)(d,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(D.a)(d,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(D.a)(d,4,"\u7F16\u8BD1\u5931\u8D25"),Object(D.a)(d,5,"\u6267\u884C\u5931\u8D25"),d),g;(function(h){h[h.SET_VISIBLE=0]="SET_VISIBLE",h[h.SET_TABINDEX=1]="SET_TABINDEX"})(g||(g={}));function m(h,E){switch(E.type){case g.SET_VISIBLE:return Object(C.a)(Object(C.a)({},h),{},{visible:E.payload});case g.SET_TABINDEX:return Object(C.a)(Object(C.a)({},h),{},{tabIndex:E.payload});default:throw new Error}}function _(h){var E=h.status,S=h.error_msg,w=h.output,R=h.input,N=h.expected_output,F=h.is_file,z=h.input_file_url,q=h.output_file_url,B=h.expected_output_file_url,M=null,G={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(E){case s.a.NOMATCH:M=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!F&&f.a.createElement(i.a,{value:R,style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(z,R)}},R)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!F&&f.a.createElement(i.a,{value:w&&n.Base64.decode(w)||"",style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(q,w)}},w)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!F&&f.a.createElement(i.a,{value:N&&n.Base64.decode(N)||"",style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(B,N)}},N)));break;case s.a.EXECUTEFAILURE:M=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&f.a.createElement(i.a,{value:R,style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(z,R)}},R)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.COMPILEFAILURE:M=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&f.a.createElement(i.a,{value:R,style:G}),F&&f.a.createElement("div",{style:G},f.a.createElement("a",{onClick:function(){return Object(t.y)(z,R)}},R)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.PODFAILURE:M=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:M=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",M," ")}function x(h){var E=h.status,S=h.error_msg,w=h.execute_time,R=h.output,N=h.input,F=h.expected_output,z=h.is_file,q=h.input_file_url,B=h.output_file_url,M=h.expected_output_file_url,G=null;switch(E){case s.a.OK:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",w),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,n.Base64.decode(R)));break;case s.a.NOMATCH:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,N)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",R&&n.Base64.decode(R)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",F&&n.Base64.decode(F)));break;case s.a.EXECUTEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,N)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.COMPILEFAILURE:G=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,N)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},n.Base64.decode(S)));break;case s.a.PODFAILURE:G=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:G=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",G," ")}Xe.b=function(h){var E=h.id,S=h.input,w=h.debuging,R=h.submitting,N=h.executingMessage,F=h.debugResult,z=h.onChangeInput,q=h.onDebugCode,B=h.onSubmitCode,M=Object(O.useReducer)(m,y),G=Object(W.a)(M,2),J=G[0],K=G[1],Z=J.visible,le=J.tabIndex;Object(O.useEffect)(function(){K({type:g.SET_VISIBLE,payload:!1})},[E]);function de(_e){var ye=_e.target.id;K({type:g.SET_TABINDEX,payload:ye})}function Te(){K({type:g.SET_VISIBLE,payload:!Z})}var we=Object(O.useMemo)(function(){if(F){var _e=F.status;return f.a.createElement(f.a.Fragment,null,x(F))}return null},[F]);function Ie(){K({type:g.SET_VISIBLE,payload:!0}),K({type:g.SET_TABINDEX,payload:"1"}),q()}return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(Z?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:le==="0"?"active":"",id:"0",onClick:de},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:le==="1"?"active":"",id:"1",onClick:de},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(le==="0"?"":"hide")},f.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:S,onChange:z})),f.a.createElement("div",{className:"tab-panel-body ".concat(le==="1"?"":"hide")},w?f.a.createElement(a.a,{message:N}):F?f.a.createElement("section",{style:{height:200}}," ",we," "):f.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),f.a.createElement("a",{className:"btn-collapse ".concat(Z?"up":""),onClick:Te},Z?f.a.createElement(p.a,null):f.a.createElement(c.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},f.a.createElement(ie.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),f.a.createElement(ie.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(ie.a,{className:"btn-green",type:"ghost",loading:w,onClick:Ie},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(ie.a,{type:"primary",loading:R,disabled:R,onClick:function(){K({type:g.SET_VISIBLE,payload:!1}),B()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(nt,Xe,V){nt.exports=V.p+"static/time.a3dc82f3.svg"},"SA+Z":function(nt,Xe,V){var ce=V("wTVA"),ie=V("EbDI"),W=V("ZhPi"),C=V("wkBT");function D(T){return ce(T)||ie(T)||W(T)||C()}nt.exports=D,nt.exports.__esModule=!0,nt.exports.default=nt.exports},SJMd:function(nt,Xe){/**
|
|
|
* @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 V,ce,ie,W=!1,C,D;window.PR_SHOULD_USE_CONTINUATION=!0;var T,A;(function(){var O=window,f=["break,continue,do,else,for,if,return,while"],p=[f,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],c=[p,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],s=[c,"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"],n=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[c,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",l=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",i=[f,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],t=[f,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[f,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[s,o,n,l,a,i,t,d],y=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,b="str",g="kwd",m="com",_="typ",x="lit",h="pun",E="pln",S="tag",w="dec",R="src",N="atn",F="atv",z="nocode",q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(me){for(var We=0,He=!1,it=!1,re=0,P=me.length;re<P;++re){var j=me[re];if(j.ignoreCase)it=!0;else if(/[a-z]/i.test(j.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){He=!0,it=!1;break}}var ee={b:8,t:9,n:10,v:11,f:12,r:13};function $(Ne){var Be=Ne.charCodeAt(0);if(Be!==92)return Be;var tt=Ne.charAt(1);return Be=ee[tt],Be||("0"<=tt&&tt<="7"?parseInt(Ne.substring(1),8):tt==="u"||tt==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function Q(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var Be=String.fromCharCode(Ne);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function xe(Ne){var Be=Ne.substring(1,Ne.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),tt=[],lt=Be[0]==="^",qe=["["];lt&&qe.push("^");for(var Ye=lt?1:0,je=Be.length;Ye<je;++Ye){var Ue=Be[Ye];if(/\\[bdsw]/i.test(Ue))qe.push(Ue);else{var ke=$(Ue),be;Ye+2<je&&Be[Ye+1]==="-"?(be=$(Be[Ye+2]),Ye+=2):be=ke,tt.push([ke,be]),be<65||ke>122||(be<65||ke>90||tt.push([Math.max(65,ke)|32,Math.min(be,90)|32]),be<97||ke>122||tt.push([Math.max(97,ke)&~32,Math.min(be,122)&~32]))}}tt.sort(function(Ve,at){return Ve[0]-at[0]||at[1]-Ve[1]});for(var Ce=[],Pe=[],Ye=0;Ye<tt.length;++Ye){var Le=tt[Ye];Le[0]<=Pe[1]+1?Pe[1]=Math.max(Pe[1],Le[1]):Ce.push(Pe=Le)}for(var Ye=0;Ye<Ce.length;++Ye){var Le=Ce[Ye];qe.push(Q(Le[0])),Le[1]>Le[0]&&(Le[1]+1>Le[0]&&qe.push("-"),qe.push(Q(Le[1])))}return qe.push("]"),qe.join("")}function De(Ne){for(var Be=Ne.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),tt=Be.length,lt=[],qe=0,Ye=0;qe<tt;++qe){var je=Be[qe];if(je==="(")++Ye;else if(je.charAt(0)==="\\"){var Ue=+je.substring(1);Ue&&(Ue<=Ye?lt[Ue]=-1:Be[qe]=Q(Ue))}}for(var qe=1;qe<lt.length;++qe)lt[qe]===-1&&(lt[qe]=++We);for(var qe=0,Ye=0;qe<tt;++qe){var je=Be[qe];if(je==="(")++Ye,lt[Ye]||(Be[qe]="(?:");else if(je.charAt(0)==="\\"){var Ue=+je.substring(1);Ue&&Ue<=Ye&&(Be[qe]="\\"+lt[Ue])}}for(var qe=0;qe<tt;++qe)Be[qe]==="^"&&Be[qe+1]!=="^"&&(Be[qe]="");if(Ne.ignoreCase&&He)for(var qe=0;qe<tt;++qe){var je=Be[qe],ke=je.charAt(0);je.length>=2&&ke==="["?Be[qe]=xe(je):ke!=="\\"&&(Be[qe]=je.replace(/[a-zA-Z]/g,function(Pe){var Le=Pe.charCodeAt(0);return"["+String.fromCharCode(Le&~32,Le|32)+"]"}))}return Be.join("")}for(var dt=[],re=0,P=me.length;re<P;++re){var j=me[re];if(j.global||j.multiline)throw new Error(""+j);dt.push("(?:"+De(j)+")")}return new RegExp(dt.join("|"),it?"gi":"g")}function M(me,We){var He=/(?:^|\s)nocode(?:\s|$)/,it=[],re=0,P=[],j=0;function ee($){var Q=$.nodeType;if(Q==1){if(He.test($.className))return;for(var xe=$.firstChild;xe;xe=xe.nextSibling)ee(xe);var De=$.nodeName.toLowerCase();(De==="br"||De==="li")&&(it[j]=`
|
|
|
`,P[j<<1]=re++,P[j++<<1|1]=$)}else if(Q==3||Q==4){var dt=$.nodeValue;dt.length&&(We?dt=dt.replace(/\r\n?/g,`
|
|
|
`):dt=dt.replace(/[ \t\r\n]+/g," "),it[j]=dt,P[j<<1]=re,re+=dt.length,P[j++<<1|1]=$)}}return ee(me),{sourceCode:it.join("").replace(/\n$/,""),spans:P}}function G(me,We,He,it,re){if(!He)return;var P={sourceNode:me,pre:1,langExtension:null,numberLines:null,sourceCode:He,spans:null,basePos:We,decorations:null};it(P),re.push.apply(re,P.decorations)}var J=/\S/;function K(me){for(var We=void 0,He=me.firstChild;He;He=He.nextSibling){var it=He.nodeType;We=it===1?We?me:He:it===3&&J.test(He.nodeValue)?me:We}return We===me?void 0:We}function Z(me,We){var He={},it;(function(){for(var j=me.concat(We),ee=[],$={},Q=0,xe=j.length;Q<xe;++Q){var De=j[Q],dt=De[3];if(dt)for(var Ne=dt.length;--Ne>=0;)He[dt.charAt(Ne)]=De;var Be=De[1],tt=""+Be;$.hasOwnProperty(tt)||(ee.push(Be),$[tt]=null)}ee.push(/[\0-\uffff]/),it=B(ee)})();var re=We.length,P=function(j){for(var ee=j.sourceCode,$=j.basePos,Q=j.sourceNode,xe=[$,E],De=0,dt=ee.match(it)||[],Ne={},Be=0,tt=dt.length;Be<tt;++Be){var lt=dt[Be],qe=Ne[lt],Ye=void 0,je;if(typeof qe=="string")je=!1;else{var Ue=He[lt.charAt(0)];if(Ue)Ye=lt.match(Ue[1]),qe=Ue[0];else{for(var ke=0;ke<re;++ke)if(Ue=We[ke],Ye=lt.match(Ue[1]),Ye){qe=Ue[0];break}Ye||(qe=E)}je=qe.length>=5&&qe.substring(0,5)==="lang-",je&&!(Ye&&typeof Ye[1]=="string")&&(je=!1,qe=R),je||(Ne[lt]=qe)}var be=De;if(De+=lt.length,!je)xe.push($+be,qe);else{var Ce=Ye[1],Pe=lt.indexOf(Ce),Le=Pe+Ce.length;Ye[2]&&(Le=lt.length-Ye[2].length,Pe=Le-Ce.length);var Ve=qe.substring(5);G(Q,$+be,lt.substring(0,Pe),P,xe),G(Q,$+be+Pe,Ce,ye(Ve,Ce),xe),G(Q,$+be+Le,lt.substring(Le),P,xe)}}j.decorations=xe};return P}function le(me){var We=[],He=[];me.tripleQuotedStrings?We.push([b,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?We.push([b,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):We.push([b,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&He.push([b,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var it=me.hashComments;it&&(me.cStyleComments?(it>1?We.push([m,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):We.push([m,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([b,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):We.push([m,/^#[^\r\n]*/,null,"#"])),me.cStyleComments&&(He.push([m,/^\/\/[^\r\n]*/,null]),He.push([m,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var re=me.regexLiterals;if(re){var P=re>1?"":`
|
|
|
\r`,j=P?".":"[\\S\\s]",ee="/(?=[^/*"+P+"])(?:[^/\\x5B\\x5C"+P+"]|\\x5C"+j+"|\\x5B(?:[^\\x5C\\x5D"+P+"]|\\x5C"+j+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+q+"("+ee+")")])}var $=me.types;$&&He.push([_,$]);var Q=(""+me.keywords).replace(/^ | $/g,"");Q.length&&He.push([g,new RegExp("^(?:"+Q.replace(/[\s,]+/g,"|")+")\\b"),null]),We.push([E,/^\s+/,null,` \r
|
|
|
\xA0`]);var xe="^.[^\\s\\w.$@'\"`/\\\\]*";return me.regexLiterals&&(xe+="(?!s*/)"),He.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[E,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[E,/^\\[\s\S]?/,null],[h,new RegExp(xe),null]),Z(We,He)}var de=le({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(me,We,He){for(var it=/(?:^|\s)nocode(?:\s|$)/,re=/\r\n?|\n/,P=me.ownerDocument,j=P.createElement("li");me.firstChild;)j.appendChild(me.firstChild);var ee=[j];function $(Be){var tt=Be.nodeType;if(tt==1&&!it.test(Be.className))if(Be.nodeName==="br")Q(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var lt=Be.firstChild;lt;lt=lt.nextSibling)$(lt);else if((tt==3||tt==4)&&He){var qe=Be.nodeValue,Ye=qe.match(re);if(Ye){var je=qe.substring(0,Ye.index);Be.nodeValue=je;var Ue=qe.substring(Ye.index+Ye[0].length);if(Ue){var ke=Be.parentNode;ke.insertBefore(P.createTextNode(Ue),Be.nextSibling)}Q(Be),je||Be.parentNode.removeChild(Be)}}}function Q(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function tt(Ye,je){var Ue=je?Ye.cloneNode(!1):Ye,ke=Ye.parentNode;if(ke){var be=tt(ke,1),Ce=Ye.nextSibling;be.appendChild(Ue);for(var Pe=Ce;Pe;Pe=Ce)Ce=Pe.nextSibling,be.appendChild(Pe)}return Ue}for(var lt=tt(Be.nextSibling,0),qe;(qe=lt.parentNode)&&qe.nodeType===1;)lt=qe;ee.push(lt)}for(var xe=0;xe<ee.length;++xe)$(ee[xe]);We===(We|0)&&ee[0].setAttribute("value",We);var De=P.createElement("ol");De.className="linenums";for(var dt=Math.max(0,We-1|0)||0,xe=0,Ne=ee.length;xe<Ne;++xe)j=ee[xe],j.className="L"+(xe+dt)%10,j.firstChild||j.appendChild(P.createTextNode("\xA0")),De.appendChild(j);me.appendChild(De)}function we(me){var We=/\bMSIE\s(\d+)/.exec(navigator.userAgent);We=We&&+We[1]<=8;var He=/\n/g,it=me.sourceCode,re=it.length,P=0,j=me.spans,ee=j.length,$=0,Q=me.decorations,xe=Q.length,De=0;Q[xe]=re;var dt,Ne;for(Ne=dt=0;Ne<xe;)Q[Ne]!==Q[Ne+2]?(Q[dt++]=Q[Ne++],Q[dt++]=Q[Ne++]):Ne+=2;for(xe=dt,Ne=dt=0;Ne<xe;){for(var Be=Q[Ne],tt=Q[Ne+1],lt=Ne+2;lt+2<=xe&&Q[lt+1]===tt;)lt+=2;Q[dt++]=Be,Q[dt++]=tt,Ne=lt}xe=Q.length=dt;var qe=me.sourceNode,Ye="";qe&&(Ye=qe.style.display,qe.style.display="none");try{for(var je=null;$<ee;){var Ue=j[$],ke=j[$+2]||re,be=Q[De+2]||re,lt=Math.min(ke,be),Ce=j[$+1],Pe;if(Ce.nodeType!==1&&(Pe=it.substring(P,lt))){We&&(Pe=Pe.replace(He,"\r")),Ce.nodeValue=Pe;var Le=Ce.ownerDocument,Ve=Le.createElement("span");Ve.className=Q[De+1];var at=Ce.parentNode;at.replaceChild(Ve,Ce),Ve.appendChild(Ce),P<ke&&(j[$+1]=Ce=Le.createTextNode(it.substring(lt,ke)),at.insertBefore(Ce,Ve.nextSibling))}P=lt,P>=ke&&($+=2),P>=be&&(De+=2)}}finally{qe&&(qe.style.display=Ye)}}var Ie={};function _e(me,We){for(var He=We.length;--He>=0;){var it=We[He];Ie.hasOwnProperty(it)?O.console&&console.warn("cannot override language handler %s",it):Ie[it]=me}}function ye(me,We){return me&&Ie.hasOwnProperty(me)||(me=/^\s*</.test(We)?"default-markup":"default-code"),Ie[me]}_e(de,["default-code"]),_e(Z([],[[E,/^[^<?]+/],[w,/^<!\w[^>]*(?:>|$)/],[m,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),_e(Z([[E,/^[\s]+/,null,` \r
|
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["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"]),_e(Z([],[[F,/^[\s\S]+/]]),["uq.val"]),_e(le({keywords:s,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),_e(le({keywords:"null,true,false"}),["json"]),_e(le({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),_e(le({keywords:n,cStyleComments:!0}),["java"]),_e(le({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),_e(le({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),_e(le({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),_e(le({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),_e(le({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),_e(le({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),_e(Z([],[[b,/^[\s\S]+/]]),["regex"]);function Ke(me){var We=me.langExtension;try{var He=M(me.sourceNode,me.pre),it=He.sourceCode;me.sourceCode=it,me.spans=He.spans,me.basePos=0,ye(We,it)(me),we(me)}catch(re){O.console&&console.log(re&&re.stack||re)}}function Me(me,We,He){var it=He||!1,re=We||null,P=document.createElement("div");P.innerHTML="<pre>"+me+"</pre>",P=P.firstChild,it&&Te(P,it,!0);var j={langExtension:re,numberLines:it,sourceNode:P,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ke(j),P.innerHTML}function Fe(me,We){var He=We||document.body,it=He.ownerDocument||document;function re(Ue){return He.getElementsByTagName(Ue)}for(var P=[re("pre"),re("code"),re("xmp")],j=[],ee=0;ee<P.length;++ee)for(var $=0,Q=P[ee].length;$<Q;++$)j.push(P[ee][$]);P=null;var xe=Date;xe.now||(xe={now:function(){return+new Date}});var De=0,dt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,Be=/\bprettyprinted\b/,tt=/pre|xmp/i,lt=/^code$/i,qe=/^(?:pre|code|xmp)$/i,Ye={};function je(){for(var Ue=O.PR_SHOULD_USE_CONTINUATION?xe.now()+250:Infinity;De<j.length&&xe.now()<Ue;De++){for(var ke=j[De],be=Ye,Ce=ke;Ce=Ce.previousSibling;){var Pe=Ce.nodeType,Le=(Pe===7||Pe===8)&&Ce.nodeValue;if(Le?!/^\??prettify\b/.test(Le):Pe!==3||/\S/.test(Ce.nodeValue))break;if(Le){be={},Le.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vt,st,It){be[st]=It});break}}var Ve=ke.className;if((be!==Ye||Ne.test(Ve))&&!Be.test(Ve)){for(var at=!1,_t=ke.parentNode;_t;_t=_t.parentNode){var kt=_t.tagName;if(qe.test(kt)&&_t.className&&Ne.test(_t.className)){at=!0;break}}if(!at){ke.className+=" prettyprinted";var Bt=be.lang;if(!Bt){Bt=Ve.match(dt);var jt;!Bt&&(jt=K(ke))&<.test(jt.tagName)&&(Bt=jt.className.match(dt)),Bt&&(Bt=Bt[1])}var At;if(tt.test(ke.tagName))At=1;else{var pt=ke.currentStyle,gt=it.defaultView,rt=pt?pt.whiteSpace:gt&>.getComputedStyle?gt.getComputedStyle(ke,null).getPropertyValue("white-space"):0;At=rt&&rt.substring(0,3)==="pre"}var Oe=be.linenums;(Oe=Oe==="true"||+Oe)||(Oe=Ve.match(/\blinenums\b(?::(\d+))?/),Oe=Oe?Oe[1]&&Oe[1].length?+Oe[1]:!0:!1),Oe&&Te(ke,Oe,At);var ze={langExtension:Bt,sourceNode:ke,numberLines:Oe,pre:At,sourceCode:null,basePos:null,spans:null,decorations:null};Ke(ze)}}}De<j.length?O.setTimeout(je,250):typeof me=="function"&&me()}je()}var Ge=O.PR={createSimpleLexer:Z,registerLangHandler:_e,sourceDecorator:le,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:F,PR_COMMENT:m,PR_DECLARATION:w,PR_KEYWORD:g,PR_LITERAL:x,PR_NOCODE:z,PR_PLAIN:E,PR_PUNCTUATION:h,PR_SOURCE:R,PR_STRING:b,PR_TAG:S,PR_TYPE:_,prettyPrintOne:W?O.prettyPrintOne=Me:T=Me,prettyPrint:A=W?O.prettyPrint=Fe:A=Fe},Ee=O.define;typeof Ee=="function"&&Ee.amd&&Ee("google-code-prettify",[],function(){return Ge})})()},TXwP:function(nt,Xe,V){var ce,ie;(function(){var W;(function(){"use strict";var D=[,,function(f){function p(n){this.__parent=n,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var n=new p(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},p.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},p.prototype.has_match=function(n){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(n))return!0;return!1},p.prototype.set_indent=function(n,o){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(n){this.__items.push(n);var o=n.lastIndexOf(`
|
|
|
`);o!==-1?this.__character_count=n.length-o:this.__character_count+=n.length},p.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function c(n,o){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),o=o||"",n.indent_level>0&&(o=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}c.prototype.get_indent_size=function(n,o){var r=this.__base_string_length;return o=o||0,n<0&&(r=0),r+=n*this.__indent_size,r+=o,r},c.prototype.get_indent_string=function(n,o){var r=this.__base_string;return o=o||0,n<0&&(n=0,r=""),o+=n*this.__indent_size,this.__ensure_cache(o),r+=this.__cache[o],r},c.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var n=this.__cache.length,o=0,r="";this.__indent_size&&n>=this.__indent_size&&(o=Math.floor(n/this.__indent_size),n-=o*this.__indent_size,r=new Array(o+1).join(this.__indent_string)),n&&(r+=new Array(n+1).join(" ")),this.__cache.push(r)};function s(n,o){this.__indent_cache=new c(n,o),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(n,o){return this.__indent_cache.get_indent_string(n,o)},s.prototype.get_indent_size=function(n,o){return this.__indent_cache.get_indent_size(n,o)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(n){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
|
|
|
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
|
`);return n!==`
|
|
|
`&&(r=r.replace(/[\n]/g,n)),r},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(n,o){return n=n||0,o=o||0,this.next_line.set_indent(n,o),this.__lines.length>1?(this.current_line.set_indent(n,o),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(n){for(var o=0;o<n.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},s.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},s.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},s.prototype.remove_indent=function(n){for(var o=this.__lines.length;n<o;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},s.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(n,o){for(var r=this.__lines.length-2;r>=0;){var l=this.__lines[r];if(l.is_empty())break;if(l.item(0).indexOf(n)!==0&&l.item(-1)!==o){this.__lines.splice(r+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},f.exports.Output=s},,,,function(f){function p(n,o){this.raw_options=c(n,o),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(n,o){var r=this.raw_options[n],l=o||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(l=r.concat()):typeof r=="string"&&(l=r.split(/[^a-zA-Z0-9_\/\-]+/)),l},p.prototype._get_boolean=function(n,o){var r=this.raw_options[n],l=r===void 0?!!o:!!r;return l},p.prototype._get_characters=function(n,o){var r=this.raw_options[n],l=o||"";return typeof r=="string"&&(l=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),l},p.prototype._get_number=function(n,o){var r=this.raw_options[n];o=parseInt(o,10),isNaN(o)&&(o=0);var l=parseInt(r,10);return isNaN(l)&&(l=o),l},p.prototype._get_selection=function(n,o,r){var l=this._get_selection_list(n,o,r);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
|
|
|
`+o+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return l[0]},p.prototype._get_selection_list=function(n,o,r){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[o[0]],!this._is_valid_selection(r,o))throw new Error("Invalid Default Value!");var l=this._get_array(n,r);if(!this._is_valid_selection(l,o))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
|
|
|
`+o+`
|
|
|
You passed in: '`+this.raw_options[n]+"'");return l},p.prototype._is_valid_selection=function(n,o){return n.length&&o.length&&!n.some(function(r){return o.indexOf(r)===-1})};function c(n,o){var r={};n=s(n);var l;for(l in n)l!==o&&(r[l]=n[l]);if(o&&n[o])for(l in n[o])r[l]=n[o][l];return r}function s(n){var o={},r;for(r in n){var l=r.replace(/-/g,"_");o[l]=n[r]}return o}f.exports.Options=p,f.exports.normalizeOpts=s,f.exports.mergeOpts=c},,function(f){var p=RegExp.prototype.hasOwnProperty("sticky");function c(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position<this.__input_length},c.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},c.prototype.peek=function(s){var n=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(n=this.__input.charAt(s)),n},c.prototype.__match=function(s,n){s.lastIndex=n;var o=s.exec(this.__input);return o&&!(p&&s.sticky)&&(o.index!==n&&(o=null)),o},c.prototype.test=function(s,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(s,n):!1},c.prototype.testChar=function(s,n){var o=this.peek(n);return s.lastIndex=0,o!==null&&s.test(o)},c.prototype.match=function(s){var n=this.__match(s,this.__position);return n?this.__position+=n[0].length:n=null,n},c.prototype.read=function(s,n,o){var r="",l;return s&&(l=this.match(s),l&&(r+=l[0])),n&&(l||!s)&&(r+=this.readUntil(n,o)),r},c.prototype.readUntil=function(s,n){var o="",r=this.__position;s.lastIndex=this.__position;var l=s.exec(this.__input);return l?(r=l.index,n&&(r+=l[0].length)):r=this.__input_length,o=this.__input.substring(this.__position,r),this.__position=r,o},c.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},c.prototype.get_regexp=function(s,n){var o=null,r="g";return n&&p&&(r="y"),typeof s=="string"&&s!==""?o=new RegExp(s,r):s&&(o=new RegExp(s.source,r)),o},c.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},c.prototype.peekUntilAfter=function(s){var n=this.__position,o=this.readUntilAfter(s);return this.__position=n,o},c.prototype.lookBack=function(s){var n=this.__position-1;return n>=s.length&&this.__input.substring(n-s.length,n).toLowerCase()===s},f.exports.InputScanner=c},,,,,function(f){function p(c,s){c=typeof c=="string"?c:c.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(c+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(c+/\sbeautify\signore:end\s/.source+s,"g")}p.prototype.get_directives=function(c){if(!c.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(c);n;)s[n[1]]=n[2],n=this.__directive_pattern.exec(c);return s},p.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=p},,function(f,p,c){var s=c(16).Beautifier,n=c(17).Options;function o(r,l){var a=new s(r,l);return a.beautify()}f.exports=o,f.exports.defaultOptions=function(){return new n}},function(f,p,c){var s=c(17).Options,n=c(2).Output,o=c(8).InputScanner,r=c(13).Directives,l=new r(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=/\s/,d=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,y=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function b(g,m){this._source_text=g||"",this._options=new s(m),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}b.prototype.eatString=function(g){var m="";for(this._ch=this._input.next();this._ch;){if(m+=this._ch,this._ch==="\\")m+=this._input.next();else if(g.indexOf(this._ch)!==-1||this._ch===`
|
|
|
`)break;this._ch=this._input.next()}return m},b.prototype.eatWhitespace=function(g){for(var m=t.test(this._input.peek()),_=0;t.test(this._input.peek());)this._ch=this._input.next(),g&&this._ch===`
|
|
|
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return m},b.prototype.foundNestedPseudoClass=function(){for(var g=0,m=1,_=this._input.peek(m);_;){if(_==="{")return!0;if(_==="(")g+=1;else if(_===")"){if(g===0)return!1;g-=1}else if(_===";"||_==="}")return!1;m++,_=this._input.peek(m)}return!1},b.prototype.print_string=function(g){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(g)},b.prototype.preserveSingleSpace=function(g){g&&(this._output.space_before_token=!0)},b.prototype.indent=function(){this._indentLevel++},b.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g=this._source_text,m=this._options.eol;m==="auto"&&(m=`
|
|
|
`,g&&a.test(g||"")&&(m=g.match(a)[0])),g=g.replace(i,`
|
|
|
`);var _=g.match(/^[\t ]*/)[0];this._output=new n(this._options,_),this._input=new o(g),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var x=0,h=!1,E=!1,S=!1,w=!1,R=!1,N=!1,F=this._ch,z=!1,q,B,M;q=this._input.read(d),B=q!=="",M=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var G=this._input.read(v),J=l.get_directives(G);J&&J.ignore==="start"&&(G+=l.readIgnored(this._input)),this.print_string(G),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(y)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var K=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);K.match(/[ :]$/)&&(K=this.eatString(": ").replace(/\s$/,""),this.print_string(K),this._output.space_before_token=!0),K=K.replace(/\s$/,""),K==="extend"?w=!0:K==="import"&&(R=!0),K in this.NESTED_AT_RULE?(this._nestedLevel+=1,K in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!h&&x===0&&K.indexOf(":")!==-1&&(E=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")E&&(E=!1,this.outdent()),S?(S=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(M==="("?this._output.space_before_token=!1:M!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),M==="{"&&this._output.trim(!0),R=!1,w=!1,E&&(this.outdent(),E=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Z=0;Z<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Z++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Z])){z=!0;break}(h||S)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!w&&x===0?(this.print_string(":"),E||(E=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var le=M==='"'||M==="'";this.preserveSingleSpace(le||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")z=!1,x===0?(E&&(this.outdent(),E=!1),w=!1,R=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),x++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),x&&(x--,this.outdent()));else{var de=!1;this._input.lookBack("with")&&(de=!0),this.preserveSingleSpace(B||de),this.print_string(this._ch),E&&M==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),x++,this.indent())}else if(this._ch===")")x&&(x--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!E||N)&&x===0&&!R&&!w?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!E&&x===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&t.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),t.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Te=M==='"'||M==="'";this.preserveSingleSpace(Te||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
|
`&&z&&this._output.add_new_line()}var we=this._output.get_code(m);return we},f.exports.Beautifier=b},function(f,p,c){var s=c(6).Options;function n(o){s.call(this,o,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<l.length;a++)l[a]!=="expand"?this.brace_style="collapse":this.brace_style=l[a]}n.prototype=new s,f.exports.Options=n}],T={};function A(f){var p=T[f];if(p!==void 0)return p.exports;var c=T[f]={exports:{}};return D[f](c,c.exports,A),c.exports}var O=A(15);W=O})();var C=W;!(ce=[],ie=function(){return{css_beautify:C}}.apply(Xe,ce),ie!==void 0&&(nt.exports=ie))})()},TcMa:function(nt,Xe,V){nt.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(nt,Xe,V){},VEzc:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},"VrN/":function(nt,Xe,V){(function(ce,ie){nt.exports=ie()})(this,function(){"use strict";var ce=navigator.userAgent,ie=navigator.platform,W=/gecko\/\d/i.test(ce),C=/MSIE \d/.test(ce),D=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ce),T=/Edge\/(\d+)/.exec(ce),A=C||D||T,O=A&&(C?document.documentMode||6:+(T||D)[1]),f=!T&&/WebKit\//.test(ce),p=f&&/Qt\/\d+\.\d+/.test(ce),c=!T&&/Chrome\//.test(ce),s=/Opera\//.test(ce),n=/Apple Computer/.test(navigator.vendor),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ce),r=/PhantomJS/.test(ce),l=!T&&/AppleWebKit/.test(ce)&&/Mobile\/\w+/.test(ce),a=/Android/.test(ce),i=l||a||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ce),t=l||/Mac/.test(ie),d=/\bCrOS\b/.test(ce),v=/win/i.test(ie),y=s&&ce.match(/Version\/(\d*\.\d*)/);y&&(y=Number(y[1])),y&&y>=15&&(s=!1,f=!0);var b=t&&(p||s&&(y==null||y<12.11)),g=W||A&&O>=9;function m(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,u){var I=e.className,L=m(u).exec(I);if(L){var k=I.slice(L.index+L[0].length);e.className=I.slice(0,L.index)+(k?L[1]+k:"")}};function x(e){for(var u=e.childNodes.length;u>0;--u)e.removeChild(e.firstChild);return e}function h(e,u){return x(e).appendChild(u)}function E(e,u,I,L){var k=document.createElement(e);if(I&&(k.className=I),L&&(k.style.cssText=L),typeof u=="string")k.appendChild(document.createTextNode(u));else if(u)for(var Y=0;Y<u.length;++Y)k.appendChild(u[Y]);return k}function S(e,u,I,L){var k=E(e,u,I,L);return k.setAttribute("role","presentation"),k}var w;document.createRange?w=function(e,u,I,L){var k=document.createRange();return k.setEnd(L||e,I),k.setStart(e,u),k}:w=function(e,u,I){var L=document.body.createTextRange();try{L.moveToElementText(e.parentNode)}catch(k){return L}return L.collapse(!0),L.moveEnd("character",I),L.moveStart("character",u),L};function R(e,u){if(u.nodeType==3&&(u=u.parentNode),e.contains)return e.contains(u);do if(u.nodeType==11&&(u=u.host),u==e)return!0;while(u=u.parentNode)}function N(){var e;try{e=document.activeElement}catch(u){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,u){var I=e.className;m(u).test(I)||(e.className+=(I?" ":"")+u)}function z(e,u){for(var I=e.split(" "),L=0;L<I.length;L++)I[L]&&!m(I[L]).test(u)&&(u+=" "+I[L]);return u}var q=function(e){e.select()};l?q=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:A&&(q=function(e){try{e.select()}catch(u){}});function B(e){var u=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,u)}}function M(e,u,I){u||(u={});for(var L in e)e.hasOwnProperty(L)&&(I!==!1||!u.hasOwnProperty(L))&&(u[L]=e[L]);return u}function G(e,u,I,L,k){u==null&&(u=e.search(/[^\s\u00a0]/),u==-1&&(u=e.length));for(var Y=L||0,ue=k||0;;){var fe=e.indexOf(" ",Y);if(fe<0||fe>=u)return ue+(u-Y);ue+=fe-Y,ue+=I-ue%I,Y=fe+1}}var J=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};J.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},J.prototype.set=function(e,u){this.f=u;var I=+new Date+e;(!this.id||I<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=I)};function K(e,u){for(var I=0;I<e.length;++I)if(e[I]==u)return I;return-1}var Z=50,le={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},Te={origin:"*mouse"},we={origin:"+move"};function Ie(e,u,I){for(var L=0,k=0;;){var Y=e.indexOf(" ",L);Y==-1&&(Y=e.length);var ue=Y-L;if(Y==e.length||k+ue>=u)return L+Math.min(ue,u-k);if(k+=Y-L,k+=I-k%I,L=Y+1,k>=u)return L}}var _e=[""];function ye(e){for(;_e.length<=e;)_e.push(Ke(_e)+" ");return _e[e]}function Ke(e){return e[e.length-1]}function Me(e,u){for(var I=[],L=0;L<e.length;L++)I[L]=u(e[L],L);return I}function Fe(e,u,I){for(var L=0,k=I(u);L<e.length&&I(e[L])<=k;)L++;e.splice(L,0,u)}function Ge(){}function Ee(e,u){var I;return Object.create?I=Object.create(e):(Ge.prototype=e,I=new Ge),u&&M(u,I),I}var me=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function We(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||me.test(e))}function He(e,u){return u?u.source.indexOf("\\w")>-1&&We(e)?!0:u.test(e):We(e)}function it(e){for(var u in e)if(e.hasOwnProperty(u)&&e[u])return!1;return!0}var re=/[\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 P(e){return e.charCodeAt(0)>=768&&re.test(e)}function j(e,u,I){for(;(I<0?u>0:u<e.length)&&P(e.charAt(u));)u+=I;return u}function ee(e,u,I){for(var L=u>I?-1:1;;){if(u==I)return u;var k=(u+I)/2,Y=L<0?Math.ceil(k):Math.floor(k);if(Y==u)return e(Y)?u:I;e(Y)?I=Y:u=Y+L}}function $(e,u,I,L){if(!e)return L(u,I,"ltr",0);for(var k=!1,Y=0;Y<e.length;++Y){var ue=e[Y];(ue.from<I&&ue.to>u||u==I&&ue.to==u)&&(L(Math.max(ue.from,u),Math.min(ue.to,I),ue.level==1?"rtl":"ltr",Y),k=!0)}k||L(u,I,"ltr")}var Q=null;function xe(e,u,I){var L;Q=null;for(var k=0;k<e.length;++k){var Y=e[k];if(Y.from<u&&Y.to>u)return k;Y.to==u&&(Y.from!=Y.to&&I=="before"?L=k:Q=k),Y.from==u&&(Y.from!=Y.to&&I!="before"?L=k:Q=k)}return L!=null?L:Q}var De=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",u="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function I(Se){return Se<=247?e.charAt(Se):1424<=Se&&Se<=1524?"R":1536<=Se&&Se<=1785?u.charAt(Se-1536):1774<=Se&&Se<=2220?"r":8192<=Se&&Se<=8203?"w":Se==8204?"b":"L"}var L=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,k=/[stwN]/,Y=/[LRr]/,ue=/[Lb1n]/,fe=/[1n]/;function ge(Se,Je,et){this.level=Se,this.from=Je,this.to=et}return function(Se,Je){var et=Je=="ltr"?"L":"R";if(Se.length==0||Je=="ltr"&&!L.test(Se))return!1;for(var ft=Se.length,ut=[],Tt=0;Tt<ft;++Tt)ut.push(I(Se.charCodeAt(Tt)));for(var Ut=0,Kt=et;Ut<ft;++Ut){var qt=ut[Ut];qt=="m"?ut[Ut]=Kt:Kt=qt}for(var on=0,Zt=et;on<ft;++on){var dn=ut[on];dn=="1"&&Zt=="r"?ut[on]="n":Y.test(dn)&&(Zt=dn,dn=="r"&&(ut[on]="R"))}for(var On=1,yn=ut[0];On<ft-1;++On){var ei=ut[On];ei=="+"&&yn=="1"&&ut[On+1]=="1"?ut[On]="1":ei==","&&yn==ut[On+1]&&(yn=="1"||yn=="n")&&(ut[On]=yn),yn=ei}for(var Ii=0;Ii<ft;++Ii){var ar=ut[Ii];if(ar==",")ut[Ii]="N";else if(ar=="%"){var Mi=void 0;for(Mi=Ii+1;Mi<ft&&ut[Mi]=="%";++Mi);for(var Mr=Ii&&ut[Ii-1]=="!"||Mi<ft&&ut[Mi]=="1"?"1":"N",Cr=Ii;Cr<Mi;++Cr)ut[Cr]=Mr;Ii=Mi-1}}for(var $i=0,Or=et;$i<ft;++$i){var dr=ut[$i];Or=="L"&&dr=="1"?ut[$i]="L":Y.test(dr)&&(Or=dr)}for(var nr=0;nr<ft;++nr)if(k.test(ut[nr])){var Ji=void 0;for(Ji=nr+1;Ji<ft&&k.test(ut[Ji]);++Ji);for(var Fi=(nr?ut[nr-1]:et)=="L",Ar=(Ji<ft?ut[Ji]:et)=="L",Da=Fi==Ar?Fi?"L":"R":et,ha=nr;ha<Ji;++ha)ut[ha]=Da;nr=Ji-1}for(var gr=[],Zr,or=0;or<ft;)if(ue.test(ut[or])){var Fo=or;for(++or;or<ft&&ue.test(ut[or]);++or);gr.push(new ge(0,Fo,or))}else{var na=or,_a=gr.length,ya=Je=="rtl"?1:0;for(++or;or<ft&&ut[or]!="L";++or);for(var Er=na;Er<or;)if(fe.test(ut[Er])){na<Er&&(gr.splice(_a,0,new ge(1,na,Er)),_a+=ya);var ka=Er;for(++Er;Er<or&&fe.test(ut[Er]);++Er);gr.splice(_a,0,new ge(2,ka,Er)),_a+=ya,na=Er}else++Er;na<or&&gr.splice(_a,0,new ge(1,na,or))}return Je=="ltr"&&(gr[0].level==1&&(Zr=Se.match(/^\s+/))&&(gr[0].from=Zr[0].length,gr.unshift(new ge(0,0,Zr[0].length))),Ke(gr).level==1&&(Zr=Se.match(/\s+$/))&&(Ke(gr).to-=Zr[0].length,gr.push(new ge(0,ft-Zr[0].length,ft)))),Je=="rtl"?gr.reverse():gr}}();function dt(e,u){var I=e.order;return I==null&&(I=e.order=De(e.text,u)),I}var Ne=[],Be=function(e,u,I){if(e.addEventListener)e.addEventListener(u,I,!1);else if(e.attachEvent)e.attachEvent("on"+u,I);else{var L=e._handlers||(e._handlers={});L[u]=(L[u]||Ne).concat(I)}};function tt(e,u){return e._handlers&&e._handlers[u]||Ne}function lt(e,u,I){if(e.removeEventListener)e.removeEventListener(u,I,!1);else if(e.detachEvent)e.detachEvent("on"+u,I);else{var L=e._handlers,k=L&&L[u];if(k){var Y=K(k,I);Y>-1&&(L[u]=k.slice(0,Y).concat(k.slice(Y+1)))}}}function qe(e,u){var I=tt(e,u);if(!I.length)return;for(var L=Array.prototype.slice.call(arguments,2),k=0;k<I.length;++k)I[k].apply(null,L)}function Ye(e,u,I){return typeof u=="string"&&(u={type:u,preventDefault:function(){this.defaultPrevented=!0}}),qe(e,I||u.type,e,u),Pe(u)||u.codemirrorIgnore}function je(e){var u=e._handlers&&e._handlers.cursorActivity;if(!u)return;for(var I=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),L=0;L<u.length;++L)K(I,u[L])==-1&&I.push(u[L])}function Ue(e,u){return tt(e,u).length>0}function ke(e){e.prototype.on=function(u,I){Be(this,u,I)},e.prototype.off=function(u,I){lt(this,u,I)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Le(e){be(e),Ce(e)}function Ve(e){return e.target||e.srcElement}function at(e){var u=e.which;return u==null&&(e.button&1?u=1:e.button&2?u=3:e.button&4&&(u=2)),t&&e.ctrlKey&&u==1&&(u=3),u}var _t=function(){if(A&&O<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}(),kt;function Bt(e){if(kt==null){var u=E("span","\u200B");h(e,E("span",[u,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(kt=u.offsetWidth<=1&&u.offsetHeight>2&&!(A&&O<8))}var I=kt?E("span","\u200B"):E("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return I.setAttribute("cm-text",""),I}var jt;function At(e){if(jt!=null)return jt;var u=h(e,document.createTextNode("A\u062EA")),I=w(u,0,1).getBoundingClientRect(),L=w(u,1,2).getBoundingClientRect();return x(e),!I||I.left==I.right?!1:jt=L.right-I.right<3}var pt=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var u=0,I=[],L=e.length;u<=L;){var k=e.indexOf(`
|
|
|
`,u);k==-1&&(k=e.length);var Y=e.slice(u,e.charAt(k-1)=="\r"?k-1:k),ue=Y.indexOf("\r");ue!=-1?(I.push(Y.slice(0,ue)),u+=ue+1):(I.push(Y),u=k+1)}return I}:function(e){return e.split(/\r\n?|\n/)},gt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(u){return!1}}:function(e){var u;try{u=e.ownerDocument.selection.createRange()}catch(I){}return!u||u.parentElement()!=e?!1:u.compareEndPoints("StartToEnd",u)!=0},rt=function(){var e=E("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Oe=null;function ze(e){if(Oe!=null)return Oe;var u=h(e,E("span","x")),I=u.getBoundingClientRect(),L=w(u,0,1).getBoundingClientRect();return Oe=Math.abs(I.left-L.left)>1}var vt={},st={};function It(e,u){arguments.length>2&&(u.dependencies=Array.prototype.slice.call(arguments,2)),vt[e]=u}function Pt(e,u){st[e]=u}function Ze(e){if(typeof e=="string"&&st.hasOwnProperty(e))e=st[e];else if(e&&typeof e.name=="string"&&st.hasOwnProperty(e.name)){var u=st[e.name];typeof u=="string"&&(u={name:u}),e=Ee(u,e),e.name=u.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ze("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ze("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function mt(e,u){u=Ze(u);var I=vt[u.name];if(!I)return mt(e,"text/plain");var L=I(e,u);if(Lt.hasOwnProperty(u.name)){var k=Lt[u.name];for(var Y in k){if(!k.hasOwnProperty(Y))continue;L.hasOwnProperty(Y)&&(L["_"+Y]=L[Y]),L[Y]=k[Y]}}if(L.name=u.name,u.helperType&&(L.helperType=u.helperType),u.modeProps)for(var ue in u.modeProps)L[ue]=u.modeProps[ue];return L}var Lt={};function Mt(e,u){var I=Lt.hasOwnProperty(e)?Lt[e]:Lt[e]={};M(u,I)}function $t(e,u){if(u===!0)return u;if(e.copyState)return e.copyState(u);var I={};for(var L in u){var k=u[L];k instanceof Array&&(k=k.concat([])),I[L]=k}return I}function Re(e,u){for(var I;e.innerMode&&!(I=e.innerMode(u),!I||I.mode==e);)u=I.state,e=I.mode;return I||{mode:e,state:u}}function ve(e,u,I){return e.startState?e.startState(u,I):!0}var X=function(e,u,I){this.pos=this.start=0,this.string=e,this.tabSize=u||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=I};X.prototype.eol=function(){return this.pos>=this.string.length},X.prototype.sol=function(){return this.pos==this.lineStart},X.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},X.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},X.prototype.eat=function(e){var u=this.string.charAt(this.pos),I;if(typeof e=="string"?I=u==e:I=u&&(e.test?e.test(u):e(u)),I)return++this.pos,u},X.prototype.eatWhile=function(e){for(var u=this.pos;this.eat(e););return this.pos>u},X.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},X.prototype.skipToEnd=function(){this.pos=this.string.length},X.prototype.skipTo=function(e){var u=this.string.indexOf(e,this.pos);if(u>-1)return this.pos=u,!0},X.prototype.backUp=function(e){this.pos-=e},X.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},X.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},X.prototype.match=function(e,u,I){if(typeof e=="string"){var L=function(ue){return I?ue.toLowerCase():ue},k=this.string.substr(this.pos,e.length);if(L(k)==L(e))return u!==!1&&(this.pos+=e.length),!0}else{var Y=this.string.slice(this.pos).match(e);return Y&&Y.index>0?null:(Y&&u!==!1&&(this.pos+=Y[0].length),Y)}},X.prototype.current=function(){return this.string.slice(this.start,this.pos)},X.prototype.hideFirstChars=function(e,u){this.lineStart+=e;try{return u()}finally{this.lineStart-=e}},X.prototype.lookAhead=function(e){var u=this.lineOracle;return u&&u.lookAhead(e)},X.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ne(e,u){if(u-=e.first,u<0||u>=e.size)throw new Error("There is no line "+(u+e.first)+" in the document.");for(var I=e;!I.lines;)for(var L=0;;++L){var k=I.children[L],Y=k.chunkSize();if(u<Y){I=k;break}u-=Y}return I.lines[u]}function oe(e,u,I){var L=[],k=u.line;return e.iter(u.line,I.line+1,function(Y){var ue=Y.text;k==I.line&&(ue=ue.slice(0,I.ch)),k==u.line&&(ue=ue.slice(u.ch)),L.push(ue),++k}),L}function he(e,u,I){var L=[];return e.iter(u,I,function(k){L.push(k.text)}),L}function Ae(e,u){var I=u-e.height;if(I)for(var L=e;L;L=L.parent)L.height+=I}function Qe(e){if(e.parent==null)return null;for(var u=e.parent,I=K(u.lines,e),L=u.parent;L;u=L,L=L.parent)for(var k=0;!(L.children[k]==u);++k)I+=L.children[k].chunkSize();return I+u.first}function ot(e,u){var I=e.first;e:do{for(var L=0;L<e.children.length;++L){var k=e.children[L],Y=k.height;if(u<Y){e=k;continue e}u-=Y,I+=k.chunkSize()}return I}while(!e.lines);for(var ue=0;ue<e.lines.length;++ue){var fe=e.lines[ue],ge=fe.height;if(u<ge)break;u-=ge}return I+ue}function Rt(e,u){return u>=e.first&&u<e.first+e.size}function Nt(e,u){return String(e.lineNumberFormatter(u+e.firstLineNumber))}function ht(e,u,I){if(I===void 0&&(I=null),!(this instanceof ht))return new ht(e,u,I);this.line=e,this.ch=u,this.sticky=I}function Dt(e,u){return e.line-u.line||e.ch-u.ch}function sn(e,u){return e.sticky==u.sticky&&Dt(e,u)==0}function Ct(e){return ht(e.line,e.ch)}function hn(e,u){return Dt(e,u)<0?u:e}function rn(e,u){return Dt(e,u)<0?e:u}function ae(e,u){return Math.max(e.first,Math.min(u,e.first+e.size-1))}function U(e,u){if(u.line<e.first)return ht(e.first,0);var I=e.first+e.size-1;return u.line>I?ht(I,ne(e,I).text.length):H(u,ne(e,u.line).text.length)}function H(e,u){var I=e.ch;return I==null||I>u?ht(e.line,u):I<0?ht(e.line,0):e}function te(e,u){for(var I=[],L=0;L<u.length;L++)I[L]=U(e,u[L]);return I}var pe=function(e,u){this.state=e,this.lookAhead=u},se=function(e,u,I,L){this.state=u,this.doc=e,this.line=I,this.maxLookAhead=L||0,this.baseTokens=null,this.baseTokenPos=1};se.prototype.lookAhead=function(e){var u=this.doc.getLine(this.line+e);return u!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),u},se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var u=this.baseTokens[this.baseTokenPos+1];return{type:u&&u.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},se.fromSaved=function(e,u,I){return u instanceof pe?new se(e,$t(e.mode,u.state),I,u.lookAhead):new se(e,$t(e.mode,u),I)},se.prototype.save=function(e){var u=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pe(u,this.maxLookAhead):u};function $e(e,u,I,L){var k=[e.state.modeGen],Y={};mi(e,u.text,e.doc.mode,I,function(Se,Je){return k.push(Se,Je)},Y,L);for(var ue=I.state,fe=function(Se){I.baseTokens=k;var Je=e.state.overlays[Se],et=1,ft=0;I.state=!0,mi(e,u.text,Je.mode,I,function(ut,Tt){for(var Ut=et;ft<ut;){var Kt=k[et];Kt>ut&&k.splice(et,1,ut,k[et+1],Kt),et+=2,ft=Math.min(ut,Kt)}if(!Tt)return;if(Je.opaque)k.splice(Ut,et-Ut,ut,"overlay "+Tt),et=Ut+2;else for(;Ut<et;Ut+=2){var qt=k[Ut+1];k[Ut+1]=(qt?qt+" ":"")+"overlay "+Tt}},Y),I.state=ue,I.baseTokens=null,I.baseTokenPos=1},ge=0;ge<e.state.overlays.length;++ge)fe(ge);return{styles:k,classes:Y.bgClass||Y.textClass?Y:null}}function yt(e,u,I){if(!u.styles||u.styles[0]!=e.state.modeGen){var L=Ot(e,Qe(u)),k=u.text.length>e.options.maxHighlightLength&&$t(e.doc.mode,L.state),Y=$e(e,u,L);k&&(L.state=k),u.stateAfter=L.save(!k),u.styles=Y.styles,Y.classes?u.styleClasses=Y.classes:u.styleClasses&&(u.styleClasses=null),I===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return u.styles}function Ot(e,u,I){var L=e.doc,k=e.display;if(!L.mode.startState)return new se(L,!0,u);var Y=Wn(e,u,I),ue=Y>L.first&&ne(L,Y-1).stateAfter,fe=ue?se.fromSaved(L,ue,Y):new se(L,ve(L.mode),Y);return L.iter(Y,u,function(ge){Yt(e,ge.text,fe);var Se=fe.line;ge.stateAfter=Se==u-1||Se%5==0||Se>=k.viewFrom&&Se<k.viewTo?fe.save():null,fe.nextLine()}),I&&(L.modeFrontier=fe.line),fe}function Yt(e,u,I,L){var k=e.doc.mode,Y=new X(u,e.options.tabSize,I);for(Y.start=Y.pos=L||0,u==""&&St(k,I.state);!Y.eol();)Wt(k,Y,I.state),Y.start=Y.pos}function St(e,u){if(e.blankLine)return e.blankLine(u);if(!e.innerMode)return;var I=Re(e,u);if(I.mode.blankLine)return I.mode.blankLine(I.state)}function Wt(e,u,I,L){for(var k=0;k<10;k++){L&&(L[0]=Re(e,I).mode);var Y=e.token(u,I);if(u.pos>u.start)return Y}throw new Error("Mode "+e.name+" failed to advance stream.")}var ln=function(e,u,I){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=u||null,this.state=I};function Bn(e,u,I,L){var k=e.doc,Y=k.mode,ue;u=U(k,u);var fe=ne(k,u.line),ge=Ot(e,u.line,I),Se=new X(fe.text,e.options.tabSize,ge),Je;for(L&&(Je=[]);(L||Se.pos<u.ch)&&!Se.eol();)Se.start=Se.pos,ue=Wt(Y,Se,ge.state),L&&Je.push(new ln(Se,ue,$t(k.mode,ge.state)));return L?Je:new ln(Se,ue,ge.state)}function Oi(e,u){if(e)for(;;){var I=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!I)break;e=e.slice(0,I.index)+e.slice(I.index+I[0].length);var L=I[1]?"bgClass":"textClass";u[L]==null?u[L]=I[2]:new RegExp("(?:^|\\s)"+I[2]+"(?:$|\\s)").test(u[L])||(u[L]+=" "+I[2])}return e}function mi(e,u,I,L,k,Y,ue){var fe=I.flattenSpans;fe==null&&(fe=e.options.flattenSpans);var ge=0,Se=null,Je=new X(u,e.options.tabSize,L),et,ft=e.options.addModeClass&&[null];for(u==""&&Oi(St(I,L.state),Y);!Je.eol();){if(Je.pos>e.options.maxHighlightLength?(fe=!1,ue&&Yt(e,u,L,Je.pos),Je.pos=u.length,et=null):et=Oi(Wt(I,Je,L.state,ft),Y),ft){var ut=ft[0].name;ut&&(et="m-"+(et?ut+" "+et:ut))}if(!fe||Se!=et){for(;ge<Je.start;)ge=Math.min(Je.start,ge+5e3),k(ge,Se);Se=et}Je.start=Je.pos}for(;ge<Je.pos;){var Tt=Math.min(Je.pos,ge+5e3);k(Tt,Se),ge=Tt}}function Wn(e,u,I){for(var L,k,Y=e.doc,ue=I?-1:u-(e.doc.mode.innerMode?1e3:100),fe=u;fe>ue;--fe){if(fe<=Y.first)return Y.first;var ge=ne(Y,fe-1),Se=ge.stateAfter;if(Se&&(!I||fe+(Se instanceof pe?Se.lookAhead:0)<=Y.modeFrontier))return fe;var Je=G(ge.text,null,e.options.tabSize);(k==null||L>Je)&&(k=fe-1,L=Je)}return k}function di(e,u){if(e.modeFrontier=Math.min(e.modeFrontier,u),e.highlightFrontier<u-10)return;for(var I=e.first,L=u-1;L>I;L--){var k=ne(e,L).stateAfter;if(k&&(!(k instanceof pe)||L+k.lookAhead<u)){I=L+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,I)}var hr=!1,vi=!1;function gi(){hr=!0}function xi(){vi=!0}function Bi(e,u,I){this.marker=e,this.from=u,this.to=I}function Ai(e,u){if(e)for(var I=0;I<e.length;++I){var L=e[I];if(L.marker==u)return L}}function sr(e,u){for(var I,L=0;L<e.length;++L)e[L]!=u&&(I||(I=[])).push(e[L]);return I}function Di(e,u){e.markedSpans=e.markedSpans?e.markedSpans.concat([u]):[u],u.marker.attachLine(e)}function fr(e,u,I){var L;if(e)for(var k=0;k<e.length;++k){var Y=e[k],ue=Y.marker,fe=Y.from==null||(ue.inclusiveLeft?Y.from<=u:Y.from<u);if(fe||Y.from==u&&ue.type=="bookmark"&&(!I||!Y.marker.insertLeft)){var ge=Y.to==null||(ue.inclusiveRight?Y.to>=u:Y.to>u);(L||(L=[])).push(new Bi(ue,Y.from,ge?null:Y.to))}}return L}function lr(e,u,I){var L;if(e)for(var k=0;k<e.length;++k){var Y=e[k],ue=Y.marker,fe=Y.to==null||(ue.inclusiveRight?Y.to>=u:Y.to>u);if(fe||Y.from==u&&ue.type=="bookmark"&&(!I||Y.marker.insertLeft)){var ge=Y.from==null||(ue.inclusiveLeft?Y.from<=u:Y.from<u);(L||(L=[])).push(new Bi(ue,ge?null:Y.from-u,Y.to==null?null:Y.to-u))}}return L}function Wi(e,u){if(u.full)return null;var I=Rt(e,u.from.line)&&ne(e,u.from.line).markedSpans,L=Rt(e,u.to.line)&&ne(e,u.to.line).markedSpans;if(!I&&!L)return null;var k=u.from.ch,Y=u.to.ch,ue=Dt(u.from,u.to)==0,fe=fr(I,k,ue),ge=lr(L,Y,ue),Se=u.text.length==1,Je=Ke(u.text).length+(Se?k:0);if(fe)for(var et=0;et<fe.length;++et){var ft=fe[et];if(ft.to==null){var ut=Ai(ge,ft.marker);ut?Se&&(ft.to=ut.to==null?null:ut.to+Je):ft.to=k}}if(ge)for(var Tt=0;Tt<ge.length;++Tt){var Ut=ge[Tt];if(Ut.to!=null&&(Ut.to+=Je),Ut.from==null){var Kt=Ai(fe,Ut.marker);Kt||(Ut.from=Je,Se&&(fe||(fe=[])).push(Ut))}else Ut.from+=Je,Se&&(fe||(fe=[])).push(Ut)}fe&&(fe=Gi(fe)),ge&&ge!=fe&&(ge=Gi(ge));var qt=[fe];if(!Se){var on=u.text.length-2,Zt;if(on>0&&fe)for(var dn=0;dn<fe.length;++dn)fe[dn].to==null&&(Zt||(Zt=[])).push(new Bi(fe[dn].marker,null,null));for(var On=0;On<on;++On)qt.push(Zt);qt.push(ge)}return qt}function Gi(e){for(var u=0;u<e.length;++u){var I=e[u];I.from!=null&&I.from==I.to&&I.marker.clearWhenEmpty!==!1&&e.splice(u--,1)}return e.length?e:null}function vr(e,u,I){var L=null;if(e.iter(u.line,I.line+1,function(ut){if(ut.markedSpans)for(var Tt=0;Tt<ut.markedSpans.length;++Tt){var Ut=ut.markedSpans[Tt].marker;Ut.readOnly&&(!L||K(L,Ut)==-1)&&(L||(L=[])).push(Ut)}}),!L)return null;for(var k=[{from:u,to:I}],Y=0;Y<L.length;++Y)for(var ue=L[Y],fe=ue.find(0),ge=0;ge<k.length;++ge){var Se=k[ge];if(Dt(Se.to,fe.from)<0||Dt(Se.from,fe.to)>0)continue;var Je=[ge,1],et=Dt(Se.from,fe.from),ft=Dt(Se.to,fe.to);(et<0||!ue.inclusiveLeft&&!et)&&Je.push({from:Se.from,to:fe.from}),(ft>0||!ue.inclusiveRight&&!ft)&&Je.push({from:fe.to,to:Se.to}),k.splice.apply(k,Je),ge+=Je.length-3}return k}function Rr(e){var u=e.markedSpans;if(!u)return;for(var I=0;I<u.length;++I)u[I].marker.detachLine(e);e.markedSpans=null}function ur(e,u){if(!u)return;for(var I=0;I<u.length;++I)u[I].marker.attachLine(e);e.markedSpans=u}function Hn(e){return e.inclusiveLeft?-1:0}function wn(e){return e.inclusiveRight?1:0}function wi(e,u){var I=e.lines.length-u.lines.length;if(I!=0)return I;var L=e.find(),k=u.find(),Y=Dt(L.from,k.from)||Hn(e)-Hn(u);if(Y)return-Y;var ue=Dt(L.to,k.to)||wn(e)-wn(u);return ue||u.id-e.id}function Mn(e,u){var I=vi&&e.markedSpans,L;if(I)for(var k=void 0,Y=0;Y<I.length;++Y)k=I[Y],k.marker.collapsed&&(u?k.from:k.to)==null&&(!L||wi(L,k.marker)<0)&&(L=k.marker);return L}function Ri(e){return Mn(e,!0)}function oi(e){return Mn(e,!1)}function Lr(e,u){var I=vi&&e.markedSpans,L;if(I)for(var k=0;k<I.length;++k){var Y=I[k];Y.marker.collapsed&&(Y.from==null||Y.from<u)&&(Y.to==null||Y.to>u)&&(!L||wi(L,Y.marker)<0)&&(L=Y.marker)}return L}function Ni(e,u,I,L,k){var Y=ne(e,u),ue=vi&&Y.markedSpans;if(ue)for(var fe=0;fe<ue.length;++fe){var ge=ue[fe];if(!ge.marker.collapsed)continue;var Se=ge.marker.find(0),Je=Dt(Se.from,I)||Hn(ge.marker)-Hn(k),et=Dt(Se.to,L)||wn(ge.marker)-wn(k);if(Je>=0&&et<=0||Je<=0&&et>=0)continue;if(Je<=0&&(ge.marker.inclusiveRight&&k.inclusiveLeft?Dt(Se.to,I)>=0:Dt(Se.to,I)>0)||Je>=0&&(ge.marker.inclusiveRight&&k.inclusiveLeft?Dt(Se.from,L)<=0:Dt(Se.from,L)<0))return!0}}function Qi(e){for(var u;u=Ri(e);)e=u.find(-1,!0).line;return e}function Br(e){for(var u;u=oi(e);)e=u.find(1,!0).line;return e}function qi(e){for(var u,I;u=oi(e);)e=u.find(1,!0).line,(I||(I=[])).push(e);return I}function Kr(e,u){var I=ne(e,u),L=Qi(I);return I==L?u:Qe(L)}function Nr(e,u){if(u>e.lastLine())return u;var I=ne(e,u),L;if(!Ir(e,I))return u;for(;L=oi(I);)I=L.find(1,!0).line;return Qe(I)+1}function Ir(e,u){var I=vi&&u.markedSpans;if(I)for(var L=void 0,k=0;k<I.length;++k){if(L=I[k],!L.marker.collapsed)continue;if(L.from==null)return!0;if(L.marker.widgetNode)continue;if(L.from==0&&L.marker.inclusiveLeft&&Jr(e,u,L))return!0}}function Jr(e,u,I){if(I.to==null){var L=I.marker.find(1,!0);return Jr(e,L.line,Ai(L.line.markedSpans,I.marker))}if(I.marker.inclusiveRight&&I.to==u.text.length)return!0;for(var k=void 0,Y=0;Y<u.markedSpans.length;++Y)if(k=u.markedSpans[Y],k.marker.collapsed&&!k.marker.widgetNode&&k.from==I.to&&(k.to==null||k.to!=I.from)&&(k.marker.inclusiveLeft||I.marker.inclusiveRight)&&Jr(e,u,k))return!0}function xr(e){e=Qi(e);for(var u=0,I=e.parent,L=0;L<I.lines.length;++L){var k=I.lines[L];if(k==e)break;u+=k.height}for(var Y=I.parent;Y;I=Y,Y=I.parent)for(var ue=0;ue<Y.children.length;++ue){var fe=Y.children[ue];if(fe==I)break;u+=fe.height}return u}function Qr(e){if(e.height==0)return 0;for(var u=e.text.length,I,L=e;I=Ri(L);){var k=I.find(0,!0);L=k.from.line,u+=k.from.ch-k.to.ch}for(L=e;I=oi(L);){var Y=I.find(0,!0);u-=L.text.length-Y.from.ch,L=Y.to.line,u+=L.text.length-Y.to.ch}return u}function qr(e){var u=e.display,I=e.doc;u.maxLine=ne(I,I.first),u.maxLineLength=Qr(u.maxLine),u.maxLineChanged=!0,I.iter(function(L){var k=Qr(L);k>u.maxLineLength&&(u.maxLineLength=k,u.maxLine=L)})}var _r=function(e,u,I){this.text=e,ur(this,u),this.height=I?I(this):1};_r.prototype.lineNo=function(){return Qe(this)},ke(_r);function ea(e,u,I,L){e.text=u,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Rr(e),ur(e,I);var k=L?L(e):1;k!=e.height&&Ae(e,k)}function fn(e){e.parent=null,Rr(e)}var Cn={},mn={};function Un(e,u){if(!e||/^\s*$/.test(e))return null;var I=u.addModeClass?mn:Cn;return I[e]||(I[e]=e.replace(/\S+/g,"cm-$&"))}function ni(e,u){var I=S("span",null,null,f?"padding-right: .1px":null),L={pre:S("pre",[I],"CodeMirror-line"),content:I,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};u.measure={};for(var k=0;k<=(u.rest?u.rest.length:0);k++){var Y=k?u.rest[k-1]:u.line,ue=void 0;L.pos=0,L.addToken=nn,At(e.display.measure)&&(ue=dt(Y,e.doc.direction))&&(L.addToken=Zi(L.addToken,ue)),L.map=[];var fe=u!=e.display.externalMeasured&&Qe(Y);Dr(Y,L,yt(e,Y,fe)),Y.styleClasses&&(Y.styleClasses.bgClass&&(L.bgClass=z(Y.styleClasses.bgClass,L.bgClass||"")),Y.styleClasses.textClass&&(L.textClass=z(Y.styleClasses.textClass,L.textClass||""))),L.map.length==0&&L.map.push(0,0,L.content.appendChild(Bt(e.display.measure))),k==0?(u.measure.map=L.map,u.measure.cache={}):((u.measure.maps||(u.measure.maps=[])).push(L.map),(u.measure.caches||(u.measure.caches=[])).push({}))}if(f){var ge=L.content.lastChild;(/\bcm-tab\b/.test(ge.className)||ge.querySelector&&ge.querySelector(".cm-tab"))&&(L.content.className="cm-tab-wrap-hack")}return qe(e,"renderLine",e,u.line,L.pre),L.pre.className&&(L.textClass=z(L.pre.className,L.textClass||"")),L}function _i(e){var u=E("span","\u2022","cm-invalidchar");return u.title="\\u"+e.charCodeAt(0).toString(16),u.setAttribute("aria-label",u.title),u}function nn(e,u,I,L,k,Y,ue){if(!u)return;var fe=e.splitSpaces?Li(u,e.trailingSpace):u,ge=e.cm.state.specialChars,Se=!1,Je;if(!ge.test(u))e.col+=u.length,Je=document.createTextNode(fe),e.map.push(e.pos,e.pos+u.length,Je),A&&O<9&&(Se=!0),e.pos+=u.length;else{Je=document.createDocumentFragment();for(var et=0;;){ge.lastIndex=et;var ft=ge.exec(u),ut=ft?ft.index-et:u.length-et;if(ut){var Tt=document.createTextNode(fe.slice(et,et+ut));A&&O<9?Je.appendChild(E("span",[Tt])):Je.appendChild(Tt),e.map.push(e.pos,e.pos+ut,Tt),e.col+=ut,e.pos+=ut}if(!ft)break;et+=ut+1;var Ut=void 0;if(ft[0]==" "){var Kt=e.cm.options.tabSize,qt=Kt-e.col%Kt;Ut=Je.appendChild(E("span",ye(qt),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=qt}else ft[0]=="\r"||ft[0]==`
|
|
|
`?(Ut=Je.appendChild(E("span",ft[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",ft[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(ft[0]),Ut.setAttribute("cm-text",ft[0]),A&&O<9?Je.appendChild(E("span",[Ut])):Je.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=fe.charCodeAt(u.length-1)==32,I||L||k||Se||Y||ue){var on=I||"";L&&(on+=L),k&&(on+=k);var Zt=E("span",[Je],on,Y);if(ue)for(var dn in ue)ue.hasOwnProperty(dn)&&dn!="style"&&dn!="class"&&Zt.setAttribute(dn,ue[dn]);return e.content.appendChild(Zt)}e.content.appendChild(Je)}function Li(e,u){if(e.length>1&&!/ /.test(e))return e;for(var I=u,L="",k=0;k<e.length;k++){var Y=e.charAt(k);Y==" "&&I&&(k==e.length-1||e.charCodeAt(k+1)==32)&&(Y="\xA0"),L+=Y,I=Y==" "}return L}function Zi(e,u){return function(I,L,k,Y,ue,fe,ge){k=k?k+" cm-force-border":"cm-force-border";for(var Se=I.pos,Je=Se+L.length;;){for(var et=void 0,ft=0;ft<u.length&&!(et=u[ft],et.to>Se&&et.from<=Se);ft++);if(et.to>=Je)return e(I,L,k,Y,ue,fe,ge);e(I,L.slice(0,et.to-Se),k,Y,null,fe,ge),Y=null,L=L.slice(et.to-Se),Se=et.to}}}function zn(e,u,I,L){var k=!L&&I.widgetNode;k&&e.map.push(e.pos,e.pos+u,k),!L&&e.cm.display.input.needsContentAttribute&&(k||(k=e.content.appendChild(document.createElement("span"))),k.setAttribute("cm-marker",I.id)),k&&(e.cm.display.input.setUneditable(k),e.content.appendChild(k)),e.pos+=u,e.trailingSpace=!1}function Dr(e,u,I){var L=e.markedSpans,k=e.text,Y=0;if(!L){for(var ue=1;ue<I.length;ue+=2)u.addToken(u,k.slice(Y,Y=I[ue]),Un(I[ue+1],u.cm.options));return}for(var fe=k.length,ge=0,Se=1,Je="",et,ft,ut=0,Tt,Ut,Kt,qt,on;;){if(ut==ge){Tt=Ut=Kt=ft="",on=null,qt=null,ut=Infinity;for(var Zt=[],dn=void 0,On=0;On<L.length;++On){var yn=L[On],ei=yn.marker;if(ei.type=="bookmark"&&yn.from==ge&&ei.widgetNode)Zt.push(ei);else if(yn.from<=ge&&(yn.to==null||yn.to>ge||ei.collapsed&&yn.to==ge&&yn.from==ge)){if(yn.to!=null&&yn.to!=ge&&ut>yn.to&&(ut=yn.to,Ut=""),ei.className&&(Tt+=" "+ei.className),ei.css&&(ft=(ft?ft+";":"")+ei.css),ei.startStyle&&yn.from==ge&&(Kt+=" "+ei.startStyle),ei.endStyle&&yn.to==ut&&(dn||(dn=[])).push(ei.endStyle,yn.to),ei.title&&((on||(on={})).title=ei.title),ei.attributes)for(var Ii in ei.attributes)(on||(on={}))[Ii]=ei.attributes[Ii];ei.collapsed&&(!qt||wi(qt.marker,ei)<0)&&(qt=yn)}else yn.from>ge&&ut>yn.from&&(ut=yn.from)}if(dn)for(var ar=0;ar<dn.length;ar+=2)dn[ar+1]==ut&&(Ut+=" "+dn[ar]);if(!qt||qt.from==ge)for(var Mi=0;Mi<Zt.length;++Mi)zn(u,0,Zt[Mi]);if(qt&&(qt.from||0)==ge){if(zn(u,(qt.to==null?fe+1:qt.to)-ge,qt.marker,qt.from==null),qt.to==null)return;qt.to==ge&&(qt=!1)}}if(ge>=fe)break;for(var Mr=Math.min(fe,ut);;){if(Je){var Cr=ge+Je.length;if(!qt){var $i=Cr>Mr?Je.slice(0,Mr-ge):Je;u.addToken(u,$i,et?et+Tt:Tt,Kt,ge+$i.length==ut?Ut:"",ft,on)}if(Cr>=Mr){Je=Je.slice(Mr-ge),ge=Mr;break}ge=Cr,Kt=""}Je=k.slice(Y,Y=I[Se++]),et=Un(I[Se++],u.cm.options)}}}function hi(e,u,I){this.line=u,this.rest=qi(u),this.size=this.rest?Qe(Ke(this.rest))-I+1:1,this.node=this.text=null,this.hidden=Ir(e,u)}function Vi(e,u,I){for(var L=[],k,Y=u;Y<I;Y=k){var ue=new hi(e.doc,ne(e.doc,Y),Y);k=Y+ue.size,L.push(ue)}return L}var ct=null;function xt(e){ct?ct.ops.push(e):e.ownsGroup=ct={ops:[e],delayedCallbacks:[]}}function zt(e){var u=e.delayedCallbacks,I=0;do{for(;I<u.length;I++)u[I].call(null);for(var L=0;L<e.ops.length;L++){var k=e.ops[L];if(k.cursorActivityHandlers)for(;k.cursorActivityCalled<k.cursorActivityHandlers.length;)k.cursorActivityHandlers[k.cursorActivityCalled++].call(null,k.cm)}}while(I<u.length)}function Ht(e,u){var I=e.ownsGroup;if(!I)return;try{zt(I)}finally{ct=null,u(I)}}var en=null;function Xt(e,u){var I=tt(e,u);if(!I.length)return;var L=Array.prototype.slice.call(arguments,2),k;ct?k=ct.delayedCallbacks:en?k=en:(k=en=[],setTimeout(Et,0));for(var Y=function(fe){k.push(function(){return I[fe].apply(null,L)})},ue=0;ue<I.length;++ue)Y(ue)}function Et(){var e=en;en=null;for(var u=0;u<e.length;++u)e[u]()}function bt(e,u,I,L){for(var k=0;k<u.changes.length;k++){var Y=u.changes[k];Y=="text"?Ft(e,u):Y=="gutter"?Yn(e,u,I,L):Y=="class"?pn(e,u):Y=="widget"&&Ln(e,u,L)}u.changes=null}function Jt(e){return e.node==e.text&&(e.node=E("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),A&&O<8&&(e.node.style.zIndex=2)),e.node}function wt(e,u){var I=u.bgClass?u.bgClass+" "+(u.line.bgClass||""):u.line.bgClass;if(I&&(I+=" CodeMirror-linebackground"),u.background)I?u.background.className=I:(u.background.parentNode.removeChild(u.background),u.background=null);else if(I){var L=Jt(u);u.background=L.insertBefore(E("div",null,I),L.firstChild),e.display.input.setUneditable(u.background)}}function cn(e,u){var I=e.display.externalMeasured;return I&&I.line==u.line?(e.display.externalMeasured=null,u.measure=I.measure,I.built):ni(e,u)}function Ft(e,u){var I=u.text.className,L=cn(e,u);u.text==u.node&&(u.node=L.pre),u.text.parentNode.replaceChild(L.pre,u.text),u.text=L.pre,L.bgClass!=u.bgClass||L.textClass!=u.textClass?(u.bgClass=L.bgClass,u.textClass=L.textClass,pn(e,u)):I&&(u.text.className=I)}function pn(e,u){wt(e,u),u.line.wrapClass?Jt(u).className=u.line.wrapClass:u.node!=u.text&&(u.node.className="");var I=u.textClass?u.textClass+" "+(u.line.textClass||""):u.line.textClass;u.text.className=I||""}function Yn(e,u,I,L){if(u.gutter&&(u.node.removeChild(u.gutter),u.gutter=null),u.gutterBackground&&(u.node.removeChild(u.gutterBackground),u.gutterBackground=null),u.line.gutterClass){var k=Jt(u);u.gutterBackground=E("div",null,"CodeMirror-gutter-background "+u.line.gutterClass,"left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px; width: "+L.gutterTotalWidth+"px"),e.display.input.setUneditable(u.gutterBackground),k.insertBefore(u.gutterBackground,u.text)}var Y=u.line.gutterMarkers;if(e.options.lineNumbers||Y){var ue=Jt(u),fe=u.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?L.fixedPos:-L.gutterTotalWidth)+"px");if(e.display.input.setUneditable(fe),ue.insertBefore(fe,u.text),u.line.gutterClass&&(fe.className+=" "+u.line.gutterClass),e.options.lineNumbers&&(!Y||!Y["CodeMirror-linenumbers"])&&(u.lineNumber=fe.appendChild(E("div",Nt(e.options,I),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+L.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),Y)for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Se=e.display.gutterSpecs[ge].className,Je=Y.hasOwnProperty(Se)&&Y[Se];Je&&fe.appendChild(E("div",[Je],"CodeMirror-gutter-elt","left: "+L.gutterLeft[Se]+"px; width: "+L.gutterWidth[Se]+"px"))}}}function Ln(e,u,I){u.alignable&&(u.alignable=null);for(var L=m("CodeMirror-linewidget"),k=u.node.firstChild,Y=void 0;k;k=Y)Y=k.nextSibling,L.test(k.className)&&u.node.removeChild(k);Zn(e,u,I)}function Sn(e,u,I,L){var k=cn(e,u);return u.text=u.node=k.pre,k.bgClass&&(u.bgClass=k.bgClass),k.textClass&&(u.textClass=k.textClass),pn(e,u),Yn(e,u,I,L),Zn(e,u,L),u.node}function Zn(e,u,I){if(In(e,u.line,u,I,!0),u.rest)for(var L=0;L<u.rest.length;L++)In(e,u.rest[L],u,I,!1)}function In(e,u,I,L,k){if(!u.widgets)return;for(var Y=Jt(I),ue=0,fe=u.widgets;ue<fe.length;++ue){var ge=fe[ue],Se=E("div",[ge.node],"CodeMirror-linewidget"+(ge.className?" "+ge.className:""));ge.handleMouseEvents||Se.setAttribute("cm-ignore-events","true"),$n(ge,Se,I,L),e.display.input.setUneditable(Se),k&&ge.above?Y.insertBefore(Se,I.gutter||I.text):Y.appendChild(Se),Xt(ge,"redraw")}}function $n(e,u,I,L){if(e.noHScroll){(I.alignable||(I.alignable=[])).push(u);var k=L.wrapperWidth;u.style.left=L.fixedPos+"px",e.coverGutter||(k-=L.gutterTotalWidth,u.style.paddingLeft=L.gutterTotalWidth+"px"),u.style.width=k+"px"}e.coverGutter&&(u.style.zIndex=5,u.style.position="relative",e.noHScroll||(u.style.marginLeft=-L.gutterTotalWidth+"px"))}function Kn(e){if(e.height!=null)return e.height;var u=e.doc.cm;if(!u)return 0;if(!R(document.body,e.node)){var I="position: relative;";e.coverGutter&&(I+="margin-left: -"+u.display.gutters.offsetWidth+"px;"),e.noHScroll&&(I+="width: "+u.display.wrapper.clientWidth+"px;"),h(u.display.measure,E("div",[e.node],null,I))}return e.height=e.node.parentNode.offsetHeight}function fi(e,u){for(var I=Ve(u);I!=e.wrapper;I=I.parentNode)if(!I||I.nodeType==1&&I.getAttribute("cm-ignore-events")=="true"||I.parentNode==e.sizer&&I!=e.mover)return!0}function ti(e){return e.lineSpace.offsetTop}function Ei(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ci(e){if(e.cachedPaddingH)return e.cachedPaddingH;var u=h(e.measure,E("pre","x","CodeMirror-line-like")),I=window.getComputedStyle?window.getComputedStyle(u):u.currentStyle,L={left:parseInt(I.paddingLeft),right:parseInt(I.paddingRight)};return!isNaN(L.left)&&!isNaN(L.right)&&(e.cachedPaddingH=L),L}function ui(e){return Z-e.display.nativeBarWidth}function jn(e){return e.display.scroller.clientWidth-ui(e)-e.display.barWidth}function si(e){return e.display.scroller.clientHeight-ui(e)-e.display.barHeight}function Fn(e,u,I){var L=e.options.lineWrapping,k=L&&jn(e);if(!u.measure.heights||L&&u.measure.width!=k){var Y=u.measure.heights=[];if(L){u.measure.width=k;for(var ue=u.text.firstChild.getClientRects(),fe=0;fe<ue.length-1;fe++){var ge=ue[fe],Se=ue[fe+1];Math.abs(ge.bottom-Se.bottom)>2&&Y.push((ge.bottom+Se.top)/2-I.top)}}Y.push(I.bottom-I.top)}}function Vt(e,u,I){if(e.line==u)return{map:e.measure.map,cache:e.measure.cache};for(var L=0;L<e.rest.length;L++)if(e.rest[L]==u)return{map:e.measure.maps[L],cache:e.measure.caches[L]};for(var k=0;k<e.rest.length;k++)if(Qe(e.rest[k])>I)return{map:e.measure.maps[k],cache:e.measure.caches[k],before:!0}}function _n(e,u){u=Qi(u);var I=Qe(u),L=e.display.externalMeasured=new hi(e.doc,u,I);L.lineN=I;var k=L.built=ni(e,L);return L.text=k.pre,h(e.display.lineMeasure,k.pre),L}function ci(e,u,I,L){return Dn(e,li(e,u),I,L)}function yi(e,u){if(u>=e.display.viewFrom&&u<e.display.viewTo)return e.display.view[tr(e,u)];var I=e.display.externalMeasured;if(I&&u>=I.lineN&&u<I.lineN+I.size)return I}function li(e,u){var I=Qe(u),L=yi(e,I);L&&!L.text?L=null:L&&L.changes&&(bt(e,L,I,ai(e)),e.curOp.forceUpdate=!0),L||(L=_n(e,u));var k=Vt(L,u,I);return{line:u,view:L,rect:null,map:k.map,cache:k.cache,before:k.before,hasHeights:!1}}function Dn(e,u,I,L,k){u.before&&(I=-1);var Y=I+(L||""),ue;return u.cache.hasOwnProperty(Y)?ue=u.cache[Y]:(u.rect||(u.rect=u.view.text.getBoundingClientRect()),u.hasHeights||(Fn(e,u.view,u.rect),u.hasHeights=!0),ue=Gt(e,u,I,L),ue.bogus||(u.cache[Y]=ue)),{left:ue.left,right:ue.right,top:k?ue.rtop:ue.top,bottom:k?ue.rbottom:ue.bottom}}var Jn={left:0,right:0,top:0,bottom:0};function gn(e,u,I){for(var L,k,Y,ue,fe,ge,Se=0;Se<e.length;Se+=3)if(fe=e[Se],ge=e[Se+1],u<fe?(k=0,Y=1,ue="left"):u<ge?(k=u-fe,Y=k+1):(Se==e.length-3||u==ge&&e[Se+3]>u)&&(Y=ge-fe,k=Y-1,u>=ge&&(ue="right")),k!=null){if(L=e[Se+2],fe==ge&&I==(L.insertLeft?"left":"right")&&(ue=I),I=="left"&&k==0)for(;Se&&e[Se-2]==e[Se-3]&&e[Se-1].insertLeft;)L=e[(Se-=3)+2],ue="left";if(I=="right"&&k==ge-fe)for(;Se<e.length-3&&e[Se+3]==e[Se+4]&&!e[Se+5].insertLeft;)L=e[(Se+=3)+2],ue="right";break}return{node:L,start:k,end:Y,collapse:ue,coverStart:fe,coverEnd:ge}}function An(e,u){var I=Jn;if(u=="left")for(var L=0;L<e.length&&!((I=e[L]).left!=I.right);L++);else for(var k=e.length-1;k>=0&&!((I=e[k]).left!=I.right);k--);return I}function Gt(e,u,I,L){var k=gn(u.map,I,L),Y=k.node,ue=k.start,fe=k.end,ge=k.collapse,Se;if(Y.nodeType==3){for(var Je=0;Je<4;Je++){for(;ue&&P(u.line.text.charAt(k.coverStart+ue));)--ue;for(;k.coverStart+fe<k.coverEnd&&P(u.line.text.charAt(k.coverStart+fe));)++fe;if(A&&O<9&&ue==0&&fe==k.coverEnd-k.coverStart?Se=Y.parentNode.getBoundingClientRect():Se=An(w(Y,ue,fe).getClientRects(),L),Se.left||Se.right||ue==0)break;fe=ue,ue=ue-1,ge="right"}A&&O<11&&(Se=Qt(e.display.measure,Se))}else{ue>0&&(ge=L="right");var et;e.options.lineWrapping&&(et=Y.getClientRects()).length>1?Se=et[L=="right"?et.length-1:0]:Se=Y.getBoundingClientRect()}if(A&&O<9&&!ue&&(!Se||!Se.left&&!Se.right)){var ft=Y.parentNode.getClientRects()[0];ft?Se={left:ft.left,right:ft.left+Xn(e.display),top:ft.top,bottom:ft.bottom}:Se=Jn}for(var ut=Se.top-u.rect.top,Tt=Se.bottom-u.rect.top,Ut=(ut+Tt)/2,Kt=u.view.measure.heights,qt=0;qt<Kt.length-1&&!(Ut<Kt[qt]);qt++);var on=qt?Kt[qt-1]:0,Zt=Kt[qt],dn={left:(ge=="right"?Se.right:Se.left)-u.rect.left,right:(ge=="left"?Se.left:Se.right)-u.rect.left,top:on,bottom:Zt};return!Se.left&&!Se.right&&(dn.bogus=!0),e.options.singleCursorHeightPerLine||(dn.rtop=ut,dn.rbottom=Tt),dn}function Qt(e,u){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ze(e))return u;var I=screen.logicalXDPI/screen.deviceXDPI,L=screen.logicalYDPI/screen.deviceYDPI;return{left:u.left*I,right:u.right*I,top:u.top*L,bottom:u.bottom*L}}function an(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var u=0;u<e.rest.length;u++)e.measure.caches[u]={}}function bn(e){e.display.externalMeasure=null,x(e.display.lineMeasure);for(var u=0;u<e.display.view.length;u++)an(e.display.view[u])}function un(e){bn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Gn(){return c&&a?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function En(){return c&&a?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function kn(e){var u=0;if(e.widgets)for(var I=0;I<e.widgets.length;++I)e.widgets[I].above&&(u+=Kn(e.widgets[I]));return u}function Tn(e,u,I,L,k){if(!k){var Y=kn(u);I.top+=Y,I.bottom+=Y}if(L=="line")return I;L||(L="local");var ue=xr(u);if(L=="local"?ue+=ti(e.display):ue-=e.display.viewOffset,L=="page"||L=="window"){var fe=e.display.lineSpace.getBoundingClientRect();ue+=fe.top+(L=="window"?0:En());var ge=fe.left+(L=="window"?0:Gn());I.left+=ge,I.right+=ge}return I.top+=ue,I.bottom+=ue,I}function pi(e,u,I){if(I=="div")return u;var L=u.left,k=u.top;if(I=="page")L-=Gn(),k-=En();else if(I=="local"||!I){var Y=e.display.sizer.getBoundingClientRect();L+=Y.left,k+=Y.top}var ue=e.display.lineSpace.getBoundingClientRect();return{left:L-ue.left,top:k-ue.top}}function ii(e,u,I,L,k){return L||(L=ne(e.doc,u.line)),Tn(e,L,ci(e,L,u.ch,k),I)}function ri(e,u,I,L,k,Y){L=L||ne(e.doc,u.line),k||(k=li(e,L));function ue(Tt,Ut){var Kt=Dn(e,k,Tt,Ut?"right":"left",Y);return Ut?Kt.left=Kt.right:Kt.right=Kt.left,Tn(e,L,Kt,I)}var fe=dt(L,e.doc.direction),ge=u.ch,Se=u.sticky;if(ge>=L.text.length?(ge=L.text.length,Se="before"):ge<=0&&(ge=0,Se="after"),!fe)return ue(Se=="before"?ge-1:ge,Se=="before");function Je(Tt,Ut,Kt){var qt=fe[Ut],on=qt.level==1;return ue(Kt?Tt-1:Tt,on!=Kt)}var et=xe(fe,ge,Se),ft=Q,ut=Je(ge,et,Se=="before");return ft!=null&&(ut.other=Je(ge,ft,Se!="before")),ut}function ki(e,u){var I=0;u=U(e.doc,u),e.options.lineWrapping||(I=Xn(e.display)*u.ch);var L=ne(e.doc,u.line),k=xr(L)+ti(e.display);return{left:I,right:I,top:k,bottom:k+L.height}}function Xi(e,u,I,L,k){var Y=ht(e,u,I);return Y.xRel=k,L&&(Y.outside=L),Y}function kr(e,u,I){var L=e.doc;if(I+=e.display.viewOffset,I<0)return Xi(L.first,0,null,-1,-1);var k=ot(L,I),Y=L.first+L.size-1;if(k>Y)return Xi(L.first+L.size-1,ne(L,Y).text.length,null,1,1);u<0&&(u=0);for(var ue=ne(L,k);;){var fe=Vr(e,ue,k,u,I),ge=Lr(ue,fe.ch+(fe.xRel>0||fe.outside>0?1:0));if(!ge)return fe;var Se=ge.find(1);if(Se.line==k)return Se;ue=ne(L,k=Se.line)}}function er(e,u,I,L){L-=kn(u);var k=u.text.length,Y=ee(function(ue){return Dn(e,I,ue-1).bottom<=L},k,0);return k=ee(function(ue){return Dn(e,I,ue).top>L},Y,k),{begin:Y,end:k}}function Ur(e,u,I,L){I||(I=li(e,u));var k=Tn(e,u,Dn(e,I,L),"line").top;return er(e,u,I,k)}function Gr(e,u,I,L){return e.bottom<=I?!1:e.top>I?!0:(L?e.left:e.right)>u}function Vr(e,u,I,L,k){k-=xr(u);var Y=li(e,u),ue=kn(u),fe=0,ge=u.text.length,Se=!0,Je=dt(u,e.doc.direction);if(Je){var et=(e.options.lineWrapping?ba:Wr)(e,u,I,Y,Je,L,k);Se=et.level!=1,fe=Se?et.from:et.to-1,ge=Se?et.to:et.from-1}var ft=null,ut=null,Tt=ee(function(On){var yn=Dn(e,Y,On);return yn.top+=ue,yn.bottom+=ue,Gr(yn,L,k,!1)?(yn.top<=k&&yn.left<=L&&(ft=On,ut=yn),!0):!1},fe,ge),Ut,Kt,qt=!1;if(ut){var on=L-ut.left<ut.right-L,Zt=on==Se;Tt=ft+(Zt?0:1),Kt=Zt?"after":"before",Ut=on?ut.left:ut.right}else{!Se&&(Tt==ge||Tt==fe)&&Tt++,Kt=Tt==0?"after":Tt==u.text.length?"before":Dn(e,Y,Tt-(Se?1:0)).bottom+ue<=k==Se?"after":"before";var dn=ri(e,ht(I,Tt,Kt),"line",u,Y);Ut=dn.left,qt=k<dn.top?-1:k>=dn.bottom?1:0}return Tt=j(u.text,Tt,1),Xi(I,Tt,Kt,qt,L-Ut)}function Wr(e,u,I,L,k,Y,ue){var fe=ee(function(et){var ft=k[et],ut=ft.level!=1;return Gr(ri(e,ht(I,ut?ft.to:ft.from,ut?"before":"after"),"line",u,L),Y,ue,!0)},0,k.length-1),ge=k[fe];if(fe>0){var Se=ge.level!=1,Je=ri(e,ht(I,Se?ge.from:ge.to,Se?"after":"before"),"line",u,L);Gr(Je,Y,ue,!0)&&Je.top>ue&&(ge=k[fe-1])}return ge}function ba(e,u,I,L,k,Y,ue){var fe=er(e,u,L,ue),ge=fe.begin,Se=fe.end;/\s/.test(u.text.charAt(Se-1))&&Se--;for(var Je=null,et=null,ft=0;ft<k.length;ft++){var ut=k[ft];if(ut.from>=Se||ut.to<=ge)continue;var Tt=ut.level!=1,Ut=Dn(e,L,Tt?Math.min(Se,ut.to)-1:Math.max(ge,ut.from)).right,Kt=Ut<Y?Y-Ut+1e9:Ut-Y;(!Je||et>Kt)&&(Je=ut,et=Kt)}return Je||(Je=k[k.length-1]),Je.from<ge&&(Je={from:ge,to:Je.to,level:Je.level}),Je.to>Se&&(Je={from:Je.from,to:Se,level:Je.level}),Je}var Vn;function xn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Vn==null){Vn=E("pre",null,"CodeMirror-line-like");for(var u=0;u<49;++u)Vn.appendChild(document.createTextNode("x")),Vn.appendChild(E("br"));Vn.appendChild(document.createTextNode("x"))}h(e.measure,Vn);var I=Vn.offsetHeight/50;return I>3&&(e.cachedTextHeight=I),x(e.measure),I||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var u=E("span","xxxxxxxxxx"),I=E("pre",[u],"CodeMirror-line-like");h(e.measure,I);var L=u.getBoundingClientRect(),k=(L.right-L.left)/10;return k>2&&(e.cachedCharWidth=k),k||10}function ai(e){for(var u=e.display,I={},L={},k=u.gutters.clientLeft,Y=u.gutters.firstChild,ue=0;Y;Y=Y.nextSibling,++ue){var fe=e.display.gutterSpecs[ue].className;I[fe]=Y.offsetLeft+Y.clientLeft+k,L[fe]=Y.clientWidth}return{fixedPos:Ui(u),gutterTotalWidth:u.gutters.offsetWidth,gutterLeft:I,gutterWidth:L,wrapperWidth:u.wrapper.clientWidth}}function Ui(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qn(e){var u=xn(e.display),I=e.options.lineWrapping,L=I&&Math.max(5,e.display.scroller.clientWidth/Xn(e.display)-3);return function(k){if(Ir(e.doc,k))return 0;var Y=0;if(k.widgets)for(var ue=0;ue<k.widgets.length;ue++)k.widgets[ue].height&&(Y+=k.widgets[ue].height);return I?Y+(Math.ceil(k.text.length/L)||1)*u:Y+u}}function wr(e){var u=e.doc,I=Qn(e);u.iter(function(L){var k=I(L);k!=L.height&&Ae(L,k)})}function yr(e,u,I,L){var k=e.display;if(!I&&Ve(u).getAttribute("cm-not-content")=="true")return null;var Y,ue,fe=k.lineSpace.getBoundingClientRect();try{Y=u.clientX-fe.left,ue=u.clientY-fe.top}catch(et){return null}var ge=kr(e,Y,ue),Se;if(L&&ge.xRel>0&&(Se=ne(e.doc,ge.line).text).length==ge.ch){var Je=G(Se,Se.length,e.options.tabSize)-Se.length;ge=ht(ge.line,Math.max(0,Math.round((Y-Ci(e.display).left)/Xn(e.display))-Je))}return ge}function tr(e,u){if(u>=e.display.viewTo)return null;if(u-=e.display.viewFrom,u<0)return null;for(var I=e.display.view,L=0;L<I.length;L++)if(u-=I[L].size,u<0)return L}function Hi(e,u,I,L){u==null&&(u=e.doc.first),I==null&&(I=e.doc.first+e.doc.size),L||(L=0);var k=e.display;if(L&&I<k.viewTo&&(k.updateLineNumbers==null||k.updateLineNumbers>u)&&(k.updateLineNumbers=u),e.curOp.viewChanged=!0,u>=k.viewTo)vi&&Kr(e.doc,u)<k.viewTo&&cr(e);else if(I<=k.viewFrom)vi&&Nr(e.doc,I+L)>k.viewFrom?cr(e):(k.viewFrom+=L,k.viewTo+=L);else if(u<=k.viewFrom&&I>=k.viewTo)cr(e);else if(u<=k.viewFrom){var Y=Nn(e,I,I+L,1);Y?(k.view=k.view.slice(Y.index),k.viewFrom=Y.lineN,k.viewTo+=L):cr(e)}else if(I>=k.viewTo){var ue=Nn(e,u,u,-1);ue?(k.view=k.view.slice(0,ue.index),k.viewTo=ue.lineN):cr(e)}else{var fe=Nn(e,u,u,-1),ge=Nn(e,I,I+L,1);fe&&ge?(k.view=k.view.slice(0,fe.index).concat(Vi(e,fe.lineN,ge.lineN)).concat(k.view.slice(ge.index)),k.viewTo+=L):cr(e)}var Se=k.externalMeasured;Se&&(I<Se.lineN?Se.lineN+=L:u<Se.lineN+Se.size&&(k.externalMeasured=null))}function pr(e,u,I){e.curOp.viewChanged=!0;var L=e.display,k=e.display.externalMeasured;if(k&&u>=k.lineN&&u<k.lineN+k.size&&(L.externalMeasured=null),u<L.viewFrom||u>=L.viewTo)return;var Y=L.view[tr(e,u)];if(Y.node==null)return;var ue=Y.changes||(Y.changes=[]);K(ue,I)==-1&&ue.push(I)}function cr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Nn(e,u,I,L){var k=tr(e,u),Y,ue=e.display.view;if(!vi||I==e.doc.first+e.doc.size)return{index:k,lineN:I};for(var fe=e.display.viewFrom,ge=0;ge<k;ge++)fe+=ue[ge].size;if(fe!=u){if(L>0){if(k==ue.length-1)return null;Y=fe+ue[k].size-u,k++}else Y=fe-u;u+=Y,I+=Y}for(;Kr(e.doc,I)!=I;){if(k==(L<0?0:ue.length-1))return null;I+=L*ue[k-(L<0?1:0)].size,k+=L}return{index:k,lineN:I}}function Rn(e,u,I){var L=e.display,k=L.view;k.length==0||u>=L.viewTo||I<=L.viewFrom?(L.view=Vi(e,u,I),L.viewFrom=u):(L.viewFrom>u?L.view=Vi(e,u,L.viewFrom).concat(L.view):L.viewFrom<u&&(L.view=L.view.slice(tr(e,u))),L.viewFrom=u,L.viewTo<I?L.view=L.view.concat(Vi(e,L.viewTo,I)):L.viewTo>I&&(L.view=L.view.slice(0,tr(e,I)))),L.viewTo=I}function qn(e){for(var u=e.display.view,I=0,L=0;L<u.length;L++){var k=u[L];!k.hidden&&(!k.node||k.changes)&&++I}return I}function tn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Pn(e,u){u===void 0&&(u=!0);for(var I=e.doc,L={},k=L.cursors=document.createDocumentFragment(),Y=L.selection=document.createDocumentFragment(),ue=0;ue<I.sel.ranges.length;ue++){if(!u&&ue==I.sel.primIndex)continue;var fe=I.sel.ranges[ue];if(fe.from().line>=e.display.viewTo||fe.to().line<e.display.viewFrom)continue;var ge=fe.empty();(ge||e.options.showCursorWhenSelecting)&&Si(e,fe.head,k),ge||Yi(e,fe,Y)}return L}function Si(e,u,I){var L=ri(e,u,"div",null,null,!e.options.singleCursorHeightPerLine),k=I.appendChild(E("div","\xA0","CodeMirror-cursor"));if(k.style.left=L.left+"px",k.style.top=L.top+"px",k.style.height=Math.max(0,L.bottom-L.top)*e.options.cursorHeight+"px",L.other){var Y=I.appendChild(E("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Y.style.display="",Y.style.left=L.other.left+"px",Y.style.top=L.other.top+"px",Y.style.height=(L.other.bottom-L.other.top)*.85+"px"}}function ji(e,u){return e.top-u.top||e.left-u.left}function Yi(e,u,I){var L=e.display,k=e.doc,Y=document.createDocumentFragment(),ue=Ci(e.display),fe=ue.left,ge=Math.max(L.sizerWidth,jn(e)-L.sizer.offsetLeft)-ue.right,Se=k.direction=="ltr";function Je(Zt,dn,On,yn){dn<0&&(dn=0),dn=Math.round(dn),yn=Math.round(yn),Y.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+Zt+`px;
|
|
|
top: `+dn+"px; width: "+(On==null?ge-Zt:On)+`px;
|
|
|
height: `+(yn-dn)+"px"))}function et(Zt,dn,On){var yn=ne(k,Zt),ei=yn.text.length,Ii,ar;function Mi($i,Or){return ii(e,ht(Zt,$i),"div",yn,Or)}function Mr($i,Or,dr){var nr=Ur(e,yn,null,$i),Ji=Or=="ltr"==(dr=="after")?"left":"right",Fi=dr=="after"?nr.begin:nr.end-(/\s/.test(yn.text.charAt(nr.end-1))?2:1);return Mi(Fi,Ji)[Ji]}var Cr=dt(yn,k.direction);return $(Cr,dn||0,On==null?ei:On,function($i,Or,dr,nr){var Ji=dr=="ltr",Fi=Mi($i,Ji?"left":"right"),Ar=Mi(Or-1,Ji?"right":"left"),Da=dn==null&&$i==0,ha=On==null&&Or==ei,gr=nr==0,Zr=!Cr||nr==Cr.length-1;if(Ar.top-Fi.top<=3){var or=(Se?Da:ha)&&gr,Fo=(Se?ha:Da)&&Zr,na=or?fe:(Ji?Fi:Ar).left,_a=Fo?ge:(Ji?Ar:Fi).right;Je(na,Fi.top,_a-na,Fi.bottom)}else{var ya,Er,ka,Bo;Ji?(ya=Se&&Da&&gr?fe:Fi.left,Er=Se?ge:Mr($i,dr,"before"),ka=Se?fe:Mr(Or,dr,"after"),Bo=Se&&ha&&Zr?ge:Ar.right):(ya=Se?Mr($i,dr,"before"):fe,Er=!Se&&Da&&gr?ge:Fi.right,ka=!Se&&ha&&Zr?fe:Ar.left,Bo=Se?Mr(Or,dr,"after"):ge),Je(ya,Fi.top,Er-ya,Fi.bottom),Fi.bottom<Ar.top&&Je(fe,Fi.bottom,null,Ar.top),Je(ka,Ar.top,Bo-ka,Ar.bottom)}(!Ii||ji(Fi,Ii)<0)&&(Ii=Fi),ji(Ar,Ii)<0&&(Ii=Ar),(!ar||ji(Fi,ar)<0)&&(ar=Fi),ji(Ar,ar)<0&&(ar=Ar)}),{start:Ii,end:ar}}var ft=u.from(),ut=u.to();if(ft.line==ut.line)et(ft.line,ft.ch,ut.ch);else{var Tt=ne(k,ft.line),Ut=ne(k,ut.line),Kt=Qi(Tt)==Qi(Ut),qt=et(ft.line,ft.ch,Kt?Tt.text.length+1:null).end,on=et(ut.line,Kt?0:null,ut.ch).start;Kt&&(qt.top<on.top-2?(Je(qt.right,qt.top,null,qt.bottom),Je(fe,on.top,on.left,on.bottom)):Je(qt.right,qt.top,on.left-qt.right,qt.bottom)),qt.bottom<on.top&&Je(fe,qt.bottom,null,on.top)}I.appendChild(Y)}function ia(e){if(!e.state.focused)return;var u=e.display;clearInterval(u.blinker);var I=!0;u.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?u.blinker=setInterval(function(){e.hasFocus()||Sr(e),u.cursorDiv.style.visibility=(I=!I)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(u.cursorDiv.style.visibility="hidden")}function vn(e){e.state.focused||(e.display.input.focus(),fa(e))}function ra(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Sr(e))},100)}function fa(e,u){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(qe(e,"focus",e,u),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),f&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ia(e)}function Sr(e,u){if(e.state.delayingBlurEvent)return;e.state.focused&&(qe(e,"blur",e,u),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Hr(e){for(var u=e.display,I=u.lineDiv.offsetTop,L=0;L<u.view.length;L++){var k=u.view[L],Y=e.options.lineWrapping,ue=void 0,fe=0;if(k.hidden)continue;if(A&&O<8){var ge=k.node.offsetTop+k.node.offsetHeight;ue=ge-I,I=ge}else{var Se=k.node.getBoundingClientRect();ue=Se.bottom-Se.top,!Y&&k.text.firstChild&&(fe=k.text.firstChild.getBoundingClientRect().right-Se.left-1)}var Je=k.line.height-ue;if((Je>.005||Je<-.005)&&(Ae(k.line,ue),zr(k.line),k.rest))for(var et=0;et<k.rest.length;et++)zr(k.rest[et]);if(fe>e.display.sizerWidth){var ft=Math.ceil(fe/Xn(e.display));ft>e.display.maxLineLength&&(e.display.maxLineLength=ft,e.display.maxLine=k.line,e.display.maxLineChanged=!0)}}}function zr(e){if(e.widgets)for(var u=0;u<e.widgets.length;++u){var I=e.widgets[u],L=I.node.parentNode;L&&(I.height=L.offsetHeight)}}function Xr(e,u,I){var L=I&&I.top!=null?Math.max(0,I.top):e.scroller.scrollTop;L=Math.floor(L-ti(e));var k=I&&I.bottom!=null?I.bottom:L+e.wrapper.clientHeight,Y=ot(u,L),ue=ot(u,k);if(I&&I.ensure){var fe=I.ensure.from.line,ge=I.ensure.to.line;fe<Y?(Y=fe,ue=ot(u,xr(ne(u,fe))+e.wrapper.clientHeight)):Math.min(ge,u.lastLine())>=ue&&(Y=ot(u,xr(ne(u,ge))-e.wrapper.clientHeight),ue=ge)}return{from:Y,to:Math.max(ue,Y+1)}}function aa(e,u){if(Ye(e,"scrollCursorIntoView"))return;var I=e.display,L=I.sizer.getBoundingClientRect(),k=null;if(u.top+L.top<0?k=!0:u.bottom+L.top>(window.innerHeight||document.documentElement.clientHeight)&&(k=!1),k!=null&&!r){var Y=E("div","\u200B",null,`position: absolute;
|
|
|
top: `+(u.top-I.viewOffset-ti(e.display))+`px;
|
|
|
height: `+(u.bottom-u.top+ui(e)+I.barHeight)+`px;
|
|
|
left: `+u.left+"px; width: "+Math.max(2,u.right-u.left)+"px;");e.display.lineSpace.appendChild(Y),Y.scrollIntoView(k),e.display.lineSpace.removeChild(Y)}}function oa(e,u,I,L){L==null&&(L=0);var k;!e.options.lineWrapping&&u==I&&(u=u.ch?ht(u.line,u.sticky=="before"?u.ch-1:u.ch,"after"):u,I=u.sticky=="before"?ht(u.line,u.ch+1,"before"):u);for(var Y=0;Y<5;Y++){var ue=!1,fe=ri(e,u),ge=!I||I==u?fe:ri(e,I);k={left:Math.min(fe.left,ge.left),top:Math.min(fe.top,ge.top)-L,right:Math.max(fe.left,ge.left),bottom:Math.max(fe.bottom,ge.bottom)+L};var Se=zi(e,k),Je=e.doc.scrollTop,et=e.doc.scrollLeft;if(Se.scrollTop!=null&&(Ma(e,Se.scrollTop),Math.abs(e.doc.scrollTop-Je)>1&&(ue=!0)),Se.scrollLeft!=null&&(pa(e,Se.scrollLeft),Math.abs(e.doc.scrollLeft-et)>1&&(ue=!0)),!ue)break}return k}function vo(e,u){var I=zi(e,u);I.scrollTop!=null&&Ma(e,I.scrollTop),I.scrollLeft!=null&&pa(e,I.scrollLeft)}function zi(e,u){var I=e.display,L=xn(e.display);u.top<0&&(u.top=0);var k=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:I.scroller.scrollTop,Y=si(e),ue={};u.bottom-u.top>Y&&(u.bottom=u.top+Y);var fe=e.doc.height+Ei(I),ge=u.top<L,Se=u.bottom>fe-L;if(u.top<k)ue.scrollTop=ge?0:u.top;else if(u.bottom>k+Y){var Je=Math.min(u.top,(Se?fe:u.bottom)-Y);Je!=k&&(ue.scrollTop=Je)}var et=e.options.fixedGutter?0:I.gutters.offsetWidth,ft=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:I.scroller.scrollLeft-et,ut=jn(e)-I.gutters.offsetWidth,Tt=u.right-u.left>ut;return Tt&&(u.right=u.left+ut),u.left<10?ue.scrollLeft=0:u.left<ft?ue.scrollLeft=Math.max(0,u.left+et-(Tt?0:10)):u.right>ut+ft-3&&(ue.scrollLeft=u.right+(Tt?0:10)-ut),ue}function _o(e,u){if(u==null)return;eo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+u}function Ea(e){eo(e);var u=e.getCursor();e.curOp.scrollToPos={from:u,to:u,margin:e.options.cursorScrollMargin}}function Pa(e,u,I){(u!=null||I!=null)&&eo(e),u!=null&&(e.curOp.scrollLeft=u),I!=null&&(e.curOp.scrollTop=I)}function Qs(e,u){eo(e),e.curOp.scrollToPos=u}function eo(e){var u=e.curOp.scrollToPos;if(u){e.curOp.scrollToPos=null;var I=ki(e,u.from),L=ki(e,u.to);Wo(e,I,L,u.margin)}}function Wo(e,u,I,L){var k=zi(e,{left:Math.min(u.left,I.left),top:Math.min(u.top,I.top)-L,right:Math.max(u.right,I.right),bottom:Math.max(u.bottom,I.bottom)+L});Pa(e,k.scrollLeft,k.scrollTop)}function Ma(e,u){if(Math.abs(e.doc.scrollTop-u)<2)return;W||bo(e,{top:u}),Ho(e,u,!0),W&&bo(e),ja(e,100)}function Ho(e,u,I){if(u=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,u)),e.display.scroller.scrollTop==u&&!I)return;e.doc.scrollTop=u,e.display.scrollbars.setScrollTop(u),e.display.scroller.scrollTop!=u&&(e.display.scroller.scrollTop=u)}function pa(e,u,I,L){if(u=Math.max(0,Math.min(u,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(I?u==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-u)<2)&&!L)return;e.doc.scrollLeft=u,Xo(e),e.display.scroller.scrollLeft!=u&&(e.display.scroller.scrollLeft=u),e.display.scrollbars.setScrollLeft(u)}function Na(e){var u=e.display,I=u.gutters.offsetWidth,L=Math.round(e.doc.height+Ei(e.display));return{clientHeight:u.scroller.clientHeight,viewHeight:u.wrapper.clientHeight,scrollWidth:u.scroller.scrollWidth,clientWidth:u.scroller.clientWidth,viewWidth:u.wrapper.clientWidth,barLeft:e.options.fixedGutter?I:0,docHeight:L,scrollHeight:L+ui(e)+u.barHeight,nativeBarWidth:u.nativeBarWidth,gutterWidth:I}}var ma=function(e,u,I){this.cm=I;var L=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),k=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");L.tabIndex=k.tabIndex=-1,e(L),e(k),Be(L,"scroll",function(){L.clientHeight&&u(L.scrollTop,"vertical")}),Be(k,"scroll",function(){k.clientWidth&&u(k.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,A&&O<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ma.prototype.update=function(e){var u=e.scrollWidth>e.clientWidth+1,I=e.scrollHeight>e.clientHeight+1,L=e.nativeBarWidth;if(I){this.vert.style.display="block",this.vert.style.bottom=u?L+"px":"0";var k=e.viewHeight-(u?L:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+k)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(u){this.horiz.style.display="block",this.horiz.style.right=I?L+"px":"0",this.horiz.style.left=e.barLeft+"px";var Y=e.viewWidth-e.barLeft-(I?L:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+Y)+"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:I?L:0,bottom:u?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&&!o?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new J,this.disableVert=new J},ma.prototype.enableZeroWidthBar=function(e,u,I){e.style.pointerEvents="auto";function L(){var k=e.getBoundingClientRect(),Y=I=="vert"?document.elementFromPoint(k.right-1,(k.top+k.bottom)/2):document.elementFromPoint((k.right+k.left)/2,k.bottom-1);Y!=e?e.style.pointerEvents="none":u.set(1e3,L)}u.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,u){u||(u=Na(e));var I=e.display.barWidth,L=e.display.barHeight;zo(e,u);for(var k=0;k<4&&I!=e.display.barWidth||L!=e.display.barHeight;k++)I!=e.display.barWidth&&e.options.lineWrapping&&Hr(e),zo(e,Na(e)),I=e.display.barWidth,L=e.display.barHeight}function zo(e,u){var I=e.display,L=I.scrollbars.update(u);I.sizer.style.paddingRight=(I.barWidth=L.right)+"px",I.sizer.style.paddingBottom=(I.barHeight=L.bottom)+"px",I.heightForcer.style.borderBottom=L.bottom+"px solid transparent",L.right&&L.bottom?(I.scrollbarFiller.style.display="block",I.scrollbarFiller.style.height=L.bottom+"px",I.scrollbarFiller.style.width=L.right+"px"):I.scrollbarFiller.style.display="",L.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(I.gutterFiller.style.display="block",I.gutterFiller.style.height=L.bottom+"px",I.gutterFiller.style.width=u.gutterWidth+"px"):I.gutterFiller.style.display=""}var Ko={native:ma,null:Ua};function Go(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ko[e.options.scrollbarStyle](function(u){e.display.wrapper.insertBefore(u,e.display.scrollbarFiller),Be(u,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),u.setAttribute("cm-not-content","true")},function(u,I){I=="horizontal"?pa(e,u):Ma(e,u)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function ga(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},xt(e.curOp)}function va(e){var u=e.curOp;u&&Ht(u,function(I){for(var L=0;L<I.ops.length;L++)I.ops[L].cm.curOp=null;el(I)})}function el(e){for(var u=e.ops,I=0;I<u.length;I++)tl(u[I]);for(var L=0;L<u.length;L++)nl(u[L]);for(var k=0;k<u.length;k++)il(u[k]);for(var Y=0;Y<u.length;Y++)rl(u[Y]);for(var ue=0;ue<u.length;ue++)al(u[ue])}function tl(e){var u=e.cm,I=u.display;sl(u),e.updateMaxLine&&qr(u),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<I.viewFrom||e.scrollToPos.to.line>=I.viewTo)||I.maxLineChanged&&u.options.lineWrapping,e.update=e.mustUpdate&&new to(u,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function nl(e){e.updatedDisplay=e.mustUpdate&&yo(e.cm,e.update)}function il(e){var u=e.cm,I=u.display;e.updatedDisplay&&Hr(u),e.barMeasure=Na(u),I.maxLineChanged&&!u.options.lineWrapping&&(e.adjustWidthTo=ci(u,I.maxLine,I.maxLine.text.length).left+3,u.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(I.scroller.clientWidth,I.sizer.offsetLeft+e.adjustWidthTo+ui(u)+u.display.barWidth),e.maxScrollLeft=Math.max(0,I.sizer.offsetLeft+e.adjustWidthTo-jn(u))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=I.input.prepareSelection())}function rl(e){var u=e.cm;e.adjustWidthTo!=null&&(u.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<u.doc.scrollLeft&&pa(u,Math.min(u.display.scroller.scrollLeft,e.maxScrollLeft),!0),u.display.maxLineChanged=!1);var I=e.focus&&e.focus==N();e.preparedSelection&&u.display.input.showSelection(e.preparedSelection,I),(e.updatedDisplay||e.startHeight!=u.doc.height)&&xa(u,e.barMeasure),e.updatedDisplay&&xo(u,e.barMeasure),e.selectionChanged&&ia(u),u.state.focused&&e.updateInput&&u.display.input.reset(e.typing),I&&vn(e.cm)}function al(e){var u=e.cm,I=u.display,L=u.doc;if(e.updatedDisplay&&Vo(u,e.update),I.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(I.wheelStartX=I.wheelStartY=null),e.scrollTop!=null&&Ho(u,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&pa(u,e.scrollLeft,!0,!0),e.scrollToPos){var k=oa(u,U(L,e.scrollToPos.from),U(L,e.scrollToPos.to),e.scrollToPos.margin);aa(u,k)}var Y=e.maybeHiddenMarkers,ue=e.maybeUnhiddenMarkers;if(Y)for(var fe=0;fe<Y.length;++fe)Y[fe].lines.length||qe(Y[fe],"hide");if(ue)for(var ge=0;ge<ue.length;++ge)ue[ge].lines.length&&qe(ue[ge],"unhide");I.wrapper.offsetHeight&&(L.scrollTop=u.display.scroller.scrollTop),e.changeObjs&&qe(u,"changes",u,e.changeObjs),e.update&&e.update.finish()}function Pr(e,u){if(e.curOp)return u();ga(e);try{return u()}finally{va(e)}}function ir(e,u){return function(){if(e.curOp)return u.apply(e,arguments);ga(e);try{return u.apply(e,arguments)}finally{va(e)}}}function br(e){return function(){if(this.curOp)return e.apply(this,arguments);ga(this);try{return e.apply(this,arguments)}finally{va(this)}}}function rr(e){return function(){var u=this.cm;if(!u||u.curOp)return e.apply(this,arguments);ga(u);try{return e.apply(this,arguments)}finally{va(u)}}}function ja(e,u){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(u,B(ol,e))}function ol(e){var u=e.doc;if(u.highlightFrontier>=e.display.viewTo)return;var I=+new Date+e.options.workTime,L=Ot(e,u.highlightFrontier),k=[];u.iter(L.line,Math.min(u.first+u.size,e.display.viewTo+500),function(Y){if(L.line>=e.display.viewFrom){var ue=Y.styles,fe=Y.text.length>e.options.maxHighlightLength?$t(u.mode,L.state):null,ge=$e(e,Y,L,!0);fe&&(L.state=fe),Y.styles=ge.styles;var Se=Y.styleClasses,Je=ge.classes;Je?Y.styleClasses=Je:Se&&(Y.styleClasses=null);for(var et=!ue||ue.length!=Y.styles.length||Se!=Je&&(!Se||!Je||Se.bgClass!=Je.bgClass||Se.textClass!=Je.textClass),ft=0;!et&&ft<ue.length;++ft)et=ue[ft]!=Y.styles[ft];et&&k.push(L.line),Y.stateAfter=L.save(),L.nextLine()}else Y.text.length<=e.options.maxHighlightLength&&Yt(e,Y.text,L),Y.stateAfter=L.line%5==0?L.save():null,L.nextLine();if(+new Date>I)return ja(e,e.options.workDelay),!0}),u.highlightFrontier=L.line,u.modeFrontier=Math.max(u.modeFrontier,L.line),k.length&&Pr(e,function(){for(var Y=0;Y<k.length;Y++)pr(e,k[Y],"text")})}var to=function(e,u,I){var L=e.display;this.viewport=u,this.visible=Xr(L,e.doc,u),this.editorIsHidden=!L.wrapper.offsetWidth,this.wrapperHeight=L.wrapper.clientHeight,this.wrapperWidth=L.wrapper.clientWidth,this.oldDisplayWidth=jn(e),this.force=I,this.dims=ai(e),this.events=[]};to.prototype.signal=function(e,u){Ue(e,u)&&this.events.push(arguments)},to.prototype.finish=function(){for(var e=0;e<this.events.length;e++)qe.apply(null,this.events[e])};function sl(e){var u=e.display;!u.scrollbarsClipped&&u.scroller.offsetWidth&&(u.nativeBarWidth=u.scroller.offsetWidth-u.scroller.clientWidth,u.heightForcer.style.height=ui(e)+"px",u.sizer.style.marginBottom=-u.nativeBarWidth+"px",u.sizer.style.borderRightWidth=ui(e)+"px",u.scrollbarsClipped=!0)}function ll(e){if(e.hasFocus())return null;var u=N();if(!u||!R(e.display.lineDiv,u))return null;var I={activeElt:u};if(window.getSelection){var L=window.getSelection();L.anchorNode&&L.extend&&R(e.display.lineDiv,L.anchorNode)&&(I.anchorNode=L.anchorNode,I.anchorOffset=L.anchorOffset,I.focusNode=L.focusNode,I.focusOffset=L.focusOffset)}return I}function ul(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode)){var u=window.getSelection(),I=document.createRange();I.setEnd(e.anchorNode,e.anchorOffset),I.collapse(!1),u.removeAllRanges(),u.addRange(I),u.extend(e.focusNode,e.focusOffset)}}function yo(e,u){var I=e.display,L=e.doc;if(u.editorIsHidden)return cr(e),!1;if(!u.force&&u.visible.from>=I.viewFrom&&u.visible.to<=I.viewTo&&(I.updateLineNumbers==null||I.updateLineNumbers>=I.viewTo)&&I.renderedView==I.view&&qn(e)==0)return!1;Yo(e)&&(cr(e),u.dims=ai(e));var k=L.first+L.size,Y=Math.max(u.visible.from-e.options.viewportMargin,L.first),ue=Math.min(k,u.visible.to+e.options.viewportMargin);I.viewFrom<Y&&Y-I.viewFrom<20&&(Y=Math.max(L.first,I.viewFrom)),I.viewTo>ue&&I.viewTo-ue<20&&(ue=Math.min(k,I.viewTo)),vi&&(Y=Kr(e.doc,Y),ue=Nr(e.doc,ue));var fe=Y!=I.viewFrom||ue!=I.viewTo||I.lastWrapHeight!=u.wrapperHeight||I.lastWrapWidth!=u.wrapperWidth;Rn(e,Y,ue),I.viewOffset=xr(ne(e.doc,I.viewFrom)),e.display.mover.style.top=I.viewOffset+"px";var ge=qn(e);if(!fe&&ge==0&&!u.force&&I.renderedView==I.view&&(I.updateLineNumbers==null||I.updateLineNumbers>=I.viewTo))return!1;var Se=ll(e);return ge>4&&(I.lineDiv.style.display="none"),cl(e,I.updateLineNumbers,u.dims),ge>4&&(I.lineDiv.style.display=""),I.renderedView=I.view,ul(Se),x(I.cursorDiv),x(I.selectionDiv),I.gutters.style.height=I.sizer.style.minHeight=0,fe&&(I.lastWrapHeight=u.wrapperHeight,I.lastWrapWidth=u.wrapperWidth,ja(e,400)),I.updateLineNumbers=null,!0}function Vo(e,u){for(var I=u.viewport,L=!0;;L=!1){if(!L||!e.options.lineWrapping||u.oldDisplayWidth==jn(e)){if(I&&I.top!=null&&(I={top:Math.min(e.doc.height+Ei(e.display)-si(e),I.top)}),u.visible=Xr(e.display,e.doc,I),u.visible.from>=e.display.viewFrom&&u.visible.to<=e.display.viewTo)break}else L&&(u.visible=Xr(e.display,e.doc,I));if(!yo(e,u))break;Hr(e);var k=Na(e);tn(e),xa(e,k),xo(e,k),u.force=!1}u.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(u.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function bo(e,u){var I=new to(e,u);if(yo(e,I)){Hr(e),Vo(e,I);var L=Na(e);tn(e),xa(e,L),xo(e,L),I.finish()}}function cl(e,u,I){var L=e.display,k=e.options.lineNumbers,Y=L.lineDiv,ue=Y.firstChild;function fe(Tt){var Ut=Tt.nextSibling;return f&&t&&e.display.currentWheelTarget==Tt?Tt.style.display="none":Tt.parentNode.removeChild(Tt),Ut}for(var ge=L.view,Se=L.viewFrom,Je=0;Je<ge.length;Je++){var et=ge[Je];if(!et.hidden)if(!et.node||et.node.parentNode!=Y){var ft=Sn(e,et,Se,I);Y.insertBefore(ft,ue)}else{for(;ue!=et.node;)ue=fe(ue);var ut=k&&u!=null&&u<=Se&&et.lineNumber;et.changes&&(K(et.changes,"gutter")>-1&&(ut=!1),bt(e,et,Se,I)),ut&&(x(et.lineNumber),et.lineNumber.appendChild(document.createTextNode(Nt(e.options,Se)))),ue=et.node.nextSibling}Se+=et.size}for(;ue;)ue=fe(ue)}function Eo(e){var u=e.gutters.offsetWidth;e.sizer.style.marginLeft=u+"px"}function xo(e,u){e.display.sizer.style.minHeight=u.docHeight+"px",e.display.heightForcer.style.top=u.docHeight+"px",e.display.gutters.style.height=u.docHeight+e.display.barHeight+ui(e)+"px"}function Xo(e){var u=e.display,I=u.view;if(!u.alignWidgets&&(!u.gutters.firstChild||!e.options.fixedGutter))return;for(var L=Ui(u)-u.scroller.scrollLeft+e.doc.scrollLeft,k=u.gutters.offsetWidth,Y=L+"px",ue=0;ue<I.length;ue++)if(!I[ue].hidden){e.options.fixedGutter&&(I[ue].gutter&&(I[ue].gutter.style.left=Y),I[ue].gutterBackground&&(I[ue].gutterBackground.style.left=Y));var fe=I[ue].alignable;if(fe)for(var ge=0;ge<fe.length;ge++)fe[ge].style.left=Y}e.options.fixedGutter&&(u.gutters.style.left=L+k+"px")}function Yo(e){if(!e.options.lineNumbers)return!1;var u=e.doc,I=Nt(e.options,u.first+u.size-1),L=e.display;if(I.length!=L.lineNumChars){var k=L.measure.appendChild(E("div",[E("div",I)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Y=k.firstChild.offsetWidth,ue=k.offsetWidth-Y;return L.lineGutter.style.width="",L.lineNumInnerWidth=Math.max(Y,L.lineGutter.offsetWidth-ue)+1,L.lineNumWidth=L.lineNumInnerWidth+ue,L.lineNumChars=L.lineNumInnerWidth?I.length:-1,L.lineGutter.style.width=L.lineNumWidth+"px",Eo(e.display),!0}return!1}function wo(e,u){for(var I=[],L=!1,k=0;k<e.length;k++){var Y=e[k],ue=null;if(typeof Y!="string"&&(ue=Y.style,Y=Y.className),Y=="CodeMirror-linenumbers")if(u)L=!0;else continue;I.push({className:Y,style:ue})}return u&&!L&&I.push({className:"CodeMirror-linenumbers",style:null}),I}function $o(e){var u=e.gutters,I=e.gutterSpecs;x(u),e.lineGutter=null;for(var L=0;L<I.length;++L){var k=I[L],Y=k.className,ue=k.style,fe=u.appendChild(E("div",null,"CodeMirror-gutter "+Y));ue&&(fe.style.cssText=ue),Y=="CodeMirror-linenumbers"&&(e.lineGutter=fe,fe.style.width=(e.lineNumWidth||1)+"px")}u.style.display=I.length?"":"none",Eo(e)}function Fa(e){$o(e.display),Hi(e),Xo(e)}function dl(e,u,I,L){var k=this;this.input=I,k.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),k.scrollbarFiller.setAttribute("cm-not-content","true"),k.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),k.gutterFiller.setAttribute("cm-not-content","true"),k.lineDiv=S("div",null,"CodeMirror-code"),k.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),k.cursorDiv=E("div",null,"CodeMirror-cursors"),k.measure=E("div",null,"CodeMirror-measure"),k.lineMeasure=E("div",null,"CodeMirror-measure"),k.lineSpace=S("div",[k.measure,k.lineMeasure,k.selectionDiv,k.cursorDiv,k.lineDiv],null,"position: relative; outline: none");var Y=S("div",[k.lineSpace],"CodeMirror-lines");k.mover=E("div",[Y],null,"position: relative"),k.sizer=E("div",[k.mover],"CodeMirror-sizer"),k.sizerWidth=null,k.heightForcer=E("div",null,null,"position: absolute; height: "+Z+"px; width: 1px;"),k.gutters=E("div",null,"CodeMirror-gutters"),k.lineGutter=null,k.scroller=E("div",[k.sizer,k.heightForcer,k.gutters],"CodeMirror-scroll"),k.scroller.setAttribute("tabIndex","-1"),k.wrapper=E("div",[k.scrollbarFiller,k.gutterFiller,k.scroller],"CodeMirror"),A&&O<8&&(k.gutters.style.zIndex=-1,k.scroller.style.paddingRight=0),!f&&!(W&&i)&&(k.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(k.wrapper):e(k.wrapper)),k.viewFrom=k.viewTo=u.first,k.reportedViewFrom=k.reportedViewTo=u.first,k.view=[],k.renderedView=null,k.externalMeasured=null,k.viewOffset=0,k.lastWrapHeight=k.lastWrapWidth=0,k.updateLineNumbers=null,k.nativeBarWidth=k.barHeight=k.barWidth=0,k.scrollbarsClipped=!1,k.lineNumWidth=k.lineNumInnerWidth=k.lineNumChars=null,k.alignWidgets=!1,k.cachedCharWidth=k.cachedTextHeight=k.cachedPaddingH=null,k.maxLine=null,k.maxLineLength=0,k.maxLineChanged=!1,k.wheelDX=k.wheelDY=k.wheelStartX=k.wheelStartY=null,k.shift=!1,k.selForContextMenu=null,k.activeTouch=null,k.gutterSpecs=wo(L.gutters,L.lineNumbers),$o(k),I.init(k)}var no=0,jr=null;A?jr=-.53:W?jr=15:c?jr=-.7:n&&(jr=-1/3);function Jo(e){var u=e.wheelDeltaX,I=e.wheelDeltaY;return u==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(u=e.detail),I==null&&e.detail&&e.axis==e.VERTICAL_AXIS?I=e.detail:I==null&&(I=e.wheelDelta),{x:u,y:I}}function hl(e){var u=Jo(e);return u.x*=jr,u.y*=jr,u}function Qo(e,u){var I=Jo(u),L=I.x,k=I.y,Y=e.display,ue=Y.scroller,fe=ue.scrollWidth>ue.clientWidth,ge=ue.scrollHeight>ue.clientHeight;if(!(L&&fe||k&&ge))return;if(k&&t&&f){e:for(var Se=u.target,Je=Y.view;Se!=ue;Se=Se.parentNode)for(var et=0;et<Je.length;et++)if(Je[et].node==Se){e.display.currentWheelTarget=Se;break e}}if(L&&!W&&!s&&jr!=null){k&&ge&&Ma(e,Math.max(0,ue.scrollTop+k*jr)),pa(e,Math.max(0,ue.scrollLeft+L*jr)),(!k||k&&ge)&&be(u),Y.wheelStartX=null;return}if(k&&jr!=null){var ft=k*jr,ut=e.doc.scrollTop,Tt=ut+Y.wrapper.clientHeight;ft<0?ut=Math.max(0,ut+ft-50):Tt=Math.min(e.doc.height,Tt+ft+50),bo(e,{top:ut,bottom:Tt})}no<20&&(Y.wheelStartX==null?(Y.wheelStartX=ue.scrollLeft,Y.wheelStartY=ue.scrollTop,Y.wheelDX=L,Y.wheelDY=k,setTimeout(function(){if(Y.wheelStartX==null)return;var Ut=ue.scrollLeft-Y.wheelStartX,Kt=ue.scrollTop-Y.wheelStartY,qt=Kt&&Y.wheelDY&&Kt/Y.wheelDY||Ut&&Y.wheelDX&&Ut/Y.wheelDX;if(Y.wheelStartX=Y.wheelStartY=null,!qt)return;jr=(jr*no+qt)/(no+1),++no},200)):(Y.wheelDX+=L,Y.wheelDY+=k))}var Fr=function(e,u){this.ranges=e,this.primIndex=u};Fr.prototype.primary=function(){return this.ranges[this.primIndex]},Fr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var u=0;u<this.ranges.length;u++){var I=this.ranges[u],L=e.ranges[u];if(!sn(I.anchor,L.anchor)||!sn(I.head,L.head))return!1}return!0},Fr.prototype.deepCopy=function(){for(var e=[],u=0;u<this.ranges.length;u++)e[u]=new bi(Ct(this.ranges[u].anchor),Ct(this.ranges[u].head));return new Fr(e,this.primIndex)},Fr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Fr.prototype.contains=function(e,u){u||(u=e);for(var I=0;I<this.ranges.length;I++){var L=this.ranges[I];if(Dt(u,L.from())>=0&&Dt(e,L.to())<=0)return I}return-1};var bi=function(e,u){this.anchor=e,this.head=u};bi.prototype.from=function(){return rn(this.anchor,this.head)},bi.prototype.to=function(){return hn(this.anchor,this.head)},bi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yr(e,u,I){var L=e&&e.options.selectionsMayTouch,k=u[I];u.sort(function(ft,ut){return Dt(ft.from(),ut.from())}),I=K(u,k);for(var Y=1;Y<u.length;Y++){var ue=u[Y],fe=u[Y-1],ge=Dt(fe.to(),ue.from());if(L&&!ue.empty()?ge>0:ge>=0){var Se=rn(fe.from(),ue.from()),Je=hn(fe.to(),ue.to()),et=fe.empty()?ue.from()==ue.head:fe.from()==fe.head;Y<=I&&--I,u.splice(--Y,2,new bi(et?Je:Se,et?Se:Je))}}return new Fr(u,I)}function sa(e,u){return new Fr([new bi(e,u||e)],0)}function la(e){return e.text?ht(e.from.line+e.text.length-1,Ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qo(e,u){if(Dt(e,u.from)<0)return e;if(Dt(e,u.to)<=0)return la(u);var I=e.line+u.text.length-(u.to.line-u.from.line)-1,L=e.ch;return e.line==u.to.line&&(L+=la(u).ch-u.to.ch),ht(I,L)}function So(e,u){for(var I=[],L=0;L<e.sel.ranges.length;L++){var k=e.sel.ranges[L];I.push(new bi(qo(k.anchor,u),qo(k.head,u)))}return Yr(e.cm,I,e.sel.primIndex)}function Zo(e,u,I){return e.line==u.line?ht(I.line,e.ch-u.ch+I.ch):ht(I.line+(e.line-u.line),e.ch)}function fl(e,u,I){for(var L=[],k=ht(e.first,0),Y=k,ue=0;ue<u.length;ue++){var fe=u[ue],ge=Zo(fe.from,k,Y),Se=Zo(la(fe),k,Y);if(k=fe.to,Y=Se,I=="around"){var Je=e.sel.ranges[ue],et=Dt(Je.head,Je.anchor)<0;L[ue]=new bi(et?Se:ge,et?ge:Se)}else L[ue]=new bi(ge,ge)}return new Fr(L,e.sel.primIndex)}function To(e){e.doc.mode=mt(e.options,e.doc.modeOption),Ba(e)}function Ba(e){e.doc.iter(function(u){u.stateAfter&&(u.stateAfter=null),u.styles&&(u.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ja(e,100),e.state.modeGen++,e.curOp&&Hi(e)}function es(e,u){return u.from.ch==0&&u.to.ch==0&&Ke(u.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Co(e,u,I,L){function k(on){return I?I[on]:null}function Y(on,Zt,dn){ea(on,Zt,dn,L),Xt(on,"change",on,u)}function ue(on,Zt){for(var dn=[],On=on;On<Zt;++On)dn.push(new _r(Se[On],k(On),L));return dn}var fe=u.from,ge=u.to,Se=u.text,Je=ne(e,fe.line),et=ne(e,ge.line),ft=Ke(Se),ut=k(Se.length-1),Tt=ge.line-fe.line;if(u.full)e.insert(0,ue(0,Se.length)),e.remove(Se.length,e.size-Se.length);else if(es(e,u)){var Ut=ue(0,Se.length-1);Y(et,et.text,ut),Tt&&e.remove(fe.line,Tt),Ut.length&&e.insert(fe.line,Ut)}else if(Je==et)if(Se.length==1)Y(Je,Je.text.slice(0,fe.ch)+ft+Je.text.slice(ge.ch),ut);else{var Kt=ue(1,Se.length-1);Kt.push(new _r(ft+Je.text.slice(ge.ch),ut,L)),Y(Je,Je.text.slice(0,fe.ch)+Se[0],k(0)),e.insert(fe.line+1,Kt)}else if(Se.length==1)Y(Je,Je.text.slice(0,fe.ch)+Se[0]+et.text.slice(ge.ch),k(0)),e.remove(fe.line+1,Tt);else{Y(Je,Je.text.slice(0,fe.ch)+Se[0],k(0)),Y(et,ft+et.text.slice(ge.ch),ut);var qt=ue(1,Se.length-1);Tt>1&&e.remove(fe.line+1,Tt-1),e.insert(fe.line+1,qt)}Xt(e,"change",e,u)}function ua(e,u,I){function L(k,Y,ue){if(k.linked)for(var fe=0;fe<k.linked.length;++fe){var ge=k.linked[fe];if(ge.doc==Y)continue;var Se=ue&&ge.sharedHist;if(I&&!Se)continue;u(ge.doc,Se),L(ge.doc,k,Se)}}L(e,null,!0)}function ts(e,u){if(u.cm)throw new Error("This document is already in use.");e.doc=u,u.cm=e,wr(e),To(e),ns(e),e.options.lineWrapping||qr(e),e.options.mode=u.modeOption,Hi(e)}function ns(e){(e.doc.direction=="rtl"?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function pl(e){Pr(e,function(){ns(e),Hi(e)})}function io(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Oo(e,u){var I={from:Ct(u.from),to:la(u),text:oe(e,u.from,u.to)};return as(e,I,u.from.line,u.to.line+1),ua(e,function(L){return as(L,I,u.from.line,u.to.line+1)},!0),I}function is(e){for(;e.length;){var u=Ke(e);if(u.ranges)e.pop();else break}}function ml(e,u){if(u)return is(e.done),Ke(e.done);if(e.done.length&&!Ke(e.done).ranges)return Ke(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ke(e.done)}function rs(e,u,I,L){var k=e.history;k.undone.length=0;var Y=+new Date,ue,fe;if((k.lastOp==L||k.lastOrigin==u.origin&&u.origin&&(u.origin.charAt(0)=="+"&&k.lastModTime>Y-(e.cm?e.cm.options.historyEventDelay:500)||u.origin.charAt(0)=="*"))&&(ue=ml(k,k.lastOp==L)))fe=Ke(ue.changes),Dt(u.from,u.to)==0&&Dt(u.from,fe.to)==0?fe.to=la(u):ue.changes.push(Oo(e,u));else{var ge=Ke(k.done);for((!ge||!ge.ranges)&&ro(e.sel,k.done),ue={changes:[Oo(e,u)],generation:k.generation},k.done.push(ue);k.done.length>k.undoDepth;)k.done.shift(),k.done[0].ranges||k.done.shift()}k.done.push(I),k.generation=++k.maxGeneration,k.lastModTime=k.lastSelTime=Y,k.lastOp=k.lastSelOp=L,k.lastOrigin=k.lastSelOrigin=u.origin,fe||qe(e,"historyAdded")}function gl(e,u,I,L){var k=u.charAt(0);return k=="*"||k=="+"&&I.ranges.length==L.ranges.length&&I.somethingSelected()==L.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,u,I,L){var k=e.history,Y=L&&L.origin;I==k.lastSelOp||Y&&k.lastSelOrigin==Y&&(k.lastModTime==k.lastSelTime&&k.lastOrigin==Y||gl(e,Y,Ke(k.done),u))?k.done[k.done.length-1]=u:ro(u,k.done),k.lastSelTime=+new Date,k.lastSelOrigin=Y,k.lastSelOp=I,L&&L.clearRedo!==!1&&is(k.undone)}function ro(e,u){var I=Ke(u);I&&I.ranges&&I.equals(e)||u.push(e)}function as(e,u,I,L){var k=u["spans_"+e.id],Y=0;e.iter(Math.max(e.first,I),Math.min(e.first+e.size,L),function(ue){ue.markedSpans&&((k||(k=u["spans_"+e.id]={}))[Y]=ue.markedSpans),++Y})}function _l(e){if(!e)return null;for(var u,I=0;I<e.length;++I)e[I].marker.explicitlyCleared?u||(u=e.slice(0,I)):u&&u.push(e[I]);return u?u.length?u:null:e}function yl(e,u){var I=u["spans_"+e.id];if(!I)return null;for(var L=[],k=0;k<u.text.length;++k)L.push(_l(I[k]));return L}function os(e,u){var I=yl(e,u),L=Wi(e,u);if(!I)return L;if(!L)return I;for(var k=0;k<I.length;++k){var Y=I[k],ue=L[k];if(Y&&ue){e:for(var fe=0;fe<ue.length;++fe){for(var ge=ue[fe],Se=0;Se<Y.length;++Se)if(Y[Se].marker==ge.marker)continue e;Y.push(ge)}}else ue&&(I[k]=ue)}return I}function wa(e,u,I){for(var L=[],k=0;k<e.length;++k){var Y=e[k];if(Y.ranges){L.push(I?Fr.prototype.deepCopy.call(Y):Y);continue}var ue=Y.changes,fe=[];L.push({changes:fe});for(var ge=0;ge<ue.length;++ge){var Se=ue[ge],Je=void 0;if(fe.push({from:Se.from,to:Se.to,text:Se.text}),u)for(var et in Se)(Je=et.match(/^spans_(\d+)$/))&&(K(u,Number(Je[1]))>-1&&(Ke(fe)[et]=Se[et],delete Se[et]))}}return L}function Ao(e,u,I,L){if(L){var k=e.anchor;if(I){var Y=Dt(u,k)<0;Y!=Dt(I,k)<0?(k=u,u=I):Y!=Dt(u,I)<0&&(u=I)}return new bi(k,u)}else return new bi(I||u,u)}function ao(e,u,I,L,k){k==null&&(k=e.cm&&(e.cm.display.shift||e.extend)),mr(e,new Fr([Ao(e.sel.primary(),u,I,k)],0),L)}function ss(e,u,I){for(var L=[],k=e.cm&&(e.cm.display.shift||e.extend),Y=0;Y<e.sel.ranges.length;Y++)L[Y]=Ao(e.sel.ranges[Y],u[Y],null,k);var ue=Yr(e.cm,L,e.sel.primIndex);mr(e,ue,I)}function Ro(e,u,I,L){var k=e.sel.ranges.slice(0);k[u]=I,mr(e,Yr(e.cm,k,e.sel.primIndex),L)}function ls(e,u,I,L){mr(e,sa(u,I),L)}function bl(e,u,I){var L={ranges:u.ranges,update:function(k){this.ranges=[];for(var Y=0;Y<k.length;Y++)this.ranges[Y]=new bi(U(e,k[Y].anchor),U(e,k[Y].head))},origin:I&&I.origin};return qe(e,"beforeSelectionChange",e,L),e.cm&&qe(e.cm,"beforeSelectionChange",e.cm,L),L.ranges!=u.ranges?Yr(e.cm,L.ranges,L.ranges.length-1):u}function us(e,u,I){var L=e.history.done,k=Ke(L);k&&k.ranges?(L[L.length-1]=u,oo(e,u,I)):mr(e,u,I)}function mr(e,u,I){oo(e,u,I),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,I)}function oo(e,u,I){(Ue(e,"beforeSelectionChange")||e.cm&&Ue(e.cm,"beforeSelectionChange"))&&(u=bl(e,u,I));var L=I&&I.bias||(Dt(u.primary().head,e.sel.primary().head)<0?-1:1);cs(e,hs(e,u,L,!0)),!(I&&I.scroll===!1)&&e.cm&&Ea(e.cm)}function cs(e,u){if(u.equals(e.sel))return;e.sel=u,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,je(e.cm)),Xt(e,"cursorActivity",e)}function ds(e){cs(e,hs(e,e.sel,null,!1))}function hs(e,u,I,L){for(var k,Y=0;Y<u.ranges.length;Y++){var ue=u.ranges[Y],fe=u.ranges.length==e.sel.ranges.length&&e.sel.ranges[Y],ge=so(e,ue.anchor,fe&&fe.anchor,I,L),Se=so(e,ue.head,fe&&fe.head,I,L);(k||ge!=ue.anchor||Se!=ue.head)&&(k||(k=u.ranges.slice(0,Y)),k[Y]=new bi(ge,Se))}return k?Yr(e.cm,k,u.primIndex):u}function Sa(e,u,I,L,k){var Y=ne(e,u.line);if(Y.markedSpans)for(var ue=0;ue<Y.markedSpans.length;++ue){var fe=Y.markedSpans[ue],ge=fe.marker,Se="selectLeft"in ge?!ge.selectLeft:ge.inclusiveLeft,Je="selectRight"in ge?!ge.selectRight:ge.inclusiveRight;if((fe.from==null||(Se?fe.from<=u.ch:fe.from<u.ch))&&(fe.to==null||(Je?fe.to>=u.ch:fe.to>u.ch))){if(k&&(qe(ge,"beforeCursorEnter"),ge.explicitlyCleared))if(Y.markedSpans){--ue;continue}else break;if(!ge.atomic)continue;if(I){var et=ge.find(L<0?1:-1),ft=void 0;if((L<0?Je:Se)&&(et=fs(e,et,-L,et&&et.line==u.line?Y:null)),et&&et.line==u.line&&(ft=Dt(et,I))&&(L<0?ft<0:ft>0))return Sa(e,et,u,L,k)}var ut=ge.find(L<0?-1:1);return(L<0?Se:Je)&&(ut=fs(e,ut,L,ut.line==u.line?Y:null)),ut?Sa(e,ut,u,L,k):null}}return u}function so(e,u,I,L,k){var Y=L||1,ue=Sa(e,u,I,Y,k)||!k&&Sa(e,u,I,Y,!0)||Sa(e,u,I,-Y,k)||!k&&Sa(e,u,I,-Y,!0);return ue||(e.cantEdit=!0,ht(e.first,0))}function fs(e,u,I,L){return I<0&&u.ch==0?u.line>e.first?U(e,ht(u.line-1)):null:I>0&&u.ch==(L||ne(e,u.line)).text.length?u.line<e.first+e.size-1?ht(u.line+1,0):null:new ht(u.line,u.ch+I)}function ps(e){e.setSelection(ht(e.firstLine(),0),ht(e.lastLine()),de)}function ms(e,u,I){var L={canceled:!1,from:u.from,to:u.to,text:u.text,origin:u.origin,cancel:function(){return L.canceled=!0}};return I&&(L.update=function(k,Y,ue,fe){k&&(L.from=U(e,k)),Y&&(L.to=U(e,Y)),ue&&(L.text=ue),fe!==void 0&&(L.origin=fe)}),qe(e,"beforeChange",e,L),e.cm&&qe(e.cm,"beforeChange",e.cm,L),L.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:L.from,to:L.to,text:L.text,origin:L.origin}}function Ta(e,u,I){if(e.cm){if(!e.cm.curOp)return ir(e.cm,Ta)(e,u,I);if(e.cm.state.suppressEdits)return}if((Ue(e,"beforeChange")||e.cm&&Ue(e.cm,"beforeChange"))&&(u=ms(e,u,!0),!u))return;var L=hr&&!I&&vr(e,u.from,u.to);if(L)for(var k=L.length-1;k>=0;--k)gs(e,{from:L[k].from,to:L[k].to,text:k?[""]:u.text,origin:u.origin});else gs(e,u)}function gs(e,u){if(u.text.length==1&&u.text[0]==""&&Dt(u.from,u.to)==0)return;var I=So(e,u);rs(e,u,I,e.cm?e.cm.curOp.id:NaN),Wa(e,u,I,Wi(e,u));var L=[];ua(e,function(k,Y){!Y&&K(L,k.history)==-1&&(bs(k.history,u),L.push(k.history)),Wa(k,u,null,Wi(k,u))})}function lo(e,u,I){var L=e.cm&&e.cm.state.suppressEdits;if(L&&!I)return;for(var k=e.history,Y,ue=e.sel,fe=u=="undo"?k.done:k.undone,ge=u=="undo"?k.undone:k.done,Se=0;Se<fe.length&&!(Y=fe[Se],I?Y.ranges&&!Y.equals(e.sel):!Y.ranges);Se++);if(Se==fe.length)return;for(k.lastOrigin=k.lastSelOrigin=null;;)if(Y=fe.pop(),Y.ranges){if(ro(Y,ge),I&&!Y.equals(e.sel)){mr(e,Y,{clearRedo:!1});return}ue=Y}else if(L){fe.push(Y);return}else break;var Je=[];ro(ue,ge),ge.push({changes:Je,generation:k.generation}),k.generation=Y.generation||++k.maxGeneration;for(var et=Ue(e,"beforeChange")||e.cm&&Ue(e.cm,"beforeChange"),ft=function(Ut){var Kt=Y.changes[Ut];if(Kt.origin=u,et&&!ms(e,Kt,!1))return fe.length=0,{};Je.push(Oo(e,Kt));var qt=Ut?So(e,Kt):Ke(fe);Wa(e,Kt,qt,os(e,Kt)),!Ut&&e.cm&&e.cm.scrollIntoView({from:Kt.from,to:la(Kt)});var on=[];ua(e,function(Zt,dn){!dn&&K(on,Zt.history)==-1&&(bs(Zt.history,Kt),on.push(Zt.history)),Wa(Zt,Kt,null,os(Zt,Kt))})},ut=Y.changes.length-1;ut>=0;--ut){var Tt=ft(ut);if(Tt)return Tt.v}}function vs(e,u){if(u==0)return;if(e.first+=u,e.sel=new Fr(Me(e.sel.ranges,function(k){return new bi(ht(k.anchor.line+u,k.anchor.ch),ht(k.head.line+u,k.head.ch))}),e.sel.primIndex),e.cm){Hi(e.cm,e.first,e.first-u,u);for(var I=e.cm.display,L=I.viewFrom;L<I.viewTo;L++)pr(e.cm,L,"gutter")}}function Wa(e,u,I,L){if(e.cm&&!e.cm.curOp)return ir(e.cm,Wa)(e,u,I,L);if(u.to.line<e.first){vs(e,u.text.length-1-(u.to.line-u.from.line));return}if(u.from.line>e.lastLine())return;if(u.from.line<e.first){var k=u.text.length-1-(e.first-u.from.line);vs(e,k),u={from:ht(e.first,0),to:ht(u.to.line+k,u.to.ch),text:[Ke(u.text)],origin:u.origin}}var Y=e.lastLine();u.to.line>Y&&(u={from:u.from,to:ht(Y,ne(e,Y).text.length),text:[u.text[0]],origin:u.origin}),u.removed=oe(e,u.from,u.to),I||(I=So(e,u)),e.cm?El(e.cm,u,L):Co(e,u,L),oo(e,I,de),e.cantEdit&&so(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,u,I){var L=e.doc,k=e.display,Y=u.from,ue=u.to,fe=!1,ge=Y.line;e.options.lineWrapping||(ge=Qe(Qi(ne(L,Y.line))),L.iter(ge,ue.line+1,function(ut){if(ut==k.maxLine)return fe=!0,!0})),L.sel.contains(u.from,u.to)>-1&&je(e),Co(L,u,I,Qn(e)),e.options.lineWrapping||(L.iter(ge,Y.line+u.text.length,function(ut){var Tt=Qr(ut);Tt>k.maxLineLength&&(k.maxLine=ut,k.maxLineLength=Tt,k.maxLineChanged=!0,fe=!1)}),fe&&(e.curOp.updateMaxLine=!0)),di(L,Y.line),ja(e,400);var Se=u.text.length-(ue.line-Y.line)-1;u.full?Hi(e):Y.line==ue.line&&u.text.length==1&&!es(e.doc,u)?pr(e,Y.line,"text"):Hi(e,Y.line,ue.line+1,Se);var Je=Ue(e,"changes"),et=Ue(e,"change");if(et||Je){var ft={from:Y,to:ue,text:u.text,removed:u.removed,origin:u.origin};et&&Xt(e,"change",e,ft),Je&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ft)}e.display.selForContextMenu=null}function Ca(e,u,I,L,k){var Y;L||(L=I),Dt(L,I)<0&&(Y=[L,I],I=Y[0],L=Y[1]),typeof u=="string"&&(u=e.splitLines(u)),Ta(e,{from:I,to:L,text:u,origin:k})}function _s(e,u,I,L){I<e.line?e.line+=L:u<e.line&&(e.line=u,e.ch=0)}function ys(e,u,I,L){for(var k=0;k<e.length;++k){var Y=e[k],ue=!0;if(Y.ranges){Y.copied||(Y=e[k]=Y.deepCopy(),Y.copied=!0);for(var fe=0;fe<Y.ranges.length;fe++)_s(Y.ranges[fe].anchor,u,I,L),_s(Y.ranges[fe].head,u,I,L);continue}for(var ge=0;ge<Y.changes.length;++ge){var Se=Y.changes[ge];if(I<Se.from.line)Se.from=ht(Se.from.line+L,Se.from.ch),Se.to=ht(Se.to.line+L,Se.to.ch);else if(u<=Se.to.line){ue=!1;break}}ue||(e.splice(0,k+1),k=0)}}function bs(e,u){var I=u.from.line,L=u.to.line,k=u.text.length-(L-I)-1;ys(e.done,I,L,k),ys(e.undone,I,L,k)}function Ha(e,u,I,L){var k=u,Y=u;return typeof u=="number"?Y=ne(e,ae(e,u)):k=Qe(u),k==null?null:(L(Y,k)&&e.cm&&pr(e.cm,k,I),Y)}function za(e){this.lines=e,this.parent=null;for(var u=0,I=0;I<e.length;++I)e[I].parent=this,u+=e[I].height;this.height=u}za.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,u){for(var I=e,L=e+u;I<L;++I){var k=this.lines[I];this.height-=k.height,fn(k),Xt(k,"delete")}this.lines.splice(e,u)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,u,I){this.height+=I,this.lines=this.lines.slice(0,e).concat(u).concat(this.lines.slice(e));for(var L=0;L<u.length;++L)u[L].parent=this},iterN:function(e,u,I){for(var L=e+u;e<L;++e)if(I(this.lines[e]))return!0}};function Ka(e){this.children=e;for(var u=0,I=0,L=0;L<e.length;++L){var k=e[L];u+=k.chunkSize(),I+=k.height,k.parent=this}this.size=u,this.height=I,this.parent=null}Ka.prototype={chunkSize:function(){return this.size},removeInner:function(e,u){this.size-=u;for(var I=0;I<this.children.length;++I){var L=this.children[I],k=L.chunkSize();if(e<k){var Y=Math.min(u,k-e),ue=L.height;if(L.removeInner(e,Y),this.height-=ue-L.height,k==Y&&(this.children.splice(I--,1),L.parent=null),(u-=Y)==0)break;e=0}else e-=k}if(this.size-u<25&&(this.children.length>1||!(this.children[0]instanceof za))){var fe=[];this.collapse(fe),this.children=[new za(fe)],this.children[0].parent=this}},collapse:function(e){for(var u=0;u<this.children.length;++u)this.children[u].collapse(e)},insertInner:function(e,u,I){this.size+=u.length,this.height+=I;for(var L=0;L<this.children.length;++L){var k=this.children[L],Y=k.chunkSize();if(e<=Y){if(k.insertInner(e,u,I),k.lines&&k.lines.length>50){for(var ue=k.lines.length%25+25,fe=ue;fe<k.lines.length;){var ge=new za(k.lines.slice(fe,fe+=25));k.height-=ge.height,this.children.splice(++L,0,ge),ge.parent=this}k.lines=k.lines.slice(0,ue),this.maybeSpill()}break}e-=Y}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var u=e.children.splice(e.children.length-5,5),I=new Ka(u);if(e.parent){e.size-=I.size,e.height-=I.height;var k=K(e.parent.children,e);e.parent.children.splice(k+1,0,I)}else{var L=new Ka(e.children);L.parent=e,e.children=[L,I],e=L}I.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,u,I){for(var L=0;L<this.children.length;++L){var k=this.children[L],Y=k.chunkSize();if(e<Y){var ue=Math.min(u,Y-e);if(k.iterN(e,ue,I))return!0;if((u-=ue)==0)break;e=0}else e-=Y}}};var Ga=function(e,u,I){if(I)for(var L in I)I.hasOwnProperty(L)&&(this[L]=I[L]);this.doc=e,this.node=u};Ga.prototype.clear=function(){var e=this.doc.cm,u=this.line.widgets,I=this.line,L=Qe(I);if(L==null||!u)return;for(var k=0;k<u.length;++k)u[k]==this&&u.splice(k--,1);u.length||(I.widgets=null);var Y=Kn(this);Ae(I,Math.max(0,I.height-Y)),e&&(Pr(e,function(){Es(e,I,-Y),pr(e,L,"widget")}),Xt(e,"lineWidgetCleared",e,this,L))},Ga.prototype.changed=function(){var e=this,u=this.height,I=this.doc.cm,L=this.line;this.height=null;var k=Kn(this)-u;if(!k)return;Ir(this.doc,L)||Ae(L,L.height+k),I&&Pr(I,function(){I.curOp.forceUpdate=!0,Es(I,L,k),Xt(I,"lineWidgetChanged",I,e,Qe(L))})},ke(Ga);function Es(e,u,I){xr(u)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_o(e,I)}function xl(e,u,I,L){var k=new Ga(e,I,L),Y=e.cm;return Y&&k.noHScroll&&(Y.display.alignWidgets=!0),Ha(e,u,"widget",function(ue){var fe=ue.widgets||(ue.widgets=[]);if(k.insertAt==null?fe.push(k):fe.splice(Math.min(fe.length-1,Math.max(0,k.insertAt)),0,k),k.line=ue,Y&&!Ir(e,ue)){var ge=xr(ue)<e.scrollTop;Ae(ue,ue.height+Kn(k)),ge&&_o(Y,k.height),Y.curOp.forceUpdate=!0}return!0}),Y&&Xt(Y,"lineWidgetAdded",Y,k,typeof u=="number"?u:Qe(u)),k}var xs=0,ca=function(e,u){this.lines=[],this.type=u,this.doc=e,this.id=++xs};ca.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,u=e&&!e.curOp;if(u&&ga(e),Ue(this,"clear")){var I=this.find();I&&Xt(this,"clear",I.from,I.to)}for(var L=null,k=null,Y=0;Y<this.lines.length;++Y){var ue=this.lines[Y],fe=Ai(ue.markedSpans,this);e&&!this.collapsed?pr(e,Qe(ue),"text"):e&&(fe.to!=null&&(k=Qe(ue)),fe.from!=null&&(L=Qe(ue))),ue.markedSpans=sr(ue.markedSpans,fe),fe.from==null&&this.collapsed&&!Ir(this.doc,ue)&&e&&Ae(ue,xn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ge=0;ge<this.lines.length;++ge){var Se=Qi(this.lines[ge]),Je=Qr(Se);Je>e.display.maxLineLength&&(e.display.maxLine=Se,e.display.maxLineLength=Je,e.display.maxLineChanged=!0)}L!=null&&e&&this.collapsed&&Hi(e,L,k+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ds(e.doc)),e&&Xt(e,"markerCleared",e,this,L,k),u&&va(e),this.parent&&this.parent.clear()},ca.prototype.find=function(e,u){e==null&&this.type=="bookmark"&&(e=1);for(var I,L,k=0;k<this.lines.length;++k){var Y=this.lines[k],ue=Ai(Y.markedSpans,this);if(ue.from!=null&&(I=ht(u?Y:Qe(Y),ue.from),e==-1))return I;if(ue.to!=null&&(L=ht(u?Y:Qe(Y),ue.to),e==1))return L}return I&&{from:I,to:L}},ca.prototype.changed=function(){var e=this,u=this.find(-1,!0),I=this,L=this.doc.cm;if(!u||!L)return;Pr(L,function(){var k=u.line,Y=Qe(u.line),ue=yi(L,Y);if(ue&&(an(ue),L.curOp.selectionChanged=L.curOp.forceUpdate=!0),L.curOp.updateMaxLine=!0,!Ir(I.doc,k)&&I.height!=null){var fe=I.height;I.height=null;var ge=Kn(I)-fe;ge&&Ae(k,k.height+ge)}Xt(L,"markerChanged",L,e)})},ca.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var u=this.doc.cm.curOp;(!u.maybeHiddenMarkers||K(u.maybeHiddenMarkers,this)==-1)&&(u.maybeUnhiddenMarkers||(u.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ca.prototype.detachLine=function(e){if(this.lines.splice(K(this.lines,e),1),!this.lines.length&&this.doc.cm){var u=this.doc.cm.curOp;(u.maybeHiddenMarkers||(u.maybeHiddenMarkers=[])).push(this)}},ke(ca);function Oa(e,u,I,L,k){if(L&&L.shared)return wl(e,u,I,L,k);if(e.cm&&!e.cm.curOp)return ir(e.cm,Oa)(e,u,I,L,k);var Y=new ca(e,k),ue=Dt(u,I);if(L&&M(L,Y,!1),ue>0||ue==0&&Y.clearWhenEmpty!==!1)return Y;if(Y.replacedWith&&(Y.collapsed=!0,Y.widgetNode=S("span",[Y.replacedWith],"CodeMirror-widget"),L.handleMouseEvents||Y.widgetNode.setAttribute("cm-ignore-events","true"),L.insertLeft&&(Y.widgetNode.insertLeft=!0)),Y.collapsed){if(Ni(e,u.line,u,I,Y)||u.line!=I.line&&Ni(e,I.line,u,I,Y))throw new Error("Inserting collapsed marker partially overlapping an existing one");xi()}Y.addToHistory&&rs(e,{from:u,to:I,origin:"markText"},e.sel,NaN);var fe=u.line,ge=e.cm,Se;if(e.iter(fe,I.line+1,function(et){ge&&Y.collapsed&&!ge.options.lineWrapping&&Qi(et)==ge.display.maxLine&&(Se=!0),Y.collapsed&&fe!=u.line&&Ae(et,0),Di(et,new Bi(Y,fe==u.line?u.ch:null,fe==I.line?I.ch:null)),++fe}),Y.collapsed&&e.iter(u.line,I.line+1,function(et){Ir(e,et)&&Ae(et,0)}),Y.clearOnEnter&&Be(Y,"beforeCursorEnter",function(){return Y.clear()}),Y.readOnly&&(gi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),Y.collapsed&&(Y.id=++xs,Y.atomic=!0),ge){if(Se&&(ge.curOp.updateMaxLine=!0),Y.collapsed)Hi(ge,u.line,I.line+1);else if(Y.className||Y.startStyle||Y.endStyle||Y.css||Y.attributes||Y.title)for(var Je=u.line;Je<=I.line;Je++)pr(ge,Je,"text");Y.atomic&&ds(ge.doc),Xt(ge,"markerAdded",ge,Y)}return Y}var Va=function(e,u){this.markers=e,this.primary=u;for(var I=0;I<e.length;++I)e[I].parent=this};Va.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Xt(this,"clear")},Va.prototype.find=function(e,u){return this.primary.find(e,u)},ke(Va);function wl(e,u,I,L,k){L=M(L),L.shared=!1;var Y=[Oa(e,u,I,L,k)],ue=Y[0],fe=L.widgetNode;return ua(e,function(ge){fe&&(L.widgetNode=fe.cloneNode(!0)),Y.push(Oa(ge,U(ge,u),U(ge,I),L,k));for(var Se=0;Se<ge.linked.length;++Se)if(ge.linked[Se].isParent)return;ue=Ke(Y)}),new Va(Y,ue)}function ws(e){return e.findMarks(ht(e.first,0),e.clipPos(ht(e.lastLine())),function(u){return u.parent})}function Sl(e,u){for(var I=0;I<u.length;I++){var L=u[I],k=L.find(),Y=e.clipPos(k.from),ue=e.clipPos(k.to);if(Dt(Y,ue)){var fe=Oa(e,Y,ue,L.primary,L.primary.type);L.markers.push(fe),fe.parent=L}}}function Tl(e){for(var u=function(L){var k=e[L],Y=[k.primary.doc];ua(k.primary.doc,function(ge){return Y.push(ge)});for(var ue=0;ue<k.markers.length;ue++){var fe=k.markers[ue];K(Y,fe.doc)==-1&&(fe.parent=null,k.markers.splice(ue--,1))}},I=0;I<e.length;I++)u(I)}var Cl=0,Tr=function(e,u,I,L,k){if(!(this instanceof Tr))return new Tr(e,u,I,L,k);I==null&&(I=0),Ka.call(this,[new za([new _r("",null)])]),this.first=I,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=I;var Y=ht(I,0);this.sel=sa(Y),this.history=new io(null),this.id=++Cl,this.modeOption=u,this.lineSep=L,this.direction=k=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Co(this,{from:Y,to:Y,text:e}),mr(this,sa(Y),de)};Tr.prototype=Ee(Ka.prototype,{constructor:Tr,iter:function(e,u,I){I?this.iterN(e-this.first,u-e,I):this.iterN(this.first,this.first+this.size,e)},insert:function(e,u){for(var I=0,L=0;L<u.length;++L)I+=u[L].height;this.insertInner(e-this.first,u,I)},remove:function(e,u){this.removeInner(e-this.first,u)},getValue:function(e){var u=he(this,this.first,this.first+this.size);return e===!1?u:u.join(e||this.lineSeparator())},setValue:rr(function(e){var u=ht(this.first,0),I=this.first+this.size-1;Ta(this,{from:u,to:ht(I,ne(this,I).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pa(this.cm,0,0),mr(this,sa(u),de)}),replaceRange:function(e,u,I,L){u=U(this,u),I=I?U(this,I):u,Ca(this,e,u,I,L)},getRange:function(e,u,I){var L=oe(this,U(this,e),U(this,u));return I===!1?L:L.join(I||this.lineSeparator())},getLine:function(e){var u=this.getLineHandle(e);return u&&u.text},getLineHandle:function(e){if(Rt(this,e))return ne(this,e)},getLineNumber:function(e){return Qe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ne(this,e)),Qi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return U(this,e)},getCursor:function(e){var u=this.sel.primary(),I;return e==null||e=="head"?I=u.head:e=="anchor"?I=u.anchor:e=="end"||e=="to"||e===!1?I=u.to():I=u.from(),I},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:rr(function(e,u,I){ls(this,U(this,typeof e=="number"?ht(e,u||0):e),null,I)}),setSelection:rr(function(e,u,I){ls(this,U(this,e),U(this,u||e),I)}),extendSelection:rr(function(e,u,I){ao(this,U(this,e),u&&U(this,u),I)}),extendSelections:rr(function(e,u){ss(this,te(this,e),u)}),extendSelectionsBy:rr(function(e,u){var I=Me(this.sel.ranges,e);ss(this,te(this,I),u)}),setSelections:rr(function(e,u,I){if(!e.length)return;for(var L=[],k=0;k<e.length;k++)L[k]=new bi(U(this,e[k].anchor),U(this,e[k].head));u==null&&(u=Math.min(e.length-1,this.sel.primIndex)),mr(this,Yr(this.cm,L,u),I)}),addSelection:rr(function(e,u,I){var L=this.sel.ranges.slice(0);L.push(new bi(U(this,e),U(this,u||e))),mr(this,Yr(this.cm,L,L.length-1),I)}),getSelection:function(e){for(var u=this.sel.ranges,I,L=0;L<u.length;L++){var k=oe(this,u[L].from(),u[L].to());I=I?I.concat(k):k}return e===!1?I:I.join(e||this.lineSeparator())},getSelections:function(e){for(var u=[],I=this.sel.ranges,L=0;L<I.length;L++){var k=oe(this,I[L].from(),I[L].to());e!==!1&&(k=k.join(e||this.lineSeparator())),u[L]=k}return u},replaceSelection:function(e,u,I){for(var L=[],k=0;k<this.sel.ranges.length;k++)L[k]=e;this.replaceSelections(L,u,I||"+input")},replaceSelections:rr(function(e,u,I){for(var L=[],k=this.sel,Y=0;Y<k.ranges.length;Y++){var ue=k.ranges[Y];L[Y]={from:ue.from(),to:ue.to(),text:this.splitLines(e[Y]),origin:I}}for(var fe=u&&u!="end"&&fl(this,L,u),ge=L.length-1;ge>=0;ge--)Ta(this,L[ge]);fe?us(this,fe):this.cm&&Ea(this.cm)}),undo:rr(function(){lo(this,"undo")}),redo:rr(function(){lo(this,"redo")}),undoSelection:rr(function(){lo(this,"undo",!0)}),redoSelection:rr(function(){lo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,u=0,I=0,L=0;L<e.done.length;L++)e.done[L].ranges||++u;for(var k=0;k<e.undone.length;k++)e.undone[k].ranges||++I;return{undo:u,redo:I}},clearHistory:function(){var e=this;this.history=new io(this.history.maxGeneration),ua(this,function(u){return u.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:wa(this.history.done),undone:wa(this.history.undone)}},setHistory:function(e){var u=this.history=new io(this.history.maxGeneration);u.done=wa(e.done.slice(0),null,!0),u.undone=wa(e.undone.slice(0),null,!0)},setGutterMarker:rr(function(e,u,I){return Ha(this,e,"gutter",function(L){var k=L.gutterMarkers||(L.gutterMarkers={});return k[u]=I,!I&&it(k)&&(L.gutterMarkers=null),!0})}),clearGutter:rr(function(e){var u=this;this.iter(function(I){I.gutterMarkers&&I.gutterMarkers[e]&&Ha(u,I,"gutter",function(){return I.gutterMarkers[e]=null,it(I.gutterMarkers)&&(I.gutterMarkers=null),!0})})}),lineInfo:function(e){var u;if(typeof e=="number"){if(!Rt(this,e))return null;if(u=e,e=ne(this,e),!e)return null}else if(u=Qe(e),u==null)return null;return{line:u,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:rr(function(e,u,I){return Ha(this,e,u=="gutter"?"gutter":"class",function(L){var k=u=="text"?"textClass":u=="background"?"bgClass":u=="gutter"?"gutterClass":"wrapClass";if(!L[k])L[k]=I;else{if(m(I).test(L[k]))return!1;L[k]+=" "+I}return!0})}),removeLineClass:rr(function(e,u,I){return Ha(this,e,u=="gutter"?"gutter":"class",function(L){var k=u=="text"?"textClass":u=="background"?"bgClass":u=="gutter"?"gutterClass":"wrapClass",Y=L[k];if(Y)if(I==null)L[k]=null;else{var ue=Y.match(m(I));if(!ue)return!1;var fe=ue.index+ue[0].length;L[k]=Y.slice(0,ue.index)+(!ue.index||fe==Y.length?"":" ")+Y.slice(fe)||null}else return!1;return!0})}),addLineWidget:rr(function(e,u,I){return xl(this,e,u,I)}),removeLineWidget:function(e){e.clear()},markText:function(e,u,I){return Oa(this,U(this,e),U(this,u),I,I&&I.type||"range")},setBookmark:function(e,u){var I={replacedWith:u&&(u.nodeType==null?u.widget:u),insertLeft:u&&u.insertLeft,clearWhenEmpty:!1,shared:u&&u.shared,handleMouseEvents:u&&u.handleMouseEvents};return e=U(this,e),Oa(this,e,e,I,"bookmark")},findMarksAt:function(e){e=U(this,e);var u=[],I=ne(this,e.line).markedSpans;if(I)for(var L=0;L<I.length;++L){var k=I[L];(k.from==null||k.from<=e.ch)&&(k.to==null||k.to>=e.ch)&&u.push(k.marker.parent||k.marker)}return u},findMarks:function(e,u,I){e=U(this,e),u=U(this,u);var L=[],k=e.line;return this.iter(e.line,u.line+1,function(Y){var ue=Y.markedSpans;if(ue)for(var fe=0;fe<ue.length;fe++){var ge=ue[fe];!(ge.to!=null&&k==e.line&&e.ch>=ge.to||ge.from==null&&k!=e.line||ge.from!=null&&k==u.line&&ge.from>=u.ch)&&(!I||I(ge.marker))&&L.push(ge.marker.parent||ge.marker)}++k}),L},getAllMarks:function(){var e=[];return this.iter(function(u){var I=u.markedSpans;if(I)for(var L=0;L<I.length;++L)I[L].from!=null&&e.push(I[L].marker)}),e},posFromIndex:function(e){var u,I=this.first,L=this.lineSeparator().length;return this.iter(function(k){var Y=k.text.length+L;if(Y>e)return u=e,!0;e-=Y,++I}),U(this,ht(I,u))},indexFromPos:function(e){e=U(this,e);var u=e.ch;if(e.line<this.first||e.ch<0)return 0;var I=this.lineSeparator().length;return this.iter(this.first,e.line,function(L){u+=L.text.length+I}),u},copy:function(e){var u=new Tr(he(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return u.scrollTop=this.scrollTop,u.scrollLeft=this.scrollLeft,u.sel=this.sel,u.extend=!1,e&&(u.history.undoDepth=this.history.undoDepth,u.setHistory(this.getHistory())),u},linkedDoc:function(e){e||(e={});var u=this.first,I=this.first+this.size;e.from!=null&&e.from>u&&(u=e.from),e.to!=null&&e.to<I&&(I=e.to);var L=new Tr(he(this,u,I),e.mode||this.modeOption,u,this.lineSep,this.direction);return e.sharedHist&&(L.history=this.history),(this.linked||(this.linked=[])).push({doc:L,sharedHist:e.sharedHist}),L.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(L,ws(this)),L},unlinkDoc:function(e){if(e instanceof Pi&&(e=e.doc),this.linked)for(var u=0;u<this.linked.length;++u){var I=this.linked[u];if(I.doc!=e)continue;this.linked.splice(u,1),e.unlinkDoc(this),Tl(ws(this));break}if(e.history==this.history){var L=[e.id];ua(e,function(k){return L.push(k.id)},!0),e.history=new io(null),e.history.done=wa(this.history.done,L),e.history.undone=wa(this.history.undone,L)}},iterLinkedDocs:function(e){ua(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):pt(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:rr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(u){return u.order=null}),this.cm&&pl(this.cm)})}),Tr.prototype.eachLine=Tr.prototype.iter;var Ss=0;function Ol(e){var u=this;if(Ts(u),Ye(u,e)||fi(u.display,e))return;be(e),A&&(Ss=+new Date);var I=yr(u,e,!0),L=e.dataTransfer.files;if(!I||u.isReadOnly())return;if(L&&L.length&&window.FileReader&&window.File)for(var k=L.length,Y=Array(k),ue=0,fe=function(){++ue==k&&ir(u,function(){I=U(u.doc,I);var ut={from:I,to:I,text:u.doc.splitLines(Y.filter(function(Tt){return Tt!=null}).join(u.doc.lineSeparator())),origin:"paste"};Ta(u.doc,ut),us(u.doc,sa(U(u.doc,I),U(u.doc,la(ut))))})()},ge=function(ut,Tt){if(u.options.allowDropFileTypes&&K(u.options.allowDropFileTypes,ut.type)==-1){fe();return}var Ut=new FileReader;Ut.onerror=function(){return fe()},Ut.onload=function(){var Kt=Ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Kt)){fe();return}Y[Tt]=Kt,fe()},Ut.readAsText(ut)},Se=0;Se<L.length;Se++)ge(L[Se],Se);else{if(u.state.draggingText&&u.doc.sel.contains(I)>-1){u.state.draggingText(e),setTimeout(function(){return u.display.input.focus()},20);return}try{var Je=e.dataTransfer.getData("Text");if(Je){var et;if(u.state.draggingText&&!u.state.draggingText.copy&&(et=u.listSelections()),oo(u.doc,sa(I,I)),et)for(var ft=0;ft<et.length;++ft)Ca(u.doc,"",et[ft].anchor,et[ft].head,"drag");u.replaceSelection(Je,"around","paste"),u.display.input.focus()}}catch(ut){}}}function Al(e,u){if(A&&(!e.state.draggingText||+new Date-Ss<100)){Le(u);return}if(Ye(e,u)||fi(e.display,u))return;if(u.dataTransfer.setData("Text",e.getSelection()),u.dataTransfer.effectAllowed="copyMove",u.dataTransfer.setDragImage&&!n){var I=E("img",null,null,"position: fixed; left: 0; top: 0;");I.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s&&(I.width=I.height=1,e.display.wrapper.appendChild(I),I._top=I.offsetTop),u.dataTransfer.setDragImage(I,0,0),s&&I.parentNode.removeChild(I)}}function Rl(e,u){var I=yr(e,u);if(!I)return;var L=document.createDocumentFragment();Si(e,I,L),e.display.dragCursor||(e.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,L)}function Ts(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Cs(e){if(!document.getElementsByClassName)return;for(var u=document.getElementsByClassName("CodeMirror"),I=[],L=0;L<u.length;L++){var k=u[L].CodeMirror;k&&I.push(k)}I.length&&I[0].operation(function(){for(var Y=0;Y<I.length;Y++)e(I[Y])})}var Os=!1;function Ll(){if(Os)return;Il(),Os=!0}function Il(){var e;Be(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Cs(Dl)},100))}),Be(window,"blur",function(){return Cs(Sr)})}function Dl(e){var u=e.display;u.cachedCharWidth=u.cachedTextHeight=u.cachedPaddingH=null,u.scrollbarsClipped=!1,e.setSize()}for(var da={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Xa=0;Xa<10;Xa++)da[Xa+48]=da[Xa+96]=String(Xa);for(var uo=65;uo<=90;uo++)da[uo]=String.fromCharCode(uo);for(var Ya=1;Ya<=12;Ya++)da[Ya+111]=da[Ya+63235]="F"+Ya;var ta={};ta.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ta.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ta.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ta.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ta.default=t?ta.macDefault:ta.pcDefault;function kl(e){var u=e.split(/-(?!$)/);e=u[u.length-1];for(var I,L,k,Y,ue=0;ue<u.length-1;ue++){var fe=u[ue];if(/^(cmd|meta|m)$/i.test(fe))Y=!0;else if(/^a(lt)?$/i.test(fe))I=!0;else if(/^(c|ctrl|control)$/i.test(fe))L=!0;else if(/^s(hift)?$/i.test(fe))k=!0;else throw new Error("Unrecognized modifier name: "+fe)}return I&&(e="Alt-"+e),L&&(e="Ctrl-"+e),Y&&(e="Cmd-"+e),k&&(e="Shift-"+e),e}function Pl(e){var u={};for(var I in e)if(e.hasOwnProperty(I)){var L=e[I];if(/^(name|fallthrough|(de|at)tach)$/.test(I))continue;if(L=="..."){delete e[I];continue}for(var k=Me(I.split(" "),kl),Y=0;Y<k.length;Y++){var ue=void 0,fe=void 0;Y==k.length-1?(fe=k.join(" "),ue=L):(fe=k.slice(0,Y+1).join(" "),ue="...");var ge=u[fe];if(!ge)u[fe]=ue;else if(ge!=ue)throw new Error("Inconsistent bindings for "+fe)}delete e[I]}for(var Se in u)e[Se]=u[Se];return e}function Aa(e,u,I,L){u=co(u);var k=u.call?u.call(e,L):u[e];if(k===!1)return"nothing";if(k==="...")return"multi";if(k!=null&&I(k))return"handled";if(u.fallthrough){if(Object.prototype.toString.call(u.fallthrough)!="[object Array]")return Aa(e,u.fallthrough,I,L);for(var Y=0;Y<u.fallthrough.length;Y++){var ue=Aa(e,u.fallthrough[Y],I,L);if(ue)return ue}}}function As(e){var u=typeof e=="string"?e:da[e.keyCode];return u=="Ctrl"||u=="Alt"||u=="Shift"||u=="Mod"}function Rs(e,u,I){var L=e;return u.altKey&&L!="Alt"&&(e="Alt-"+e),(b?u.metaKey:u.ctrlKey)&&L!="Ctrl"&&(e="Ctrl-"+e),(b?u.ctrlKey:u.metaKey)&&L!="Mod"&&(e="Cmd-"+e),!I&&u.shiftKey&&L!="Shift"&&(e="Shift-"+e),e}function Ls(e,u){if(s&&e.keyCode==34&&e.char)return!1;var I=da[e.keyCode];return I==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(I=e.code),Rs(I,e,u))}function co(e){return typeof e=="string"?ta[e]:e}function Ra(e,u){for(var I=e.doc.sel.ranges,L=[],k=0;k<I.length;k++){for(var Y=u(I[k]);L.length&&Dt(Y.from,Ke(L).to)<=0;){var ue=L.pop();if(Dt(ue.from,Y.from)<0){Y.from=ue.from;break}}L.push(Y)}Pr(e,function(){for(var fe=L.length-1;fe>=0;fe--)Ca(e.doc,"",L[fe].from,L[fe].to,"+delete");Ea(e)})}function Lo(e,u,I){var L=j(e.text,u+I,I);return L<0||L>e.text.length?null:L}function Io(e,u,I){var L=Lo(e,u.ch,I);return L==null?null:new ht(u.line,L,I<0?"after":"before")}function Do(e,u,I,L,k){if(e){u.doc.direction=="rtl"&&(k=-k);var Y=dt(I,u.doc.direction);if(Y){var ue=k<0?Ke(Y):Y[0],fe=k<0==(ue.level==1),ge=fe?"after":"before",Se;if(ue.level>0||u.doc.direction=="rtl"){var Je=li(u,I);Se=k<0?I.text.length-1:0;var et=Dn(u,Je,Se).top;Se=ee(function(ft){return Dn(u,Je,ft).top==et},k<0==(ue.level==1)?ue.from:ue.to-1,Se),ge=="before"&&(Se=Lo(I,Se,1))}else Se=k<0?ue.to:ue.from;return new ht(L,Se,ge)}}return new ht(L,k<0?I.text.length:0,k<0?"before":"after")}function Ml(e,u,I,L){var k=dt(u,e.doc.direction);if(!k)return Io(u,I,L);I.ch>=u.text.length?(I.ch=u.text.length,I.sticky="before"):I.ch<=0&&(I.ch=0,I.sticky="after");var Y=xe(k,I.ch,I.sticky),ue=k[Y];if(e.doc.direction=="ltr"&&ue.level%2==0&&(L>0?ue.to>I.ch:ue.from<I.ch))return Io(u,I,L);var fe=function(qt,on){return Lo(u,qt instanceof ht?qt.ch:qt,on)},ge,Se=function(qt){return e.options.lineWrapping?(ge=ge||li(e,u),Ur(e,u,ge,qt)):{begin:0,end:u.text.length}},Je=Se(I.sticky=="before"?fe(I,-1):I.ch);if(e.doc.direction=="rtl"||ue.level==1){var et=ue.level==1==L<0,ft=fe(I,et?1:-1);if(ft!=null&&(et?ft<=ue.to&&ft<=Je.end:ft>=ue.from&&ft>=Je.begin)){var ut=et?"before":"after";return new ht(I.line,ft,ut)}}var Tt=function(qt,on,Zt){for(var dn=function(Ii,ar){return ar?new ht(I.line,fe(Ii,1),"before"):new ht(I.line,Ii,"after")};qt>=0&&qt<k.length;qt+=on){var On=k[qt],yn=on>0==(On.level!=1),ei=yn?Zt.begin:fe(Zt.end,-1);if(On.from<=ei&&ei<On.to)return dn(ei,yn);if(ei=yn?On.from:fe(On.to,-1),Zt.begin<=ei&&ei<Zt.end)return dn(ei,yn)}},Ut=Tt(Y+L,L,Je);if(Ut)return Ut;var Kt=L>0?Je.end:fe(Je.begin,-1);return Kt!=null&&!(L>0&&Kt==u.text.length)&&(Ut=Tt(L>0?0:k.length-1,L,Se(Kt)),Ut)?Ut:null}var $a={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Ra(e,function(u){if(u.empty()){var I=ne(e.doc,u.head.line).text.length;return u.head.ch==I&&u.head.line<e.lastLine()?{from:u.head,to:ht(u.head.line+1,0)}:{from:u.head,to:ht(u.head.line,I)}}else return{from:u.from(),to:u.to()}})},deleteLine:function(e){return Ra(e,function(u){return{from:ht(u.from().line,0),to:U(e.doc,ht(u.to().line+1,0))}})},delLineLeft:function(e){return Ra(e,function(u){return{from:ht(u.from().line,0),to:u.from()}})},delWrappedLineLeft:function(e){return Ra(e,function(u){var I=e.charCoords(u.head,"div").top+5,L=e.coordsChar({left:0,top:I},"div");return{from:L,to:u.from()}})},delWrappedLineRight:function(e){return Ra(e,function(u){var I=e.charCoords(u.head,"div").top+5,L=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:I},"div");return{from:u.from(),to:L}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ht(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ht(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(u){return Is(e,u.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(u){return Ds(e,u.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(u){return Nl(e,u.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(u){var I=e.cursorCoords(u.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:I},"div")},we)},goLineLeft:function(e){return e.extendSelectionsBy(function(u){var I=e.cursorCoords(u.head,"div").top+5;return e.coordsChar({left:0,top:I},"div")},we)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(u){var I=e.cursorCoords(u.head,"div").top+5,L=e.coordsChar({left:0,top:I},"div");return L.ch<e.getLine(L.line).search(/\S/)?Ds(e,u.head):L},we)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var u=[],I=e.listSelections(),L=e.options.tabSize,k=0;k<I.length;k++){var Y=I[k].from(),ue=G(e.getLine(Y.line),Y.ch,L);u.push(ye(L-ue%L))}e.replaceSelections(u)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pr(e,function(){for(var u=e.listSelections(),I=[],L=0;L<u.length;L++){if(!u[L].empty())continue;var k=u[L].head,Y=ne(e.doc,k.line).text;if(Y){if(k.ch==Y.length&&(k=new ht(k.line,k.ch-1)),k.ch>0)k=new ht(k.line,k.ch+1),e.replaceRange(Y.charAt(k.ch-1)+Y.charAt(k.ch-2),ht(k.line,k.ch-2),k,"+transpose");else if(k.line>e.doc.first){var ue=ne(e.doc,k.line-1).text;ue&&(k=new ht(k.line,1),e.replaceRange(Y.charAt(0)+e.doc.lineSeparator()+ue.charAt(ue.length-1),ht(k.line-1,ue.length-1),k,"+transpose"))}}I.push(new bi(k,k))}e.setSelections(I)})},newlineAndIndent:function(e){return Pr(e,function(){for(var u=e.listSelections(),I=u.length-1;I>=0;I--)e.replaceRange(e.doc.lineSeparator(),u[I].anchor,u[I].head,"+input");u=e.listSelections();for(var L=0;L<u.length;L++)e.indentLine(u[L].from().line,null,!0);Ea(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Is(e,u){var I=ne(e.doc,u),L=Qi(I);return L!=I&&(u=Qe(L)),Do(!0,e,L,u,1)}function Nl(e,u){var I=ne(e.doc,u),L=Br(I);return L!=I&&(u=Qe(L)),Do(!0,e,I,u,-1)}function Ds(e,u){var I=Is(e,u.line),L=ne(e.doc,I.line),k=dt(L,e.doc.direction);if(!k||k[0].level==0){var Y=Math.max(I.ch,L.text.search(/\S/)),ue=u.line==I.line&&u.ch<=Y&&u.ch;return ht(I.line,ue?0:Y,I.sticky)}return I}function ho(e,u,I){if(typeof u=="string"&&(u=$a[u],!u))return!1;e.display.input.ensurePolled();var L=e.display.shift,k=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),I&&(e.display.shift=!1),k=u(e)!=le}finally{e.display.shift=L,e.state.suppressEdits=!1}return k}function Ul(e,u,I){for(var L=0;L<e.state.keyMaps.length;L++){var k=Aa(u,e.state.keyMaps[L],I,e);if(k)return k}return e.options.extraKeys&&Aa(u,e.options.extraKeys,I,e)||Aa(u,e.options.keyMap,I,e)}var jl=new J;function Ja(e,u,I,L){var k=e.state.keySeq;if(k){if(As(u))return"handled";if(/\'$/.test(u)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==k&&(e.state.keySeq=null,e.display.input.reset())}),ks(e,k+" "+u,I,L))return!0}return ks(e,u,I,L)}function ks(e,u,I,L){var k=Ul(e,u,L);return k=="multi"&&(e.state.keySeq=u),k=="handled"&&Xt(e,"keyHandled",e,u,I),(k=="handled"||k=="multi")&&(be(I),ia(e)),!!k}function Ps(e,u){var I=Ls(u,!0);return I?u.shiftKey&&!e.state.keySeq?Ja(e,"Shift-"+I,u,function(L){return ho(e,L,!0)})||Ja(e,I,u,function(L){if(typeof L=="string"?/^go[A-Z]/.test(L):L.motion)return ho(e,L)}):Ja(e,I,u,function(L){return ho(e,L)}):!1}function Fl(e,u,I){return Ja(e,"'"+I+"'",u,function(L){return ho(e,L,!0)})}var ko=null;function Ms(e){var u=this;if(e.target&&e.target!=u.display.input.getField())return;if(u.curOp.focus=N(),Ye(u,e))return;A&&O<11&&e.keyCode==27&&(e.returnValue=!1);var I=e.keyCode;u.display.shift=I==16||e.shiftKey;var L=Ps(u,e);s&&(ko=L?I:null,!L&&I==88&&!rt&&(t?e.metaKey:e.ctrlKey)&&u.replaceSelection("",null,"cut")),W&&!t&&!L&&I==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),I==18&&!/\bCodeMirror-crosshair\b/.test(u.display.lineDiv.className)&&Bl(u)}function Bl(e){var u=e.display.lineDiv;F(u,"CodeMirror-crosshair");function I(L){(L.keyCode==18||!L.altKey)&&(_(u,"CodeMirror-crosshair"),lt(document,"keyup",I),lt(document,"mouseover",I))}Be(document,"keyup",I),Be(document,"mouseover",I)}function Ns(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ye(this,e)}function Us(e){var u=this;if(e.target&&e.target!=u.display.input.getField())return;if(fi(u.display,e)||Ye(u,e)||e.ctrlKey&&!e.altKey||t&&e.metaKey)return;var I=e.keyCode,L=e.charCode;if(s&&I==ko){ko=null,be(e);return}if(s&&(!e.which||e.which<10)&&Ps(u,e))return;var k=String.fromCharCode(L==null?I:L);if(k=="\b")return;if(Fl(u,e,k))return;u.display.input.onKeyPress(e)}var Wl=400,Po=function(e,u,I){this.time=e,this.pos=u,this.button=I};Po.prototype.compare=function(e,u,I){return this.time+Wl>e&&Dt(u,this.pos)==0&&I==this.button};var Qa,qa;function Hl(e,u){var I=+new Date;return qa&&qa.compare(I,e,u)?(Qa=qa=null,"triple"):Qa&&Qa.compare(I,e,u)?(qa=new Po(I,e,u),Qa=null,"double"):(Qa=new Po(I,e,u),qa=null,"single")}function js(e){var u=this,I=u.display;if(Ye(u,e)||I.activeTouch&&I.input.supportsTouch())return;if(I.input.ensurePolled(),I.shift=e.shiftKey,fi(I,e)){f||(I.scroller.draggable=!1,setTimeout(function(){return I.scroller.draggable=!0},100));return}if(Mo(u,e))return;var L=yr(u,e),k=at(e),Y=L?Hl(L,k):"single";if(window.focus(),k==1&&u.state.selectingText&&u.state.selectingText(e),L&&zl(u,k,L,Y,e))return;k==1?L?Gl(u,L,Y,e):Ve(e)==I.scroller&&be(e):k==2?(L&&ao(u.doc,L),setTimeout(function(){return I.input.focus()},20)):k==3&&(g?u.display.input.onContextMenu(e):ra(u))}function zl(e,u,I,L,k){var Y="Click";return L=="double"?Y="Double"+Y:L=="triple"&&(Y="Triple"+Y),Y=(u==1?"Left":u==2?"Middle":"Right")+Y,Ja(e,Rs(Y,k),k,function(ue){if(typeof ue=="string"&&(ue=$a[ue]),!ue)return!1;var fe=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),fe=ue(e,I)!=le}finally{e.state.suppressEdits=!1}return fe})}function Kl(e,u,I){var L=e.getOption("configureMouse"),k=L?L(e,u,I):{};if(k.unit==null){var Y=d?I.shiftKey&&I.metaKey:I.altKey;k.unit=Y?"rectangle":u=="single"?"char":u=="double"?"word":"line"}return(k.extend==null||e.doc.extend)&&(k.extend=e.doc.extend||I.shiftKey),k.addNew==null&&(k.addNew=t?I.metaKey:I.ctrlKey),k.moveOnDrag==null&&(k.moveOnDrag=!(t?I.altKey:I.ctrlKey)),k}function Gl(e,u,I,L){A?setTimeout(B(vn,e),0):e.curOp.focus=N();var k=Kl(e,I,L),Y=e.doc.sel,ue;e.options.dragDrop&&_t&&!e.isReadOnly()&&I=="single"&&(ue=Y.contains(u))>-1&&(Dt((ue=Y.ranges[ue]).from(),u)<0||u.xRel>0)&&(Dt(ue.to(),u)>0||u.xRel<0)?Vl(e,L,u,k):Xl(e,L,u,k)}function Vl(e,u,I,L){var k=e.display,Y=!1,ue=ir(e,function(Se){f&&(k.scroller.draggable=!1),e.state.draggingText=!1,lt(k.wrapper.ownerDocument,"mouseup",ue),lt(k.wrapper.ownerDocument,"mousemove",fe),lt(k.scroller,"dragstart",ge),lt(k.scroller,"drop",ue),Y||(be(Se),L.addNew||ao(e.doc,I,null,null,L.extend),f&&!n||A&&O==9?setTimeout(function(){k.wrapper.ownerDocument.body.focus({preventScroll:!0}),k.input.focus()},20):k.input.focus())}),fe=function(Se){Y=Y||Math.abs(u.clientX-Se.clientX)+Math.abs(u.clientY-Se.clientY)>=10},ge=function(){return Y=!0};f&&(k.scroller.draggable=!0),e.state.draggingText=ue,ue.copy=!L.moveOnDrag,k.scroller.dragDrop&&k.scroller.dragDrop(),Be(k.wrapper.ownerDocument,"mouseup",ue),Be(k.wrapper.ownerDocument,"mousemove",fe),Be(k.scroller,"dragstart",ge),Be(k.scroller,"drop",ue),ra(e),setTimeout(function(){return k.input.focus()},20)}function Fs(e,u,I){if(I=="char")return new bi(u,u);if(I=="word")return e.findWordAt(u);if(I=="line")return new bi(ht(u.line,0),U(e.doc,ht(u.line+1,0)));var L=I(e,u);return new bi(L.from,L.to)}function Xl(e,u,I,L){var k=e.display,Y=e.doc;be(u);var ue,fe,ge=Y.sel,Se=ge.ranges;if(L.addNew&&!L.extend?(fe=Y.sel.contains(I),fe>-1?ue=Se[fe]:ue=new bi(I,I)):(ue=Y.sel.primary(),fe=Y.sel.primIndex),L.unit=="rectangle")L.addNew||(ue=new bi(I,I)),I=yr(e,u,!0,!0),fe=-1;else{var Je=Fs(e,I,L.unit);L.extend?ue=Ao(ue,Je.anchor,Je.head,L.extend):ue=Je}L.addNew?fe==-1?(fe=Se.length,mr(Y,Yr(e,Se.concat([ue]),fe),{scroll:!1,origin:"*mouse"})):Se.length>1&&Se[fe].empty()&&L.unit=="char"&&!L.extend?(mr(Y,Yr(e,Se.slice(0,fe).concat(Se.slice(fe+1)),0),{scroll:!1,origin:"*mouse"}),ge=Y.sel):Ro(Y,fe,ue,Te):(fe=0,mr(Y,new Fr([ue],0),Te),ge=Y.sel);var et=I;function ft(Zt){if(Dt(et,Zt)==0)return;if(et=Zt,L.unit=="rectangle"){for(var dn=[],On=e.options.tabSize,yn=G(ne(Y,I.line).text,I.ch,On),ei=G(ne(Y,Zt.line).text,Zt.ch,On),Ii=Math.min(yn,ei),ar=Math.max(yn,ei),Mi=Math.min(I.line,Zt.line),Mr=Math.min(e.lastLine(),Math.max(I.line,Zt.line));Mi<=Mr;Mi++){var Cr=ne(Y,Mi).text,$i=Ie(Cr,Ii,On);Ii==ar?dn.push(new bi(ht(Mi,$i),ht(Mi,$i))):Cr.length>$i&&dn.push(new bi(ht(Mi,$i),ht(Mi,Ie(Cr,ar,On))))}dn.length||dn.push(new bi(I,I)),mr(Y,Yr(e,ge.ranges.slice(0,fe).concat(dn),fe),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Zt)}else{var Or=ue,dr=Fs(e,Zt,L.unit),nr=Or.anchor,Ji;Dt(dr.anchor,nr)>0?(Ji=dr.head,nr=rn(Or.from(),dr.anchor)):(Ji=dr.anchor,nr=hn(Or.to(),dr.head));var Fi=ge.ranges.slice(0);Fi[fe]=Yl(e,new bi(U(Y,nr),Ji)),mr(Y,Yr(e,Fi,fe),Te)}}var ut=k.wrapper.getBoundingClientRect(),Tt=0;function Ut(Zt){var dn=++Tt,On=yr(e,Zt,!0,L.unit=="rectangle");if(!On)return;if(Dt(On,et)!=0){e.curOp.focus=N(),ft(On);var yn=Xr(k,Y);(On.line>=yn.to||On.line<yn.from)&&setTimeout(ir(e,function(){Tt==dn&&Ut(Zt)}),150)}else{var ei=Zt.clientY<ut.top?-20:Zt.clientY>ut.bottom?20:0;ei&&setTimeout(ir(e,function(){if(Tt!=dn)return;k.scroller.scrollTop+=ei,Ut(Zt)}),50)}}function Kt(Zt){e.state.selectingText=!1,Tt=Infinity,Zt&&(be(Zt),k.input.focus()),lt(k.wrapper.ownerDocument,"mousemove",qt),lt(k.wrapper.ownerDocument,"mouseup",on),Y.history.lastSelOrigin=null}var qt=ir(e,function(Zt){Zt.buttons===0||!at(Zt)?Kt(Zt):Ut(Zt)}),on=ir(e,Kt);e.state.selectingText=on,Be(k.wrapper.ownerDocument,"mousemove",qt),Be(k.wrapper.ownerDocument,"mouseup",on)}function Yl(e,u){var I=u.anchor,L=u.head,k=ne(e.doc,I.line);if(Dt(I,L)==0&&I.sticky==L.sticky)return u;var Y=dt(k);if(!Y)return u;var ue=xe(Y,I.ch,I.sticky),fe=Y[ue];if(fe.from!=I.ch&&fe.to!=I.ch)return u;var ge=ue+(fe.from==I.ch==(fe.level!=1)?0:1);if(ge==0||ge==Y.length)return u;var Se;if(L.line!=I.line)Se=(L.line-I.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Je=xe(Y,L.ch,L.sticky),et=Je-ue||(L.ch-I.ch)*(fe.level==1?-1:1);Je==ge-1||Je==ge?Se=et<0:Se=et>0}var ft=Y[ge+(Se?-1:0)],ut=Se==(ft.level==1),Tt=ut?ft.from:ft.to,Ut=ut?"after":"before";return I.ch==Tt&&I.sticky==Ut?u:new bi(new ht(I.line,Tt,Ut),L)}function Bs(e,u,I,L){var k,Y;if(u.touches)k=u.touches[0].clientX,Y=u.touches[0].clientY;else try{k=u.clientX,Y=u.clientY}catch(ft){return!1}if(k>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;L&&be(u);var ue=e.display,fe=ue.lineDiv.getBoundingClientRect();if(Y>fe.bottom||!Ue(e,I))return Pe(u);Y-=fe.top-ue.viewOffset;for(var ge=0;ge<e.display.gutterSpecs.length;++ge){var Se=ue.gutters.childNodes[ge];if(Se&&Se.getBoundingClientRect().right>=k){var Je=ot(e.doc,Y),et=e.display.gutterSpecs[ge];return qe(e,I,e,Je,et.className,u),Pe(u)}}}function Mo(e,u){return Bs(e,u,"gutterClick",!0)}function Ws(e,u){if(fi(e.display,u)||$l(e,u))return;if(Ye(e,u,"contextmenu"))return;g||e.display.input.onContextMenu(u)}function $l(e,u){return Ue(e,"gutterContextMenu")?Bs(e,u,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}var La={toString:function(){return"CodeMirror.Init"}},zs={},fo={};function Jl(e){var u=e.optionHandlers;function I(L,k,Y,ue){e.defaults[L]=k,Y&&(u[L]=ue?function(fe,ge,Se){Se!=La&&Y(fe,ge,Se)}:Y)}e.defineOption=I,e.Init=La,I("value","",function(L,k){return L.setValue(k)},!0),I("mode",null,function(L,k){L.doc.modeOption=k,To(L)},!0),I("indentUnit",2,To,!0),I("indentWithTabs",!1),I("smartIndent",!0),I("tabSize",4,function(L){Ba(L),un(L),Hi(L)},!0),I("lineSeparator",null,function(L,k){if(L.doc.lineSep=k,!k)return;var Y=[],ue=L.doc.first;L.doc.iter(function(ge){for(var Se=0;;){var Je=ge.text.indexOf(k,Se);if(Je==-1)break;Se=Je+k.length,Y.push(ht(ue,Je))}ue++});for(var fe=Y.length-1;fe>=0;fe--)Ca(L.doc,k,Y[fe],ht(Y[fe].line,Y[fe].ch+k.length))}),I("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(L,k,Y){L.state.specialChars=new RegExp(k.source+(k.test(" ")?"":"| "),"g"),Y!=La&&L.refresh()}),I("specialCharPlaceholder",_i,function(L){return L.refresh()},!0),I("electricChars",!0),I("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),I("spellcheck",!1,function(L,k){return L.getInputField().spellcheck=k},!0),I("autocorrect",!1,function(L,k){return L.getInputField().autocorrect=k},!0),I("autocapitalize",!1,function(L,k){return L.getInputField().autocapitalize=k},!0),I("rtlMoveVisually",!v),I("wholeLineUpdateBefore",!0),I("theme","default",function(L){Hs(L),Fa(L)},!0),I("keyMap","default",function(L,k,Y){var ue=co(k),fe=Y!=La&&co(Y);fe&&fe.detach&&fe.detach(L,ue),ue.attach&&ue.attach(L,fe||null)}),I("extraKeys",null),I("configureMouse",null),I("lineWrapping",!1,ql,!0),I("gutters",[],function(L,k){L.display.gutterSpecs=wo(k,L.options.lineNumbers),Fa(L)},!0),I("fixedGutter",!0,function(L,k){L.display.gutters.style.left=k?Ui(L.display)+"px":"0",L.refresh()},!0),I("coverGutterNextToScrollbar",!1,function(L){return xa(L)},!0),I("scrollbarStyle","native",function(L){Go(L),xa(L),L.display.scrollbars.setScrollTop(L.doc.scrollTop),L.display.scrollbars.setScrollLeft(L.doc.scrollLeft)},!0),I("lineNumbers",!1,function(L,k){L.display.gutterSpecs=wo(L.options.gutters,k),Fa(L)},!0),I("firstLineNumber",1,Fa,!0),I("lineNumberFormatter",function(L){return L},Fa,!0),I("showCursorWhenSelecting",!1,tn,!0),I("resetSelectionOnContextMenu",!0),I("lineWiseCopyCut",!0),I("pasteLinesPerSelection",!0),I("selectionsMayTouch",!1),I("readOnly",!1,function(L,k){k=="nocursor"&&(Sr(L),L.display.input.blur()),L.display.input.readOnlyChanged(k)}),I("screenReaderLabel",null,function(L,k){k=k===""?null:k,L.display.input.screenReaderLabelChanged(k)}),I("disableInput",!1,function(L,k){k||L.display.input.reset()},!0),I("dragDrop",!0,Ql),I("allowDropFileTypes",null),I("cursorBlinkRate",530),I("cursorScrollMargin",0),I("cursorHeight",1,tn,!0),I("singleCursorHeightPerLine",!0,tn,!0),I("workTime",100),I("workDelay",100),I("flattenSpans",!0,Ba,!0),I("addModeClass",!1,Ba,!0),I("pollInterval",100),I("undoDepth",200,function(L,k){return L.doc.history.undoDepth=k}),I("historyEventDelay",1250),I("viewportMargin",10,function(L){return L.refresh()},!0),I("maxHighlightLength",1e4,Ba,!0),I("moveInputWithCursor",!0,function(L,k){k||L.display.input.resetPosition()}),I("tabindex",null,function(L,k){return L.display.input.getField().tabIndex=k||""}),I("autofocus",null),I("direction","ltr",function(L,k){return L.doc.setDirection(k)},!0),I("phrases",null)}function Ql(e,u,I){var L=I&&I!=La;if(!u!=!L){var k=e.display.dragFunctions,Y=u?Be:lt;Y(e.display.scroller,"dragstart",k.start),Y(e.display.scroller,"dragenter",k.enter),Y(e.display.scroller,"dragover",k.over),Y(e.display.scroller,"dragleave",k.leave),Y(e.display.scroller,"drop",k.drop)}}function ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),qr(e)),wr(e),Hi(e),un(e),setTimeout(function(){return xa(e)},100)}function Pi(e,u){var I=this;if(!(this instanceof Pi))return new Pi(e,u);this.options=u=u?M(u):{},M(zs,u,!1);var L=u.value;typeof L=="string"?L=new Tr(L,u.mode,null,u.lineSeparator,u.direction):u.mode&&(L.modeOption=u.mode),this.doc=L;var k=new Pi.inputStyles[u.inputStyle](this),Y=this.display=new dl(e,L,k,u);Y.wrapper.CodeMirror=this,Hs(this),u.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 J,keySeq:null,specialChars:null},u.autofocus&&!i&&Y.input.focus(),A&&O<11&&setTimeout(function(){return I.display.input.reset(!0)},20),Zl(this),Ll(),ga(this),this.curOp.forceUpdate=!0,ts(this,L),u.autofocus&&!i||this.hasFocus()?setTimeout(function(){I.hasFocus()&&!I.state.focused&&fa(I)},20):Sr(this);for(var ue in fo)fo.hasOwnProperty(ue)&&fo[ue](this,u[ue],La);Yo(this),u.finishInit&&u.finishInit(this);for(var fe=0;fe<No.length;++fe)No[fe](this);va(this),f&&u.lineWrapping&&getComputedStyle(Y.lineDiv).textRendering=="optimizelegibility"&&(Y.lineDiv.style.textRendering="auto")}Pi.defaults=zs,Pi.optionHandlers=fo;function Zl(e){var u=e.display;Be(u.scroller,"mousedown",ir(e,js)),A&&O<11?Be(u.scroller,"dblclick",ir(e,function(ge){if(Ye(e,ge))return;var Se=yr(e,ge);if(!Se||Mo(e,ge)||fi(e.display,ge))return;be(ge);var Je=e.findWordAt(Se);ao(e.doc,Je.anchor,Je.head)})):Be(u.scroller,"dblclick",function(ge){return Ye(e,ge)||be(ge)}),Be(u.scroller,"contextmenu",function(ge){return Ws(e,ge)}),Be(u.input.getField(),"contextmenu",function(ge){u.scroller.contains(ge.target)||Ws(e,ge)});var I,L={end:0};function k(){u.activeTouch&&(I=setTimeout(function(){return u.activeTouch=null},1e3),L=u.activeTouch,L.end=+new Date)}function Y(ge){if(ge.touches.length!=1)return!1;var Se=ge.touches[0];return Se.radiusX<=1&&Se.radiusY<=1}function ue(ge,Se){if(Se.left==null)return!0;var Je=Se.left-ge.left,et=Se.top-ge.top;return Je*Je+et*et>20*20}Be(u.scroller,"touchstart",function(ge){if(!Ye(e,ge)&&!Y(ge)&&!Mo(e,ge)){u.input.ensurePolled(),clearTimeout(I);var Se=+new Date;u.activeTouch={start:Se,moved:!1,prev:Se-L.end<=300?L:null},ge.touches.length==1&&(u.activeTouch.left=ge.touches[0].pageX,u.activeTouch.top=ge.touches[0].pageY)}}),Be(u.scroller,"touchmove",function(){u.activeTouch&&(u.activeTouch.moved=!0)}),Be(u.scroller,"touchend",function(ge){var Se=u.activeTouch;if(Se&&!fi(u,ge)&&Se.left!=null&&!Se.moved&&new Date-Se.start<300){var Je=e.coordsChar(u.activeTouch,"page"),et;!Se.prev||ue(Se,Se.prev)?et=new bi(Je,Je):!Se.prev.prev||ue(Se,Se.prev.prev)?et=e.findWordAt(Je):et=new bi(ht(Je.line,0),U(e.doc,ht(Je.line+1,0))),e.setSelection(et.anchor,et.head),e.focus(),be(ge)}k()}),Be(u.scroller,"touchcancel",k),Be(u.scroller,"scroll",function(){u.scroller.clientHeight&&(Ma(e,u.scroller.scrollTop),pa(e,u.scroller.scrollLeft,!0),qe(e,"scroll",e))}),Be(u.scroller,"mousewheel",function(ge){return Qo(e,ge)}),Be(u.scroller,"DOMMouseScroll",function(ge){return Qo(e,ge)}),Be(u.wrapper,"scroll",function(){return u.wrapper.scrollTop=u.wrapper.scrollLeft=0}),u.dragFunctions={enter:function(ge){Ye(e,ge)||Le(ge)},over:function(ge){Ye(e,ge)||(Rl(e,ge),Le(ge))},start:function(ge){return Al(e,ge)},drop:ir(e,Ol),leave:function(ge){Ye(e,ge)||Ts(e)}};var fe=u.input.getField();Be(fe,"keyup",function(ge){return Ns.call(e,ge)}),Be(fe,"keydown",ir(e,Ms)),Be(fe,"keypress",ir(e,Us)),Be(fe,"focus",function(ge){return fa(e,ge)}),Be(fe,"blur",function(ge){return Sr(e,ge)})}var No=[];Pi.defineInitHook=function(e){return No.push(e)};function Za(e,u,I,L){var k=e.doc,Y;I==null&&(I="add"),I=="smart"&&(k.mode.indent?Y=Ot(e,u).state:I="prev");var ue=e.options.tabSize,fe=ne(k,u),ge=G(fe.text,null,ue);fe.stateAfter&&(fe.stateAfter=null);var Se=fe.text.match(/^\s*/)[0],Je;if(!L&&!/\S/.test(fe.text))Je=0,I="not";else if(I=="smart"&&(Je=k.mode.indent(Y,fe.text.slice(Se.length),fe.text),Je==le||Je>150)){if(!L)return;I="prev"}I=="prev"?u>k.first?Je=G(ne(k,u-1).text,null,ue):Je=0:I=="add"?Je=ge+e.options.indentUnit:I=="subtract"?Je=ge-e.options.indentUnit:typeof I=="number"&&(Je=ge+I),Je=Math.max(0,Je);var et="",ft=0;if(e.options.indentWithTabs)for(var ut=Math.floor(Je/ue);ut;--ut)ft+=ue,et+=" ";if(ft<Je&&(et+=ye(Je-ft)),et!=Se)return Ca(k,et,ht(u,0),ht(u,Se.length),"+input"),fe.stateAfter=null,!0;for(var Tt=0;Tt<k.sel.ranges.length;Tt++){var Ut=k.sel.ranges[Tt];if(Ut.head.line==u&&Ut.head.ch<Se.length){var Kt=ht(u,Se.length);Ro(k,Tt,new bi(Kt,Kt));break}}}var $r=null;function po(e){$r=e}function Uo(e,u,I,L,k){var Y=e.doc;e.display.shift=!1,L||(L=Y.sel);var ue=+new Date-200,fe=k=="paste"||e.state.pasteIncoming>ue,ge=pt(u),Se=null;if(fe&&L.ranges.length>1)if($r&&$r.text.join(`
|
|
|
`)==u){if(L.ranges.length%$r.text.length==0){Se=[];for(var Je=0;Je<$r.text.length;Je++)Se.push(Y.splitLines($r.text[Je]))}}else ge.length==L.ranges.length&&e.options.pasteLinesPerSelection&&(Se=Me(ge,function(qt){return[qt]}));for(var et=e.curOp.updateInput,ft=L.ranges.length-1;ft>=0;ft--){var ut=L.ranges[ft],Tt=ut.from(),Ut=ut.to();ut.empty()&&(I&&I>0?Tt=ht(Tt.line,Tt.ch-I):e.state.overwrite&&!fe?Ut=ht(Ut.line,Math.min(ne(Y,Ut.line).text.length,Ut.ch+Ke(ge).length)):fe&&$r&&$r.lineWise&&$r.text.join(`
|
|
|
`)==ge.join(`
|
|
|
`)&&(Tt=Ut=ht(Tt.line,0)));var Kt={from:Tt,to:Ut,text:Se?Se[ft%Se.length]:ge,origin:k||(fe?"paste":e.state.cutIncoming>ue?"cut":"+input")};Ta(e.doc,Kt),Xt(e,"inputRead",e,Kt)}u&&!fe&&Gs(e,u),Ea(e),e.curOp.updateInput<2&&(e.curOp.updateInput=et),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ks(e,u){var I=e.clipboardData&&e.clipboardData.getData("Text");if(I)return e.preventDefault(),!u.isReadOnly()&&!u.options.disableInput&&Pr(u,function(){return Uo(u,I,0,null,"paste")}),!0}function Gs(e,u){if(!e.options.electricChars||!e.options.smartIndent)return;for(var I=e.doc.sel,L=I.ranges.length-1;L>=0;L--){var k=I.ranges[L];if(k.head.ch>100||L&&I.ranges[L-1].head.line==k.head.line)continue;var Y=e.getModeAt(k.head),ue=!1;if(Y.electricChars){for(var fe=0;fe<Y.electricChars.length;fe++)if(u.indexOf(Y.electricChars.charAt(fe))>-1){ue=Za(e,k.head.line,"smart");break}}else Y.electricInput&&(Y.electricInput.test(ne(e.doc,k.head.line).text.slice(0,k.head.ch))&&(ue=Za(e,k.head.line,"smart")));ue&&Xt(e,"electricInput",e,k.head.line)}}function Vs(e){for(var u=[],I=[],L=0;L<e.doc.sel.ranges.length;L++){var k=e.doc.sel.ranges[L].head.line,Y={anchor:ht(k,0),head:ht(k+1,0)};I.push(Y),u.push(e.getRange(Y.anchor,Y.head))}return{text:u,ranges:I}}function Xs(e,u,I,L){e.setAttribute("autocorrect",I?"":"off"),e.setAttribute("autocapitalize",L?"":"off"),e.setAttribute("spellcheck",!!u)}function Ys(){var e=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),u=E("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return f?e.style.width="1000px":e.setAttribute("wrap","off"),l&&(e.style.border="1px solid black"),Xs(e),u}function eu(e){var u=e.optionHandlers,I=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(L,k){var Y=this.options,ue=Y[L];if(Y[L]==k&&L!="mode")return;Y[L]=k,u.hasOwnProperty(L)&&ir(this,u[L])(this,k,ue),qe(this,"optionChange",this,L)},getOption:function(L){return this.options[L]},getDoc:function(){return this.doc},addKeyMap:function(L,k){this.state.keyMaps[k?"push":"unshift"](co(L))},removeKeyMap:function(L){for(var k=this.state.keyMaps,Y=0;Y<k.length;++Y)if(k[Y]==L||k[Y].name==L)return k.splice(Y,1),!0},addOverlay:br(function(L,k){var Y=L.token?L:e.getMode(this.options,L);if(Y.startState)throw new Error("Overlays may not be stateful.");Fe(this.state.overlays,{mode:Y,modeSpec:L,opaque:k&&k.opaque,priority:k&&k.priority||0},function(ue){return ue.priority}),this.state.modeGen++,Hi(this)}),removeOverlay:br(function(L){for(var k=this.state.overlays,Y=0;Y<k.length;++Y){var ue=k[Y].modeSpec;if(ue==L||typeof L=="string"&&ue.name==L){k.splice(Y,1),this.state.modeGen++,Hi(this);return}}}),indentLine:br(function(L,k,Y){typeof k!="string"&&typeof k!="number"&&(k==null?k=this.options.smartIndent?"smart":"prev":k=k?"add":"subtract"),Rt(this.doc,L)&&Za(this,L,k,Y)}),indentSelection:br(function(L){for(var k=this.doc.sel.ranges,Y=-1,ue=0;ue<k.length;ue++){var fe=k[ue];if(fe.empty())fe.head.line>Y&&(Za(this,fe.head.line,L,!0),Y=fe.head.line,ue==this.doc.sel.primIndex&&Ea(this));else{var ge=fe.from(),Se=fe.to(),Je=Math.max(Y,ge.line);Y=Math.min(this.lastLine(),Se.line-(Se.ch?0:1))+1;for(var et=Je;et<Y;++et)Za(this,et,L);var ft=this.doc.sel.ranges;ge.ch==0&&k.length==ft.length&&ft[ue].from().ch>0&&Ro(this.doc,ue,new bi(ge,ft[ue].to()),de)}}}),getTokenAt:function(L,k){return Bn(this,L,k)},getLineTokens:function(L,k){return Bn(this,ht(L),k,!0)},getTokenTypeAt:function(L){L=U(this.doc,L);var k=yt(this,ne(this.doc,L.line)),Y=0,ue=(k.length-1)/2,fe=L.ch,ge;if(fe==0)ge=k[2];else for(;;){var Se=Y+ue>>1;if((Se?k[Se*2-1]:0)>=fe)ue=Se;else if(k[Se*2+1]<fe)Y=Se+1;else{ge=k[Se*2+2];break}}var Je=ge?ge.indexOf("overlay "):-1;return Je<0?ge:Je==0?null:ge.slice(0,Je-1)},getModeAt:function(L){var k=this.doc.mode;return k.innerMode?e.innerMode(k,this.getTokenAt(L).state).mode:k},getHelper:function(L,k){return this.getHelpers(L,k)[0]},getHelpers:function(L,k){var Y=[];if(!I.hasOwnProperty(k))return Y;var ue=I[k],fe=this.getModeAt(L);if(typeof fe[k]=="string")ue[fe[k]]&&Y.push(ue[fe[k]]);else if(fe[k])for(var ge=0;ge<fe[k].length;ge++){var Se=ue[fe[k][ge]];Se&&Y.push(Se)}else fe.helperType&&ue[fe.helperType]?Y.push(ue[fe.helperType]):ue[fe.name]&&Y.push(ue[fe.name]);for(var Je=0;Je<ue._global.length;Je++){var et=ue._global[Je];et.pred(fe,this)&&K(Y,et.val)==-1&&Y.push(et.val)}return Y},getStateAfter:function(L,k){var Y=this.doc;return L=ae(Y,L==null?Y.first+Y.size-1:L),Ot(this,L+1,k).state},cursorCoords:function(L,k){var Y,ue=this.doc.sel.primary();return L==null?Y=ue.head:typeof L=="object"?Y=U(this.doc,L):Y=L?ue.from():ue.to(),ri(this,Y,k||"page")},charCoords:function(L,k){return ii(this,U(this.doc,L),k||"page")},coordsChar:function(L,k){return L=pi(this,L,k||"page"),kr(this,L.left,L.top)},lineAtHeight:function(L,k){return L=pi(this,{top:L,left:0},k||"page").top,ot(this.doc,L+this.display.viewOffset)},heightAtLine:function(L,k,Y){var ue=!1,fe;if(typeof L=="number"){var ge=this.doc.first+this.doc.size-1;L<this.doc.first?L=this.doc.first:L>ge&&(L=ge,ue=!0),fe=ne(this.doc,L)}else fe=L;return Tn(this,fe,{top:0,left:0},k||"page",Y||ue).top+(ue?this.doc.height-xr(fe):0)},defaultTextHeight:function(){return xn(this.display)},defaultCharWidth:function(){return Xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(L,k,Y,ue,fe){var ge=this.display;L=ri(this,U(this.doc,L));var Se=L.bottom,Je=L.left;if(k.style.position="absolute",k.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(k),ge.sizer.appendChild(k),ue=="over")Se=L.top;else if(ue=="above"||ue=="near"){var et=Math.max(ge.wrapper.clientHeight,this.doc.height),ft=Math.max(ge.sizer.clientWidth,ge.lineSpace.clientWidth);(ue=="above"||L.bottom+k.offsetHeight>et)&&L.top>k.offsetHeight?Se=L.top-k.offsetHeight:L.bottom+k.offsetHeight<=et&&(Se=L.bottom),Je+k.offsetWidth>ft&&(Je=ft-k.offsetWidth)}k.style.top=Se+"px",k.style.left=k.style.right="",fe=="right"?(Je=ge.sizer.clientWidth-k.offsetWidth,k.style.right="0px"):(fe=="left"?Je=0:fe=="middle"&&(Je=(ge.sizer.clientWidth-k.offsetWidth)/2),k.style.left=Je+"px"),Y&&vo(this,{left:Je,top:Se,right:Je+k.offsetWidth,bottom:Se+k.offsetHeight})},triggerOnKeyDown:br(Ms),triggerOnKeyPress:br(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:br(js),execCommand:function(L){if($a.hasOwnProperty(L))return $a[L].call(null,this)},triggerElectric:br(function(L){Gs(this,L)}),findPosH:function(L,k,Y,ue){var fe=1;k<0&&(fe=-1,k=-k);for(var ge=U(this.doc,L),Se=0;Se<k&&!(ge=jo(this.doc,ge,fe,Y,ue),ge.hitSide);++Se);return ge},moveH:br(function(L,k){var Y=this;this.extendSelectionsBy(function(ue){return Y.display.shift||Y.doc.extend||ue.empty()?jo(Y.doc,ue.head,L,k,Y.options.rtlMoveVisually):L<0?ue.from():ue.to()},we)}),deleteH:br(function(L,k){var Y=this.doc.sel,ue=this.doc;Y.somethingSelected()?ue.replaceSelection("",null,"+delete"):Ra(this,function(fe){var ge=jo(ue,fe.head,L,k,!1);return L<0?{from:ge,to:fe.head}:{from:fe.head,to:ge}})}),findPosV:function(L,k,Y,ue){var fe=1,ge=ue;k<0&&(fe=-1,k=-k);for(var Se=U(this.doc,L),Je=0;Je<k;++Je){var et=ri(this,Se,"div");if(ge==null?ge=et.left:et.left=ge,Se=$s(this,et,fe,Y),Se.hitSide)break}return Se},moveV:br(function(L,k){var Y=this,ue=this.doc,fe=[],ge=!this.display.shift&&!ue.extend&&ue.sel.somethingSelected();if(ue.extendSelectionsBy(function(Je){if(ge)return L<0?Je.from():Je.to();var et=ri(Y,Je.head,"div");Je.goalColumn!=null&&(et.left=Je.goalColumn),fe.push(et.left);var ft=$s(Y,et,L,k);return k=="page"&&Je==ue.sel.primary()&&_o(Y,ii(Y,ft,"div").top-et.top),ft},we),fe.length)for(var Se=0;Se<ue.sel.ranges.length;Se++)ue.sel.ranges[Se].goalColumn=fe[Se]}),findWordAt:function(L){var k=this.doc,Y=ne(k,L.line).text,ue=L.ch,fe=L.ch;if(Y){var ge=this.getHelper(L,"wordChars");(L.sticky=="before"||fe==Y.length)&&ue?--ue:++fe;for(var Se=Y.charAt(ue),Je=He(Se,ge)?function(et){return He(et,ge)}:/\s/.test(Se)?function(et){return/\s/.test(et)}:function(et){return!/\s/.test(et)&&!He(et)};ue>0&&Je(Y.charAt(ue-1));)--ue;for(;fe<Y.length&&Je(Y.charAt(fe));)++fe}return new bi(ht(L.line,ue),ht(L.line,fe))},toggleOverwrite:function(L){if(L!=null&&L==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),qe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:br(function(L,k){Pa(this,L,k)}),getScrollInfo:function(){var L=this.display.scroller;return{left:L.scrollLeft,top:L.scrollTop,height:L.scrollHeight-ui(this)-this.display.barHeight,width:L.scrollWidth-ui(this)-this.display.barWidth,clientHeight:si(this),clientWidth:jn(this)}},scrollIntoView:br(function(L,k){L==null?(L={from:this.doc.sel.primary().head,to:null},k==null&&(k=this.options.cursorScrollMargin)):typeof L=="number"?L={from:ht(L,0),to:null}:L.from==null&&(L={from:L,to:null}),L.to||(L.to=L.from),L.margin=k||0,L.from.line!=null?Qs(this,L):Wo(this,L.from,L.to,L.margin)}),setSize:br(function(L,k){var Y=this,ue=function(ge){return typeof ge=="number"||/^\d+$/.test(String(ge))?ge+"px":ge};L!=null&&(this.display.wrapper.style.width=ue(L)),k!=null&&(this.display.wrapper.style.height=ue(k)),this.options.lineWrapping&&bn(this);var fe=this.display.viewFrom;this.doc.iter(fe,this.display.viewTo,function(ge){if(ge.widgets){for(var Se=0;Se<ge.widgets.length;Se++)if(ge.widgets[Se].noHScroll){pr(Y,fe,"widget");break}}++fe}),this.curOp.forceUpdate=!0,qe(this,"refresh",this)}),operation:function(L){return Pr(this,L)},startOperation:function(){return ga(this)},endOperation:function(){return va(this)},refresh:br(function(){var L=this.display.cachedTextHeight;Hi(this),this.curOp.forceUpdate=!0,un(this),Pa(this,this.doc.scrollLeft,this.doc.scrollTop),Eo(this.display),(L==null||Math.abs(L-xn(this.display))>.5||this.options.lineWrapping)&&wr(this),qe(this,"refresh",this)}),swapDoc:br(function(L){var k=this.doc;return k.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,L),un(this),this.display.input.reset(),Pa(this,L.scrollLeft,L.scrollTop),this.curOp.forceScroll=!0,Xt(this,"swapDoc",this,k),k}),phrase:function(L){var k=this.options.phrases;return k&&Object.prototype.hasOwnProperty.call(k,L)?k[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}},ke(e),e.registerHelper=function(L,k,Y){I.hasOwnProperty(L)||(I[L]=e[L]={_global:[]}),I[L][k]=Y},e.registerGlobalHelper=function(L,k,Y,ue){e.registerHelper(L,k,ue),I[L]._global.push({pred:Y,val:ue})}}function jo(e,u,I,L,k){var Y=u,ue=I,fe=ne(e,u.line),ge=k&&e.direction=="rtl"?-I:I;function Se(){var on=u.line+ge;return on<e.first||on>=e.first+e.size?!1:(u=new ht(on,u.ch,u.sticky),fe=ne(e,on))}function Je(on){var Zt;if(L=="codepoint"){var dn=fe.text.charCodeAt(u.ch+(L>0?0:-1));isNaN(dn)?Zt=null:Zt=new ht(u.line,Math.max(0,Math.min(fe.text.length,u.ch+I*(dn>=55296&&dn<56320?2:1))),-I)}else k?Zt=Ml(e.cm,fe,u,I):Zt=Io(fe,u,I);if(Zt==null)if(!on&&Se())u=Do(k,e.cm,fe,u.line,ge);else return!1;else u=Zt;return!0}if(L=="char"||L=="codepoint")Je();else if(L=="column")Je(!0);else if(L=="word"||L=="group")for(var et=null,ft=L=="group",ut=e.cm&&e.cm.getHelper(u,"wordChars"),Tt=!0;!(I<0&&!Je(!Tt));Tt=!1){var Ut=fe.text.charAt(u.ch)||`
|
|
|
`,Kt=He(Ut,ut)?"w":ft&&Ut==`
|
|
|
`?"n":!ft||/\s/.test(Ut)?null:"p";if(ft&&!Tt&&!Kt&&(Kt="s"),et&&et!=Kt){I<0&&(I=1,Je(),u.sticky="after");break}if(Kt&&(et=Kt),I>0&&!Je(!Tt))break}var qt=so(e,u,Y,ue,!0);return sn(Y,qt)&&(qt.hitSide=!0),qt}function $s(e,u,I,L){var k=e.doc,Y=u.left,ue;if(L=="page"){var fe=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ge=Math.max(fe-.5*xn(e.display),3);ue=(I>0?u.bottom:u.top)+I*ge}else L=="line"&&(ue=I>0?u.bottom+3:u.top-3);for(var Se;!(Se=kr(e,Y,ue),!Se.outside);){if(I<0?ue<=0:ue>=k.height){Se.hitSide=!0;break}ue+=I*5}return Se}var Ti=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new J,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ti.prototype.init=function(e){var u=this,I=this,L=I.cm,k=I.div=e.lineDiv;Xs(k,L.options.spellcheck,L.options.autocorrect,L.options.autocapitalize);function Y(fe){for(var ge=fe.target;ge;ge=ge.parentNode){if(ge==k)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ge.className))break}return!1}Be(k,"paste",function(fe){if(!Y(fe)||Ye(L,fe)||Ks(fe,L))return;O<=11&&setTimeout(ir(L,function(){return u.updateFromDOM()}),20)}),Be(k,"compositionstart",function(fe){u.composing={data:fe.data,done:!1}}),Be(k,"compositionupdate",function(fe){u.composing||(u.composing={data:fe.data,done:!1})}),Be(k,"compositionend",function(fe){u.composing&&(fe.data!=u.composing.data&&u.readFromDOMSoon(),u.composing.done=!0)}),Be(k,"touchstart",function(){return I.forceCompositionEnd()}),Be(k,"input",function(){u.composing||u.readFromDOMSoon()});function ue(fe){if(!Y(fe)||Ye(L,fe))return;if(L.somethingSelected())po({lineWise:!1,text:L.getSelections()}),fe.type=="cut"&&L.replaceSelection("",null,"cut");else if(L.options.lineWiseCopyCut){var ge=Vs(L);po({lineWise:!0,text:ge.text}),fe.type=="cut"&&L.operation(function(){L.setSelections(ge.ranges,0,de),L.replaceSelection("",null,"cut")})}else return;if(fe.clipboardData){fe.clipboardData.clearData();var Se=$r.text.join(`
|
|
|
`);if(fe.clipboardData.setData("Text",Se),fe.clipboardData.getData("Text")==Se){fe.preventDefault();return}}var Je=Ys(),et=Je.firstChild;L.display.lineSpace.insertBefore(Je,L.display.lineSpace.firstChild),et.value=$r.text.join(`
|
|
|
`);var ft=document.activeElement;q(et),setTimeout(function(){L.display.lineSpace.removeChild(Je),ft.focus(),ft==k&&I.showPrimarySelection()},50)}Be(k,"copy",ue),Be(k,"cut",ue)},Ti.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ti.prototype.prepareSelection=function(){var e=Pn(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ti.prototype.showSelection=function(e,u){if(!e||!this.cm.display.view.length)return;(e.focus||u)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ti.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ti.prototype.showPrimarySelection=function(){var e=this.getSelection(),u=this.cm,I=u.doc.sel.primary(),L=I.from(),k=I.to();if(u.display.viewTo==u.display.viewFrom||L.line>=u.display.viewTo||k.line<u.display.viewFrom){e.removeAllRanges();return}var Y=mo(u,e.anchorNode,e.anchorOffset),ue=mo(u,e.focusNode,e.focusOffset);if(Y&&!Y.bad&&ue&&!ue.bad&&Dt(rn(Y,ue),L)==0&&Dt(hn(Y,ue),k)==0)return;var fe=u.display.view,ge=L.line>=u.display.viewFrom&&Js(u,L)||{node:fe[0].measure.map[2],offset:0},Se=k.line<u.display.viewTo&&Js(u,k);if(!Se){var Je=fe[fe.length-1].measure,et=Je.maps?Je.maps[Je.maps.length-1]:Je.map;Se={node:et[et.length-1],offset:et[et.length-2]-et[et.length-3]}}if(!ge||!Se){e.removeAllRanges();return}var ft=e.rangeCount&&e.getRangeAt(0),ut;try{ut=w(ge.node,ge.offset,Se.offset,Se.node)}catch(Tt){}ut&&(!W&&u.state.focused?(e.collapse(ge.node,ge.offset),ut.collapsed||(e.removeAllRanges(),e.addRange(ut))):(e.removeAllRanges(),e.addRange(ut)),ft&&e.anchorNode==null?e.addRange(ft):W&&this.startGracePeriod()),this.rememberSelection()},Ti.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ti.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},Ti.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ti.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var u=e.getRangeAt(0).commonAncestorContainer;return R(this.div,u)},Ti.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ti.prototype.blur=function(){this.div.blur()},Ti.prototype.getField=function(){return this.div},Ti.prototype.supportsTouch=function(){return!0},Ti.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Pr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function u(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,u))}this.polling.set(this.cm.options.pollInterval,u)},Ti.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ti.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),u=this.cm;if(a&&c&&this.cm.display.gutterSpecs.length&&tu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var I=mo(u,e.anchorNode,e.anchorOffset),L=mo(u,e.focusNode,e.focusOffset);I&&L&&Pr(u,function(){mr(u.doc,sa(I,L),de),(I.bad||L.bad)&&(u.curOp.selectionChanged=!0)})},Ti.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,u=e.display,I=e.doc.sel.primary(),L=I.from(),k=I.to();if(L.ch==0&&L.line>e.firstLine()&&(L=ht(L.line-1,ne(e.doc,L.line-1).length)),k.ch==ne(e.doc,k.line).text.length&&k.line<e.lastLine()&&(k=ht(k.line+1,0)),L.line<u.viewFrom||k.line>u.viewTo-1)return!1;var Y,ue,fe;L.line==u.viewFrom||(Y=tr(e,L.line))==0?(ue=Qe(u.view[0].line),fe=u.view[0].node):(ue=Qe(u.view[Y].line),fe=u.view[Y-1].node.nextSibling);var ge=tr(e,k.line),Se,Je;if(ge==u.view.length-1?(Se=u.viewTo-1,Je=u.lineDiv.lastChild):(Se=Qe(u.view[ge+1].line)-1,Je=u.view[ge+1].node.previousSibling),!fe)return!1;for(var et=e.doc.splitLines(nu(e,fe,Je,ue,Se)),ft=oe(e.doc,ht(ue,0),ht(Se,ne(e.doc,Se).text.length));et.length>1&&ft.length>1;)if(Ke(et)==Ke(ft))et.pop(),ft.pop(),Se--;else if(et[0]==ft[0])et.shift(),ft.shift(),ue++;else break;for(var ut=0,Tt=0,Ut=et[0],Kt=ft[0],qt=Math.min(Ut.length,Kt.length);ut<qt&&Ut.charCodeAt(ut)==Kt.charCodeAt(ut);)++ut;for(var on=Ke(et),Zt=Ke(ft),dn=Math.min(on.length-(et.length==1?ut:0),Zt.length-(ft.length==1?ut:0));Tt<dn&&on.charCodeAt(on.length-Tt-1)==Zt.charCodeAt(Zt.length-Tt-1);)++Tt;if(et.length==1&&ft.length==1&&ue==L.line)for(;ut&&ut>L.ch&&on.charCodeAt(on.length-Tt-1)==Zt.charCodeAt(Zt.length-Tt-1);)ut--,Tt++;et[et.length-1]=on.slice(0,on.length-Tt).replace(/^\u200b+/,""),et[0]=et[0].slice(ut).replace(/\u200b+$/,"");var On=ht(ue,ut),yn=ht(Se,ft.length?Ke(ft).length-Tt:0);if(et.length>1||et[0]||Dt(On,yn))return Ca(e.doc,et,On,yn,"+input"),!0},Ti.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ti.prototype.reset=function(){this.forceCompositionEnd()},Ti.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ti.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)},Ti.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pr(this.cm,function(){return Hi(e.cm)})},Ti.prototype.setUneditable=function(e){e.contentEditable="false"},Ti.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ir(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ti.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ti.prototype.onContextMenu=function(){},Ti.prototype.resetPosition=function(){},Ti.prototype.needsContentAttribute=!0;function Js(e,u){var I=yi(e,u.line);if(!I||I.hidden)return null;var L=ne(e.doc,u.line),k=Vt(I,L,u.line),Y=dt(L,e.doc.direction),ue="left";if(Y){var fe=xe(Y,u.ch);ue=fe%2?"right":"left"}var ge=gn(k.map,u.ch,ue);return ge.offset=ge.collapse=="right"?ge.end:ge.start,ge}function tu(e){for(var u=e;u;u=u.parentNode)if(/CodeMirror-gutter-wrapper/.test(u.className))return!0;return!1}function Ia(e,u){return u&&(e.bad=!0),e}function nu(e,u,I,L,k){var Y="",ue=!1,fe=e.doc.lineSeparator(),ge=!1;function Se(ut){return function(Tt){return Tt.id==ut}}function Je(){ue&&(Y+=fe,ge&&(Y+=fe),ue=ge=!1)}function et(ut){ut&&(Je(),Y+=ut)}function ft(ut){if(ut.nodeType==1){var Tt=ut.getAttribute("cm-text");if(Tt){et(Tt);return}var Ut=ut.getAttribute("cm-marker"),Kt;if(Ut){var qt=e.findMarks(ht(L,0),ht(k+1,0),Se(+Ut));qt.length&&(Kt=qt[0].find(0))&&et(oe(e.doc,Kt.from,Kt.to).join(fe));return}if(ut.getAttribute("contenteditable")=="false")return;var on=/^(pre|div|p|li|table|br)$/i.test(ut.nodeName);if(!/^br$/i.test(ut.nodeName)&&ut.textContent.length==0)return;on&&Je();for(var Zt=0;Zt<ut.childNodes.length;Zt++)ft(ut.childNodes[Zt]);/^(pre|p)$/i.test(ut.nodeName)&&(ge=!0),on&&(ue=!0)}else ut.nodeType==3&&et(ut.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ft(u),u==I);)u=u.nextSibling,ge=!1;return Y}function mo(e,u,I){var L;if(u==e.display.lineDiv){if(L=e.display.lineDiv.childNodes[I],!L)return Ia(e.clipPos(ht(e.display.viewTo-1)),!0);u=null,I=0}else for(L=u;;L=L.parentNode){if(!L||L==e.display.lineDiv)return null;if(L.parentNode&&L.parentNode==e.display.lineDiv)break}for(var k=0;k<e.display.view.length;k++){var Y=e.display.view[k];if(Y.node==L)return iu(Y,u,I)}}function iu(e,u,I){var L=e.text.firstChild,k=!1;if(!u||!R(L,u))return Ia(ht(Qe(e.line),0),!0);if(u==L&&(k=!0,u=L.childNodes[I],I=0,!u)){var Y=e.rest?Ke(e.rest):e.line;return Ia(ht(Qe(Y),Y.text.length),k)}var ue=u.nodeType==3?u:null,fe=u;for(!ue&&u.childNodes.length==1&&u.firstChild.nodeType==3&&(ue=u.firstChild,I&&(I=ue.nodeValue.length));fe.parentNode!=L;)fe=fe.parentNode;var ge=e.measure,Se=ge.maps;function Je(Kt,qt,on){for(var Zt=-1;Zt<(Se?Se.length:0);Zt++)for(var dn=Zt<0?ge.map:Se[Zt],On=0;On<dn.length;On+=3){var yn=dn[On+2];if(yn==Kt||yn==qt){var ei=Qe(Zt<0?e.line:e.rest[Zt]),Ii=dn[On]+on;return(on<0||yn!=Kt)&&(Ii=dn[On+(on?1:0)]),ht(ei,Ii)}}}var et=Je(ue,fe,I);if(et)return Ia(et,k);for(var ft=fe.nextSibling,ut=ue?ue.nodeValue.length-I:0;ft;ft=ft.nextSibling){if(et=Je(ft,ft.firstChild,0),et)return Ia(ht(et.line,et.ch-ut),k);ut+=ft.textContent.length}for(var Tt=fe.previousSibling,Ut=I;Tt;Tt=Tt.previousSibling){if(et=Je(Tt,Tt.firstChild,-1),et)return Ia(ht(et.line,et.ch+Ut),k);Ut+=Tt.textContent.length}}var Ki=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new J,this.hasSelection=!1,this.composing=null};Ki.prototype.init=function(e){var u=this,I=this,L=this.cm;this.createField(e);var k=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),l&&(k.style.width="0px"),Be(k,"input",function(){A&&O>=9&&u.hasSelection&&(u.hasSelection=null),I.poll()}),Be(k,"paste",function(ue){if(Ye(L,ue)||Ks(ue,L))return;L.state.pasteIncoming=+new Date,I.fastPoll()});function Y(ue){if(Ye(L,ue))return;if(L.somethingSelected())po({lineWise:!1,text:L.getSelections()});else if(L.options.lineWiseCopyCut){var fe=Vs(L);po({lineWise:!0,text:fe.text}),ue.type=="cut"?L.setSelections(fe.ranges,null,de):(I.prevInput="",k.value=fe.text.join(`
|
|
|
`),q(k))}else return;ue.type=="cut"&&(L.state.cutIncoming=+new Date)}Be(k,"cut",Y),Be(k,"copy",Y),Be(e.scroller,"paste",function(ue){if(fi(e,ue)||Ye(L,ue))return;if(!k.dispatchEvent){L.state.pasteIncoming=+new Date,I.focus();return}var fe=new Event("paste");fe.clipboardData=ue.clipboardData,k.dispatchEvent(fe)}),Be(e.lineSpace,"selectstart",function(ue){fi(e,ue)||be(ue)}),Be(k,"compositionstart",function(){var ue=L.getCursor("from");I.composing&&I.composing.range.clear(),I.composing={start:ue,range:L.markText(ue,L.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(k,"compositionend",function(){I.composing&&(I.poll(),I.composing.range.clear(),I.composing=null)})},Ki.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Ki.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ki.prototype.prepareSelection=function(){var e=this.cm,u=e.display,I=e.doc,L=Pn(e);if(e.options.moveInputWithCursor){var k=ri(e,I.sel.primary().head,"div"),Y=u.wrapper.getBoundingClientRect(),ue=u.lineDiv.getBoundingClientRect();L.teTop=Math.max(0,Math.min(u.wrapper.clientHeight-10,k.top+ue.top-Y.top)),L.teLeft=Math.max(0,Math.min(u.wrapper.clientWidth-10,k.left+ue.left-Y.left))}return L},Ki.prototype.showSelection=function(e){var u=this.cm,I=u.display;h(I.cursorDiv,e.cursors),h(I.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ki.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var u=this.cm;if(u.somethingSelected()){this.prevInput="";var I=u.getSelection();this.textarea.value=I,u.state.focused&&q(this.textarea),A&&O>=9&&(this.hasSelection=I)}else e||(this.prevInput=this.textarea.value="",A&&O>=9&&(this.hasSelection=null))},Ki.prototype.getField=function(){return this.textarea},Ki.prototype.supportsTouch=function(){return!1},Ki.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ki.prototype.blur=function(){this.textarea.blur()},Ki.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ki.prototype.receivedFocus=function(){this.slowPoll()},Ki.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()})},Ki.prototype.fastPoll=function(){var e=!1,u=this;u.pollingFast=!0;function I(){var L=u.poll();!L&&!e?(e=!0,u.polling.set(60,I)):(u.pollingFast=!1,u.slowPoll())}u.polling.set(20,I)},Ki.prototype.poll=function(){var e=this,u=this.cm,I=this.textarea,L=this.prevInput;if(this.contextMenuPending||!u.state.focused||gt(I)&&!L&&!this.composing||u.isReadOnly()||u.options.disableInput||u.state.keySeq)return!1;var k=I.value;if(k==L&&!u.somethingSelected())return!1;if(A&&O>=9&&this.hasSelection===k||t&&/[\uf700-\uf7ff]/.test(k))return u.display.input.reset(),!1;if(u.doc.sel==u.display.selForContextMenu){var Y=k.charCodeAt(0);if(Y==8203&&!L&&(L="\u200B"),Y==8666)return this.reset(),this.cm.execCommand("undo")}for(var ue=0,fe=Math.min(L.length,k.length);ue<fe&&L.charCodeAt(ue)==k.charCodeAt(ue);)++ue;return Pr(u,function(){Uo(u,k.slice(ue),L.length-ue,null,e.composing?"*compose":null),k.length>1e3||k.indexOf(`
|
|
|
`)>-1?I.value=e.prevInput="":e.prevInput=k,e.composing&&(e.composing.range.clear(),e.composing.range=u.markText(e.composing.start,u.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ki.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ki.prototype.onKeyPress=function(){A&&O>=9&&(this.hasSelection=null),this.fastPoll()},Ki.prototype.onContextMenu=function(e){var u=this,I=u.cm,L=I.display,k=u.textarea;u.contextMenuPending&&u.contextMenuPending();var Y=yr(I,e),ue=L.scroller.scrollTop;if(!Y||s)return;var fe=I.options.resetSelectionOnContextMenu;fe&&I.doc.sel.contains(Y)==-1&&ir(I,mr)(I.doc,sa(Y),de);var ge=k.style.cssText,Se=u.wrapper.style.cssText,Je=u.wrapper.offsetParent.getBoundingClientRect();u.wrapper.style.cssText="position: static",k.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-Je.top-5)+"px; left: "+(e.clientX-Je.left-5)+`px;
|
|
|
z-index: 1000; background: `+(A?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var et;f&&(et=window.scrollY),L.input.focus(),f&&window.scrollTo(null,et),L.input.reset(),I.somethingSelected()||(k.value=u.prevInput=" "),u.contextMenuPending=ut,L.selForContextMenu=I.doc.sel,clearTimeout(L.detectingSelectAll);function ft(){if(k.selectionStart!=null){var Ut=I.somethingSelected(),Kt="\u200B"+(Ut?k.value:"");k.value="\u21DA",k.value=Kt,u.prevInput=Ut?"":"\u200B",k.selectionStart=1,k.selectionEnd=Kt.length,L.selForContextMenu=I.doc.sel}}function ut(){if(u.contextMenuPending!=ut)return;if(u.contextMenuPending=!1,u.wrapper.style.cssText=Se,k.style.cssText=ge,A&&O<9&&L.scrollbars.setScrollTop(L.scroller.scrollTop=ue),k.selectionStart!=null){(!A||A&&O<9)&&ft();var Ut=0,Kt=function(){L.selForContextMenu==I.doc.sel&&k.selectionStart==0&&k.selectionEnd>0&&u.prevInput=="\u200B"?ir(I,ps)(I):Ut++<10?L.detectingSelectAll=setTimeout(Kt,500):(L.selForContextMenu=null,L.input.reset())};L.detectingSelectAll=setTimeout(Kt,200)}}if(A&&O>=9&&ft(),g){Le(e);var Tt=function(){lt(window,"mouseup",Tt),setTimeout(ut,20)};Be(window,"mouseup",Tt)}else setTimeout(ut,50)},Ki.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ki.prototype.setUneditable=function(){},Ki.prototype.needsContentAttribute=!1;function ru(e,u){if(u=u?M(u):{},u.value=e.value,!u.tabindex&&e.tabIndex&&(u.tabindex=e.tabIndex),!u.placeholder&&e.placeholder&&(u.placeholder=e.placeholder),u.autofocus==null){var I=N();u.autofocus=I==e||e.getAttribute("autofocus")!=null&&I==document.body}function L(){e.value=fe.getValue()}var k;if(e.form&&(Be(e.form,"submit",L),!u.leaveSubmitMethodAlone)){var Y=e.form;k=Y.submit;try{var ue=Y.submit=function(){L(),Y.submit=k,Y.submit(),Y.submit=ue}}catch(ge){}}u.finishInit=function(ge){ge.save=L,ge.getTextArea=function(){return e},ge.toTextArea=function(){ge.toTextArea=isNaN,L(),e.parentNode.removeChild(ge.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",L),!u.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=k))}},e.style.display="none";var fe=Pi(function(ge){return e.parentNode.insertBefore(ge,e.nextSibling)},u);return fe}function au(e){e.off=lt,e.on=Be,e.wheelEventPixels=hl,e.Doc=Tr,e.splitLines=pt,e.countColumn=G,e.findColumn=Ie,e.isWordChar=We,e.Pass=le,e.signal=qe,e.Line=_r,e.changeEnd=la,e.scrollbarModel=Ko,e.Pos=ht,e.cmpPos=Dt,e.modes=vt,e.mimeModes=st,e.resolveMode=Ze,e.getMode=mt,e.modeExtensions=Lt,e.extendMode=Mt,e.copyState=$t,e.startState=ve,e.innerMode=Re,e.commands=$a,e.keyMap=ta,e.keyName=Ls,e.isModifierKey=As,e.lookupKey=Aa,e.normalizeKeyMap=Pl,e.StringStream=X,e.SharedTextMarker=Va,e.TextMarker=ca,e.LineWidget=Ga,e.e_preventDefault=be,e.e_stopPropagation=Ce,e.e_stop=Le,e.addClass=F,e.contains=R,e.rmClass=_,e.keyNames=da}Jl(Pi),eu(Pi);var ou="iter insert remove copy getEditor constructor".split(" ");for(var go in Tr.prototype)Tr.prototype.hasOwnProperty(go)&&K(ou,go)<0&&(Pi.prototype[go]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tr.prototype[go]));return ke(Tr),Pi.inputStyles={textarea:Ki,contenteditable:Ti},Pi.defineMode=function(e){!Pi.defaults.mode&&e!="null"&&(Pi.defaults.mode=e),It.apply(this,arguments)},Pi.defineMIME=Pt,Pi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Pi.defineMIME("text/plain","null"),Pi.defineExtension=function(e,u){Pi.prototype[e]=u},Pi.defineDocExtension=function(e,u){Tr.prototype[e]=u},Pi.fromTextArea=ru,au(Pi),Pi.version="5.58.2",Pi})},W7jJ:function(nt,Xe,V){"use strict";V.r(Xe);var ce=V("0Owb"),ie=V("PpiC"),W=V("OaEy"),C=V("2fM7"),D=V("T2oS"),T=V("W9HT"),A=V("miYZ"),O=V("tsqr"),f=V("2qtc"),p=V("kLXV"),c=V("9og8"),s=V("tJVT"),n=V("k1fw"),o=V("aHsQ"),r=V("sGsY"),l=V("WmNS"),a=V.n(l),i=V("cDcd"),t=V.n(i),d=V("Fvcw"),v=V("GIiI"),y=V("Ty5D"),b=V("9kvl"),g=V("55Ip"),m=V("7qur"),_=V("cDPC"),x=V("m3rI"),h=V("RCxd"),E=V("EHPI"),S=V("J66h"),w=V("uMZB"),R=V.n(w),N=V("sNtx"),F=V("RpDr"),z=V("+L6B"),q=V("2/Rp"),B=V("y8nQ"),M=V("Vl3Y"),G=V("5NDa"),J=V("5rEg"),K=J.a.TextArea,Z=5e3,le=function(ct){var xt=ct.callback,zt=ct.onCancel,Ht=ct.notes;function en(Xt){xt(Xt)}return t.a.createElement(M.a,{className:"note-form-panel",onFinish:en,initialValues:{notes:Ht}},t.a.createElement(M.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:Z,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(Z)}]},t.a.createElement(K,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),t.a.createElement(M.a.Item,{style:{textAlign:"right"}},t.a.createElement(q.a,{type:"ghost",onClick:zt,style:{marginRight:10}}," \u53D6\u6D88 "),t.a.createElement(q.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},de=V("ZsLC"),Te=V.n(de),we=V("DjyN"),Ie=V("NUBc"),_e=V("g9YV"),ye=V("wCAj"),Ke=V("Hw79"),Me=V.n(Ke),Fe=V("ye1Q"),Ge=V("lfch"),Ee=V("bdLU"),me=V("1vsH"),We=V("wd/R"),He=V.n(We),it=ye.a.Column,re=function(ct){var xt=ct.submitResult,zt=ct.submitting,Ht=ct.submitRecords,en=ct.page,Xt=ct.onPageChange,Et=ct.topicId,bt=xt||{},Jt=bt.status,wt=bt.id,cn=bt.input,Ft=bt.output,pn=bt.expected_output,Yn=bt.is_file,Ln=bt.input_file_url,Sn=bt.output_file_url,Zn=bt.expected_output_file_url,In=bt.error_msg,$n=Ht||{},Kn=$n.records,fi=$n.records_count,ti=Object(y.i)();function Ei(){Yn?navigator.clipboard.writeText(S.Base64.decode(In)).then(function(){O.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(S.Base64.decode(Ft)).then(function(){O.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return t.a.createElement(T.a,{spinning:zt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:t.a.createElement(Fe.a,{style:{fontSize:24},spin:!0})},wt?t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:Me.a.info},t.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",t.a.createElement("span",{className:Jt===Ee.a.OK?"c-green":"c-red"},F.a[Jt])),t.a.createElement("li",{className:Me.a.error},t.a.createElement("a",{onClick:Ei},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",t.a.createElement(Ge.a,null)," ")),t.a.createElement("li",null,t.a.createElement(g.a,{to:"/problems/".concat(Et,"/record-detail/").concat(wt,"?backId=").concat(ti==null?void 0:ti.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),Jt!==Ee.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,!Yn&&cn,Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.y)(Ln,cn)}},cn)),t.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,(Jt===4||Jt===5)&&S.Base64.decode(In),Jt!=4&&Jt!=5&&(Yn?t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.y)(Sn,Ft)}},Ft):S.Base64.decode(Ft))),t.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),t.a.createElement("pre",null,!Yn&&S.Base64.decode(pn),Yn&&t.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(me.y)(Zn,pn)}},pn))):null):null,(Kn==null?void 0:Kn.length)>0?t.a.createElement(ye.a,{dataSource:Kn,rowKey:"id",pagination:!1},t.a.createElement(it,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(ui,jn){return t.a.createElement("span",null," ",He()(ui).format("YYYY-MM-DD HH:mm:ss"))}}),t.a.createElement(it,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(ui,jn){var si;return t.a.createElement(g.a,{className:ui===0?"c-green":"c-red",to:"/problems/".concat(Et,"/record-detail/").concat(jn.id,"?backId=").concat(ti==null?void 0:ti.save_identifier)},(si=F.a[ui])===null||si===void 0?void 0:si.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),t.a.createElement(it,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),t.a.createElement(it,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),t.a.createElement(it,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,fi>15?t.a.createElement(Ie.a,{className:Me.a.pagination,current:en,pageSize:15,total:fi,onChange:Xt}):null)},P=V("BdwD"),j=V("DYRE"),ee=V("zeV3"),$=V("+BJd"),Q=V("mr32"),xe=V("TcMa"),De=V.n(xe),dt=V("9Bee"),Ne={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Be=function(ct){var xt=ct.hack,zt=ct.onTriggerPraise,Ht=ct.toDiscuss,en=xt.language,Xt=xt.difficulty,Et=xt.time_limit,bt=xt.username,Jt=xt.user_path,wt=xt.user_praise,cn=xt.comments_count,Ft=xt.praises_count,pn=xt.description,Yn=xt.pass_count,Ln=xt.submit_count,Sn=Object(y.h)();console.log(xt.language,"language");var Zn=Ne[Xt];return t.a.createElement(t.a.Fragment,null,t.a.createElement("ul",{className:De.a.info},t.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",t.a.createElement(Q.a,{color:Zn.color},Zn.name)),t.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",t.a.createElement("b",null,Et,"\u79D2"))),t.a.createElement(dt.a,{value:pn,className:De.a.desc}),t.a.createElement("ul",{className:De.a["commit-info"]},t.a.createElement("li",null,t.a.createElement(ee.a,{size:4},t.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",t.a.createElement("b",null,Yn))),t.a.createElement("li",null,t.a.createElement(ee.a,{size:4},t.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",t.a.createElement("b",null,Ln))," "),t.a.createElement("li",{style:{flex:"1 0 0"}}),t.a.createElement("li",null,t.a.createElement(ee.a,{size:4},t.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ht})," ",t.a.createElement("b",null,cn))," ")))},tt=V("dhSg"),lt=V("ps8w"),qe=V.n(lt),Ye=V("oBTY"),je=V("M8RZ"),Ue=V("OkW/"),ke=V("ErOA");function be(ct){return Object(ke.c)("comments.json",ct)}function Ce(ct){return Object(ke.f)("/discusses/".concat(ct,"/plus.json"),{container_type:"Discuss",type:1})}function Pe(ct){return Object(ke.f)("comments/reply.json",ct)}function Le(ct){return Object(ke.f)("comments.json",ct)}function Ve(ct){return Object(ke.f)("comments/".concat(ct==null?void 0:ct.id,"/hidden.json"),ct)}function at(ct){return Object(ke.b)("comments/".concat(ct==null?void 0:ct.id,".json"))}var _t=V("GgEA"),kt=V("AMnG"),Bt=V("xKgJ");function jt(ct){var xt=ct.author;return t.a.createElement("a",{href:"/users/".concat(xt.login),target:"_blank"},t.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(x.a.IMG_SERVER,"/images/").concat(xt.image_url),width:"50"}))}function At(ct){var xt=ct.data,zt=ct.index,Ht=ct.parentDiscussIndex,en=ct.user,Xt=ct.onSetActionType,Et=xt.author,bt=xt.can_delete,Jt=xt.content,wt=xt.id,cn=xt.time;function Ft(){Xt({id:wt,index:zt,type:"delete-discuss",parentDiscussIndex:Ht,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var pn=en.admin||bt||Et.user_id===en.user_id;return t.a.createElement("div",{className:"discuss-item-container second-discuss "},t.a.createElement(jt,{author:Et}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(Et.login),target:"_blank"},Et.name),t.a.createElement("span",{className:"grey"},cn),t.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},pn?t.a.createElement("a",{onClick:Ft,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),t.a.createElement(dt.a,{className:"discuss-content",value:Jt})))}var pt=function(ct){var xt=ct.user,zt=ct.data,Ht=ct.index,en=ct.onPlusDiscuss,Xt=ct.onSetActionType,Et=ct.activeDiscussIndex,bt=ct.onReplyDiscuss,Jt=ct.onSetActiveDiscussIndex,wt=zt.content,cn=zt.children,Ft=zt.hidden,pn=zt.id,Yn=zt.praise_count,Ln=zt.time,Sn=zt.user_praise,Zn=zt.can_delete,In=zt.author;console.log(Zn&&(!cn||cn.length==0),"children22");function $n(){Jt(pn)}function Kn(){en(pn,!Sn,Ht)}function fi(){Xt({id:pn,index:Ht,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function ti(){Xt({id:pn,index:Ht,params:{hidden:Ft?"0":"1"},type:"hidden-discuss",message:Ft?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var Ei=xt.admin||xt.user_id===In.user_id;return t.a.createElement("div",{className:"discuss-item-container",key:pn},t.a.createElement(jt,{author:In}),t.a.createElement("section",null,t.a.createElement("div",{className:"discuss-info"},t.a.createElement("a",{href:"/users/".concat(In.login),target:"_blank"}," ",In.name," "),t.a.createElement("span",{className:"grey"},Ln)),t.a.createElement(dt.a,{className:"discuss-content",value:wt}),cn&&cn.length>0?t.a.createElement("div",{className:"reply-discuss-container"},cn.map(function(Ci,ui){return t.a.createElement(At,{key:Ci.id,data:Ci,index:ui,user:xt,onSetActionType:Xt,parentDiscussIndex:Ht})})):null,t.a.createElement("div",{className:"btn-group"},Object(Bt.v)()?t.a.createElement("a",{onClick:ti,title:Ft?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},t.a.createElement("i",{className:Ft?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Zn&&(!cn||cn.length==0)?t.a.createElement("a",{onClick:fi,title:"\u5220\u9664"},t.a.createElement("i",{className:"iconfont icon-shanchu"})):null,t.a.createElement("a",{onClick:$n,title:"\u56DE\u590D"}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," "),t.a.createElement("a",{onClick:Kn,className:Sn?"c-orange":""},t.a.createElement("i",{className:Sn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),t.a.createElement("span",null,Yn||""))),t.a.createElement(kt.a,{id:pn,activeDiscussIndex:Et,onReplyDiscuss:bt})))},gt=V("kaH+"),rt=V("Wx9E"),Oe=V("Ot1p"),ze=function(ct){var xt=ct.user_praise,zt=ct.praise_count,Ht=ct.praisePlus,en=ct.onCreateDiscuss,Xt=ct.discuss_count,Et=Object(i.useState)(!1),bt=Object(s.a)(Et,2),Jt=bt[0],wt=bt[1],cn=Object(i.useState)(""),Ft=Object(s.a)(cn,2),pn=Ft[0],Yn=Ft[1];function Ln(Kn){Yn(Kn)}function Sn(){wt(!0)}function Zn(){wt(!1)}function In(){return $n.apply(this,arguments)}function $n(){return $n=Object(c.a)(a.a.mark(function Kn(){return a.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:en(pn),Yn(""),wt(!1);case 3:case"end":return ti.stop()}},Kn)})),$n.apply(this,arguments)}return t.a.createElement("div",{className:"dis-input-editor-container ".concat(Jt?"active":""," ")},t.a.createElement("div",{className:Jt?"text-area hide":"text-area"},t.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Sn}),t.a.createElement("a",{style:{alignItems:"center"}}," ",t.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Xt," "),t.a.createElement("a",{className:"c-light-black",onClick:Ht,style:{alignItems:"center"},title:xt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},t.a.createElement("i",{className:"mr3 ".concat(xt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),zt?t.a.createElement("span",null,zt):"")),Jt?t.a.createElement("div",{className:"input-mask",onClick:Zn}):null,t.a.createElement("div",{className:Jt?"md-container":"md-container hide"},t.a.createElement(Oe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:pn,height:240,onChange:Ln}),t.a.createElement("div",{className:"tip-container",onClick:Zn},t.a.createElement("a",{className:"btn-send",onClick:In}," \u53D1\u9001 "))))},vt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},st;(function(ct){ct[ct.GET_DISCUSSES=0]="GET_DISCUSSES",ct[ct.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",ct[ct.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",ct[ct.PLUS_DISCUSS=3]="PLUS_DISCUSS",ct[ct.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",ct[ct.SET_PAGE=5]="SET_PAGE",ct[ct.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(st||(st={}));function It(ct,xt){switch(xt.type){case st.SHOW_DISCUSSES_LOADING:return Object(n.a)(Object(n.a)({},ct),{},{loading:!0});case st.GET_DISCUSSES:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.TOP_OR_DOWN_DISCUSS:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.SET_ACTION_TYPE:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.PLUS_DISCUSS:return Object(n.a)(Object(n.a)({},ct),xt.payload);case st.SET_PAGE:return Object(n.a)(Object(n.a)({},ct),{},{page:xt.payload});case st.ACTIVE_DISCUSS_INDEX:return Object(n.a)(Object(n.a)({},ct),xt.payload);default:throw new Error}}var Pt=function(ct){var xt=ct.user,zt=ct.identifier,Ht=ct.hack,en=ct.onTriggerPraise,Xt=ct.setDiscussTotal,Et=Object(i.useReducer)(It,vt),bt=Object(s.a)(Et,2),Jt=bt[0],wt=bt[1],cn=Jt.loading,Ft=Jt.page,pn=Jt.data,Yn=Jt.count,Ln=Jt.actionType,Sn=Jt.activeDiscussIndex,Zn=Object(i.useCallback)(Object(c.a)(a.a.mark(function _n(){var ci,yi,li;return a.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return wt({type:st.SHOW_DISCUSSES_LOADING}),Jn.next=3,be({container_type:"Practice",container_identifier:zt,limit:10,page:Ft});case 3:ci=Jn.sent,yi=ci.comments,li=ci.disscuss_count,wt({type:st.GET_DISCUSSES,payload:{data:yi,count:li,loading:!1}}),Xt(li);case 7:case"end":return Jn.stop()}},_n)})),[Ft,zt]);Object(i.useEffect)(function(){Zn()},[zt,Ft]);function In(_n){wt({type:st.SET_PAGE,page:_n})}function $n(_n){wt({type:st.SET_ACTION_TYPE,payload:{actionType:_n}})}function Kn(_n){Sn===_n?wt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):wt({type:st.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:_n}})}function fi(_n,ci,yi){return ti.apply(this,arguments)}function ti(){return ti=Object(c.a)(a.a.mark(function _n(ci,yi,li){var Dn;return a.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.prev=0,gn.next=3,Ce(ci);case 3:Dn=gn.sent,pn[li].user_praise=yi,pn[li].praise_count=Dn.praise_count,wt({type:st.PLUS_DISCUSS,payload:{data:Object(Ye.a)(pn)}}),gn.next=12;break;case 9:gn.prev=9,gn.t0=gn.catch(0),console.log(gn.t0);case 12:case"end":return gn.stop()}},_n,null,[[0,9]])})),ti.apply(this,arguments)}function Ei(){return Ci.apply(this,arguments)}function Ci(){return Ci=Object(c.a)(a.a.mark(function _n(){var ci,yi,li,Dn,Jn;return a.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if(ci=Ln.id,yi=Ln.params,li=Ln.type,Dn=Ln.index,Jn=Ln.parentDiscussIndex,!(li==="hidden-discuss")){An.next=7;break}return console.log(yi,"params"),An.next=5,Ve(Object(n.a)({id:ci,container_type:"Practice",container_identifier:zt},yi));case 5:Jn?pn[Jn].children[Dn].hidden=yi.hidden==1:pn[Dn].hidden=yi.hidden==1,wt({type:st.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Ye.a)(pn)}});case 7:if(!(li==="delete-discuss")){An.next=13;break}return An.next=10,at({id:ci,container_type:"Practice",container_identifier:zt});case 10:return wt({type:st.SET_ACTION_TYPE,payload:{actionType:null}}),An.next=13,Zn();case 13:case"end":return An.stop()}},_n)})),Ci.apply(this,arguments)}function ui(){wt({type:st.SET_ACTION_TYPE,payload:{actionType:null}})}function jn(_n,ci){return si.apply(this,arguments)}function si(){return si=Object(c.a)(a.a.mark(function _n(ci,yi){return a.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return Dn.prev=0,Dn.next=3,Pe({container_type:"Practice",container_identifier:zt,comments:{content:yi,parent_id:ci}});case 3:Zn(),Dn.next=9;break;case 6:Dn.prev=6,Dn.t0=Dn.catch(0),console.log(Dn.t0);case 9:case"end":return Dn.stop()}},_n,null,[[0,6]])})),si.apply(this,arguments)}function Fn(_n){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(c.a)(a.a.mark(function _n(ci){return a.a.wrap(function(li){for(;;)switch(li.prev=li.next){case 0:return wt({type:st.SHOW_DISCUSSES_LOADING}),li.next=3,Le({comments:{content:ci},container_type:"Practice",container_identifier:zt});case 3:Zn();case 4:case"end":return li.stop()}},_n)})),Vt.apply(this,arguments)}return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:"discuss-panel"},pn.length===0?t.a.createElement(P.a,null):pn.map(function(_n,ci){return t.a.createElement(pt,{onReplyDiscuss:jn,onPlusDiscuss:fi,onSetActiveDiscussIndex:Kn,onSetActionType:$n,data:_n,index:ci,user:xt,activeDiscussIndex:Sn})}),Yn>10?t.a.createElement("div",{className:"pagination-container"},t.a.createElement(Ie.a,{showQuickJumper:!0,onChange:In,current:Ft,total:Yn})):null),t.a.createElement(ze,{user_praise:Ht.user_praise,praise_count:Ht.praises_count,praisePlus:en,discuss_count:Ht.comments_count,onCreateDiscuss:Fn}),t.a.createElement(je.a,null,t.a.createElement(p.a,{centered:!0,title:"\u63D0\u793A",visible:!!Ln,onOk:Ei,onCancel:ui},t.a.createElement("p",null,Ln?Ln.message:"")),t.a.createElement(gt.a,null)))},Ze=V("1FX+"),mt=V.n(Ze),Lt=V("pYxM"),Mt=V.n(Lt),$t=V("sB/4"),Re=V.n($t),ve=V("Wtmd"),X=V.n(ve),ne=V("CNDd"),oe=V.n(ne),he=V("nCk5"),Ae=V.n(he),Qe=V("kovY"),ot=V.n(Qe),Rt=function(xt){var zt=xt.style,Ht=zt===void 0?{}:zt,en=xt.onClick,Xt=xt.onAssist,Et=xt.onHide,bt=xt.data,Jt=xt.active,wt=xt.showLine;return t.a.createElement(t.a.Fragment,null,t.a.createElement("div",{className:Jt===(bt==null?void 0:bt.id)?"".concat(Mt.a.list," ").concat(Mt.a.active):Mt.a.list,style:Ht,onClick:function(){return en(bt)}},(bt==null?void 0:bt.video)&&t.a.createElement("div",{className:Mt.a.left},t.a.createElement("img",{src:bt==null?void 0:bt.video_cover}),t.a.createElement("div",null,t.a.createElement("img",{src:Re.a}),t.a.createElement("span",null,bt==null?void 0:bt.video_duration)),t.a.createElement("div",{className:Mt.a.mask})),t.a.createElement("div",{className:Mt.a.right},t.a.createElement("div",{className:Mt.a.name},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(bt==null?void 0:bt.image_url),width:30,height:30}),t.a.createElement("div",{title:bt==null?void 0:bt.name,className:Mt.a.title},bt==null?void 0:bt.name),(bt==null?void 0:bt.is_authority)&&t.a.createElement("div",{className:Mt.a.b},"\u5B98\u65B9"),(bt==null?void 0:bt.is_excellent)&&t.a.createElement("div",{className:Mt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Mt.a.des},t.a.createElement(dt.a,{showLines:2,showTextOnly:!0,value:(bt==null?void 0:bt.content)||"\u6682\u65E0\u5185\u5BB9"})),t.a.createElement("div",{className:Mt.a.tag},t.a.createElement("span",{className:"current",onClick:function(Ft){Ft.stopPropagation(),Xt(bt)}},t.a.createElement("img",{src:bt!=null&&bt.user_liker?oe.a:X.a}),t.a.createElement("span",{style:{color:bt!=null&&bt.user_liker?"#0152d9":"#656f87"}},bt==null?void 0:bt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ae.a}),t.a.createElement("span",null,bt==null?void 0:bt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:ot.a}),t.a.createElement("span",null,bt==null?void 0:bt.viewed_count)),Object(Bt.v)()&&t.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Ft){Ft.stopPropagation(),Et(bt)}},bt!=null&&bt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),wt&&t.a.createElement("div",{className:Mt.a.line}))},Nt=Rt,ht=V("5Dmo"),Dt=V("3S7+"),sn=V("Z8dc"),Ct=V.n(sn),hn=V("Aky1"),rn=V("7+5b"),ae=V.n(rn),U=V("twBr"),H=V.n(U),te=V("oE5q"),pe=V.n(te),se=function(xt,zt){var Ht,en,Xt,Et=zt.payload.uploadInfo,bt=Et===void 0?{}:Et;switch(zt.type){case"addVideo":return{videoList:[].concat(Object(Ye.a)(xt.videoList),[{name:bt.file.name,size:bt.file.size,type:bt.file.type,fileHash:bt.fileHash,state:bt.state,video_id:bt.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:xt.videoList.filter(function(Jt){return Jt.name!==zt.payload.name})};case"replaceVideo":return{videoList:zt.payload};case"removeAll":return[];case"updateProgress":return{videoList:xt.videoList.map(function(Jt){return Jt.name===zt.payload.uploadInfo.file.name?Object(n.a)(Object(n.a)({},Jt),{loaded:zt.payload.progressPercent,video_id:bt.videoId,fileHash:bt.fileHash}):Jt})};case"updateTitle":return{videoList:(Ht=xt.videoList)===null||Ht===void 0?void 0:Ht.map(function(Jt){return Jt.name===zt.payload.item.name?Object(n.a)(Object(n.a)({},Jt),{title:zt.payload.title}):Jt})};case"updateImg":return{videoList:(en=xt.videoList)===null||en===void 0?void 0:en.map(function(Jt){return Jt.name===zt.payload.item.name?Object(n.a)(Object(n.a)({},Jt),{attachment_id:zt.payload.attachment_id}):Jt})};case"updateImg":return{videoList:(Xt=xt.videoList)===null||Xt===void 0?void 0:Xt.map(function(Jt){return Jt.name===zt.payload.item.name?Object(n.a)(Object(n.a)({},Jt),{attachment_id:zt.payload.attachment_id}):Jt})};default:return[]}},$e=function(xt){var zt,Ht,en=xt.onClose,Xt=xt.onOk,Et=xt.identifier,bt=xt.active,Jt=M.a.useForm(),wt=Object(s.a)(Jt,1),cn=wt[0],Ft=Object(i.useState)({}),pn=Object(s.a)(Ft,2),Yn=pn[0],Ln=pn[1],Sn=Object(i.useState)(!1),Zn=Object(s.a)(Sn,2),In=Zn[0],$n=Zn[1],Kn=Object(i.useState)(!1),fi=Object(s.a)(Kn,2),ti=fi[0],Ei=fi[1],Ci=Object(i.useReducer)(se,{videoList:[]}),ui=Object(s.a)(Ci,2),jn=ui[0],si=ui[1],Fn=Object(Bt.x)(),Vt=Object(y.i)(),_n=Object(i.useRef)();Object(i.useEffect)(function(){bt&&ci()},[bt]);var ci=function(){var En=Object(c.a)(a.a.mark(function kn(){var Tn,pi,ii,ri,ki,Xi,kr,er,Ur,Gr,Vr,Wr;return a.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(m.k)(Et,{active:bt});case 2:Tn=Vn.sent,(Tn==null?void 0:Tn.status)===0&&(Xi={name:Tn==null||((pi=Tn.data)===null||pi===void 0)?void 0:pi.name,content:Tn==null||((ii=Tn.data)===null||ii===void 0)?void 0:ii.content},cn.setFieldsValue(Xi),Ln(Xi),Tn!=null&&(ri=Tn.data)!==null&&ri!==void 0&&(ki=ri.videos)!==null&&ki!==void 0&&ki[0]&&si({type:"replaceVideo",payload:[{video_id:Tn==null||((kr=Tn.data)===null||kr===void 0||((er=kr.videos)===null||er===void 0||((Ur=er[0])===null||Ur===void 0)))?void 0:Ur.video_id,name:Tn==null||((Gr=Tn.data)===null||Gr===void 0||((Vr=Gr.videos)===null||Vr===void 0||((Wr=Vr[0])===null||Wr===void 0)))?void 0:Wr.title,loaded:100}]}));case 4:case"end":return Vn.stop()}},kn)}));return function(){return En.apply(this,arguments)}}(),yi=function(kn,Tn){Ln(Object(n.a)({},Tn))},li=function(){var En=Object(c.a)(a.a.mark(function kn(Tn){var pi,ii,ri,ki,Xi;return a.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:if(ii={videos:jn.videoList,articles:Tn},Ei(!0),!bt){er.next=9;break}return ii.active=bt,er.next=6,Object(m.j)(Et,ii);case 6:ri=er.sent,er.next=12;break;case 9:return er.next=11,Object(m.a)(Et,ii);case 11:ri=er.sent;case 12:((pi=ri)===null||pi===void 0?void 0:pi.status)===0&&(console.log(bt||((ki=ri)===null||ki===void 0?void 0:ki.id),44),Xt(bt||((Xi=ri)===null||Xi===void 0?void 0:Xi.id))),Ei(!1);case 14:case"end":return er.stop()}},kn)}));return function(Tn){return En.apply(this,arguments)}}(),Dn=function(){var kn=document.getElementById("fileUpload");kn.value=""},Jn=function(kn){var Tn='{"Vod":{}}';if($n(!0),_n.current){_n.current.addFile(kn,null,null,null,Tn);return}Object(hn.a)(Fn==null?void 0:Fn.login,"",{create:!_n,addFileSuccess:function(ii){si({type:"addVideo",payload:{uploadInfo:ii}})},onUploadProgress:function(ii,ri,ki){var Xi=Math.ceil(ki*100);si({type:"updateProgress",payload:{uploadInfo:ii,progressPercent:Xi}}),Dn()},onUploadFailed:function(ii){O.b.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002")},onUploadEnd:function(ii){$n(!1)},onUploadSucceed:function(ii){$n(!1)},onUploadError:function(ii){$n(!1)},gotUploader:function(ii){ii.addFile(kn,null,null,null,Tn),_n.current=ii}})},gn=function(kn){var Tn,pi=1024,ii=kn.target.files[0];if(!ii){Dn();return}var ri=ii.name.toLowerCase();if(ri&&ri.indexOf(".avi")==-1&&ri.indexOf(".flv")==-1&&ri.indexOf(".f4v")==-1&&ri.indexOf(".m4v")==-1&&ri.indexOf(".mov")==-1&&ri.indexOf(".mp4")==-1&&ri.indexOf(".rmvb")==-1&&ri.indexOf(".swf")==-1&&ri.indexOf(".webm")==-1&&ri.indexOf(".wmv")==-1){O.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),Dn();return}if(ii.size>pi*1024*1024){O.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(pi,"M")),Dn();return}if((Tn=jn.videoList)!==null&&Tn!==void 0&&Tn.find(function(ki){return ki.name===ii.name})){O.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),Dn();return}Jn(ii)},An=function(kn,Tn){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",Tn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){Dn(),si({type:"removeVideo",payload:{name:kn}})}})},Gt=function(){return t.a.createElement("label",{htmlFor:"fileUpload",className:Ct.a.main},t.a.createElement("img",{src:ae.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891"))},Qt=function(kn){return t.a.createElement("div",{className:Ct.a.mainLoading},t.a.createElement("div",{className:Ct.a.proWarp},t.a.createElement("div",{className:Ct.a.pro},t.a.createElement("div",{style:{width:kn}})),t.a.createElement("span",null,kn||0,"%")),t.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),t.a.createElement("div",{className:Ct.a.tip},t.a.createElement(Dt.a,{getPopupContainer:function(pi){return pi.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:pe.a,alt:""}))))},an=function(kn){return t.a.createElement("div",{className:Ct.a.mainSucceed},t.a.createElement("img",{src:H.a,alt:""}),t.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),t.a.createElement("div",{className:Ct.a.tip},t.a.createElement(Dt.a,{getPopupContainer:function(pi){return pi.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:pe.a,alt:""}))),t.a.createElement("div",{className:Ct.a.del,onClick:function(){return An(kn.name,kn.loaded==100)}},t.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},bn=function(){var kn;return t.a.createElement(t.a.Fragment,null,(kn=jn.videoList)===null||kn===void 0?void 0:kn.map(function(Tn,pi){return t.a.createElement(t.a.Fragment,{key:pi},Tn.loaded==100?an(Tn):Qt(Tn.loaded))}))},un=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:en})},Gn=(zt=jn.videoList)===null||zt===void 0?void 0:zt.length;return t.a.createElement("div",{className:Ct.a.listForm},t.a.createElement("header",null,bt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),t.a.createElement("section",{className:Ct.a.scroll,id:"sss"},t.a.createElement("div",{className:Ct.a.formWrap}," ",t.a.createElement(M.a,{form:cn,scrollToFirstError:!0,layout:"vertical",onValuesChange:yi,onFinish:li},t.a.createElement(M.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(J.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ht=Yn.name)===null||Ht===void 0?void 0:Ht.length)||0,"/60")})),t.a.createElement(M.a.Item,{name:"content",label:"\u5185\u5BB9:"},t.a.createElement(Oe.a,{defaultValue:Yn.content||"",watch:!0})))),t.a.createElement("div",{className:Ct.a.upload},Gn?bn():Gt(),t.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:gn,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:Ct.a.btns},t.a.createElement(q.a,{onClick:un,type:"primary",ghost:!0},"\u5173\u95ED"),t.a.createElement(q.a,{loading:ti,disabled:In,onClick:function(){return cn.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},yt=$e,Ot=V("cWXX"),Yt=V("/ezw"),St=V("CaVn"),Wt=V.n(St),ln=V("s8/Y"),Bn=V.n(ln),Oi=V("JOrW"),mi=V.n(Oi),Wn=V("gqXR"),di=V.n(Wn),hr=V("14J3"),vi=V("BMrR"),gi=V("jCWc"),xi=V("kPKH"),Bi=V("wW8i"),Ai=V.n(Bi),sr=V("MVJL"),Di=V.n(sr),fr=function(xt){var zt=xt.id,Ht=xt.cb,en=Object(i.useState)(""),Xt=Object(s.a)(en,2),Et=Xt[0],bt=Xt[1];return t.a.createElement("aside",{className:"mt10"},t.a.createElement(Oe.a,{defaultValue:Et,id:"writeForumsReviewId",onChange:function(wt){bt(wt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(vi.a,null,t.a.createElement(xi.a,{flex:"1"}),t.a.createElement(xi.a,null,t.a.createElement(q.a,{type:"primary",size:"large",onClick:Object(c.a)(a.a.mark(function Jt(){return a.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:Et===""?O.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):Ht(zt,Et);case 1:case"end":return cn.stop()}},Jt)}))},"\u53D1\u9001"))))},lr=function(xt){var zt,Ht=xt.data;return t.a.createElement("div",{className:Di.a.thirdlyLevelDiscuss},t.a.createElement("span",{className:"c-grey-333"},t.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null||((zt=Ht.author)===null||zt===void 0)?void 0:zt.name),"@",t.a.createElement("span",{className:"font 14 c-light-primary"},Ht==null?void 0:Ht.parent_name),":"),t.a.createElement(dt.a,{value:Ht==null?void 0:Ht.content}))},Wi=function(xt){var zt,Ht,en,Xt,Et=xt.data,bt=xt.onReplyDiscuss,Jt=xt.thirdlyReply,wt=xt.setThirdlyReply,cn=Object(Bt.x)();return console.log(cn,"user"),t.a.createElement("div",{className:Di.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Et==null||((zt=Et.author)===null||zt===void 0)?void 0:zt.image_url)}),t.a.createElement("div",{className:Di.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333"},Et==null||((Ht=Et.author)===null||Ht===void 0)?void 0:Ht.name),(cn==null?void 0:cn.login)!==(Et==null||((en=Et.author)===null||en===void 0)?void 0:en.login)&&t.a.createElement("span",{onClick:function(){return wt(Et==null?void 0:Et.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(dt.a,{value:Et==null?void 0:Et.content}),Et==null||((Xt=Et.children)===null||Xt===void 0)?void 0:Xt.map(function(Ft){return t.a.createElement(lr,{key:Ft.id,data:Ft})}),Jt===(Et==null?void 0:Et.id)&&t.a.createElement("div",null,t.a.createElement(fr,{id:Et==null?void 0:Et.id,cb:bt}),t.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return wt(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:Di.a.line})))},Gi=function(xt){var zt,Ht,en,Xt,Et=xt.data,bt=xt.onReplyDiscuss,Jt=xt.secondReply,wt=xt.setSecondReply,cn=xt.thirdlyReply,Ft=xt.setThirdlyReply,pn=xt.onPlusDiscuss,Yn=Object(i.useState)(!1),Ln=Object(s.a)(Yn,2),Sn=Ln[0],Zn=Ln[1];return console.log(Et,"data"),t.a.createElement("div",{className:Di.a.discussItem},t.a.createElement("div",{className:Di.a.list},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Et==null||((zt=Et.author)===null||zt===void 0)?void 0:zt.image_url)}),t.a.createElement("div",{className:Di.a.wrap},t.a.createElement("div",{className:"font14",style:{marginBottom:6}},t.a.createElement("span",{className:"c-grey-333 mr30"},Et==null||((Ht=Et.author)===null||Ht===void 0)?void 0:Ht.name),t.a.createElement("span",{className:"c-grey-999"},Et==null?void 0:Et.time)),t.a.createElement(dt.a,{value:Et==null?void 0:Et.content}),t.a.createElement("div",{className:Di.a.btns},t.a.createElement("div",{onClick:function(){return pn(Et==null?void 0:Et.id)},className:Et!=null&&Et.user_praise?"c-light-primary":"c-grey-999"},t.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),t.a.createElement("span",null,Et==null?void 0:Et.praise_count)),t.a.createElement("div",{onClick:function(){var $n;if((Et==null||(($n=Et.children)===null||$n===void 0)?void 0:$n.length)===0)return;wt(null),Zn(!Sn)},style:{color:Sn?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),t.a.createElement("span",null,Sn?"\u6536\u8D77\u8BC4\u8BBA":Et==null||((en=Et.children)===null||en===void 0)?void 0:en.length)),t.a.createElement("div",{onClick:function(){Zn(!1),wt(Jt===(Et==null?void 0:Et.id)?null:Et==null?void 0:Et.id)},style:{color:Jt===(Et==null?void 0:Et.id)?"#0152d9":"#999999"}},t.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),t.a.createElement("span",null,Jt===(Et==null?void 0:Et.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),Jt===(Et==null?void 0:Et.id)&&t.a.createElement(fr,{id:Et==null?void 0:Et.id,cb:function($n,Kn){bt($n,Kn),Zn(!0)}}),Sn&&t.a.createElement("div",{className:Di.a.secondLevelDiscuss},Et==null||((Xt=Et.children)===null||Xt===void 0)?void 0:Xt.map(function(In){return t.a.createElement(Wi,{thirdlyReply:cn,setThirdlyReply:Ft,key:In.id,data:In,onReplyDiscuss:bt})})))))},vr=Gi,Rr=function(xt){var zt=xt.identifier,Ht=xt.active,en=xt.onOk,Xt=Object(i.useState)(""),Et=Object(s.a)(Xt,2),bt=Et[0],Jt=Et[1],wt=Object(i.useState)(1),cn=Object(s.a)(wt,2),Ft=cn[0],pn=cn[1],Yn=Object(i.useState)([]),Ln=Object(s.a)(Yn,2),Sn=Ln[0],Zn=Ln[1],In=Object(i.useState)(0),$n=Object(s.a)(In,2),Kn=$n[0],fi=$n[1],ti=Object(i.useState)(null),Ei=Object(s.a)(ti,2),Ci=Ei[0],ui=Ei[1],jn=Object(i.useState)(null),si=Object(s.a)(jn,2),Fn=si[0],Vt=si[1];Object(i.useEffect)(function(){_n(1),pn(1)},[Ht]);var _n=function(){var Jn=Object(c.a)(a.a.mark(function gn(An){var Gt;return a.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,be({container_type:"QuestionSolutionArticle",container_identifier:Ht,limit:5,page:An});case 2:Gt=an.sent,Gt!=null&&Gt.comments&&(Zn((Gt==null?void 0:Gt.comments)||[]),pn(An),fi(Gt==null?void 0:Gt.disscuss_count));case 4:case"end":return an.stop()}},gn)}));return function(An){return Jn.apply(this,arguments)}}(),ci=function(){var Jn=Object(c.a)(a.a.mark(function gn(){var An;return a.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(!(bt==="")){Qt.next=3;break}return O.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Qt.abrupt("return");case 3:return Qt.next=5,Le({comments:{content:bt},container_type:"QuestionSolutionArticle",container_identifier:Ht});case 5:An=Qt.sent,An!=null&&An.discuss&&(Jt(""),_n(Ft),en());case 7:case"end":return Qt.stop()}},gn)}));return function(){return Jn.apply(this,arguments)}}(),yi=function(){var Jn=Object(c.a)(a.a.mark(function gn(An,Gt,Qt){var an;return a.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Pe({container_type:"QuestionSolutionArticle",container_identifier:Ht,comments:{content:Gt,parent_id:An}});case 2:an=un.sent,ui(null),Vt(null),_n(Ft);case 6:case"end":return un.stop()}},gn)}));return function(An,Gt,Qt){return Jn.apply(this,arguments)}}(),li=function(){var Jn=Object(c.a)(a.a.mark(function gn(An){var Gt;return a.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Ce(An);case 2:Gt=an.sent,_n(Ft);case 4:case"end":return an.stop()}},gn)}));return function(An){return Jn.apply(this,arguments)}}(),Dn=function(gn){pn(gn),_n(gn)};return t.a.createElement("div",{className:Ai.a.discuss},t.a.createElement("aside",{className:Ai.a.reply,style:{borderWidth:Kn?1:0}},t.a.createElement(Oe.a,{defaultValue:bt,id:"writeForumsReviewId",onChange:function(gn){Jt(gn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),t.a.createElement(vi.a,null,t.a.createElement(xi.a,{flex:"1"}),t.a.createElement(xi.a,null,t.a.createElement(q.a,{type:"primary",size:"large",onClick:function(){return ci()}},"\u53D1\u9001")))),Sn==null?void 0:Sn.map(function(Jn){return t.a.createElement(vr,{secondReply:Ci,setSecondReply:ui,thirdlyReply:Fn,setThirdlyReply:Vt,key:Jn.id,data:Jn,onReplyDiscuss:yi,onPlusDiscuss:li})}),t.a.createElement(Ie.a,{className:Ai.a.pagination,showTotal:function(gn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},gn),"\u6761\u6570\u636E")},current:Ft,onChange:Dn,total:Kn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},ur=Rr,Hn=V("hgre"),wn=function(xt){var zt,Ht,en,Xt,Et,bt,Jt,wt,cn,Ft,pn=xt.active,Yn=xt.identifier,Ln=xt.onAssist,Sn=xt.onEdit,Zn=xt.onArticlesSkip,In=xt.onClose,$n=xt.onOk,Kn=xt.onDelete,fi=xt.detailsIndex,ti=xt.btnShowStatus,Ei=Object(i.useState)(!0),Ci=Object(s.a)(Ei,2),ui=Ci[0],jn=Ci[1],si=Object(i.useState)({}),Fn=Object(s.a)(si,2),Vt=Fn[0],_n=Fn[1];Object(i.useEffect)(function(){pn&&ci()},[pn,fi]);var ci=function(){var gn=Object(c.a)(a.a.mark(function An(){var Gt,Qt,an=arguments;return a.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return Gt=an.length>0&&an[0]!==void 0?an[0]:!0,Gt&&jn(!0),un.next=4,Object(m.d)(Yn,{active:pn});case 4:Qt=un.sent,(Qt==null?void 0:Qt.status)===0&&_n((Qt==null?void 0:Qt.data)||{}),jn(!1);case 7:case"end":return un.stop()}},An)}));return function(){return gn.apply(this,arguments)}}(),yi=function(){var gn=Object(c.a)(a.a.mark(function An(Gt){var Qt;return a.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(m.g)(Yn,Object(n.a)({active:pn},Gt));case 2:Qt=bn.sent,(Qt==null?void 0:Qt.status)===0&&(ci(!1),$n());case 4:case"end":return bn.stop()}},An)}));return function(Gt){return gn.apply(this,arguments)}}(),li=function(){var gn=Object(c.a)(a.a.mark(function An(Gt){var Qt;return a.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(m.c)(Yn,{active:Gt==null?void 0:Gt.id});case 2:Qt=bn.sent,Qt.status===0&&(ci(!1),$n());case 4:case"end":return bn.stop()}},An)}));return function(Gt){return gn.apply(this,arguments)}}(),Dn=function(An){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 Kn(An)}})},Jn=function(){ci(!1),$n()};return t.a.createElement("div",{className:Wt.a.listDetails},t.a.createElement(Yt.a,{className:"pt20 pl20 pr20",loading:ui,active:!0,paragraph:{rows:5}},t.a.createElement("div",{className:Wt.a.head},t.a.createElement("div",{className:Wt.a.name},t.a.createElement("div",{title:Vt==null?void 0:Vt.name,className:Wt.a.title},Vt==null?void 0:Vt.name),(Vt==null?void 0:Vt.is_authority)&&t.a.createElement("div",{className:Wt.a.b},"\u5B98\u65B9"),(Vt==null?void 0:Vt.is_excellent)&&t.a.createElement("div",{className:Wt.a.a},"\u7CBE\u9009")),t.a.createElement("div",{className:Wt.a.tag},t.a.createElement("img",{src:x.a.IMG_SERVER+"/images/"+(Vt==null?void 0:Vt.image_url)}),t.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Vt==null?void 0:Vt.username),t.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",He()(Vt==null?void 0:Vt.created_at).format("YYYY-MM-DD")),t.a.createElement("span",null,t.a.createElement("img",{src:X.a}),t.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),t.a.createElement("span",null,t.a.createElement("img",{src:Ae.a}),t.a.createElement("span",null,Vt==null?void 0:Vt.discusses_count)),t.a.createElement("span",null,t.a.createElement("img",{src:ot.a}),t.a.createElement("span",null,Vt==null?void 0:Vt.viewed_count)),t.a.createElement("div",{className:Wt.a.btn},(Object(Bt.v)()||(Vt==null?void 0:Vt.is_self))&&t.a.createElement(t.a.Fragment,null,t.a.createElement(q.a,{onClick:function(){return Dn(Vt)},type:"primary",ghost:!0},"\u5220\u9664"),t.a.createElement(q.a,{onClick:function(){return Sn(Vt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Bt.v)()&&t.a.createElement(q.a,{onClick:function(){return yi({is_authority:!(Vt!=null&&Vt.is_authority)})},type:"primary"},t.a.createElement("img",{src:mi.a}),Vt!=null&&Vt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Bt.v)()&&t.a.createElement(q.a,{onClick:function(){return yi({is_excellent:!(Vt!=null&&Vt.is_excellent)})},type:"primary"},t.a.createElement("img",{src:Bn.a}),Vt!=null&&Vt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),t.a.createElement("div",{className:Wt.a.scroll},(Vt==null||((zt=Vt.videos)===null||zt===void 0||((Ht=zt[0])===null||Ht===void 0))?void 0:Ht.id)&&t.a.createElement("div",{className:Wt.a.video},t.a.createElement(T.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Vt!=null&&(en=Vt.videos)!==null&&en!==void 0&&(Xt=en[0])!==null&&Xt!==void 0&&Xt.transcoded)},t.a.createElement(Hn.a,{poster:Vt==null||((Et=Vt.videos)===null||Et===void 0||((bt=Et[0])===null||bt===void 0))?void 0:bt.cover_url,src:(Vt==null||((Jt=Vt.videos)===null||Jt===void 0||((wt=Jt[0])===null||wt===void 0))?void 0:wt.play_url)||"",videoId:Vt==null||((cn=Vt.videos)===null||cn===void 0||((Ft=cn[0])===null||Ft===void 0))?void 0:Ft.id,logWatchHistory:function(){}}))),t.a.createElement(dt.a,{className:Wt.a.html,value:(Vt==null?void 0:Vt.content)||""}),t.a.createElement("div",{onClick:function(){return li(Vt)},className:Wt.a.g},t.a.createElement("img",{className:"mr10",src:(Vt!=null&&Vt.user_liker,di.a)}),t.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),t.a.createElement(ur,{onOk:Jn,active:pn,identifier:Yn})),t.a.createElement("div",{className:Wt.a.btns},t.a.createElement(q.a,{onClick:function(){return In()},type:"primary",ghost:!0},"\u5173\u95ED"),ti[0]&&t.a.createElement(q.a,{onClick:function(An){return Zn(An,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),ti[1]&&t.a.createElement(q.a,{onClick:function(An){return Zn(An,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},wi=wn,Mn=V("3tLw"),Ri=V.n(Mn),oi=V("ek7X"),Lr=V("0NbB"),Ni=function(xt){var zt=xt.identifier,Ht=xt.tabStatus,en=xt.setFilterListTotal,Xt=xt.setListStatus,Et={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},bt=Object(i.useState)(Object(n.a)({},Et)),Jt=Object(s.a)(bt,2),wt=Jt[0],cn=Jt[1],Ft=Object(i.useState)(!1),pn=Object(s.a)(Ft,2),Yn=pn[0],Ln=pn[1],Sn=Object(i.useState)(0),Zn=Object(s.a)(Sn,2),In=Zn[0],$n=Zn[1],Kn=Object(i.useState)(1),fi=Object(s.a)(Kn,2),ti=fi[0],Ei=fi[1],Ci=Object(i.useState)(null),ui=Object(s.a)(Ci,2),jn=ui[0],si=ui[1],Fn=Object(i.useState)([]),Vt=Object(s.a)(Fn,2),_n=Vt[0],ci=Vt[1],yi=Object(i.useState)([!0,!0]),li=Object(s.a)(yi,2),Dn=li[0],Jn=li[1],gn=Object(i.useState)(0),An=Object(s.a)(gn,2),Gt=An[0],Qt=An[1],an=Object(i.useRef)(null);Object(i.useEffect)(function(){ki()},[Ht]),Object(i.useEffect)(function(){bn()},[jn]),Object(i.useEffect)(function(){Gn(Object(n.a)({},Et)),ki()},[zt]),Object(i.useEffect)(function(){return window.addEventListener("resize",un),Xt(Gt),function(){window.removeEventListener("resize",un)}},[Gt]);var bn=function(){var Vn=Object(c.a)(a.a.mark(function xn(){var Xn,ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:if(jn){Qn.next=3;break}return Jn([!0,!0]),Qn.abrupt("return");case 3:Xn=[!0,!0],ai=_n==null?void 0:_n.findIndex(function(wr){return wr.id===jn}),ai===0&&wt.page===1&&(Xn[0]=!1),(wt.page-1)*wt.limit+(ai+1)===wt.total&&(Xn[1]=!1),Jn(Xn);case 8:case"end":return Qn.stop()}},xn)}));return function(){return Vn.apply(this,arguments)}}(),un=function(){if(Gt){var xn,Xn=window.innerWidth-((xn=an.current)===null||xn===void 0?void 0:xn.clientWidth);$n(Xn)}},Gn=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai,Ui,Qn,wr;return a.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return Ln(!0),tr.next=3,Object(m.f)(zt,Xn);case 3:return ai=tr.sent,(ai==null?void 0:ai.status)===0&&(ci((ai==null||((Ui=ai.data)===null||Ui===void 0)?void 0:Ui.articles)||[]),cn(Object(n.a)(Object(n.a)({},Xn),{},{total:ai==null||((Qn=ai.data)===null||Qn===void 0)?void 0:Qn.articles_count})),en(ai==null||((wr=ai.data)===null||wr===void 0)?void 0:wr.articles_count)),Ln(!1),tr.abrupt("return",ai);case 7:case"end":return tr.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),En=function(){(wt==null?void 0:wt.sort_direction)===null?wt.sort_direction="asc":(wt==null?void 0:wt.sort_direction)==="asc"?wt.sort_direction="desc":(wt==null?void 0:wt.sort_direction)==="desc"&&(wt.sort_direction=null),wt.page=1,ki(),cn(Object(n.a)({},wt)),Gn(wt)},kn=function(){wt.page=1,wt.search=wt==null?void 0:wt.save_search,ki(),cn(Object(n.a)({},wt)),Gn(wt)},Tn=function(){var xn,Xn=document.getElementsByClassName("btn-resize");Xn[0].style.visibility="hidden";var ai=window.innerWidth-((xn=an.current)===null||xn===void 0?void 0:xn.clientWidth);$n(ai)},pi=function(){Tn(),Qt(1)},ii=function(xn){Tn(),si(xn==null?void 0:xn.id),Qt(3)},ri=function(xn){Tn(),si(xn==null?void 0:xn.id),Qt(2)},ki=function(){var xn=document.getElementsByClassName("btn-resize");xn[0].style.visibility="visible",$n(0),Qt(0),si(null)},Xi=function(xn){Qt(3),si(xn),wt.page=1,cn(Object(n.a)({},wt)),Gn(wt)},kr=function(xn){Qt(3),si(xn),cn(Object(n.a)({},wt)),Gn(wt)},er=function(xn){cn(Object(n.a)({},wt)),Gn(wt)},Ur=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(m.c)(zt,{active:Xn==null?void 0:Xn.id});case 2:ai=Qn.sent,ai.status===0&&(Gn(wt),Ei(ti+1));case 4:case"end":return Qn.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),Gr=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(m.e)(zt,{active:Xn==null?void 0:Xn.id});case 2:ai=Qn.sent,ai.status===0&&(Gn(wt),Ei(ti+1));case 4:case"end":return Qn.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),Vr=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn){var ai;return a.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(m.i)(zt,{active:Xn==null?void 0:Xn.id});case 2:ai=Qn.sent,ai.status===0&&(ki(),Gn(wt));case 4:case"end":return Qn.stop()}},xn)}));return function(Xn){return Vn.apply(this,arguments)}}(),Wr=function(xn){wt.page=xn,cn(Object(n.a)({},wt)),Gn(wt)},ba=function(){var Vn=Object(c.a)(a.a.mark(function xn(Xn,ai){var Ui,Qn,wr,yr,tr,Hi,pr,cr,Nn,Rn,qn;return a.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Ui=_n==null?void 0:_n.findIndex(function(Si){return Si.id===jn}),console.log(Ui,ai,22),!(ai==="prev")){Pn.next=21;break}if(!(Ui===void 0)){Pn.next=6;break}return O.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 6:if(!(Ui===0)){Pn.next=19;break}if(!(wt.page===1)){Pn.next=10;break}return O.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 10:if(!(wt.page!==1)){Pn.next=17;break}return wt.page=wt.page-1,cn(Object(n.a)({},wt)),Pn.next=15,Gn(wt);case 15:Qn=Pn.sent,(Qn==null?void 0:Qn.status)===0&&(Hi=Qn==null||((wr=Qn.data)===null||wr===void 0)?void 0:wr.articles[(Qn==null||((yr=Qn.data)===null||yr===void 0||((tr=yr.articles)===null||tr===void 0))?void 0:tr.length)-1],si(Hi==null?void 0:Hi.id),console.log(Xn.target,555));case 17:Pn.next=21;break;case 19:pr=_n[Ui-1],si(pr==null?void 0:pr.id);case 21:if(!(ai==="next")){Pn.next=39;break}if(!(Ui===void 0)){Pn.next=25;break}return O.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 25:if(!((wt.page-1)*wt.limit+(Ui+1)===wt.total)){Pn.next=28;break}return O.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Pn.abrupt("return");case 28:if(!(Ui+1===wt.limit)){Pn.next=37;break}return wt.page=wt.page+1,cn(Object(n.a)({},wt)),Pn.next=33,Gn(wt);case 33:cr=Pn.sent,(cr==null?void 0:cr.status)===0&&(Rn=cr==null||((Nn=cr.data)===null||Nn===void 0)?void 0:Nn.articles[0],si(Rn==null?void 0:Rn.id)),Pn.next=39;break;case 37:qn=_n[Ui+1],si(qn==null?void 0:qn.id);case 39:case"end":return Pn.stop()}},xn)}));return function(Xn,ai){return Vn.apply(this,arguments)}}();return t.a.createElement("div",{className:mt.a.wrap,ref:an},t.a.createElement("div",{className:mt.a.head},t.a.createElement("div",{className:mt.a.sort,onClick:En},t.a.createElement("span",null,"\u6700\u65B0"),t.a.createElement("aside",null,t.a.createElement(oi.a,{style:{color:(wt==null?void 0:wt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),t.a.createElement(Lr.a,{style:{color:(wt==null?void 0:wt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),t.a.createElement(J.a.Search,{value:wt.save_search,className:mt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(xn){wt.save_search=xn.target.value,cn(Object(n.a)({},wt))},onSearch:kn}),t.a.createElement("div",{onClick:pi,className:mt.a.btn},t.a.createElement("img",{src:Ri.a}),"\u5199\u9898\u89E3")),t.a.createElement("div",{className:mt.a.listWarp},t.a.createElement(T.a,{spinning:Yn,className:"mt20"},_n==null?void 0:_n.map(function(Vn,xn){var Xn=!0;return xn+1===_n.length&&xn!==0&&(Xn=!1),t.a.createElement(Nt,{active:jn,key:Vn.id,data:Vn,showLine:Xn,onClick:ii,onAssist:Ur,onHide:Gr})}),(_n==null?void 0:_n.length)===0&&t.a.createElement(P.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),t.a.createElement(Ie.a,{className:mt.a.pagination,showTotal:function(xn){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},xn),"\u6761\u6570\u636E")},total:wt.total,showSizeChanger:!1,current:wt==null?void 0:wt.page,onChange:Wr,hideOnSinglePage:!0,showQuickJumper:!0}),Gt>0&&t.a.createElement("div",{className:mt.a.fixedRight,style:{width:In}},Gt===1&&t.a.createElement(yt,{identifier:zt,onClose:ki,onOk:Xi}),Gt===2&&t.a.createElement(yt,{active:jn,identifier:zt,onClose:ki,onOk:kr}),Gt===3&&t.a.createElement(wi,{btnShowStatus:Dn,onArticlesSkip:ba,detailsIndex:ti,active:jn,identifier:zt,onClose:ki,onOk:er,onEdit:ri,onAssist:Ur,onDelete:Vr})))},Qi=Ni,Br=V("VEzc"),qi=V.n(Br),Kr=function(xt){var zt,Ht=xt.visible,en=xt.onVisible,Xt=xt.value,Et=xt.onChange,bt=xt.setIndex,Jt={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},wt=Object(i.useState)(Jt),cn=Object(s.a)(wt,2),Ft=cn[0],pn=cn[1],Yn=Object(i.useState)([]),Ln=Object(s.a)(Yn,2),Sn=Ln[0],Zn=Ln[1],In=Object(i.useState)([]),$n=Object(s.a)(In,2),Kn=$n[0],fi=$n[1],ti=Object(i.useState)(!1),Ei=Object(s.a)(ti,2),Ci=Ei[0],ui=Ei[1],jn=Object(i.useRef)([]),si=Object(i.useRef)(null),Fn=Object(y.i)();Object(i.useEffect)(function(){return Fn!=null&&Fn.id&&(si.current=setInterval(function(){Vt(30)},3e4)),function(){clearInterval(si.current)}},[]);var Vt=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an){var bn;return a.a.wrap(function(Gn){for(;;)switch(Gn.prev=Gn.next){case 0:return Gn.next=2,Object(m.r)(Fn==null?void 0:Fn.id,{practice_time:an});case 2:bn=Gn.sent;case 3:case"end":return Gn.stop()}},Qt)}));return function(an){return Gt.apply(this,arguments)}}();Object(i.useEffect)(function(){Jn(Ft),li()},[]),Object(i.useEffect)(function(){return window.addEventListener("click",ci),function(){window.removeEventListener("click",ci)}},[Fn==null?void 0:Fn.save_identifier,Ht]),Object(i.useEffect)(function(){var Gt=jn.current.findIndex(function(Gn){return Gn.identifier===(Fn==null?void 0:Fn.save_identifier)}),Qt=jn.current[Gt-1],an=jn.current[Gt+1],bn=document.getElementById("oj-prev"),un=document.getElementById("oj-next");Qt?bn.style.display="block":bn.style.display="none",an?un.style.display="block":un.style.display="none"},[Fn==null?void 0:Fn.save_identifier,jn.current]);var _n=function(Qt,an){if(Qt.id===an)return Qt;for(var bn=0,un=Qt;un=un.parentNode;bn++){if(un.id===an)return un;if(un==document.documentElement)return!1}},ci=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an){var bn,un,Gn;return a.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(!_n(an.target,"oj-drawer")&&Ht&&en(!1),bn=jn.current.findIndex(function(Tn){return Tn.identifier===(Fn==null?void 0:Fn.save_identifier)}),un=jn.current[bn-1],Gn=jn.current[bn+1],!(an.target.id==="oj-prev")){kn.next=14;break}if(!(!un||bn===-1)){kn.next=8;break}return O.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),kn.abrupt("return");case 8:return an.target.style.pointerEvents="none",an.target.style.cursor="not-allowed",kn.next=12,gn(un==null?void 0:un.identifier);case 12:bt("0"),setTimeout(function(){an.target.style.pointerEvents="auto",an.target.style.cursor="pointer"},400);case 14:if(!(an.target.id==="oj-next"||an.target.id==="oj-modal-next")){kn.next=24;break}if(!(!Gn||bn===-1)){kn.next=18;break}return O.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),kn.abrupt("return");case 18:return an.target.style.pointerEvents="none",an.target.style.cursor="not-allowed",kn.next=22,gn(Gn==null?void 0:Gn.identifier);case 22:bt("0"),setTimeout(function(){an.target.style.pointerEvents="auto",an.target.style.cursor="pointer"},400);case 24:case"end":return kn.stop()}},Qt)}));return function(an){return Gt.apply(this,arguments)}}();Object(i.useEffect)(function(){Et(Fn==null?void 0:Fn.save_identifier);var Gt=Kn.findIndex(function(Qt){return Qt.some(function(an){return an.identifier===(Fn==null?void 0:Fn.save_identifier)})});Gt===-1?pn(Object(n.a)(Object(n.a)({},Ft),{},{page:1})):pn(Object(n.a)(Object(n.a)({},Ft),{},{page:Gt+1}))},[Fn==null?void 0:Fn.save_identifier,Kn]);var yi=function(Qt){Ft.page=1,Ft.tag_discipline_id=Qt,pn(Object(n.a)({},Ft)),Jn(Ft)},li=function(){var Gt=Object(c.a)(a.a.mark(function Qt(){var an;return a.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(ke.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:an=un.sent,Zn(an.tag_disciplines||[]);case 4:case"end":return un.stop()}},Qt)}));return function(){return Gt.apply(this,arguments)}}(),Dn=function(Qt){Ft.page=1,Ft.difficulty=typeof Qt=="number"?Qt:null,pn(Object(n.a)({},Ft)),Jn(Ft)},Jn=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an){var bn,un,Gn,En,kn,Tn;return a.a.wrap(function(ii){for(;;)switch(ii.prev=ii.next){case 0:return ui(!0),ii.next=3,Object(m.p)(an);case 3:if(bn=ii.sent,bn!=null&&bn.practices_list){for(Gn=bn==null||((un=bn.practices_list)===null||un===void 0)?void 0:un.length,En=[],kn=0;kn<Gn;kn+=Ft==null?void 0:Ft.per_page)En.push(bn==null||((Tn=bn.practices_list)===null||Tn===void 0)?void 0:Tn.slice(kn,kn+(Ft==null?void 0:Ft.per_page)));pn(Object(n.a)(Object(n.a)({},Ft),{},{total:bn==null?void 0:bn.practices_count})),jn.current=(bn==null?void 0:bn.practices_list)||[],fi(En)}ui(!1);case 6:case"end":return ii.stop()}},Qt)}));return function(an){return Gt.apply(this,arguments)}}(),gn=function(){var Gt=Object(c.a)(a.a.mark(function Qt(an,bn){var un;return a.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(ke.a)("/api/practices/".concat(an,"/start"),{method:"get"});case 2:un=En.sent,(un==null?void 0:un.status)===0&&b.d.push("/problems/".concat(un==null?void 0:un.identifier,"/oj/").concat(an));case 4:case"end":return En.stop()}},Qt)}));return function(an,bn){return Gt.apply(this,arguments)}}(),An=function(Qt){Ft.page=Qt,pn(Object(n.a)({},Ft))};return t.a.createElement("div",{className:qi.a.wrap,id:"oj-drawer",style:{left:Ht?0:-700}},t.a.createElement("div",{className:qi.a.head},t.a.createElement("div",{className:qi.a.title},"\u9898\u76EE\u5217\u8868"),t.a.createElement(J.a.Search,{value:Ft==null?void 0:Ft.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Qt){Ft.save_search=Qt.target.value,pn(Object(n.a)({},Ft))},onSearch:function(){Ft.page=1,Ft.search=Ft.save_search,pn(Object(n.a)({},Ft)),Jn(Ft)}}),t.a.createElement(C.a,{value:Ft==null?void 0:Ft.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Qt){return Qt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:yi},Sn.map(function(Gt){return t.a.createElement(C.a.Option,{key:Gt.id,value:Gt.id},Gt.name)})),t.a.createElement(C.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Qt){return Qt.parentNode},value:Ft==null?void 0:Ft.difficulty,onChange:Dn},t.a.createElement(C.a.Option,{value:1},"\u7B80\u5355"),t.a.createElement(C.a.Option,{value:2},"\u9002\u4E2D"),t.a.createElement(C.a.Option,{value:3},"\u56F0\u96BE"))),t.a.createElement("div",{className:qi.a.content},t.a.createElement(T.a,{spinning:Ci},Kn==null||((zt=Kn[Ft.page-1])===null||zt===void 0)?void 0:zt.map(function(Gt){return t.a.createElement("div",{key:Gt.identifier,className:qi.a.list,onClick:function(an){return gn(Gt.identifier,an)}},t.a.createElement("i",{style:{visibility:Xt===Gt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),t.a.createElement("span",{style:{fontWeight:Xt===Gt.identifier?"bold":400,color:Xt===Gt.identifier?"#ffffff":"#bac4cd"},title:Gt==null?void 0:Gt.name},Gt.name),(Gt==null?void 0:Gt.difficulty)===1&&t.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(Gt==null?void 0:Gt.difficulty)===2&&t.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(Gt==null?void 0:Gt.difficulty)===3&&t.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),t.a.createElement("div",{className:qi.a.footer},t.a.createElement(Ie.a,{showTotal:function(Qt){return t.a.createElement("span",{style:{color:"#656F87"}},"\u5171",t.a.createElement("span",{className:"c-light-primary"},Qt),"\u6761\u6570\u636E")},total:Ft.total,pageSize:Ft==null?void 0:Ft.per_page,current:Ft==null?void 0:Ft.page,showSizeChanger:!1,onChange:An,showQuickJumper:!0,hideOnSinglePage:!0})))},Nr=Kr,Ir=function(ct){var xt,zt=ct.hack,Ht=ct.onTriggerPraise,en=ct.topicId,Xt=ct.page,Et=ct.onPageChange,bt=ct.user,Jt=ct.submitRecords,wt=ct.submitting,cn=ct.submitResult,Ft=Object(y.h)(),pn=Object(i.useState)((Ft==null||((xt=Ft.query)===null||xt===void 0)?void 0:xt.tab)||"0"),Yn=Object(s.a)(pn,2),Ln=Yn[0],Sn=Yn[1],Zn=Object(i.useState)(0),In=Object(s.a)(Zn,2),$n=In[0],Kn=In[1],fi=Object(i.useState)(0),ti=Object(s.a)(fi,2),Ei=ti[0],Ci=ti[1],ui=Object(i.useState)(0),jn=Object(s.a)(ui,2),si=jn[0],Fn=jn[1],Vt=Object(i.useState)(),_n=Object(s.a)(Vt,2),ci=_n[0],yi=_n[1],li=Object(i.useState)(!1),Dn=Object(s.a)(li,2),Jn=Dn[0],gn=Dn[1];function An(Qt){var an=Qt.target.id;if(Ln==="3"&&an!==Ln&&(Ei===1||Ei===2)){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:function(){Sn(an)}});return}Sn(an)}Object(i.useEffect)(function(){var Qt=tt.a.subscribe("to-commit-info",function(){Sn("1")});return Qt},[]);function Gt(){Sn("2")}return t.a.createElement("div",{className:Te.a["left-panel"]},t.a.createElement("ul",{className:"".concat(Te.a["s-navs"]," ").concat(Te.a["bg-white"]," ").concat(Te.a.b1)},t.a.createElement("li",{className:"mr40 current"},t.a.createElement("img",{onClick:function(){return gn(!0)},src:qe.a})),t.a.createElement("li",{className:Te.a["oj-mr"]},t.a.createElement("a",{className:Ln==="0"?Te.a.active:"",id:"0",onClick:An},"\u4EFB\u52A1\u63CF\u8FF0")),t.a.createElement("li",{className:Te.a["oj-mr"]},t.a.createElement("a",{className:Ln==="3"?Te.a.active:"",id:"3",onClick:An},"\u9898\u89E3",si?"(".concat(si,")"):"")),t.a.createElement("li",{className:Te.a["oj-mr"]},t.a.createElement("a",{className:Ln==="2"?Te.a.active:"",id:"2",onClick:An},"\u8BC4\u8BBA",$n?"(".concat($n,")"):"")),t.a.createElement("li",null,t.a.createElement("a",{className:Ln==="1"?Te.a.active:"",id:"1",onClick:An},"\u63D0\u4EA4\u8BB0\u5F55"))),t.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Ln==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},t.a.createElement(Be,{hack:zt,onTriggerPraise:Ht,toDiscuss:Gt})),t.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Ln==="1"?"":"hide")},Jt!=null&&Jt.records_count?t.a.createElement(re,{page:Xt,onPageChange:Et,topicId:en,submitting:wt,submitRecords:Jt,submitResult:cn}):t.a.createElement(P.a,null)),t.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Ln==="2"?"":"hide"),style:{padding:0}},t.a.createElement(Pt,{setDiscussTotal:Kn,user:bt,identifier:zt.identifier,hack:zt,onTriggerPraise:Ht})),t.a.createElement("div",{className:"".concat(Te.a["tab-panel-body"]," ").concat(Ln==="3"?"":"hide"),style:{padding:0}},t.a.createElement(Qi,{setListStatus:Ci,setFilterListTotal:Fn,tabStatus:Ln,identifier:zt.identifier})),t.a.createElement(Nr,{visible:Jn,setIndex:Sn,onVisible:function(an){return gn(an)},value:ci,onChange:function(an){return yi(an)}}))},Jr=V("+aKw"),xr=V("oFv4"),Qr=V.n(xr),qr=V("S/kP"),_r=V.n(qr),ea=V("t/PP"),fn=V.n(ea),Cn=V("LvDl"),mn=V.n(Cn),Un=V("P5Jw"),ni=r.a.Countdown,_i={Java:"java",C:"c",Python:"py","C++":"c"},nn;(function(ct){ct[ct.SET_LOADING=0]="SET_LOADING",ct[ct.GET_DATA=1]="GET_DATA",ct[ct.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",ct[ct.SET_DATA=3]="SET_DATA",ct[ct.SET_DEBUGING=4]="SET_DEBUGING",ct[ct.SET_SUBMITING=5]="SET_SUBMITING",ct[ct.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",ct[ct.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",ct[ct.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",ct[ct.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",ct[ct.SET_PAGE=10]="SET_PAGE",ct[ct.GET_LANGUAGE=11]="GET_LANGUAGE",ct[ct.GET_DRAWER=12]="GET_DRAWER"})(nn||(nn={}));function Li(){return new Date().getTime()}var Zi={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function zn(ct,xt){switch(xt.type){case nn.GET_DATA:return Object(n.a)(Object(n.a)({},ct),xt.payload);case nn.SET_DATA:return Object(n.a)(Object(n.a)({},ct),{},{data:xt.payload});case nn.SET_LOADING:return Object(n.a)(Object(n.a)({},ct),{},{loading:xt.payload});case nn.GET_LANGUAGE:return Object(n.a)(Object(n.a)({},ct),{},{languageList:xt.payload});case nn.GET_DRAWER:return Object(n.a)(Object(n.a)({},ct),{},{drawerData:xt.payload});case nn.SET_SHOW_NOTE:return Object(n.a)(Object(n.a)({},ct),{},{showNote:xt.payload});case nn.SET_DEBUGING:return Object(n.a)(Object(n.a)({},ct),{},{debuging:xt.payload});case nn.SET_SUBMITING:return Object(n.a)(Object(n.a)({},ct),{},{submitting:xt.payload});case nn.GET_SUBMIT_RECORDS:return Object(n.a)(Object(n.a)({},ct),{},{submitRecords:xt.payload});case nn.SET_PAGE:return Object(n.a)(Object(n.a)({},ct),{},{submitRecordPage:xt.payload});case nn.SET_EXECUTE_MESSAGE:return Object(n.a)(Object(n.a)({},ct),{},{executingMessage:xt.payload});case nn.SET_EXECUTE_RESULT:return Object(n.a)(Object(n.a)({},ct),xt.payload);case nn.SET_SUBMIT_RESULT:return Object(n.a)(Object(n.a)({},ct),xt.payload);default:throw new Error}}var Dr=Xe.default=function(ct){var xt,zt,Ht=ct.children,en=Object(i.useReducer)(zn,Zi),Xt=Object(s.a)(en,2),Et=Xt[0],bt=Xt[1],Jt=Object(y.i)(),wt=Jt.id,cn=Object(y.g)(),Ft=Object(y.h)(),pn=Et.languageValue,Yn=Et.languageList,Ln=Et.loading,Sn=Et.data,Zn=Et.debugResult,In=Et.submitResult,$n=Et.submitRecords,Kn=Et.submitRecordPage,fi=Et.showNote,ti=Et.debuging,Ei=Et.submitting,Ci=Et.executingMessage,ui=Object(i.useState)("#FFF"),jn=Object(s.a)(ui,2),si=jn[0],Fn=jn[1],Vt=Object(i.useState)(null),_n=Object(s.a)(Vt,2),ci=_n[0],yi=_n[1],li=Object(i.useState)({}),Dn=Object(s.a)(li,2),Jn=Dn[0],gn=Dn[1],An=Object(i.useState)(!1),Gt=Object(s.a)(An,2),Qt=Gt[0],an=Gt[1],bn=Object(i.useRef)(null),un=Object(i.useRef)(null),Gn=Sn==null?void 0:Sn.user,En=Sn==null?void 0:Sn.hack;Object(i.useEffect)(function(){return Object(b.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(b.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(b.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(b.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(i.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(i.useEffect)(function(){if(Qt){var Nn,Rn=document.getElementById("oj-next"),qn=document.getElementById("oj-modal-next");(Rn==null||((Nn=Rn.style)===null||Nn===void 0)?void 0:Nn.display)==="none"?qn.style.display="none":qn.style.display="block"}},[Qt]),Object(i.useEffect)(function(){function Nn(){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(c.a)(a.a.mark(function qn(){var tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object(m.m)(wt);case 2:tn=vn.sent,tn.status===401?document.location.href="/user/login":(tn.hack=tn.practice,tn.hack.code=S.Base64.decode(tn==null||((Pn=tn.hack)===null||Pn===void 0)?void 0:Pn.code),Yi="".concat(Gn==null?void 0:Gn.login,"-language"),localStorage.getItem(Yi)&&(tn.hack.language=localStorage.getItem(Yi)),un.current=mn.a.cloneDeep(tn),un.current.language=tn==null||((Si=tn.hack)===null||Si===void 0)?void 0:Si.language,bt({type:nn.GET_DATA,payload:{loading:!1,data:tn}}),bt({type:nn.SET_SUBMIT_RESULT,payload:{languageValue:tn==null||((ji=tn.hack)===null||ji===void 0)?void 0:ji.language}}));case 4:case"end":return vn.stop()}},qn)})),Rn.apply(this,arguments)}wt&&Nn()},[wt]),Object(i.useEffect)(function(){bt({type:nn.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),ii(),an(!1)},[wt]),Object(i.useEffect)(function(){clearTimeout(bn.current)},[wt]),Object(i.useEffect)(function(){Tn()},[wt,Kn]);var kn=function(){window.parent.postMessage("backExercise","*")};function Tn(){return pi.apply(this,arguments)}function pi(){return pi=Object(c.a)(a.a.mark(function Nn(){var Rn;return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.prev=0,tn.next=3,Object(m.o)(wt,{limit:15,page:Kn});case 3:Rn=tn.sent,bt({type:nn.GET_SUBMIT_RECORDS,payload:Rn}),tn.next=10;break;case 7:tn.prev=7,tn.t0=tn.catch(0),console.log(tn.t0);case 10:case"end":return tn.stop()}},Nn,null,[[0,7]])})),pi.apply(this,arguments)}function ii(){return ri.apply(this,arguments)}function ri(){return ri=Object(c.a)(a.a.mark(function Nn(){var Rn;return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.prev=0,tn.next=3,Object(m.w)(wt);case 3:Rn=tn.sent,bt({type:nn.GET_LANGUAGE,payload:Rn==null?void 0:Rn.data}),tn.next=10;break;case 7:tn.prev=7,tn.t0=tn.catch(0),console.log(tn.t0);case 10:case"end":return tn.stop()}},Nn,null,[[0,7]])})),ri.apply(this,arguments)}function ki(Nn){bt({type:nn.SET_PAGE,payload:Nn})}function Xi(Nn){return kr.apply(this,arguments)}function kr(){return kr=Object(c.a)(a.a.mark(function Nn(Rn){var qn,tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return ji=((qn=window)===null||qn===void 0||((tn=qn.location)===null||tn===void 0||((Pn=tn.pathname)===null||Pn===void 0||((Si=Pn.split("/"))===null||Si===void 0)))?void 0:Si[2])||wt,vn.next=3,Object(m.v)(ji,Rn||{code:S.Base64.encode(En.code),language:pn});case 3:return Yi=vn.sent,vn.abrupt("return",Yi);case 5:case"end":return vn.stop()}},Nn)})),kr.apply(this,arguments)}function er(){return Ur.apply(this,arguments)}function Ur(){return Ur=Object(c.a)(a.a.mark(function Nn(){var Rn,qn,tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(!Ei){vn.next=2;break}return vn.abrupt("return");case 2:return bt({type:nn.SET_SUBMITING,payload:!0}),vn.prev=3,tt.a.publish("to-commit-info"),vn.next=7,Xi();case 7:if(Rn=vn.sent,!(Rn.status===0)){vn.next=21;break}return Yi=function(){return Yi=Object(c.a)(a.a.mark(function fa(){var Sr,Hr,zr,Xr,aa,oa;return a.a.wrap(function(zi){for(;;)switch(zi.prev=zi.next){case 0:return zi.next=2,Object(m.l)(wt,"submit");case 2:if(Sr=zi.sent,Hr=Sr.status,zr=Sr.data,Xr=Li(),aa=Xr-Si>(Pn+3)*1e3,Hr!==0&&!aa&&setTimeout(ji,1e3),!aa){zi.next=12;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),bt({type:nn.SET_SUBMITING,payload:!1}),zi.abrupt("return");case 12:if(!(Hr===0)){zi.next=19;break}return zr.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),zi.next=16,Object(m.o)(wt,{limit:15,page:Kn});case 16:oa=zi.sent,bt({type:nn.SET_SUBMIT_RESULT,payload:Object(n.a)(Object(n.a)({},Et),{},{submitResult:zr,submitting:!1,submitRecords:oa})}),(zr==null?void 0:zr.status)===0&&an(!0);case 19:case"end":return zi.stop()}},fa)})),Yi.apply(this,arguments)},ji=function(){return Yi.apply(this,arguments)},qn={},vn.next=14,Object(m.s)(wt,qn);case 14:if(tn=vn.sent,!(tn.status===-1)){vn.next=18;break}return window.parent.location.href="/classrooms/".concat(Ft.query.coursesId,"/exercise/").concat(Ft.query.exercisesId,"/detail"),vn.abrupt("return");case 18:Pn=En.time_limit,Si=Li(),ji();case 21:vn.next=26;break;case 23:vn.prev=23,vn.t0=vn.catch(3),bt({type:nn.SET_SUBMITING,payload:!1});case 26:case"end":return vn.stop()}},Nn,null,[[3,23]])})),Ur.apply(this,arguments)}function Gr(){return Vr.apply(this,arguments)}function Vr(){return Vr=Object(c.a)(a.a.mark(function Nn(){var Rn,qn,tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Et.debuging=!0,bt({type:nn.SET_DEBUGING,payload:!0}),vn.prev=2,vn.next=5,Xi();case 5:if(Rn=vn.sent,!(Rn.status===0)){vn.next=21;break}return Yi=function(){return Yi=Object(c.a)(a.a.mark(function fa(){var Sr,Hr,zr,Xr,aa,oa;return a.a.wrap(function(zi){for(;;)switch(zi.prev=zi.next){case 0:return zi.next=2,Object(m.l)(wt,"debug");case 2:if(Sr=zi.sent,Hr=Sr.status,zr=Sr.message,Xr=Sr.data,aa=Li(),oa=aa-Si>(qn+3)*1e3,Hr!==0&&!oa&&(bt({type:nn.SET_EXECUTE_MESSAGE,payload:zr}),setTimeout(ji,1e3)),!oa){zi.next=13;break}return p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),bt({type:nn.SET_DEBUGING,payload:!1}),zi.abrupt("return");case 13:Hr===0&&(bt({type:nn.SET_DEBUGING,payload:!1}),Xr.status===2&&p.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),bt({type:nn.SET_EXECUTE_RESULT,payload:Object(n.a)(Object(n.a)({},Et),{},{debugResult:Xr,debuging:!1})}));case 14:case"end":return zi.stop()}},fa)})),Yi.apply(this,arguments)},ji=function(){return Yi.apply(this,arguments)},qn=En.time_limit,tn={input:encodeURIComponent(Sn.test_case.input)},vn.next=13,Object(m.h)(wt,tn);case 13:if(Pn=vn.sent,!(Pn.status===-1)){vn.next=17;break}return window.parent.location.href="/classrooms/".concat(Ft.query.coursesId,"/exercise/").concat(Ft.query.exercisesId,"/detail"),vn.abrupt("return");case 17:Si=Li(),ji(),vn.next=22;break;case 21:bt({type:nn.SET_DEBUGING,payload:!1});case 22:vn.next=27;break;case 24:vn.prev=24,vn.t0=vn.catch(2),console.log(vn.t0);case 27:return vn.prev=27,vn.finish(27);case 29:case"end":return vn.stop()}},Nn,null,[[2,24,27,29]])})),Vr.apply(this,arguments)}function Wr(Nn){var Rn;clearTimeout(bn.current),bn.current=setTimeout(function(){var qn;Xi({code:S.Base64.encode(Nn),language:un==null||((qn=un.current)===null||qn===void 0)?void 0:qn.language})},2e3),bt({type:nn.SET_DATA,payload:Object(n.a)(Object(n.a)({},un==null?void 0:un.current),{},{hack:Object(n.a)(Object(n.a)({},un==null||((Rn=un.current)===null||Rn===void 0)?void 0:Rn.hack),{},{code:Nn})})})}function ba(Nn){var Rn=Nn.target.value;bt({type:nn.SET_DATA,payload:Object(n.a)(Object(n.a)({},Sn),{},{test_case:{input:Rn}})})}var Vn=function(){var Nn=Object(c.a)(a.a.mark(function Rn(qn){var tn,Pn,Si,ji,Yi;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return bt({type:nn.SET_LOADING,payload:!0}),vn.next=3,Xi();case 3:if(tn=vn.sent,!(tn.status===0)){vn.next=14;break}return bt({type:nn.SET_SUBMIT_RESULT,payload:{languageValue:qn}}),un.current.language=qn,Pn="".concat(Gn==null?void 0:Gn.login,"-language"),localStorage.setItem(Pn,qn),vn.next=11,Object(m.w)(wt);case 11:Si=vn.sent,Si.status===0&&(Yi=Si==null||((ji=Si.data)===null||ji===void 0)?void 0:ji.find(function(ra){return ra.language===qn}),Wr(S.Base64.decode(Yi.code))),setTimeout(function(){bt({type:nn.SET_LOADING,payload:!1})},300);case 14:case"end":return vn.stop()}},Rn)}));return function(qn){return Nn.apply(this,arguments)}}();function xn(){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(c.a)(a.a.mark(function Nn(){var Rn;return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.prev=0,tn.next=3,Object(m.q)(wt,{language:pn});case 3:Rn=tn.sent,Rn.status===401?cn.replace("/login",{from:Ft.pathname}):(Wr(S.Base64.decode(Rn.code)),ii()),tn.next=10;break;case 7:tn.prev=7,tn.t0=tn.catch(0),console.log(tn.t0);case 10:case"end":return tn.stop()}},Nn,null,[[0,7]])})),Xn.apply(this,arguments)}function ai(){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(c.a)(a.a.mark(function Rn(){var qn;return a.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(m.t)(wt,{language:pn});case 2:qn=Pn.sent,qn.status===401?cn.replace("/login",{from:Ft.pathname}):Wr(S.Base64.decode(qn.code));case 4:case"end":return Pn.stop()}},Rn)}))()}})}function Ui(){bt({type:nn.SET_SHOW_NOTE,payload:!0})}function Qn(){bt({type:nn.SET_SHOW_NOTE,payload:!1})}function wr(Nn){return yr.apply(this,arguments)}function yr(){return yr=Object(c.a)(a.a.mark(function Nn(Rn){return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(m.b)(wt,Rn);case 2:bt({type:nn.GET_DATA,payload:{showNote:!1,data:Object(n.a)(Object(n.a)({},Sn),{},{hack:Object(n.a)(Object(n.a)({},En),{},{notes:Rn.notes})})}});case 3:case"end":return tn.stop()}},Nn)})),yr.apply(this,arguments)}var tr={input:Sn==null||((xt=Sn.test_case)===null||xt===void 0)?void 0:xt.input,language:En==null?void 0:En.language,code:En==null?void 0:En.code,title:"main."+_i[En==null?void 0:En.language],modify_code:En==null?void 0:En.modify_code,notes:En==null?void 0:En.notes,debugResult:Zn,debuging:ti,submitting:Ei,executingMessage:Ci,id:wt,languageValue:pn,languageList:Yn,onChangeLanguage:Vn,onCancelNote:Qn,onAddNote:wr,showNote:fi,onShowNote:Ui,onSubmitCode:er,onChangeCode:Wr,onChangeInput:ba,onDebugCode:Gr,onResetCode:xn,onSyncCode:ai,onUpdateCode:Xi};function Hi(){return pr.apply(this,arguments)}function pr(){return pr=Object(c.a)(a.a.mark(function Nn(){var Rn,qn,tn;return a.a.wrap(function(Si){for(;;)switch(Si.prev=Si.next){case 0:return Si.next=2,Object(m.u)(En.id,{container_type:"Hack",type:1});case 2:Rn=Si.sent,qn=Rn.praise_count,tn=Object(n.a)(Object(n.a)({},Sn),{},{hack:Object(n.a)(Object(n.a)({},En),{},{praises_count:qn,user_praise:!En.user_praise})}),bt({type:nn.SET_DATA,payload:tn});case 6:case"end":return Si.stop()}},Nn)})),pr.apply(this,arguments)}var cr={topicId:wt,submitResult:In,submitRecords:$n,submitting:Ei,page:Kn,onPageChange:ki,hack:En,user:Sn==null?void 0:Sn.user,onTriggerPraise:Hi};return console.log(Sn,un==null?void 0:un.current,"data--------"),t.a.createElement(t.a.Fragment,null,t.a.createElement(T.a,{className:"oj-custom-large-spin",size:"large",spinning:Ln},Sn?t.a.createElement("div",{className:"oj-custom-warp"},t.a.createElement("header",{className:R.a.header,style:{minWidth:1200}},t.a.createElement("div",null,t.a.createElement("img",{src:"".concat(x.a.IMG_SERVER,"/images/").concat(Gn.image_url),alt:"user",width:30}),t.a.createElement("span",null,Gn.name)),t.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},t.a.createElement("div",null,En.name),t.a.createElement(Jr.a,{onChange:function(Rn){},className:"font12 c-grey-999"})),t.a.createElement(Un.CopyToClipboard,{text:"".concat((zt=window.location)===null||zt===void 0?void 0:zt.origin,"/problems/").concat(En.identifier,"/share"),onCopy:function(){return O.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},t.a.createElement("span",{className:R.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",t.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),En.edit_privilege?t.a.createElement(g.a,{className:R.a.btn_back,to:"/problems/".concat(En.identifier,"/ojedit"),style:{marginRight:10}}," ",t.a.createElement(d.a,null)," \u7F16\u8F91"):null,t.a.createElement(g.a,{className:R.a.btn_back,onClick:function(){},to:"/problems"}," ",t.a.createElement(v.a,null),"\u9000\u51FA")),t.a.createElement(_.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:t.a.createElement(Ir,cr),rightChild:t.a.createElement(Vi,tr)})):null),t.a.createElement(p.a,{centered:!0,closable:!1,width:680,footer:null,visible:Qt,className:"oj-modal"},t.a.createElement("section",{className:"oj-modal-content"},t.a.createElement("div",{className:"oj-modal-head"},t.a.createElement("img",{src:Qr.a,alt:""}),t.a.createElement("i",{onClick:function(){return an(!1)},className:"iconfont icon-guanbi1"})),t.a.createElement("aside",null,t.a.createElement("img",{className:"mr30",src:fn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",t.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},In==null?void 0:In.execute_time,"s"),"\u4F18\u4E8E",t.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(In==null?void 0:In.time_better_than)||100,"%"),"\u7684\u7528\u6237"),t.a.createElement("aside",{className:"mb50"},t.a.createElement("img",{src:_r.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"},In==null?void 0:In.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"}},(In==null?void 0:In.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 hi(ct){var xt=ct.languageValue,zt=ct.languageList,Ht=ct.onChangeLanguage,en=ct.title,Xt=ct.modify_code,Et=ct.onSyncCode,bt=ct.onShowCodeSetting,Jt=ct.onResetCode,wt=Object(y.h)(),cn=function(){p.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:t.a.createElement(h.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:Jt})};return t.a.createElement("div",{className:"action-bar"},t.a.createElement(C.a,{className:"oj-select",value:xt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ht},zt==null?void 0:zt.map(function(Ft){return t.a.createElement(C.a.Option,{key:Ft.language,value:Ft.language},Ft.language)})),t.a.createElement("span",null),t.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:cn},t.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),t.a.createElement("a",{onClick:bt},t.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Vi(ct){var xt=ct.id,zt=ct.input,Ht=ct.showNote,en=ct.onShowNote,Xt=ct.notes,Et=ct.onCancelNote,bt=ct.onAddNote,Jt=ct.debugResult,wt=ct.language,cn=ct.debuging,Ft=ct.submitting,pn=ct.executingMessage,Yn=ct.code,Ln=ct.onSubmitCode,Sn=ct.onDebugCode,Zn=ct.onChangeCode,In=ct.onChangeInput,$n=ct.onUpdateCode,Kn=Object(ie.a)(ct,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function fi(Ei){return t.a.createElement(hi,Object(ce.a)({},Kn,{onShowCodeSetting:Ei}))}var ti={id:xt,input:zt,debugResult:Jt,debuging:cn,submitting:Ft,executingMessage:pn,onDebugCode:Sn,onChangeCode:Zn,onSubmitCode:Ln,onChangeInput:In};return t.a.createElement("div",{className:"right-panel"},t.a.createElement(E.a,{language:wt,value:Yn,onChange:Zn,ActionBarRender:fi}),t.a.createElement("div",{className:"note-form-area ".concat(Ht?"active":"")},t.a.createElement(le,{onCancel:Et,notes:Xt,callback:bt})),t.a.createElement(F.b,ti))}},WaYH:function(nt,Xe,V){"use strict";var ce=V("rePB"),ie=V("Ff2n"),W=V("VTBJ"),C=V("1OyB"),D=V("vuIU"),T=V("JX7q"),A=V("Ji7U"),O=V("LK+K"),f=V("cDcd"),p=V("TSYQ"),c=V.n(p),s=V("sboe"),n=V("OZM5"),o=function(g){var m=g.prefixCls,_=g.level,x=g.isStart,h=g.isEnd;if(!_)return null;for(var E="".concat(m,"-indent-unit"),S=[],w=0;w<_;w+=1){var R;S.push(f.createElement("span",{key:w,className:c()(E,(R={},Object(ce.a)(R,"".concat(E,"-start"),x[w+1]),Object(ce.a)(R,"".concat(E,"-end"),h[w+1]),Object(ce.a)(R,"".concat(E,"-end-first-level"),!w&&h[0]),R))}))}return f.createElement("span",{"aria-hidden":"true",className:"".concat(m,"-indent")},S)},r=o,l=V("815F"),a="open",i="close",t="---",d=function(b){Object(A.a)(m,b);var g=Object(O.a)(m);function m(){var _;return Object(C.a)(this,m),_=g.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(x){var h=_.props.context.onNodeClick;h(x,Object(l.b)(_.props)),_.isSelectable()?_.onSelect(x):_.onCheck(x)},_.onSelectorDoubleClick=function(x){var h=_.props.context.onNodeDoubleClick;h(x,Object(l.b)(_.props))},_.onSelect=function(x){if(_.isDisabled())return;var h=_.props.context.onNodeSelect;x.preventDefault(),h(x,Object(l.b)(_.props))},_.onCheck=function(x){if(_.isDisabled())return;var h=_.props,E=h.disableCheckbox,S=h.checked,w=_.props.context.onNodeCheck;if(!_.isCheckable()||E)return;x.preventDefault();var R=!S;w(x,Object(l.b)(_.props),R)},_.onMouseEnter=function(x){var h=_.props.context.onNodeMouseEnter;h(x,Object(l.b)(_.props))},_.onMouseLeave=function(x){var h=_.props.context.onNodeMouseLeave;h(x,Object(l.b)(_.props))},_.onContextMenu=function(x){var h=_.props.context.onNodeContextMenu;h(x,Object(l.b)(_.props))},_.onDragStart=function(x){var h=_.props.context.onNodeDragStart;x.stopPropagation(),_.setState({dragNodeHighlight:!0}),h(x,Object(T.a)(_));try{x.dataTransfer.setData("text/plain","")}catch(E){}},_.onDragEnter=function(x){var h=_.props.context.onNodeDragEnter;x.preventDefault(),x.stopPropagation(),h(x,Object(T.a)(_))},_.onDragOver=function(x){var h=_.props.context.onNodeDragOver;x.preventDefault(),x.stopPropagation(),h(x,Object(T.a)(_))},_.onDragLeave=function(x){var h=_.props.context.onNodeDragLeave;x.stopPropagation(),h(x,Object(T.a)(_))},_.onDragEnd=function(x){var h=_.props.context.onNodeDragEnd;x.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(x,Object(T.a)(_))},_.onDrop=function(x){var h=_.props.context.onNodeDrop;x.preventDefault(),x.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(x,Object(T.a)(_))},_.onExpand=function(x){var h=_.props.context.onNodeExpand;h(x,Object(l.b)(_.props))},_.setSelectHandle=function(x){_.selectHandle=x},_.getNodeState=function(){var x=_.props.expanded;return _.isLeaf()?null:x?a:i},_.hasChildren=function(){var x=_.props.eventKey,h=_.props.context.keyEntities,E=h[x]||{},S=E.children;return!!(S||[]).length},_.isLeaf=function(){var x=_.props,h=x.isLeaf,E=x.loaded,S=_.props.context.loadData,w=_.hasChildren();return h===!1?!1:h||!S&&!w||S&&E&&!w},_.isDisabled=function(){var x=_.props.disabled,h=_.props.context.disabled;return!!(h||x)},_.isCheckable=function(){var x=_.props.checkable,h=_.props.context.checkable;return!h||x===!1?!1:h},_.syncLoadData=function(x){var h=x.expanded,E=x.loading,S=x.loaded,w=_.props.context,R=w.loadData,N=w.onNodeLoad;if(E)return;R&&h&&!_.isLeaf()&&(!_.hasChildren()&&!S&&N(Object(l.b)(_.props)))},_.renderSwitcher=function(){var x=_.props,h=x.expanded,E=x.switcherIcon,S=_.props.context,w=S.prefixCls,R=S.switcherIcon,N=E||R;if(_.isLeaf())return f.createElement("span",{className:c()("".concat(w,"-switcher"),"".concat(w,"-switcher-noop"))},typeof N=="function"?N(Object(W.a)(Object(W.a)({},_.props),{},{isLeaf:!0})):N);var F=c()("".concat(w,"-switcher"),"".concat(w,"-switcher_").concat(h?a:i));return f.createElement("span",{onClick:_.onExpand,className:F},typeof N=="function"?N(Object(W.a)(Object(W.a)({},_.props),{},{isLeaf:!1})):N)},_.renderCheckbox=function(){var x=_.props,h=x.checked,E=x.halfChecked,S=x.disableCheckbox,w=_.props.context.prefixCls,R=_.isDisabled(),N=_.isCheckable();if(!N)return null;var F=typeof N!="boolean"?N:null;return f.createElement("span",{className:c()("".concat(w,"-checkbox"),h&&"".concat(w,"-checkbox-checked"),!h&&E&&"".concat(w,"-checkbox-indeterminate"),(R||S)&&"".concat(w,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var x=_.props.loading,h=_.props.context.prefixCls;return f.createElement("span",{className:c()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(_.getNodeState()||"docu"),x&&"".concat(h,"-icon_loading"))})},_.renderSelector=function(){var x=_.state.dragNodeHighlight,h=_.props,E=h.title,S=h.selected,w=h.icon,R=h.loading,N=h.data,F=_.props.context,z=F.prefixCls,q=F.showIcon,B=F.icon,M=F.draggable,G=F.loadData,J=F.titleRender,K=_.isDisabled(),Z="".concat(z,"-node-content-wrapper"),le;if(q){var de=w||B;le=de?f.createElement("span",{className:c()("".concat(z,"-iconEle"),"".concat(z,"-icon__customize"))},typeof de=="function"?de(_.props):de):_.renderIcon()}else G&&R&&(le=_.renderIcon());var Te;typeof E=="function"?Te=E(N):J?Te=J(N):Te=E;var we=f.createElement("span",{className:"".concat(z,"-title")},Te);return f.createElement("span",{ref:_.setSelectHandle,title:typeof E=="string"?E:"",className:c()("".concat(Z),"".concat(Z,"-").concat(_.getNodeState()||"normal"),!K&&(S||x)&&"".concat(z,"-node-selected"),!K&&M&&"draggable"),draggable:!K&&M||void 0,"aria-grabbed":!K&&M||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:M?_.onDragStart:void 0},le,we)},_}return Object(D.a)(m,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var x=this.props.selectable,h=this.props.context.selectable;return typeof x=="boolean"?x:h}},{key:"render",value:function(){var x,h=this.props,E=h.eventKey,S=h.className,w=h.style,R=h.dragOver,N=h.dragOverGapTop,F=h.dragOverGapBottom,z=h.isLeaf,q=h.isStart,B=h.isEnd,M=h.expanded,G=h.selected,J=h.checked,K=h.halfChecked,Z=h.loading,le=h.domRef,de=h.active,Te=h.onMouseMove,we=Object(ie.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ie=this.props.context,_e=Ie.prefixCls,ye=Ie.filterTreeNode,Ke=Ie.draggable,Me=Ie.keyEntities,Fe=this.isDisabled(),Ge=Object(n.f)(we),Ee=Me[E]||{},me=Ee.level,We=B[B.length-1];return f.createElement("div",Object.assign({ref:le,className:c()(S,"".concat(_e,"-treenode"),(x={},Object(ce.a)(x,"".concat(_e,"-treenode-disabled"),Fe),Object(ce.a)(x,"".concat(_e,"-treenode-switcher-").concat(M?"open":"close"),!z),Object(ce.a)(x,"".concat(_e,"-treenode-checkbox-checked"),J),Object(ce.a)(x,"".concat(_e,"-treenode-checkbox-indeterminate"),K),Object(ce.a)(x,"".concat(_e,"-treenode-selected"),G),Object(ce.a)(x,"".concat(_e,"-treenode-loading"),Z),Object(ce.a)(x,"".concat(_e,"-treenode-active"),de),Object(ce.a)(x,"".concat(_e,"-treenode-leaf-last"),We),Object(ce.a)(x,"drag-over",!Fe&&R),Object(ce.a)(x,"drag-over-gap-top",!Fe&&N),Object(ce.a)(x,"drag-over-gap-bottom",!Fe&&F),Object(ce.a)(x,"filter-node",ye&&ye(Object(l.b)(this.props))),x)),style:w,onDragEnter:Ke?this.onDragEnter:void 0,onDragOver:Ke?this.onDragOver:void 0,onDragLeave:Ke?this.onDragLeave:void 0,onDrop:Ke?this.onDrop:void 0,onDragEnd:Ke?this.onDragEnd:void 0,onMouseMove:Te},Ge),f.createElement(r,{prefixCls:_e,level:me,isStart:q,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),m}(f.Component),v=function(g){return f.createElement(s.a.Consumer,null,function(m){return f.createElement(d,Object.assign({},g,{context:m}))})};v.displayName="TreeNode",v.defaultProps={title:t},v.isTreeNode=1;var y=Xe.a=v},Wtmd:function(nt,Xe,V){nt.exports=V.p+"static/c.03ba6fd6.svg"},Wx9E:function(nt,Xe,V){},XIdC:function(nt,Xe,V){"use strict";var ce=V("rePB"),ie=V("ODXe"),W=V("Ff2n"),C=V("cDcd"),D=V.n(C),T=V("TSYQ"),A=V.n(T),O=V("6cGi"),f=V("4IlW"),p=C.forwardRef(function(c,s){var n,o=c.prefixCls,r=o===void 0?"rc-switch":o,l=c.className,a=c.checked,i=c.defaultChecked,t=c.disabled,d=c.loadingIcon,v=c.checkedChildren,y=c.unCheckedChildren,b=c.onClick,g=c.onChange,m=c.onKeyDown,_=Object(W.a)(c,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),x=Object(O.a)(!1,{value:a,defaultValue:i}),h=Object(ie.a)(x,2),E=h[0],S=h[1];function w(z,q){var B=E;return t||(B=z,S(B),g==null||g(B,q)),B}function R(z){z.which===f.a.LEFT?w(!1,z):z.which===f.a.RIGHT&&w(!0,z),m==null||m(z)}function N(z){var q=w(!E,z);b==null||b(q,z)}var F=A()(r,l,(n={},Object(ce.a)(n,"".concat(r,"-checked"),E),Object(ce.a)(n,"".concat(r,"-disabled"),t),n));return C.createElement("button",Object.assign({},_,{type:"button",role:"switch","aria-checked":E,disabled:t,className:F,ref:s,onKeyDown:R,onClick:N}),d,C.createElement("span",{className:"".concat(r,"-inner")},E?v:y))});p.displayName="Switch",Xe.a=p},Y1PL:function(nt,Xe,V){"use strict";V.r(Xe),V.d(Xe,"ResizableTextArea",function(){return K});var ce=V("wx14"),ie=V("1OyB"),W=V("vuIU"),C=V("Ji7U"),D=V("LK+K"),T=V("cDcd"),A=V("VTBJ"),O=V("rePB"),f=V("Zm9Q"),p=V("Kwbf"),c=V("c+Xe"),s=V("m+aA"),n=V("bdgK"),o=new Map;function r(de){de.forEach(function(Te){var we,Ie=Te.target;(we=o.get(Ie))===null||we===void 0||we.forEach(function(_e){return _e(Ie)})})}var l=new n.default(r),a=null,i=null;function t(de,Te){o.has(de)||(o.set(de,new Set),l.observe(de)),o.get(de).add(Te)}function d(de,Te){o.has(de)&&(o.get(de).delete(Te),o.get(de).size||(l.unobserve(de),o.delete(de)))}var v=function(de){Object(C.a)(we,de);var Te=Object(D.a)(we);function we(){return Object(ie.a)(this,we),Te.apply(this,arguments)}return Object(W.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(T.Component),y=T.createContext(null);function b(de){var Te=de.children,we=de.onBatchResize,Ie=T.useRef(0),_e=T.useRef([]),ye=T.useContext(y),Ke=T.useCallback(function(Me,Fe,Ge){Ie.current+=1;var Ee=Ie.current;_e.current.push({size:Me,element:Fe,data:Ge}),Promise.resolve().then(function(){Ee===Ie.current&&(we==null||we(_e.current),_e.current=[])}),ye==null||ye(Me,Fe,Ge)},[we,ye]);return T.createElement(y.Provider,{value:Ke},Te)}function g(de){var Te=de.children,we=de.disabled,Ie=T.useRef(null),_e=T.useRef(null),ye=T.useContext(y),Ke=T.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Me=T.isValidElement(Te)&&Object(c.c)(Te),Fe=Me?Te.ref:null,Ge=T.useMemo(function(){return Object(c.a)(Fe,Ie)},[Fe,Ie]),Ee=T.useRef(de);Ee.current=de;var me=T.useCallback(function(We){var He=Ee.current,it=He.onResize,re=He.data,P=We.getBoundingClientRect(),j=P.width,ee=P.height,$=We.offsetWidth,Q=We.offsetHeight,xe=Math.floor(j),De=Math.floor(ee);if(Ke.current.width!==xe||Ke.current.height!==De||Ke.current.offsetWidth!==$||Ke.current.offsetHeight!==Q){var dt={width:xe,height:De,offsetWidth:$,offsetHeight:Q};Ke.current=dt;var Ne=$===Math.round(j)?j:$,Be=Q===Math.round(ee)?ee:Q,tt=Object(A.a)(Object(A.a)({},dt),{},{offsetWidth:Ne,offsetHeight:Be});ye==null||ye(tt,We,re),it&&Promise.resolve().then(function(){it(tt,We)})}},[]);return T.useEffect(function(){var We=Object(s.a)(Ie.current)||Object(s.a)(_e.current);return We&&!we&&t(We,me),function(){return d(We,me)}},[Ie.current,we]),T.createElement(v,{ref:_e},Me?T.cloneElement(Te,{ref:Ge}):Te)}var m="rc-observer-key";function _(de){var Te=de.children,we=Object(f.a)(Te);return we.map(function(Ie,_e){var ye=(Ie==null?void 0:Ie.key)||"".concat(m,"-").concat(_e);return T.createElement(g,Object(ce.a)({},de,{key:ye}),Ie)})}_.Collection=b;var x=_,h=V("bT9E"),E=V("TSYQ"),S=V.n(E),w=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important
|
|
|
`,R=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},F;function z(de){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(Te&&N[we])return N[we];var Ie=window.getComputedStyle(de),_e=Ie.getPropertyValue("box-sizing")||Ie.getPropertyValue("-moz-box-sizing")||Ie.getPropertyValue("-webkit-box-sizing"),ye=parseFloat(Ie.getPropertyValue("padding-bottom"))+parseFloat(Ie.getPropertyValue("padding-top")),Ke=parseFloat(Ie.getPropertyValue("border-bottom-width"))+parseFloat(Ie.getPropertyValue("border-top-width")),Me=R.map(function(Ge){return"".concat(Ge,":").concat(Ie.getPropertyValue(Ge))}).join(";"),Fe={sizingStyle:Me,paddingSize:ye,borderSize:Ke,boxSizing:_e};return Te&&we&&(N[we]=Fe),Fe}function q(de){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ie=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)),de.getAttribute("wrap")?F.setAttribute("wrap",de.getAttribute("wrap")):F.removeAttribute("wrap");var _e=z(de,Te),ye=_e.paddingSize,Ke=_e.borderSize,Me=_e.boxSizing,Fe=_e.sizingStyle;F.setAttribute("style","".concat(Fe,";").concat(w)),F.value=de.value||de.placeholder||"";var Ge=Number.MIN_SAFE_INTEGER,Ee=Number.MAX_SAFE_INTEGER,me=F.scrollHeight,We;if(Me==="border-box"?me+=Ke:Me==="content-box"&&(me-=ye),we!==null||Ie!==null){F.value=" ";var He=F.scrollHeight-ye;we!==null&&(Ge=He*we,Me==="border-box"&&(Ge=Ge+ye+Ke),me=Math.max(Ge,me)),Ie!==null&&(Ee=He*Ie,Me==="border-box"&&(Ee=Ee+ye+Ke),We=me>Ee?"":"hidden",me=Math.min(Ee,me))}return{height:me,minHeight:Ge,maxHeight:Ee,overflowY:We,resize:"none"}}var B=V("Gytx"),M=V.n(B),G;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(G||(G={}));var J=function(de){Object(C.a)(we,de);var Te=Object(D.a)(we);function we(Ie){var _e;return Object(ie.a)(this,we),_e=Te.call(this,Ie),_e.nextFrameActionId=void 0,_e.resizeFrameId=void 0,_e.textArea=void 0,_e.saveTextArea=function(ye){_e.textArea=ye},_e.handleResize=function(ye){var Ke=_e.state.resizeStatus,Me=_e.props,Fe=Me.autoSize,Ge=Me.onResize;if(Ke!==G.NONE)return;typeof Ge=="function"&&Ge(ye),Fe&&_e.resizeOnNextFrame()},_e.resizeOnNextFrame=function(){cancelAnimationFrame(_e.nextFrameActionId),_e.nextFrameActionId=requestAnimationFrame(_e.resizeTextarea)},_e.resizeTextarea=function(){var ye=_e.props.autoSize;if(!ye||!_e.textArea)return;var Ke=ye.minRows,Me=ye.maxRows,Fe=q(_e.textArea,!1,Ke,Me);_e.setState({textareaStyles:Fe,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(_e.resizeFrameId),_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:G.RESIZED},function(){_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:G.NONE}),_e.fixFirefoxAutoScroll()})})})})},_e.renderTextArea=function(){var ye=_e.props,Ke=ye.prefixCls,Me=Ke===void 0?"rc-textarea":Ke,Fe=ye.autoSize,Ge=ye.onResize,Ee=ye.className,me=ye.disabled,We=_e.state,He=We.textareaStyles,it=We.resizeStatus,re=Object(h.a)(_e.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),P=S()(Me,Ee,Object(O.a)({},"".concat(Me,"-disabled"),me));"value"in re&&(re.value=re.value||"");var j=Object(A.a)(Object(A.a)(Object(A.a)({},_e.props.style),He),it===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return T.createElement(x,{onResize:_e.handleResize,disabled:!(Fe||Ge)},T.createElement("textarea",Object(ce.a)({},re,{className:P,style:j,ref:_e.saveTextArea})))},_e.state={textareaStyles:{},resizeStatus:G.NONE},_e}return Object(W.a)(we,[{key:"componentDidUpdate",value:function(_e){(_e.value!==this.props.value||!M()(_e.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 _e=this.textArea.selectionStart,ye=this.textArea.selectionEnd;this.textArea.setSelectionRange(_e,ye)}}catch(Ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(T.Component),K=J,Z=function(de){Object(C.a)(we,de);var Te=Object(D.a)(we);function we(Ie){var _e;Object(ie.a)(this,we),_e=Te.call(this,Ie),_e.resizableTextArea=void 0,_e.focus=function(){_e.resizableTextArea.textArea.focus()},_e.saveTextArea=function(Ke){_e.resizableTextArea=Ke},_e.handleChange=function(Ke){var Me=_e.props.onChange;_e.setValue(Ke.target.value,function(){_e.resizableTextArea.resizeTextarea()}),Me&&Me(Ke)},_e.handleKeyDown=function(Ke){var Me=_e.props,Fe=Me.onPressEnter,Ge=Me.onKeyDown;Ke.keyCode===13&&Fe&&Fe(Ke),Ge&&Ge(Ke)};var ye=typeof Ie.value=="undefined"||Ie.value===null?Ie.defaultValue:Ie.value;return _e.state={value:ye},_e}return Object(W.a)(we,[{key:"setValue",value:function(_e,ye){"value"in this.props||this.setState({value:_e},ye)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return T.createElement(K,Object(ce.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(_e){return"value"in _e?{value:_e.value}:null}}]),we}(T.Component),le=Xe.default=Z},Z8dc:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(nt,Xe,V){"use strict";var ce=V("BoS7"),ie=V("Sdc0"),W=V("OaEy"),C=V("2fM7"),D=V("cDcd"),T=V.n(D),A=V("lOMy"),O=V.n(A),f=C.a.Option;Xe.a=function(p){var c=p.onFontSizeChange,s=p.cmFontSize,n=p.cmCodeMode,o=p.onCodeModeChange,r=p.onTabToSpace,l=p.className,a=l===void 0?"":l,i=p.tabToSpace,t=p.children;return T.a.createElement("div",{className:"tpi-code-setting ".concat(a)},T.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),T.a.createElement("section",null,T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),T.a.createElement(C.a,{bordered:!1,size:"small",value:n,onChange:o},T.a.createElement(f,{value:"vs"},"\u767D\u8272\u80CC\u666F"),T.a.createElement(f,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),T.a.createElement(C.a,{bordered:!1,size:"small",value:s,onChange:c},T.a.createElement(f,{value:12},"12px"),T.a.createElement(f,{value:14},"14px"),T.a.createElement(f,{value:16},"16px"),T.a.createElement(f,{value:18},"18px"),T.a.createElement(f,{value:20},"20px"),T.a.createElement(f,{value:22},"22px"))),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"Tab\u8F6C\u6362"),T.a.createElement(ie.a,{checked:i,onChange:r}))),T.a.createElement("h3",null,"\u5FEB\u6377\u952E"),T.a.createElement("section",null,T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),T.a.createElement("span",null,"Ctrl + S")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),T.a.createElement("span",null,"F1 / Alt + F1")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),T.a.createElement("span",null,"Ctrl + ]/[")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),T.a.createElement("span",null,"Ctrl + Shift + \\")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),T.a.createElement("span",null,"Home")),T.a.createElement("div",{className:"file-item"},T.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),T.a.createElement("span",null,"End"))),t)}},ZW9T:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return q});var ce=V("k1fw"),ie=V("miYZ"),W=V("tsqr"),C=V("rAM+"),D=V("tJVT"),T=V("PpiC"),A=V("cDcd"),O=V.n(A),f=V("bdgK"),p=V("oBTY"),c=V("9og8"),s=V("WmNS"),n=V.n(s),o={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},r={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
|
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
|
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
|
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
|
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
|
`)}]},a={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
|
`)}]},i=V("5VLF"),t=V.n(i),d={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},v=function(M,G){return G.map(function(J){return{label:J,kind:M.languages.CompletionItemKind.Keyword,insertText:J}})},y=function(M){return Object.keys(d.tables).map(function(G){return{label:G,kind:M.languages.CompletionItemKind.Variable,insertText:G}})},b=function(M,G){var J=d.tables[M];return J?J.map(function(K){return{label:K,kind:G.languages.CompletionItemKind.Field,insertText:K}}):[]};function g(B,M,G,J,K){var Z=M.getWordUntilPosition(G),le={startLineNumber:G.lineNumber,endLineNumber:G.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn},de=J.map(function(Te){return{label:Te,kind:B.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}});return K.map(function(Te){de.push(Object(ce.a)(Object(ce.a)({},Te),{},{range:le}))}),de}var m=function(B){d.languages.map(function(K){return B.languages.registerDocumentFormattingEditProvider(K,{provideDocumentFormattingEdits:function(le,de,Te){return Object(c.a)(n.a.mark(function we(){var Ie;return n.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return Ie=t()(le.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ye.abrupt("return",[{range:le.getFullModelRange(),text:Ie}]);case 2:case"end":return ye.stop()}},we)}))()}}),K});var M=l.quickKey.map(function(K){return{label:K.label,kind:B.languages.CompletionItemKind.Method,insertText:K.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),G=a.quickKey.map(function(K){return{label:K.label,kind:B.languages.CompletionItemKind.Method,insertText:K.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=r.quickKey.map(function(K){return{label:K.label,kind:B.languages.CompletionItemKind.Method,insertText:K.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(p.a)(l.keywords),Object(p.a)(l.quickKey.map(function(K){return K.label}))),provideCompletionItems:function(Z,le){var de=Z.getValueInRange({startLineNumber:le.lineNumber,startColumn:1,endLineNumber:le.lineNumber,endColumn:le.column}),Te=de.match(/cu/gim);console.log("match:",Te,le,de,Z);var we=[],Ie=le.lineNumber,_e=le.column,ye=Z.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:_e}),Ke=ye.trim().split(/\s+/),Me=Ke[Ke.length-1];if(Me.endsWith(".")){var Fe=Me.slice(0,Me.length-1);Object.keys(d.tables).includes(Fe)&&(we=Object(p.a)(b(Fe,B)))}else Me==="."?we=[]:we=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,l.keywords)),Object(p.a)(M));return{suggestions:we}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(p.a)(o.keywords)),provideCompletionItems:function(Z,le){var de=Z.getValueInRange({startLineNumber:le.lineNumber,startColumn:1,endLineNumber:le.lineNumber,endColumn:le.column}),Te=de.match(/cu/gim);console.log("match:",Te,le,de,Z);var we=[],Ie=le.lineNumber,_e=le.column,ye=Z.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:_e}),Ke=ye.trim().split(/\s+/),Me=Ke[Ke.length-1];if(Me.endsWith(".")){var Fe=Me.slice(0,Me.length-1);Object.keys(d.tables).includes(Fe)&&(we=Object(p.a)(b(Fe,B)))}else Me==="."?we=[]:we=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,o.keywords)));return{suggestions:we}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(p.a)(r.keywords)),provideCompletionItems:function(Z,le){var de=[],Te=le.lineNumber,we=le.column,Ie=Z.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:we}),_e=Ie.trim().split(/\s+/),ye=_e[_e.length-1];if(ye.endsWith(".")){var Ke=ye.slice(0,ye.length-1);Object.keys(d.tables).includes(Ke)&&(de=Object(p.a)(b(Ke,B)))}else ye==="."?de=[]:de=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,r.keywords)),Object(p.a)(J));return{suggestions:de}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(p.a)(a.keywords)),provideCompletionItems:function(Z,le){var de=[],Te=le.lineNumber,we=le.column,Ie=Z.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:we}),_e=Ie.trim().split(/\s+/),ye=_e[_e.length-1];if(ye.endsWith(".")){var Ke=ye.slice(0,ye.length-1);Object.keys(d.tables).includes(Ke)&&(de=Object(p.a)(b(Ke,B)))}else ye==="."?de=[]:de=[].concat(Object(p.a)(y(B)),Object(p.a)(v(B,a.keywords)),Object(p.a)(G));return{suggestions:de}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",x=V("LvDl"),h=V("+ua5");function E(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function S(){}var w=!1,R={"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 N(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=B;if(Array.isArray(B)){for(var G=0;G<B.length;G++){var J=R[B[G]];if(J)return J}return M[0]}return R[M]||M}var F=null,z=Xe.b=function(B){var M=B.width,G=M===void 0?"100%":M,J=B.height,K=J===void 0?"100%":J,Z=B.value,le=B.language,de=le===void 0?"javascript":le,Te=B.style,we=Te===void 0?{}:Te,Ie=B.options,_e=Ie===void 0?{}:Ie,ye=B.overrideServices,Ke=ye===void 0?{}:ye,Me=B.theme,Fe=Me===void 0?"vs-dark":Me,Ge=B.onEditBlur,Ee=B.onSave,me=B.autoHeight,We=me===void 0?!1:me,He=B.forbidCopy,it=He===void 0?!1:He,re=B.onChange,P=re===void 0?S:re,j=B.editorDidMount,ee=j===void 0?S:j,$=B.onFocus,Q=$===void 0?S:$,xe=B.filename,De=xe===void 0?"educoder.txt":xe,dt=B.errorLine,Ne=B.errorContent,Be=Ne===void 0?"":Ne,tt=Object(T.a)(B,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),lt=Object(A.useRef)(),qe=Object(A.useRef)({}),Ye=Object(A.useRef)(),je=Object(A.useRef)(!1),Ue=Object(A.useRef)(),ke=Object(A.useState)(!1),be=Object(D.a)(ke,2),Ce=be[0],Pe=be[1];function Le(){var Ze;return lt.current&&(Ze=new f.default(function(mt){var Lt=Object(C.a)(mt),Mt;try{for(Lt.s();!(Mt=Lt.n()).done;){var $t=Mt.value;($t.target.offsetHeight>0||$t.target.offsetWidth>0)&&qe.current.instance.layout()}}catch(Re){Lt.e(Re)}finally{Lt.f()}}),Ze.observe(lt.current)),Ze}function Ve(){W.b.warn(decodeURIComponent(_))}var at=function(){var mt=qe.current.instance;if(Z!=null&&mt&&Ce){var Lt=mt.getModel();Lt&&Z!==Lt.getValue()&&(w=!0,Lt.setValue(Z),mt.layout(),w=!1)}};Object(A.useEffect)(function(){Ye.current&&clearTimeout(Ye.current),Ye.current=setTimeout(function(){at()},500)},[Z,Ce,qe.current]),Object(A.useEffect)(function(){if(dt&&qe.current&&qe.current.instance){var Ze=qe.current.instance;Ze.changeViewZones(function(Lt){var Mt=document.createElement("div");Mt.style.padding="10px 20px",Mt.style.width="calc(100% - 20px)",Mt.className="my-error-line-wrp",Mt.innerHTML=Be,Lt.addZone({afterLineNumber:dt||11,heightInLines:3,domNode:Mt})});var mt={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}};Ze.addOverlayWidget(mt),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[dt,qe.current,Ce]);function _t(){var Ze=qe.current.instance;if(Ze){var mt=Ze.getSelection(),Lt=qe.current.pastePos||{},Mt=new F.Range(Lt.startLineNumber||mt.endLineNumber,Lt.startColumn||mt.endColumn,Lt.endLineNumber||mt.endLineNumber,Lt.endColumn||mt.endColumn);setTimeout(function(){Ze.executeEdits("",[{range:Mt,text:""}])},300)}}function kt(Ze){(window.navigator.platform.match("Mac")?Ze.metaKey:Ze.ctrlKey)&&Ze.keyCode==83&&(Ze.preventDefault(),Ee())}var Bt=function(){if(We&&qe.current.instance){var mt=qe.current.instance.getContentHeight();It(mt<K?K:mt)}else It(K)};function jt(Ze){var mt=document.createEvent("MouseEvents");mt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ze.dispatchEvent(mt)}function At(Ze,mt){var Lt=window.URL||window.webkitURL||window,Mt=new Blob([mt]),$t=document.createElementNS("http://www.w3.org/1999/xhtml","a");$t.href=Lt.createObjectURL(Mt),$t.download=Ze,jt($t)}Object(A.useEffect)(function(){Bt()},[Bt]),Object(A.useEffect)(function(){lt.current&&!Ce&&V.e(27).then(V.t.bind(null,"M/lh",7)).then(function(Ze){try{F=Ze,qe.current.instance=F.editor.create(lt.current,{value:Z,language:N(de),theme:Fe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Ke);var mt=qe.current.instance;if(ee(mt,F),setTimeout(function(){Bt(),qe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){At(De||"educoder.txt",mt.getValue())}})},500),qe.current.subscription=mt.onDidChangeModelContent(function(Mt){je.current?clearTimeout(Ue.current):(Bt(),P(mt.getValue(),Mt)),Ue.current=setTimeout(function(){je.current=!1},500)}),window.Monaco||m(F),it&&(mt.addCommand(F.KeyMod.CtrlCmd|F.KeyMod.Shift|F.KeyCode.KEY_V,function(){return Ve(),null}),mt.addCommand(F.KeyMod.CtrlCmd|F.KeyCode.KEY_C,function(){return Ve(),null})),window.Monaco=F,Ge&&mt.onDidBlurEditorWidget(function(){Ge(mt.getValue())}),Q&&mt.onDidFocusEditorText(function(){Q(mt.getValue())}),it){mt.addCommand(F.KeyMod.CtrlCmd|F.KeyCode.KEY_V,function(){return Ve(),null}),mt.onDidPaste(function(Mt){qe.current.pastePos=Mt});try{window.addEventListener("paste",_t)}catch(Mt){}}var Lt=Le();return Pe(!0),function(){var Mt=qe.current.instance;Mt.dispose();var $t=Mt.getModel();$t&&$t.dispose(),qe.current.subscription&&qe.current.subscription.dispose(),it&&window.removeEventListener("paste",_t),Lt.unobserve(lt.current)}}catch(Mt){}})},[]),Object(A.useEffect)(function(){var Ze=qe.current.instance;if(Ze&&Ce)return document.addEventListener("keydown",kt,!1),function(){document.removeEventListener("keydown",kt)}},[Ee,Ce]),Object(A.useEffect)(function(){var Ze=qe.current.instance;if(Ze&&Ce){var mt=N(de);F.editor.setModelLanguage(Ze.getModel(),mt),console.log("language:",de,Ze.getModel(),mt)}},[de,Ce]),Object(A.useEffect)(function(){var Ze=qe.current.instance;Ze&&Ce&&F.editor.setTheme(Fe)},[Fe,Ce]),Object(A.useEffect)(function(){var Ze=qe.current.instance;Ze&&Ce&&(Ze.updateOptions(Object(ce.a)({},_e)),setTimeout(function(){Ze.getModel().updateOptions(Object(ce.a)({},_e))},200))},[JSON.stringify(_e),Ce]),Object(A.useEffect)(function(){var Ze=qe.current.instance;Ze&&Ce&&Ze.layout()},[G,K,Ce]);var pt=Object(A.useState)(E(G)),gt=Object(D.a)(pt,2),rt=gt[0],Oe=gt[1],ze=Object(A.useState)(E(K)),vt=Object(D.a)(ze,2),st=vt[0],It=vt[1],Pt=Object(ce.a)(Object(ce.a)({},we),{},{width:rt,height:st});return O.a.createElement("div",{className:"my-monaco-editor",ref:lt,style:Pt})};function q(B){var M=B.width,G=M===void 0?"100%":M,J=B.height,K=J===void 0?"100%":J,Z=B.original,le=B.modified,de=B.language,Te=B.options,we=Te===void 0?{}:Te,Ie=Object(A.useRef)(),_e=Object(A.useState)(null),ye=Object(D.a)(_e,2),Ke=ye[0],Me=ye[1];function Fe(We){var He;return Ie.current&&(He=new f.default(function(it){var re=Object(C.a)(it),P;try{for(re.s();!(P=re.n()).done;){var j=P.value;(j.target.offsetHeight>0||j.target.offsetWidth>0)&&We.layout()}}catch(ee){re.e(ee)}finally{re.f()}}),He.observe(Ie.current)),He}Object(A.useEffect)(function(){Ie.current&&V.e(27).then(V.t.bind(null,"M/lh",7)).then(function(We){F=We;var He=F.editor.createDiffEditor(Ie.current,Object(ce.a)(Object(ce.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},we),{},{wordWrap:!0}));Me(He);var it=Fe(He);return function(){He.dispose();var re=He.getModel();re&&re.dispose(),it.unobserve(Ie.current)}})},[]),Object(A.useEffect)(function(){Ke&&Ke.setModel({original:F.editor.createModel(Z,de),modified:F.editor.createModel(le,de)})},[Z,le,de,Ke]);var Ge=E(G),Ee=E(K),me={width:Ge,height:Ee};return O.a.createElement("div",{className:"my-diff-editor",ref:Ie,style:me})}},ZpRC:function(nt,Xe,V){"use strict";function ce(c){return typeof c=="object"&&c!=null&&c.nodeType===1}function ie(c,s){return(!s||c!=="hidden")&&c!=="visible"&&c!=="clip"}function W(c,s){if(c.clientHeight<c.scrollHeight||c.clientWidth<c.scrollWidth){var n=getComputedStyle(c,null);return ie(n.overflowY,s)||ie(n.overflowX,s)||function(o){var r=function(l){if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch(a){return null}}(o);return!!r&&(r.clientHeight<o.scrollHeight||r.clientWidth<o.scrollWidth)}(c)}return!1}function C(c,s,n,o,r,l,a,i){return l<c&&a>s||l>c&&a<s?0:l<=c&&i<=n||a>=s&&i>=n?l-c-o:a>s&&i<n||l<c&&i>n?a-s+r:0}var D=function(c,s){var n=window,o=s.scrollMode,r=s.block,l=s.inline,a=s.boundary,i=s.skipOverflowHiddenElements,t=typeof a=="function"?a:function(He){return He!==a};if(!ce(c))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,v=[],y=c;ce(y)&&t(y);){if((y=y.parentElement)===d){v.push(y);break}y!=null&&y===document.body&&W(y)&&!W(document.documentElement)||y!=null&&W(y,i)&&v.push(y)}for(var b=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,x=c.getBoundingClientRect(),h=x.height,E=x.width,S=x.top,w=x.right,R=x.bottom,N=x.left,F=r==="start"||r==="nearest"?S:r==="end"?R:S+h/2,z=l==="center"?N+E/2:l==="end"?w:N,q=[],B=0;B<v.length;B++){var M=v[B],G=M.getBoundingClientRect(),J=G.height,K=G.width,Z=G.top,le=G.right,de=G.bottom,Te=G.left;if(o==="if-needed"&&S>=0&&N>=0&&R<=g&&w<=b&&S>=Z&&R<=de&&N>=Te&&w<=le)return q;var we=getComputedStyle(M),Ie=parseInt(we.borderLeftWidth,10),_e=parseInt(we.borderTopWidth,10),ye=parseInt(we.borderRightWidth,10),Ke=parseInt(we.borderBottomWidth,10),Me=0,Fe=0,Ge="offsetWidth"in M?M.offsetWidth-M.clientWidth-Ie-ye:0,Ee="offsetHeight"in M?M.offsetHeight-M.clientHeight-_e-Ke:0;if(d===M)Me=r==="start"?F:r==="end"?F-g:r==="nearest"?C(_,_+g,g,_e,Ke,_+F,_+F+h,h):F-g/2,Fe=l==="start"?z:l==="center"?z-b/2:l==="end"?z-b:C(m,m+b,b,Ie,ye,m+z,m+z+E,E),Me=Math.max(0,Me+_),Fe=Math.max(0,Fe+m);else{Me=r==="start"?F-Z-_e:r==="end"?F-de+Ke+Ee:r==="nearest"?C(Z,de,J,_e,Ke+Ee,F,F+h,h):F-(Z+J/2)+Ee/2,Fe=l==="start"?z-Te-Ie:l==="center"?z-(Te+K/2)+Ge/2:l==="end"?z-le+ye+Ge:C(Te,le,K,Ie,ye+Ge,z,z+E,E);var me=M.scrollLeft,We=M.scrollTop;F+=We-(Me=Math.max(0,Math.min(We+Me,M.scrollHeight-J+Ee))),z+=me-(Fe=Math.max(0,Math.min(me+Fe,M.scrollWidth-K+Ge)))}q.push({el:M,top:Me,left:Fe})}return q};function T(c){return c===Object(c)&&Object.keys(c).length!==0}function A(c,s){s===void 0&&(s="auto");var n="scrollBehavior"in document.body.style;c.forEach(function(o){var r=o.el,l=o.top,a=o.left;r.scroll&&n?r.scroll({top:l,left:a,behavior:s}):(r.scrollTop=l,r.scrollLeft=a)})}function O(c){return c===!1?{block:"end",inline:"nearest"}:T(c)?c:{block:"start",inline:"nearest"}}function f(c,s){var n=!c.ownerDocument.documentElement.contains(c);if(T(s)&&typeof s.behavior=="function")return s.behavior(n?[]:D(c,s));if(n)return;var o=O(s);return A(D(c,o),o.behavior)}var p=Xe.a=f},ZsLC:function(nt,Xe,V){nt.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return C}),V.d(Xe,"a",function(){return D});var ce=V("je13"),ie=V.n(ce),W=!1;function C(T,A){var O=ie.a.get("__ec");O||(O={}),O[T]=A,ie.a.set("__ec",O)}function D(T,A){var O=ie.a.get("__ec");return O?O[T]===void 0?A:O[T]:A}},bT9E:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return ie});var ce=V("VTBJ");function ie(W,C){var D=Object(ce.a)({},W);return Array.isArray(C)&&C.forEach(function(T){delete D[T]}),D}},bdLU:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return ce});var ce;(function(ie){ie[ie.NOMATCH=-1]="NOMATCH",ie[ie.OK=0]="OK",ie[ie.TIMEOUT=2]="TIMEOUT",ie[ie.PODFAILURE=3]="PODFAILURE",ie[ie.COMPILEFAILURE=4]="COMPILEFAILURE",ie[ie.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ce||(ce={}))},biw7:function(nt,Xe,V){"use strict";var ce=V("cDcd"),ie=V.n(ce),W=ce.createContext(null);Xe.a=W},c5Ni:function(nt,Xe,V){},cDPC:function(nt,Xe,V){"use strict";var ce=V("tJVT"),ie=V("cDcd"),W=V.n(ie),C=V("i3hx"),D=V.n(C);Xe.a=function(T){var A=T.defaultX,O=A===void 0?"40%":A,f=T.leftChild,p=T.rightChild,c=T.className,s=T.hideResize,n=s===void 0?!1:s,o=Object(ie.useState)(O),r=Object(ce.a)(o,2),l=r[0],a=r[1],i=Object(ie.useRef)();function t(){i.current=!0}Object(ie.useEffect)(function(){function y(g){i.current&&a(g.pageX)}function b(){i.current=!1}return window.addEventListener("mousemove",y),window.addEventListener("mouseup",b),function(){window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",b)}},[]);var d=typeof l=="number"&&l!==.01?"".concat(l,"px"):O,v="calc(100% - ".concat(n?"0px":"4px"," - ").concat(d,")");return W.a.createElement("div",{className:"split-panel-container ".concat(c)},W.a.createElement("section",{style:{width:d,display:l===.01?"none":""}},f),W.a.createElement("section",{className:"resize-x-bar",onMouseDown:t},W.a.createElement("a",{className:"btn-resize"},W.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},W.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"})))),W.a.createElement("section",{style:{width:v}},p))}},dejd:function(nt,Xe,V){},dmUQ:function(nt,Xe,V){"use strict";var ce=V("Ff2n"),ie=V("rePB"),W=V("1OyB"),C=V("vuIU"),D=V("Ji7U"),T=V("md7G"),A=V("foSv"),O=V("cDcd"),f=V.n(O),p=V("TSYQ"),c=V.n(p),s=V("4IlW");function n(h,E){var S=Object.keys(h);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);E&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(h,R).enumerable})),S.push.apply(S,w)}return S}function o(h){for(var E=1;E<arguments.length;E++){var S=arguments[E]!=null?arguments[E]:{};E%2?n(Object(S),!0).forEach(function(w){Object(ie.a)(h,w,S[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(S)):n(Object(S)).forEach(function(w){Object.defineProperty(h,w,Object.getOwnPropertyDescriptor(S,w))})}return h}function r(h){var E=l();return function(){var w=Object(A.a)(h),R;if(E){var N=Object(A.a)(this).constructor;R=Reflect.construct(w,arguments,N)}else R=w.apply(this,arguments);return Object(T.a)(this,R)}}function l(){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(h){return!1}}function a(){}function i(h){h.preventDefault()}var t=function(E){return E.replace(/[^\w.-]+/g,"")},d=200,v=600,y=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,b=function(E){return E!=null},g=function(E,S){return S===E||typeof S=="number"&&typeof E=="number"&&isNaN(S)&&isNaN(E)},m=function(h){Object(D.a)(S,h);var E=r(S);function S(w){var R;Object(W.a)(this,S),R=E.call(this,w),R.onKeyDown=function(z){var q=R.props,B=q.onKeyDown,M=q.onPressEnter;if(z.keyCode===s.a.UP){var G=R.getRatio(z);R.up(z,G,null),R.stop()}else if(z.keyCode===s.a.DOWN){var J=R.getRatio(z);R.down(z,J,null),R.stop()}else z.keyCode===s.a.ENTER&&M&&M(z);if(R.recordCursorPosition(),R.lastKeyCode=z.keyCode,B){for(var K=arguments.length,Z=new Array(K>1?K-1:0),le=1;le<K;le++)Z[le-1]=arguments[le];B.apply(void 0,[z].concat(Z))}},R.onKeyUp=function(z){var q=R.props.onKeyUp;if(R.stop(),R.recordCursorPosition(),q){for(var B=arguments.length,M=new Array(B>1?B-1:0),G=1;G<B;G++)M[G-1]=arguments[G];q.apply(void 0,[z].concat(M))}},R.onChange=function(z){var q=R.props.onChange;R.state.focused&&(R.inputting=!0),R.rawInput=R.props.parser(R.getValueFromEvent(z)),R.setState({inputValue:R.rawInput}),q(R.toNumber(R.rawInput))},R.onMouseUp=function(){var z=R.props.onMouseUp;R.recordCursorPosition(),z&&z.apply(void 0,arguments)},R.onFocus=function(){var z;R.setState({focused:!0}),(z=R.props).onFocus.apply(z,arguments)},R.onBlur=function(){var z=R.props.onBlur;R.inputting=!1,R.setState({focused:!1});var q=R.getCurrentValidValue(R.state.inputValue),B=R.setValue(q,a);if(z){var M=R.input.value,G=R.getInputDisplayValue({focus:!1,value:B});R.input.value=G&&Number(G),z.apply(void 0,arguments),R.input.value=M}},R.getRatio=function(z){var q=1;return z.metaKey||z.ctrlKey?q=.1:z.shiftKey&&(q=10),q},R.getFullNum=function(z){return isNaN(z)?z:/e/i.test(String(z))?Number(z).toFixed(18).replace(/\.?0+$/,""):z},R.getPrecision=function(z){if(b(R.props.precision))return R.props.precision;var q=String(z);if(q.indexOf("e-")>=0)return parseInt(q.slice(q.indexOf("e-")+2),10);var B=0;return q.indexOf(".")>=0&&(B=q.length-q.indexOf(".")-1),B},R.getInputDisplayValue=function(z){var q=z||R.state,B=q.focused,M=q.inputValue,G=q.value,J;B?J=M:J=R.toPrecisionAsStep(G),J==null&&(J="");var K=R.formatWrapper(J);return b(R.props.decimalSeparator)&&(K=K.toString().replace(".",R.props.decimalSeparator)),K},R.recordCursorPosition=function(){try{R.cursorStart=R.input.selectionStart,R.cursorEnd=R.input.selectionEnd,R.currentValue=R.input.value,R.cursorBefore=R.input.value.substring(0,R.cursorStart),R.cursorAfter=R.input.value.substring(R.cursorEnd)}catch(z){}},R.restoreByAfter=function(z){if(z===void 0)return!1;var q=R.input.value,B=q.lastIndexOf(z);if(B===-1)return!1;var M=R.cursorBefore.length;return R.lastKeyCode===s.a.DELETE&&R.cursorBefore.charAt(M-1)===z[0]?(R.fixCaret(M,M),!0):B+z.length===q.length?(R.fixCaret(B,B),!0):!1},R.partRestoreByAfter=function(z){return z===void 0?!1:Array.prototype.some.call(z,function(q,B){var M=z.substring(B);return R.restoreByAfter(M)})},R.isNotCompleteNumber=function(z){return isNaN(z)||z===""||z===null||z&&z.toString().indexOf(".")===z.toString().length-1},R.stop=function(){R.autoStepTimer&&clearTimeout(R.autoStepTimer)},R.down=function(z,q,B){R.pressingUpOrDown=!0,R.step("down",z,q,B)},R.up=function(z,q,B){R.pressingUpOrDown=!0,R.step("up",z,q,B)},R.saveInput=function(z){R.input=z};var N=w.value;N===void 0&&(N=w.defaultValue),R.state={focused:w.autoFocus};var F=R.getValidValue(R.toNumber(N));return R.state=o(o({},R.state),{},{inputValue:R.toPrecisionAsStep(F),value:F}),R}return Object(C.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(R){var N=this.props,F=N.value,z=N.onChange,q=N.max,B=N.min,M=this.state.focused;if(R){if(!g(R.value,F)||!g(R.max,q)||!g(R.min,B)){var G=M?F:this.getValidValue(F),J;this.pressingUpOrDown?J=G:this.inputting?J=this.rawInput:J=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:J})}var K="value"in this.props?F:this.state.value;"max"in this.props&&R.max!==q&&typeof K=="number"&&K>q&&z&&z(q),"min"in this.props&&R.min!==B&&typeof K=="number"&&K<B&&z&&z(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Z=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===s.a.BACKSPACE?Z=this.cursorStart-1:this.lastKeyCode===s.a.DELETE&&(Z=this.cursorStart):Z=this.input.value.length,this.fixCaret(Z,Z)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case s.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case s.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(le){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(R){var N=R;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(R){var N=R.target.value.trim().replace(/。/g,".");return b(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(R){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,z=parseFloat(R);return isNaN(z)?R:(z<N&&(z=N),z>F&&(z=F),z)}},{key:"setValue",value:function(R,N){var F=this.props.precision,z=this.isNotCompleteNumber(parseFloat(R))?null:parseFloat(R),q=this.state.value,B=q===void 0?null:q,M=this.state.inputValue,G=M===void 0?null:M,J=typeof z=="number"?z.toFixed(F):"".concat(z),K=z!==B||J!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},N)):this.setState({value:z,inputValue:this.toPrecisionAsStep(R)},N),K&&this.props.onChange(z),z}},{key:"getMaxPrecision",value:function(R){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,z=F.precision,q=F.step;if(b(z))return z;var B=this.getPrecision(N),M=this.getPrecision(q),G=this.getPrecision(R);return R?Math.max(G,B+M):B+M}},{key:"getPrecisionFactor",value:function(R){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(R,N);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(R){return this.props.formatter?this.props.formatter(R):R}},{key:"toPrecisionAsStep",value:function(R){if(this.isNotCompleteNumber(R)||R==="")return R;var N=Math.abs(this.getMaxPrecision(R));return isNaN(N)?R.toString():Number(R).toFixed(N)}},{key:"toNumber",value:function(R){var N=this.props.precision,F=this.state.focused,z=R&&R.length>16&&F;return this.isNotCompleteNumber(R)||z?R:b(N)?Math.round(R*Math.pow(10,N))/Math.pow(10,N):Number(R)}},{key:"upStep",value:function(R,N){var F=this.props.step,z=this.getPrecisionFactor(R,N),q=Math.abs(this.getMaxPrecision(R,N)),B=((z*R+z*F*N)/z).toFixed(q);return this.toNumber(B)}},{key:"downStep",value:function(R,N){var F=this.props.step,z=this.getPrecisionFactor(R,N),q=Math.abs(this.getMaxPrecision(R,N)),B=((z*R-z*F*N)/z).toFixed(q);return this.toNumber(B)}},{key:"step",value:function(R,N){var F=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,q=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var B=this.props;if(B.disabled)return;var M=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(M))return;var G=this["".concat(R,"Step")](M,z),J=G>B.max||G<B.min;if(G>B.max?G=B.max:G<B.min&&(G=B.min),this.setValue(G,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),J)return;this.autoStepTimer=setTimeout(function(){F[R](N,z,!0)},q?d:v)}},{key:"fixCaret",value:function(R,N){if(R===void 0||N===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,z=this.input.selectionEnd;(R!==F||N!==z)&&this.input.setSelectionRange(R,N)}catch(q){}}},{key:"render",value:function(){var R,N=this.props,F=N.prefixCls,z=N.disabled,q=N.readOnly,B=N.useTouch,M=N.autoComplete,G=N.upHandler,J=N.downHandler,K=N.className,Z=N.max,le=N.min,de=N.style,Te=N.title,we=N.onMouseEnter,Ie=N.onMouseLeave,_e=N.onMouseOver,ye=N.onMouseOut,Ke=N.required,Me=N.onClick,Fe=N.tabIndex,Ge=N.type,Ee=N.placeholder,me=N.id,We=N.inputMode,He=N.pattern,it=N.step,re=N.maxLength,P=N.autoFocus,j=N.name,ee=N.onPaste,$=N.onInput,Q=Object(ce.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),xe=this.state,De=xe.value,dt=xe.focused,Ne=c()(F,(R={},Object(ie.a)(R,K,!!K),Object(ie.a)(R,"".concat(F,"-disabled"),z),Object(ie.a)(R,"".concat(F,"-focused"),dt),R)),Be={};Object.keys(Q).forEach(function(Le){(Le.substr(0,5)==="data-"||Le.substr(0,5)==="aria-"||Le==="role")&&(Be[Le]=Q[Le])});var tt=!q&&!z,lt=this.getInputDisplayValue(null),qe=(De||De===0)&&(isNaN(De)||Number(De)>=Z),Ye=(De||De===0)&&(isNaN(De)||Number(De)<=le),je=qe||z||q,Ue=Ye||z||q,ke=c()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(ie.a)({},"".concat(F,"-handler-up-disabled"),je)),be=c()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(ie.a)({},"".concat(F,"-handler-down-disabled"),Ue)),Ce=B?{onTouchStart:je?a:this.up,onTouchEnd:this.stop}:{onMouseDown:je?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Pe=B?{onTouchStart:Ue?a:this.down,onTouchEnd:this.stop}:{onMouseDown:Ue?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return f.a.createElement("div",{className:Ne,style:de,title:Te,onMouseEnter:we,onMouseLeave:Ie,onMouseOver:_e,onMouseOut:ye,onFocus:function(){return null},onBlur:function(){return null}},f.a.createElement("div",{className:"".concat(F,"-handler-wrap")},f.a.createElement("span",Object.assign({unselectable:"on"},Ce,{role:"button","aria-label":"Increase Value","aria-disabled":je,className:ke}),G||f.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:i})),f.a.createElement("span",Object.assign({unselectable:"on"},Pe,{role:"button","aria-label":"Decrease Value","aria-disabled":Ue,className:be}),J||f.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:i}))),f.a.createElement("div",{className:"".concat(F,"-input-wrap")},f.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":le,"aria-valuemax":Z,"aria-valuenow":De,required:Ke,type:Ge,placeholder:Ee,onPaste:ee,onClick:Me,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Fe,autoComplete:M,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:a,onKeyUp:tt?this.onKeyUp:a,autoFocus:P,maxLength:re,readOnly:q,disabled:z,max:Z,min:le,step:it,name:j,title:Te,id:me,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:He,inputMode:We,onInput:$},Be))))}}]),S}(f.a.Component);m.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:y,min:-y,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:t,required:!1,autoComplete:"off"};var _=m,x=Xe.a=_},fcSX:function(nt,Xe,V){"use strict";var ce=V("Ff2n"),ie=V("1OyB"),W=V("vuIU"),C=V("Ji7U"),D=V("md7G"),T=V("foSv"),A=V("1W/9"),O=V("cDcd"),f=V("rePB"),p=V("JX7q"),c=V("TSYQ"),s=V.n(c),n=V("qx4F"),o=V("4IlW");function r(z){return Array.isArray(z)?z:[z]}var l={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},a=Object.keys(l).filter(function(z){if(typeof document=="undefined")return!1;var q=document.getElementsByTagName("html")[0];return z in(q?q.style:{})})[0],i=l[a];function t(z,q,B,M){z.addEventListener?z.addEventListener(q,B,M):z.attachEvent&&z.attachEvent("on".concat(q),B)}function d(z,q,B,M){z.removeEventListener?z.removeEventListener(q,B,M):z.attachEvent&&z.detachEvent("on".concat(q),B)}function v(z,q){var B=typeof z=="function"?z(q):z;return Array.isArray(B)?B.length===2?B:[B[0],B[1]]:[B]}var y=function(q){return!isNaN(parseFloat(q))&&isFinite(q)},b=!(typeof window!="undefined"&&window.document&&window.document.createElement),g=function z(q,B,M,G){if(!B||B===document||B instanceof Document)return!1;if(B===q.parentNode)return!0;var J=Math.max(Math.abs(M),Math.abs(G))===Math.abs(G),K=Math.max(Math.abs(M),Math.abs(G))===Math.abs(M),Z=B.scrollHeight-B.clientHeight,le=B.scrollWidth-B.clientWidth,de=document.defaultView.getComputedStyle(B),Te=de.overflowY==="auto"||de.overflowY==="scroll",we=de.overflowX==="auto"||de.overflowX==="scroll",Ie=Z&&Te,_e=le&&we;return J&&(!Ie||Ie&&(B.scrollTop>=Z&&G<0||B.scrollTop<=0&&G>0))||K&&(!_e||_e&&(B.scrollLeft>=le&&M<0||B.scrollLeft<=0&&M>0))?z(q,B.parentNode,M,G):!1};function m(z){var q=_();return function(){var M=Object(T.a)(z),G;if(q){var J=Object(T.a)(this).constructor;G=Reflect.construct(M,arguments,J)}else G=M.apply(this,arguments);return Object(D.a)(this,G)}}function _(){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 x={},h=function(z){Object(C.a)(B,z);var q=m(B);function B(M){var G;return Object(ie.a)(this,B),G=q.call(this,M),G.domFocus=function(){G.dom&&G.dom.focus()},G.removeStartHandler=function(J){if(J.touches.length>1)return;G.startPos={x:J.touches[0].clientX,y:J.touches[0].clientY}},G.removeMoveHandler=function(J){if(J.changedTouches.length>1)return;var K=J.currentTarget,Z=J.changedTouches[0].clientX-G.startPos.x,le=J.changedTouches[0].clientY-G.startPos.y;(K===G.maskDom||K===G.handlerDom||K===G.contentDom&&g(K,J.target,Z,le))&&J.cancelable&&J.preventDefault()},G.transitionEnd=function(J){var K=J.target;d(K,i,G.transitionEnd),K.style.transition=""},G.onKeyDown=function(J){if(J.keyCode===o.a.ESC){var K=G.props.onClose;J.stopPropagation(),K&&K(J)}},G.onWrapperTransitionEnd=function(J){var K=G.props,Z=K.open,le=K.afterVisibleChange;J.target===G.contentWrapper&&J.propertyName.match(/transform$/)&&(G.dom.style.transition="",!Z&&G.getCurrentDrawerSome()&&(document.body.style.overflowX="",G.maskDom&&(G.maskDom.style.left="",G.maskDom.style.width="")),le&&le(!!Z))},G.openLevelTransition=function(){var J=G.props,K=J.open,Z=J.width,le=J.height,de=G.getHorizontalBoolAndPlacementName(),Te=de.isHorizontal,we=de.placementName,Ie=G.contentDom?G.contentDom.getBoundingClientRect()[Te?"width":"height"]:0,_e=(Te?Z:le)||Ie;G.setLevelAndScrolling(K,we,_e)},G.setLevelTransform=function(J,K,Z,le){var de=G.props,Te=de.placement,we=de.levelMove,Ie=de.duration,_e=de.ease,ye=de.showMask;G.levelDom.forEach(function(Ke){Ke.style.transition="transform ".concat(Ie," ").concat(_e),t(Ke,i,G.transitionEnd);var Me=J?Z:0;if(we){var Fe=v(we,{target:Ke,open:J});Me=J?Fe[0]:Fe[1]||0}var Ge=typeof Me=="number"?"".concat(Me,"px"):Me,Ee=Te==="left"||Te==="top"?Ge:"-".concat(Ge);Ee=ye&&Te==="right"&&le?"calc(".concat(Ee," + ").concat(le,"px)"):Ee,Ke.style.transform=Me?"".concat(K,"(").concat(Ee,")"):""})},G.setLevelAndScrolling=function(J,K,Z){var le=G.props.onChange;if(!b){var de=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(n.a)(!0):0;G.setLevelTransform(J,K,Z,de),G.toggleScrollingToDrawerAndBody(de)}le&&le(J)},G.toggleScrollingToDrawerAndBody=function(J){var K=G.props,Z=K.getOpenCount,le=K.getContainer,de=K.showMask,Te=K.open,we=le&&le(),Ie=Z&&Z();if(we&&we.parentNode===document.body&&de){var _e=["touchstart"],ye=[document.body,G.maskDom,G.handlerDom,G.contentDom];Te&&document.body.style.overflow!=="hidden"?(J&&G.addScrollingEffect(J),Ie===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ye.forEach(function(Ke,Me){if(!Ke)return;t(Ke,_e[Me]||"touchmove",Me?G.removeMoveHandler:G.removeStartHandler,G.passive)})):G.getCurrentDrawerSome()&&(Ie||(document.body.style.overflow=""),document.body.style.touchAction="",J&&G.remScrollingEffect(J),ye.forEach(function(Ke,Me){if(!Ke)return;d(Ke,_e[Me]||"touchmove",Me?G.removeMoveHandler:G.removeStartHandler,G.passive)}))}},G.addScrollingEffect=function(J){var K=G.props,Z=K.placement,le=K.duration,de=K.ease,Te=K.getOpenCount,we=K.switchScrollingEffect,Ie=Te&&Te();Ie===1&&we();var _e="width ".concat(le," ").concat(de),ye="transform ".concat(le," ").concat(de);G.dom.style.transition="none";switch(Z){case"right":G.dom.style.transform="translateX(-".concat(J,"px)");break;case"top":case"bottom":G.dom.style.width="calc(100% - ".concat(J,"px)"),G.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(ye,",").concat(_e),G.dom.style.width="",G.dom.style.transform="")})},G.remScrollingEffect=function(J){var K=G.props,Z=K.placement,le=K.duration,de=K.ease,Te=K.getOpenCount,we=K.switchScrollingEffect,Ie=Te&&Te();Ie||we(!0),a&&(document.body.style.overflowX="hidden"),G.dom.style.transition="none";var _e,ye="width ".concat(le," ").concat(de),Ke="transform ".concat(le," ").concat(de);switch(Z){case"left":{G.dom.style.width="100%",ye="width 0s ".concat(de," ").concat(le);break}case"right":{G.dom.style.transform="translateX(".concat(J,"px)"),G.dom.style.width="100%",ye="width 0s ".concat(de," ").concat(le),G.maskDom&&(G.maskDom.style.left="-".concat(J,"px"),G.maskDom.style.width="calc(100% + ".concat(J,"px)"));break}case"top":case"bottom":{G.dom.style.width="calc(100% + ".concat(J,"px)"),G.dom.style.height="100%",G.dom.style.transform="translateZ(0)",_e="height 0s ".concat(de," ").concat(le);break}default:break}clearTimeout(G.timeout),G.timeout=setTimeout(function(){G.dom&&(G.dom.style.transition="".concat(Ke,",").concat(_e?"".concat(_e,","):"").concat(ye),G.dom.style.transform="",G.dom.style.width="",G.dom.style.height="")})},G.getCurrentDrawerSome=function(){return!Object.keys(x).some(function(J){return x[J]})},G.getLevelDom=function(J){var K=J.level,Z=J.getContainer;if(b)return;var le=Z&&Z(),de=le?le.parentNode:null;if(G.levelDom=[],K==="all"){var Te=de?Array.prototype.slice.call(de.children):[];Te.forEach(function(we){we.nodeName!=="SCRIPT"&&we.nodeName!=="STYLE"&&we.nodeName!=="LINK"&&we!==le&&G.levelDom.push(we)})}else K&&r(K).forEach(function(we){document.querySelectorAll(we).forEach(function(Ie){G.levelDom.push(Ie)})})},G.getHorizontalBoolAndPlacementName=function(){var J=G.props.placement,K=J==="left"||J==="right",Z="translate".concat(K?"X":"Y");return{isHorizontal:K,placementName:Z}},G.state={_self:Object(p.a)(G)},G}return Object(W.a)(B,[{key:"componentDidMount",value:function(){var G=this;if(!b){var J=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return J=!0,null}}))}catch(Te){}this.passive=J?{passive:!1}:!1}var K=this.props,Z=K.open,le=K.getContainer,de=le&&le();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),Z&&(de&&de.parentNode===document.body&&(x[this.drawerId]=Z),this.openLevelTransition(),this.forceUpdate(function(){G.domFocus()}))}},{key:"componentDidUpdate",value:function(G){var J=this.props,K=J.open,Z=J.getContainer,le=Z&&Z();K!==G.open&&(K&&this.domFocus(),le&&le.parentNode===document.body&&(x[this.drawerId]=!!K),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var G=this.props,J=G.getOpenCount,K=G.open,Z=G.switchScrollingEffect,le=typeof J=="function"&&J();delete x[this.drawerId],K&&(this.setLevelTransform(!1),document.body.style.touchAction=""),le||(document.body.style.overflow="",Z(!0))}},{key:"render",value:function(){var G,J=this,K=this.props,Z=K.className,le=K.children,de=K.style,Te=K.width,we=K.height,Ie=K.defaultOpen,_e=K.open,ye=K.prefixCls,Ke=K.placement,Me=K.level,Fe=K.levelMove,Ge=K.ease,Ee=K.duration,me=K.getContainer,We=K.handler,He=K.onChange,it=K.afterVisibleChange,re=K.showMask,P=K.maskClosable,j=K.maskStyle,ee=K.onClose,$=K.onHandleClick,Q=K.keyboard,xe=K.getOpenCount,De=K.switchScrollingEffect,dt=Object(ce.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"]),Ne=this.dom?_e:!1,Be=s()(ye,(G={},Object(f.a)(G,"".concat(ye,"-").concat(Ke),!0),Object(f.a)(G,"".concat(ye,"-open"),Ne),Object(f.a)(G,Z||"",!!Z),Object(f.a)(G,"no-mask",!re),G)),tt=this.getHorizontalBoolAndPlacementName(),lt=tt.placementName,qe=Ke==="left"||Ke==="top"?"-100%":"100%",Ye=Ne?"":"".concat(lt,"(").concat(qe,")"),je=We&&O.cloneElement(We,{onClick:function(ke){We.props.onClick&&We.props.onClick(),$&&$(ke)},ref:function(ke){J.handlerDom=ke}});return O.createElement("div",Object.assign({},dt,{tabIndex:-1,className:Be,style:de,ref:function(ke){J.dom=ke},onKeyDown:Ne&&Q?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),re&&O.createElement("div",{className:"".concat(ye,"-mask"),onClick:P?ee:void 0,style:j,ref:function(ke){J.maskDom=ke}}),O.createElement("div",{className:"".concat(ye,"-content-wrapper"),style:{transform:Ye,msTransform:Ye,width:y(Te)?"".concat(Te,"px"):Te,height:y(we)?"".concat(we,"px"):we},ref:function(ke){J.contentWrapper=ke}},O.createElement("div",{className:"".concat(ye,"-content"),ref:function(ke){J.contentDom=ke},onTouchStart:Ne&&re?this.removeStartHandler:void 0,onTouchMove:Ne&&re?this.removeMoveHandler:void 0},le),je))}}],[{key:"getDerivedStateFromProps",value:function(G,J){var K=J.prevProps,Z=J._self,le={prevProps:G};if(K!==void 0){var de=G.placement,Te=G.level;de!==K.placement&&(Z.contentDom=null),Te!==K.level&&Z.getLevelDom(G)}return le}}]),B}(O.Component);h.defaultProps={switchScrollingEffect:function(){}};var E=h;function S(z){var q=w();return function(){var M=Object(T.a)(z),G;if(q){var J=Object(T.a)(this).constructor;G=Reflect.construct(M,arguments,J)}else G=M.apply(this,arguments);return Object(D.a)(this,G)}}function w(){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 R=function(z){Object(C.a)(B,z);var q=S(B);function B(M){var G;Object(ie.a)(this,B),G=q.call(this,M),G.onHandleClick=function(K){var Z=G.props,le=Z.onHandleClick,de=Z.open;if(le&&le(K),typeof de=="undefined"){var Te=G.state.open;G.setState({open:!Te})}},G.onClose=function(K){var Z=G.props,le=Z.onClose,de=Z.open;le&&le(K),typeof de=="undefined"&&G.setState({open:!1})};var J=typeof M.open!="undefined"?M.open:!!M.defaultOpen;return G.state={open:J},"onMaskClick"in M&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),G}return Object(W.a)(B,[{key:"render",value:function(){var G=this,J=this.props,K=J.defaultOpen,Z=J.getContainer,le=J.wrapperClassName,de=J.forceRender,Te=J.handler,we=Object(ce.a)(J,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Ie=this.state.open;if(!Z)return O.createElement("div",{className:le,ref:function(Ke){G.dom=Ke}},O.createElement(E,Object.assign({},we,{open:Ie,handler:Te,getContainer:function(){return G.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var _e=!!Te||de;return O.createElement(A.a,{visible:Ie,forceRender:_e,getContainer:Z,wrapperClassName:le},function(ye){var Ke=ye.visible,Me=ye.afterClose,Fe=Object(ce.a)(ye,["visible","afterClose"]);return O.createElement(E,Object.assign({},we,Fe,{open:Ke!==void 0?Ke:Ie,afterVisibleChange:Me!==void 0?Me:we.afterVisibleChange,handler:Te,onClose:G.onClose,onHandleClick:G.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(G,J){var K=J.prevProps,Z={prevProps:G};return typeof K!="undefined"&&G.open!==K.open&&(Z.open=G.open),Z}}]),B}(O.Component);R.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:O.createElement("div",{className:"drawer-handle"},O.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=R,F=Xe.a=N},fcyK:function(nt,Xe,V){},fyJ8:function(nt,Xe,V){"use strict";var ce=V("rePB"),ie=V("VTBJ"),W=V("Ff2n"),C=V("U8pU"),D=V("cDcd"),T=V.n(D),A=V("TSYQ"),O=V.n(A),f=V("c+Xe"),p=V("sR1s");function c(l){return l&&Object(C.a)(l)==="object"&&!Array.isArray(l)&&!D.isValidElement(l)}function s(l){return typeof l=="string"?!0:Object(f.c)(l)}function n(l,a){var i,t=l.prefixCls,d=l.className,v=l.record,y=l.index,b=l.dataIndex,g=l.render,m=l.children,_=l.component,x=_===void 0?"td":_,h=l.colSpan,E=l.rowSpan,S=l.fixLeft,w=l.fixRight,R=l.firstFixLeft,N=l.lastFixLeft,F=l.firstFixRight,z=l.lastFixRight,q=l.appendNode,B=l.additionalProps,M=B===void 0?{}:B,G=l.ellipsis,J=l.align,K=l.rowType,Z=l.isSticky,le="".concat(t,"-cell"),de,Te;if(m)Te=m;else{var we=Object(p.b)(v,b);if(Te=we,g){var Ie=g(we,v,y);c(Ie)?(Te=Ie.children,de=Ie.props):Te=Ie}}Object(C.a)(Te)==="object"&&!Array.isArray(Te)&&!D.isValidElement(Te)&&(Te=null),G&&(N||F)&&(Te=D.createElement("span",{className:"".concat(le,"-content")},Te));var _e=de||{},ye=_e.colSpan,Ke=_e.rowSpan,Me=_e.style,Fe=_e.className,Ge=Object(W.a)(_e,["colSpan","rowSpan","style","className"]),Ee=ye!==void 0?ye:h,me=Ke!==void 0?Ke:E;if(Ee===0||me===0)return null;var We={},He=typeof S=="number",it=typeof w=="number";He&&(We.position="sticky",We.left=S),it&&(We.position="sticky",We.right=w);var re={};J&&(re.textAlign=J);var P,j=G===!0?{showTitle:!0}:G;j&&(j.showTitle||K==="header")&&(typeof Te=="string"||typeof Te=="number"?P=Te.toString():D.isValidElement(Te)&&typeof Te.props.children=="string"&&(P=Te.props.children));var ee=Object(ie.a)(Object(ie.a)(Object(ie.a)({title:P},Ge),M),{},{colSpan:Ee&&Ee!==1?Ee:null,rowSpan:me&&me!==1?me:null,className:O()(le,d,(i={},Object(ce.a)(i,"".concat(le,"-fix-left"),He),Object(ce.a)(i,"".concat(le,"-fix-left-first"),R),Object(ce.a)(i,"".concat(le,"-fix-left-last"),N),Object(ce.a)(i,"".concat(le,"-fix-right"),it),Object(ce.a)(i,"".concat(le,"-fix-right-first"),F),Object(ce.a)(i,"".concat(le,"-fix-right-last"),z),Object(ce.a)(i,"".concat(le,"-ellipsis"),G),Object(ce.a)(i,"".concat(le,"-with-append"),q),Object(ce.a)(i,"".concat(le,"-fix-sticky"),(He||it)&&Z),i),M.className,Fe),style:Object(ie.a)(Object(ie.a)(Object(ie.a)(Object(ie.a)({},M.style),re),We),Me),ref:s(x)?a:null});return D.createElement(x,Object.assign({},ee),q,Te)}var o=D.forwardRef(n);o.displayName="Cell";var r=D.memo(o,function(l,a){return a.shouldCellUpdate?!a.shouldCellUpdate(a.record,l.record):!1});Xe.a=r},gRFJ:function(nt,Xe,V){nt.exports=[V("rdUC"),V("ynwM"),V("RELg"),V("DlR+"),V("CrYA"),V("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(nt){return nt<10?"0"+nt:nt}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(nt){return rx_escapable.lastIndex=0,rx_escapable.test(nt)?'"'+nt.replace(rx_escapable,function(Xe){var V=meta[Xe];return typeof V=="string"?V:"\\u"+("0000"+Xe.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+nt+'"'}function str(nt,Xe){var V,ce,ie,W,C=gap,D,T=Xe[nt];T&&typeof T=="object"&&typeof T.toJSON=="function"&&(T=T.toJSON(nt)),typeof rep=="function"&&(T=rep.call(Xe,nt,T));switch(typeof T){case"string":return quote(T);case"number":return isFinite(T)?String(T):"null";case"boolean":case"null":return String(T);case"object":if(!T)return"null";if(gap+=indent,D=[],Object.prototype.toString.apply(T)==="[object Array]"){for(W=T.length,V=0;V<W;V+=1)D[V]=str(V,T)||"null";return ie=D.length===0?"[]":gap?`[
|
|
|
`+gap+D.join(`,
|
|
|
`+gap)+`
|
|
|
`+C+"]":"["+D.join(",")+"]",gap=C,ie}if(rep&&typeof rep=="object")for(W=rep.length,V=0;V<W;V+=1)typeof rep[V]=="string"&&(ce=rep[V],ie=str(ce,T),ie&&D.push(quote(ce)+(gap?": ":":")+ie));else for(ce in T)Object.prototype.hasOwnProperty.call(T,ce)&&(ie=str(ce,T),ie&&D.push(quote(ce)+(gap?": ":":")+ie));return ie=D.length===0?"{}":gap?`{
|
|
|
`+gap+D.join(`,
|
|
|
`+gap)+`
|
|
|
`+C+"}":"{"+D.join(",")+"}",gap=C,ie}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(nt,Xe,V){var ce;if(gap="",indent="",typeof V=="number")for(ce=0;ce<V;ce+=1)indent+=" ";else typeof V=="string"&&(indent=V);if(rep=Xe,Xe&&typeof Xe!="function"&&(typeof Xe!="object"||typeof Xe.length!="number"))throw new Error("JSON.stringify");return str("",{"":nt})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(nt,Xe){var V,ce,ie=nt[Xe];if(ie&&typeof ie=="object")for(V in ie)Object.prototype.hasOwnProperty.call(ie,V)&&(ce=walk(ie,V),ce!==void 0?ie[V]=ce:delete ie[V]);return reviver.call(nt,Xe,ie)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(nt){return"\\u"+("0000"+nt.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},gqXR:function(nt,Xe,V){nt.exports=V.p+"static/g.a5bcde87.svg"},hW8S:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return C}),V.d(Xe,"c",function(){return D}),V.d(Xe,"b",function(){return T});var ce=V("VTBJ"),ie=V("Ff2n"),W=V("Kwbf"),C="RC_TABLE_INTERNAL_COL_DEFINE";function D(A){var O=A.expandable,f=Object(ie.a)(A,["expandable"]);return"expandable"in A?Object(ce.a)(Object(ce.a)({},f),O):f}function T(A){return Object.keys(A).reduce(function(O,f){return(f.substr(0,5)==="data-"||f.substr(0,5)==="aria-")&&(O[f]=A[f]),O},{})}},hgre:function(nt,Xe,V){"use strict";var ce=V("miYZ"),ie=V("tsqr"),W=V("9og8"),C=V("WmNS"),D=V.n(C),T=V("cDcd"),A=V.n(T),O=V("GUcZ"),f=V("ulZh"),p=V.n(f),c=V("xKgJ"),s=V("P5Jw"),n=V.n(s),o=V("bntm"),r=V("4xil"),l=V.n(r);function a(v){if(isNaN(v))return{minutes:"00",seconds:"00"};var y=new Date(v*1e3).toISOString().substr(11,8);return{hour:y.substr(0,2),minutes:y.substr(3,2),seconds:y.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function i(v,y){return v-y}function t(v){v.sort(i);for(var y=0,b=0;b<v.length-1;b++){var g=Math.abs(v[b+1]-v[b]);g<21&&(y+=g)}return y}var d=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;Xe.a=Object(T.forwardRef)(function(v,y){var b,g=v.src,m=v.toLog,_=v.videoId,x=v.logWatchHistory,h=v.courseId,E=h===void 0?null:h,S=v.startTime,w=v.handlePause,R=w===void 0?function(){}:w,N=v.handlePlay,F=N===void 0?function(){}:N,z=v.handlePlayEnded,q=z===void 0?function(){}:z,B=v.videoSpeed,M=B===void 0?1:B,G=g==null||((b=g.split("."))===null||b===void 0)?void 0:b.pop(),J=G==="flv",K=Object(T.useRef)(),Z=Object(T.useRef)(),le=Object(T.useRef)(),de=Object(T.useRef)(),Te=Object(T.useRef)(),we=Object(T.useRef)(),Ie=Object(T.useRef)(),_e=Object(T.useRef)(),ye=Object(T.useRef)(),Ke=Object(T.useRef)(),Me=Object(T.useRef)(),Fe=Object(T.useRef)(),Ge=Object(T.useRef)(),Ee=Object(T.useRef)(),me=navigator.userAgent.toLowerCase().match(d),We=me?me[0]:"pc",He=Object(T.useRef)(!1),it=Object(c.x)(),re=0,P=0,j=0,ee=null,$=!1,Q=20,xe=1,De=!1,dt=!1,Ne=[];Object(T.useImperativeHandle)(y,function(){return{getLastUpdatedTime:function(){return K.current.currentTime},getDuration:function(){return K.current.duration}}});var Be=Object(T.useCallback)(function(je){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke={point:K.current.currentTime};ee?(ke.log_id=ee,ke.watch_duration=t(Ne),ke.total_duration=P):(E?(ke.video_id=parseInt(_,10),ke.course_id=E):ke.video_id=_,ke.duration=re,ke.device=We),Ue&&(ke.ed="1");function be(){return Ce.apply(this,arguments)}function Ce(){return Ce=Object(W.a)(D.a.mark(function Pe(){var Le;return D.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return De=!0,at.next=3,x(ke);case 3:Le=at.sent,ee=Le,De=!1,je&&je();case 7:case"end":return at.stop()}},Pe)})),Ce.apply(this,arguments)}be()},[_,E]);Object(T.useEffect)(function(){ie.b.destroy();var je=null;return O.a.isSupported&&J&&g&&(g==null?void 0:g.indexOf(".m3u8"))<0?(je=O.a.createPlayer({type:"flv",volume:.8,cors:!0,url:g,muted:!1}),K.current&&(je.attachMediaElement(K.current),je.load())):K.current.setAttribute("src",g),lt(),function(){je&&(je.unload(),je.pause(),je.destroy(),je=null)}},[K,J,g]);function tt(){K.current.paused?(de.current.style.display="none",Te.current.style.display="block"):(de.current.style.display="block",Te.current.style.display="none")}function lt(){Me.current.style.display="none",Ge.current.style.display="none",Fe.current.style.display="none",K.current.muted||K.current.volume===0?Me.current.style.display="block":K.current.volume>0&&K.current.volume<=.5?Ge.current.style.display="block":Fe.current.style.display="block"}Object(T.useEffect)(function(){var je=document.getElementById("play"),Ue=document.querySelectorAll(".playback-icons use");function ke(){F(),S&&!He.current&&(K.current.currentTime=S),He.current=!0,Ne.push(K.current.currentTime),$||($=!0,m&&Be())}function be(){return Ce.apply(this,arguments)}function Ce(){return Ce=Object(W.a)(D.a.mark(function rt(){return D.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:tt(),Ne.push(K.current.currentTime),m&&Be(function(){ee=null,j=0,$=!1,De=!1,dt=!1,Ne=[],P=0,xe=1},!0);case 3:case"end":return ze.stop()}},rt)})),Ce.apply(this,arguments)}function Pe(){we.current.value=Math.round(K.current.currentTime),Ie.current.value=Math.round(K.current.currentTime)}function Le(){var rt=a(Math.round(K.current.currentTime));ye.current.innerText="".concat(rt.hour>0?rt.hour+":":"").concat(rt.minutes,":").concat(rt.seconds),ye.current.setAttribute("datetime","".concat(rt.hour>0?" "+rt.hour+" ":"").concat(rt.minutes,"m ").concat(rt.seconds,"s"))}function Ve(){var rt=Math.round(K.current.duration);we.current.setAttribute("max",rt),Ie.current.setAttribute("max",rt);var Oe=a(rt);_e.current.innerText="".concat(Oe.hour>0?Oe.hour+":":"").concat(Oe.minutes,":").concat(Oe.seconds),_e.current.setAttribute("datetime","".concat(Oe.hour>0?" "+Oe.hour+" ":"").concat(Oe.minutes,"m ").concat(Oe.seconds,"s"))}function at(){var rt=Math.round(K.current.duration);we.current.setAttribute("max",rt),Ie.current.setAttribute("max",rt);var Oe=a(rt);_e.current.innerText="".concat(Oe.hour>0?Oe.hour+":":"").concat(Oe.minutes,":").concat(Oe.seconds),_e.current.setAttribute("datetime","".concat(Oe.hour>0?" "+Oe.hour+" ":"").concat(Oe.minutes,"m ").concat(Oe.seconds,"s")),Pe(),Le();var ze=Z.current.getBoundingClientRect(),vt=ze.width,st=ze.height,It=ze.x,Pt=ze.y;if(It<0||Pt<0||!vt)return;if(!dt){var Ze=K.current.currentTime,mt=Ze-j;Math.abs(mt)<10?(P+=Math.abs(mt),j=Ze,De||P-xe*Q>=0&&(xe++,Ne.push(j),m&&Be())):(j=Ze,m&&Be())}}function _t(){dt=!0}function kt(){K.current.playing&&Ne.push(K.current.currentTime,j),j=K.current.currentTime,dt=!1}function Bt(){re=K.current.duration,re<=20&&(Q=re/3),K.current.addEventListener("play",ke)}function jt(rt){rt.preventDefault(),Object(o.a)()?(K.current.style.width="100%",K.current.style.height="100%"):K.current.style.cssText=""}function At(){R()}function pt(rt){var Oe=rt.target.dataset.seek?rt.target.dataset.seek:rt.target.value;K.current.currentTime=Oe,Ie.current.value=Oe,we.current.value=Oe}function gt(rt){var Oe=Math.round(rt.offsetX/rt.target.clientWidth*parseInt(rt.target.getAttribute("max"),10));we.current.setAttribute("data-seek",Oe);var ze=a(Oe);Ke.current.textContent="".concat(ze.hour>0?ze.hour+":":"").concat(ze.minutes,":").concat(ze.seconds);var vt=K.current.getBoundingClientRect();Ke.current.style.left="".concat(rt.pageX-vt.left,"px")}return le.current.addEventListener(Object(o.c)(),jt),K.current.addEventListener("canplay",Bt),K.current.addEventListener("ended",be),K.current.addEventListener("seeking",_t),K.current.addEventListener("seeked",kt),K.current.addEventListener("loadedmetadata",Ve),we.current.addEventListener("mousemove",gt),we.current.addEventListener("input",pt),K.current.addEventListener("timeupdate",at),K.current.addEventListener("pause",At),K.current.addEventListener("volumechange",lt),function(){K.current.removeEventListener("canplay",Bt),K.current.removeEventListener("play",ke),K.current.removeEventListener("ended",be),K.current.removeEventListener("seeking",_t),K.current.removeEventListener("seeked",kt),we.current.removeEventListener("mousemove",gt),we.current.removeEventListener("input",pt),K.current.removeEventListener("timeupdate",at),K.current.removeEventListener("pause",At),K.current.removeEventListener("loadedmetadata",Ve),K.current.removeEventListener("volumechange",lt),K.current.playing&&(Ne.push(j,K.current.currentTime),m&&Be())}},[K,g]),Object(T.useEffect)(function(){if(K.current.onended=function(){q(K)},K.current.oncontextmenu=function(){return!1},(g==null?void 0:g.indexOf(".m3u8"))>-1){if(K.current.canPlayType("application/vnd.apple.mpegurl"))K.current.src=g;else if(p.a.isSupported()){var je=new p.a;je.loadSource(g),je.attachMedia(K.current)}}},[g]),Object(T.useEffect)(function(){K.current.playbackRate=M},[M]);var qe=function(){K.current.paused||K.current.ended?K.current.play():K.current.pause(),tt()};function Ye(){K.current.muted=!K.current.muted,K.current.muted?(Ee.current.setAttribute("data-volume",volume.value),Ee.current.value=0):Ee.current.value=Ee.current.dataset.volume}return A.a.createElement("div",{style:{position:"relative"},ref:le},A.a.createElement("div",{ref:Z,className:"".concat(l.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(l.a.animate__loop)},it?it.login:" "),A.a.createElement("div",{className:l.a.container},A.a.createElement("div",{className:l.a["video-container"],id:"video-container"},A.a.createElement("div",{className:l.a["playback-animation"],id:"playback-animation"},A.a.createElement("svg",{className:l.a["playback-icons"]},A.a.createElement("use",{className:"hidden",href:"#play-icon"}),A.a.createElement("use",{href:"#pause"}))),A.a.createElement("video",{className:l.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:K,autoPlay:!1}),A.a.createElement("div",{className:"".concat(l.a["video-controls"]," "),id:"video-controls"},A.a.createElement("div",{className:l.a["bottom-controls"]},A.a.createElement("div",{className:l.a["left-controls"]},A.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:qe},A.a.createElement("svg",{className:l.a["playback-icons"]},A.a.createElement("use",{ref:Te,href:"#play-icon"}),A.a.createElement("use",{ref:de,style:{display:"none"},href:"#pause"}))),A.a.createElement("div",{className:l.a.time},A.a.createElement("time",{id:"time-elapsed",ref:ye},"00:00"),A.a.createElement("span",null," / "),A.a.createElement("time",{id:"duration",ref:_e},"00:00"))),A.a.createElement("div",{className:l.a["right-controls"]},A.a.createElement(s.CopyToClipboard,{text:g,onCopy:function(){return ie.b.success("\u590D\u5236\u6210\u529F")}},A.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},A.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),A.a.createElement("div",{className:l.a["volume-controls"]},A.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l.a["volume-button"],id:"volume-button",onClick:Ye},A.a.createElement("i",{ref:Me,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:Ge,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),A.a.createElement("i",{ref:Fe,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),A.a.createElement("input",{className:l.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Ee,style:{display:"none"},onClick:lt})),A.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l.a["fullscreen-button"],onClick:function(){Object(o.a)()?Object(o.b)():Object(o.d)(le.current)}},A.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),A.a.createElement("div",{className:l.a["video-progress"]},A.a.createElement("progress",{ref:Ie,value:"0",min:"0"}),A.a.createElement("input",{className:l.a.seek,ref:we,value:"0",min:"0",type:"range",step:"1"}),A.a.createElement("div",{className:l.a["seek-tooltip"],ref:Ke,id:"seek-tooltip"},"00:00"))))),A.a.createElement("svg",{style:{display:"none"}},A.a.createElement("defs",null,A.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),A.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),A.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},A.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"})),A.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},A.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"})),A.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},A.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"})),A.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},A.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"})),A.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},A.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"})),A.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},A.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(nt,Xe,V){},je13:function(nt,Xe,V){var ce=V("5nXd"),ie=V("gRFJ"),W=[V("uQRt")];nt.exports=ce.createStore(ie,W)},kSUc:function(nt,Xe,V){},"kaH+":function(nt,Xe,V){"use strict";var ce=V("+L6B"),ie=V("2/Rp"),W=V("tJVT"),C=V("cDcd"),D=V.n(C),T=V("UZu5"),A=V.n(T),O=V("dhSg"),f=V("rLCj"),p=V("dF/Y"),c=V("4i/N");Xe.a=function(){var s=Object(C.useState)(""),n=Object(W.a)(s,2),o=n[0],r=n[1],l=Object(C.useState)(0),a=Object(W.a)(l,2),i=a[0],t=a[1],d=Object(C.useRef)("");Object(C.useEffect)(function(){var x=O.a.subscribe("preview-image",function(h){r(h),document.body.style.overflow="hidden"});return x},[]),Object(C.useEffect)(function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}},[]),Object(C.useEffect)(function(){d.current=o},[o]);function v(x){x.keyCode==27&&d.current&&y()}function y(){document.body.style.overflow="auto",r("")}function b(){t(i+90)}var g=Object(C.useRef)(),m=Object(C.useRef)(),_=function(h){(h.nativeEvent.target===g.current||h.nativeEvent.target===m.current)&&y()};return D.a.createElement(C.Fragment,null,o?D.a.createElement("div",{className:"image-preview-container",ref:g,onClick:_},D.a.createElement("div",{className:"button-group"},D.a.createElement(ie.a,{onClick:b},"\u65CB\u8F6C",D.a.createElement(f.a,null)),D.a.createElement(ie.a,{href:o},"\u4E0B\u8F7D",D.a.createElement(p.a,null)),D.a.createElement(ie.a,{onClick:y},"\u5173\u95ED",D.a.createElement(c.a,null))),D.a.createElement("div",{className:"preview-wrp-group",ref:m},D.a.createElement("img",{className:"image-preview",src:o,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(i,"deg)")}}))):null)}},kovY:function(nt,Xe,V){nt.exports=V.p+"static/e.eabfa286.svg"},lOMy:function(nt,Xe,V){},lZu9:function(nt,Xe,V){(function(ce){ce(V("VrN/"),V("1eCo"),V("8EBN"))})(function(ce){"use strict";ce.defineMode("markdown",function(ie,W){var C=ce.getMode(ie,"text/html"),D=C.name=="null";function T(B){if(ce.findModeByName){var M=ce.findModeByName(B);M&&(B=M.mime||M.mimes[0])}var G=ce.getMode(ie,B);return G.name=="null"?null:G}W.highlightFormatting===void 0&&(W.highlightFormatting=!1),W.maxBlockquoteDepth===void 0&&(W.maxBlockquoteDepth=0),W.taskLists===void 0&&(W.taskLists=!1),W.strikethrough===void 0&&(W.strikethrough=!1),W.emoji===void 0&&(W.emoji=!1),W.fencedCodeBlockHighlighting===void 0&&(W.fencedCodeBlockHighlighting=!0),W.fencedCodeBlockDefaultMode===void 0&&(W.fencedCodeBlockDefaultMode="text/plain"),W.xml===void 0&&(W.xml=!0),W.tokenTypeOverrides===void 0&&(W.tokenTypeOverrides={});var A={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 O in A)A.hasOwnProperty(O)&&W.tokenTypeOverrides[O]&&(A[O]=W.tokenTypeOverrides[O]);var f=/^([*\-_])(?:\s*\1){2,}\s*$/,p=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,s=W.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,n=/^ {0,3}(?:\={1,}|-{2,})\s*$/,o=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,i=" ";function t(B,M,G){return M.f=M.inline=G,G(B,M)}function d(B,M,G){return M.f=M.block=G,G(B,M)}function v(B){return!B||!/\S/.test(B.string)}function y(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==g){var M=D;if(!M){var G=ce.innerMode(C,B.htmlState);M=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}M&&(B.f=h,B.block=b,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function b(B,M){var G=B.column()===M.indentation,J=v(M.prevLine.stream),K=M.indentedCode,Z=M.prevLine.hr,le=M.list!==!1,de=(M.listStack[M.listStack.length-1]||0)+3;M.indentedCode=!1;var Te=M.indentation;if(M.indentationDiff===null&&(M.indentationDiff=M.indentation,le)){for(M.list=null;Te<M.listStack[M.listStack.length-1];)M.listStack.pop(),M.listStack.length?M.indentation=M.listStack[M.listStack.length-1]:M.list=!1;M.list!==!1&&(M.indentationDiff=Te-M.listStack[M.listStack.length-1])}var we=!J&&!Z&&!M.prevLine.header&&(!le||!K)&&!M.prevLine.fencedCodeEnd,Ie=(M.list===!1||Z||J)&&M.indentation<=de&&B.match(f),_e=null;if(M.indentationDiff>=4&&(K||M.prevLine.fencedCodeEnd||M.prevLine.header||J))return B.skipToEnd(),M.indentedCode=!0,A.code;if(B.eatSpace())return null;if(G&&M.indentation<=de&&(_e=B.match(s))&&_e[1].length<=6)return M.quote=0,M.header=_e[1].length,M.thisLine.header=!0,W.highlightFormatting&&(M.formatting="header"),M.f=M.inline,_(M);if(M.indentation<=de&&B.eat(">"))return M.quote=G?1:M.quote+1,W.highlightFormatting&&(M.formatting="quote"),B.eatSpace(),_(M);if(!Ie&&!M.setext&&G&&M.indentation<=de&&(_e=B.match(p))){var ye=_e[1]?"ol":"ul";return M.indentation=Te+B.current().length,M.list=!0,M.quote=0,M.listStack.push(M.indentation),M.em=!1,M.strong=!1,M.code=!1,M.strikethrough=!1,W.taskLists&&B.match(c,!1)&&(M.taskList=!0),M.f=M.inline,W.highlightFormatting&&(M.formatting=["list","list-"+ye]),_(M)}else{if(G&&M.indentation<=de&&(_e=B.match(r,!0)))return M.quote=0,M.fencedEndRE=new RegExp(_e[1]+"+ *$"),M.localMode=W.fencedCodeBlockHighlighting&&T(_e[2]||W.fencedCodeBlockDefaultMode),M.localMode&&(M.localState=ce.startState(M.localMode)),M.f=M.block=m,W.highlightFormatting&&(M.formatting="code-block"),M.code=-1,_(M);if(M.setext||(!we||!le)&&!M.quote&&M.list===!1&&!M.code&&!Ie&&!l.test(B.string)&&(_e=B.lookAhead(1))&&(_e=_e.match(n)))return M.setext?(M.header=M.setext,M.setext=0,B.skipToEnd(),W.highlightFormatting&&(M.formatting="header")):(M.header=_e[0].charAt(0)=="="?1:2,M.setext=M.header),M.thisLine.header=!0,M.f=M.inline,_(M);if(Ie)return B.skipToEnd(),M.hr=!0,M.thisLine.hr=!0,A.hr;if(B.peek()==="[")return t(B,M,N)}return t(B,M,M.inline)}function g(B,M){var G=C.token(B,M.htmlState);if(!D){var J=ce.innerMode(C,M.htmlState);(J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText||M.md_inside&&B.current().indexOf(">")>-1)&&(M.f=h,M.block=b,M.htmlState=null)}return G}function m(B,M){var G=M.listStack[M.listStack.length-1]||0,J=M.indentation<G,K=G+3;if(M.fencedEndRE&&M.indentation<=K&&(J||B.match(M.fencedEndRE))){W.highlightFormatting&&(M.formatting="code-block");var Z;return J||(Z=_(M)),M.localMode=M.localState=null,M.block=b,M.f=h,M.fencedEndRE=null,M.code=0,M.thisLine.fencedCodeEnd=!0,J?d(B,M,M.block):Z}else return M.localMode?M.localMode.token(B,M.localState):(B.skipToEnd(),A.code)}function _(B){var M=[];if(B.formatting){M.push(A.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var G=0;G<B.formatting.length;G++)M.push(A.formatting+"-"+B.formatting[G]),B.formatting[G]==="header"&&M.push(A.formatting+"-"+B.formatting[G]+"-"+B.header),B.formatting[G]==="quote"&&(!W.maxBlockquoteDepth||W.maxBlockquoteDepth>=B.quote?M.push(A.formatting+"-"+B.formatting[G]+"-"+B.quote):M.push("error"))}if(B.taskOpen)return M.push("meta"),M.length?M.join(" "):null;if(B.taskClosed)return M.push("property"),M.length?M.join(" "):null;if(B.linkHref?M.push(A.linkHref,"url"):(B.strong&&M.push(A.strong),B.em&&M.push(A.em),B.strikethrough&&M.push(A.strikethrough),B.emoji&&M.push(A.emoji),B.linkText&&M.push(A.linkText),B.code&&M.push(A.code),B.image&&M.push(A.image),B.imageAltText&&M.push(A.imageAltText,"link"),B.imageMarker&&M.push(A.imageMarker)),B.header&&M.push(A.header,A.header+"-"+B.header),B.quote&&(M.push(A.quote),!W.maxBlockquoteDepth||W.maxBlockquoteDepth>=B.quote?M.push(A.quote+"-"+B.quote):M.push(A.quote+"-"+W.maxBlockquoteDepth)),B.list!==!1){var J=(B.listStack.length-1)%3;J?J===1?M.push(A.list2):M.push(A.list3):M.push(A.list1)}return B.trailingSpaceNewLine?M.push("trailing-space-new-line"):B.trailingSpace&&M.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),M.length?M.join(" "):null}function x(B,M){return B.match(o,!0)?_(M):void 0}function h(B,M){var G=M.text(B,M);if(typeof G!="undefined")return G;if(M.list)return M.list=null,_(M);if(M.taskList){var J=B.match(c,!0)[1]===" ";return J?M.taskOpen=!0:M.taskClosed=!0,W.highlightFormatting&&(M.formatting="task"),M.taskList=!1,_(M)}if(M.taskOpen=!1,M.taskClosed=!1,M.header&&B.match(/^#+$/,!0))return W.highlightFormatting&&(M.formatting="header"),_(M);var K=B.next();if(M.linkTitle){M.linkTitle=!1;var Z=K;K==="("&&(Z=")"),Z=(Z+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var le="^\\s*(?:[^"+Z+"\\\\]+|\\\\\\\\|\\\\.)"+Z;if(B.match(new RegExp(le),!0))return A.linkHref}if(K==="`"){var de=M.formatting;W.highlightFormatting&&(M.formatting="code"),B.eatWhile("`");var Te=B.current().length;if(M.code==0&&(!M.quote||Te==1))return M.code=Te,_(M);if(Te==M.code){var we=_(M);return M.code=0,we}else return M.formatting=de,_(M)}else if(M.code)return _(M);if(K==="\\"&&(B.next(),W.highlightFormatting)){var Ie=_(M),_e=A.formatting+"-escape";return Ie?Ie+" "+_e:_e}if(K==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return M.imageMarker=!0,M.image=!0,W.highlightFormatting&&(M.formatting="image"),_(M);if(K==="["&&M.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return M.imageMarker=!1,M.imageAltText=!0,W.highlightFormatting&&(M.formatting="image"),_(M);if(K==="]"&&M.imageAltText){W.highlightFormatting&&(M.formatting="image");var Ie=_(M);return M.imageAltText=!1,M.image=!1,M.inline=M.f=S,Ie}if(K==="["&&!M.image)return M.linkText&&B.match(/^.*?\]/)||(M.linkText=!0,W.highlightFormatting&&(M.formatting="link")),_(M);if(K==="]"&&M.linkText){W.highlightFormatting&&(M.formatting="link");var Ie=_(M);return M.linkText=!1,M.inline=M.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?S:h,Ie}if(K==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){M.f=M.inline=E,W.highlightFormatting&&(M.formatting="link");var Ie=_(M);return Ie?Ie+=" ":Ie="",Ie+A.linkInline}if(K==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){M.f=M.inline=E,W.highlightFormatting&&(M.formatting="link");var Ie=_(M);return Ie?Ie+=" ":Ie="",Ie+A.linkEmail}if(W.xml&&K==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ye=B.string.indexOf(">",B.pos);if(ye!=-1){var Ke=B.string.substring(B.start,ye);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ke)&&(M.md_inside=!0)}return B.backUp(1),M.htmlState=ce.startState(C),d(B,M,g)}if(W.xml&&K==="<"&&B.match(/^\/\w*?>/))return M.md_inside=!1,"tag";if(K==="*"||K==="_"){for(var Me=1,Fe=B.pos==1?" ":B.string.charAt(B.pos-2);Me<3&&B.eat(K);)Me++;var Ge=B.peek()||" ",Ee=!/\s/.test(Ge)&&(!a.test(Ge)||/\s/.test(Fe)||a.test(Fe)),me=!/\s/.test(Fe)&&(!a.test(Fe)||/\s/.test(Ge)||a.test(Ge)),We=null,He=null;if(Me%2&&(!M.em&&Ee&&(K==="*"||!me||a.test(Fe))?We=!0:M.em==K&&me&&(K==="*"||!Ee||a.test(Ge))&&(We=!1)),Me>1&&(!M.strong&&Ee&&(K==="*"||!me||a.test(Fe))?He=!0:M.strong==K&&me&&(K==="*"||!Ee||a.test(Ge))&&(He=!1)),He!=null||We!=null){W.highlightFormatting&&(M.formatting=We==null?"strong":He==null?"em":"strong em"),We===!0&&(M.em=K),He===!0&&(M.strong=K);var we=_(M);return We===!1&&(M.em=!1),He===!1&&(M.strong=!1),we}}else if(K===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return _(M);B.backUp(1)}if(W.strikethrough){if(K==="~"&&B.eatWhile(K)){if(M.strikethrough){W.highlightFormatting&&(M.formatting="strikethrough");var we=_(M);return M.strikethrough=!1,we}else if(B.match(/^[^\s]/,!1))return M.strikethrough=!0,W.highlightFormatting&&(M.formatting="strikethrough"),_(M)}else if(K===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return _(M);B.backUp(2)}}if(W.emoji&&K===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){M.emoji=!0,W.highlightFormatting&&(M.formatting="emoji");var it=_(M);return M.emoji=!1,it}return K===" "&&(B.match(/^ +$/,!1)?M.trailingSpace++:M.trailingSpace&&(M.trailingSpaceNewLine=!0)),_(M)}function E(B,M){var G=B.next();if(G===">"){M.f=M.inline=h,W.highlightFormatting&&(M.formatting="link");var J=_(M);return J?J+=" ":J="",J+A.linkInline}return B.match(/^[^>]+/,!0),A.linkInline}function S(B,M){if(B.eatSpace())return null;var G=B.next();return G==="("||G==="["?(M.f=M.inline=R(G==="("?")":"]"),W.highlightFormatting&&(M.formatting="link-string"),M.linkHref=!0,_(M)):"error"}var w={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function R(B){return function(M,G){var J=M.next();if(J===B){G.f=G.inline=h,W.highlightFormatting&&(G.formatting="link-string");var K=_(G);return G.linkHref=!1,K}return M.match(w[B]),G.linkHref=!0,_(G)}}function N(B,M){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(M.f=F,B.next(),W.highlightFormatting&&(M.formatting="link"),M.linkText=!0,_(M)):t(B,M,h)}function F(B,M){if(B.match(/^\]:/,!0)){M.f=M.inline=z,W.highlightFormatting&&(M.formatting="link");var G=_(M);return M.linkText=!1,G}return B.match(/^([^\]\\]|\\.)+/,!0),A.linkText}function z(B,M){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?M.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),M.f=M.inline=h,A.linkHref+" url")}var q={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:h,text:x,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&ce.copyState(C,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?ce.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,M){if(M.formatting=!1,B!=M.thisLine.stream){if(M.header=0,M.hr=!1,B.match(/^\s*$/,!0))return y(M),null;if(M.prevLine=M.thisLine,M.thisLine={stream:B},M.taskList=!1,M.trailingSpace=0,M.trailingSpaceNewLine=!1,!M.localState&&(M.f=M.block,M.f!=g)){var G=B.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(M.indentation=G,M.indentationDiff=null,G>0)return null}}return M.f(B,M)},innerMode:function(B){return B.block==g?{state:B.htmlState,mode:C}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:q}},indent:function(B,M,G){return B.block==g&&C.indent?C.indent(B.htmlState,M,G):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,M,G):ce.Pass},blankLine:y,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return q},"xml"),ce.defineMIME("text/markdown","markdown"),ce.defineMIME("text/x-markdown","markdown")})},n6Qo:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return O});var ce=V("cDcd"),ie=V("biw7"),W=V("fyJ8");function C(f){var p=f.className,c=f.index,s=f.children,n=f.colSpan,o=f.rowSpan,r=ce.useContext(ie.a),l=r.prefixCls,a=r.fixedInfoList,i=a[c];return ce.createElement(W.a,Object.assign({className:p,index:c,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:s,props:{colSpan:n,rowSpan:o}}}},i))}function D(f){return ce.createElement("tr",Object.assign({},f))}function T(f){var p=f.children,c=ce.useContext(ie.a),s=c.prefixCls;return ce.createElement("tfoot",{className:"".concat(s,"-summary")},p)}var A=Xe.b=T,O={Cell:C,Row:D}},nCk5:function(nt,Xe,V){nt.exports=V.p+"static/d.53bf6ae3.svg"},nWbc:function(nt,Xe,V){},oE5q:function(nt,Xe,V){nt.exports=V.p+"static/t.0b94c5c3.svg"},oFv4:function(nt,Xe,V){nt.exports=V.p+"static/internal.da228387.png"},osHv:function(nt,Xe,V){(function(ce){ce(V("VrN/"))})(function(ce){"use strict";var ie=ce.Pos;function W(a,i){return a.line-i.line||a.ch-i.ch}var C="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",D=C+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",T=new RegExp("<(/?)(["+C+"]["+D+"]*)","g");function A(a,i,t,d){this.line=i,this.ch=t,this.cm=a,this.text=a.getLine(i),this.min=d?Math.max(d.from,a.firstLine()):a.firstLine(),this.max=d?Math.min(d.to-1,a.lastLine()):a.lastLine()}function O(a,i){var t=a.cm.getTokenTypeAt(ie(a.line,i));return t&&/\btag\b/.test(t)}function f(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function p(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function c(a){for(;;){var i=a.text.indexOf(">",a.ch);if(i==-1){if(f(a))continue;return}if(!O(a,i+1)){a.ch=i+1;continue}var t=a.text.lastIndexOf("/",i),d=t>-1&&!/\S/.test(a.text.slice(t+1,i));return a.ch=i+1,d?"selfClose":"regular"}}function s(a){for(;;){var i=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(i==-1){if(p(a))continue;return}if(!O(a,i+1)){a.ch=i;continue}T.lastIndex=i,a.ch=i;var t=T.exec(a.text);if(t&&t.index==i)return t}}function n(a){for(;;){T.lastIndex=a.ch;var i=T.exec(a.text);if(!i){if(f(a))continue;return}if(!O(a,i.index+1)){a.ch=i.index+1;continue}return a.ch=i.index+i[0].length,i}}function o(a){for(;;){var i=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(i==-1){if(p(a))continue;return}if(!O(a,i+1)){a.ch=i;continue}var t=a.text.lastIndexOf("/",i),d=t>-1&&!/\S/.test(a.text.slice(t+1,i));return a.ch=i+1,d?"selfClose":"regular"}}function r(a,i){for(var t=[];;){var d=n(a),v,y=a.line,b=a.ch-(d?d[0].length:0);if(!d||!(v=c(a)))return;if(v=="selfClose")continue;if(d[1]){for(var g=t.length-1;g>=0;--g)if(t[g]==d[2]){t.length=g;break}if(g<0&&(!i||i==d[2]))return{tag:d[2],from:ie(y,b),to:ie(a.line,a.ch)}}else t.push(d[2])}}function l(a,i){for(var t=[];;){var d=o(a);if(!d)return;if(d=="selfClose"){s(a);continue}var v=a.line,y=a.ch,b=s(a);if(!b)return;if(b[1])t.push(b[2]);else{for(var g=t.length-1;g>=0;--g)if(t[g]==b[2]){t.length=g;break}if(g<0&&(!i||i==b[2]))return{tag:b[2],from:ie(a.line,a.ch),to:ie(v,y)}}}}ce.registerHelper("fold","xml",function(a,i){for(var t=new A(a,i.line,0);;){var d=n(t);if(!d||t.line!=i.line)return;var v=c(t);if(!v)return;if(!d[1]&&v!="selfClose"){var y=ie(t.line,t.ch),b=r(t,d[2]);return b&&W(b.from,y)>0?{from:y,to:b.from}:null}}}),ce.findMatchingTag=function(a,i,t){var d=new A(a,i.line,i.ch,t);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var v=c(d),y=v&&ie(d.line,d.ch),b=v&&s(d);if(!v||!b||W(d,i)>0)return;var g={from:ie(d.line,d.ch),to:y,tag:b[2]};return v=="selfClose"?{open:g,close:null,at:"open"}:b[1]?{open:l(d,b[2]),close:g,at:"close"}:(d=new A(a,y.line,y.ch,t),{open:g,close:r(d,b[2]),at:"open"})},ce.findEnclosingTag=function(a,i,t,d){for(var v=new A(a,i.line,i.ch,t);;){var y=l(v,d);if(!y)break;var b=new A(a,i.line,i.ch,t),g=r(b,y.tag);if(g)return{open:y,close:g}}},ce.scanForClosingTag=function(a,i,t,d){var v=new A(a,i.line,i.ch,d?{from:0,to:d}:null);return r(v,t)}})},p5ED:function(nt,Xe,V){"use strict";var ce=V("+L6B"),ie=V("2/Rp"),W=V("5Dmo"),C=V("3S7+"),D=V("k1fw"),T=V("tJVT"),A=V("cDcd"),O=V.n(A),f=V("vHTk"),p=V.n(f),c=V("yEEn"),s=V("ZW9T"),n=V("1vsH");Xe.a=function(o){var r=o.name,l=o.data,a=o.theme,i=o.type,t=o.filename,d=o.monacoEditor,v=o.className,y=o.style,b=o.close,g=o.onClose,m=o.hasMask,_=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),x=Object(T.a)(_,2),h=x[0],E=x[1],S=Object(A.useState)(""),w=Object(T.a)(S,2),R=w[0],N=w[1],F,z=1024*1024,q=10*z,B=Object(A.useRef)();i==="office"&&(F=Object(n.V)(l).filesize,F>q&&(i="other")),t&&(d.filename=t),Object(A.useEffect)(function(){var J,K,Z=(J=document.cookie)===null||J===void 0||((K=J.replace(/\s/g,""))===null||K===void 0)?void 0:K.split(";");Z==null||Z.map(function(le){var de=le.split("=");de[0]==="_educoder_session"&&N(de[1])})},[]);var M=function(){if(l.startsWith("http")||l.startsWith("/")){G();return}Object(n.z)(t||"educoder",l,t)},G=function(){Object(n.x)(t||r,l)};return console.log("data:",l,"fileanme:",t," name:",r),O.a.createElement("div",{style:Object(D.a)({},y||{}),className:"".concat(m&&p.a.bgBlack," ").concat(i?p.a.wrp:"hide")},b&&O.a.createElement("div",{className:p.a.close,ref:B},O.a.createElement(C.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},O.a.createElement("span",{onClick:G},O.a.createElement("i",{className:"icon-quxiaozhiding"}))),O.a.createElement(C.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},O.a.createElement("span",{className:"",onClick:g},O.a.createElement("i",{className:"icon-guanbi1"})))),O.a.createElement("div",{className:"".concat(p.a[v]," ").concat(v," ").concat(p.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&O.a.createElement(s.b,d)),i==="audio"&&O.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),i==="video"&&O.a.createElement(O.a.Fragment,null,l!=null&&l.startsWith("/")?O.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):O.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),i==="html"&&O.a.createElement("iframe",{src:l+"&disposition=inline"}),i==="pdf"&&O.a.createElement("embed",{className:p.a.embed,src:l}),i==="image"&&O.a.createElement(O.a.Fragment,null,O.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),i==="other"&&O.a.createElement("div",null,O.a.createElement(ie.a,{type:"primary",size:"large",onClick:M},O.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&O.a.createElement(ie.a,{type:"primary",size:"large",onClick:M},O.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,Xe,V){},pYxM:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ppsT:function(nt,Xe,V){(function(ce){var ie,ie;!function(W){if(!0)window.OSS=W(),nt.exports=W();else var C}(function(){var W;return function(){function C(D,T,A){function O(c,s){if(!T[c]){if(!D[c]){var n=typeof ie=="function"&&ie;if(!s&&n)return ie(c,!0);if(f)return f(c,!0);var o=new Error("Cannot find module '"+c+"'");throw o.code="MODULE_NOT_FOUND",o}var r=T[c]={exports:{}};D[c][0].call(r.exports,function(l){return O(D[c][1][l]||l)},r,r.exports,C,D,T,A)}return T[c].exports}for(var f=typeof ie=="function"&&ie,p=0;p<A.length;p++)O(A[p]);return O}return C}()({1:[function(C,D,T){"use strict";var A=C("./browser/client");A.Buffer=C("buffer").Buffer,A.co=C("co"),A.urllib=C("../shims/xhr"),A.version=C("./browser/version").version,D.exports=A},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(C,D,T){(function(A,O){"use strict";function f(J){return J&&J.__esModule?J:{default:J}}function p(J,K){return J[K]||J[K.toLowerCase()]}function c(J,K){var Z=h.parse(J);if(!Z.protocol){var le=K?"https://":"http://";Z=h.parse(le+J)}if(Z.protocol!=="http:"&&Z.protocol!=="https:")throw new Error("Endpoint protocol must be http or https.");return Z}function s(J,K,Z){var le=Z?"https://":"http://",de=K?"-internal.aliyuncs.com":".aliyuncs.com";return J.substr(0,"vpc100-oss-cn-".length)==="vpc100-oss-cn-"&&(de=".aliyuncs.com"),h.parse(le+J+de)}function n(){return document&&document.location&&document.location.protocol==="https:"}function o(J,K){if(!(this instanceof o))return new o(J,K);J&&J.inited?this.options=J:this.options=o.initOptions(J),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=R,this.agent=this.options.agent||M),this.ctx=K,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var r=C("babel-runtime/regenerator"),l=f(r),a=C("babel-runtime/core-js/object/keys"),i=f(a),t=C("debug")("ali-oss"),d=C("./../../shims/crypto/crypto.js"),v=C("path"),y=C("copy-to"),b=C("mime"),g=C("xml2js"),m=C("humanize-ms"),_=C("agentkeepalive"),x=C("merge-descriptors"),h=C("url"),E=C("is-type-of"),S=C("platform"),w=C("utility"),R=C("urllib"),N=C("./version"),F=C("dateformat"),z=C("bowser"),q=C("../common/signUtils"),B=C("../common/utils"),M=new _;D.exports=o,o.initOptions=function(J){if(!J||!J.accessKeyId||!J.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var K=n(),Z={region:"oss-cn-hangzhou",internal:!1,secure:K,bucket:null,endpoint:null,cname:!1};if((0,i.default)(J).forEach(function(le){J[le]!==void 0&&(Z[le]=J[le])}),Z.accessKeyId=Z.accessKeyId.trim(),Z.accessKeySecret=Z.accessKeySecret.trim(),Z.timeout&&(Z.timeout=m(Z.timeout)),Z.endpoint)Z.endpoint=c(Z.endpoint,Z.secure);else{if(!Z.region)throw new Error("require options.endpoint or options.region");Z.endpoint=s(Z.region,Z.internal,Z.secure)}return Z.inited=!0,Z};var G=o.prototype;x(G,C("./object")),x(G,C("./managed_upload")),x(G,C("../common/multipart")),x(G,C("../common/thunkpool.js")),o.Wrapper=C("./wrapper"),G.signature=function(J){return t("authorization stringToSign: %s",J),q.computeSignature(this.options.accessKeySecret,J)},G.authorization=function(J,K,Z,le){var de=q.buildCanonicalString(J.toUpperCase(),K,{headers:le,parameters:Z});return q.authorization(this.options.accessKeyId,this.options.accessKeySecret,de)},G.createRequest=function(J){var K={"x-oss-date":F(+new Date+this.options.amendTimeSkewed,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.options.stsToken&&(K["x-oss-security-token"]=this.options.stsToken),y(J.headers).to(K),p(K,"Content-Type")||(J.mime===b.default_type&&(J.mime=""),J.mime&&J.mime.indexOf("/")>0?K["Content-Type"]=J.mime:K["Content-Type"]=b.getType(J.mime||v.extname(J.object||""))||"application/octet-stream"),J.content&&(K["Content-Md5"]=d.createHash("md5").update(new O(J.content,"utf8")).digest("base64"),K["Content-Length"]||(K["Content-Length"]=J.content.length));var Z=this._getResource(J);K.authorization=this.authorization(J.method,Z,J.subres,K);var le=this._getReqUrl(J);t("request %s %s, with headers %j, !!stream: %s",J.method,le,K,!!J.stream);var de=J.timeout||this.options.timeout;return{url:le,params:{agent:this.agent,method:J.method,content:J.content,stream:J.stream,headers:K,timeout:de,writeStream:J.writeStream,customResponse:J.customResponse,ctx:J.ctx||this.ctx}}},G.request=l.default.mark(function J(K){var Z,le,de,Te;return l.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return Z=this.createRequest(K),le=void 0,de=void 0,we.prev=3,we.next=6,this.urllib.request(Z.url,Z.params);case 6:le=we.sent,t("response %s %s, got %s, headers: %j",K.method,Z.url,le.status,le.headers),we.next=13;break;case 10:we.prev=10,we.t0=we.catch(3),de=we.t0;case 13:if(Te=void 0,!le||!K.successStatuses||K.successStatuses.indexOf(le.status)!==-1){we.next=26;break}return we.next=17,this.requestError(le);case 17:if(Te=we.sent,Te.code!=="RequestTimeTooSkewed"){we.next=23;break}return this.options.amendTimeSkewed=+new Date(Te.serverTime)-new Date,we.next=22,this.request(K);case 22:return we.abrupt("return",we.sent);case 23:Te.params=K,we.next=30;break;case 26:if(!de){we.next=30;break}return we.next=29,this.requestError(de);case 29:Te=we.sent;case 30:if(!Te){we.next=32;break}throw Te;case 32:if(!K.xmlResponse){we.next=36;break}return we.next=35,this.parseXML(le.data);case 35:le.data=we.sent;case 36:return we.abrupt("return",le);case 37:case"end":return we.stop()}},J,this,[[3,10]])}),G._getResource=function(J){var K="/";return J.bucket&&(K+=J.bucket+"/"),J.object&&(K+=J.object),K},G._isIP=function(J){return B._isIP(J)},G._escape=function(J){return w.encodeURIComponent(J).replace(/%2F/g,"/")},G._getReqUrl=function(J){var K={};y(this.options.endpoint).to(K);var Z=this._isIP(K.hostname),le=this.options.cname;!J.bucket||le||Z||(K.host=J.bucket+"."+K.host);var de="/";J.bucket&&Z&&(de+=J.bucket+"/"),J.object&&(de+=this._escape(J.object).replace(/\+/g,"%2B")),K.pathname=de;var Te={};if(J.query&&x(Te,J.query),J.subres){var we={};E.string(J.subres)?we[J.subres]="":E.array(J.subres)?J.subres.forEach(function(Ie){we[Ie]=""}):we=J.subres,x(Te,we)}return K.query=Te,h.format(K)},G._getUserAgent=function(){var J=A&&A.browser?"js":"nodejs",K="aliyun-sdk-"+J+"/"+N.version,Z=S.description;return!Z&&A&&(Z="Node.js "+A.version.slice(1)+" on "+A.platform+" "+A.arch),this._checkUserAgent(K+" "+Z)},G._checkUserAgent=function(J){return J.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},G.checkBrowserAndVersion=function(J,K){return z.name===J&&z.version.split(".")[0]===K},G.parseXML=function(J){return function(K){O.isBuffer(J)&&(J=J.toString()),g.parseString(J,{explicitRoot:!1,explicitArray:!1},K)}},G.requestError=l.default.mark(function J(K){var Z,le,de,Te;return l.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(Z=null,K.data&&K.data.length){we.next=5;break}K.status===-1||K.status===-2?(Z=new Error(K.message),Z.name=K.name,Z.status=K.status,Z.code=K.name):(K.status===404?(Z=new Error("Object not exists"),Z.name="NoSuchKeyError",Z.status=404,Z.code="NoSuchKey"):K.status===412?(Z=new Error("Pre condition failed"),Z.name="PreconditionFailedError",Z.status=412,Z.code="PreconditionFailed"):(Z=new Error("Unknow error, status: "+K.status),Z.name="UnknowError",Z.status=K.status),Z.requestId=K.headers["x-oss-request-id"],Z.host=""),we.next=30;break;case 5:return le=String(K.data),t("request response error data: %s",le),de=void 0,we.prev=8,we.next=11,this.parseXML(le)||{};case 11:de=we.sent,we.next=21;break;case 14:return we.prev=14,we.t0=we.catch(8),t(le),we.t0.message+=`
|
|
|
raw xml: `+le,we.t0.status=K.status,we.t0.requestId=K.headers["x-oss-request-id"],we.abrupt("return",we.t0);case 21:Te=de.Message||"unknow request error, status: "+K.status,de.Condition&&(Te+=" (condition: "+de.Condition+")"),Z=new Error(Te),Z.name=de.Code?de.Code+"Error":"UnknowError",Z.status=K.status,Z.code=de.Code,Z.requestId=de.RequestId,Z.hostId=de.HostId,Z.serverTime=de.ServerTime;case 30:return t("generate error %j",Z),we.abrupt("return",Z);case 32:case"end":return we.stop()}},J,this,[[8,14]])})}).call(this,C("_process"),C("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(C,D,T){(function(A){"use strict";function O(y){return y&&y.__esModule?y:{default:y}}function f(y,b){if(!(this instanceof f))return new f(y,b);v.call(this,b),this.file=y,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var p=C("babel-runtime/core-js/array/from"),c=O(p),s=C("babel-runtime/regenerator"),n=O(s),o=C("is-type-of"),r=C("util"),l=C("path"),a=C("mime"),i=C("copy-to"),t=T;t.multipartUpload=n.default.mark(function y(b,g,m){var _,x,h,E,S,w,R,N,F;return n.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 _=102400,m.mime||(o.file(g)?m.mime=a.getType(l.extname(g.name)):o.blob(g)?m.mime=g.type:m.mime=a.getType(l.extname(g))),m.headers=m.headers||{},this._convertMetaToHeaders(m.meta,m.headers),z.next=12,this._getFileSize(g);case 12:if(!((x=z.sent)<_)){z.next=25;break}return h=this._createStream(g,0,x),m.contentLength=x,z.next=18,this.putStream(b,h,m);case 18:if(E=z.sent,!m||!m.progress){z.next=22;break}return z.next=22,m.progress(1);case 22:return S={res:E.res,bucket:this.options.bucket,name:b,etag:E.res.headers.etag},(m.headers&&m.headers["x-oss-callback"]||m.callback)&&(S.data=E.data),z.abrupt("return",S);case 25:if(!(m.partSize&&m.partSize<_)){z.next=27;break}throw new Error("partSize must not be smaller than "+_);case 27:return z.next=29,this.initMultipartUpload(b,m);case 29:if(w=z.sent,R=w.uploadId,N=this._getPartSize(x,m.partSize),F={file:g,name:b,fileSize:x,partSize:N,uploadId:R,doneParts:[]},!m||!m.progress){z.next=36;break}return z.next=36,m.progress(0,F,w.res);case 36:return z.next=38,this._resumeMultipart(F,m);case 38:return z.abrupt("return",z.sent);case 39:case"end":return z.stop()}},y,this)}),t._resumeMultipart=n.default.mark(function y(b,g){var m,_,x,h,E,S,w,R,N,F,z,q,B,M,G,J,K,Z,le,de,Te;return n.default.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:if(!this.isCancel()){we.next=2;break}throw this._makeCancelEvent();case 2:if(m=b.file,_=b.fileSize,x=b.partSize,h=b.uploadId,E=b.doneParts,S=b.name,w=[],E.length>0&&i(E).to(w),R=this._divideParts(_,x),N=R.length,F=!1,z=n.default.mark(function Ie(_e,ye){var Ke,Me,Fe;return n.default.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:if(_e.isCancel()){Ge.next=21;break}return Ge.prev=1,Ke=R[ye-1],Me={stream:_e._createStream(m,Ke.start,Ke.end),size:Ke.end-Ke.start},Ge.next=6,_e._uploadPart(S,h,ye,Me);case 6:if(Fe=Ge.sent,_e.isCancel()||F){Ge.next=13;break}if(b.doneParts.push({number:ye,etag:Fe.res.headers.etag}),w.push({number:ye,etag:Fe.res.headers.etag}),!g||!g.progress){Ge.next=13;break}return Ge.next=13,g.progress(E.length/N,b,Fe.res);case 13:Ge.next=21;break;case 15:if(Ge.prev=15,Ge.t0=Ge.catch(1),_e.isCancel()){Ge.next=21;break}throw _e.cancel(),Ge.t0.partNum=ye,Ge.t0;case 21:case"end":return Ge.stop()}},Ie,this,[[1,15]])}),q=(0,c.default)(new Array(N),function(Ie,_e){return _e+1}),B=w.map(function(Ie){return Ie.number}),M=q.filter(function(Ie){return B.indexOf(Ie)<0}),G=5,J=g.parallel||G,!this.checkBrowserAndVersion("Internet Explorer","10")&&J!==1){we.next=26;break}K=0;case 16:if(!(K<M.length)){we.next=24;break}if(!this.isCancel()){we.next=19;break}throw this._makeCancelEvent();case 19:return we.next=21,z(this,M[K]);case 21:K++,we.next=16;break;case 24:we.next=40;break;case 26:for(Z=[],le=0;le<M.length;le++)Z.push(z(this,M[le]));return we.next=30,this._thunkPool(Z,J);case 30:if(de=we.sent,F=!0,!(de&&de.length>0)){we.next=37;break}throw this.resetCancelFlag(),Te=de[0],Te.message="Failed to upload some parts with error: "+Te.toString()+" part_num: "+Te.partNum,Te;case 37:if(!this.isCancel()){we.next=40;break}throw Z=null,this._makeCancelEvent();case 40:return we.next=42,this.completeMultipartUpload(S,h,w,g);case 42:return we.abrupt("return",we.sent);case 43:case"end":return we.stop()}},y,this)}),o.file=function(y){return typeof File!="undefined"&&y instanceof File},o.blob=function(y){return typeof Blob!="undefined"&&y instanceof Blob},t._getFileSize=n.default.mark(function y(b){var g;return n.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!o.buffer(b)){m.next=4;break}return m.abrupt("return",b.length);case 4:if(!o.blob(b)&&!o.file(b)){m.next=6;break}return m.abrupt("return",b.size);case 6:if(!o.string(b)){m.next=11;break}return m.next=9,this._statFile(b);case 9:return g=m.sent,m.abrupt("return",g.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return m.stop()}},y,this)});var d=C("stream"),v=d.Readable;r.inherits(f,v),f.prototype.readFileAndPush=function(y){if(this.fileBuffer)for(var b=!0;b&&this.fileBuffer&&this.start<this.fileBuffer.length;){var g=this.start,m=g+y;m=m>this.fileBuffer.length?this.fileBuffer.length:m,this.start=m,b=this.push(this.fileBuffer.slice(g,m))}},f.prototype._read=function(y){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);y=y||16384;var b=this;this.reader.onload=function(g){b.fileBuffer=new A(new Uint8Array(g.target.result)),b.file=null,b.readFileAndPush(y)},this.start===0?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(y)},t._createStream=function(y,b,g){if(o.blob(y)||o.file(y))return new f(y.slice(b,g));throw new Error("_createStream requires File/String.")},t._getPartSize=function(y,b){return b?Math.max(Math.ceil(y/1e4),b):1048576},t._divideParts=function(y,b){for(var g=Math.ceil(y/b),m=[],_=0;_<g;_++){var x=b*_,h=Math.min(x+b,y);m.push({start:x,end:h})}return m},t._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,C("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(C,D,T){"use strict";function A(b){return b&&b.__esModule?b:{default:b}}var O=C("babel-runtime/core-js/object/keys"),f=A(O),p=C("babel-runtime/regenerator"),c=A(p),s=C("debug")("ali-oss:object"),n=C("utility"),o=C("fs"),r=C("is-type-of"),l=C("url"),a=C("copy-to"),i=C("path"),t=C("mime"),d=C("../common/callback"),v=C("../common/signUtils"),y=T;y.append=c.default.mark(function b(g,m,_){var x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return _=_||{},_.position===void 0&&(_.position="0"),_.subres={append:"",position:_.position},_.method="POST",h.next=6,this.put(g,m,_);case 6:return x=h.sent,x.nextAppendPosition=x.res.headers["x-oss-next-append-position"],h.abrupt("return",x);case 9:case"end":return h.stop()}},b,this)}),y.put=c.default.mark(function b(g,m,_){var x,h,E,S,w,R;return c.default.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(x=void 0,_=_||{},!r.buffer(m)){N.next=6;break}x=m,N.next=18;break;case 6:if(!r.blob(m)&&!r.file(m)){N.next=17;break}return _.mime||(r.file(m)?_.mime=t.getType(i.extname(m.name)):_.mime=m.type),h=this._createStream(m,0,m.size),N.next=11,this._getFileSize(m);case 11:return _.contentLength=N.sent,N.next=14,this.putStream(g,h,_);case 14:return N.abrupt("return",N.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return _.headers=_.headers||{},this._convertMetaToHeaders(_.meta,_.headers),E=_.method||"PUT",S=this._objectRequestParams(E,g,_),d.encodeCallback(S,_),S.mime=_.mime,S.content=x,S.successStatuses=[200],N.next=28,this.request(S);case 28:return w=N.sent,R={name:g,url:this._objectUrl(g),res:w.res},S.headers&&S.headers["x-oss-callback"]&&(R.data=JSON.parse(w.data.toString())),N.abrupt("return",R);case 32:case"end":return N.stop()}},b,this)}),y.putStream=c.default.mark(function b(g,m,_){var x,h,E,S;return c.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return _=_||{},_.headers=_.headers||{},_.contentLength?_.headers["Content-Length"]=_.contentLength:_.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(_.meta,_.headers),x=_.method||"PUT",h=this._objectRequestParams(x,g,_),d.encodeCallback(h,_),h.mime=_.mime,h.stream=m,h.successStatuses=[200],w.next=12,this.request(h);case 12:return E=w.sent,S={name:g,url:this._objectUrl(g),res:E.res},h.headers&&h.headers["x-oss-callback"]&&(S.data=JSON.parse(E.data.toString())),w.abrupt("return",S);case 16:case"end":return w.stop()}},b,this)}),y.head=c.default.mark(function b(g,m){var _,x,h;return c.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return _=this._objectRequestParams("HEAD",g,m),_.successStatuses=[200,304],E.next=4,this.request(_);case 4:return x=E.sent,h={meta:null,res:x.res,status:x.status},x.status===200&&(0,f.default)(x.headers).forEach(function(S){S.indexOf("x-oss-meta-")===0&&(h.meta||(h.meta={}),h.meta[S.substring(11)]=x.headers[S])}),E.abrupt("return",h);case 8:case"end":return E.stop()}},b,this)}),y.get=c.default.mark(function b(g,m,_){var x,h,E,S;return c.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return x=null,h=!1,r.writableStream(m)?x=m:r.string(m)?(x=o.createWriteStream(m),h=!0):_=m,_=_||{},_.process&&(_.subres=_.subres||{},_.subres["x-oss-process"]=_.process),E=void 0,w.prev=6,S=this._objectRequestParams("GET",g,_),S.writeStream=x,S.successStatuses=[200,206,304],w.next=12,this.request(S);case 12:E=w.sent,h&&x.destroy(),w.next=24;break;case 16:if(w.prev=16,w.t0=w.catch(6),!h){w.next=23;break}return x.destroy(),s("get error: %s, delete the exists file %s",w.t0,m),w.next=23,this._deleteFileSafe(m);case 23:throw w.t0;case 24:return w.abrupt("return",{res:E.res,content:E.data});case 25:case"end":return w.stop()}},b,this,[[6,16]])}),y.getStream=c.default.mark(function b(g,m){var _,x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return m=m||{},_=this._objectRequestParams("GET",g,m),_.customResponse=!0,_.successStatuses=[200,206,304],h.next=6,this.request(_);case 6:return x=h.sent,h.abrupt("return",{stream:x.res,res:{status:x.status,headers:x.headers}});case 8:case"end":return h.stop()}},b,this)}),y.delete=c.default.mark(function b(g,m){var _,x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return _=this._objectRequestParams("DELETE",g,m),_.successStatuses=[204],h.next=4,this.request(_);case 4:return x=h.sent,h.abrupt("return",{res:x.res});case 6:case"end":return h.stop()}},b,this)}),y.deleteMulti=c.default.mark(function b(g,m){var _,x,h,E,S,w;return c.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:for(m=m||{},_=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<Delete>
|
|
|
`,m.quiet?_+=` <Quiet>true</Quiet>
|
|
|
`:_+=` <Quiet>false</Quiet>
|
|
|
`,x=0;x<g.length;x++)_+=" <Object><Key>"+n.escape(this._objectName(g[x]))+`</Key></Object>
|
|
|
`;return _+="</Delete>",s("delete multi objects: %s",_),m.subres="delete",h=this._objectRequestParams("POST","",m),h.mime="xml",h.content=_,h.xmlResponse=!0,h.successStatuses=[200],R.next=14,this.request(h);case 14:return E=R.sent,S=E.data,w=S&&S.Deleted||null,w&&(Array.isArray(w)||(w=[w]),w=w.map(function(N){return N.Key})),R.abrupt("return",{res:E.res,deleted:w});case 19:case"end":return R.stop()}},b,this)}),y.copy=c.default.mark(function b(g,m,_){var x,h,E;return c.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return _=_||{},_.headers=_.headers||{},(0,f.default)(_.headers).forEach(function(w){_.headers["x-oss-copy-source-"+w.toLowerCase()]=_.headers[w]}),_.meta&&(_.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(_.meta,_.headers),m=m[0]!=="/"?"/"+this.options.bucket+"/"+encodeURIComponent(m):"/"+encodeURIComponent(m.slice(1)),_.headers["x-oss-copy-source"]=m,x=this._objectRequestParams("PUT",g,_),x.xmlResponse=!0,x.successStatuses=[200,304],S.next=12,this.request(x);case 12:return h=S.sent,E=h.data,E&&(E={etag:E.ETag,lastModified:E.LastModified}),S.abrupt("return",{data:E,res:h.res});case 16:case"end":return S.stop()}},b,this)}),y.putMeta=c.default.mark(function b(g,m,_){return c.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,this.copy(g,g,{meta:m||{},timeout:_&&_.timeout,ctx:_&&_.ctx});case 2:return x.abrupt("return",x.sent);case 3:case"end":return x.stop()}},b,this)}),y.list=c.default.mark(function b(g,m){var _,x,h,E,S;return c.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return _=this._objectRequestParams("GET","",m),_.query=g,_.xmlResponse=!0,_.successStatuses=[200],w.next=6,this.request(_);case 6:return x=w.sent,h=x.data.Contents,E=this,h&&(Array.isArray(h)||(h=[h]),h=h.map(function(R){return{name:R.Key,url:E._objectUrl(R.Key),lastModified:R.LastModified,etag:R.ETag,type:R.Type,size:Number(R.Size),storageClass:R.StorageClass,owner:{id:R.Owner.ID,displayName:R.Owner.DisplayName}}})),S=x.data.CommonPrefixes||null,S&&(Array.isArray(S)||(S=[S]),S=S.map(function(R){return R.Prefix})),w.abrupt("return",{res:x.res,objects:h,prefixes:S,nextMarker:x.data.NextMarker||null,isTruncated:x.data.IsTruncated==="true"});case 13:case"end":return w.stop()}},b,this)}),y.putACL=c.default.mark(function b(g,m,_){var x,h;return c.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return _=_||{},_.subres="acl",_.headers=_.headers||{},_.headers["x-oss-object-acl"]=m,g=this._objectName(g),x=this._objectRequestParams("PUT",g,_),x.successStatuses=[200],E.next=9,this.request(x);case 9:return h=E.sent,E.abrupt("return",{res:h.res});case 11:case"end":return E.stop()}},b,this)}),y.getACL=c.default.mark(function b(g,m){var _,x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return m=m||{},m.subres="acl",g=this._objectName(g),_=this._objectRequestParams("GET",g,m),_.successStatuses=[200],_.xmlResponse=!0,h.next=8,this.request(_);case 8:return x=h.sent,h.abrupt("return",{acl:x.data.AccessControlList.Grant,owner:{id:x.data.Owner.ID,displayName:x.data.Owner.DisplayName},res:x.res});case 10:case"end":return h.stop()}},b,this)}),y.restore=c.default.mark(function b(g,m){var _,x;return c.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return m=m||{},m.subres="restore",_=this._objectRequestParams("POST",g,m),_.successStatuses=[202],h.next=6,this.request(_);case 6:return x=h.sent,h.abrupt("return",{res:x.res});case 8:case"end":return h.stop()}},b,this)}),y.signatureUrl=function(b,g){g=g||{},b=this._objectName(b),g.method=g.method||"GET";var m=n.timestamp()+(g.expires||1800),_={bucket:this.options.bucket,object:b},x=this._getResource(_);this.options.stsToken&&(g["security-token"]=this.options.stsToken);var h=v._signatureForURL(this.options.accessKeySecret,g,x,m),E=l.parse(this._getReqUrl(_));return E.query={OSSAccessKeyId:this.options.accessKeyId,Expires:m,Signature:h.Signature},a(h.subResource).to(E.query),E.format()},y.getObjectUrl=function(b,g){return g?g[g.length-1]!=="/"&&(g+="/"):g=this.options.endpoint.format(),g+this._escape(this._objectName(b))},y._objectUrl=function(b){return this._getReqUrl({bucket:this.options.bucket,object:b})},y.generateObjectUrl=function(b,g){if(g)g[g.length-1]!=="/"&&(g+="/");else{g=this.options.endpoint.format();var m=l.parse(g),_=this.options.bucket;m.hostname=_+"."+m.hostname,m.host=_+"."+m.host,g=m.format()}return g+this._escape(this._objectName(b))},y._objectRequestParams=function(b,g,m){if(!this.options.bucket)throw new Error("Please create a bucket first");m=m||{},g=this._objectName(g);var _={object:g,bucket:this.options.bucket,method:b,subres:m&&m.subres,timeout:m&&m.timeout,ctx:m&&m.ctx};return m.headers&&(_.headers={},a(m.headers).to(_.headers)),_},y._objectName=function(b){return b.replace(/^\/+/,"")},y._statFile=function(b){return function(g){o.stat(b,g)}},y._convertMetaToHeaders=function(b,g){b&&(0,f.default)(b).forEach(function(m){g["x-oss-meta-"+m]=b[m]})},y._deleteFileSafe=function(b){return function(g){o.exists(b,function(m){m?o.unlink(b,function(_){_&&s("unlink %j error: %s",b,_),g()}):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(C,D,T){"use strict";T.version="5.3.1"},{}],6:[function(C,D,T){"use strict";function A(i){return i&&i.__esModule?i:{default:i}}function O(i){return i&&typeof i.next=="function"&&typeof i.throw=="function"}function f(i){if(!i)return!1;var t=i.constructor;return!!t&&(t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction"||O(t.prototype)||O(i.prototype))}function p(i,t){var d=new i(t),v=(0,r.default)(d),y=(0,r.default)((0,n.default)(d));v.concat(y).forEach(function(b){f(d[b])?this[b]=l.wrap(d[b]).bind(d):this[b]=d[b]},this)}function c(i){if(!(this instanceof c))return new c(i);p.call(this,a,i)}var s=C("babel-runtime/core-js/object/get-prototype-of"),n=A(s),o=C("babel-runtime/core-js/object/keys"),r=A(o),l=C("co"),a=C("./client");D.exports=c,c.STS=function i(t){if(!(this instanceof i))return new i(t);p.call(this,a.STS,t)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(C,D,T){(function(A){"use strict";function O(n){return n&&n.__esModule?n:{default:n}}var f=C("babel-runtime/core-js/object/keys"),p=O(f),c=C("babel-runtime/core-js/json/stringify"),s=O(c);T.encodeCallback=function(n,o){if(n.headers=n.headers||{},!Object.prototype.hasOwnProperty.call(n.headers,"x-oss-callback")&&o.callback){var r={callbackUrl:encodeURI(o.callback.url),callbackBody:o.callback.body};o.callback.host&&(r.callbackHost=o.callback.host),o.callback.contentType&&(r.callbackBodyType=o.callback.contentType);var l=new A((0,s.default)(r)).toString("base64");if(n.headers["x-oss-callback"]=l,o.callback.customValue){var a={};(0,p.default)(o.callback.customValue).forEach(function(i){a["x:"+i]=o.callback.customValue[i]}),n.headers["x-oss-callback-var"]=new A((0,s.default)(a)).toString("base64")}}}}).call(this,C("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(C,D,T){"use strict";var A=C("babel-runtime/regenerator"),O=function(s){return s&&s.__esModule?s:{default:s}}(A),f=C("copy-to"),p=C("./callback"),c=T;c.listUploads=O.default.mark(function s(n,o){var r,l,a,i;return O.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=o||{},r={},f(o).to(r),r.subres="uploads",l=this._objectRequestParams("GET","",r),l.query=n,l.xmlResponse=!0,l.successStatuses=[200],t.next=10,this.request(l);case 10:return a=t.sent,i=a.data.Upload||[],Array.isArray(i)||(i=[i]),i=i.map(function(d){return{name:d.Key,uploadId:d.UploadId,initiated:d.Initiated}}),t.abrupt("return",{res:a.res,uploads:i,bucket:a.data.Bucket,nextKeyMarker:a.data.NextKeyMarker,nextUploadIdMarker:a.data.NextUploadIdMarker,isTruncated:a.data.IsTruncated==="true"});case 15:case"end":return t.stop()}},s,this)}),c.listParts=O.default.mark(function s(n,o,r,l){var a,i,t;return O.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return l=l||{},a={},f(l).to(a),a.subres={uploadId:o},i=this._objectRequestParams("GET",n,a),i.query=r,i.xmlResponse=!0,i.successStatuses=[200],d.next=10,this.request(i);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()}},s,this)}),c.abortMultipartUpload=O.default.mark(function s(n,o,r){var l,a,i;return O.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.cancel(),r=r||{},l={},f(r).to(l),l.subres={uploadId:o},a=this._objectRequestParams("DELETE",n,l),a.successStatuses=[204],t.next=9,this.request(a);case 9:return i=t.sent,t.abrupt("return",{res:i.res});case 11:case"end":return t.stop()}},s,this)}),c.initMultipartUpload=O.default.mark(function s(n,o){var r,l,a;return O.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return o=o||{},r={},f(o).to(r),r.headers=r.headers||{},this._convertMetaToHeaders(o.meta,r.headers),r.subres="uploads",l=this._objectRequestParams("POST",n,r),l.mime=o.mime,l.xmlResponse=!0,l.successStatuses=[200],i.next=12,this.request(l);case 12:return a=i.sent,i.abrupt("return",{res:a.res,bucket:a.data.Bucket,name:a.data.Key,uploadId:a.data.UploadId});case 14:case"end":return i.stop()}},s,this)}),c.uploadPart=O.default.mark(function s(n,o,r,l,a,i,t){var d;return O.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return d={stream:this._createStream(l,a,i),size:i-a},v.next=3,this._uploadPart(n,o,r,d,t);case 3:return v.abrupt("return",v.sent);case 4:case"end":return v.stop()}},s,this)}),c.completeMultipartUpload=O.default.mark(function s(n,o,r,l){var a,i,t,d,v,y,b,g;return O.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:for(a=r.concat().sort(function(_,x){return _.number-x.number}).filter(function(_,x,h){return!x||_.number!==h[x-1].number}),i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<CompleteMultipartUpload>
|
|
|
`,t=0;t<a.length;t++)d=a[t],i+=`<Part>
|
|
|
`,i+="<PartNumber>"+d.number+`</PartNumber>
|
|
|
`,i+="<ETag>"+d.etag+`</ETag>
|
|
|
`,i+=`</Part>
|
|
|
`;return i+="</CompleteMultipartUpload>",l=l||{},v={},f(l).to(v),v.subres={uploadId:o},y=this._objectRequestParams("POST",n,v),p.encodeCallback(y,v),y.mime="xml",y.content=i,y.headers&&y.headers["x-oss-callback"]||(y.xmlResponse=!0),y.successStatuses=[200],m.next=16,this.request(y);case 16:return b=m.sent,g={res:b.res,bucket:y.bucket,name:n,etag:b.res.headers.etag},y.headers&&y.headers["x-oss-callback"]&&(g.data=JSON.parse(b.data.toString())),m.abrupt("return",g);case 20:case"end":return m.stop()}},s,this)}),c._uploadPart=O.default.mark(function s(n,o,r,l,a){var i,t,d;return O.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=a||{},i={},f(a).to(i),i.headers={"Content-Length":l.size},i.subres={partNumber:r,uploadId:o},t=this._objectRequestParams("PUT",n,i),t.mime=i.mime,t.stream=l.stream,t.successStatuses=[200],v.next=11,this.request(t);case 11:return d=v.sent,l.stream=null,t.stream=null,v.abrupt("return",{name:n,etag:d.res.headers.etag,res:d.res});case 15:case"end":return v.stop()}},s,this)})},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(C,D,T){(function(A){"use strict";function O(r){return r&&r.__esModule?r:{default:r}}var f=C("babel-runtime/core-js/json/stringify"),p=O(f),c=C("babel-runtime/core-js/object/keys"),s=O(c),n=C("./../../shims/crypto/crypto.js"),o=C("is-type-of");T.buildCanonicalizedResource=function(r,l){var a=""+r,i="?";if(o.string(l)&&l.trim()!=="")a+=i+l;else if(o.array(l))l.sort(),a+=i+l.join("&");else if(l){var t=function(v,y){return v[0]>y[0]?1:v[0]<y[0]?-1:0},d=function(v){a+=i+v,l[v]&&(a+="="+l[v]),i="&"};(0,s.default)(l).sort(t).forEach(d)}return a},T.buildCanonicalString=function(r,l,a,i){a=a||{};var t=a.headers||{},d=[],v={},y=[r.toUpperCase(),t["Content-Md5"]||"",t["Content-Type"]||t["Content-Type".toLowerCase()],i||t["x-oss-date"]];return(0,s.default)(t).forEach(function(b){var g=b.toLowerCase();g.indexOf("x-oss-")===0&&(v[g]=String(t[b]).trim())}),(0,s.default)(v).sort().forEach(function(b){d.push(b+":"+v[b])}),y=y.concat(d),y.push(this.buildCanonicalizedResource(l,a.parameters)),y.join(`
|
|
|
`)},T.computeSignature=function(r,l){return n.createHmac("sha1",r).update(new A(l,"utf8")).digest("base64")},T.authorization=function(r,l,a){return"OSS "+r+":"+this.computeSignature(l,a)},T._signatureForURL=function(r,l,a,i){var t={},d={};if(l.process&&(d["x-oss-process"]=l.process),l.response&&(0,s.default)(l.response).forEach(function(g){var m="response-"+g.toLowerCase();d[m]=l.response[g]}),(0,s.default)(l).forEach(function(g){var m=g.toLowerCase(),_=l[g];m.indexOf("x-oss-")===0?t[m]=_:m.indexOf("content-md5")===0||m.indexOf("content-type")===0?t[g]=_:m!=="expires"&&m!=="response"&&m!=="process"&&m!=="method"&&(d[m]=_)}),Object.prototype.hasOwnProperty.call(l,"security-token")&&(d["security-token"]=l["security-token"]),Object.prototype.hasOwnProperty.call(l,"callback")){var v={callbackUrl:encodeURI(l.callback.url),callbackBody:l.callback.body};if(l.callback.host&&(v.callbackHost=l.callback.host),l.callback.contentType&&(v.callbackBodyType=l.callback.contentType),d.callback=new A((0,p.default)(v)).toString("base64"),l.callback.customValue){var y={};(0,s.default)(l.callback.customValue).forEach(function(g){y["x:"+g]=l.callback.customValue[g]}),d["callback-var"]=new A((0,p.default)(y)).toString("base64")}}var b=this.buildCanonicalString(l.method,a,{headers:t,parameters:d},i.toString());return{Signature:this.computeSignature(r,b),subResource:d}}}).call(this,C("buffer").Buffer)},{"./../../shims/crypto/crypto.js":237,"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38,"is-type-of":165}],10:[function(C,D,T){"use strict";var A=C("babel-runtime/regenerator"),O=function(n){return n&&n.__esModule?n:{default:n}}(A),f=C("co"),p=C("co-priority-queue"),c=C("any-promise"),s=T;s._thunkPool=function(n,o){function r(d,v){++i===d.length&&v(t)}function l(d,v){function y(){var h;return O.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:h=void 0;case 1:if(a.isCancel()){E.next=9;break}return E.next=4,m.next();case 4:return h=E.sent,E.next=7,h();case 7:E.next=1;break;case 9:_+=1,_===d&&(m.fns=[],m.buffer=[],v(t));case 11:case"end":return E.stop()}},g,this)}function b(h){console.error(h.stack)}for(var g=O.default.mark(y),m=new p,_=0,x=0;x<d;x++)f(y).catch(b);return function(h,E){return function(S){m.push(O.default.mark(function w(){return O.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.prev=0,R.t0=S,R.next=4,h;case 4:R.t1=R.sent,(0,R.t0)(null,R.t1),R.next=11;break;case 8:R.prev=8,R.t2=R.catch(0),S(R.t2);case 11:case"end":return R.stop()}},w,this,[[0,8]])}),E)}}}var a=this,i=0,t=[];return new c(function(d){function v(_){return O.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,g(n[_]);case 2:r(n,d);case 3:case"end":return x.stop()}},b,this)}function y(_){t.push(_),r(n,d)}for(var b=O.default.mark(v),g=new l(o,d),m=0;m<n.length;m++)f(v(m)).catch(y)})},s.cancel=function(){this.options.cancelFlag=!0},s.isCancel=function(){return this.options.cancelFlag},s.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(C,D,T){"use strict";T._isIP=function(A){var O=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,f=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;return O.test(A)||f.test(A)}},{}],12:[function(C,D,T){function A(){}D.exports=A,D.exports.HttpsAgent=A},{}],13:[function(C,D,T){D.exports=C("./register")().Promise},{"./register":15}],14:[function(C,D,T){"use strict";var A=null;D.exports=function(O,f){return function(p,c){p=p||null,c=c||{};var s=c.global!==!1;if(A===null&&s&&(A=O["@@any-promise/REGISTRATION"]||null),A!==null&&p!==null&&A.implementation!==p)throw new Error('any-promise already defined as "'+A.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return A===null&&(A=p!==null&&c.Promise!==void 0?{Promise:c.Promise,implementation:p}:f(p),s&&(O["@@any-promise/REGISTRATION"]=A)),A}}},{}],15:[function(C,D,T){"use strict";function A(){if(window.Promise===void 0)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}D.exports=C("./loader")(window,A)},{"./loader":14}],16:[function(C,D,T){D.exports={default:C("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(C,D,T){D.exports={default:C("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(C,D,T){D.exports={default:C("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(C,D,T){D.exports={default:C("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(C,D,T){D.exports={default:C("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(C,D,T){D.exports={default:C("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(C,D,T){D.exports={default:C("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(C,D,T){D.exports={default:C("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(C,D,T){D.exports={default:C("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(C,D,T){D.exports={default:C("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(C,D,T){D.exports={default:C("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(C,D,T){D.exports={default:C("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(C,D,T){D.exports={default:C("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(C,D,T){D.exports={default:C("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(C,D,T){"use strict";T.__esModule=!0,T.default=function(A,O){if(!(A instanceof O))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(C,D,T){"use strict";T.__esModule=!0;var A=C("../core-js/object/define-property"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);T.default=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,O.default)(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}()},{"../core-js/object/define-property":20}],32:[function(C,D,T){"use strict";function A(n){return n&&n.__esModule?n:{default:n}}T.__esModule=!0;var O=C("../core-js/symbol/iterator"),f=A(O),p=C("../core-js/symbol"),c=A(p),s=typeof c.default=="function"&&typeof f.default=="symbol"?function(n){return typeof n}:function(n){return n&&typeof c.default=="function"&&n.constructor===c.default&&n!==c.default.prototype?"symbol":typeof n};T.default=typeof c.default=="function"&&s(f.default)==="symbol"?function(n){return n===void 0?"undefined":s(n)}:function(n){return n&&typeof c.default=="function"&&n.constructor===c.default&&n!==c.default.prototype?"symbol":n===void 0?"undefined":s(n)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(C,D,T){D.exports=C("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(C,D,T){"use strict";function A(d){var v=d.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=d.indexOf("=");return y===-1&&(y=v),[y,y===v?0:4-y%4]}function O(d){var v=A(d),y=v[0],b=v[1];return 3*(y+b)/4-b}function f(d,v,y){return 3*(v+y)/4-y}function p(d){for(var v,y=A(d),b=y[0],g=y[1],m=new l(f(d,b,g)),_=0,x=g>0?b-4:b,h=0;h<x;h+=4)v=r[d.charCodeAt(h)]<<18|r[d.charCodeAt(h+1)]<<12|r[d.charCodeAt(h+2)]<<6|r[d.charCodeAt(h+3)],m[_++]=v>>16&255,m[_++]=v>>8&255,m[_++]=255&v;return g===2&&(v=r[d.charCodeAt(h)]<<2|r[d.charCodeAt(h+1)]>>4,m[_++]=255&v),g===1&&(v=r[d.charCodeAt(h)]<<10|r[d.charCodeAt(h+1)]<<4|r[d.charCodeAt(h+2)]>>2,m[_++]=v>>8&255,m[_++]=255&v),m}function c(d){return o[d>>18&63]+o[d>>12&63]+o[d>>6&63]+o[63&d]}function s(d,v,y){for(var b,g=[],m=v;m<y;m+=3)b=(d[m]<<16&16711680)+(d[m+1]<<8&65280)+(255&d[m+2]),g.push(c(b));return g.join("")}function n(d){for(var v,y=d.length,b=y%3,g=[],m=0,_=y-b;m<_;m+=16383)g.push(s(d,m,m+16383>_?_:m+16383));return b===1?(v=d[y-1],g.push(o[v>>2]+o[v<<4&63]+"==")):b===2&&(v=(d[y-2]<<8)+d[y-1],g.push(o[v>>10]+o[v>>4&63]+o[v<<2&63]+"=")),g.join("")}T.byteLength=O,T.toByteArray=p,T.fromByteArray=n;for(var o=[],r=[],l=typeof Uint8Array!="undefined"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,t=a.length;i<t;++i)o[i]=a[i],r[a.charCodeAt(i)]=i;r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],35:[function(C,D,T){!function(A,O,f){D!==void 0&&D.exports?D.exports=f():typeof W=="function"&&W.amd?W("bowser",f):A.bowser=f()}(this,0,function(){function A(r){function l(J){var K=r.match(J);return K&&K.length>1&&K[1]||""}function a(J){var K=r.match(J);return K&&K.length>1&&K[2]||""}var i,t=l(/(ipod|iphone|ipad)/i).toLowerCase(),d=/like android/i.test(r),v=!d&&/android/i.test(r),y=/nexus\s*[0-6]\s*/i.test(r),b=!y&&/nexus\s*[0-9]+/i.test(r),g=/CrOS/.test(r),m=/silk/i.test(r),_=/sailfish/i.test(r),x=/tizen/i.test(r),h=/(web|hpw)os/i.test(r),E=/windows phone/i.test(r),S=(/SamsungBrowser/i.test(r),!E&&/windows/i.test(r)),w=!t&&!m&&/macintosh/i.test(r),R=!v&&!_&&!x&&!h&&/linux/i.test(r),N=a(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),F=l(/version\/(\d+(\.\d+)?)/i),z=/tablet/i.test(r)&&!/tablet pc/i.test(r),q=!z&&/[^-]mobi/i.test(r),B=/xbox/i.test(r);/opera/i.test(r)?i={name:"Opera",opera:n,version:F||l(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(r)?i={name:"Opera",opera:n,version:l(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||F}:/SamsungBrowser/i.test(r)?i={name:"Samsung Internet for Android",samsungBrowser:n,version:F||l(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(r)?i={name:"Opera Coast",coast:n,version:F||l(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(r)?i={name:"Yandex Browser",yandexbrowser:n,version:F||l(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(r)?i={name:"UC Browser",ucbrowser:n,version:l(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(r)?i={name:"Maxthon",maxthon:n,version:l(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(r)?i={name:"Epiphany",epiphany:n,version:l(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(r)?i={name:"Puffin",puffin:n,version:l(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(r)?i={name:"Sleipnir",sleipnir:n,version:l(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(r)?i={name:"K-Meleon",kMeleon:n,version:l(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:E?(i={name:"Windows Phone",osname:"Windows Phone",windowsphone:n},N?(i.msedge=n,i.version=N):(i.msie=n,i.version=l(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(r)?i={name:"Internet Explorer",msie:n,version:l(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:g?i={name:"Chrome",osname:"Chrome OS",chromeos:n,chromeBook:n,chrome:n,version:l(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(r)?i={name:"Microsoft Edge",msedge:n,version:N}:/vivaldi/i.test(r)?i={name:"Vivaldi",vivaldi:n,version:l(/vivaldi\/(\d+(\.\d+)?)/i)||F}:_?i={name:"Sailfish",osname:"Sailfish OS",sailfish:n,version:l(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(r)?i={name:"SeaMonkey",seamonkey:n,version:l(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(r)?(i={name:"Firefox",firefox:n,version:l(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(r)&&(i.firefoxos=n,i.osname="Firefox OS")):m?i={name:"Amazon Silk",silk:n,version:l(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(r)?i={name:"PhantomJS",phantom:n,version:l(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(r)?i={name:"SlimerJS",slimer:n,version:l(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(r)||/rim\stablet/i.test(r)?i={name:"BlackBerry",osname:"BlackBerry OS",blackberry:n,version:F||l(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:h?(i={name:"WebOS",osname:"WebOS",webos:n,version:F||l(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(r)&&(i.touchpad=n)):/bada/i.test(r)?i={name:"Bada",osname:"Bada",bada:n,version:l(/dolfin\/(\d+(\.\d+)?)/i)}:x?i={name:"Tizen",osname:"Tizen",tizen:n,version:l(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||F}:/qupzilla/i.test(r)?i={name:"QupZilla",qupzilla:n,version:l(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||F}:/chromium/i.test(r)?i={name:"Chromium",chromium:n,version:l(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||F}:/chrome|crios|crmo/i.test(r)?i={name:"Chrome",chrome:n,version:l(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:v?i={name:"Android",version:F}:/safari|applewebkit/i.test(r)?(i={name:"Safari",safari:n},F&&(i.version=F)):t?(i={name:t=="iphone"?"iPhone":t=="ipad"?"iPad":"iPod"},F&&(i.version=F)):i=/googlebot/i.test(r)?{name:"Googlebot",googlebot:n,version:l(/googlebot\/(\d+(\.\d+))/i)||F}:{name:l(/^(.*)\/(.*) /),version:a(/^(.*)\/(.*) /)},!i.msedge&&/(apple)?webkit/i.test(r)?(/(apple)?webkit\/537\.36/i.test(r)?(i.name=i.name||"Blink",i.blink=n):(i.name=i.name||"Webkit",i.webkit=n),!i.version&&F&&(i.version=F)):!i.opera&&/gecko\//i.test(r)&&(i.name=i.name||"Gecko",i.gecko=n,i.version=i.version||l(/gecko\/(\d+(\.\d+)?)/i)),i.windowsphone||!v&&!i.silk?!i.windowsphone&&t?(i[t]=n,i.ios=n,i.osname="iOS"):w?(i.mac=n,i.osname="macOS"):B?(i.xbox=n,i.osname="Xbox"):S?(i.windows=n,i.osname="Windows"):R&&(i.linux=n,i.osname="Linux"):(i.android=n,i.osname="Android");var M="";i.windows?M=function(J){switch(J){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}}(l(/Windows ((NT|XP)( \d\d?.\d)?)/i)):i.windowsphone?M=l(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i.mac?(M=l(/Mac OS X (\d+([_\.\s]\d+)*)/i),M=M.replace(/[_\s]/g,".")):t?(M=l(/os (\d+([_\s]\d+)*) like mac os x/i),M=M.replace(/[_\s]/g,".")):v?M=l(/android[ \/-](\d+(\.\d+)*)/i):i.webos?M=l(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):i.blackberry?M=l(/rim\stablet\sos\s(\d+(\.\d+)*)/i):i.bada?M=l(/bada\/(\d+(\.\d+)*)/i):i.tizen&&(M=l(/tizen[\/\s](\d+(\.\d+)*)/i)),M&&(i.osversion=M);var G=!i.windows&&M.split(".")[0];return z||b||t=="ipad"||v&&(G==3||G>=4&&!q)||i.silk?i.tablet=n:(q||t=="iphone"||t=="ipod"||v||y||i.blackberry||i.webos||i.bada)&&(i.mobile=n),i.msedge||i.msie&&i.version>=10||i.yandexbrowser&&i.version>=15||i.vivaldi&&i.version>=1||i.chrome&&i.version>=20||i.samsungBrowser&&i.version>=4||i.firefox&&i.version>=20||i.safari&&i.version>=6||i.opera&&i.version>=10||i.ios&&i.osversion&&i.osversion.split(".")[0]>=6||i.blackberry&&i.version>=10.1||i.chromium&&i.version>=20?i.a=n:i.msie&&i.version<10||i.chrome&&i.version<20||i.firefox&&i.version<20||i.safari&&i.version<6||i.opera&&i.version<10||i.ios&&i.osversion&&i.osversion.split(".")[0]<6||i.chromium&&i.version<20?i.c=n:i.x=n,i}function O(r){return r.split(".").length}function f(r,l){var a,i=[];if(Array.prototype.map)return Array.prototype.map.call(r,l);for(a=0;a<r.length;a++)i.push(l(r[a]));return i}function p(r){for(var l=Math.max(O(r[0]),O(r[1])),a=f(r,function(i){var t=l-O(i);return i+=new Array(t+1).join(".0"),f(i.split("."),function(d){return new Array(20-d.length).join("0")+d}).reverse()});--l>=0;){if(a[0][l]>a[1][l])return 1;if(a[0][l]!==a[1][l])return-1;if(l===0)return 0}}function c(r,l,a){var i=o;typeof l=="string"&&(a=l,l=void 0),l===void 0&&(l=!1),a&&(i=A(a));var t=""+i.version;for(var d in r)if(r.hasOwnProperty(d)&&i[d]){if(typeof r[d]!="string")throw new Error("Browser version in the minVersion map should be a string: "+d+": "+String(r));return p([t,r[d]])<0}return l}function s(r,l,a){return!c(r,l,a)}var n=!0,o=A(typeof navigator!="undefined"&&navigator.userAgent||"");return o.test=function(r){for(var l=0;l<r.length;++l){var a=r[l];if(typeof a=="string"&&a in o)return!0}return!1},o.isUnsupportedBrowser=c,o.compareVersions=p,o.check=s,o._detect=A,o.detect=A,o})},{}],36:[function(C,D,T){},{}],37:[function(C,D,T){function A(o){if(o&&!s(o))throw new Error("Unknown encoding: "+o)}function O(o){return o.toString(this.encoding)}function f(o){this.charReceived=o.length%2,this.charLength=this.charReceived?2:0}function p(o){this.charReceived=o.length%3,this.charLength=this.charReceived?3:0}var c=C("buffer").Buffer,s=c.isEncoding||function(o){switch(o&&o.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}},n=T.StringDecoder=function(o){switch(this.encoding=(o||"utf8").toLowerCase().replace(/[-_]/,""),A(o),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=p;break;default:return void(this.write=O)}this.charBuffer=new c(6),this.charReceived=0,this.charLength=0};n.prototype.write=function(o){for(var r="";this.charLength;){var l=o.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:o.length;if(o.copy(this.charBuffer,this.charReceived,0,l),this.charReceived+=l,this.charReceived<this.charLength)return"";o=o.slice(l,o.length),r=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=r.charCodeAt(r.length-1);if(!(i>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,o.length===0)return r;break}this.charLength+=this.surrogateSize,r=""}this.detectIncompleteChar(o);var a=o.length;this.charLength&&(o.copy(this.charBuffer,0,o.length-this.charReceived,a),a-=this.charReceived),r+=o.toString(this.encoding,0,a);var a=r.length-1,i=r.charCodeAt(a);if(i>=55296&&i<=56319){var t=this.surrogateSize;return this.charLength+=t,this.charReceived+=t,this.charBuffer.copy(this.charBuffer,t,0,t),o.copy(this.charBuffer,0,0,t),r.substring(0,a)}return r},n.prototype.detectIncompleteChar=function(o){for(var r=o.length>=3?3:o.length;r>0;r--){var l=o[o.length-r];if(r==1&&l>>5==6){this.charLength=2;break}if(r<=2&&l>>4==14){this.charLength=3;break}if(r<=3&&l>>3==30){this.charLength=4;break}}this.charReceived=r},n.prototype.end=function(o){var r="";if(o&&o.length&&(r=this.write(o)),this.charReceived){var l=this.charReceived,a=this.charBuffer,i=this.encoding;r+=a.slice(0,l).toString(i)}return r}},{buffer:38}],38:[function(C,D,T){(function(A){"use strict";function O(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(P,j){if(O()<j)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(P=new Uint8Array(j),P.__proto__=p.prototype):(P===null&&(P=new p(j)),P.length=j),P}function p(P,j,ee){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(P,j,ee);if(typeof P=="number"){if(typeof j=="string")throw new Error("If encoding is specified then the first argument must be a string");return o(this,P)}return c(this,P,j,ee)}function c(P,j,ee,$){if(typeof j=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&j instanceof ArrayBuffer?a(P,j,ee,$):typeof j=="string"?r(P,j,ee):i(P,j)}function s(P){if(typeof P!="number")throw new TypeError('"size" argument must be a number');if(P<0)throw new RangeError('"size" argument must not be negative')}function n(P,j,ee,$){return s(j),j<=0?f(P,j):ee!==void 0?typeof $=="string"?f(P,j).fill(ee,$):f(P,j).fill(ee):f(P,j)}function o(P,j){if(s(j),P=f(P,j<0?0:0|t(j)),!p.TYPED_ARRAY_SUPPORT)for(var ee=0;ee<j;++ee)P[ee]=0;return P}function r(P,j,ee){if(typeof ee=="string"&&ee!==""||(ee="utf8"),!p.isEncoding(ee))throw new TypeError('"encoding" must be a valid string encoding');var $=0|v(j,ee);P=f(P,$);var Q=P.write(j,ee);return Q!==$&&(P=P.slice(0,Q)),P}function l(P,j){var ee=j.length<0?0:0|t(j.length);P=f(P,ee);for(var $=0;$<ee;$+=1)P[$]=255&j[$];return P}function a(P,j,ee,$){if(j.byteLength,ee<0||j.byteLength<ee)throw new RangeError("'offset' is out of bounds");if(j.byteLength<ee+($||0))throw new RangeError("'length' is out of bounds");return j=ee===void 0&&$===void 0?new Uint8Array(j):$===void 0?new Uint8Array(j,ee):new Uint8Array(j,ee,$),p.TYPED_ARRAY_SUPPORT?(P=j,P.__proto__=p.prototype):P=l(P,j),P}function i(P,j){if(p.isBuffer(j)){var ee=0|t(j.length);return P=f(P,ee),P.length===0||j.copy(P,0,0,ee),P}if(j){if(typeof ArrayBuffer!="undefined"&&j.buffer instanceof ArrayBuffer||"length"in j)return typeof j.length!="number"||Ee(j.length)?f(P,0):l(P,j);if(j.type==="Buffer"&&He(j.data))return l(P,j.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function t(P){if(P>=O())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O().toString(16)+" bytes");return 0|P}function d(P){return+P!=P&&(P=0),p.alloc(+P)}function v(P,j){if(p.isBuffer(P))return P.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(P)||P instanceof ArrayBuffer))return P.byteLength;typeof P!="string"&&(P=""+P);var ee=P.length;if(ee===0)return 0;for(var $=!1;;)switch(j){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":case void 0:return ye(P).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*ee;case"hex":return ee>>>1;case"base64":return Fe(P).length;default:if($)return ye(P).length;j=(""+j).toLowerCase(),$=!0}}function y(P,j,ee){var $=!1;if((j===void 0||j<0)&&(j=0),j>this.length)return"";if((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)return"";if(ee>>>=0,j>>>=0,ee<=j)return"";for(P||(P="utf8");;)switch(P){case"hex":return B(this,j,ee);case"utf8":case"utf-8":return N(this,j,ee);case"ascii":return z(this,j,ee);case"latin1":case"binary":return q(this,j,ee);case"base64":return R(this,j,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,j,ee);default:if($)throw new TypeError("Unknown encoding: "+P);P=(P+"").toLowerCase(),$=!0}}function b(P,j,ee){var $=P[j];P[j]=P[ee],P[ee]=$}function g(P,j,ee,$,Q){if(P.length===0)return-1;if(typeof ee=="string"?($=ee,ee=0):ee>2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,isNaN(ee)&&(ee=Q?0:P.length-1),ee<0&&(ee=P.length+ee),ee>=P.length){if(Q)return-1;ee=P.length-1}else if(ee<0){if(!Q)return-1;ee=0}if(typeof j=="string"&&(j=p.from(j,$)),p.isBuffer(j))return j.length===0?-1:m(P,j,ee,$,Q);if(typeof j=="number")return j&=255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(P,j,ee):Uint8Array.prototype.lastIndexOf.call(P,j,ee):m(P,[j],ee,$,Q);throw new TypeError("val must be string, number or Buffer")}function m(P,j,ee,$,Q){function xe(Ye,je){return De===1?Ye[je]:Ye.readUInt16BE(je*De)}var De=1,dt=P.length,Ne=j.length;if($!==void 0&&(($=String($).toLowerCase())==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(P.length<2||j.length<2)return-1;De=2,dt/=2,Ne/=2,ee/=2}var Be;if(Q){var tt=-1;for(Be=ee;Be<dt;Be++)if(xe(P,Be)===xe(j,tt===-1?0:Be-tt)){if(tt===-1&&(tt=Be),Be-tt+1===Ne)return tt*De}else tt!==-1&&(Be-=Be-tt),tt=-1}else for(ee+Ne>dt&&(ee=dt-Ne),Be=ee;Be>=0;Be--){for(var lt=!0,qe=0;qe<Ne;qe++)if(xe(P,Be+qe)!==xe(j,qe)){lt=!1;break}if(lt)return Be}return-1}function _(P,j,ee,$){ee=Number(ee)||0;var Q=P.length-ee;$?($=Number($))>Q&&($=Q):$=Q;var xe=j.length;if(xe%2!=0)throw new TypeError("Invalid hex string");$>xe/2&&($=xe/2);for(var De=0;De<$;++De){var dt=parseInt(j.substr(2*De,2),16);if(isNaN(dt))return De;P[ee+De]=dt}return De}function x(P,j,ee,$){return Ge(ye(j,P.length-ee),P,ee,$)}function h(P,j,ee,$){return Ge(Ke(j),P,ee,$)}function E(P,j,ee,$){return h(P,j,ee,$)}function S(P,j,ee,$){return Ge(Fe(j),P,ee,$)}function w(P,j,ee,$){return Ge(Me(j,P.length-ee),P,ee,$)}function R(P,j,ee){return j===0&&ee===P.length?me.fromByteArray(P):me.fromByteArray(P.slice(j,ee))}function N(P,j,ee){ee=Math.min(P.length,ee);for(var $=[],Q=j;Q<ee;){var xe=P[Q],De=null,dt=xe>239?4:xe>223?3:xe>191?2:1;if(Q+dt<=ee){var Ne,Be,tt,lt;switch(dt){case 1:xe<128&&(De=xe);break;case 2:Ne=P[Q+1],(192&Ne)==128&&(lt=(31&xe)<<6|63&Ne)>127&&(De=lt);break;case 3:Ne=P[Q+1],Be=P[Q+2],(192&Ne)==128&&(192&Be)==128&&(lt=(15&xe)<<12|(63&Ne)<<6|63&Be)>2047&&(lt<55296||lt>57343)&&(De=lt);break;case 4:Ne=P[Q+1],Be=P[Q+2],tt=P[Q+3],(192&Ne)==128&&(192&Be)==128&&(192&tt)==128&&(lt=(15&xe)<<18|(63&Ne)<<12|(63&Be)<<6|63&tt)>65535&<<1114112&&(De=lt)}}De===null?(De=65533,dt=1):De>65535&&(De-=65536,$.push(De>>>10&1023|55296),De=56320|1023&De),$.push(De),Q+=dt}return F($)}function F(P){var j=P.length;if(j<=it)return String.fromCharCode.apply(String,P);for(var ee="",$=0;$<j;)ee+=String.fromCharCode.apply(String,P.slice($,$+=it));return ee}function z(P,j,ee){var $="";ee=Math.min(P.length,ee);for(var Q=j;Q<ee;++Q)$+=String.fromCharCode(127&P[Q]);return $}function q(P,j,ee){var $="";ee=Math.min(P.length,ee);for(var Q=j;Q<ee;++Q)$+=String.fromCharCode(P[Q]);return $}function B(P,j,ee){var $=P.length;(!j||j<0)&&(j=0),(!ee||ee<0||ee>$)&&(ee=$);for(var Q="",xe=j;xe<ee;++xe)Q+=_e(P[xe]);return Q}function M(P,j,ee){for(var $=P.slice(j,ee),Q="",xe=0;xe<$.length;xe+=2)Q+=String.fromCharCode($[xe]+256*$[xe+1]);return Q}function G(P,j,ee){if(P%1!=0||P<0)throw new RangeError("offset is not uint");if(P+j>ee)throw new RangeError("Trying to access beyond buffer length")}function J(P,j,ee,$,Q,xe){if(!p.isBuffer(P))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>Q||j<xe)throw new RangeError('"value" argument is out of bounds');if(ee+$>P.length)throw new RangeError("Index out of range")}function K(P,j,ee,$){j<0&&(j=65535+j+1);for(var Q=0,xe=Math.min(P.length-ee,2);Q<xe;++Q)P[ee+Q]=(j&255<<8*($?Q:1-Q))>>>8*($?Q:1-Q)}function Z(P,j,ee,$){j<0&&(j=4294967295+j+1);for(var Q=0,xe=Math.min(P.length-ee,4);Q<xe;++Q)P[ee+Q]=j>>>8*($?Q:3-Q)&255}function le(P,j,ee,$,Q,xe){if(ee+$>P.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function de(P,j,ee,$,Q){return Q||le(P,j,ee,4,34028234663852886e22,-34028234663852886e22),We.write(P,j,ee,$,23,4),ee+4}function Te(P,j,ee,$,Q){return Q||le(P,j,ee,8,17976931348623157e292,-17976931348623157e292),We.write(P,j,ee,$,52,8),ee+8}function we(P){if(P=Ie(P).replace(re,""),P.length<2)return"";for(;P.length%4!=0;)P+="=";return P}function Ie(P){return P.trim?P.trim():P.replace(/^\s+|\s+$/g,"")}function _e(P){return P<16?"0"+P.toString(16):P.toString(16)}function ye(P,j){j=j||1/0;for(var ee,$=P.length,Q=null,xe=[],De=0;De<$;++De){if((ee=P.charCodeAt(De))>55295&&ee<57344){if(!Q){if(ee>56319){(j-=3)>-1&&xe.push(239,191,189);continue}if(De+1===$){(j-=3)>-1&&xe.push(239,191,189);continue}Q=ee;continue}if(ee<56320){(j-=3)>-1&&xe.push(239,191,189),Q=ee;continue}ee=65536+(Q-55296<<10|ee-56320)}else Q&&(j-=3)>-1&&xe.push(239,191,189);if(Q=null,ee<128){if((j-=1)<0)break;xe.push(ee)}else if(ee<2048){if((j-=2)<0)break;xe.push(ee>>6|192,63&ee|128)}else if(ee<65536){if((j-=3)<0)break;xe.push(ee>>12|224,ee>>6&63|128,63&ee|128)}else{if(!(ee<1114112))throw new Error("Invalid code point");if((j-=4)<0)break;xe.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,63&ee|128)}}return xe}function Ke(P){for(var j=[],ee=0;ee<P.length;++ee)j.push(255&P.charCodeAt(ee));return j}function Me(P,j){for(var ee,$,Q,xe=[],De=0;De<P.length&&!((j-=2)<0);++De)ee=P.charCodeAt(De),$=ee>>8,Q=ee%256,xe.push(Q),xe.push($);return xe}function Fe(P){return me.toByteArray(we(P))}function Ge(P,j,ee,$){for(var Q=0;Q<$&&!(Q+ee>=j.length||Q>=P.length);++Q)j[Q+ee]=P[Q];return Q}function Ee(P){return P!==P}var me=C("base64-js"),We=C("ieee754"),He=C("isarray");T.Buffer=p,T.SlowBuffer=d,T.INSPECT_MAX_BYTES=50,p.TYPED_ARRAY_SUPPORT=A.TYPED_ARRAY_SUPPORT!==void 0?A.TYPED_ARRAY_SUPPORT:function(){try{var P=new Uint8Array(1);return P.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},P.foo()===42&&typeof P.subarray=="function"&&P.subarray(1,1).byteLength===0}catch(j){return!1}}(),T.kMaxLength=O(),p.poolSize=8192,p._augment=function(P){return P.__proto__=p.prototype,P},p.from=function(P,j,ee){return c(null,P,j,ee)},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(P,j,ee){return n(null,P,j,ee)},p.allocUnsafe=function(P){return o(null,P)},p.allocUnsafeSlow=function(P){return o(null,P)},p.isBuffer=function(P){return!(P==null||!P._isBuffer)},p.compare=function(P,j){if(!p.isBuffer(P)||!p.isBuffer(j))throw new TypeError("Arguments must be Buffers");if(P===j)return 0;for(var ee=P.length,$=j.length,Q=0,xe=Math.min(ee,$);Q<xe;++Q)if(P[Q]!==j[Q]){ee=P[Q],$=j[Q];break}return ee<$?-1:$<ee?1:0},p.isEncoding=function(P){switch(String(P).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(P,j){if(!He(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return p.alloc(0);var ee;if(j===void 0)for(j=0,ee=0;ee<P.length;++ee)j+=P[ee].length;var $=p.allocUnsafe(j),Q=0;for(ee=0;ee<P.length;++ee){var xe=P[ee];if(!p.isBuffer(xe))throw new TypeError('"list" argument must be an Array of Buffers');xe.copy($,Q),Q+=xe.length}return $},p.byteLength=v,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var P=this.length;if(P%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var j=0;j<P;j+=2)b(this,j,j+1);return this},p.prototype.swap32=function(){var P=this.length;if(P%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var j=0;j<P;j+=4)b(this,j,j+3),b(this,j+1,j+2);return this},p.prototype.swap64=function(){var P=this.length;if(P%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var j=0;j<P;j+=8)b(this,j,j+7),b(this,j+1,j+6),b(this,j+2,j+5),b(this,j+3,j+4);return this},p.prototype.toString=function(){var P=0|this.length;return P===0?"":arguments.length===0?N(this,0,P):y.apply(this,arguments)},p.prototype.equals=function(P){if(!p.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P||p.compare(this,P)===0},p.prototype.inspect=function(){var P="",j=T.INSPECT_MAX_BYTES;return this.length>0&&(P=this.toString("hex",0,j).match(/.{2}/g).join(" "),this.length>j&&(P+=" ... ")),"<Buffer "+P+">"},p.prototype.compare=function(P,j,ee,$,Q){if(!p.isBuffer(P))throw new TypeError("Argument must be a Buffer");if(j===void 0&&(j=0),ee===void 0&&(ee=P?P.length:0),$===void 0&&($=0),Q===void 0&&(Q=this.length),j<0||ee>P.length||$<0||Q>this.length)throw new RangeError("out of range index");if($>=Q&&j>=ee)return 0;if($>=Q)return-1;if(j>=ee)return 1;if(j>>>=0,ee>>>=0,$>>>=0,Q>>>=0,this===P)return 0;for(var xe=Q-$,De=ee-j,dt=Math.min(xe,De),Ne=this.slice($,Q),Be=P.slice(j,ee),tt=0;tt<dt;++tt)if(Ne[tt]!==Be[tt]){xe=Ne[tt],De=Be[tt];break}return xe<De?-1:De<xe?1:0},p.prototype.includes=function(P,j,ee){return this.indexOf(P,j,ee)!==-1},p.prototype.indexOf=function(P,j,ee){return g(this,P,j,ee,!0)},p.prototype.lastIndexOf=function(P,j,ee){return g(this,P,j,ee,!1)},p.prototype.write=function(P,j,ee,$){if(j===void 0)$="utf8",ee=this.length,j=0;else if(ee===void 0&&typeof j=="string")$=j,ee=this.length,j=0;else{if(!isFinite(j))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");j|=0,isFinite(ee)?(ee|=0,$===void 0&&($="utf8")):($=ee,ee=void 0)}var Q=this.length-j;if((ee===void 0||ee>Q)&&(ee=Q),P.length>0&&(ee<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");for(var xe=!1;;)switch($){case"hex":return _(this,P,j,ee);case"utf8":case"utf-8":return x(this,P,j,ee);case"ascii":return h(this,P,j,ee);case"latin1":case"binary":return E(this,P,j,ee);case"base64":return S(this,P,j,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,P,j,ee);default:if(xe)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),xe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var it=4096;p.prototype.slice=function(P,j){var ee=this.length;P=~~P,j=j===void 0?ee:~~j,P<0?(P+=ee)<0&&(P=0):P>ee&&(P=ee),j<0?(j+=ee)<0&&(j=0):j>ee&&(j=ee),j<P&&(j=P);var $;if(p.TYPED_ARRAY_SUPPORT)$=this.subarray(P,j),$.__proto__=p.prototype;else{var Q=j-P;$=new p(Q,void 0);for(var xe=0;xe<Q;++xe)$[xe]=this[xe+P]}return $},p.prototype.readUIntLE=function(P,j,ee){P|=0,j|=0,ee||G(P,j,this.length);for(var $=this[P],Q=1,xe=0;++xe<j&&(Q*=256);)$+=this[P+xe]*Q;return $},p.prototype.readUIntBE=function(P,j,ee){P|=0,j|=0,ee||G(P,j,this.length);for(var $=this[P+--j],Q=1;j>0&&(Q*=256);)$+=this[P+--j]*Q;return $},p.prototype.readUInt8=function(P,j){return j||G(P,1,this.length),this[P]},p.prototype.readUInt16LE=function(P,j){return j||G(P,2,this.length),this[P]|this[P+1]<<8},p.prototype.readUInt16BE=function(P,j){return j||G(P,2,this.length),this[P]<<8|this[P+1]},p.prototype.readUInt32LE=function(P,j){return j||G(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+16777216*this[P+3]},p.prototype.readUInt32BE=function(P,j){return j||G(P,4,this.length),16777216*this[P]+(this[P+1]<<16|this[P+2]<<8|this[P+3])},p.prototype.readIntLE=function(P,j,ee){P|=0,j|=0,ee||G(P,j,this.length);for(var $=this[P],Q=1,xe=0;++xe<j&&(Q*=256);)$+=this[P+xe]*Q;return Q*=128,$>=Q&&($-=Math.pow(2,8*j)),$},p.prototype.readIntBE=function(P,j,ee){P|=0,j|=0,ee||G(P,j,this.length);for(var $=j,Q=1,xe=this[P+--$];$>0&&(Q*=256);)xe+=this[P+--$]*Q;return Q*=128,xe>=Q&&(xe-=Math.pow(2,8*j)),xe},p.prototype.readInt8=function(P,j){return j||G(P,1,this.length),128&this[P]?-1*(255-this[P]+1):this[P]},p.prototype.readInt16LE=function(P,j){j||G(P,2,this.length);var ee=this[P]|this[P+1]<<8;return 32768&ee?4294901760|ee:ee},p.prototype.readInt16BE=function(P,j){j||G(P,2,this.length);var ee=this[P+1]|this[P]<<8;return 32768&ee?4294901760|ee:ee},p.prototype.readInt32LE=function(P,j){return j||G(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},p.prototype.readInt32BE=function(P,j){return j||G(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},p.prototype.readFloatLE=function(P,j){return j||G(P,4,this.length),We.read(this,P,!0,23,4)},p.prototype.readFloatBE=function(P,j){return j||G(P,4,this.length),We.read(this,P,!1,23,4)},p.prototype.readDoubleLE=function(P,j){return j||G(P,8,this.length),We.read(this,P,!0,52,8)},p.prototype.readDoubleBE=function(P,j){return j||G(P,8,this.length),We.read(this,P,!1,52,8)},p.prototype.writeUIntLE=function(P,j,ee,$){(P=+P,j|=0,ee|=0,!$)&&J(this,P,j,ee,Math.pow(2,8*ee)-1,0);var Q=1,xe=0;for(this[j]=255&P;++xe<ee&&(Q*=256);)this[j+xe]=P/Q&255;return j+ee},p.prototype.writeUIntBE=function(P,j,ee,$){(P=+P,j|=0,ee|=0,!$)&&J(this,P,j,ee,Math.pow(2,8*ee)-1,0);var Q=ee-1,xe=1;for(this[j+Q]=255&P;--Q>=0&&(xe*=256);)this[j+Q]=P/xe&255;return j+ee},p.prototype.writeUInt8=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,1,255,0),p.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),this[j]=255&P,j+1},p.prototype.writeUInt16LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):K(this,P,j,!0),j+2},p.prototype.writeUInt16BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):K(this,P,j,!1),j+2},p.prototype.writeUInt32LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[j+3]=P>>>24,this[j+2]=P>>>16,this[j+1]=P>>>8,this[j]=255&P):Z(this,P,j,!0),j+4},p.prototype.writeUInt32BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):Z(this,P,j,!1),j+4},p.prototype.writeIntLE=function(P,j,ee,$){if(P=+P,j|=0,!$){var Q=Math.pow(2,8*ee-1);J(this,P,j,ee,Q-1,-Q)}var xe=0,De=1,dt=0;for(this[j]=255&P;++xe<ee&&(De*=256);)P<0&&dt===0&&this[j+xe-1]!==0&&(dt=1),this[j+xe]=(P/De>>0)-dt&255;return j+ee},p.prototype.writeIntBE=function(P,j,ee,$){if(P=+P,j|=0,!$){var Q=Math.pow(2,8*ee-1);J(this,P,j,ee,Q-1,-Q)}var xe=ee-1,De=1,dt=0;for(this[j+xe]=255&P;--xe>=0&&(De*=256);)P<0&&dt===0&&this[j+xe+1]!==0&&(dt=1),this[j+xe]=(P/De>>0)-dt&255;return j+ee},p.prototype.writeInt8=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,1,127,-128),p.TYPED_ARRAY_SUPPORT||(P=Math.floor(P)),P<0&&(P=255+P+1),this[j]=255&P,j+1},p.prototype.writeInt16LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8):K(this,P,j,!0),j+2},p.prototype.writeInt16BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>8,this[j+1]=255&P):K(this,P,j,!1),j+2},p.prototype.writeInt32LE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[j]=255&P,this[j+1]=P>>>8,this[j+2]=P>>>16,this[j+3]=P>>>24):Z(this,P,j,!0),j+4},p.prototype.writeInt32BE=function(P,j,ee){return P=+P,j|=0,ee||J(this,P,j,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),p.TYPED_ARRAY_SUPPORT?(this[j]=P>>>24,this[j+1]=P>>>16,this[j+2]=P>>>8,this[j+3]=255&P):Z(this,P,j,!1),j+4},p.prototype.writeFloatLE=function(P,j,ee){return de(this,P,j,!0,ee)},p.prototype.writeFloatBE=function(P,j,ee){return de(this,P,j,!1,ee)},p.prototype.writeDoubleLE=function(P,j,ee){return Te(this,P,j,!0,ee)},p.prototype.writeDoubleBE=function(P,j,ee){return Te(this,P,j,!1,ee)},p.prototype.copy=function(P,j,ee,$){if(ee||(ee=0),$||$===0||($=this.length),j>=P.length&&(j=P.length),j||(j=0),$>0&&$<ee&&($=ee),$===ee)return 0;if(P.length===0||this.length===0)return 0;if(j<0)throw new RangeError("targetStart out of bounds");if(ee<0||ee>=this.length)throw new RangeError("sourceStart out of bounds");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),P.length-j<$-ee&&($=P.length-j+ee);var Q,xe=$-ee;if(this===P&&ee<j&&j<$)for(Q=xe-1;Q>=0;--Q)P[Q+j]=this[Q+ee];else if(xe<1e3||!p.TYPED_ARRAY_SUPPORT)for(Q=0;Q<xe;++Q)P[Q+j]=this[Q+ee];else Uint8Array.prototype.set.call(P,this.subarray(ee,ee+xe),j);return xe},p.prototype.fill=function(P,j,ee,$){if(typeof P=="string"){if(typeof j=="string"?($=j,j=0,ee=this.length):typeof ee=="string"&&($=ee,ee=this.length),P.length===1){var Q=P.charCodeAt(0);Q<256&&(P=Q)}if($!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!p.isEncoding($))throw new TypeError("Unknown encoding: "+$)}else typeof P=="number"&&(P&=255);if(j<0||this.length<j||this.length<ee)throw new RangeError("Out of range index");if(ee<=j)return this;j>>>=0,ee=ee===void 0?this.length:ee>>>0,P||(P=0);var xe;if(typeof P=="number")for(xe=j;xe<ee;++xe)this[xe]=P;else{var De=p.isBuffer(P)?P:ye(new p(P,$).toString()),dt=De.length;for(xe=0;xe<ee-j;++xe)this[xe+j]=De[xe%dt]}return this};var re=/[^+\/0-9A-Za-z-_]/g}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(C,D,T){D.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(C,D,T){"use strict";var A=function(){this.buffer=[],this.fns=[]};A.prototype.push=function(f,p){if(this.fns.length)return this.fns.shift()(null,f);var c={data:f,priority:p},s=O(this.buffer,c,function(n){return n.priority});this.buffer.splice(s,0,c)},A.prototype.next=function(){var f=this;return function(p){if(f.buffer.length)return p(null,f.buffer.pop().data);f.fns.push(p)}};var O=function(f,p,c){p=c(p);for(var s=0,n=f?f.length:s;s<n;){var o=s+n>>>1;c(f[o])<p?s=o+1:n=o}return s};D.exports=A},{}],41:[function(C,D,T){function A(a){var i=this,t=l.call(arguments,1);return new Promise(function(d,v){function y(m){var _;try{_=a.next(m)}catch(x){return v(x)}g(_)}function b(m){var _;try{_=a.throw(m)}catch(x){return v(x)}g(_)}function g(m){if(m.done)return d(m.value);var _=O.call(i,m.value);return _&&s(_)?_.then(y,b):b(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(m.value)+'"'))}if(typeof a=="function"&&(a=a.apply(i,t)),!a||typeof a.next!="function")return d(a);y()})}function O(a){return a&&(s(a)?a:o(a)||n(a)?A.call(this,a):typeof a=="function"?f.call(this,a):Array.isArray(a)?p.call(this,a):r(a)?c.call(this,a):a)}function f(a){var i=this;return new Promise(function(t,d){a.call(i,function(v,y){if(v)return d(v);arguments.length>2&&(y=l.call(arguments,1)),t(y)})})}function p(a){return Promise.all(a.map(O,this))}function c(a){for(var i=new a.constructor,t=Object.keys(a),d=[],v=0;v<t.length;v++){var y=t[v],b=O.call(this,a[y]);b&&s(b)?function(g,m){i[m]=void 0,d.push(g.then(function(_){i[m]=_}))}(b,y):i[y]=a[y]}return Promise.all(d).then(function(){return i})}function s(a){return typeof a.then=="function"}function n(a){return typeof a.next=="function"&&typeof a.throw=="function"}function o(a){var i=a.constructor;return!!i&&(i.name==="GeneratorFunction"||i.displayName==="GeneratorFunction"||n(i.prototype))}function r(a){return Object==a.constructor}var l=Array.prototype.slice;D.exports=A.default=A.co=A,A.wrap=function(a){function i(){return A.call(this,a.apply(this,arguments))}return i.__generatorFunction__=a,i}},{}],42:[function(C,D,T){D.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],43:[function(C,D,T){"use strict";function A(p,c){if(!(this instanceof A))return new A(p,c);this.src=p,this._withAccess=c}function O(p,c){return p[c]===void 0&&p.__lookupGetter__(c)===void 0&&p.__lookupSetter__(c)===void 0}var f=Array.prototype.slice;D.exports=A,A.prototype.withAccess=function(p){return this._withAccess=p!==!1,this},A.prototype.pick=function(p){return Array.isArray(p)||(p=f.call(arguments)),p.length&&(this.keys=p),this},A.prototype.to=function(p){if(p=p||{},!this.src)return p;var c=this.keys||Object.keys(this.src);if(!this._withAccess){for(var s=0;s<c.length;s++)n=c[s],p[n]===void 0&&(p[n]=this.src[n]);return p}for(var s=0;s<c.length;s++){var n=c[s];if(O(p,n)){var o=this.src.__lookupGetter__(n),r=this.src.__lookupSetter__(n);o&&p.__defineGetter__(n,o),r&&p.__defineSetter__(n,r),o||r||(p[n]=this.src[n])}}return p},A.prototype.toCover=function(p){for(var c=this.keys||Object.keys(this.src),s=0;s<c.length;s++){var n=c[s];delete p[n];var o=this.src.__lookupGetter__(n),r=this.src.__lookupSetter__(n);o&&p.__defineGetter__(n,o),r&&p.__defineSetter__(n,r),o||r||(p[n]=this.src[n])}},A.prototype.override=A.prototype.toCover,A.prototype.and=function(p){var c={};return this.to(c),this.src=p,this.to(c),this.src=c,this}},{}],44:[function(C,D,T){C("../../modules/es6.string.iterator"),C("../../modules/es6.array.from"),D.exports=C("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(C,D,T){var A=C("../../modules/_core"),O=A.JSON||(A.JSON={stringify:JSON.stringify});D.exports=function(f){return O.stringify.apply(O,arguments)}},{"../../modules/_core":65}],46:[function(C,D,T){C("../../modules/es6.object.assign"),D.exports=C("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(C,D,T){C("../../modules/es6.object.create");var A=C("../../modules/_core").Object;D.exports=function(O,f){return A.create(O,f)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(C,D,T){C("../../modules/es6.object.define-property");var A=C("../../modules/_core").Object;D.exports=function(O,f,p){return A.defineProperty(O,f,p)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(C,D,T){C("../../modules/es6.object.get-own-property-names");var A=C("../../modules/_core").Object;D.exports=function(O){return A.getOwnPropertyNames(O)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(C,D,T){C("../../modules/es6.object.get-prototype-of"),D.exports=C("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(C,D,T){C("../../modules/es6.object.keys"),D.exports=C("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(C,D,T){C("../modules/es6.object.to-string"),C("../modules/es6.string.iterator"),C("../modules/web.dom.iterable"),C("../modules/es6.promise"),C("../modules/es7.promise.finally"),C("../modules/es7.promise.try"),D.exports=C("../modules/_core").Promise},{"../modules/_core":65,"../modules/es6.object.to-string":142,"../modules/es6.promise":143,"../modules/es6.string.iterator":145,"../modules/es7.promise.finally":147,"../modules/es7.promise.try":148,"../modules/web.dom.iterable":151}],53:[function(C,D,T){C("../modules/web.immediate"),D.exports=C("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(C,D,T){C("../../modules/es6.string.from-code-point"),D.exports=C("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(C,D,T){C("../../modules/es6.function.has-instance"),D.exports=C("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(C,D,T){C("../../modules/es6.symbol"),C("../../modules/es6.object.to-string"),C("../../modules/es7.symbol.async-iterator"),C("../../modules/es7.symbol.observable"),D.exports=C("../../modules/_core").Symbol},{"../../modules/_core":65,"../../modules/es6.object.to-string":142,"../../modules/es6.symbol":146,"../../modules/es7.symbol.async-iterator":149,"../../modules/es7.symbol.observable":150}],57:[function(C,D,T){C("../../modules/es6.string.iterator"),C("../../modules/web.dom.iterable"),D.exports=C("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(C,D,T){D.exports=function(A){if(typeof A!="function")throw TypeError(A+" is not a function!");return A}},{}],59:[function(C,D,T){D.exports=function(){}},{}],60:[function(C,D,T){D.exports=function(A,O,f,p){if(!(A instanceof O)||p!==void 0&&p in A)throw TypeError(f+": incorrect invocation!");return A}},{}],61:[function(C,D,T){var A=C("./_is-object");D.exports=function(O){if(!A(O))throw TypeError(O+" is not an object!");return O}},{"./_is-object":85}],62:[function(C,D,T){var A=C("./_to-iobject"),O=C("./_to-length"),f=C("./_to-absolute-index");D.exports=function(p){return function(c,s,n){var o,r=A(c),l=O(r.length),a=f(n,l);if(p&&s!=s){for(;l>a;)if((o=r[a++])!=o)return!0}else for(;l>a;a++)if((p||a in r)&&r[a]===s)return p||a||0;return!p&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(C,D,T){var A=C("./_cof"),O=C("./_wks")("toStringTag"),f=A(function(){return arguments}())=="Arguments",p=function(c,s){try{return c[s]}catch(n){}};D.exports=function(c){var s,n,o;return c===void 0?"Undefined":c===null?"Null":typeof(n=p(s=Object(c),O))=="string"?n:f?A(s):(o=A(s))=="Object"&&typeof s.callee=="function"?"Arguments":o}},{"./_cof":64,"./_wks":131}],64:[function(C,D,T){var A={}.toString;D.exports=function(O){return A.call(O).slice(8,-1)}},{}],65:[function(C,D,T){var A=D.exports={version:"2.5.7"};typeof __e=="number"&&(__e=A)},{}],66:[function(C,D,T){"use strict";var A=C("./_object-dp"),O=C("./_property-desc");D.exports=function(f,p,c){p in f?A.f(f,p,O(0,c)):f[p]=c}},{"./_object-dp":98,"./_property-desc":111}],67:[function(C,D,T){var A=C("./_a-function");D.exports=function(O,f,p){if(A(O),f===void 0)return O;switch(p){case 1:return function(c){return O.call(f,c)};case 2:return function(c,s){return O.call(f,c,s)};case 3:return function(c,s,n){return O.call(f,c,s,n)}}return function(){return O.apply(f,arguments)}}},{"./_a-function":58}],68:[function(C,D,T){D.exports=function(A){if(A==null)throw TypeError("Can't call method on "+A);return A}},{}],69:[function(C,D,T){D.exports=!C("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":74}],70:[function(C,D,T){var A=C("./_is-object"),O=C("./_global").document,f=A(O)&&A(O.createElement);D.exports=function(p){return f?O.createElement(p):{}}},{"./_global":76,"./_is-object":85}],71:[function(C,D,T){D.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(C,D,T){var A=C("./_object-keys"),O=C("./_object-gops"),f=C("./_object-pie");D.exports=function(p){var c=A(p),s=O.f;if(s)for(var n,o=s(p),r=f.f,l=0;o.length>l;)r.call(p,n=o[l++])&&c.push(n);return c}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(C,D,T){var A=C("./_global"),O=C("./_core"),f=C("./_ctx"),p=C("./_hide"),c=C("./_has"),s=function(n,o,r){var l,a,i,t=n&s.F,d=n&s.G,v=n&s.S,y=n&s.P,b=n&s.B,g=n&s.W,m=d?O:O[o]||(O[o]={}),_=m.prototype,x=d?A:v?A[o]:(A[o]||{}).prototype;d&&(r=o);for(l in r)(a=!t&&x&&x[l]!==void 0)&&c(m,l)||(i=a?x[l]:r[l],m[l]=d&&typeof x[l]!="function"?r[l]:b&&a?f(i,A):g&&x[l]==i?function(h){var E=function(S,w,R){if(this instanceof h){switch(arguments.length){case 0:return new h;case 1:return new h(S);case 2:return new h(S,w)}return new h(S,w,R)}return h.apply(this,arguments)};return E.prototype=h.prototype,E}(i):y&&typeof i=="function"?f(Function.call,i):i,y&&((m.virtual||(m.virtual={}))[l]=i,n&s.R&&_&&!_[l]&&p(_,l,i)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,D.exports=s},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(C,D,T){D.exports=function(A){try{return!!A()}catch(O){return!0}}},{}],75:[function(C,D,T){var A=C("./_ctx"),O=C("./_iter-call"),f=C("./_is-array-iter"),p=C("./_an-object"),c=C("./_to-length"),s=C("./core.get-iterator-method"),n={},o={},T=D.exports=function(r,l,a,i,t){var d,v,y,b,g=t?function(){return r}:s(r),m=A(a,i,l?2:1),_=0;if(typeof g!="function")throw TypeError(r+" is not iterable!");if(f(g)){for(d=c(r.length);d>_;_++)if((b=l?m(p(v=r[_])[0],v[1]):m(r[_]))===n||b===o)return b}else for(y=g.call(r);!(v=y.next()).done;)if((b=O(y,m,v.value,l))===n||b===o)return b};T.BREAK=n,T.RETURN=o},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(C,D,T){var A=D.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=A)},{}],77:[function(C,D,T){var A={}.hasOwnProperty;D.exports=function(O,f){return A.call(O,f)}},{}],78:[function(C,D,T){var A=C("./_object-dp"),O=C("./_property-desc");D.exports=C("./_descriptors")?function(f,p,c){return A.f(f,p,O(1,c))}:function(f,p,c){return f[p]=c,f}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(C,D,T){var A=C("./_global").document;D.exports=A&&A.documentElement},{"./_global":76}],80:[function(C,D,T){D.exports=!C("./_descriptors")&&!C("./_fails")(function(){return Object.defineProperty(C("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(C,D,T){D.exports=function(A,O,f){var p=f===void 0;switch(O.length){case 0:return p?A():A.call(f);case 1:return p?A(O[0]):A.call(f,O[0]);case 2:return p?A(O[0],O[1]):A.call(f,O[0],O[1]);case 3:return p?A(O[0],O[1],O[2]):A.call(f,O[0],O[1],O[2]);case 4:return p?A(O[0],O[1],O[2],O[3]):A.call(f,O[0],O[1],O[2],O[3])}return A.apply(f,O)}},{}],82:[function(C,D,T){var A=C("./_cof");D.exports=Object("z").propertyIsEnumerable(0)?Object:function(O){return A(O)=="String"?O.split(""):Object(O)}},{"./_cof":64}],83:[function(C,D,T){var A=C("./_iterators"),O=C("./_wks")("iterator"),f=Array.prototype;D.exports=function(p){return p!==void 0&&(A.Array===p||f[O]===p)}},{"./_iterators":91,"./_wks":131}],84:[function(C,D,T){var A=C("./_cof");D.exports=Array.isArray||function(O){return A(O)=="Array"}},{"./_cof":64}],85:[function(C,D,T){D.exports=function(A){return typeof A=="object"?A!==null:typeof A=="function"}},{}],86:[function(C,D,T){var A=C("./_an-object");D.exports=function(O,f,p,c){try{return c?f(A(p)[0],p[1]):f(p)}catch(n){var s=O.return;throw s!==void 0&&A(s.call(O)),n}}},{"./_an-object":61}],87:[function(C,D,T){"use strict";var A=C("./_object-create"),O=C("./_property-desc"),f=C("./_set-to-string-tag"),p={};C("./_hide")(p,C("./_wks")("iterator"),function(){return this}),D.exports=function(c,s,n){c.prototype=A(p,{next:O(1,n)}),f(c,s+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(C,D,T){"use strict";var A=C("./_library"),O=C("./_export"),f=C("./_redefine"),p=C("./_hide"),c=C("./_iterators"),s=C("./_iter-create"),n=C("./_set-to-string-tag"),o=C("./_object-gpo"),r=C("./_wks")("iterator"),l=!([].keys&&"next"in[].keys()),a=function(){return this};D.exports=function(i,t,d,v,y,b,g){s(d,t,v);var m,_,x,h=function(B){if(!l&&B in R)return R[B];switch(B){case"keys":case"values":return function(){return new d(this,B)}}return function(){return new d(this,B)}},E=t+" Iterator",S=y=="values",w=!1,R=i.prototype,N=R[r]||R["@@iterator"]||y&&R[y],F=N||h(y),z=y?S?h("entries"):F:void 0,q=t=="Array"&&R.entries||N;if(q&&(x=o(q.call(new i)))!==Object.prototype&&x.next&&(n(x,E,!0),A||typeof x[r]=="function"||p(x,r,a)),S&&N&&N.name!=="values"&&(w=!0,F=function(){return N.call(this)}),A&&!g||!l&&!w&&R[r]||p(R,r,F),c[t]=F,c[E]=a,y)if(m={values:S?F:h("values"),keys:b?F:h("keys"),entries:z},g)for(_ in m)_ in R||f(R,_,m[_]);else O(O.P+O.F*(l||w),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(C,D,T){var A=C("./_wks")("iterator"),O=!1;try{var f=[7][A]();f.return=function(){O=!0},Array.from(f,function(){throw 2})}catch(p){}D.exports=function(p,c){if(!c&&!O)return!1;var s=!1;try{var n=[7],o=n[A]();o.next=function(){return{done:s=!0}},n[A]=function(){return o},p(n)}catch(r){}return s}},{"./_wks":131}],90:[function(C,D,T){D.exports=function(A,O){return{value:O,done:!!A}}},{}],91:[function(C,D,T){D.exports={}},{}],92:[function(C,D,T){D.exports=!0},{}],93:[function(C,D,T){var A=C("./_uid")("meta"),O=C("./_is-object"),f=C("./_has"),p=C("./_object-dp").f,c=0,s=Object.isExtensible||function(){return!0},n=!C("./_fails")(function(){return s(Object.preventExtensions({}))}),o=function(t){p(t,A,{value:{i:"O"+ ++c,w:{}}})},r=function(t,d){if(!O(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!f(t,A)){if(!s(t))return"F";if(!d)return"E";o(t)}return t[A].i},l=function(t,d){if(!f(t,A)){if(!s(t))return!0;if(!d)return!1;o(t)}return t[A].w},a=function(t){return n&&i.NEED&&s(t)&&!f(t,A)&&o(t),t},i=D.exports={KEY:A,NEED:!1,fastKey:r,getWeak:l,onFreeze:a}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(C,D,T){var A=C("./_global"),O=C("./_task").set,f=A.MutationObserver||A.WebKitMutationObserver,p=A.process,c=A.Promise,s=C("./_cof")(p)=="process";D.exports=function(){var n,o,r,l=function(){var d,v;for(s&&(d=p.domain)&&d.exit();n;){v=n.fn,n=n.next;try{v()}catch(y){throw n?r():o=void 0,y}}o=void 0,d&&d.enter()};if(s)r=function(){p.nextTick(l)};else if(!f||A.navigator&&A.navigator.standalone)if(c&&c.resolve){var a=c.resolve(void 0);r=function(){a.then(l)}}else r=function(){O.call(A,l)};else{var i=!0,t=document.createTextNode("");new f(l).observe(t,{characterData:!0}),r=function(){t.data=i=!i}}return function(d){var v={fn:d,next:void 0};o&&(o.next=v),n||(n=v,r()),o=v}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(C,D,T){"use strict";function A(f){var p,c;this.promise=new f(function(s,n){if(p!==void 0||c!==void 0)throw TypeError("Bad Promise constructor");p=s,c=n}),this.resolve=O(p),this.reject=O(c)}var O=C("./_a-function");D.exports.f=function(f){return new A(f)}},{"./_a-function":58}],96:[function(C,D,T){"use strict";var A=C("./_object-keys"),O=C("./_object-gops"),f=C("./_object-pie"),p=C("./_to-object"),c=C("./_iobject"),s=Object.assign;D.exports=!s||C("./_fails")(function(){var n={},o={},r=Symbol(),l="abcdefghijklmnopqrst";return n[r]=7,l.split("").forEach(function(a){o[a]=a}),s({},n)[r]!=7||Object.keys(s({},o)).join("")!=l})?function(n,o){for(var r=p(n),l=arguments.length,a=1,i=O.f,t=f.f;l>a;)for(var d,v=c(arguments[a++]),y=i?A(v).concat(i(v)):A(v),b=y.length,g=0;b>g;)t.call(v,d=y[g++])&&(r[d]=v[d]);return r}:s},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(C,D,T){var A=C("./_an-object"),O=C("./_object-dps"),f=C("./_enum-bug-keys"),p=C("./_shared-key")("IE_PROTO"),c=function(){},s=function(){var n,o=C("./_dom-create")("iframe"),r=f.length;for(o.style.display="none",C("./_html").appendChild(o),o.src="javascript:",n=o.contentWindow.document,n.open(),n.write("<script>document.F=Object</script>"),n.close(),s=n.F;r--;)delete s.prototype[f[r]];return s()};D.exports=Object.create||function(n,o){var r;return n!==null?(c.prototype=A(n),r=new c,c.prototype=null,r[p]=n):r=s(),o===void 0?r:O(r,o)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(C,D,T){var A=C("./_an-object"),O=C("./_ie8-dom-define"),f=C("./_to-primitive"),p=Object.defineProperty;T.f=C("./_descriptors")?Object.defineProperty:function(c,s,n){if(A(c),s=f(s,!0),A(n),O)try{return p(c,s,n)}catch(o){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(c[s]=n.value),c}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(C,D,T){var A=C("./_object-dp"),O=C("./_an-object"),f=C("./_object-keys");D.exports=C("./_descriptors")?Object.defineProperties:function(p,c){O(p);for(var s,n=f(c),o=n.length,r=0;o>r;)A.f(p,s=n[r++],c[s]);return p}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(C,D,T){var A=C("./_object-pie"),O=C("./_property-desc"),f=C("./_to-iobject"),p=C("./_to-primitive"),c=C("./_has"),s=C("./_ie8-dom-define"),n=Object.getOwnPropertyDescriptor;T.f=C("./_descriptors")?n:function(o,r){if(o=f(o),r=p(r,!0),s)try{return n(o,r)}catch(l){}if(c(o,r))return O(!A.f.call(o,r),o[r])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(C,D,T){var A=C("./_to-iobject"),O=C("./_object-gopn").f,f={}.toString,p=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(s){try{return O(s)}catch(n){return p.slice()}};D.exports.f=function(s){return p&&f.call(s)=="[object Window]"?c(s):O(A(s))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(C,D,T){var A=C("./_object-keys-internal"),O=C("./_enum-bug-keys").concat("length","prototype");T.f=Object.getOwnPropertyNames||function(f){return A(f,O)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(C,D,T){T.f=Object.getOwnPropertySymbols},{}],104:[function(C,D,T){var A=C("./_has"),O=C("./_to-object"),f=C("./_shared-key")("IE_PROTO"),p=Object.prototype;D.exports=Object.getPrototypeOf||function(c){return c=O(c),A(c,f)?c[f]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?p:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(C,D,T){var A=C("./_has"),O=C("./_to-iobject"),f=C("./_array-includes")(!1),p=C("./_shared-key")("IE_PROTO");D.exports=function(c,s){var n,o=O(c),r=0,l=[];for(n in o)n!=p&&A(o,n)&&l.push(n);for(;s.length>r;)A(o,n=s[r++])&&(~f(l,n)||l.push(n));return l}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(C,D,T){var A=C("./_object-keys-internal"),O=C("./_enum-bug-keys");D.exports=Object.keys||function(f){return A(f,O)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(C,D,T){T.f={}.propertyIsEnumerable},{}],108:[function(C,D,T){var A=C("./_export"),O=C("./_core"),f=C("./_fails");D.exports=function(p,c){var s=(O.Object||{})[p]||Object[p],n={};n[p]=c(s),A(A.S+A.F*f(function(){s(1)}),"Object",n)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(C,D,T){D.exports=function(A){try{return{e:!1,v:A()}}catch(O){return{e:!0,v:O}}}},{}],110:[function(C,D,T){var A=C("./_an-object"),O=C("./_is-object"),f=C("./_new-promise-capability");D.exports=function(p,c){if(A(p),O(c)&&c.constructor===p)return c;var s=f.f(p);return(0,s.resolve)(c),s.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(C,D,T){D.exports=function(A,O){return{enumerable:!(1&A),configurable:!(2&A),writable:!(4&A),value:O}}},{}],112:[function(C,D,T){var A=C("./_hide");D.exports=function(O,f,p){for(var c in f)p&&O[c]?O[c]=f[c]:A(O,c,f[c]);return O}},{"./_hide":78}],113:[function(C,D,T){D.exports=C("./_hide")},{"./_hide":78}],114:[function(C,D,T){"use strict";var A=C("./_global"),O=C("./_core"),f=C("./_object-dp"),p=C("./_descriptors"),c=C("./_wks")("species");D.exports=function(s){var n=typeof O[s]=="function"?O[s]:A[s];p&&n&&!n[c]&&f.f(n,c,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(C,D,T){var A=C("./_object-dp").f,O=C("./_has"),f=C("./_wks")("toStringTag");D.exports=function(p,c,s){p&&!O(p=s?p:p.prototype,f)&&A(p,f,{configurable:!0,value:c})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(C,D,T){var A=C("./_shared")("keys"),O=C("./_uid");D.exports=function(f){return A[f]||(A[f]=O(f))}},{"./_shared":117,"./_uid":127}],117:[function(C,D,T){var A=C("./_core"),O=C("./_global"),f=O["__core-js_shared__"]||(O["__core-js_shared__"]={});(D.exports=function(p,c){return f[p]||(f[p]=c!==void 0?c:{})})("versions",[]).push({version:A.version,mode:C("./_library")?"pure":"global",copyright:"\u6F0F 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(C,D,T){var A=C("./_an-object"),O=C("./_a-function"),f=C("./_wks")("species");D.exports=function(p,c){var s,n=A(p).constructor;return n===void 0||(s=A(n)[f])==null?c:O(s)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(C,D,T){var A=C("./_to-integer"),O=C("./_defined");D.exports=function(f){return function(p,c){var s,n,o=String(O(p)),r=A(c),l=o.length;return r<0||r>=l?f?"":void 0:(s=o.charCodeAt(r),s<55296||s>56319||r+1===l||(n=o.charCodeAt(r+1))<56320||n>57343?f?o.charAt(r):s:f?o.slice(r,r+2):n-56320+(s-55296<<10)+65536)}}},{"./_defined":68,"./_to-integer":122}],120:[function(C,D,T){var A,O,f,p=C("./_ctx"),c=C("./_invoke"),s=C("./_html"),n=C("./_dom-create"),o=C("./_global"),r=o.process,l=o.setImmediate,a=o.clearImmediate,i=o.MessageChannel,t=o.Dispatch,d=0,v={},y=function(){var g=+this;if(v.hasOwnProperty(g)){var m=v[g];delete v[g],m()}},b=function(g){y.call(g.data)};l&&a||(l=function(g){for(var m=[],_=1;arguments.length>_;)m.push(arguments[_++]);return v[++d]=function(){c(typeof g=="function"?g:Function(g),m)},A(d),d},a=function(g){delete v[g]},C("./_cof")(r)=="process"?A=function(g){r.nextTick(p(y,g,1))}:t&&t.now?A=function(g){t.now(p(y,g,1))}:i?(O=new i,f=O.port2,O.port1.onmessage=b,A=p(f.postMessage,f,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(A=function(g){o.postMessage(g+"","*")},o.addEventListener("message",b,!1)):A="onreadystatechange"in n("script")?function(g){s.appendChild(n("script")).onreadystatechange=function(){s.removeChild(this),y.call(g)}}:function(g){setTimeout(p(y,g,1),0)}),D.exports={set:l,clear:a}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(C,D,T){var A=C("./_to-integer"),O=Math.max,f=Math.min;D.exports=function(p,c){return p=A(p),p<0?O(p+c,0):f(p,c)}},{"./_to-integer":122}],122:[function(C,D,T){var A=Math.ceil,O=Math.floor;D.exports=function(f){return isNaN(f=+f)?0:(f>0?O:A)(f)}},{}],123:[function(C,D,T){var A=C("./_iobject"),O=C("./_defined");D.exports=function(f){return A(O(f))}},{"./_defined":68,"./_iobject":82}],124:[function(C,D,T){var A=C("./_to-integer"),O=Math.min;D.exports=function(f){return f>0?O(A(f),9007199254740991):0}},{"./_to-integer":122}],125:[function(C,D,T){var A=C("./_defined");D.exports=function(O){return Object(A(O))}},{"./_defined":68}],126:[function(C,D,T){var A=C("./_is-object");D.exports=function(O,f){if(!A(O))return O;var p,c;if(f&&typeof(p=O.toString)=="function"&&!A(c=p.call(O)))return c;if(typeof(p=O.valueOf)=="function"&&!A(c=p.call(O)))return c;if(!f&&typeof(p=O.toString)=="function"&&!A(c=p.call(O)))return c;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(C,D,T){var A=0,O=Math.random();D.exports=function(f){return"Symbol(".concat(f===void 0?"":f,")_",(++A+O).toString(36))}},{}],128:[function(C,D,T){var A=C("./_global"),O=A.navigator;D.exports=O&&O.userAgent||""},{"./_global":76}],129:[function(C,D,T){var A=C("./_global"),O=C("./_core"),f=C("./_library"),p=C("./_wks-ext"),c=C("./_object-dp").f;D.exports=function(s){var n=O.Symbol||(O.Symbol=f?{}:A.Symbol||{});s.charAt(0)=="_"||s in n||c(n,s,{value:p.f(s)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(C,D,T){T.f=C("./_wks")},{"./_wks":131}],131:[function(C,D,T){var A=C("./_shared")("wks"),O=C("./_uid"),f=C("./_global").Symbol,p=typeof f=="function";(D.exports=function(c){return A[c]||(A[c]=p&&f[c]||(p?f:O)("Symbol."+c))}).store=A},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(C,D,T){var A=C("./_classof"),O=C("./_wks")("iterator"),f=C("./_iterators");D.exports=C("./_core").getIteratorMethod=function(p){if(p!=null)return p[O]||p["@@iterator"]||f[A(p)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(C,D,T){"use strict";var A=C("./_ctx"),O=C("./_export"),f=C("./_to-object"),p=C("./_iter-call"),c=C("./_is-array-iter"),s=C("./_to-length"),n=C("./_create-property"),o=C("./core.get-iterator-method");O(O.S+O.F*!C("./_iter-detect")(function(r){Array.from(r)}),"Array",{from:function(r){var l,a,i,t,d=f(r),v=typeof this=="function"?this:Array,y=arguments.length,b=y>1?arguments[1]:void 0,g=b!==void 0,m=0,_=o(d);if(g&&(b=A(b,y>2?arguments[2]:void 0,2)),_==null||v==Array&&c(_))for(l=s(d.length),a=new v(l);l>m;m++)n(a,m,g?b(d[m],m):d[m]);else for(t=_.call(d),a=new v;!(i=t.next()).done;m++)n(a,m,g?p(t,b,[i.value,m],!0):i.value);return a.length=m,a}})},{"./_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(C,D,T){"use strict";var A=C("./_add-to-unscopables"),O=C("./_iter-step"),f=C("./_iterators"),p=C("./_to-iobject");D.exports=C("./_iter-define")(Array,"Array",function(c,s){this._t=p(c),this._i=0,this._k=s},function(){var c=this._t,s=this._k,n=this._i++;return!c||n>=c.length?(this._t=void 0,O(1)):s=="keys"?O(0,n):s=="values"?O(0,c[n]):O(0,[n,c[n]])},"values"),f.Arguments=f.Array,A("keys"),A("values"),A("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(C,D,T){"use strict";var A=C("./_is-object"),O=C("./_object-gpo"),f=C("./_wks")("hasInstance"),p=Function.prototype;f in p||C("./_object-dp").f(p,f,{value:function(c){if(typeof this!="function"||!A(c))return!1;if(!A(this.prototype))return c instanceof this;for(;c=O(c);)if(this.prototype===c)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(C,D,T){var A=C("./_export");A(A.S+A.F,"Object",{assign:C("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(C,D,T){var A=C("./_export");A(A.S,"Object",{create:C("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(C,D,T){var A=C("./_export");A(A.S+A.F*!C("./_descriptors"),"Object",{defineProperty:C("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(C,D,T){C("./_object-sap")("getOwnPropertyNames",function(){return C("./_object-gopn-ext").f})},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(C,D,T){var A=C("./_to-object"),O=C("./_object-gpo");C("./_object-sap")("getPrototypeOf",function(){return function(f){return O(A(f))}})},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(C,D,T){var A=C("./_to-object"),O=C("./_object-keys");C("./_object-sap")("keys",function(){return function(f){return O(A(f))}})},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(C,D,T){arguments[4][36][0].apply(T,arguments)},{dup:36}],143:[function(C,D,T){"use strict";var A,O,f,p,c=C("./_library"),s=C("./_global"),n=C("./_ctx"),o=C("./_classof"),r=C("./_export"),l=C("./_is-object"),a=C("./_a-function"),i=C("./_an-instance"),t=C("./_for-of"),d=C("./_species-constructor"),v=C("./_task").set,y=C("./_microtask")(),b=C("./_new-promise-capability"),g=C("./_perform"),m=C("./_user-agent"),_=C("./_promise-resolve"),x=s.TypeError,h=s.process,E=h&&h.versions,S=E&&E.v8||"",w=s.Promise,R=o(h)=="process",N=function(){},F=O=b.f,z=!!function(){try{var le=w.resolve(1),de=(le.constructor={})[C("./_wks")("species")]=function(Te){Te(N,N)};return(R||typeof PromiseRejectionEvent=="function")&&le.then(N)instanceof de&&S.indexOf("6.6")!==0&&m.indexOf("Chrome/66")===-1}catch(Te){}}(),q=function(le){var de;return!(!l(le)||typeof(de=le.then)!="function")&&de},B=function(le,de){if(!le._n){le._n=!0;var Te=le._c;y(function(){for(var we=le._v,Ie=le._s==1,_e=0;Te.length>_e;)!function(ye){var Ke,Me,Fe,Ge=Ie?ye.ok:ye.fail,Ee=ye.resolve,me=ye.reject,We=ye.domain;try{Ge?(Ie||(le._h==2&&J(le),le._h=1),Ge===!0?Ke=we:(We&&We.enter(),Ke=Ge(we),We&&(We.exit(),Fe=!0)),Ke===ye.promise?me(x("Promise-chain cycle")):(Me=q(Ke))?Me.call(Ke,Ee,me):Ee(Ke)):me(we)}catch(He){We&&!Fe&&We.exit(),me(He)}}(Te[_e++]);le._c=[],le._n=!1,de&&!le._h&&M(le)})}},M=function(le){v.call(s,function(){var de,Te,we,Ie=le._v,_e=G(le);if(_e&&(de=g(function(){R?h.emit("unhandledRejection",Ie,le):(Te=s.onunhandledrejection)?Te({promise:le,reason:Ie}):(we=s.console)&&we.error&&we.error("Unhandled promise rejection",Ie)}),le._h=R||G(le)?2:1),le._a=void 0,_e&&de.e)throw de.v})},G=function(le){return le._h!==1&&(le._a||le._c).length===0},J=function(le){v.call(s,function(){var de;R?h.emit("rejectionHandled",le):(de=s.onrejectionhandled)&&de({promise:le,reason:le._v})})},K=function(le){var de=this;de._d||(de._d=!0,de=de._w||de,de._v=le,de._s=2,de._a||(de._a=de._c.slice()),B(de,!0))},Z=function(le){var de,Te=this;if(!Te._d){Te._d=!0,Te=Te._w||Te;try{if(Te===le)throw x("Promise can't be resolved itself");(de=q(le))?y(function(){var we={_w:Te,_d:!1};try{de.call(le,n(Z,we,1),n(K,we,1))}catch(Ie){K.call(we,Ie)}}):(Te._v=le,Te._s=1,B(Te,!1))}catch(we){K.call({_w:Te,_d:!1},we)}}};z||(w=function(le){i(this,w,"Promise","_h"),a(le),A.call(this);try{le(n(Z,this,1),n(K,this,1))}catch(de){K.call(this,de)}},A=function(le){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},A.prototype=C("./_redefine-all")(w.prototype,{then:function(le,de){var Te=F(d(this,w));return Te.ok=typeof le!="function"||le,Te.fail=typeof de=="function"&&de,Te.domain=R?h.domain:void 0,this._c.push(Te),this._a&&this._a.push(Te),this._s&&B(this,!1),Te.promise},catch:function(le){return this.then(void 0,le)}}),f=function(){var le=new A;this.promise=le,this.resolve=n(Z,le,1),this.reject=n(K,le,1)},b.f=F=function(le){return le===w||le===p?new f(le):O(le)}),r(r.G+r.W+r.F*!z,{Promise:w}),C("./_set-to-string-tag")(w,"Promise"),C("./_set-species")("Promise"),p=C("./_core").Promise,r(r.S+r.F*!z,"Promise",{reject:function(le){var de=F(this);return(0,de.reject)(le),de.promise}}),r(r.S+r.F*(c||!z),"Promise",{resolve:function(le){return _(c&&this===p?w:this,le)}}),r(r.S+r.F*!(z&&C("./_iter-detect")(function(le){w.all(le).catch(N)})),"Promise",{all:function(le){var de=this,Te=F(de),we=Te.resolve,Ie=Te.reject,_e=g(function(){var ye=[],Ke=0,Me=1;t(le,!1,function(Fe){var Ge=Ke++,Ee=!1;ye.push(void 0),Me++,de.resolve(Fe).then(function(me){Ee||(Ee=!0,ye[Ge]=me,--Me||we(ye))},Ie)}),--Me||we(ye)});return _e.e&&Ie(_e.v),Te.promise},race:function(le){var de=this,Te=F(de),we=Te.reject,Ie=g(function(){t(le,!1,function(_e){de.resolve(_e).then(Te.resolve,we)})});return Ie.e&&we(Ie.v),Te.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(C,D,T){var A=C("./_export"),O=C("./_to-absolute-index"),f=String.fromCharCode,p=String.fromCodePoint;A(A.S+A.F*(!!p&&p.length!=1),"String",{fromCodePoint:function(c){for(var s,n=[],o=arguments.length,r=0;o>r;){if(s=+arguments[r++],O(s,1114111)!==s)throw RangeError(s+" is not a valid code point");n.push(s<65536?f(s):f(55296+((s-=65536)>>10),s%1024+56320))}return n.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(C,D,T){"use strict";var A=C("./_string-at")(!0);C("./_iter-define")(String,"String",function(O){this._t=String(O),this._i=0},function(){var O,f=this._t,p=this._i;return p>=f.length?{value:void 0,done:!0}:(O=A(f,p),this._i+=O.length,{value:O,done:!1})})},{"./_iter-define":88,"./_string-at":119}],146:[function(C,D,T){"use strict";var A=C("./_global"),O=C("./_has"),f=C("./_descriptors"),p=C("./_export"),c=C("./_redefine"),s=C("./_meta").KEY,n=C("./_fails"),o=C("./_shared"),r=C("./_set-to-string-tag"),l=C("./_uid"),a=C("./_wks"),i=C("./_wks-ext"),t=C("./_wks-define"),d=C("./_enum-keys"),v=C("./_is-array"),y=C("./_an-object"),b=C("./_is-object"),g=C("./_to-iobject"),m=C("./_to-primitive"),_=C("./_property-desc"),x=C("./_object-create"),h=C("./_object-gopn-ext"),E=C("./_object-gopd"),S=C("./_object-dp"),w=C("./_object-keys"),R=E.f,N=S.f,F=h.f,z=A.Symbol,q=A.JSON,B=q&&q.stringify,M=a("_hidden"),G=a("toPrimitive"),J={}.propertyIsEnumerable,K=o("symbol-registry"),Z=o("symbols"),le=o("op-symbols"),de=Object.prototype,Te=typeof z=="function",we=A.QObject,Ie=!we||!we.prototype||!we.prototype.findChild,_e=f&&n(function(){return x(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a!=7})?function(ee,$,Q){var xe=R(de,$);xe&&delete de[$],N(ee,$,Q),xe&&ee!==de&&N(de,$,xe)}:N,ye=function(ee){var $=Z[ee]=x(z.prototype);return $._k=ee,$},Ke=Te&&typeof z.iterator=="symbol"?function(ee){return typeof ee=="symbol"}:function(ee){return ee instanceof z},Me=function(ee,$,Q){return ee===de&&Me(le,$,Q),y(ee),$=m($,!0),y(Q),O(Z,$)?(Q.enumerable?(O(ee,M)&&ee[M][$]&&(ee[M][$]=!1),Q=x(Q,{enumerable:_(0,!1)})):(O(ee,M)||N(ee,M,_(1,{})),ee[M][$]=!0),_e(ee,$,Q)):N(ee,$,Q)},Fe=function(ee,$){y(ee);for(var Q,xe=d($=g($)),De=0,dt=xe.length;dt>De;)Me(ee,Q=xe[De++],$[Q]);return ee},Ge=function(ee,$){return $===void 0?x(ee):Fe(x(ee),$)},Ee=function(ee){var $=J.call(this,ee=m(ee,!0));return!(this===de&&O(Z,ee)&&!O(le,ee))&&(!($||!O(this,ee)||!O(Z,ee)||O(this,M)&&this[M][ee])||$)},me=function(ee,$){if(ee=g(ee),$=m($,!0),ee!==de||!O(Z,$)||O(le,$)){var Q=R(ee,$);return!Q||!O(Z,$)||O(ee,M)&&ee[M][$]||(Q.enumerable=!0),Q}},We=function(ee){for(var $,Q=F(g(ee)),xe=[],De=0;Q.length>De;)O(Z,$=Q[De++])||$==M||$==s||xe.push($);return xe},He=function(ee){for(var $,Q=ee===de,xe=F(Q?le:g(ee)),De=[],dt=0;xe.length>dt;)!O(Z,$=xe[dt++])||Q&&!O(de,$)||De.push(Z[$]);return De};Te||(z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var ee=l(arguments.length>0?arguments[0]:void 0),$=function(Q){this===de&&$.call(le,Q),O(this,M)&&O(this[M],ee)&&(this[M][ee]=!1),_e(this,ee,_(1,Q))};return f&&Ie&&_e(de,ee,{configurable:!0,set:$}),ye(ee)},c(z.prototype,"toString",function(){return this._k}),E.f=me,S.f=Me,C("./_object-gopn").f=h.f=We,C("./_object-pie").f=Ee,C("./_object-gops").f=He,f&&!C("./_library")&&c(de,"propertyIsEnumerable",Ee,!0),i.f=function(ee){return ye(a(ee))}),p(p.G+p.W+p.F*!Te,{Symbol:z});for(var it="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;it.length>re;)a(it[re++]);for(var P=w(a.store),j=0;P.length>j;)t(P[j++]);p(p.S+p.F*!Te,"Symbol",{for:function(ee){return O(K,ee+="")?K[ee]:K[ee]=z(ee)},keyFor:function(ee){if(!Ke(ee))throw TypeError(ee+" is not a symbol!");for(var $ in K)if(K[$]===ee)return $},useSetter:function(){Ie=!0},useSimple:function(){Ie=!1}}),p(p.S+p.F*!Te,"Object",{create:Ge,defineProperty:Me,defineProperties:Fe,getOwnPropertyDescriptor:me,getOwnPropertyNames:We,getOwnPropertySymbols:He}),q&&p(p.S+p.F*(!Te||n(function(){var ee=z();return B([ee])!="[null]"||B({a:ee})!="{}"||B(Object(ee))!="{}"})),"JSON",{stringify:function(ee){for(var $,Q,xe=[ee],De=1;arguments.length>De;)xe.push(arguments[De++]);if(Q=$=xe[1],(b($)||ee!==void 0)&&!Ke(ee))return v($)||($=function(dt,Ne){if(typeof Q=="function"&&(Ne=Q.call(this,dt,Ne)),!Ke(Ne))return Ne}),xe[1]=$,B.apply(q,xe)}}),z.prototype[G]||C("./_hide")(z.prototype,G,z.prototype.valueOf),r(z,"Symbol"),r(Math,"Math",!0),r(A.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(C,D,T){"use strict";var A=C("./_export"),O=C("./_core"),f=C("./_global"),p=C("./_species-constructor"),c=C("./_promise-resolve");A(A.P+A.R,"Promise",{finally:function(s){var n=p(this,O.Promise||f.Promise),o=typeof s=="function";return this.then(o?function(r){return c(n,s()).then(function(){return r})}:s,o?function(r){return c(n,s()).then(function(){throw r})}:s)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(C,D,T){"use strict";var A=C("./_export"),O=C("./_new-promise-capability"),f=C("./_perform");A(A.S,"Promise",{try:function(p){var c=O.f(this),s=f(p);return(s.e?c.reject:c.resolve)(s.v),c.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(C,D,T){C("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(C,D,T){C("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(C,D,T){C("./es6.array.iterator");for(var A=C("./_global"),O=C("./_hide"),f=C("./_iterators"),p=C("./_wks")("toStringTag"),c="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(","),s=0;s<c.length;s++){var n=c[s],o=A[n],r=o&&o.prototype;r&&!r[p]&&O(r,p,n),f[n]=f.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(C,D,T){var A=C("./_export"),O=C("./_task");A(A.G+A.B,{setImmediate:O.set,clearImmediate:O.clear})},{"./_export":73,"./_task":120}],153:[function(C,D,T){(function(A){"use strict";function O(m){return Array.isArray?Array.isArray(m):y(m)==="[object Array]"}function f(m){return typeof m=="boolean"}function p(m){return m===null}function c(m){return m==null}function s(m){return typeof m=="number"}function n(m){return typeof m=="string"}function o(m){return(m===void 0?"undefined":(0,g.default)(m))==="symbol"}function r(m){return m===void 0}function l(m){return y(m)==="[object RegExp]"}function a(m){return(m===void 0?"undefined":(0,g.default)(m))==="object"&&m!==null}function i(m){return y(m)==="[object Date]"}function t(m){return y(m)==="[object Error]"||m instanceof Error}function d(m){return typeof m=="function"}function v(m){return m===null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||(m===void 0?"undefined":(0,g.default)(m))==="symbol"||m===void 0}function y(m){return Object.prototype.toString.call(m)}var b=C("babel-runtime/helpers/typeof"),g=function(m){return m&&m.__esModule?m:{default:m}}(b);T.isArray=O,T.isBoolean=f,T.isNull=p,T.isNullOrUndefined=c,T.isNumber=s,T.isString=n,T.isSymbol=o,T.isUndefined=r,T.isRegExp=l,T.isObject=a,T.isDate=i,T.isError=t,T.isFunction=d,T.isPrimitive=v,T.isBuffer=A.isBuffer}).call(this,{isBuffer:C("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(C,D,T){"use strict";var A=C("babel-runtime/helpers/typeof"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);!function(f){function p(r,l){for(r=String(r),l=l||2;r.length<l;)r="0"+r;return r}function c(r){var l=new Date(r.getFullYear(),r.getMonth(),r.getDate());l.setDate(l.getDate()-(l.getDay()+6)%7+3);var a=new Date(l.getFullYear(),0,4);a.setDate(a.getDate()-(a.getDay()+6)%7+3);var i=l.getTimezoneOffset()-a.getTimezoneOffset();l.setHours(l.getHours()-i);var t=(l-a)/6048e5;return 1+Math.floor(t)}function s(r){var l=r.getDay();return l===0&&(l=7),l}function n(r){return r===null?"null":r===void 0?"undefined":(r===void 0?"undefined":(0,O.default)(r))!=="object"?r===void 0?"undefined":(0,O.default)(r):Array.isArray(r)?"array":{}.toString.call(r).slice(8,-1).toLowerCase()}var o=function(){var r=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,l=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,a=/[^-+\dA-Z]/g;return function(i,t,d,v){if(arguments.length!==1||n(i)!=="string"||/\d/.test(i)||(t=i,i=void 0),i=i||new Date,i instanceof Date||(i=new Date(i)),isNaN(i))throw TypeError("Invalid date");t=String(o.masks[t]||t||o.masks.default);var y=t.slice(0,4);y!=="UTC:"&&y!=="GMT:"||(t=t.slice(4),d=!0,y==="GMT:"&&(v=!0));var b=d?"getUTC":"get",g=i[b+"Date"](),m=i[b+"Day"](),_=i[b+"Month"](),x=i[b+"FullYear"](),h=i[b+"Hours"](),E=i[b+"Minutes"](),S=i[b+"Seconds"](),w=i[b+"Milliseconds"](),R=d?0:i.getTimezoneOffset(),N=c(i),F=s(i),z={d:g,dd:p(g),ddd:o.i18n.dayNames[m],dddd:o.i18n.dayNames[m+7],m:_+1,mm:p(_+1),mmm:o.i18n.monthNames[_],mmmm:o.i18n.monthNames[_+12],yy:String(x).slice(2),yyyy:x,h:h%12||12,hh:p(h%12||12),H:h,HH:p(h),M:E,MM:p(E),s:S,ss:p(S),l:p(w,3),L:p(Math.round(w/10)),t:h<12?"a":"p",tt:h<12?"am":"pm",T:h<12?"A":"P",TT:h<12?"AM":"PM",Z:v?"GMT":d?"UTC":(String(i).match(l)||[""]).pop().replace(a,""),o:(R>0?"-":"+")+p(100*Math.floor(Math.abs(R)/60)+Math.abs(R)%60,4),S:["th","st","nd","rd"][g%10>3?0:(g%100-g%10!=10)*g%10],W:N,N:F};return t.replace(r,function(q){return q in z?z[q]:q.slice(1,q.length-1)})}}();o.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"},o.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 W=="function"&&W.amd?W(function(){return o}):(T===void 0?"undefined":(0,O.default)(T))==="object"?D.exports=o:f.dateFormat=o}(void 0)},{"babel-runtime/helpers/typeof":32}],155:[function(C,D,T){(function(A){function O(){return!(typeof window=="undefined"||!window.process||window.process.type!=="renderer")||typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(n){var o=this.useColors;if(n[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+n[0]+(o?"%c ":" ")+"+"+T.humanize(this.diff),o){var r="color: "+this.color;n.splice(1,0,r,"color: inherit");var l=0,a=0;n[0].replace(/%[a-zA-Z%]/g,function(i){i!=="%%"&&(l++,i==="%c"&&(a=l))}),n.splice(a,0,r)}}function p(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function c(n){try{n==null?T.storage.removeItem("debug"):T.storage.debug=n}catch(o){}}function s(){var n;try{n=T.storage.debug}catch(o){}return!n&&A!==void 0&&"env"in A&&(n=A.env.DEBUG),n}T=D.exports=C("./debug"),T.log=p,T.formatArgs=f,T.save=c,T.load=s,T.useColors=O,T.storage=typeof chrome!="undefined"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch(n){}}(),T.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],T.formatters.j=function(n){try{return JSON.stringify(n)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}},T.enable(s())}).call(this,C("_process"))},{"./debug":156,_process:173}],156:[function(C,D,T){function A(o){var r,l=0;for(r in o)l=(l<<5)-l+o.charCodeAt(r),l|=0;return T.colors[Math.abs(l)%T.colors.length]}function O(o){function r(){if(r.enabled){var l=r,a=+new Date,i=a-(n||a);l.diff=i,l.prev=n,l.curr=a,n=a;for(var t=new Array(arguments.length),d=0;d<t.length;d++)t[d]=arguments[d];t[0]=T.coerce(t[0]),typeof t[0]!="string"&&t.unshift("%O");var v=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,function(y,b){if(y==="%%")return y;v++;var g=T.formatters[b];if(typeof g=="function"){var m=t[v];y=g.call(l,m),t.splice(v,1),v--}return y}),T.formatArgs.call(l,t),(r.log||T.log||console.log.bind(console)).apply(l,t)}}return r.namespace=o,r.enabled=T.enabled(o),r.useColors=T.useColors(),r.color=A(o),typeof T.init=="function"&&T.init(r),r}function f(o){T.save(o),T.names=[],T.skips=[];for(var r=(typeof o=="string"?o:"").split(/[\s,]+/),l=r.length,a=0;a<l;a++)r[a]&&(o=r[a].replace(/\*/g,".*?"),o[0]==="-"?T.skips.push(new RegExp("^"+o.substr(1)+"$")):T.names.push(new RegExp("^"+o+"$")))}function p(){T.enable("")}function c(o){var r,l;for(r=0,l=T.skips.length;r<l;r++)if(T.skips[r].test(o))return!1;for(r=0,l=T.names.length;r<l;r++)if(T.names[r].test(o))return!0;return!1}function s(o){return o instanceof Error?o.stack||o.message:o}T=D.exports=O.debug=O.default=O,T.coerce=s,T.disable=p,T.enable=f,T.enabled=c,T.humanize=C("ms"),T.names=[],T.skips=[],T.formatters={};var n},{ms:169}],157:[function(C,D,T){"use strict";function A(f){var p=""+f,c=O.exec(p);if(!c)return p;var s,n="",o=0,r=0;for(o=c.index;o<p.length;o++){switch(p.charCodeAt(o)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}r!==o&&(n+=p.substring(r,o)),r=o+1,n+=s}return r!==o?n+p.substring(r,o):n}var O=/["'&<>]/;D.exports=A},{}],158:[function(C,D,T){function A(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function O(s){return typeof s=="function"}function f(s){return typeof s=="number"}function p(s){return typeof s=="object"&&s!==null}function c(s){return s===void 0}D.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._maxListeners=void 0,A.defaultMaxListeners=10,A.prototype.setMaxListeners=function(s){if(!f(s)||s<0||isNaN(s))throw TypeError("n must be a positive number");return this._maxListeners=s,this},A.prototype.emit=function(s){var n,o,r,l,a,i;if(this._events||(this._events={}),s==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var t=new Error('Uncaught, unspecified "error" event. ('+n+")");throw t.context=n,t}if(o=this._events[s],c(o))return!1;if(O(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:l=Array.prototype.slice.call(arguments,1),o.apply(this,l)}else if(p(o))for(l=Array.prototype.slice.call(arguments,1),i=o.slice(),r=i.length,a=0;a<r;a++)i[a].apply(this,l);return!0},A.prototype.addListener=function(s,n){var o;if(!O(n))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",s,O(n.listener)?n.listener:n),this._events[s]?p(this._events[s])?this._events[s].push(n):this._events[s]=[this._events[s],n]:this._events[s]=n,p(this._events[s])&&!this._events[s].warned&&(o=c(this._maxListeners)?A.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[s].length>o&&(this._events[s].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[s].length),typeof console.trace=="function"&&console.trace()),this},A.prototype.on=A.prototype.addListener,A.prototype.once=function(s,n){function o(){this.removeListener(s,o),r||(r=!0,n.apply(this,arguments))}if(!O(n))throw TypeError("listener must be a function");var r=!1;return o.listener=n,this.on(s,o),this},A.prototype.removeListener=function(s,n){var o,r,l,a;if(!O(n))throw TypeError("listener must be a function");if(!this._events||!this._events[s])return this;if(o=this._events[s],l=o.length,r=-1,o===n||O(o.listener)&&o.listener===n)delete this._events[s],this._events.removeListener&&this.emit("removeListener",s,n);else if(p(o)){for(a=l;a-- >0;)if(o[a]===n||o[a].listener&&o[a].listener===n){r=a;break}if(r<0)return this;o.length===1?(o.length=0,delete this._events[s]):o.splice(r,1),this._events.removeListener&&this.emit("removeListener",s,n)}return this},A.prototype.removeAllListeners=function(s){var n,o;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[s]&&delete this._events[s],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(o=this._events[s],O(o))this.removeListener(s,o);else if(o)for(;o.length;)this.removeListener(s,o[o.length-1]);return delete this._events[s],this},A.prototype.listeners=function(s){return this._events&&this._events[s]?O(this._events[s])?[this._events[s]]:this._events[s].slice():[]},A.prototype.listenerCount=function(s){if(this._events){var n=this._events[s];if(O(n))return 1;if(n)return n.length}return 0},A.listenerCount=function(s,n){return s.listenerCount(n)}},{}],159:[function(C,D,T){var A=C("http"),O=D.exports;for(var f in A)A.hasOwnProperty(f)&&(O[f]=A[f]);O.request=function(p,c){return p||(p={}),p.scheme="https",p.protocol="https:",A.request.call(this,p,c)}},{http:196}],160:[function(C,D,T){"use strict";var A=C("util"),O=C("ms");D.exports=function(f){if(typeof f=="number")return f;var p=O(f);if(p===void 0){var c=new Error(A.format("humanize-ms(%j) result undefined",f));console.warn(c.stack)}return p}},{ms:169,util:207}],161:[function(C,D,T){T.read=function(A,O,f,p,c){var s,n,o=8*c-p-1,r=(1<<o)-1,l=r>>1,a=-7,i=f?c-1:0,t=f?-1:1,d=A[O+i];for(i+=t,s=d&(1<<-a)-1,d>>=-a,a+=o;a>0;s=256*s+A[O+i],i+=t,a-=8);for(n=s&(1<<-a)-1,s>>=-a,a+=p;a>0;n=256*n+A[O+i],i+=t,a-=8);if(s===0)s=1-l;else{if(s===r)return n?NaN:1/0*(d?-1:1);n+=Math.pow(2,p),s-=l}return(d?-1:1)*n*Math.pow(2,s-p)},T.write=function(A,O,f,p,c,s){var n,o,r,l=8*s-c-1,a=(1<<l)-1,i=a>>1,t=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=p?0:s-1,v=p?1:-1,y=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(o=isNaN(O)?1:0,n=a):(n=Math.floor(Math.log(O)/Math.LN2),O*(r=Math.pow(2,-n))<1&&(n--,r*=2),O+=n+i>=1?t/r:t*Math.pow(2,1-i),O*r>=2&&(n++,r/=2),n+i>=a?(o=0,n=a):n+i>=1?(o=(O*r-1)*Math.pow(2,c),n+=i):(o=O*Math.pow(2,i-1)*Math.pow(2,c),n=0));c>=8;A[f+d]=255&o,d+=v,o/=256,c-=8);for(n=n<<c|o,l+=c;l>0;A[f+d]=255&n,d+=v,n/=256,l-=8);A[f+d-v]|=128*y}},{}],162:[function(C,D,T){typeof Object.create=="function"?D.exports=function(A,O){A.super_=O,A.prototype=Object.create(O.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}})}:D.exports=function(A,O){A.super_=O;var f=function(){};f.prototype=O.prototype,A.prototype=new f,A.prototype.constructor=A}},{}],163:[function(C,D,T){function A(f){return!!f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function O(f){return typeof f.readFloatLE=="function"&&typeof f.slice=="function"&&A(f.slice(0,0))}D.exports=function(f){return f!=null&&(A(f)||O(f)||!!f._isBuffer)}},{}],164:[function(C,D,T){!function(A){function O(c){return p.call(c).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}function f(c){return typeof c=="function"&&(/^class(\s|\{\}$)/.test(p.call(c))||/^.*classCallCheck\(/.test(O(c)))}var p=Function.prototype.toString;T!==void 0?(D!==void 0&&D.exports&&(T=D.exports=f),T.isClass=f):typeof W=="function"&&W.amd?W([],function(){return f}):A.isClass=f}(this)},{}],165:[function(C,D,T){"use strict";function A(s){var n=s.slice(2);return n=n[0].toLowerCase()+n.slice(1)}var O=C("core-util-is"),f=C("isstream"),p=C("is-class");Object.keys(O).map(function(s){T[A(s)]=O[s]}),T.stream=f,T.readableStream=f.isReadable,T.writableStream=f.isWritable,T.duplexStream=f.isDuplex,T.class=p,T.finite=function(s){return Number.isFinite(s)},T.NaN=function(s){return Number.isNaN(s)},T.generator=function(s){return s&&typeof s.next=="function"&&typeof s.throw=="function"},T.generatorFunction=function(s){return s&&s.constructor&&s.constructor.name==="GeneratorFunction"},T.asyncFunction=function(s){return s&&s.constructor&&s.constructor.name==="AsyncFunction"},T.promise=function(s){return s&&typeof s.then=="function"};var c=Math.pow(2,31);T.int=function(s){return O.isNumber(s)&&s%1==0},T.int32=function(s){return T.int(s)&&s<c&&s>=-c},T.long=function(s){return T.int(s)&&(s>=c||s<-c)},T.Long=function(s){return T.object(s)&&T.number(s.high)&&T.number(s.low)},T.double=function(s){return O.isNumber(s)&&!isNaN(s)&&s%1!=0},T.date=function(s){return s instanceof Date},T.regExp=function(s){return s instanceof RegExp},T.regexp=T.regExp,T.error=function(s){return s instanceof Error},T.array=function(s){return Array.isArray(s)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(C,D,T){var A={}.toString;D.exports=Array.isArray||function(O){return A.call(O)=="[object Array]"}},{}],167:[function(C,D,T){function A(s){return s instanceof c.Stream}function O(s){return A(s)&&typeof s._read=="function"&&typeof s._readableState=="object"}function f(s){return A(s)&&typeof s._write=="function"&&typeof s._writableState=="object"}function p(s){return O(s)&&f(s)}var c=C("stream");D.exports=A,D.exports.isReadable=O,D.exports.isWritable=f,D.exports.isDuplex=p},{stream:195}],168:[function(C,D,T){"use strict";function A(f,p,c){if(!f)throw new TypeError("argument dest is required");if(!p)throw new TypeError("argument src is required");return c===void 0&&(c=!0),Object.getOwnPropertyNames(p).forEach(function(s){if(c||!O.call(f,s)){var n=Object.getOwnPropertyDescriptor(p,s);Object.defineProperty(f,s,n)}}),f}D.exports=A;var O=Object.prototype.hasOwnProperty},{}],169:[function(C,D,T){function A(l){if(l=String(l),!(l.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(l);if(a){var i=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*r;case"days":case"day":case"d":return i*o;case"hours":case"hour":case"hrs":case"hr":case"h":return i*n;case"minutes":case"minute":case"mins":case"min":case"m":return i*s;case"seconds":case"second":case"secs":case"sec":case"s":return i*c;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function O(l){return l>=o?Math.round(l/o)+"d":l>=n?Math.round(l/n)+"h":l>=s?Math.round(l/s)+"m":l>=c?Math.round(l/c)+"s":l+"ms"}function f(l){return p(l,o,"day")||p(l,n,"hour")||p(l,s,"minute")||p(l,c,"second")||l+" ms"}function p(l,a,i){if(!(l<a))return l<1.5*a?Math.floor(l/a)+" "+i:Math.ceil(l/a)+" "+i+"s"}var c=1e3,s=60*c,n=60*s,o=24*n,r=365.25*o;D.exports=function(l,a){a=a||{};var i=typeof l;if(i==="string"&&l.length>0)return A(l);if(i==="number"&&isNaN(l)===!1)return a.long?f(l):O(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))}},{}],170:[function(C,D,T){(function(A){function O(s,n){for(var o=0,r=s.length-1;r>=0;r--){var l=s[r];l==="."?s.splice(r,1):l===".."?(s.splice(r,1),o++):o&&(s.splice(r,1),o--)}if(n)for(;o--;o)s.unshift("..");return s}function f(s){typeof s!="string"&&(s+="");var n,o=0,r=-1,l=!0;for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!l){o=n+1;break}}else r===-1&&(l=!1,r=n+1);return r===-1?"":s.slice(o,r)}function p(s,n){if(s.filter)return s.filter(n);for(var o=[],r=0;r<s.length;r++)n(s[r],r,s)&&o.push(s[r]);return o}T.resolve=function(){for(var s="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var r=o>=0?arguments[o]:A.cwd();if(typeof r!="string")throw new TypeError("Arguments to path.resolve must be strings");r&&(s=r+"/"+s,n=r.charAt(0)==="/")}return s=O(p(s.split("/"),function(l){return!!l}),!n).join("/"),(n?"/":"")+s||"."},T.normalize=function(s){var n=T.isAbsolute(s),o=c(s,-1)==="/";return s=O(p(s.split("/"),function(r){return!!r}),!n).join("/"),s||n||(s="."),s&&o&&(s+="/"),(n?"/":"")+s},T.isAbsolute=function(s){return s.charAt(0)==="/"},T.join=function(){var s=Array.prototype.slice.call(arguments,0);return T.normalize(p(s,function(n,o){if(typeof n!="string")throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))},T.relative=function(s,n){function o(v){for(var y=0;y<v.length&&v[y]==="";y++);for(var b=v.length-1;b>=0&&v[b]==="";b--);return y>b?[]:v.slice(y,b-y+1)}s=T.resolve(s).substr(1),n=T.resolve(n).substr(1);for(var r=o(s.split("/")),l=o(n.split("/")),a=Math.min(r.length,l.length),i=a,t=0;t<a;t++)if(r[t]!==l[t]){i=t;break}for(var d=[],t=i;t<r.length;t++)d.push("..");return d=d.concat(l.slice(i)),d.join("/")},T.sep="/",T.delimiter=":",T.dirname=function(s){if(typeof s!="string"&&(s+=""),s.length===0)return".";for(var n=s.charCodeAt(0),o=n===47,r=-1,l=!0,a=s.length-1;a>=1;--a)if((n=s.charCodeAt(a))===47){if(!l){r=a;break}}else l=!1;return r===-1?o?"/":".":o&&r===1?"/":s.slice(0,r)},T.basename=function(s,n){var o=f(s);return n&&o.substr(-1*n.length)===n&&(o=o.substr(0,o.length-n.length)),o},T.extname=function(s){typeof s!="string"&&(s+="");for(var n=-1,o=0,r=-1,l=!0,a=0,i=s.length-1;i>=0;--i){var t=s.charCodeAt(i);if(t!==47)r===-1&&(l=!1,r=i+1),t===46?n===-1?n=i:a!==1&&(a=1):n!==-1&&(a=-1);else if(!l){o=i+1;break}}return n===-1||r===-1||a===0||a===1&&n===r-1&&n===o+1?"":s.slice(n,r)};var c="ab".substr(-1)==="b"?function(s,n,o){return s.substr(n,o)}:function(s,n,o){return n<0&&(n=s.length+n),s.substr(n,o)}}).call(this,C("_process"))},{_process:173}],171:[function(C,D,T){(function(A){(function(){"use strict";function O(S){return S=String(S),S.charAt(0).toUpperCase()+S.slice(1)}function f(S,w,R){var N={"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 w&&R&&/^Win/i.test(S)&&!/^Windows Phone /i.test(S)&&(N=N[/[\d.]+$/.exec(S)])&&(S="Windows "+N),S=String(S),w&&R&&(S=S.replace(RegExp(w,"i"),R)),S=c(S.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(S,w){var R=-1,N=S?S.length:0;if(typeof N=="number"&&N>-1&&N<=g)for(;++R<N;)w(S[R],R,S);else s(S,w)}function c(S){return S=a(S),/^(?:webOS|i(?:OS|P))/.test(S)?S:O(S)}function s(S,w){for(var R in S)x.call(S,R)&&w(S[R],R,S)}function n(S){return S==null?O(S):h.call(S).slice(8,-1)}function o(S,w){var R=S!=null?typeof S[w]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(R)||R=="object"&&!S[w])}function r(S){return String(S).replace(/([ -])(?!$)/g,"$1?")}function l(S,w){var R=null;return p(S,function(N,F){R=w(R,N,F,S)}),R}function a(S){return String(S).replace(/^ +| +$/g,"")}function i(S){function w(ee){return l(ee,function($,Q){var xe=Q.pattern||r(Q);return!$&&($=RegExp("\\b"+xe+" *\\d+[.\\w_]*","i").exec(S)||RegExp("\\b"+xe+" *\\w+-[\\w]*","i").exec(S)||RegExp("\\b"+xe+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(S))&&(($=String(Q.label&&!RegExp(xe,"i").test(Q.label)?Q.label:$).split("/"))[1]&&!/[\d.]+/.test($[0])&&($[0]+=" "+$[1]),Q=Q.label||Q,$=c($[0].replace(RegExp(xe,"i"),Q).replace(RegExp("; *(?:"+Q+"[_-])?","i")," ").replace(RegExp("("+Q+")[-_.]?(\\w)","i"),"$1 $2"))),$})}function R(){return this.description||""}var N=d,F=S&&typeof S=="object"&&n(S)!="String";F&&(N=S,S=null);var z=N.navigator||{},q=z.userAgent||"";S||(S=q);var B,M,G=F?!!z.likeChrome:/\bChrome\b/.test(S)&&!/internal|\n/i.test(h.toString()),J=F?"Object":"ScriptBridgingProxyObject",K=F?"Object":"Environment",Z=F&&N.java?"JavaPackage":n(N.java),le=F?"Object":"RuntimeObject",de=/\bJava/.test(Z)&&N.java,Te=de&&n(N.environment)==K,we=de?"a":"\u4F2A",Ie=de?"b":"\u5C3E",_e=N.document||{},ye=N.operamini||N.opera,Ke=m.test(Ke=F&&ye?ye["[[Class]]"]:n(ye))?Ke:ye=null,Me=S,Fe=[],Ge=null,Ee=S==q,me=Ee&&ye&&typeof ye.version=="function"&&ye.version(),We=function(ee){return l(ee,function($,Q){return $||RegExp("\\b"+(Q.pattern||r(Q))+"\\b","i").exec(S)&&(Q.label||Q)})}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),He=function(ee){return l(ee,function($,Q){return $||RegExp("\\b"+(Q.pattern||r(Q))+"\\b","i").exec(S)&&(Q.label||Q)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),it=w([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),re=function(ee){return l(ee,function($,Q,xe){return $||(Q[it]||Q[/^[a-z]+(?: +[a-z]+\b)*/i.exec(it)]||RegExp("\\b"+r(xe)+"(?:\\b|\\w*\\d)","i").exec(S))&&xe})}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),P=function(ee){return l(ee,function($,Q){var xe=Q.pattern||r(Q);return!$&&($=RegExp("\\b"+xe+"(?:/[\\d.]+|[ \\w.]*)","i").exec(S))&&($=f($,xe,Q.label||Q)),$})}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);if(We&&(We=[We]),re&&!it&&(it=w([re])),(B=/\bGoogle TV\b/.exec(it))&&(it=B[0]),/\bSimulator\b/i.test(S)&&(it=(it?it+" ":"")+"Simulator"),He=="Opera Mini"&&/\bOPiOS\b/.test(S)&&Fe.push("running in Turbo/Uncompressed mode"),He=="IE"&&/\blike iPhone OS\b/.test(S)?(B=i(S.replace(/like iPhone OS/,"")),re=B.manufacturer,it=B.product):/^iP/.test(it)?(He||(He="Safari"),P="iOS"+((B=/ OS ([\d_]+)/i.exec(S))?" "+B[1].replace(/_/g,"."):"")):He!="Konqueror"||/buntu/i.test(P)?re&&re!="Google"&&(/Chrome/.test(He)&&!/\bMobile Safari\b/i.test(S)||/\bVita\b/.test(it))||/\bAndroid\b/.test(P)&&/^Chrome/.test(He)&&/\bVersion\//i.test(S)?(He="Android Browser",P=/\bAndroid\b/.test(P)?P:"Android"):He=="Silk"?(/\bMobi/i.test(S)||(P="Android",Fe.unshift("desktop mode")),/Accelerated *= *true/i.test(S)&&Fe.unshift("accelerated")):He=="PaleMoon"&&(B=/\bFirefox\/([\d.]+)\b/.exec(S))?Fe.push("identifying as Firefox "+B[1]):He=="Firefox"&&(B=/\b(Mobile|Tablet|TV)\b/i.exec(S))?(P||(P="Firefox OS"),it||(it=B[1])):!He||(B=!/\bMinefield\b/i.test(S)&&/\b(?:Firefox|Safari)\b/.exec(He))?(He&&!it&&/[\/,]|^[^(]+?\)/.test(S.slice(S.indexOf(B+"/")+8))&&(He=null),(B=it||re||P)&&(it||re||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(P))&&(He=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(P)?P:B)+" Browser")):He=="Electron"&&(B=(/\bChrome\/([\d.]+)\b/.exec(S)||0)[1])&&Fe.push("Chromium "+B):P="Kubuntu",me||(me=function(ee){return l(ee,function($,Q){return $||(RegExp(Q+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(S)||0)[1]||null})}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",r(He),"(?:Firefox|Minefield|NetFront)"])),(B=We=="iCab"&&parseFloat(me)>3&&"WebKit"||/\bOpera\b/.test(He)&&(/\bOPR\b/.test(S)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(S)&&!/^(?:Trident|EdgeHTML)$/.test(We)&&"WebKit"||!We&&/\bMSIE\b/i.test(S)&&(P=="Mac OS"?"Tasman":"Trident")||We=="WebKit"&&/\bPlayStation\b(?! Vita\b)/i.test(He)&&"NetFront")&&(We=[B]),He=="IE"&&(B=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(S)||0)[1])?(He+=" Mobile",P="Windows Phone "+(/\+$/.test(B)?B:B+".x"),Fe.unshift("desktop mode")):/\bWPDesktop\b/i.test(S)?(He="IE Mobile",P="Windows Phone 8.x",Fe.unshift("desktop mode"),me||(me=(/\brv:([\d.]+)/.exec(S)||0)[1])):He!="IE"&&We=="Trident"&&(B=/\brv:([\d.]+)/.exec(S))&&(He&&Fe.push("identifying as "+He+(me?" "+me:"")),He="IE",me=B[1]),Ee){if(o(N,"global"))if(de&&(B=de.lang.System,Me=B.getProperty("os.arch"),P=P||B.getProperty("os.name")+" "+B.getProperty("os.version")),Te){try{me=N.require("ringo/engine").version.join("."),He="RingoJS"}catch(ee){(B=N.system)&&B.global.system==N.system&&(He="Narwhal",P||(P=B[0].os||null))}He||(He="Rhino")}else typeof N.process=="object"&&!N.process.browser&&(B=N.process)&&(typeof B.versions=="object"&&(typeof B.versions.electron=="string"?(Fe.push("Node "+B.versions.node),He="Electron",me=B.versions.electron):typeof B.versions.nw=="string"&&(Fe.push("Chromium "+me,"Node "+B.versions.node),He="NW.js",me=B.versions.nw)),He||(He="Node.js",Me=B.arch,P=B.platform,me=/[\d.]+/.exec(B.version),me=me?me[0]:null));else n(B=N.runtime)==J?(He="Adobe AIR",P=B.flash.system.Capabilities.os):n(B=N.phantom)==le?(He="PhantomJS",me=(B=B.version||null)&&B.major+"."+B.minor+"."+B.patch):typeof _e.documentMode=="number"&&(B=/\bTrident\/(\d+)/i.exec(S))?(me=[me,_e.documentMode],(B=+B[1]+4)!=me[1]&&(Fe.push("IE "+me[1]+" mode"),We&&(We[1]=""),me[1]=B),me=He=="IE"?String(me[1].toFixed(1)):me[0]):typeof _e.documentMode=="number"&&/^(?:Chrome|Firefox)\b/.test(He)&&(Fe.push("masking as "+He+" "+me),He="IE",me="11.0",We=["Trident"],P="Windows");P=P&&c(P)}if(me&&(B=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(me)||/(?:alpha|beta)(?: ?\d)?/i.exec(S+";"+(Ee&&z.appMinorVersion))||/\bMinefield\b/i.test(S)&&"a")&&(Ge=/b/i.test(B)?"beta":"alpha",me=me.replace(RegExp(B+"\\+?$"),"")+(Ge=="beta"?Ie:we)+(/\d+\+?/.exec(B)||"")),He=="Fennec"||He=="Firefox"&&/\b(?:Android|Firefox OS)\b/.test(P))He="Firefox Mobile";else if(He=="Maxthon"&&me)me=me.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(it))it=="Xbox 360"&&(P=null),it=="Xbox 360"&&/\bIEMobile\b/.test(S)&&Fe.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(He)&&(!He||it||/Browser|Mobi/.test(He))||P!="Windows CE"&&!/Mobi/i.test(S))if(He=="IE"&&Ee)try{N.external===null&&Fe.unshift("platform preview")}catch(ee){Fe.unshift("embedded")}else(/\bBlackBerry\b/.test(it)||/\bBB10\b/.test(S))&&(B=(RegExp(it.replace(/ +/g," *")+"/([.\\d]+)","i").exec(S)||0)[1]||me)?(B=[B,/BB10/.test(S)],P=(B[1]?(it=null,re="BlackBerry"):"Device Software")+" "+B[0],me=null):this!=s&&it!="Wii"&&(Ee&&ye||/Opera/.test(He)&&/\b(?:MSIE|Firefox)\b/i.test(S)||He=="Firefox"&&/\bOS X (?:\d+\.){2,}/.test(P)||He=="IE"&&(P&&!/^Win/.test(P)&&me>5.5||/\bWindows XP\b/.test(P)&&me>8||me==8&&!/\bTrident\b/.test(S)))&&!m.test(B=i.call(s,S.replace(m,"")+";"))&&B.name&&(B="ing as "+B.name+((B=B.version)?" "+B:""),m.test(He)?(/\bIE\b/.test(B)&&P=="Mac OS"&&(P=null),B="identify"+B):(B="mask"+B,He=Ke?c(Ke.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(B)&&(P=null),Ee||(me=null)),We=["Presto"],Fe.push(B));else He+=" Mobile";(B=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(S)||0)[1])&&(B=[parseFloat(B.replace(/\.(\d)$/,".0$1")),B],He=="Safari"&&B[1].slice(-1)=="+"?(He="WebKit Nightly",Ge="alpha",me=B[1].slice(0,-1)):me!=B[1]&&me!=(B[2]=(/\bSafari\/([\d.]+\+?)/i.exec(S)||0)[1])||(me=null),B[1]=(/\bChrome\/([\d.]+)/i.exec(S)||0)[1],B[0]==537.36&&B[2]==537.36&&parseFloat(B[1])>=28&&We=="WebKit"&&(We=["Blink"]),Ee&&(G||B[1])?(We&&(We[1]="like Chrome"),B=B[1]||(B=B[0],B<530?1:B<532?2:B<532.05?3:B<533?4:B<534.03?5:B<534.07?6:B<534.1?7:B<534.13?8:B<534.16?9:B<534.24?10:B<534.3?11:B<535.01?12:B<535.02?"13+":B<535.07?15:B<535.11?16:B<535.19?17:B<536.05?18:B<536.1?19:B<537.01?20:B<537.11?"21+":B<537.13?23:B<537.18?24:B<537.24?25:B<537.36?26:We!="Blink"?"27":"28")):(We&&(We[1]="like Safari"),B=B[0],B=B<400?1:B<500?2:B<526?3:B<533?4:B<534?"4+":B<535?5:B<537?6:B<538?7:B<601?8:"8"),We&&(We[1]+=" "+(B+=typeof B=="number"?".x":/[.+]/.test(B)?"":"+")),He=="Safari"&&(!me||parseInt(me)>45)&&(me=B)),He=="Opera"&&(B=/\bzbov|zvav$/.exec(P))?(He+=" ",Fe.unshift("desktop mode"),B=="zvav"?(He+="Mini",me=null):He+="Mobile",P=P.replace(RegExp(" *"+B+"$"),"")):He=="Safari"&&/\bChrome\b/.exec(We&&We[1])&&(Fe.unshift("desktop mode"),He="Chrome Mobile",me=null,/\bOS X\b/.test(P)?(re="Apple",P="iOS 4.3+"):P=null),me&&me.indexOf(B=/[\d.]+$/.exec(P))==0&&S.indexOf("/"+B+"-")>-1&&(P=a(P.replace(B,""))),We&&!/\b(?:Avant|Nook)\b/.test(He)&&(/Browser|Lunascape|Maxthon/.test(He)||He!="Safari"&&/^iOS/.test(P)&&/\bSafari\b/.test(We[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(He)&&We[1])&&(B=We[We.length-1])&&Fe.push(B),Fe.length&&(Fe=["("+Fe.join("; ")+")"]),re&&it&&it.indexOf(re)<0&&Fe.push("on "+re),it&&Fe.push((/^on /.test(Fe[Fe.length-1])?"":"on ")+it),P&&(B=/ ([\d.+]+)$/.exec(P),M=B&&P.charAt(P.length-B[0].length-1)=="/",P={architecture:32,family:B&&!M?P.replace(B[0],""):P,version:B?B[1]:null,toString:function(){var ee=this.version;return this.family+(ee&&!M?" "+ee:"")+(this.architecture==64?" 64-bit":"")}}),(B=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(Me))&&!/\bi686\b/i.test(Me)?(P&&(P.architecture=64,P.family=P.family.replace(RegExp(" *"+B),"")),He&&(/\bWOW64\b/i.test(S)||Ee&&/\w(?:86|32)$/.test(z.cpuClass||z.platform)&&!/\bWin64; x64\b/i.test(S))&&Fe.unshift("32-bit")):P&&/^OS X/.test(P.family)&&He=="Chrome"&&parseFloat(me)>=39&&(P.architecture=64),S||(S=null);var j={};return j.description=S,j.layout=We&&We[0],j.manufacturer=re,j.name=He,j.prerelease=Ge,j.product=it,j.ua=S,j.version=He&&me,j.os=P||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=i,j.toString=R,j.version&&Fe.unshift(me),j.name&&Fe.unshift(He),P&&He&&(P!=String(P).split(" ")[0]||P!=He.split(" ")[0]&&!it)&&Fe.push(it?"("+P+")":"on "+P),Fe.length&&(j.description=Fe.join(" ")),j}var t={function:!0,object:!0},d=t[typeof window]&&window||this,v=t[typeof T]&&T,y=t[typeof D]&&D&&!D.nodeType&&D,b=v&&y&&typeof A=="object"&&A;!b||b.global!==b&&b.window!==b&&b.self!==b||(d=b);var g=Math.pow(2,53)-1,m=/\bOpera/,_=Object.prototype,x=_.hasOwnProperty,h=_.toString,E=i();typeof W=="function"&&typeof W.amd=="object"&&W.amd?(d.platform=E,W(function(){return E})):v&&y?s(E,function(S,w){v[w]=S}):d.platform=E}).call(this)}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],172:[function(C,D,T){(function(A){"use strict";function O(f,p,c,s){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var n,o,r=arguments.length;switch(r){case 0:case 1:return A.nextTick(f);case 2:return A.nextTick(function(){f.call(null,p)});case 3:return A.nextTick(function(){f.call(null,p,c)});case 4:return A.nextTick(function(){f.call(null,p,c,s)});default:for(n=new Array(r-1),o=0;o<n.length;)n[o++]=arguments[o];return A.nextTick(function(){f.apply(null,n)})}}!A.version||A.version.indexOf("v0.")===0||A.version.indexOf("v1.")===0&&A.version.indexOf("v1.8.")!==0?D.exports={nextTick:O}:D.exports=A}).call(this,C("_process"))},{_process:173}],173:[function(C,D,T){function A(){throw new Error("setTimeout has not been defined")}function O(){throw new Error("clearTimeout has not been defined")}function f(y){if(r===setTimeout)return setTimeout(y,0);if((r===A||!r)&&setTimeout)return r=setTimeout,setTimeout(y,0);try{return r(y,0)}catch(b){try{return r.call(null,y,0)}catch(g){return r.call(this,y,0)}}}function p(y){if(l===clearTimeout)return clearTimeout(y);if((l===O||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(y);try{return l(y)}catch(b){try{return l.call(null,y)}catch(g){return l.call(this,y)}}}function c(){d&&i&&(d=!1,i.length?t=i.concat(t):v=-1,t.length&&s())}function s(){if(!d){var y=f(c);d=!0;for(var b=t.length;b;){for(i=t,t=[];++v<b;)i&&i[v].run();v=-1,b=t.length}i=null,d=!1,p(y)}}function n(y,b){this.fun=y,this.array=b}function o(){}var r,l,a=D.exports={};!function(){try{r=typeof setTimeout=="function"?setTimeout:A}catch(y){r=A}try{l=typeof clearTimeout=="function"?clearTimeout:O}catch(y){l=O}}();var i,t=[],d=!1,v=-1;a.nextTick=function(y){var b=new Array(arguments.length-1);if(arguments.length>1)for(var g=1;g<arguments.length;g++)b[g-1]=arguments[g];t.push(new n(y,b)),t.length!==1||d||f(s)},n.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=o,a.addListener=o,a.once=o,a.off=o,a.removeListener=o,a.removeAllListeners=o,a.emit=o,a.prependListener=o,a.prependOnceListener=o,a.listeners=function(y){return[]},a.binding=function(y){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(y){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],174:[function(C,D,T){(function(A){!function(O){function f(Z){throw new RangeError(M[Z])}function p(Z,le){for(var de=Z.length,Te=[];de--;)Te[de]=le(Z[de]);return Te}function c(Z,le){var de=Z.split("@"),Te="";return de.length>1&&(Te=de[0]+"@",Z=de[1]),Z=Z.replace(B,"."),Te+p(Z.split("."),le).join(".")}function s(Z){for(var le,de,Te=[],we=0,Ie=Z.length;we<Ie;)le=Z.charCodeAt(we++),le>=55296&&le<=56319&&we<Ie?(de=Z.charCodeAt(we++),(64512&de)==56320?Te.push(((1023&le)<<10)+(1023&de)+65536):(Te.push(le),we--)):Te.push(le);return Te}function n(Z){return p(Z,function(le){var de="";return le>65535&&(le-=65536,de+=K(le>>>10&1023|55296),le=56320|1023&le),de+=K(le)}).join("")}function o(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:x}function r(Z,le){return Z+22+75*(Z<26)-((le!=0)<<5)}function l(Z,le,de){var Te=0;for(Z=de?J(Z/w):Z>>1,Z+=J(Z/le);Z>G*E>>1;Te+=x)Z=J(Z/G);return J(Te+(G+1)*Z/(Z+S))}function a(Z){var le,de,Te,we,Ie,_e,ye,Ke,Me,Fe,Ge=[],Ee=Z.length,me=0,We=N,He=R;for(de=Z.lastIndexOf(F),de<0&&(de=0),Te=0;Te<de;++Te)Z.charCodeAt(Te)>=128&&f("not-basic"),Ge.push(Z.charCodeAt(Te));for(we=de>0?de+1:0;we<Ee;){for(Ie=me,_e=1,ye=x;we>=Ee&&f("invalid-input"),Ke=o(Z.charCodeAt(we++)),(Ke>=x||Ke>J((_-me)/_e))&&f("overflow"),me+=Ke*_e,Me=ye<=He?h:ye>=He+E?E:ye-He,!(Ke<Me);ye+=x)Fe=x-Me,_e>J(_/Fe)&&f("overflow"),_e*=Fe;le=Ge.length+1,He=l(me-Ie,le,Ie==0),J(me/le)>_-We&&f("overflow"),We+=J(me/le),me%=le,Ge.splice(me++,0,We)}return n(Ge)}function i(Z){var le,de,Te,we,Ie,_e,ye,Ke,Me,Fe,Ge,Ee,me,We,He,it=[];for(Z=s(Z),Ee=Z.length,le=N,de=0,Ie=R,_e=0;_e<Ee;++_e)(Ge=Z[_e])<128&&it.push(K(Ge));for(Te=we=it.length,we&&it.push(F);Te<Ee;){for(ye=_,_e=0;_e<Ee;++_e)(Ge=Z[_e])>=le&&Ge<ye&&(ye=Ge);for(me=Te+1,ye-le>J((_-de)/me)&&f("overflow"),de+=(ye-le)*me,le=ye,_e=0;_e<Ee;++_e)if(Ge=Z[_e],Ge<le&&++de>_&&f("overflow"),Ge==le){for(Ke=de,Me=x;Fe=Me<=Ie?h:Me>=Ie+E?E:Me-Ie,!(Ke<Fe);Me+=x)He=Ke-Fe,We=x-Fe,it.push(K(r(Fe+He%We,0))),Ke=J(He/We);it.push(K(r(Ke,0))),Ie=l(de,me,Te==we),de=0,++Te}++de,++le}return it.join("")}function t(Z){return c(Z,function(le){return z.test(le)?a(le.slice(4).toLowerCase()):le})}function d(Z){return c(Z,function(le){return q.test(le)?"xn--"+i(le):le})}var v=typeof T=="object"&&T&&!T.nodeType&&T,y=typeof D=="object"&&D&&!D.nodeType&&D,b=typeof A=="object"&&A;b.global!==b&&b.window!==b&&b.self!==b||(O=b);var g,m,_=2147483647,x=36,h=1,E=26,S=38,w=700,R=72,N=128,F="-",z=/^xn--/,q=/[^\x20-\x7E]/,B=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},G=x-h,J=Math.floor,K=String.fromCharCode;if(g={version:"1.4.1",ucs2:{decode:s,encode:n},decode:a,encode:i,toASCII:d,toUnicode:t},typeof W=="function"&&typeof W.amd=="object"&&W.amd)W("punycode",function(){return g});else if(v&&y)if(D.exports==v)y.exports=g;else for(m in g)g.hasOwnProperty(m)&&(v[m]=g[m]);else O.punycode=g}(this)}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],175:[function(C,D,T){"use strict";function A(f,p){return Object.prototype.hasOwnProperty.call(f,p)}D.exports=function(f,p,c,s){p=p||"&",c=c||"=";var n={};if(typeof f!="string"||f.length===0)return n;var o=/\+/g;f=f.split(p);var r=1e3;s&&typeof s.maxKeys=="number"&&(r=s.maxKeys);var l=f.length;r>0&&l>r&&(l=r);for(var a=0;a<l;++a){var i,t,d,v,y=f[a].replace(o,"%20"),b=y.indexOf(c);b>=0?(i=y.substr(0,b),t=y.substr(b+1)):(i=y,t=""),d=decodeURIComponent(i),v=decodeURIComponent(t),A(n,d)?O(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n};var O=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"}},{}],176:[function(C,D,T){"use strict";function A(c,s){if(c.map)return c.map(s);for(var n=[],o=0;o<c.length;o++)n.push(s(c[o],o));return n}var O=function(c){switch(typeof c){case"string":return c;case"boolean":return c?"true":"false";case"number":return isFinite(c)?c:"";default:return""}};D.exports=function(c,s,n,o){return s=s||"&",n=n||"=",c===null&&(c=void 0),typeof c=="object"?A(p(c),function(r){var l=encodeURIComponent(O(r))+n;return f(c[r])?A(c[r],function(a){return l+encodeURIComponent(O(a))}).join(s):l+encodeURIComponent(O(c[r]))}).join(s):o?encodeURIComponent(O(o))+n+encodeURIComponent(O(c)):""};var f=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},p=Object.keys||function(c){var s=[];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&s.push(n);return s}},{}],177:[function(C,D,T){"use strict";T.decode=T.parse=C("./decode"),T.encode=T.stringify=C("./encode")},{"./decode":175,"./encode":176}],178:[function(C,D,T){D.exports=C("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(C,D,T){"use strict";function A(d){if(!(this instanceof A))return new A(d);r.call(this,d),l.call(this,d),d&&d.readable===!1&&(this.readable=!1),d&&d.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,d&&d.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",O)}function O(){this.allowHalfOpen||this._writableState.ended||s.nextTick(f,this)}function f(d){d.end()}var p=C("babel-runtime/core-js/object/keys"),c=function(d){return d&&d.__esModule?d:{default:d}}(p),s=C("process-nextick-args"),n=c.default||function(d){var v=[];for(var y in d)v.push(y);return v};D.exports=A;var o=C("core-util-is");o.inherits=C("inherits");var r=C("./_stream_readable"),l=C("./_stream_writable");o.inherits(A,r);for(var a=n(l.prototype),i=0;i<a.length;i++){var t=a[i];A.prototype[t]||(A.prototype[t]=l.prototype[t])}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),A.prototype._destroy=function(d,v){this.push(null),this.end(),s.nextTick(v,d)}},{"./_stream_readable":181,"./_stream_writable":183,"babel-runtime/core-js/object/keys":23,"core-util-is":153,inherits:162,"process-nextick-args":172}],180:[function(C,D,T){"use strict";function A(p){if(!(this instanceof A))return new A(p);O.call(this,p)}D.exports=A;var O=C("./_stream_transform"),f=C("core-util-is");f.inherits=C("inherits"),f.inherits(A,O),A.prototype._transform=function(p,c,s){s(null,p)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(C,D,T){(function(A,O){"use strict";function f(Ee){return de.from(Ee)}function p(Ee){return de.isBuffer(Ee)||Ee instanceof Te}function c(Ee,me,We){if(typeof Ee.prependListener=="function")return Ee.prependListener(me,We);Ee._events&&Ee._events[me]?K(Ee._events[me])?Ee._events[me].unshift(We):Ee._events[me]=[We,Ee._events[me]]:Ee.on(me,We)}function s(Ee,me){J=J||C("./_stream_duplex"),Ee=Ee||{};var We=me instanceof J;this.objectMode=!!Ee.objectMode,We&&(this.objectMode=this.objectMode||!!Ee.readableObjectMode);var He=Ee.highWaterMark,it=Ee.readableHighWaterMark,re=this.objectMode?16:16384;this.highWaterMark=He||He===0?He:We&&(it||it===0)?it:re,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Ke,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=Ee.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Ee.encoding&&(ye||(ye=C("string_decoder/").StringDecoder),this.decoder=new ye(Ee.encoding),this.encoding=Ee.encoding)}function n(Ee){if(J=J||C("./_stream_duplex"),!(this instanceof n))return new n(Ee);this._readableState=new s(Ee,this),this.readable=!0,Ee&&(typeof Ee.read=="function"&&(this._read=Ee.read),typeof Ee.destroy=="function"&&(this._destroy=Ee.destroy)),le.call(this)}function o(Ee,me,We,He,it){var re=Ee._readableState;if(me===null)re.reading=!1,d(Ee,re);else{var P;it||(P=l(re,me)),P?Ee.emit("error",P):re.objectMode||me&&me.length>0?(typeof me=="string"||re.objectMode||(0,M.default)(me)===de.prototype||(me=f(me)),He?re.endEmitted?Ee.emit("error",new Error("stream.unshift() after end event")):r(Ee,re,me,!0):re.ended?Ee.emit("error",new Error("stream.push() after EOF")):(re.reading=!1,re.decoder&&!We?(me=re.decoder.write(me),re.objectMode||me.length!==0?r(Ee,re,me,!1):b(Ee,re)):r(Ee,re,me,!1))):He||(re.reading=!1)}return a(re)}function r(Ee,me,We,He){me.flowing&&me.length===0&&!me.sync?(Ee.emit("data",We),Ee.read(0)):(me.length+=me.objectMode?1:We.length,He?me.buffer.unshift(We):me.buffer.push(We),me.needReadable&&v(Ee)),b(Ee,me)}function l(Ee,me){var We;return p(me)||typeof me=="string"||me===void 0||Ee.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We}function a(Ee){return!Ee.ended&&(Ee.needReadable||Ee.length<Ee.highWaterMark||Ee.length===0)}function i(Ee){return Ee>=Ge?Ee=Ge:(Ee--,Ee|=Ee>>>1,Ee|=Ee>>>2,Ee|=Ee>>>4,Ee|=Ee>>>8,Ee|=Ee>>>16,Ee++),Ee}function t(Ee,me){return Ee<=0||me.length===0&&me.ended?0:me.objectMode?1:Ee!==Ee?me.flowing&&me.length?me.buffer.head.data.length:me.length:(Ee>me.highWaterMark&&(me.highWaterMark=i(Ee)),Ee<=me.length?Ee:me.ended?me.length:(me.needReadable=!0,0))}function d(Ee,me){if(!me.ended){if(me.decoder){var We=me.decoder.end();We&&We.length&&(me.buffer.push(We),me.length+=me.objectMode?1:We.length)}me.ended=!0,v(Ee)}}function v(Ee){var me=Ee._readableState;me.needReadable=!1,me.emittedReadable||(_e("emitReadable",me.flowing),me.emittedReadable=!0,me.sync?G.nextTick(y,Ee):y(Ee))}function y(Ee){_e("emit readable"),Ee.emit("readable"),E(Ee)}function b(Ee,me){me.readingMore||(me.readingMore=!0,G.nextTick(g,Ee,me))}function g(Ee,me){for(var We=me.length;!me.reading&&!me.flowing&&!me.ended&&me.length<me.highWaterMark&&(_e("maybeReadMore read 0"),Ee.read(0),We!==me.length);)We=me.length;me.readingMore=!1}function m(Ee){return function(){var me=Ee._readableState;_e("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&Z(Ee,"data")&&(me.flowing=!0,E(Ee))}}function _(Ee){_e("readable nexttick read 0"),Ee.read(0)}function x(Ee,me){me.resumeScheduled||(me.resumeScheduled=!0,G.nextTick(h,Ee,me))}function h(Ee,me){me.reading||(_e("resume read 0"),Ee.read(0)),me.resumeScheduled=!1,me.awaitDrain=0,Ee.emit("resume"),E(Ee),me.flowing&&!me.reading&&Ee.read(0)}function E(Ee){var me=Ee._readableState;for(_e("flow",me.flowing);me.flowing&&Ee.read()!==null;);}function S(Ee,me){if(me.length===0)return null;var We;return me.objectMode?We=me.buffer.shift():!Ee||Ee>=me.length?(We=me.decoder?me.buffer.join(""):me.buffer.length===1?me.buffer.head.data:me.buffer.concat(me.length),me.buffer.clear()):We=w(Ee,me.buffer,me.decoder),We}function w(Ee,me,We){var He;return Ee<me.head.data.length?(He=me.head.data.slice(0,Ee),me.head.data=me.head.data.slice(Ee)):He=Ee===me.head.data.length?me.shift():We?R(Ee,me):N(Ee,me),He}function R(Ee,me){var We=me.head,He=1,it=We.data;for(Ee-=it.length;We=We.next;){var re=We.data,P=Ee>re.length?re.length:Ee;if(P===re.length?it+=re:it+=re.slice(0,Ee),(Ee-=P)===0){P===re.length?(++He,We.next?me.head=We.next:me.head=me.tail=null):(me.head=We,We.data=re.slice(P));break}++He}return me.length-=He,it}function N(Ee,me){var We=de.allocUnsafe(Ee),He=me.head,it=1;for(He.data.copy(We),Ee-=He.data.length;He=He.next;){var re=He.data,P=Ee>re.length?re.length:Ee;if(re.copy(We,We.length-Ee,0,P),(Ee-=P)===0){P===re.length?(++it,He.next?me.head=He.next:me.head=me.tail=null):(me.head=He,He.data=re.slice(P));break}++it}return me.length-=it,We}function F(Ee){var me=Ee._readableState;if(me.length>0)throw new Error('"endReadable()" called on non-empty stream');me.endEmitted||(me.ended=!0,G.nextTick(z,me,Ee))}function z(Ee,me){Ee.endEmitted||Ee.length!==0||(Ee.endEmitted=!0,me.readable=!1,me.emit("end"))}function q(Ee,me){for(var We=0,He=Ee.length;We<He;We++)if(Ee[We]===me)return We;return-1}var B=C("babel-runtime/core-js/object/get-prototype-of"),M=function(Ee){return Ee&&Ee.__esModule?Ee:{default:Ee}}(B),G=C("process-nextick-args");D.exports=n;var J,K=C("isarray");n.ReadableState=s;var Z=(C("events").EventEmitter,function(Ee,me){return Ee.listeners(me).length}),le=C("./internal/streams/stream"),de=C("safe-buffer").Buffer,Te=O.Uint8Array||function(){},we=C("core-util-is");we.inherits=C("inherits");var Ie=C("util"),_e=void 0;_e=Ie&&Ie.debuglog?Ie.debuglog("stream"):function(){};var ye,Ke=C("./internal/streams/BufferList"),Me=C("./internal/streams/destroy");we.inherits(n,le);var Fe=["error","close","destroy","pause","resume"];Object.defineProperty(n.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Ee){this._readableState&&(this._readableState.destroyed=Ee)}}),n.prototype.destroy=Me.destroy,n.prototype._undestroy=Me.undestroy,n.prototype._destroy=function(Ee,me){this.push(null),me(Ee)},n.prototype.push=function(Ee,me){var We,He=this._readableState;return He.objectMode?We=!0:typeof Ee=="string"&&(me=me||He.defaultEncoding,me!==He.encoding&&(Ee=de.from(Ee,me),me=""),We=!0),o(this,Ee,me,!1,We)},n.prototype.unshift=function(Ee){return o(this,Ee,null,!0,!1)},n.prototype.isPaused=function(){return this._readableState.flowing===!1},n.prototype.setEncoding=function(Ee){return ye||(ye=C("string_decoder/").StringDecoder),this._readableState.decoder=new ye(Ee),this._readableState.encoding=Ee,this};var Ge=8388608;n.prototype.read=function(Ee){_e("read",Ee),Ee=parseInt(Ee,10);var me=this._readableState,We=Ee;if(Ee!==0&&(me.emittedReadable=!1),Ee===0&&me.needReadable&&(me.length>=me.highWaterMark||me.ended))return _e("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?F(this):v(this),null;if((Ee=t(Ee,me))===0&&me.ended)return me.length===0&&F(this),null;var He=me.needReadable;_e("need readable",He),(me.length===0||me.length-Ee<me.highWaterMark)&&(He=!0,_e("length less than watermark",He)),me.ended||me.reading?(He=!1,_e("reading or ended",He)):He&&(_e("do read"),me.reading=!0,me.sync=!0,me.length===0&&(me.needReadable=!0),this._read(me.highWaterMark),me.sync=!1,me.reading||(Ee=t(We,me)));var it;return it=Ee>0?S(Ee,me):null,it===null?(me.needReadable=!0,Ee=0):me.length-=Ee,me.length===0&&(me.ended||(me.needReadable=!0),We!==Ee&&me.ended&&F(this)),it!==null&&this.emit("data",it),it},n.prototype._read=function(Ee){this.emit("error",new Error("_read() is not implemented"))},n.prototype.pipe=function(Ee,me){function We(lt,qe){_e("onunpipe"),lt===Q&&qe&&qe.hasUnpiped===!1&&(qe.hasUnpiped=!0,it())}function He(){_e("onend"),Ee.end()}function it(){_e("cleanup"),Ee.removeListener("close",j),Ee.removeListener("finish",ee),Ee.removeListener("drain",Ne),Ee.removeListener("error",P),Ee.removeListener("unpipe",We),Q.removeListener("end",He),Q.removeListener("end",$),Q.removeListener("data",re),Be=!0,!xe.awaitDrain||Ee._writableState&&!Ee._writableState.needDrain||Ne()}function re(lt){_e("ondata"),tt=!1,Ee.write(lt)!==!1||tt||((xe.pipesCount===1&&xe.pipes===Ee||xe.pipesCount>1&&q(xe.pipes,Ee)!==-1)&&!Be&&(_e("false write response, pause",Q._readableState.awaitDrain),Q._readableState.awaitDrain++,tt=!0),Q.pause())}function P(lt){_e("onerror",lt),$(),Ee.removeListener("error",P),Z(Ee,"error")===0&&Ee.emit("error",lt)}function j(){Ee.removeListener("finish",ee),$()}function ee(){_e("onfinish"),Ee.removeListener("close",j),$()}function $(){_e("unpipe"),Q.unpipe(Ee)}var Q=this,xe=this._readableState;switch(xe.pipesCount){case 0:xe.pipes=Ee;break;case 1:xe.pipes=[xe.pipes,Ee];break;default:xe.pipes.push(Ee)}xe.pipesCount+=1,_e("pipe count=%d opts=%j",xe.pipesCount,me);var De=(!me||me.end!==!1)&&Ee!==A.stdout&&Ee!==A.stderr,dt=De?He:$;xe.endEmitted?G.nextTick(dt):Q.once("end",dt),Ee.on("unpipe",We);var Ne=m(Q);Ee.on("drain",Ne);var Be=!1,tt=!1;return Q.on("data",re),c(Ee,"error",P),Ee.once("close",j),Ee.once("finish",ee),Ee.emit("pipe",Q),xe.flowing||(_e("pipe resume"),Q.resume()),Ee},n.prototype.unpipe=function(Ee){var me=this._readableState,We={hasUnpiped:!1};if(me.pipesCount===0)return this;if(me.pipesCount===1)return Ee&&Ee!==me.pipes?this:(Ee||(Ee=me.pipes),me.pipes=null,me.pipesCount=0,me.flowing=!1,Ee&&Ee.emit("unpipe",this,We),this);if(!Ee){var He=me.pipes,it=me.pipesCount;me.pipes=null,me.pipesCount=0,me.flowing=!1;for(var re=0;re<it;re++)He[re].emit("unpipe",this,We);return this}var P=q(me.pipes,Ee);return P===-1?this:(me.pipes.splice(P,1),me.pipesCount-=1,me.pipesCount===1&&(me.pipes=me.pipes[0]),Ee.emit("unpipe",this,We),this)},n.prototype.on=function(Ee,me){var We=le.prototype.on.call(this,Ee,me);if(Ee==="data")this._readableState.flowing!==!1&&this.resume();else if(Ee==="readable"){var He=this._readableState;He.endEmitted||He.readableListening||(He.readableListening=He.needReadable=!0,He.emittedReadable=!1,He.reading?He.length&&v(this):G.nextTick(_,this))}return We},n.prototype.addListener=n.prototype.on,n.prototype.resume=function(){var Ee=this._readableState;return Ee.flowing||(_e("resume"),Ee.flowing=!0,x(this,Ee)),this},n.prototype.pause=function(){return _e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_e("pause"),this._readableState.flowing=!1,this.emit("pause")),this},n.prototype.wrap=function(Ee){var me=this,We=this._readableState,He=!1;Ee.on("end",function(){if(_e("wrapped end"),We.decoder&&!We.ended){var P=We.decoder.end();P&&P.length&&me.push(P)}me.push(null)}),Ee.on("data",function(P){(_e("wrapped data"),We.decoder&&(P=We.decoder.write(P)),(!We.objectMode||P!=null)&&(We.objectMode||P&&P.length))&&(me.push(P)||(He=!0,Ee.pause()))});for(var it in Ee)this[it]===void 0&&typeof Ee[it]=="function"&&(this[it]=function(P){return function(){return Ee[P].apply(Ee,arguments)}}(it));for(var re=0;re<Fe.length;re++)Ee.on(Fe[re],this.emit.bind(this,Fe[re]));return this._read=function(P){_e("wrapped _read",P),He&&(He=!1,Ee.resume())},this},Object.defineProperty(n.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),n._fromList=S}).call(this,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./_stream_duplex":179,"./internal/streams/BufferList":184,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/get-prototype-of":22,"core-util-is":153,events:158,inherits:162,isarray:166,"process-nextick-args":172,"safe-buffer":193,"string_decoder/":200,util:36}],182:[function(C,D,T){"use strict";function A(n,o){var r=this._transformState;r.transforming=!1;var l=r.writecb;if(!l)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,o!=null&&this.push(o),l(n);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function O(n){if(!(this instanceof O))return new O(n);c.call(this,n),this._transformState={afterTransform:A.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",f)}function f(){var n=this;typeof this._flush=="function"?this._flush(function(o,r){p(n,o,r)}):p(this,null,null)}function p(n,o,r){if(o)return n.emit("error",o);if(r!=null&&n.push(r),n._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(n._transformState.transforming)throw new Error("Calling transform done when still transforming");return n.push(null)}D.exports=O;var c=C("./_stream_duplex"),s=C("core-util-is");s.inherits=C("inherits"),s.inherits(O,c),O.prototype.push=function(n,o){return this._transformState.needTransform=!1,c.prototype.push.call(this,n,o)},O.prototype._transform=function(n,o,r){throw new Error("_transform() is not implemented")},O.prototype._write=function(n,o,r){var l=this._transformState;if(l.writecb=r,l.writechunk=n,l.writeencoding=o,!l.transforming){var a=this._readableState;(l.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},O.prototype._read=function(n){var o=this._transformState;o.writechunk!==null&&o.writecb&&!o.transforming?(o.transforming=!0,this._transform(o.writechunk,o.writeencoding,o.afterTransform)):o.needTransform=!0},O.prototype._destroy=function(n,o){var r=this;c.prototype._destroy.call(this,n,function(l){o(l),r.emit("close")})}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(C,D,T){(function(A,O){"use strict";function f(Me){return Me&&Me.__esModule?Me:{default:Me}}function p(Me){var Fe=this;this.next=null,this.entry=null,this.finish=function(){R(Fe,Me)}}function c(Me){return Ie.from(Me)}function s(Me){return Ie.isBuffer(Me)||Me instanceof _e}function n(){}function o(Me,Fe){Z=Z||C("./_stream_duplex"),Me=Me||{};var Ge=Fe instanceof Z;this.objectMode=!!Me.objectMode,Ge&&(this.objectMode=this.objectMode||!!Me.writableObjectMode);var Ee=Me.highWaterMark,me=Me.writableHighWaterMark,We=this.objectMode?16:16384;this.highWaterMark=Ee||Ee===0?Ee:Ge&&(me||me===0)?me:We,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var He=Me.decodeStrings===!1;this.decodeStrings=!He,this.defaultEncoding=Me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(it){b(Fe,it)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new p(this)}function r(Me){if(Z=Z||C("./_stream_duplex"),!(Ke.call(r,this)||this instanceof Z))return new r(Me);this._writableState=new o(Me,this),this.writable=!0,Me&&(typeof Me.write=="function"&&(this._write=Me.write),typeof Me.writev=="function"&&(this._writev=Me.writev),typeof Me.destroy=="function"&&(this._destroy=Me.destroy),typeof Me.final=="function"&&(this._final=Me.final)),we.call(this)}function l(Me,Fe){var Ge=new Error("write after end");Me.emit("error",Ge),K.nextTick(Fe,Ge)}function a(Me,Fe,Ge,Ee){var me=!0,We=!1;return Ge===null?We=new TypeError("May not write null values to stream"):typeof Ge=="string"||Ge===void 0||Fe.objectMode||(We=new TypeError("Invalid non-string/buffer chunk")),We&&(Me.emit("error",We),K.nextTick(Ee,We),me=!1),me}function i(Me,Fe,Ge){return Me.objectMode||Me.decodeStrings===!1||typeof Fe!="string"||(Fe=Ie.from(Fe,Ge)),Fe}function t(Me,Fe,Ge,Ee,me,We){if(!Ge){var He=i(Fe,Ee,me);Ee!==He&&(Ge=!0,me="buffer",Ee=He)}var it=Fe.objectMode?1:Ee.length;Fe.length+=it;var re=Fe.length<Fe.highWaterMark;if(re||(Fe.needDrain=!0),Fe.writing||Fe.corked){var P=Fe.lastBufferedRequest;Fe.lastBufferedRequest={chunk:Ee,encoding:me,isBuf:Ge,callback:We,next:null},P?P.next=Fe.lastBufferedRequest:Fe.bufferedRequest=Fe.lastBufferedRequest,Fe.bufferedRequestCount+=1}else d(Me,Fe,!1,it,Ee,me,We);return re}function d(Me,Fe,Ge,Ee,me,We,He){Fe.writelen=Ee,Fe.writecb=He,Fe.writing=!0,Fe.sync=!0,Ge?Me._writev(me,Fe.onwrite):Me._write(me,We,Fe.onwrite),Fe.sync=!1}function v(Me,Fe,Ge,Ee,me){--Fe.pendingcb,Ge?(K.nextTick(me,Ee),K.nextTick(S,Me,Fe),Me._writableState.errorEmitted=!0,Me.emit("error",Ee)):(me(Ee),Me._writableState.errorEmitted=!0,Me.emit("error",Ee),S(Me,Fe))}function y(Me){Me.writing=!1,Me.writecb=null,Me.length-=Me.writelen,Me.writelen=0}function b(Me,Fe){var Ge=Me._writableState,Ee=Ge.sync,me=Ge.writecb;if(y(Ge),Fe)v(Me,Ge,Ee,Fe,me);else{var We=x(Ge);We||Ge.corked||Ge.bufferProcessing||!Ge.bufferedRequest||_(Me,Ge),Ee?le(g,Me,Ge,We,me):g(Me,Ge,We,me)}}function g(Me,Fe,Ge,Ee){Ge||m(Me,Fe),Fe.pendingcb--,Ee(),S(Me,Fe)}function m(Me,Fe){Fe.length===0&&Fe.needDrain&&(Fe.needDrain=!1,Me.emit("drain"))}function _(Me,Fe){Fe.bufferProcessing=!0;var Ge=Fe.bufferedRequest;if(Me._writev&&Ge&&Ge.next){var Ee=Fe.bufferedRequestCount,me=new Array(Ee),We=Fe.corkedRequestsFree;We.entry=Ge;for(var He=0,it=!0;Ge;)me[He]=Ge,Ge.isBuf||(it=!1),Ge=Ge.next,He+=1;me.allBuffers=it,d(Me,Fe,!0,Fe.length,me,"",We.finish),Fe.pendingcb++,Fe.lastBufferedRequest=null,We.next?(Fe.corkedRequestsFree=We.next,We.next=null):Fe.corkedRequestsFree=new p(Fe),Fe.bufferedRequestCount=0}else{for(;Ge;){var re=Ge.chunk,P=Ge.encoding,j=Ge.callback;if(d(Me,Fe,!1,Fe.objectMode?1:re.length,re,P,j),Ge=Ge.next,Fe.bufferedRequestCount--,Fe.writing)break}Ge===null&&(Fe.lastBufferedRequest=null)}Fe.bufferedRequest=Ge,Fe.bufferProcessing=!1}function x(Me){return Me.ending&&Me.length===0&&Me.bufferedRequest===null&&!Me.finished&&!Me.writing}function h(Me,Fe){Me._final(function(Ge){Fe.pendingcb--,Ge&&Me.emit("error",Ge),Fe.prefinished=!0,Me.emit("prefinish"),S(Me,Fe)})}function E(Me,Fe){Fe.prefinished||Fe.finalCalled||(typeof Me._final=="function"?(Fe.pendingcb++,Fe.finalCalled=!0,K.nextTick(h,Me,Fe)):(Fe.prefinished=!0,Me.emit("prefinish")))}function S(Me,Fe){var Ge=x(Fe);return Ge&&(E(Me,Fe),Fe.pendingcb===0&&(Fe.finished=!0,Me.emit("finish"))),Ge}function w(Me,Fe,Ge){Fe.ending=!0,S(Me,Fe),Ge&&(Fe.finished?K.nextTick(Ge):Me.once("finish",Ge)),Fe.ended=!0,Me.writable=!1}function R(Me,Fe,Ge){var Ee=Me.entry;for(Me.entry=null;Ee;){var me=Ee.callback;Fe.pendingcb--,me(Ge),Ee=Ee.next}Fe.corkedRequestsFree?Fe.corkedRequestsFree.next=Me:Fe.corkedRequestsFree=Me}var N=C("babel-runtime/core-js/object/define-property"),F=f(N),z=C("babel-runtime/core-js/symbol/has-instance"),q=f(z),B=C("babel-runtime/core-js/symbol"),M=f(B),G=C("babel-runtime/core-js/set-immediate"),J=f(G),K=C("process-nextick-args");D.exports=r;var Z,le=!A.browser&&["v0.10","v0.9."].indexOf(A.version.slice(0,5))>-1?J.default:K.nextTick;r.WritableState=o;var de=C("core-util-is");de.inherits=C("inherits");var Te={deprecate:C("util-deprecate")},we=C("./internal/streams/stream"),Ie=C("safe-buffer").Buffer,_e=O.Uint8Array||function(){},ye=C("./internal/streams/destroy");de.inherits(r,we),o.prototype.getBuffer=function(){for(var Me=this.bufferedRequest,Fe=[];Me;)Fe.push(Me),Me=Me.next;return Fe},function(){try{Object.defineProperty(o.prototype,"buffer",{get:Te.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Me){}}();var Ke;typeof M.default=="function"&&q.default&&typeof Function.prototype[q.default]=="function"?(Ke=Function.prototype[q.default],(0,F.default)(r,q.default,{value:function(Me){return!!Ke.call(this,Me)||this===r&&Me&&Me._writableState instanceof o}})):Ke=function(Me){return Me instanceof this},r.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},r.prototype.write=function(Me,Fe,Ge){var Ee=this._writableState,me=!1,We=!Ee.objectMode&&s(Me);return We&&!Ie.isBuffer(Me)&&(Me=c(Me)),typeof Fe=="function"&&(Ge=Fe,Fe=null),We?Fe="buffer":Fe||(Fe=Ee.defaultEncoding),typeof Ge!="function"&&(Ge=n),Ee.ended?l(this,Ge):(We||a(this,Ee,Me,Ge))&&(Ee.pendingcb++,me=t(this,Ee,We,Me,Fe,Ge)),me},r.prototype.cork=function(){this._writableState.corked++},r.prototype.uncork=function(){var Me=this._writableState;Me.corked&&(Me.corked--,Me.writing||Me.corked||Me.finished||Me.bufferProcessing||!Me.bufferedRequest||_(this,Me))},r.prototype.setDefaultEncoding=function(Me){if(typeof Me=="string"&&(Me=Me.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Me+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+Me);return this._writableState.defaultEncoding=Me,this},Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),r.prototype._write=function(Me,Fe,Ge){Ge(new Error("_write() is not implemented"))},r.prototype._writev=null,r.prototype.end=function(Me,Fe,Ge){var Ee=this._writableState;typeof Me=="function"?(Ge=Me,Me=null,Fe=null):typeof Fe=="function"&&(Ge=Fe,Fe=null),Me!=null&&this.write(Me,Fe),Ee.corked&&(Ee.corked=1,this.uncork()),Ee.ending||Ee.finished||w(this,Ee,Ge)},Object.defineProperty(r.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(Me){this._writableState&&(this._writableState.destroyed=Me)}}),r.prototype.destroy=ye.destroy,r.prototype._undestroy=ye.undestroy,r.prototype._destroy=function(Me,Fe){this.end(),Fe(Me)}}).call(this,C("_process"),typeof ce!="undefined"?ce: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(C,D,T){"use strict";function A(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function O(c,s,n){c.copy(s,n)}var f=C("safe-buffer").Buffer,p=C("util");D.exports=function(){function c(){A(this,c),this.head=null,this.tail=null,this.length=0}return c.prototype.push=function(s){var n={data:s,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},c.prototype.unshift=function(s){var n={data:s,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},c.prototype.shift=function(){if(this.length!==0){var s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}},c.prototype.clear=function(){this.head=this.tail=null,this.length=0},c.prototype.join=function(s){if(this.length===0)return"";for(var n=this.head,o=""+n.data;n=n.next;)o+=s+n.data;return o},c.prototype.concat=function(s){if(this.length===0)return f.alloc(0);if(this.length===1)return this.head.data;for(var n=f.allocUnsafe(s>>>0),o=this.head,r=0;o;)O(o.data,n,r),r+=o.data.length,o=o.next;return n},c}(),p&&p.inspect&&p.inspect.custom&&(D.exports.prototype[p.inspect.custom]=function(){var c=p.inspect({length:this.length});return this.constructor.name+" "+c})},{"safe-buffer":193,util:36}],185:[function(C,D,T){"use strict";function A(c,s){var n=this,o=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return o||r?(s?s(c):!c||this._writableState&&this._writableState.errorEmitted||p.nextTick(f,this,c),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(l){!s&&l?(p.nextTick(f,n,l),n._writableState&&(n._writableState.errorEmitted=!0)):s&&s(l)}),this)}function O(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function f(c,s){c.emit("error",s)}var p=C("process-nextick-args");D.exports={destroy:A,undestroy:O}},{"process-nextick-args":172}],186:[function(C,D,T){"use strict";D.exports=C("events").EventEmitter},{events:158}],187:[function(C,D,T){D.exports=C("./readable").PassThrough},{"./readable":188}],188:[function(C,D,T){T=D.exports=C("./lib/_stream_readable.js"),T.Stream=T,T.Readable=T,T.Writable=C("./lib/_stream_writable.js"),T.Duplex=C("./lib/_stream_duplex.js"),T.Transform=C("./lib/_stream_transform.js"),T.PassThrough=C("./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(C,D,T){D.exports=C("./readable").Transform},{"./readable":188}],190:[function(C,D,T){D.exports=C("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(C,D,T){var A=function(){return this}()||Function("return this")(),O=A.regeneratorRuntime&&Object.getOwnPropertyNames(A).indexOf("regeneratorRuntime")>=0,f=O&&A.regeneratorRuntime;if(A.regeneratorRuntime=void 0,D.exports=C("./runtime"),O)A.regeneratorRuntime=f;else try{delete A.regeneratorRuntime}catch(p){A.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(C,D,T){!function(A){"use strict";function O(J,K,Z,le){var de=K&&K.prototype instanceof p?K:p,Te=Object.create(de.prototype),we=new t(le||[]);return Te._invoke=r(J,Z,we),Te}function f(J,K,Z){try{return{type:"normal",arg:J.call(K,Z)}}catch(le){return{type:"throw",arg:le}}}function p(){}function c(){}function s(){}function n(J){["next","throw","return"].forEach(function(K){J[K]=function(Z){return this._invoke(K,Z)}})}function o(J){function K(de,Te,we,Ie){var _e=f(J[de],J,Te);if(_e.type!=="throw"){var ye=_e.arg,Ke=ye.value;return Ke&&typeof Ke=="object"&&g.call(Ke,"__await")?Promise.resolve(Ke.__await).then(function(Me){K("next",Me,we,Ie)},function(Me){K("throw",Me,we,Ie)}):Promise.resolve(Ke).then(function(Me){ye.value=Me,we(ye)},Ie)}Ie(_e.arg)}function Z(de,Te){function we(){return new Promise(function(Ie,_e){K(de,Te,Ie,_e)})}return le=le?le.then(we,we):we()}var le;this._invoke=Z}function r(J,K,Z){var le=w;return function(de,Te){if(le===N)throw new Error("Generator is already running");if(le===F){if(de==="throw")throw Te;return v()}for(Z.method=de,Z.arg=Te;;){var we=Z.delegate;if(we){var Ie=l(we,Z);if(Ie){if(Ie===z)continue;return Ie}}if(Z.method==="next")Z.sent=Z._sent=Z.arg;else if(Z.method==="throw"){if(le===w)throw le=F,Z.arg;Z.dispatchException(Z.arg)}else Z.method==="return"&&Z.abrupt("return",Z.arg);le=N;var _e=f(J,K,Z);if(_e.type==="normal"){if(le=Z.done?F:R,_e.arg===z)continue;return{value:_e.arg,done:Z.done}}_e.type==="throw"&&(le=F,Z.method="throw",Z.arg=_e.arg)}}}function l(J,K){var Z=J.iterator[K.method];if(Z===y){if(K.delegate=null,K.method==="throw"){if(J.iterator.return&&(K.method="return",K.arg=y,l(J,K),K.method==="throw"))return z;K.method="throw",K.arg=new TypeError("The iterator does not provide a 'throw' method")}return z}var le=f(Z,J.iterator,K.arg);if(le.type==="throw")return K.method="throw",K.arg=le.arg,K.delegate=null,z;var de=le.arg;return de?de.done?(K[J.resultName]=de.value,K.next=J.nextLoc,K.method!=="return"&&(K.method="next",K.arg=y),K.delegate=null,z):de:(K.method="throw",K.arg=new TypeError("iterator result is not an object"),K.delegate=null,z)}function a(J){var K={tryLoc:J[0]};1 in J&&(K.catchLoc=J[1]),2 in J&&(K.finallyLoc=J[2],K.afterLoc=J[3]),this.tryEntries.push(K)}function i(J){var K=J.completion||{};K.type="normal",delete K.arg,J.completion=K}function t(J){this.tryEntries=[{tryLoc:"root"}],J.forEach(a,this),this.reset(!0)}function d(J){if(J){var K=J[_];if(K)return K.call(J);if(typeof J.next=="function")return J;if(!isNaN(J.length)){var Z=-1,le=function de(){for(;++Z<J.length;)if(g.call(J,Z))return de.value=J[Z],de.done=!1,de;return de.value=y,de.done=!0,de};return le.next=le}}return{next:v}}function v(){return{value:y,done:!0}}var y,b=Object.prototype,g=b.hasOwnProperty,m=typeof Symbol=="function"?Symbol:{},_=m.iterator||"@@iterator",x=m.asyncIterator||"@@asyncIterator",h=m.toStringTag||"@@toStringTag",E=typeof D=="object",S=A.regeneratorRuntime;if(S)return void(E&&(D.exports=S));S=A.regeneratorRuntime=E?D.exports:{},S.wrap=O;var w="suspendedStart",R="suspendedYield",N="executing",F="completed",z={},q={};q[_]=function(){return this};var B=Object.getPrototypeOf,M=B&&B(B(d([])));M&&M!==b&&g.call(M,_)&&(q=M);var G=s.prototype=p.prototype=Object.create(q);c.prototype=G.constructor=s,s.constructor=c,s[h]=c.displayName="GeneratorFunction",S.isGeneratorFunction=function(J){var K=typeof J=="function"&&J.constructor;return!!K&&(K===c||(K.displayName||K.name)==="GeneratorFunction")},S.mark=function(J){return Object.setPrototypeOf?Object.setPrototypeOf(J,s):(J.__proto__=s,h in J||(J[h]="GeneratorFunction")),J.prototype=Object.create(G),J},S.awrap=function(J){return{__await:J}},n(o.prototype),o.prototype[x]=function(){return this},S.AsyncIterator=o,S.async=function(J,K,Z,le){var de=new o(O(J,K,Z,le));return S.isGeneratorFunction(K)?de:de.next().then(function(Te){return Te.done?Te.value:de.next()})},n(G),G[h]="Generator",G[_]=function(){return this},G.toString=function(){return"[object Generator]"},S.keys=function(J){var K=[];for(var Z in J)K.push(Z);return K.reverse(),function le(){for(;K.length;){var de=K.pop();if(de in J)return le.value=de,le.done=!1,le}return le.done=!0,le}},S.values=d,t.prototype={constructor:t,reset:function(J){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.method="next",this.arg=y,this.tryEntries.forEach(i),!J)for(var K in this)K.charAt(0)==="t"&&g.call(this,K)&&!isNaN(+K.slice(1))&&(this[K]=y)},stop:function(){this.done=!0;var J=this.tryEntries[0],K=J.completion;if(K.type==="throw")throw K.arg;return this.rval},dispatchException:function(J){function K(_e,ye){return Te.type="throw",Te.arg=J,Z.next=_e,ye&&(Z.method="next",Z.arg=y),!!ye}if(this.done)throw J;for(var Z=this,le=this.tryEntries.length-1;le>=0;--le){var de=this.tryEntries[le],Te=de.completion;if(de.tryLoc==="root")return K("end");if(de.tryLoc<=this.prev){var we=g.call(de,"catchLoc"),Ie=g.call(de,"finallyLoc");if(we&&Ie){if(this.prev<de.catchLoc)return K(de.catchLoc,!0);if(this.prev<de.finallyLoc)return K(de.finallyLoc)}else if(we){if(this.prev<de.catchLoc)return K(de.catchLoc,!0)}else{if(!Ie)throw new Error("try statement without catch or finally");if(this.prev<de.finallyLoc)return K(de.finallyLoc)}}}},abrupt:function(J,K){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var le=this.tryEntries[Z];if(le.tryLoc<=this.prev&&g.call(le,"finallyLoc")&&this.prev<le.finallyLoc){var de=le;break}}de&&(J==="break"||J==="continue")&&de.tryLoc<=K&&K<=de.finallyLoc&&(de=null);var Te=de?de.completion:{};return Te.type=J,Te.arg=K,de?(this.method="next",this.next=de.finallyLoc,z):this.complete(Te)},complete:function(J,K){if(J.type==="throw")throw J.arg;return J.type==="break"||J.type==="continue"?this.next=J.arg:J.type==="return"?(this.rval=this.arg=J.arg,this.method="return",this.next="end"):J.type==="normal"&&K&&(this.next=K),z},finish:function(J){for(var K=this.tryEntries.length-1;K>=0;--K){var Z=this.tryEntries[K];if(Z.finallyLoc===J)return this.complete(Z.completion,Z.afterLoc),i(Z),z}},catch:function(J){for(var K=this.tryEntries.length-1;K>=0;--K){var Z=this.tryEntries[K];if(Z.tryLoc===J){var le=Z.completion;if(le.type==="throw"){var de=le.arg;i(Z)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(J,K,Z){return this.delegate={iterator:d(J),resultName:K,nextLoc:Z},this.method==="next"&&(this.arg=y),z}}}(function(){return this}()||Function("return this")())},{}],193:[function(C,D,T){function A(c,s){for(var n in c)s[n]=c[n]}function O(c,s,n){return p(c,s,n)}var f=C("buffer"),p=f.Buffer;p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?D.exports=f:(A(f,T),T.Buffer=O),A(p,O),O.from=function(c,s,n){if(typeof c=="number")throw new TypeError("Argument must not be a number");return p(c,s,n)},O.alloc=function(c,s,n){if(typeof c!="number")throw new TypeError("Argument must be a number");var o=p(c);return s!==void 0?typeof n=="string"?o.fill(s,n):o.fill(s):o.fill(0),o},O.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return p(c)},O.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(c)}},{buffer:38}],194:[function(C,D,T){(function(A){"use strict";function O(v){return v&&v.__esModule?v:{default:v}}var f=C("babel-runtime/core-js/string/from-code-point"),p=O(f),c=C("babel-runtime/core-js/json/stringify"),s=O(c),n=C("babel-runtime/helpers/typeof"),o=O(n),r=C("babel-runtime/core-js/object/define-property"),l=O(r),a=C("babel-runtime/core-js/object/keys"),i=O(a),t=C("babel-runtime/core-js/object/create"),d=O(t);!function(v){function y($,Q){if(!(this instanceof y))return new y($,Q);var xe=this;g(xe),xe.q=xe.c="",xe.bufferCheckPosition=v.MAX_BUFFER_LENGTH,xe.opt=Q||{},xe.opt.lowercase=xe.opt.lowercase||xe.opt.lowercasetags,xe.looseCase=xe.opt.lowercase?"toLowerCase":"toUpperCase",xe.tags=[],xe.closed=xe.closedRoot=xe.sawRoot=!1,xe.tag=xe.error=null,xe.strict=!!$,xe.noscript=!(!$&&!xe.opt.noscript),xe.state=j.BEGIN,xe.strictEntities=xe.opt.strictEntities,xe.ENTITIES=xe.strictEntities?(0,d.default)(v.XML_ENTITIES):(0,d.default)(v.ENTITIES),xe.attribList=[],xe.opt.xmlns&&(xe.ns=(0,d.default)(We)),xe.trackPosition=xe.opt.position!==!1,xe.trackPosition&&(xe.position=xe.line=xe.column=0),N(xe,"onready")}function b($){for(var Q=Math.max(v.MAX_BUFFER_LENGTH,10),xe=0,De=0,dt=ye.length;De<dt;De++){var Ne=$[ye[De]].length;if(Ne>Q)switch(ye[De]){case"textNode":z($);break;case"cdata":F($,"oncdata",$.cdata),$.cdata="";break;case"script":F($,"onscript",$.script),$.script="";break;default:B($,"Max buffer length exceeded: "+ye[De])}xe=Math.max(xe,Ne)}var Be=v.MAX_BUFFER_LENGTH-xe;$.bufferCheckPosition=Be+$.position}function g($){for(var Q=0,xe=ye.length;Q<xe;Q++)$[ye[Q]]=""}function m($){z($),$.cdata!==""&&(F($,"oncdata",$.cdata),$.cdata=""),$.script!==""&&(F($,"onscript",$.script),$.script="")}function _($,Q){return new x($,Q)}function x($,Q){if(!(this instanceof x))return new x($,Q);Ke.apply(this),this._parser=new y($,Q),this.writable=!0,this.readable=!0;var xe=this;this._parser.onend=function(){xe.emit("end")},this._parser.onerror=function(De){xe.emit("error",De),xe._parser.error=null},this._decoder=null,Me.forEach(function(De){(0,l.default)(xe,"on"+De,{get:function(){return xe._parser["on"+De]},set:function(dt){if(!dt)return xe.removeAllListeners(De),xe._parser["on"+De]=dt,dt;xe.on(De,dt)},enumerable:!0,configurable:!1})})}function h($){return $===" "||$===`
|
|
|
`||$==="\r"||$===" "}function E($){return $==='"'||$==="'"}function S($){return $===">"||h($)}function w($,Q){return $.test(Q)}function R($,Q){return!w($,Q)}function N($,Q,xe){$[Q]&&$[Q](xe)}function F($,Q,xe){$.textNode&&z($),N($,Q,xe)}function z($){$.textNode=q($.opt,$.textNode),$.textNode&&N($,"ontext",$.textNode),$.textNode=""}function q($,Q){return $.trim&&(Q=Q.trim()),$.normalize&&(Q=Q.replace(/\s+/g," ")),Q}function B($,Q){return z($),$.trackPosition&&(Q+=`
|
|
|
Line: `+$.line+`
|
|
|
Column: `+$.column+`
|
|
|
Char: `+$.c),Q=new Error(Q),$.error=Q,N($,"onerror",Q),$}function M($){return $.sawRoot&&!$.closedRoot&&G($,"Unclosed root tag"),$.state!==j.BEGIN&&$.state!==j.BEGIN_WHITESPACE&&$.state!==j.TEXT&&B($,"Unexpected end"),z($),$.c="",$.closed=!0,N($,"onend"),y.call($,$.strict,$.opt),$}function G($,Q){if(($===void 0?"undefined":(0,o.default)($))!=="object"||!($ instanceof y))throw new Error("bad call to strictFail");$.strict&&B($,Q)}function J($){$.strict||($.tagName=$.tagName[$.looseCase]());var Q=$.tags[$.tags.length-1]||$,xe=$.tag={name:$.tagName,attributes:{}};$.opt.xmlns&&(xe.ns=Q.ns),$.attribList.length=0,F($,"onopentagstart",xe)}function K($,Q){var xe=$.indexOf(":"),De=xe<0?["",$]:$.split(":"),dt=De[0],Ne=De[1];return Q&&$==="xmlns"&&(dt="xmlns",Ne=""),{prefix:dt,local:Ne}}function Z($){if($.strict||($.attribName=$.attribName[$.looseCase]()),$.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName))return void($.attribName=$.attribValue="");if($.opt.xmlns){var Q=K($.attribName,!0),xe=Q.prefix,De=Q.local;if(xe==="xmlns")if(De==="xml"&&$.attribValue!==Ee)G($,"xml: prefix must be bound to "+Ee+`
|
|
|
Actual: `+$.attribValue);else if(De==="xmlns"&&$.attribValue!==me)G($,"xmlns: prefix must be bound to "+me+`
|
|
|
Actual: `+$.attribValue);else{var dt=$.tag,Ne=$.tags[$.tags.length-1]||$;dt.ns===Ne.ns&&(dt.ns=(0,d.default)(Ne.ns)),dt.ns[De]=$.attribValue}$.attribList.push([$.attribName,$.attribValue])}else $.tag.attributes[$.attribName]=$.attribValue,F($,"onattribute",{name:$.attribName,value:$.attribValue});$.attribName=$.attribValue=""}function le($,Q){if($.opt.xmlns){var xe=$.tag,De=K($.tagName);xe.prefix=De.prefix,xe.local=De.local,xe.uri=xe.ns[De.prefix]||"",xe.prefix&&!xe.uri&&(G($,"Unbound namespace prefix: "+(0,s.default)($.tagName)),xe.uri=De.prefix);var dt=$.tags[$.tags.length-1]||$;xe.ns&&dt.ns!==xe.ns&&(0,i.default)(xe.ns).forEach(function(Ce){F($,"onopennamespace",{prefix:Ce,uri:xe.ns[Ce]})});for(var Ne=0,Be=$.attribList.length;Ne<Be;Ne++){var tt=$.attribList[Ne],lt=tt[0],qe=tt[1],Ye=K(lt,!0),je=Ye.prefix,Ue=Ye.local,ke=je===""?"":xe.ns[je]||"",be={name:lt,value:qe,prefix:je,local:Ue,uri:ke};je&&je!=="xmlns"&&!ke&&(G($,"Unbound namespace prefix: "+(0,s.default)(je)),be.uri=je),$.tag.attributes[lt]=be,F($,"onattribute",be)}$.attribList.length=0}$.tag.isSelfClosing=!!Q,$.sawRoot=!0,$.tags.push($.tag),F($,"onopentag",$.tag),Q||($.noscript||$.tagName.toLowerCase()!=="script"?$.state=j.TEXT:$.state=j.SCRIPT,$.tag=null,$.tagName=""),$.attribName=$.attribValue="",$.attribList.length=0}function de($){if(!$.tagName)return G($,"Weird empty close tag."),$.textNode+="</>",void($.state=j.TEXT);if($.script){if($.tagName!=="script")return $.script+="</"+$.tagName+">",$.tagName="",void($.state=j.SCRIPT);F($,"onscript",$.script),$.script=""}var Q=$.tags.length,xe=$.tagName;$.strict||(xe=xe[$.looseCase]());for(var De=xe;Q--&&!($.tags[Q].name===De);)G($,"Unexpected close tag");if(Q<0)return G($,"Unmatched closing tag: "+$.tagName),$.textNode+="</"+$.tagName+">",void($.state=j.TEXT);$.tagName=xe;for(var dt=$.tags.length;dt-- >Q;){var Ne=$.tag=$.tags.pop();$.tagName=$.tag.name,F($,"onclosetag",$.tagName);var Be={};for(var tt in Ne.ns)Be[tt]=Ne.ns[tt];var lt=$.tags[$.tags.length-1]||$;$.opt.xmlns&&Ne.ns!==lt.ns&&(0,i.default)(Ne.ns).forEach(function(qe){var Ye=Ne.ns[qe];F($,"onclosenamespace",{prefix:qe,uri:Ye})})}Q===0&&($.closedRoot=!0),$.tagName=$.attribValue=$.attribName="",$.attribList.length=0,$.state=j.TEXT}function Te($){var Q,xe=$.entity,De=xe.toLowerCase(),dt="";return $.ENTITIES[xe]?$.ENTITIES[xe]:$.ENTITIES[De]?$.ENTITIES[De]:(xe=De,xe.charAt(0)==="#"&&(xe.charAt(1)==="x"?(xe=xe.slice(2),Q=parseInt(xe,16),dt=Q.toString(16)):(xe=xe.slice(1),Q=parseInt(xe,10),dt=Q.toString(10))),xe=xe.replace(/^0+/,""),isNaN(Q)||dt.toLowerCase()!==xe?(G($,"Invalid character entity"),"&"+$.entity+";"):(0,p.default)(Q))}function we($,Q){Q==="<"?($.state=j.OPEN_WAKA,$.startTagPosition=$.position):h(Q)||(G($,"Non-whitespace before first tag."),$.textNode=Q,$.state=j.TEXT)}function Ie($,Q){var xe="";return Q<$.length&&(xe=$.charAt(Q)),xe}function _e($){var Q=this;if(this.error)throw this.error;if(Q.closed)return B(Q,"Cannot write after close. Assign an onready handler.");if($===null)return M(Q);($===void 0?"undefined":(0,o.default)($))==="object"&&($=$.toString());for(var xe=0,De="";!(De=Ie($,xe++),Q.c=De,!De);)switch(Q.trackPosition&&(Q.position++,De===`
|
|
|
`?(Q.line++,Q.column=0):Q.column++),Q.state){case j.BEGIN:if(Q.state=j.BEGIN_WHITESPACE,De==="\uFEFF")continue;we(Q,De);continue;case j.BEGIN_WHITESPACE:we(Q,De);continue;case j.TEXT:if(Q.sawRoot&&!Q.closedRoot){for(var dt=xe-1;De&&De!=="<"&&De!=="&";)(De=Ie($,xe++))&&Q.trackPosition&&(Q.position++,De===`
|
|
|
`?(Q.line++,Q.column=0):Q.column++);Q.textNode+=$.substring(dt,xe-1)}De!=="<"||Q.sawRoot&&Q.closedRoot&&!Q.strict?(h(De)||Q.sawRoot&&!Q.closedRoot||G(Q,"Text data outside of root node."),De==="&"?Q.state=j.TEXT_ENTITY:Q.textNode+=De):(Q.state=j.OPEN_WAKA,Q.startTagPosition=Q.position);continue;case j.SCRIPT:De==="<"?Q.state=j.SCRIPT_ENDING:Q.script+=De;continue;case j.SCRIPT_ENDING:De==="/"?Q.state=j.CLOSE_TAG:(Q.script+="<"+De,Q.state=j.SCRIPT);continue;case j.OPEN_WAKA:if(De==="!")Q.state=j.SGML_DECL,Q.sgmlDecl="";else if(!h(De))if(w(He,De))Q.state=j.OPEN_TAG,Q.tagName=De;else if(De==="/")Q.state=j.CLOSE_TAG,Q.tagName="";else if(De==="?")Q.state=j.PROC_INST,Q.procInstName=Q.procInstBody="";else{if(G(Q,"Unencoded <"),Q.startTagPosition+1<Q.position){var Ne=Q.position-Q.startTagPosition;De=new Array(Ne).join(" ")+De}Q.textNode+="<"+De,Q.state=j.TEXT}continue;case j.SGML_DECL:(Q.sgmlDecl+De).toUpperCase()===Fe?(F(Q,"onopencdata"),Q.state=j.CDATA,Q.sgmlDecl="",Q.cdata=""):Q.sgmlDecl+De==="--"?(Q.state=j.COMMENT,Q.comment="",Q.sgmlDecl=""):(Q.sgmlDecl+De).toUpperCase()===Ge?(Q.state=j.DOCTYPE,(Q.doctype||Q.sawRoot)&&G(Q,"Inappropriately located doctype declaration"),Q.doctype="",Q.sgmlDecl=""):De===">"?(F(Q,"onsgmldeclaration",Q.sgmlDecl),Q.sgmlDecl="",Q.state=j.TEXT):(E(De)&&(Q.state=j.SGML_DECL_QUOTED),Q.sgmlDecl+=De);continue;case j.SGML_DECL_QUOTED:De===Q.q&&(Q.state=j.SGML_DECL,Q.q=""),Q.sgmlDecl+=De;continue;case j.DOCTYPE:De===">"?(Q.state=j.TEXT,F(Q,"ondoctype",Q.doctype),Q.doctype=!0):(Q.doctype+=De,De==="["?Q.state=j.DOCTYPE_DTD:E(De)&&(Q.state=j.DOCTYPE_QUOTED,Q.q=De));continue;case j.DOCTYPE_QUOTED:Q.doctype+=De,De===Q.q&&(Q.q="",Q.state=j.DOCTYPE);continue;case j.DOCTYPE_DTD:Q.doctype+=De,De==="]"?Q.state=j.DOCTYPE:E(De)&&(Q.state=j.DOCTYPE_DTD_QUOTED,Q.q=De);continue;case j.DOCTYPE_DTD_QUOTED:Q.doctype+=De,De===Q.q&&(Q.state=j.DOCTYPE_DTD,Q.q="");continue;case j.COMMENT:De==="-"?Q.state=j.COMMENT_ENDING:Q.comment+=De;continue;case j.COMMENT_ENDING:De==="-"?(Q.state=j.COMMENT_ENDED,Q.comment=q(Q.opt,Q.comment),Q.comment&&F(Q,"oncomment",Q.comment),Q.comment=""):(Q.comment+="-"+De,Q.state=j.COMMENT);continue;case j.COMMENT_ENDED:De!==">"?(G(Q,"Malformed comment"),Q.comment+="--"+De,Q.state=j.COMMENT):Q.state=j.TEXT;continue;case j.CDATA:De==="]"?Q.state=j.CDATA_ENDING:Q.cdata+=De;continue;case j.CDATA_ENDING:De==="]"?Q.state=j.CDATA_ENDING_2:(Q.cdata+="]"+De,Q.state=j.CDATA);continue;case j.CDATA_ENDING_2:De===">"?(Q.cdata&&F(Q,"oncdata",Q.cdata),F(Q,"onclosecdata"),Q.cdata="",Q.state=j.TEXT):De==="]"?Q.cdata+="]":(Q.cdata+="]]"+De,Q.state=j.CDATA);continue;case j.PROC_INST:De==="?"?Q.state=j.PROC_INST_ENDING:h(De)?Q.state=j.PROC_INST_BODY:Q.procInstName+=De;continue;case j.PROC_INST_BODY:if(!Q.procInstBody&&h(De))continue;De==="?"?Q.state=j.PROC_INST_ENDING:Q.procInstBody+=De;continue;case j.PROC_INST_ENDING:De===">"?(F(Q,"onprocessinginstruction",{name:Q.procInstName,body:Q.procInstBody}),Q.procInstName=Q.procInstBody="",Q.state=j.TEXT):(Q.procInstBody+="?"+De,Q.state=j.PROC_INST_BODY);continue;case j.OPEN_TAG:w(it,De)?Q.tagName+=De:(J(Q),De===">"?le(Q):De==="/"?Q.state=j.OPEN_TAG_SLASH:(h(De)||G(Q,"Invalid character in tag name"),Q.state=j.ATTRIB));continue;case j.OPEN_TAG_SLASH:De===">"?(le(Q,!0),de(Q)):(G(Q,"Forward-slash in opening tag not followed by >"),Q.state=j.ATTRIB);continue;case j.ATTRIB:if(h(De))continue;De===">"?le(Q):De==="/"?Q.state=j.OPEN_TAG_SLASH:w(He,De)?(Q.attribName=De,Q.attribValue="",Q.state=j.ATTRIB_NAME):G(Q,"Invalid attribute name");continue;case j.ATTRIB_NAME:De==="="?Q.state=j.ATTRIB_VALUE:De===">"?(G(Q,"Attribute without value"),Q.attribValue=Q.attribName,Z(Q),le(Q)):h(De)?Q.state=j.ATTRIB_NAME_SAW_WHITE:w(it,De)?Q.attribName+=De:G(Q,"Invalid attribute name");continue;case j.ATTRIB_NAME_SAW_WHITE:if(De==="=")Q.state=j.ATTRIB_VALUE;else{if(h(De))continue;G(Q,"Attribute without value"),Q.tag.attributes[Q.attribName]="",Q.attribValue="",F(Q,"onattribute",{name:Q.attribName,value:""}),Q.attribName="",De===">"?le(Q):w(He,De)?(Q.attribName=De,Q.state=j.ATTRIB_NAME):(G(Q,"Invalid attribute name"),Q.state=j.ATTRIB)}continue;case j.ATTRIB_VALUE:if(h(De))continue;E(De)?(Q.q=De,Q.state=j.ATTRIB_VALUE_QUOTED):(G(Q,"Unquoted attribute value"),Q.state=j.ATTRIB_VALUE_UNQUOTED,Q.attribValue=De);continue;case j.ATTRIB_VALUE_QUOTED:if(De!==Q.q){De==="&"?Q.state=j.ATTRIB_VALUE_ENTITY_Q:Q.attribValue+=De;continue}Z(Q),Q.q="",Q.state=j.ATTRIB_VALUE_CLOSED;continue;case j.ATTRIB_VALUE_CLOSED:h(De)?Q.state=j.ATTRIB:De===">"?le(Q):De==="/"?Q.state=j.OPEN_TAG_SLASH:w(He,De)?(G(Q,"No whitespace between attributes"),Q.attribName=De,Q.attribValue="",Q.state=j.ATTRIB_NAME):G(Q,"Invalid attribute name");continue;case j.ATTRIB_VALUE_UNQUOTED:if(!S(De)){De==="&"?Q.state=j.ATTRIB_VALUE_ENTITY_U:Q.attribValue+=De;continue}Z(Q),De===">"?le(Q):Q.state=j.ATTRIB;continue;case j.CLOSE_TAG:if(Q.tagName)De===">"?de(Q):w(it,De)?Q.tagName+=De:Q.script?(Q.script+="</"+Q.tagName,Q.tagName="",Q.state=j.SCRIPT):(h(De)||G(Q,"Invalid tagname in closing tag"),Q.state=j.CLOSE_TAG_SAW_WHITE);else{if(h(De))continue;R(He,De)?Q.script?(Q.script+="</"+De,Q.state=j.SCRIPT):G(Q,"Invalid tagname in closing tag."):Q.tagName=De}continue;case j.CLOSE_TAG_SAW_WHITE:if(h(De))continue;De===">"?de(Q):G(Q,"Invalid characters in closing tag");continue;case j.TEXT_ENTITY:case j.ATTRIB_VALUE_ENTITY_Q:case j.ATTRIB_VALUE_ENTITY_U:var Be,tt;switch(Q.state){case j.TEXT_ENTITY:Be=j.TEXT,tt="textNode";break;case j.ATTRIB_VALUE_ENTITY_Q:Be=j.ATTRIB_VALUE_QUOTED,tt="attribValue";break;case j.ATTRIB_VALUE_ENTITY_U:Be=j.ATTRIB_VALUE_UNQUOTED,tt="attribValue"}De===";"?(Q[tt]+=Te(Q),Q.entity="",Q.state=Be):w(Q.entity.length?P:re,De)?Q.entity+=De:(G(Q,"Invalid character in entity name"),Q[tt]+="&"+Q.entity+De,Q.entity="",Q.state=Be);continue;default:throw new Error(Q,"Unknown state: "+Q.state)}return Q.position>=Q.bufferCheckPosition&&b(Q),Q}v.parser=function($,Q){return new y($,Q)},v.SAXParser=y,v.SAXStream=x,v.createStream=_,v.MAX_BUFFER_LENGTH=65536;var ye=["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($){function Q(){}return Q.prototype=$,new Q}),i.default||(Object.keys=function($){var Q=[];for(var xe in $)$.hasOwnProperty(xe)&&Q.push(xe);return Q}),y.prototype={end:function(){M(this)},write:_e,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){m(this)}};var Ke;try{Ke=C("stream").Stream}catch($){Ke=function(){}}var Me=v.EVENTS.filter(function($){return $!=="error"&&$!=="end"});x.prototype=(0,d.default)(Ke.prototype,{constructor:{value:x}}),x.prototype.write=function($){if(typeof A=="function"&&typeof A.isBuffer=="function"&&A.isBuffer($)){if(!this._decoder){var Q=C("string_decoder").StringDecoder;this._decoder=new Q("utf8")}$=this._decoder.write($)}return this._parser.write($.toString()),this.emit("data",$),!0},x.prototype.end=function($){return $&&$.length&&this.write($),this._parser.end(),!0},x.prototype.on=function($,Q){var xe=this;return xe._parser["on"+$]||Me.indexOf($)===-1||(xe._parser["on"+$]=function(){var De=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);De.splice(0,0,$),xe.emit.apply(xe,De)}),Ke.prototype.on.call(xe,$,Q)};var Fe="[CDATA[",Ge="DOCTYPE",Ee="http://www.w3.org/XML/1998/namespace",me="http://www.w3.org/2000/xmlns/",We={xml:Ee,xmlns:me},He=/[:_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]/,it=/[:_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-]/,re=/[#:_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]/,P=/[#:_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-]/,j=0;v.STATE={BEGIN:j++,BEGIN_WHITESPACE:j++,TEXT:j++,TEXT_ENTITY:j++,OPEN_WAKA:j++,SGML_DECL:j++,SGML_DECL_QUOTED:j++,DOCTYPE:j++,DOCTYPE_QUOTED:j++,DOCTYPE_DTD:j++,DOCTYPE_DTD_QUOTED:j++,COMMENT_STARTING:j++,COMMENT:j++,COMMENT_ENDING:j++,COMMENT_ENDED:j++,CDATA:j++,CDATA_ENDING:j++,CDATA_ENDING_2:j++,PROC_INST:j++,PROC_INST_BODY:j++,PROC_INST_ENDING:j++,OPEN_TAG:j++,OPEN_TAG_SLASH:j++,ATTRIB:j++,ATTRIB_NAME:j++,ATTRIB_NAME_SAW_WHITE:j++,ATTRIB_VALUE:j++,ATTRIB_VALUE_QUOTED:j++,ATTRIB_VALUE_CLOSED:j++,ATTRIB_VALUE_UNQUOTED:j++,ATTRIB_VALUE_ENTITY_Q:j++,ATTRIB_VALUE_ENTITY_U:j++,CLOSE_TAG:j++,CLOSE_TAG_SAW_WHITE:j++,SCRIPT:j++,SCRIPT_ENDING:j++},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,i.default)(v.ENTITIES).forEach(function($){var Q=v.ENTITIES[$],xe=typeof Q=="number"?String.fromCharCode(Q):Q;v.ENTITIES[$]=xe});for(var ee in v.STATE)v.STATE[v.STATE[ee]]=ee;j=v.STATE,p.default||function(){var $=String.fromCharCode,Q=Math.floor,xe=function(){var De,dt,Ne=[],Be=-1,tt=arguments.length;if(!tt)return"";for(var lt="";++Be<tt;){var qe=Number(arguments[Be]);if(!isFinite(qe)||qe<0||qe>1114111||Q(qe)!==qe)throw RangeError("Invalid code point: "+qe);qe<=65535?Ne.push(qe):(qe-=65536,De=55296+(qe>>10),dt=qe%1024+56320,Ne.push(De,dt)),(Be+1===tt||Ne.length>16384)&&(lt+=$.apply(null,Ne),Ne.length=0)}return lt};l.default?Object.defineProperty(String,"fromCodePoint",{value:xe,configurable:!0,writable:!0}):String.fromCodePoint=xe}()}(T===void 0?(void 0).sax={}:T)}).call(this,C("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(C,D,T){function A(){O.call(this)}D.exports=A;var O=C("events").EventEmitter;C("inherits")(A,O),A.Readable=C("readable-stream/readable.js"),A.Writable=C("readable-stream/writable.js"),A.Duplex=C("readable-stream/duplex.js"),A.Transform=C("readable-stream/transform.js"),A.PassThrough=C("readable-stream/passthrough.js"),A.Stream=A,A.prototype.pipe=function(f,p){function c(t){f.writable&&f.write(t)===!1&&a.pause&&a.pause()}function s(){a.readable&&a.resume&&a.resume()}function n(){i||(i=!0,f.end())}function o(){i||(i=!0,typeof f.destroy=="function"&&f.destroy())}function r(t){if(l(),O.listenerCount(this,"error")===0)throw t}function l(){a.removeListener("data",c),f.removeListener("drain",s),a.removeListener("end",n),a.removeListener("close",o),a.removeListener("error",r),f.removeListener("error",r),a.removeListener("end",l),a.removeListener("close",l),f.removeListener("close",l)}var a=this;a.on("data",c),f.on("drain",s),f._isStdio||p&&p.end===!1||(a.on("end",n),a.on("close",o));var i=!1;return a.on("error",r),f.on("error",r),a.on("end",l),a.on("close",l),f.on("close",l),f.emit("pipe",a),f}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(C,D,T){(function(A){var O=C("./lib/request"),f=C("./lib/response"),p=C("xtend"),c=C("builtin-status-codes"),s=C("url"),n=T;n.request=function(o,r){o=typeof o=="string"?s.parse(o):p(o);var l=A.location.protocol.search(/^https?:$/)===-1?"http:":"",a=o.protocol||l,i=o.hostname||o.host,t=o.port,d=o.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),o.url=(i?a+"//"+i:"")+(t?":"+t:"")+d,o.method=(o.method||"GET").toUpperCase(),o.headers=o.headers||{};var v=new O(o);return r&&v.on("response",r),v},n.get=function(o,r){var l=n.request(o,r);return l.end(),l},n.ClientRequest=O,n.IncomingMessage=f.IncomingMessage,n.Agent=function(){},n.Agent.defaultMaxSockets=4,n.globalAgent=new n.Agent,n.STATUS_CODES=c,n.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 ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(C,D,T){(function(A){"use strict";function O(){if(c!==void 0)return c;if(A.XMLHttpRequest){c=new A.XMLHttpRequest;try{c.open("GET",A.XDomainRequest?"/":"https://example.com")}catch(o){c=null}}else c=null;return c}function f(o){var r=O();if(!r)return!1;try{return r.responseType=o,r.responseType===o}catch(l){}return!1}function p(o){return typeof o=="function"}T.fetch=p(A.fetch)&&p(A.ReadableStream),T.writableStream=p(A.WritableStream),T.abortController=p(A.AbortController),T.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),T.blobConstructor=!0}catch(o){}var c,s=A.ArrayBuffer!==void 0,n=s&&p(A.ArrayBuffer.prototype.slice);T.arraybuffer=T.fetch||s&&f("arraybuffer"),T.msstream=!T.fetch&&n&&f("ms-stream"),T.mozchunkedarraybuffer=!T.fetch&&s&&f("moz-chunked-arraybuffer"),T.overrideMimeType=T.fetch||!!O()&&p(O().overrideMimeType),T.vbArray=p(A.VBArray),c=null}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],198:[function(C,D,T){(function(A,O,f){"use strict";function p(b,g){return o.fetch&&g?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&b?"arraybuffer":o.vbArray&&b?"text:vbarray":"text"}function c(b){try{var g=b.status;return g!==null&&g!==0}catch(m){return!1}}var s=C("babel-runtime/core-js/object/keys"),n=function(b){return b&&b.__esModule?b:{default:b}}(s),o=C("./capability"),r=C("inherits"),l=C("./response"),a=C("readable-stream"),i=C("to-arraybuffer"),t=l.IncomingMessage,d=l.readyStates,v=D.exports=function(b){var g=this;a.Writable.call(g),g._opts=b,g._body=[],g._headers={},b.auth&&g.setHeader("Authorization","Basic "+new f(b.auth).toString("base64")),(0,n.default)(b.headers).forEach(function(x){g.setHeader(x,b.headers[x])});var m,_=!0;if(b.mode==="disable-fetch"||"requestTimeout"in b&&!o.abortController)_=!1,m=!0;else if(b.mode==="prefer-streaming")m=!1;else if(b.mode==="allow-wrong-content-type")m=!o.overrideMimeType;else{if(b.mode&&b.mode!=="default"&&b.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");m=!0}g._mode=p(m,_),g._fetchTimer=null,g.on("finish",function(){g._onFinish()})};r(v,a.Writable),v.prototype.setHeader=function(b,g){var m=this,_=b.toLowerCase();y.indexOf(_)===-1&&(m._headers[_]={name:b,value:g})},v.prototype.getHeader=function(b){var g=this._headers[b.toLowerCase()];return g?g.value:null},v.prototype.removeHeader=function(b){delete this._headers[b.toLowerCase()]},v.prototype._onFinish=function(){var b=this;if(!b._destroyed){var g=b._opts,m=b._headers,_=null;g.method!=="GET"&&g.method!=="HEAD"&&(_=o.arraybuffer?i(f.concat(b._body)):o.blobConstructor?new O.Blob(b._body.map(function(w){return i(w)}),{type:(m["content-type"]||{}).value||""}):f.concat(b._body).toString());var x=[];if((0,n.default)(m).forEach(function(w){var R=m[w].name,N=m[w].value;Array.isArray(N)?N.forEach(function(F){x.push([R,F])}):x.push([R,N])}),b._mode==="fetch"){var h=null;if(o.abortController){var E=new AbortController;h=E.signal,b._fetchAbortController=E,"requestTimeout"in g&&g.requestTimeout!==0&&(b._fetchTimer=O.setTimeout(function(){b.emit("requestTimeout"),b._fetchAbortController&&b._fetchAbortController.abort()},g.requestTimeout))}O.fetch(b._opts.url,{method:b._opts.method,headers:x,body:_||void 0,mode:"cors",credentials:g.withCredentials?"include":"same-origin",signal:h}).then(function(w){b._fetchResponse=w,b._connect()},function(w){O.clearTimeout(b._fetchTimer),b._destroyed||b.emit("error",w)})}else{var S=b._xhr=new O.XMLHttpRequest;try{S.open(b._opts.method,b._opts.url,!0)}catch(w){return void A.nextTick(function(){b.emit("error",w)})}"responseType"in S&&(S.responseType=b._mode.split(":")[0]),"withCredentials"in S&&(S.withCredentials=!!g.withCredentials),b._mode==="text"&&"overrideMimeType"in S&&S.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in g&&(S.timeout=g.requestTimeout,S.ontimeout=function(){b.emit("requestTimeout")}),x.forEach(function(w){S.setRequestHeader(w[0],w[1])}),b._response=null,S.onreadystatechange=function(){switch(S.readyState){case d.LOADING:case d.DONE:b._onXHRProgress()}},b._mode==="moz-chunked-arraybuffer"&&(S.onprogress=function(){b._onXHRProgress()}),S.onerror=function(){b._destroyed||b.emit("error",new Error("XHR error"))};try{S.send(_)}catch(w){return void A.nextTick(function(){b.emit("error",w)})}}}},v.prototype._onXHRProgress=function(){var b=this;c(b._xhr)&&!b._destroyed&&(b._response||b._connect(),b._response._onXHRProgress())},v.prototype._connect=function(){var b=this;b._destroyed||(b._response=new t(b._xhr,b._fetchResponse,b._mode,b._fetchTimer),b._response.on("error",function(g){b.emit("error",g)}),b.emit("response",b._response))},v.prototype._write=function(b,g,m){this._body.push(b),m()},v.prototype.abort=v.prototype.destroy=function(){var b=this;b._destroyed=!0,O.clearTimeout(b._fetchTimer),b._response&&(b._response._destroyed=!0),b._xhr?b._xhr.abort():b._fetchAbortController&&b._fetchAbortController.abort()},v.prototype.end=function(b,g,m){var _=this;typeof b=="function"&&(m=b,b=void 0),a.Writable.prototype.end.call(_,b,g,m)},v.prototype.flushHeaders=function(){},v.prototype.setTimeout=function(){},v.prototype.setNoDelay=function(){},v.prototype.setSocketKeepAlive=function(){};var y=["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,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{},C("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(C,D,T){(function(A,O,f){"use strict";var p=C("babel-runtime/core-js/promise"),c=function(a){return a&&a.__esModule?a:{default:a}}(p),s=C("./capability"),n=C("inherits"),o=C("readable-stream"),r=T.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=T.IncomingMessage=function(a,i,t,d){var v=this;if(o.Readable.call(v),v._mode=t,v.headers={},v.rawHeaders=[],v.trailers={},v.rawTrailers=[],v.on("end",function(){A.nextTick(function(){v.emit("close")})}),t==="fetch"){if(v._fetchResponse=i,v.url=i.url,v.statusCode=i.status,v.statusMessage=i.statusText,i.headers.forEach(function(_,x){v.headers[x.toLowerCase()]=_,v.rawHeaders.push(x,_)}),s.writableStream){var y=new WritableStream({write:function(_){return new c.default(function(x,h){v._destroyed?h():v.push(new f(_))?x():v._resumeFetch=x})},close:function(){O.clearTimeout(d),v._destroyed||v.push(null)},abort:function(_){v._destroyed||v.emit("error",_)}});try{return void i.body.pipeTo(y).catch(function(_){O.clearTimeout(d),v._destroyed||v.emit("error",_)})}catch(_){}}var b=i.body.getReader();!function _(){b.read().then(function(x){if(!v._destroyed){if(x.done)return O.clearTimeout(d),void v.push(null);v.push(new f(x.value)),_()}}).catch(function(x){O.clearTimeout(d),v._destroyed||v.emit("error",x)})}()}else if(v._xhr=a,v._pos=0,v.url=a.responseURL,v.statusCode=a.status,v.statusMessage=a.statusText,a.getAllResponseHeaders().split(/\r?\n/).forEach(function(_){var x=_.match(/^([^:]+):\s*(.*)/);if(x){var h=x[1].toLowerCase();h==="set-cookie"?(v.headers[h]===void 0&&(v.headers[h]=[]),v.headers[h].push(x[2])):v.headers[h]!==void 0?v.headers[h]+=", "+x[2]:v.headers[h]=x[2],v.rawHeaders.push(x[1],x[2])}}),v._charset="x-user-defined",!s.overrideMimeType){var g=v.rawHeaders["mime-type"];if(g){var m=g.match(/;\s*charset=([^;])(;|$)/);m&&(v._charset=m[1].toLowerCase())}v._charset||(v._charset="utf-8")}};n(l,o.Readable),l.prototype._read=function(){var a=this,i=a._resumeFetch;i&&(a._resumeFetch=null,i())},l.prototype._onXHRProgress=function(){var a=this,i=a._xhr,t=null;switch(a._mode){case"text:vbarray":if(i.readyState!==r.DONE)break;try{t=new O.VBArray(i.responseBody).toArray()}catch(g){}if(t!==null){a.push(new f(t));break}case"text":try{t=i.responseText}catch(g){a._mode="text:vbarray";break}if(t.length>a._pos){var d=t.substr(a._pos);if(a._charset==="x-user-defined"){for(var v=new f(d.length),y=0;y<d.length;y++)v[y]=255&d.charCodeAt(y);a.push(v)}else a.push(d,a._charset);a._pos=t.length}break;case"arraybuffer":if(i.readyState!==r.DONE||!i.response)break;t=i.response,a.push(new f(new Uint8Array(t)));break;case"moz-chunked-arraybuffer":if(t=i.response,i.readyState!==r.LOADING||!t)break;a.push(new f(new Uint8Array(t)));break;case"ms-stream":if(t=i.response,i.readyState!==r.LOADING)break;var b=new O.MSStreamReader;b.onprogress=function(){b.result.byteLength>a._pos&&(a.push(new f(new Uint8Array(b.result.slice(a._pos)))),a._pos=b.result.byteLength)},b.onload=function(){a.push(null)},b.readAsArrayBuffer(t)}a._xhr.readyState===r.DONE&&a._mode!=="ms-stream"&&a.push(null)}}).call(this,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{},C("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(C,D,T){"use strict";function A(g){if(!g)return"utf8";for(var m;;)switch(g){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 g;default:if(m)return;g=(""+g).toLowerCase(),m=!0}}function O(g){var m=A(g);if(typeof m!="string"&&(y.isEncoding===b||!b(g)))throw new Error("Unknown encoding: "+g);return m||g}function f(g){this.encoding=O(g);var m;switch(this.encoding){case"utf16le":this.text=l,this.end=a,m=4;break;case"utf8":this.fillLast=n,m=4;break;case"base64":this.text=i,this.end=t,m=3;break;default:return this.write=d,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(m)}function p(g){return g<=127?0:g>>5==6?2:g>>4==14?3:g>>3==30?4:g>>6==2?-1:-2}function c(g,m,_){var x=m.length-1;if(x<_)return 0;var h=p(m[x]);return h>=0?(h>0&&(g.lastNeed=h-1),h):--x<_||h===-2?0:(h=p(m[x]))>=0?(h>0&&(g.lastNeed=h-2),h):--x<_||h===-2?0:(h=p(m[x]),h>=0?(h>0&&(h===2?h=0:g.lastNeed=h-3),h):0)}function s(g,m,_){if((192&m[0])!=128)return g.lastNeed=0,"\u951F\uFFFD";if(g.lastNeed>1&&m.length>1){if((192&m[1])!=128)return g.lastNeed=1,"\u951F\uFFFD";if(g.lastNeed>2&&m.length>2&&(192&m[2])!=128)return g.lastNeed=2,"\u951F\uFFFD"}}function n(g){var m=this.lastTotal-this.lastNeed,_=s(this,g,m);return _!==void 0?_:this.lastNeed<=g.length?(g.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(g.copy(this.lastChar,m,0,g.length),void(this.lastNeed-=g.length))}function o(g,m){var _=c(this,g,m);if(!this.lastNeed)return g.toString("utf8",m);this.lastTotal=_;var x=g.length-(_-this.lastNeed);return g.copy(this.lastChar,0,x),g.toString("utf8",m,x)}function r(g){var m=g&&g.length?this.write(g):"";return this.lastNeed?m+"\u951F\uFFFD":m}function l(g,m){if((g.length-m)%2==0){var _=g.toString("utf16le",m);if(_){var x=_.charCodeAt(_.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",m,g.length-1)}function a(g){var m=g&&g.length?this.write(g):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,_)}return m}function i(g,m){var _=(g.length-m)%3;return _===0?g.toString("base64",m):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",m,g.length-_))}function t(g){var m=g&&g.length?this.write(g):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function d(g){return g.toString(this.encoding)}function v(g){return g&&g.length?this.write(g):""}var y=C("safe-buffer").Buffer,b=y.isEncoding||function(g){switch((g=""+g)&&g.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}};T.StringDecoder=f,f.prototype.write=function(g){if(g.length===0)return"";var m,_;if(this.lastNeed){if((m=this.fillLast(g))===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<g.length?m?m+this.text(g,_):this.text(g,_):m||""},f.prototype.end=r,f.prototype.text=o,f.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length}},{"safe-buffer":193}],201:[function(C,D,T){(function(A,O){function f(r,l){this._id=r,this._clearFn=l}var p=C("process/browser.js").nextTick,c=Function.prototype.apply,s=Array.prototype.slice,n={},o=0;T.setTimeout=function(){return new f(c.call(setTimeout,window,arguments),clearTimeout)},T.setInterval=function(){return new f(c.call(setInterval,window,arguments),clearInterval)},T.clearTimeout=T.clearInterval=function(r){r.close()},f.prototype.unref=f.prototype.ref=function(){},f.prototype.close=function(){this._clearFn.call(window,this._id)},T.enroll=function(r,l){clearTimeout(r._idleTimeoutId),r._idleTimeout=l},T.unenroll=function(r){clearTimeout(r._idleTimeoutId),r._idleTimeout=-1},T._unrefActive=T.active=function(r){clearTimeout(r._idleTimeoutId);var l=r._idleTimeout;l>=0&&(r._idleTimeoutId=setTimeout(function(){r._onTimeout&&r._onTimeout()},l))},T.setImmediate=typeof A=="function"?A:function(r){var l=o++,a=!(arguments.length<2)&&s.call(arguments,1);return n[l]=!0,p(function(){n[l]&&(a?r.apply(null,a):r.call(null),T.clearImmediate(l))}),l},T.clearImmediate=typeof O=="function"?O:function(r){delete n[r]}}).call(this,C("timers").setImmediate,C("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(C,D,T){var A=C("buffer").Buffer;D.exports=function(O){if(O instanceof Uint8Array){if(O.byteOffset===0&&O.byteLength===O.buffer.byteLength)return O.buffer;if(typeof O.buffer.slice=="function")return O.buffer.slice(O.byteOffset,O.byteOffset+O.byteLength)}if(A.isBuffer(O)){for(var f=new Uint8Array(O.length),p=O.length,c=0;c<p;c++)f[c]=O[c];return f.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(C,D,T){"use strict";function A(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function O(h,E,S){if(h&&n.isObject(h)&&h instanceof A)return h;var w=new A;return w.parse(h,E,S),w}function f(h){return n.isString(h)&&(h=O(h)),h instanceof A?h.format():A.prototype.format.call(h)}function p(h,E){return O(h,!1,!0).resolve(E)}function c(h,E){return h?O(h,!1,!0).resolveObject(E):E}var s=C("punycode"),n=C("./util");T.parse=O,T.resolve=p,T.resolveObject=c,T.format=f,T.Url=A;var o=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
|
|
|
`," "],i=["{","}","|","\\","^","`"].concat(a),t=["'"].concat(i),d=["%","/","?",";","#"].concat(t),v=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=C("querystring");A.prototype.parse=function(h,E,S){if(!n.isString(h))throw new TypeError("Parameter 'url' must be a string, not "+typeof h);var w=h.indexOf("?"),R=w!==-1&&w<h.indexOf("#")?"?":"#",N=h.split(R),F=/\\/g;N[0]=N[0].replace(F,"/"),h=N.join(R);var z=h;if(z=z.trim(),!S&&h.split("#").length===1){var q=l.exec(z);if(q)return this.path=z,this.href=z,this.pathname=q[1],q[2]?(this.search=q[2],this.query=E?x.parse(this.search.substr(1)):this.search.substr(1)):E&&(this.search="",this.query={}),this}var B=o.exec(z);if(B){B=B[0];var M=B.toLowerCase();this.protocol=M,z=z.substr(B.length)}if(S||B||z.match(/^\/\/[^@\/]+@[^@\/]+/)){var G=z.substr(0,2)==="//";!G||B&&m[B]||(z=z.substr(2),this.slashes=!0)}if(!m[B]&&(G||B&&!_[B])){for(var J=-1,K=0;K<v.length;K++){var Z=z.indexOf(v[K]);Z!==-1&&(J===-1||Z<J)&&(J=Z)}var le,de;de=J===-1?z.lastIndexOf("@"):z.lastIndexOf("@",J),de!==-1&&(le=z.slice(0,de),z=z.slice(de+1),this.auth=decodeURIComponent(le)),J=-1;for(var K=0;K<d.length;K++){var Z=z.indexOf(d[K]);Z!==-1&&(J===-1||Z<J)&&(J=Z)}J===-1&&(J=z.length),this.host=z.slice(0,J),z=z.slice(J),this.parseHost(),this.hostname=this.hostname||"";var Te=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Te)for(var we=this.hostname.split(/\./),K=0,Ie=we.length;K<Ie;K++){var _e=we[K];if(_e&&!_e.match(y)){for(var ye="",Ke=0,Me=_e.length;Ke<Me;Ke++)_e.charCodeAt(Ke)>127?ye+="x":ye+=_e[Ke];if(!ye.match(y)){var Fe=we.slice(0,K),Ge=we.slice(K+1),Ee=_e.match(b);Ee&&(Fe.push(Ee[1]),Ge.unshift(Ee[2])),Ge.length&&(z="/"+Ge.join(".")+z),this.hostname=Fe.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),Te||(this.hostname=s.toASCII(this.hostname));var me=this.port?":"+this.port:"",We=this.hostname||"";this.host=We+me,this.href+=this.host,Te&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),z[0]!=="/"&&(z="/"+z))}if(!g[M])for(var K=0,Ie=t.length;K<Ie;K++){var He=t[K];if(z.indexOf(He)!==-1){var it=encodeURIComponent(He);it===He&&(it=escape(He)),z=z.split(He).join(it)}}var re=z.indexOf("#");re!==-1&&(this.hash=z.substr(re),z=z.slice(0,re));var P=z.indexOf("?");if(P!==-1?(this.search=z.substr(P),this.query=z.substr(P+1),E&&(this.query=x.parse(this.query)),z=z.slice(0,P)):E&&(this.search="",this.query={}),z&&(this.pathname=z),_[M]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var me=this.pathname||"",j=this.search||"";this.path=me+j}return this.href=this.format(),this},A.prototype.format=function(){var h=this.auth||"";h&&(h=encodeURIComponent(h),h=h.replace(/%3A/i,":"),h+="@");var E=this.protocol||"",S=this.pathname||"",w=this.hash||"",R=!1,N="";this.host?R=h+this.host:this.hostname&&(R=h+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(R+=":"+this.port)),this.query&&n.isObject(this.query)&&Object.keys(this.query).length&&(N=x.stringify(this.query));var F=this.search||N&&"?"+N||"";return E&&E.substr(-1)!==":"&&(E+=":"),this.slashes||(!E||_[E])&&R!==!1?(R="//"+(R||""),S&&S.charAt(0)!=="/"&&(S="/"+S)):R||(R=""),w&&w.charAt(0)!=="#"&&(w="#"+w),F&&F.charAt(0)!=="?"&&(F="?"+F),S=S.replace(/[?#]/g,function(z){return encodeURIComponent(z)}),F=F.replace("#","%23"),E+R+S+F+w},A.prototype.resolve=function(h){return this.resolveObject(O(h,!1,!0)).format()},A.prototype.resolveObject=function(h){if(n.isString(h)){var E=new A;E.parse(h,!1,!0),h=E}for(var S=new A,w=Object.keys(this),R=0;R<w.length;R++){var N=w[R];S[N]=this[N]}if(S.hash=h.hash,h.href==="")return S.href=S.format(),S;if(h.slashes&&!h.protocol){for(var F=Object.keys(h),z=0;z<F.length;z++){var q=F[z];q!=="protocol"&&(S[q]=h[q])}return _[S.protocol]&&S.hostname&&!S.pathname&&(S.path=S.pathname="/"),S.href=S.format(),S}if(h.protocol&&h.protocol!==S.protocol){if(!_[h.protocol]){for(var B=Object.keys(h),M=0;M<B.length;M++){var G=B[M];S[G]=h[G]}return S.href=S.format(),S}if(S.protocol=h.protocol,h.host||m[h.protocol])S.pathname=h.pathname;else{for(var Ie=(h.pathname||"").split("/");Ie.length&&!(h.host=Ie.shift()););h.host||(h.host=""),h.hostname||(h.hostname=""),Ie[0]!==""&&Ie.unshift(""),Ie.length<2&&Ie.unshift(""),S.pathname=Ie.join("/")}if(S.search=h.search,S.query=h.query,S.host=h.host||"",S.auth=h.auth,S.hostname=h.hostname||h.host,S.port=h.port,S.pathname||S.search){var J=S.pathname||"",K=S.search||"";S.path=J+K}return S.slashes=S.slashes||h.slashes,S.href=S.format(),S}var Z=S.pathname&&S.pathname.charAt(0)==="/",le=h.host||h.pathname&&h.pathname.charAt(0)==="/",de=le||Z||S.host&&h.pathname,Te=de,we=S.pathname&&S.pathname.split("/")||[],Ie=h.pathname&&h.pathname.split("/")||[],_e=S.protocol&&!_[S.protocol];if(_e&&(S.hostname="",S.port=null,S.host&&(we[0]===""?we[0]=S.host:we.unshift(S.host)),S.host="",h.protocol&&(h.hostname=null,h.port=null,h.host&&(Ie[0]===""?Ie[0]=h.host:Ie.unshift(h.host)),h.host=null),de=de&&(Ie[0]===""||we[0]==="")),le)S.host=h.host||h.host===""?h.host:S.host,S.hostname=h.hostname||h.hostname===""?h.hostname:S.hostname,S.search=h.search,S.query=h.query,we=Ie;else if(Ie.length)we||(we=[]),we.pop(),we=we.concat(Ie),S.search=h.search,S.query=h.query;else if(!n.isNullOrUndefined(h.search)){if(_e){S.hostname=S.host=we.shift();var ye=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ye&&(S.auth=ye.shift(),S.host=S.hostname=ye.shift())}return S.search=h.search,S.query=h.query,n.isNull(S.pathname)&&n.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!we.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var Ke=we.slice(-1)[0],Me=(S.host||h.host||we.length>1)&&(Ke==="."||Ke==="..")||Ke==="",Fe=0,Ge=we.length;Ge>=0;Ge--)Ke=we[Ge],Ke==="."?we.splice(Ge,1):Ke===".."?(we.splice(Ge,1),Fe++):Fe&&(we.splice(Ge,1),Fe--);if(!de&&!Te)for(;Fe--;Fe)we.unshift("..");!de||we[0]===""||we[0]&&we[0].charAt(0)==="/"||we.unshift(""),Me&&we.join("/").substr(-1)!=="/"&&we.push("");var Ee=we[0]===""||we[0]&&we[0].charAt(0)==="/";if(_e){S.hostname=S.host=Ee?"":we.length?we.shift():"";var ye=!!(S.host&&S.host.indexOf("@")>0)&&S.host.split("@");ye&&(S.auth=ye.shift(),S.host=S.hostname=ye.shift())}return de=de||S.host&&we.length,de&&!Ee&&we.unshift(""),we.length?S.pathname=we.join("/"):(S.pathname=null,S.path=null),n.isNull(S.pathname)&&n.isNull(S.search)||(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=h.auth||S.auth,S.slashes=S.slashes||h.slashes,S.href=S.format(),S},A.prototype.parseHost=function(){var h=this.host,E=r.exec(h);E&&(E=E[0],E!==":"&&(this.port=E.substr(1)),h=h.substr(0,h.length-E.length)),h&&(this.hostname=h)}},{"./util":204,punycode:174,querystring:177}],204:[function(C,D,T){"use strict";D.exports={isString:function(A){return typeof A=="string"},isObject:function(A){return typeof A=="object"&&A!==null},isNull:function(A){return A===null},isNullOrUndefined:function(A){return A==null}}},{}],205:[function(C,D,T){(function(A){function O(p,c){function s(){if(!n){if(f("throwDeprecation"))throw new Error(c);f("traceDeprecation")?console.trace(c):console.warn(c),n=!0}return p.apply(this,arguments)}if(f("noDeprecation"))return p;var n=!1;return s}function f(p){try{if(!A.localStorage)return!1}catch(s){return!1}var c=A.localStorage[p];return c!=null&&String(c).toLowerCase()==="true"}D.exports=O}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],206:[function(C,D,T){D.exports=function(A){return A&&typeof A=="object"&&typeof A.copy=="function"&&typeof A.fill=="function"&&typeof A.readUInt8=="function"}},{}],207:[function(C,D,T){(function(A,O){function f(K,Z){var le={seen:[],stylize:c};return arguments.length>=3&&(le.depth=arguments[2]),arguments.length>=4&&(le.colors=arguments[3]),d(Z)?le.showHidden=Z:Z&&T._extend(le,Z),_(le.showHidden)&&(le.showHidden=!1),_(le.depth)&&(le.depth=2),_(le.colors)&&(le.colors=!1),_(le.customInspect)&&(le.customInspect=!0),le.colors&&(le.stylize=p),n(le,K,le.depth)}function p(K,Z){var le=f.styles[Z];return le?"["+f.colors[le][0]+"m"+K+"["+f.colors[le][1]+"m":K}function c(K,Z){return K}function s(K){var Z={};return K.forEach(function(le,de){Z[le]=!0}),Z}function n(K,Z,le){if(K.customInspect&&Z&&w(Z.inspect)&&Z.inspect!==T.inspect&&(!Z.constructor||Z.constructor.prototype!==Z)){var de=Z.inspect(le,K);return g(de)||(de=n(K,de,le)),de}var Te=o(K,Z);if(Te)return Te;var we=Object.keys(Z),Ie=s(we);if(K.showHidden&&(we=Object.getOwnPropertyNames(Z)),S(Z)&&(we.indexOf("message")>=0||we.indexOf("description")>=0))return r(Z);if(we.length===0){if(w(Z)){var _e=Z.name?": "+Z.name:"";return K.stylize("[Function"+_e+"]","special")}if(x(Z))return K.stylize(RegExp.prototype.toString.call(Z),"regexp");if(E(Z))return K.stylize(Date.prototype.toString.call(Z),"date");if(S(Z))return r(Z)}var ye="",Ke=!1,Me=["{","}"];if((t(Z)&&(Ke=!0,Me=["[","]"]),w(Z))&&(ye=" [Function"+(Z.name?": "+Z.name:"")+"]"),x(Z)&&(ye=" "+RegExp.prototype.toString.call(Z)),E(Z)&&(ye=" "+Date.prototype.toUTCString.call(Z)),S(Z)&&(ye=" "+r(Z)),we.length===0&&(!Ke||Z.length==0))return Me[0]+ye+Me[1];if(le<0)return x(Z)?K.stylize(RegExp.prototype.toString.call(Z),"regexp"):K.stylize("[Object]","special");K.seen.push(Z);var Fe;return Fe=Ke?l(K,Z,le,Ie,we):we.map(function(Ge){return a(K,Z,le,Ie,Ge,Ke)}),K.seen.pop(),i(Fe,ye,Me)}function o(K,Z){if(_(Z))return K.stylize("undefined","undefined");if(g(Z)){var le="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return K.stylize(le,"string")}return b(Z)?K.stylize(""+Z,"number"):d(Z)?K.stylize(""+Z,"boolean"):v(Z)?K.stylize("null","null"):void 0}function r(K){return"["+Error.prototype.toString.call(K)+"]"}function l(K,Z,le,de,Te){for(var we=[],Ie=0,_e=Z.length;Ie<_e;++Ie)q(Z,String(Ie))?we.push(a(K,Z,le,de,String(Ie),!0)):we.push("");return Te.forEach(function(ye){ye.match(/^\d+$/)||we.push(a(K,Z,le,de,ye,!0))}),we}function a(K,Z,le,de,Te,we){var Ie,_e,ye;if(ye=Object.getOwnPropertyDescriptor(Z,Te)||{value:Z[Te]},ye.get?_e=ye.set?K.stylize("[Getter/Setter]","special"):K.stylize("[Getter]","special"):ye.set&&(_e=K.stylize("[Setter]","special")),q(de,Te)||(Ie="["+Te+"]"),_e||(K.seen.indexOf(ye.value)<0?(_e=v(le)?n(K,ye.value,null):n(K,ye.value,le-1),_e.indexOf(`
|
|
|
`)>-1&&(_e=we?_e.split(`
|
|
|
`).map(function(Ke){return" "+Ke}).join(`
|
|
|
`).substr(2):`
|
|
|
`+_e.split(`
|
|
|
`).map(function(Ke){return" "+Ke}).join(`
|
|
|
`))):_e=K.stylize("[Circular]","special")),_(Ie)){if(we&&Te.match(/^\d+$/))return _e;Ie=JSON.stringify(""+Te),Ie.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Ie=Ie.substr(1,Ie.length-2),Ie=K.stylize(Ie,"name")):(Ie=Ie.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Ie=K.stylize(Ie,"string"))}return Ie+": "+_e}function i(K,Z,le){var de=0;return K.reduce(function(Te,we){return de++,we.indexOf(`
|
|
|
`)>=0&&de++,Te+we.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?le[0]+(Z===""?"":Z+`
|
|
|
`)+" "+K.join(`,
|
|
|
`)+" "+le[1]:le[0]+Z+" "+K.join(", ")+" "+le[1]}function t(K){return Array.isArray(K)}function d(K){return typeof K=="boolean"}function v(K){return K===null}function y(K){return K==null}function b(K){return typeof K=="number"}function g(K){return typeof K=="string"}function m(K){return typeof K=="symbol"}function _(K){return K===void 0}function x(K){return h(K)&&N(K)==="[object RegExp]"}function h(K){return typeof K=="object"&&K!==null}function E(K){return h(K)&&N(K)==="[object Date]"}function S(K){return h(K)&&(N(K)==="[object Error]"||K instanceof Error)}function w(K){return typeof K=="function"}function R(K){return K===null||typeof K=="boolean"||typeof K=="number"||typeof K=="string"||typeof K=="symbol"||K===void 0}function N(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,Z=[F(K.getHours()),F(K.getMinutes()),F(K.getSeconds())].join(":");return[K.getDate(),J[K.getMonth()],Z].join(" ")}function q(K,Z){return Object.prototype.hasOwnProperty.call(K,Z)}var B=/%[sdj%]/g;T.format=function(K){if(!g(K)){for(var Z=[],le=0;le<arguments.length;le++)Z.push(f(arguments[le]));return Z.join(" ")}for(var le=1,de=arguments,Te=de.length,we=String(K).replace(B,function(ye){if(ye==="%%")return"%";if(le>=Te)return ye;switch(ye){case"%s":return String(de[le++]);case"%d":return Number(de[le++]);case"%j":try{return JSON.stringify(de[le++])}catch(Ke){return"[Circular]"}default:return ye}}),Ie=de[le];le<Te;Ie=de[++le])v(Ie)||!h(Ie)?we+=" "+Ie:we+=" "+f(Ie);return we},T.deprecate=function(K,Z){function le(){if(!de){if(A.throwDeprecation)throw new Error(Z);A.traceDeprecation?console.trace(Z):console.error(Z),de=!0}return K.apply(this,arguments)}if(_(O.process))return function(){return T.deprecate(K,Z).apply(this,arguments)};if(A.noDeprecation===!0)return K;var de=!1;return le};var M,G={};T.debuglog=function(K){if(_(M)&&(M=A.env.NODE_DEBUG||""),K=K.toUpperCase(),!G[K])if(new RegExp("\\b"+K+"\\b","i").test(M)){var Z=A.pid;G[K]=function(){var le=T.format.apply(T,arguments);console.error("%s %d: %s",K,Z,le)}}else G[K]=function(){};return G[K]},T.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},T.isArray=t,T.isBoolean=d,T.isNull=v,T.isNullOrUndefined=y,T.isNumber=b,T.isString=g,T.isSymbol=m,T.isUndefined=_,T.isRegExp=x,T.isObject=h,T.isDate=E,T.isError=S,T.isFunction=w,T.isPrimitive=R,T.isBuffer=C("./support/isBuffer");var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];T.log=function(){console.log("%s - %s",z(),T.format.apply(T,arguments))},T.inherits=C("inherits"),T._extend=function(K,Z){if(!Z||!h(Z))return K;for(var le=Object.keys(Z),de=le.length;de--;)K[le[de]]=Z[le[de]];return K}}).call(this,C("_process"),typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(C,D,T){"use strict";(function(){T.stripBOM=function(A){return A[0]==="\uFEFF"?A.substring(1):A}}).call(void 0)},{}],209:[function(C,D,T){"use strict";function A(s){return s&&s.__esModule?s:{default:s}}var O=C("babel-runtime/helpers/typeof"),f=A(O),p=C("babel-runtime/core-js/object/keys"),c=A(p);(function(){var s,n,o,r,l,a={}.hasOwnProperty;s=C("xmlbuilder"),n=C("./defaults").defaults,r=function(i){return typeof i=="string"&&(i.indexOf("&")>=0||i.indexOf(">")>=0||i.indexOf("<")>=0)},l=function(i){return"<![CDATA["+o(i)+"]]>"},o=function(i){return i.replace("]]>","]]]]><![CDATA[>")},T.Builder=function(){function i(t){var d,v,y;this.options={},v=n[.2];for(d in v)a.call(v,d)&&(y=v[d],this.options[d]=y);for(d in t)a.call(t,d)&&(y=t[d],this.options[d]=y)}return i.prototype.buildObject=function(t){var d,v,y,b,g;return d=this.options.attrkey,v=this.options.charkey,(0,c.default)(t).length===1&&this.options.rootName===n[.2].rootName?(g=(0,c.default)(t)[0],t=t[g]):g=this.options.rootName,y=function(m){return function(_,x){var h,E,S,w,R,N;if((x===void 0?"undefined":(0,f.default)(x))!=="object")m.options.cdata&&r(x)?_.raw(l(x)):_.txt(x);else if(Array.isArray(x)){for(w in x)if(a.call(x,w)){E=x[w];for(R in E)S=E[R],_=y(_.ele(R),S).up()}}else for(R in x)if(a.call(x,R))if(E=x[R],R===d){if((E===void 0?"undefined":(0,f.default)(E))==="object")for(h in E)N=E[h],_=_.att(h,N)}else if(R===v)_=m.options.cdata&&r(E)?_.raw(l(E)):_.txt(E);else if(Array.isArray(E))for(w in E)a.call(E,w)&&(S=E[w],_=typeof S=="string"?m.options.cdata&&r(S)?_.ele(R).raw(l(S)).up():_.ele(R,S).up():y(_.ele(R),S).up());else(E===void 0?"undefined":(0,f.default)(E))==="object"?_=y(_.ele(R),E).up():typeof E=="string"&&m.options.cdata&&r(E)?_=_.ele(R).raw(l(E)).up():(E==null&&(E=""),_=_.ele(R,E.toString()).up());return _}}(this),b=s.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),y(b,t).end(this.options.renderOpts)},i}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(C,D,T){"use strict";(function(){T.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(C,D,T){"use strict";function A(o){return o&&o.__esModule?o:{default:o}}var O=C("babel-runtime/core-js/object/get-own-property-names"),f=A(O),p=C("babel-runtime/core-js/object/keys"),c=A(p),s=C("babel-runtime/helpers/typeof"),n=A(s);(function(){var o,r,l,a,i,t,d,v,y=function(m,_){return function(){return m.apply(_,arguments)}},b=function(m,_){function x(){this.constructor=m}for(var h in _)g.call(_,h)&&(m[h]=_[h]);return x.prototype=_.prototype,m.prototype=new x,m.__super__=_.prototype,m},g={}.hasOwnProperty;d=C("sax"),l=C("events"),o=C("./bom"),t=C("./processors"),v=C("timers").setImmediate,r=C("./defaults").defaults,a=function(m){return(m===void 0?"undefined":(0,n.default)(m))==="object"&&m!=null&&(0,c.default)(m).length===0},i=function(m,_,x){var h,E,S;for(h=0,E=m.length;h<E;h++)S=m[h],_=S(_,x);return _},T.Parser=function(m){function _(x){this.parseString=y(this.parseString,this),this.reset=y(this.reset,this),this.assignOrPush=y(this.assignOrPush,this),this.processAsync=y(this.processAsync,this);var h,E,S;if(!(this instanceof T.Parser))return new T.Parser(x);this.options={},E=r[.2];for(h in E)g.call(E,h)&&(S=E[h],this.options[h]=S);for(h in x)g.call(x,h)&&(S=x[h],this.options[h]=S);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(t.normalize)),this.reset()}return b(_,m),_.prototype.processAsync=function(){var x,h;try{return this.remaining.length<=this.options.chunkSize?(x=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(x),this.saxParser.close()):(x=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(x),v(this.processAsync))}catch(E){if(h=E,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(h)}},_.prototype.assignOrPush=function(x,h,E){return h in x?(x[h]instanceof Array||(x[h]=[x[h]]),x[h].push(E)):this.options.explicitArray?x[h]=[E]:x[h]=E},_.prototype.reset=function(){var x,h,E,S;return this.removeAllListeners(),this.saxParser=d.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(w){return function(R){if(w.saxParser.resume(),!w.saxParser.errThrown)return w.saxParser.errThrown=!0,w.emit("error",R)}}(this),this.saxParser.onend=function(w){return function(){if(!w.saxParser.ended)return w.saxParser.ended=!0,w.emit("end",w.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,S=[],x=this.options.attrkey,h=this.options.charkey,this.saxParser.onopentag=function(w){return function(R){var N,F,z,q,B;if(z={},z[h]="",!w.options.ignoreAttrs){B=R.attributes;for(N in B)g.call(B,N)&&(x in z||w.options.mergeAttrs||(z[x]={}),F=w.options.attrValueProcessors?i(w.options.attrValueProcessors,R.attributes[N],N):R.attributes[N],q=w.options.attrNameProcessors?i(w.options.attrNameProcessors,N):N,w.options.mergeAttrs?w.assignOrPush(z,q,F):z[x][q]=F)}return z["#name"]=w.options.tagNameProcessors?i(w.options.tagNameProcessors,R.name):R.name,w.options.xmlns&&(z[w.options.xmlnskey]={uri:R.uri,local:R.local}),S.push(z)}}(this),this.saxParser.onclosetag=function(w){return function(){var R,N,F,z,q,B,M,G,J,K;if(B=S.pop(),q=B["#name"],w.options.explicitChildren&&w.options.preserveChildrenOrder||delete B["#name"],B.cdata===!0&&(R=B.cdata,delete B.cdata),J=S[S.length-1],B[h].match(/^\s*$/)&&!R?(N=B[h],delete B[h]):(w.options.trim&&(B[h]=B[h].trim()),w.options.normalize&&(B[h]=B[h].replace(/\s{2,}/g," ").trim()),B[h]=w.options.valueProcessors?i(w.options.valueProcessors,B[h],q):B[h],(0,c.default)(B).length===1&&h in B&&!w.EXPLICIT_CHARKEY&&(B=B[h])),a(B)&&(B=w.options.emptyTag!==""?w.options.emptyTag:N),w.options.validator!=null&&(K="/"+function(){var Z,le,de;for(de=[],Z=0,le=S.length;Z<le;Z++)z=S[Z],de.push(z["#name"]);return de}().concat(q).join("/"),function(){var Z;try{B=w.options.validator(K,J&&J[q],B)}catch(le){return Z=le,w.emit("error",Z)}}()),w.options.explicitChildren&&!w.options.mergeAttrs&&(B===void 0?"undefined":(0,n.default)(B))==="object")if(w.options.preserveChildrenOrder){if(J){J[w.options.childkey]=J[w.options.childkey]||[],M={};for(F in B)g.call(B,F)&&(M[F]=B[F]);J[w.options.childkey].push(M),delete B["#name"],(0,c.default)(B).length===1&&h in B&&!w.EXPLICIT_CHARKEY&&(B=B[h])}}else z={},w.options.attrkey in B&&(z[w.options.attrkey]=B[w.options.attrkey],delete B[w.options.attrkey]),!w.options.charsAsChildren&&w.options.charkey in B&&(z[w.options.charkey]=B[w.options.charkey],delete B[w.options.charkey]),(0,f.default)(B).length>0&&(z[w.options.childkey]=B),B=z;return S.length>0?w.assignOrPush(J,q,B):(w.options.explicitRoot&&(G=B,B={},B[q]=G),w.resultObject=B,w.saxParser.ended=!0,w.emit("end",w.resultObject))}}(this),E=function(w){return function(R){var N,F;if(F=S[S.length-1])return F[h]+=R,w.options.explicitChildren&&w.options.preserveChildrenOrder&&w.options.charsAsChildren&&(w.options.includeWhiteChars||R.replace(/\\n/g,"").trim()!=="")&&(F[w.options.childkey]=F[w.options.childkey]||[],N={"#name":"__text__"},N[h]=R,w.options.normalize&&(N[h]=N[h].replace(/\s{2,}/g," ").trim()),F[w.options.childkey].push(N)),F}}(this),this.saxParser.ontext=E,this.saxParser.oncdata=function(w){return function(R){var N;if(N=E(R))return N.cdata=!0}}()},_.prototype.parseString=function(x,h){var E;h!=null&&typeof h=="function"&&(this.on("end",function(S){return this.reset(),h(null,S)}),this.on("error",function(S){return this.reset(),h(S)}));try{return x=x.toString(),x.trim()===""?(this.emit("end",null),!0):(x=o.stripBOM(x),this.options.async?(this.remaining=x,v(this.processAsync),this.saxParser):this.saxParser.write(x).close())}catch(S){if(E=S,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",E),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw E}},_}(l.EventEmitter),T.parseString=function(m,_,x){var h,E,S;return x!=null?(typeof x=="function"&&(h=x),(_===void 0?"undefined":(0,n.default)(_))==="object"&&(E=_)):(typeof _=="function"&&(h=_),E={}),S=new T.Parser(E),S.parseString(m,h)}}).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(C,D,T){"use strict";(function(){var A;A=new RegExp(/(?!xmlns)^.*:/),T.normalize=function(O){return O.toLowerCase()},T.firstCharLowerCase=function(O){return O.charAt(0).toLowerCase()+O.slice(1)},T.stripPrefix=function(O){return O.replace(A,"")},T.parseNumbers=function(O){return isNaN(O)||(O=O%1==0?parseInt(O,10):parseFloat(O)),O},T.parseBooleans=function(O){return/^(?:true|false)$/i.test(O)&&(O=O.toLowerCase()==="true"),O}}).call(void 0)},{}],213:[function(C,D,T){"use strict";(function(){var A,O,f,p,c=function(n,o){function r(){this.constructor=n}for(var l in o)s.call(o,l)&&(n[l]=o[l]);return r.prototype=o.prototype,n.prototype=new r,n.__super__=o.prototype,n},s={}.hasOwnProperty;O=C("./defaults"),A=C("./builder"),f=C("./parser"),p=C("./processors"),T.defaults=O.defaults,T.processors=p,T.ValidationError=function(n){function o(r){this.message=r}return c(o,n),o}(Error),T.Builder=A.Builder,T.Parser=f.Parser,T.parseString=f.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(C,D,T){"use strict";function A(o){return o&&o.__esModule?o:{default:o}}var O=C("babel-runtime/core-js/object/get-prototype-of"),f=A(O),p=C("babel-runtime/helpers/typeof"),c=A(p),s=C("babel-runtime/core-js/object/assign"),n=A(s);(function(){var o,r,l,a,i,t,d=[].slice,v={}.hasOwnProperty;o=function(){var y,b,g,m,_,x;if(x=arguments[0],_=2<=arguments.length?d.call(arguments,1):[],a(n.default))n.default.apply(null,arguments);else for(y=0,g=_.length;y<g;y++)if((m=_[y])!=null)for(b in m)v.call(m,b)&&(x[b]=m[b]);return x},a=function(y){return!!y&&Object.prototype.toString.call(y)==="[object Function]"},i=function(y){var b;return!!y&&((b=y===void 0?"undefined":(0,c.default)(y))==="function"||b==="object")},r=function(y){return a(Array.isArray)?Array.isArray(y):Object.prototype.toString.call(y)==="[object Array]"},l=function(y){var b;if(r(y))return!y.length;for(b in y)if(v.call(y,b))return!1;return!0},t=function(y){var b,g;return i(y)&&(g=(0,f.default)(y))&&(b=g.constructor)&&typeof b=="function"&&b instanceof b&&Function.prototype.toString.call(b)===Function.prototype.toString.call(Object)},D.exports.assign=o,D.exports.isFunction=a,D.exports.isObject=i,D.exports.isArray=r,D.exports.isEmpty=l,D.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(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){D.exports=function(){function f(p,c,s){if(this.options=p.options,this.stringify=p.stringify,c==null)throw new Error("Missing attribute name of element "+p.name);if(s==null)throw new Error("Missing attribute value for attribute "+c+" of element "+p.name);this.name=this.stringify.attName(c),this.value=this.stringify.attValue(s)}return f.prototype.clone=function(){return(0,O.default)(this)},f.prototype.toString=function(p){return this.options.writer.set(p).attribute(this)},f}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p=function(s,n){function o(){this.constructor=s}for(var r in n)c.call(n,r)&&(s[r]=n[r]);return o.prototype=n.prototype,s.prototype=new o,s.__super__=n.prototype,s},c={}.hasOwnProperty;f=C("./XMLNode"),D.exports=function(s){function n(o,r){if(n.__super__.constructor.call(this,o),r==null)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(r)}return p(n,s),n.prototype.clone=function(){return(0,O.default)(this)},n.prototype.toString=function(o){return this.options.writer.set(o).cdata(this)},n}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p=function(s,n){function o(){this.constructor=s}for(var r in n)c.call(n,r)&&(s[r]=n[r]);return o.prototype=n.prototype,s.prototype=new o,s.__super__=n.prototype,s},c={}.hasOwnProperty;f=C("./XMLNode"),D.exports=function(s){function n(o,r){if(n.__super__.constructor.call(this,o),r==null)throw new Error("Missing comment text");this.text=this.stringify.comment(r)}return p(n,s),n.prototype.clone=function(){return(0,O.default)(this)},n.prototype.toString=function(o){return this.options.writer.set(o).comment(this)},n}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(C,D,T){"use strict";(function(){var A,O=function(p,c){function s(){this.constructor=p}for(var n in c)f.call(c,n)&&(p[n]=c[n]);return s.prototype=c.prototype,p.prototype=new s,p.__super__=c.prototype,p},f={}.hasOwnProperty;A=C("./XMLNode"),D.exports=function(p){function c(s,n,o,r,l,a){if(c.__super__.constructor.call(this,s),n==null)throw new Error("Missing DTD element name");if(o==null)throw new Error("Missing DTD attribute name");if(!r)throw new Error("Missing DTD attribute type");if(!l)throw new Error("Missing DTD attribute default");if(l.indexOf("#")!==0&&(l="#"+l),!l.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(a&&!l.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(n),this.attributeName=this.stringify.attName(o),this.attributeType=this.stringify.dtdAttType(r),this.defaultValue=this.stringify.dtdAttDefault(a),this.defaultValueType=l}return O(c,p),c.prototype.toString=function(s){return this.options.writer.set(s).dtdAttList(this)},c}(A)}).call(void 0)},{"./XMLNode":227}],219:[function(C,D,T){"use strict";(function(){var A,O=function(p,c){function s(){this.constructor=p}for(var n in c)f.call(c,n)&&(p[n]=c[n]);return s.prototype=c.prototype,p.prototype=new s,p.__super__=c.prototype,p},f={}.hasOwnProperty;A=C("./XMLNode"),D.exports=function(p){function c(s,n,o){if(c.__super__.constructor.call(this,s),n==null)throw new Error("Missing DTD element name");o||(o="(#PCDATA)"),Array.isArray(o)&&(o="("+o.join(",")+")"),this.name=this.stringify.eleName(n),this.value=this.stringify.dtdElementValue(o)}return O(c,p),c.prototype.toString=function(s){return this.options.writer.set(s).dtdElement(this)},c}(A)}).call(void 0)},{"./XMLNode":227}],220:[function(C,D,T){"use strict";(function(){var A,O,f=function(c,s){function n(){this.constructor=c}for(var o in s)p.call(s,o)&&(c[o]=s[o]);return n.prototype=s.prototype,c.prototype=new n,c.__super__=s.prototype,c},p={}.hasOwnProperty;O=C("./Utility").isObject,A=C("./XMLNode"),D.exports=function(c){function s(n,o,r,l){if(s.__super__.constructor.call(this,n),r==null)throw new Error("Missing entity name");if(l==null)throw new Error("Missing entity value");if(this.pe=!!o,this.name=this.stringify.eleName(r),O(l)){if(!l.pubID&&!l.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(l.pubID&&!l.sysID)throw new Error("System identifier is required for a public external entity");if(l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID)),l.nData!=null&&(this.nData=this.stringify.dtdNData(l.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(l)}return f(s,c),s.prototype.toString=function(n){return this.options.writer.set(n).dtdEntity(this)},s}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(C,D,T){"use strict";(function(){var A,O=function(p,c){function s(){this.constructor=p}for(var n in c)f.call(c,n)&&(p[n]=c[n]);return s.prototype=c.prototype,p.prototype=new s,p.__super__=c.prototype,p},f={}.hasOwnProperty;A=C("./XMLNode"),D.exports=function(p){function c(s,n,o){if(c.__super__.constructor.call(this,s),n==null)throw new Error("Missing notation name");if(!o.pubID&&!o.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(n),o.pubID!=null&&(this.pubID=this.stringify.dtdPubID(o.pubID)),o.sysID!=null&&(this.sysID=this.stringify.dtdSysID(o.sysID))}return O(c,p),c.prototype.toString=function(s){return this.options.writer.set(s).dtdNotation(this)},c}(A)}).call(void 0)},{"./XMLNode":227}],222:[function(C,D,T){"use strict";(function(){var A,O,f=function(c,s){function n(){this.constructor=c}for(var o in s)p.call(s,o)&&(c[o]=s[o]);return n.prototype=s.prototype,c.prototype=new n,c.__super__=s.prototype,c},p={}.hasOwnProperty;O=C("./Utility").isObject,A=C("./XMLNode"),D.exports=function(c){function s(n,o,r,l){var a;s.__super__.constructor.call(this,n),O(o)&&(a=o,o=a.version,r=a.encoding,l=a.standalone),o||(o="1.0"),this.version=this.stringify.xmlVersion(o),r!=null&&(this.encoding=this.stringify.xmlEncoding(r)),l!=null&&(this.standalone=this.stringify.xmlStandalone(l))}return f(s,c),s.prototype.toString=function(n){return this.options.writer.set(n).declaration(this)},s}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n=function(r,l){function a(){this.constructor=r}for(var i in l)o.call(l,i)&&(r[i]=l[i]);return a.prototype=l.prototype,r.prototype=new a,r.__super__=l.prototype,r},o={}.hasOwnProperty;s=C("./Utility").isObject,c=C("./XMLNode"),A=C("./XMLDTDAttList"),f=C("./XMLDTDEntity"),O=C("./XMLDTDElement"),p=C("./XMLDTDNotation"),D.exports=function(r){function l(a,i,t){var d,v;l.__super__.constructor.call(this,a),this.documentObject=a,s(i)&&(d=i,i=d.pubID,t=d.sysID),t==null&&(v=[i,t],t=v[0],i=v[1]),i!=null&&(this.pubID=this.stringify.dtdPubID(i)),t!=null&&(this.sysID=this.stringify.dtdSysID(t))}return n(l,r),l.prototype.element=function(a,i){var t;return t=new O(this,a,i),this.children.push(t),this},l.prototype.attList=function(a,i,t,d,v){var y;return y=new A(this,a,i,t,d,v),this.children.push(y),this},l.prototype.entity=function(a,i){var t;return t=new f(this,!1,a,i),this.children.push(t),this},l.prototype.pEntity=function(a,i){var t;return t=new f(this,!0,a,i),this.children.push(t),this},l.prototype.notation=function(a,i){var t;return t=new p(this,a,i),this.children.push(t),this},l.prototype.toString=function(a){return this.options.writer.set(a).docType(this)},l.prototype.ele=function(a,i){return this.element(a,i)},l.prototype.att=function(a,i,t,d,v){return this.attList(a,i,t,d,v)},l.prototype.ent=function(a,i){return this.entity(a,i)},l.prototype.pent=function(a,i){return this.pEntity(a,i)},l.prototype.not=function(a,i){return this.notation(a,i)},l.prototype.up=function(){return this.root()||this.documentObject},l}(c)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(C,D,T){"use strict";(function(){var A,O,f,p,c=function(n,o){function r(){this.constructor=n}for(var l in o)s.call(o,l)&&(n[l]=o[l]);return r.prototype=o.prototype,n.prototype=new r,n.__super__=o.prototype,n},s={}.hasOwnProperty;p=C("./Utility").isPlainObject,A=C("./XMLNode"),f=C("./XMLStringifier"),O=C("./XMLStringWriter"),D.exports=function(n){function o(r){o.__super__.constructor.call(this,null),r||(r={}),r.writer||(r.writer=new O),this.options=r,this.stringify=new f(r),this.isDocument=!0}return c(o,n),o.prototype.end=function(r){var l;return r?p(r)&&(l=r,r=this.options.writer.set(l)):r=this.options.writer,r.document(this)},o.prototype.toString=function(r){return this.options.writer.set(r).document(this)},o}(A)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n,o,r,l,a,i,t,d,v,y,b,g,m,_={}.hasOwnProperty;m=C("./Utility"),b=m.isObject,y=m.isFunction,g=m.isPlainObject,l=C("./XMLElement"),O=C("./XMLCData"),f=C("./XMLComment"),i=C("./XMLRaw"),v=C("./XMLText"),a=C("./XMLProcessingInstruction"),o=C("./XMLDeclaration"),r=C("./XMLDocType"),p=C("./XMLDTDAttList"),s=C("./XMLDTDEntity"),c=C("./XMLDTDElement"),n=C("./XMLDTDNotation"),A=C("./XMLAttribute"),d=C("./XMLStringifier"),t=C("./XMLStringWriter"),D.exports=function(){function x(h,E,S){var w;h||(h={}),h.writer?g(h.writer)&&(w=h.writer,h.writer=new t(w)):h.writer=new t(h),this.options=h,this.writer=h.writer,this.stringify=new d(h),this.onDataCallback=E||function(){},this.onEndCallback=S||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return x.prototype.node=function(h,E,S){var w;if(h==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(),h=h.valueOf(),E==null&&(E={}),E=E.valueOf(),b(E)||(w=[E,S],S=w[0],E=w[1]),this.currentNode=new l(this,h,E),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,S!=null&&this.text(S),this},x.prototype.element=function(h,E,S){return this.currentNode&&this.currentNode instanceof r?this.dtdElement.apply(this,arguments):this.node(h,E,S)},x.prototype.attribute=function(h,E){var S,w;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(h!=null&&(h=h.valueOf()),b(h))for(S in h)_.call(h,S)&&(w=h[S],this.attribute(S,w));else y(E)&&(E=E.apply()),this.options.skipNullAttributes&&E==null||(this.currentNode.attributes[h]=new A(this,h,E));return this},x.prototype.text=function(h){var E;return this.openCurrent(),E=new v(this,h),this.onData(this.writer.text(E,this.currentLevel+1)),this},x.prototype.cdata=function(h){var E;return this.openCurrent(),E=new O(this,h),this.onData(this.writer.cdata(E,this.currentLevel+1)),this},x.prototype.comment=function(h){var E;return this.openCurrent(),E=new f(this,h),this.onData(this.writer.comment(E,this.currentLevel+1)),this},x.prototype.raw=function(h){var E;return this.openCurrent(),E=new i(this,h),this.onData(this.writer.raw(E,this.currentLevel+1)),this},x.prototype.instruction=function(h,E){var S,w,R,N,F;if(this.openCurrent(),h!=null&&(h=h.valueOf()),E!=null&&(E=E.valueOf()),Array.isArray(h))for(S=0,N=h.length;S<N;S++)w=h[S],this.instruction(w);else if(b(h))for(w in h)_.call(h,w)&&(R=h[w],this.instruction(w,R));else y(E)&&(E=E.apply()),F=new a(this,h,E),this.onData(this.writer.processingInstruction(F,this.currentLevel+1));return this},x.prototype.declaration=function(h,E,S){var w;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return w=new o(this,h,E,S),this.onData(this.writer.declaration(w,this.currentLevel+1)),this},x.prototype.doctype=function(h,E,S){if(this.openCurrent(),h==null)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new r(this,E,S),this.currentNode.rootNodeName=h,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},x.prototype.dtdElement=function(h,E){var S;return this.openCurrent(),S=new c(this,h,E),this.onData(this.writer.dtdElement(S,this.currentLevel+1)),this},x.prototype.attList=function(h,E,S,w,R){var N;return this.openCurrent(),N=new p(this,h,E,S,w,R),this.onData(this.writer.dtdAttList(N,this.currentLevel+1)),this},x.prototype.entity=function(h,E){var S;return this.openCurrent(),S=new s(this,!1,h,E),this.onData(this.writer.dtdEntity(S,this.currentLevel+1)),this},x.prototype.pEntity=function(h,E){var S;return this.openCurrent(),S=new s(this,!0,h,E),this.onData(this.writer.dtdEntity(S,this.currentLevel+1)),this},x.prototype.notation=function(h,E){var S;return this.openCurrent(),S=new n(this,h,E),this.onData(this.writer.dtdNotation(S,this.currentLevel+1)),this},x.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},x.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},x.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},x.prototype.openNode=function(h){if(!h.isOpen)return!this.root&&this.currentLevel===0&&h instanceof l&&(this.root=h),this.onData(this.writer.openNode(h,this.currentLevel)),h.isOpen=!0},x.prototype.closeNode=function(h){if(!h.isClosed)return this.onData(this.writer.closeNode(h,this.currentLevel)),h.isClosed=!0},x.prototype.onData=function(h){return this.documentStarted=!0,this.onDataCallback(h)},x.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},x.prototype.ele=function(){return this.element.apply(this,arguments)},x.prototype.nod=function(h,E,S){return this.node(h,E,S)},x.prototype.txt=function(h){return this.text(h)},x.prototype.dat=function(h){return this.cdata(h)},x.prototype.com=function(h){return this.comment(h)},x.prototype.ins=function(h,E){return this.instruction(h,E)},x.prototype.dec=function(h,E,S){return this.declaration(h,E,S)},x.prototype.dtd=function(h,E,S){return this.doctype(h,E,S)},x.prototype.e=function(h,E,S){return this.element(h,E,S)},x.prototype.n=function(h,E,S){return this.node(h,E,S)},x.prototype.t=function(h){return this.text(h)},x.prototype.d=function(h){return this.cdata(h)},x.prototype.c=function(h){return this.comment(h)},x.prototype.r=function(h){return this.raw(h)},x.prototype.i=function(h,E){return this.instruction(h,E)},x.prototype.att=function(){return this.currentNode&&this.currentNode instanceof r?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.a=function(){return this.currentNode&&this.currentNode instanceof r?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},x.prototype.ent=function(h,E){return this.entity(h,E)},x.prototype.pent=function(h,E){return this.pEntity(h,E)},x.prototype.not=function(h,E){return this.notation(h,E)},x}()}).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(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p,c,s,n,o=function(l,a){function i(){this.constructor=l}for(var t in a)r.call(a,t)&&(l[t]=a[t]);return i.prototype=a.prototype,l.prototype=new i,l.__super__=a.prototype,l},r={}.hasOwnProperty;n=C("./Utility"),s=n.isObject,c=n.isFunction,p=C("./XMLNode"),f=C("./XMLAttribute"),D.exports=function(l){function a(i,t,d){if(a.__super__.constructor.call(this,i),t==null)throw new Error("Missing element name");this.name=this.stringify.eleName(t),this.attributes={},d!=null&&this.attribute(d),i.isDocument&&(this.isRoot=!0,this.documentObject=i,i.rootObject=this)}return o(a,l),a.prototype.clone=function(){var i,t,d,v;d=(0,O.default)(this),d.isRoot&&(d.documentObject=null),d.attributes={},v=this.attributes;for(t in v)r.call(v,t)&&(i=v[t],d.attributes[t]=i.clone());return d.children=[],this.children.forEach(function(y){var b;return b=y.clone(),b.parent=d,d.children.push(b)}),d},a.prototype.attribute=function(i,t){var d,v;if(i!=null&&(i=i.valueOf()),s(i))for(d in i)r.call(i,d)&&(v=i[d],this.attribute(d,v));else c(t)&&(t=t.apply()),this.options.skipNullAttributes&&t==null||(this.attributes[i]=new f(this,i,t));return this},a.prototype.removeAttribute=function(i){var t,d,v;if(i==null)throw new Error("Missing attribute name");if(i=i.valueOf(),Array.isArray(i))for(d=0,v=i.length;d<v;d++)t=i[d],delete this.attributes[t];else delete this.attributes[i];return this},a.prototype.toString=function(i){return this.options.writer.set(i).element(this)},a.prototype.att=function(i,t){return this.attribute(i,t)},a.prototype.a=function(i,t){return this.attribute(i,t)},a}(p)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n,o,r,l,a,i,t={}.hasOwnProperty;i=C("./Utility"),a=i.isObject,l=i.isFunction,r=i.isEmpty,c=null,A=null,O=null,f=null,p=null,n=null,o=null,s=null,D.exports=function(){function d(v){this.parent=v,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],c||(c=C("./XMLElement"),A=C("./XMLCData"),O=C("./XMLComment"),f=C("./XMLDeclaration"),p=C("./XMLDocType"),n=C("./XMLRaw"),o=C("./XMLText"),s=C("./XMLProcessingInstruction"))}return d.prototype.element=function(v,y,b){var g,m,_,x,h,E,S,w,R,N;if(E=null,y==null&&(y={}),y=y.valueOf(),a(y)||(R=[y,b],b=R[0],y=R[1]),v!=null&&(v=v.valueOf()),Array.isArray(v))for(_=0,S=v.length;_<S;_++)m=v[_],E=this.element(m);else if(l(v))E=this.element(v.apply());else if(a(v)){for(h in v)if(t.call(v,h))if(N=v[h],l(N)&&(N=N.apply()),a(N)&&r(N)&&(N=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0)E=this.attribute(h.substr(this.stringify.convertAttKey.length),N);else if(!this.options.separateArrayItems&&Array.isArray(N))for(x=0,w=N.length;x<w;x++)m=N[x],g={},g[h]=m,E=this.element(g);else a(N)?(E=this.element(h),E.element(N)):E=this.element(h,N)}else E=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&v.indexOf(this.stringify.convertTextKey)===0?this.text(b):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&v.indexOf(this.stringify.convertCDataKey)===0?this.cdata(b):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&v.indexOf(this.stringify.convertCommentKey)===0?this.comment(b):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&v.indexOf(this.stringify.convertRawKey)===0?this.raw(b):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&v.indexOf(this.stringify.convertPIKey)===0?this.instruction(v.substr(this.stringify.convertPIKey.length),b):this.node(v,y,b);if(E==null)throw new Error("Could not create any elements with: "+v);return E},d.prototype.insertBefore=function(v,y,b){var g,m,_;if(this.isRoot)throw new Error("Cannot insert elements at root level");return m=this.parent.children.indexOf(this),_=this.parent.children.splice(m),g=this.parent.element(v,y,b),Array.prototype.push.apply(this.parent.children,_),g},d.prototype.insertAfter=function(v,y,b){var g,m,_;if(this.isRoot)throw new Error("Cannot insert elements at root level");return m=this.parent.children.indexOf(this),_=this.parent.children.splice(m+1),g=this.parent.element(v,y,b),Array.prototype.push.apply(this.parent.children,_),g},d.prototype.remove=function(){var v;if(this.isRoot)throw new Error("Cannot remove the root element");return v=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[v,v-v+1].concat([])),this.parent},d.prototype.node=function(v,y,b){var g,m;return v!=null&&(v=v.valueOf()),y||(y={}),y=y.valueOf(),a(y)||(m=[y,b],b=m[0],y=m[1]),g=new c(this,v,y),b!=null&&g.text(b),this.children.push(g),g},d.prototype.text=function(v){var y;return y=new o(this,v),this.children.push(y),this},d.prototype.cdata=function(v){var y;return y=new A(this,v),this.children.push(y),this},d.prototype.comment=function(v){var y;return y=new O(this,v),this.children.push(y),this},d.prototype.commentBefore=function(v){var y,b;return y=this.parent.children.indexOf(this),b=this.parent.children.splice(y),this.parent.comment(v),Array.prototype.push.apply(this.parent.children,b),this},d.prototype.commentAfter=function(v){var y,b;return y=this.parent.children.indexOf(this),b=this.parent.children.splice(y+1),this.parent.comment(v),Array.prototype.push.apply(this.parent.children,b),this},d.prototype.raw=function(v){var y;return y=new n(this,v),this.children.push(y),this},d.prototype.instruction=function(v,y){var b,g,m,_,x;if(v!=null&&(v=v.valueOf()),y!=null&&(y=y.valueOf()),Array.isArray(v))for(_=0,x=v.length;_<x;_++)b=v[_],this.instruction(b);else if(a(v))for(b in v)t.call(v,b)&&(g=v[b],this.instruction(b,g));else l(y)&&(y=y.apply()),m=new s(this,v,y),this.children.push(m);return this},d.prototype.instructionBefore=function(v,y){var b,g;return b=this.parent.children.indexOf(this),g=this.parent.children.splice(b),this.parent.instruction(v,y),Array.prototype.push.apply(this.parent.children,g),this},d.prototype.instructionAfter=function(v,y){var b,g;return b=this.parent.children.indexOf(this),g=this.parent.children.splice(b+1),this.parent.instruction(v,y),Array.prototype.push.apply(this.parent.children,g),this},d.prototype.declaration=function(v,y,b){var g,m;return g=this.document(),m=new f(g,v,y,b),g.children[0]instanceof f?g.children[0]=m:g.children.unshift(m),g.root()||g},d.prototype.doctype=function(v,y){var b,g,m,_,x,h,E,S,w,R;for(g=this.document(),m=new p(g,v,y),w=g.children,_=x=0,E=w.length;x<E;_=++x)if((b=w[_])instanceof p)return g.children[_]=m,m;for(R=g.children,_=h=0,S=R.length;h<S;_=++h)if(b=R[_],b.isRoot)return g.children.splice(_,0,m),m;return g.children.push(m),m},d.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},d.prototype.root=function(){var v;for(v=this;v;){if(v.isDocument)return v.rootObject;if(v.isRoot)return v;v=v.parent}},d.prototype.document=function(){var v;for(v=this;v;){if(v.isDocument)return v;v=v.parent}},d.prototype.end=function(v){return this.document().end(v)},d.prototype.prev=function(){var v;if((v=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[v-1]},d.prototype.next=function(){var v;if((v=this.parent.children.indexOf(this))===-1||v===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[v+1]},d.prototype.importDocument=function(v){var y;return y=v.root().clone(),y.parent=this,y.isRoot=!1,this.children.push(y),this},d.prototype.ele=function(v,y,b){return this.element(v,y,b)},d.prototype.nod=function(v,y,b){return this.node(v,y,b)},d.prototype.txt=function(v){return this.text(v)},d.prototype.dat=function(v){return this.cdata(v)},d.prototype.com=function(v){return this.comment(v)},d.prototype.ins=function(v,y){return this.instruction(v,y)},d.prototype.doc=function(){return this.document()},d.prototype.dec=function(v,y,b){return this.declaration(v,y,b)},d.prototype.dtd=function(v,y){return this.doctype(v,y)},d.prototype.e=function(v,y,b){return this.element(v,y,b)},d.prototype.n=function(v,y,b){return this.node(v,y,b)},d.prototype.t=function(v){return this.text(v)},d.prototype.d=function(v){return this.cdata(v)},d.prototype.c=function(v){return this.comment(v)},d.prototype.r=function(v){return this.raw(v)},d.prototype.i=function(v,y){return this.instruction(v,y)},d.prototype.u=function(){return this.up()},d.prototype.importXMLBuilder=function(v){return this.importDocument(v)},d}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[function(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p=function(s,n){function o(){this.constructor=s}for(var r in n)c.call(n,r)&&(s[r]=n[r]);return o.prototype=n.prototype,s.prototype=new o,s.__super__=n.prototype,s},c={}.hasOwnProperty;f=C("./XMLNode"),D.exports=function(s){function n(o,r,l){if(n.__super__.constructor.call(this,o),r==null)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(r),l&&(this.value=this.stringify.insValue(l))}return p(n,s),n.prototype.clone=function(){return(0,O.default)(this)},n.prototype.toString=function(o){return this.options.writer.set(o).processingInstruction(this)},n}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[function(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p=function(s,n){function o(){this.constructor=s}for(var r in n)c.call(n,r)&&(s[r]=n[r]);return o.prototype=n.prototype,s.prototype=new o,s.__super__=n.prototype,s},c={}.hasOwnProperty;f=C("./XMLNode"),D.exports=function(s){function n(o,r){if(n.__super__.constructor.call(this,o),r==null)throw new Error("Missing raw text");this.value=this.stringify.raw(r)}return p(n,s),n.prototype.clone=function(){return(0,O.default)(this)},n.prototype.toString=function(o){return this.options.writer.set(o).raw(this)},n}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n,o,r,l,a,i,t,d=function(y,b){function g(){this.constructor=y}for(var m in b)v.call(b,m)&&(y[m]=b[m]);return g.prototype=b.prototype,y.prototype=new g,y.__super__=b.prototype,y},v={}.hasOwnProperty;n=C("./XMLDeclaration"),o=C("./XMLDocType"),A=C("./XMLCData"),O=C("./XMLComment"),r=C("./XMLElement"),a=C("./XMLRaw"),i=C("./XMLText"),l=C("./XMLProcessingInstruction"),f=C("./XMLDTDAttList"),p=C("./XMLDTDElement"),c=C("./XMLDTDEntity"),s=C("./XMLDTDNotation"),t=C("./XMLWriterBase"),D.exports=function(y){function b(g,m){b.__super__.constructor.call(this,m),this.stream=g}return d(b,y),b.prototype.document=function(g){var m,_,x,h,E,S,w,R;for(S=g.children,_=0,h=S.length;_<h;_++)m=S[_],m.isLastRootNode=!1;for(g.children[g.children.length-1].isLastRootNode=!0,w=g.children,R=[],x=0,E=w.length;x<E;x++)switch(m=w[x],!1){case!(m instanceof n):R.push(this.declaration(m));break;case!(m instanceof o):R.push(this.docType(m));break;case!(m instanceof O):R.push(this.comment(m));break;case!(m instanceof l):R.push(this.processingInstruction(m));break;default:R.push(this.element(m))}return R},b.prototype.attribute=function(g){return this.stream.write(" "+g.name+'="'+g.value+'"')},b.prototype.cdata=function(g,m){return this.stream.write(this.space(m)+"<![CDATA["+g.text+"]]>"+this.endline(g))},b.prototype.comment=function(g,m){return this.stream.write(this.space(m)+"<!-- "+g.text+" -->"+this.endline(g))},b.prototype.declaration=function(g,m){return this.stream.write(this.space(m)),this.stream.write('<?xml version="'+g.version+'"'),g.encoding!=null&&this.stream.write(' encoding="'+g.encoding+'"'),g.standalone!=null&&this.stream.write(' standalone="'+g.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(g))},b.prototype.docType=function(g,m){var _,x,h,E;if(m||(m=0),this.stream.write(this.space(m)),this.stream.write("<!DOCTYPE "+g.root().name),g.pubID&&g.sysID?this.stream.write(' PUBLIC "'+g.pubID+'" "'+g.sysID+'"'):g.sysID&&this.stream.write(' SYSTEM "'+g.sysID+'"'),g.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(g)),E=g.children,x=0,h=E.length;x<h;x++)switch(_=E[x],!1){case!(_ instanceof f):this.dtdAttList(_,m+1);break;case!(_ instanceof p):this.dtdElement(_,m+1);break;case!(_ instanceof c):this.dtdEntity(_,m+1);break;case!(_ instanceof s):this.dtdNotation(_,m+1);break;case!(_ instanceof A):this.cdata(_,m+1);break;case!(_ instanceof O):this.comment(_,m+1);break;case!(_ instanceof l):this.processingInstruction(_,m+1);break;default:throw new Error("Unknown DTD node type: "+_.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(g))},b.prototype.element=function(g,m){var _,x,h,E,S,w,R,N;m||(m=0),N=this.space(m),this.stream.write(N+"<"+g.name),w=g.attributes;for(S in w)v.call(w,S)&&(_=w[S],this.attribute(_));if(g.children.length===0||g.children.every(function(F){return F.value===""}))this.allowEmpty?this.stream.write("></"+g.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&g.children.length===1&&g.children[0].value!=null)this.stream.write(">"),this.stream.write(g.children[0].value),this.stream.write("</"+g.name+">");else{for(this.stream.write(">"+this.newline),R=g.children,h=0,E=R.length;h<E;h++)switch(x=R[h],!1){case!(x instanceof A):this.cdata(x,m+1);break;case!(x instanceof O):this.comment(x,m+1);break;case!(x instanceof r):this.element(x,m+1);break;case!(x instanceof a):this.raw(x,m+1);break;case!(x instanceof i):this.text(x,m+1);break;case!(x instanceof l):this.processingInstruction(x,m+1);break;default:throw new Error("Unknown XML node type: "+x.constructor.name)}this.stream.write(N+"</"+g.name+">")}return this.stream.write(this.endline(g))},b.prototype.processingInstruction=function(g,m){return this.stream.write(this.space(m)+"<?"+g.target),g.value&&this.stream.write(" "+g.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(g))},b.prototype.raw=function(g,m){return this.stream.write(this.space(m)+g.value+this.endline(g))},b.prototype.text=function(g,m){return this.stream.write(this.space(m)+g.value+this.endline(g))},b.prototype.dtdAttList=function(g,m){return this.stream.write(this.space(m)+"<!ATTLIST "+g.elementName+" "+g.attributeName+" "+g.attributeType),g.defaultValueType!=="#DEFAULT"&&this.stream.write(" "+g.defaultValueType),g.defaultValue&&this.stream.write(' "'+g.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(g))},b.prototype.dtdElement=function(g,m){return this.stream.write(this.space(m)+"<!ELEMENT "+g.name+" "+g.value),this.stream.write(this.spacebeforeslash+">"+this.endline(g))},b.prototype.dtdEntity=function(g,m){return this.stream.write(this.space(m)+"<!ENTITY"),g.pe&&this.stream.write(" %"),this.stream.write(" "+g.name),g.value?this.stream.write(' "'+g.value+'"'):(g.pubID&&g.sysID?this.stream.write(' PUBLIC "'+g.pubID+'" "'+g.sysID+'"'):g.sysID&&this.stream.write(' SYSTEM "'+g.sysID+'"'),g.nData&&this.stream.write(" NDATA "+g.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(g))},b.prototype.dtdNotation=function(g,m){return this.stream.write(this.space(m)+"<!NOTATION "+g.name),g.pubID&&g.sysID?this.stream.write(' PUBLIC "'+g.pubID+'" "'+g.sysID+'"'):g.pubID?this.stream.write(' PUBLIC "'+g.pubID+'"'):g.sysID&&this.stream.write(' SYSTEM "'+g.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(g))},b.prototype.endline=function(g){return g.isLastRootNode?"":this.newline},b}(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(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n,o,r,l,a,i,t,d=function(y,b){function g(){this.constructor=y}for(var m in b)v.call(b,m)&&(y[m]=b[m]);return g.prototype=b.prototype,y.prototype=new g,y.__super__=b.prototype,y},v={}.hasOwnProperty;n=C("./XMLDeclaration"),o=C("./XMLDocType"),A=C("./XMLCData"),O=C("./XMLComment"),r=C("./XMLElement"),a=C("./XMLRaw"),i=C("./XMLText"),l=C("./XMLProcessingInstruction"),f=C("./XMLDTDAttList"),p=C("./XMLDTDElement"),c=C("./XMLDTDEntity"),s=C("./XMLDTDNotation"),t=C("./XMLWriterBase"),D.exports=function(y){function b(g){b.__super__.constructor.call(this,g)}return d(b,y),b.prototype.document=function(g){var m,_,x,h,E;for(this.textispresent=!1,h="",E=g.children,_=0,x=E.length;_<x;_++)m=E[_],h+=function(){switch(!1){case!(m instanceof n):return this.declaration(m);case!(m instanceof o):return this.docType(m);case!(m instanceof O):return this.comment(m);case!(m instanceof l):return this.processingInstruction(m);default:return this.element(m,0)}}.call(this);return this.pretty&&h.slice(-this.newline.length)===this.newline&&(h=h.slice(0,-this.newline.length)),h},b.prototype.attribute=function(g){return" "+g.name+'="'+g.value+'"'},b.prototype.cdata=function(g,m){return this.space(m)+"<![CDATA["+g.text+"]]>"+this.newline},b.prototype.comment=function(g,m){return this.space(m)+"<!-- "+g.text+" -->"+this.newline},b.prototype.declaration=function(g,m){var _;return _=this.space(m),_+='<?xml version="'+g.version+'"',g.encoding!=null&&(_+=' encoding="'+g.encoding+'"'),g.standalone!=null&&(_+=' standalone="'+g.standalone+'"'),_+=this.spacebeforeslash+"?>",_+=this.newline},b.prototype.docType=function(g,m){var _,x,h,E,S;if(m||(m=0),E=this.space(m),E+="<!DOCTYPE "+g.root().name,g.pubID&&g.sysID?E+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.sysID&&(E+=' SYSTEM "'+g.sysID+'"'),g.children.length>0){for(E+=" [",E+=this.newline,S=g.children,x=0,h=S.length;x<h;x++)_=S[x],E+=function(){switch(!1){case!(_ instanceof f):return this.dtdAttList(_,m+1);case!(_ instanceof p):return this.dtdElement(_,m+1);case!(_ instanceof c):return this.dtdEntity(_,m+1);case!(_ instanceof s):return this.dtdNotation(_,m+1);case!(_ instanceof A):return this.cdata(_,m+1);case!(_ instanceof O):return this.comment(_,m+1);case!(_ instanceof l):return this.processingInstruction(_,m+1);default:throw new Error("Unknown DTD node type: "+_.constructor.name)}}.call(this);E+="]"}return E+=this.spacebeforeslash+">",E+=this.newline},b.prototype.element=function(g,m){var _,x,h,E,S,w,R,N,F,z,q,B,M;m||(m=0),M=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),B=this.space(m),N="",N+=B+"<"+g.name,F=g.attributes;for(R in F)v.call(F,R)&&(_=F[R],N+=this.attribute(_));if(g.children.length===0||g.children.every(function(G){return G.value===""}))this.allowEmpty?N+="></"+g.name+">"+this.newline:N+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&g.children.length===1&&g.children[0].value!=null)N+=">",N+=g.children[0].value,N+="</"+g.name+">"+this.newline;else{if(this.dontprettytextnodes){for(z=g.children,h=0,S=z.length;h<S;h++)if(x=z[h],x.value!=null){this.textispresent++,M=!0;break}}for(this.textispresent&&(this.newline="",this.pretty=!1,B=this.space(m)),N+=">"+this.newline,q=g.children,E=0,w=q.length;E<w;E++)x=q[E],N+=function(){switch(!1){case!(x instanceof A):return this.cdata(x,m+1);case!(x instanceof O):return this.comment(x,m+1);case!(x instanceof r):return this.element(x,m+1);case!(x instanceof a):return this.raw(x,m+1);case!(x instanceof i):return this.text(x,m+1);case!(x instanceof l):return this.processingInstruction(x,m+1);default:throw new Error("Unknown XML node type: "+x.constructor.name)}}.call(this);M&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),N+=B+"</"+g.name+">"+this.newline}return N},b.prototype.processingInstruction=function(g,m){var _;return _=this.space(m)+"<?"+g.target,g.value&&(_+=" "+g.value),_+=this.spacebeforeslash+"?>"+this.newline},b.prototype.raw=function(g,m){return this.space(m)+g.value+this.newline},b.prototype.text=function(g,m){return this.space(m)+g.value+this.newline},b.prototype.dtdAttList=function(g,m){var _;return _=this.space(m)+"<!ATTLIST "+g.elementName+" "+g.attributeName+" "+g.attributeType,g.defaultValueType!=="#DEFAULT"&&(_+=" "+g.defaultValueType),g.defaultValue&&(_+=' "'+g.defaultValue+'"'),_+=this.spacebeforeslash+">"+this.newline},b.prototype.dtdElement=function(g,m){return this.space(m)+"<!ELEMENT "+g.name+" "+g.value+this.spacebeforeslash+">"+this.newline},b.prototype.dtdEntity=function(g,m){var _;return _=this.space(m)+"<!ENTITY",g.pe&&(_+=" %"),_+=" "+g.name,g.value?_+=' "'+g.value+'"':(g.pubID&&g.sysID?_+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.sysID&&(_+=' SYSTEM "'+g.sysID+'"'),g.nData&&(_+=" NDATA "+g.nData)),_+=this.spacebeforeslash+">"+this.newline},b.prototype.dtdNotation=function(g,m){var _;return _=this.space(m)+"<!NOTATION "+g.name,g.pubID&&g.sysID?_+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.pubID?_+=' PUBLIC "'+g.pubID+'"':g.sysID&&(_+=' SYSTEM "'+g.sysID+'"'),_+=this.spacebeforeslash+">"+this.newline},b.prototype.openNode=function(g,m){var _,x,h,E;if(m||(m=0),g instanceof r){h=this.space(m)+"<"+g.name,E=g.attributes;for(x in E)v.call(E,x)&&(_=E[x],h+=this.attribute(_));return h+=(g.children?">":"/>")+this.newline}return h=this.space(m)+"<!DOCTYPE "+g.rootNodeName,g.pubID&&g.sysID?h+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.sysID&&(h+=' SYSTEM "'+g.sysID+'"'),h+=(g.children?" [":">")+this.newline},b.prototype.closeNode=function(g,m){switch(m||(m=0),!1){case!(g instanceof r):return this.space(m)+"</"+g.name+">"+this.newline;case!(g instanceof o):return this.space(m)+"]>"+this.newline}},b}(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(C,D,T){"use strict";(function(){var A=function(f,p){return function(){return f.apply(p,arguments)}},O={}.hasOwnProperty;D.exports=function(){function f(p){this.assertLegalChar=A(this.assertLegalChar,this);var c,s,n;p||(p={}),this.noDoubleEncoding=p.noDoubleEncoding,s=p.stringify||{};for(c in s)O.call(s,c)&&(n=s[c],this[c]=n)}return f.prototype.eleName=function(p){return p=""+p||"",this.assertLegalChar(p)},f.prototype.eleText=function(p){return p=""+p||"",this.assertLegalChar(this.elEscape(p))},f.prototype.cdata=function(p){return p=""+p||"",p=p.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(p)},f.prototype.comment=function(p){if(p=""+p||"",p.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+p);return this.assertLegalChar(p)},f.prototype.raw=function(p){return""+p||""},f.prototype.attName=function(p){return p=""+p||""},f.prototype.attValue=function(p){return p=""+p||"",this.attEscape(p)},f.prototype.insTarget=function(p){return""+p||""},f.prototype.insValue=function(p){if(p=""+p||"",p.match(/\?>/))throw new Error("Invalid processing instruction value: "+p);return p},f.prototype.xmlVersion=function(p){if(p=""+p||"",!p.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+p);return p},f.prototype.xmlEncoding=function(p){if(p=""+p||"",!p.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+p);return p},f.prototype.xmlStandalone=function(p){return p?"yes":"no"},f.prototype.dtdPubID=function(p){return""+p||""},f.prototype.dtdSysID=function(p){return""+p||""},f.prototype.dtdElementValue=function(p){return""+p||""},f.prototype.dtdAttType=function(p){return""+p||""},f.prototype.dtdAttDefault=function(p){return p!=null?""+p||"":p},f.prototype.dtdEntityValue=function(p){return""+p||""},f.prototype.dtdNData=function(p){return""+p||""},f.prototype.convertAttKey="@",f.prototype.convertPIKey="?",f.prototype.convertTextKey="#text",f.prototype.convertCDataKey="#cdata",f.prototype.convertCommentKey="#comment",f.prototype.convertRawKey="#raw",f.prototype.assertLegalChar=function(p){var c;if(c=p.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+p+" at index "+c.index);return p},f.prototype.elEscape=function(p){var c;return c=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(c,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")},f.prototype.attEscape=function(p){var c;return c=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,p.replace(c,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")},f}()}).call(void 0)},{}],233:[function(C,D,T){"use strict";var A=C("babel-runtime/core-js/object/create"),O=function(f){return f&&f.__esModule?f:{default:f}}(A);(function(){var f,p=function(s,n){function o(){this.constructor=s}for(var r in n)c.call(n,r)&&(s[r]=n[r]);return o.prototype=n.prototype,s.prototype=new o,s.__super__=n.prototype,s},c={}.hasOwnProperty;f=C("./XMLNode"),D.exports=function(s){function n(o,r){if(n.__super__.constructor.call(this,o),r==null)throw new Error("Missing element text");this.value=this.stringify.eleText(r)}return p(n,s),n.prototype.clone=function(){return(0,O.default)(this)},n.prototype.toString=function(o){return this.options.writer.set(o).text(this)},n}(f)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(C,D,T){"use strict";(function(){var A={}.hasOwnProperty;D.exports=function(){function O(f){var p,c,s,n,o,r,l,a,i;f||(f={}),this.pretty=f.pretty||!1,this.allowEmpty=(c=f.allowEmpty)!=null&&c,this.pretty?(this.indent=(s=f.indent)!=null?s:" ",this.newline=(n=f.newline)!=null?n:`
|
|
|
`,this.offset=(o=f.offset)!=null?o:0,this.dontprettytextnodes=(r=f.dontprettytextnodes)!=null?r:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=(l=f.spacebeforeslash)!=null?l:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,a=f.writer||{};for(p in a)A.call(a,p)&&(i=a[p],this[p]=i)}return O.prototype.set=function(f){var p,c,s;f||(f={}),"pretty"in f&&(this.pretty=f.pretty),"allowEmpty"in f&&(this.allowEmpty=f.allowEmpty),this.pretty?(this.indent="indent"in f?f.indent:" ",this.newline="newline"in f?f.newline:`
|
|
|
`,this.offset="offset"in f?f.offset:0,this.dontprettytextnodes="dontprettytextnodes"in f?f.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in f?f.spacebeforeslash:"",this.spacebeforeslash===!0&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,c=f.writer||{};for(p in c)A.call(c,p)&&(s=c[p],this[p]=s);return this},O.prototype.space=function(f){var p;return this.pretty?(p=(f||0)+this.offset+1,p>0?new Array(p).join(this.indent):""):""},O}()}).call(void 0)},{}],235:[function(C,D,T){"use strict";(function(){var A,O,f,p,c,s,n;n=C("./Utility"),c=n.assign,s=n.isFunction,A=C("./XMLDocument"),O=C("./XMLDocumentCB"),p=C("./XMLStringWriter"),f=C("./XMLStreamWriter"),D.exports.create=function(o,r,l,a){var i,t;if(o==null)throw new Error("Root element needs a name");return a=c({},r,l,a),i=new A(a),t=i.element(o),a.headless||(i.declaration(a),a.pubID==null&&a.sysID==null||i.doctype(a)),t},D.exports.begin=function(o,r,l){var a;return s(o)&&(a=[o,r],r=a[0],l=a[1],o={}),r?new O(o,r,l):new A(o)},D.exports.stringWriter=function(o){return new p(o)},D.exports.streamWriter=function(o,r){return new f(o,r)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(C,D,T){function A(){for(var f={},p=0;p<arguments.length;p++){var c=arguments[p];for(var s in c)O.call(c,s)&&(f[s]=c[s])}return f}D.exports=A;var O=Object.prototype.hasOwnProperty},{}],237:[function(C,D,T){"use strict";function A(a,i,t){p.isBuffer(i)||(i=new p(i)),p.isBuffer(t)||(t=new p(t)),i.length>r?i=a(i):i.length<r&&(i=p.concat([i,l],r));for(var d=new p(r),v=new p(r),y=0;y<r;y++)d[y]=54^i[y],v[y]=92^i[y];var b=a(p.concat([d,t]));return a(p.concat([v,b]))}function O(a,i){a=a||"sha1";var t=o[a],d=[],v=0;return t||f("algorithm:",a,"is not yet supported"),{update:function(y){return p.isBuffer(y)||(y=new p(y)),d.push(y),v+=y.length,this},digest:function(y){var b=p.concat(d),g=i?A(t,i,b):t(b);return d=null,y?g.toString(y):g}}}function f(){var a=[].slice.call(arguments).join(" ");throw new Error([a,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
|
`))}var p=C("buffer").Buffer,c=C("./sha"),s=C("./sha256"),n=C("./md5"),o={sha1:c,sha256:s,md5:n},r=64,l=new p(r);l.fill(0),T.createHash=function(a){return O(a)},T.createHmac=function(a,i){return O(a,i)},function(a,i){for(var t in a)i(a[t],t)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(a){T[a]=function(){f("sorry,",a,"is not implemented yet")}})},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(C,D,T){"use strict";function A(o,r){if(o.length%c!=0){var l=o.length+(c-o.length%c);o=p.concat([o,s],l)}for(var a=[],i=r?o.readInt32BE:o.readInt32LE,t=0;t<o.length;t+=c)a.push(i.call(o,t));return a}function O(o,r,l){for(var a=new p(r),i=l?a.writeInt32BE:a.writeInt32LE,t=0;t<o.length;t++)i.call(a,o[t],4*t,!0);return a}function f(o,r,l,a){return p.isBuffer(o)||(o=new p(o)),O(r(A(o,a),o.length*n),l,a)}var p=C("buffer").Buffer,c=4,s=new p(c);s.fill(0);var n=8;D.exports={hash:f}},{buffer:38}],239:[function(C,D,T){"use strict";function A(l,a){l[a>>5]|=128<<a%32,l[14+(a+64>>>9<<4)]=a;for(var i=1732584193,t=-271733879,d=-1732584194,v=271733878,y=0;y<l.length;y+=16){var b=i,g=t,m=d,_=v;i=f(i,t,d,v,l[y+0],7,-680876936),v=f(v,i,t,d,l[y+1],12,-389564586),d=f(d,v,i,t,l[y+2],17,606105819),t=f(t,d,v,i,l[y+3],22,-1044525330),i=f(i,t,d,v,l[y+4],7,-176418897),v=f(v,i,t,d,l[y+5],12,1200080426),d=f(d,v,i,t,l[y+6],17,-1473231341),t=f(t,d,v,i,l[y+7],22,-45705983),i=f(i,t,d,v,l[y+8],7,1770035416),v=f(v,i,t,d,l[y+9],12,-1958414417),d=f(d,v,i,t,l[y+10],17,-42063),t=f(t,d,v,i,l[y+11],22,-1990404162),i=f(i,t,d,v,l[y+12],7,1804603682),v=f(v,i,t,d,l[y+13],12,-40341101),d=f(d,v,i,t,l[y+14],17,-1502002290),t=f(t,d,v,i,l[y+15],22,1236535329),i=p(i,t,d,v,l[y+1],5,-165796510),v=p(v,i,t,d,l[y+6],9,-1069501632),d=p(d,v,i,t,l[y+11],14,643717713),t=p(t,d,v,i,l[y+0],20,-373897302),i=p(i,t,d,v,l[y+5],5,-701558691),v=p(v,i,t,d,l[y+10],9,38016083),d=p(d,v,i,t,l[y+15],14,-660478335),t=p(t,d,v,i,l[y+4],20,-405537848),i=p(i,t,d,v,l[y+9],5,568446438),v=p(v,i,t,d,l[y+14],9,-1019803690),d=p(d,v,i,t,l[y+3],14,-187363961),t=p(t,d,v,i,l[y+8],20,1163531501),i=p(i,t,d,v,l[y+13],5,-1444681467),v=p(v,i,t,d,l[y+2],9,-51403784),d=p(d,v,i,t,l[y+7],14,1735328473),t=p(t,d,v,i,l[y+12],20,-1926607734),i=c(i,t,d,v,l[y+5],4,-378558),v=c(v,i,t,d,l[y+8],11,-2022574463),d=c(d,v,i,t,l[y+11],16,1839030562),t=c(t,d,v,i,l[y+14],23,-35309556),i=c(i,t,d,v,l[y+1],4,-1530992060),v=c(v,i,t,d,l[y+4],11,1272893353),d=c(d,v,i,t,l[y+7],16,-155497632),t=c(t,d,v,i,l[y+10],23,-1094730640),i=c(i,t,d,v,l[y+13],4,681279174),v=c(v,i,t,d,l[y+0],11,-358537222),d=c(d,v,i,t,l[y+3],16,-722521979),t=c(t,d,v,i,l[y+6],23,76029189),i=c(i,t,d,v,l[y+9],4,-640364487),v=c(v,i,t,d,l[y+12],11,-421815835),d=c(d,v,i,t,l[y+15],16,530742520),t=c(t,d,v,i,l[y+2],23,-995338651),i=s(i,t,d,v,l[y+0],6,-198630844),v=s(v,i,t,d,l[y+7],10,1126891415),d=s(d,v,i,t,l[y+14],15,-1416354905),t=s(t,d,v,i,l[y+5],21,-57434055),i=s(i,t,d,v,l[y+12],6,1700485571),v=s(v,i,t,d,l[y+3],10,-1894986606),d=s(d,v,i,t,l[y+10],15,-1051523),t=s(t,d,v,i,l[y+1],21,-2054922799),i=s(i,t,d,v,l[y+8],6,1873313359),v=s(v,i,t,d,l[y+15],10,-30611744),d=s(d,v,i,t,l[y+6],15,-1560198380),t=s(t,d,v,i,l[y+13],21,1309151649),i=s(i,t,d,v,l[y+4],6,-145523070),v=s(v,i,t,d,l[y+11],10,-1120210379),d=s(d,v,i,t,l[y+2],15,718787259),t=s(t,d,v,i,l[y+9],21,-343485551),i=n(i,b),t=n(t,g),d=n(d,m),v=n(v,_)}return Array(i,t,d,v)}function O(l,a,i,t,d,v){return n(o(n(n(a,l),n(t,v)),d),i)}function f(l,a,i,t,d,v,y){return O(a&i|~a&t,l,a,d,v,y)}function p(l,a,i,t,d,v,y){return O(a&t|i&~t,l,a,d,v,y)}function c(l,a,i,t,d,v,y){return O(a^i^t,l,a,d,v,y)}function s(l,a,i,t,d,v,y){return O(i^(a|~t),l,a,d,v,y)}function n(l,a){var i=(65535&l)+(65535&a);return(l>>16)+(a>>16)+(i>>16)<<16|65535&i}function o(l,a){return l<<a|l>>>32-a}var r=C("./helpers");D.exports=function(l){return r.hash(l,A,16)}},{"./helpers":238}],240:[function(C,D,T){"use strict";function A(n,o){n[o>>5]|=128<<24-o%32,n[15+(o+64>>9<<4)]=o;for(var r=Array(80),l=1732584193,a=-271733879,i=-1732584194,t=271733878,d=-1009589776,v=0;v<n.length;v+=16){for(var y=l,b=a,g=i,m=t,_=d,x=0;x<80;x++){r[x]=x<16?n[v+x]:c(r[x-3]^r[x-8]^r[x-14]^r[x-16],1);var h=p(p(c(l,5),O(x,a,i,t)),p(p(d,r[x]),f(x)));d=t,t=i,i=c(a,30),a=l,l=h}l=p(l,y),a=p(a,b),i=p(i,g),t=p(t,m),d=p(d,_)}return Array(l,a,i,t,d)}function O(n,o,r,l){return n<20?o&r|~o&l:n<40?o^r^l:n<60?o&r|o&l|r&l:o^r^l}function f(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function p(n,o){var r=(65535&n)+(65535&o);return(n>>16)+(o>>16)+(r>>16)<<16|65535&r}function c(n,o){return n<<o|n>>>32-o}var s=C("./helpers");D.exports=function(n){return s.hash(n,A,20,!0)}},{"./helpers":238}],241:[function(C,D,T){"use strict";var A=C("./helpers"),O=function(i,t){var d=(65535&i)+(65535&t);return(i>>16)+(t>>16)+(d>>16)<<16|65535&d},f=function(i,t){return i>>>t|i<<32-t},p=function(i,t){return i>>>t},c=function(i,t,d){return i&t^~i&d},s=function(i,t,d){return i&t^i&d^t&d},n=function(i){return f(i,2)^f(i,13)^f(i,22)},o=function(i){return f(i,6)^f(i,11)^f(i,25)},r=function(i){return f(i,7)^f(i,18)^p(i,3)},l=function(i){return f(i,17)^f(i,19)^p(i,10)},a=function(i,t){var d,v,y,b,g,m,_,x,h,E,S,w,R=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),N=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),F=new Array(64);i[t>>5]|=128<<24-t%32,i[15+(t+64>>9<<4)]=t;for(var h=0;h<i.length;h+=16){d=N[0],v=N[1],y=N[2],b=N[3],g=N[4],m=N[5],_=N[6],x=N[7];for(var E=0;E<64;E++)F[E]=E<16?i[E+h]:O(O(O(l(F[E-2]),F[E-7]),r(F[E-15])),F[E-16]),S=O(O(O(O(x,o(g)),c(g,m,_)),R[E]),F[E]),w=O(n(d),s(d,v,y)),x=_,_=m,m=g,g=O(b,S),b=y,y=v,v=d,d=O(S,w);N[0]=O(d,N[0]),N[1]=O(v,N[1]),N[2]=O(y,N[2]),N[3]=O(b,N[3]),N[4]=O(g,N[4]),N[5]=O(m,N[5]),N[6]=O(_,N[6]),N[7]=O(x,N[7])}return N};D.exports=function(i){return A.hash(i,a,32,!0)}},{"./helpers":238}],242:[function(C,D,T){(function(A){"use strict";function O(a){return a&&a.__esModule?a:{default:a}}var f=C("babel-runtime/core-js/object/create"),p=O(f),c=C("babel-runtime/helpers/classCallCheck"),s=O(c),n=C("babel-runtime/helpers/createClass"),o=O(n),r=C("babel-runtime/helpers/typeof"),l=O(r);!function(a){if((T===void 0?"undefined":(0,l.default)(T))==="object"&&D!==void 0)D.exports=a();else if(typeof W=="function"&&W.amd)W([],a);else{var i;i=typeof window!="undefined"?window:A!==void 0?A:typeof self!="undefined"?self:this,i.mime=a()}}(function(){return function a(i,t,d){function v(g,m){if(!t[g]){if(!i[g]){var _=typeof C=="function"&&C;if(!m&&_)return _(g,!0);if(y)return y(g,!0);var x=new Error("Cannot find module '"+g+"'");throw x.code="MODULE_NOT_FOUND",x}var h=t[g]={exports:{}};i[g][0].call(h.exports,function(E){var S=i[g][1][E];return v(S||E)},h,h.exports,a,i,t,d)}return t[g].exports}for(var y=typeof C=="function"&&C,b=0;b<d.length;b++)v(d[b]);return v}({1:[function(a,i,t){var d=function(){function v(){(0,s.default)(this,v),this._types=(0,p.default)(null),this._extensions=(0,p.default)(null);for(var y=0;y<arguments.length;y++)this.define(arguments[y])}return(0,o.default)(v,[{key:"define",value:function(y,b){for(var g in y){for(var m=y[g],_=0;_<m.length;_++){var x=m[_];if(!b&&x in this._types)throw new Error('Attempt to change mapping for "'+x+'" extension from "'+this._types[x]+'" to "'+g+'". Pass `force=true` to allow this, otherwise remove "'+x+'" from the list of extensions for "'+g+'".');this._types[x]=g}!b&&this._extensions[g]||(this._extensions[g]=m[0])}}},{key:"getType",value:function(y){y=String(y);var b=y.replace(/^.*[\/\\]/,"").toLowerCase(),g=b.replace(/^.*\./,"").toLowerCase(),m=b.length<y.length;return(g.length<b.length-1||!m)&&this._types[g]||null}},{key:"getExtension",value:function(y){return(y=/^\s*([^;\s]*)/.test(y)&&RegExp.$1)&&this._extensions[y.toLowerCase()]||null}}]),v}();i.exports=d},{}],2:[function(a,i,t){var d=a("./Mime");i.exports=new d(a("./types/standard"),a("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(a,i,t){i.exports={"application/prs.cww":["cww"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":[],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],4:[function(a,i,t){i.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/xm":["xm"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/webp":["webp"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}]},{},[2])(2)})}).call(this,typeof ce!="undefined"?ce:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"babel-runtime/core-js/object/create":19,"babel-runtime/helpers/classCallCheck":30,"babel-runtime/helpers/createClass":31,"babel-runtime/helpers/typeof":32}],243:[function(C,D,T){"use strict";T.encodeURIComponent=function(A){try{return encodeURIComponent(A)}catch(O){return A}},T.escape=C("escape-html"),T.timestamp=function(A){if(A){var O=A;return typeof O=="string"&&(O=Number(O)),String(A).length===10&&(O*=1e3),new Date(O)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(C,D,T){(function(A,O){"use strict";function f(x){return x&&x.__esModule?x:{default:x}}function p(x,h){return x===void 0?h:x}function c(x,h){return function(E,S,w){if(E)return h(E);x({data:S,status:w.statusCode,headers:w.headers,res:w})}}var s,n=C("babel-runtime/core-js/json/stringify"),o=f(n),r=C("babel-runtime/helpers/typeof"),l=f(r),a=C("util"),i=C("url"),t=C("http"),d=C("https"),v=C("debug")("urllib"),y=C("humanize-ms"),b=0,g=Math.pow(2,31)-10,m=/^https?:\/\//i;T.TIMEOUTS=[y("300s"),y("300s")];var _=["json","text"];T.request=function(x,h,E){return arguments.length===2&&typeof h=="function"&&(E=h,h=null),typeof E=="function"?T.requestWithCallback(x,h,E):(s||(s=C("any-promise")),new s(function(S,w){T.requestWithCallback(x,h,c(S,w))}))},T.requestWithCallback=function(x,h,E){function S(){it&&(clearTimeout(it),it=null)}function w(){re&&(clearTimeout(re),re=null)}function R(Ye,je,Ue){if(w(),!E)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),G,A.pid,_e.method,x),void(Ye&&console.warn(`[urllib:warn] [%s] [%s] [worker:%s] %s: %s
|
|
|
stack: %s`,Date(),G,A.pid,Ye.name,Ye.message,Ye.stack));var ke=E;E=null;var be={};if(Ue&&(Q=Ue.statusCode,be=Ue.headers),Q===401&&be["www-authenticate"]&&(!h.headers||!h.headers.Authorization)&&h.digestAuth){var Ce=be["www-authenticate"];if(Ce.indexOf("Digest ")>=0)return v("Request#%d %s: got digest auth header WWW-Authenticate: %s",G,x,Ce),h.headers=h.headers||{},h.headers.Authorization=digestAuthHeader(_e.method,_e.path,Ce,h.digestAuth),v("Request#%d %s: auth with digest header: %s",G,x,h.headers.Authorization),Ue.headers["set-cookie"]&&(h.headers.Cookie=Ue.headers["set-cookie"].join(";")),T.requestWithCallback(x,h,ke)}var Pe=Date.now()-Z;Ne&&(Ne.contentDownload=Pe),v("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",Pe,$,Q,_e.method,_e.host,_e.path,ee,Ne);var Le={status:Q,statusCode:Q,headers:be,size:$,aborted:xe,rt:Pe,keepAliveSocket:ee,data:je,requestUrls:h.requestUrls,timing:Ne,remoteAddress:De,remotePort:dt};if(Ye){var Ve="";we&&typeof we.getCurrentStatus=="function"&&(Ve=", agent status: "+(0,o.default)(we.getCurrentStatus())),Ye.message+=", "+_e.method+" "+x+" "+Q+" (connected: "+j+", keepalive socket: "+ee+Ve+`)
|
|
|
headers: `+(0,o.default)(be),Ye.data=je,Ye.path=_e.path,Ye.status=Q,Ye.headers=be,Ye.res=Le}ke(Ye,je,h.streaming?Ue:Le),h.emitter&&(J.url=x,J.socket=qe&&qe.connection,J.options=_e,J.size=We,h.emitter.emit("response",{requestId:G,error:Ye,ctx:h.ctx,req:J,res:Le}))}function N(Ye){var je=null;if(h.followRedirect&&statuses.redirect[Ye.statusCode]){h._followRedirectCount=(h._followRedirectCount||0)+1;var Ue=Ye.headers.location;if(Ue){if(!(h._followRedirectCount>h.maxRedirects)){var ke=h.formatRedirectUrl?h.formatRedirectUrl(x,Ue):i.resolve(x,Ue);v("Request#%d %s: `redirected` from %s to %s",G,_e.path,x,ke),w(),h.headers&&h.headers.Host&&m.test(Ue)&&(h.headers.Host=null);var be=E;return E=null,T.requestWithCallback(ke,h,be),{redirect:!0,error:null}}je=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+x),je.name="MaxRedirectError"}else je=new Error("Got statusCode "+Ye.statusCode+" but cannot resolve next location from headers"),je.name="FollowRedirectError"}return{redirect:!1,error:je}}function F(Ye,je,Ue){return Ue(null,je,Ye.headers["content-encoding"])}function z(Ye){if(Ne&&(Ne.waiting=Date.now()-Z),v("Request#%d %s `req response` event emit: status %d, headers: %j",G,x,Ye.statusCode,Ye.headers),h.streaming){var je=N(Ye);return je.redirect?void Ye.resume():je.error?(Ye.resume(),R(je.error,null,Ye)):R(null,null,Ye)}if(Ye.on("close",function(){v("Request#%d %s: `res close` event emit, total size %d",G,x,$)}),Ye.on("error",function(){v("Request#%d %s: `res error` event emit, total size %d",G,x,$)}),Ye.on("aborted",function(){xe=!0,v("Request#%d %s: `res aborted` event emit, total size %d",G,x,$)}),Be){var je=N(Ye);return je.redirect?void Ye.resume():je.error?(Ye.resume(),Be.end(),R(je.error,null,Ye)):(h.consumeWriteStream===!1?Ye.on("end",R.bind(null,null,null,Ye)):isNode010||isNode012?first([[Be,"close"],[Ye,"aborted"]],function(be,Ce,Pe){v("Request#%d %s: writeStream or res %s event emitted",G,x,Pe),R(P||null,null,Ye)}):Be.on("close",function(){v("Request#%d %s: writeStream close event emitted",G,x),R(P||null,null,Ye)}),Ye.pipe(Be))}var Ue=[];Ye.on("data",function(ke){v("Request#%d %s: `res data` event emit, size %d",G,x,ke.length),$+=ke.length,Ue.push(ke)}),Ye.on("end",function(){var ke=O.concat(Ue,$);if(v("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",G,x,$,Ye._dumped),P)return R(P,ke,Ye);var be=N(Ye);if(be.error)return R(be.error,ke,Ye);be.redirect||F(Ye,ke,function(Ce,Pe,Le){if(Ce)return R(Ce,ke,Ye);if(!Le&&_.indexOf(h.dataType)>=0){try{Pe=decodeBodyByCharset(Pe,Ye)}catch(at){return v("decodeBodyByCharset error: %s",at),R(null,Pe,Ye)}if(h.dataType==="json")if($===0)Pe=null;else{var Ve=parseJSON(Pe,Ie);Ve.error?Ce=Ve.error:Pe=Ve.data}}xe&&v("Request#%d %s: Remote socket was terminated before `response.end()` was called",G,x),R(Ce,Pe,Ye)})})}function q(){v("Response timer ticking, timeout: %d",lt),re=setTimeout(function(){re=null;var Ye="Response timeout for "+lt+"ms";P=new Error(Ye),P.name="ResponseTimeoutError",P.requestId=G,v("ResponseTimeout: Request#%d %s %s: %s, connected: %s",G,x,P.name,Ye,j),B()},lt)}function B(){v("Request#%d %s abort, connected: %s",G,x,j),qe.socket||(P.noSocket=!0,R(P)),qe.abort()}if(!x||typeof x!="string"&&(x===void 0?"undefined":(0,l.default)(x))!=="object"){var M=a.format("expect request url to be a string or a http request options, but got %j",x);throw new Error(M)}arguments.length===2&&typeof h=="function"&&(E=h,h=null),h=h||{},b>=g&&(b=0);var G=++b;h.requestUrls=h.requestUrls||[];var J={requestId:G,url:x,args:h,ctx:h.ctx};h.emitter&&h.emitter.emit("request",J),h.timeout=h.timeout||T.TIMEOUTS,h.maxRedirects=h.maxRedirects||10,h.streaming=h.streaming||h.customResponse;var K,Z=Date.now();typeof x=="string"?(m.test(x)||(x="http://"+x),K=i.parse(x)):K=x;var le=(h.type||h.method||K.method||"GET").toUpperCase(),de=K.port||80,Te=t,we=p(h.agent,T.agent),Ie=h.fixJSONCtlChars;K.protocol==="https:"&&(Te=d,we=p(h.httpsAgent,T.httpsAgent),K.port||(de=443));var _e={host:K.hostname||K.host||"localhost",path:K.path||"/",method:le,port:de,agent:we,headers:h.headers||{},lookup:h.lookup};Array.isArray(h.timeout)?_e.requestTimeout=h.timeout[h.timeout.length-1]:h.timeout!==void 0&&(_e.requestTimeout=h.timeout);for(var ye=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],Ke=0;Ke<ye.length;Ke++){var Me=ye[Ke];h.hasOwnProperty(Me)&&(_e[Me]=h[Me])}_e.rejectUnauthorized!==!1||_e.hasOwnProperty("secureOptions")||(_e.secureOptions=C("constants").SSL_OP_NO_TLSv1_2);var Fe=h.auth||K.auth;Fe&&(_e.auth=Fe);var Ge=h.content||h.data,Ee=le==="GET"||le==="HEAD"||h.dataAsQueryString;if(!h.content&&Ge&&typeof Ge!="string"&&!O.isBuffer(Ge))if(Ee)Ge=h.nestedQuerystring?qs.stringify(Ge):querystring.stringify(Ge);else{var me=_e.headers["Content-Type"]||_e.headers["content-type"];me||(me=h.contentType==="json"?"application/json":"application/x-www-form-urlencoded",_e.headers["Content-Type"]=me),Ge=parseContentType(me).type==="application/json"?(0,o.default)(Ge):h.nestedQuerystring?qs.stringify(Ge):querystring.stringify(Ge)}Ee&&Ge&&(_e.path+=(K.query?"&":"?")+Ge,Ge=null);var We=0;if(Ge){var He=Ge.length;O.isBuffer(Ge)||(He=O.byteLength(Ge)),We=_e.headers["Content-Length"]=He}h.dataType==="json"&&(_e.headers.Accept="application/json"),typeof h.beforeRequest=="function"&&h.beforeRequest(_e);var it=null,re=null,P=null,j=!1,ee=!1,$=0,Q=-1,xe=!1,De="",dt="",Ne=null;h.timing&&(Ne={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),_e.headers["User-Agent"]||_e.headers["user-agent"]||(_e.headers["User-Agent"]=navigator.userAgent),h.gzip&&(_e.headers["Accept-Encoding"]||_e.headers["accept-encoding"]||(_e.headers["Accept-Encoding"]="gzip"));var Be=h.writeStream;v("Request#%d %s %s with headers %j, options.path: %s",G,le,x,_e.headers,_e.path),h.requestUrls.push(x);var tt,lt;Array.isArray(h.timeout)?(tt=y(h.timeout[0]),lt=y(h.timeout[1])):tt=lt=y(h.timeout),v("ConnectTimeout: %d, ResponseTimeout: %d",tt,lt);var qe;try{qe=Te.request(_e,z)}catch(Ye){return R(Ye)}return typeof window=="undefined"?function(){v("Connect timer ticking, timeout: %d",tt),it=setTimeout(function(){it=null,Q===-1&&(Q=-2);var Ye="Connect timeout for "+tt+"ms",je="ConnectionTimeoutError";qe.socket||(je="SocketAssignTimeoutError",Ye+=", working sockets is full"),P=new Error(Ye),P.name=je,P.requestId=G,v("ConnectTimeout: Request#%d %s %s: %s, connected: %s",G,x,P.name,Ye,j),B()},tt)}():qe.on("requestTimeout",function(){Q===-1&&(Q=-2);var Ye="Connect timeout for "+tt+"ms";P=new Error(Ye),P.name="ConnectionTimeoutError",P.requestId=G,B()}),Ne&&qe.on("finish",function(){Ne.requestSent=Date.now()-Z}),qe.once("socket",function(Ye){Ne&&(Ne.queuing=Date.now()-Z),isNode010&&Ye.socket&&(Ye=Ye.socket);var je=Ye.readyState;if(je==="opening")return Ye.once("lookup",function(Ue,ke,be){v("Request#%d %s lookup: %s, %s, %s",G,x,Ue,ke,be),Ne&&(Ne.dnslookup=Date.now()-Z),ke&&(De=ke)}),void Ye.once("connect",function(){Ne&&(Ne.connected=Date.now()-Z),S(),q(),v("Request#%d %s new socket connected",G,x),j=!0,De||(De=Ye.remoteAddress),dt=Ye.remotePort});v("Request#%d %s reuse socket connected, readyState: %s",G,x,je),j=!0,ee=!0,De||(De=Ye.remoteAddress),dt=Ye.remotePort,S(),q()}),qe.on("error",function(Ye){Ye.name!=="Error"&&Ye.name!=="TypeError"||(Ye.name=j?"ResponseError":"RequestError"),Ye.message+=' (req "error")',v("Request#%d %s `req error` event emit, %s: %s",G,x,Ye.name,Ye.message),R(P||Ye)}),Be&&Be.once("error",function(Ye){Ye.message+=' (writeStream "error")',P=Ye,v("Request#%d %s `writeStream error` event emit, %s: %s",G,x,Ye.name,Ye.message),B()}),h.stream?(h.stream.pipe(qe),h.stream.once("error",function(Ye){Ye.message+=' (stream "error")',P=Ye,v("Request#%d %s `readStream error` event emit, %s: %s",G,x,Ye.name,Ye.message),B()})):qe.end(Ge),qe.requestId=G,qe}}).call(this,C("_process"),C("buffer").Buffer)},{_process:173,"any-promise":13,"babel-runtime/core-js/json/stringify":17,"babel-runtime/helpers/typeof":32,buffer:38,constants:42,debug:155,http:196,https:159,"humanize-ms":160,url:203,util:207}]},{},[1])(1)}),!function(W){function C(T){if(D[T])return D[T].exports;var A=D[T]={i:T,l:!1,exports:{}};return W[T].call(A.exports,A,A.exports,C),A.l=!0,A.exports}var D={};C.m=W,C.c=D,C.d=function(T,A,O){C.o(T,A)||Object.defineProperty(T,A,{configurable:!1,enumerable:!0,get:O})},C.n=function(T){var A=T&&T.__esModule?function(){return T.default}:function(){return T};return C.d(A,"a",A),A},C.o=function(T,A){return Object.prototype.hasOwnProperty.call(T,A)},C.p="",C(C.s=12)}([function(W,C,D){!function(T,A){W.exports=C=A()}(0,function(){var T=T||function(A,O){var f=Object.create||function(){function d(){}return function(v){var y;return d.prototype=v,y=new d,d.prototype=null,y}}(),p={},c=p.lib={},s=c.Base=function(){return{extend:function(d){var v=f(this);return d&&v.mixIn(d),v.hasOwnProperty("init")&&this.init!==v.init||(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var d=this.extend();return d.init.apply(d,arguments),d},init:function(){},mixIn:function(d){for(var v in d)d.hasOwnProperty(v)&&(this[v]=d[v]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),n=c.WordArray=s.extend({init:function(d,v){d=this.words=d||[],this.sigBytes=v!=null?v:4*d.length},toString:function(d){return(d||r).stringify(this)},concat:function(d){var v=this.words,y=d.words,b=this.sigBytes,g=d.sigBytes;if(this.clamp(),b%4)for(var m=0;m<g;m++){var _=y[m>>>2]>>>24-m%4*8&255;v[b+m>>>2]|=_<<24-(b+m)%4*8}else for(var m=0;m<g;m+=4)v[b+m>>>2]=y[m>>>2];return this.sigBytes+=g,this},clamp:function(){var d=this.words,v=this.sigBytes;d[v>>>2]&=4294967295<<32-v%4*8,d.length=A.ceil(v/4)},clone:function(){var d=s.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var v,y=[],b=0;b<d;b+=4){var g=function(m){var m=m,_=987654321,x=4294967295;return function(){_=36969*(65535&_)+(_>>16)&x,m=18e3*(65535&m)+(m>>16)&x;var h=(_<<16)+m&x;return h/=4294967296,(h+=.5)*(A.random()>.5?1:-1)}}(4294967296*(v||A.random()));v=987654071*g(),y.push(4294967296*g()|0)}return new n.init(y,d)}}),o=p.enc={},r=o.Hex={stringify:function(d){for(var v=d.words,y=d.sigBytes,b=[],g=0;g<y;g++){var m=v[g>>>2]>>>24-g%4*8&255;b.push((m>>>4).toString(16)),b.push((15&m).toString(16))}return b.join("")},parse:function(d){for(var v=d.length,y=[],b=0;b<v;b+=2)y[b>>>3]|=parseInt(d.substr(b,2),16)<<24-b%8*4;return new n.init(y,v/2)}},l=o.Latin1={stringify:function(d){for(var v=d.words,y=d.sigBytes,b=[],g=0;g<y;g++){var m=v[g>>>2]>>>24-g%4*8&255;b.push(String.fromCharCode(m))}return b.join("")},parse:function(d){for(var v=d.length,y=[],b=0;b<v;b++)y[b>>>2]|=(255&d.charCodeAt(b))<<24-b%4*8;return new n.init(y,v)}},a=o.Utf8={stringify:function(d){try{return decodeURIComponent(escape(l.stringify(d)))}catch(v){throw new Error("Malformed UTF-8 data")}},parse:function(d){return l.parse(unescape(encodeURIComponent(d)))}},i=c.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new n.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=a.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var v=this._data,y=v.words,b=v.sigBytes,g=this.blockSize,m=4*g,_=b/m;_=d?A.ceil(_):A.max((0|_)-this._minBufferSize,0);var x=_*g,h=A.min(4*x,b);if(x){for(var E=0;E<x;E+=g)this._doProcessBlock(y,E);var S=y.splice(0,x);v.sigBytes-=h}return new n.init(S,h)},clone:function(){var d=s.clone.call(this);return d._data=this._data.clone(),d},_minBufferSize:0}),t=(c.Hasher=i.extend({cfg:s.extend(),init:function(d){this.cfg=this.cfg.extend(d),this.reset()},reset:function(){i.reset.call(this),this._doReset()},update:function(d){return this._append(d),this._process(),this},finalize:function(d){return d&&this._append(d),this._doFinalize()},blockSize:16,_createHelper:function(d){return function(v,y){return new d.init(y).finalize(v)}},_createHmacHelper:function(d){return function(v,y){return new t.HMAC.init(d,y).finalize(v)}}}),p.algo={});return p}(Math);return T})},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}(),O=function(){function f(){T(this,f)}return A(f,null,[{key:"detectIEVersion",value:function(){for(var p=4,c=document.createElement("div"),s=c.getElementsByTagName("i");c.innerHTML="<!--[if gt IE "+p+"]><i></i><![endif]-->",s[0];)p++;return p>4&&p}},{key:"extend",value:function(p,c){for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&c[s]&&(p[s]=c[s])}},{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 c(s){return s<10?"0"+s:s}return p.getUTCFullYear()+"-"+c(p.getUTCMonth()+1)+"-"+c(p.getUTCDate())+"T"+c(p.getUTCHours())+":"+c(p.getUTCMinutes())+":"+c(p.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(p){return!!/^\d+$/.test(p)}}]),f}();C.default=O},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return function(A){function O(t,d,v,y,b,g,m){var _=t+(d&v|~d&y)+b+m;return(_<<g|_>>>32-g)+d}function f(t,d,v,y,b,g,m){var _=t+(d&y|v&~y)+b+m;return(_<<g|_>>>32-g)+d}function p(t,d,v,y,b,g,m){var _=t+(d^v^y)+b+m;return(_<<g|_>>>32-g)+d}function c(t,d,v,y,b,g,m){var _=t+(v^(d|~y))+b+m;return(_<<g|_>>>32-g)+d}var s=T,n=s.lib,o=n.WordArray,r=n.Hasher,l=s.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*A.abs(A.sin(t+1))|0}();var i=l.MD5=r.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,d){for(var v=0;v<16;v++){var y=d+v,b=t[y];t[y]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8)}var g=this._hash.words,m=t[d+0],_=t[d+1],x=t[d+2],h=t[d+3],E=t[d+4],S=t[d+5],w=t[d+6],R=t[d+7],N=t[d+8],F=t[d+9],z=t[d+10],q=t[d+11],B=t[d+12],M=t[d+13],G=t[d+14],J=t[d+15],K=g[0],Z=g[1],le=g[2],de=g[3];K=O(K,Z,le,de,m,7,a[0]),de=O(de,K,Z,le,_,12,a[1]),le=O(le,de,K,Z,x,17,a[2]),Z=O(Z,le,de,K,h,22,a[3]),K=O(K,Z,le,de,E,7,a[4]),de=O(de,K,Z,le,S,12,a[5]),le=O(le,de,K,Z,w,17,a[6]),Z=O(Z,le,de,K,R,22,a[7]),K=O(K,Z,le,de,N,7,a[8]),de=O(de,K,Z,le,F,12,a[9]),le=O(le,de,K,Z,z,17,a[10]),Z=O(Z,le,de,K,q,22,a[11]),K=O(K,Z,le,de,B,7,a[12]),de=O(de,K,Z,le,M,12,a[13]),le=O(le,de,K,Z,G,17,a[14]),Z=O(Z,le,de,K,J,22,a[15]),K=f(K,Z,le,de,_,5,a[16]),de=f(de,K,Z,le,w,9,a[17]),le=f(le,de,K,Z,q,14,a[18]),Z=f(Z,le,de,K,m,20,a[19]),K=f(K,Z,le,de,S,5,a[20]),de=f(de,K,Z,le,z,9,a[21]),le=f(le,de,K,Z,J,14,a[22]),Z=f(Z,le,de,K,E,20,a[23]),K=f(K,Z,le,de,F,5,a[24]),de=f(de,K,Z,le,G,9,a[25]),le=f(le,de,K,Z,h,14,a[26]),Z=f(Z,le,de,K,N,20,a[27]),K=f(K,Z,le,de,M,5,a[28]),de=f(de,K,Z,le,x,9,a[29]),le=f(le,de,K,Z,R,14,a[30]),Z=f(Z,le,de,K,B,20,a[31]),K=p(K,Z,le,de,S,4,a[32]),de=p(de,K,Z,le,N,11,a[33]),le=p(le,de,K,Z,q,16,a[34]),Z=p(Z,le,de,K,G,23,a[35]),K=p(K,Z,le,de,_,4,a[36]),de=p(de,K,Z,le,E,11,a[37]),le=p(le,de,K,Z,R,16,a[38]),Z=p(Z,le,de,K,z,23,a[39]),K=p(K,Z,le,de,M,4,a[40]),de=p(de,K,Z,le,m,11,a[41]),le=p(le,de,K,Z,h,16,a[42]),Z=p(Z,le,de,K,w,23,a[43]),K=p(K,Z,le,de,F,4,a[44]),de=p(de,K,Z,le,B,11,a[45]),le=p(le,de,K,Z,J,16,a[46]),Z=p(Z,le,de,K,x,23,a[47]),K=c(K,Z,le,de,m,6,a[48]),de=c(de,K,Z,le,R,10,a[49]),le=c(le,de,K,Z,G,15,a[50]),Z=c(Z,le,de,K,S,21,a[51]),K=c(K,Z,le,de,B,6,a[52]),de=c(de,K,Z,le,h,10,a[53]),le=c(le,de,K,Z,z,15,a[54]),Z=c(Z,le,de,K,_,21,a[55]),K=c(K,Z,le,de,N,6,a[56]),de=c(de,K,Z,le,J,10,a[57]),le=c(le,de,K,Z,w,15,a[58]),Z=c(Z,le,de,K,M,21,a[59]),K=c(K,Z,le,de,E,6,a[60]),de=c(de,K,Z,le,q,10,a[61]),le=c(le,de,K,Z,x,15,a[62]),Z=c(Z,le,de,K,F,21,a[63]),g[0]=g[0]+K|0,g[1]=g[1]+Z|0,g[2]=g[2]+le|0,g[3]=g[3]+de|0},_doFinalize:function(){var t=this._data,d=t.words,v=8*this._nDataBytes,y=8*t.sigBytes;d[y>>>5]|=128<<24-y%32;var b=A.floor(v/4294967296),g=v;d[15+(y+64>>>9<<4)]=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),d[14+(y+64>>>9<<4)]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),t.sigBytes=4*(d.length+1),this._process();for(var m=this._hash,_=m.words,x=0;x<4;x++){var h=_[x];_[x]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return m},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});s.MD5=r._createHelper(i),s.HmacMD5=r._createHmacHelper(i)}(Math),T.MD5})},function(W,C,D){"use strict";Object.defineProperty(C,"__esModule",{value:!0}),C.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},C.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},C.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(W,C,D){"use strict";function T(i){return i&&i.__esModule?i:{default:i}}function A(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function i(t,d){for(var v=0;v<d.length;v++){var y=d[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(t,y.key,y)}}return function(t,d,v){return d&&i(t.prototype,d),v&&i(t,v),t}}(),f=D(5),p=T(f),c=D(25),s=T(c),n=D(6),o=T(n),r=D(7),l=T(r),a=function(){function i(t){A(this,i);var d=l.default.os.name,v=l.default.os.version||"",y=l.default.browser.name,b=l.default.browser.version||"",g=window.location.href,m="";g&&(m=l.default.getHost(g));var _="pc";l.default.os.ipad?_="pad":(l.default.os.iphone||l.default.os.android)&&(_="phone"),this._ri=p.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:o.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:i.getUuid(),os:d,ov:v,et:y,ev:b,uat:navigator.userAgent,app_n:m,tt:_,dm:"h5",ut:""}}return O(i,[{key:"log",value:function(t,d){d&&d.ri?(this._ri=d.ri,delete d.ri):this._ri=p.default.create(),d&&d.ut&&(this.initParam.ut=d.ut,delete d.ut),this.initParam.t=new Date().getTime(),this.initParam.ll=t=="20006"?"error":"info",this.initParam.ri=this._ri,this.initParam.e=t;var v=[];if(d)for(var y in d)v.push(y+"="+d[y]);var b=v.join("&");this.initParam.args=encodeURIComponent(b==""?"0":b);var g=[];for(var y in this.initParam)g.push(y+"="+this.initParam[y]);var m=g.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(m):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+m}}],[{key:"getUuid",value:function(){var t=s.default.get("p_h5_upload_u");return t||(t=p.default.create(),s.default.set("p_h5_upload_u",t,730)),t}},{key:"getClientId",value:function(){return s.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(t){return t||(t=p.default.create()),s.default.set("p_h5_upload_clientId",t,730),t}}]),i}();C.default=a},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}(),O=function(){function f(){T(this,f)}return A(f,null,[{key:"create",value:function(p,c){var s,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(c=c||n.length,p)for(s=0;s<p;s++)o[s]=n[0|Math.random()*c];else{var r;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",s=0;s<36;s++)o[s]||(r=0|16*Math.random(),o[s]=n[s==19?3&r|8:r])}return o.join("")}}]),f}();C.default=O},function(W,C,D){"use strict";Object.defineProperty(C,"__esModule",{value:!0});var T={version:"1.5.0"};C.default=T},function(W,C,D){"use strict";function T(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function n(o,r){for(var l=0;l<r.length;l++){var a=r[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}return function(o,r,l){return r&&n(o.prototype,r),l&&n(o,l),o}}(),O=function(n){var o=navigator.userAgent,r="other";if(n.ios)return"iOS";if(n.android)return"android";if(o.indexOf("Baiduspider")>-1)return"Baiduspider";if(o.indexOf("PlayStation")>-1)return"PS4";var l=navigator.platform=="Win32"||navigator.platform=="Windows"||o.indexOf("Windows")>-1,a=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";return a&&(r="macOS"),navigator.platform=="X11"&&!l&&!a&&(r="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(r="Linux"),l?"windows":r},f=function(){var n=navigator.userAgent,o="";return(n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1)&&(o="2000"),(n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1)&&(o="XP"),(n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1)&&(o="2003"),(n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1)&&(o="Vista"),(n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1)&&(o="7"),(n.indexOf("Windows NT 6.2")>-1||n.indexOf("Windows 8")>-1)&&(o="8"),(n.indexOf("Windows NT 6.3")>-1||n.indexOf("Windows 8.1")>-1)&&(o="8.1"),(n.indexOf("Windows NT 10")>-1||n.indexOf("Windows 10")>-1)&&(o="10"),o},p=function(n){var o=navigator.userAgent.toLowerCase();return n.chrome?"Chrome":n.firefox?"Firefox":n.safari?"Safari":n.webview?"webview":n.ie?/edge/.test(o)?"Edge":"IE":/baiduspider/.test(o)?"Baiduspider":/ucweb/.test(o)||/UCBrowser/.test(o)?"UC":/opera/.test(o)?"Opera":/ucweb/.test(o)?"UC":/360se/.test(o)?"360\u6D4F\u89C8\u5668":/bidubrowser/.test(o)?"\u767E\u5EA6\u6D4F\u89C8\u5668":/metasr/.test(o)?"\u641C\u72D7\u6D4F\u89C8\u5668":/lbbrowser/.test(o)?"\u730E\u8C79\u6D4F\u89C8\u5668":/micromessenger/.test(o)?"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668":/qqbrowser/.test(o)?"QQ\u6D4F\u89C8\u5668":/playstation/.test(o)?"PS4\u6D4F\u89C8\u5668":void 0},c=function(){var n={},o={},r=navigator.userAgent,l=navigator.platform,a=r.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=r.match(/(Android);?[\s\/]+([\d.]+)?/),t=!!r.match(/\(Macintosh\; Intel /),d=r.match(/(iPad).*OS\s([\d_]+)/),v=r.match(/(iPod)(.*OS\s([\d_]+))?/),y=!d&&r.match(/(iPhone\sOS)\s([\d_]+)/),b=r.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),g=/Win\d{2}|Windows/.test(l),m=r.match(/Windows Phone ([\d.]+)/),_=b&&r.match(/TouchPad/),x=r.match(/Kindle\/([\d.]+)/),h=r.match(/Silk\/([\d._]+)/),E=r.match(/(BlackBerry).*Version\/([\d.]+)/),S=r.match(/(BB10).*Version\/([\d.]+)/),w=r.match(/(RIM\sTablet\sOS)\s([\d.]+)/),R=r.match(/PlayBook/),N=r.match(/Chrome\/([\d.]+)/)||r.match(/CriOS\/([\d.]+)/),F=r.match(/Firefox\/([\d.]+)/),z=r.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),q=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),B=!N&&r.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),M=B||r.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((o.webkit=!!a)&&(o.version=a[1]),i&&(n.android=!0,n.version=i[2]),y&&!v&&(n.ios=n.iphone=!0,n.version=y[2].replace(/_/g,".")),d&&(n.ios=n.ipad=!0,n.version=d[2].replace(/_/g,".")),v&&(n.ios=n.ipod=!0,n.version=v[3]?v[3].replace(/_/g,"."):null),m&&(n.wp=!0,n.version=m[1]),b&&(n.webos=!0,n.version=b[2]),_&&(n.touchpad=!0),E&&(n.blackberry=!0,n.version=E[2]),S&&(n.bb10=!0,n.version=S[2]),w&&(n.rimtabletos=!0,n.version=w[2]),R&&(o.playbook=!0),x&&(n.kindle=!0,n.version=x[1]),h&&(o.silk=!0,o.version=h[1]),!h&&n.android&&r.match(/Kindle Fire/)&&(o.silk=!0),N&&(o.chrome=!0,o.version=N[1]),F&&(o.firefox=!0,o.version=F[1]),z&&(n.firefoxos=!0,n.version=z[1]),q&&(o.ie=!0,o.version=q[1]),M&&(t||n.ios||g||i)&&(o.safari=!0,n.ios||(o.version=M[1])),B&&(o.webview=!0),t){var G=r.match(/[\d]*_[\d]*_[\d]*/);G&&G.length>0&&G[0]&&(n.version=G[0].replace(/_/g,"."))}return n.tablet=!!(d||R||i&&!r.match(/Mobile/)||F&&r.match(/Tablet/)||q&&!r.match(/Phone/)&&r.match(/Touch/)),n.phone=!(n.tablet||n.ipod||!(i||y||b||E||S||N&&r.match(/Android/)||N&&r.match(/CriOS\/([\d.]+)/)||F&&r.match(/Mobile/)||q&&r.match(/Touch/))),n.pc=!n.tablet&&!n.phone,t?n.name="macOS":g?(n.name="windows",n.version=f()):n.name=O(n),o.name=p(o),{os:n,browser:o}}(),s=function(){function n(){T(this,n)}return A(n,null,[{key:"getHost",value:function(o){var r="";if(o===void 0||o==null||o=="")return"";var l=o.indexOf("//"),a=o;l>-1&&(a=o.substring(l+2));var r=a,i=a.split("/");return i&&i.length>0&&(r=i[0]),i=r.split(":"),i&&i.length>0&&(r=i[0]),r}},{key:"os",get:function(){return c.os}},{key:"browser",get:function(){var o=c.browser;return o.name||(o.name=p()),o}}]),n}();C.default=s},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}(),O=function(){function f(){T(this,f)}return A(f,null,[{key:"get",value:function(p,c,s,n,o){var r;s=s||function(){},typeof XMLHttpRequest=="undefined"&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(l){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(l){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(l){}throw new Error("This browser does not support XMLHttpRequest.")}),r=new XMLHttpRequest,r.onreadystatechange=function(){r.readyState===4&&(r.status===200?c(r.responseText):s(r.responseText))};try{n===void 0&&(n=!0),r.open("GET",p,n),o&&(r.withCredentials=!0)}catch(l){return void s(l)}try{r.send()}catch(l){s(l)}}}]),f}();C.default=O},function(W,C,D){"use strict";function T(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function c(s,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,r.key,r)}}return function(s,n,o){return n&&c(s.prototype,n),o&&c(s,o),s}}(),O=D(27),f=D(30),p=(D(10),function(){function c(){T(this,c)}return A(c,null,[{key:"randomUUID",value:function(){for(var s=[],n="0123456789abcdef",o=0;o<36;o++)s[o]=n.substr(Math.floor(16*Math.random()),1);return s[14]="4",s[19]=n.substr(3&s[19]|8,1),s[8]=s[13]=s[18]=s[23]="-",s.join("")}},{key:"aliyunEncodeURI",value:function(s){var n=encodeURIComponent(s);return n=n.replace(/\+/g,"%20").replace(/\*/g,"%2A").replace(/%7E/g,"~").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}},{key:"makeUTF8sort",value:function(s,n,o){if(!s)throw new Error("PrismPlayer Error: vid should not be null!");var r=[];for(var l in s)r.push(l);for(var a=r.sort(),i="",t=a.length,l=0;l<t;l++){var d=c.aliyunEncodeURI(a[l]),v=c.aliyunEncodeURI(s[a[l]]);i==""?i=d+n+v:i+=o+d+n+v}return i}},{key:"makeChangeSiga",value:function(s,n){if(!s)throw new Error("PrismPlayer Error: vid should not be null!");return f.stringify(O("GET&"+c.aliyunEncodeURI("/")+"&"+c.aliyunEncodeURI(c.makeUTF8sort(s,"=","&")),n+"&"))}}]),c}());C.default=p},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return T.enc.Utf8})},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return T.enc.Hex})},function(W,C,D){W.exports=D(13)},function(W,C,D){"use strict";var T,A,O=(typeof Symbol=="function"&&Symbol.iterator,D(14)),f=function(c){return c&&c.__esModule?c:{default:c}}(O),p={Vod:f.default};T=[],(A=function(){return p}.apply(C,T))!==void 0&&(W.exports=A),window.AliyunUpload=p,nt.exports=AliyunUpload},function(W,C,D){"use strict";function T(S){return S&&S.__esModule?S:{default:S}}function A(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function S(w,R){for(var N=0;N<R.length;N++){var F=R[N];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(w,F.key,F)}}return function(w,R,N){return R&&S(w.prototype,R),N&&S(w,N),w}}(),f=D(15),p=D(3),c=D(16),s=T(c),n=D(18),o=T(n),r=D(24),l=T(r),a=D(4),i=T(a),t=D(1),d=T(t),v=D(5),y=T(v),b=D(26),g=T(b),m=D(31),_=T(m),x=D(32),h=T(x),E=(D(2),function(){function S(w){A(this,S),this.options=w,this.options.partSize=this.options.partSize||p.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||p.UPLOADDEFAULT.PARALLEL,this.options.region=this.options.region||"cn-shanghai",this.options.cname=this.options.cname||!1,this.options.localCheckpoint=this.options.localCheckpoint||!1,this.options.enableUploadProgress===void 0&&(this.options.enableUploadProgress=!0),this._ossCreditor=new Object,this._state=f.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new i.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=f.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return O(S,[{key:"init",value:function(w,R,N,F){return this._retryCount=0,!(N&&!F||!N&&F)&&!(w&&!R||!w&&R)&&(this._ossCreditor.accessKeyId=w,this._ossCreditor.accessKeySecret=R,this._ossCreditor.securityToken=N,this._ossCreditor.expireTime=F,!0)}},{key:"addFile",value:function(w,R,N,F,z,q){if(!w)return!1;if(w.size==0)try{this.options.onUploadFailed({file:w},"EmptyFile","\u6587\u4EF6\u5927\u5C0F\u4E3A0\uFF0C\u4E0D\u80FD\u4E0A\u4F20")}catch(J){console.log(J)}for(var B=(this.options,0);B<this._uploadList.length;B++)if(this._uploadList[B].file==w)return!1;var M=new Object;if(M.file=w,M._endpoint=R,M._bucket=N,M._object=F,M.state=f.UPLOADSTATE.INIT,M.isImage=d.default.isImage(w.name),!M.isImage&&this.options.enableUploadProgress){var G=this;h.default.getMd5(w,function(J){M.fileHash=J;var K=G._getCheckoutpoint(M);G.options.localCheckpoint||K||G._getCheckoutpointFromCloud(M,function(Z){if(Z.UploadPoint){var le=JSON.parse(Z.UploadPoint);le.loaded!=1&&(M.checkpoint=le.checkpoint,M.loaded=le.loaded,M.videoId=Z.VideoId,G._saveCheckoutpoint(M,le.checkpoint))}},function(Z){try{if((Z=JSON.parse(Z))&&Z.Code=="InvalidParameter"&&Z.Message.indexOf("UserId")>0){G._invalidUserId=!0;var le=Z.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(le)}}catch(de){console.log(de)}})})}z&&(M.videoInfo=z?JSON.parse(z).Vod:{},M.userData=o.default.encode(z)),M.ri=y.default.create(),this._uploadList.push(M),this._reportLog("20001",M,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(M)}catch(J){console.log(J)}return!0}},{key:"deleteFile",value:function(w){return!!this.cancelFile(w)&&(this._uploadList.splice(w,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(w){if(this.options,w<0||w>=this._uploadList.length)return!1;var R=this._uploadList[w];if(w==this._curIndex&&R.state==f.UPLOADSTATE.UPLOADING){R.state=f.UPLOADSTATE.CANCELED;var N=this._getCheckoutpoint(R);N&&N.checkpoint&&(N=N.checkpoint),N&&this._ossUpload.abort(R),this._removeCheckoutpoint(R),this.nextUpload()}else R.state!=f.UPLOADSTATE.SUCCESS&&(R.state=f.UPLOADSTATE.CANCELED);return this._reportLog("20008",R),!0}},{key:"resumeFile",value:function(w){if(this.options,w<0||w>=this._uploadList.length)return!1;var R=this._uploadList[w];return R.state==f.UPLOADSTATE.CANCELED&&(R.state=f.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(w){return this._getCheckoutpoint({file:w})}},{key:"startUpload",value:function(w){if(this._retryCount=0,this.options,this._state==f.VODSTATE.START||this._state==f.VODSTATE.EXPIRE)return void console.log("already started or expired");if(this._initState(),this._curIndex=this._findUploadIndex(),this._curIndex==-1)return void(this._state=f.VODSTATE.END);var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R),this._state=f.VODSTATE.START}},{key:"nextUpload",value:function(){var w=this.options;if(this._state==f.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),this._curIndex!=-1){var R=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(R)}else{this._state=f.VODSTATE.END;try{w.onUploadEnd&&w.onUploadEnd(R)}catch(N){console.log(N)}}}},{key:"clear",value:function(w){for(var R=this.options,N=0,F=0;F<this._uploadList.length;F++)R.uploadList[F].state==f.UPLOADSTATE.SUCCESS&&N++,this._uploadList[F].state==w&&(R.uploadList.splice(F,1),F--);R.onClear&&R.onClear(R.uploadList.length,N)}},{key:"stopUpload",value:function(){if((this._state==f.VODSTATE.START||this._state==f.VODSTATE.FAILURE||this._curIndex==-1)&&this._curIndex!=-1){var w=this._uploadList[this._curIndex];this._state=f.VODSTATE.STOP,w.state=f.UPLOADSTATE.STOPED,this._changeState(w,f.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(w){var R=this;if(!w)return!1;var N=JSON.parse(o.default.decode(w));return!!(N.AccessKeyId&&N.AccessKeySecret&&N.SecurityToken&&N.Expiration)&&R.resumeUploadWithToken(N.AccessKeyId,N.AccessKeySecret,N.SecurityToken,N.Expiration)}},{key:"resumeUploadWithToken",value:function(w,R,N,F){if(this.options,!(w&&R&&N&&F))return!1;if(this._state!=f.VODSTATE.EXPIRE)return!1;if(this._curIndex==-1)return!1;var z="";return this._uploadList.length>this._curIndex&&(z=this._uploadList[this._curIndex]),z&&(this.init(w,R,N,F),this._state=f.VODSTATE.START,this._ossUpload=null,this._uploadCore(z,z.retry),z.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(w,R,N){if(this._curIndex==-1)return!1;if(this._state!=f.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var F=this._uploadList[this._curIndex];F.object?this._refreshSTSTokenUpload(F,w,R,N):this.setSTSToken(F,w,R,N)}}},{key:"setSTSTokenDirectlyUpload",value:function(w,R,N,F,z){if(!(R&&N&&F&&z))return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken and expiration should not be empty."),!1;this._ut="oss";var q=w;this.init(R,N,F,z),q.endpoint=q._endpoint,q.bucket=q._bucket,q.object=q._object,this._ossUpload=null,this._uploadCore(q,w.retry),w.retry=!1}},{key:"setSTSToken",value:function(w,R,N,F){if(!R||!N||!F)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var z=w.videoInfo,q={accessKeyId:R,securityToken:F,accessKeySecret:N,fileName:w.file.name,title:z.Title,requestId:w.ri,region:this.options.region};z.ImageType&&(q.imageType=z.ImageType),z.ImageExt&&(q.imageExt=z.ImageExt),z.FileSize&&(q.fileSize=z.FileSize),z.Description&&(q.description=z.Description),z.CateId&&(q.cateId=z.CateId),z.Tags&&(q.tags=z.Tags),z.TemplateGroupId&&(q.templateGroupId=z.TemplateGroupId),z.StorageLocation&&(q.storageLocation=z.StorageLocation),z.CoverURL&&(q.coverUrl=z.CoverURL),z.TransCodeMode&&(q.transCodeMode=z.TransCodeMode),z.UserData&&(q.userData=z.UserData);var B=this,M="getUploadAuth";w.videoId?(q.videoId=w.videoId,M="refreshUploadAuth"):w.isImage&&(M="getImageUploadAuth"),g.default[M](q,function(G){w.videoId=G.VideoId?G.VideoId:w.videoId,B.setUploadAuthAndAddress(w,G.UploadAuth,G.UploadAddress),B._state=f.VODSTATE.START},function(G){B._error(w,{name:G.Code,code:G.Code,message:G.Message,requestId:G.RequestId})})}},{key:"setUploadAuthAndAddress",value:function(w,R,N,F){if(!w||!R||!N)return!1;var z=JSON.parse(o.default.decode(R));if(!(z.AccessKeyId&&z.AccessKeySecret&&z.SecurityToken&&z.Expiration))return console.error("uploadauth is invalid"),!1;var q={},B=w;if(N){if(q=JSON.parse(o.default.decode(N)),!q.Endpoint||!q.Bucket||!q.FileName)return console.error("uploadAddress is invalid"),!1}else q.Endpoint=B.endpoint,q.Bucket=B.bucket,q.FileName=B.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),B.endpoint=B._endpoint?B._endpoint:q.Endpoint,B.bucket=B._bucket?B._bucket:q.Bucket,B.object=B._object?B._object:q.FileName,B.region=this.options.region,F&&(B.videoId=F),this._ossUpload=null,this._uploadCore(B,w.retry),w.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(w,R,N,F){if(!R||!N||!F)return console.log("accessKeyId\u3001ccessKeySecret\u3001securityToken should not be empty."),!1;var z={accessKeyId:R,securityToken:F,accessKeySecret:N,videoId:w.object,requestId:w.ri,region:this.options.region},q=this,B="refreshUploadAuth";w.isImage&&(B="getImageUploadAuth"),g.default[B](z,function(M){q.setUploadAuthAndAddress(w,M.UploadAuth,UploadAddress),q._state=f.VODSTATE.START},function(M){q._error(w,{name:M.Code,code:M.Code,message:M.Message,requestId:M.RequestId})})}},{key:"_upload",value:function(w){var R=arguments.length>1&&arguments[1]!==void 0&&arguments[1],N=this.options;if(w.retry=R,N.onUploadstarted&&!R)try{var F=this._getCheckoutpoint(w);F&&F.state!=f.UPLOADSTATE.UPLOADING&&(w.checkpoint=F,w.videoId=F.videoId),N.onUploadstarted(w)}catch(z){console.log(z)}}},{key:"_uploadCore",value:function(w){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(w.state=f.UPLOADSTATE.UPLOADING,!this._ossUpload){w.endpoint=w.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var R=this;this._ossUpload=new s.default({bucket:w.bucket,endpoint:w.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(G,J){R._error.call(R,G,J)},oncomplete:function(G,J){R._complete.call(R,G,J)},onprogress:function(G,J,K){R._progress.call(R,G,J,K)}})}var N=d.default.getFileType(w.file.name),F=this._getCheckoutpoint(w),z="",q="";F&&F.checkpoint&&(q=F.state,z=F.videoId,F=F.checkpoint),F&&z==w.videoId&&q!=f.UPLOADSTATE.UPLOADING&&(F.file=w.file,w.checkpoint=F,F.uploadId);var B=this._adjustPartSize(w);this._reportLog("20002",w,{ft:N,fs:w.file.size,bu:w.bucket,ok:w.object,vid:w.videoId||"",fn:w.file.name,fw:null,fh:null,ps:B});var M={headers:{"x-oss-notification":w.userData?w.userData:""},partSize:B,parallel:this.options.parallel};this._ossUpload.upload(w,M)}},{key:"_findUploadIndex",value:function(){for(var w=-1,R=0;R<this._uploadList.length;R++)if(this._uploadList[R].state==f.UPLOADSTATE.INIT){w=R;break}return w}},{key:"_error",value:function(w,R){if(R.name=="cancel")try{this.options.onUploadCanceled(w,R)}catch(F){console.log(F)}else{if(R.message.indexOf("InvalidAccessKeyIdError")>0||R.name=="SignatureDoesNotMatchError"||R.code=="SecurityTokenExpired"||R.code=="InvalidSecurityToken.Expired"||R.code=="InvalidAccessKeyId"&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=f.VODSTATE.EXPIRE,w.state=f.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(w,R)}catch(F){console.log(F)}}return}if((R.name=="RequestTimeoutError"||R.name=="ConnectionTimeout"||R.name=="ConnectionTimeoutError")&&this._retryTotal>this._retryCount){var N=this;return setTimeout(function(){N._uploadCore(w,!0)},1e3*N._retryDuration),void this._retryCount++}R.name=="NoSuchUploadError"&&this._removeCheckoutpoint(w),this._handleError(w,R)}}},{key:"_handleError",value:function(w,R){var N=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],F=f.UPLOADSTATE.FAIlURE;if(w.state!=f.UPLOADSTATE.CANCELED&&(w.state=f.UPLOADSTATE.FAIlURE,this._state=f.VODSTATE.FAILURE,this.options.onUploadFailed&&R&&R.code&&R.message))try{this.options.onUploadFailed(w,R.code,R.message)}catch(q){console.log(q)}if(N&&this._changeState(w,F),this._reportLog("20006",w,{code:R.name,message:R.message,requestId:R.requestId,fs:w.file.size,bu:w.bucket,ok:w.object,fn:w.file.name}),this._reportLog("20004",w,{requestId:R.requestId,fs:w.file.size,bu:w.bucket,ok:w.object,fn:w.file.name}),w.ri=y.default.create(),this._findUploadIndex()!=-1){var z=this;this._state=f.VODSTATE.START,setTimeout(function(){z.nextUpload()},100)}}},{key:"_complete",value:function(w,R){if(w.state=f.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(w)}catch(z){console.log(z)}var N=0;R&&R.res&&R.res.headers&&(N=R.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(w);var F=this;setTimeout(function(){F.nextUpload()},100),this._retryCount=0,this._reportLog("20003",w,{requestId:N})}},{key:"_progress",value:function(w,R,N){if(this.options.onUploadProgress)try{w.loaded=R.loaded,this.options.onUploadProgress(w,R.total,R.loaded)}catch(J){console.log(J)}var F=R.checkpoint,z=0;F&&(w.checkpoint=F,this._saveCheckoutpoint(w,F,f.UPLOADSTATE.UPLOADING),z=F.uploadId),this._retryCount=0;var q=this._getPortNumber(F),B=0;if(N&&N.headers&&(B=N.headers["x-oss-request-id"]),R.loaded!=0&&this._reportLog("20007",w,{pn:q,requestId:B}),R.loaded!=1&&this._reportLog("20005",w,{UploadId:z,pn:q+1,pr:w.retry?1:0,fs:w.file.size,bu:w.bucket,ok:w.object,fn:w.file.name}),!this._invalidUserId&&!w.isImage&&this._ut=="vod"&&this.options.enableUploadProgress){var M={file:w.file,checkpoint:R,userId:this.options.userId,videoId:w.videoId,region:this.options.region,fileHash:w.fileHash};try{var G=this;_.default.upload(M,function(){},function(J){if((J=JSON.parse(J))&&J.Code=="InvalidParameter"&&J.Message.indexOf("UserId")>0){G._invalidUserId=!0;var K=J.Message+"\uFF0C\u6B63\u786E\u8D26\u53F7ID(userId)\u8BF7\u53C2\u8003\uFF1Ahttps://help.aliyun.com/knowledge_detail/37196.html";console.log(K)}})}catch(J){console.log(J)}}}},{key:"_getPortNumber",value:function(w){if(w){var R=w.doneParts;if(R&&R.length>0)return R[R.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(w){var R=this._getCheckoutpointKey(w);l.default.remove(R)}},{key:"_getCheckoutpoint",value:function(w){var R=this._getCheckoutpointKey(w),N=l.default.get(R);if(N)try{return JSON.parse(N)}catch(F){}return""}},{key:"_saveCheckoutpoint",value:function(w,R,N){if(R){var F=this._getCheckoutpointKey(w),z=w.file,q={fileName:z.name,lastModified:z.lastModified,size:z.size,object:w.object,videoId:w.videoId,bucket:w.bucket,endpoint:w.endpoint,checkpoint:R,loaded:w.loaded,state:N};l.default.set(F,JSON.stringify(q))}}},{key:"_changeState",value:function(w,R){var N=this._getCheckoutpoint(w);N&&((this._onbeforeunload=!0)&&(R=f.UPLOADSTATE.STOPED),this._saveCheckoutpoint(w,N.checkpoint,R))}},{key:"_getCheckoutpointKey",value:function(w){return"upload_"+w.file.lastModified+"_"+w.file.name+"_"+w.file.size}},{key:"_getCheckoutpointFromCloud",value:function(w,R,N){var F={userId:this.options.userId,uploadInfoList:[{FileName:w.file.name,FileSize:w.file.size,FileCreateTime:w.file.lastModified,FileHash:w.fileHash}],region:this.options.region};_.default.get(F,function(z){R(z)},N)}},{key:"_reportLog",value:function(w,R,N){N||(N={}),N.ri=R.ri,this._ut&&(N.ut=this._ut),this._log.log(w,N)}},{key:"_initEvent",value:function(){var w=this;window&&(window.onbeforeunload=function(R){if(w._onbeforeunload=!0,w._curIndex!=-1&&w._uploadList.length>w._curIndex){var N=w._uploadList[w._curIndex];w._changeState(N,f.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var w=0;w<this._uploadList.length;w++){var R=this._uploadList[w];R.state!=f.UPLOADSTATE.FAIlURE&&R.state!=f.UPLOADSTATE.STOPED||(R.state=f.UPLOADSTATE.INIT)}this._state=f.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(w){return w.file.size/this.options.partSize>1e4?w.file.size/9999:this.options.partSize}}]),S}());C.default=E},function(W,C,D){"use strict";Object.defineProperty(C,"__esModule",{value:!0}),C.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},C.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(W,C,D){"use strict";function T(n){return n&&n.__esModule?n:{default:n}}function A(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function n(o,r){for(var l=0;l<r.length;l++){var a=r[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}return function(o,r,l){return r&&n(o.prototype,r),l&&n(o,l),o}}(),f=D(3),p=D(17),c=(T(p),D(1)),s=(T(c),function(){function n(o,r){if(A(this,n),o){this._config=o,this.create(this._config),this._uploadInfo=null,this._callback={};var l=function(){};this._callback.onerror=r.onerror||l,this._callback.oncomplete=r.oncomplete||l,this._callback.onprogress=r.onprogress||l}}return O(n,[{key:"create",value:function(o){if(o.endpoint=o.endpoint||this._config.endpoint,o.bucket=o.bucket||this._config.bucket,!(o.AccessKeyId&&o.AccessKeySecret&&o.endpoint&&o.SecurityToken))throw new Error("AccessKeyId\u3001AccessKeySecret\u3001endpoint should not be null");var r={accessKeyId:o.AccessKeyId,accessKeySecret:o.AccessKeySecret,stsToken:o.SecurityToken,endpoint:o.endpoint||this._config.endpoint,bucket:o.bucket||this._config.bucket,secure:!0,cname:o.cname};o.timeout&&(r.timeout=o.timeout),this.oss=new OSS.Wrapper(r)}},{key:"abort",value:function(o){if(o.checkpoint){var r=o.checkpoint.uploadId;this.oss.abortMultipartUpload(o.object,r)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(o,r){this._uploadInfo=o;var l=this,a=function(t,d,v){return function(y){l._progress(t,d,v),y()}},i={parallel:r.parallel||this._config.parallel||f.UPLOADDEFAULT.PARALLEL,partSize:r.partSize||this._config.partSize||f.UPLOADDEFAULT.PARTSIZE,progress:a};r.headers&&(i.headers=r.headers),o.checkpoint&&(i.checkpoint=o.checkpoint),o.bucket||(this.oss.options.bucket=o.bucket),o.endpoint||(this.oss.options.endpoint=o.endpoint),this.oss.multipartUpload(o.object,o.file,i).then(function(t,d){l._complete(t)}).catch(function(t){l.oss.cancel&&(l.oss&&l.oss.isCancel()?console.log("oss is cancel as error"):l.oss.cancel()),l._error(t)})}},{key:"header",value:function(o,r,l){this.oss.get(o.object).then(function(a){r(a)}).catch(function(a){l(a)})}},{key:"_progress",value:function(o,r,l){this._callback.onprogress(this._uploadInfo,{loaded:o,total:this._uploadInfo.file.size,checkpoint:r},l)}},{key:"_error",value:function(o){this._callback.onerror(this._uploadInfo,o)}},{key:"_complete",value:function(o){this._callback.oncomplete(this._uploadInfo,o)}}]),n}());C.default=s},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}(),O=function(){function f(){T(this,f)}return A(f,null,[{key:"format",value:function(p){if(arguments.length<2)return null;for(var c=arguments[1],s=1;s<arguments.length;s++){var n=new RegExp("\\{"+(s-1)+"\\}","gm");c=c.replace(n,arguments[s+1])}return{code:p,message:c}}},{key:"CODE",get:function(){return{SUCCESS:"Successful",EmptyValue:"InvalidParameter.EmptyValue",STSInvalid:"InvalidParameter.TokenInvalid",ReadFileError:"ReadFileError",FILEDUPLICATION:"FileDuplication",UploadALEADRYSTARTED:"UploadAlearyStarted"}}},{key:"MESSAGE",get:function(){return{SUCCESS:"Successful",EmptyValue:"\u53C2\u6570 {0} \u4E0D\u80FD\u4E3A\u7A7A\u3002",STSInvalid:"STS\u53C2\u6570\u975E\u6CD5\uFF0C accessKeyId\u3001accessKeySecret\u3001secretToken\u3001expireTime\u90FD\u4E0D\u80FD\u4E3A\u7A7A\u3002",ReadFileError:"\u8BFB\u53D6\u6587\u4EF6{0}{1}\u5931\u8D25.",FILEDUPLICATION:"\u6587\u4EF6\u91CD\u590D\u6DFB\u52A0 {0}",UploadALEADRYSTARTED:"\u91CD\u590D\u5F00\u59CB."}}}]),f}();C.default=O},function(W,C,D){"use strict";(function(T){function A(p,c){if(!(p instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function p(c,s){for(var n=0;n<s.length;n++){var o=s[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}return function(c,s,n){return s&&p(c.prototype,s),n&&p(c,n),c}}(),f=function(){function p(){A(this,p)}return O(p,null,[{key:"encode",value:function(c){return new T(c).toString("base64")}},{key:"decode",value:function(c){return new T(c,"base64").toString()}}]),p}();C.default=f}).call(C,D(19).Buffer)},function(W,C,D){"use strict";(function(T){function A(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function O(re,P){if(A()<P)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(re=new Uint8Array(P),re.__proto__=f.prototype):(re===null&&(re=new f(P)),re.length=P),re}function f(re,P,j){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(re,P,j);if(typeof re=="number"){if(typeof P=="string")throw new Error("If encoding is specified then the first argument must be a string");return n(this,re)}return p(this,re,P,j)}function p(re,P,j,ee){if(typeof P=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&P instanceof ArrayBuffer?l(re,P,j,ee):typeof P=="string"?o(re,P,j):a(re,P)}function c(re){if(typeof re!="number")throw new TypeError('"size" argument must be a number');if(re<0)throw new RangeError('"size" argument must not be negative')}function s(re,P,j,ee){return c(P),P<=0?O(re,P):j!==void 0?typeof ee=="string"?O(re,P).fill(j,ee):O(re,P).fill(j):O(re,P)}function n(re,P){if(c(P),re=O(re,P<0?0:0|i(P)),!f.TYPED_ARRAY_SUPPORT)for(var j=0;j<P;++j)re[j]=0;return re}function o(re,P,j){if(typeof j=="string"&&j!==""||(j="utf8"),!f.isEncoding(j))throw new TypeError('"encoding" must be a valid string encoding');var ee=0|d(P,j);re=O(re,ee);var $=re.write(P,j);return $!==ee&&(re=re.slice(0,$)),re}function r(re,P){var j=P.length<0?0:0|i(P.length);re=O(re,j);for(var ee=0;ee<j;ee+=1)re[ee]=255&P[ee];return re}function l(re,P,j,ee){if(P.byteLength,j<0||P.byteLength<j)throw new RangeError("'offset' is out of bounds");if(P.byteLength<j+(ee||0))throw new RangeError("'length' is out of bounds");return P=j===void 0&&ee===void 0?new Uint8Array(P):ee===void 0?new Uint8Array(P,j):new Uint8Array(P,j,ee),f.TYPED_ARRAY_SUPPORT?(re=P,re.__proto__=f.prototype):re=r(re,P),re}function a(re,P){if(f.isBuffer(P)){var j=0|i(P.length);return re=O(re,j),re.length===0||P.copy(re,0,0,j),re}if(P){if(typeof ArrayBuffer!="undefined"&&P.buffer instanceof ArrayBuffer||"length"in P)return typeof P.length!="number"||Ge(P.length)?O(re,0):r(re,P);if(P.type==="Buffer"&&We(P.data))return r(re,P.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function i(re){if(re>=A())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A().toString(16)+" bytes");return 0|re}function t(re){return+re!=re&&(re=0),f.alloc(+re)}function d(re,P){if(f.isBuffer(re))return re.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(re)||re instanceof ArrayBuffer))return re.byteLength;typeof re!="string"&&(re=""+re);var j=re.length;if(j===0)return 0;for(var ee=!1;;)switch(P){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":case void 0:return _e(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*j;case"hex":return j>>>1;case"base64":return Me(re).length;default:if(ee)return _e(re).length;P=(""+P).toLowerCase(),ee=!0}}function v(re,P,j){var ee=!1;if((P===void 0||P<0)&&(P=0),P>this.length)return"";if((j===void 0||j>this.length)&&(j=this.length),j<=0)return"";if(j>>>=0,P>>>=0,j<=P)return"";for(re||(re="utf8");;)switch(re){case"hex":return q(this,P,j);case"utf8":case"utf-8":return R(this,P,j);case"ascii":return F(this,P,j);case"latin1":case"binary":return z(this,P,j);case"base64":return w(this,P,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,P,j);default:if(ee)throw new TypeError("Unknown encoding: "+re);re=(re+"").toLowerCase(),ee=!0}}function y(re,P,j){var ee=re[P];re[P]=re[j],re[j]=ee}function b(re,P,j,ee,$){if(re.length===0)return-1;if(typeof j=="string"?(ee=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,isNaN(j)&&(j=$?0:re.length-1),j<0&&(j=re.length+j),j>=re.length){if($)return-1;j=re.length-1}else if(j<0){if(!$)return-1;j=0}if(typeof P=="string"&&(P=f.from(P,ee)),f.isBuffer(P))return P.length===0?-1:g(re,P,j,ee,$);if(typeof P=="number")return P&=255,f.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(re,P,j):Uint8Array.prototype.lastIndexOf.call(re,P,j):g(re,[P],j,ee,$);throw new TypeError("val must be string, number or Buffer")}function g(re,P,j,ee,$){function Q(qe,Ye){return xe===1?qe[Ye]:qe.readUInt16BE(Ye*xe)}var xe=1,De=re.length,dt=P.length;if(ee!==void 0&&((ee=String(ee).toLowerCase())==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(re.length<2||P.length<2)return-1;xe=2,De/=2,dt/=2,j/=2}var Ne;if($){var Be=-1;for(Ne=j;Ne<De;Ne++)if(Q(re,Ne)===Q(P,Be===-1?0:Ne-Be)){if(Be===-1&&(Be=Ne),Ne-Be+1===dt)return Be*xe}else Be!==-1&&(Ne-=Ne-Be),Be=-1}else for(j+dt>De&&(j=De-dt),Ne=j;Ne>=0;Ne--){for(var tt=!0,lt=0;lt<dt;lt++)if(Q(re,Ne+lt)!==Q(P,lt)){tt=!1;break}if(tt)return Ne}return-1}function m(re,P,j,ee){j=Number(j)||0;var $=re.length-j;ee?(ee=Number(ee))>$&&(ee=$):ee=$;var Q=P.length;if(Q%2!=0)throw new TypeError("Invalid hex string");ee>Q/2&&(ee=Q/2);for(var xe=0;xe<ee;++xe){var De=parseInt(P.substr(2*xe,2),16);if(isNaN(De))return xe;re[j+xe]=De}return xe}function _(re,P,j,ee){return Fe(_e(P,re.length-j),re,j,ee)}function x(re,P,j,ee){return Fe(ye(P),re,j,ee)}function h(re,P,j,ee){return x(re,P,j,ee)}function E(re,P,j,ee){return Fe(Me(P),re,j,ee)}function S(re,P,j,ee){return Fe(Ke(P,re.length-j),re,j,ee)}function w(re,P,j){return P===0&&j===re.length?Ee.fromByteArray(re):Ee.fromByteArray(re.slice(P,j))}function R(re,P,j){j=Math.min(re.length,j);for(var ee=[],$=P;$<j;){var Q=re[$],xe=null,De=Q>239?4:Q>223?3:Q>191?2:1;if($+De<=j){var dt,Ne,Be,tt;switch(De){case 1:Q<128&&(xe=Q);break;case 2:dt=re[$+1],(192&dt)==128&&(tt=(31&Q)<<6|63&dt)>127&&(xe=tt);break;case 3:dt=re[$+1],Ne=re[$+2],(192&dt)==128&&(192&Ne)==128&&(tt=(15&Q)<<12|(63&dt)<<6|63&Ne)>2047&&(tt<55296||tt>57343)&&(xe=tt);break;case 4:dt=re[$+1],Ne=re[$+2],Be=re[$+3],(192&dt)==128&&(192&Ne)==128&&(192&Be)==128&&(tt=(15&Q)<<18|(63&dt)<<12|(63&Ne)<<6|63&Be)>65535&&tt<1114112&&(xe=tt)}}xe===null?(xe=65533,De=1):xe>65535&&(xe-=65536,ee.push(xe>>>10&1023|55296),xe=56320|1023&xe),ee.push(xe),$+=De}return N(ee)}function N(re){var P=re.length;if(P<=He)return String.fromCharCode.apply(String,re);for(var j="",ee=0;ee<P;)j+=String.fromCharCode.apply(String,re.slice(ee,ee+=He));return j}function F(re,P,j){var ee="";j=Math.min(re.length,j);for(var $=P;$<j;++$)ee+=String.fromCharCode(127&re[$]);return ee}function z(re,P,j){var ee="";j=Math.min(re.length,j);for(var $=P;$<j;++$)ee+=String.fromCharCode(re[$]);return ee}function q(re,P,j){var ee=re.length;(!P||P<0)&&(P=0),(!j||j<0||j>ee)&&(j=ee);for(var $="",Q=P;Q<j;++Q)$+=Ie(re[Q]);return $}function B(re,P,j){for(var ee=re.slice(P,j),$="",Q=0;Q<ee.length;Q+=2)$+=String.fromCharCode(ee[Q]+256*ee[Q+1]);return $}function M(re,P,j){if(re%1!=0||re<0)throw new RangeError("offset is not uint");if(re+P>j)throw new RangeError("Trying to access beyond buffer length")}function G(re,P,j,ee,$,Q){if(!f.isBuffer(re))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>$||P<Q)throw new RangeError('"value" argument is out of bounds');if(j+ee>re.length)throw new RangeError("Index out of range")}function J(re,P,j,ee){P<0&&(P=65535+P+1);for(var $=0,Q=Math.min(re.length-j,2);$<Q;++$)re[j+$]=(P&255<<8*(ee?$:1-$))>>>8*(ee?$:1-$)}function K(re,P,j,ee){P<0&&(P=4294967295+P+1);for(var $=0,Q=Math.min(re.length-j,4);$<Q;++$)re[j+$]=P>>>8*(ee?$:3-$)&255}function Z(re,P,j,ee,$,Q){if(j+ee>re.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function le(re,P,j,ee,$){return $||Z(re,P,j,4,34028234663852886e22,-34028234663852886e22),me.write(re,P,j,ee,23,4),j+4}function de(re,P,j,ee,$){return $||Z(re,P,j,8,17976931348623157e292,-17976931348623157e292),me.write(re,P,j,ee,52,8),j+8}function Te(re){if(re=we(re).replace(it,""),re.length<2)return"";for(;re.length%4!=0;)re+="=";return re}function we(re){return re.trim?re.trim():re.replace(/^\s+|\s+$/g,"")}function Ie(re){return re<16?"0"+re.toString(16):re.toString(16)}function _e(re,P){P=P||1/0;for(var j,ee=re.length,$=null,Q=[],xe=0;xe<ee;++xe){if((j=re.charCodeAt(xe))>55295&&j<57344){if(!$){if(j>56319){(P-=3)>-1&&Q.push(239,191,189);continue}if(xe+1===ee){(P-=3)>-1&&Q.push(239,191,189);continue}$=j;continue}if(j<56320){(P-=3)>-1&&Q.push(239,191,189),$=j;continue}j=65536+($-55296<<10|j-56320)}else $&&(P-=3)>-1&&Q.push(239,191,189);if($=null,j<128){if((P-=1)<0)break;Q.push(j)}else if(j<2048){if((P-=2)<0)break;Q.push(j>>6|192,63&j|128)}else if(j<65536){if((P-=3)<0)break;Q.push(j>>12|224,j>>6&63|128,63&j|128)}else{if(!(j<1114112))throw new Error("Invalid code point");if((P-=4)<0)break;Q.push(j>>18|240,j>>12&63|128,j>>6&63|128,63&j|128)}}return Q}function ye(re){for(var P=[],j=0;j<re.length;++j)P.push(255&re.charCodeAt(j));return P}function Ke(re,P){for(var j,ee,$,Q=[],xe=0;xe<re.length&&!((P-=2)<0);++xe)j=re.charCodeAt(xe),ee=j>>8,$=j%256,Q.push($),Q.push(ee);return Q}function Me(re){return Ee.toByteArray(Te(re))}function Fe(re,P,j,ee){for(var $=0;$<ee&&!($+j>=P.length||$>=re.length);++$)P[$+j]=re[$];return $}function Ge(re){return re!==re}/*!
|
|
|
* The buffer module from node.js, for the browser.
|
|
|
*
|
|
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
|
* @license MIT
|
|
|
*/var Ee=D(21),me=D(22),We=D(23);C.Buffer=f,C.SlowBuffer=t,C.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=T.TYPED_ARRAY_SUPPORT!==void 0?T.TYPED_ARRAY_SUPPORT:function(){try{var re=new Uint8Array(1);return re.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},re.foo()===42&&typeof re.subarray=="function"&&re.subarray(1,1).byteLength===0}catch(P){return!1}}(),C.kMaxLength=A(),f.poolSize=8192,f._augment=function(re){return re.__proto__=f.prototype,re},f.from=function(re,P,j){return p(null,re,P,j)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(re,P,j){return s(null,re,P,j)},f.allocUnsafe=function(re){return n(null,re)},f.allocUnsafeSlow=function(re){return n(null,re)},f.isBuffer=function(re){return!(re==null||!re._isBuffer)},f.compare=function(re,P){if(!f.isBuffer(re)||!f.isBuffer(P))throw new TypeError("Arguments must be Buffers");if(re===P)return 0;for(var j=re.length,ee=P.length,$=0,Q=Math.min(j,ee);$<Q;++$)if(re[$]!==P[$]){j=re[$],ee=P[$];break}return j<ee?-1:ee<j?1:0},f.isEncoding=function(re){switch(String(re).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(re,P){if(!We(re))throw new TypeError('"list" argument must be an Array of Buffers');if(re.length===0)return f.alloc(0);var j;if(P===void 0)for(P=0,j=0;j<re.length;++j)P+=re[j].length;var ee=f.allocUnsafe(P),$=0;for(j=0;j<re.length;++j){var Q=re[j];if(!f.isBuffer(Q))throw new TypeError('"list" argument must be an Array of Buffers');Q.copy(ee,$),$+=Q.length}return ee},f.byteLength=d,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var re=this.length;if(re%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var P=0;P<re;P+=2)y(this,P,P+1);return this},f.prototype.swap32=function(){var re=this.length;if(re%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var P=0;P<re;P+=4)y(this,P,P+3),y(this,P+1,P+2);return this},f.prototype.swap64=function(){var re=this.length;if(re%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var P=0;P<re;P+=8)y(this,P,P+7),y(this,P+1,P+6),y(this,P+2,P+5),y(this,P+3,P+4);return this},f.prototype.toString=function(){var re=0|this.length;return re===0?"":arguments.length===0?R(this,0,re):v.apply(this,arguments)},f.prototype.equals=function(re){if(!f.isBuffer(re))throw new TypeError("Argument must be a Buffer");return this===re||f.compare(this,re)===0},f.prototype.inspect=function(){var re="",P=C.INSPECT_MAX_BYTES;return this.length>0&&(re=this.toString("hex",0,P).match(/.{2}/g).join(" "),this.length>P&&(re+=" ... ")),"<Buffer "+re+">"},f.prototype.compare=function(re,P,j,ee,$){if(!f.isBuffer(re))throw new TypeError("Argument must be a Buffer");if(P===void 0&&(P=0),j===void 0&&(j=re?re.length:0),ee===void 0&&(ee=0),$===void 0&&($=this.length),P<0||j>re.length||ee<0||$>this.length)throw new RangeError("out of range index");if(ee>=$&&P>=j)return 0;if(ee>=$)return-1;if(P>=j)return 1;if(P>>>=0,j>>>=0,ee>>>=0,$>>>=0,this===re)return 0;for(var Q=$-ee,xe=j-P,De=Math.min(Q,xe),dt=this.slice(ee,$),Ne=re.slice(P,j),Be=0;Be<De;++Be)if(dt[Be]!==Ne[Be]){Q=dt[Be],xe=Ne[Be];break}return Q<xe?-1:xe<Q?1:0},f.prototype.includes=function(re,P,j){return this.indexOf(re,P,j)!==-1},f.prototype.indexOf=function(re,P,j){return b(this,re,P,j,!0)},f.prototype.lastIndexOf=function(re,P,j){return b(this,re,P,j,!1)},f.prototype.write=function(re,P,j,ee){if(P===void 0)ee="utf8",j=this.length,P=0;else if(j===void 0&&typeof P=="string")ee=P,j=this.length,P=0;else{if(!isFinite(P))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");P|=0,isFinite(j)?(j|=0,ee===void 0&&(ee="utf8")):(ee=j,j=void 0)}var $=this.length-P;if((j===void 0||j>$)&&(j=$),re.length>0&&(j<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");for(var Q=!1;;)switch(ee){case"hex":return m(this,re,P,j);case"utf8":case"utf-8":return _(this,re,P,j);case"ascii":return x(this,re,P,j);case"latin1":case"binary":return h(this,re,P,j);case"base64":return E(this,re,P,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,re,P,j);default:if(Q)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),Q=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var He=4096;f.prototype.slice=function(re,P){var j=this.length;re=~~re,P=P===void 0?j:~~P,re<0?(re+=j)<0&&(re=0):re>j&&(re=j),P<0?(P+=j)<0&&(P=0):P>j&&(P=j),P<re&&(P=re);var ee;if(f.TYPED_ARRAY_SUPPORT)ee=this.subarray(re,P),ee.__proto__=f.prototype;else{var $=P-re;ee=new f($,void 0);for(var Q=0;Q<$;++Q)ee[Q]=this[Q+re]}return ee},f.prototype.readUIntLE=function(re,P,j){re|=0,P|=0,j||M(re,P,this.length);for(var ee=this[re],$=1,Q=0;++Q<P&&($*=256);)ee+=this[re+Q]*$;return ee},f.prototype.readUIntBE=function(re,P,j){re|=0,P|=0,j||M(re,P,this.length);for(var ee=this[re+--P],$=1;P>0&&($*=256);)ee+=this[re+--P]*$;return ee},f.prototype.readUInt8=function(re,P){return P||M(re,1,this.length),this[re]},f.prototype.readUInt16LE=function(re,P){return P||M(re,2,this.length),this[re]|this[re+1]<<8},f.prototype.readUInt16BE=function(re,P){return P||M(re,2,this.length),this[re]<<8|this[re+1]},f.prototype.readUInt32LE=function(re,P){return P||M(re,4,this.length),(this[re]|this[re+1]<<8|this[re+2]<<16)+16777216*this[re+3]},f.prototype.readUInt32BE=function(re,P){return P||M(re,4,this.length),16777216*this[re]+(this[re+1]<<16|this[re+2]<<8|this[re+3])},f.prototype.readIntLE=function(re,P,j){re|=0,P|=0,j||M(re,P,this.length);for(var ee=this[re],$=1,Q=0;++Q<P&&($*=256);)ee+=this[re+Q]*$;return $*=128,ee>=$&&(ee-=Math.pow(2,8*P)),ee},f.prototype.readIntBE=function(re,P,j){re|=0,P|=0,j||M(re,P,this.length);for(var ee=P,$=1,Q=this[re+--ee];ee>0&&($*=256);)Q+=this[re+--ee]*$;return $*=128,Q>=$&&(Q-=Math.pow(2,8*P)),Q},f.prototype.readInt8=function(re,P){return P||M(re,1,this.length),128&this[re]?-1*(255-this[re]+1):this[re]},f.prototype.readInt16LE=function(re,P){P||M(re,2,this.length);var j=this[re]|this[re+1]<<8;return 32768&j?4294901760|j:j},f.prototype.readInt16BE=function(re,P){P||M(re,2,this.length);var j=this[re+1]|this[re]<<8;return 32768&j?4294901760|j:j},f.prototype.readInt32LE=function(re,P){return P||M(re,4,this.length),this[re]|this[re+1]<<8|this[re+2]<<16|this[re+3]<<24},f.prototype.readInt32BE=function(re,P){return P||M(re,4,this.length),this[re]<<24|this[re+1]<<16|this[re+2]<<8|this[re+3]},f.prototype.readFloatLE=function(re,P){return P||M(re,4,this.length),me.read(this,re,!0,23,4)},f.prototype.readFloatBE=function(re,P){return P||M(re,4,this.length),me.read(this,re,!1,23,4)},f.prototype.readDoubleLE=function(re,P){return P||M(re,8,this.length),me.read(this,re,!0,52,8)},f.prototype.readDoubleBE=function(re,P){return P||M(re,8,this.length),me.read(this,re,!1,52,8)},f.prototype.writeUIntLE=function(re,P,j,ee){(re=+re,P|=0,j|=0,!ee)&&G(this,re,P,j,Math.pow(2,8*j)-1,0);var $=1,Q=0;for(this[P]=255&re;++Q<j&&($*=256);)this[P+Q]=re/$&255;return P+j},f.prototype.writeUIntBE=function(re,P,j,ee){(re=+re,P|=0,j|=0,!ee)&&G(this,re,P,j,Math.pow(2,8*j)-1,0);var $=j-1,Q=1;for(this[P+$]=255&re;--$>=0&&(Q*=256);)this[P+$]=re/Q&255;return P+j},f.prototype.writeUInt8=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,1,255,0),f.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),this[P]=255&re,P+1},f.prototype.writeUInt16LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[P]=255&re,this[P+1]=re>>>8):J(this,re,P,!0),P+2},f.prototype.writeUInt16BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>8,this[P+1]=255&re):J(this,re,P,!1),P+2},f.prototype.writeUInt32LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[P+3]=re>>>24,this[P+2]=re>>>16,this[P+1]=re>>>8,this[P]=255&re):K(this,re,P,!0),P+4},f.prototype.writeUInt32BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>24,this[P+1]=re>>>16,this[P+2]=re>>>8,this[P+3]=255&re):K(this,re,P,!1),P+4},f.prototype.writeIntLE=function(re,P,j,ee){if(re=+re,P|=0,!ee){var $=Math.pow(2,8*j-1);G(this,re,P,j,$-1,-$)}var Q=0,xe=1,De=0;for(this[P]=255&re;++Q<j&&(xe*=256);)re<0&&De===0&&this[P+Q-1]!==0&&(De=1),this[P+Q]=(re/xe>>0)-De&255;return P+j},f.prototype.writeIntBE=function(re,P,j,ee){if(re=+re,P|=0,!ee){var $=Math.pow(2,8*j-1);G(this,re,P,j,$-1,-$)}var Q=j-1,xe=1,De=0;for(this[P+Q]=255&re;--Q>=0&&(xe*=256);)re<0&&De===0&&this[P+Q+1]!==0&&(De=1),this[P+Q]=(re/xe>>0)-De&255;return P+j},f.prototype.writeInt8=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,1,127,-128),f.TYPED_ARRAY_SUPPORT||(re=Math.floor(re)),re<0&&(re=255+re+1),this[P]=255&re,P+1},f.prototype.writeInt16LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[P]=255&re,this[P+1]=re>>>8):J(this,re,P,!0),P+2},f.prototype.writeInt16BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>8,this[P+1]=255&re):J(this,re,P,!1),P+2},f.prototype.writeInt32LE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[P]=255&re,this[P+1]=re>>>8,this[P+2]=re>>>16,this[P+3]=re>>>24):K(this,re,P,!0),P+4},f.prototype.writeInt32BE=function(re,P,j){return re=+re,P|=0,j||G(this,re,P,4,2147483647,-2147483648),re<0&&(re=4294967295+re+1),f.TYPED_ARRAY_SUPPORT?(this[P]=re>>>24,this[P+1]=re>>>16,this[P+2]=re>>>8,this[P+3]=255&re):K(this,re,P,!1),P+4},f.prototype.writeFloatLE=function(re,P,j){return le(this,re,P,!0,j)},f.prototype.writeFloatBE=function(re,P,j){return le(this,re,P,!1,j)},f.prototype.writeDoubleLE=function(re,P,j){return de(this,re,P,!0,j)},f.prototype.writeDoubleBE=function(re,P,j){return de(this,re,P,!1,j)},f.prototype.copy=function(re,P,j,ee){if(j||(j=0),ee||ee===0||(ee=this.length),P>=re.length&&(P=re.length),P||(P=0),ee>0&&ee<j&&(ee=j),ee===j)return 0;if(re.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(j<0||j>=this.length)throw new RangeError("sourceStart out of bounds");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),re.length-P<ee-j&&(ee=re.length-P+j);var $,Q=ee-j;if(this===re&&j<P&&P<ee)for($=Q-1;$>=0;--$)re[$+P]=this[$+j];else if(Q<1e3||!f.TYPED_ARRAY_SUPPORT)for($=0;$<Q;++$)re[$+P]=this[$+j];else Uint8Array.prototype.set.call(re,this.subarray(j,j+Q),P);return Q},f.prototype.fill=function(re,P,j,ee){if(typeof re=="string"){if(typeof P=="string"?(ee=P,P=0,j=this.length):typeof j=="string"&&(ee=j,j=this.length),re.length===1){var $=re.charCodeAt(0);$<256&&(re=$)}if(ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!f.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee)}else typeof re=="number"&&(re&=255);if(P<0||this.length<P||this.length<j)throw new RangeError("Out of range index");if(j<=P)return this;P>>>=0,j=j===void 0?this.length:j>>>0,re||(re=0);var Q;if(typeof re=="number")for(Q=P;Q<j;++Q)this[Q]=re;else{var xe=f.isBuffer(re)?re:_e(new f(re,ee).toString()),De=xe.length;for(Q=0;Q<j-P;++Q)this[Q+P]=xe[Q%De]}return this};var it=/[^+\/0-9A-Za-z-_]/g}).call(C,D(20))},function(W,C){var D;D=function(){return this}();try{D=D||Function("return this")()||(0,eval)("this")}catch(T){typeof window=="object"&&(D=window)}W.exports=D},function(W,C,D){"use strict";function T(i){var t=i.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return i[t-2]==="="?2:i[t-1]==="="?1:0}function A(i){return 3*i.length/4-T(i)}function O(i){var t,d,v,y,b,g=i.length;y=T(i),b=new o(3*g/4-y),d=y>0?g-4:g;var m=0;for(t=0;t<d;t+=4)v=n[i.charCodeAt(t)]<<18|n[i.charCodeAt(t+1)]<<12|n[i.charCodeAt(t+2)]<<6|n[i.charCodeAt(t+3)],b[m++]=v>>16&255,b[m++]=v>>8&255,b[m++]=255&v;return y===2?(v=n[i.charCodeAt(t)]<<2|n[i.charCodeAt(t+1)]>>4,b[m++]=255&v):y===1&&(v=n[i.charCodeAt(t)]<<10|n[i.charCodeAt(t+1)]<<4|n[i.charCodeAt(t+2)]>>2,b[m++]=v>>8&255,b[m++]=255&v),b}function f(i){return s[i>>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]}function p(i,t,d){for(var v,y=[],b=t;b<d;b+=3)v=(i[b]<<16)+(i[b+1]<<8)+i[b+2],y.push(f(v));return y.join("")}function c(i){for(var t,d=i.length,v=d%3,y="",b=[],g=0,m=d-v;g<m;g+=16383)b.push(p(i,g,g+16383>m?m:g+16383));return v===1?(t=i[d-1],y+=s[t>>2],y+=s[t<<4&63],y+="=="):v===2&&(t=(i[d-2]<<8)+i[d-1],y+=s[t>>10],y+=s[t>>4&63],y+=s[t<<2&63],y+="="),b.push(y),b.join("")}C.byteLength=A,C.toByteArray=O,C.fromByteArray=c;for(var s=[],n=[],o=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,a=r.length;l<a;++l)s[l]=r[l],n[r.charCodeAt(l)]=l;n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(W,C){C.read=function(D,T,A,O,f){var p,c,s=8*f-O-1,n=(1<<s)-1,o=n>>1,r=-7,l=A?f-1:0,a=A?-1:1,i=D[T+l];for(l+=a,p=i&(1<<-r)-1,i>>=-r,r+=s;r>0;p=256*p+D[T+l],l+=a,r-=8);for(c=p&(1<<-r)-1,p>>=-r,r+=O;r>0;c=256*c+D[T+l],l+=a,r-=8);if(p===0)p=1-o;else{if(p===n)return c?NaN:1/0*(i?-1:1);c+=Math.pow(2,O),p-=o}return(i?-1:1)*c*Math.pow(2,p-O)},C.write=function(D,T,A,O,f,p){var c,s,n,o=8*p-f-1,r=(1<<o)-1,l=r>>1,a=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=O?0:p-1,t=O?1:-1,d=T<0||T===0&&1/T<0?1:0;for(T=Math.abs(T),isNaN(T)||T===1/0?(s=isNaN(T)?1:0,c=r):(c=Math.floor(Math.log(T)/Math.LN2),T*(n=Math.pow(2,-c))<1&&(c--,n*=2),T+=c+l>=1?a/n:a*Math.pow(2,1-l),T*n>=2&&(c++,n/=2),c+l>=r?(s=0,c=r):c+l>=1?(s=(T*n-1)*Math.pow(2,f),c+=l):(s=T*Math.pow(2,l-1)*Math.pow(2,f),c=0));f>=8;D[A+i]=255&s,i+=t,s/=256,f-=8);for(c=c<<f|s,o+=f;o>0;D[A+i]=255&c,i+=t,c/=256,o-=8);D[A+i-t]|=128*d}},function(W,C){var D={}.toString;W.exports=Array.isArray||function(T){return D.call(T)=="[object Array]"}},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}(),O=function(){function f(){T(this,f)}return A(f,null,[{key:"set",value:function(p,c){try{window.localStorage&&localStorage.setItem(p,c)}catch(s){window[p+"_localStorage"]=c}}},{key:"get",value:function(p){try{if(window.localStorage)return localStorage.getItem(p)}catch(c){return window[p+"_localStorage"]}return""}},{key:"remove",value:function(p){try{window.localStorage&&localStorage.removeItem(p)}catch(c){delete window[p+"_localStorage"]}}}]),f}();C.default=O},function(W,C,D){"use strict";function T(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function f(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}return function(p,c,s){return c&&f(p.prototype,c),s&&f(p,s),p}}(),O=function(){function f(){T(this,f)}return A(f,null,[{key:"get",value:function(p){for(var c=p+"",s=document.cookie.split(";"),n=0;n<s.length;n++){var o=s[n].trim();if(o.indexOf(c)==0)return unescape(o.substring(c.length+1,o.length))}return""}},{key:"set",value:function(p,c,s){var n=new Date;n.setTime(n.getTime()+24*s*60*60*1e3);var o="expires="+n.toGMTString();document.cookie=p+"="+escape(c)+"; "+o}}]),f}();C.default=O},function(W,C,D){"use strict";function T(o){return o&&o.__esModule?o:{default:o}}function A(o,r){if(!(o instanceof r))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function o(r,l){for(var a=0;a<l.length;a++){var i=l[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}return function(r,l,a){return l&&o(r.prototype,l),a&&o(r,a),r}}(),f=D(8),p=T(f),c=D(9),s=T(c),n=function(){function o(){A(this,o)}return O(o,null,[{key:"refreshUploadAuth",value:function(r,l,a){var i=(s.default.randomUUID(),s.default.randomUUID()),t={AccessKeyId:r.accessKeyId,SecurityToken:r.securityToken,Action:"RefreshUploadVideo",VideoId:r.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:i,RequestId:r.requestId},d=s.default.makeUTF8sort(t,"=","&")+"&Signature="+s.default.aliyunEncodeURI(s.default.makeChangeSiga(t,r.accessKeySecret)),v="https://vod."+r.region+".aliyuncs.com/?"+d;p.default.get(v,function(y){var y=JSON.parse(y);l&&l(y)},function(y){if(a){var b=JSON.parse(y);a(b)}})}},{key:"getUploadAuth",value:function(r,l,a){var i=(s.default.randomUUID(),s.default.randomUUID()),t={AccessKeyId:r.accessKeyId,SecurityToken:r.securityToken,Action:"CreateUploadVideo",Title:r.title,FileName:r.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:i,RequestId:r.requestId};r.fileSize&&(t.FileSize=r.fileSize),r.description&&(t.Description=r.description),r.cateId&&(t.CateId=r.cateId),r.tags&&(t.Tags=r.tags),r.templateGroupId&&(t.TemplateGroupId=r.templateGroupId),r.storageLocation&&(t.StorageLocation=r.storageLocation),r.coverUrl&&(t.CoverURL=r.coverUrl),r.transCodeMode&&(t.TransCodeMode=r.transCodeMode),r.userData&&(t.UserData=JSON.stringify(r.userData));var d=s.default.makeUTF8sort(t,"=","&")+"&Signature="+s.default.aliyunEncodeURI(s.default.makeChangeSiga(t,r.accessKeySecret)),v="https://vod."+r.region+".aliyuncs.com/?"+d;p.default.get(v,function(y){try{y=JSON.parse(y)}catch(b){if(a)return void a({Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"})}l&&l(y)},function(y){if(a){var b={Code:"GetUploadAuthFailed",Message:"\u83B7\u53D6uploadauth\u5931\u8D25"};try{b=JSON.parse(y)}catch(g){}a(b)}})}},{key:"getImageUploadAuth",value:function(r,l,a){var i=(s.default.randomUUID(),s.default.randomUUID()),t={AccessKeyId:r.accessKeyId,SecurityToken:r.securityToken,Action:"CreateUploadImage",ImageType:r.imageType?r.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:i,RequestId:r.requestId};r.title&&(t.Title=r.title),r.imageExt&&(t.ImageExt=r.imageExt),r.tags&&(t.Tags=r.tags),r.storageLocation&&(t.StorageLocation=r.storageLocation);var d=s.default.makeUTF8sort(t,"=","&")+"&Signature="+s.default.aliyunEncodeURI(s.default.makeChangeSiga(t,r.accessKeySecret)),v="https://vod."+r.region+".aliyuncs.com/?"+d;p.default.get(v,function(y){y=JSON.parse(y),l&&l(y)},function(y){if(a){var b=JSON.parse(y);a(b)}})}}]),o}();C.default=n},function(W,C,D){!function(T,A,O){W.exports=C=A(D(0),D(28),D(29))}(0,function(T){return T.HmacSHA1})},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return function(){var A=T,O=A.lib,f=O.WordArray,p=O.Hasher,c=A.algo,s=[],n=c.SHA1=p.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,r){for(var l=this._hash.words,a=l[0],i=l[1],t=l[2],d=l[3],v=l[4],y=0;y<80;y++){if(y<16)s[y]=0|o[r+y];else{var b=s[y-3]^s[y-8]^s[y-14]^s[y-16];s[y]=b<<1|b>>>31}var g=(a<<5|a>>>27)+v+s[y];g+=y<20?1518500249+(i&t|~i&d):y<40?1859775393+(i^t^d):y<60?(i&t|i&d|t&d)-1894007588:(i^t^d)-899497514,v=d,d=t,t=i<<30|i>>>2,i=a,a=g}l[0]=l[0]+a|0,l[1]=l[1]+i|0,l[2]=l[2]+t|0,l[3]=l[3]+d|0,l[4]=l[4]+v|0},_doFinalize:function(){var o=this._data,r=o.words,l=8*this._nDataBytes,a=8*o.sigBytes;return r[a>>>5]|=128<<24-a%32,r[14+(a+64>>>9<<4)]=Math.floor(l/4294967296),r[15+(a+64>>>9<<4)]=l,o.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var o=p.clone.call(this);return o._hash=this._hash.clone(),o}});A.SHA1=p._createHelper(n),A.HmacSHA1=p._createHmacHelper(n)}(),T.SHA1})},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){!function(){var A=T,O=A.lib,f=O.Base,p=A.enc,c=p.Utf8,s=A.algo;s.HMAC=f.extend({init:function(n,o){n=this._hasher=new n.init,typeof o=="string"&&(o=c.parse(o));var r=n.blockSize,l=4*r;o.sigBytes>l&&(o=n.finalize(o)),o.clamp();for(var a=this._oKey=o.clone(),i=this._iKey=o.clone(),t=a.words,d=i.words,v=0;v<r;v++)t[v]^=1549556828,d[v]^=909522486;a.sigBytes=i.sigBytes=l,this.reset()},reset:function(){var n=this._hasher;n.reset(),n.update(this._iKey)},update:function(n){return this._hasher.update(n),this},finalize:function(n){var o=this._hasher,r=o.finalize(n);return o.reset(),o.finalize(this._oKey.clone().concat(r))}})}()})},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return function(){function A(s,n,o){for(var r=[],l=0,a=0;a<n;a++)if(a%4){var i=o[s.charCodeAt(a-1)]<<a%4*2,t=o[s.charCodeAt(a)]>>>6-a%4*2;r[l>>>2]|=(i|t)<<24-l%4*8,l++}return p.create(r,l)}var O=T,f=O.lib,p=f.WordArray,c=O.enc;c.Base64={stringify:function(s){var n=s.words,o=s.sigBytes,r=this._map;s.clamp();for(var l=[],a=0;a<o;a+=3)for(var i=n[a>>>2]>>>24-a%4*8&255,t=n[a+1>>>2]>>>24-(a+1)%4*8&255,d=n[a+2>>>2]>>>24-(a+2)%4*8&255,v=i<<16|t<<8|d,y=0;y<4&&a+.75*y<o;y++)l.push(r.charAt(v>>>6*(3-y)&63));var b=r.charAt(64);if(b)for(;l.length%4;)l.push(b);return l.join("")},parse:function(s){var n=s.length,o=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var l=0;l<o.length;l++)r[o.charCodeAt(l)]=l}var a=o.charAt(64);if(a){var i=s.indexOf(a);i!==-1&&(n=i)}return A(s,n,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),T.enc.Base64})},function(W,C,D){"use strict";function T(m){return m&&m.__esModule?m:{default:m}}function A(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var O=function(){function m(_,x){for(var h=0;h<x.length;h++){var E=x[h];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,h){return x&&m(_.prototype,x),h&&m(_,h),_}}(),f=D(8),p=T(f),c=D(7),s=T(c),n=D(4),o=T(n),r=D(6),l=T(r),a=D(1),i=T(a),t=D(9),d=T(t),v=D(2),y=D(11),b=D(10),g=function(){function m(){A(this,m)}return O(m,null,[{key:"getAuthInfo",value:function(_,x,h){var E=_+"|f#Ylm&^1TppeRhLg|"+h;return x&&(E=_+"|"+x+"|f#Ylm&^1TppeRhLg|"+h),v(b.parse(E)).toString(y)}},{key:"upload",value:function(_,x,h){var E=i.default.ISODateString(new Date),S=Math.floor(new Date().valueOf()/1e3),w=o.default.getClientId();w=o.default.setClientId(w);var R=m.getAuthInfo(_.userId,w,S),N=d.default.randomUUID(),F={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:s.default.browser.name+(s.default.browser.version||""),AppVersion:l.default.version,AuthTimestamp:S,Timestamp:E,AuthInfo:R,FileName:_.file.name,FileSize:_.file.size,FileCreateTime:_.file.lastModified,FileHash:_.fileHash,UploadId:_.checkpoint.checkpoint.uploadId,PartSize:_.checkpoint.checkpoint.partSize,DonePartsCount:_.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(_.checkpoint),UploadRatio:_.checkpoint.loaded,UserId:_.userId,VideoId:_.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:N};w&&(F.ClientId=w);var z=d.default.makeUTF8sort(F,"=","&")+"&Signature="+d.default.aliyunEncodeURI(d.default.makeChangeSiga(F,_.accessKeySecret)),q="https://vod."+_.region+".aliyuncs.com/?"+z;p.default.get(q,function(B){x&&x()},function(B){B&&(h(B),console.log(B))})}},{key:"get",value:function(_,x,h){var E=i.default.ISODateString(new Date),S=Math.floor(new Date().valueOf()/1e3),w=o.default.getClientId(),R=m.getAuthInfo(_.userId,w,S),N=d.default.randomUUID(),F={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:s.default.browser.name+(s.default.browser.version||""),AppVersion:l.default.version,AuthTimestamp:S,Timestamp:E,AuthInfo:R,UserId:_.userId,UploadInfoList:JSON.stringify(_.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:N};w&&(F.ClientId=w);var z=d.default.makeUTF8sort(F,"=","&")+"&Signature="+d.default.aliyunEncodeURI(d.default.makeChangeSiga(F,_.accessKeySecret)),q="https://vod."+_.region+".aliyuncs.com/?"+z;p.default.get(q,function(B){var M={},G=w;B=B?JSON.parse(B):{},B.UploadProgress&&B.UploadProgress.UploadProgressList&&B.UploadProgress.UploadProgressList.length>0&&(M=B.UploadProgress.UploadProgressList[0],G=M.ClientId),o.default.setClientId(G),x&&x(M)},function(B){B&&(h(B),console.log(B))})}}]),m}();C.default=g},function(W,C,D){"use strict";function T(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(C,"__esModule",{value:!0});var A=function(){function c(s,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,r.key,r)}}return function(s,n,o){return n&&c(s.prototype,n),o&&c(s,o),s}}(),O=D(2),f=D(33),p=(D(11),function(){function c(){T(this,c)}return A(c,null,[{key:"getMd5",value:function(s,n,o){var r=new FileReader;r.onload=function(i){try{if(i&&i.target){var t=O(f.parse(i.target.result)),d=t.toString();n(d)}}catch(v){console.log(v)}},r.onerror=function(i){console.log(i),errorCallback(i)};var l=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,a=l.call(s,0,1024);r.readAsBinaryString(a)}}]),c}());C.default=p},function(W,C,D){!function(T,A){W.exports=C=A(D(0))}(0,function(T){return T.enc.Latin1})}])}).call(this,V("IyRk"))},ps8w:function(nt,Xe,V){nt.exports=V.p+"static/show.6268a056.svg"},psGv:function(nt,Xe,V){var ce,ie;(function(){var W;(function(){"use strict";var A=[,,function(c){function s(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}s.prototype.clone_empty=function(){var r=new s(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},s.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},s.prototype.has_match=function(r){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(r))return!0;return!1},s.prototype.set_indent=function(r,l){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},s.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(r){this.__items.push(r);var l=r.lastIndexOf(`
|
|
|
`);l!==-1?this.__character_count=r.length-l:this.__character_count+=r.length},s.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function n(r,l){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),l=l||"",r.indent_level>0&&(l=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}n.prototype.get_indent_size=function(r,l){var a=this.__base_string_length;return l=l||0,r<0&&(a=0),a+=r*this.__indent_size,a+=l,a},n.prototype.get_indent_string=function(r,l){var a=this.__base_string;return l=l||0,r<0&&(r=0,a=""),l+=r*this.__indent_size,this.__ensure_cache(l),a+=this.__cache[l],a},n.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var r=this.__cache.length,l=0,a="";this.__indent_size&&r>=this.__indent_size&&(l=Math.floor(r/this.__indent_size),r-=l*this.__indent_size,a=new Array(l+1).join(this.__indent_string)),r&&(a+=new Array(r+1).join(" ")),this.__cache.push(a)};function o(r,l){this.__indent_cache=new n(r,l),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(r,l){return this.__indent_cache.get_indent_string(r,l)},o.prototype.get_indent_size=function(r,l){return this.__indent_cache.get_indent_size(r,l)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(r){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
|
`);return r!==`
|
|
|
`&&(a=a.replace(/[\n]/g,r)),a},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(r,l){return r=r||0,l=l||0,this.next_line.set_indent(r,l),this.__lines.length>1?(this.current_line.set_indent(r,l),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(r){for(var l=0;l<r.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},o.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},o.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},o.prototype.remove_indent=function(r){for(var l=this.__lines.length;r<l;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},o.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(r,l){for(var a=this.__lines.length-2;a>=0;){var i=this.__lines[a];if(i.is_empty())break;if(i.item(0).indexOf(r)!==0&&i.item(-1)!==l){this.__lines.splice(a+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},c.exports.Output=o},function(c){function s(n,o,r,l){this.type=n,this.text=o,this.comments_before=null,this.newlines=r||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}c.exports.Token=s},,,function(c){function s(r,l){this.raw_options=n(r,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(r,l){var a=this.raw_options[r],i=l||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(i=a.concat()):typeof a=="string"&&(i=a.split(/[^a-zA-Z0-9_\/\-]+/)),i},s.prototype._get_boolean=function(r,l){var a=this.raw_options[r],i=a===void 0?!!l:!!a;return i},s.prototype._get_characters=function(r,l){var a=this.raw_options[r],i=l||"";return typeof a=="string"&&(i=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),i},s.prototype._get_number=function(r,l){var a=this.raw_options[r];l=parseInt(l,10),isNaN(l)&&(l=0);var i=parseInt(a,10);return isNaN(i)&&(i=l),i},s.prototype._get_selection=function(r,l,a){var i=this._get_selection_list(r,l,a);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[r]+"'");return i[0]},s.prototype._get_selection_list=function(r,l,a){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[l[0]],!this._is_valid_selection(a,l))throw new Error("Invalid Default Value!");var i=this._get_array(r,a);if(!this._is_valid_selection(i,l))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[r]+"'");return i},s.prototype._is_valid_selection=function(r,l){return r.length&&l.length&&!r.some(function(a){return l.indexOf(a)===-1})};function n(r,l){var a={};r=o(r);var i;for(i in r)i!==l&&(a[i]=r[i]);if(l&&r[l])for(i in r[l])a[i]=r[l][i];return a}function o(r){var l={},a;for(a in r){var i=a.replace(/-/g,"_");l[i]=r[a]}return l}c.exports.Options=s,c.exports.normalizeOpts=o,c.exports.mergeOpts=n},,function(c){var s=RegExp.prototype.hasOwnProperty("sticky");function n(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__input.charAt(this.__position),this.__position+=1),o},n.prototype.peek=function(o){var r=null;return o=o||0,o+=this.__position,o>=0&&o<this.__input_length&&(r=this.__input.charAt(o)),r},n.prototype.__match=function(o,r){o.lastIndex=r;var l=o.exec(this.__input);return l&&!(s&&o.sticky)&&(l.index!==r&&(l=null)),l},n.prototype.test=function(o,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(o,r):!1},n.prototype.testChar=function(o,r){var l=this.peek(r);return o.lastIndex=0,l!==null&&o.test(l)},n.prototype.match=function(o){var r=this.__match(o,this.__position);return r?this.__position+=r[0].length:r=null,r},n.prototype.read=function(o,r,l){var a="",i;return o&&(i=this.match(o),i&&(a+=i[0])),r&&(i||!o)&&(a+=this.readUntil(r,l)),a},n.prototype.readUntil=function(o,r){var l="",a=this.__position;o.lastIndex=this.__position;var i=o.exec(this.__input);return i?(a=i.index,r&&(a+=i[0].length)):a=this.__input_length,l=this.__input.substring(this.__position,a),this.__position=a,l},n.prototype.readUntilAfter=function(o){return this.readUntil(o,!0)},n.prototype.get_regexp=function(o,r){var l=null,a="g";return r&&s&&(a="y"),typeof o=="string"&&o!==""?l=new RegExp(o,a):o&&(l=new RegExp(o.source,a)),l},n.prototype.get_literal_regexp=function(o){return RegExp(o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(o){var r=this.__position,l=this.readUntilAfter(o);return this.__position=r,l},n.prototype.lookBack=function(o){var r=this.__position-1;return r>=o.length&&this.__input.substring(r-o.length,r).toLowerCase()===o},c.exports.InputScanner=n},function(c,s,n){var o=n(8).InputScanner,r=n(3).Token,l=n(10).TokenStream,a=n(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},t=function(d,v){this._input=new o(d),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};t.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var d,v=new r(i.START,""),y=null,b=[],g=new l;v.type!==i.EOF;){for(d=this._get_next_token(v,y);this._is_comment(d);)g.add(d),d=this._get_next_token(v,y);g.isEmpty()||(d.comments_before=g,g=new l),d.parent=y,this._is_opening(d)?(b.push(y),y=d):y&&this._is_closing(d,y)&&(d.opened=y,y.closed=d,y=b.pop(),d.parent=y),d.previous=v,v.next=d,this.__tokens.add(d),v=d}return this.__tokens},t.prototype._is_first_token=function(){return this.__tokens.isEmpty()},t.prototype._reset=function(){},t.prototype._get_next_token=function(d,v){this._readWhitespace();var y=this._input.read(/.+/g);return y?this._create_token(i.RAW,y):this._create_token(i.EOF,"")},t.prototype._is_comment=function(d){return!1},t.prototype._is_opening=function(d){return!1},t.prototype._is_closing=function(d,v){return!1},t.prototype._create_token=function(d,v){var y=new r(d,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return y},t.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},c.exports.Tokenizer=t,c.exports.TOKEN=i},function(c){function s(n){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=n}s.prototype.restart=function(){this.__position=0},s.prototype.isEmpty=function(){return this.__tokens_length===0},s.prototype.hasNext=function(){return this.__position<this.__tokens_length},s.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__tokens[this.__position],this.__position+=1),n},s.prototype.peek=function(n){var o=null;return n=n||0,n+=this.__position,n>=0&&n<this.__tokens_length&&(o=this.__tokens[n]),o},s.prototype.add=function(n){this.__parent_token&&(n.parent=this.__parent_token),this.__tokens.push(n),this.__tokens_length+=1},c.exports.TokenStream=s},function(c,s,n){var o=n(12).Pattern;function r(l,a){o.call(this,l,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new o,r.prototype.__set_whitespace_patterns=function(l,a){l+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var a=this.__split(this._newline_regexp,l);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return l},r.prototype.matching=function(l,a){var i=this._create();return i.__set_whitespace_patterns(l,a),i._update(),i},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(l,a){l.lastIndex=0;for(var i=0,t=[],d=l.exec(a);d;)t.push(a.substring(i,d.index)),i=d.index+d[0].length,d=l.exec(a);return i<a.length?t.push(a.substring(i,a.length)):t.push(""),t},c.exports.WhitespacePattern=r},function(c){function s(n,o){this._input=n,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,o&&(this._starting_pattern=this._input.get_regexp(o._starting_pattern,!0),this._match_pattern=this._input.get_regexp(o._match_pattern,!0),this._until_pattern=this._input.get_regexp(o._until_pattern),this._until_after=o._until_after)}s.prototype.read=function(){var n=this._input.read(this._starting_pattern);return(!this._starting_pattern||n)&&(n+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),n},s.prototype.read_match=function(){return this._input.match(this._match_pattern)},s.prototype.until_after=function(n){var o=this._create();return o._until_after=!0,o._until_pattern=this._input.get_regexp(n),o._update(),o},s.prototype.until=function(n){var o=this._create();return o._until_after=!1,o._until_pattern=this._input.get_regexp(n),o._update(),o},s.prototype.starting_with=function(n){var o=this._create();return o._starting_pattern=this._input.get_regexp(n,!0),o._update(),o},s.prototype.matching=function(n){var o=this._create();return o._match_pattern=this._input.get_regexp(n,!0),o._update(),o},s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){},c.exports.Pattern=s},function(c){function s(n,o){n=typeof n=="string"?n:n.source,o=typeof o=="string"?o:o.source,this.__directives_block_pattern=new RegExp(n+/ beautify( \w+[:]\w+)+ /.source+o,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(n+/\sbeautify\signore:end\s/.source+o,"g")}s.prototype.get_directives=function(n){if(!n.match(this.__directives_block_pattern))return null;var o={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(n);r;)o[r[1]]=r[2],r=this.__directive_pattern.exec(n);return o},s.prototype.readIgnored=function(n){return n.readUntilAfter(this.__directives_end_ignore_pattern)},c.exports.Directives=s},function(c,s,n){var o=n(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(a,i){o.call(this,a,i),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),i&&(this.__template_pattern=this._input.get_regexp(i.__template_pattern),this._excluded=Object.assign(this._excluded,i._excluded),this._disabled=Object.assign(this._disabled,i._disabled));var t=new o(a);this.__patterns={handlebars_comment:t.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:t.starting_with(/{{{/).until_after(/}}}/),handlebars:t.starting_with(/{{/).until_after(/}}/),php:t.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:t.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:t.starting_with(/{%/).until_after(/%}/),django_value:t.starting_with(/{{/).until_after(/}}/),django_comment:t.starting_with(/{#/).until_after(/#}/),smarty:t.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:t.starting_with(/{\*/).until_after(/\*}/),smarty_literal:t.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new o,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(a){var i=this._create();return i._disabled[a]=!0,i._update(),i},l.prototype.read_options=function(a){var i=this._create();for(var t in r)i._disabled[t]=a.templating.indexOf(t)===-1;return i._update(),i},l.prototype.exclude=function(a){var i=this._create();return i._excluded[a]=!0,i._update(),i},l.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),a+=i,i=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},l.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},l.prototype._read_template=function(){var a="",i=this._input.peek();if(i==="<"){var t=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&t==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&t==="%"&&(a=a||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},c.exports.TemplatablePattern=l},,,,function(c,s,n){var o=n(19).Beautifier,r=n(20).Options;function l(a,i,t,d){var v=new o(a,i,t,d);return v.beautify()}c.exports=l,c.exports.defaultOptions=function(){return new r}},function(c,s,n){var o=n(20).Options,r=n(2).Output,l=n(21).Tokenizer,a=n(21).TOKEN,i=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,d=function(S,w){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new r(S,w)};d.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},d.prototype.set_space_before_token=function(S,w){this._output.space_before_token=S,this._output.non_breaking_space=w},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(S){this._output.add_raw_token(S)},d.prototype.print_preserved_newlines=function(S){var w=0;S.type!==a.TEXT&&S.previous.type!==a.TEXT&&(w=S.newlines?1:0),this.preserve_newlines&&(w=S.newlines<this.max_preserve_newlines+1?S.newlines:this.max_preserve_newlines+1);for(var R=0;R<w;R++)this.print_newline(R>0);return w!==0},d.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(S){this._output.add_new_line(S)},d.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var v=function(S){for(var w=null,R=S.next;R.type!==a.EOF&&S.closed!==R;){if(R.type===a.ATTRIBUTE&&R.text==="type"){R.next&&R.next.type===a.EQUALS&&R.next.next&&R.next.next.type===a.VALUE&&(w=R.next.next.text);break}R=R.next}return w},y=function(S,w){var R=null,N=null;return w.closed?(S==="script"?R="text/javascript":S==="style"&&(R="text/css"),R=v(w)||R,R.search("text/css")>-1?N="css":R.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":R.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":R.search(/test\/null/)>-1&&(N="null"),N):null};function b(S,w){return w.indexOf(S)!==-1}function g(S,w,R){this.parent=S||null,this.tag=w?w.tag_name:"",this.indent_level=R||0,this.parser_token=w||null}function m(S){this._printer=S,this._current_frame=null}m.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},m.prototype.record_tag=function(S){var w=new g(this._current_frame,S,this._printer.indent_level);this._current_frame=w},m.prototype._try_pop_frame=function(S){var w=null;return S&&(w=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),w},m.prototype._get_frame=function(S,w){for(var R=this._current_frame;R&&!(S.indexOf(R.tag)!==-1);){if(w&&w.indexOf(R.tag)!==-1){R=null;break}R=R.parent}return R},m.prototype.try_pop=function(S,w){var R=this._get_frame([S],w);return this._try_pop_frame(R)},m.prototype.indent_to_tag=function(S){var w=this._get_frame(S);w&&(this._printer.indent_level=w.indent_level)};function _(S,w,R,N){this._source_text=S||"",w=w||{},this._js_beautify=R,this._css_beautify=N,this._tag_stack=null;var F=new o(w,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,w=this._options.eol;this._options.eol==="auto"&&(w=`
|
|
|
`,S&&i.test(S)&&(w=S.match(i)[0])),S=S.replace(t,`
|
|
|
`);var R=S.match(/^[\t ]*/)[0],N={text:"",type:""},F=new x,z=new d(this._options,R),q=new l(S,this._options).tokenize();this._tag_stack=new m(z);for(var B=null,M=q.next();M.type!==a.EOF;)M.type===a.TAG_OPEN||M.type===a.COMMENT?(B=this._handle_tag_open(z,M,F,N),F=B):M.type===a.ATTRIBUTE||M.type===a.EQUALS||M.type===a.VALUE||M.type===a.TEXT&&!F.tag_complete?B=this._handle_inside_tag(z,M,F,q):M.type===a.TAG_CLOSE?B=this._handle_tag_close(z,M,F):M.type===a.TEXT?B=this._handle_text(z,M,F):z.add_raw_token(M),N=B,M=q.next();var G=z._output.get_code(w);return G},_.prototype._handle_tag_close=function(S,w,R){var N={text:w.text,type:w.type};return S.alignment_size=0,R.tag_complete=!0,S.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),R.is_unformatted?S.add_raw_token(w):(R.tag_start_char==="<"&&(S.set_space_before_token(w.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&R.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(w)),R.indent_content&&!(R.is_unformatted||R.is_content_unformatted)&&(S.indent(),R.indent_content=!1),!R.is_inline_element&&!(R.is_unformatted||R.is_content_unformatted)&&S.set_wrap_point(),N},_.prototype._handle_inside_tag=function(S,w,R,N){var F=R.has_wrapped_attrs,z={text:w.text,type:w.type};if(S.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),R.is_unformatted)S.add_raw_token(w);else if(R.tag_start_char==="{"&&w.type===a.TEXT)S.print_preserved_newlines(w)?(w.newlines=0,S.add_raw_token(w)):S.print_token(w);else{if(w.type===a.ATTRIBUTE?(S.set_space_before_token(!0),R.attr_count+=1):(w.type===a.EQUALS||w.type===a.VALUE&&w.previous.type===a.EQUALS)&&S.set_space_before_token(!1),w.type===a.ATTRIBUTE&&R.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(w),F=F||w.newlines!==0),this._is_wrap_attributes_force)){var q=R.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&R.attr_count===1){var B=!0,M=0,G;do{if(G=N.peek(M),G.type===a.ATTRIBUTE){B=!1;break}M+=1}while(M<4&&G.type!==a.EOF&&G.type!==a.TAG_CLOSE);q=!B}q&&(S.print_newline(!1),F=!0)}S.print_token(w),F=F||S.previous_token_wrapped(),R.has_wrapped_attrs=F}return z},_.prototype._handle_text=function(S,w,R){var N={text:w.text,type:"TK_CONTENT"};return R.custom_beautifier_name?this._print_custom_beatifier_text(S,w,R):R.is_unformatted||R.is_content_unformatted?S.add_raw_token(w):(S.traverse_whitespace(w),S.print_token(w)),N},_.prototype._print_custom_beatifier_text=function(S,w,R){var N=this;if(w.text!==""){var F=w.text,z,q=1,B="",M="";R.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?z=this._js_beautify:R.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?z=this._css_beautify:R.custom_beautifier_name==="html"&&(z=function(de,Te){var we=new _(de,Te,N._js_beautify,N._css_beautify);return we.beautify()}),this._options.indent_scripts==="keep"?q=0:this._options.indent_scripts==="separate"&&(q=-S.indent_level);var G=S.get_full_indent(q);if(F=F.replace(/\n[ \t]*$/,""),R.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var J=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!J){S.add_raw_token(w);return}B=G+J[1]+`
|
|
|
`,F=J[4],J[5]&&(M=G+J[5]),F=F.replace(/\n[ \t]*$/,""),(J[2]||J[3].indexOf(`
|
|
|
`)!==-1)&&(J=J[3].match(/[ \t]+$/),J&&(w.whitespace_before=J[0]))}if(F)if(z){var K=function(){this.eol=`
|
|
|
`};K.prototype=this._options.raw_options;var Z=new K;F=z(G+F,Z)}else{var le=w.whitespace_before;le&&(F=F.replace(new RegExp(`
|
|
|
(`+le+")?","g"),`
|
|
|
`)),F=G+F.replace(/\n/g,`
|
|
|
`+G)}B&&(F?F=B+F+`
|
|
|
`+M:F=B+M),S.print_newline(!1),F&&(w.text=F,w.whitespace_before="",w.newlines=0,S.add_raw_token(w),S.print_newline(!0))}},_.prototype._handle_tag_open=function(S,w,R,N){var F=this._get_tag_open_token(w);return(R.is_unformatted||R.is_content_unformatted)&&!R.is_empty_element&&w.type===a.TAG_OPEN&&w.text.indexOf("</")===0?(S.add_raw_token(w),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(S.traverse_whitespace(w),this._set_tag_position(S,w,F,R,N),F.is_inline_element||S.set_wrap_point(),S.print_token(w)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=w.text.length+1),!F.tag_complete&&!F.is_unformatted&&(S.alignment_size=F.alignment_size),F};var x=function(S,w){if(this.parent=S||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!w)this.tag_complete=!0;else{var R;this.tag_start_char=w.text[0],this.text=w.text,this.tag_start_char==="<"?(R=w.text.match(/^<([^\s>]*)/),this.tag_check=R?R[1]:""):(R=w.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=R?R[1]:"",(w.text.startsWith("{{#>")||w.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&w.next!==null?this.tag_check=w.next.text.split(" ")[0]:this.tag_check=w.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),w.type===a.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||w.closed&&w.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};_.prototype._get_tag_open_token=function(S){var w=new x(this._tag_stack.get_parser_token(),S);return w.alignment_size=this._options.wrap_attributes_indent_size,w.is_end_tag=w.is_end_tag||b(w.tag_check,this._options.void_elements),w.is_empty_element=w.tag_complete||w.is_start_tag&&w.is_end_tag,w.is_unformatted=!w.tag_complete&&b(w.tag_check,this._options.unformatted),w.is_content_unformatted=!w.is_empty_element&&b(w.tag_check,this._options.content_unformatted),w.is_inline_element=b(w.tag_name,this._options.inline)||w.tag_name.includes("-")||w.tag_start_char==="{",w},_.prototype._set_tag_position=function(S,w,R,N,F){if(R.is_empty_element||(R.is_end_tag?R.start_tag_token=this._tag_stack.try_pop(R.tag_name):(this._do_optional_end_element(R)&&(R.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(R),(R.tag_name==="script"||R.tag_name==="style")&&!(R.is_unformatted||R.is_content_unformatted)&&(R.custom_beautifier_name=y(R.tag_check,w)))),b(R.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),R.is_empty_element){if(R.tag_start_char==="{"&&R.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),R.indent_content=!0;var z=S.current_line_has_match(/{{#if/);z||S.print_newline(!1)}R.tag_name==="!--"&&F.type===a.TAG_CLOSE&&N.is_end_tag&&R.text.indexOf(`
|
|
|
`)===-1||(R.is_inline_element||R.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,R))}else if(R.is_end_tag){var q=!1;q=R.start_tag_token&&R.start_tag_token.multiline_content,q=q||!R.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===a.TAG_CLOSE&&R.start_tag_token===N)&&F.type!=="TK_CONTENT",(R.is_content_unformatted||R.is_unformatted)&&(q=!1),q&&S.print_newline(!1)}else R.indent_content=!R.custom_beautifier_name,R.tag_start_char==="<"&&(R.tag_name==="html"?R.indent_content=this._options.indent_inner_html:R.tag_name==="head"?R.indent_content=this._options.indent_head_inner_html:R.tag_name==="body"&&(R.indent_content=this._options.indent_body_inner_html)),!(R.is_inline_element||R.is_unformatted)&&(F.type!=="TK_CONTENT"||R.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,R)},_.prototype._calcluate_parent_multiline=function(S,w){w.parent&&S._output.just_added_newline()&&!((w.is_inline_element||w.is_unformatted)&&w.parent.is_inline_element)&&(w.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],E=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(S){var w=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")w=w||this._tag_stack.try_pop("head");else if(S.tag_name==="li")w=w||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")w=w||this._tag_stack.try_pop("dt",["dl"]),w=w||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&h.indexOf(S.tag_name)!==-1){var R=S.parent.parent;(!R||E.indexOf(R.tag_name)===-1)&&(w=w||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(w=w||this._tag_stack.try_pop("rt",["ruby","rtc"]),w=w||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?w=w||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?w=w||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?w=w||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.tag_name==="tfoot"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("thead",["table"]),w=w||this._tag_stack.try_pop("tbody",["table"])):S.tag_name==="tr"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(S.tag_name==="th"||S.tag_name==="td")&&(w=w||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),w=w||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return S.parent=this._tag_stack.get_parser_token(),w},c.exports.Beautifier=_},function(c,s,n){var o=n(6).Options;function r(l){o.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new o,c.exports.Options=r},function(c,s,n){var o=n(9).Tokenizer,r=n(9).TOKEN,l=n(13).Directives,a=n(14).TemplatablePattern,i=n(12).Pattern,t={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},d=new l(/<\!--/,/-->/),v=function(y,b){o.call(this,y,b),this._current_tag_name="";var g=new a(this._input).read_options(this._options),m=new i(this._input);if(this.__patterns={word:g.until(/[\n\r\t <]/),single_quote:g.until_after(/'/),double_quote:g.until_after(/"/),attribute:g.until(/[\n\r\t =>]|\/>/),element_name:g.until(/[\n\r\t >\/]/),handlebars_comment:m.starting_with(/{{!--/).until_after(/--}}/),handlebars:m.starting_with(/{{/).until_after(/}}/),handlebars_open:m.until(/[\n\r\t }]/),handlebars_raw_close:m.until(/}}/),comment:m.starting_with(/<!--/).until_after(/-->/),cdata:m.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:m.starting_with(/<!\[/).until_after(/]>/),processing:m.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=m.matching(_).until_after(_)}};v.prototype=new o,v.prototype._is_comment=function(y){return!1},v.prototype._is_opening=function(y){return y.type===t.TAG_OPEN},v.prototype._is_closing=function(y,b){return y.type===t.TAG_CLOSE&&b&&((y.text===">"||y.text==="/>")&&b.text[0]==="<"||y.text==="}}"&&b.text[0]==="{"&&b.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(y,b){var g=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(t.EOF,""):(g=g||this._read_open_handlebars(m,b),g=g||this._read_attribute(m,y,b),g=g||this._read_close(m,b),g=g||this._read_raw_content(m,y,b),g=g||this._read_content_word(m),g=g||this._read_comment_or_cdata(m),g=g||this._read_processing(m),g=g||this._read_open(m,b),g=g||this._create_token(t.UNKNOWN,this._input.next()),g)},v.prototype._read_comment_or_cdata=function(y){var b=null,g=null,m=null;if(y==="<"){var _=this._input.peek(1);_==="!"&&(g=this.__patterns.comment.read(),g?(m=d.get_directives(g),m&&m.ignore==="start"&&(g+=d.readIgnored(this._input))):g=this.__patterns.cdata.read()),g&&(b=this._create_token(t.COMMENT,g),b.directives=m)}return b},v.prototype._read_processing=function(y){var b=null,g=null,m=null;if(y==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(g=this.__patterns.conditional_comment.read(),g=g||this.__patterns.processing.read()),g&&(b=this._create_token(t.COMMENT,g),b.directives=m)}return b},v.prototype._read_open=function(y,b){var g=null,m=null;return b||y==="<"&&(g=this._input.next(),this._input.peek()==="/"&&(g+=this._input.next()),g+=this.__patterns.element_name.read(),m=this._create_token(t.TAG_OPEN,g)),m},v.prototype._read_open_handlebars=function(y,b){var g=null,m=null;return b||this._options.indent_handlebars&&y==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(g=this.__patterns.handlebars_comment.read(),g=g||this.__patterns.handlebars.read(),m=this._create_token(t.COMMENT,g)):(g=this.__patterns.handlebars_open.read(),m=this._create_token(t.TAG_OPEN,g))),m},v.prototype._read_close=function(y,b){var g=null,m=null;return b&&(b.text[0]==="<"&&(y===">"||y==="/"&&this._input.peek(1)===">")?(g=this._input.next(),y==="/"&&(g+=this._input.next()),m=this._create_token(t.TAG_CLOSE,g)):b.text[0]==="{"&&y==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),m=this._create_token(t.TAG_CLOSE,"}}"))),m},v.prototype._read_attribute=function(y,b,g){var m=null,_="";if(g&&g.text[0]==="<")if(y==="=")m=this._create_token(t.EQUALS,this._input.next());else if(y==='"'||y==="'"){var x=this._input.next();y==='"'?x+=this.__patterns.double_quote.read():x+=this.__patterns.single_quote.read(),m=this._create_token(t.VALUE,x)}else _=this.__patterns.attribute.read(),_&&(b.type===t.EQUALS?m=this._create_token(t.VALUE,_):m=this._create_token(t.ATTRIBUTE,_));return m},v.prototype._is_content_unformatted=function(y){return this._options.void_elements.indexOf(y)===-1&&(this._options.content_unformatted.indexOf(y)!==-1||this._options.unformatted.indexOf(y)!==-1)},v.prototype._read_raw_content=function(y,b,g){var m="";if(g&&g.text[0]==="{")m=this.__patterns.handlebars_raw_close.read();else if(b.type===t.TAG_CLOSE&&b.opened.text[0]==="<"&&b.text[0]!=="/"){var _=b.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var x=this._read_comment_or_cdata(y);if(x)return x.type=t.TEXT,x;m=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(m=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return m?this._create_token(t.TEXT,m):null},v.prototype._read_content_word=function(y){var b="";if(this._options.unformatted_content_delimiter&&(y===this._options.unformatted_content_delimiter[0]&&(b=this.__patterns.unformatted_content_delimiter.read())),b||(b=this.__patterns.word.read()),b)return this._create_token(t.TEXT,b)},c.exports.Tokenizer=v,c.exports.TOKEN=t}],O={};function f(c){var s=O[c];if(s!==void 0)return s.exports;var n=O[c]={exports:{}};return A[c](n,n.exports,f),n.exports}var p=f(18);W=p})();var C=W;if(!0)!(ce=[V,V("6UM0"),V("TXwP")],ie=function(A){var O=V("6UM0"),f=V("TXwP");return{html_beautify:function(p,c){return C(p,c,O.js_beautify,f.css_beautify)}}}.apply(Xe,ce),ie!==void 0&&(nt.exports=ie));else var D,T})()},"rAM+":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return ie});var ce=V("Qw5x");function ie(W,C){var D;if(typeof Symbol=="undefined"||W[Symbol.iterator]==null){if(Array.isArray(W)||(D=Object(ce.a)(W))||C&&W&&typeof W.length=="number"){D&&(W=D);var T=0,A=function(){};return{s:A,n:function(){return T>=W.length?{done:!0}:{done:!1,value:W[T++]}},e:function(s){throw s},f:A}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var O=!0,f=!1,p;return{s:function(){D=W[Symbol.iterator]()},n:function(){var s=D.next();return O=s.done,s},e:function(s){f=!0,p=s},f:function(){try{!O&&D.return!=null&&D.return()}finally{if(f)throw p}}}}},rHrb:function(nt,Xe,V){"use strict";Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.CopyToClipboard=void 0;var ce=W(V("cDcd")),ie=W(V("+QRC"));function W(t){return t&&t.__esModule?t:{default:t}}function C(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(v){return typeof v}:C=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},C(t)}function D(t,d){var v=Object.keys(t);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(t);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(t,b).enumerable})),v.push.apply(v,y)}return v}function T(t){for(var d=1;d<arguments.length;d++){var v=arguments[d]!=null?arguments[d]:{};d%2?D(v,!0).forEach(function(y){a(t,y,v[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(v)):D(v).forEach(function(y){Object.defineProperty(t,y,Object.getOwnPropertyDescriptor(v,y))})}return t}function A(t,d){if(t==null)return{};var v=O(t,d),y,b;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(b=0;b<g.length;b++){if(y=g[b],d.indexOf(y)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,y))continue;v[y]=t[y]}}return v}function O(t,d){if(t==null)return{};var v={},y=Object.keys(t),b,g;for(g=0;g<y.length;g++){if(b=y[g],d.indexOf(b)>=0)continue;v[b]=t[b]}return v}function f(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<d.length;v++){var y=d[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(t,y.key,y)}}function c(t,d,v){return d&&p(t.prototype,d),v&&p(t,v),t}function s(t,d){return d&&(C(d)==="object"||typeof d=="function")?d:o(t)}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},n(t)}function o(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(d&&d.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),d&&l(t,d)}function l(t,d){return l=Object.setPrototypeOf||function(y,b){return y.__proto__=b,y},l(t,d)}function a(t,d,v){return d in t?Object.defineProperty(t,d,{value:v,enumerable:!0,configurable:!0,writable:!0}):t[d]=v,t}var i=function(t){r(d,t);function d(){var v,y;f(this,d);for(var b=arguments.length,g=new Array(b),m=0;m<b;m++)g[m]=arguments[m];return y=s(this,(v=n(d)).call.apply(v,[this].concat(g))),a(o(y),"onClick",function(_){var x=y.props,h=x.text,E=x.onCopy,S=x.children,w=x.options,R=ce.default.Children.only(S),N=(0,ie.default)(h,w);E&&E(h,N),R&&R.props&&typeof R.props.onClick=="function"&&R.props.onClick(_)}),y}return c(d,[{key:"render",value:function(){var y=this.props,b=y.text,g=y.onCopy,m=y.options,_=y.children,x=A(y,["text","onCopy","options","children"]),h=ce.default.Children.only(_);return ce.default.cloneElement(h,T({},x,{onClick:this.onClick}))}}]),d}(ce.default.PureComponent);Xe.CopyToClipboard=i,a(i,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(nt,Xe){const V=/[&<>"']/,ce=/[&<>"']/g,ie=/[<>"']|&(?!#?\w+;)/,W=/[<>"']|&(?!#?\w+;)/g,C={"&":"&","<":"<",">":">",'"':""","'":"'"},D=m=>C[m];function T(m,_){if(_){if(V.test(m))return m.replace(ce,D)}else if(ie.test(m))return m.replace(W,D);return m}const A=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function O(m){return m.replace(A,(_,x)=>(x=x.toLowerCase(),x==="colon"?":":x.charAt(0)==="#"?x.charAt(1)==="x"?String.fromCharCode(parseInt(x.substring(2),16)):String.fromCharCode(+x.substring(1)):""))}const f=/(^|[^\[])\^/g;function p(m,_){m=m.source||m,_=_||"";const x={replace:(h,E)=>(E=E.source||E,E=E.replace(f,"$1"),m=m.replace(h,E),x),getRegex:()=>new RegExp(m,_)};return x}const c=/[^\w:]/g,s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function n(m,_,x){if(m){let h;try{h=decodeURIComponent(O(x)).replace(c,"").toLowerCase()}catch(E){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}_&&!s.test(x)&&(x=i(_,x));try{x=encodeURI(x).replace(/%25/g,"%")}catch(h){return null}return x}const o={},r=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(m,_){o[" "+m]||(r.test(m)?o[" "+m]=m+"/":o[" "+m]=y(m,"/",!0)),m=o[" "+m];const x=m.indexOf(":")===-1;return _.substring(0,2)==="//"?x?_:m.replace(l,"$1")+_:_.charAt(0)==="/"?x?_:m.replace(a,"$1")+_:m+_}const t={exec:function(){}};function d(m){let _=1,x,h;for(;_<arguments.length;_++){x=arguments[_];for(h in x)Object.prototype.hasOwnProperty.call(x,h)&&(m[h]=x[h])}return m}function v(m,_){const x=m.replace(/\|/g,(S,w,R)=>{let N=!1,F=w;for(;--F>=0&&R[F]==="\\";)N=!N;return N?"|":" |"}),h=x.split(/ \|/);let E=0;if(h.length>_)h.splice(_);else for(;h.length<_;)h.push("");for(;E<h.length;E++)h[E]=h[E].trim().replace(/\\\|/g,"|");return h}function y(m,_,x){const h=m.length;if(h===0)return"";let E=0;for(;E<h;){const S=m.charAt(h-E-1);if(S===_&&!x)E++;else if(S!==_&&x)E++;else break}return m.substr(0,h-E)}function b(m,_){if(m.indexOf(_[1])===-1)return-1;const x=m.length;let h=0,E=0;for(;E<x;E++)if(m[E]==="\\")E++;else if(m[E]===_[0])h++;else if(m[E]===_[1]&&(h--,h<0))return E;return-1}function g(m){m&&m.sanitize&&!m.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}nt.exports={escape:T,unescape:O,edit:p,cleanUrl:n,resolveUrl:i,noopTest:t,merge:d,splitCells:v,rtrim:y,findClosingBracket:b,checkSanitizeDeprecation:g}},rdUC:function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global;nt.exports={name:"localStorage",read:C,write:D,each:T,remove:A,clearAll:O};function W(){return ie.localStorage}function C(f){return W().getItem(f)}function D(f,p){return W().setItem(f,p)}function T(f){for(var p=W().length-1;p>=0;p--){var c=W().key(p);f(C(c),c)}}function A(f){return W().removeItem(f)}function O(){return W().clear()}},"s8/Y":function(nt,Xe,V){nt.exports=V.p+"static/jx.6713fc81.svg"},"sB/4":function(nt,Xe,V){nt.exports=V.p+"static/b.7405990c.svg"},sNtx:function(nt,Xe,V){},sR1s:function(nt,Xe,V){"use strict";V.d(Xe,"b",function(){return C}),V.d(Xe,"a",function(){return D}),V.d(Xe,"c",function(){return T}),V.d(Xe,"d",function(){return A});var ce=V("U8pU"),ie="RC_TABLE_KEY";function W(O){return O==null?[]:Array.isArray(O)?O:[O]}function C(O,f){if(!f&&typeof f!="number")return O;for(var p=W(f),c=O,s=0;s<p.length;s+=1){if(!c)return null;var n=p[s];c=c[n]}return c}function D(O){var f=[],p={};return O.forEach(function(c){for(var s=c||{},n=s.key,o=s.dataIndex,r=n||W(o).join("-")||ie;p[r];)r="".concat(r,"_next");p[r]=!0,f.push(r)}),f}function T(){var O={};function f(n,o){o&&Object.keys(o).forEach(function(r){var l=o[r];l&&Object(ce.a)(l)==="object"?(n[r]=n[r]||{},f(n[r],l)):n[r]=l})}for(var p=arguments.length,c=new Array(p),s=0;s<p;s++)c[s]=arguments[s];return c.forEach(function(n){f(O,n)}),O}function A(O){return O!=null}},sboe:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return W});var ce=V("cDcd"),ie=V.n(ce),W=ce.createContext(null)},"t/PP":function(nt,Xe,V){nt.exports=V.p+"static/title.dd3b799f.svg"},t23M:function(nt,Xe,V){"use strict";var ce=V("VTBJ"),ie=V("1OyB"),W=V("vuIU"),C=V("Ji7U"),D=V("LK+K"),T=V("cDcd"),A=V.n(T),O=V("m+aA"),f=V("Zm9Q"),p=V("Kwbf"),c=V("c+Xe"),s=V("bdgK"),n="rc-observer-key",o=function(r){Object(C.a)(a,r);var l=Object(D.a)(a);function a(){var i;return Object(ie.a)(this,a),i=l.apply(this,arguments),i.resizeObserver=null,i.childNode=null,i.currentElement=null,i.state={width:0,height:0,offsetHeight:0,offsetWidth:0},i.onResize=function(t){var d=i.props.onResize,v=t[0].target,y=v.getBoundingClientRect(),b=y.width,g=y.height,m=v.offsetWidth,_=v.offsetHeight,x=Math.floor(b),h=Math.floor(g);if(i.state.width!==x||i.state.height!==h||i.state.offsetWidth!==m||i.state.offsetHeight!==_){var E={width:x,height:h,offsetWidth:m,offsetHeight:_};i.setState(E),d&&Promise.resolve().then(function(){d(Object(ce.a)(Object(ce.a)({},E),{},{offsetWidth:m,offsetHeight:_}))})}},i.setChildNode=function(t){i.childNode=t},i}return Object(W.a)(a,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var t=this.props.disabled;if(t){this.destroyObserver();return}var d=Object(O.a)(this.childNode||this),v=d!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new s.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var t=this.props.children,d=Object(f.a)(t);if(d.length>1)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(T.isValidElement(v)&&Object(c.c)(v)){var y=v.ref;d[0]=T.cloneElement(v,{ref:Object(c.a)(y,this.setChildNode)})}return d.length===1?d[0]:d.map(function(b,g){return!T.isValidElement(b)||"key"in b&&b.key!==null?b:T.cloneElement(b,{key:"".concat(n,"-").concat(g)})})}}]),a}(T.Component);o.displayName="ResizeObserver",Xe.a=o},twBr:function(nt,Xe,V){nt.exports=V.p+"static/s.1f286590.svg"},uMZB:function(nt,Xe,V){nt.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(nt,Xe,V){nt.exports=ce;function ce(){return V("gaXo"),{}}},ulZh:function(nt,Xe,V){typeof window!="undefined"&&function(ie,W){nt.exports=W()}(this,function(){return function(ce){var ie={};function W(C){if(ie[C])return ie[C].exports;var D=ie[C]={i:C,l:!1,exports:{}};return ce[C].call(D.exports,D,D.exports,W),D.l=!0,D.exports}return W.m=ce,W.c=ie,W.d=function(C,D,T){W.o(C,D)||Object.defineProperty(C,D,{enumerable:!0,get:T})},W.r=function(C){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})},W.t=function(C,D){if(D&1&&(C=W(C)),D&8)return C;if(D&4&&typeof C=="object"&&C&&C.__esModule)return C;var T=Object.create(null);if(W.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:C}),D&2&&typeof C!="string")for(var A in C)W.d(T,A,function(O){return C[O]}.bind(null,A));return T},W.n=function(C){var D=C&&C.__esModule?function(){return C.default}:function(){return C};return W.d(D,"a",D),D},W.o=function(C,D){return Object.prototype.hasOwnProperty.call(C,D)},W.p="/dist/",W(W.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ce,ie,W){"use strict";var C=Object.prototype.hasOwnProperty,D="~";function T(){}Object.create&&(T.prototype=Object.create(null),new T().__proto__||(D=!1));function A(c,s,n){this.fn=c,this.context=s,this.once=n||!1}function O(c,s,n,o,r){if(typeof n!="function")throw new TypeError("The listener must be a function");var l=new A(n,o||c,r),a=D?D+s:s;return c._events[a]?c._events[a].fn?c._events[a]=[c._events[a],l]:c._events[a].push(l):(c._events[a]=l,c._eventsCount++),c}function f(c,s){--c._eventsCount===0?c._events=new T:delete c._events[s]}function p(){this._events=new T,this._eventsCount=0}p.prototype.eventNames=function(){var s=[],n,o;if(this._eventsCount===0)return s;for(o in n=this._events)C.call(n,o)&&s.push(D?o.slice(1):o);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(n)):s},p.prototype.listeners=function(s){var n=D?D+s:s,o=this._events[n];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,l=o.length,a=new Array(l);r<l;r++)a[r]=o[r].fn;return a},p.prototype.listenerCount=function(s){var n=D?D+s:s,o=this._events[n];return o?o.fn?1:o.length:0},p.prototype.emit=function(s,n,o,r,l,a){var i=D?D+s:s;if(!this._events[i])return!1;var t=this._events[i],d=arguments.length,v,y;if(t.fn){t.once&&this.removeListener(s,t.fn,void 0,!0);switch(d){case 1:return t.fn.call(t.context),!0;case 2:return t.fn.call(t.context,n),!0;case 3:return t.fn.call(t.context,n,o),!0;case 4:return t.fn.call(t.context,n,o,r),!0;case 5:return t.fn.call(t.context,n,o,r,l),!0;case 6:return t.fn.call(t.context,n,o,r,l,a),!0}for(y=1,v=new Array(d-1);y<d;y++)v[y-1]=arguments[y];t.fn.apply(t.context,v)}else{var b=t.length,g;for(y=0;y<b;y++){t[y].once&&this.removeListener(s,t[y].fn,void 0,!0);switch(d){case 1:t[y].fn.call(t[y].context);break;case 2:t[y].fn.call(t[y].context,n);break;case 3:t[y].fn.call(t[y].context,n,o);break;case 4:t[y].fn.call(t[y].context,n,o,r);break;default:if(!v)for(g=1,v=new Array(d-1);g<d;g++)v[g-1]=arguments[g];t[y].fn.apply(t[y].context,v)}}}return!0},p.prototype.on=function(s,n,o){return O(this,s,n,o,!1)},p.prototype.once=function(s,n,o){return O(this,s,n,o,!0)},p.prototype.removeListener=function(s,n,o,r){var l=D?D+s:s;if(!this._events[l])return this;if(!n)return f(this,l),this;var a=this._events[l];if(a.fn)a.fn===n&&(!r||a.once)&&(!o||a.context===o)&&f(this,l);else{for(var i=0,t=[],d=a.length;i<d;i++)(a[i].fn!==n||r&&!a[i].once||o&&a[i].context!==o)&&t.push(a[i]);t.length?this._events[l]=t.length===1?t[0]:t:f(this,l)}return this},p.prototype.removeAllListeners=function(s){var n;return s?(n=D?D+s:s,this._events[n]&&f(this,n)):(this._events=new T,this._eventsCount=0),this},p.prototype.off=p.prototype.removeListener,p.prototype.addListener=p.prototype.on,p.prefixed=D,p.EventEmitter=p,ce.exports=p},"./node_modules/url-toolkit/src/url-toolkit.js":function(ce,ie,W){(function(C){var D=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,T=/^([^\/?#]*)([^]*)$/,A=/(?:\/|^)\.(?=\/)/g,O=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,f={buildAbsoluteURL:function(p,c,s){if(s=s||{},p=p.trim(),c=c.trim(),!c){if(!s.alwaysNormalize)return p;var n=f.parseURL(p);if(!n)throw new Error("Error trying to parse base URL.");return n.path=f.normalizePath(n.path),f.buildURLFromParts(n)}var o=f.parseURL(c);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return s.alwaysNormalize?(o.path=f.normalizePath(o.path),f.buildURLFromParts(o)):c;var r=f.parseURL(p);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var l=T.exec(r.path);r.netLoc=l[1],r.path=l[2]}r.netLoc&&!r.path&&(r.path="/");var a={scheme:r.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(a.netLoc=r.netLoc,o.path[0]!=="/"))if(!o.path)a.path=r.path,o.params||(a.params=r.params,o.query||(a.query=r.query));else{var i=r.path,t=i.substring(0,i.lastIndexOf("/")+1)+o.path;a.path=f.normalizePath(t)}return a.path===null&&(a.path=s.alwaysNormalize?f.normalizePath(o.path):o.path),f.buildURLFromParts(a)},parseURL:function(p){var c=D.exec(p);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(p){for(p=p.split("").reverse().join("").replace(A,"");p.length!==(p=p.replace(O,"")).length;);return p.split("").reverse().join("")},buildURLFromParts:function(p){return p.scheme+p.netLoc+p.path+p.params+p.query+p.fragment}};ce.exports=f})(this)},"./node_modules/webworkify-webpack/index.js":function(ce,ie,W){function C(s){var n={};function o(l){if(n[l])return n[l].exports;var a=n[l]={i:l,l:!1,exports:{}};return s[l].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=s,o.c=n,o.i=function(l){return l},o.d=function(l,a,i){o.o(l,a)||Object.defineProperty(l,a,{configurable:!1,enumerable:!0,get:i})},o.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},o.n=function(l){var a=l&&l.__esModule?function(){return l.default}:function(){return l};return o.d(a,"a",a),a},o.o=function(l,a){return Object.prototype.hasOwnProperty.call(l,a)},o.p="/",o.oe=function(l){throw console.error(l),l};var r=o(o.s=ENTRY_MODULE);return r.default||r}var D="[\\.|\\-|\\+|\\w|/|@]+",T="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+D+").*?\\)";function A(s){return(s+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function O(s){return!isNaN(1*s)}function f(s,n,o){var r={};r[o]=[];var l=n.toString(),a=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return r;for(var i=a[1],t=new RegExp("(\\\\n|\\W)"+A(i)+T,"g"),d;d=t.exec(l);){if(d[3]==="dll-reference")continue;r[o].push(d[3])}for(t=new RegExp("\\("+A(i)+'\\("(dll-reference\\s('+D+'))"\\)\\)'+T,"g");d=t.exec(l);)s[d[2]]||(r[o].push(d[1]),s[d[2]]=W(d[1]).m),r[d[2]]=r[d[2]]||[],r[d[2]].push(d[4]);for(var v=Object.keys(r),y=0;y<v.length;y++)for(var b=0;b<r[v[y]].length;b++)O(r[v[y]][b])&&(r[v[y]][b]=1*r[v[y]][b]);return r}function p(s){var n=Object.keys(s);return n.reduce(function(o,r){return o||s[r].length>0},!1)}function c(s,n){for(var o={main:[n]},r={main:[]},l={main:{}};p(o);)for(var a=Object.keys(o),i=0;i<a.length;i++){var t=a[i],d=o[t],v=d.pop();if(l[t]=l[t]||{},l[t][v]||!s[t][v])continue;l[t][v]=!0,r[t]=r[t]||[],r[t].push(v);for(var y=f(s,s[t][v],t),b=Object.keys(y),g=0;g<b.length;g++)o[b[g]]=o[b[g]]||[],o[b[g]]=o[b[g]].concat(y[b[g]])}return r}ce.exports=function(s,n){n=n||{};var o={main:W.m},r=n.all?{main:Object.keys(o.main)}:c(o,s),l="";Object.keys(r).filter(function(v){return v!=="main"}).forEach(function(v){for(var y=0;r[v][y];)y++;r[v].push(y),o[v][y]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+v+" = ("+C.toString().replace("ENTRY_MODULE",JSON.stringify(y))+")({"+r[v].map(function(b){return""+JSON.stringify(b)+": "+o[v][b].toString()}).join(",")+`});
|
|
|
`}),l=l+"new (("+C.toString().replace("ENTRY_MODULE",JSON.stringify(s))+")({"+r.main.map(function(v){return""+JSON.stringify(v)+": "+o.main[v].toString()}).join(",")+"}))(self);";var a=new window.Blob([l],{type:"text/javascript"});if(n.bare)return a;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,t=i.createObjectURL(a),d=new window.Worker(t);return d.objectURL=t,d}},"./src/config.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"hlsDefaultConfig",function(){return g}),W.d(ie,"mergeConfig",function(){return _}),W.d(ie,"enableStreamingMode",function(){return x});var C=W("./src/controller/abr-controller.ts"),D=W("./src/controller/audio-stream-controller.ts"),T=W("./src/controller/audio-track-controller.ts"),A=W("./src/controller/subtitle-stream-controller.ts"),O=W("./src/controller/subtitle-track-controller.ts"),f=W("./src/controller/buffer-controller.ts"),p=W("./src/controller/timeline-controller.ts"),c=W("./src/controller/cap-level-controller.ts"),s=W("./src/controller/fps-controller.ts"),n=W("./src/controller/eme-controller.ts"),o=W("./src/controller/cmcd-controller.ts"),r=W("./src/utils/xhr-loader.ts"),l=W("./src/utils/fetch-loader.ts"),a=W("./src/utils/cues.ts"),i=W("./src/utils/mediakeys-helper.ts"),t=W("./src/utils/logger.ts");function d(){return d=Object.assign||function(h){for(var E=1;E<arguments.length;E++){var S=arguments[E];for(var w in S)Object.prototype.hasOwnProperty.call(S,w)&&(h[w]=S[w])}return h},d.apply(this,arguments)}function v(h,E){var S=Object.keys(h);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);E&&(w=w.filter(function(R){return Object.getOwnPropertyDescriptor(h,R).enumerable})),S.push.apply(S,w)}return S}function y(h){for(var E=1;E<arguments.length;E++){var S=arguments[E]!=null?arguments[E]:{};E%2?v(Object(S),!0).forEach(function(w){b(h,w,S[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(S)):v(Object(S)).forEach(function(w){Object.defineProperty(h,w,Object.getOwnPropertyDescriptor(S,w))})}return h}function b(h,E,S){return E in h?Object.defineProperty(h,E,{value:S,enumerable:!0,configurable:!0,writable:!0}):h[E]=S,h}var g=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:C.default,bufferController:f.default,capLevelController:c.default,fpsController:s.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},m()),{},{subtitleStreamController:A.SubtitleStreamController,subtitleTrackController:O.default,timelineController:p.TimelineController,audioStreamController:D.default,audioTrackController:T.default,emeController:n.default,cmcdController:o.default});function m(){return{cueHandler:a.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function _(h,E){if((E.liveSyncDurationCount||E.liveMaxLatencyDurationCount)&&(E.liveSyncDuration||E.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(E.liveMaxLatencyDurationCount!==void 0&&(E.liveSyncDurationCount===void 0||E.liveMaxLatencyDurationCount<=E.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(E.liveMaxLatencyDuration!==void 0&&(E.liveSyncDuration===void 0||E.liveMaxLatencyDuration<=E.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},h,E)}function x(h){var E=h.loader;if(E!==l.default&&E!==r.default)t.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var S=Object(l.fetchSupported)();S&&(h.loader=l.default,h.progressive=!0,h.enableSoftwareAES=!0,t.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/polyfills/number.ts"),D=W("./src/utils/ewma-bandwidth-estimator.ts"),T=W("./src/events.ts"),A=W("./src/utils/buffer-helper.ts"),O=W("./src/errors.ts"),f=W("./src/types/loader.ts"),p=W("./src/utils/logger.ts");function c(o,r){for(var l=0;l<r.length;l++){var a=r[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function s(o,r,l){return r&&c(o.prototype,r),l&&c(o,l),o}var n=function(){function o(l){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=l;var a=l.config;this.bwEstimator=new D.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var r=o.prototype;return r.registerListeners=function(){var a=this.hls;a.on(T.Events.FRAG_LOADING,this.onFragLoading,this),a.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(T.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(T.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var a=this.hls;a.off(T.Events.FRAG_LOADING,this.onFragLoading,this),a.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(T.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(T.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(a,i){var t=i.frag;if(t.type===f.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=t,this.partCurrent=(d=i.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(a,i){var t=this.hls.config;i.details.live?this.bwEstimator.update(t.abrEwmaSlowLive,t.abrEwmaFastLive):this.bwEstimator.update(t.abrEwmaSlowVoD,t.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var a=this.fragCurrent,i=this.partCurrent,t=this.hls,d=t.autoLevelEnabled,v=t.config,y=t.media;if(!a||!y)return;var b=i?i.stats:a.stats,g=i?i.duration:a.duration;if(b.aborted){p.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||y.paused||!y.playbackRate||!y.readyState)return;var m=performance.now()-b.loading.start,_=Math.abs(y.playbackRate);if(m<=500*g/_)return;var x=t.levels,h=t.minAutoLevel,E=x[a.level],S=b.total||Math.max(b.loaded,Math.round(g*E.maxBitrate/8)),w=Math.max(1,b.bwEstimate?b.bwEstimate/8:b.loaded*1e3/m),R=(S-b.loaded)/w,N=y.currentTime,F=(A.BufferHelper.bufferInfo(y,N,v.maxBufferHole).end-N)/_;if(F>=2*g/_||R<=F)return;var z=Number.POSITIVE_INFINITY,q;for(q=a.level-1;q>h;q--){var B=x[q].maxBitrate;if(z=g*B/(8*.8*w),z<F)break}if(z>=R)return;var M=this.bwEstimator.getEstimate();p.logger.warn("Fragment "+a.sn+(i?" part "+i.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+q+`
|
|
|
Current BW estimate: `+(Object(C.isFiniteNumber)(M)?(M/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+R.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+z.toFixed(3)+` s
|
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),t.nextLoadLevel=q,this.bwEstimator.sample(m,b.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),t.trigger(T.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:i,stats:b})},r.onFragLoaded=function(a,i){var t=i.frag,d=i.part;if(t.type===f.PlaylistLevelType.MAIN&&Object(C.isFiniteNumber)(t.sn)){var v=d?d.stats:t.stats,y=d?d.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var b=this.hls.levels[t.level],g=(b.loaded?b.loaded.bytes:0)+v.loaded,m=(b.loaded?b.loaded.duration:0)+y;b.loaded={bytes:g,duration:m},b.realBitrate=Math.round(8*g/m)}if(t.bitrateTest){var _={stats:v,frag:t,part:d,id:t.type};this.onFragBuffered(T.Events.FRAG_BUFFERED,_),t.bitrateTest=!1}}},r.onFragBuffered=function(a,i){var t=i.frag,d=i.part,v=d?d.stats:t.stats;if(v.aborted)return;if(t.type!==f.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var y=v.parsing.end-v.loading.start;this.bwEstimator.sample(y,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=y/1e3:this.bitrateTestDelay=0},r.onError=function(a,i){switch(i.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var a=this.fragCurrent,i=this.partCurrent,t=this.hls,d=t.maxAutoLevel,v=t.config,y=t.minAutoLevel,b=t.media,g=i?i.duration:a?a.duration:0,m=b?b.currentTime:0,_=b&&b.playbackRate!==0?Math.abs(b.playbackRate):1,x=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,h=(A.BufferHelper.bufferInfo(b,m,v.maxBufferHole).end-m)/_,E=this.findBestLevel(x,y,d,h,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(E>=0)return E;p.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=g?Math.min(g,v.maxStarvationDelay):v.maxStarvationDelay,w=v.abrBandWidthFactor,R=v.abrBandWidthUpFactor;if(!h){var N=this.bitrateTestDelay;if(N){var F=g?Math.min(g,v.maxLoadingDelay):v.maxLoadingDelay;S=F-N,p.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),w=R=1}}return E=this.findBestLevel(x,y,d,h+S,w,R),Math.max(E,0)},r.findBestLevel=function(a,i,t,d,v,y){for(var b,g=this.fragCurrent,m=this.partCurrent,_=this.lastLoadedFragLevel,x=this.hls.levels,h=x[_],E=!!(h!=null&&(b=h.details)!==null&&b!==void 0&&b.live),S=h==null?void 0:h.codecSet,w=m?m.duration:g?g.duration:0,R=t;R>=i;R--){var N=x[R];if(!N||S&&N.codecSet!==S)continue;var F=N.details,z=(m?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||w,q=void 0;R<=_?q=v*a:q=y*a;var B=x[R].maxBitrate,M=B*z/q;if(p.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+R+"/"+Math.round(q)+"/"+B+"/"+z+"/"+d+"/"+M),q>B&&(!M||E&&!this.bitrateTestDelay||M<d))return R}return-1},s(o,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,i=this.bwEstimator;if(a!==-1&&(!i||!i.canEstimate()))return a;var t=this.getNextABRAutoLevel();return a!==-1&&(t=Math.min(a,t)),t},set:function(a){this._nextAutoLevel=a}}]),o}();ie.default=n},"./src/controller/audio-stream-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/polyfills/number.ts"),D=W("./src/controller/base-stream-controller.ts"),T=W("./src/events.ts"),A=W("./src/utils/buffer-helper.ts"),O=W("./src/controller/fragment-tracker.ts"),f=W("./src/types/level.ts"),p=W("./src/types/loader.ts"),c=W("./src/loader/fragment.ts"),s=W("./src/demux/chunk-cache.ts"),n=W("./src/demux/transmuxer-interface.ts"),o=W("./src/types/transmuxer.ts"),r=W("./src/controller/fragment-finders.ts"),l=W("./src/utils/discontinuities.ts"),a=W("./src/errors.ts"),i=W("./src/utils/logger.ts");function t(){return t=Object.assign||function(g){for(var m=1;m<arguments.length;m++){var _=arguments[m];for(var x in _)Object.prototype.hasOwnProperty.call(_,x)&&(g[x]=_[x])}return g},t.apply(this,arguments)}function d(g,m){g.prototype=Object.create(m.prototype),g.prototype.constructor=g,v(g,m)}function v(g,m){return v=Object.setPrototypeOf||function(x,h){return x.__proto__=h,x},v(g,m)}var y=100,b=function(g){d(m,g);function m(x,h){var E;return E=g.call(this,x,h,"[audio-stream-controller]")||this,E.videoBuffer=null,E.videoTrackCC=-1,E.waitingVideoCC=-1,E.audioSwitch=!1,E.trackId=-1,E.waitingData=null,E.mainDetails=null,E.bufferFlushed=!1,E._registerListeners(),E}var _=m.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var h=this.hls;h.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(T.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(T.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(T.Events.ERROR,this.onError,this),h.on(T.Events.BUFFER_RESET,this.onBufferReset,this),h.on(T.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var h=this.hls;h.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(T.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(T.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(T.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(T.Events.ERROR,this.onError,this),h.off(T.Events.BUFFER_RESET,this.onBufferReset,this),h.off(T.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(T.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(T.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(h,E){var S=E.frag,w=E.id,R=E.initPTS;if(w==="main"){var N=S.cc;this.initPTS[S.cc]=R,this.log("InitPTS for cc: "+N+" found from main: "+R),this.videoTrackCC=N,this.state===D.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=D.State.STOPPED;return}var E=this.lastCurrentTime;this.stopLoad(),this.setInterval(y),this.fragLoadError=0,E>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+E.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},_.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var h,E=this.levels,S=this.trackId,w=E==null||((h=E[S])===null||h===void 0)?void 0:h.details;if(w){if(this.waitForCdnTuneIn(w))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var R,N=performance.now(),F=this.retryDate;(!F||N>=F||(R=this.media)!==null&&R!==void 0&&R.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var z=this.waitingData;if(z){var q=z.frag,B=z.part,M=z.cache,G=z.complete;if(this.initPTS[q.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var J=M.flush(),K={frag:q,part:B,payload:J,networkDetails:null};this._handleFragmentLoadProgress(K),G&&g.prototype._handleFragmentLoadComplete.call(this,K)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+q.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Z=this.getLoadPosition(),le=A.BufferHelper.bufferInfo(this.mediaBuffer,Z,this.config.maxBufferHole),de=Object(r.fragmentWithinToleranceTest)(le.end,this.config.maxFragLookUpTolerance,q);de<0&&(i.logger.log("Waiting fragment cc ("+q.cc+") @ "+q.start+" cancelled because another fragment at "+le.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},_.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var E=this.mediaBuffer?this.mediaBuffer:h,S=E.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},_.doTickIdle=function(){var h,E,S=this.hls,w=this.levels,R=this.media,N=this.trackId,F=S.config;if(!w||!w[N])return;if(!R&&(this.startFragRequested||!F.startFragPrefetch))return;var z=w[N],q=z.details;if(!q||q.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(q)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,p.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,p.PlaylistLevelType.AUDIO);if(B===null)return;var M=B.len,G=this.getMaxBufferLength(),J=this.audioSwitch;if(M>=G&&!J)return;if(!J&&this._streamEnded(B,q)){S.trigger(T.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var K=q.fragments,Z=K[0].start,le=B.end;if(J){var de=this.getLoadPosition();le=de,q.PTSKnown&&de<Z&&((B.end>Z||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),R.currentTime=Z+.05))}var Te=this.getNextFragment(le,q);if(!Te){this.bufferFlushed=!0;return}((h=Te.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((E=Te.decryptdata)!==null&&E!==void 0&&E.key)?this.loadKey(Te,q):this.loadFragment(Te,q,le)},_.getMaxBufferLength=function(){var h=g.prototype.getMaxBufferLength.call(this),E=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,p.PlaylistLevelType.MAIN);return E===null?h:Math.max(h,E.len)},_.onMediaDetaching=function(){this.videoBuffer=null,g.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(h,E){var S=E.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(w){return new f.Level(w)})},_.onAudioTrackSwitching=function(h,E){var S=!!E.url;this.trackId=E.id;var w=this.fragCurrent;w!=null&&w.loader&&w.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(y):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(h,E){this.mainDetails=E.details},_.onAudioTrackLoaded=function(h,E){var S,w=this.levels,R=E.details,N=E.id;if(!w){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+R.startSN+","+R.endSN+"],duration:"+R.totalduration);var F=w[N],z=0;if(R.live||(S=F.details)!==null&&S!==void 0&&S.live){var q=this.mainDetails;if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed||!q)return;!F.details&&R.hasProgramDateTime&&q.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(R,q),z=R.fragments[0].start):z=this.alignPlaylists(R,F.details)}F.details=R,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!R.live)&&this.setStartPosition(F.details,z),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(R)&&(this.state=D.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(h){var E,S=h.frag,w=h.part,R=h.payload,N=this.config,F=this.trackId,z=this.levels;if(!z){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var q=z[F];console.assert(q,"Audio track is defined on fragment load progress");var B=q.details;console.assert(B,"Audio track details are defined on fragment load progress");var M=N.defaultAudioCodec||q.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new n.default(this.hls,p.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var J=this.initPTS[S.cc],K=(E=S.initSegment)===null||E===void 0?void 0:E.data;if(J!==void 0){var Z=!1,le=w?w.index:-1,de=le!==-1,Te=new o.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,R.byteLength,le,de);G.push(R,K,M,"",S,w,B.totalduration,Z,Te,J)}else{i.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+F);var we=this.waitingData=this.waitingData||{frag:S,part:w,cache:new s.default,complete:!1},Ie=we.cache;Ie.push(new Uint8Array(R)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}g.prototype._handleFragmentLoadComplete.call(this,h)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(h,E){var S=E.tracks.audio;S&&(this.mediaBuffer=S.buffer),E.tracks.video&&(this.videoBuffer=E.tracks.video.buffer)},_.onFragBuffered=function(h,E){var S=E.frag,w=E.part;if(S.type!==p.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(w?" p: "+w.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,w)},_.onError=function(h,E){switch(E.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.AUDIO,E);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=E.fatal?D.State.ERROR:D.State.IDLE,this.warn(E.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(E.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var S=!0,w=this.getFwdBufferInfo(this.mediaBuffer,p.PlaylistLevelType.AUDIO);w&&w.len>.5&&(S=!this.reduceMaxBufferLength(w.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,g.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(h,E){var S=E.type;S===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(h){var E,S="audio",w=this.hls,R=h.remuxResult,N=h.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var z=F.frag,q=F.part,B=R.audio,M=R.text,G=R.id3,J=R.initSegment;if(this.fragContextChanged(z))return;if(this.state=D.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),J!=null&&J.tracks&&(this._bufferInitSegment(J.tracks,z,N),w.trigger(T.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:S,tracks:J.tracks})),B){var K=B.startPTS,Z=B.endPTS,le=B.startDTS,de=B.endDTS;q&&(q.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:K,endPTS:Z,startDTS:le,endDTS:de}),z.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,K,Z,le,de),this.bufferFragmentData(B,z,q,N)}if(G!=null&&(E=G.samples)!==null&&E!==void 0&&E.length){var Te=t({frag:z,id:S},G);w.trigger(T.Events.FRAG_PARSING_METADATA,Te)}if(M){var we=t({frag:z,id:S},M);w.trigger(T.Events.FRAG_PARSING_USERDATA,we)}},_._bufferInitSegment=function(h,E,S){if(this.state!==D.State.PARSING)return;h.video&&delete h.video;var w=h.audio;if(!w)return;w.levelCodec=w.codec,w.id="audio",this.log("Init audio buffer, container:"+w.container+", codecs[parsed]=["+w.codec+"]"),this.hls.trigger(T.Events.BUFFER_CODECS,h);var R=w.initSegment;if(R!=null&&R.byteLength){var N={type:"audio",frag:E,part:null,chunkMeta:S,parent:E.type,data:R};this.hls.trigger(T.Events.BUFFER_APPENDING,N)}this.tick()},_.loadFragment=function(h,E,S){var w=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||w===O.FragmentState.NOT_LOADED||w===O.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):E.live&&!Object(C.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,h,E,S)))},_.completeAudioSwitch=function(){var h=this.hls,E=this.media,S=this.trackId;E&&(this.log("Switching audio track : flushing all audio"),g.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(T.Events.AUDIO_TRACK_SWITCHED,{id:S})},m}(D.default);ie.default=b},"./src/controller/audio-track-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/controller/base-playlist-controller.ts"),A=W("./src/types/loader.ts");function O(n,o){for(var r=0;r<o.length;r++){var l=o[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(n,l.key,l)}}function f(n,o,r){return o&&O(n.prototype,o),r&&O(n,r),n}function p(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o)}function c(n,o){return c=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},c(n,o)}var s=function(n){p(o,n);function o(l){var a;return a=n.call(this,l,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var r=o.prototype;return r.registerListeners=function(){var a=this.hls;a.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(C.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(C.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(C.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var a=this.hls;a.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(C.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(C.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(C.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(C.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,n.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(a,i){this.tracks=i.audioTracks||[]},r.onAudioTrackLoaded=function(a,i){var t=i.id,d=i.details,v=this.tracksInGroup[t];if(!v){this.warn("Invalid audio track id "+t);return}var y=v.details;v.details=i.details,this.log("audioTrack "+t+" loaded ["+d.startSN+"-"+d.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,i,y))},r.onLevelLoading=function(a,i){this.switchLevel(i.level)},r.onLevelSwitching=function(a,i){this.switchLevel(i.level)},r.switchLevel=function(a){var i=this.hls.levels[a];if(!(i!=null&&i.audioGroupIds))return;var t=i.audioGroupIds[i.urlId];if(this.groupId!==t){this.groupId=t;var d=this.tracks.filter(function(y){return!t||y.groupId===t});this.selectDefaultTrack&&!d.some(function(y){return y.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var v={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(C.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},r.onError=function(a,i){if(n.prototype.onError.call(this,a,i),i.fatal||!i.context)return;i.context.type===A.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},r.setAudioTrack=function(a){var i=this.tracksInGroup;if(a<0||a>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=i[this.trackId];this.log("Now switching to audio-track index "+a);var d=i[a],v=d.id,y=d.groupId,b=y===void 0?"":y,g=d.name,m=d.type,_=d.url;if(this.trackId=a,this.trackName=g,this.selectDefaultTrack=!1,this.hls.trigger(C.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:b,name:g,type:m,url:_}),d.details&&!d.details.live)return;var x=this.switchParams(d.url,t==null?void 0:t.details);this.loadPlaylist(x)},r.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,t=this.findTrackId(i)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(a){for(var i=this.tracksInGroup,t=0;t<i.length;t++){var d=i[t];if((!this.selectDefaultTrack||d.default)&&(!a||a===d.name))return d.id}return-1},r.loadPlaylist=function(a){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var t=i.id,d=i.groupId,v=i.url;if(a)try{v=a.addDirectives(v)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("loading audio-track playlist for id: "+t),this.clearTimer(),this.hls.trigger(C.Events.AUDIO_TRACK_LOADING,{url:v,id:t,groupId:d,deliveryDirectives:a||null})}},f(o,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),o}(T.default);ie.default=s},"./src/controller/base-playlist-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return f});var C=W("./src/polyfills/number.ts"),D=W("./src/types/level.ts"),T=W("./src/controller/level-helper.ts"),A=W("./src/utils/logger.ts"),O=W("./src/errors.ts"),f=function(){function p(s,n){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=A.logger.log.bind(A.logger,n+":"),this.warn=A.logger.warn.bind(A.logger,n+":"),this.hls=s}var c=p.prototype;return c.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},c.onError=function(n,o){o.fatal&&o.type===O.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},c.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},c.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},c.stopLoad=function(){this.canLoad=!1,this.clearTimer()},c.switchParams=function(n,o){var r=o==null?void 0:o.renditionReports;if(r)for(var l=0;l<r.length;l++){var a=r[l],i=""+a.URI;if(i===n.substr(-i.length)){var t=parseInt(a["LAST-MSN"]),d=parseInt(a["LAST-PART"]);if(o&&this.hls.config.lowLatencyMode){var v=Math.min(o.age-o.partTarget,o.targetduration);d!==void 0&&v>o.partTarget&&(d+=1)}if(Object(C.isFiniteNumber)(t))return new D.HlsUrlParameters(t,Object(C.isFiniteNumber)(d)?d:void 0,D.HlsSkip.No)}}},c.loadPlaylist=function(n){},c.shouldLoadTrack=function(n){return this.canLoad&&n&&!!n.url&&(!n.details||n.details.live)},c.playlistLoaded=function(n,o,r){var l=this,a=o.details,i=o.stats,t=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(a.advancedDateTime=Date.now()-t,a.live||r!=null&&r.live){if(a.reloaded(r),r&&this.log("live playlist "+n+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),r&&a.fragments.length>0&&Object(T.mergeDetails)(r,a),!this.canLoad||!a.live)return;var d,v=void 0,y=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var b=this.hls.config.lowLatencyMode,g=a.lastPartSn,m=a.endSN,_=a.lastPartIndex,x=_!==-1,h=g===m,E=b?0:_;x?(v=h?m+1:g,y=h?E:_+1):v=m+1;var S=a.age,w=S+a.ageHeader,R=Math.min(w-a.partTarget,a.targetduration*1.5);if(R>0){if(r&&R>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+R+" with playlist age: "+a.age),R=0;else{var N=Math.floor(R/a.targetduration);if(v+=N,y!==void 0){var F=Math.round(R%a.targetduration/a.partTarget);y+=F}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+R+" skip sn "+N+" to part "+y)}a.tuneInGoal=R}if(d=this.getDeliveryDirectives(a,o.deliveryDirectives,v,y),b||!h){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(a,o.deliveryDirectives,v,y);var z=Object(T.computeReloadInterval)(a,i);v!==void 0&&a.canBlockReload&&(z-=a.partTarget||1),this.log("reload live playlist "+n+" in "+Math.round(z)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(d)},z)}else this.clearTimer()},c.getDeliveryDirectives=function(n,o,r,l){var a=Object(D.getSkipValue)(n,r);return o!=null&&o.skip&&n.deltaUpdateFailed&&(r=o.msn,l=o.part,a=D.HlsSkip.No),new D.HlsUrlParameters(r,l,a)},c.retryLoadingOrFail=function(n){var o=this,r=this.hls.config,l=this.retryCount<r.levelLoadingMaxRetry;if(l){var a;if(this.retryCount++,n.details.indexOf("LoadTimeOut")>-1&&(a=n.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+n.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return o.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+n.details+'"')}}else this.warn('cannot recover from error "'+n.details+'"'),this.clearTimer(),n.fatal=!0;return l},p}()},"./src/controller/base-stream-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"State",function(){return m}),W.d(ie,"default",function(){return _});var C=W("./src/polyfills/number.ts"),D=W("./src/task-loop.ts"),T=W("./src/controller/fragment-tracker.ts"),A=W("./src/utils/buffer-helper.ts"),O=W("./src/utils/logger.ts"),f=W("./src/events.ts"),p=W("./src/errors.ts"),c=W("./src/types/transmuxer.ts"),s=W("./src/utils/mp4-tools.ts"),n=W("./src/utils/discontinuities.ts"),o=W("./src/controller/fragment-finders.ts"),r=W("./src/controller/level-helper.ts"),l=W("./src/loader/fragment-loader.ts"),a=W("./src/crypt/decrypter.ts"),i=W("./src/utils/time-ranges.ts"),t=W("./src/types/loader.ts");function d(x,h){for(var E=0;E<h.length;E++){var S=h[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}function v(x,h,E){return h&&d(x.prototype,h),E&&d(x,E),x}function y(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function b(x,h){x.prototype=Object.create(h.prototype),x.prototype.constructor=x,g(x,h)}function g(x,h){return g=Object.setPrototypeOf||function(S,w){return S.__proto__=w,S},g(x,h)}var m={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},_=function(x){b(h,x);function h(S,w,R){var N;return N=x.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=m.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=R,N.log=O.logger.log.bind(O.logger,R+":"),N.warn=O.logger.warn.bind(O.logger,R+":"),N.hls=S,N.fragmentLoader=new l.default(S.config),N.fragmentTracker=w,N.config=S.config,N.decrypter=new a.default(S,S.config),S.on(f.Events.KEY_LOADED,N.onKeyLoaded,y(N)),N}var E=h.prototype;return E.doTick=function(){this.onTickEnd()},E.onTickEnd=function(){},E.startLoad=function(w){},E.stopLoad=function(){this.fragmentLoader.abort();var w=this.fragCurrent;w&&this.fragmentTracker.removeFragment(w),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=m.STOPPED},E._streamEnded=function(w,R){var N=this.fragCurrent,F=this.fragmentTracker;if(!R.live&&N&&N.sn===R.endSN&&!w.nextStart){var z=F.getState(N);return z===T.FragmentState.PARTIAL||z===T.FragmentState.OK}return!1},E.onMediaAttached=function(w,R){var N=this.media=this.mediaBuffer=R.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===m.STOPPED&&this.startLoad(F.startPosition)},E.onMediaDetaching=function(){var w=this.media;w!=null&&w.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),w&&(w.removeEventListener("seeking",this.onvseeking),w.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},E.onMediaSeeking=function(){var w=this.config,R=this.fragCurrent,N=this.media,F=this.mediaBuffer,z=this.state,q=N?N.currentTime:0,B=A.BufferHelper.bufferInfo(F||N,q,w.maxBufferHole);if(this.log("media seeking to "+(Object(C.isFiniteNumber)(q)?q.toFixed(3):q)+", state: "+z),z===m.ENDED)this.resetLoadingState();else if(R&&!B.len){var M=w.maxFragLookUpTolerance,G=R.start-M,J=R.start+R.duration+M,K=q>J;(q<G||K)&&(K&&R.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),R.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=q),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=q),this.tickImmediate()},E.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},E.onKeyLoaded=function(w,R){if(this.state!==m.KEY_LOADING||R.frag!==this.fragCurrent||!this.levels)return;this.state=m.IDLE;var N=this.levels[R.frag.level].details;N&&this.loadFragment(R.frag,N,R.frag.start)},E.onHandlerDestroying=function(){this.stopLoad(),x.prototype.onHandlerDestroying.call(this)},E.onHandlerDestroyed=function(){this.state=m.STOPPED,this.hls.off(f.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,x.prototype.onHandlerDestroyed.call(this)},E.loadKey=function(w,R){this.log("Loading key for "+w.sn+" of ["+R.startSN+"-"+R.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level),this.state=m.KEY_LOADING,this.fragCurrent=w,this.hls.trigger(f.Events.KEY_LOADING,{frag:w})},E.loadFragment=function(w,R,N){this._loadFragForPlayback(w,R,N)},E._loadFragForPlayback=function(w,R,N){var F=this,z=function(B){if(F.fragContextChanged(w)){F.warn("Fragment "+w.sn+(B.part?" p: "+B.part.index:"")+" of level "+w.level+" was dropped during download."),F.fragmentTracker.removeFragment(w);return}w.stats.chunkCount++,F._handleFragmentLoadProgress(B)};this._doFragLoad(w,R,N,z).then(function(q){if(!q)return;F.fragLoadError=0;var B=F.state;if(F.fragContextChanged(w)){(B===m.FRAG_LOADING||B===m.BACKTRACKING||!F.fragCurrent&&B===m.PARSING)&&(F.fragmentTracker.removeFragment(w),F.state=m.IDLE);return}if("payload"in q&&(F.log("Loaded fragment "+w.sn+" of level "+w.level),F.hls.trigger(f.Events.FRAG_LOADED,q),F.state===m.BACKTRACKING)){F.fragmentTracker.backtrack(w,q),F.resetFragmentLoading(w);return}F._handleFragmentLoadComplete(q)}).catch(function(q){F.warn(q),F.resetFragmentLoading(w)})},E.flushMainBuffer=function(w,R,N){if(N===void 0&&(N=null),!(w-R))return;var F={startOffset:w,endOffset:R,type:N};this.fragLoadError=0,this.hls.trigger(f.Events.BUFFER_FLUSHING,F)},E._loadInitSegment=function(w){var R=this;this._doFragLoad(w).then(function(N){if(!N||R.fragContextChanged(w)||!R.levels)throw new Error("init load aborted");return N}).then(function(N){var F=R.hls,z=N.payload,q=w.decryptdata;if(z&&z.byteLength>0&&q&&q.key&&q.iv&&q.method==="AES-128"){var B=self.performance.now();return R.decrypter.webCryptoDecrypt(new Uint8Array(z),q.key.buffer,q.iv.buffer).then(function(M){var G=self.performance.now();return F.trigger(f.Events.FRAG_DECRYPTED,{frag:w,payload:M,stats:{tstart:B,tdecrypt:G}}),N.payload=M,N})}return N}).then(function(N){var F=R.fragCurrent,z=R.hls,q=R.levels;if(!q)throw new Error("init load aborted, missing levels");var B=q[w.level].details;console.assert(B,"Level details are defined when init segment is loaded");var M=w.stats;R.state=m.IDLE,R.fragLoadError=0,w.data=new Uint8Array(N.payload),M.parsing.start=M.buffering.start=self.performance.now(),M.parsing.end=M.buffering.end=self.performance.now(),N.frag===F&&z.trigger(f.Events.FRAG_BUFFERED,{stats:M,frag:F,part:null,id:w.type}),R.tick()}).catch(function(N){R.warn(N),R.resetFragmentLoading(w)})},E.fragContextChanged=function(w){var R=this.fragCurrent;return!w||!R||w.level!==R.level||w.sn!==R.sn||w.urlId!==R.urlId},E.fragBufferedComplete=function(w,R){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+w.type+" sn: "+w.sn+(R?" part: "+R.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level+" "+i.default.toString(A.BufferHelper.getBuffered(N))),this.state=m.IDLE,this.tick()},E._handleFragmentLoadComplete=function(w){var R=this.transmuxer;if(!R)return;var N=w.frag,F=w.part,z=w.partsLoaded,q=!z||z.length===0||z.some(function(M){return!M}),B=new c.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!q);R.flush(B)},E._handleFragmentLoadProgress=function(w){},E._doFragLoad=function(w,R,N,F){var z=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(w.start,N||0),this.config.lowLatencyMode&&R){var q=R.partList;if(q&&F){N>w.end&&R.fragmentHint&&(w=R.fragmentHint);var B=this.getNextPart(q,w,N);if(B>-1){var M=q[B];return this.log("Loading part sn: "+w.sn+" p: "+M.index+" cc: "+w.cc+" of playlist ["+R.startSN+"-"+R.endSN+"] parts [0-"+B+"-"+(q.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=M.start+M.duration,this.state=m.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:w,part:q[B],targetBufferTime:N}),this.doFragPartsLoad(w,q,B,F).catch(function(G){return z.handleFragLoadError(G)})}else if(!w.url||this.loadedEndOfParts(q,N))return Promise.resolve(null)}}return this.log("Loading fragment "+w.sn+" cc: "+w.cc+" "+(R?"of ["+R.startSN+"-"+R.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(N.toFixed(3))),Object(C.isFiniteNumber)(w.sn)&&!this.bitrateTest&&(this.nextLoadPosition=w.start+w.duration),this.state=m.FRAG_LOADING,this.hls.trigger(f.Events.FRAG_LOADING,{frag:w,targetBufferTime:N}),this.fragmentLoader.load(w,F).catch(function(G){return z.handleFragLoadError(G)})},E.doFragPartsLoad=function(w,R,N,F){var z=this;return new Promise(function(q,B){var M=[],G=function J(K){var Z=R[K];z.fragmentLoader.loadPart(w,Z,F).then(function(le){M[Z.index]=le;var de=le.part;z.hls.trigger(f.Events.FRAG_LOADED,le);var Te=R[K+1];if(Te&&Te.fragment===w)J(K+1);else return q({frag:w,part:de,partsLoaded:M})}).catch(B)};G(N)})},E.handleFragLoadError=function(w){var R=w.data;return R&&R.details===p.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(R.frag,R.part):this.hls.trigger(f.Events.ERROR,R),null},E._handleTransmuxerFlush=function(w){var R=this.getCurrentContext(w);if(!R||this.state!==m.PARSING){this.fragCurrent||(this.state=m.IDLE);return}var N=R.frag,F=R.part,z=R.level,q=self.performance.now();N.stats.parsing.end=q,F&&(F.stats.parsing.end=q),this.updateLevelTiming(N,F,z,w.partial)},E.getCurrentContext=function(w){var R=this.levels,N=w.level,F=w.sn,z=w.part;if(!R||!R[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var q=R[N],B=z>-1?Object(r.getPartWith)(q,F,z):null,M=B?B.fragment:Object(r.getFragmentWithSN)(q,F,this.fragCurrent);return M?{frag:M,part:B,level:q}:null},E.bufferFragmentData=function(w,R,N,F){if(!w||this.state!==m.PARSING)return;var z=w.data1,q=w.data2,B=z;if(z&&q&&(B=Object(s.appendUint8Array)(z,q)),!B||!B.length)return;var M={type:w.type,frag:R,part:N,chunkMeta:F,parent:R.type,data:B};this.hls.trigger(f.Events.BUFFER_APPENDING,M),w.dropped&&w.independent&&!N&&this.flushBufferGap(R)},E.flushBufferGap=function(w){var R=this.media;if(!R)return;if(!A.BufferHelper.isBuffered(R,R.currentTime)){this.flushMainBuffer(0,w.start);return}var N=R.currentTime,F=A.BufferHelper.bufferInfo(R,N,0),z=w.duration,q=Math.min(this.config.maxFragLookUpTolerance*2,z*.25),B=Math.max(Math.min(w.start-q,F.end-q),N+q);w.start-B>q&&this.flushMainBuffer(B,w.start)},E.getFwdBufferInfo=function(w,R){var N=this.config,F=this.getLoadPosition();if(!Object(C.isFiniteNumber)(F))return null;var z=A.BufferHelper.bufferInfo(w,F,N.maxBufferHole);if(z.len===0&&z.nextStart!==void 0){var q=this.fragmentTracker.getBufferedFrag(F,R);if(q&&z.nextStart<q.end)return A.BufferHelper.bufferInfo(w,F,Math.max(z.nextStart,N.maxBufferHole))}return z},E.getMaxBufferLength=function(w){var R=this.config,N;return w?N=Math.max(8*R.maxBufferSize/w,R.maxBufferLength):N=R.maxBufferLength,Math.min(N,R.maxMaxBufferLength)},E.reduceMaxBufferLength=function(w){var R=this.config,N=w||R.maxBufferLength;return R.maxMaxBufferLength>=N?(R.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+R.maxMaxBufferLength+"s"),!0):!1},E.getNextFragment=function(w,R){var N,F,z=R.fragments,q=z.length;if(!q)return null;var B=this.config,M=z[0].start,G;if(R.live){var J=B.initialLiveManifestSize;if(q<J)return this.warn("Not enough fragments to start playback (have: "+q+", need: "+J+")"),null;!R.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(R,z),this.startPosition=G?this.hls.liveSyncPosition||G.start:w)}else w<=M&&(G=z[0]);if(!G){var K=B.lowLatencyMode?R.partEnd:R.fragmentEnd;G=this.getFragmentAtPosition(w,K,R)}return(N=G)!==null&&N!==void 0&&N.initSegment&&!((F=G)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},E.getNextPart=function(w,R,N){for(var F=-1,z=!1,q=!0,B=0,M=w.length;B<M;B++){var G=w[B];if(q=q&&!G.independent,F>-1&&N<G.start)break;var J=G.loaded;!J&&(z||G.independent||q)&&G.fragment===R&&(F=B),z=J}return F},E.loadedEndOfParts=function(w,R){var N=w[w.length-1];return N&&R>N.start&&N.loaded},E.getInitialLiveFragment=function(w,R){var N=this.fragPrevious,F=null;if(N){if(w.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(o.findFragmentByPDT)(R,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var z=N.sn+1;if(z>=w.startSN&&z<=w.endSN){var q=R[z-w.startSN];N.cc===q.cc&&(F=q,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(o.findFragWithCC)(R,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(F=this.getFragmentAtPosition(B,this.bitrateTest?w.fragmentEnd:w.edge,w))}return F},E.getFragmentAtPosition=function(w,R,N){var F=this.config,z=this.fragPrevious,q=N.fragments,B=N.endSN,M=N.fragmentHint,G=F.maxFragLookUpTolerance,J=!!(F.lowLatencyMode&&N.partList&&M);J&&M&&!this.bitrateTest&&(q=q.concat(M),B=M.sn);var K;if(w<R){var Z=w>R-G?0:G;K=Object(o.findFragmentByPTS)(z,q,w,Z)}else K=q[q.length-1];if(K){var le=K.sn-N.startSN,de=z&&K.level===z.level,Te=q[le+1],we=this.fragmentTracker.getState(K);if(we===T.FragmentState.BACKTRACKED){K=null;for(var Ie=le;q[Ie]&&this.fragmentTracker.getState(q[Ie])===T.FragmentState.BACKTRACKED;)z?K=q[Ie--]:K=q[--Ie];K||(K=Te)}else z&&K.sn===z.sn&&!J&&(de&&(K.sn<B&&this.fragmentTracker.getState(Te)!==T.FragmentState.OK?(this.log("SN "+K.sn+" just loaded, load next one: "+Te.sn),K=Te):K=null))}return K},E.synchronizeToLiveEdge=function(w){var R=this.config,N=this.media;if(!N)return;var F=this.hls.liveSyncPosition,z=N.currentTime,q=w.fragments[0].start,B=w.edge,M=z>=q-R.maxFragLookUpTolerance&&z<=B;if(F!==null&&N.duration>F&&(z<F||!M)){var G=R.liveMaxLatencyDuration!==void 0?R.liveMaxLatencyDuration:R.liveMaxLatencyDurationCount*w.targetduration;(!M&&N.readyState<4||z<B-G)&&(this.loadedmetadata||(this.nextLoadPosition=F),N.readyState&&(this.warn("Playback: "+z.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+F.toFixed(3)),N.currentTime=F))}},E.alignPlaylists=function(w,R){var N=this.levels,F=this.levelLastLoaded,z=this.fragPrevious,q=F!==null?N[F]:null,B=w.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var M=w.fragments[0].start,G=!R,J=w.alignedSliding&&Object(C.isFiniteNumber)(M);if(G||!J&&!M){Object(n.alignStream)(z,q,w);var K=w.fragments[0].start;return this.log("Live playlist sliding: "+K.toFixed(2)+" start-sn: "+(R?R.startSN:"na")+"->"+w.startSN+" prev-sn: "+(z?z.sn:"na")+" fragments: "+B),K}return M},E.waitForCdnTuneIn=function(w){var R=3;return w.live&&w.canBlockReload&&w.tuneInGoal>Math.max(w.partHoldBack,w.partTarget*R)},E.setStartPosition=function(w,R){var N=this.startPosition;if(N<R&&(N=-1),N===-1||this.lastCurrentTime===-1){var F=w.startTimeOffset;Object(C.isFiniteNumber)(F)?(N=R+F,F<0&&(N+=w.totalduration),N=Math.min(Math.max(R,N),R+w.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+N),this.startPosition=N):w.live?N=this.hls.liveSyncPosition||R:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},E.getLoadPosition=function(){var w=this.media,R=0;return this.loadedmetadata&&w?R=w.currentTime:this.nextLoadPosition&&(R=this.nextLoadPosition),R},E.handleFragLoadAborted=function(w,R){this.transmuxer&&w.sn!=="initSegment"&&w.stats.aborted&&(this.warn("Fragment "+w.sn+(R?" part"+R.index:"")+" of level "+w.level+" was aborted"),this.resetFragmentLoading(w))},E.resetFragmentLoading=function(w){(!this.fragCurrent||!this.fragContextChanged(w))&&(this.state=m.IDLE)},E.onFragmentOrKeyLoadError=function(w,R){if(R.fatal)return;var N=R.frag;if(!N||N.type!==w)return;var F=this.fragCurrent;console.assert(F&&N.sn===F.sn&&N.level===F.level&&N.urlId===F.urlId,"Frag load error must match current frag to retry");var z=this.config;if(this.fragLoadError+1<=z.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var q=Math.min(Math.pow(2,this.fragLoadError)*z.fragLoadingRetryDelay,z.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+w+" "+N.level+" failed to load, retrying in "+q+"ms"),this.retryDate=self.performance.now()+q,this.fragLoadError++,this.state=m.FRAG_LOADING_WAITING_RETRY}else R.levelRetry?(w===t.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=m.IDLE):(O.logger.error(R.details+" reaches max retry, redispatch as fatal ..."),R.fatal=!0,this.hls.stopLoad(),this.state=m.ERROR)},E.afterBufferFlushed=function(w,R,N){if(!w)return;var F=A.BufferHelper.getBuffered(w);this.fragmentTracker.detectEvictedFragments(R,F,N),this.state===m.ENDED&&this.resetLoadingState()},E.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=m.IDLE},E.resetLiveStartWhenNotLoaded=function(w){if(!this.loadedmetadata){this.startFragRequested=!1;var R=this.levels?this.levels[w].details:null;if(R!=null&&R.live)return this.startPosition=-1,this.setStartPosition(R,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},E.updateLevelTiming=function(w,R,N,F){var z=this,q=N.details;console.assert(!!q,"level.details must be defined");var B=Object.keys(w.elementaryStreams).reduce(function(M,G){var J=w.elementaryStreams[G];if(J){var K=J.endPTS-J.startPTS;if(K<=0)return z.warn("Could not parse fragment "+w.sn+" "+G+" duration reliably ("+K+") resetting transmuxer to fallback to playlist timing"),z.resetTransmuxer(),M||!1;var Z=F?0:Object(r.updateFragPTSDTS)(q,w,J.startPTS,J.endPTS,J.startDTS,J.endDTS);return z.hls.trigger(f.Events.LEVEL_PTS_UPDATED,{details:q,level:N,drift:Z,type:G,frag:w,start:J.startPTS,end:J.endPTS}),!0}return M},!1);B?(this.state=m.PARSED,this.hls.trigger(f.Events.FRAG_PARSED,{frag:w,part:R})):this.resetLoadingState()},E.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(h,[{key:"state",get:function(){return this._state},set:function(w){var R=this._state;R!==w&&(this._state=w,this.log(R+"->"+w))}}]),h}(D.default)},"./src/controller/buffer-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o});var C=W("./src/polyfills/number.ts"),D=W("./src/events.ts"),T=W("./src/utils/logger.ts"),A=W("./src/errors.ts"),O=W("./src/utils/buffer-helper.ts"),f=W("./src/utils/mediasource-helper.ts"),p=W("./src/loader/fragment.ts"),c=W("./src/controller/buffer-operation-queue.ts"),s=Object(f.getMediaSource)(),n=/([ha]vc.)(?:\.[^.,]+)+/,o=function(){function r(a){var i=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=i.hls,d=i.media,v=i.mediaSource;T.logger.log("[buffer-controller]: Media source opened"),d&&(i.updateMediaElementDuration(),t.trigger(D.Events.MEDIA_ATTACHED,{media:d})),v&&v.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){T.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){T.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var l=r.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var i=this.hls;i.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(D.Events.BUFFER_RESET,this.onBufferReset,this),i.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(D.Events.BUFFER_EOS,this.onBufferEos,this),i.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(D.Events.FRAG_PARSED,this.onFragParsed,this),i.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var i=this.hls;i.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(D.Events.BUFFER_RESET,this.onBufferReset,this),i.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(D.Events.BUFFER_EOS,this.onBufferEos,this),i.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(D.Events.FRAG_PARSED,this.onFragParsed,this),i.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(i,t){var d=2;(t.audio&&!t.video||!t.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,T.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(i,t){var d=this.media=t.media;if(d&&s){var v=this.mediaSource=new s;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}},l.onMediaDetaching=function(){var i=this.media,t=this.mediaSource,d=this._objectUrl;if(t){if(T.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(v){T.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),i&&(d&&self.URL.revokeObjectURL(d),i.src===d?(i.removeAttribute("src"),i.load()):T.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(D.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(t){var d=i.sourceBuffer[t];try{d&&(i.removeBufferListeners(t),i.mediaSource&&i.mediaSource.removeSourceBuffer(d),i.sourceBuffer[t]=void 0)}catch(v){T.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",v)}}),this._initSourceBuffer()},l.onBufferCodecs=function(i,t){var d=this,v=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(y){if(v){var b=d.tracks[y];if(b&&typeof b.buffer.changeType=="function"){var g=t[y],m=g.codec,_=g.levelCodec,x=g.container,h=(b.levelCodec||b.codec).replace(n,"$1"),E=(_||m).replace(n,"$1");if(h!==E){var S=x+";codecs="+(_||m);d.appendChangeType(y,S)}}}else d.pendingTracks[y]=t[y]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(i,t){var d=this,v=this.operationQueue,y={execute:function(){var g=d.sourceBuffer[i];g&&(T.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+t),g.changeType(t)),v.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(g){T.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",g)}};v.append(y,i)},l.onBufferAppending=function(i,t){var d=this,v=this.hls,y=this.operationQueue,b=this.tracks,g=t.data,m=t.type,_=t.frag,x=t.part,h=t.chunkMeta,E=h.buffering[m],S=self.performance.now();E.start=S;var w=_.stats.buffering,R=x?x.stats.buffering:null;w.start===0&&(w.start=S),R&&R.start===0&&(R.start=S);var N=b.audio,F=m==="audio"&&h.id===1&&(N==null?void 0:N.container)==="audio/mpeg",z={execute:function(){if(E.executeStart=self.performance.now(),F){var B=d.sourceBuffer[m];if(B){var M=_.start-B.timestampOffset;Math.abs(M)>=.1&&(T.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+M+") sn: "+_.sn+")"),B.timestampOffset=_.start)}}d.appendExecutor(g,m)},onStart:function(){},onComplete:function(){var B=self.performance.now();E.executeEnd=E.end=B,w.first===0&&(w.first=B),R&&R.first===0&&(R.first=B);var M=d.sourceBuffer,G={};for(var J in M)G[J]=O.BufferHelper.getBuffered(M[J]);d.appendError=0,d.hls.trigger(D.Events.BUFFER_APPENDED,{type:m,frag:_,part:x,chunkMeta:h,parent:_.type,timeRanges:G})},onError:function(B){T.logger.error("[buffer-controller]: Error encountered while trying to append to the "+m+" SourceBuffer",B);var M={type:A.ErrorTypes.MEDIA_ERROR,parent:_.type,details:A.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?M.details=A.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,M.details=A.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>v.config.appendErrorMaxRetry&&(T.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),M.fatal=!0)),v.trigger(D.Events.ERROR,M)}};y.append(z,m)},l.onBufferFlushing=function(i,t){var d=this,v=this.operationQueue,y=function(g){return{execute:d.removeExecutor.bind(d,g,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(D.Events.BUFFER_FLUSHED,{type:g})},onError:function(_){T.logger.warn("[buffer-controller]: Failed to remove from "+g+" SourceBuffer",_)}}};t.type?v.append(y(t.type),t.type):this.getSourceBufferTypes().forEach(function(b){v.append(y(b),b)})},l.onFragParsed=function(i,t){var d=this,v=t.frag,y=t.part,b=[],g=y?y.elementaryStreams:v.elementaryStreams;g[p.ElementaryStreamTypes.AUDIOVIDEO]?b.push("audiovideo"):(g[p.ElementaryStreamTypes.AUDIO]&&b.push("audio"),g[p.ElementaryStreamTypes.VIDEO]&&b.push("video"));var m=function(){var x=self.performance.now();v.stats.buffering.end=x,y&&(y.stats.buffering.end=x);var h=y?y.stats:v.stats;d.hls.trigger(D.Events.FRAG_BUFFERED,{frag:v,part:y,stats:h,id:v.type})};b.length===0&&T.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(m,b)},l.onFragChanged=function(i,t){this.flushBackBuffer()},l.onBufferEos=function(i,t){var d=this,v=this.getSourceBufferTypes().reduce(function(y,b){var g=d.sourceBuffer[b];return(!t.type||t.type===b)&&(g&&!g.ended&&(g.ended=!0,T.logger.log("[buffer-controller]: "+b+" sourceBuffer now EOS"))),y&&!!(!g||g.ended)},!0);v&&this.blockBuffers(function(){var y=d.mediaSource;if(!y||y.readyState!=="open")return;y.endOfStream()})},l.onLevelUpdated=function(i,t){var d=t.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var i=this.hls,t=this.details,d=this.media,v=this.sourceBuffer;if(!d||t===null)return;var y=this.getSourceBufferTypes();if(!y.length)return;var b=t.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(C.isFiniteNumber)(b)||b<0)return;var g=d.currentTime,m=t.levelTargetDuration,_=Math.max(b,m),x=Math.floor(g/m)*m-_;y.forEach(function(h){var E=v[h];if(E){var S=O.BufferHelper.getBuffered(E);S.length>0&&x>S.start(0)&&(i.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:x}),t.live&&i.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:x}),i.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:x,type:h}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,t=this.hls,d=this.media,v=this.mediaSource,y=i.fragments[0].start+i.totalduration,b=d.duration,g=Object(C.isFiniteNumber)(v.duration)?v.duration:0;i.live&&t.config.liveDurationInfinity?(T.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(i)):(y>g&&y>b||!Object(C.isFiniteNumber)(b))&&(T.logger.log("[buffer-controller]: Updating Media Source duration to "+y.toFixed(3)),v.duration=y)},l.updateSeekableRange=function(i){var t=this.mediaSource,d=i.fragments,v=d.length;if(v&&i.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var y=Math.max(0,d[0].start),b=Math.max(y,y+i.totalduration);t.setLiveSeekableRange(y,b)}},l.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,t=this.operationQueue,d=this.pendingTracks,v=Object.keys(d).length;if(v&&!i||v===2){this.createSourceBuffers(d),this.pendingTracks={};var y=this.getSourceBufferTypes();if(y.length===0){this.hls.trigger(D.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}y.forEach(function(b){t.executeNext(b)})}},l.createSourceBuffers=function(i){var t=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var y in i)if(!t[y]){var b=i[y];if(!b)throw Error("source buffer exists for track "+y+", however track does not");var g=b.levelCodec||b.codec,m=b.container+";codecs="+g;T.logger.log("[buffer-controller]: creating sourceBuffer("+m+")");try{var _=t[y]=d.addSourceBuffer(m),x=y;this.addBufferListener(x,"updatestart",this._onSBUpdateStart),this.addBufferListener(x,"updateend",this._onSBUpdateEnd),this.addBufferListener(x,"error",this._onSBUpdateError),this.tracks[y]={buffer:_,codec:g,container:b.container,levelCodec:b.levelCodec,id:b.id},v++}catch(h){T.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(D.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:m})}}v&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(i){var t=this.operationQueue,d=t.current(i);d.onStart()},l._onSBUpdateEnd=function(i){var t=this.operationQueue,d=t.current(i);d.onComplete(),t.shiftAndExecuteNext(i)},l._onSBUpdateError=function(i,t){T.logger.error("[buffer-controller]: "+i+" SourceBuffer error",t),this.hls.trigger(D.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(i);d&&d.onError(t)},l.removeExecutor=function(i,t,d){var v=this.media,y=this.mediaSource,b=this.operationQueue,g=this.sourceBuffer,m=g[i];if(!v||!y||!m){T.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),b.shiftAndExecuteNext(i);return}var _=Object(C.isFiniteNumber)(v.duration)?v.duration:Infinity,x=Object(C.isFiniteNumber)(y.duration)?y.duration:Infinity,h=Math.max(0,t),E=Math.min(d,_,x);E>h?(T.logger.log("[buffer-controller]: Removing ["+h+","+E+"] from the "+i+" SourceBuffer"),console.assert(!m.updating,i+" sourceBuffer must not be updating"),m.remove(h,E)):b.shiftAndExecuteNext(i)},l.appendExecutor=function(i,t){var d=this.operationQueue,v=this.sourceBuffer,y=v[t];if(!y){T.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(t);return}y.ended=!1,console.assert(!y.updating,t+" sourceBuffer must not be updating"),y.appendBuffer(i)},l.blockBuffers=function(i,t){var d=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){T.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var v=this.operationQueue,y=t.map(function(b){return v.appendBlocker(b)});Promise.all(y).then(function(){i(),t.forEach(function(b){var g=d.sourceBuffer[b];(!g||!g.updating)&&v.shiftAndExecuteNext(b)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(i,t,d){var v=this.sourceBuffer[i];if(!v)return;var y=d.bind(this,i);this.listeners[i].push({event:t,listener:y}),v.addEventListener(t,y)},l.removeBufferListeners=function(i){var t=this.sourceBuffer[i];if(!t)return;this.listeners[i].forEach(function(d){t.removeEventListener(d.event,d.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return D});var C=W("./src/utils/logger.ts"),D=function(){function T(O){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=O}var A=T.prototype;return A.append=function(f,p){var c=this.queues[p];c.push(f),c.length===1&&this.buffers[p]&&this.executeNext(p)},A.insertAbort=function(f,p){var c=this.queues[p];c.unshift(f),this.executeNext(p)},A.appendBlocker=function(f){var p,c=new Promise(function(n){p=n}),s={execute:p,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(s,f),c},A.executeNext=function(f){var p=this.buffers,c=this.queues,s=p[f],n=c[f];if(n.length){var o=n[0];try{o.execute()}catch(r){C.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(r),(!s||!s.updating)&&(n.shift(),this.executeNext(f))}}},A.shiftAndExecuteNext=function(f){this.queues[f].shift(),this.executeNext(f)},A.current=function(f){return this.queues[f][0]},T}()},"./src/controller/cap-level-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts");function D(O,f){for(var p=0;p<f.length;p++){var c=f[p];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(O,c.key,c)}}function T(O,f,p){return f&&D(O.prototype,f),p&&D(O,p),O}var A=function(){function O(p){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=p,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var f=O.prototype;return f.setStreamController=function(c){this.streamController=c},f.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},f.registerListeners=function(){var c=this.hls;c.on(C.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.on(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(C.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},f.unregisterListener=function(){var c=this.hls;c.off(C.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.off(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(C.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},f.onFpsDropLevelCapping=function(c,s){O.isLevelAllowed(s.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(s.droppedLevel)},f.onMediaAttaching=function(c,s){this.media=s.media instanceof HTMLVideoElement?s.media:null},f.onManifestParsed=function(c,s){var n=this.hls;this.restrictedLevels=[],this.firstLevel=s.firstLevel,n.config.capLevelToPlayerSize&&s.video&&this.startCapping()},f.onBufferCodecs=function(c,s){var n=this.hls;n.config.capLevelToPlayerSize&&s.video&&this.startCapping()},f.onMediaDetaching=function(){this.stopCapping()},f.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var c=this.hls.levels;if(c.length){var s=this.hls;s.autoLevelCapping=this.getMaxLevel(c.length-1),s.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=s.autoLevelCapping}}},f.getMaxLevel=function(c){var s=this,n=this.hls.levels;if(!n.length)return-1;var o=n.filter(function(r,l){return O.isLevelAllowed(l,s.restrictedLevels)&&l<=c});return this.clientRect=null,O.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},f.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},f.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},f.getDimensions=function(){if(this.clientRect)return this.clientRect;var c=this.media,s={width:0,height:0};if(c){var n=c.getBoundingClientRect();s.width=n.width,s.height=n.height,!s.width&&!s.height&&(s.width=n.right-n.left||c.width||0,s.height=n.bottom-n.top||c.height||0)}return this.clientRect=s,s},O.isLevelAllowed=function(c,s){return s===void 0&&(s=[]),s.indexOf(c)===-1},O.getMaxLevelByMediaSize=function(c,s,n){if(!c||!c.length)return-1;for(var o=function(t,d){return d?t.width!==d.width||t.height!==d.height:!0},r=c.length-1,l=0;l<c.length;l+=1){var a=c[l];if((a.width>=s||a.height>=n)&&o(a,c[l+1])){r=l;break}}return r},T(O,[{key:"mediaWidth",get:function(){return this.getDimensions().width*O.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*O.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var c=1;try{c=self.devicePixelRatio}catch(s){}return c}}]),O}();ie.default=A},"./src/controller/cmcd-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o});var C=W("./src/events.ts"),D=W("./src/types/cmcd.ts"),T=W("./src/utils/buffer-helper.ts"),A=W("./src/utils/logger.ts");function O(r,l){for(var a=0;a<l.length;a++){var i=l[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function f(r,l,a){return l&&O(r.prototype,l),a&&O(r,a),r}function p(r,l){var a=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=c(r))||l&&r&&typeof r.length=="number"){a&&(r=a);var i=0;return function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}}}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 c(r,l){if(!r)return;if(typeof r=="string")return s(r,l);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return s(r,l)}function s(r,l){(l==null||l>r.length)&&(l=r.length);for(var a=0,i=new Array(l);a<l;a++)i[a]=r[a];return i}function n(){return n=Object.assign||function(r){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(r[i]=a[i])}return r},n.apply(this,arguments)}var o=function(){function r(a){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(v){try{i.apply(v,{ot:D.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(y){A.logger.warn("Could not generate manifest CMCD data.",y)}},this.applyFragmentData=function(v){try{var y=v.frag,b=i.hls.levels[y.level],g=i.getObjectType(y),m={d:y.duration*1e3,ot:g};(g===D.CMCDObjectType.VIDEO||g===D.CMCDObjectType.AUDIO||g==D.CMCDObjectType.MUXED)&&(m.br=b.bitrate/1e3,m.tb=i.getTopBandwidth(g),m.bl=i.getBufferLength(g)),i.apply(v,m)}catch(_){A.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=a;var t=this.config=a.config,d=t.cmcd;d!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||r.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var l=r.prototype;return l.registerListeners=function(){var i=this.hls;i.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(C.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var i=this.hls;i.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(C.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(i,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(i,t){var d,v;this.audioBuffer=(d=t.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(v=t.tracks.video)===null||v===void 0?void 0:v.buffer},l.createData=function(){var i;return{v:D.CMCDVersion,sf:D.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(i,t){t===void 0&&(t={}),n(t,this.createData());var d=t.ot===D.CMCDObjectType.INIT||t.ot===D.CMCDObjectType.VIDEO||t.ot===D.CMCDObjectType.MUXED;if(this.starved&&d&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){var v=r.toHeaders(t);if(!Object.keys(v).length)return;i.headers||(i.headers={}),n(i.headers,v)}else{var y=r.toQuery(t);if(!y)return;i.url=r.appendQueryToUri(i.url,y)}},l.getObjectType=function(i){var t=i.type;return t==="subtitle"?D.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?D.CMCDObjectType.INIT:t==="audio"?D.CMCDObjectType.AUDIO:t==="main"?this.hls.audioTracks.length?D.CMCDObjectType.VIDEO:D.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(i){for(var t=0,d=i===D.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=p(d),y;!(y=v()).done;){var b=y.value;b.bitrate>t&&(t=b.bitrate)}return t>0?t:NaN},l.getBufferLength=function(i){var t=this.hls.media,d=i===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!t)return NaN;var v=T.BufferHelper.bufferInfo(d,t.currentTime,this.config.maxBufferHole);return v.len*1e3},l.createPlaylistLoader=function(){var i=this.config.pLoader,t=this.applyPlaylistData,d=i||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new d(b)}var y=v.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(g,m,_){t(g),this.loader.load(g,m,_)},f(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},l.createFragmentLoader=function(){var i=this.config.fLoader,t=this.applyFragmentData,d=i||this.config.loader;return function(){function v(b){this.loader=void 0,this.loader=new d(b)}var y=v.prototype;return y.destroy=function(){this.loader.destroy()},y.abort=function(){this.loader.abort()},y.load=function(g,m,_){t(g),this.loader.load(g,m,_)},f(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},r.uuid=function(){var i=URL.createObjectURL(new Blob),t=i.toString();return URL.revokeObjectURL(i),t.substr(t.lastIndexOf("/")+1)},r.serialize=function(i){for(var t=[],d=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},v=function(F){return Math.round(F)},y=function(F){return v(F/100)*100},b=function(F){return encodeURIComponent(F)},g={br:v,d:v,bl:y,dl:y,mtp:y,nor:b,rtp:y,tb:v},m=Object.keys(i||{}).sort(),_=p(m),x;!(x=_()).done;){var h=x.value,E=i[h];if(!d(E))continue;if(h==="v"&&E===1)continue;if(h=="pr"&&E===1)continue;var S=g[h];S&&(E=S(E));var w=typeof E,R=void 0;h==="ot"||h==="sf"||h==="st"?R=h+"="+E:w==="boolean"?R=h:w==="number"?R=h+"="+E:R=h+"="+JSON.stringify(E),t.push(R)}return t.join(",")},r.toHeaders=function(i){for(var t=Object.keys(i),d={},v=["Object","Request","Session","Status"],y=[{},{},{},{}],b={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},g=0,m=t;g<m.length;g++){var _=m[g],x=b[_]!=null?b[_]:1;y[x][_]=i[_]}for(var h=0;h<y.length;h++){var E=r.serialize(y[h]);E&&(d["CMCD-"+v[h]]=E)}return d},r.toQuery=function(i){return"CMCD="+encodeURIComponent(r.serialize(i))},r.appendQueryToUri=function(i,t){if(!t)return i;var d=i.includes("?")?"&":"?";return""+i+d+t},r}()},"./src/controller/eme-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/utils/logger.ts"),A=W("./src/utils/mediakeys-helper.ts");function O(o,r){for(var l=0;l<r.length;l++){var a=r[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function f(o,r,l){return r&&O(o.prototype,r),l&&O(o,l),o}var p=3,c=function(r,l,a){var i={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(t){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:a.audioRobustness||""})}),l.forEach(function(t){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:a.videoRobustness||""})}),[i]},s=function(r,l,a,i){switch(r){case A.KeySystems.WIDEVINE:return c(l,a,i);default:throw new Error("Unknown key-system: "+r)}},n=function(){function o(l){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=l,this._config=l.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var r=o.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(C.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(C.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(a){switch(a){case A.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},r._attemptKeySystemAccess=function(a,i,t){var d=this,v=s(a,i,t,this._drmSystemOptions);T.logger.log("Requesting encrypted media key-system access");var y=this.requestMediaKeySystemAccess(a,v);this.mediaKeysPromise=y.then(function(b){return d._onMediaKeySystemAccessObtained(a,b)}),y.catch(function(b){T.logger.error('Failed to obtain key-system "'+a+'" access:',b)})},r._onMediaKeySystemAccessObtained=function(a,i){var t=this;T.logger.log('Access for key-system "'+a+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:a};this._mediaKeysList.push(d);var v=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(y){return d.mediaKeys=y,T.logger.log('Media-keys created for key-system "'+a+'"'),t._onMediaKeysCreated(),y});return v.catch(function(y){T.logger.error("Failed to create media-keys:",y)}),v},r._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),a._onNewMediaKeySession(i.mediaKeysSession))})},r._onNewMediaKeySession=function(a){var i=this;T.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(t){i._onKeySessionMessage(a,t.message)},!1)},r._onKeySessionMessage=function(a,i){T.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(t){T.logger.log("Received license data (length: "+(t&&t.byteLength)+"), updating key-session"),a.update(t)})},r.onMediaEncrypted=function(a){var i=this;if(T.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){T.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var t=function(v){if(!i._media)return;i._attemptSetMediaKeys(v),i._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(t).catch(t)},r._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){T.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}T.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(a,i){var t=this,d=this._mediaKeysList[0];if(!d){T.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){T.logger.warn("Key-Session already initialized but requested again");return}var v=d.mediaKeysSession;if(!v){T.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){T.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}T.logger.log('Generating key-session request for "'+a+'" init data type'),d.mediaKeysSessionInitialized=!0,v.generateRequest(a,i).then(function(){T.logger.debug("Key-session generation succeeded")}).catch(function(y){T.logger.error("Error generating key-session request:",y),t.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(a,i,t){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,a,i,t);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,d,a),v=void 0}catch(y){T.logger.error(y)}try{d.readyState||d.open("POST",a,!0),v&&v.call(this.hls,d,a)}catch(y){throw new Error("issue setting up KeySystem license XHR "+y)}return d},r._onLicenseRequestReadyStageChange=function(a,i,t,d){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,T.logger.log("License request succeeded");var v=a.response,y=this._licenseResponseCallback;if(y)try{v=y.call(this.hls,a,i)}catch(g){T.logger.error(g)}d(v)}else{if(T.logger.error("License Request XHR failed ("+i+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>p){this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var b=p-this._requestLicenseFailureCount+1;T.logger.warn("Retrying license request, "+b+" attempts left"),this._requestLicense(t,d)}break}},r._generateLicenseRequestChallenge=function(a,i){switch(a.mediaKeySystemDomain){case A.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},r._requestLicense=function(a,i){T.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){T.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(t.mediaKeySystemDomain),v=this._createLicenseXhr(d,a,i);T.logger.log("Sending license request to URL: "+d);var y=this._generateLicenseRequestChallenge(t,a);v.send(y)}catch(b){T.logger.error("Failure requesting DRM license: "+b),this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(a,i){if(!this._emeEnabled)return;var t=i.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var a=this._media,i=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(a,i){if(!this._emeEnabled)return;var t=i.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),d=i.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(A.KeySystems.WIDEVINE,t,d)},f(o,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),o}();ie.default=n},"./src/controller/fps-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/utils/logger.ts"),T=function(){function A(f){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=f,this.registerListeners()}var O=A.prototype;return O.setStreamController=function(p){this.streamController=p},O.registerListeners=function(){this.hls.on(C.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},O.unregisterListeners=function(){this.hls.off(C.Events.MEDIA_ATTACHING,this.onMediaAttaching)},O.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},O.onMediaAttaching=function(p,c){var s=this.hls.config;if(s.capLevelOnFPSDrop){var n=c.media instanceof self.HTMLVideoElement?c.media:null;this.media=n,n&&typeof n.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}},O.checkFPS=function(p,c,s){var n=performance.now();if(c){if(this.lastTime){var o=n-this.lastTime,r=s-this.lastDroppedFrames,l=c-this.lastDecodedFrames,a=1e3*r/o,i=this.hls;if(i.trigger(C.Events.FPS_DROP,{currentDropped:r,currentDecoded:l,totalDroppedFrames:s}),a>0&&r>i.config.fpsDroppedMonitoringThreshold*l){var t=i.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=t)&&(t=t-1,i.trigger(C.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:i.currentLevel}),i.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=s,this.lastDecodedFrames=c}},O.checkFPSInterval=function(){var p=this.media;if(p)if(this.isVideoPlaybackQualityAvailable){var c=p.getVideoPlaybackQuality();this.checkFPS(p,c.totalVideoFrames,c.droppedVideoFrames)}else this.checkFPS(p,p.webkitDecodedFrameCount,p.webkitDroppedFrameCount)},A}();ie.default=T},"./src/controller/fragment-finders.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"findFragmentByPDT",function(){return T}),W.d(ie,"findFragmentByPTS",function(){return A}),W.d(ie,"fragmentWithinToleranceTest",function(){return O}),W.d(ie,"pdtWithinToleranceTest",function(){return f}),W.d(ie,"findFragWithCC",function(){return p});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/binary-search.ts");function T(c,s,n){if(s===null||!Array.isArray(c)||!c.length||!Object(C.isFiniteNumber)(s))return null;var o=c[0].programDateTime;if(s<(o||0))return null;var r=c[c.length-1].endProgramDateTime;if(s>=(r||0))return null;n=n||0;for(var l=0;l<c.length;++l){var a=c[l];if(f(s,n,a))return a}return null}function A(c,s,n,o){n===void 0&&(n=0),o===void 0&&(o=0);var r=null;if(c?r=s[c.sn-s[0].sn+1]||null:n===0&&s[0].start===0&&(r=s[0]),r&&O(n,o,r)===0)return r;var l=D.default.search(s,O.bind(null,n,o));return l||r}function O(c,s,n){c===void 0&&(c=0),s===void 0&&(s=0);var o=Math.min(s,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-o<=c?1:n.start-o>c&&n.start?-1:0}function f(c,s,n){var o=Math.min(s,n.duration+(n.deltaPTS?n.deltaPTS:0))*1e3,r=n.endProgramDateTime||0;return r-o>c}function p(c,s){return D.default.search(c,function(n){return n.cc<s?1:n.cc>s?-1:0})}},"./src/controller/fragment-tracker.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"FragmentState",function(){return T}),W.d(ie,"FragmentTracker",function(){return A});var C=W("./src/events.ts"),D=W("./src/types/loader.ts"),T;(function(p){p.NOT_LOADED="NOT_LOADED",p.BACKTRACKED="BACKTRACKED",p.APPENDING="APPENDING",p.PARTIAL="PARTIAL",p.OK="OK"})(T||(T={}));var A=function(){function p(s){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=s,this._registerListeners()}var c=p.prototype;return c._registerListeners=function(){var n=this.hls;n.on(C.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.on(C.Events.FRAG_LOADED,this.onFragLoaded,this)},c._unregisterListeners=function(){var n=this.hls;n.off(C.Events.BUFFER_APPENDED,this.onBufferAppended,this),n.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.off(C.Events.FRAG_LOADED,this.onFragLoaded,this)},c.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},c.getAppendedFrag=function(n,o){if(o===D.PlaylistLevelType.MAIN){var r=this.activeFragment,l=this.activeParts;if(!r)return null;if(l)for(var a=l.length;a--;){var i=l[a],t=i?i.end:r.appendedPTS;if(i.start<=n&&t!==void 0&&n<=t)return a>9&&(this.activeParts=l.slice(a-9)),i}else if(r.start<=n&&r.appendedPTS!==void 0&&n<=r.appendedPTS)return r}return this.getBufferedFrag(n,o)},c.getBufferedFrag=function(n,o){for(var r=this.fragments,l=Object.keys(r),a=l.length;a--;){var i=r[l[a]];if((i==null?void 0:i.body.type)===o&&i.buffered){var t=i.body;if(t.start<=n&&n<=t.end)return t}}return null},c.detectEvictedFragments=function(n,o,r){var l=this;Object.keys(this.fragments).forEach(function(a){var i=l.fragments[a];if(!i)return;if(!i.buffered){i.body.type===r&&l.removeFragment(i.body);return}var t=i.range[n];if(!t)return;t.time.some(function(d){var v=!l.isTimeBuffered(d.startPTS,d.endPTS,o);return v&&l.removeFragment(i.body),v})})},c.detectPartialFragments=function(n){var o=this,r=this.timeRanges,l=n.frag,a=n.part;if(!r||l.sn==="initSegment")return;var i=f(l),t=this.fragments[i];if(!t)return;Object.keys(r).forEach(function(d){var v=l.elementaryStreams[d];if(!v)return;var y=r[d],b=a!==null||v.partial===!0;t.range[d]=o.getBufferedTimes(l,a,b,y)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},c.fragBuffered=function(n){var o=f(n),r=this.fragments[o];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},c.getBufferedTimes=function(n,o,r,l){for(var a={time:[],partial:r},i=o?o.start:n.start,t=o?o.end:n.end,d=n.minEndPTS||t,v=n.maxStartPTS||i,y=0;y<l.length;y++){var b=l.start(y)-this.bufferPadding,g=l.end(y)+this.bufferPadding;if(v>=b&&d<=g){a.time.push({startPTS:Math.max(i,l.start(y)),endPTS:Math.min(t,l.end(y))});break}else if(i<g&&t>b)a.partial=!0,a.time.push({startPTS:Math.max(i,l.start(y)),endPTS:Math.min(t,l.end(y))});else if(t<=b)break}return a},c.getPartialFragment=function(n){var o=null,r,l,a,i=0,t=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(v){var y=d[v];if(!y)return;O(y)&&(l=y.body.start-t,a=y.body.end+t,n>=l&&n<=a&&(r=Math.min(n-l,a-n),i<=r&&(o=y.body,i=r)))}),o},c.getState=function(n){var o=f(n),r=this.fragments[o];return r?r.buffered?O(r)?T.PARTIAL:T.OK:r.backtrack?T.BACKTRACKED:T.APPENDING:T.NOT_LOADED},c.backtrack=function(n,o){var r=f(n),l=this.fragments[r];if(!l||l.backtrack)return null;var a=l.backtrack=o||l.loaded;return l.loaded=null,a},c.getBacktrackData=function(n){var o=f(n),r=this.fragments[o];if(r){var l,a=r.backtrack;if(a!=null&&(l=a.payload)!==null&&l!==void 0&&l.byteLength)return a;this.removeFragment(n)}return null},c.isTimeBuffered=function(n,o,r){for(var l,a,i=0;i<r.length;i++){if(l=r.start(i)-this.bufferPadding,a=r.end(i)+this.bufferPadding,n>=l&&o<=a)return!0;if(o<=l)return!1}return!1},c.onFragLoaded=function(n,o){var r=o.frag,l=o.part;if(r.sn==="initSegment"||r.bitrateTest||l)return;var a=f(r);this.fragments[a]={body:r,loaded:o,backtrack:null,buffered:!1,range:Object.create(null)}},c.onBufferAppended=function(n,o){var r=this,l=o.frag,a=o.part,i=o.timeRanges;if(l.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=l,a){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(a)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(d){var v=i[d];if(r.detectEvictedFragments(d,v),!a)for(var y=0;y<v.length;y++)l.appendedPTS=Math.max(v.end(y),l.appendedPTS||0)})},c.onFragBuffered=function(n,o){this.detectPartialFragments(o)},c.hasFragment=function(n){var o=f(n);return!!this.fragments[o]},c.removeFragmentsInRange=function(n,o,r){var l=this;Object.keys(this.fragments).forEach(function(a){var i=l.fragments[a];if(!i)return;if(i.buffered){var t=i.body;t.type===r&&t.start<o&&t.end>n&&l.removeFragment(t)}})},c.removeFragment=function(n){var o=f(n);n.stats.loaded=0,n.clearElementaryStreamInfo(),delete this.fragments[o]},c.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},p}();function O(p){var c,s;return p.buffered&&(((c=p.range.video)===null||c===void 0?void 0:c.partial)||((s=p.range.audio)===null||s===void 0?void 0:s.partial))}function f(p){return p.type+"_"+p.level+"_"+p.urlId+"_"+p.sn}},"./src/controller/gap-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"STALL_MINIMUM_DURATION_MS",function(){return O}),W.d(ie,"MAX_START_GAP_JUMP",function(){return f}),W.d(ie,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return p}),W.d(ie,"SKIP_BUFFER_RANGE_START",function(){return c}),W.d(ie,"default",function(){return s});var C=W("./src/utils/buffer-helper.ts"),D=W("./src/errors.ts"),T=W("./src/events.ts"),A=W("./src/utils/logger.ts"),O=250,f=2,p=.1,c=.05,s=function(){function n(r,l,a,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=r,this.media=l,this.fragmentTracker=a,this.hls=i}var o=n.prototype;return o.destroy=function(){this.hls=this.fragmentTracker=this.media=null},o.poll=function(l){var a=this.config,i=this.media,t=this.stalled,d=i.currentTime,v=i.seeking,y=this.seeking&&!v,b=!this.seeking&&v;if(this.seeking=v,d!==l){if(this.moved=!0,t!==null){if(this.stallReported){var g=self.performance.now()-t;A.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(g)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((b||y)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!C.BufferHelper.getBuffered(i).length)return;var m=C.BufferHelper.bufferInfo(i,d,0),_=m.len>0,x=m.nextStart||0;if(!_&&!x)return;if(v){var h=m.len>f,E=!x||x-d>f&&!this.fragmentTracker.getPartialFragment(d);if(h||E)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,w=Math.max(x,m.start||0)-d,R=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=R==null||((S=R.details)===null||S===void 0)?void 0:S.live,F=N?R.details.targetduration*2:f;if(w>0&&w<=F){this._trySkipBufferHole(null);return}}var z=self.performance.now();if(t===null){this.stalled=z;return}var q=z-t;!v&&q>=O&&this._reportStall(m.len);var B=C.BufferHelper.bufferInfo(i,d,a.maxBufferHole);this._tryFixBufferStall(B,q)},o._tryFixBufferStall=function(l,a){var i=this.config,t=this.fragmentTracker,d=this.media,v=d.currentTime,y=t.getPartialFragment(v);if(y){var b=this._trySkipBufferHole(y);if(b)return}l.len>i.maxBufferHole&&a>i.highBufferWatchdogPeriod*1e3&&(A.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},o._reportStall=function(l){var a=this.hls,i=this.media,t=this.stallReported;t||(this.stallReported=!0,A.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+l+")"),a.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},o._trySkipBufferHole=function(l){for(var a=this.config,i=this.hls,t=this.media,d=t.currentTime,v=0,y=C.BufferHelper.getBuffered(t),b=0;b<y.length;b++){var g=y.start(b);if(d+a.maxBufferHole>=v&&d<g){var m=Math.max(g+c,t.currentTime+p);return A.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+m),this.moved=!0,this.stalled=null,t.currentTime=m,l&&i.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+m,frag:l}),m}v=y.end(b)}return 0},o._tryNudgeBuffer=function(){var l=this.config,a=this.hls,i=this.media,t=i.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<l.nudgeMaxRetry){var v=t+d*l.nudgeOffset;A.logger.warn("Nudging 'currentTime' from "+t+" to "+v),i.currentTime=v,a.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else A.logger.error("Playhead still not moving while enough data buffered @"+t+" after "+l.nudgeMaxRetry+" nudges"),a.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},n}()},"./src/controller/id3-track-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/utils/texttrack-utils.ts"),T=W("./src/demux/id3.ts"),A=.25,O=function(){function f(c){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=c,this._registerListeners()}var p=f.prototype;return p.destroy=function(){this._unregisterListeners()},p._registerListeners=function(){var s=this.hls;s.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(C.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.on(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var s=this.hls;s.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(C.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),s.off(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.onMediaAttached=function(s,n){this.media=n.media},p.onMediaDetaching=function(){if(!this.id3Track)return;Object(D.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},p.getID3Track=function(s){if(!this.media)return;for(var n=0;n<s.length;n++){var o=s[n];if(o.kind==="metadata"&&o.label==="id3")return Object(D.sendAddTrackEvent)(o,this.media),o}return this.media.addTextTrack("metadata","id3")},p.onFragParsingMetadata=function(s,n){if(!this.media)return;var o=n.frag,r=n.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<r.length;a++){var i=T.getID3Frames(r[a].data);if(i){var t=r[a].pts,d=a<r.length-1?r[a+1].pts:o.end,v=d-t;v<=0&&(d=t+A);for(var y=0;y<i.length;y++){var b=i[y];if(!T.isTimeStampFrame(b)){var g=new l(t,d,"");g.value=b,this.id3Track.addCue(g)}}}}},p.onBufferFlushing=function(s,n){var o=n.startOffset,r=n.endOffset,l=n.type;if(!l||l==="audio"){var a=this.id3Track;a&&Object(D.removeCuesInRange)(a,o,r)}},f}();ie.default=O},"./src/controller/latency-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return f});var C=W("./src/errors.ts"),D=W("./src/events.ts"),T=W("./src/utils/logger.ts");function A(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}function O(p,c,s){return c&&A(p.prototype,c),s&&A(p,s),p}var f=function(){function p(s){var n=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return n.timeupdate()},this.hls=s,this.config=s.config,this.registerListeners()}var c=p.prototype;return c.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},c.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(D.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(D.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(D.Events.ERROR,this.onError)},c.onMediaAttached=function(n,o){this.media=o.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},c.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},c.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},c.onLevelUpdated=function(n,o){var r=o.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},c.onError=function(n,o){if(o.details!==C.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,T.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},c.timeupdate=function(){var n=this.media,o=this.levelDetails;if(!n||!o)return;this.currentTime=n.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var l=this.config,a=l.lowLatencyMode,i=l.maxLiveSyncPlaybackRate;if(!a||i===1)return;var t=this.targetLatency;if(t===null)return;var d=r-t,v=Math.min(this.maxLatency,t+o.targetduration),y=d<v;if(o.live&&y&&d>.05&&this.forwardBufferLength>1){var b=Math.min(2,Math.max(1,i)),g=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;n.playbackRate=Math.min(b,Math.max(1,g))}else n.playbackRate!==1&&n.playbackRate!==0&&(n.playbackRate=1)},c.estimateLiveEdge=function(){var n=this.levelDetails;return n===null?null:n.edge+n.age},c.computeLatency=function(){var n=this.estimateLiveEdge();return n===null?null:n-this.currentTime},O(p,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var n=this.config,o=this.levelDetails;return n.liveMaxLatencyDuration!==void 0?n.liveMaxLatencyDuration:o?n.liveMaxLatencyDurationCount*o.targetduration:0}},{key:"targetLatency",get:function(){var n=this.levelDetails;if(n===null)return null;var o=n.holdBack,r=n.partHoldBack,l=n.targetduration,a=this.config,i=a.liveSyncDuration,t=a.liveSyncDurationCount,d=a.lowLatencyMode,v=this.hls.userConfig,y=d&&r||o;(v.liveSyncDuration||v.liveSyncDurationCount||y===0)&&(y=i!==void 0?i:t*l);var b=l,g=1;return y+Math.min(this.stallCount*g,b)}},{key:"liveSyncPosition",get:function(){var n=this.estimateLiveEdge(),o=this.targetLatency,r=this.levelDetails;if(n===null||o===null||r===null)return null;var l=r.edge,a=n-o-this.edgeStalled,i=l-r.totalduration,t=l-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(i,a),t)}},{key:"drift",get:function(){var n=this.levelDetails;return n===null?1:n.drift}},{key:"edgeStalled",get:function(){var n=this.levelDetails;if(n===null)return 0;var o=(this.config.lowLatencyMode&&n.partTarget||n.targetduration)*3;return Math.max(n.age-o,0)}},{key:"forwardBufferLength",get:function(){var n=this.media,o=this.levelDetails;if(!n||!o)return 0;var r=n.buffered.length;return r?n.buffered.end(r-1):o.edge-this.currentTime}}]),p}()},"./src/controller/level-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return a});var C=W("./src/types/level.ts"),D=W("./src/events.ts"),T=W("./src/errors.ts"),A=W("./src/utils/codecs.ts"),O=W("./src/controller/level-helper.ts"),f=W("./src/controller/base-playlist-controller.ts"),p=W("./src/types/loader.ts");function c(){return c=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var d=arguments[t];for(var v in d)Object.prototype.hasOwnProperty.call(d,v)&&(i[v]=d[v])}return i},c.apply(this,arguments)}function s(i,t){for(var d=0;d<t.length;d++){var v=t[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(i,v.key,v)}}function n(i,t,d){return t&&s(i.prototype,t),d&&s(i,d),i}function o(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,r(i,t)}function r(i,t){return r=Object.setPrototypeOf||function(v,y){return v.__proto__=y,v},r(i,t)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(i){o(t,i);function t(v){var y;return y=i.call(this,v,"[level-controller]")||this,y._levels=[],y._firstLevel=-1,y._startLevel=void 0,y.currentLevelIndex=-1,y.manualLevelIndex=-1,y.onParsedComplete=void 0,y._registerListeners(),y}var d=t.prototype;return d._registerListeners=function(){var y=this.hls;y.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),y.on(D.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var y=this.hls;y.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),y.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),y.off(D.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},d.startLoad=function(){var y=this._levels;y.forEach(function(b){b.loadError=0}),i.prototype.startLoad.call(this)},d.onManifestLoaded=function(y,b){var g=[],m=[],_=[],x,h={},E,S=!1,w=!1,R=!1;if(b.levels.forEach(function(q){var B=q.attrs;S=S||!!(q.width&&q.height),w=w||!!q.videoCodec,R=R||!!q.audioCodec,l&&q.audioCodec&&q.audioCodec.indexOf("mp4a.40.34")!==-1&&(q.audioCodec=void 0);var M=q.bitrate+"-"+q.attrs.RESOLUTION+"-"+q.attrs.CODECS;E=h[M],E?E.url.push(q.url):(E=new C.Level(q),h[M]=E,g.push(E)),B&&(B.AUDIO&&Object(O.addGroupId)(E,"audio",B.AUDIO),B.SUBTITLES&&Object(O.addGroupId)(E,"text",B.SUBTITLES))}),(S||w)&&R&&(g=g.filter(function(q){var B=q.videoCodec,M=q.width,G=q.height;return!!B||!!(M&&G)})),g=g.filter(function(q){var B=q.audioCodec,M=q.videoCodec;return(!B||Object(A.isCodecSupportedInMp4)(B,"audio"))&&(!M||Object(A.isCodecSupportedInMp4)(M,"video"))}),b.audioTracks&&(m=b.audioTracks.filter(function(q){return!q.audioCodec||Object(A.isCodecSupportedInMp4)(q.audioCodec,"audio")}),Object(O.assignTrackIdsByGroup)(m)),b.subtitles&&(_=b.subtitles,Object(O.assignTrackIdsByGroup)(_)),g.length>0){x=g[0].bitrate,g.sort(function(q,B){return q.bitrate-B.bitrate}),this._levels=g;for(var N=0;N<g.length;N++)if(g[N].bitrate===x){this._firstLevel=N,this.log("manifest loaded, "+g.length+" level(s) found, first bitrate: "+x);break}var F=R&&!w,z={levels:g,audioTracks:m,subtitleTracks:_,firstLevel:this._firstLevel,stats:b.stats,audio:R,video:w,altAudio:!F&&m.some(function(q){return!!q.url})};this.hls.trigger(D.Events.MANIFEST_PARSED,z),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:b.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(y,b){if(i.prototype.onError.call(this,y,b),b.fatal)return;var g=b.context,m=this._levels[this.currentLevelIndex];if(g&&(g.type===p.PlaylistContextType.AUDIO_TRACK&&m.audioGroupIds&&g.groupId===m.audioGroupIds[m.urlId]||g.type===p.PlaylistContextType.SUBTITLE_TRACK&&m.textGroupIds&&g.groupId===m.textGroupIds[m.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,x=!0,h;switch(b.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:if(b.frag){var E=this._levels[b.frag.level];E?(E.fragmentError++,E.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=b.frag.level)):h=b.frag.level}break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:g&&(g.deliveryDirectives&&(x=!1),h=g.level),_=!0;break;case T.ErrorDetails.REMUX_ALLOC_ERROR:h=b.level,_=!0;break}h!==void 0&&this.recoverLevel(b,h,_,x)},d.recoverLevel=function(y,b,g,m){var _=y.details,x=this._levels[b];if(x.loadError++,g){var h=this.retryLoadingOrFail(y);if(h)y.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(m){var E=x.url.length;if(E>1&&x.loadError<E)y.levelRetry=!0,this.redundantFailover(b);else if(this.manualLevelIndex===-1){var S=b===0?this._levels.length-1:b-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(_+": switch to "+S),y.levelRetry=!0,this.hls.nextAutoLevel=S)}}},d.redundantFailover=function(y){var b=this._levels[y],g=b.url.length;if(g>1){var m=(b.urlId+1)%g;this.warn("Switching to redundant URL-id "+m),this._levels.forEach(function(_){_.urlId=m}),this.level=y}},d.onFragLoaded=function(y,b){var g=b.frag;if(g!==void 0&&g.type===p.PlaylistLevelType.MAIN){var m=this._levels[g.level];m!==void 0&&(m.fragmentError=0,m.loadError=0)}},d.onLevelLoaded=function(y,b){var g,m=b.level,_=b.details,x=this._levels[m];if(!x){var h;this.warn("Invalid level index "+m),(h=b.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(_.deltaUpdateFailed=!0);return}m===this.currentLevelIndex?(x.fragmentError===0&&(x.loadError=0,this.retryCount=0),this.playlistLoaded(m,b,x.details)):(g=b.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(_.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(y,b){var g=this.hls.levels[this.currentLevelIndex];if(!g)return;if(g.audioGroupIds){for(var m=-1,_=this.hls.audioTracks[b.id].groupId,x=0;x<g.audioGroupIds.length;x++)if(g.audioGroupIds[x]===_){m=x;break}m!==g.urlId&&(g.urlId=m,this.startLoad())}},d.loadPlaylist=function(y){var b=this.currentLevelIndex,g=this._levels[b];if(this.canLoad&&g&&g.url.length>0){var m=g.urlId,_=g.url[m];if(y)try{_=y.addDirectives(_)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Attempt loading level index "+b+(y?" at sn "+y.msn+" part "+y.part:"")+" with URL-id "+m+" "+_),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:_,level:b,id:m,deliveryDirectives:y||null})}},d.removeLevel=function(y,b){var g=function(x,h){return h!==b},m=this._levels.filter(function(_,x){return x!==y?!0:_.url.length>1&&b!==void 0?(_.url=_.url.filter(g),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(g)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(g)),_.urlId=0,!0):!1}).map(function(_,x){var h=_.details;return h!=null&&h.fragments&&h.fragments.forEach(function(E){E.level=x}),_});this._levels=m,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:m})},n(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(y){var b,g=this._levels;if(g.length===0)return;if(this.currentLevelIndex===y&&(b=g[y])!==null&&b!==void 0&&b.details)return;if(y<0||y>=g.length){var m=y<0;if(this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.OTHER_ERROR,details:T.ErrorDetails.LEVEL_SWITCH_ERROR,level:y,fatal:m,reason:"invalid level idx"}),m)return;y=Math.min(y,g.length-1)}this.clearTimer();var _=this.currentLevelIndex,x=g[_],h=g[y];this.log("switching to level "+y+" from "+_),this.currentLevelIndex=y;var E=c({},h,{level:y,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete E._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,E);var S=h.details;if(!S||S.live){var w=this.switchParams(h.uri,x==null?void 0:x.details);this.loadPlaylist(w)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(y){this.manualLevelIndex=y,this._startLevel===void 0&&(this._startLevel=y),y!==-1&&(this.level=y)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(y){this._firstLevel=y}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var y=this.hls.config.startLevel;return y!==void 0?y:this._firstLevel}else return this._startLevel},set:function(y){this._startLevel=y}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(y){this.level=y,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=y)}}]),t}(f.default)},"./src/controller/level-helper.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"addGroupId",function(){return T}),W.d(ie,"assignTrackIdsByGroup",function(){return A}),W.d(ie,"updatePTS",function(){return O}),W.d(ie,"updateFragPTSDTS",function(){return p}),W.d(ie,"mergeDetails",function(){return c}),W.d(ie,"mapPartIntersection",function(){return s}),W.d(ie,"mapFragmentIntersection",function(){return n}),W.d(ie,"adjustSliding",function(){return o}),W.d(ie,"addSliding",function(){return r}),W.d(ie,"computeReloadInterval",function(){return l}),W.d(ie,"getFragmentWithSN",function(){return a}),W.d(ie,"getPartWith",function(){return i});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/logger.ts");function T(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 A(t){var d={};t.forEach(function(v){var y=v.groupId||"";v.id=d[y]=d[y]||0,d[y]++})}function O(t,d,v){var y=t[d],b=t[v];f(y,b)}function f(t,d){var v=d.startPTS;if(Object(C.isFiniteNumber)(v)){var y=0,b;d.sn>t.sn?(y=v-t.start,b=t):(y=t.start-v,b=d),b.duration!==y&&(b.duration=y)}else if(d.sn>t.sn){var g=t.cc===d.cc;g&&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,y,b,g){var m=y-v;m<=0&&(D.logger.warn("Fragment should have a positive duration",d),y=v+d.duration,g=b+d.duration);var _=v,x=y,h=d.startPTS,E=d.endPTS;if(Object(C.isFiniteNumber)(h)){var S=Math.abs(h-v);Object(C.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(S,d.deltaPTS):d.deltaPTS=S,_=Math.max(v,h),v=Math.min(v,h),b=Math.min(b,d.startDTS),x=Math.min(y,E),y=Math.max(y,E),g=Math.max(g,d.endDTS)}d.duration=y-v;var w=v-d.start;d.appendedPTS=y,d.start=d.startPTS=v,d.maxStartPTS=_,d.startDTS=b,d.endPTS=y,d.minEndPTS=x,d.endDTS=g;var R=d.sn;if(!t||R<t.startSN||R>t.endSN)return 0;var N,F=R-t.startSN,z=t.fragments;for(z[F]=d,N=F;N>0;N--)f(z[N],z[N-1]);for(N=F;N<z.length-1;N++)f(z[N],z[N+1]);return t.fragmentHint&&f(z[z.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,w}function c(t,d){for(var v=null,y=t.fragments,b=y.length-1;b>=0;b--){var g=y[b].initSegment;if(g){v=g;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var m=0,_;if(n(t,d,function(N,F){N.relurl&&(m=N.cc-F.cc),Object(C.isFiniteNumber)(N.startPTS)&&Object(C.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(_=F),d.PTSKnown=d.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,v=N.initSegment)}),v){var x=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;x.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=v)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=v)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(N){return!N}),d.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=d.skippedSegments;h--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var E=d.fragments;if(m){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<E.length;S++)E[S].cc+=m}d.skippedSegments&&(d.startCC=d.fragments[0].cc),s(t.partList,d.partList,function(N,F){F.elementaryStreams=N.elementaryStreams,F.stats=N.stats}),_?p(d,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):o(t,d),E.length&&(d.totalduration=d.edge-E[0].start),d.driftStartTime=t.driftStartTime,d.driftStart=t.driftStart;var w=d.advancedDateTime;if(d.advanced&&w){var R=d.edge;d.driftStart||(d.driftStartTime=w,d.driftStart=R),d.driftEndTime=w,d.driftEnd=R}else d.driftEndTime=t.driftEndTime,d.driftEnd=t.driftEnd,d.advancedDateTime=t.advancedDateTime}function s(t,d,v){if(t&&d)for(var y=0,b=0,g=t.length;b<=g;b++){var m=t[b],_=d[b+y];m&&_&&m.index===_.index&&m.fragment.sn===_.fragment.sn?v(m,_):y--}}function n(t,d,v){for(var y=d.skippedSegments,b=Math.max(t.startSN,d.startSN)-d.startSN,g=(t.fragmentHint?1:0)+(y?d.endSN:Math.min(t.endSN,d.endSN))-d.startSN,m=d.startSN-t.startSN,_=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,x=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,h=b;h<=g;h++){var E=x[m+h],S=_[h];y&&!S&&h<y&&(S=d.fragments[h]=E),E&&S&&v(E,S)}}function o(t,d){var v=d.startSN+d.skippedSegments-t.startSN,y=t.fragments;if(v<0||v>=y.length)return;r(d,y[v].start)}function r(t,d){if(d){for(var v=t.fragments,y=t.skippedSegments;y<v.length;y++)v[y].start+=d;t.fragmentHint&&(t.fragmentHint.start+=d)}}function l(t,d){var v=1e3*t.levelTargetDuration,y=v/2,b=t.age,g=b>0&&b<v*3,m=d.loading.end-d.loading.start,_,x=t.availabilityDelay;if(t.updated===!1)if(g){var h=333*t.misses;_=Math.max(Math.min(y,m*2),h),t.availabilityDelay=(t.availabilityDelay||0)+_}else _=y;else g?(x=Math.min(x||v/2,b),t.availabilityDelay=x,_=x+v-b):_=v-m;return Math.round(_)}function a(t,d,v){if(!t||!t.details)return null;var y=t.details,b=y.fragments[d-y.startSN];return b||(b=y.fragmentHint,b&&b.sn===d?b:d<y.startSN&&v&&v.sn===d?v:null)}function i(t,d,v){if(!t||!t.details)return null;var y=t.details.partList;if(y)for(var b=y.length;b--;){var g=y[b];if(g.index===v&&g.fragment.sn===d)return g}return null}},"./src/controller/stream-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return y});var C=W("./src/polyfills/number.ts"),D=W("./src/controller/base-stream-controller.ts"),T=W("./src/is-supported.ts"),A=W("./src/events.ts"),O=W("./src/utils/buffer-helper.ts"),f=W("./src/controller/fragment-tracker.ts"),p=W("./src/types/loader.ts"),c=W("./src/loader/fragment.ts"),s=W("./src/demux/transmuxer-interface.ts"),n=W("./src/types/transmuxer.ts"),o=W("./src/controller/gap-controller.ts"),r=W("./src/errors.ts"),l=W("./src/utils/logger.ts");function a(b,g){for(var m=0;m<g.length;m++){var _=g[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,_.key,_)}}function i(b,g,m){return g&&a(b.prototype,g),m&&a(b,m),b}function t(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,d(b,g)}function d(b,g){return d=Object.setPrototypeOf||function(_,x){return _.__proto__=x,_},d(b,g)}var v=100,y=function(b){t(g,b);function g(_,x){var h;return h=b.call(this,_,x,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var m=g.prototype;return m._registerListeners=function(){var x=this.hls;x.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(A.Events.LEVEL_LOADING,this.onLevelLoading,this),x.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.on(A.Events.ERROR,this.onError,this),x.on(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.on(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(A.Events.BUFFER_CREATED,this.onBufferCreated,this),x.on(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.on(A.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var x=this.hls;x.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),x.off(A.Events.ERROR,this.onError,this),x.off(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),x.off(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(A.Events.BUFFER_CREATED,this.onBufferCreated,this),x.off(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),x.off(A.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),x.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},m.startLoad=function(x){if(this.levels){var h=this.lastCurrentTime,E=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=E.startLevel;S===-1&&(E.config.testBandwidth?(S=0,this.bitrateTest=!0):S=E.nextAutoLevel),this.level=E.nextLoadLevel=S,this.loadedmetadata=!1}h>0&&x===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),x=h),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,b.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var x,h=this.levels,E=this.level,S=h==null||((x=h[E])===null||x===void 0)?void 0:x.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var w,R=self.performance.now(),N=this.retryDate;(!N||R>=N||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},m.onTickEnd=function(){b.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var x,h,E=this.hls,S=this.levelLastLoaded,w=this.levels,R=this.media,N=E.config,F=E.nextLoadLevel;if(S===null||!R&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!w||!w[F])return;var z=w[F];this.level=E.nextLoadLevel=F;var q=z.details;if(!q||this.state===D.State.WAITING_LEVEL||q.live&&this.levelLastLoaded!==F){this.state=D.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:R,p.PlaylistLevelType.MAIN);if(B===null)return;var M=B.len,G=this.getMaxBufferLength(z.maxBitrate);if(M>=G)return;if(this._streamEnded(B,q)){var J={};this.altAudio&&(J.type="video"),this.hls.trigger(A.Events.BUFFER_EOS,J),this.state=D.State.ENDED;return}var K=B.end,Z=this.getNextFragment(K,q);if(this.couldBacktrack&&!this.fragPrevious&&Z&&Z.sn!=="initSegment"){var le=Z.sn-q.startSN;le>1&&(Z=q.fragments[le-1],this.fragmentTracker.removeFragment(Z))}if(Z&&this.fragmentTracker.getState(Z)===f.FragmentState.OK&&this.nextLoadPosition>K){var de=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(R,de,p.PlaylistLevelType.MAIN),Z=this.getNextFragment(this.nextLoadPosition,q)}if(!Z)return;Z.initSegment&&!Z.initSegment.data&&!this.bitrateTest&&(Z=Z.initSegment),((x=Z.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((h=Z.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(Z,q):this.loadFragment(Z,q,K)},m.loadFragment=function(x,h,E){var S,w=this.fragmentTracker.getState(x);if(this.fragCurrent=x,w===f.FragmentState.BACKTRACKED){var R=this.fragmentTracker.getBacktrackData(x);if(R){this._handleFragmentLoadProgress(R),this._handleFragmentLoadComplete(R);return}else w=f.FragmentState.NOT_LOADED}w===f.FragmentState.NOT_LOADED||w===f.FragmentState.PARTIAL?x.sn==="initSegment"?this._loadInitSegment(x):this.bitrateTest?(x.bitrateTest=!0,this.log("Fragment "+x.sn+" of level "+x.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(x)):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,x,h,E)):w===f.FragmentState.APPENDING?this.reduceMaxBufferLength(x.duration)&&this.fragmentTracker.removeFragment(x):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(x){var h=this.fragmentTracker.getAppendedFrag(x,p.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},m.getBufferedFrag=function(x){return this.fragmentTracker.getBufferedFrag(x,p.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(x){return x?this.getBufferedFrag(x.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var x=this.levels,h=this.media;if(h!=null&&h.readyState){var E,S=this.getAppendedFrag(h.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!h.paused&&x){var w=this.hls.nextLoadLevel,R=x[w],N=this.fragLastKbps;N&&this.fragCurrent?E=this.fragCurrent.duration*R.maxBitrate/(1e3*N)+1:E=0}else E=0;var F=this.getBufferedFrag(h.currentTime+E);if(F){var z=this.followingBufferedFrag(F);if(z){this.abortCurrentFrag();var q=z.maxStartPTS?z.maxStartPTS:z.start,B=z.duration,M=Math.max(F.end,q+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(M,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var x=this.fragCurrent;this.fragCurrent=null,x!=null&&x.loader&&x.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(x,h){b.prototype.flushMainBuffer.call(this,x,h,this.altAudio?"video":null)},m.onMediaAttached=function(x,h){b.prototype.onMediaAttached.call(this,x,h);var E=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),E.addEventListener("playing",this.onvplaying),E.addEventListener("seeked",this.onvseeked),this.gapController=new o.default(this.config,E,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var x=this.media;x&&(x.removeEventListener("playing",this.onvplaying),x.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),b.prototype.onMediaDetaching.call(this)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var x=this.media,h=x?x.currentTime:null;Object(C.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(A.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},m.onManifestParsed=function(x,h){var E=!1,S=!1,w;h.levels.forEach(function(R){w=R.audioCodec,w&&(w.indexOf("mp4a.40.2")!==-1&&(E=!0),w.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=E&&S&&!Object(T.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},m.onLevelLoading=function(x,h){var E=this.levels;if(!E||this.state!==D.State.IDLE)return;var S=E[h.level];(!S.details||S.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(S.details))&&(this.state=D.State.WAITING_LEVEL)},m.onLevelLoaded=function(x,h){var E,S=this.levels,w=h.level,R=h.details,N=R.totalduration;if(!S){this.warn("Levels were reset while loading level "+w);return}this.log("Level "+w+" loaded ["+R.startSN+","+R.endSN+"], cc ["+R.startCC+", "+R.endCC+"] duration:"+N);var F=this.fragCurrent;F&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==h.level&&F.loader&&(this.state=D.State.IDLE,F.loader.abort()));var z=S[w],q=0;if(R.live||(E=z.details)!==null&&E!==void 0&&E.live){if(R.fragments[0]||(R.deltaUpdateFailed=!0),R.deltaUpdateFailed)return;q=this.alignPlaylists(R,z.details)}if(z.details=R,this.levelLastLoaded=w,this.hls.trigger(A.Events.LEVEL_UPDATED,{details:R,level:w}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(R))return;this.state=D.State.IDLE}this.startFragRequested?R.live&&this.synchronizeToLiveEdge(R):this.setStartPosition(R,q),this.tick()},m._handleFragmentLoadProgress=function(x){var h,E=x.frag,S=x.part,w=x.payload,R=this.levels;if(!R){this.warn("Levels were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var N=R[E.level],F=N.details;if(!F){this.warn("Dropping fragment "+E.sn+" of level "+E.level+" after level details were reset");return}var z=N.videoCodec,q=F.PTSKnown||!F.live,B=(h=E.initSegment)===null||h===void 0?void 0:h.data,M=this._getAudioCodec(N),G=this.transmuxer=this.transmuxer||new s.default(this.hls,p.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),J=S?S.index:-1,K=J!==-1,Z=new n.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,w.byteLength,J,K),le=this.initPTS[E.cc];G.push(w,B,M,z,E,S,F.totalduration,q,Z,le)},m.onAudioTrackSwitching=function(x,h){var E=this.altAudio,S=!!h.url,w=h.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var R=this.fragCurrent;R!=null&&R.loader&&(this.log("Switching to main audio track, cancel main fragment load"),R.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;E&&N.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:w})}},m.onAudioTrackSwitched=function(x,h){var E=h.id,S=!!this.hls.audioTracks[E].url;if(S){var w=this.videoBuffer;w&&this.mediaBuffer!==w&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=w)}this.altAudio=S,this.tick()},m.onBufferCreated=function(x,h){var E=h.tracks,S,w,R=!1;for(var N in E){var F=E[N];if(F.id==="main"){if(w=N,S=F,N==="video"){var z=E[N];z&&(this.videoBuffer=z.buffer)}}else R=!0}R&&S?(this.log("Alternate track found, use "+w+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(x,h){var E=h.frag,S=h.part;if(E&&E.type!==p.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(S?" p: "+S.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var w=S?S.stats:E.stats;this.fragLastKbps=Math.round(8*w.total/(w.buffering.end-w.loading.first)),E.sn!=="initSegment"&&(this.fragPrevious=E),this.fragBufferedComplete(E,S)},m.onError=function(x,h){switch(h.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(p.PlaylistLevelType.MAIN,h);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=D.State.ERROR):!h.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var E=!0,S=this.getFwdBufferInfo(this.media,p.PlaylistLevelType.MAIN);S&&S.len>.5&&(E=!this.reduceMaxBufferLength(S.len)),E&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},m.checkBuffer=function(){var x=this.media,h=this.gapController;if(!x||!h||!x.readyState)return;var E=O.BufferHelper.getBuffered(x);!this.loadedmetadata&&E.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=x.currentTime},m.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(x,h){var E=h.type;if(E!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(E===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,E,p.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(x,h){this.levels=h.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var x=this.media,h=x.currentTime,E=this.startPosition;if(E>=0&&h<E){if(x.seeking){l.logger.log("could not seek to "+E+", already seeking at "+h);return}var S=O.BufferHelper.getBuffered(x),w=S.length?S.start(0):0,R=w-E;R>0&&(R<this.config.maxBufferHole||R<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+R+" to match buffer start"),E+=R,this.startPosition=E),this.log("seek to target start position "+E+" from current time "+h),x.currentTime=E}},m._getAudioCodec=function(x){var h=this.config.defaultAudioCodec||x.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},m._loadBitrateTestFrag=function(x){var h=this;this._doFragLoad(x).then(function(E){var S=h.hls;if(!E||S.nextLoadLevel||h.fragContextChanged(x))return;h.fragLoadError=0,h.state=D.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var w=x.stats;w.parsing.start=w.parsing.end=w.buffering.start=w.buffering.end=self.performance.now(),S.trigger(A.Events.FRAG_LOADED,E)})},m._handleTransmuxComplete=function(x){var h,E="main",S=this.hls,w=x.remuxResult,R=x.chunkMeta,N=this.getCurrentContext(R);if(!N){this.warn("The loading context changed while buffering fragment "+R.sn+" of level "+R.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(R.level);return}var F=N.frag,z=N.part,q=N.level,B=w.video,M=w.text,G=w.id3,J=w.initSegment,K=this.altAudio?void 0:w.audio;if(this.fragContextChanged(F))return;if(this.state=D.State.PARSING,J){J.tracks&&(this._bufferInitSegment(q,J.tracks,F,R),S.trigger(A.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:E,tracks:J.tracks}));var Z=J.initPTS,le=J.timescale;Object(C.isFiniteNumber)(Z)&&(this.initPTS[F.cc]=Z,S.trigger(A.Events.INIT_PTS_FOUND,{frag:F,id:E,initPTS:Z,timescale:le}))}if(B&&w.independent!==!1){if(q.details){var de=B.startPTS,Te=B.endPTS,we=B.startDTS,Ie=B.endDTS;if(z)z.elementaryStreams[B.type]={startPTS:de,endPTS:Te,startDTS:we,endDTS:Ie};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var _e=this.getLoadPosition()+this.config.maxBufferHole;if(_e<de){this.backtrack(F);return}F.setElementaryStreamInfo(B.type,F.start,Te,F.start,Ie,!0)}F.setElementaryStreamInfo(B.type,de,Te,we,Ie),this.bufferFragmentData(B,F,z,R)}}else if(w.independent===!1){this.backtrack(F);return}if(K){var ye=K.startPTS,Ke=K.endPTS,Me=K.startDTS,Fe=K.endDTS;z&&(z.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:ye,endPTS:Ke,startDTS:Me,endDTS:Fe}),F.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,ye,Ke,Me,Fe),this.bufferFragmentData(K,F,z,R)}if(G!=null&&(h=G.samples)!==null&&h!==void 0&&h.length){var Ge={frag:F,id:E,samples:G.samples};S.trigger(A.Events.FRAG_PARSING_METADATA,Ge)}if(M){var Ee={frag:F,id:E,samples:M.samples};S.trigger(A.Events.FRAG_PARSING_USERDATA,Ee)}},m._bufferInitSegment=function(x,h,E,S){var w=this;if(this.state!==D.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var R=h.audio,N=h.video,F=h.audiovideo;if(R){var z=x.audioCodec,q=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(z&&(z.indexOf("mp4a.40.5")!==-1?z="mp4a.40.2":z="mp4a.40.5"),R.metadata.channelCount!==1&&q.indexOf("firefox")===-1&&(z="mp4a.40.5")),q.indexOf("android")!==-1&&R.container!=="audio/mpeg"&&(z="mp4a.40.2",this.log("Android: force audio codec to "+z)),x.audioCodec&&x.audioCodec!==z&&this.log('Swapping manifest audio codec "'+x.audioCodec+'" for "'+z+'"'),R.levelCodec=z,R.id="main",this.log("Init audio buffer, container:"+R.container+", codecs[selected/level/parsed]=["+(z||"")+"/"+(x.audioCodec||"")+"/"+R.codec+"]")}N&&(N.levelCodec=x.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(x.videoCodec||"")+"/"+N.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(x.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(A.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(B){var M=h[B],G=M.initSegment;G!=null&&G.byteLength&&w.hls.trigger(A.Events.BUFFER_APPENDING,{type:B,data:G,frag:E,part:null,chunkMeta:S,parent:E.type})}),this.tick()},m.backtrack=function(x){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(x);var h=this.fragmentTracker.backtrack(x);this.fragPrevious=null,this.nextLoadPosition=x.start,h?this.resetFragmentLoading(x):this.state=D.State.BACKTRACKING},m.checkFragmentChanged=function(){var x=this.media,h=null;if(x&&x.readyState>1&&x.seeking===!1){var E=x.currentTime;if(O.BufferHelper.isBuffered(x,E)?h=this.getAppendedFrag(E):O.BufferHelper.isBuffered(x,E+.1)&&(h=this.getAppendedFrag(E+.1)),h){var S=this.fragPlaying,w=h.level;(!S||h.sn!==S.sn||S.level!==w||h.urlId!==S.urlId)&&(this.hls.trigger(A.Events.FRAG_CHANGED,{frag:h}),(!S||S.level!==w)&&this.hls.trigger(A.Events.LEVEL_SWITCHED,{level:w}),this.fragPlaying=h)}}},i(g,[{key:"nextLevel",get:function(){var x=this.nextBufferedFrag;return x?x.level:-1}},{key:"currentLevel",get:function(){var x=this.media;if(x){var h=this.getAppendedFrag(x.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var x=this.media;if(x){var h=this.getAppendedFrag(x.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),g}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"SubtitleStreamController",function(){return t});var C=W("./src/events.ts"),D=W("./src/utils/logger.ts"),T=W("./src/utils/buffer-helper.ts"),A=W("./src/controller/fragment-finders.ts"),O=W("./src/utils/discontinuities.ts"),f=W("./src/controller/level-helper.ts"),p=W("./src/controller/fragment-tracker.ts"),c=W("./src/controller/base-stream-controller.ts"),s=W("./src/types/loader.ts"),n=W("./src/types/level.ts");function o(d,v){for(var y=0;y<v.length;y++){var b=v[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(d,b.key,b)}}function r(d,v,y){return v&&o(d.prototype,v),y&&o(d,y),d}function l(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,a(d,v)}function a(d,v){return a=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},a(d,v)}var i=500,t=function(d){l(v,d);function v(b,g){var m;return m=d.call(this,b,g,"[subtitle-stream-controller]")||this,m.levels=[],m.currentTrackId=-1,m.tracksBuffered=[],m.mainDetails=null,m._registerListeners(),m}var y=v.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var g=this.hls;g.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(C.Events.ERROR,this.onError,this),g.on(C.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),g.on(C.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),g.on(C.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),g.on(C.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),g.on(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y._unregisterListeners=function(){var g=this.hls;g.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(C.Events.ERROR,this.onError,this),g.off(C.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),g.off(C.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),g.off(C.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),g.off(C.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),g.off(C.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},y.startLoad=function(){this.stopLoad(),this.state=c.State.IDLE,this.setInterval(i),this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},y.onLevelLoaded=function(g,m){this.mainDetails=m.details},y.onSubtitleFragProcessed=function(g,m){var _=m.frag,x=m.success;if(this.fragPrevious=_,this.state=c.State.IDLE,!x)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var E,S=_.start,w=0;w<h.length;w++)if(S>=h[w].start&&S<=h[w].end){E=h[w];break}var R=_.start+_.duration;E?E.end=R:(E={start:S,end:R},h.push(E)),this.fragmentTracker.fragBuffered(_)},y.onBufferFlushing=function(g,m){var _=m.startOffset,x=m.endOffset;if(_===0&&x!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,E=this.levels;if(!E.length||!E[h]||!E[h].details)return;var S=E[h].details,w=S.targetduration,R=x-w;if(R<=0)return;m.endOffsetSubtitles=Math.max(0,R),this.tracksBuffered.forEach(function(N){for(var F=0;F<N.length;){if(N[F].end<=R){N.shift();continue}else if(N[F].start<R)N[F].start=R;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(_,R,s.PlaylistLevelType.SUBTITLE)}},y.onError=function(g,m){var _,x=m.frag;if(!x||x.type!==s.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=c.State.IDLE},y.onSubtitleTracksUpdated=function(g,m){var _=this,x=m.subtitleTracks;this.tracksBuffered=[],this.levels=x.map(function(h){return new n.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){_.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},y.onSubtitleTrackSwitch=function(g,m){if(this.currentTrackId=m.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(i)},y.onSubtitleTrackLoaded=function(g,m){var _,x=m.details,h=m.id,E=this.currentTrackId,S=this.levels;if(!S.length)return;var w=S[E];if(h>=S.length||h!==E||!w)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,x.live||(_=w.details)!==null&&_!==void 0&&_.live){var R=this.mainDetails;if(x.deltaUpdateFailed||!R)return;var N=R.fragments[0];if(!w.details)x.hasProgramDateTime&&R.hasProgramDateTime?Object(O.alignMediaPlaylistByPDT)(x,R):N&&Object(f.addSliding)(x,N.start);else{var F=this.alignPlaylists(x,w.details);F===0&&N&&Object(f.addSliding)(x,N.start)}}if(w.details=x,this.levelLastLoaded=h,this.tick(),x.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE){var z=Object(A.findFragmentByPTS)(null,x.fragments,this.media.currentTime,0);z||(this.warn("Subtitle playlist not aligned with playback"),w.details=void 0)}},y._handleFragmentLoadComplete=function(g){var m=g.frag,_=g.payload,x=m.decryptdata,h=this.hls;if(this.fragContextChanged(m))return;if(_&&_.byteLength>0&&x&&x.key&&x.iv&&x.method==="AES-128"){var E=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),x.key.buffer,x.iv.buffer).then(function(S){var w=performance.now();h.trigger(C.Events.FRAG_DECRYPTED,{frag:m,payload:S,stats:{tstart:E,tdecrypt:w}})})}},y.doTick=function(){if(!this.media){this.state=c.State.IDLE;return}if(this.state===c.State.IDLE){var g,m=this.currentTrackId,_=this.levels;if(!_.length||!_[m]||!_[m].details)return;var x=_[m].details,h=x.targetduration,E=this.config,S=this.media,w=T.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-h,E.maxBufferHole),R=w.end,N=w.len,F=this.getMaxBufferLength()+h;if(N>F)return;console.assert(x,"Subtitle track details are defined on idle subtitle stream controller tick");var z=x.fragments,q=z.length,B=x.edge,M,G=this.fragPrevious;if(R<B){var J=E.maxFragLookUpTolerance;G&&x.hasProgramDateTime&&(M=Object(A.findFragmentByPDT)(z,G.endProgramDateTime,J)),M||(M=Object(A.findFragmentByPTS)(G,z,R,J),!M&&G&&G.start<z[0].start&&(M=z[0]))}else M=z[q-1];(g=M)!==null&&g!==void 0&&g.encrypted?(D.logger.log("Loading key for "+M.sn),this.state=c.State.KEY_LOADING,this.hls.trigger(C.Events.KEY_LOADING,{frag:M})):M&&this.fragmentTracker.getState(M)===p.FragmentState.NOT_LOADED&&this.loadFragment(M,x,R)}},y.loadFragment=function(g,m,_){this.fragCurrent=g,d.prototype.loadFragment.call(this,g,m,_)},r(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(c.default)},"./src/controller/subtitle-track-controller.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/events.ts"),D=W("./src/utils/texttrack-utils.ts"),T=W("./src/controller/base-playlist-controller.ts"),A=W("./src/types/loader.ts");function O(o,r){for(var l=0;l<r.length;l++){var a=r[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}function f(o,r,l){return r&&O(o.prototype,r),l&&O(o,l),o}function p(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,c(o,r)}function c(o,r){return c=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},c(o,r)}var s=function(o){p(r,o);function r(a){var i;return i=o.call(this,a,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var l=r.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,o.prototype.destroy.call(this)},l.registerListeners=function(){var i=this.hls;i.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(C.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(C.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(C.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(C.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var i=this.hls;i.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(C.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(C.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(C.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(C.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(C.Events.ERROR,this.onError,this)},l.onMediaAttached=function(i,t){if(this.media=t.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},l.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},l.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 i=n(this.media.textTracks);i.forEach(function(t){Object(D.clearCurrentCues)(t)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(i,t){this.tracks=t.subtitleTracks},l.onSubtitleTrackLoaded=function(i,t){var d=t.id,v=t.details,y=this.trackId,b=this.tracksInGroup[y];if(!b){this.warn("Invalid subtitle track id "+d);return}var g=b.details;b.details=t.details,this.log("subtitle track "+d+" loaded ["+v.startSN+"-"+v.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,t,g))},l.onLevelLoading=function(i,t){this.switchLevel(t.level)},l.onLevelSwitching=function(i,t){this.switchLevel(t.level)},l.switchLevel=function(i){var t=this.hls.levels[i];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,y=this.tracks.filter(function(m){return!d||m.groupId===d});this.tracksInGroup=y;var b=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=d;var g={subtitleTracks:y};this.log("Updating subtitle tracks, "+y.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(C.Events.SUBTITLE_TRACKS_UPDATED,g),b!==-1&&this.setSubtitleTrack(b,v)}},l.findTrackId=function(i){for(var t=this.tracksInGroup,d=0;d<t.length;d++){var v=t[d];if((!this.selectDefaultTrack||v.default)&&(!i||i===v.name))return v.id}return-1},l.onError=function(i,t){if(o.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===A.PlaylistContextType.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},l.loadPlaylist=function(i){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var d=t.id,v=t.groupId,y=t.url;if(i)try{y=i.addDirectives(y)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(C.Events.SUBTITLE_TRACK_LOADING,{url:y,id:d,groupId:v,deliveryDirectives:i||null})}},l.toggleTrackModes=function(i){var t=this,d=this.media,v=this.subtitleDisplay,y=this.trackId;if(!d)return;var b=n(d.textTracks),g=b.filter(function(x){return x.groupId===t.groupId});if(i===-1)[].slice.call(b).forEach(function(x){x.mode="disabled"});else{var m=g[y];m&&(m.mode="disabled")}var _=g[i];_&&(_.mode=v?"showing":"hidden")},l.setSubtitleTrack=function(i,t){var d,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(d=v[i])!==null&&d!==void 0&&d.details)||i<-1||i>=v.length)return;this.clearTimer();var y=v[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,y){var b=y.id,g=y.groupId,m=g===void 0?"":g,_=y.name,x=y.type,h=y.url;this.hls.trigger(C.Events.SUBTITLE_TRACK_SWITCH,{id:b,groupId:m,name:_,type:x,url:h});var E=this.switchParams(y.url,t==null?void 0:t.details);this.loadPlaylist(E)}else this.hls.trigger(C.Events.SUBTITLE_TRACK_SWITCH,{id:i})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,t=n(this.media.textTracks),d=0;d<t.length;d++)if(t[d].mode==="hidden")i=d;else if(t[d].mode==="showing"){i=d;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},f(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,t)}}]),r}(T.default);function n(o){for(var r=[],l=0;l<o.length;l++){var a=o[l];a.kind==="subtitles"&&a.label&&r.push(o[l])}return r}ie.default=s},"./src/controller/timeline-controller.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"TimelineController",function(){return n});var C=W("./src/polyfills/number.ts"),D=W("./src/events.ts"),T=W("./src/utils/cea-608-parser.ts"),A=W("./src/utils/output-filter.ts"),O=W("./src/utils/webvtt-parser.ts"),f=W("./src/utils/texttrack-utils.ts"),p=W("./src/utils/imsc1-ttml-parser.ts"),c=W("./src/types/loader.ts"),s=W("./src/utils/logger.ts"),n=function(){function a(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new A.default(this,"textTrack1"),v=new A.default(this,"textTrack2"),y=new A.default(this,"textTrack3"),b=new A.default(this,"textTrack4");this.cea608Parser1=new T.default(1,d,v),this.cea608Parser2=new T.default(3,y,b)}t.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(D.Events.FRAG_LOADING,this.onFragLoading,this),t.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=a.prototype;return i.destroy=function(){var d=this.hls;d.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(D.Events.FRAG_LOADING,this.onFragLoading,this),d.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(d,v,y,b,g){for(var m=!1,_=g.length;_--;){var x=g[_],h=r(x[0],x[1],v,y);if(h>=0&&(x[0]=Math.min(x[0],v),x[1]=Math.max(x[1],y),m=!0,h/(y-v)>.5))return}if(m||g.push([v,y]),this.config.renderTextTracksNatively){var E=this.captionsTracks[d];this.Cues.newCue(E,v,y,b)}else{var S=this.Cues.newCue(null,v,y,b);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:S,track:d})}},i.onInitPtsFound=function(d,v){var y=this,b=v.frag,g=v.id,m=v.initPTS,_=v.timescale,x=this.unparsedVttFrags;g==="main"&&(this.initPTS[b.cc]=m,this.timescale[b.cc]=_),x.length&&(this.unparsedVttFrags=[],x.forEach(function(h){y.onFragLoaded(D.Events.FRAG_LOADED,h)}))},i.getExistingTrack=function(d){var v=this.media;if(v)for(var y=0;y<v.textTracks.length;y++){var b=v.textTracks[y];if(b[d])return b}return null},i.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},i.createNativeTrack=function(d){if(this.captionsTracks[d])return;var v=this.captionsProperties,y=this.captionsTracks,b=this.media,g=v[d],m=g.label,_=g.languageCode,x=this.getExistingTrack(d);if(x)y[d]=x,Object(f.clearCurrentCues)(y[d]),Object(f.sendAddTrackEvent)(y[d],b);else{var h=this.createTextTrack("captions",m,_);h&&(h[d]=!0,y[d]=h)}},i.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var v=this.captionsProperties[d];if(!v)return;var y=v.label,b={_id:d,label:y,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[d]=b,this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[b]})},i.createTextTrack=function(d,v,y){var b=this.media;return b?b.addTextTrack(d,v,y):void 0},i.onMediaAttaching=function(d,v){this.media=v.media,this._cleanTracks()},i.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(v){Object(f.clearCurrentCues)(d[v]),delete d[v]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},i._cleanTracks=function(){var d=this.media;if(!d)return;var v=d.textTracks;if(v)for(var y=0;y<v.length;y++)Object(f.clearCurrentCues)(v[y])},i.onSubtitleTracksUpdated=function(d,v){var y=this;this.textTracks=[];var b=v.subtitleTracks||[],g=b.some(function(h){return h.textCodec===p.IMSC1_CODEC});if(this.config.enableWebVTT||g&&this.config.enableIMSC1){var m=this.tracks&&b&&this.tracks.length===b.length;if(this.tracks=b||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,E){var S;if(E<_.length){for(var w=null,R=0;R<_.length;R++)if(o(_[R],h)){w=_[R];break}w&&(S=w)}S?Object(f.clearCurrentCues)(S):(S=y.createTextTrack("subtitles",h.name,h.lang),S&&(S.mode="disabled")),S&&(S.groupId=h.groupId,y.textTracks.push(S))})}else if(!m&&this.tracks&&this.tracks.length){var x=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:x})}}},i.onManifestLoaded=function(d,v){var y=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(b){var g=/(?:CC|SERVICE)([1-4])/.exec(b.instreamId);if(!g)return;var m="textTrack"+g[1],_=y.captionsProperties[m];if(!_)return;_.label=b.name,b.lang&&(_.languageCode=b.lang),_.media=b})},i.onFragLoading=function(d,v){var y=this.cea608Parser1,b=this.cea608Parser2,g=this.lastSn,m=this.lastPartIndex;if(!this.enabled||!(y&&b))return;if(v.frag.type===c.PlaylistLevelType.MAIN){var _,x,h=v.frag.sn,E=(_=v==null||((x=v.part)===null||x===void 0)?void 0:x.index)!=null?_:-1;h===g+1||h===g&&E===m+1||(y.reset(),b.reset()),this.lastSn=h,this.lastPartIndex=E}},i.onFragLoaded=function(d,v){var y=v.frag,b=v.payload,g=this.initPTS,m=this.unparsedVttFrags;if(y.type===c.PlaylistLevelType.SUBTITLE)if(b.byteLength){if(!Object(C.isFiniteNumber)(g[y.cc])){m.push(v),g.length&&this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Missing initial subtitle PTS")});return}var _=y.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var x=this.tracks[y.level],h=this.vttCCs;h[y.cc]||(h[y.cc]={start:y.start,prevCC:this.prevCC,new:!0},this.prevCC=y.cc),x&&x.textCodec===p.IMSC1_CODEC?this._parseIMSC1(y,b):this._parseVTTs(y,b,h)}}else this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:y,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(d,v){var y=this,b=this.hls;Object(p.parseIMSC1)(v,this.initPTS[d.cc],this.timescale[d.cc],function(g){y._appendCues(g,d.level),b.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(g){s.logger.log("Failed to parse IMSC1: "+g),b.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:g})})},i._parseVTTs=function(d,v,y){var b=this,g=this.hls;Object(O.parseWebVTT)(v,this.initPTS[d.cc],this.timescale[d.cc],y,d.cc,d.start,function(m){b._appendCues(m,d.level),g.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(m){b._fallbackToIMSC1(d,v),s.logger.log("Failed to parse VTT cue: "+m),g.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:m})})},i._fallbackToIMSC1=function(d,v){var y=this,b=this.tracks[d.level];b.textCodec||Object(p.parseIMSC1)(v,this.initPTS[d.cc],this.timescale[d.cc],function(){b.textCodec=p.IMSC1_CODEC,y._parseIMSC1(d,v)},function(){b.textCodec="wvtt"})},i._appendCues=function(d,v){var y=this.hls;if(this.config.renderTextTracksNatively){var b=this.textTracks[v];if(b.mode==="disabled")return;d.forEach(function(_){return Object(f.addCueToTrack)(b,_)})}else{var g=this.tracks[v],m=g.default?"default":"subtitles"+v;y.trigger(D.Events.CUES_PARSED,{type:"subtitles",cues:d,track:m})}},i.onFragDecrypted=function(d,v){var y=v.frag;if(y.type===c.PlaylistLevelType.SUBTITLE){if(!Object(C.isFiniteNumber)(this.initPTS[y.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(D.Events.FRAG_LOADED,v)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(d,v){var y=this.cea608Parser1,b=this.cea608Parser2;if(!this.enabled||!(y&&b))return;for(var g=0;g<v.samples.length;g++){var m=v.samples[g].bytes;if(m){var _=this.extractCea608Data(m);y.addData(v.samples[g].pts,_[0]),b.addData(v.samples[g].pts,_[1])}}},i.onBufferFlushing=function(d,v){var y=v.startOffset,b=v.endOffset,g=v.endOffsetSubtitles,m=v.type,_=this.media;if(!_||_.currentTime<b)return;if(!m||m==="video"){var x=this.captionsTracks;Object.keys(x).forEach(function(E){return Object(f.removeCuesInRange)(x[E],y,b)})}if(this.config.renderTextTracksNatively&&(y===0&&g!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(E){return Object(f.removeCuesInRange)(h[E],y,g)})}},i.extractCea608Data=function(d){for(var v=d[0]&31,y=2,b=[[],[]],g=0;g<v;g++){var m=d[y++],_=127&d[y++],x=127&d[y++],h=(4&m)!==0,E=3&m;if(_===0&&x===0)continue;h&&((E===0||E===1)&&(b[E].push(_),b[E].push(x)))}return b},a}();function o(a,i){return a&&a.label===i.name&&!(a.textTrack1||a.textTrack2)}function r(a,i,t,d){return Math.min(i,d)-Math.max(a,t)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return C});var C=function(){function D(A,O){this.subtle=void 0,this.aesIV=void 0,this.subtle=A,this.aesIV=O}var T=D.prototype;return T.decrypt=function(O,f){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},f,O)},D}()},"./src/crypt/aes-decryptor.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"removePadding",function(){return D}),W.d(ie,"default",function(){return T});var C=W("./src/utils/typed-array.ts");function D(A){var O=A.byteLength,f=O&&new DataView(A.buffer).getUint8(O-1);return f?Object(C.sliceUint8)(A,0,O-f):A}var T=function(){function A(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var O=A.prototype;return O.uint8ArrayToUint32Array_=function(p){for(var c=new DataView(p),s=new Uint32Array(4),n=0;n<4;n++)s[n]=c.getUint32(n*4);return s},O.initTable=function(){var p=this.sBox,c=this.invSBox,s=this.subMix,n=s[0],o=s[1],r=s[2],l=s[3],a=this.invSubMix,i=a[0],t=a[1],d=a[2],v=a[3],y=new Uint32Array(256),b=0,g=0,m=0;for(m=0;m<256;m++)m<128?y[m]=m<<1:y[m]=m<<1^283;for(m=0;m<256;m++){var _=g^g<<1^g<<2^g<<3^g<<4;_=_>>>8^_&255^99,p[b]=_,c[_]=b;var x=y[b],h=y[x],E=y[h],S=y[_]*257^_*16843008;n[b]=S<<24|S>>>8,o[b]=S<<16|S>>>16,r[b]=S<<8|S>>>24,l[b]=S,S=E*16843009^h*65537^x*257^b*16843008,i[_]=S<<24|S>>>8,t[_]=S<<16|S>>>16,d[_]=S<<8|S>>>24,v[_]=S,b?(b=x^y[y[y[E^x]]],g^=y[y[g]]):b=g=1}},O.expandKey=function(p){for(var c=this.uint8ArrayToUint32Array_(p),s=!0,n=0;n<c.length&&s;)s=c[n]===this.key[n],n++;if(s)return;this.key=c;var o=this.keySize=c.length;if(o!==4&&o!==6&&o!==8)throw new Error("Invalid aes key size="+o);var r=this.ksRows=(o+6+1)*4,l,a,i=this.keySchedule=new Uint32Array(r),t=this.invKeySchedule=new Uint32Array(r),d=this.sBox,v=this.rcon,y=this.invSubMix,b=y[0],g=y[1],m=y[2],_=y[3],x,h;for(l=0;l<r;l++){if(l<o){x=i[l]=c[l];continue}h=x,l%o===0?(h=h<<8|h>>>24,h=d[h>>>24]<<24|d[h>>>16&255]<<16|d[h>>>8&255]<<8|d[h&255],h^=v[l/o|0]<<24):o>6&&l%o===4&&(h=d[h>>>24]<<24|d[h>>>16&255]<<16|d[h>>>8&255]<<8|d[h&255]),i[l]=x=(i[l-o]^h)>>>0}for(a=0;a<r;a++)l=r-a,a&3?h=i[l]:h=i[l-4],a<4||l<=4?t[a]=h:t[a]=b[d[h>>>24]]^g[d[h>>>16&255]]^m[d[h>>>8&255]]^_[d[h&255]],t[a]=t[a]>>>0},O.networkToHostOrderSwap=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},O.decrypt=function(p,c,s){for(var n=this.keySize+6,o=this.invKeySchedule,r=this.invSBox,l=this.invSubMix,a=l[0],i=l[1],t=l[2],d=l[3],v=this.uint8ArrayToUint32Array_(s),y=v[0],b=v[1],g=v[2],m=v[3],_=new Int32Array(p),x=new Int32Array(_.length),h,E,S,w,R,N,F,z,q,B,M,G,J,K,Z=this.networkToHostOrderSwap;c<_.length;){for(q=Z(_[c]),B=Z(_[c+1]),M=Z(_[c+2]),G=Z(_[c+3]),R=q^o[0],N=G^o[1],F=M^o[2],z=B^o[3],J=4,K=1;K<n;K++)h=a[R>>>24]^i[N>>16&255]^t[F>>8&255]^d[z&255]^o[J],E=a[N>>>24]^i[F>>16&255]^t[z>>8&255]^d[R&255]^o[J+1],S=a[F>>>24]^i[z>>16&255]^t[R>>8&255]^d[N&255]^o[J+2],w=a[z>>>24]^i[R>>16&255]^t[N>>8&255]^d[F&255]^o[J+3],R=h,N=E,F=S,z=w,J=J+4;h=r[R>>>24]<<24^r[N>>16&255]<<16^r[F>>8&255]<<8^r[z&255]^o[J],E=r[N>>>24]<<24^r[F>>16&255]<<16^r[z>>8&255]<<8^r[R&255]^o[J+1],S=r[F>>>24]<<24^r[z>>16&255]<<16^r[R>>8&255]<<8^r[N&255]^o[J+2],w=r[z>>>24]<<24^r[R>>16&255]<<16^r[N>>8&255]<<8^r[F&255]^o[J+3],x[c]=Z(h^y),x[c+1]=Z(w^b),x[c+2]=Z(S^g),x[c+3]=Z(E^m),y=q,b=B,g=M,m=G,c=c+4}return x.buffer},A}()},"./src/crypt/decrypter.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return c});var C=W("./src/crypt/aes-crypto.ts"),D=W("./src/crypt/fast-aes-key.ts"),T=W("./src/crypt/aes-decryptor.ts"),A=W("./src/utils/logger.ts"),O=W("./src/utils/mp4-tools.ts"),f=W("./src/utils/typed-array.ts"),p=16,c=function(){function s(o,r,l){var a=l===void 0?{}:l,i=a.removePKCS7Padding,t=i===void 0?!0:i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=o,this.config=r,this.removePKCS7Padding=t,t)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var n=s.prototype;return n.destroy=function(){this.observer=null},n.isSync=function(){return this.config.enableSoftwareAES},n.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var l=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(T.removePadding)(l):l},n.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},n.decrypt=function(r,l,a,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),l,a);var t=this.flush();t&&i(t.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),l,a).then(i)},n.softwareDecrypt=function(r,l,a){var i=this.currentIV,t=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(r=Object(O.appendUint8Array)(d,r),this.remainderData=null);var v=this.getValidChunk(r);if(!v.length)return null;i&&(a=i);var y=this.softwareDecrypter;y||(y=this.softwareDecrypter=new T.default),y.expandKey(l);var b=t;return this.currentResult=y.decrypt(v.buffer,0,a),this.currentIV=Object(f.sliceUint8)(v,-16).buffer,b||null},n.webCryptoDecrypt=function(r,l,a){var i=this,t=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new D.default(t,l)),this.fastAesKey.expandKey().then(function(d){if(!t)return Promise.reject(new Error("web crypto not initialized"));var v=new C.default(t,a);return v.decrypt(r.buffer,d)}).catch(function(d){return i.onWebCryptoError(d,r,l,a)})},n.onWebCryptoError=function(r,l,a,i){return A.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,a,i)},n.getValidChunk=function(r){var l=r,a=r.length-r.length%p;return a!==r.length&&(l=Object(f.sliceUint8)(r,0,a),this.remainderData=Object(f.sliceUint8)(r,a)),l},n.logOnce=function(r){if(!this.logEnabled)return;A.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},s}()},"./src/crypt/fast-aes-key.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return C});var C=function(){function D(A,O){this.subtle=void 0,this.key=void 0,this.subtle=A,this.key=O}var T=D.prototype;return T.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},D}()},"./src/demux/aacdemuxer.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/demux/base-audio-demuxer.ts"),D=W("./src/demux/adts.ts"),T=W("./src/utils/logger.ts"),A=W("./src/demux/id3.ts");function O(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,f(c,s)}function f(c,s){return f=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},f(c,s)}var p=function(c){O(s,c);function s(o,r){var l;return l=c.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=o,l.config=r,l}var n=s.prototype;return n.resetInitSegment=function(r,l,a){c.prototype.resetInitSegment.call(this,r,l,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:a,inputTimeScale:9e4,dropped:0}},s.probe=function(r){if(!r)return!1;for(var l=A.getID3Data(r,0)||[],a=l.length,i=r.length;a<i;a++)if(D.probe(r,a))return T.logger.log("ADTS sync word found !"),!0;return!1},n.canParse=function(r,l){return D.canParse(r,l)},n.appendFrame=function(r,l,a){D.initTrackConfig(r,this.observer,l,a,r.manifestCodec);var i=D.appendFrame(r,l,a,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},s}(C.default);p.minProbeByteLength=9,ie.default=p},"./src/demux/adts.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"getAudioConfig",function(){return A}),W.d(ie,"isHeaderPattern",function(){return O}),W.d(ie,"getHeaderLength",function(){return f}),W.d(ie,"getFullFrameLength",function(){return p}),W.d(ie,"canGetFrameLength",function(){return c}),W.d(ie,"isHeader",function(){return s}),W.d(ie,"canParse",function(){return n}),W.d(ie,"probe",function(){return o}),W.d(ie,"initTrackConfig",function(){return r}),W.d(ie,"getFrameDuration",function(){return l}),W.d(ie,"parseFrameHeader",function(){return a}),W.d(ie,"appendFrame",function(){return i});var C=W("./src/utils/logger.ts"),D=W("./src/errors.ts"),T=W("./src/events.ts");function A(t,d,v,y){var b,g,m,_,x=navigator.userAgent.toLowerCase(),h=y,E=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];b=((d[v+2]&192)>>>6)+1;var S=(d[v+2]&60)>>>2;if(S>E.length-1){t.trigger(T.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return m=(d[v+2]&1)<<2,m|=(d[v+3]&192)>>>6,C.logger.log("manifest codec:"+y+", ADTS type:"+b+", samplingIndex:"+S),/firefox/i.test(x)?S>=6?(b=5,_=new Array(4),g=S-3):(b=2,_=new Array(2),g=S):x.indexOf("android")!==-1?(b=2,_=new Array(2),g=S):(b=5,_=new Array(4),y&&(y.indexOf("mp4a.40.29")!==-1||y.indexOf("mp4a.40.5")!==-1)||!y&&S>=6?g=S-3:((y&&y.indexOf("mp4a.40.2")!==-1&&(S>=6&&m===1||/vivaldi/i.test(x))||!y&&m===1)&&(b=2,_=new Array(2)),g=S)),_[0]=b<<3,_[0]|=(S&14)>>1,_[1]|=(S&1)<<7,_[1]|=m<<3,b===5&&(_[1]|=(g&14)>>1,_[2]=(g&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:E[S],channelCount:m,codec:"mp4a.40."+b,manifestCodec:h}}function O(t,d){return t[d]===255&&(t[d+1]&246)===240}function f(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 c(t,d){return d+5<t.length}function s(t,d){return d+1<t.length&&O(t,d)}function n(t,d){return c(t,d)&&O(t,d)&&p(t,d)<=t.length-d}function o(t,d){if(s(t,d)){var v=f(t,d);if(d+v>=t.length)return!1;var y=p(t,d);if(y<=v)return!1;var b=d+y;return b===t.length||s(t,b)}return!1}function r(t,d,v,y,b){if(!t.samplerate){var g=A(d,v,y,b);if(!g)return;t.config=g.config,t.samplerate=g.samplerate,t.channelCount=g.channelCount,t.codec=g.codec,t.manifestCodec=g.manifestCodec,C.logger.log("parsed codec:"+t.codec+", rate:"+g.samplerate+", channels:"+g.channelCount)}}function l(t){return 1024*9e4/t}function a(t,d,v,y,b){var g=f(t,d),m=p(t,d);if(m-=g,m>0){var _=v+y*b;return{headerLength:g,frameLength:m,stamp:_}}}function i(t,d,v,y,b){var g=l(t.samplerate),m=a(d,v,y,b,g);if(m){var _=m.frameLength,x=m.headerLength,h=m.stamp,E=x+_,S=Math.max(0,v+E-d.length),w;S?(w=new Uint8Array(E-x),w.set(d.subarray(v+x,d.length),0)):w=d.subarray(v+x,v+E);var R={unit:w,pts:h};return S||t.samples.push(R),{sample:R,length:E,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"initPTSFn",function(){return p});var C=W("./src/polyfills/number.ts"),D=W("./src/demux/id3.ts"),T=W("./src/demux/dummy-demuxed-track.ts"),A=W("./src/utils/mp4-tools.ts"),O=W("./src/utils/typed-array.ts"),f=function(){function c(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var s=c.prototype;return s.resetInitSegment=function(o,r,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},s.resetTimeStamp=function(){},s.resetContiguity=function(){},s.canParse=function(o,r){return!1},s.appendFrame=function(o,r,l){},s.demux=function(o,r){this.cachedData&&(o=Object(A.appendUint8Array)(this.cachedData,o),this.cachedData=null);var l=D.getID3Data(o,0),a=l?l.length:0,i,t,d=this._audioTrack,v=this._id3Track,y=l?D.getTimeStamp(l):void 0,b=o.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=p(y,r)),l&&l.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),t=this.initPTS;a<b;){if(this.canParse(o,a)){var g=this.appendFrame(d,o,a);g?(this.frameIndex++,t=g.sample.pts,a+=g.length,i=a):a=b}else D.canParse(o,a)?(l=D.getID3Data(o,a),v.samples.push({pts:t,dts:t,data:l}),a+=l.length,i=a):a++;if(a===b&&i!==b){var m=Object(O.sliceUint8)(o,i);this.cachedData?this.cachedData=Object(A.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:d,avcTrack:Object(T.dummyTrack)(),id3Track:v,textTrack:Object(T.dummyTrack)()}},s.demuxSampleAes=function(o,r,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},s.flush=function(o){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(T.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(T.dummyTrack)()}},s.destroy=function(){},c}(),p=function(s,n){return Object(C.isFiniteNumber)(s)?s*90:n*9e4};ie.default=f},"./src/demux/chunk-cache.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return C});var C=function(){function T(){this.chunks=[],this.dataLength=0}var A=T.prototype;return A.push=function(f){this.chunks.push(f),this.dataLength+=f.length},A.flush=function(){var f=this.chunks,p=this.dataLength,c;if(f.length)f.length===1?c=f[0]:c=D(f,p);else return new Uint8Array(0);return this.reset(),c},A.reset=function(){this.chunks.length=0,this.dataLength=0},T}();function D(T,A){for(var O=new Uint8Array(A),f=0,p=0;p<T.length;p++){var c=T[p];O.set(c,f),f+=c.length}return O}},"./src/demux/dummy-demuxed-track.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"dummyTrack",function(){return C});function C(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/utils/logger.ts"),D=function(){function T(O){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=O,this.bytesAvailable=O.byteLength,this.word=0,this.bitsAvailable=0}var A=T.prototype;return A.loadWord=function(){var f=this.data,p=this.bytesAvailable,c=f.byteLength-p,s=new Uint8Array(4),n=Math.min(4,p);if(n===0)throw new Error("no bytes available");s.set(f.subarray(c,c+n)),this.word=new DataView(s.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n},A.skipBits=function(f){var p;this.bitsAvailable>f?(this.word<<=f,this.bitsAvailable-=f):(f-=this.bitsAvailable,p=f>>3,f-=p>>3,this.bytesAvailable-=p,this.loadWord(),this.word<<=f,this.bitsAvailable-=f)},A.readBits=function(f){var p=Math.min(this.bitsAvailable,f),c=this.word>>>32-p;return f>32&&C.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=p,this.bitsAvailable>0?this.word<<=p:this.bytesAvailable>0&&this.loadWord(),p=f-p,p>0&&this.bitsAvailable?c<<p|this.readBits(p):c},A.skipLZ=function(){var f;for(f=0;f<this.bitsAvailable;++f)if((this.word&2147483648>>>f)!==0)return this.word<<=f,this.bitsAvailable-=f,f;return this.loadWord(),f+this.skipLZ()},A.skipUEG=function(){this.skipBits(1+this.skipLZ())},A.skipEG=function(){this.skipBits(1+this.skipLZ())},A.readUEG=function(){var f=this.skipLZ();return this.readBits(f+1)-1},A.readEG=function(){var f=this.readUEG();return 1&f?1+f>>>1:-1*(f>>>1)},A.readBoolean=function(){return this.readBits(1)===1},A.readUByte=function(){return this.readBits(8)},A.readUShort=function(){return this.readBits(16)},A.readUInt=function(){return this.readBits(32)},A.skipScalingList=function(f){for(var p=8,c=8,s,n=0;n<f;n++)c!==0&&(s=this.readEG(),c=(p+s+256)%256),p=c===0?p:c},A.readSPS=function(){var f=0,p=0,c=0,s=0,n,o,r,l=this.readUByte.bind(this),a=this.readBits.bind(this),i=this.readUEG.bind(this),t=this.readBoolean.bind(this),d=this.skipBits.bind(this),v=this.skipEG.bind(this),y=this.skipUEG.bind(this),b=this.skipScalingList.bind(this);l();var g=l();if(a(5),d(3),l(),y(),g===100||g===110||g===122||g===244||g===44||g===83||g===86||g===118||g===128){var m=i();if(m===3&&d(1),y(),y(),d(1),t())for(o=m!==3?8:12,r=0;r<o;r++)t()&&(r<6?b(16):b(64))}y();var _=i();if(_===0)i();else if(_===1)for(d(1),v(),v(),n=i(),r=0;r<n;r++)v();y(),d(1);var x=i(),h=i(),E=a(1);E===0&&d(1),d(1),t()&&(f=i(),p=i(),c=i(),s=i());var S=[1,1];if(t()&&t()){var w=l();switch(w){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((x+1)*16-f*2-p*2),height:(2-E)*(h+1)*16-(E?2:4)*(c+s),pixelRatio:S}},A.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},T}();ie.default=D},"./src/demux/id3.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"isHeader",function(){return C}),W.d(ie,"isFooter",function(){return D}),W.d(ie,"getID3Data",function(){return T}),W.d(ie,"canParse",function(){return O}),W.d(ie,"getTimeStamp",function(){return f}),W.d(ie,"isTimeStampFrame",function(){return p}),W.d(ie,"getID3Frames",function(){return s}),W.d(ie,"decodeFrame",function(){return n}),W.d(ie,"utf8ArrayToStr",function(){return i}),W.d(ie,"testables",function(){return t});var C=function(b,g){return g+10<=b.length&&(b[g]===73&&b[g+1]===68&&b[g+2]===51&&(b[g+3]<255&&b[g+4]<255&&(b[g+6]<128&&b[g+7]<128&&b[g+8]<128&&b[g+9]<128)))},D=function(b,g){return g+10<=b.length&&(b[g]===51&&b[g+1]===68&&b[g+2]===73&&(b[g+3]<255&&b[g+4]<255&&(b[g+6]<128&&b[g+7]<128&&b[g+8]<128&&b[g+9]<128)))},T=function(b,g){for(var m=g,_=0;C(b,g);){_+=10;var x=A(b,g+6);_+=x,D(b,g+10)&&(_+=10),g+=_}return _>0?b.subarray(m,m+_):void 0},A=function(b,g){var m=0;return m=(b[g]&127)<<21,m|=(b[g+1]&127)<<14,m|=(b[g+2]&127)<<7,m|=b[g+3]&127,m},O=function(b,g){return C(b,g)&&A(b,g+6)+10<=b.length-g},f=function(b){for(var g=s(b),m=0;m<g.length;m++){var _=g[m];if(p(_))return a(_)}return},p=function(b){return b&&b.key==="PRIV"&&b.info==="com.apple.streaming.transportStreamTimestamp"},c=function(b){var g=String.fromCharCode(b[0],b[1],b[2],b[3]),m=A(b,4),_=10;return{type:g,size:m,data:b.subarray(_,_+m)}},s=function(b){for(var g=0,m=[];C(b,g);){var _=A(b,g+6);g+=10;for(var x=g+_;g+8<x;){var h=c(b.subarray(g)),E=n(h);E&&m.push(E),g+=h.size+10}D(b,g)&&(g+=10)}return m},n=function(b){return b.type==="PRIV"?o(b):b.type[0]==="W"?l(b):r(b)},o=function(b){if(b.size<2)return;var g=i(b.data,!0),m=new Uint8Array(b.data.subarray(g.length+1));return{key:b.type,info:g,data:m.buffer}},r=function(b){if(b.size<2)return;if(b.type==="TXXX"){var g=1,m=i(b.data.subarray(g),!0);g+=m.length+1;var _=i(b.data.subarray(g));return{key:b.type,info:m,data:_}}var x=i(b.data.subarray(1));return{key:b.type,data:x}},l=function(b){if(b.type==="WXXX"){if(b.size<2)return;var g=1,m=i(b.data.subarray(g),!0);g+=m.length+1;var _=i(b.data.subarray(g));return{key:b.type,info:m,data:_}}var x=i(b.data);return{key:b.type,data:x}},a=function(b){if(b.data.byteLength===8){var g=new Uint8Array(b.data),m=g[3]&1,_=(g[4]<<23)+(g[5]<<15)+(g[6]<<7)+g[7];return _/=45,m&&(_+=4772185884e-2),Math.round(_)}return},i=function(b,g){g===void 0&&(g=!1);var m=v();if(m){var _=m.decode(b);if(g){var x=_.indexOf("\0");return x!==-1?_.substring(0,x):_}return _.replace(/\0/g,"")}for(var h=b.length,E,S,w,R="",N=0;N<h;){if(E=b[N++],E===0&&g)return R;if(E===0||E===3)continue;switch(E>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:R+=String.fromCharCode(E);break;case 12:case 13:S=b[N++],R+=String.fromCharCode((E&31)<<6|S&63);break;case 14:S=b[N++],w=b[N++],R+=String.fromCharCode((E&15)<<12|(S&63)<<6|(w&63)<<0);break;default:}}return R},t={decodeTextFrame:r},d;function v(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/demux/base-audio-demuxer.ts"),D=W("./src/demux/id3.ts"),T=W("./src/utils/logger.ts"),A=W("./src/demux/mpegaudio.ts");function O(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,f(c,s)}function f(c,s){return f=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},f(c,s)}var p=function(c){O(s,c);function s(){return c.apply(this,arguments)||this}var n=s.prototype;return n.resetInitSegment=function(r,l,a){c.prototype.resetInitSegment.call(this,r,l,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:a,inputTimeScale:9e4,dropped:0}},s.probe=function(r){if(!r)return!1;for(var l=D.getID3Data(r,0)||[],a=l.length,i=r.length;a<i;a++)if(A.probe(r,a))return T.logger.log("MPEG Audio sync word found !"),!0;return!1},n.canParse=function(r,l){return A.canParse(r,l)},n.appendFrame=function(r,l,a){return this.initPTS===null?void 0:A.appendFrame(r,l,a,this.initPTS,this.frameIndex)},s}(C.default);p.minProbeByteLength=4,ie.default=p},"./src/demux/mp4demuxer.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/utils/mp4-tools.ts"),D=W("./src/demux/dummy-demuxed-track.ts"),T=function(){function A(f,p){this.remainderData=null,this.config=void 0,this.config=p}var O=A.prototype;return O.resetTimeStamp=function(){},O.resetInitSegment=function(){},O.resetContiguity=function(){},A.probe=function(p){return Object(C.findBox)({data:p,start:0,end:Math.min(p.length,16384)},["moof"]).length>0},O.demux=function(p){var c=p,s=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(c=Object(C.appendUint8Array)(this.remainderData,p));var n=Object(C.segmentValidRange)(c);this.remainderData=n.remainder,s.samples=n.valid||new Uint8Array}else s.samples=c;return{audioTrack:Object(D.dummyTrack)(),avcTrack:s,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},O.flush=function(){var p=Object(D.dummyTrack)();return p.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:p,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},O.demuxSampleAes=function(p,c,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},O.destroy=function(){},A}();T.minProbeByteLength=1024,ie.default=T},"./src/demux/mpegaudio.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"appendFrame",function(){return f}),W.d(ie,"parseHeader",function(){return p}),W.d(ie,"isHeaderPattern",function(){return c}),W.d(ie,"isHeader",function(){return s}),W.d(ie,"canParse",function(){return n}),W.d(ie,"probe",function(){return o});var C=null,D=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],T=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],A=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],O=[0,1,1,4];function f(r,l,a,i,t){if(a+24>l.length)return;var d=p(l,a);if(d&&a+d.frameLength<=l.length){var v=d.samplesPerFrame*9e4/d.sampleRate,y=i+t*v,b={unit:l.subarray(a,a+d.frameLength),pts:y,dts:y};return r.config=[],r.channelCount=d.channelCount,r.samplerate=d.sampleRate,r.samples.push(b),{sample:b,length:d.frameLength,missing:0}}}function p(r,l){var a=r[l+1]>>3&3,i=r[l+1]>>1&3,t=r[l+2]>>4&15,d=r[l+2]>>2&3;if(a!==1&&t!==0&&t!==15&&d!==3){var v=r[l+2]>>1&1,y=r[l+3]>>6,b=a===3?3-i:i===3?3:4,g=D[b*14+t-1]*1e3,m=a===3?0:a===2?1:2,_=T[m*3+d],x=y===3?1:2,h=A[a][i],E=O[i],S=h*8*E,w=Math.floor(h*g/_+v)*E;if(C===null){var R=navigator.userAgent||"",N=R.match(/Chrome\/(\d+)/i);C=N?parseInt(N[1]):0}var F=!!C&&C<=87;return F&&i===2&&g>=224e3&&y===0&&(r[l+3]=r[l+3]|128),{sampleRate:_,channelCount:x,frameLength:w,samplesPerFrame:S}}}function c(r,l){return r[l]===255&&(r[l+1]&224)===224&&(r[l+1]&6)!==0}function s(r,l){return l+1<r.length&&c(r,l)}function n(r,l){var a=4;return c(r,l)&&a<=r.length-l}function o(r,l){if(l+1<r.length&&c(r,l)){var a=4,i=p(r,l),t=a;i!=null&&i.frameLength&&(t=i.frameLength);var d=l+t;return d===r.length||s(r,d)}return!1}},"./src/demux/sample-aes.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/crypt/decrypter.ts"),D=W("./src/demux/tsdemuxer.ts"),T=function(){function A(f,p,c){this.keyData=void 0,this.decrypter=void 0,this.keyData=c,this.decrypter=new C.default(f,p,{removePKCS7Padding:!1})}var O=A.prototype;return O.decryptBuffer=function(p,c){this.decrypter.decrypt(p,this.keyData.key.buffer,this.keyData.iv.buffer,c)},O.decryptAacSample=function(p,c,s,n){var o=p[c].unit,r=o.subarray(16,o.length-o.length%16),l=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),a=this;this.decryptBuffer(l,function(i){var t=new Uint8Array(i);o.set(t,16),n||a.decryptAacSamples(p,c+1,s)})},O.decryptAacSamples=function(p,c,s){for(;;c++){if(c>=p.length){s();return}if(p[c].unit.length<32)continue;var n=this.decrypter.isSync();if(this.decryptAacSample(p,c,s,n),!n)return}},O.getAvcEncryptedData=function(p){for(var c=Math.floor((p.length-48)/160)*16+16,s=new Int8Array(c),n=0,o=32;o<=p.length-16;o+=160,n+=16)s.set(p.subarray(o,o+16),n);return s},O.getAvcDecryptedUnit=function(p,c){for(var s=new Uint8Array(c),n=0,o=32;o<=p.length-16;o+=160,n+=16)p.set(s.subarray(n,n+16),o);return p},O.decryptAvcSample=function(p,c,s,n,o,r){var l=Object(D.discardEPB)(o.data),a=this.getAvcEncryptedData(l),i=this;this.decryptBuffer(a.buffer,function(t){o.data=i.getAvcDecryptedUnit(l,t),r||i.decryptAvcSamples(p,c,s+1,n)})},O.decryptAvcSamples=function(p,c,s,n){if(p instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;c++,s=0){if(c>=p.length){n();return}for(var o=p[c].units;!(s>=o.length);s++){var r=o[s];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(p,c,s,n,r,l),!l)return}}},A}();ie.default=T},"./src/demux/transmuxer-interface.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o});var C=W("./node_modules/webworkify-webpack/index.js"),D=W.n(C),T=W("./src/events.ts"),A=W("./src/demux/transmuxer.ts"),O=W("./src/utils/logger.ts"),f=W("./src/errors.ts"),p=W("./src/utils/mediasource-helper.ts"),c=W("./node_modules/eventemitter3/index.js"),s=W.n(c),n=Object(p.getMediaSource)()||{isTypeSupported:function(){return!1}},o=function(){function r(a,i,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=a,this.id=i,this.onTransmuxComplete=t,this.onFlush=d;var y=a.config,b=function(h,E){E=E||{},E.frag=v.frag,E.id=v.id,a.trigger(h,E)};this.observer=new c.EventEmitter,this.observer.on(T.Events.FRAG_DECRYPTED,b),this.observer.on(T.Events.ERROR,b);var g={mp4:n.isTypeSupported("video/mp4"),mpeg:n.isTypeSupported("audio/mpeg"),mp3:n.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(y.enableWorker&&typeof Worker!="undefined"){O.logger.log("demuxing in webworker");var _;try{_=this.worker=C("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(x){a.trigger(T.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(x.message+" ("+x.filename+":"+x.lineno+")")})},_.postMessage({cmd:"init",typeSupported:g,vendor:m,id:i,config:JSON.stringify(y)})}catch(x){O.logger.warn("Error in worker:",x),O.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new A.default(this.observer,g,y,m,i),this.worker=null}}else this.transmuxer=new A.default(this.observer,g,y,m,i)}var l=r.prototype;return l.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.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},l.push=function(i,t,d,v,y,b,g,m,_,x){var h=this;_.transmuxing.start=self.performance.now();var E=this.transmuxer,S=this.worker,w=b?b.start:y.start,R=y.decryptdata,N=this.frag,F=!(N&&y.cc===N.cc),z=!(N&&_.level===N.level),q=N?_.sn-N.sn:-1,B=this.part?_.part-this.part.index:1,M=!z&&(q===1||q===0&&B===1),G=self.performance.now();(z||q||y.stats.parsing.start===0)&&(y.stats.parsing.start=G),b&&(B||!M)&&(b.stats.parsing.start=G);var J=new A.TransmuxState(F,M,m,z,w);if(!M||F){O.logger.log("[transmuxer-interface, "+y.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
|
|
|
discontinuity: `+F+`
|
|
|
trackSwitch: `+z+`
|
|
|
contiguous: `+M+`
|
|
|
accurateTimeOffset: `+m+`
|
|
|
timeOffset: `+w);var K=new A.TransmuxConfig(d,v,t,g,x);this.configureTransmuxer(K)}if(this.frag=y,this.part=b,S)S.postMessage({cmd:"demux",data:i,decryptdata:R,chunkMeta:_,state:J},i instanceof ArrayBuffer?[i]:[]);else if(E){var Z=E.push(i,R,_,J);Object(A.isPromise)(Z)?Z.then(function(le){h.handleTransmuxComplete(le)}):this.handleTransmuxComplete(Z)}},l.flush=function(i){var t=this;i.transmuxing.start=self.performance.now();var d=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:i});else if(d){var y=d.flush(i);Object(A.isPromise)(y)?y.then(function(b){t.handleFlushResult(b,i)}):this.handleFlushResult(y,i)}},l.handleFlushResult=function(i,t){var d=this;i.forEach(function(v){d.handleTransmuxComplete(v)}),this.onFlush(t)},l.onWorkerMessage=function(i){var t=i.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}}},l.configureTransmuxer=function(i){var t=this.worker,d=this.transmuxer;t?t.postMessage({cmd:"configure",config:i}):d&&d.configure(i)},l.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},r}()},"./src/demux/transmuxer-worker.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return f});var C=W("./src/demux/transmuxer.ts"),D=W("./src/events.ts"),T=W("./src/utils/logger.ts"),A=W("./node_modules/eventemitter3/index.js"),O=W.n(A);function f(o){var r=new A.EventEmitter,l=function(i,t){o.postMessage({event:i,data:t})};r.on(D.Events.FRAG_DECRYPTED,l),r.on(D.Events.ERROR,l),o.addEventListener("message",function(a){var i=a.data;switch(i.cmd){case"init":{var t=JSON.parse(i.config);o.transmuxer=new C.default(r,i.typeSupported,t,i.vendor,i.id),Object(T.enableLogs)(t.debug),l("init",null);break}case"configure":{o.transmuxer.configure(i.config);break}case"demux":{var d=o.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(C.isPromise)(d)?d.then(function(b){p(o,b)}):p(o,d);break}case"flush":{var v=i.chunkMeta,y=o.transmuxer.flush(v);Object(C.isPromise)(y)?y.then(function(b){s(o,b,v)}):s(o,y,v);break}default:break}})}function p(o,r){if(n(r.remuxResult))return;var l=[],a=r.remuxResult,i=a.audio,t=a.video;i&&c(l,i),t&&c(l,t),o.postMessage({event:"transmuxComplete",data:r},l)}function c(o,r){r.data1&&o.push(r.data1.buffer),r.data2&&o.push(r.data2.buffer)}function s(o,r,l){r.forEach(function(a){p(o,a)}),o.postMessage({event:"flush",data:l})}function n(o){return!o.audio&&!o.video&&!o.text&&!o.id3&&!o.initSegment}},"./src/demux/transmuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return t}),W.d(ie,"isPromise",function(){return y}),W.d(ie,"TransmuxConfig",function(){return b}),W.d(ie,"TransmuxState",function(){return g});var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/crypt/decrypter.ts"),A=W("./src/demux/aacdemuxer.ts"),O=W("./src/demux/mp4demuxer.ts"),f=W("./src/demux/tsdemuxer.ts"),p=W("./src/demux/mp3demuxer.ts"),c=W("./src/remux/mp4-remuxer.ts"),s=W("./src/remux/passthrough-remuxer.ts"),n=W("./src/demux/chunk-cache.ts"),o=W("./src/utils/mp4-tools.ts"),r=W("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(m){r.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var a=[{demux:f.default,remux:c.default},{demux:O.default,remux:s.default},{demux:A.default,remux:c.default},{demux:p.default,remux:c.default}],i=1024;a.forEach(function(m){var _=m.demux;i=Math.max(i,_.minProbeByteLength)});var t=function(){function m(x,h,E,S,w){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 n.default,this.observer=x,this.typeSupported=h,this.config=E,this.vendor=S,this.id=w}var _=m.prototype;return _.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},_.push=function(h,E,S,w){var R=this,N=S.transmuxing;N.executeStart=l();var F=new Uint8Array(h),z=this.cache,q=this.config,B=this.currentTransmuxState,M=this.transmuxConfig;w&&(this.currentTransmuxState=w);var G=d(F,E);if(G&&G.method==="AES-128"){var J=this.getDecrypter();if(q.enableSoftwareAES){var K=J.softwareDecrypt(F,G.key.buffer,G.iv.buffer);if(!K)return N.executeEnd=l(),v(S);F=new Uint8Array(K)}else return this.decryptionPromise=J.webCryptoDecrypt(F,G.key.buffer,G.iv.buffer).then(function(We){var He=R.push(We,null,S);return R.decryptionPromise=null,He}),this.decryptionPromise}var Z=w||B,le=Z.contiguous,de=Z.discontinuity,Te=Z.trackSwitch,we=Z.accurateTimeOffset,Ie=Z.timeOffset,_e=M.audioCodec,ye=M.videoCodec,Ke=M.defaultInitPts,Me=M.duration,Fe=M.initSegmentData;if((de||Te)&&this.resetInitSegment(Fe,_e,ye,Me),de&&this.resetInitialTimestamp(Ke),le||this.resetContiguity(),this.needsProbing(F,de,Te)){if(z.dataLength){var Ge=z.flush();F=Object(o.appendUint8Array)(Ge,F)}this.configureTransmuxer(F,M)}var Ee=this.transmux(F,G,Ie,we,S),me=this.currentTransmuxState;return me.contiguous=!0,me.discontinuity=!1,me.trackSwitch=!1,N.executeEnd=l(),Ee},_.flush=function(h){var E=this,S=h.transmuxing;S.executeStart=l();var w=this.decrypter,R=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return E.flush(h)});var z=[],q=N.timeOffset;if(w){var B=w.flush();B&&z.push(this.push(B,null,h))}var M=R.dataLength;R.reset();var G=this.demuxer,J=this.remuxer;if(!G||!J)return M>=i&&this.observer.emit(C.Events.ERROR,C.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=l(),[v(h)];var K=G.flush(q);return y(K)?K.then(function(Z){return E.flushRemux(z,Z,h),z}):(this.flushRemux(z,K,h),z)},_.flushRemux=function(h,E,S){var w=E.audioTrack,R=E.avcTrack,N=E.id3Track,F=E.textTrack,z=this.currentTransmuxState,q=z.accurateTimeOffset,B=z.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var M=this.remuxer.remux(w,R,N,F,B,q,!0,this.id);h.push({remuxResult:M,chunkMeta:S}),S.transmuxing.executeEnd=l()},_.resetInitialTimestamp=function(h){var E=this.demuxer,S=this.remuxer;if(!E||!S)return;E.resetTimeStamp(h),S.resetTimeStamp(h)},_.resetContiguity=function(){var h=this.demuxer,E=this.remuxer;if(!h||!E)return;h.resetContiguity(),E.resetNextTimestamp()},_.resetInitSegment=function(h,E,S,w){var R=this.demuxer,N=this.remuxer;if(!R||!N)return;R.resetInitSegment(E,S,w),N.resetInitSegment(h,E,S)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(h,E,S,w,R){var N;return E&&E.method==="SAMPLE-AES"?N=this.transmuxSampleAes(h,E,S,w,R):N=this.transmuxUnencrypted(h,S,w,R),N},_.transmuxUnencrypted=function(h,E,S,w){var R=this.demuxer.demux(h,E,!1,!this.config.progressive),N=R.audioTrack,F=R.avcTrack,z=R.id3Track,q=R.textTrack,B=this.remuxer.remux(N,F,z,q,E,S,!1,this.id);return{remuxResult:B,chunkMeta:w}},_.transmuxSampleAes=function(h,E,S,w,R){var N=this;return this.demuxer.demuxSampleAes(h,E,S).then(function(F){var z=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,S,w,!1,N.id);return{remuxResult:z,chunkMeta:R}})},_.configureTransmuxer=function(h,E){for(var S=this.config,w=this.observer,R=this.typeSupported,N=this.vendor,F=E.audioCodec,z=E.defaultInitPts,q=E.duration,B=E.initSegmentData,M=E.videoCodec,G,J=0,K=a.length;J<K;J++)if(a[J].demux.probe(h)){G=a[J];break}G||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:O.default,remux:s.default});var Z=this.demuxer,le=this.remuxer,de=G.remux,Te=G.demux;(!le||!(le instanceof de))&&(this.remuxer=new de(w,S,R,N)),(!Z||!(Z instanceof Te))&&(this.demuxer=new Te(w,S,R),this.probe=Te.probe),this.resetInitSegment(B,F,M,q),this.resetInitialTimestamp(z)},_.needsProbing=function(h,E,S){return!this.demuxer||!this.remuxer||E||S},_.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new T.default(this.observer,this.config)),h},m}();function d(m,_){var x=null;return m.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(x=_),x}var v=function(_){return{remuxResult:{},chunkMeta:_}};function y(m){return"then"in m&&m.then instanceof Function}var b=function(_,x,h,E,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=x,this.initSegmentData=h,this.duration=E,this.defaultInitPts=S},g=function(_,x,h,E,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=x,this.accurateTimeOffset=h,this.trackSwitch=E,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"discardEPB",function(){return v});var C=W("./src/demux/adts.ts"),D=W("./src/demux/mpegaudio.ts"),T=W("./src/demux/exp-golomb.ts"),A=W("./src/demux/id3.ts"),O=W("./src/demux/sample-aes.ts"),f=W("./src/events.ts"),p=W("./src/utils/mp4-tools.ts"),c=W("./src/utils/logger.ts"),s=W("./src/errors.ts"),n={video:1,audio:2,id3:3,text:4},o=function(){function y(g,m,_){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=g,this.config=m,this.typeSupported=_}y.probe=function(m){var _=y.syncOffset(m);return _<0?!1:(_&&c.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},y.syncOffset=function(m){for(var _=Math.min(1e3,m.length-3*188),x=0;x<_;){if(m[x]===71&&m[x+188]===71&&m[x+2*188]===71)return x;x++}return-1},y.createTrack=function(m,_){return{container:m==="video"||m==="audio"?"video/mp2t":void 0,type:m,id:n[m],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:m==="audio"?_:void 0}};var b=y.prototype;return b.resetInitSegment=function(m,_,x){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=y.createTrack("video",x),this._audioTrack=y.createTrack("audio",x),this._id3Track=y.createTrack("id3",x),this._txtTrack=y.createTrack("text",x),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=m,this.videoCodec=_,this._duration=x},b.resetTimeStamp=function(){},b.resetContiguity=function(){var m=this._audioTrack,_=this._avcTrack,x=this._id3Track;m&&(m.pesData=null),_&&(_.pesData=null),x&&(x.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},b.demux=function(m,_,x,h){x===void 0&&(x=!1),h===void 0&&(h=!1),x||(this.sampleAes=null);var E,S=this._avcTrack,w=this._audioTrack,R=this._id3Track,N=S.pid,F=S.pesData,z=w.pid,q=R.pid,B=w.pesData,M=R.pesData,G=!1,J=this.pmtParsed,K=this._pmtId,Z=m.length;if(this.remainderData&&(m=Object(p.appendUint8Array)(this.remainderData,m),Z=m.length,this.remainderData=null),Z<188&&!h)return this.remainderData=m,{audioTrack:w,avcTrack:S,id3Track:R,textTrack:this._txtTrack};var le=Math.max(0,y.syncOffset(m));Z-=(Z+le)%188,Z<m.byteLength&&!h&&(this.remainderData=new Uint8Array(m.buffer,Z,m.buffer.byteLength-Z));for(var de=le;de<Z;de+=188)if(m[de]===71){var Te=!!(m[de+1]&64),we=((m[de+1]&31)<<8)+m[de+2],Ie=(m[de+3]&48)>>4,_e=void 0;if(Ie>1){if(_e=de+5+m[de+4],_e===de+188)continue}else _e=de+4;switch(we){case N:Te&&(F&&(E=i(F))&&this.parseAVCPES(E,!1),F={data:[],size:0}),F&&(F.data.push(m.subarray(_e,de+188)),F.size+=de+188-_e);break;case z:Te&&(B&&(E=i(B))&&(w.isAAC?this.parseAACPES(E):this.parseMPEGPES(E)),B={data:[],size:0}),B&&(B.data.push(m.subarray(_e,de+188)),B.size+=de+188-_e);break;case q:Te&&(M&&(E=i(M))&&this.parseID3PES(E),M={data:[],size:0}),M&&(M.data.push(m.subarray(_e,de+188)),M.size+=de+188-_e);break;case 0:Te&&(_e+=m[_e]+1),K=this._pmtId=l(m,_e);break;case K:{Te&&(_e+=m[_e]+1);var ye=a(m,_e,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,x);N=ye.avc,N>0&&(S.pid=N),z=ye.audio,z>0&&(w.pid=z,w.isAAC=ye.isAAC),q=ye.id3,q>0&&(R.pid=q),G&&!J&&(c.logger.log("reparse from beginning"),G=!1,de=le-188),J=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(f.Events.ERROR,f.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=F,w.pesData=B,R.pesData=M;var Ke={audioTrack:w,avcTrack:S,id3Track:R,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(Ke),Ke},b.flush=function(){var m=this.remainderData;this.remainderData=null;var _;return m?_=this.demux(m,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},b.extractRemainingSamples=function(m){var _=m.audioTrack,x=m.avcTrack,h=m.id3Track,E=x.pesData,S=_.pesData,w=h.pesData,R;E&&(R=i(E))?(this.parseAVCPES(R,!0),x.pesData=null):x.pesData=E,S&&(R=i(S))?(_.isAAC?this.parseAACPES(R):this.parseMPEGPES(R),_.pesData=null):(S!=null&&S.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=S),w&&(R=i(w))?(this.parseID3PES(R),h.pesData=null):h.pesData=w},b.demuxSampleAes=function(m,_,x){var h=this.demux(m,x,!0,!this.config.progressive),E=this.sampleAes=new O.default(this.observer,this.config,_);return this.decrypt(h,E)},b.decrypt=function(m,_){return new Promise(function(x){var h=m.audioTrack,E=m.avcTrack;h.samples&&h.isAAC?_.decryptAacSamples(h.samples,0,function(){E.samples?_.decryptAvcSamples(E.samples,0,0,function(){x(m)}):x(m)}):E.samples&&_.decryptAvcSamples(E.samples,0,0,function(){x(m)})})},b.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},b.parseAVCPES=function(m,_){var x=this,h=this._avcTrack,E=this.parseAVCNALu(m.data),S=!1,w=this.avcSample,R,N=!1;m.data=null,w&&E.length&&!h.audFound&&(t(w,h),w=this.avcSample=r(!1,m.pts,m.dts,"")),E.forEach(function(F){switch(F.type){case 1:{R=!0,w||(w=x.avcSample=r(!0,m.pts,m.dts,"")),S&&(w.debug+="NDR "),w.frame=!0;var z=F.data;if(N&&z.length>4){var q=new T.default(z).readSliceType();(q===2||q===4||q===7||q===9)&&(w.key=!0)}break}case 5:R=!0,w||(w=x.avcSample=r(!0,m.pts,m.dts,"")),S&&(w.debug+="IDR "),w.key=!0,w.frame=!0;break;case 6:{R=!0,S&&w&&(w.debug+="SEI ");var B=new T.default(v(F.data));B.readUByte();for(var M=0,G=0,J=!1,K=0;!J&&B.bytesAvailable>1;){M=0;do K=B.readUByte(),M+=K;while(K===255);G=0;do K=B.readUByte(),G+=K;while(K===255);if(M===4&&B.bytesAvailable!==0){J=!0;var Z=B.readUByte();if(Z===181){var le=B.readUShort();if(le===49){var de=B.readUInt();if(de===1195456820){var Te=B.readUByte();if(Te===3){for(var we=B.readUByte(),Ie=B.readUByte(),_e=31&we,ye=[we,Ie],Ke=0;Ke<_e;Ke++)ye.push(B.readUByte()),ye.push(B.readUByte()),ye.push(B.readUByte());d(x._txtTrack.samples,{type:3,pts:m.pts,bytes:ye})}}}}}else if(M===5&&B.bytesAvailable!==0){if(J=!0,G>16){for(var Me=[],Fe=0;Fe<16;Fe++)Me.push(B.readUByte().toString(16)),(Fe===3||Fe===5||Fe===7||Fe===9)&&Me.push("-");for(var Ge=G-16,Ee=new Uint8Array(Ge),me=0;me<Ge;me++)Ee[me]=B.readUByte();d(x._txtTrack.samples,{pts:m.pts,payloadType:M,uuid:Me.join(""),userData:Object(A.utf8ArrayToStr)(Ee),userDataBytes:Ee})}}else if(G<B.bytesAvailable)for(var We=0;We<G;We++)B.readUByte()}break}case 7:if(R=!0,N=!0,S&&w&&(w.debug+="SPS "),!h.sps){var He=new T.default(F.data),it=He.readSPS();h.width=it.width,h.height=it.height,h.pixelRatio=it.pixelRatio,h.sps=[F.data],h.duration=x._duration;for(var re=F.data.subarray(1,4),P="avc1.",j=0;j<3;j++){var ee=re[j].toString(16);ee.length<2&&(ee="0"+ee),P+=ee}h.codec=P}break;case 8:R=!0,S&&w&&(w.debug+="PPS "),h.pps||(h.pps=[F.data]);break;case 9:R=!1,h.audFound=!0,w&&t(w,h),w=x.avcSample=r(!1,m.pts,m.dts,S?"AUD ":"");break;case 12:R=!1;break;default:R=!1,w&&(w.debug+="unknown NAL "+F.type+" ");break}if(w&&R){var $=w.units;$.push(F)}}),_&&w&&(t(w,h),this.avcSample=null)},b.getLastNalUnit=function(){var m,_=this.avcSample,x;if(!_||_.units.length===0){var h=this._avcTrack.samples;_=h[h.length-1]}if((m=_)!==null&&m!==void 0&&m.units){var E=_.units;x=E[E.length-1]}return x},b.parseAVCNALu=function(m){var _=m.byteLength,x=this._avcTrack,h=x.naluState||0,E=h,S=[],w=0,R,N,F,z=-1,q=0;for(h===-1&&(z=0,q=m[0]&31,h=0,w=1);w<_;){if(R=m[w++],!h){h=R?0:1;continue}if(h===1){h=R?0:2;continue}if(!R)h=3;else if(R===1){if(z>=0){var B={data:m.subarray(z,w-h-1),type:q};S.push(B)}else{var M=this.getLastNalUnit();if(M&&(E&&w<=4-E&&(M.state&&(M.data=M.data.subarray(0,M.data.byteLength-E))),N=w-h-1,N>0)){var G=new Uint8Array(M.data.byteLength+N);G.set(M.data,0),G.set(m.subarray(0,N),M.data.byteLength),M.data=G,M.state=0}}w<_?(F=m[w]&31,z=w,q=F,h=0):h=-1}else h=0}if(z>=0&&h>=0){var J={data:m.subarray(z,_),type:q,state:h};S.push(J)}if(S.length===0){var K=this.getLastNalUnit();if(K){var Z=new Uint8Array(K.data.byteLength+m.byteLength);Z.set(K.data,0),Z.set(m,K.data.byteLength),K.data=Z}}return x.naluState=h,S},b.parseAACPES=function(m){var _=0,x=this._audioTrack,h=this.aacOverFlow,E=m.data;if(h){this.aacOverFlow=null;var S=h.sample.unit.byteLength,w=Math.min(h.missing,S),R=S-w;h.sample.unit.set(E.subarray(0,w),R),x.samples.push(h.sample),_=h.missing}var N,F;for(N=_,F=E.length;N<F-1&&!C.isHeader(E,N);N++);if(N!==_){var z,q;if(N<F-1?(z="AAC PES did not start with ADTS header,offset:"+N,q=!1):(z="no ADTS header found in AAC PES",q=!0),c.logger.warn("parsing error:"+z),this.observer.emit(f.Events.ERROR,f.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:q,reason:z}),q)return}C.initTrackConfig(x,this.observer,E,N,this.audioCodec);var B;if(m.pts!==void 0)B=m.pts;else if(h){var M=C.getFrameDuration(x.samplerate);B=h.sample.pts+M}else{c.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;N<F;)if(C.isHeader(E,N)){if(N+5<F){var J=C.appendFrame(x,E,N,B,G);if(J)if(J.missing)this.aacOverFlow=J;else{N+=J.length,G++;continue}}break}else N++},b.parseMPEGPES=function(m){var _=m.data,x=_.length,h=0,E=0,S=m.pts;if(S===void 0){c.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;E<x;)if(D.isHeader(_,E)){var w=D.appendFrame(this._audioTrack,_,E,S,h);if(w)E+=w.length,h++;else break}else E++},b.parseID3PES=function(m){if(m.pts===void 0){c.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(m)},y}();o.minProbeByteLength=188;function r(y,b,g,m){return{key:y,frame:!1,pts:b,dts:g,units:[],debug:m,length:0}}function l(y,b){return(y[b+10]&31)<<8|y[b+11]}function a(y,b,g,m){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},x=(y[b+1]&15)<<8|y[b+2],h=b+3+x-4,E=(y[b+10]&15)<<8|y[b+11];for(b+=12+E;b<h;){var S=(y[b+1]&31)<<8|y[b+2];switch(y[b]){case 207:if(!m){c.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=S);break;case 21:_.id3===-1&&(_.id3=S);break;case 219:if(!m){c.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=S);break;case 3:case 4:g?_.audio===-1&&(_.audio=S,_.isAAC=!1):c.logger.log("MPEG audio found, not supported in this browser");break;case 36:c.logger.warn("Unsupported HEVC stream type found");break;default:break}b+=((y[b+3]&15)<<8|y[b+4])+5}return _}function i(y){var b=0,g,m,_,x,h,E=y.data;if(!y||y.size===0)return null;for(;E[0].length<19&&E.length>1;){var S=new Uint8Array(E[0].length+E[1].length);S.set(E[0]),S.set(E[1],E[0].length),E[0]=S,E.splice(1,1)}g=E[0];var w=(g[0]<<16)+(g[1]<<8)+g[2];if(w===1){if(m=(g[4]<<8)+g[5],m&&m>y.size-6)return null;var R=g[7];R&192&&(x=(g[9]&14)*536870912+(g[10]&255)*4194304+(g[11]&254)*16384+(g[12]&255)*128+(g[13]&254)/2,R&64?(h=(g[14]&14)*536870912+(g[15]&255)*4194304+(g[16]&254)*16384+(g[17]&255)*128+(g[18]&254)/2,x-h>60*9e4&&(c.logger.warn(Math.round((x-h)/9e4)+"s delta between PTS and DTS, align them"),x=h)):h=x),_=g[8];var N=_+9;if(y.size<=N)return null;y.size-=N;for(var F=new Uint8Array(y.size),z=0,q=E.length;z<q;z++){g=E[z];var B=g.byteLength;if(N)if(N>B){N-=B;continue}else g=g.subarray(N),B-=N,N=0;F.set(g,b),b+=B}return m&&(m-=_+3),{data:F,pts:x,dts:h,len:m}}return null}function t(y,b){if(y.units.length&&y.frame){if(y.pts===void 0){var g=b.samples,m=g.length;if(m){var _=g[m-1];y.pts=_.pts,y.dts=_.dts}else{b.dropped++;return}}b.samples.push(y)}y.debug.length&&c.logger.log(y.pts+"/"+y.dts+":"+y.debug)}function d(y,b){var g=y.length;if(g>0){if(b.pts>=y[g-1].pts)y.push(b);else for(var m=g-1;m>=0;m--)if(b.pts<y[m].pts){y.splice(m,0,b);break}}else y.push(b)}function v(y){for(var b=y.byteLength,g=[],m=1;m<b-2;)y[m]===0&&y[m+1]===0&&y[m+2]===3?(g.push(m+2),m+=2):m++;if(g.length===0)return y;var _=b-g.length,x=new Uint8Array(_),h=0;for(m=0;m<_;h++,m++)h===g[0]&&(h++,g.shift()),x[m]=y[h];return x}ie.default=o},"./src/errors.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"ErrorTypes",function(){return C}),W.d(ie,"ErrorDetails",function(){return D});var C;(function(T){T.NETWORK_ERROR="networkError",T.MEDIA_ERROR="mediaError",T.KEY_SYSTEM_ERROR="keySystemError",T.MUX_ERROR="muxError",T.OTHER_ERROR="otherError"})(C||(C={}));var D;(function(T){T.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",T.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",T.KEY_SYSTEM_NO_SESSION="keySystemNoSession",T.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",T.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",T.MANIFEST_LOAD_ERROR="manifestLoadError",T.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",T.MANIFEST_PARSING_ERROR="manifestParsingError",T.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",T.LEVEL_EMPTY_ERROR="levelEmptyError",T.LEVEL_LOAD_ERROR="levelLoadError",T.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",T.LEVEL_SWITCH_ERROR="levelSwitchError",T.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",T.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",T.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",T.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",T.FRAG_LOAD_ERROR="fragLoadError",T.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",T.FRAG_DECRYPT_ERROR="fragDecryptError",T.FRAG_PARSING_ERROR="fragParsingError",T.REMUX_ALLOC_ERROR="remuxAllocError",T.KEY_LOAD_ERROR="keyLoadError",T.KEY_LOAD_TIMEOUT="keyLoadTimeOut",T.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",T.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",T.BUFFER_APPEND_ERROR="bufferAppendError",T.BUFFER_APPENDING_ERROR="bufferAppendingError",T.BUFFER_STALLED_ERROR="bufferStalledError",T.BUFFER_FULL_ERROR="bufferFullError",T.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",T.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",T.INTERNAL_EXCEPTION="internalException",T.INTERNAL_ABORTED="aborted",T.UNKNOWN="unknown"})(D||(D={}))},"./src/events.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"Events",function(){return C});var C;(function(D){D.MEDIA_ATTACHING="hlsMediaAttaching",D.MEDIA_ATTACHED="hlsMediaAttached",D.MEDIA_DETACHING="hlsMediaDetaching",D.MEDIA_DETACHED="hlsMediaDetached",D.BUFFER_RESET="hlsBufferReset",D.BUFFER_CODECS="hlsBufferCodecs",D.BUFFER_CREATED="hlsBufferCreated",D.BUFFER_APPENDING="hlsBufferAppending",D.BUFFER_APPENDED="hlsBufferAppended",D.BUFFER_EOS="hlsBufferEos",D.BUFFER_FLUSHING="hlsBufferFlushing",D.BUFFER_FLUSHED="hlsBufferFlushed",D.MANIFEST_LOADING="hlsManifestLoading",D.MANIFEST_LOADED="hlsManifestLoaded",D.MANIFEST_PARSED="hlsManifestParsed",D.LEVEL_SWITCHING="hlsLevelSwitching",D.LEVEL_SWITCHED="hlsLevelSwitched",D.LEVEL_LOADING="hlsLevelLoading",D.LEVEL_LOADED="hlsLevelLoaded",D.LEVEL_UPDATED="hlsLevelUpdated",D.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",D.LEVELS_UPDATED="hlsLevelsUpdated",D.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",D.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",D.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",D.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",D.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",D.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",D.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",D.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",D.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",D.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",D.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",D.CUES_PARSED="hlsCuesParsed",D.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",D.INIT_PTS_FOUND="hlsInitPtsFound",D.FRAG_LOADING="hlsFragLoading",D.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",D.FRAG_LOADED="hlsFragLoaded",D.FRAG_DECRYPTED="hlsFragDecrypted",D.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",D.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",D.FRAG_PARSING_METADATA="hlsFragParsingMetadata",D.FRAG_PARSED="hlsFragParsed",D.FRAG_BUFFERED="hlsFragBuffered",D.FRAG_CHANGED="hlsFragChanged",D.FPS_DROP="hlsFpsDrop",D.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",D.ERROR="hlsError",D.DESTROYING="hlsDestroying",D.KEY_LOADING="hlsKeyLoading",D.KEY_LOADED="hlsKeyLoaded",D.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",D.BACK_BUFFER_REACHED="hlsBackBufferReached"})(C||(C={}))},"./src/hls.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return y});var C=W("./node_modules/url-toolkit/src/url-toolkit.js"),D=W.n(C),T=W("./src/loader/playlist-loader.ts"),A=W("./src/loader/key-loader.ts"),O=W("./src/controller/id3-track-controller.ts"),f=W("./src/controller/latency-controller.ts"),p=W("./src/controller/level-controller.ts"),c=W("./src/controller/fragment-tracker.ts"),s=W("./src/controller/stream-controller.ts"),n=W("./src/is-supported.ts"),o=W("./src/utils/logger.ts"),r=W("./src/config.ts"),l=W("./node_modules/eventemitter3/index.js"),a=W.n(l),i=W("./src/events.ts"),t=W("./src/errors.ts");function d(b,g){for(var m=0;m<g.length;m++){var _=g[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,_.key,_)}}function v(b,g,m){return g&&d(b.prototype,g),m&&d(b,m),b}var y=function(){b.isSupported=function(){return Object(n.isSupported)()};function b(m){m===void 0&&(m={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var _=this.config=Object(r.mergeConfig)(b.DefaultConfig,m);this.userConfig=m,Object(o.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(r.enableStreamingMode)(_);var x=_.abrController,h=_.bufferController,E=_.capLevelController,S=_.fpsController,w=this.abrController=new x(this),R=this.bufferController=new h(this),N=this.capLevelController=new E(this),F=new S(this),z=new T.default(this),q=new A.default(this),B=new O.default(this),M=this.levelController=new p.default(this),G=new c.FragmentTracker(this),J=this.streamController=new s.default(this,G);N.setStreamController(J),F.setStreamController(J);var K=[M,J];this.networkControllers=K;var Z=[z,q,w,R,N,F,B,G];this.audioTrackController=this.createController(_.audioTrackController,null,K),this.createController(_.audioStreamController,G,K),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,K),this.createController(_.subtitleStreamController,G,K),this.createController(_.timelineController,null,Z),this.emeController=this.createController(_.emeController,null,Z),this.cmcdController=this.createController(_.cmcdController,null,Z),this.latencyController=this.createController(f.default,null,Z),this.coreComponents=Z}var g=b.prototype;return g.createController=function(_,x,h){if(_){var E=x?new _(this,x):new _(this);return h&&h.push(E),E}return null},g.on=function(_,x,h){h===void 0&&(h=this),this._emitter.on(_,x,h)},g.once=function(_,x,h){h===void 0&&(h=this),this._emitter.once(_,x,h)},g.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},g.off=function(_,x,h,E){h===void 0&&(h=this),this._emitter.off(_,x,h,E)},g.listeners=function(_){return this._emitter.listeners(_)},g.emit=function(_,x,h){return this._emitter.emit(_,x,h)},g.trigger=function(_,x){if(this.config.debug)return this.emit(_,_,x);try{return this.emit(_,_,x)}catch(h){o.logger.error("An internal error happened while handling event "+_+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(i.Events.ERROR,{type:t.ErrorTypes.OTHER_ERROR,details:t.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:h})}return!1},g.listenerCount=function(_){return this._emitter.listenerCount(_)},g.destroy=function(){o.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},g.attachMedia=function(_){o.logger.log("attachMedia"),this._media=_,this.trigger(i.Events.MEDIA_ATTACHING,{media:_})},g.detachMedia=function(){o.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},g.loadSource=function(_){this.stopLoad();var x=this.media,h=this.url,E=this.url=C.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});o.logger.log("loadSource:"+E),x&&h&&h!==E&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(x)),this.trigger(i.Events.MANIFEST_LOADING,{url:_})},g.startLoad=function(_){_===void 0&&(_=-1),o.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(x){x.startLoad(_)})},g.stopLoad=function(){o.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},g.swapAudioCodec=function(){o.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},g.recoverMediaError=function(){o.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},g.removeLevel=function(_,x){x===void 0&&(x=0),this.levelController.removeLevel(_,x)},v(b,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){o.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){o.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){o.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){o.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){o.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var x=!!_;x!==this.config.capLevelToPlayerSize&&(x?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=x)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(o.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,x=this.config.minAutoBitrate;if(!_)return 0;for(var h=_.length,E=0;E<h;E++)if(_[E].maxBitrate>x)return E;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,x=this.autoLevelCapping,h;return x===-1&&_&&_.length?h=_.length-1:h=x,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var x=this.audioTrackController;x&&(x.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var x=this.subtitleTrackController;x&&(x.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var x=this.subtitleTrackController;x&&(x.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return b.defaultConfig?b.defaultConfig:r.hlsDefaultConfig},set:function(_){b.defaultConfig=_}}]),b}();y.defaultConfig=void 0},"./src/is-supported.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"isSupported",function(){return T}),W.d(ie,"changeTypeSupported",function(){return A});var C=W("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function T(){var O=Object(C.getMediaSource)();if(!O)return!1;var f=D(),p=O&&typeof O.isTypeSupported=="function"&&O.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),c=!f||f.prototype&&typeof f.prototype.appendBuffer=="function"&&typeof f.prototype.remove=="function";return!!p&&!!c}function A(){var O,f=D();return typeof(f==null||((O=f.prototype)===null||O===void 0)?void 0:O.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return o}),W.d(ie,"LoadError",function(){return l});var C=W("./src/polyfills/number.ts"),D=W("./src/errors.ts");function T(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,c(a,i)}function A(a){var i=typeof Map=="function"?new Map:void 0;return A=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 i!="undefined"){if(i.has(d))return i.get(d);i.set(d,v)}function v(){return O(d,arguments,s(this).constructor)}return v.prototype=Object.create(d.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),c(v,d)},A(a)}function O(a,i,t){return f()?O=Reflect.construct:O=function(v,y,b){var g=[null];g.push.apply(g,y);var m=Function.bind.apply(v,g),_=new m;return b&&c(_,b.prototype),_},O.apply(null,arguments)}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function p(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function c(a,i){return c=Object.setPrototypeOf||function(d,v){return d.__proto__=v,d},c(a,i)}function s(a){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},s(a)}var n=Math.pow(2,17),o=function(){function a(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var i=a.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(d,v){var y=this,b=d.url;if(!b)return Promise.reject(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(b?"part list":"url")));this.abort();var g=this.config,m=g.fLoader,_=g.loader;return new Promise(function(x,h){y.loader&&y.loader.destroy();var E=y.loader=d.loader=m?new m(g):new _(g),S=r(d),w={timeout:g.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:g.fragLoadingMaxRetryTimeout,highWaterMark:n};d.stats=E.stats,E.load(S,w,{onSuccess:function(N,F,z,q){y.resetLoader(d,E),x({frag:d,part:null,payload:N.data,networkDetails:q})},onError:function(N,F,z){y.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:N,networkDetails:z}))},onAbort:function(N,F,z){y.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:z}))},onTimeout:function(N,F,z){y.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:z}))},onProgress:function(N,F,z,q){v&&v({frag:d,part:null,payload:z,networkDetails:q})}})})},i.loadPart=function(d,v,y){var b=this;this.abort();var g=this.config,m=g.fLoader,_=g.loader;return new Promise(function(x,h){b.loader&&b.loader.destroy();var E=b.loader=d.loader=m?new m(g):new _(g),S=r(d,v),w={timeout:g.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:g.fragLoadingMaxRetryTimeout,highWaterMark:n};v.stats=E.stats,E.load(S,w,{onSuccess:function(N,F,z,q){b.resetLoader(d,E),b.updateStatsFromPart(d,v);var B={frag:d,part:v,payload:N.data,networkDetails:q};y(B),x(B)},onError:function(N,F,z){b.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:v,response:N,networkDetails:z}))},onAbort:function(N,F,z){d.stats.aborted=v.stats.aborted,b.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:v,networkDetails:z}))},onTimeout:function(N,F,z){b.resetLoader(d,E),h(new l({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:v,networkDetails:z}))}})})},i.updateStatsFromPart=function(d,v){var y=d.stats,b=v.stats,g=b.total;if(y.loaded+=b.loaded,g){var m=Math.round(d.duration/v.duration),_=Math.min(Math.round(y.loaded/g),m),x=m-_,h=x*Math.round(y.loaded/_);y.total=y.loaded+h}else y.total=Math.max(y.loaded,y.total);var E=y.loading,S=b.loading;E.start?E.first+=S.first-S.start:(E.start=S.start,E.first=S.first),E.end=S.end},i.resetLoader=function(d,v){d.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},a}();function r(a,i){i===void 0&&(i=null);var t=i||a,d={frag:a,part:i,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},v=t.byteRangeStartOffset,y=t.byteRangeEndOffset;return Object(C.isFiniteNumber)(v)&&Object(C.isFiniteNumber)(y)&&(d.rangeStart=v,d.rangeEnd=y),d}var l=function(a){T(i,a);function i(t){for(var d,v=arguments.length,y=new Array(v>1?v-1:0),b=1;b<v;b++)y[b-1]=arguments[b];return d=a.call.apply(a,[this].concat(y))||this,d.data=void 0,d.data=t,d}return i}(A(Error))},"./src/loader/fragment.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"ElementaryStreamTypes",function(){return o}),W.d(ie,"BaseSegment",function(){return r}),W.d(ie,"Fragment",function(){return l}),W.d(ie,"Part",function(){return a});var C=W("./src/polyfills/number.ts"),D=W("./node_modules/url-toolkit/src/url-toolkit.js"),T=W.n(D),A=W("./src/utils/logger.ts"),O=W("./src/loader/level-key.ts"),f=W("./src/loader/load-stats.ts");function p(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,c(i,t)}function c(i,t){return c=Object.setPrototypeOf||function(v,y){return v.__proto__=y,v},c(i,t)}function s(i,t){for(var d=0;d<t.length;d++){var v=t[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(i,v.key,v)}}function n(i,t,d){return t&&s(i.prototype,t),d&&s(i,d),i}var o;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(o||(o={}));var r=function(){function i(d){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[o.AUDIO]=null,v[o.VIDEO]=null,v[o.AUDIOVIDEO]=null,v),this.baseurl=d}var t=i.prototype;return t.setByteRange=function(v,y){var b=v.split("@",2),g=[];b.length===1?g[0]=y?y.byteRangeEndOffset:0:g[0]=parseInt(b[1]),g[1]=parseInt(b[0])+g[0],this._byteRange=g},n(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(D.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),i}(),l=function(i){p(t,i);function t(v,y){var b;return b=i.call(this,y)||this,b._decryptdata=null,b.rawProgramDateTime=null,b.programDateTime=null,b.tagList=[],b.duration=0,b.sn=0,b.levelkey=void 0,b.type=void 0,b.loader=null,b.level=-1,b.cc=0,b.startPTS=void 0,b.endPTS=void 0,b.appendedPTS=void 0,b.startDTS=void 0,b.endDTS=void 0,b.start=0,b.deltaPTS=void 0,b.maxStartPTS=void 0,b.minEndPTS=void 0,b.stats=new f.LoadStats,b.urlId=0,b.data=void 0,b.bitrateTest=!1,b.title=null,b.initSegment=null,b.type=v,b}var d=t.prototype;return d.createInitializationVector=function(y){for(var b=new Uint8Array(16),g=12;g<16;g++)b[g]=y>>8*(15-g)&255;return b},d.setDecryptDataFromLevelKey=function(y,b){var g=y;return(y==null?void 0:y.method)==="AES-128"&&y.uri&&!y.iv&&(g=O.LevelKey.fromURI(y.uri),g.method=y.method,g.iv=this.createInitializationVector(b),g.keyFormat="identity"),g},d.setElementaryStreamInfo=function(y,b,g,m,_,x){x===void 0&&(x=!1);var h=this.elementaryStreams,E=h[y];if(!E){h[y]={startPTS:b,endPTS:g,startDTS:m,endDTS:_,partial:x};return}E.startPTS=Math.min(E.startPTS,b),E.endPTS=Math.max(E.endPTS,g),E.startDTS=Math.min(E.startDTS,m),E.endDTS=Math.max(E.endDTS,_)},d.clearElementaryStreamInfo=function(){var y=this.elementaryStreams;y[o.AUDIO]=null,y[o.VIDEO]=null,y[o.AUDIOVIDEO]=null},n(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var y=this.sn;typeof y!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&A.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),y=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,y)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(C.isFiniteNumber)(this.programDateTime))return null;var y=Object(C.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+y*1e3}},{key:"encrypted",get:function(){var y;return!!((y=this.decryptdata)!==null&&y!==void 0&&y.keyFormat&&this.decryptdata.uri)}}]),t}(r),a=function(i){p(t,i);function t(d,v,y,b,g){var m;m=i.call(this,y)||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 f.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=b;var _=d.enumeratedString("BYTERANGE");return _&&m.setByteRange(_,g),g&&(m.fragOffset=g.fragOffset+g.duration),m}return n(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}(r)},"./src/loader/key-loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return A});var C=W("./src/events.ts"),D=W("./src/errors.ts"),T=W("./src/utils/logger.ts"),A=function(){function O(p){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=p,this._registerListeners()}var f=O.prototype;return f._registerListeners=function(){this.hls.on(C.Events.KEY_LOADING,this.onKeyLoading,this)},f._unregisterListeners=function(){this.hls.off(C.Events.KEY_LOADING,this.onKeyLoading)},f.destroy=function(){this._unregisterListeners();for(var c in this.loaders){var s=this.loaders[c];s&&s.destroy()}this.loaders={}},f.onKeyLoading=function(c,s){var n=s.frag,o=n.type,r=this.loaders[o];if(!n.decryptdata){T.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=n.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(r&&(T.logger.warn("abort previous key loader for type:"+o),r.abort()),!l){T.logger.warn("key uri is falsy");return}var i=a.loader,t=n.loader=this.loaders[o]=new i(a);this.decrypturl=l,this.decryptkey=null;var d={url:l,frag:n,responseType:"arraybuffer"},v={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};t.load(d,v,y)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(C.Events.KEY_LOADED,{frag:n}))},f.loadsuccess=function(c,s,n){var o=n.frag;if(!o.decryptdata){T.logger.error("after key load, decryptdata unset");return}this.decryptkey=o.decryptdata.key=new Uint8Array(c.data),o.loader=null,delete this.loaders[o.type],this.hls.trigger(C.Events.KEY_LOADED,{frag:o})},f.loaderror=function(c,s){var n=s.frag,o=n.loader;o&&o.abort(),delete this.loaders[n.type],this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:c})},f.loadtimeout=function(c,s){var n=s.frag,o=n.loader;o&&o.abort(),delete this.loaders[n.type],this.hls.trigger(C.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},O}()},"./src/loader/level-details.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"LevelDetails",function(){return O});var C=W("./src/polyfills/number.ts");function D(f,p){for(var c=0;c<p.length;c++){var s=p[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(f,s.key,s)}}function T(f,p,c){return p&&D(f.prototype,p),c&&D(f,c),f}var A=10,O=function(){function f(c){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=c}var p=f.prototype;return p.reloaded=function(s){if(!s){this.advanced=!0,this.updated=!0;return}var n=this.lastPartSn-s.lastPartSn,o=this.lastPartIndex-s.lastPartIndex;this.updated=this.endSN!==s.endSN||!!o||!!n,this.advanced=this.endSN>s.endSN||n>0||n===0&&o>0,this.updated||this.advanced?this.misses=Math.floor(s.misses*.6):this.misses=s.misses+1,this.availabilityDelay=s.availabilityDelay},T(f,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(C.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||A}},{key:"drift",get:function(){var s=this.driftEndTime-this.driftStartTime;if(s>0){var n=this.driftEnd-this.driftStart;return n*1e3/s}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var s;return(s=this.fragments)!==null&&s!==void 0&&s.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 s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var s;return(s=this.partList)!==null&&s!==void 0&&s.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),f}()},"./src/loader/level-key.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"LevelKey",function(){return O});var C=W("./node_modules/url-toolkit/src/url-toolkit.js"),D=W.n(C);function T(f,p){for(var c=0;c<p.length;c++){var s=p[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(f,s.key,s)}}function A(f,p,c){return p&&T(f.prototype,p),c&&T(f,c),f}var O=function(){f.fromURL=function(c,s){return new f(c,s)},f.fromURI=function(c){return new f(c)};function f(p,c){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,c?this._uri=Object(C.buildAbsoluteURL)(p,c,{alwaysNormalize:!0}):this._uri=p}return A(f,[{key:"uri",get:function(){return this._uri}}]),f}()},"./src/loader/load-stats.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"LoadStats",function(){return C});var C=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return t});var C=W("./src/polyfills/number.ts"),D=W("./node_modules/url-toolkit/src/url-toolkit.js"),T=W.n(D),A=W("./src/loader/fragment.ts"),O=W("./src/loader/level-details.ts"),f=W("./src/loader/level-key.ts"),p=W("./src/utils/attr-list.ts"),c=W("./src/utils/logger.ts"),s=W("./src/utils/codecs.ts"),n=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,o=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),l=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function i(g){var m,_;return a.test((m=(_=D.parseURL(g))===null||_===void 0?void 0:_.path)!=null?m:"")}var t=function(){function g(){}return g.findGroup=function(_,x){for(var h=0;h<_.length;h++){var E=_[h];if(E.id===x)return E}},g.convertAVC1ToAVCOTI=function(_){var x=_.split(".");if(x.length>2){var h=x.shift()+".";return h+=parseInt(x.shift()).toString(16),h+=("000"+parseInt(x.shift()).toString(16)).substr(-4),h}return _},g.resolve=function(_,x){return D.buildAbsoluteURL(x,_,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(_,x){var h=[],E={},S=!1;n.lastIndex=0;for(var w;(w=n.exec(_))!=null;)if(w[1]){var R=new p.AttrList(w[1]),N={attrs:R,bitrate:R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),name:R.NAME,url:g.resolve(w[2],x)},F=R.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),d((R.CODECS||"").split(/[ ,]+/).filter(function(q){return q}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=g.convertAVC1ToAVCOTI(N.videoCodec)),h.push(N)}else if(w[3]){var z=new p.AttrList(w[3]);z["DATA-ID"]&&(S=!0,E[z["DATA-ID"]]=z)}return{levels:h,sessionData:S?E:null}},g.parseMasterPlaylistMedia=function(_,x,h,E){E===void 0&&(E=[]);var S,w=[],R=0;for(o.lastIndex=0;(S=o.exec(_))!==null;){var N=new p.AttrList(S[1]);if(N.TYPE===h){var F={attrs:N,bitrate:0,id:R++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:h,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?g.resolve(N.URI,x):""};if(E.length){var z=g.findGroup(E,F.groupId)||E[0];v(F,z,"audioCodec"),v(F,z,"textCodec")}w.push(F)}}return w},g.parseLevelPlaylist=function(_,x,h,E,S){var w=new O.LevelDetails(x),R=w.fragments,N=null,F=0,z=0,q=0,B=0,M=null,G=new A.Fragment(E,x),J,K,Z,le=-1,de=!1;for(r.lastIndex=0,w.m3u8=_;(J=r.exec(_))!==null;){de&&(de=!1,G=new A.Fragment(E,x),G.start=q,G.sn=F,G.cc=B,G.level=h,N&&(G.initSegment=N,G.rawProgramDateTime=N.rawProgramDateTime));var Te=J[1];if(Te){G.duration=parseFloat(Te);var we=(" "+J[2]).slice(1);G.title=we||null,G.tagList.push(we?["INF",Te,we]:["INF",Te])}else if(J[3])Object(C.isFiniteNumber)(G.duration)&&(G.start=q,Z&&(G.levelkey=Z),G.sn=F,G.level=h,G.cc=B,G.urlId=S,R.push(G),G.relurl=(" "+J[3]).slice(1),b(G,M),M=G,q+=G.duration,F++,z=0,de=!0);else if(J[4]){var Ie=(" "+J[4]).slice(1);M?G.setByteRange(Ie,M):G.setByteRange(Ie)}else if(J[5])G.rawProgramDateTime=(" "+J[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),le===-1&&(le=R.length);else{if(J=J[0].match(l),!J){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(K=1;K<J.length&&!(typeof J[K]!="undefined");K++);var _e=(" "+J[K]).slice(1),ye=(" "+J[K+1]).slice(1),Ke=J[K+2]?(" "+J[K+2]).slice(1):"";switch(_e){case"PLAYLIST-TYPE":w.type=ye.toUpperCase();break;case"MEDIA-SEQUENCE":F=w.startSN=parseInt(ye);break;case"SKIP":{var Me=new p.AttrList(ye),Fe=Me.decimalInteger("SKIPPED-SEGMENTS");if(Object(C.isFiniteNumber)(Fe)){w.skippedSegments=Fe;for(var Ge=Fe;Ge--;)R.unshift(null);F+=Fe}var Ee=Me.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ee&&(w.recentlyRemovedDateranges=Ee.split(" "));break}case"TARGETDURATION":w.targetduration=parseFloat(ye);break;case"VERSION":w.version=parseInt(ye);break;case"EXTM3U":break;case"ENDLIST":w.live=!1;break;case"#":(ye||Ke)&&G.tagList.push(Ke?[ye,Ke]:[ye]);break;case"DIS":B++;case"GAP":G.tagList.push([_e]);break;case"BITRATE":G.tagList.push([_e,ye]);break;case"DISCONTINUITY-SEQ":B=parseInt(ye);break;case"KEY":{var me,We=new p.AttrList(ye),He=We.enumeratedString("METHOD"),it=We.URI,re=We.hexadecimalInteger("IV"),P=We.enumeratedString("KEYFORMATVERSIONS"),j=We.enumeratedString("KEYID"),ee=(me=We.enumeratedString("KEYFORMAT"))!=null?me:"identity",$=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if($.indexOf(ee)>-1){c.logger.warn("Keyformat "+ee+" is not supported from the manifest");continue}else if(ee!=="identity")continue;He&&(Z=f.LevelKey.fromURL(x,it),it&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(He)>=0&&(Z.method=He,Z.keyFormat=ee,j&&(Z.keyID=j),P&&(Z.keyFormatVersions=P),Z.iv=re));break}case"START":{var Q=new p.AttrList(ye),xe=Q.decimalFloatingPoint("TIME-OFFSET");Object(C.isFiniteNumber)(xe)&&(w.startTimeOffset=xe);break}case"MAP":{var De=new p.AttrList(ye);G.relurl=De.URI,De.BYTERANGE&&G.setByteRange(De.BYTERANGE),G.level=h,G.sn="initSegment",Z&&(G.levelkey=Z),G.initSegment=null,N=G,de=!0;break}case"SERVER-CONTROL":{var dt=new p.AttrList(ye);w.canBlockReload=dt.bool("CAN-BLOCK-RELOAD"),w.canSkipUntil=dt.optionalFloat("CAN-SKIP-UNTIL",0),w.canSkipDateRanges=w.canSkipUntil>0&&dt.bool("CAN-SKIP-DATERANGES"),w.partHoldBack=dt.optionalFloat("PART-HOLD-BACK",0),w.holdBack=dt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new p.AttrList(ye);w.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=w.partList;Be||(Be=w.partList=[]);var tt=z>0?Be[Be.length-1]:void 0,lt=z++,qe=new A.Part(new p.AttrList(ye),G,x,lt,tt);Be.push(qe),G.duration+=qe.duration;break}case"PRELOAD-HINT":{var Ye=new p.AttrList(ye);w.preloadHint=Ye;break}case"RENDITION-REPORT":{var je=new p.AttrList(ye);w.renditionReports=w.renditionReports||[],w.renditionReports.push(je);break}default:c.logger.warn("line parsed but not handled: "+J);break}}}M&&!M.relurl?(R.pop(),q-=M.duration,w.partList&&(w.fragmentHint=M)):w.partList&&(b(G,M),G.cc=B,w.fragmentHint=G);var Ue=R.length,ke=R[0],be=R[Ue-1];if(q+=w.skippedSegments*w.targetduration,q>0&&Ue&&be){w.averagetargetduration=q/Ue;var Ce=be.sn;w.endSN=Ce!=="initSegment"?Ce:0,ke&&(w.startCC=ke.cc,ke.initSegment||w.fragments.every(function(Pe){return Pe.relurl&&i(Pe.relurl)})&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new A.Fragment(E,x),G.relurl=be.relurl,G.level=h,G.sn="initSegment",ke.initSegment=G,w.needSidxRanges=!0))}else w.endSN=0,w.startCC=0;return w.fragmentHint&&(q+=w.fragmentHint.duration),w.totalduration=q,w.endCC=B,le>0&&y(R,le),w},g}();function d(g,m){["video","audio","text"].forEach(function(_){var x=g.filter(function(E){return Object(s.isCodecType)(E,_)});if(x.length){var h=x.filter(function(E){return E.lastIndexOf("avc1",0)===0||E.lastIndexOf("mp4a",0)===0});m[_+"Codec"]=h.length>0?h[0]:x[0],g=g.filter(function(E){return x.indexOf(E)===-1})}}),m.unknownCodecs=g}function v(g,m,_){var x=m[_];x&&(g[_]=x)}function y(g,m){for(var _=g[m],x=m;x--;){var h=g[x];if(!h)return;h.programDateTime=_.programDateTime-h.duration*1e3,_=h}}function b(g,m){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):m!=null&&m.programDateTime&&(g.programDateTime=m.endProgramDateTime),Object(C.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/polyfills/number.ts"),D=W("./src/events.ts"),T=W("./src/errors.ts"),A=W("./src/utils/logger.ts"),O=W("./src/utils/mp4-tools.ts"),f=W("./src/loader/m3u8-parser.ts"),p=W("./src/types/loader.ts"),c=W("./src/utils/attr-list.ts");function s(r){var l=r.type;switch(l){case p.PlaylistContextType.AUDIO_TRACK:return p.PlaylistLevelType.AUDIO;case p.PlaylistContextType.SUBTITLE_TRACK:return p.PlaylistLevelType.SUBTITLE;default:return p.PlaylistLevelType.MAIN}}function n(r,l){var a=r.url;return(a===void 0||a.indexOf("data:")===0)&&(a=l.url),a}var o=function(){function r(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var l=r.prototype;return l.registerListeners=function(){var i=this.hls;i.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var i=this.hls;i.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(i){var t=this.hls.config,d=t.pLoader,v=t.loader,y=d||v,b=new y(t);return i.loader=b,this.loaders[i.type]=b,b},l.getInternalLoader=function(i){return this.loaders[i.type]},l.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},l.destroyInternalLoaders=function(){for(var i in this.loaders){var t=this.loaders[i];t&&t.destroy(),this.resetInternalLoader(i)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(i,t){var d=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:p.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},l.onLevelLoading=function(i,t){var d=t.id,v=t.level,y=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:null,level:v,responseType:"text",type:p.PlaylistContextType.LEVEL,url:y,deliveryDirectives:b})},l.onAudioTrackLoading=function(i,t){var d=t.id,v=t.groupId,y=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.AUDIO_TRACK,url:y,deliveryDirectives:b})},l.onSubtitleTrackLoading=function(i,t){var d=t.id,v=t.groupId,y=t.url,b=t.deliveryDirectives;this.load({id:d,groupId:v,level:null,responseType:"text",type:p.PlaylistContextType.SUBTITLE_TRACK,url:y,deliveryDirectives:b})},l.load=function(i){var t,d=this.hls.config,v=this.getInternalLoader(i);if(v){var y=v.context;if(y&&y.url===i.url){A.logger.trace("[playlist-loader]: playlist request ongoing");return}A.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),v.abort()}var b,g,m,_;switch(i.type){case p.PlaylistContextType.MANIFEST:b=d.manifestLoadingMaxRetry,g=d.manifestLoadingTimeOut,m=d.manifestLoadingRetryDelay,_=d.manifestLoadingMaxRetryTimeout;break;case p.PlaylistContextType.LEVEL:case p.PlaylistContextType.AUDIO_TRACK:case p.PlaylistContextType.SUBTITLE_TRACK:b=0,g=d.levelLoadingTimeOut;break;default:b=d.levelLoadingMaxRetry,g=d.levelLoadingTimeOut,m=d.levelLoadingRetryDelay,_=d.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(i),(t=i.deliveryDirectives)!==null&&t!==void 0&&t.part){var x;if(i.type===p.PlaylistContextType.LEVEL&&i.level!==null?x=this.hls.levels[i.level].details:i.type===p.PlaylistContextType.AUDIO_TRACK&&i.id!==null?x=this.hls.audioTracks[i.id].details:i.type===p.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(x=this.hls.subtitleTracks[i.id].details),x){var h=x.partTarget,E=x.targetduration;h&&E&&(g=Math.min(Math.max(h*3,E*.8)*1e3,g))}}var S={timeout:g,maxRetry:b,retryDelay:m,maxRetryDelay:_,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(i,S,w)},l.loadsuccess=function(i,t,d,v){if(v===void 0&&(v=null),d.isSidxRequest){this.handleSidxRequest(i,d),this.handlePlaylistLoaded(i,t,d,v);return}this.resetInternalLoader(d.type);var y=i.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,d,"no EXTM3U delimiter",v);return}t.parsing.start=performance.now(),y.indexOf("#EXTINF:")>0||y.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,t,d,v):this.handleMasterPlaylist(i,t,d,v)},l.loaderror=function(i,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!1,i)},l.loadtimeout=function(i,t,d){d===void 0&&(d=null),this.handleNetworkError(t,d,!0)},l.handleMasterPlaylist=function(i,t,d,v){var y=this.hls,b=i.data,g=n(i,d),m=f.default.parseMasterPlaylist(b,g),_=m.levels,x=m.sessionData;if(!_.length){this.handleManifestParsingError(i,d,"no level found in manifest",v);return}var h=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),E=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),S=f.default.parseMasterPlaylistMedia(b,g,"AUDIO",h),w=f.default.parseMasterPlaylistMedia(b,g,"SUBTITLES",E),R=f.default.parseMasterPlaylistMedia(b,g,"CLOSED-CAPTIONS");if(S.length){var N=S.some(function(F){return!F.url});!N&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(A.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))}y.trigger(D.Events.MANIFEST_LOADED,{levels:_,audioTracks:S,subtitles:w,captions:R,url:g,stats:t,networkDetails:v,sessionData:x})},l.handleTrackOrLevelPlaylist=function(i,t,d,v){var y=this.hls,b=d.id,g=d.level,m=d.type,_=n(i,d),x=Object(C.isFiniteNumber)(b)?b:0,h=Object(C.isFiniteNumber)(g)?g:x,E=s(d),S=f.default.parseLevelPlaylist(i.data,_,h,E,x);if(!S.fragments.length){y.trigger(D.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(m===p.PlaylistContextType.MANIFEST){var w={attrs:new c.AttrList({}),bitrate:0,details:S,name:"",url:_};y.trigger(D.Events.MANIFEST_LOADED,{levels:[w],audioTracks:[],url:_,stats:t,networkDetails:v,sessionData:null})}if(t.parsing.end=performance.now(),S.needSidxRanges){var R,N=(R=S.fragments[0].initSegment)===null||R===void 0?void 0:R.url;this.load({url:N,isSidxRequest:!0,type:m,level:g,levelDetails:S,id:b,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=S,this.handlePlaylistLoaded(i,t,d,v)},l.handleSidxRequest=function(i,t){var d=Object(O.parseSegmentIndex)(new Uint8Array(i.data));if(!d)return;var v=d.references,y=t.levelDetails;v.forEach(function(b,g){var m=b.info,_=y.fragments[g];_.byteRange.length===0&&_.setByteRange(String(1+m.end-m.start)+"@"+String(m.start)),_.initSegment&&_.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(i,t,d,v){this.hls.trigger(D.Events.ERROR,{type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===p.PlaylistContextType.MANIFEST,url:i.url,reason:d,response:i,context:t,networkDetails:v})},l.handleNetworkError=function(i,t,d,v){d===void 0&&(d=!1),A.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var y=T.ErrorDetails.UNKNOWN,b=!1,g=this.getInternalLoader(i);switch(i.type){case p.PlaylistContextType.MANIFEST:y=d?T.ErrorDetails.MANIFEST_LOAD_TIMEOUT:T.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case p.PlaylistContextType.LEVEL:y=d?T.ErrorDetails.LEVEL_LOAD_TIMEOUT:T.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.AUDIO_TRACK:y=d?T.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;case p.PlaylistContextType.SUBTITLE_TRACK:y=d?T.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:T.ErrorDetails.SUBTITLE_LOAD_ERROR,b=!1;break}g&&this.resetInternalLoader(i.type);var m={type:T.ErrorTypes.NETWORK_ERROR,details:y,fatal:b,url:i.url,loader:g,context:i,networkDetails:t};v&&(m.response=v),this.hls.trigger(D.Events.ERROR,m)},l.handlePlaylistLoaded=function(i,t,d,v){var y=d.type,b=d.level,g=d.id,m=d.groupId,_=d.loader,x=d.levelDetails,h=d.deliveryDirectives;if(!(x!=null&&x.targetduration)){this.handleManifestParsingError(i,d,"invalid target duration",v);return}if(!_)return;x.live&&(_.getCacheAge&&(x.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(x.ageHeader))&&(x.ageHeader=0));switch(y){case p.PlaylistContextType.MANIFEST:case p.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:x,level:b||0,id:g||0,stats:t,networkDetails:v,deliveryDirectives:h});break;case p.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:x,id:g||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:h});break;case p.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:x,id:g||0,groupId:m||"",stats:t,networkDetails:v,deliveryDirectives:h});break}},r}();ie.default=o},"./src/polyfills/number.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"isFiniteNumber",function(){return C}),W.d(ie,"MAX_SAFE_INTEGER",function(){return D});var C=Number.isFinite||function(T){return typeof T=="number"&&isFinite(T)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ce,ie,W){"use strict";W.r(ie);var C=function(){function D(){}return D.getSilentFrame=function(A,O){switch(A){case"mp4a.40.2":if(O===1)return new Uint8Array([0,200,0,128,35,128]);if(O===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(O===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(O===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(O===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(O===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(O===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(O===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(O===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},D}();ie.default=C},"./src/remux/mp4-generator.ts":function(ce,ie,W){"use strict";W.r(ie);var C=Math.pow(2,32)-1,D=function(){function T(){}return T.init=function(){T.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 O;for(O in T.types)T.types.hasOwnProperty(O)&&(T.types[O]=[O.charCodeAt(0),O.charCodeAt(1),O.charCodeAt(2),O.charCodeAt(3)]);var f=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),p=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);T.HDLR_TYPES={video:f,audio:p};var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);T.STTS=T.STSC=T.STCO=s,T.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),T.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),T.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),T.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var n=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);T.FTYP=T.box(T.types.ftyp,n,r,n,o),T.DINF=T.box(T.types.dinf,T.box(T.types.dref,c))},T.box=function(O){for(var f=8,p=arguments.length,c=new Array(p>1?p-1:0),s=1;s<p;s++)c[s-1]=arguments[s];for(var n=c.length,o=n;n--;)f+=c[n].byteLength;var r=new Uint8Array(f);for(r[0]=f>>24&255,r[1]=f>>16&255,r[2]=f>>8&255,r[3]=f&255,r.set(O,4),n=0,f=8;n<o;n++)r.set(c[n],f),f+=c[n].byteLength;return r},T.hdlr=function(O){return T.box(T.types.hdlr,T.HDLR_TYPES[O])},T.mdat=function(O){return T.box(T.types.mdat,O)},T.mdhd=function(O,f){f*=O;var p=Math.floor(f/(C+1)),c=Math.floor(f%(C+1));return T.box(T.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&255,85,196,0,0]))},T.mdia=function(O){return T.box(T.types.mdia,T.mdhd(O.timescale,O.duration),T.hdlr(O.type),T.minf(O))},T.mfhd=function(O){return T.box(T.types.mfhd,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255]))},T.minf=function(O){return O.type==="audio"?T.box(T.types.minf,T.box(T.types.smhd,T.SMHD),T.DINF,T.stbl(O)):T.box(T.types.minf,T.box(T.types.vmhd,T.VMHD),T.DINF,T.stbl(O))},T.moof=function(O,f,p){return T.box(T.types.moof,T.mfhd(O),T.traf(p,f))},T.moov=function(O){for(var f=O.length,p=[];f--;)p[f]=T.trak(O[f]);return T.box.apply(null,[T.types.moov,T.mvhd(O[0].timescale,O[0].duration)].concat(p).concat(T.mvex(O)))},T.mvex=function(O){for(var f=O.length,p=[];f--;)p[f]=T.trex(O[f]);return T.box.apply(null,[T.types.mvex].concat(p))},T.mvhd=function(O,f){f*=O;var p=Math.floor(f/(C+1)),c=Math.floor(f%(C+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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 T.box(T.types.mvhd,s)},T.sdtp=function(O){var f=O.samples||[],p=new Uint8Array(4+f.length),c,s;for(c=0;c<f.length;c++)s=f[c].flags,p[c+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return T.box(T.types.sdtp,p)},T.stbl=function(O){return T.box(T.types.stbl,T.stsd(O),T.box(T.types.stts,T.STTS),T.box(T.types.stsc,T.STSC),T.box(T.types.stsz,T.STSZ),T.box(T.types.stco,T.STCO))},T.avc1=function(O){var f=[],p=[],c,s,n;for(c=0;c<O.sps.length;c++)s=O.sps[c],n=s.byteLength,f.push(n>>>8&255),f.push(n&255),f=f.concat(Array.prototype.slice.call(s));for(c=0;c<O.pps.length;c++)s=O.pps[c],n=s.byteLength,p.push(n>>>8&255),p.push(n&255),p=p.concat(Array.prototype.slice.call(s));var o=T.box(T.types.avcC,new Uint8Array([1,f[3],f[4],f[5],252|3,224|O.sps.length].concat(f).concat([O.pps.length]).concat(p))),r=O.width,l=O.height,a=O.pixelRatio[0],i=O.pixelRatio[1];return T.box(T.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>8&255,r&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,T.box(T.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),T.box(T.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,i>>24,i>>16&255,i>>8&255,i&255])))},T.esds=function(O){var f=O.config.length;return new Uint8Array([0,0,0,0,3,23+f,0,1,0,4,15+f,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([f]).concat(O.config).concat([6,1,2]))},T.mp4a=function(O){var f=O.samplerate;return T.box(T.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,O.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]),T.box(T.types.esds,T.esds(O)))},T.mp3=function(O){var f=O.samplerate;return T.box(T.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,O.channelCount,0,16,0,0,0,0,f>>8&255,f&255,0,0]))},T.stsd=function(O){return O.type==="audio"?!O.isAAC&&O.codec==="mp3"?T.box(T.types.stsd,T.STSD,T.mp3(O)):T.box(T.types.stsd,T.STSD,T.mp4a(O)):T.box(T.types.stsd,T.STSD,T.avc1(O))},T.tkhd=function(O){var f=O.id,p=O.duration*O.timescale,c=O.width,s=O.height,n=Math.floor(p/(C+1)),o=Math.floor(p%(C+1));return T.box(T.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,f>>24&255,f>>16&255,f>>8&255,f&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&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,c>>8&255,c&255,0,0,s>>8&255,s&255,0,0]))},T.traf=function(O,f){var p=T.sdtp(O),c=O.id,s=Math.floor(f/(C+1)),n=Math.floor(f%(C+1));return T.box(T.types.traf,T.box(T.types.tfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255])),T.box(T.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,n>>24,n>>16&255,n>>8&255,n&255])),T.trun(O,p.length+16+20+8+16+8+8),p)},T.trak=function(O){return O.duration=O.duration||4294967295,T.box(T.types.trak,T.tkhd(O),T.mdia(O))},T.trex=function(O){var f=O.id;return T.box(T.types.trex,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},T.trun=function(O,f){var p=O.samples||[],c=p.length,s=12+16*c,n=new Uint8Array(s),o,r,l,a,i,t;for(f+=8+s,n.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,c&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255],0),o=0;o<c;o++)r=p[o],l=r.duration,a=r.size,i=r.flags,t=r.cts,n.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*o);return T.box(T.types.trun,n)},T.initSegment=function(O){T.types||T.init();var f=T.moov(O),p=new Uint8Array(T.FTYP.byteLength+f.byteLength);return p.set(T.FTYP),p.set(f,T.FTYP.byteLength),p},T}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,ie.default=D},"./src/remux/mp4-remuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return t}),W.d(ie,"normalizePts",function(){return d});var C=W("./src/polyfills/number.ts"),D=W("./src/remux/aac-helper.ts"),T=W("./src/remux/mp4-generator.ts"),A=W("./src/events.ts"),O=W("./src/errors.ts"),f=W("./src/utils/logger.ts"),p=W("./src/types/loader.ts"),c=W("./src/utils/timescale-conversion.ts");function s(){return s=Object.assign||function(g){for(var m=1;m<arguments.length;m++){var _=arguments[m];for(var x in _)Object.prototype.hasOwnProperty.call(_,x)&&(g[x]=_[x])}return g},s.apply(this,arguments)}var n=10*1e3,o=1024,r=1152,l=null,a=null,i=!1,t=function(){function g(_,x,h,E){if(E===void 0&&(E=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=_,this.config=x,this.typeSupported=h,this.ISGenerated=!1,l===null){var S=navigator.userAgent||"",w=S.match(/Chrome\/(\d+)/i);l=w?parseInt(w[1]):0}if(a===null){var R=navigator.userAgent.match(/Safari\/(\d+)/i);a=R?parseInt(R[1]):0}i=!!l&&l<75||!!a&&a<600}var m=g.prototype;return m.destroy=function(){},m.resetTimeStamp=function(x){f.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=x},m.resetNextTimestamp=function(){f.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},m.resetInitSegment=function(){f.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},m.getVideoStartPts=function(x){var h=!1,E=x.reduce(function(S,w){var R=w.pts-S;return R<-4294967296?(h=!0,d(S,w.pts)):R>0?S:w.pts},x[0].pts);return h&&f.logger.debug("PTS rollover detected"),E},m.remux=function(x,h,E,S,w,R,N,F){var z,q,B,M,G,J,K=w,Z=w,le=x.pid>-1,de=h.pid>-1,Te=h.samples.length,we=x.samples.length>0,Ie=Te>1,_e=(!le||we)&&(!de||Ie)||this.ISGenerated||N;if(_e){this.ISGenerated||(B=this.generateIS(x,h,w));var ye=this.isVideoContiguous,Ke=-1;if(Ie&&(Ke=v(h.samples),!ye&&this.config.forceKeyFrameOnDiscontinuity))if(J=!0,Ke>0){f.logger.warn("[mp4-remuxer]: Dropped "+Ke+" out of "+Te+" video samples due to a missing keyframe");var Me=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(Ke),h.dropped+=Ke,Z+=(h.samples[0].pts-Me)/(h.timescale||9e4)}else Ke===-1&&(f.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),J=!1);if(this.ISGenerated){if(we&&Ie){var Fe=this.getVideoStartPts(h.samples),Ge=d(x.samples[0].pts,Fe)-Fe,Ee=Ge/h.inputTimeScale;K+=Math.max(0,Ee),Z+=Math.max(0,-Ee)}if(we){if(x.samplerate||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(x,h,w)),q=this.remuxAudio(x,K,this.isAudioContiguous,R,de||Ie||F===p.PlaylistLevelType.AUDIO?Z:void 0),Ie){var me=q?q.endPTS-q.startPTS:0;h.inputTimeScale||(f.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(x,h,w)),z=this.remuxVideo(h,Z,ye,me)}}else Ie&&(z=this.remuxVideo(h,Z,ye,0));z&&(z.firstKeyFrame=Ke,z.independent=Ke!==-1)}}return this.ISGenerated&&(E.samples.length&&(G=this.remuxID3(E,w)),S.samples.length&&(M=this.remuxText(S,w))),{audio:q,video:z,initSegment:B,independent:J,text:M,id3:G}},m.generateIS=function(x,h,E){var S=x.samples,w=h.samples,R=this.typeSupported,N={},F=!Object(C.isFiniteNumber)(this._initPTS),z="audio/mp4",q,B,M;if(F&&(q=B=Infinity),x.config&&S.length&&(x.timescale=x.samplerate,x.isAAC||(R.mpeg?(z="audio/mpeg",x.codec=""):R.mp3&&(x.codec="mp3")),N.audio={id:"audio",container:z,codec:x.codec,initSegment:!x.isAAC&&R.mpeg?new Uint8Array(0):T.default.initSegment([x]),metadata:{channelCount:x.channelCount}},F&&(M=x.inputTimeScale,q=B=S[0].pts-Math.round(M*E))),h.sps&&h.pps&&w.length&&(h.timescale=h.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:T.default.initSegment([h]),metadata:{width:h.width,height:h.height}},F)){M=h.inputTimeScale;var G=this.getVideoStartPts(w),J=Math.round(M*E);B=Math.min(B,d(w[0].dts,G)-J),q=Math.min(q,G-J)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=q,this._initDTS=B),{tracks:N,initPTS:q,timescale:M}},m.remuxVideo=function(x,h,E,S){var w=x.inputTimeScale,R=x.samples,N=[],F=R.length,z=this._initPTS,q=this.nextAvcDts,B=8,M,G,J,K=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,le=0,de=!1;if(!E||q===null){var Te=h*w,we=R[0].pts-d(R[0].dts,R[0].pts);q=Te-we}for(var Ie=0;Ie<F;Ie++){var _e=R[Ie];if(_e.pts=d(_e.pts-z,q),_e.dts=d(_e.dts-z,q),_e.dts>_e.pts){var ye=9e4*.2;le=Math.max(Math.min(le,_e.pts-_e.dts),-1*ye)}_e.dts<R[Ie>0?Ie-1:Ie].dts&&(de=!0)}de&&R.sort(function(At,pt){var gt=At.dts-pt.dts,rt=At.pts-pt.pts;return gt||rt}),G=R[0].dts,J=R[R.length-1].dts;var Ke=Math.round((J-G)/(F-1));if(le<0){if(le<Ke*-2){f.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.toMsFromMpegTsClock)(-Ke,!0)+" ms");for(var Me=le,Fe=0;Fe<F;Fe++)R[Fe].dts=Me=Math.max(Me,R[Fe].pts-Ke),R[Fe].pts=Math.max(Me,R[Fe].pts)}else{f.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(c.toMsFromMpegTsClock)(le,!0)+" ms to overcome this issue");for(var Ge=0;Ge<F;Ge++)R[Ge].dts=R[Ge].dts+le}G=R[0].dts}if(E){var Ee=G-q,me=Ee>Ke,We=Ee<-1;if(me||We){me?f.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(Ee,!0)+" ms ("+Ee+"dts) hole between fragments detected, filling it"):f.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-Ee,!0)+" ms ("+Ee+"dts) overlapping between fragments detected"),G=q;var He=R[0].pts-Ee;R[0].dts=G,R[0].pts=He,f.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(He,!0)+"/"+Object(c.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(Ee,!0)+" ms")}}i&&(G=Math.max(0,G));for(var it=0,re=0,P=0;P<F;P++){for(var j=R[P],ee=j.units,$=ee.length,Q=0,xe=0;xe<$;xe++)Q+=ee[xe].data.length;re+=Q,it+=$,j.length=Q,j.dts=Math.max(j.dts,G),j.pts=Math.max(j.pts,j.dts,0),K=Math.min(j.pts,K),Z=Math.max(j.pts,Z)}J=R[F-1].dts;var De=re+4*it+8,dt;try{dt=new Uint8Array(De)}catch(At){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:O.ErrorTypes.MUX_ERROR,details:O.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:De,reason:"fail allocating video mdat "+De});return}var Ne=new DataView(dt.buffer);Ne.setUint32(0,De),dt.set(T.default.types.mdat,4);for(var Be=0;Be<F;Be++){for(var tt=R[Be],lt=tt.units,qe=0,Ye=0,je=lt.length;Ye<je;Ye++){var Ue=lt[Ye],ke=Ue.data,be=Ue.data.byteLength;Ne.setUint32(B,be),B+=4,dt.set(ke,B),B+=be,qe+=4+be}if(Be<F-1)M=R[Be+1].dts-tt.dts;else{var Ce=this.config,Pe=tt.dts-R[Be>0?Be-1:Be].dts;if(Ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Le=Math.floor(Ce.maxBufferHole*w),Ve=(S?K+S*w:this.nextAudioPts)-tt.pts;Ve>Le?(M=Ve-Pe,M<0&&(M=Pe),f.logger.log("[mp4-remuxer]: It is approximately "+Ve/90+" ms to the next segment; using duration "+M/90+" ms for the last video frame.")):M=Pe}else M=Pe}var at=Math.round(tt.pts-tt.dts);N.push(new y(tt.key,M,qe,at))}if(N.length&&l&&l<70){var _t=N[0].flags;_t.dependsOn=2,_t.isNonSync=0}console.assert(M!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=q=J+M,this.isVideoContiguous=!0;var kt=T.default.moof(x.sequenceNumber++,G,s({},x,{samples:N})),Bt="video",jt={data1:kt,data2:dt,startPTS:K/w,endPTS:(Z+M)/w,startDTS:G/w,endDTS:q/w,type:Bt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:x.dropped};return x.samples=[],x.dropped=0,console.assert(dt.length,"MDAT length must not be zero"),jt},m.remuxAudio=function(x,h,E,S,w){var R=x.inputTimeScale,N=x.samplerate?x.samplerate:R,F=R/N,z=x.isAAC?o:r,q=z*F,B=this._initPTS,M=!x.isAAC&&this.typeSupported.mpeg,G=[],J=x.samples,K=M?0:8,Z=this.nextAudioPts||-1,le=h*R;if(this.isAudioContiguous=E=E||J.length&&Z>0&&(S&&Math.abs(le-Z)<9e3||Math.abs(d(J[0].pts-B,le)-Z)<20*q),J.forEach(function(ke){ke.pts=d(ke.pts-B,le)}),!E||Z<0){if(J=J.filter(function(ke){return ke.pts>=0}),!J.length)return;w===0?Z=0:S?Z=Math.max(0,le):Z=J[0].pts}if(x.isAAC)for(var de=w!==void 0,Te=this.config.maxAudioFramesDrift,we=0,Ie=Z;we<J.length;we++){var _e=J[we],ye=_e.pts,Ke=ye-Ie,Me=Math.abs(1e3*Ke/R);if(Ke<=-Te*q&&de)we===0&&(f.logger.warn("Audio frame @ "+(ye/R).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ke/R)+" ms."),this.nextAudioPts=Z=Ie=ye);else if(Ke>=Te*q&&Me<n&&de){var Fe=Math.round(Ke/q);Ie=ye-Fe*q,Ie<0&&(Fe--,Ie+=q),we===0&&(this.nextAudioPts=Z=Ie),f.logger.warn("[mp4-remuxer]: Injecting "+Fe+" audio frame @ "+(Ie/R).toFixed(3)+"s due to "+Math.round(1e3*Ke/R)+" ms gap.");for(var Ge=0;Ge<Fe;Ge++){var Ee=Math.max(Ie,0),me=D.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);me||(f.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),me=_e.unit.subarray()),J.splice(we,0,{unit:me,pts:Ee}),Ie+=q,we++}}_e.pts=Ie,Ie+=q}for(var We=null,He=null,it,re=0,P=J.length;P--;)re+=J[P].unit.byteLength;for(var j=0,ee=J.length;j<ee;j++){var $=J[j],Q=$.unit,xe=$.pts;if(He!==null){var De=G[j-1];De.duration=Math.round((xe-He)/F)}else if(E&&x.isAAC&&(xe=Z),We=xe,re>0){re+=K;try{it=new Uint8Array(re)}catch(ke){this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:O.ErrorTypes.MUX_ERROR,details:O.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:re,reason:"fail allocating audio mdat "+re});return}if(!M){var dt=new DataView(it.buffer);dt.setUint32(0,re),it.set(T.default.types.mdat,4)}}else return;it.set(Q,K);var Ne=Q.byteLength;K+=Ne,G.push(new y(!0,z,Ne,0)),He=xe}var Be=G.length;if(!Be)return;var tt=G[G.length-1];this.nextAudioPts=Z=He+F*tt.duration;var lt=M?new Uint8Array(0):T.default.moof(x.sequenceNumber++,We/F,s({},x,{samples:G}));x.samples=[];var qe=We/R,Ye=Z/R,je="audio",Ue={data1:lt,data2:it,startPTS:qe,endPTS:Ye,startDTS:qe,endDTS:Ye,type:je,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(it.length,"MDAT length must not be zero"),Ue},m.remuxEmptyAudio=function(x,h,E,S){var w=x.inputTimeScale,R=x.samplerate?x.samplerate:w,N=w/R,F=this.nextAudioPts,z=(F!==null?F:S.startDTS*w)+this._initDTS,q=S.endDTS*w+this._initDTS,B=N*o,M=Math.ceil((q-z)/B),G=D.default.getSilentFrame(x.manifestCodec||x.codec,x.channelCount);if(f.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){f.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var J=[],K=0;K<M;K++){var Z=z+K*B;J.push({unit:G,pts:Z,dts:Z})}return x.samples=J,this.remuxAudio(x,h,E,!1)},m.remuxID3=function(x,h){var E=x.samples.length;if(!E)return;for(var S=x.inputTimeScale,w=this._initPTS,R=this._initDTS,N=0;N<E;N++){var F=x.samples[N];F.pts=d(F.pts-w,h*S)/S,F.dts=d(F.dts-R,h*S)/S}var z=x.samples;return x.samples=[],{samples:z}},m.remuxText=function(x,h){var E=x.samples.length;if(!E)return;for(var S=x.inputTimeScale,w=this._initPTS,R=0;R<E;R++){var N=x.samples[R];N.pts=d(N.pts-w,h*S)/S}x.samples.sort(function(z,q){return z.pts-q.pts});var F=x.samples;return x.samples=[],{samples:F}},g}();function d(g,m){var _;if(m===null)return g;for(m<g?_=-8589934592:_=8589934592;Math.abs(g-m)>4294967296;)g+=_;return g}function v(g){for(var m=0;m<g.length;m++)if(g[m].key)return m;return-1}var y=function(m,_,x,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=x,this.cts=h,this.flags=new b(m)},b=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(ce,ie,W){"use strict";W.r(ie);var C=W("./src/polyfills/number.ts"),D=W("./src/utils/mp4-tools.ts"),T=W("./src/loader/fragment.ts"),A=W("./src/utils/logger.ts"),O=function(){function c(){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 s=c.prototype;return s.destroy=function(){},s.resetTimeStamp=function(o){this.initPTS=o,this.lastEndDTS=null},s.resetNextTimestamp=function(){this.lastEndDTS=null},s.resetInitSegment=function(o,r,l){this.audioCodec=r,this.videoCodec=l,this.generateInitSegment(o),this.emitInitSegment=!0},s.generateInitSegment=function(o){var r=this.audioCodec,l=this.videoCodec;if(!o||!o.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(D.parseInitSegment)(o);r||(r=p(a.audio,T.ElementaryStreamTypes.AUDIO)),l||(l=p(a.video,T.ElementaryStreamTypes.VIDEO));var i={};a.audio&&a.video?i.audiovideo={container:"video/mp4",codec:r+","+l,initSegment:o,id:"main"}:a.audio?i.audio={container:"audio/mp4",codec:r,initSegment:o,id:"audio"}:a.video?i.video={container:"video/mp4",codec:l,initSegment:o,id:"main"}:A.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},s.remux=function(o,r,l,a,i){var t=this.initPTS,d=this.lastEndDTS,v={audio:void 0,video:void 0,text:a,id3:l,initSegment:void 0};Object(C.isFiniteNumber)(d)||(d=this.lastEndDTS=i||0);var y=r.samples;if(!y||!y.length)return v;var b={initPTS:void 0,timescale:1},g=this.initData;if((!g||!g.length)&&(this.generateInitSegment(y),g=this.initData),!g||!g.length)return A.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1),Object(C.isFiniteNumber)(t)||(this.initPTS=b.initPTS=t=f(g,y,d));var m=Object(D.getDuration)(y,g),_=d,x=m+_;Object(D.offsetStartDTS)(g,y,t),m>0?this.lastEndDTS=x:(A.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!g.audio,E=!!g.video,S="";h&&(S+="audio"),E&&(S+="video");var w={data1:y,startPTS:_,startDTS:_,endPTS:x,endDTS:x,type:S,hasAudio:h,hasVideo:E,nb:1,dropped:0};return v.audio=w.type==="audio"?w:void 0,v.video=w.type!=="audio"?w:void 0,v.text=a,v.id3=l,v.initSegment=b,v},c}(),f=function(s,n,o){return Object(D.getStartDTS)(s,n)-o};function p(c,s){var n=c==null?void 0:c.codec;return n&&n.length>4?n:n==="hvc1"?"hvc1.1.c.L120.90":n==="av01"?"av01.0.04M.08":n==="avc1"||s===T.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}ie.default=O},"./src/task-loop.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return C});var C=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var T=D.prototype;return T.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},T.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},T.onHandlerDestroyed=function(){},T.hasInterval=function(){return!!this._tickInterval},T.hasNextTick=function(){return!!this._tickTimer},T.setInterval=function(O){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,O),!0)},T.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},T.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},T.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},T.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},T.doTick=function(){},D}()},"./src/types/cmcd.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"CMCDVersion",function(){return C}),W.d(ie,"CMCDObjectType",function(){return D}),W.d(ie,"CMCDStreamingFormat",function(){return T}),W.d(ie,"CMCDStreamType",function(){return A});var C=1,D;(function(O){O.MANIFEST="m",O.AUDIO="a",O.VIDEO="v",O.MUXED="av",O.INIT="i",O.CAPTION="c",O.TIMED_TEXT="tt",O.KEY="k",O.OTHER="o"})(D||(D={}));var T;(function(O){O.DASH="d",O.HLS="h",O.SMOOTH="s",O.OTHER="o"})(T||(T={}));var A;(function(O){O.VOD="v",O.LIVE="l"})(A||(A={}))},"./src/types/level.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"HlsSkip",function(){return T}),W.d(ie,"getSkipValue",function(){return A}),W.d(ie,"HlsUrlParameters",function(){return O}),W.d(ie,"Level",function(){return f});function C(p,c){for(var s=0;s<c.length;s++){var n=c[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}function D(p,c,s){return c&&C(p.prototype,c),s&&C(p,s),p}var T;(function(p){p.No="",p.Yes="YES",p.v2="v2"})(T||(T={}));function A(p,c){var s=p.canSkipUntil,n=p.canSkipDateRanges,o=p.endSN,r=c!==void 0?c-o:0;return s&&r<s?n?T.v2:T.Yes:T.No}var O=function(){function p(s,n,o){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=s,this.part=n,this.skip=o}var c=p.prototype;return c.addDirectives=function(n){var o=new self.URL(n);return this.msn!==void 0&&o.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&o.searchParams.set("_HLS_part",this.part.toString()),this.skip&&o.searchParams.set("_HLS_skip",this.skip),o.toString()},p}(),f=function(){function p(c){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[c.url],this.attrs=c.attrs,this.bitrate=c.bitrate,c.details&&(this.details=c.details),this.id=c.id||0,this.name=c.name,this.width=c.width||0,this.height=c.height||0,this.audioCodec=c.audioCodec,this.videoCodec=c.videoCodec,this.unknownCodecs=c.unknownCodecs,this.codecSet=[c.videoCodec,c.audioCodec].filter(function(s){return s}).join(",").replace(/\.[^.,]+/g,"")}return D(p,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(s){var n=s%this.url.length;this._urlId!==n&&(this.details=void 0,this._urlId=n)}}]),p}()},"./src/types/loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"PlaylistContextType",function(){return C}),W.d(ie,"PlaylistLevelType",function(){return D});var C;(function(T){T.MANIFEST="manifest",T.LEVEL="level",T.AUDIO_TRACK="audioTrack",T.SUBTITLE_TRACK="subtitleTrack"})(C||(C={}));var D;(function(T){T.MAIN="main",T.AUDIO="audio",T.SUBTITLE="subtitle"})(D||(D={}))},"./src/types/transmuxer.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"ChunkMetadata",function(){return C});var C=function(A,O,f,p,c,s){p===void 0&&(p=0),c===void 0&&(c=-1),s===void 0&&(s=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=D(),this.buffering={audio:D(),video:D(),audiovideo:D()},this.level=A,this.sn=O,this.id=f,this.size=p,this.part=c,this.partial=s};function D(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"AttrList",function(){return T});var C=/^(\d+)x(\d+)$/,D=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,T=function(){function A(f){typeof f=="string"&&(f=A.parseAttrList(f));for(var p in f)f.hasOwnProperty(p)&&(this[p]=f[p])}var O=A.prototype;return O.decimalInteger=function(p){var c=parseInt(this[p],10);return c>Number.MAX_SAFE_INTEGER?Infinity:c},O.hexadecimalInteger=function(p){if(this[p]){var c=(this[p]||"0x").slice(2);c=(c.length&1?"0":"")+c;for(var s=new Uint8Array(c.length/2),n=0;n<c.length/2;n++)s[n]=parseInt(c.slice(n*2,n*2+2),16);return s}else return null},O.hexadecimalIntegerAsNumber=function(p){var c=parseInt(this[p],16);return c>Number.MAX_SAFE_INTEGER?Infinity:c},O.decimalFloatingPoint=function(p){return parseFloat(this[p])},O.optionalFloat=function(p,c){var s=this[p];return s?parseFloat(s):c},O.enumeratedString=function(p){return this[p]},O.bool=function(p){return this[p]==="YES"},O.decimalResolution=function(p){var c=C.exec(this[p]);return c===null?void 0:{width:parseInt(c[1],10),height:parseInt(c[2],10)}},A.parseAttrList=function(p){var c,s={},n='"';for(D.lastIndex=0;(c=D.exec(p))!==null;){var o=c[2];o.indexOf(n)===0&&o.lastIndexOf(n)===o.length-1&&(o=o.slice(1,-1)),s[c[1]]=o}return s},A}()},"./src/utils/binary-search.ts":function(ce,ie,W){"use strict";W.r(ie);var C={search:function(T,A){for(var O=0,f=T.length-1,p=null,c=null;O<=f;){p=(O+f)/2|0,c=T[p];var s=A(c);if(s>0)O=p+1;else if(s<0)f=p-1;else return c}return null}};ie.default=C},"./src/utils/buffer-helper.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"BufferHelper",function(){return T});var C=W("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},T=function(){function A(){}return A.isBuffered=function(f,p){try{if(f){for(var c=A.getBuffered(f),s=0;s<c.length;s++)if(p>=c.start(s)&&p<=c.end(s))return!0}}catch(n){}return!1},A.bufferInfo=function(f,p,c){try{if(f){var s=A.getBuffered(f),n=[],o;for(o=0;o<s.length;o++)n.push({start:s.start(o),end:s.end(o)});return this.bufferedInfo(n,p,c)}}catch(r){}return{len:0,start:p,end:p,nextStart:void 0}},A.bufferedInfo=function(f,p,c){p=Math.max(0,p),f.sort(function(b,g){var m=b.start-g.start;return m||g.end-b.end});var s=[];if(c)for(var n=0;n<f.length;n++){var o=s.length;if(o){var r=s[o-1].end;f[n].start-r<c?f[n].end>r&&(s[o-1].end=f[n].end):s.push(f[n])}else s.push(f[n])}else s=f;for(var l=0,a,i=p,t=p,d=0;d<s.length;d++){var v=s[d].start,y=s[d].end;if(p+c>=v&&p<y)i=v,t=y,l=t-p;else if(p+c<v){a=v;break}}return{len:l,start:i||0,end:t||0,nextStart:a}},A.getBuffered=function(f){try{return f.buffered}catch(p){return C.logger.log("failed to get media.buffered",p),D}},A}()},"./src/utils/cea-608-parser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"Row",function(){return t}),W.d(ie,"CaptionScreen",function(){return d});var C=W("./src/utils/logger.ts"),D={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},T=function(x){var h=x;return D.hasOwnProperty(x)&&(h=D[x]),String.fromCharCode(h)},A=15,O=100,f={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},p={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},s={25:2,26:4,29:6,30:8,31:10,27:13,28:15},n=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],o;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(o||(o={}));var r=function(){function _(){this.time=null,this.verboseLevel=o.ERROR}var x=_.prototype;return x.log=function(E,S){this.verboseLevel>=E&&C.logger.log(this.time+" ["+E+"] "+S)},_}(),l=function(x){for(var h=[],E=0;E<x.length;E++)h.push(x[E].toString(16));return h},a=function(){function _(h,E,S,w,R){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=E||!1,this.italics=S||!1,this.background=w||"black",this.flash=R||!1}var x=_.prototype;return x.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},x.setStyles=function(E){for(var S=["foreground","underline","italics","background","flash"],w=0;w<S.length;w++){var R=S[w];E.hasOwnProperty(R)&&(this[R]=E[R])}},x.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},x.equals=function(E){return this.foreground===E.foreground&&this.underline===E.underline&&this.italics===E.italics&&this.background===E.background&&this.flash===E.flash},x.copy=function(E){this.foreground=E.foreground,this.underline=E.underline,this.italics=E.italics,this.background=E.background,this.flash=E.flash},x.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),i=function(){function _(h,E,S,w,R,N){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new a(E,S,w,R,N)}var x=_.prototype;return x.reset=function(){this.uchar=" ",this.penState.reset()},x.setChar=function(E,S){this.uchar=E,this.penState.copy(S)},x.setPenState=function(E){this.penState.copy(E)},x.equals=function(E){return this.uchar===E.uchar&&this.penState.equals(E.penState)},x.copy=function(E){this.uchar=E.uchar,this.penState.copy(E.penState)},x.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),t=function(){function _(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var E=0;E<O;E++)this.chars.push(new i);this.logger=h,this.pos=0,this.currPenState=new a}var x=_.prototype;return x.equals=function(E){for(var S=!0,w=0;w<O;w++)if(!this.chars[w].equals(E.chars[w])){S=!1;break}return S},x.copy=function(E){for(var S=0;S<O;S++)this.chars[S].copy(E.chars[S])},x.isEmpty=function(){for(var E=!0,S=0;S<O;S++)if(!this.chars[S].isEmpty()){E=!1;break}return E},x.setCursor=function(E){this.pos!==E&&(this.pos=E),this.pos<0?(this.logger.log(o.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>O&&(this.logger.log(o.DEBUG,"Too large cursor position "+this.pos),this.pos=O)},x.moveCursor=function(E){var S=this.pos+E;if(E>1)for(var w=this.pos+1;w<S+1;w++)this.chars[w].setPenState(this.currPenState);this.setCursor(S)},x.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},x.insertChar=function(E){E>=144&&this.backSpace();var S=T(E);if(this.pos>=O){this.logger.log(o.ERROR,"Cannot insert "+E.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},x.clearFromPos=function(E){var S;for(S=E;S<O;S++)this.chars[S].reset()},x.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},x.clearToEndOfRow=function(){this.clearFromPos(this.pos)},x.getTextString=function(){for(var E=[],S=!0,w=0;w<O;w++){var R=this.chars[w].uchar;R!==" "&&(S=!1),E.push(R)}return S?"":E.join("")},x.setPenStyles=function(E){this.currPenState.setStyles(E);var S=this.chars[this.pos];S.setPenState(this.currPenState)},_}(),d=function(){function _(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var E=0;E<A;E++)this.rows.push(new t(h));this.logger=h,this.currRow=A-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var x=_.prototype;return x.reset=function(){for(var E=0;E<A;E++)this.rows[E].clear();this.currRow=A-1},x.equals=function(E){for(var S=!0,w=0;w<A;w++)if(!this.rows[w].equals(E.rows[w])){S=!1;break}return S},x.copy=function(E){for(var S=0;S<A;S++)this.rows[S].copy(E.rows[S])},x.isEmpty=function(){for(var E=!0,S=0;S<A;S++)if(!this.rows[S].isEmpty()){E=!1;break}return E},x.backSpace=function(){var E=this.rows[this.currRow];E.backSpace()},x.clearToEndOfRow=function(){var E=this.rows[this.currRow];E.clearToEndOfRow()},x.insertChar=function(E){var S=this.rows[this.currRow];S.insertChar(E)},x.setPen=function(E){var S=this.rows[this.currRow];S.setPenStyles(E)},x.moveCursor=function(E){var S=this.rows[this.currRow];S.moveCursor(E)},x.setCursor=function(E){this.logger.log(o.INFO,"setCursor: "+E);var S=this.rows[this.currRow];S.setCursor(E)},x.setPAC=function(E){this.logger.log(o.INFO,"pacData = "+JSON.stringify(E));var S=E.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var w=0;w<A;w++)this.rows[w].clear();var R=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var F=N.rows[R].cueStartTime,z=this.logger.time;if(F&&z!==null&&F<z)for(var q=0;q<this.nrRollUpRows;q++)this.rows[S-this.nrRollUpRows+q+1].copy(N.rows[R+q])}}this.currRow=S;var B=this.rows[this.currRow];if(E.indent!==null){var M=E.indent,G=Math.max(M-1,0);B.setCursor(E.indent),E.color=B.chars[G].penState.foreground}var J={foreground:E.color,underline:E.underline,italics:E.italics,background:"black",flash:!1};this.setPen(J)},x.setBkgData=function(E){this.logger.log(o.INFO,"bkgData = "+JSON.stringify(E)),this.backSpace(),this.setPen(E),this.insertChar(32)},x.setRollUpRows=function(E){this.nrRollUpRows=E},x.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(o.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(o.TEXT,this.getDisplayText());var E=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(E,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(o.INFO,"Rolling up")},x.getDisplayText=function(E){E=E||!1;for(var S=[],w="",R=-1,N=0;N<A;N++){var F=this.rows[N].getTextString();F&&(R=N+1,E?S.push("Row "+R+": '"+F+"'"):S.push(F.trim()))}return S.length>0&&(E?w="["+S.join(" | ")+"]":w=S.join(`
|
|
|
`)),w},x.getTextAndFormat=function(){return this.rows},_}(),v=function(){function _(h,E,S){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=h,this.outputFilter=E,this.mode=null,this.verbose=0,this.displayedMemory=new d(S),this.nonDisplayedMemory=new d(S),this.lastOutputScreen=new d(S),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var x=_.prototype;return x.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[A-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},x.getHandler=function(){return this.outputFilter},x.setHandler=function(E){this.outputFilter=E},x.setPAC=function(E){this.writeScreen.setPAC(E)},x.setBkgData=function(E){this.writeScreen.setBkgData(E)},x.setMode=function(E){if(E===this.mode)return;this.mode=E,this.logger.log(o.INFO,"MODE="+E),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=E},x.insertChars=function(E){for(var S=0;S<E.length;S++)this.writeScreen.insertChar(E[S]);var w=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(o.INFO,w+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(o.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},x.ccRCL=function(){this.logger.log(o.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},x.ccBS=function(){if(this.logger.log(o.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},x.ccAOF=function(){},x.ccAON=function(){},x.ccDER=function(){this.logger.log(o.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},x.ccRU=function(E){this.logger.log(o.INFO,"RU("+E+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(E)},x.ccFON=function(){this.logger.log(o.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},x.ccRDC=function(){this.logger.log(o.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},x.ccTR=function(){this.logger.log(o.INFO,"TR"),this.setMode("MODE_TEXT")},x.ccRTD=function(){this.logger.log(o.INFO,"RTD"),this.setMode("MODE_TEXT")},x.ccEDM=function(){this.logger.log(o.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},x.ccCR=function(){this.logger.log(o.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},x.ccENM=function(){this.logger.log(o.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},x.ccEOC=function(){if(this.logger.log(o.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var E=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=E,this.writeScreen=this.nonDisplayedMemory,this.logger.log(o.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},x.ccTO=function(E){this.logger.log(o.INFO,"TO("+E+") - Tab Offset"),this.writeScreen.moveCursor(E)},x.ccMIDROW=function(E){var S={flash:!1};if(S.underline=E%2===1,S.italics=E>=46,S.italics)S.foreground="white";else{var w=Math.floor(E/2)-16,R=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=R[w]}this.logger.log(o.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},x.outputDataUpdate=function(E){E===void 0&&(E=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),E&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},x.cueSplitAtTime=function(E){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,E,this.displayedMemory),this.cueStartTime=E))},_}(),y=function(){function _(h,E,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var w=new r;this.channels=[null,new v(h,E,w),new v(h+1,S,w)],this.cmdHistory=m(),this.logger=w}var x=_.prototype;return x.getHandler=function(E){return this.channels[E].getHandler()},x.setHandler=function(E,S){this.channels[E].setHandler(S)},x.addData=function(E,S){var w,R,N,F=!1;this.logger.time=E;for(var z=0;z<S.length;z+=2){if(R=S[z]&127,N=S[z+1]&127,R===0&&N===0)continue;if(this.logger.log(o.DATA,"["+l([S[z],S[z+1]])+"] -> ("+l([R,N])+")"),w=this.parseCmd(R,N),w||(w=this.parseMidrow(R,N)),w||(w=this.parsePAC(R,N)),w||(w=this.parseBackgroundAttributes(R,N)),!w&&(F=this.parseChars(R,N),F)){var q=this.currentChannel;if(q&&q>0){var B=this.channels[q];B.insertChars(F)}else this.logger.log(o.WARNING,"No channel found yet. TEXT-MODE?")}!w&&!F&&this.logger.log(o.WARNING,"Couldn't parse cleaned data "+l([R,N])+" orig: "+l([S[z],S[z+1]]))}},x.parseCmd=function(E,S){var w=this.cmdHistory,R=(E===20||E===28||E===21||E===29)&&S>=32&&S<=47,N=(E===23||E===31)&&S>=33&&S<=35;if(!(R||N))return!1;if(g(E,S,w))return b(null,null,w),this.logger.log(o.DEBUG,"Repeated command ("+l([E,S])+") is dropped"),!0;var F=E===20||E===21||E===23?1:2,z=this.channels[F];return E===20||E===21||E===28||E===29?S===32?z.ccRCL():S===33?z.ccBS():S===34?z.ccAOF():S===35?z.ccAON():S===36?z.ccDER():S===37?z.ccRU(2):S===38?z.ccRU(3):S===39?z.ccRU(4):S===40?z.ccFON():S===41?z.ccRDC():S===42?z.ccTR():S===43?z.ccRTD():S===44?z.ccEDM():S===45?z.ccCR():S===46?z.ccENM():S===47&&z.ccEOC():z.ccTO(S-32),b(E,S,w),this.currentChannel=F,!0},x.parseMidrow=function(E,S){var w=0;if((E===17||E===25)&&S>=32&&S<=47){if(E===17?w=1:w=2,w!==this.currentChannel)return this.logger.log(o.ERROR,"Mismatch channel in midrow parsing"),!1;var R=this.channels[w];return R?(R.ccMIDROW(S),this.logger.log(o.DEBUG,"MIDROW ("+l([E,S])+")"),!0):!1}return!1},x.parsePAC=function(E,S){var w,R=this.cmdHistory,N=(E>=17&&E<=23||E>=25&&E<=31)&&S>=64&&S<=127,F=(E===16||E===24)&&S>=64&&S<=95;if(!(N||F))return!1;if(g(E,S,R))return b(null,null,R),!0;var z=E<=23?1:2;S>=64&&S<=95?w=z===1?f[E]:c[E]:w=z===1?p[E]:s[E];var q=this.channels[z];return q?(q.setPAC(this.interpretPAC(w,S)),b(E,S,R),this.currentChannel=z,!0):!1},x.interpretPAC=function(E,S){var w,R={color:null,italics:!1,indent:null,underline:!1,row:E};return S>95?w=S-96:w=S-64,R.underline=(w&1)===1,w<=13?R.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(w/2)]:w<=15?(R.italics=!0,R.color="white"):R.indent=Math.floor((w-16)/2)*4,R},x.parseChars=function(E,S){var w,R=null,N=null;if(E>=25?(w=2,N=E-8):(w=1,N=E),N>=17&&N<=19){var F;N===17?F=S+80:N===18?F=S+112:F=S+144,this.logger.log(o.INFO,"Special char '"+T(F)+"' in channel "+w),R=[F]}else E>=32&&E<=127&&(R=S===0?[E]:[E,S]);if(R){var z=l(R);this.logger.log(o.DEBUG,"Char codes = "+z.join(",")),b(E,S,this.cmdHistory)}return R},x.parseBackgroundAttributes=function(E,S){var w=(E===16||E===24)&&S>=32&&S<=47,R=(E===23||E===31)&&S>=45&&S<=47;if(!(w||R))return!1;var N,F={};E===16||E===24?(N=Math.floor((S-32)/2),F.background=n[N],S%2===1&&(F.background=F.background+"_semi")):S===45?F.background="transparent":(F.foreground="black",S===47&&(F.underline=!0));var z=E<=23?1:2,q=this.channels[z];return q.setBkgData(F),b(E,S,this.cmdHistory),!0},x.reset=function(){for(var E=0;E<Object.keys(this.channels).length;E++){var S=this.channels[E];S&&S.reset()}this.cmdHistory=m()},x.cueSplitAtTime=function(E){for(var S=0;S<this.channels.length;S++){var w=this.channels[S];w&&w.cueSplitAtTime(E)}},_}();function b(_,x,h){h.a=_,h.b=x}function g(_,x,h){return h.a===_&&h.b===x}function m(){return{a:null,b:null}}ie.default=y},"./src/utils/codecs.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"isCodecType",function(){return D}),W.d(ie,"isCodecSupportedInMp4",function(){return T});var C={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function D(A,O){var f=C[O];return!!f&&f[A.slice(0,4)]===!0}function T(A,O){return MediaSource.isTypeSupported((O||"video")+'/mp4;codecs="'+A+'"')}},"./src/utils/cues.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/utils/vttparser.ts"),D=W("./src/utils/webvtt-parser.ts"),T=W("./src/utils/texttrack-utils.ts"),A=/\s/,O={newCue:function(p,c,s,n){for(var o=[],r,l,a,i,t,d=self.VTTCue||self.TextTrackCue,v=0;v<n.rows.length;v++)if(r=n.rows[v],a=!0,i=0,t="",!r.isEmpty()){for(var y=0;y<r.chars.length;y++)A.test(r.chars[y].uchar)&&a?i++:(t+=r.chars[y].uchar,a=!1);r.cueStartTime=c,c===s&&(s+=1e-4),i>=16?i--:i++;var b=Object(C.fixLineBreaks)(t.trim()),g=Object(D.generateCueId)(c,s,b);(!p||!p.cues||!p.cues.getCueById(g))&&(l=new d(c,s,b),l.id=g,l.line=v+1,l.align="left",l.position=10+Math.min(80,Math.floor(i*8/32)*10),o.push(l))}return p&&o.length&&(o.sort(function(m,_){return m.line==="auto"||_.line==="auto"?0:m.line>8&&_.line>8?_.line-m.line:m.line-_.line}),o.forEach(function(m){return Object(T.addCueToTrack)(p,m)})),o}};ie.default=O},"./src/utils/discontinuities.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"findFirstFragWithCC",function(){return A}),W.d(ie,"shouldAlignOnDiscontinuities",function(){return O}),W.d(ie,"findDiscontinuousReferenceFrag",function(){return f}),W.d(ie,"adjustSlidingStart",function(){return c}),W.d(ie,"alignStream",function(){return s}),W.d(ie,"alignPDT",function(){return o}),W.d(ie,"alignFragmentByPDTDelta",function(){return r}),W.d(ie,"alignMediaPlaylistByPDT",function(){return l});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/logger.ts"),T=W("./src/controller/level-helper.ts");function A(a,i){for(var t=null,d=0,v=a.length;d<v;d++){var y=a[d];if(y&&y.cc===i){t=y;break}}return t}function O(a,i,t){return!!(i.details&&(t.endCC>t.startCC||a&&a.cc<t.startCC))}function f(a,i){var t=a.fragments,d=i.fragments;if(!d.length||!t.length){D.logger.log("No fragments to align");return}var v=A(t,d[0].cc);if(!v||v&&!v.startPTS){D.logger.log("No frag in previous level to align on");return}return v}function p(a,i){if(a){var t=a.start+i;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function c(a,i){for(var t=i.fragments,d=0,v=t.length;d<v;d++)p(t[d],a);i.fragmentHint&&p(i.fragmentHint,a),i.alignedSliding=!0}function s(a,i,t){if(!i)return;n(a,t,i),!t.alignedSliding&&i.details&&o(t,i.details),!t.alignedSliding&&i.details&&!t.skippedSegments&&Object(T.adjustSliding)(i.details,t)}function n(a,i,t){if(O(a,t,i)){var d=f(t.details,i);d&&Object(C.isFiniteNumber)(d.start)&&(D.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),c(d.start,i))}}function o(a,i){if(!i.fragments.length||!a.hasProgramDateTime||!i.hasProgramDateTime)return;var t=i.fragments[0].programDateTime,d=a.fragments[0].programDateTime,v=(d-t)/1e3+i.fragments[0].start;v&&Object(C.isFiniteNumber)(v)&&(D.logger.log("Adjusting PTS using programDateTime delta "+(d-t)+"ms, sliding:"+v.toFixed(3)+" "+a.url+" "),c(v,a))}function r(a,i){var t=a.programDateTime;if(!t)return;var d=(t-i)/1e3;a.start=a.startPTS=d,a.endPTS=d+a.duration}function l(a,i){if(!i.fragments.length||!a.hasProgramDateTime||!i.hasProgramDateTime)return;var t=i.fragments[0].programDateTime,d=i.fragments[0].start,v=t-d*1e3;a.fragments.forEach(function(y){r(y,v)}),a.fragmentHint&&r(a.fragmentHint,v),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/utils/ewma.ts"),D=function(){function T(O,f,p){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=p,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new C.default(O),this.fast_=new C.default(f)}var A=T.prototype;return A.update=function(f,p){var c=this.slow_,s=this.fast_;this.slow_.halfLife!==f&&(this.slow_=new C.default(f,c.getEstimate(),c.getTotalWeight())),this.fast_.halfLife!==p&&(this.fast_=new C.default(p,s.getEstimate(),s.getTotalWeight()))},A.sample=function(f,p){f=Math.max(f,this.minDelayMs_);var c=8*p,s=f/1e3,n=c/s;this.fast_.sample(s,n),this.slow_.sample(s,n)},A.canEstimate=function(){var f=this.fast_;return f&&f.getTotalWeight()>=this.minWeight_},A.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},A.destroy=function(){},T}();ie.default=D},"./src/utils/ewma.ts":function(ce,ie,W){"use strict";W.r(ie);var C=function(){function D(A,O,f){O===void 0&&(O=0),f===void 0&&(f=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=A,this.alpha_=A?Math.exp(Math.log(.5)/A):0,this.estimate_=O,this.totalWeight_=f}var T=D.prototype;return T.sample=function(O,f){var p=Math.pow(this.alpha_,O);this.estimate_=f*(1-p)+p*this.estimate_,this.totalWeight_+=O},T.getTotalWeight=function(){return this.totalWeight_},T.getEstimate=function(){if(this.alpha_){var O=1-Math.pow(this.alpha_,this.totalWeight_);if(O)return this.estimate_/O}return this.estimate_},D}();ie.default=C},"./src/utils/fetch-loader.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"fetchSupported",function(){return r});var C=W("./src/polyfills/number.ts"),D=W("./src/loader/load-stats.ts"),T=W("./src/demux/chunk-cache.ts");function A(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,s(d,v)}function O(d){var v=typeof Map=="function"?new Map:void 0;return O=function(b){if(b===null||!c(b))return b;if(typeof b!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(b))return v.get(b);v.set(b,g)}function g(){return f(b,arguments,n(this).constructor)}return g.prototype=Object.create(b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),s(g,b)},O(d)}function f(d,v,y){return p()?f=Reflect.construct:f=function(g,m,_){var x=[null];x.push.apply(x,m);var h=Function.bind.apply(g,x),E=new h;return _&&s(E,_.prototype),E},f.apply(null,arguments)}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function c(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function s(d,v){return s=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},s(d,v)}function n(d){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},n(d)}function o(){return o=Object.assign||function(d){for(var v=1;v<arguments.length;v++){var y=arguments[v];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(d[b]=y[b])}return d},o.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var l=function(){function d(y){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=y.fetchSetup||i,this.controller=new self.AbortController,this.stats=new D.LoadStats}var v=d.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var b=this.response;(!b||!b.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(b,g,m){var _=this,x=this.stats;if(x.loading.start)throw new Error("Loader can only be used once.");x.loading.start=self.performance.now();var h=a(b,this.controller.signal),E=m.onProgress,S=b.responseType==="arraybuffer",w=S?"byteLength":"length";this.context=b,this.config=g,this.callbacks=m,this.request=this.fetchSetup(b,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),m.onTimeout(x,b,_.response)},g.timeout),self.fetch(this.request).then(function(R){if(_.response=_.loader=R,!R.ok){var N=R.status,F=R.statusText;throw new t(F||"fetch, bad network response",N,R)}return x.loading.first=Math.max(self.performance.now(),x.loading.start),x.total=parseInt(R.headers.get("Content-Length")||"0"),E&&Object(C.isFiniteNumber)(g.highWaterMark)?_.loadProgressively(R,x,b,g.highWaterMark,E):S?R.arrayBuffer():R.text()}).then(function(R){var N=_.response;self.clearTimeout(_.requestTimeout),x.loading.end=Math.max(self.performance.now(),x.loading.first),x.loaded=x.total=R[w];var F={url:N.url,data:R};E&&!Object(C.isFiniteNumber)(g.highWaterMark)&&E(x,b,R,N),m.onSuccess(F,x,b,N)}).catch(function(R){if(self.clearTimeout(_.requestTimeout),x.aborted)return;var N=R.code||0;m.onError({code:N,text:R.message},b,R.details)})},v.getCacheAge=function(){var b=null;if(this.response){var g=this.response.headers.get("age");b=g?parseFloat(g):null}return b},v.loadProgressively=function(b,g,m,_,x){_===void 0&&(_=0);var h=new T.default,E=b.body.getReader(),S=function w(){return E.read().then(function(R){if(R.done)return h.dataLength&&x(g,m,h.flush(),b),Promise.resolve(new ArrayBuffer(0));var N=R.value,F=N.length;return g.loaded+=F,F<_||h.dataLength?(h.push(N),h.dataLength>=_&&x(g,m,h.flush(),b)):x(g,m,N,b),w()}).catch(function(){return Promise.reject()})};return S()},d}();function a(d,v){var y={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(o({},d.headers))};return d.rangeEnd&&y.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),y}function i(d,v){return new self.Request(d.url,v)}var t=function(d){A(v,d);function v(y,b,g){var m;return m=d.call(this,y)||this,m.code=void 0,m.details=void 0,m.code=b,m.details=g,m}return v}(O(Error));ie.default=l},"./src/utils/imsc1-ttml-parser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"IMSC1_CODEC",function(){return c}),W.d(ie,"parseIMSC1",function(){return r});var C=W("./src/utils/mp4-tools.ts"),D=W("./src/utils/vttparser.ts"),T=W("./src/utils/vttcue.ts"),A=W("./src/demux/id3.ts"),O=W("./src/utils/timescale-conversion.ts"),f=W("./src/utils/webvtt-parser.ts");function p(){return p=Object.assign||function(_){for(var x=1;x<arguments.length;x++){var h=arguments[x];for(var E in h)Object.prototype.hasOwnProperty.call(h,E)&&(_[E]=h[E])}return _},p.apply(this,arguments)}var c="stpp.ttml.im1t",s=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,n=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,o={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(_,x,h,E,S){var w=Object(C.findBox)(new Uint8Array(_),["mdat"]);if(w.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var R=w[0],N=Object(A.utf8ArrayToStr)(new Uint8Array(_,R.start,R.end-R.start)),F=Object(O.toTimescaleFromScale)(x,1,h);try{E(l(N,F))}catch(z){S(z)}}function l(_,x){var h=new DOMParser,E=h.parseFromString(_,"text/xml"),S=E.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var w={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},R=Object.keys(w).reduce(function(B,M){return B[M]=S.getAttribute("ttp:"+M)||w[M],B},{}),N=S.getAttribute("xml:space")!=="preserve",F=i(a(S,"styling","style")),z=i(a(S,"layout","region")),q=a(S,"body","[begin]");return[].map.call(q,function(B){var M=t(B,N);if(!M||!B.hasAttribute("begin"))return null;var G=b(B.getAttribute("begin"),R),J=b(B.getAttribute("dur"),R),K=b(B.getAttribute("end"),R);if(G===null)throw y(B);if(K===null){if(J===null)throw y(B);K=G+J}var Z=new T.default(G-x,K-x,M);Z.id=Object(f.generateCueId)(Z.startTime,Z.endTime,Z.text);var le=z[B.getAttribute("region")],de=F[B.getAttribute("style")];Z.position=10,Z.size=80;var Te=d(le,de),we=Te.textAlign;if(we){var Ie=o[we];Ie&&(Z.lineAlign=Ie),Z.align=we}return p(Z,Te),Z}).filter(function(B){return B!==null})}function a(_,x,h){var E=_.getElementsByTagName(x)[0];return E?[].slice.call(E.querySelectorAll(h)):[]}function i(_){return _.reduce(function(x,h){var E=h.getAttribute("xml:id");return E&&(x[E]=h),x},{})}function t(_,x){return[].slice.call(_.childNodes).reduce(function(h,E,S){var w;return E.nodeName==="br"&&S?h+`
|
|
|
`:(w=E.childNodes)!==null&&w!==void 0&&w.length?t(E,x):x?h+E.textContent.trim().replace(/\s+/g," "):h+E.textContent},"")}function d(_,x){var h="http://www.w3.org/ns/ttml#styling",E=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return E.reduce(function(S,w){var R=v(x,h,w)||v(_,h,w);return R&&(S[w]=R),S},{})}function v(_,x,h){return _.hasAttributeNS(x,h)?_.getAttributeNS(x,h):null}function y(_){return new Error("Could not parse ttml timestamp "+_)}function b(_,x){if(!_)return null;var h=Object(D.parseTimeStamp)(_);return h===null&&(s.test(_)?h=g(_,x):n.test(_)&&(h=m(_,x))),h}function g(_,x){var h=s.exec(_),E=(h[4]|0)+(h[5]|0)/x.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+E/x.frameRate}function m(_,x){var h=n.exec(_),E=Number(h[1]),S=h[2];switch(S){case"h":return E*3600;case"m":return E*60;case"ms":return E*1e3;case"f":return E/x.frameRate;case"t":return E/x.tickRate}return E}},"./src/utils/logger.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"enableLogs",function(){return f}),W.d(ie,"logger",function(){return p});var C=function(){},D={trace:C,debug:C,log:C,warn:C,info:C,error:C},T=D;function A(c){var s=self.console[c];return s?s.bind(self.console,"["+c+"] >"):C}function O(c){for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;o<s;o++)n[o-1]=arguments[o];n.forEach(function(r){T[r]=c[r]?c[r].bind(c):A(r)})}function f(c){if(self.console&&c===!0||typeof c=="object"){O(c,"debug","log","info","warn","error");try{T.log()}catch(s){T=D}}else T=D}var p=T},"./src/utils/mediakeys-helper.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"KeySystems",function(){return C}),W.d(ie,"requestMediaKeySystemAccess",function(){return D});var C;(function(T){T.WIDEVINE="com.widevine.alpha",T.PLAYREADY="com.microsoft.playready"})(C||(C={}));var D=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"getMediaSource",function(){return C});function C(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"bin2str",function(){return O}),W.d(ie,"readUint16",function(){return f}),W.d(ie,"readUint32",function(){return p}),W.d(ie,"writeUint32",function(){return c}),W.d(ie,"findBox",function(){return s}),W.d(ie,"parseSegmentIndex",function(){return n}),W.d(ie,"parseInitSegment",function(){return o}),W.d(ie,"getStartDTS",function(){return r}),W.d(ie,"getDuration",function(){return l}),W.d(ie,"computeRawDurationFromSamples",function(){return a}),W.d(ie,"offsetStartDTS",function(){return i}),W.d(ie,"segmentValidRange",function(){return t}),W.d(ie,"appendUint8Array",function(){return d});var C=W("./src/utils/typed-array.ts"),D=W("./src/loader/fragment.ts"),T=Math.pow(2,32)-1,A=[].push;function O(v){return String.fromCharCode.apply(null,v)}function f(v,y){"data"in v&&(y+=v.start,v=v.data);var b=v[y]<<8|v[y+1];return b<0?65536+b:b}function p(v,y){"data"in v&&(y+=v.start,v=v.data);var b=v[y]<<24|v[y+1]<<16|v[y+2]<<8|v[y+3];return b<0?4294967296+b:b}function c(v,y,b){"data"in v&&(y+=v.start,v=v.data),v[y]=b>>24,v[y+1]=b>>16&255,v[y+2]=b>>8&255,v[y+3]=b&255}function s(v,y){var b=[];if(!y.length)return b;var g,m,_;"data"in v?(g=v.data,m=v.start,_=v.end):(g=v,m=0,_=g.byteLength);for(var x=m;x<_;){var h=p(g,x),E=O(g.subarray(x+4,x+8)),S=h>1?x+h:_;if(E===y[0])if(y.length===1)b.push({data:g,start:x+8,end:S});else{var w=s({data:g,start:x+8,end:S},y.slice(1));w.length&&A.apply(b,w)}x=S}return b}function n(v){var y=s(v,["moov"]),b=y[0],g=b?b.end:null,m=s(v,["sidx"]);if(!m||!m[0])return null;var _=[],x=m[0],h=x.data[0],E=h===0?8:16,S=p(x,E);E+=4;var w=0,R=0;h===0?E+=8:E+=16,E+=2;var N=x.end+R,F=f(x,E);E+=2;for(var z=0;z<F;z++){var q=E,B=p(x,q);q+=4;var M=B&2147483647,G=(B&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var J=p(x,q);q+=4,_.push({referenceSize:M,subsegmentDuration:J,info:{duration:J/S,start:N,end:N+M-1}}),N+=M,q+=4,E=q}return{earliestPresentationTime:w,timescale:S,version:h,referencesCount:F,references:_,moovEndOffset:g}}function o(v){for(var y=[],b=s(v,["moov","trak"]),g=0;g<b.length;g++){var m=b[g],_=s(m,["tkhd"])[0];if(_){var x=_.data[_.start],h=x===0?12:20,E=p(_,h),S=s(m,["mdia","mdhd"])[0];if(S){x=S.data[S.start],h=x===0?12:20;var w=p(S,h),R=s(m,["mdia","hdlr"])[0];if(R){var N=O(R.data.subarray(R.start+8,R.start+12)),F={soun:D.ElementaryStreamTypes.AUDIO,vide:D.ElementaryStreamTypes.VIDEO}[N];if(F){var z=s(m,["mdia","minf","stbl","stsd"])[0],q=void 0;z&&(q=O(z.data.subarray(z.start+12,z.start+16))),y[E]={timescale:w,type:F},y[F]={timescale:w,id:E,codec:q}}}}}}var B=s(v,["moov","mvex","trex"]);return B.forEach(function(M){var G=p(M,4),J=y[G];J&&(J.default={duration:p(M,12),flags:p(M,20)})}),y}function r(v,y){return s(y,["moof","traf"]).reduce(function(b,g){var m=s(g,["tfdt"])[0],_=m.data[m.start],x=s(g,["tfhd"]).reduce(function(h,E){var S=p(E,4),w=v[S];if(w){var R=p(m,4);_===1&&(R*=Math.pow(2,32),R+=p(m,8));var N=w.timescale||9e4,F=R/N;if(isFinite(F)&&(h===null||F<h))return F}return h},null);return x!==null&&isFinite(x)&&(b===null||x<b)?x:b},null)||0}function l(v,y){for(var b=0,g=0,m=0,_=s(v,["moof","traf"]),x=0;x<_.length;x++){var h=_[x],E=s(h,["tfhd"])[0],S=p(E,4),w=y[S];if(!w)continue;var R=w.default,N=p(E,0)|(R==null?void 0:R.flags),F=R==null?void 0:R.duration;N&8&&(N&2?F=p(E,12):F=p(E,8));for(var z=w.timescale||9e4,q=s(h,["trun"]),B=0;B<q.length;B++){if(F){var M=p(q[B],4);b=F*M}else b=a(q[B]);w.type===D.ElementaryStreamTypes.VIDEO?g+=b/z:w.type===D.ElementaryStreamTypes.AUDIO&&(m+=b/z)}}if(g===0&&m===0){var G=n(v);if(G!=null&&G.references)return G.references.reduce(function(J,K){return J+K.info.duration||0},0)}return g||m}function a(v){var y=p(v,0),b=8;y&1&&(b+=4),y&4&&(b+=4);for(var g=0,m=p(v,4),_=0;_<m;_++){if(y&256){var x=p(v,b);g+=x,b+=4}y&512&&(b+=4),y&1024&&(b+=4),y&2048&&(b+=4)}return g}function i(v,y,b){s(y,["moof","traf"]).forEach(function(g){s(g,["tfhd"]).forEach(function(m){var _=p(m,4),x=v[_];if(!x)return;var h=x.timescale||9e4;s(g,["tfdt"]).forEach(function(E){var S=E.data[E.start],w=p(E,4);if(S===0)c(E,4,w-b*h);else{w*=Math.pow(2,32),w+=p(E,8),w-=b*h,w=Math.max(w,0);var R=Math.floor(w/(T+1)),N=Math.floor(w%(T+1));c(E,4,R),c(E,8,N)}})})})}function t(v){var y={valid:null,remainder:null},b=s(v,["moof"]);if(b){if(b.length<2)return y.remainder=v,y}else return y;var g=b[b.length-1];return y.valid=Object(C.sliceUint8)(v,0,g.start-8),y.remainder=Object(C.sliceUint8)(v,g.start-8),y}function d(v,y){var b=new Uint8Array(v.length+y.length);return b.set(v),b.set(y,v.length),b}},"./src/utils/output-filter.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"default",function(){return C});var C=function(){function D(A,O){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=A,this.trackName=O}var T=D.prototype;return T.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},T.newCue=function(O,f,p){(this.startTime===null||this.startTime>O)&&(this.startTime=O),this.endTime=f,this.screen=p,this.timelineController.createCaptionsTrack(this.trackName)},T.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"sendAddTrackEvent",function(){return D}),W.d(ie,"addCueToTrack",function(){return T}),W.d(ie,"clearCurrentCues",function(){return A}),W.d(ie,"removeCuesInRange",function(){return O}),W.d(ie,"getCuesInRange",function(){return p});var C=W("./src/utils/logger.ts");function D(c,s){var n;try{n=new Event("addtrack")}catch(o){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=c,s.dispatchEvent(n)}function T(c,s){var n=c.mode;if(n==="disabled"&&(c.mode="hidden"),c.cues&&!c.cues.getCueById(s.id))try{if(c.addCue(s),!c.cues.getCueById(s.id))throw new Error("addCue is failed for: "+s)}catch(r){C.logger.debug("[texttrack-utils]: "+r);var o=new self.TextTrackCue(s.startTime,s.endTime,s.text);o.id=s.id,c.addCue(o)}n==="disabled"&&(c.mode=n)}function A(c){var s=c.mode;if(s==="disabled"&&(c.mode="hidden"),c.cues)for(var n=c.cues.length;n--;)c.removeCue(c.cues[n]);s==="disabled"&&(c.mode=s)}function O(c,s,n){var o=c.mode;if(o==="disabled"&&(c.mode="hidden"),c.cues&&c.cues.length>0)for(var r=p(c.cues,s,n),l=0;l<r.length;l++)c.removeCue(r[l]);o==="disabled"&&(c.mode=o)}function f(c,s){if(s<c[0].startTime)return 0;var n=c.length-1;if(s>c[n].endTime)return-1;for(var o=0,r=n;o<=r;){var l=Math.floor((r+o)/2);if(s<c[l].startTime)r=l-1;else if(s>c[l].startTime&&o<n)o=l+1;else return l}return c[o].startTime-s<s-c[r].startTime?o:r}function p(c,s,n){var o=[],r=f(c,s);if(r>-1)for(var l=r,a=c.length;l<a;l++){var i=c[l];if(i.startTime>=s&&i.endTime<=n)o.push(i);else if(i.startTime>n)return o}return o}},"./src/utils/time-ranges.ts":function(ce,ie,W){"use strict";W.r(ie);var C={toString:function(T){for(var A="",O=T.length,f=0;f<O;f++)A+="["+T.start(f).toFixed(3)+","+T.end(f).toFixed(3)+"]";return A}};ie.default=C},"./src/utils/timescale-conversion.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"toTimescaleFromBase",function(){return D}),W.d(ie,"toTimescaleFromScale",function(){return T}),W.d(ie,"toMsFromMpegTsClock",function(){return A}),W.d(ie,"toMpegTsClockFromTimescale",function(){return O});var C=9e4;function D(f,p,c,s){c===void 0&&(c=1),s===void 0&&(s=!1);var n=f*p*c;return s?Math.round(n):n}function T(f,p,c,s){return c===void 0&&(c=1),s===void 0&&(s=!1),D(f,p,1/c,s)}function A(f,p){return p===void 0&&(p=!1),D(f,1e3,1/C,p)}function O(f,p){return p===void 0&&(p=1),D(f,C,1/p)}},"./src/utils/typed-array.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"sliceUint8",function(){return C});function C(D,T,A){return Uint8Array.prototype.slice?D.slice(T,A):new Uint8Array(Array.prototype.slice.call(D,T,A))}},"./src/utils/vttcue.ts":function(ce,ie,W){"use strict";W.r(ie),ie.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var C=["","lr","rl"],D=["start","middle","end","left","right"];function T(c,s){if(typeof s!="string")return!1;if(!Array.isArray(c))return!1;var n=s.toLowerCase();return~c.indexOf(n)?n:!1}function A(c){return T(C,c)}function O(c){return T(D,c)}function f(c){for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;o<s;o++)n[o-1]=arguments[o];for(var r=1;r<arguments.length;r++){var l=arguments[r];for(var a in l)c[a]=l[a]}return c}function p(c,s,n){var o=this,r={enumerable:!0};o.hasBeenReset=!1;var l="",a=!1,i=c,t=s,d=n,v=null,y="",b=!0,g="auto",m="start",_=50,x="middle",h=50,E="middle";Object.defineProperty(o,"id",f({},r,{get:function(){return l},set:function(w){l=""+w}})),Object.defineProperty(o,"pauseOnExit",f({},r,{get:function(){return a},set:function(w){a=!!w}})),Object.defineProperty(o,"startTime",f({},r,{get:function(){return i},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");i=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",f({},r,{get:function(){return t},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");t=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",f({},r,{get:function(){return d},set:function(w){d=""+w,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",f({},r,{get:function(){return v},set:function(w){v=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",f({},r,{get:function(){return y},set:function(w){var R=A(w);if(R===!1)throw new SyntaxError("An invalid or illegal string was specified.");y=R,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",f({},r,{get:function(){return b},set:function(w){b=!!w,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",f({},r,{get:function(){return g},set:function(w){if(typeof w!="number"&&w!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");g=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",f({},r,{get:function(){return m},set:function(w){var R=O(w);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");m=R,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",f({},r,{get:function(){return _},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");_=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",f({},r,{get:function(){return x},set:function(w){var R=O(w);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");x=R,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",f({},r,{get:function(){return h},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");h=w,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",f({},r,{get:function(){return E},set:function(w){var R=O(w);if(!R)throw new SyntaxError("An invalid or illegal string was specified.");E=R,this.hasBeenReset=!0}})),o.displayState=void 0}return p.prototype.getCueAsHTML=function(){var c=self.WebVTT;return c.convertCueToDOMTree(self,this.text)},p}()},"./src/utils/vttparser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"parseTimeStamp",function(){return T}),W.d(ie,"fixLineBreaks",function(){return s}),W.d(ie,"VTTParser",function(){return n});var C=W("./src/utils/vttcue.ts"),D=function(){function o(){}var r=o.prototype;return r.decode=function(a,i){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},o}();function T(o){function r(a,i,t,d){return(a|0)*3600+(i|0)*60+(t|0)+parseFloat(d||0)}var l=o.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?r(l[2],l[3],0,l[4]):r(l[1],l[2],l[3],l[4]):null}var A=function(){function o(){this.values=Object.create(null)}var r=o.prototype;return r.set=function(a,i){!this.get(a)&&i!==""&&(this.values[a]=i)},r.get=function(a,i,t){return t?this.has(a)?this.values[a]:i[t]:this.has(a)?this.values[a]:i},r.has=function(a){return a in this.values},r.alt=function(a,i,t){for(var d=0;d<t.length;++d)if(i===t[d]){this.set(a,i);break}},r.integer=function(a,i){/^-?\d+$/.test(i)&&this.set(a,parseInt(i,10))},r.percent=function(a,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var t=parseFloat(i);if(t>=0&&t<=100)return this.set(a,t),!0}return!1},o}();function O(o,r,l,a){var i=a?o.split(a):[o];for(var t in i){if(typeof i[t]!="string")continue;var d=i[t].split(l);if(d.length!==2)continue;var v=d[0],y=d[1];r(v,y)}}var f=new C.default(0,0,""),p=f.align==="middle"?"middle":"center";function c(o,r,l){var a=o;function i(){var v=T(o);if(v===null)throw new Error("Malformed timestamp: "+a);return o=o.replace(/^[^\sa-zA-Z-]+/,""),v}function t(v,y){var b=new A;O(v,function(_,x){var h;switch(_){case"region":for(var E=l.length-1;E>=0;E--)if(l[E].id===x){b.set(_,l[E].region);break}break;case"vertical":b.alt(_,x,["rl","lr"]);break;case"line":h=x.split(","),b.integer(_,h[0]),b.percent(_,h[0])&&b.set("snapToLines",!1),b.alt(_,h[0],["auto"]),h.length===2&&b.alt("lineAlign",h[1],["start",p,"end"]);break;case"position":h=x.split(","),b.percent(_,h[0]),h.length===2&&b.alt("positionAlign",h[1],["start",p,"end","line-left","line-right","auto"]);break;case"size":b.percent(_,x);break;case"align":b.alt(_,x,["start",p,"end","left","right"]);break}},/:/,/\s/),y.region=b.get("region",null),y.vertical=b.get("vertical","");var g=b.get("line","auto");g==="auto"&&f.line===-1&&(g=-1),y.line=g,y.lineAlign=b.get("lineAlign","start"),y.snapToLines=b.get("snapToLines",!0),y.size=b.get("size",100),y.align=b.get("align",p);var m=b.get("position","auto");m==="auto"&&f.position===50&&(m=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=m}function d(){o=o.replace(/^\s+/,"")}if(d(),r.startTime=i(),d(),o.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);o=o.substr(3),d(),r.endTime=i(),d(),t(o,r)}function s(o){return o.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var n=function(){function o(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=o.prototype;return r.parse=function(a){var i=this;a&&(i.buffer+=i.decoder.decode(a,{stream:!0}));function t(){var m=i.buffer,_=0;for(m=s(m);_<m.length&&m[_]!=="\r"&&m[_]!==`
|
|
|
`;)++_;var x=m.substr(0,_);return m[_]==="\r"&&++_,m[_]===`
|
|
|
`&&++_,i.buffer=m.substr(_),x}function d(m){O(m,function(_,x){},/:/)}try{var v="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;v=t();var y=v.match(/^()?WEBVTT([ \t].*)?$/);if(!y||!y[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var b=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;b?b=!1:v=t();switch(i.state){case"HEADER":/:/.test(v)?d(v):v||(i.state="ID");continue;case"NOTE":v||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){i.state="NOTE";break}if(!v)continue;if(i.cue=new C.default(0,0,""),i.state="CUE",v.indexOf("-->")===-1){i.cue.id=v;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{c(v,i.cue,i.regionList)}catch(m){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var g=v.indexOf("-->")!==-1;if(!v||g&&(b=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
|
|
|
`),i.cue.text+=v}continue;case"BADCUE":v||(i.state="ID")}}}catch(m){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
|
|
|
|
|
|
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){a.onparsingerror&&a.onparsingerror(i)}return a.onflush&&a.onflush(),this},o}()},"./src/utils/webvtt-parser.ts":function(ce,ie,W){"use strict";W.r(ie),W.d(ie,"generateCueId",function(){return n}),W.d(ie,"parseWebVTT",function(){return r});var C=W("./src/polyfills/number.ts"),D=W("./src/utils/vttparser.ts"),T=W("./src/demux/id3.ts"),A=W("./src/utils/timescale-conversion.ts"),O=W("./src/remux/mp4-remuxer.ts"),f=/\r\n|\n\r|\n|\r/g,p=function(a,i,t){return t===void 0&&(t=0),a.substr(t,i.length)===i},c=function(a){var i=parseInt(a.substr(-3)),t=parseInt(a.substr(-6,2)),d=parseInt(a.substr(-9,2)),v=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(C.isFiniteNumber)(i)||!Object(C.isFiniteNumber)(t)||!Object(C.isFiniteNumber)(d)||!Object(C.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return i+=1e3*t,i+=60*1e3*d,i+=60*60*1e3*v,i},s=function(a){for(var i=5381,t=a.length;t;)i=i*33^a.charCodeAt(--t);return(i>>>0).toString()};function n(l,a,i){return s(l.toString())+s(a.toString())+s(i)}var o=function(a,i,t){var d=a[i],v=a[d.prevCC];if(!v||!v.new&&d.new){a.ccOffset=a.presentationOffset=d.start,d.new=!1;return}for(;(y=v)!==null&&y!==void 0&&y.new;){var y;a.ccOffset+=d.start-v.start,d.new=!1,d=v,v=a[d.prevCC]}a.presentationOffset=t};function r(l,a,i,t,d,v,y,b){var g=new D.VTTParser,m=Object(T.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(f,`
|
|
|
`).split(`
|
|
|
`),_=[],x=Object(A.toMpegTsClockFromTimescale)(a,i),h="00:00.000",E=0,S=0,w,R=!0,N=!1;g.oncue=function(F){var z=t[d],q=t.ccOffset,B=(E-x)/9e4;if(z!=null&&z.new&&(S!==void 0?q=t.ccOffset=z.start:o(t,d,B)),B&&(q=B-t.presentationOffset),N){var M=F.endTime-F.startTime,G=Object(O.normalizePts)((F.startTime+q-S)*9e4,v*9e4)/9e4;F.startTime=G,F.endTime=G+M}var J=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(J)),F.id||(F.id=n(F.startTime,F.endTime,J)),F.endTime>0&&_.push(F)},g.onparsingerror=function(F){w=F},g.onflush=function(){if(w){b(w);return}y(_)},m.forEach(function(F){if(R)if(p(F,"X-TIMESTAMP-MAP=")){R=!1,N=!0,F.substr(16).split(",").forEach(function(z){p(z,"LOCAL:")?h=z.substr(6):p(z,"MPEGTS:")&&(E=parseInt(z.substr(7)))});try{S=c(h)/1e3}catch(z){N=!1,w=z}return}else F===""&&(R=!1);g.parse(F+`
|
|
|
`)}),g.flush()}},"./src/utils/xhr-loader.ts":function(ce,ie,W){"use strict";W.r(ie);var C=W("./src/utils/logger.ts"),D=W("./src/loader/load-stats.ts"),T=/^age:\s*[\d.]+\s*$/m,A=function(){function O(p){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=p?p.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var f=O.prototype;return f.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},f.abortInternal=function(){var c=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),c&&(c.onreadystatechange=null,c.onprogress=null,c.readyState!==4&&(this.stats.aborted=!0,c.abort()))},f.abort=function(){var c;this.abortInternal(),(c=this.callbacks)!==null&&c!==void 0&&c.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},f.load=function(c,s,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=c,this.config=s,this.callbacks=n,this.retryDelay=s.retryDelay,this.loadInternal()},f.loadInternal=function(){var c=this.config,s=this.context;if(!c)return;var n=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0;var r=this.xhrSetup;try{if(r)try{r(n,s.url)}catch(i){n.open("GET",s.url,!0),r(n,s.url)}n.readyState||n.open("GET",s.url,!0);var l=this.context.headers;if(l)for(var a in l)n.setRequestHeader(a,l[a])}catch(i){this.callbacks.onError({code:n.status,text:i.message},s,n);return}s.rangeEnd&&n.setRequestHeader("Range","bytes="+s.rangeStart+"-"+(s.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=s.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout),n.send()},f.readystatechange=function(){var c=this.context,s=this.loader,n=this.stats;if(!c||!s)return;var o=s.readyState,r=this.config;if(n.aborted)return;if(o>=2)if(self.clearTimeout(this.requestTimeout),n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),o===4){s.onreadystatechange=null,s.onprogress=null;var l=s.status;if(l>=200&&l<300){n.loading.end=Math.max(self.performance.now(),n.loading.first);var a,i;if(c.responseType==="arraybuffer"?(a=s.response,i=a.byteLength):(a=s.responseText,i=a.length),n.loaded=n.total=i,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(n,c,a,s),!this.callbacks)return;var d={url:s.responseURL,data:a};this.callbacks.onSuccess(d,n,c,s)}else n.retry>=r.maxRetry||l>=400&&l<499?(C.logger.error(l+" while loading "+c.url),this.callbacks.onError({code:l,text:s.statusText},c,s)):(C.logger.warn(l+" while loading "+c.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,r.maxRetryDelay),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},f.loadtimeout=function(){C.logger.warn("timeout while loading "+this.context.url);var c=this.callbacks;c&&(this.abortInternal(),c.onTimeout(this.stats,this.context,this.loader))},f.loadprogress=function(c){var s=this.stats;s.loaded=c.loaded,c.lengthComputable&&(s.total=c.total)},f.getCacheAge=function(){var c=null;if(this.loader&&T.test(this.loader.getAllResponseHeaders())){var s=this.loader.getResponseHeader("age");c=s?parseFloat(s):null}return c},O}();ie.default=A}}).default})},vHTk:function(nt,Xe,V){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return Q});var ce=V("rePB"),ie=V("VTBJ"),W=V("KQm4"),C=V("U8pU"),D=V("ODXe"),T=V("cDcd"),A=V("TSYQ"),O=V.n(A),f=V("Gytx"),p=V.n(f),c=V("Kwbf"),s=V("t23M"),n=V("qx4F"),o=V("6eGT"),r=V("IBYe"),l=V("Ff2n"),a=V("c+Xe"),i=V("fyJ8"),t=V("biw7");function d(Ne,Be,tt,lt,qe){var Ye=tt[Ne]||{},je=tt[Be]||{},Ue,ke;Ye.fixed==="left"?Ue=lt.left[Ne]:je.fixed==="right"&&(ke=lt.right[Be]);var be=!1,Ce=!1,Pe=!1,Le=!1,Ve=tt[Be+1],at=tt[Ne-1];if(qe==="rtl"){if(Ue!==void 0){var _t=at&&at.fixed==="left";Le=!_t}else if(ke!==void 0){var kt=Ve&&Ve.fixed==="right";Pe=!kt}}else if(Ue!==void 0){var Bt=Ve&&Ve.fixed==="left";be=!Bt}else if(ke!==void 0){var jt=at&&at.fixed==="right";Ce=!jt}return{fixLeft:Ue,fixRight:ke,lastFixLeft:be,firstFixRight:Ce,lastFixRight:Pe,firstFixLeft:Le,isSticky:lt.isSticky}}var v=V("sR1s");function y(Ne){var Be=Ne.cells,tt=Ne.stickyOffsets,lt=Ne.flattenColumns,qe=Ne.rowComponent,Ye=Ne.cellComponent,je=Ne.onHeaderRow,Ue=Ne.index,ke=T.useContext(t.a),be=ke.prefixCls,Ce=ke.direction,Pe;je&&(Pe=je(Be.map(function(Ve){return Ve.column}),Ue));var Le=Object(v.a)(Be.map(function(Ve){return Ve.column}));return T.createElement(qe,Object.assign({},Pe),Be.map(function(Ve,at){var _t=Ve.column,kt=d(Ve.colStart,Ve.colEnd,lt,tt,Ce),Bt;return _t&&_t.onHeaderCell&&(Bt=Ve.column.onHeaderCell(_t)),T.createElement(i.a,Object.assign({},Ve,{ellipsis:_t.ellipsis,align:_t.align,component:Ye,prefixCls:be,key:Le[at]},kt,{additionalProps:Bt,rowType:"header"}))}))}y.displayName="HeaderRow";var b=y;function g(Ne){var Be=[];function tt(je,Ue){var ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Be[ke]=Be[ke]||[];var be=Ue,Ce=je.filter(Boolean).map(function(Pe){var Le={key:Pe.key,className:Pe.className||"",children:Pe.title,column:Pe,colStart:be},Ve=1,at=Pe.children;return at&&at.length>0&&(Ve=tt(at,be,ke+1).reduce(function(_t,kt){return _t+kt},0),Le.hasSubColumns=!0),"colSpan"in Pe&&(Ve=Pe.colSpan),"rowSpan"in Pe&&(Le.rowSpan=Pe.rowSpan),Le.colSpan=Ve,Le.colEnd=Le.colStart+Ve-1,Be[ke].push(Le),be+=Ve,Ve});return Ce}tt(Ne,0);for(var lt=Be.length,qe=function(Ue){Be[Ue].forEach(function(ke){!("rowSpan"in ke)&&!ke.hasSubColumns&&(ke.rowSpan=lt-Ue)})},Ye=0;Ye<lt;Ye+=1)qe(Ye);return Be}function m(Ne){var Be=Ne.stickyOffsets,tt=Ne.columns,lt=Ne.flattenColumns,qe=Ne.onHeaderRow,Ye=T.useContext(t.a),je=Ye.prefixCls,Ue=Ye.getComponent,ke=T.useMemo(function(){return g(tt)},[tt]),be=Ue(["header","wrapper"],"thead"),Ce=Ue(["header","row"],"tr"),Pe=Ue(["header","cell"],"th");return T.createElement(be,{className:"".concat(je,"-thead")},ke.map(function(Le,Ve){var at=T.createElement(b,{key:Ve,flattenColumns:lt,cells:Le,stickyOffsets:Be,rowComponent:Ce,cellComponent:Pe,onHeaderRow:qe,index:Ve});return at}))}var _=m,x=V("hW8S");function h(Ne){for(var Be=Ne.colWidths,tt=Ne.columns,lt=Ne.columCount,qe=[],Ye=lt||tt.length,je=!1,Ue=Ye-1;Ue>=0;Ue-=1){var ke=Be[Ue],be=tt&&tt[Ue],Ce=be&&be[x.a];(ke||Ce||je)&&(qe.unshift(T.createElement("col",Object.assign({key:Ue,style:{width:ke,minWidth:ke}},Ce))),je=!0)}return T.createElement("colgroup",null,qe)}var E=h;function S(Ne,Be){return Object(T.useMemo)(function(){for(var tt=[],lt=0;lt<Be;lt+=1){var qe=Ne[lt];if(qe!==void 0)tt[lt]=qe;else return null}return tt},[Ne.join("_"),Be])}var w=T.forwardRef(function(Ne,Be){var tt=Ne.noData,lt=Ne.columns,qe=Ne.flattenColumns,Ye=Ne.colWidths,je=Ne.columCount,Ue=Ne.stickyOffsets,ke=Ne.direction,be=Ne.fixHeader,Ce=Ne.offsetHeader,Pe=Ne.stickyClassName,Le=Ne.onScroll,Ve=Object(l.a)(Ne,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),at=T.useContext(t.a),_t=at.prefixCls,kt=at.scrollbarSize,Bt=at.isSticky,jt=Bt&&!be?0:kt,At=T.useRef(null),pt=T.useCallback(function(It){Object(a.b)(Be,It),Object(a.b)(At,It)},[]);T.useEffect(function(){var It;function Pt(Ze){var mt=Ze.currentTarget,Lt=Ze.deltaX;Lt&&(Le({currentTarget:mt,scrollLeft:mt.scrollLeft+Lt}),Ze.preventDefault())}return(It=At.current)===null||It===void 0||It.addEventListener("wheel",Pt),function(){var Ze;(Ze=At.current)===null||Ze===void 0||Ze.removeEventListener("wheel",Pt)}},[]);var gt=qe[qe.length-1],rt={fixed:gt?gt.fixed:null,onHeaderCell:function(){return{className:"".concat(_t,"-cell-scrollbar")}}},Oe=Object(T.useMemo)(function(){return jt?[].concat(Object(W.a)(lt),[rt]):lt},[jt,lt]),ze=Object(T.useMemo)(function(){return jt?[].concat(Object(W.a)(qe),[rt]):qe},[jt,qe]),vt=Object(T.useMemo)(function(){var It=Ue.right,Pt=Ue.left;return Object(ie.a)(Object(ie.a)({},Ue),{},{left:ke==="rtl"?[].concat(Object(W.a)(Pt.map(function(Ze){return Ze+jt})),[0]):Pt,right:ke==="rtl"?It:[].concat(Object(W.a)(It.map(function(Ze){return Ze+jt})),[0]),isSticky:Bt})},[jt,Ue,Bt]),st=S(Ye,je);return T.createElement("div",{style:Object(ie.a)({overflow:"hidden"},Bt?{top:Ce}:{}),ref:pt,className:O()("".concat(_t,"-header"),Object(ce.a)({},Pe,!!Pe))},T.createElement("table",{style:{tableLayout:"fixed",visibility:tt||st?null:"hidden"}},T.createElement(E,{colWidths:st?[].concat(Object(W.a)(st),[jt]):[],columCount:je+1,columns:ze}),T.createElement(_,Object.assign({},Ve,{stickyOffsets:vt,columns:Oe,flattenColumns:ze}))))});w.displayName="FixedHeader";var R=w,N=T.createContext(null),F=N;function z(Ne){var Be=Ne.prefixCls,tt=Ne.children,lt=Ne.component,qe=Ne.cellComponent,Ye=Ne.fixHeader,je=Ne.fixColumn,Ue=Ne.horizonScroll,ke=Ne.className,be=Ne.expanded,Ce=Ne.componentWidth,Pe=Ne.colSpan,Le=T.useContext(t.a),Ve=Le.scrollbarSize;return T.useMemo(function(){var at=tt;return je&&(at=T.createElement("div",{style:{width:Ce-(Ye?Ve:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Be,"-expanded-row-fixed")},at)),T.createElement(lt,{className:ke,style:{display:be?null:"none"}},T.createElement(i.a,{component:qe,prefixCls:Be,colSpan:Pe},at))},[tt,lt,Ye,Ue,ke,be,Ce,Pe,Ve])}var q=z;function B(Ne){var Be=Ne.className,tt=Ne.style,lt=Ne.record,qe=Ne.index,Ye=Ne.rowKey,je=Ne.getRowKey,Ue=Ne.rowExpandable,ke=Ne.expandedKeys,be=Ne.onRow,Ce=Ne.indent,Pe=Ce===void 0?0:Ce,Le=Ne.rowComponent,Ve=Ne.cellComponent,at=Ne.childrenColumnName,_t=T.useContext(t.a),kt=_t.prefixCls,Bt=_t.fixedInfoList,jt=T.useContext(F),At=jt.fixHeader,pt=jt.fixColumn,gt=jt.horizonScroll,rt=jt.componentWidth,Oe=jt.flattenColumns,ze=jt.expandableType,vt=jt.expandRowByClick,st=jt.onTriggerExpand,It=jt.rowClassName,Pt=jt.expandedRowClassName,Ze=jt.indentSize,mt=jt.expandIcon,Lt=jt.expandedRowRender,Mt=jt.expandIconColumnIndex,$t=T.useState(!1),Re=Object(D.a)($t,2),ve=Re[0],X=Re[1],ne=ke&&ke.has(Ne.recordKey);T.useEffect(function(){ne&&X(!0)},[ne]);var oe=ze==="row"&&(!Ue||Ue(lt)),he=ze==="nest",Ae=at&<&<[at],Qe=oe||he,ot;be&&(ot=be(lt,qe));var Rt=function(U){if(vt&&Qe&&st(lt,U),ot&&ot.onClick){for(var H,te=arguments.length,pe=new Array(te>1?te-1:0),se=1;se<te;se++)pe[se-1]=arguments[se];(H=ot).onClick.apply(H,[U].concat(pe))}},Nt;typeof It=="string"?Nt=It:typeof It=="function"&&(Nt=It(lt,qe,Pe));var ht=Object(v.a)(Oe),Dt=T.createElement(Le,Object.assign({},ot,{"data-row-key":Ye,className:O()(Be,"".concat(kt,"-row"),"".concat(kt,"-row-level-").concat(Pe),Nt,ot&&ot.className),style:Object(ie.a)(Object(ie.a)({},tt),ot?ot.style:null),onClick:Rt}),Oe.map(function(ae,U){var H=ae.render,te=ae.dataIndex,pe=ae.className,se=ht[U],$e=Bt[U],yt;U===(Mt||0)&&he&&(yt=T.createElement(T.Fragment,null,T.createElement("span",{style:{paddingLeft:"".concat(Ze*Pe,"px")},className:"".concat(kt,"-row-indent indent-level-").concat(Pe)}),mt({prefixCls:kt,expanded:ne,expandable:Ae,record:lt,onExpand:st})));var Ot;return ae.onCell&&(Ot=ae.onCell(lt,qe)),T.createElement(i.a,Object.assign({className:pe,ellipsis:ae.ellipsis,align:ae.align,component:Ve,prefixCls:kt,key:se,record:lt,index:qe,dataIndex:te,render:H,shouldCellUpdate:ae.shouldCellUpdate},$e,{appendNode:yt,additionalProps:Ot}))})),sn;if(oe&&(ve||ne)){var Ct=Lt(lt,qe,Pe+1,ne),hn=Pt&&Pt(lt,qe,Pe);sn=T.createElement(q,{expanded:ne,className:O()("".concat(kt,"-expanded-row"),"".concat(kt,"-expanded-row-level-").concat(Pe+1),hn),prefixCls:kt,fixHeader:At,fixColumn:pt,horizonScroll:gt,component:Le,componentWidth:rt,cellComponent:Ve,colSpan:Oe.length},Ct)}var rn;return Ae&&ne&&(rn=(lt[at]||[]).map(function(ae,U){var H=je(ae,U);return T.createElement(B,Object.assign({},Ne,{key:H,rowKey:H,record:ae,recordKey:H,index:U,indent:Pe+1}))})),T.createElement(T.Fragment,null,Dt,sn,rn)}B.displayName="BodyRow";var M=B,G=T.createContext(null),J=G;function K(Ne){var Be=Ne.columnKey,tt=Ne.onColumnResize,lt=T.useRef();return T.useEffect(function(){lt.current&&tt(Be,lt.current.offsetWidth)},[]),T.createElement(s.a,{onResize:function(Ye){var je=Ye.offsetWidth;tt(Be,je)}},T.createElement("td",{ref:lt,style:{padding:0,border:0,height:0}},T.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Z(Ne){var Be=Ne.data,tt=Ne.getRowKey,lt=Ne.measureColumnWidth,qe=Ne.expandedKeys,Ye=Ne.onRow,je=Ne.rowExpandable,Ue=Ne.emptyNode,ke=Ne.childrenColumnName,be=T.useContext(J),Ce=be.onColumnResize,Pe=T.useContext(t.a),Le=Pe.prefixCls,Ve=Pe.getComponent,at=T.useContext(F),_t=at.fixHeader,kt=at.horizonScroll,Bt=at.flattenColumns,jt=at.componentWidth;return T.useMemo(function(){var At=Ve(["body","wrapper"],"tbody"),pt=Ve(["body","row"],"tr"),gt=Ve(["body","cell"],"td"),rt;Be.length?rt=Be.map(function(ze,vt){var st=tt(ze,vt);return T.createElement(M,{key:st,rowKey:st,record:ze,recordKey:st,index:vt,rowComponent:pt,cellComponent:gt,expandedKeys:qe,onRow:Ye,getRowKey:tt,rowExpandable:je,childrenColumnName:ke})}):rt=T.createElement(q,{expanded:!0,className:"".concat(Le,"-placeholder"),prefixCls:Le,fixHeader:_t,fixColumn:kt,horizonScroll:kt,component:pt,componentWidth:jt,cellComponent:gt,colSpan:Bt.length},Ue);var Oe=Object(v.a)(Bt);return T.createElement(At,{className:"".concat(Le,"-tbody")},lt&&T.createElement("tr",{"aria-hidden":"true",className:"".concat(Le,"-measure-row"),style:{height:0}},Oe.map(function(ze){return T.createElement(K,{key:ze,columnKey:ze,onColumnResize:Ce})})),rt)},[Be,Le,Ye,lt,qe,tt,Ve,jt,Ue,Bt])}var le=T.memo(Z);le.displayName="Body";var de=le,Te=V("wRmb"),we=V("xEkU"),Ie=V.n(we);function _e(Ne){var Be=Object(T.useRef)(Ne),tt=Object(T.useState)({}),lt=Object(D.a)(tt,2),qe=lt[1],Ye=Object(T.useRef)(null),je=Object(T.useRef)([]);function Ue(ke){Ye.current===null&&(je.current=[],Ye.current=Ie()(function(){je.current.forEach(function(be){Be.current=be(Be.current)}),Ye.current=null,qe({})})),je.current.push(ke)}return Object(T.useEffect)(function(){return function(){Ie.a.cancel(Ye.current)}},[]),[Be.current,Ue]}function ye(Ne){var Be=Object(T.useRef)(Ne),tt=Object(T.useRef)(null);function lt(){window.clearTimeout(tt.current)}function qe(je){Be.current=je,lt(),tt.current=window.setTimeout(function(){Be.current=null,tt.current=null},100)}function Ye(){return Be.current}return Object(T.useEffect)(function(){return lt},[]),[qe,Ye]}function Ke(Ne,Be,tt){var lt=Object(T.useMemo)(function(){for(var qe=[],Ye=[],je=0,Ue=0,ke=0;ke<Be;ke+=1)if(tt==="rtl"){Ye[ke]=Ue,Ue+=Ne[ke]||0;var be=Be-ke-1;qe[be]=je,je+=Ne[be]||0}else{qe[ke]=je,je+=Ne[ke]||0;var Ce=Be-ke-1;Ye[Ce]=Ue,Ue+=Ne[Ce]||0}return{left:qe,right:Ye}},[Ne,Be,tt]);return lt}var Me=Ke;function Fe(Ne){var Be=Ne.className,tt=Ne.children;return T.createElement("div",{className:Be},tt)}var Ge=Fe,Ee=V("n6Qo");function me(Ne){var Be,tt=Ne.prefixCls,lt=Ne.record,qe=Ne.onExpand,Ye=Ne.expanded,je=Ne.expandable,Ue="".concat(tt,"-row-expand-icon");if(!je)return T.createElement("span",{className:O()(Ue,"".concat(tt,"-row-spaced"))});var ke=function(Ce){qe(lt,Ce),Ce.stopPropagation()};return T.createElement("span",{className:O()(Ue,(Be={},Object(ce.a)(Be,"".concat(tt,"-row-expanded"),Ye),Object(ce.a)(Be,"".concat(tt,"-row-collapsed"),!Ye),Be)),onClick:ke})}function We(Ne,Be,tt){var lt=[];function qe(Ye){(Ye||[]).forEach(function(je,Ue){lt.push(Be(je,Ue)),qe(je[tt])})}return qe(Ne),lt}var He=V("zT1h"),it=V("y0+3"),re=function(Be,tt){var lt,qe,Ye=Be.scrollBodyRef,je=Be.onScroll,Ue=Be.offsetScroll,ke=T.useContext(t.a),be=ke.prefixCls,Ce=((lt=Ye.current)===null||lt===void 0?void 0:lt.scrollWidth)||0,Pe=((qe=Ye.current)===null||qe===void 0?void 0:qe.clientWidth)||0,Le=Ce&&Pe*(Pe/Ce),Ve=T.useRef(),at=_e({scrollLeft:0,isHiddenScrollBar:!1}),_t=Object(D.a)(at,2),kt=_t[0],Bt=_t[1],jt=T.useRef({delta:0,x:0}),At=T.useState(!1),pt=Object(D.a)(At,2),gt=pt[0],rt=pt[1],Oe=function(){rt(!1)},ze=function(Ze){Ze.persist(),jt.current.delta=Ze.pageX-kt.scrollLeft,jt.current.x=0,rt(!0),Ze.preventDefault()},vt=function(Ze){var mt,Lt=Ze||((mt=window)===null||mt===void 0?void 0:mt.event),Mt=Lt.buttons;if(!gt||Mt===0){gt&&rt(!1);return}var $t=jt.current.x+Ze.pageX-jt.current.x-jt.current.delta;$t<=0&&($t=0),$t+Le>=Pe&&($t=Pe-Le),je({scrollLeft:$t/Pe*(Ce+2)}),jt.current.x=Ze.pageX},st=function(){var Ze=Object(it.b)(Ye.current).top,mt=Ze+Ye.current.offsetHeight,Lt=document.documentElement.scrollTop+window.innerHeight;mt-Object(n.a)()<=Lt||Ze>=Lt-Ue?Bt(function(Mt){return Object(ie.a)(Object(ie.a)({},Mt),{},{isHiddenScrollBar:!0})}):Bt(function(Mt){return Object(ie.a)(Object(ie.a)({},Mt),{},{isHiddenScrollBar:!1})})},It=function(Ze){Bt(function(mt){return Object(ie.a)(Object(ie.a)({},mt),{},{scrollLeft:Ze/Ce*Pe||0})})};return T.useImperativeHandle(tt,function(){return{setScrollLeft:It}}),T.useEffect(function(){var Pt=Object(He.a)(document.body,"mouseup",Oe,!1),Ze=Object(He.a)(document.body,"mousemove",vt,!1);return st(),function(){Pt.remove(),Ze.remove()}},[Le,gt]),T.useEffect(function(){var Pt=Object(He.a)(window,"scroll",st,!1),Ze=Object(He.a)(window,"resize",st,!1);return function(){Pt.remove(),Ze.remove()}},[]),T.useEffect(function(){kt.isHiddenScrollBar||Bt(function(Pt){var Ze,mt;return Object(ie.a)(Object(ie.a)({},Pt),{},{scrollLeft:Ye.current.scrollLeft/((Ze=Ye.current)===null||Ze===void 0?void 0:Ze.scrollWidth)*((mt=Ye.current)===null||mt===void 0?void 0:mt.clientWidth)})})},[kt.isHiddenScrollBar]),Ce<=Pe||!Le||kt.isHiddenScrollBar?null:T.createElement("div",{style:{height:Object(n.a)(),width:Pe,bottom:Ue},className:"".concat(be,"-sticky-scroll")},T.createElement("div",{onMouseDown:ze,ref:Ve,className:O()("".concat(be,"-sticky-scroll-bar"),Object(ce.a)({},"".concat(be,"-sticky-scroll-bar-active"),gt)),style:{width:"".concat(Le,"px"),transform:"translate3d(".concat(kt.scrollLeft,"px, 0, 0)")}}))},P=T.forwardRef(re);function j(Ne,Be){return T.useMemo(function(){var tt=!!Ne;return{isSticky:tt,stickyClassName:tt?"".concat(Be,"-sticky-header"):"",offsetHeader:Object(C.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(C.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,Be])}var ee=[],$={},Q="rc-table-internal-hook",xe=T.memo(function(Ne){var Be=Ne.children;return Be},function(Ne,Be){return p()(Ne.props,Be.props)?Ne.pingLeft!==Be.pingLeft||Ne.pingRight!==Be.pingRight:!1});function De(Ne){var Be,tt=Ne.prefixCls,lt=Ne.className,qe=Ne.rowClassName,Ye=Ne.style,je=Ne.data,Ue=Ne.rowKey,ke=Ne.scroll,be=Ne.tableLayout,Ce=Ne.direction,Pe=Ne.title,Le=Ne.footer,Ve=Ne.summary,at=Ne.id,_t=Ne.showHeader,kt=Ne.components,Bt=Ne.emptyText,jt=Ne.onRow,At=Ne.onHeaderRow,pt=Ne.internalHooks,gt=Ne.transformColumns,rt=Ne.internalRefs,Oe=Ne.sticky,ze=je||ee,vt=!!ze.length,st=T.useState(0),It=Object(D.a)(st,2),Pt=It[0],Ze=It[1];T.useEffect(function(){Ze(Object(n.a)())});var mt=T.useMemo(function(){return Object(v.c)(kt,{})},[kt]),Lt=T.useCallback(function(Ht,en){return Object(v.b)(mt,Ht)||en},[mt]),Mt=T.useMemo(function(){return typeof Ue=="function"?Ue:function(Ht){var en=Ht&&Ht[Ue];return en}},[Ue]),$t=Object(x.c)(Ne),Re=$t.expandIcon,ve=$t.expandedRowKeys,X=$t.defaultExpandedRowKeys,ne=$t.defaultExpandAllRows,oe=$t.expandedRowRender,he=$t.onExpand,Ae=$t.onExpandedRowsChange,Qe=$t.expandRowByClick,ot=$t.rowExpandable,Rt=$t.expandIconColumnIndex,Nt=$t.expandedRowClassName,ht=$t.childrenColumnName,Dt=$t.indentSize,sn=Re||me,Ct=ht||"children",hn=T.useMemo(function(){return oe?"row":Ne.expandable&&pt===Q&&Ne.expandable.__PARENT_RENDER_ICON__||ze.some(function(Ht){return Ht&&Object(C.a)(Ht)==="object"&&Ht[Ct]})?"nest":!1},[!!oe,ze]),rn=T.useState(function(){return X||(ne?We(ze,Mt,Ct):[])}),ae=Object(D.a)(rn,2),U=ae[0],H=ae[1],te=T.useMemo(function(){return new Set(ve||U||[])},[ve,U]),pe=T.useCallback(function(Ht){var en=Mt(Ht,ze.indexOf(Ht)),Xt,Et=te.has(en);Et?(te.delete(en),Xt=Object(W.a)(te)):Xt=[].concat(Object(W.a)(te),[en]),H(Xt),he&&he(!Et,Ht),Ae&&Ae(Xt)},[Mt,te,ze,he,Ae]),se=T.useState(0),$e=Object(D.a)(se,2),yt=$e[0],Ot=$e[1],Yt=Object(Te.b)(Object(ie.a)(Object(ie.a)(Object(ie.a)({},Ne),$t),{},{expandable:!!oe,expandedKeys:te,getRowKey:Mt,onTriggerExpand:pe,expandIcon:sn,expandIconColumnIndex:Rt,direction:Ce}),pt===Q?gt:null),St=Object(D.a)(Yt,2),Wt=St[0],ln=St[1],Bn=T.useMemo(function(){return{columns:Wt,flattenColumns:ln}},[Wt,ln]),Oi=T.useRef(),mi=T.useRef(),Wn=T.useRef(),di=T.useState(!1),hr=Object(D.a)(di,2),vi=hr[0],gi=hr[1],xi=T.useState(!1),Bi=Object(D.a)(xi,2),Ai=Bi[0],sr=Bi[1],Di=_e(new Map),fr=Object(D.a)(Di,2),lr=fr[0],Wi=fr[1],Gi=Object(v.a)(ln),vr=Gi.map(function(Ht){return lr.get(Ht)}),Rr=T.useMemo(function(){return vr},[vr.join("_")]),ur=Me(Rr,ln.length,Ce),Hn=ke&&Object(v.d)(ke.y),wn=ke&&Object(v.d)(ke.x),wi=wn&&ln.some(function(Ht){var en=Ht.fixed;return en}),Mn=T.useRef(),Ri=j(Oe,tt),oi=Ri.isSticky,Lr=Ri.offsetHeader,Ni=Ri.offsetScroll,Qi=Ri.stickyClassName,Br,qi,Kr;Hn&&(qi={overflowY:"scroll",maxHeight:ke.y}),wn&&(Br={overflowX:"auto"},Hn||(qi={overflowY:"hidden"}),Kr={width:ke.x===!0?"auto":ke.x,minWidth:"100%"});var Nr=T.useCallback(function(Ht,en){Wi(function(Xt){var Et=new Map(Xt);return Et.set(Ht,en),Et})},[]),Ir=ye(null),Jr=Object(D.a)(Ir,2),xr=Jr[0],Qr=Jr[1];function qr(Ht,en){if(!en)return;typeof en=="function"?en(Ht):en.scrollLeft!==Ht&&(en.scrollLeft=Ht)}var _r=function(en){var Xt=en.currentTarget,Et=en.scrollLeft,bt=typeof Et=="number"?Et:Xt.scrollLeft,Jt=Xt||$;if(!Qr()||Qr()===Jt){var wt;xr(Jt),qr(bt,mi.current),qr(bt,Wn.current),qr(bt,(wt=Mn.current)===null||wt===void 0?void 0:wt.setScrollLeft)}if(Xt){var cn=Xt.scrollWidth,Ft=Xt.clientWidth;gi(bt>0),sr(bt<cn-Ft)}},ea=function(){Wn.current&&_r({currentTarget:Wn.current})},fn=function(en){var Xt=en.width;ea(),Ot(Oi.current?Oi.current.offsetWidth:Xt)};T.useEffect(function(){return ea},[]),T.useEffect(function(){wn&&ea()},[wn]),T.useEffect(function(){pt===Q&&rt&&(rt.body.current=Wn.current)});var Cn=Lt(["table"],"table"),mn=T.useMemo(function(){return be||(wi?ke.x==="max-content"?"auto":"fixed":Hn||ln.some(function(Ht){var en=Ht.ellipsis;return en})?"fixed":"auto")},[Hn,wi,ln,be]),Un,ni={colWidths:Rr,columCount:ln.length,stickyOffsets:ur,onHeaderRow:At,fixHeader:Hn},_i=T.useMemo(function(){return vt?null:typeof Bt=="function"?Bt():Bt},[vt,Bt]),nn=T.createElement(de,{data:ze,measureColumnWidth:Hn||wn||oi,expandedKeys:te,rowExpandable:ot,getRowKey:Mt,onRow:jt,emptyNode:_i,childrenColumnName:Ct}),Li=T.createElement(E,{colWidths:ln.map(function(Ht){var en=Ht.width;return en}),columns:ln}),Zi=Ve&&T.createElement(Ee.b,null,Ve(ze)),zn=Lt(["body"]);if(Hn||oi){var Dr;typeof zn=="function"?(Dr=zn(ze,{scrollbarSize:Pt,ref:Wn,onScroll:_r}),ni.colWidths=ln.map(function(Ht,en){var Xt=Ht.width,Et=en===Wt.length-1?Xt-Pt:Xt;return typeof Et=="number"&&!Number.isNaN(Et)?Et:(Object(c.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Dr=T.createElement("div",{style:Object(ie.a)(Object(ie.a)({},Br),qi),onScroll:_r,ref:Wn,className:O()("".concat(tt,"-body"))},T.createElement(Cn,{style:Object(ie.a)(Object(ie.a)({},Kr),{},{tableLayout:mn})},Li,nn,Zi),oi&&T.createElement(P,{ref:Mn,offsetScroll:Ni,scrollBodyRef:Wn,onScroll:_r})),Un=T.createElement(T.Fragment,null,_t!==!1&&T.createElement(R,Object.assign({noData:!ze.length},ni,Bn,{direction:Ce,offsetHeader:Lr,stickyClassName:Qi,ref:mi,onScroll:_r})),Dr)}else Un=T.createElement("div",{style:Object(ie.a)(Object(ie.a)({},Br),qi),className:O()("".concat(tt,"-content")),onScroll:_r,ref:Wn},T.createElement(Cn,{style:Object(ie.a)(Object(ie.a)({},Kr),{},{tableLayout:mn})},Li,_t!==!1&&T.createElement(_,Object.assign({},ni,Bn)),nn,Zi));var hi=Object(x.b)(Ne),Vi=T.createElement("div",Object.assign({className:O()(tt,lt,(Be={},Object(ce.a)(Be,"".concat(tt,"-rtl"),Ce==="rtl"),Object(ce.a)(Be,"".concat(tt,"-ping-left"),vi),Object(ce.a)(Be,"".concat(tt,"-ping-right"),Ai),Object(ce.a)(Be,"".concat(tt,"-layout-fixed"),be==="fixed"),Object(ce.a)(Be,"".concat(tt,"-fixed-header"),Hn),Object(ce.a)(Be,"".concat(tt,"-fixed-column"),wi),Object(ce.a)(Be,"".concat(tt,"-scroll-horizontal"),wn),Object(ce.a)(Be,"".concat(tt,"-has-fix-left"),ln[0]&&ln[0].fixed),Object(ce.a)(Be,"".concat(tt,"-has-fix-right"),ln[ln.length-1]&&ln[ln.length-1].fixed==="right"),Be)),style:Ye,id:at,ref:Oi},hi),T.createElement(xe,{pingLeft:vi,pingRight:Ai,props:Object(ie.a)(Object(ie.a)({},Ne),{},{stickyOffsets:ur,mergedExpandedKeys:te})},Pe&&T.createElement(Ge,{className:"".concat(tt,"-title")},Pe(ze)),T.createElement("div",{className:"".concat(tt,"-container")},Un),Le&&T.createElement(Ge,{className:"".concat(tt,"-footer")},Le(ze))));wn&&(Vi=T.createElement(s.a,{onResize:fn},Vi));var ct=T.useMemo(function(){return{prefixCls:tt,getComponent:Lt,scrollbarSize:Pt,direction:Ce,fixedInfoList:ln.map(function(Ht,en){return d(en,en,ln,ur,Ce)}),isSticky:oi}},[tt,Lt,Pt,Ce,ln,ur,Ce,oi]),xt=T.useMemo(function(){return Object(ie.a)(Object(ie.a)({},Bn),{},{tableLayout:mn,rowClassName:qe,expandedRowClassName:Nt,componentWidth:yt,fixHeader:Hn,fixColumn:wi,horizonScroll:wn,expandIcon:sn,expandableType:hn,expandRowByClick:Qe,expandedRowRender:oe,onTriggerExpand:pe,expandIconColumnIndex:Rt,indentSize:Dt})},[Bn,mn,qe,Nt,yt,Hn,wi,wn,sn,hn,Qe,oe,pe,Rt,Dt]),zt=T.useMemo(function(){return{onColumnResize:Nr}},[Nr]);return T.createElement(t.a.Provider,{value:ct},T.createElement(F.Provider,{value:xt},T.createElement(J.Provider,{value:zt},Vi)))}De.Column=r.a,De.ColumnGroup=o.a,De.Summary=Ee.a,De.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var dt=Xe.b=De},wRmb:function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return p});var ce=V("rePB"),ie=V("KQm4"),W=V("VTBJ"),C=V("Ff2n"),D=V("cDcd"),T=V.n(D),A=V("Kwbf"),O=V("Zm9Q"),f=V("hW8S");function p(r){return Object(O.a)(r).filter(function(l){return D.isValidElement(l)}).map(function(l){var a=l.key,i=l.props,t=i.children,d=Object(C.a)(i,["children"]),v=Object(W.a)({key:a},d);return t&&(v.children=p(t)),v})}function c(r){return r.reduce(function(l,a){var i=a.fixed,t=i===!0?"left":i,d=a.children;return d&&d.length>0?[].concat(Object(ie.a)(l),Object(ie.a)(c(d).map(function(v){return Object(W.a)({fixed:t},v)}))):[].concat(Object(ie.a)(l),[Object(W.a)(Object(W.a)({},a),{},{fixed:t})])},[])}function s(r){for(var l=!0,a=0;a<r.length;a+=1){var i=r[a];if(l&&i.fixed!=="left")l=!1;else if(!l&&i.fixed==="left"){Object(A.a)(!1,"Index ".concat(a-1," of `columns` missing `fixed='left'` prop."));break}}for(var t=!0,d=r.length-1;d>=0;d-=1){var v=r[d];if(t&&v.fixed!=="right")t=!1;else if(!t&&v.fixed==="right"){Object(A.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function n(r){return r.map(function(l){var a=l.fixed,i=Object(C.a)(l,["fixed"]),t=a;return a==="left"?t="right":a==="right"&&(t="left"),Object(W.a)({fixed:t},i)})}function o(r,l){var a=r.prefixCls,i=r.columns,t=r.children,d=r.expandable,v=r.expandedKeys,y=r.getRowKey,b=r.onTriggerExpand,g=r.expandIcon,m=r.rowExpandable,_=r.expandIconColumnIndex,x=r.direction,h=r.expandRowByClick,E=D.useMemo(function(){return i||p(t)},[i,t]),S=D.useMemo(function(){if(d){var N,F=_||0,z=E[F],q=(N={},Object(ce.a)(N,f.a,{className:"".concat(a,"-expand-icon-col")}),Object(ce.a)(N,"title",""),Object(ce.a)(N,"fixed",z?z.fixed:null),Object(ce.a)(N,"className","".concat(a,"-row-expand-icon-cell")),Object(ce.a)(N,"render",function(G,J,K){var Z=y(J,K),le=v.has(Z),de=m?m(J):!0,Te=g({prefixCls:a,expanded:le,expandable:de,record:J,onExpand:b});return h?D.createElement("span",{onClick:function(Ie){return Ie.stopPropagation()}},Te):Te}),N),B=E.slice();return F>=0&&B.splice(F,0,q),B}return E},[d,E,y,v,g,x]),w=D.useMemo(function(){var N=S;return l&&(N=l(N)),N.length||(N=[{render:function(){return null}}]),N},[l,S,x]),R=D.useMemo(function(){return x==="rtl"?n(c(w)):c(w)},[w,x]);return[w,R]}Xe.b=o},wW8i:function(nt,Xe,V){nt.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(nt,Xe,V){"use strict";V.d(Xe,"a",function(){return c}),V.d(Xe,"b",function(){return n});var ce=/margin|padding|width|height|max|min|offset/,ie={left:!0,top:!0},W={cssFloat:1,styleFloat:1,float:1};function C(o){return o.nodeType===1?o.ownerDocument.defaultView.getComputedStyle(o,null):{}}function D(o,r,l){if(r=r.toLowerCase(),l==="auto"){if(r==="height")return o.offsetHeight;if(r==="width")return o.offsetWidth}return r in ie||(ie[r]=ce.test(r)),ie[r]?parseFloat(l)||0:l}function T(o,r){var l=arguments.length,a=C(o);return r=W[r]?"cssFloat"in o.style?"cssFloat":"styleFloat":r,l===1?a:D(o,r,a[r]||o.style[r])}function A(o,r,l){var a=arguments.length;if(r=W[r]?"cssFloat"in o.style?"cssFloat":"styleFloat":r,a===3)return typeof l=="number"&&ce.test(r)&&(l="".concat(l,"px")),o.style[r]=l,l;for(var i in r)r.hasOwnProperty(i)&&A(o,i,r[i]);return C(o)}function O(o){return o===document.body?document.documentElement.clientWidth:o.offsetWidth}function f(o){return o===document.body?window.innerHeight||document.documentElement.clientHeight:o.offsetHeight}function p(){var o=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:o,height:r}}function c(){var o=document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight;return{width:o,height:r}}function s(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function n(o){var r=o.getBoundingClientRect(),l=document.documentElement;return{left:r.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:r.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},ynwM:function(nt,Xe,V){var ce=V("MFOe"),ie=ce.Global;nt.exports={name:"oldFF-globalStorage",read:C,write:D,each:T,remove:A,clearAll:O};var W=ie.globalStorage;function C(f){return W[f]}function D(f,p){W[f]=p}function T(f){for(var p=W.length-1;p>=0;p--){var c=W.key(p);f(W[c],c)}}function A(f){return W.removeItem(f)}function O(){T(function(f,p){delete W[f]})}}}]);
|