(window.webpackJsonp=window.webpackJsonp||[]).push([[145,5,7,8],{"+NIl":function(ut,$e,J){(function(re){re(J("VrN/"))})(function(re){"use strict";re.defineMode("stex",function(z,L){"use strict";function H(A,_){A.cmdState.push(_)}function k(A){return A.cmdState.length>0?A.cmdState[A.cmdState.length-1]:null}function P(A){var _=A.cmdState.pop();_&&_.closeBracket()}function F(A){for(var _=A.cmdState,b=_.length-1;b>=0;b--){var d=_[b];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function M(A,_,b){return function(){this.name=A,this.bracketNo=0,this.style=_,this.styles=b,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var D={};D.importmodule=M("importmodule","tag",["string","builtin"]),D.documentclass=M("documentclass","tag",["","atom"]),D.usepackage=M("usepackage","tag",["atom"]),D.begin=M("begin","tag",["atom"]),D.end=M("end","tag",["atom"]),D.label=M("label","tag",["atom"]),D.ref=M("ref","tag",["atom"]),D.eqref=M("eqref","tag",["atom"]),D.cite=M("cite","tag",["atom"]),D.bibitem=M("bibitem","tag",["atom"]),D.Bibitem=M("Bibitem","tag",["atom"]),D.RBibitem=M("RBibitem","tag",["atom"]),D.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(A,_){A.f=_}function E(A,_){var b;if(A.match(/^\\[a-zA-Z@]+/)){var d=A.current().slice(1);return b=D.hasOwnProperty(d)?D[d]:D.DEFAULT,b=new b,H(_,b),R(_,T),b.style}if(A.match(/^\\[$&%#{}_]/))return"tag";if(A.match(/^\\[,;!\/\\]/))return"tag";if(A.match("\\["))return R(_,function(u,l){return w(u,l,"\\]")}),"keyword";if(A.match("\\("))return R(_,function(u,l){return w(u,l,"\\)")}),"keyword";if(A.match("$$"))return R(_,function(u,l){return w(u,l,"$$")}),"keyword";if(A.match("$"))return R(_,function(u,l){return w(u,l,"$")}),"keyword";var s=A.next();if(s=="%")return A.skipToEnd(),"comment";if(s=="}"||s=="]"){if(b=k(_),b)b.closeBracket(s),R(_,T);else return"error";return"bracket"}else return s=="{"||s=="["?(b=D.DEFAULT,b=new b,H(_,b),"bracket"):/\d/.test(s)?(A.eatWhile(/[\w.%]/),"atom"):(A.eatWhile(/[\w\-_]/),b=F(_),b.name=="begin"&&(b.argument=A.current()),b.styleIdentifier())}function w(A,_,b){if(A.eatSpace())return null;if(b&&A.match(b))return R(_,E),"keyword";if(A.match(/^\\[a-zA-Z@]+/))return"tag";if(A.match(/^[a-zA-Z]+/))return"variable-2";if(A.match(/^\\[$&%#{}_]/))return"tag";if(A.match(/^\\[,;!\/]/))return"tag";if(A.match(/^[\^_&]/))return"tag";if(A.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(A.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=A.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(A.skipToEnd(),"comment"):"error"}function T(A,_){var b=A.peek(),d;return b=="{"||b=="["?(d=k(_),d.openBracket(b),A.eat(b),R(_,E),"bracket"):/[ \t\r]/.test(b)?(A.eat(b),null):(R(_,E),P(_),E(A,_))}return{startState:function(){var A=L.inMathMode?function(_,b){return w(_,b)}:E;return{cmdState:[],f:A}},copyState:function(A){return{cmdState:A.cmdState.slice(),f:A.f}},token:function(A,_){return _.f(A,_)},blankLine:function(A){A.f=E,A.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"19Vz":function(ut,$e,J){(function(re){re(J("VrN/"))})(function(re){re.defineOption("placeholder","",function(M,D,R){var E=R&&R!=re.Init;if(D&&!E)M.on("blur",k),M.on("change",P),M.on("swapDoc",P),re.on(M.getInputField(),"compositionupdate",M.state.placeholderCompose=function(){H(M)}),P(M);else if(!D&&E){M.off("blur",k),M.off("change",P),M.off("swapDoc",P),re.off(M.getInputField(),"compositionupdate",M.state.placeholderCompose),z(M);var w=M.getWrapperElement();w.className=w.className.replace(" CodeMirror-empty","")}D&&!M.hasFocus()&&k(M)});function z(M){M.state.placeholder&&(M.state.placeholder.parentNode.removeChild(M.state.placeholder),M.state.placeholder=null)}function L(M){z(M);var D=M.state.placeholder=document.createElement("pre");D.style.cssText="height: 0; overflow: visible",D.style.direction=M.getOption("direction"),D.className="CodeMirror-placeholder CodeMirror-line-like";var R=M.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),D.appendChild(R),M.display.lineSpace.insertBefore(D,M.display.lineSpace.firstChild)}function H(M){setTimeout(function(){var D=!1,R=M.getInputField();R.nodeName=="TEXTAREA"?D=!R.value:M.lineCount()==1&&(D=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),D?L(M):z(M)},20)}function k(M){F(M)&&L(M)}function P(M){var D=M.getWrapperElement(),R=F(M);D.className=D.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?L(M):z(M)}function F(M){return M.lineCount()===1&&M.getLine(0)===""}})},"1eCo":function(ut,$e,J){(function(re){re(J("VrN/"))})(function(re){"use strict";var z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(H,k){var P=H.indentUnit,F={},M=k.htmlMode?z:L;for(var D in M)F[D]=M[D];for(var D in k)F[D]=k[D];var R,E;function w(a,m){function p(U){return m.tokenize=U,U(a,m)}var v=a.next();if(v=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?p(_("atom","]]>")):null:a.match("--")?p(_("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),p(b(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),m.tokenize=_("meta","?>"),"meta"):(R=a.eat("/")?"closeTag":"openTag",m.tokenize=T,"tag bracket");if(v=="&"){var O;return a.eat("#")?a.eat("x")?O=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):O=a.eatWhile(/[\d]/)&&a.eat(";"):O=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),O?"atom":"error"}else return a.eatWhile(/[^&<]/),null}w.isInText=!0;function T(a,m){var p=a.next();if(p==">"||p=="/"&&a.eat(">"))return m.tokenize=w,R=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return R="equals",null;if(p=="<"){m.tokenize=w,m.state=l,m.tagName=m.tagStart=null;var v=m.tokenize(a,m);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(p)?(m.tokenize=A(p),m.stringStartCol=a.column(),m.tokenize(a,m)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function A(a){var m=function(p,v){for(;!p.eol();)if(p.next()==a){v.tokenize=T;break}return"string"};return m.isInAttribute=!0,m}function _(a,m){return function(p,v){for(;!p.eol();){if(p.match(m)){v.tokenize=w;break}p.next()}return a}}function b(a){return function(m,p){for(var v;(v=m.next())!=null;){if(v=="<")return p.tokenize=b(a+1),p.tokenize(m,p);if(v==">")if(a==1){p.tokenize=w;break}else return p.tokenize=b(a-1),p.tokenize(m,p)}return"meta"}}function d(a,m,p){this.prev=a.context,this.tagName=m,this.indent=a.indented,this.startOfLine=p,(F.doNotIndent.hasOwnProperty(m)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function s(a){a.context&&(a.context=a.context.prev)}function u(a,m){for(var p;;){if(!a.context)return;if(p=a.context.tagName,!F.contextGrabbers.hasOwnProperty(p)||!F.contextGrabbers[p].hasOwnProperty(m))return;s(a)}}function l(a,m,p){return a=="openTag"?(p.tagStart=m.column(),S):a=="closeTag"?h:l}function S(a,m,p){return a=="word"?(p.tagName=m.current(),E="tag",y):F.allowMissingTagName&&a=="endTag"?(E="tag bracket",y(a,m,p)):(E="error",S)}function h(a,m,p){if(a=="word"){var v=m.current();return p.context&&p.context.tagName!=v&&F.implicitlyClosed.hasOwnProperty(p.context.tagName)&&s(p),p.context&&p.context.tagName==v||F.matchClosing===!1?(E="tag",g):(E="tag error",C)}else return F.allowMissingTagName&&a=="endTag"?(E="tag bracket",g(a,m,p)):(E="error",C)}function g(a,m,p){return a!="endTag"?(E="error",g):(s(p),l)}function C(a,m,p){return E="error",g(a,m,p)}function y(a,m,p){if(a=="word")return E="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var v=p.tagName,O=p.tagStart;return p.tagName=p.tagStart=null,a=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(v)?u(p,v):(u(p,v),p.context=new d(p,v,O==p.indented)),l}return E="error",y}function f(a,m,p){return a=="equals"?c:(F.allowMissing||(E="error"),y(a,m,p))}function c(a,m,p){return a=="string"?o:a=="word"&&F.allowUnquoted?(E="string",y):(E="error",y(a,m,p))}function o(a,m,p){return a=="string"?o:y(a,m,p)}return{startState:function(a){var m={tokenize:w,state:l,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(m.baseIndent=a),m},token:function(a,m){if(!m.tagName&&a.sol()&&(m.indented=a.indentation()),a.eatSpace())return null;R=null;var p=m.tokenize(a,m);return(p||R)&&p!="comment"&&(E=null,m.state=m.state(R||p,a,m),E&&(p=E=="error"?p+" error":E)),p},indent:function(a,m,p){var v=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+P;if(v&&v.noIndent)return re.Pass;if(a.tokenize!=T&&a.tokenize!=w)return p?p.match(/^(\s*)/)[0].length:0;if(a.tagName)return F.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+P*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/$/,blockCommentStart:"",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=y)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var m=[],p=a.context;p;p=p.prev)p.tagName&&m.push(p.tagName);return m.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(ut,$e,J){"use strict";J.d($e,"a",function(){return u});var re=J("Ty5D"),z=J("dI71"),L=J("q1tI"),H=J.n(L),k=J("YS25"),P=J("17x9"),F=J.n(P),M=J("wx14"),D=J("zLVn"),R=J("9R94"),E=function(c){Object(z.a)(o,c);function o(){for(var m,p=arguments.length,v=new Array(p),O=0;O=0||p.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;c.setState({goInputText:""}),U(c.getValidValue())},c.go=function(p){var v=c.state.goInputText;if(v==="")return;(p.keyCode===A.ENTER||p.type==="click")&&(c.setState({goInputText:""}),c.props.quickGo(c.getValidValue()))},c}return Object(k.a)(f,[{key:"getValidValue",value:function(){var o=this.state,a=o.goInputText,m=o.current;return!a||isNaN(a)?m:Number(a)}},{key:"getPageSizeOptions",value:function(){var o=this.props,a=o.pageSize,m=o.pageSizeOptions;return m.some(function(p){return p.toString()===a.toString()})?m:m.concat([a.toString()]).sort(function(p,v){var O=isNaN(Number(p))?0:Number(p),U=isNaN(Number(v))?0:Number(v);return O-U})}},{key:"render",value:function(){var o=this,a=this.props,m=a.pageSize,p=a.locale,v=a.rootPrefixCls,O=a.changeSize,U=a.quickGo,j=a.goButton,G=a.selectComponentClass,B=a.buildOptionText,N=a.selectPrefixCls,V=a.disabled,$=this.state.goInputText,ie="".concat(v,"-options"),oe=G,_e=null,fe=null,Se=null;if(!O&&!U)return null;var be=this.getPageSizeOptions();if(O&&oe){var me=be.map(function(le,ue){return D.a.createElement(oe.Option,{key:ue,value:le.toString()},(B||o.buildOptionText)(le))});_e=D.a.createElement(oe,{disabled:V,prefixCls:N,showSearch:!1,className:"".concat(ie,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(m||be[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},me)}return U&&(j&&(Se=typeof j=="boolean"?D.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(ie,"-quick-jumper-button")},p.jump_to_confirm):D.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),fe=D.a.createElement("div",{className:"".concat(ie,"-quick-jumper")},p.jump_to,D.a.createElement("input",{disabled:V,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,Se)),D.a.createElement("li",{className:"".concat(ie)},_e,fe)}}]),f}(D.a.Component);_.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=_,d=J("N2Kk");function s(){}function u(C){return typeof C=="number"&&isFinite(C)&&Math.floor(C)===C}function l(C,y,f){return f}function S(C,y,f){var c=typeof C=="undefined"?y.pageSize:C;return Math.floor((f.total-1)/c)+1}var h=function(C){Object(P.a)(f,C);var y=Object(F.a)(f);function f(c){var o;Object(H.a)(this,f),o=y.call(this,c),o.getJumpPrevPage=function(){return Math.max(1,o.state.current-(o.props.showLessItems?3:5))},o.getJumpNextPage=function(){return Math.min(S(void 0,o.state,o.props),o.state.current+(o.props.showLessItems?3:5))},o.getItemIcon=function(O,U){var j=o.props.prefixCls,G=O||D.a.createElement("button",{type:"button","aria-label":U,className:"".concat(j,"-item-link")});return typeof O=="function"&&(G=D.a.createElement(O,Object(L.a)({},o.props))),G},o.savePaginationNode=function(O){o.paginationNode=O},o.isValid=function(O){return u(O)&&O!==o.state.current},o.shouldDisplayQuickJumper=function(){var O=o.props,U=O.showQuickJumper,j=O.pageSize,G=O.total;return G<=j?!1:U},o.handleKeyDown=function(O){(O.keyCode===A.ARROW_UP||O.keyCode===A.ARROW_DOWN)&&O.preventDefault()},o.handleKeyUp=function(O){var U=o.getValidValue(O),j=o.state.currentInputValue;U!==j&&o.setState({currentInputValue:U}),O.keyCode===A.ENTER?o.handleChange(U):O.keyCode===A.ARROW_UP?o.handleChange(U-1):O.keyCode===A.ARROW_DOWN&&o.handleChange(U+1)},o.changePageSize=function(O){var U=o.state.current,j=S(O,o.state,o.props);U=U>j?j:U,j===0&&(U=o.state.current),typeof O=="number"&&("pageSize"in o.props||o.setState({pageSize:O}),"current"in o.props||o.setState({current:U,currentInputValue:U})),o.props.onShowSizeChange(U,O),"onChange"in o.props&&o.props.onChange&&o.props.onChange(U,O)},o.handleChange=function(O){var U=o.props.disabled,j=O;if(o.isValid(j)&&!U){var G=S(void 0,o.state,o.props);j>G?j=G:j<1&&(j=1),"current"in o.props||o.setState({current:j,currentInputValue:j});var B=o.state.pageSize;return o.props.onChange(j,B),j}return o.state.current},o.prev=function(){o.hasPrev()&&o.handleChange(o.state.current-1)},o.next=function(){o.hasNext()&&o.handleChange(o.state.current+1)},o.jumpPrev=function(){o.handleChange(o.getJumpPrevPage())},o.jumpNext=function(){o.handleChange(o.getJumpNextPage())},o.hasPrev=function(){return o.state.current>1},o.hasNext=function(){return o.state.current2?j-2:0),B=2;B=m?v=m:v=Number(a),v}},{key:"getShowSizeChanger",value:function(){var o=this.props,a=o.showSizeChanger,m=o.total,p=o.totalBoundaryShowSizeChanger;return typeof a!="undefined"?a:m>p}},{key:"renderPrev",value:function(o){var a=this.props,m=a.prevIcon,p=a.itemRender,v=p(o,"prev",this.getItemIcon(m,"prev page")),O=!this.hasPrev();return Object(M.isValidElement)(v)?Object(M.cloneElement)(v,{disabled:O}):v}},{key:"renderNext",value:function(o){var a=this.props,m=a.nextIcon,p=a.itemRender,v=p(o,"next",this.getItemIcon(m,"next page")),O=!this.hasNext();return Object(M.isValidElement)(v)?Object(M.cloneElement)(v,{disabled:O}):v}},{key:"render",value:function(){var o=this,a=this.props,m=a.prefixCls,p=a.className,v=a.style,O=a.disabled,U=a.hideOnSinglePage,j=a.total,G=a.locale,B=a.showQuickJumper,N=a.showLessItems,V=a.showTitle,$=a.showTotal,ie=a.simple,oe=a.itemRender,_e=a.showPrevNextJumpers,fe=a.jumpPrevIcon,Se=a.jumpNextIcon,be=a.selectComponentClass,me=a.selectPrefixCls,le=a.pageSizeOptions,ue=this.state,Ee=ue.current,Ge=ue.pageSize,Te=ue.currentInputValue;if(U===!0&&j<=Ge)return null;var pe=S(void 0,this.state,this.props),Ae=[],Ce=null,we=null,Be=null,Qe=null,je=null,De=B&&B.goButton,Pe=N?1:2,Le=Ee-1>0?Ee-1:0,Re=Ee+1=Pe*2&&Ee!==1+2&&(Ae[0]=Object(M.cloneElement)(Ae[0],{className:"".concat(m,"-item-after-jump-prev")}),Ae.unshift(Ce)),pe-Ee>=Pe*2&&Ee!==pe-2&&(Ae[Ae.length-1]=Object(M.cloneElement)(Ae[Ae.length-1],{className:"".concat(m,"-item-before-jump-next")}),Ae.push(we)),Ye!==1&&Ae.unshift(Be),He!==pe&&Ae.push(Qe)}var se=null;$&&(se=D.a.createElement("li",{className:"".concat(m,"-total-text")},$(j,[j===0?0:(Ee-1)*Ge+1,Ee*Ge>j?j:Ee*Ge])));var te=!this.hasPrev()||!pe,ee=!this.hasNext()||!pe;return D.a.createElement("ul",Object(re.a)({className:E()(m,p,Object(z.a)({},"".concat(m,"-disabled"),O)),style:v,unselectable:"unselectable",ref:this.savePaginationNode},Ue),se,D.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(m,"-prev"),Object(z.a)({},"".concat(m,"-disabled"),te)),"aria-disabled":te},this.renderPrev(Le)),Ae,D.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:ee?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(m,"-next"),Object(z.a)({},"".concat(m,"-disabled"),ee)),"aria-disabled":ee},this.renderNext(Re)),D.a.createElement(b,{disabled:O,locale:G,rootPrefixCls:m,selectComponentClass:be,selectPrefixCls:me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ee,pageSize:Ge,pageSizeOptions:le,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:De}))}}],[{key:"getDerivedStateFromProps",value:function(o,a){var m={};if("current"in o&&(m.current=o.current,o.current!==a.current&&(m.currentInputValue=m.current)),"pageSize"in o&&o.pageSize!==a.pageSize){var p=a.current,v=S(o.pageSize,a,o);p=p>v?v:p,"current"in o||(m.current=p,m.currentInputValue=p),m.pageSize=o.pageSize}return m}}]),f}(D.a.Component);h.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:d.a,style:{},itemRender:l,totalBoundaryShowSizeChanger:50};var g=h},"6S+g":function(ut,$e,J){"use strict";var re=J("PpiC"),z=J("q1tI"),L=J.n(z),H=J("8h34"),k=J.n(H),P=J("9BLJ"),F=J("BtR2"),M=J("WhZy"),D=J("sNeV"),R=J("m3rI"),E=J("9kvl"),w=function(A){var _=A.user,b=Object(re.a)(A,["user"]),d=_.userInfo;return L.a.createElement("ul",{className:k.a.forumList},b.memos.map(function(s,u){var l={index:u,admin:d&&d.admin,banned_permission:s.banned_permission,login:d&&d.login,is_currentUser:d&&s.user_login===d.login,is_fine:s.is_fine,sticky:s.sticky,memo_watched:s.memo_watched,user_banned_permission:s.banned_permission,is_deleted:s.apply_destroy};return L.a.createElement("li",{key:s.id},L.a.createElement("div",{className:k.a.cOuXkk,style:{lineHeight:"36px"}},L.a.createElement("div",{className:k.a.kTLhbM,style:{marginLeft:"-8px"}},L.a.createElement("span",null,L.a.createElement("span",{className:s.tag_name=="\u4EA4\u6D41"?k.a.blue:k.a.orange},"\u3010",s.tag_name,"\u3011")),L.a.createElement("a",{href:"/forums/".concat(s.id),className:"".concat(k.a.taskHide," ").concat(k.a.textTitle)},s.subject),s.sticky===!0?L.a.createElement("span",{className:"".concat(k.a.tag," ").concat(k.a.tagRed)},"\u7F6E\u9876"):"",s.is_original===!0?L.a.createElement("span",{className:"".concat(k.a.tag," ").concat(k.a.tagOrange)},"\u539F\u521B"):"",s.is_fine===!0?L.a.createElement("span",{className:"".concat(k.a.tag," ").concat(k.a.tagBlue)},"\u7CBE\u534E"):""),L.a.createElement("div",{className:k.a.kTLhbM},s.apply_destroy?L.a.createElement("span",{className:"".concat(k.a.orange," mr10"),style:{fontSize:"12px"}},"\u5DF2\u7533\u8BF7\u5220\u5E16"):"",d&&d.login?L.a.createElement(D.a,{permission:l,id:s.id,calbackFunc:b.calbackFunc}):"")),L.a.createElement("div",{className:k.a.cOuXkk,style:{marginTop:"8px"}},L.a.createElement("div",{className:k.a.kTLhbM},L.a.createElement("a",{href:"/forums/accounts/".concat(s.user_login,"/memos")},L.a.createElement("div",{className:k.a.kTLhbM},L.a.createElement("img",{src:R.a.IMG_SERVER+"/images/"+s.image_url,alt:"",className:k.a.dGqnMq}),L.a.createElement("span",{className:k.a.dicrWo},s.username))),s.forum_section_title?L.a.createElement("a",{href:"",className:"".concat(k.a.iwMcWy," ").concat(k.a.textType)},s.forum_section_title):"",s.published_time?L.a.createElement("span",{className:k.a.iwMcWy},s.published_time):""),L.a.createElement("span",null,L.a.createElement("span",{className:k.a.iconWrap},L.a.createElement(P.a,null),L.a.createElement("span",{className:k.a.spanText},s.viewed_count)),L.a.createElement("span",{className:k.a.iconWrap},L.a.createElement(F.a,null),L.a.createElement("span",{className:k.a.spanText},s.praises_count)),L.a.createElement("span",{className:k.a.iconWrap},L.a.createElement(M.a,null),L.a.createElement("span",{className:k.a.spanText},s.replies_count)))))}))};$e.a=Object(E.a)(function(T){var A=T.user;return{user:A}})(w)},"7ahc":function(ut,$e,J){"use strict";J.d($e,"a",function(){return S});var re=J("k1fw"),z=J("0Owb"),L=J("+L6B"),H=J("2/Rp"),k=J("y8nQ"),P=J("Vl3Y"),F=J("tJVT"),M=J("OaEy"),D=J("2fM7"),R=J("q1tI"),E=J.n(R),w=J("VrN/"),T=J.n(w),A=J("p77/"),_=J.n(A),b=J("c5Ni"),d=J.n(b),s=D.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};$e.b=function(h){var g=h.callback,C=h.onCancel,y=Object(R.useState)("python"),f=Object(F.a)(y,2),c=f[0],o=f[1];function a(p){o(l[p][1])}function m(p){g(p)}return E.a.createElement(P.a,Object(z.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:m}),E.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(D.a,{onChange:a},Object.keys(l).map(function(p){return E.a.createElement(s,{key:p,value:p},l[p][0])}))),E.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(S,{mode:c})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(H.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function S(h){var g=h.value,C=h.onChange,y=h.mode,f=h.options,c=f===void 0?{}:f,o=Object(R.useRef)(),a=Object(R.useState)(),m=Object(F.a)(a,2),p=m[0],v=m[1];return Object(R.useEffect)(function(){if(p){function O(U){var j=U.getValue();C&&C(j)}return p.on("change",O),function(){p.off("change",O)}}},[p,C]),Object(R.useEffect)(function(){p&&p.setOption("mode",y)},[p,y]),Object(R.useEffect)(function(){p&&((g!==p.getValue()||g==="")&&setTimeout(function(){p.setValue(g||" ")},300))},[p,g]),Object(R.useEffect)(function(){if(o.current&&!p){var O=T.a.fromTextArea(o.current,Object(re.a)({mode:y,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));v(O)}},[o.current,p]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:o}))}},"8EBN":function(ut,$e,J){(function(re){re(J("VrN/"))})(function(re){"use strict";re.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var z=0;z-1&&H.substring(F+1,H.length);if(M)return re.findModeByExtension(M)},re.findModeByName=function(H){H=H.toLowerCase();for(var k=0;k=oe.length?_e.slice(oe.length):_e}).join(` `)}var R=[],E=["
    "],w=new F.a.Renderer,T=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){R.length=0,E=["
      "]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function b(V,$,ie,oe){if($>=V.length||V[$].level<=ie)return $;var _e=V[$];oe.push("
    • "+_e.text+""),$++;var fe=[];return $=b(V,$,_e.level,fe),fe.length>0&&(oe.push("
        "),fe.forEach(function(Se){oe.push(Se)}),oe.push("
      ")),oe.push("
    • "),$=b(V,$,ie,oe),$}function d(){return b(R,0,0,E),E.push("
    "),E.join("")}var s={heading:function($){var ie=T.exec($);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},fences:function($){var ie=this.rules.block.fences.exec($);if(ie){var oe=ie[0],_e=D(oe,ie[3]||""),fe=ie[2]?ie[2].trim():ie[2];if(["latex","katex","math"].indexOf(fe)>=0){var Se=S(),be=_e;_e=Se,h[Se]={type:"block",expression:be}}return{type:"code",raw:oe,lang:fe,text:_e}}}},u=/(?:\${2})([^\n`]+?)(?:\${2})/gi,l=0,S=function(){return"__special_katext_id_".concat(l++,"__")},h={};function g(){return h}function C(){l=0,h={}}function y(V){return V=V.replace(u,function($,ie){var oe=S();return h[oe]={type:"inline",expression:ie},oe}),V}var f=w.listitem;w.listitem=function(V){return f(y(V))};var c=w.paragraph;w.paragraph=function(V){return c(y(V))};var o=w.tablecell;w.tablecell=function(V,$){return o(y(V),$)},w.code=function(V,$,ie){var oe=($||"").match(/\S*/)[0];return oe?["latex","katex","math"].indexOf(oe)>=0?"

    ".concat(V,"

    "):'
    ').concat(ie?V:Object(M.escape)(V,!0),`
    `):'
    '+(ie?V:Object(M.escape)(V,!0))+"
    "},w.heading=function(V,$,ie){var oe=this.options.headerPrefix+ie.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return R.push({anchor:oe,level:$,text:V}),"'+V+""},F.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),F.a.use({tokenizer:s,renderer:w});var a=F.a,m=J("SJMd"),p=J("ulZh"),v=J.n(p),O=J("m3rI"),U=J("Oy/b"),j=J("p5ED"),G=/]*>/g;function B(V){var $=document.createElement("div");return $.innerHTML=V,$.childNodes.length===0?"":$.childNodes[0].nodeValue}var N=$e.a=function(V){var $,ie=V.value,oe=ie===void 0?"":ie,_e=V.className,fe=V.showTextOnly,Se=V.showLines,be=V.style,me=be===void 0?{}:be,le=V.stylesPrev,ue=le===void 0?{}:le,Ee=($=String(oe))===null||$===void 0?void 0:$.replace(/|<\/script>/gi,"").replace(/on\w+="[^"]*"/gi,""),Ge=Object(L.useState)(""),Te=Object(z.a)(Ge,2),pe=Te[0],Ae=Te[1],Ce=Object(L.useMemo)(function(){try{var je=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,De=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Pe=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ee=Ee.replace(je,"("+O.a.API_SERVER+"/api/attachments/").replace(De,'"'+O.a.API_SERVER+"/api/attachments/").replace(Pe,'"'+O.a.API_SERVER+"/files/uploads/").replace(/\r\n/g,` `),Ee=Ee.replace(new RegExp("(?[TOC]

    ",d()),A()),Le=Le.replace(/(__special_katext_id_\d+__)/g,function(We,ke){var Ke=Re[ke],ze=Ke.type,ge=Ke.expression;return Object(U.renderToString)(B(ge)||"",{displayMode:ze==="block",throwOnError:!1,output:"html"})}),Le=Le.replace(/▁/g,"\u2581\u2581\u2581"),C(),fe){var Ue=document.createElement("div");return Ue.innerHTML=Le,Ue.innerText}return setTimeout(function(){return Qe()},500),Le},[Ee]),we=Object(L.useRef)();_.WebkitLineClamp=Se,Se&&(me=Object(re.a)(Object(re.a)({},me),_));function Be(je){var De=je.target;if(De.tagName.toUpperCase()==="A"){var Pe=De.getAttribute("href");if(Pe.indexOf("office")>-1)je.preventDefault(),Ae(Pe);else if(Pe.startsWith("#")){je.preventDefault();var Le=document.getElementById(Pe.replace("#",""));Le&&Le.scrollIntoView(!0)}}}var Qe=function(){var De,Pe=(De=we.current)===null||De===void 0?void 0:De.querySelectorAll("video");Pe==null||Pe.forEach(function(Le){if(Le.oncontextmenu=function(){return!1},Le.src.indexOf(".m3u8")>-1&&!Le.canPlayType("application/vnd.apple.mpegurl")){if(v.a.isSupported()){var Re=new v.a;Re.loadSource(Le.src),Re.attachMedia(Le)}}})};return Object(L.useEffect)(function(){if(we.current&&Ce&&(Ce.match(G)&&window.PR.prettyPrint()),we.current)return we.current.addEventListener("click",Be),function(){we.current.removeEventListener("click",Be),C(),A()}},[Ce,we.current,Be]),H.a.createElement(H.a.Fragment,null,H.a.createElement("div",{ref:we,style:Object(re.a)({},me),className:"".concat(_e||""," markdown-body "),dangerouslySetInnerHTML:{__html:Ce}}),H.a.createElement(j.a,{close:!0,data:pe,type:pe!=null&&pe.length?"office":"",style:Object(re.a)({},ue),onClose:function(){return Ae("")}}))}},"9VGf":function(ut,$e,J){"use strict";J.d($e,"a",function(){return L});var re=J("q1tI"),z=J.n(re);function L(H,k){var P=Object(re.useRef)();Object(re.useEffect)(function(){P.current=H}),Object(re.useEffect)(function(){function F(){P.current()}if(k!==null){var M=setInterval(F,k);return function(){return clearInterval(M)}}},[k])}},BU3w:function(ut,$e,J){"use strict";J.d($e,"a",function(){return P});var re=J("MNnm"),z="rc-util-key";function L(F){if(F.attachTo)return F.attachTo;var M=document.querySelector("head");return M||document.body}function H(F){var M,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var R=document.createElement("style");if((M=D.csp)===null||M===void 0?void 0:M.nonce){var E;R.nonce=(E=D.csp)===null||E===void 0?void 0:E.nonce}R.innerHTML=F;var w=L(D),T=w.firstChild;return D.prepend&&w.prepend?w.prepend(R):D.prepend&&T?w.insertBefore(R,T):w.appendChild(R),R}var k=new Map;function P(F,M){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=L(D);if(!k.has(R)){var E=H("",D),w=E.parentNode;k.set(R,w),w.removeChild(E)}var T=Array.from(k.get(R).children).find(function(s){return s.tagName==="STYLE"&&s[z]===M});if(T){var A,_;if(((A=D.csp)===null||A===void 0?void 0:A.nonce)&&T.nonce!==((_=D.csp)===null||_===void 0?void 0:_.nonce)){var b;T.nonce=(b=D.csp)===null||b===void 0?void 0:b.nonce}return T.innerHTML!==F&&(T.innerHTML=F),T}var d=H(F,D);return d[z]=M,d}},Bd2K:function(ut,$e,J){(function(re){re(J("VrN/"),J("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(D,R,E){if(E!=re.Init&&E&&D.removeKeyMap("autoCloseTags"),!R)return;var w={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(w["'/'"]=function(T){return P(T)}),(typeof R!="object"||R.whenOpening!==!1)&&(w["'>'"]=function(T){return H(T)}),D.addKeyMap(w)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["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 H(D){if(D.getOption("disableInput"))return re.Pass;for(var R=D.listSelections(),E=[],w=D.getOption("autoCloseTags"),T=0;TA.ch&&(u=u.slice(0,u.length-_.end+A.ch));var g=u.toLowerCase();if(!u||_.type=="string"&&(_.end!=A.ch||!/[\"\']/.test(_.string.charAt(_.string.length-1))||_.string.length==1)||_.type=="tag"&&s.close||_.string.indexOf("/")==A.ch-_.start-1||S&&F(S,g)>-1||M(D,b.mode.xmlCurrentContext&&b.mode.xmlCurrentContext(d)||[],u,A,!0))return re.Pass;var C=typeof w=="object"&&w.emptyTags;if(C&&F(C,u)>-1){E[T]={text:"/>",newPos:re.Pos(A.line,A.ch+2)};continue}var y=h&&F(h,g)>-1;E[T]={indent:y,text:">"+(y?` `:"")+"",newPos:y?re.Pos(A.line+1,0):re.Pos(A.line,A.ch+1)}}for(var f=typeof w=="object"&&w.dontIndentOnAutoClose,T=R.length-1;T>=0;T--){var c=E[T];D.replaceRange(c.text,R[T].head,R[T].anchor,"+insert");var o=D.listSelections().slice(0);o[T]={head:c.newPos,anchor:c.newPos},D.setSelections(o),!f&&c.indent&&(D.indentLine(c.newPos.line,null,!0),D.indentLine(c.newPos.line+1,null,!0))}}function k(D,R){for(var E=D.listSelections(),w=[],T=R?"/":""&&(S+=">"),w[b]=S}if(D.replaceSelections(w),E=D.listSelections(),!_)for(var b=0;b=0&&R[d]==E;d--)++b;w=_.to;for(var d=1;d0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],E=0;Ese.length)&&(te=se.length);for(var ee=0,Y=new Array(te);ee=se.length?{done:!0}:{done:!1,value:se[Y++]}}}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 ee=se[Symbol.iterator](),ee.next.bind(ee)}function P(se,te){return te={exports:{}},se(te,te.exports),te.exports}var F=P(function(se){function te(){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 ee(Y){se.exports.defaults=Y}se.exports={defaults:te(),getDefaults:te,changeDefaults:ee}}),M=F.defaults,D=F.getDefaults,R=F.changeDefaults,E=/[&<>"']/,w=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,_={"&":"&","<":"<",">":">",'"':""","'":"'"},b=function(te){return _[te]};function d(se,te){if(te){if(E.test(se))return se.replace(w,b)}else if(T.test(se))return se.replace(A,b);return se}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(se){return se.replace(s,function(te,ee){return ee=ee.toLowerCase(),ee==="colon"?":":ee.charAt(0)==="#"?ee.charAt(1)==="x"?String.fromCharCode(parseInt(ee.substring(2),16)):String.fromCharCode(+ee.substring(1)):""})}var l=/(^|[^\[])\^/g;function S(se,te){se=se.source||se,te=te||"";var ee={replace:function(Q,Z){return Z=Z.source||Z,Z=Z.replace(l,"$1"),se=se.replace(Q,Z),ee},getRegex:function(){return new RegExp(se,te)}};return ee}var h=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(se,te,ee){if(se){var Y;try{Y=decodeURIComponent(u(ee)).replace(h,"").toLowerCase()}catch(Q){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}te&&!g.test(ee)&&(ee=a(te,ee));try{ee=encodeURI(ee).replace(/%25/g,"%")}catch(Q){return null}return ee}var y={},f=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(se,te){y[" "+se]||(f.test(se)?y[" "+se]=se+"/":y[" "+se]=O(se,"/",!0)),se=y[" "+se];var ee=se.indexOf(":")===-1;return te.substring(0,2)==="//"?ee?te:se.replace(c,"$1")+te:te.charAt(0)==="/"?ee?te:se.replace(o,"$1")+te:se+te}var m={exec:function(){}};function p(se){for(var te=1,ee,Y;te=0&&de[Me]==="\\";)ye=!ye;return ye?"|":" |"}),Y=ee.split(/ \|/),Q=0;if(Y.length>te)Y.splice(te);else for(;Y.length=Y.length?Q.slice(Y.length):Q}).join(` `)}var fe=function(){function se(ee){this.options=ee||B}var te=se.prototype;return te.space=function(Y){var Q=this.rules.block.newline.exec(Y);if(Q)return Q[0].length>1?{type:"space",raw:Q[0]}:{raw:` `}},te.code=function(Y,Q){var Z=this.rules.block.code.exec(Y);if(Z){var q=Q[Q.length-1];if(q&&q.type==="paragraph")return{raw:Z[0],text:Z[0].trimRight()};var de=Z[0].replace(/^ {4}/gm,"");return{type:"code",raw:Z[0],codeBlockStyle:"indented",text:this.options.pedantic?de:N(de,` `)}}},te.fences=function(Y){var Q=this.rules.block.fences.exec(Y);if(Q){var Z=Q[0],q=_e(Z,Q[3]||"");return{type:"code",raw:Z,lang:Q[2]?Q[2].trim():Q[2],text:q}}},te.heading=function(Y){var Q=this.rules.block.heading.exec(Y);if(Q)return{type:"heading",raw:Q[0],depth:Q[1].length,text:Q[2]}},te.nptable=function(Y){var Q=this.rules.block.nptable.exec(Y);if(Q){var Z={type:"table",header:V(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(` `):[],raw:Q[0]};if(Z.header.length===Z.align.length){var q=Z.align.length,de;for(de=0;de ?/gm,"");return{type:"blockquote",raw:Q[0],text:Z}}},te.list=function(Y){var Q=this.rules.block.list.exec(Y);if(Q){for(var Z=Q[0],q=Q[2],de=q.length>1,ye=q[q.length-1]===")",Me={type:"list",raw:Z,ordered:de,start:de?+q.slice(0,-1):"",loose:!1,items:[]},et=Q[0].match(this.rules.block.item),qe=!1,at,gt,yt,st,_t,xt,Bt,Dt=et.length,pt=0;pt1||this.options.smartLists&&yt!==q)&&(st=et.slice(pt+1).join(` `),Me.raw=Me.raw.substring(0,Me.raw.length-st.length),pt=Dt-1)),_t=qe||/\n\n(?!\s*$)/.test(at),pt!==Dt-1&&(qe=at.charAt(at.length-1)===` `,_t||(_t=qe)),_t&&(Me.loose=!0),xt=/^\[[ xX]\] /.test(at),Bt=void 0,xt&&(Bt=at[1]!==" ",at=at.replace(/^\[[ xX]\] +/,"")),Me.items.push({type:"list_item",raw:Z,task:xt,checked:Bt,loose:_t,text:at});return Me}},te.html=function(Y){var Q=this.rules.block.html.exec(Y);if(Q)return{type:this.options.sanitize?"paragraph":"html",raw:Q[0],pre:!this.options.sanitizer&&(Q[1]==="pre"||Q[1]==="script"||Q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):$(Q[0]):Q[0]}},te.def=function(Y){var Q=this.rules.block.def.exec(Y);if(Q){Q[3]&&(Q[3]=Q[3].substring(1,Q[3].length-1));var Z=Q[1].toLowerCase().replace(/\s+/g," ");return{tag:Z,raw:Q[0],href:Q[2],title:Q[3]}}},te.table=function(Y){var Q=this.rules.block.table.exec(Y);if(Q){var Z={type:"table",header:V(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(` `):[]};if(Z.header.length===Z.align.length){Z.raw=Q[0];var q=Z.align.length,de;for(de=0;de/i.test(q[0])&&(Q=!1),!Z&&/^<(pre|code|kbd|script)(\s|>)/i.test(q[0])?Z=!0:Z&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(q[0])&&(Z=!1),{type:this.options.sanitize?"text":"html",raw:q[0],inLink:Q,inRawBlock:Z,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):$(q[0]):q[0]}},te.link=function(Y){var Q=this.rules.inline.link.exec(Y);if(Q){var Z=ie(Q[2],"()");if(Z>-1){var q=Q[0].indexOf("!")===0?5:4,de=q+Q[1].length+Z;Q[2]=Q[2].substring(0,Z),Q[0]=Q[0].substring(0,de).trim(),Q[3]=""}var ye=Q[2],Me="";if(this.options.pedantic){var et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ye);et?(ye=et[1],Me=et[3]):Me=""}else Me=Q[3]?Q[3].slice(1,-1):"";ye=ye.trim().replace(/^<([\s\S]*)>$/,"$1");var qe=oe(Q,{href:ye&&ye.replace(this.rules.inline._escapes,"$1"),title:Me&&Me.replace(this.rules.inline._escapes,"$1")},Q[0]);return qe}},te.reflink=function(Y,Q){var Z;if((Z=this.rules.inline.reflink.exec(Y))||(Z=this.rules.inline.nolink.exec(Y))){var q=(Z[2]||Z[1]).replace(/\s+/g," ");if(q=Q[q.toLowerCase()],!q||!q.href){var de=Z[0].charAt(0);return{type:"text",raw:de,text:de}}var ye=oe(Z,q,Z[0]);return ye}},te.strong=function(Y,Q,Z){Z===void 0&&(Z="");var q=this.rules.inline.strong.start.exec(Y);if(q&&(!q[1]||q[1]&&(Z===""||this.rules.inline.punctuation.exec(Z)))){Q=Q.slice(-1*Y.length);var de=q[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;de.lastIndex=0;for(var ye;(q=de.exec(Q))!=null;)if(ye=this.rules.inline.strong.middle.exec(Q.slice(0,q.index+3)),ye)return{type:"strong",raw:Y.slice(0,ye[0].length),text:Y.slice(2,ye[0].length-2)}}},te.em=function(Y,Q,Z){Z===void 0&&(Z="");var q=this.rules.inline.em.start.exec(Y);if(q&&(!q[1]||q[1]&&(Z===""||this.rules.inline.punctuation.exec(Z)))){Q=Q.slice(-1*Y.length);var de=q[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;de.lastIndex=0;for(var ye;(q=de.exec(Q))!=null;)if(ye=this.rules.inline.em.middle.exec(Q.slice(0,q.index+2)),ye)return{type:"em",raw:Y.slice(0,ye[0].length),text:Y.slice(1,ye[0].length-1)}}},te.codespan=function(Y){var Q=this.rules.inline.code.exec(Y);if(Q){var Z=Q[2].replace(/\n/g," "),q=/[^ ]/.test(Z),de=Z.startsWith(" ")&&Z.endsWith(" ");return q&&de&&(Z=Z.substring(1,Z.length-1)),Z=$(Z,!0),{type:"codespan",raw:Q[0],text:Z}}},te.br=function(Y){var Q=this.rules.inline.br.exec(Y);if(Q)return{type:"br",raw:Q[0]}},te.del=function(Y){var Q=this.rules.inline.del.exec(Y);if(Q)return{type:"del",raw:Q[0],text:Q[1]}},te.autolink=function(Y,Q){var Z=this.rules.inline.autolink.exec(Y);if(Z){var q,de;return Z[2]==="@"?(q=$(this.options.mangle?Q(Z[1]):Z[1]),de="mailto:"+q):(q=$(Z[1]),de=q),{type:"link",raw:Z[0],text:q,href:de,tokens:[{type:"text",raw:q,text:q}]}}},te.url=function(Y,Q){var Z;if(Z=this.rules.inline.url.exec(Y)){var q,de;if(Z[2]==="@")q=$(this.options.mangle?Q(Z[0]):Z[0]),de="mailto:"+q;else{var ye;do ye=Z[0],Z[0]=this.rules.inline._backpedal.exec(Z[0])[0];while(ye!==Z[0]);q=$(Z[0]),Z[1]==="www."?de="http://"+q:de=q}return{type:"link",raw:Z[0],text:q,href:de,tokens:[{type:"text",raw:q,text:q}]}}},te.inlineText=function(Y,Q,Z){var q=this.rules.inline.text.exec(Y);if(q){var de;return Q?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):$(q[0]):q[0]:de=$(this.options.smartypants?Z(q[0]):q[0]),{type:"text",raw:q[0],text:de}}},se}(),Se=G.noopTest,be=G.edit,me=G.merge,le={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};le._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,le._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,le.def=be(le.def).replace("label",le._label).replace("title",le._title).getRegex(),le.bullet=/(?:[*+-]|\d{1,9}[.)])/,le.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,le.item=be(le.item,"gm").replace(/bull/g,le.bullet).getRegex(),le.list=be(le.list).replace(/bull/g,le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+le.def.source+")").getRegex(),le._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",le._comment=//,le.html=be(le.html,"i").replace("comment",le._comment).replace("tag",le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),le.paragraph=be(le._paragraph).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.blockquote=be(le.blockquote).replace("paragraph",le.paragraph).getRegex(),le.normal=me({},le),le.gfm=me({},le.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*|$)"}),le.gfm.nptable=be(le.gfm.nptable).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.gfm.table=be(le.gfm.table).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.pedantic=me({},le.normal,{html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:be(le.normal._paragraph).replace("hr",le.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ue.punctuation=be(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=be(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=be(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=be(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=be(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=be(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=be(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=be(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=be(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=be(ue._blockSkip,"g").getRegex(),ue.overlapSkip=be(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=be(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=be(ue.tag).replace("comment",le._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=be(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=be(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=be(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=me({},ue),ue.pedantic=me({},ue.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:be(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=me({},ue.normal,{escape:be(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(Y="x"+Y.toString(16)),te+="&#"+Y+";";return te}var we=function(){function se(ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=ee||Ge,this.options.tokenizer=this.options.tokenizer||new fe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:Te.normal,inline:pe.normal};this.options.pedantic?(Y.block=Te.pedantic,Y.inline=pe.pedantic):this.options.gfm&&(Y.block=Te.gfm,this.options.breaks?Y.inline=pe.breaks:Y.inline=pe.gfm),this.tokenizer.rules=Y}se.lex=function(Y,Q){var Z=new se(Q);return Z.lex(Y)};var te=se.prototype;return te.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},te.blockTokens=function(Y,Q,Z){Q===void 0&&(Q=[]),Z===void 0&&(Z=!0),Y=Y.replace(/^ +$/gm,"");for(var q,de,ye,Me;Y;){if(q=this.tokenizer.space(Y)){Y=Y.substring(q.raw.length),q.type&&Q.push(q);continue}if(q=this.tokenizer.code(Y,Q)){Y=Y.substring(q.raw.length),q.type?Q.push(q):(Me=Q[Q.length-1],Me.raw+=` `+q.raw,Me.text+=` `+q.text);continue}if(q=this.tokenizer.fences(Y)){Y=Y.substring(q.raw.length),Q.push(q);continue}if(q=this.tokenizer.heading(Y)){Y=Y.substring(q.raw.length),Q.push(q);continue}if(q=this.tokenizer.nptable(Y)){Y=Y.substring(q.raw.length),Q.push(q);continue}if(q=this.tokenizer.hr(Y)){Y=Y.substring(q.raw.length),Q.push(q);continue}if(q=this.tokenizer.blockquote(Y)){Y=Y.substring(q.raw.length),q.tokens=this.blockTokens(q.text,[],Z),Q.push(q);continue}if(q=this.tokenizer.list(Y)){for(Y=Y.substring(q.raw.length),ye=q.items.length,de=0;de0)for(;(et=this.tokenizer.rules.inline.reflinkSearch.exec(Me))!=null;)qe.includes(et[0].slice(et[0].lastIndexOf("[")+1,-1))&&(Me=Me.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(et=this.tokenizer.rules.inline.blockSkip.exec(Me))!=null;)Me=Me.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(ye=this.tokenizer.escape(Y)){Y=Y.substring(ye.raw.length),Q.push(ye);continue}if(ye=this.tokenizer.tag(Y,Z,q)){Y=Y.substring(ye.raw.length),Z=ye.inLink,q=ye.inRawBlock,Q.push(ye);continue}if(ye=this.tokenizer.link(Y)){Y=Y.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,q)),Q.push(ye);continue}if(ye=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(ye.raw.length),ye.type==="link"&&(ye.tokens=this.inlineTokens(ye.text,[],!0,q)),Q.push(ye);continue}if(ye=this.tokenizer.strong(Y,Me,de)){Y=Y.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],Z,q),Q.push(ye);continue}if(ye=this.tokenizer.em(Y,Me,de)){Y=Y.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],Z,q),Q.push(ye);continue}if(ye=this.tokenizer.codespan(Y)){Y=Y.substring(ye.raw.length),Q.push(ye);continue}if(ye=this.tokenizer.br(Y)){Y=Y.substring(ye.raw.length),Q.push(ye);continue}if(ye=this.tokenizer.del(Y)){Y=Y.substring(ye.raw.length),ye.tokens=this.inlineTokens(ye.text,[],Z,q),Q.push(ye);continue}if(ye=this.tokenizer.autolink(Y,Ce)){Y=Y.substring(ye.raw.length),Q.push(ye);continue}if(!Z&&(ye=this.tokenizer.url(Y,Ce))){Y=Y.substring(ye.raw.length),Q.push(ye);continue}if(ye=this.tokenizer.inlineText(Y,q,Ae)){Y=Y.substring(ye.raw.length),de=ye.raw.slice(-1),Q.push(ye);continue}if(Y){var at="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return Q},z(se,null,[{key:"rules",get:function(){return{block:Te,inline:pe}}}]),se}(),Be=F.defaults,Qe=G.cleanUrl,je=G.escape,De=function(){function se(ee){this.options=ee||Be}var te=se.prototype;return te.code=function(Y,Q,Z){var q=(Q||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(Y,q);de!=null&&de!==Y&&(Z=!0,Y=de)}return q?'
    '+(Z?Y:je(Y,!0))+`
    `:"
    "+(Z?Y:je(Y,!0))+`
    `},te.blockquote=function(Y){return`
    `+Y+`
    `},te.html=function(Y){return Y},te.heading=function(Y,Q,Z,q){return this.options.headerIds?"'+Y+" `:""+Y+" `},te.hr=function(){return this.options.xhtml?`
    `:`
    `},te.list=function(Y,Q,Z){var q=Q?"ol":"ul",de=Q&&Z!==1?' start="'+Z+'"':"";return"<"+q+de+`> `+Y+" `},te.listitem=function(Y){return"
  • "+Y+`
  • `},te.checkbox=function(Y){return" "},te.paragraph=function(Y){return"

    "+Y+`

    `},te.table=function(Y,Q){return Q&&(Q=""+Q+""),` `+Y+` `+Q+`
    `},te.tablerow=function(Y){return` `+Y+` `},te.tablecell=function(Y,Q){var Z=Q.header?"th":"td",q=Q.align?"<"+Z+' align="'+Q.align+'">':"<"+Z+">";return q+Y+" `},te.strong=function(Y){return""+Y+""},te.em=function(Y){return""+Y+""},te.codespan=function(Y){return""+Y+""},te.br=function(){return this.options.xhtml?"
    ":"
    "},te.del=function(Y){return""+Y+""},te.link=function(Y,Q,Z){if(Y=Qe(this.options.sanitize,this.options.baseUrl,Y),Y===null)return Z;var q='",q},te.image=function(Y,Q,Z){if(Y=Qe(this.options.sanitize,this.options.baseUrl,Y),Y===null)return Z;var q=''+Z+'":">",q},te.text=function(Y){return Y},se}(),Pe=function(){function se(){}var te=se.prototype;return te.strong=function(Y){return Y},te.em=function(Y){return Y},te.codespan=function(Y){return Y},te.del=function(Y){return Y},te.html=function(Y){return Y},te.text=function(Y){return Y},te.link=function(Y,Q,Z){return""+Z},te.image=function(Y,Q,Z){return""+Z},te.br=function(){return""},se}(),Le=function(){function se(){this.seen={}}var te=se.prototype;return te.slug=function(Y){var Q=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Q)){var Z=Q;do this.seen[Z]++,Q=Z+"-"+this.seen[Z];while(this.seen.hasOwnProperty(Q))}return this.seen[Q]=0,Q},se}(),Re=F.defaults,Ue=G.unescape,We=function(){function se(ee){this.options=ee||Re,this.options.renderer=this.options.renderer||new De,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new Le}se.parse=function(Y,Q){var Z=new se(Q);return Z.parse(Y)};var te=se.prototype;return te.parse=function(Y,Q){Q===void 0&&(Q=!0);var Z="",q,de,ye,Me,et,qe,at,gt,yt,st,_t,xt,Bt,Dt,pt,Nt,rr,Gt,Vt=Y.length;for(q=0;q0&&pt.tokens[0].type==="text"?(pt.tokens[0].text=Gt+" "+pt.tokens[0].text,pt.tokens[0].tokens&&pt.tokens[0].tokens.length>0&&pt.tokens[0].tokens[0].type==="text"&&(pt.tokens[0].tokens[0].text=Gt+" "+pt.tokens[0].tokens[0].text)):pt.tokens.unshift({type:"text",text:Gt}):Dt+=Gt),Dt+=this.parse(pt.tokens,Bt),yt+=this.renderer.listitem(Dt,rr,Nt);Z+=this.renderer.list(yt,_t,xt);continue}case"html":{Z+=this.renderer.html(st.text);continue}case"paragraph":{Z+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(yt=st.tokens?this.parseInline(st.tokens):st.text;q+1An error occurred:

    "+ze(ye.message+"",!0)+"
    ";throw ye}}xe.options=xe.setOptions=function(se){return ke(xe.defaults,se),Ye(xe.defaults),xe},xe.getDefaults=ge,xe.defaults=He,xe.use=function(se){var te=ke({},se);if(se.renderer&&function(){var Y=xe.defaults.renderer||new De,Q=function(de){var ye=Y[de];Y[de]=function(){for(var Me=arguments.length,et=new Array(Me),qe=0;qe`,triples:"",explode:"[]{}"},L=re.Pos;re.defineOption("autoCloseBrackets",!1,function(_,b,d){d&&d!=re.Init&&(_.removeKeyMap(k),_.state.closeBrackets=null),b&&(P(H(b,"pairs")),_.state.closeBrackets=b,_.addKeyMap(k))});function H(_,b){return b=="pairs"&&typeof _=="string"?_:typeof _=="object"&&_[b]!=null?_[b]:z[b]}var k={Backspace:D,Enter:R};function P(_){for(var b=0;b<_.length;b++){var d=_.charAt(b),s="'"+d+"'";k[s]||(k[s]=F(d))}}P(z.pairs+"`");function F(_){return function(b){return w(b,_)}}function M(_){var b=_.state.closeBrackets;if(!b||b.override)return b;var d=_.getModeAt(_.getCursor());return d.closeBrackets||b}function D(_){var b=M(_);if(!b||_.getOption("disableInput"))return re.Pass;for(var d=H(b,"pairs"),s=_.listSelections(),u=0;u=0;u--){var S=s[u].head;_.replaceRange("",L(S.line,S.ch-1),L(S.line,S.ch+1),"+delete")}}function R(_){var b=M(_),d=b&&H(b,"explode");if(!d||_.getOption("disableInput"))return re.Pass;for(var s=_.listSelections(),u=0;u0;return{anchor:new L(_.anchor.line,_.anchor.ch+(b?-1:1)),head:new L(_.head.line,_.head.ch+(b?1:-1))}}function w(_,b){var d=M(_);if(!d||_.getOption("disableInput"))return re.Pass;var s=H(d,"pairs"),u=s.indexOf(b);if(u==-1)return re.Pass;for(var l=H(d,"closeBefore"),S=H(d,"triples"),h=s.charAt(u+1)==b,g=_.listSelections(),C=u%2==0,y,f=0;f=0&&_.getRange(o,L(o.line,o.ch+3))==b+b+b?a="skipThree":a="skip";else if(h&&o.ch>1&&S.indexOf(b)>=0&&_.getRange(L(o.line,o.ch-2),o)==b+b){if(o.ch>2&&/\bstring/.test(_.getTokenTypeAt(L(o.line,o.ch-2))))return re.Pass;a="addFour"}else if(h){var p=o.ch==0?" ":_.getRange(L(o.line,o.ch-1),o);if(!re.isWordChar(m)&&p!=b&&!re.isWordChar(p))a="both";else return re.Pass}else if(C&&(m.length===0||/\s/.test(m)||l.indexOf(m)>-1))a="both";else return re.Pass;if(!y)y=a;else if(y!=a)return re.Pass}var v=u%2?s.charAt(u-1):b,O=u%2?b:s.charAt(u+1);_.operation(function(){if(y=="skip")_.execCommand("goCharRight");else if(y=="skipThree")for(var U=0;U<3;U++)_.execCommand("goCharRight");else if(y=="surround"){for(var j=_.getSelections(),U=0;U1&&arguments[1]!==void 0?arguments[1]:1,ee=Pe.length,Y=0;Y1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(N).map(function($,ie){if(!k.isValidElement($)||!$.type)return null;var oe=$.type.isSelectOptGroup,_e=$.key,fe=$.props,Se=fe.children,be=Object(F.a)(fe,["children"]);return V||!oe?y($):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(_e===null?ie:_e,"__"),label:_e},be),{},{options:f(Se)})}).filter(function($){return $})}var c=J("2Qr1"),o=J("qNPg"),a=J("U8pU"),m=J("Kwbf"),p=J("WKfj");function v(N){var V=N.mode,$=N.options,ie=N.children,oe=N.backfill,_e=N.allowClear,fe=N.placeholder,Se=N.getInputElement,be=N.showSearch,me=N.onSearch,le=N.defaultOpen,ue=N.autoFocus,Ee=N.labelInValue,Ge=N.value,Te=N.inputValue,pe=N.optionLabelProp,Ae=V==="multiple"||V==="tags",Ce=be!==void 0?be:Ae||V==="combobox",we=$||f(ie);if(Object(m.a)(V!=="tags"||we.every(function(De){return!De.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Be=we.some(function(De){return De.options?De.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in De?De.value:De.key)=="number"});Object(m.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(m.a)(V!=="combobox"||!pe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(m.a)(V==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(m.a)(V==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(m.b)(V!=="combobox"||!Se||!_e||!fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!Ce&&V!=="combobox"&&V!=="tags"&&Object(m.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(m.b)(!le||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ge!=null){var Qe=Object(p.d)(Ge);Object(m.a)(!Ee||Qe.every(function(De){return Object(a.a)(De)==="object"&&("key"in De||"value"in De)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(m.a)(!Ae||Array.isArray(Ge),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var je=null;Object(C.a)(ie).some(function(De){if(!k.isValidElement(De)||!De.type)return!1;var Pe=De.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var Le=Object(C.a)(De.props.children).every(function(Re){return!k.isValidElement(Re)||!De.type||Re.type.isSelectOption?!0:(je=Re.type,!1)});return!Le}return je=Pe,!0}),je&&Object(m.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(je.displayName||je.name||je,"`.")),Object(m.a)(Te===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var O=v,U=Object(o.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:f,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:O,fillOptionsWithMissingValue:c.a}),j=function(N){Object(L.a)($,N);var V=Object(H.a)($);function $(){var ie;return Object(re.a)(this,$),ie=V.apply(this,arguments),ie.selectRef=k.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(z.a)($,[{key:"render",value:function(){return k.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),$}(k.Component);j.Option=l,j.OptGroup=h;var G=j,B=$e.c=G},M8RZ:function(ut,$e,J){"use strict";J.d($e,"a",function(){return D});var re=J("fWQN"),z=J("mtLc"),L=J("yKVA"),H=J("879j"),k=J("q1tI"),P=J.n(k),F=J("i8i4"),M=J.n(F),D=function(R){Object(L.a)(w,R);var E=Object(H.a)(w);function w(T){var A;Object(re.a)(this,w),A=E.call(this,T);var _=window.document;return A.node=_.createElement("div"),_.body.appendChild(A.node),A}return Object(z.a)(w,[{key:"render",value:function(){var A=this.props.children;return Object(F.createPortal)(A,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),w}(P.a.Component)},MXfU:function(ut,$e){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFsAAABKCAYAAADUvCinAAAAAXNSR0IArs4c6QAAFq9JREFUeAHdnAl4VFWWx6sqlYWEkIRsJCRkJQECCXsIS0gAWWwQl1YQxQ2nRx0/u9We8etvpmf87LFt7XHs7mmXbhVEFESQdWRfwiKGXRYhkI0sQAIBAmQnqZrfKfMyZVGVqldLjL7vu9997757zz33/84995xzb5VG8xO/Fi1aNPTDDz/M7w7D1HcHJjzFAyCPNxgMi/V6/YOe6kMNXZ2ayj+mugsXLhSAFxqNxtmPPvroge7A+09Osj///HOvmzdvvoZET/D19Z04f/78i90BaOHhJwU20hx748aNZVqt9kR0dHTOnXfe2dxdgBY+tN2JGVd4QT8/gsp4GRovPfnkkytcoeWptj96ycbaiEdl/BWgEWjt+AULFlzwFFiu0v3RSvaGDRt8L168+CIALNDpdL99/PHHl7oKhqfbe3m6A3fTR4J1/fr1m88iuBxJPs8iOBdr45C7+/EEvR+NZIuVUVdX9wBg/wYgTnp7e//rI488UuoqKCyqv4FmK+rnj67Sste+2+vsjz/+OODWrVsiyb9iMIcAZh4L4El7A3PkPUA/Db2ZERERdzhS39U63RbsDz74YDBq4qmWlpZZ5GtIdz7xxBMlrg5YaY/18iuAnhsYGDht1qxZDUq5J/NuBTZSnIAUzwGEOYB7i/R3pO5f3AkGtHVI9BuAmkG644EHHrjpSYDNaf+gOvvQoUPe33zzTRYMTSVNB1xf0mfo4+V4fkXmjMr9p59+GtLU1CSSPpzHvcQ8NqK36y3r2Xpub7+M92UZGRnPjhw58patup4o71KwkahwgBqFXTyawUgS6RI9vBngNj/22GPFloNkukfTZjZ17iXl8L5jNlLexPMW8lU9e/Zcj5RetWyvPKOWsrl/HzPxTdTR35XyrszdBjZAaD/66KMgBh4KmGGkKAaSzHN/yXkv96IbD5If8PLyOpCWlnbUmnQtWbIkGV19jwBM3Uyh7efnp+nfv3/lmTNnYnx8fE7OnDkzrKioSFdYWBhx/fp1wayVurvIV/Ph1mAOnpfC9evX+1+6dOkVaEzmcb67FlehrfZyC9hI3wEG04/B1sLAFVINqYrnYsoLJfXq1asYyWu0xaDEndva2u6hjYA8ROohrW0pKSmlgCz3iRTpli1bpgHMvPvvvz9H6siFaqkuKSlp40NEX716VQMNI8US6dsCrQd5/gS18XtrH1bad9XlFrCdYRYQdIsXL84CYFEP90AjQegEBQU1p6amliYnJ/v06NFDyr7HozWwpZ1yNTc31+zZs6e1rKysj1IG2CfpYxWzaTWe5jdKeVfn3xuIpzuXBfH48eOTUDEC7t2kSOkzJCSkftCgQaXx8fGBqIs4KbN1dQK2ob6+fu+uXbt8/f39/bKysvwANxzQa8+ePdv3woULvkIT4M+RrSKtRnfv49nAfZdcHge73SmZzmhEPcwkD5KRhYeHXwPgsri4uFCsj1gpc+SyAnbNlStXjiDN0aGhoY1jxowJhN4AS1rMoNrz58/XnD59Ooo8AF6kSjVgr2XRXB0QELADNddi2c6dzw6DjbvcE3f5CZiMcZQB6qYwmKnkPaRNnz59qgcPHnw+JiYmCqmTBVT1JWADzm5sb92xY8dakdhE9HFlQkJCDDT7OUKQmXWTINbFgoKCyPLy8iCepZmssl8K8GpNSkf6lDoOgd2++5EPaCMdJWwirtVq+vbtW4bVcZlgfj8GEqGmvVndNgApQIIvbdy4MRcpbQLgIwMHDgxAr6dTz6FxmNHruIVuw+XLl8sBPrS0tDQc2qJqHDYpOwg5cOMQk1gKQ2DiuAP0hFFNfHz8WQCuxfsTc6+3I+3M6rTwUauwMCqR2pvo3J7V1dVxYWFhtUT7bh44cCAL0y9vzpw5OWZt3HXbxAc9h6rpiXUTgzcrdMWk3E2+ytykdKZDh8BeunRpWENDQyUdmBYZy45goo1pfAqAG9Gbqbw36WXLepbPqKV8pnH9tWvXfGtrawNZ4EKpo8dMvI5OvwS4BhbPSOgnS7m0b1cjngJbulCuFvgqYXH1wZ5P4OODucmkFOBnESVU7eZ3eGNKD9byefPm1SDdTzDl3kTqOkwqpS7T+Tg2bChqwmQfK+X2cnSsP/pbg5kni1oogxE1Izv+0od8tB/y8uFDJ2LjF7KveQ2h6M3YRTgnwufL5LJxoepySLLNKQL6HUjdFlb9OhhYcuTIEYlrJEkdQD82YsQIPwL6HgOqKyQbW73s1KlTLaRkkWjWhSYW9pPY/z2J5YSfPHkyCEEZjs1+whwbe/cOSbZCZOfOnfri4uK3ANqIuuhJenrYsGHHmGpvfvXVV+PQdWNIGqZ/0dixY+sxpyT28aO4mLXXEZ4LgBmP3o4DTJlxZ4YMGdKEozWIQZiMg9GjR9eBgZ6P8A6Snt2uWhwaoyqwWTR+ifucBsjmxDMok3QWa+rVzZs3D4bpWSQd9arHjx9/nsVNLAZVfZl34MH7Ntz7khMnTgQztnAAD8J6quIIRAFmqizut81QynpOnDjxwqZNm8Yzyx+Bt8WO8uewGpHoGwtVATEJMbdEr9q6ylnsFhEAimY1f5iv34MAfR0e3Rn080CY9bfV0JFyd6gRpPIicZTmb7/9Nr6xsVE82Ib09PRiFvkIJNrk1drjBaFqxjm6gceb+tBDD12zV1/eq5G2/4KhQIC2R7dfcHDwfxCPrmZQb6xdu1aP1fGLLVu2jICxVnT6MWZBLIupWpPQXr+dvkdq6wHnIo5QLKZkFOMw4sEWooe9uY+nsarFPTc3tx4rLZyP9Sptn+m08/aXDkk20yUHoHYi1Qa+fGdSba3Pawz07TVr1lxB4p9C0lNFH/LhCnBMenEfba2RrTKVkm0k/FpGPCYIPRsiNJOSkqro+wZ6WBZ1l04XMDOu5ufnBzNbMzEF7e7w6wnoxwLAW6ShdG4VSMAKY2EwOgG0jC8EKf63e++9t47799B1ryFhC44ePTqBJDHqCmi38jETpLI7Lon8EecWNdGXWRWP+qqbOnXqWfRwDLyIWXmb+epMv8yMXqgjHUL0LvhlAnqnQS09lZaQJnbWGQucJjEx0RS56ayenXc9ef/r6dOnN5Mv3Ldv35u4yPNwGO4DGC8AuYKVcwWJS7FDx+prxtCEx1mNFEeTh/Xu3bsNS6kUvoNYa0RlOUXXamfthYCrnzRpUs0XX3wxEqH9BcXvdVqfhe8GjAZ2Vmn27NmtAK5Gv3dGTnnXys1SzMaP9+7dexf3C+AjAAumAdDLxRqg7LY+LdUIDscF7N5APpo4Rhp0cBX2vgE9rEo9KUw5kyM4TZi8jcyaVMK2l23R8AJIUR9ptiogGRrccKvqxVYbB8uFZgbgPowEViLZv0TCCwkLZJAlAJ4RwIpYbP2RIG+FJsBqiNMgrPqmvLy8AMy2QKyJlnHjxl1CHQVGRUUJ6J0Kj0LLXTlBtlvM0sDW1tbwdevWrbVFV9seb36BCsOQLHNQk9HRaRLjJRjvY4uAm8s3wvDr7EEmsk6IO5xG0EmDBSNbY8FE5xq3bt0aLZE57OE2hOAiuWwi+7qZD9Xk8Ctqt23bJnuw/wSOVQoB7o0IxgnZzLZqjbR7it8MHTp0EAO1Wkch5qF8N3RfRQ+KtfAi/E5W+snMzKwaMGCAPwPopZR1lxzb21hZWWkNLwMf4SlzSe7gGW/qOaZwGmCLXv0hrmw63Yz+ex6TagqMfqEwwWzb1h2BFv4Ixl1Q+LTIdQjM726zM1ErEUzhVXh8OhbFDl1p0birHlcTnziJ2niXDk28Ijn9MbkE8P5dxYSdflrh70vi7Kzze+OpG2yjfu1tqz0No/kKAcQMdLjbrSw2t9WxQczdxWKzvs35kefgR1kzqrmPxNTqQ9i3gvcO7126mznolYHRpu3bt4diEc3iubN1o5nZ+aI1/aJBVw5Hul9lcZqOpaBBkgyYNVZVjgcGoZBcs2LFCjm9WgHAYqPLR1+ekBAfVVp6Lhu9vRgLZD5lXcmXCMAmXP4iQsvZYCSWnOxOFZDEsTkiz+YXak9+ElHAoaErVsFWKmODj+f+VQ7IZKOPxLFRXnVFPpmPns4A3sLm3l5VVSWL5PIZM6ZP3rFjZzMS3wev9BNMw0e7gJkqTNLVWBv6mpqa++FJVIVsl60lvcPassMRHjoFWyEA6FO5/090+CisAWNkZKRD7ZT2TuQnkeqhSHUxbaMmT550eNu27XIAU8CeQ/CH4yG7s5lsRUjMDQY8wok+7DURj3kHNv8hdPFQAJZTAsq436DPP7N421oQrdK+bYG0VgtDvZj0/pQpU2SjIANdFY4zYiSeoXRurZkrZb8lwJMMgQXh4aH/GxsbOwUnR+h9279/8mDWkXiOfXxJkD+LOMsuvEaZcopel3quXDXEVhYhxbu5JrDh/DNAltj2HlIthCWu8hBnBivVdqJq8aODNZwG7Q0DH1ZUVMgxMb/hw4e7G3SJDX9C2s3gjBkZw6wuPCkp/TPh4QyHJh+En7c47PO82sFb1N+NpbODKxXH6h8A2If+b6Jz/zZq1KjS3r2D79uwYdO3tHF690kV2ObMTZyYXVleXrGW6T6HraMYkkQF3SHpH6CrM+lrBLvseT4+3jJ9zbs23VMWzi7QUayBRKRQfsS0HnNQrAI1l4R/l6KTqjkzch80X5bGgHyKgNjirKzMQFQVMRtNVDsLhe3Et6Na5USunHVQ0lXuP0a1dPgE7XU7MqfBRoUkI10vpqam7C0oOGMCHSkPY2NAkHEW9Dbavs2g3xEOhw3LqOfeprUhH4LZtZQw57yVK1ca586de55mfaWtnSsfFbSGAz8xqAyxaIJI4sCtGDAgZUtiYvJ4o9HwCs++Vr4zxZok+JLc8roLQclhwdxl+UKenQZbIUan4wFc0leAvoYd6QewXHoRWFKqqMnXsVERgGTNwIM93qOH/x32GiclJU5BjRzkzMldhw8ffo3wwku0sfaBbogUf/3113ybMzPh+w9Cm74uIL1/YpZUBgT4y6+E3wdoe93afE/7XF56BmyzXscNGJA6jud9p08XlAD6fQy8BwupWRW7t3+hhsRCtEOHZojTkm6vBXUjJkyYcBBVUs/O+DMEp/7GrHvarN1hPsQytueCsGIep/yp9nd5RAsXEyns4+Wlk1+N9SOZNXP6dp+tli5LthXCYwcOHDAWxvMx/CsZ+GzUizfHGqxU/V7RCX65UEC7hzl3Uo79nOPo4PV6r58Rw36PD/wU8e5BnOfYDeWzgH8AaRf7/DWSN1Issfu/8kG2xMXFcqJWKyrL39F+FG6hs5N7UXneZqkBOqKztyj1LHNPgG3qA4bGpKUN0sDAfqbuFaRoGouoF16pJQ/K8/8QKniOBx/AOEW76coLR/L4+Lh7WeS2IL1T0Zuf0mYMNJ6UtvBygvTu5Mk5l/V633/UaIzPfifEzkkypudj/HCq3BG+zOt4DGylEwaZOWjQQA368iA7GvU4RBNZ1LToSaWK5FcJ5KwiL2Qg1yIjI0abv3TkHmAjsrOzGwhz1nD/EG3ESljODFnEgaEBGo0B9SQnt5wD2BEe7NXxONgKA4A7CutFdlkOA7qRBXQkp11Nr9kw3cDmrAAUggraTi5TX/Wl02nvRge/dPDgwRbCw/lRUX0ehMgKFrxA1cQ80KDLwFZ4xxYfkZiYoMFxOLp//34/AB/IZoUc5vk5H6S5b99om1t0Co3O8tDQ3q/MmDHtGMrjv6Gp7axuV7/73lzuys5xQIbFxsYMbGlpOobzchxg/DAf+YWX1tVjBmIbj+5uQAu2qiUb6WtB/2pY6c9zsrMV0OJc+UheXvoMzDxNRkZ6GbSzAMkVcp5uK56tzEqnmFQt2RwXXsWi915VVXWfrVu3xeEgFAD+RVdHCc04gFb98V3t15H2HKNrOn78hFg1idRfimkpnqrqS/XgMjOHpfDrh6zr12v/ed++/CklJaV3lpWVG7EwDsbF9WO113TpGT7VI1bRAFe+pbCwyIcAlQ+xkg0cyGnipMHrgO6Ui6lqAeEoQSBBeyJfxth2nvOLi0s+Jeb7JFKZgdkmh8YPYQVI/Fd2V9x2bdy4SWiZ4tluI2qDECDf4mygd0VFpSE4uNcGPGGDt7ePhFq9ALpcr/dO4/dCcpxO1aVKsgH612ZAS0djkpISSUnL8dQ+4WM8z/m98adP+9WwnXY4JCQIT9LkZali6oeqjC5uRZL1SLKORXvt5Mm5unaQZXfcxBZ5P/ZmwUHzslo+VYEN8bnWOzDOGTFi+N1arebtHTvyEIzm5/AaJ7KdVjxy5IgKpt5EmFQ1i6z345nS1ta2Vvk1AQdtNIC8Oicnx5uI4ix47gDZomex31+2KLP7qBJsY79OKIrJ9cKkSbmXm5ubfpeXtzuFE6SP5eXtSurdO+Qg8ZFbqJmxnbTv8lc4WG2ckfE6d67MCMgrOXPtx2EC+bsNWyC389gpDjbHoQpsJPcCgMqKbPOC0XAfH98/TJs29fTlyzXP8nv1u69evTZ1+/YdRs7hbR4yJC1Cp/MaZpNAF7zAejIQR9EBchsgr8rNzfFHEGTzQEuyy4HgYLeSlQqqwIYX4hdG0Vd2L5geGBYW+g4btFsJuT5z7ty5ZzjKO43f3TSyS78S130IRFLtEnJjBXgC5HM6gL6FdbGa3SY5hPlzyh0CWWHlOxyUJ8dzVXqUn0dEtrW1yt9JhDnehSnqZmCci/bvP1jADzklXt0HB+YS0b3NMTF9c6Fld6fBFWsEQTayX6ktKSnll1+9VuFEBeNMzRCQ1YxD6mKN1NB2MAG1atVt1Taorj4/BQdqPe381LaF0TqDoe0t9Lk3foKEU/2JlRSwiO7j8PrdPNu00Z0BGzBNBx0xTxsx4Vamp2eE85FVhW4txtik12tnRUb23WZR7tCj6i8rVDk+wHaVcTm3IQ71cnulyvr6hj9yVGA4r2QPUMeGwa6xY8cUsRX2IBjd9osylWAD8nkkuaRBFj5+Q8M6oXUFZBkBu/7aORxR3ioPzlxOgS0doXs5u2FYDDDZznQsbZD0QzgO73HAfR50JlFkYEdn5dixWc3oUgG9Y01xBGzoGREEURd1QocfSEUB8jRn+VPaQZdjFbpHWeDPKWXO5E6DrXTGoodkGl8BmHilTG3OYFYTe9gIUC9AZwDPjZy+Woi5yP+S6ORPYbSdgS0g8/G1RUXFN/nN5Yr09MGxgMPsc+2C7jlE4t/5ZcES1yh919plsIUMYHhXV1+Y39ZmFD3s1CEWzCnZWXl7z56vKrHPX4JmOM/VnIb6gEOUOfziYBzPt7nr1dWXNDgkN3CgPsesjAfkKdRz9TrGEZi/REZGLwFw4cstl1vANueEA5BjDIbWOUiEOAcJ5u8cvL+K8fC6HMXF55DjwrIQl5PEodqEKWnSvRxw1OBaXw8MDFg+ePAQCYA5tbtDO9MFqKWIzTqdTv8ZBznzlXJ35m4H25w5gB8M8LMpuwvwhwNchw42r2fjvrCurv4N/vspFyBEf5t4HT16lAZ1UYskf8aGcgptRdervqDJoRzTEV8BeB0An1BNRGUDj4Jtzgtg9cBOz0BaRzLQkayFnDzVDqTcy7ye5T3qZVdJSfH7BQWFv+edN2plDfY5el2Ta1nX1jP9tQHsaYyew/R3CHPzEHbyMcobbbXxRHmXgW2NeQbuS6Qwlg9AyLaNQzLySwKtqAt+dSxHwsQE1PYAWAM5Z+hM/1F1B+344ar8+6URsP4/p9512lZQXs49uVc5wFaw4VEBsLT5Ya//AzDfafkdei4SAAAAAElFTkSuQmCC"},Nmsl:function(ut,$e,J){ut.exports={none_panels:"none_panels___1g-mA",none_p_title:"none_p_title___1lCVD"}},Ot1p:function(ut,$e,J){"use strict";var re=J("2qtc"),z=J("kLXV"),L=J("rAM+"),H=J("miYZ"),k=J("tsqr"),P=J("tJVT"),F=J("jrin"),M=J("q1tI"),D=J.n(M),R=J("VrN/"),E=J.n(R),w=J("bdgK"),T=J("p77/"),A=J("Bd2K"),_=J("ELLl"),b=J("19Vz"),d=J("lZu9"),s=J("+NIl"),u=J("kSUc"),l=J("9Bee"),S=function(ee){var Y=ee.value,Q=Y===void 0?"":Y,Z=ee.className,q=ee.showTextOnly,de=ee.showLines,ye=ee.style,Me=ye===void 0?{}:ye,et=Object(M.useMemo)(function(){return""},[Q]);return D.a.createElement(D.a.Fragment,null,D.a.createElement("div",{dangerouslySetInnerHTML:{__html:et}}))},h=J("0Owb"),g=J("dejd"),C=J("C+DQ"),y=[{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 f(ee){var Y=ee.onActionCallback,Q=ee.title,Z=ee.icon,q=ee.actionName,de=ee.className,ye=de===void 0?"":de,Me=ee.children;function et(){Y(q)}return D.a.createElement("a",{title:Q,className:ye,onClick:et},D.a.createElement("i",{className:"md-iconfont ".concat(Z)}),Me)}var c=function(ee){var Y=ee.watch,Q=ee.showNullButton,Z=ee.onActionCallback,q=ee.fullScreen,de=ee.insertTemp,ye=ee.hidetoolBar,Me=[].concat(y,[{title:"".concat(Y?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Y?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return D.a.createElement("ul",{className:"markdown-toolbar-container"},!ye&&Me.map(function(et,qe){return D.a.createElement("li",{key:qe},et.actionName?D.a.createElement(f,Object(h.a)({},et,{onActionCallback:Z})):D.a.createElement("span",{className:"v-line"}))}),Q?D.a.createElement("li",null,D.a.createElement(f,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Z},D.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,de&&D.a.createElement("li",null,D.a.createElement(f,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(de),onActionCallback:Z},D.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),D.a.createElement("li",{className:"btn-full-screen"},D.a.createElement(f,{icon:"".concat(q?"icon-shrink":"icon-enlarge"),title:q?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Z})))},o=J("M8RZ"),a=J("+L6B"),m=J("2/Rp"),p=J("y8nQ"),v=J("Vl3Y"),O=J("5NDa"),U=J("5rEg"),j={labelCol:{span:4},wrapperCol:{span:20}},G=function(ee){var Y=ee.callback,Q=ee.onCancel;function Z(q){Y(q)}return D.a.createElement(v.a,Object(h.a)({},j,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Z}),D.a.createElement(v.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},D.a.createElement(U.a,null)),D.a.createElement(v.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},D.a.createElement(U.a,null)),D.a.createElement("div",{className:"flex-container flex-end"},D.a.createElement(m.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),D.a.createElement(m.a,{type:"ghost",onClick:Q},"\u53D6\u6D88")))},B=J("7ahc"),N=J("HmJG"),V=J("BjJ7"),$=v.a.useForm,ie={width:280,marginRight:10},oe={labelCol:{span:5},wrapperCol:{span:19}},_e=function(ee){var Y=ee.callback,Q=ee.onCancel,Z=$(),q=Object(P.a)(Z,1),de=q[0];function ye(qe){Y(qe)}function Me(qe,at){de.setFieldsValue({src:"/api/attachments/".concat(qe.id),type:at.type})}function et(qe){var at=qe.target.files[0];Se(at,Me)}return D.a.createElement(v.a,Object(h.a)({form:de},oe,{className:"upload-image-panel",onFinish:ye}),D.a.createElement(v.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},D.a.createElement("div",{className:"flex-container"},D.a.createElement(v.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},D.a.createElement(U.a,{style:ie})),D.a.createElement(fe,{onFileChange:et}))),D.a.createElement(v.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},D.a.createElement(U.a,{style:{width:264}})),D.a.createElement(v.a.Item,{style:{textAlign:"right"}},D.a.createElement(m.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),D.a.createElement(m.a,{type:"ghost",onClick:Q},"\u53D6\u6D88")))};function fe(ee){var Y=ee.onFileChange;return D.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",D.a.createElement("input",{type:"file",onChange:Y}))}function Se(ee,Y){if(!ee)throw new String("\u6CA1\u6709\u6587\u4EF6");var Q=new FormData;Q.append("editormd-image-file",ee),Q.append("file_param_name","editormd-image-file"),Q.append("byxhr","true");var Z=new window.XMLHttpRequest;Z.withCredentials=!0,Z.addEventListener("load",function(q){Y(JSON.parse(q.target.responseText),ee)},!1),Z.addEventListener("error",function(q){console.error(q)},!1),Z.open("POST","".concat(V.a,"/api/attachments.json")),Z.send(Q)}var be=J("giR+"),me=J("fyUT"),le=J("7Kak"),ue=J("9yH6"),Ee=ue.a.Group,Ge={margin:"0 8px"},Te=function(ee){var Y=ee.callback,Q=ee.onCancel;function Z(q){Y(q)}return D.a.createElement(v.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Z},D.a.createElement("div",{className:"flex-container"},D.a.createElement("span",{style:Ge},"\u5355\u5143\u683C\u6570\uFF1A"),D.a.createElement("span",{style:Ge},"\u884C\u6570"),D.a.createElement(v.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},D.a.createElement(me.a,null)),D.a.createElement("span",{style:Ge},"\u5217\u6570"),D.a.createElement(v.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},D.a.createElement(me.a,null))),D.a.createElement("div",{className:"flex-container",style:{marginTop:12}},D.a.createElement("span",{style:Ge},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),D.a.createElement(v.a.Item,{name:"align"},D.a.createElement(Ee,null,D.a.createElement(ue.a,{value:"default"},D.a.createElement("i",{className:"fa fa-align-justify"})),D.a.createElement(ue.a,{value:"left"},D.a.createElement("i",{className:"fa fa-align-left"})),D.a.createElement(ue.a,{value:"center"},D.a.createElement("i",{className:"fa fa-align-center"})),D.a.createElement(ue.a,{value:"right"},D.a.createElement("i",{className:"fa fa-align-right"}))))),D.a.createElement("div",{className:"flex-container flex-end"},D.a.createElement(m.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),D.a.createElement(m.a,{type:"ghost",onClick:Q},"\u53D6\u6D88")))},pe=J("m3rI"),Ae=J("wMS7"),Ce=J.n(Ae),we="link",Be="upload-image",Qe="code-block",je="add-table",De="------------",Pe={default:De,left:":".concat(De),center:":".concat(De,":"),right:"".concat(De,":")},Le=J("9VGf"),Re,Ue;function We(){}var ke=0,Ke=1e4,ze="\u2581",ge=` **\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 Ye(ee){return/^\d+$/.test(ee)?"".concat(ee,"px"):ee}var He=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=He?"Cmd":"Ctrl",Ie=(Re={},Object(F.a)(Re,xe+"-B","bold"),Object(F.a)(Re,xe+"-I","italic"),Re),se=(Ue={},Object(F.a)(Ue,we,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Ue,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Ue,Be,"\u6DFB\u52A0\u56FE\u7247"),Object(F.a)(Ue,je,"\u6DFB\u52A0\u8868\u683C"),Ue),te=$e.a=function(ee){var Y=ee.defaultValue,Q=Y===void 0?"":Y,Z=ee.onChange,q=ee.width,de=q===void 0?"100%":q,ye=ee.height,Me=ye===void 0?400:ye,et=ee.miniToolbar,qe=et===void 0?!1:et,at=ee.isFocus,gt=at===void 0?!1:at,yt=ee.watch,st=ee.insertTemp,_t=ee.mode,xt=_t===void 0?"markdown":_t,Bt=ee.id,Dt=Bt===void 0?"markdown-editor-id":Bt,pt=ee.showResizeBar,Nt=pt===void 0?!1:pt,rr=ee.noStorage,Gt=rr===void 0?!1:rr,Vt=ee.showNullButton,Xt=Vt===void 0?!1:Vt,Pr=ee.hidetoolBar,Ht=Pr===void 0?!1:Pr,kt=ee.fullScreen,jt=kt===void 0?!1:kt,Ot=ee.onBlur,tt=ee.onCMBeforeChange,Yt=ee.onFullScreen,Nr=ee.className,fr=Nr===void 0?"":Nr,St=ee.disablePaste,hr=St===void 0?!1:St,gr=ee.placeholder,nr=gr===void 0?"":gr,Fe=ee.values,dt=Fe===void 0?"":Fe,_r=Object(M.useState)(null),vr=Object(P.a)(_r,2),Ve=vr[0],wr=vr[1],jr=Object(M.useState)(Q),ct=Object(P.a)(jr,2),Ct=ct[0],Ur=ct[1],xr=Object(M.useState)(yt),ht=Object(P.a)(xr,2),wt=ht[0],ot=ht[1],ve=Object(M.useState)(jt),nt=Object(P.a)(ve,2),lt=nt[0],At=nt[1],Jt=Object(M.useState)(""),ar=Object(P.a)(Jt,2),Kt=ar[0],Ut=ar[1],Ln=Object(M.useState)(0),Mr=Object(P.a)(Ln,2),Wr=Mr[0],Cr=Mr[1],wi=Object(M.useState)(Me),Ci=Object(P.a)(wi,2),pn=Ci[0],nn=Ci[1],$i=Object(M.useState)(!1),Ai=Object(P.a)($i,2),Ba=Ai[0],Zn=Ai[1],Qr=Object(M.useRef)(),Dn=Object(M.useRef)(),On=Object(M.useRef)(),gn=Object(M.useRef)();Object(M.useEffect)(function(){Ur(dt),Ve==null||Ve.setValue(dt)},[dt]),Object(M.useEffect)(function(){Yt==null||Yt(lt)},[lt]),Object(M.useEffect)(function(){if(Qr.current){var vt=E.a.fromTextArea(Qr.current,{mode:xt,lineNumbers:!qe,lineWrapping:!0,value:Q,autoCloseTags:!0,autoCloseBrackets:!0});gt&&vt.focus();function bt(Et,Lt){if(hr){Lt.preventDefault();return}var Pt=Lt.clipboardData;if(Pt){var Ft=Pt.types.toString(),Qt=Pt.items,or=["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"];if(Ft==="Files"||Pt.types.indexOf("Files")>-1){if(Lt.preventDefault(),xt=="stex")return;try{var sr,Jr=Qt[1];((sr=Qt[0])===null||sr===void 0?void 0:sr.kind)==="file"&&(Jr=Qt[0]);var qt=Jr.getAsFile(),on=qt.name.split(".").pop();Se(qt,function(yr){if(yr.id){var $r,qr,qn;(qt==null||(($r=qt.type)===null||$r===void 0)?void 0:$r.indexOf("image"))>-1?vt.replaceSelection("![,](/api/attachments/".concat(yr.id,"?type=").concat(yr.content_type,")")):(qt==null||((qr=qt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?vt.replaceSelection('')):(qt==null||((qn=qt.type)===null||qn===void 0)?void 0:qn.indexOf("pdf"))>-1?vt.replaceSelection('
    ').concat(qt.name,"")):or.includes(on)?vt.replaceSelection('').concat(qt.name,"")):vt.replaceSelection("[".concat(qt.name,"](").concat(pe.a.API_SERVER,"/api/attachments/").concat(yr.id,"?type=").concat(yr.content_type,")"))}else(yr==null?void 0:yr.status)===401&&(document.location.href="/user/login")})}catch(yr){k.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",bt),wr(vt),function(){vt.off("paste",bt)}}},[]);var Jn=Object(M.useCallback)(function(){if(Dn.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[pn,Dn,lt]);Object(M.useEffect)(function(){function vt(){var Et=new w.default(function(Lt){var Pt=Object(L.a)(Lt),Ft;try{for(Pt.s();!(Ft=Pt.n()).done;){var Qt=Ft.value;(Qt.target.offsetHeight>0||Qt.target.offsetWidth>0)&&(Jn(),Ve.setSize("100%","100%"),Ve.refresh())}}catch(or){Pt.e(or)}finally{Pt.f()}});return Et.observe(Qr.current.parentElement),Et}if(Ve){var bt=vt();return function(){bt.unobserve(Qr.current.parentElement)}}},[Ve,Jn]),Object(M.useEffect)(function(){if(Ve){for(var vt=[],bt=function(){var Qt=Lt[Et];Pt=Object(P.a)(Qt,2);var or=Pt[0],sr=Pt[1],Jr=Object(F.a)({},or,function(){vn(sr)});vt.push(Jr),Ve.addKeyMap(Jr)},Et=0,Lt=Object.entries(Ie);Et0){var vt=new Date().getTime(),bt=window.sessionStorage.getItem(Dt);vt>=Wr+Ke&&(!bt||bt!==Ct)&&(window.sessionStorage.setItem(Dt,Ct),Zn(!0))}},Ke),Object(M.useEffect)(function(){ot(yt)},[Ve,yt]),Object(M.useEffect)(function(){Ve&&(gt&&Ve.focus())},[Ve,gt]),Object(M.useEffect)(function(){if(wt&&Ve){var vt=Ve.getScrollerElement();function bt(Et){var Lt=Et.target;if(gn.current){var Pt=Lt.scrollTop/Lt.scrollHeight;gn.current.scrollTop=gn.current.scrollHeight*Pt}}return vt.addEventListener("scroll",bt),function(){vt.removeEventListener("scroll",bt)}}},[Ve,wt]),Object(M.useEffect)(function(){if(Ve&&tt){function vt(bt,Et){tt(bt,Et)}return Ve.on("beforeChange",vt),function(){Ve.off("beforeChange",vt)}}},[Ve,tt]),Object(M.useEffect)(function(){if(Ve&&Ot){function vt(){Ot(Ve.getValue())}return Ve.on("blur",vt),function(){Ve.off("blur",vt)}}},[Ve,Ot]),Object(M.useEffect)(function(){if(Ve){function vt(bt){var Et=Ce.a.sanitize(bt.getValue());Ur(Et),Cr(new Date().getTime()),bt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Z&&Z(Et)}return Ve.on("change",vt),function(){Ve.off("change",vt)}}},[Ve,Z]),Object(M.useEffect)(function(){Ve&&(Q==null?(Ve.setValue(""),Ur("")):Q!==Ve.getValue()&&(Ve.setValue(Q),Ur(Q),Ve.setCursor(Ve.lineCount(),0)))},[Ve,Q]);var vn=Object(M.useCallback)(function(vt){var bt=Ve.getCursor(),Et=Ve.getSelection(),Lt=Et.split(` `);switch(vt){case"bold":return Ve.replaceSelection("**"+Et+"**"),Et===""&&Ve.setCursor(bt.line,bt.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+Et+"*"),Et===""&&Ve.setCursor(bt.line,bt.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+Et+"`"),Et===""&&Ve.setCursor(bt.line,bt.ch+1),Ve.focus();case"inline-latex":return Ve.replaceSelection("`$$"+Et+"$$`"),Et===""&&Ve.setCursor(bt.line,bt.ch+3),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+Et+"\n```"),Ve.setCursor(bt.line+1,Et.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`
    `),Ve.focus();case"list-ul":return Et===""?Ve.replaceSelection("- "+Et):Ve.replaceSelection(Lt.map(function(Pt){return Pt===""?"":"- ".concat(Pt)}).join(` `)),Ve.focus();case"list-ol":return Et===""?Ve.replaceSelection("1. "+Et):Ve.replaceSelection(Lt.map(function(Pt,Ft){return Pt===""?"":"".concat(Ft+1,". ").concat(Pt)}).join(` `)),Ve.focus();case"add-null-ch":return Et===""&&Ve.setCursor(bt.line,bt.ch+1),Ve.replaceSelection(ze),Ve.focus();case"inster-template-1":return Et===""&&Ve.setCursor(bt.line,bt.ch),Ve.replaceSelection(ge),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return ot(!wt),Ve.focus();case"trigger-full-screen":return At(!lt),Ve.focus();case we:Ut(we);return;case Qe:Ut(Qe);return;case Be:Ut(Be);return;case je:Ut(je);return;default:throw new Error}},[Ve,wt,lt]),Zr=Object(M.useCallback)(function(vt){Ut("");switch(Kt){case we:var bt=vt.title,Et=vt.link;return Ve.replaceSelection("[".concat(bt,"](").concat(Et,")")),Ve.focus();case Qe:var Lt=vt.language,Pt=vt.content;return Ve.replaceSelection(["```"+Lt,Pt,"```"].join(` `)),Ve.focus();case Be:var Ft=vt.src,Qt=vt.alt;return Ve.replaceSelection("![ ".concat(Qt," ]( ").concat(Ft,' "').concat(Qt,'" )')),Ve.focus();case je:for(var or=vt.row,sr=vt.col,Jr=vt.align,qt=` `,on=0;on300&&(or=300);var sr=Me+or+"px";nn(sr)}}return vt.addEventListener("mousedown",Lt),document.addEventListener("mousemove",Ft),document.addEventListener("mouseup",Pt),function(){vt.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",Ft),document.removeEventListener("mouseup",Pt)}}},[Ve,On]),Object(M.useEffect)(function(){nn(Me)},[Me]);var Li=Ye(de),Rn=Ye(pn),qi={width:Li,height:Rn},ea=Object(M.useMemo)(function(){if(Wr){var vt=new Date(Wr),bt=vt.getHours(),Et=vt.getMinutes(),Lt=vt.getSeconds();return bt=bt<10?"0"+bt:bt,Et=Et<10?"0"+Et:Et,Lt=Lt<10?"0"+Lt:Lt,"".concat(bt,":").concat(Et,":").concat(Lt)}return 0},[Wr]);function Hr(){window.sessionStorage.removeItem(Dt),Zn(!1),Cr(0)}function ja(){Zn(!1),Cr(0),Ve.setValue(window.sessionStorage.getItem(Dt))}return D.a.createElement(M.Fragment,null,D.a.createElement("div",{className:"markdown-editor-wrapper",ref:Dn},D.a.createElement("div",{className:"markdown-editor-container ".concat(fr," ").concat(wt?"on-preview":""," ").concat(qe?"mini":""," ").concat(lt?"full-screen":""),style:qi},D.a.createElement(c,{insertTemp:st,watch:wt,fullScreen:lt,showNullButton:Xt,onActionCallback:vn,hidetoolBar:Ht}),D.a.createElement("div",{className:"markdown-editor-body"},D.a.createElement("div",{className:"codemirror-container"},D.a.createElement("textarea",{ref:Qr,placeholder:nr})),wt?D.a.createElement("div",{ref:gn,className:"preview-container"},xt==="stex"&&D.a.createElement(S,{value:Ct}),xt!=="stex"&&D.a.createElement(l.a,{value:Ct})):null))),Nt?D.a.createElement("a",{ref:On,className:"editor-resize"}):null,D.a.createElement(o.a,null,se[Kt]?D.a.createElement(z.a,{centered:!0,title:se[Kt],visible:!0,onCancel:an,footer:null},$n):null))}},SJ7D:function(ut,$e,J){},SJMd:function(ut,$e){/** * @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 J,re,z,L=!1,H,k;window.PR_SHOULD_USE_CONTINUATION=!0;var P,F;(function(){var M=window,D=["break,continue,do,else,for,if,return,while"],R=[D,"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"],E=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],w=[E,"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"],T=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],A=[E,"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"],_="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",b=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="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",s=[D,"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"],u=[D,"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"],l=[D,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[w,A,T,b,d,s,u,l],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",C="kwd",y="com",f="typ",c="lit",o="pun",a="pln",m="tag",p="dec",v="src",O="atn",U="atv",j="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(Ce){for(var we=0,Be=!1,Qe=!1,je=0,De=Ce.length;je122||(Y<65||ee>90||Ye.push([Math.max(65,ee)|32,Math.min(Y,90)|32]),Y<97||ee>122||Ye.push([Math.max(97,ee)&~32,Math.min(Y,122)&~32]))}}Ye.sort(function(de,ye){return de[0]-ye[0]||ye[1]-de[1]});for(var Q=[],Z=[],Ie=0;Ieq[0]&&(q[1]+1>q[0]&&xe.push("-"),xe.push(Ue(q[1])))}return xe.push("]"),xe.join("")}function ke(ze){for(var ge=ze.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ye=ge.length,He=[],xe=0,Ie=0;xe=2&&ee==="["?ge[xe]=We(se):ee!=="\\"&&(ge[xe]=se.replace(/[a-zA-Z]/g,function(Z){var q=Z.charCodeAt(0);return"["+String.fromCharCode(q&~32,q|32)+"]"}))}return ge.join("")}for(var Ke=[],je=0,De=Ce.length;je=0;)Be[Ke.charAt(ze)]=ke;var ge=ke[1],Ye=""+ge;Re.hasOwnProperty(Ye)||(Le.push(ge),Re[Ye]=null)}Le.push(/[\0-\uffff]/),Qe=B(Le)})();var je=we.length,De=function(Pe){for(var Le=Pe.sourceCode,Re=Pe.basePos,Ue=Pe.sourceNode,We=[Re,a],ke=0,Ke=Le.match(Qe)||[],ze={},ge=0,Ye=Ke.length;ge=5&&xe.substring(0,5)==="lang-",se&&!(Ie&&typeof Ie[1]=="string")&&(se=!1,xe=v),se||(ze[He]=xe)}var Y=ke;if(ke+=He.length,!se)We.push(Re+Y,xe);else{var Q=Ie[1],Z=He.indexOf(Q),q=Z+Q.length;Ie[2]&&(q=He.length-Ie[2].length,Z=q-Q.length);var de=xe.substring(5);V(Ue,Re+Y,He.substring(0,Z),De,We),V(Ue,Re+Y+Z,Q,ue(de,Q),We),V(Ue,Re+Y+q,He.substring(q),De,We)}}Pe.decorations=We};return De}function _e(Ce){var we=[],Be=[];Ce.tripleQuotedStrings?we.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ce.multiLineStrings?we.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):we.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ce.verbatimStrings&&Be.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Qe=Ce.hashComments;Qe&&(Ce.cStyleComments?(Qe>1?we.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):we.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):we.push([y,/^#[^\r\n]*/,null,"#"])),Ce.cStyleComments&&(Be.push([y,/^\/\/[^\r\n]*/,null]),Be.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var je=Ce.regexLiterals;if(je){var De=je>1?"":` \r`,Pe=De?".":"[\\S\\s]",Le="/(?=[^/*"+De+"])(?:[^/\\x5B\\x5C"+De+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+De+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+G+"("+Le+")")])}var Re=Ce.types;Re&&Be.push([f,Re]);var Ue=(""+Ce.keywords).replace(/^ | $/g,"");Ue.length&&Be.push([C,new RegExp("^(?:"+Ue.replace(/[\s,]+/g,"|")+")\\b"),null]),we.push([a,/^\s+/,null,` \r \xA0`]);var We="^.[^\\s\\w.$@'\"`/\\\\]*";return Ce.regexLiterals&&(We+="(?!s*/)"),Be.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[o,new RegExp(We),null]),oe(we,Be)}var fe=_e({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Ce,we,Be){for(var Qe=/(?:^|\s)nocode(?:\s|$)/,je=/\r\n?|\n/,De=Ce.ownerDocument,Pe=De.createElement("li");Ce.firstChild;)Pe.appendChild(Ce.firstChild);var Le=[Pe];function Re(ge){var Ye=ge.nodeType;if(Ye==1&&!Qe.test(ge.className))if(ge.nodeName==="br")Ue(ge),ge.parentNode&&ge.parentNode.removeChild(ge);else for(var He=ge.firstChild;He;He=He.nextSibling)Re(He);else if((Ye==3||Ye==4)&&Be){var xe=ge.nodeValue,Ie=xe.match(je);if(Ie){var se=xe.substring(0,Ie.index);ge.nodeValue=se;var te=xe.substring(Ie.index+Ie[0].length);if(te){var ee=ge.parentNode;ee.insertBefore(De.createTextNode(te),ge.nextSibling)}Ue(ge),se||ge.parentNode.removeChild(ge)}}}function Ue(ge){for(;!ge.nextSibling;)if(ge=ge.parentNode,!ge)return;function Ye(Ie,se){var te=se?Ie.cloneNode(!1):Ie,ee=Ie.parentNode;if(ee){var Y=Ye(ee,1),Q=Ie.nextSibling;Y.appendChild(te);for(var Z=Q;Z;Z=Q)Q=Z.nextSibling,Y.appendChild(Z)}return te}for(var He=Ye(ge.nextSibling,0),xe;(xe=He.parentNode)&&xe.nodeType===1;)He=xe;Le.push(He)}for(var We=0;We=ee&&(Re+=2),De>=Y&&(ke+=2)}}finally{xe&&(xe.style.display=Ie)}}var me={};function le(Ce,we){for(var Be=we.length;--Be>=0;){var Qe=we[Be];me.hasOwnProperty(Qe)?M.console&&console.warn("cannot override language handler %s",Qe):me[Qe]=Ce}}function ue(Ce,we){return Ce&&me.hasOwnProperty(Ce)||(Ce=/^\s*]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[o,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),le(oe([[a,/^[\s]+/,null,` \r `],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[O,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[o,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),le(oe([],[[U,/^[\s\S]+/]]),["uq.val"]),le(_e({keywords:w,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),le(_e({keywords:"null,true,false"}),["json"]),le(_e({keywords:A,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),le(_e({keywords:T,cStyleComments:!0}),["java"]),le(_e({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),le(_e({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),le(_e({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),le(_e({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),le(_e({keywords:b,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),le(_e({keywords:_,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),le(oe([],[[g,/^[\s\S]+/]]),["regex"]);function Ee(Ce){var we=Ce.langExtension;try{var Be=N(Ce.sourceNode,Ce.pre),Qe=Be.sourceCode;Ce.sourceCode=Qe,Ce.spans=Be.spans,Ce.basePos=0,ue(we,Qe)(Ce),be(Ce)}catch(je){M.console&&console.log(je&&je.stack||je)}}function Ge(Ce,we,Be){var Qe=Be||!1,je=we||null,De=document.createElement("div");De.innerHTML="
    "+Ce+"
    ",De=De.firstChild,Qe&&Se(De,Qe,!0);var Pe={langExtension:je,numberLines:Qe,sourceNode:De,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ee(Pe),De.innerHTML}function Te(Ce,we){var Be=we||document.body,Qe=Be.ownerDocument||document;function je(te){return Be.getElementsByTagName(te)}for(var De=[je("pre"),je("code"),je("xmp")],Pe=[],Le=0;Le=15&&(w=!1,D=!0);var g=u&&(R||w&&(h==null||h<12.11)),C=L||F&&M>=9;function y(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var n=e.className,r=y(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function c(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function o(e,t){return c(e).appendChild(t)}function a(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var x=0;x=t)return I+(t-x);I+=W-x,I+=n-I%n,x=W+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(I,t-i);if(i+=x-r,i+=n-i%n,r=x+1,i>=t)return r}}var le=[""];function ue(e){for(;le.length<=e;)le.push(Ee(le)+" ");return le[e]}function Ee(e){return e[e.length-1]}function Ge(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ce.test(e))}function Be(e,t){return t?t.source.indexOf("\\w")>-1&&we(e)?!0:t.test(e):we(e)}function Qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var je=/[\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 De(e){return e.charCodeAt(0)>=768&&je.test(e)}function Pe(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,x=r<0?Math.ceil(i):Math.floor(i);if(x==t)return e(x)?t:n;e(x)?n=x:t=x+r}}function Re(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,x=0;xt||t==n&&I.to==t)&&(r(Math.max(I.from,t),Math.min(I.to,n),I.level==1?"rtl":"ltr",x),i=!0)}i||r(t,n,"ltr")}var Ue=null;function We(e,t,n){var r;Ue=null;for(var i=0;it)return i;x.to==t&&(x.from!=x.to&&n=="before"?r=i:Ue=i),x.from==t&&(x.from!=x.to&&n!="before"?r=i:Ue=i)}return r!=null?r:Ue}var ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(X){return X<=247?e.charAt(X):1424<=X&&X<=1524?"R":1536<=X&&X<=1785?t.charAt(X-1536):1774<=X&&X<=2220?"r":8192<=X&&X<=8203?"w":X==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,x=/[LRr]/,I=/[Lb1n]/,W=/[1n]/;function K(X,ne,ae){this.level=X,this.from=ne,this.to=ae}return function(X,ne){var ae=ne=="ltr"?"L":"R";if(X.length==0||ne=="ltr"&&!r.test(X))return!1;for(var he=X.length,ce=[],Oe=0;Oe-1&&(r[t]=i.slice(0,x).concat(i.slice(x+1)))}}}function xe(e,t){var n=Ye(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function ee(e){e.prototype.on=function(t,n){ge(this,t,n)},e.prototype.off=function(t,n){He(this,t,n)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Q(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Z(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function q(e){Y(e),Q(e)}function de(e){return e.target||e.srcElement}function ye(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var Me=function(){if(F&&M<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),et;function qe(e){if(et==null){var t=a("span","\u200B");o(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(et=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&M<8))}var n=et?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var at;function gt(e){if(at!=null)return at;var t=o(e,document.createTextNode("A\u062EA")),n=p(t,0,1).getBoundingClientRect(),r=p(t,1,2).getBoundingClientRect();return c(e),!n||n.left==n.right?!1:at=r.right-n.right<3}var yt=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var x=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),I=x.indexOf("\r");I!=-1?(n.push(x.slice(0,I)),t+=I+1):(n.push(x),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},st=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_t=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),xt=null;function Bt(e){if(xt!=null)return xt;var t=o(e,a("span","x")),n=t.getBoundingClientRect(),r=p(t,0,1).getBoundingClientRect();return xt=Math.abs(n.left-r.left)>1}var Dt={},pt={};function Nt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Dt[e]=t}function rr(e,t){pt[e]=t}function Gt(e){if(typeof e=="string"&&pt.hasOwnProperty(e))e=pt[e];else if(e&&typeof e.name=="string"&&pt.hasOwnProperty(e.name)){var t=pt[e.name];typeof t=="string"&&(t={name:t}),e=Ae(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Gt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Gt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vt(e,t){t=Gt(t);var n=Dt[t.name];if(!n)return Vt(e,"text/plain");var r=n(e,t);if(Xt.hasOwnProperty(t.name)){var i=Xt[t.name];for(var x in i){if(!i.hasOwnProperty(x))continue;r.hasOwnProperty(x)&&(r["_"+x]=r[x]),r[x]=i[x]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var I in t.modeProps)r[I]=t.modeProps[I];return r}var Xt={};function Pr(e,t){var n=Xt.hasOwnProperty(e)?Xt[e]:Xt[e]={};N(t,n)}function Ht(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function kt(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function jt(e,t,n){return e.startState?e.startState(t,n):!0}var Ot=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ot.prototype.eol=function(){return this.pos>=this.string.length},Ot.prototype.sol=function(){return this.pos==this.lineStart},Ot.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ot.prototype.next=function(){if(this.post},Ot.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ot.prototype.skipToEnd=function(){this.pos=this.string.length},Ot.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ot.prototype.backUp=function(e){this.pos-=e},Ot.prototype.column=function(){return this.lastColumnPos0?null:(x&&t!==!1&&(this.pos+=x[0].length),x)}},Ot.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ot.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ot.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ot.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function tt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],x=i.chunkSize();if(t=e.first&&tn?Fe(n,tt(e,n).text.length):Ct(t,tt(e,t.line).text.length)}function Ct(e,t){var n=e.ch;return n==null||n>t?Fe(e.line,t):n<0?Fe(e.line,0):e}function Ur(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},ht.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ht.fromSaved=function(e,t,n){return t instanceof xr?new ht(e,Ht(e.mode,t.state),n,t.lookAhead):new ht(e,Ht(e.mode,t),n)},ht.prototype.save=function(e){var t=e!==!1?Ht(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new xr(t,this.maxLookAhead):t};function wt(e,t,n,r){var i=[e.state.modeGen],x={};Ut(e,t.text,e.doc.mode,n,function(X,ne){return i.push(X,ne)},x,r);for(var I=n.state,W=function(X){n.baseTokens=i;var ne=e.state.overlays[X],ae=1,he=0;n.state=!0,Ut(e,t.text,ne.mode,n,function(ce,Oe){for(var Ne=ae;hece&&i.splice(ae,1,ce,i[ae+1],Xe),ae+=2,he=Math.min(ce,Xe)}if(!Oe)return;if(ne.opaque)i.splice(Ne,ae-Ne,ce,"overlay "+Oe),ae=Ne+2;else for(;Nee.options.maxHighlightLength&&Ht(e.doc.mode,r.state),x=wt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=x.styles,x.classes?t.styleClasses=x.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ve(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ht(r,!0,t);var x=Ln(e,t,n),I=x>r.first&&tt(r,x-1).stateAfter,W=I?ht.fromSaved(r,I,x):new ht(r,jt(r.mode),x);return r.iter(x,t,function(K){nt(e,K.text,W);var X=W.line;K.stateAfter=X==t-1||X%5==0||X>=i.viewFrom&&Xt.start)return x}throw new Error("Mode "+e.name+" failed to advance stream.")}var Jt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function ar(e,t,n,r){var i=e.doc,x=i.mode,I;t=ct(i,t);var W=tt(i,t.line),K=ve(e,t.line,n),X=new Ot(W.text,e.options.tabSize,K),ne;for(r&&(ne=[]);(r||X.pose.options.maxHighlightLength?(W=!1,I&&nt(e,t,r,ne.pos),ne.pos=t.length,ae=null):ae=Kt(At(n,ne,r.state,he),x),he){var ce=he[0].name;ce&&(ae="m-"+(ae?ce+" "+ae:ce))}if(!W||X!=ae){for(;KI;--W){if(W<=x.first)return x.first;var K=tt(x,W-1),X=K.stateAfter;if(X&&(!n||W+(X instanceof xr?X.lookAhead:0)<=x.modeFrontier))return W;var ne=V(K.text,null,e.options.tabSize);(i==null||r>ne)&&(i=W-1,r=ne)}return i}function Mr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiern;r--){var i=tt(e,r).stateAfter;if(i&&(!(i instanceof xr)||r+i.lookAhead=t:x.to>t);(r||(r=[])).push(new pn(I,x.from,K?null:x.to))}}return r}function Zn(e,t,n){var r;if(e)for(var i=0;i=t:x.to>t);if(W||x.from==t&&I.type=="bookmark"&&(!n||x.marker.insertLeft)){var K=x.from==null||(I.inclusiveLeft?x.from<=t:x.from0&&W)for(var it=0;it0)continue;var ne=[K,1],ae=dt(X.from,W.from),he=dt(X.to,W.to);(ae<0||!I.inclusiveLeft&&!ae)&&ne.push({from:X.from,to:W.from}),(he>0||!I.inclusiveRight&&!he)&&ne.push({from:W.to,to:X.to}),i.splice.apply(i,ne),K+=ne.length-3}return i}function gn(e){var t=e.markedSpans;if(!t)return;for(var n=0;nt)&&(!r||$n(r,x.marker)<0)&&(r=x.marker)}return r}function ea(e,t,n,r,i){var x=tt(e,t),I=Cr&&x.markedSpans;if(I)for(var W=0;W=0&&ae<=0||ne<=0&&ae>=0)continue;if(ne<=0&&(K.marker.inclusiveRight&&i.inclusiveLeft?dt(X.to,n)>=0:dt(X.to,n)>0)||ne>=0&&(K.marker.inclusiveRight&&i.inclusiveLeft?dt(X.from,r)<=0:dt(X.from,r)<0))return!0}}function Hr(e){for(var t;t=Li(e);)e=t.find(-1,!0).line;return e}function ja(e){for(var t;t=Rn(e);)e=t.find(1,!0).line;return e}function vt(e){for(var t,n;t=Rn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function bt(e,t){var n=tt(e,t),r=Hr(n);return n==r?t:St(r)}function Et(e,t){if(t>e.lastLine())return t;var n=tt(e,t),r;if(!Lt(e,n))return t;for(;r=Rn(n);)n=r.find(1,!0).line;return St(n)+1}function Lt(e,t){var n=Cr&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var sr=function(e,t,n){this.text=e,Jn(this,t),this.height=n?n(this):1};sr.prototype.lineNo=function(){return St(this)},ee(sr);function Jr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gn(e),Jn(e,n);var i=r?r(e):1;i!=e.height&&fr(e,i)}function qt(e){e.parent=null,gn(e)}var on={},yr={};function $r(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?yr:on;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function qr(e,t){var n=m("span",null,null,D?"padding-right: .1px":null),r={pre:m("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var x=i?t.rest[i-1]:t.line,I=void 0;r.pos=0,r.addToken=ws,gt(e.display.measure)&&(I=Ke(x,e.doc.direction))&&(r.addToken=As(r.addToken,I)),r.map=[];var W=t!=e.display.externalMeasured&&St(x);Ls(x,r,ot(e,x,W)),x.styleClasses&&(x.styleClasses.bgClass&&(r.bgClass=j(x.styleClasses.bgClass,r.bgClass||"")),x.styleClasses.textClass&&(r.textClass=j(x.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(qe(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(D){var K=r.content.lastChild;(/\bcm-tab\b/.test(K.className)||K.querySelector&&K.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return xe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function qn(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ws(e,t,n,r,i,x,I){if(!t)return;var W=e.splitSpaces?Cs(t,e.trailingSpace):t,K=e.cm.state.specialChars,X=!1,ne;if(!K.test(t))e.col+=t.length,ne=document.createTextNode(W),e.map.push(e.pos,e.pos+t.length,ne),F&&M<9&&(X=!0),e.pos+=t.length;else{ne=document.createDocumentFragment();for(var ae=0;;){K.lastIndex=ae;var he=K.exec(t),ce=he?he.index-ae:t.length-ae;if(ce){var Oe=document.createTextNode(W.slice(ae,ae+ce));F&&M<9?ne.appendChild(a("span",[Oe])):ne.appendChild(Oe),e.map.push(e.pos,e.pos+ce,Oe),e.col+=ce,e.pos+=ce}if(!he)break;ae+=ce+1;var Ne=void 0;if(he[0]==" "){var Xe=e.cm.options.tabSize,Ze=Xe-e.col%Xe;Ne=ne.appendChild(a("span",ue(Ze),"cm-tab")),Ne.setAttribute("role","presentation"),Ne.setAttribute("cm-text"," "),e.col+=Ze}else he[0]=="\r"||he[0]==` `?(Ne=ne.appendChild(a("span",he[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ne.setAttribute("cm-text",he[0]),e.col+=1):(Ne=e.cm.options.specialCharPlaceholder(he[0]),Ne.setAttribute("cm-text",he[0]),F&&M<9?ne.appendChild(a("span",[Ne])):ne.appendChild(Ne),e.col+=1);e.map.push(e.pos,e.pos+1,Ne),e.pos++}}if(e.trailingSpace=W.charCodeAt(t.length-1)==32,n||r||i||X||x||I){var rt=n||"";r&&(rt+=r),i&&(rt+=i);var Je=a("span",[ne],rt,x);if(I)for(var it in I)I.hasOwnProperty(it)&&it!="style"&&it!="class"&&Je.setAttribute(it,I[it]);return e.content.appendChild(Je)}e.content.appendChild(ne)}function Cs(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iX&&ae.from<=X);he++);if(ae.to>=ne)return e(n,r,i,x,I,W,K);e(n,r.slice(0,ae.to-X),i,x,null,W,K),x=null,r=r.slice(ae.to-X),X=ae.to}}}function Wa(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ls(e,t,n){var r=e.markedSpans,i=e.text,x=0;if(!r){for(var I=1;IK||Tt.collapsed&&ft.to==K&&ft.from==K)){if(ft.to!=null&&ft.to!=K&&ce>ft.to&&(ce=ft.to,Ne=""),Tt.className&&(Oe+=" "+Tt.className),Tt.css&&(he=(he?he+";":"")+Tt.css),Tt.startStyle&&ft.from==K&&(Xe+=" "+Tt.startStyle),Tt.endStyle&&ft.to==ce&&(it||(it=[])).push(Tt.endStyle,ft.to),Tt.title&&((rt||(rt={})).title=Tt.title),Tt.attributes)for(var It in Tt.attributes)(rt||(rt={}))[It]=Tt.attributes[It];Tt.collapsed&&(!Ze||$n(Ze.marker,Tt)<0)&&(Ze=ft)}else ft.from>K&&ce>ft.from&&(ce=ft.from)}if(it)for(var dr=0;dr=W)break;for(var Ir=Math.min(W,ce);;){if(ne){var Dr=K+ne.length;if(!Ze){var er=Dr>Ir?ne.slice(0,Ir-K):ne;t.addToken(t,er,ae?ae+Oe:Oe,Xe,K+er.length==ce?Ne:"",he,rt)}if(Dr>=Ir){ne=ne.slice(Ir-K),K=Ir;break}K=Dr,Xe=""}ne=i.slice(x,x=n[X++]),ae=$r(n[X++],t.cm.options)}}}function Ha(e,t,n){this.line=t,this.rest=vt(t),this.size=this.rest?St(Ee(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Lt(e,t)}function Di(e,t,n){for(var r=[],i,x=t;x2&&x.push((K.bottom+X.top)/2-n.top)}}x.push(n.bottom-n.top)}}function Qa(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Bs(e,t){t=Hr(t);var n=St(t),r=e.display.externalMeasured=new Ha(e.doc,t,n);r.lineN=n;var i=r.built=qr(e,r);return r.text=i.pre,o(e.display.lineMeasure,i.pre),r}function Za(e,t,n,r){return Xr(e,Mn(e,t),n,r)}function ia(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(x=K-W,i=x-1,t>=K&&(I="right")),i!=null){if(r=e[X+2],W==K&&n==(r.insertLeft?"left":"right")&&(I=n),n=="left"&&i==0)for(;X&&e[X-2]==e[X-3]&&e[X-1].insertLeft;)r=e[(X-=3)+2],I="left";if(n=="right"&&i==K-W)for(;X=0&&!((n=e[i]).left!=n.right);i--);return n}function Ws(e,t,n,r){var i=$a(t.map,n,r),x=i.node,I=i.start,W=i.end,K=i.collapse,X;if(x.nodeType==3){for(var ne=0;ne<4;ne++){for(;I&&De(t.line.text.charAt(i.coverStart+I));)--I;for(;i.coverStart+W0&&(K=r="right");var ae;e.options.lineWrapping&&(ae=x.getClientRects()).length>1?X=ae[r=="right"?ae.length-1:0]:X=x.getBoundingClientRect()}if(F&&M<9&&!I&&(!X||!X.left&&!X.right)){var he=x.parentNode.getClientRects()[0];he?X={left:he.left,right:he.left+In(e.display),top:he.top,bottom:he.bottom}:X=Ja}for(var ce=X.top-t.rect.top,Oe=X.bottom-t.rect.top,Ne=(ce+Oe)/2,Xe=t.view.measure.heights,Ze=0;Ze=r.text.length?(K=r.text.length,X="before"):K<=0&&(K=0,X="after"),!W)return I(X=="before"?K-1:K,X=="before");function ne(Oe,Ne,Xe){var Ze=W[Ne],rt=Ze.level==1;return I(Xe?Oe-1:Oe,rt!=Xe)}var ae=We(W,K,X),he=Ue,ce=ne(K,ae,X=="before");return he!=null&&(ce.other=ne(K,he,X!="before")),ce}function io(e,t){var n=0;t=ct(e.doc,t),e.options.lineWrapping||(n=In(e.display)*t.ch);var r=tt(e.doc,t.line),i=Ft(r)+Oi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function sa(e,t,n,r,i){var x=Fe(e,t,n);return x.xRel=i,r&&(x.outside=r),x}function la(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return sa(r.first,0,null,-1,-1);var i=hr(r,n),x=r.first+r.size-1;if(i>x)return sa(r.first+r.size-1,tt(r,x).text.length,null,1,1);t<0&&(t=0);for(var I=tt(r,i);;){var W=Ks(e,I,i,t,n),K=qi(I,W.ch+(W.xRel>0||W.outside>0?1:0));if(!K)return W;var X=K.find(1);if(X.line==i)return X;I=tt(r,i=X.line)}}function ao(e,t,n,r){r-=aa(t);var i=t.text.length,x=Le(function(I){return Xr(e,n,I-1).bottom<=r},i,0);return i=Le(function(I){return Xr(e,n,I).top>r},x,i),{begin:x,end:i}}function oo(e,t,n,r){n||(n=Mn(e,t));var i=Ri(e,t,Xr(e,n,r),"line").top;return ao(e,t,n,i)}function ua(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Ks(e,t,n,r,i){i-=Ft(t);var x=Mn(e,t),I=aa(t),W=0,K=t.text.length,X=!0,ne=Ke(t,e.doc.direction);if(ne){var ae=(e.options.lineWrapping?Gs:zs)(e,t,n,x,ne,r,i);X=ae.level!=1,W=X?ae.from:ae.to-1,K=X?ae.to:ae.from-1}var he=null,ce=null,Oe=Le(function(mt){var ft=Xr(e,x,mt);return ft.top+=I,ft.bottom+=I,ua(ft,r,i,!1)?(ft.top<=i&&ft.left<=r&&(he=mt,ce=ft),!0):!1},W,K),Ne,Xe,Ze=!1;if(ce){var rt=r-ce.left=it.bottom?1:0}return Oe=Pe(t.text,Oe,1),sa(n,Oe,Xe,Ze,r-Ne)}function zs(e,t,n,r,i,x,I){var W=Le(function(ae){var he=i[ae],ce=he.level!=1;return ua(Kr(e,Fe(n,ce?he.to:he.from,ce?"before":"after"),"line",t,r),x,I,!0)},0,i.length-1),K=i[W];if(W>0){var X=K.level!=1,ne=Kr(e,Fe(n,X?K.from:K.to,X?"after":"before"),"line",t,r);ua(ne,x,I,!0)&&ne.top>I&&(K=i[W-1])}return K}function Gs(e,t,n,r,i,x,I){var W=ao(e,t,r,I),K=W.begin,X=W.end;/\s/.test(t.text.charAt(X-1))&&X--;for(var ne=null,ae=null,he=0;he=X||ce.to<=K)continue;var Oe=ce.level!=1,Ne=Xr(e,r,Oe?Math.min(X,ce.to)-1:Math.max(K,ce.from)).right,Xe=NeXe)&&(ne=ce,ae=Xe)}return ne||(ne=i[i.length-1]),ne.fromX&&(ne={from:ne.from,to:X,level:ne.level}),ne}var bn;function kn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(bn==null){bn=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)bn.appendChild(document.createTextNode("x")),bn.appendChild(a("br"));bn.appendChild(document.createTextNode("x"))}o(e.measure,bn);var n=bn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),c(e.measure),n||1}function In(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),n=a("pre",[t],"CodeMirror-line-like");o(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function da(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,x=t.gutters.firstChild,I=0;x;x=x.nextSibling,++I){var W=e.display.gutterSpecs[I].className;n[W]=x.offsetLeft+x.clientLeft+i,r[W]=x.clientWidth}return{fixedPos:ca(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ca(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function so(e){var t=kn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/In(e.display)-3);return function(i){if(Lt(e.doc,i))return 0;var x=0;if(i.widgets)for(var I=0;I0&&(X=tt(e.doc,K.line).text).length==K.ch){var ne=V(X,X.length,e.options.tabSize)-X.length;K=Fe(K.line,Math.max(0,Math.round((x-Ya(e.display).left)/In(e.display))-ne))}return K}function xn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Cr&&bt(e.doc,t)i.viewFrom?ln(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)ln(e);else if(t<=i.viewFrom){var x=Pi(e,n,n+r,1);x?(i.view=i.view.slice(x.index),i.viewFrom=x.lineN,i.viewTo+=r):ln(e)}else if(n>=i.viewTo){var I=Pi(e,t,t,-1);I?(i.view=i.view.slice(0,I.index),i.viewTo=I.lineN):ln(e)}else{var W=Pi(e,t,t,-1),K=Pi(e,n,n+r,1);W&&K?(i.view=i.view.slice(0,W.index).concat(Di(e,W.lineN,K.lineN)).concat(i.view.slice(K.index)),i.viewTo+=r):ln(e)}var X=i.externalMeasured;X&&(n=i.lineN&&t=r.viewTo)return;var x=r.view[xn(e,t)];if(x.node==null)return;var I=x.changes||(x.changes=[]);ie(I,n)==-1&&I.push(n)}function ln(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pi(e,t,n,r){var i=xn(e,t),x,I=e.display.view;if(!Cr||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var W=e.display.viewFrom,K=0;K0){if(i==I.length-1)return null;x=W+I[i].size-t,i++}else x=W-t;t+=x,n+=x}for(;bt(e.doc,n)!=n;){if(i==(r<0?0:I.length-1))return null;n+=r*I[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Vs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Di(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Di(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,xn(e,n)))),r.viewTo=n}function lo(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||W.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Nn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function fo(e){e.state.focused||(e.display.input.focus(),ma(e))}function ho(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Nn(e))},100)}function ma(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(xe(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),D&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ha(e)}function Nn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(xe(e,"blur",e,t),e.state.focused=!1,f(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ki(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||ne<-.005)&&(fr(i.line,I),mo(i.line),i.rest))for(var ae=0;aee.display.sizerWidth){var he=Math.ceil(W/In(e.display));he>e.display.maxLineLength&&(e.display.maxLineLength=he,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function mo(e){if(e.widgets)for(var t=0;t=I&&(x=hr(t,Ft(tt(t,K))-e.wrapper.clientHeight),I=K)}return{from:x,to:Math.max(I,x+1)}}function Ys(e,t){if(Ie(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!_){var x=a("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-Oi(e.display))+`px; height: `+(t.bottom-t.top+Vr(e)+n.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(x),x.scrollIntoView(i),e.display.lineSpace.removeChild(x)}}function Qs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?Fe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Fe(t.line,t.ch+1,"before"):t);for(var x=0;x<5;x++){var I=!1,W=Kr(e,t),K=!n||n==t?W:Kr(e,n);i={left:Math.min(W.left,K.left),top:Math.min(W.top,K.top)-r,right:Math.max(W.left,K.left),bottom:Math.max(W.bottom,K.bottom)+r};var X=pa(e,i),ne=e.doc.scrollTop,ae=e.doc.scrollLeft;if(X.scrollTop!=null&&(oi(e,X.scrollTop),Math.abs(e.doc.scrollTop-ne)>1&&(I=!0)),X.scrollLeft!=null&&(Tn(e,X.scrollLeft),Math.abs(e.doc.scrollLeft-ae)>1&&(I=!0)),!I)break}return i}function Zs(e,t){var n=pa(e,t);n.scrollTop!=null&&oi(e,n.scrollTop),n.scrollLeft!=null&&Tn(e,n.scrollLeft)}function pa(e,t){var n=e.display,r=kn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,x=na(e),I={};t.bottom-t.top>x&&(t.bottom=t.top+x);var W=e.doc.height+ra(n),K=t.topW-r;if(t.topi+x){var ne=Math.min(t.top,(X?W:t.bottom)-x);ne!=i&&(I.scrollTop=ne)}var ae=e.options.fixedGutter?0:n.gutters.offsetWidth,he=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ae,ce=yn(e)-n.gutters.offsetWidth,Oe=t.right-t.left>ce;return Oe&&(t.right=t.left+ce),t.left<10?I.scrollLeft=0:t.leftce+he-3&&(I.scrollLeft=t.right+(Oe?0:10)-ce),I}function ga(e,t){if(t==null)return;Ni(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Un(e){Ni(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ai(e,t,n){(t!=null||n!=null)&&Ni(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Js(e,t){Ni(e),e.curOp.scrollToPos=t}function Ni(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=io(e,t.from),r=io(e,t.to);po(e,n,r,t.margin)}}function po(e,t,n,r){var i=pa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ai(e,i.scrollLeft,i.scrollTop)}function oi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;L||ya(e,{top:t}),go(e,t,!0),L&&ya(e),ui(e,100)}function go(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Tn(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function si(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ra(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Vr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Sn=function(e,t,n){this.cm=n;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ge(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),ge(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&M<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Sn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var x=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+x)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Sn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Sn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Sn.prototype.zeroWidthHack=function(){var e=u&&!A?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},Sn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),x=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);x!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Sn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var li=function(){};li.prototype.update=function(){return{bottom:0,right:0}},li.prototype.setScrollLeft=function(){},li.prototype.setScrollTop=function(){},li.prototype.clear=function(){};function Fn(e,t){t||(t=si(e));var n=e.display.barWidth,r=e.display.barHeight;vo(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ki(e),vo(e,si(e)),n=e.display.barWidth,r=e.display.barHeight}function vo(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var yo={native:Sn,null:li};function bo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&f(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new yo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ge(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Tn(e,t):oi(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var $s=0;function _n(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:++$s},Ds(e.curOp)}function wn(e){var t=e.curOp;t&&Rs(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ui(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&va(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&ki(t),e.barMeasure=si(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Za(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Vr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=ve(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(x){if(r.line>=e.display.viewFrom){var I=x.styles,W=x.text.length>e.options.maxHighlightLength?Ht(t.mode,r.state):null,K=wt(e,x,r,!0);W&&(r.state=W),x.styles=K.styles;var X=x.styleClasses,ne=K.classes;ne?x.styleClasses=ne:X&&(x.styleClasses=null);for(var ae=!I||I.length!=x.styles.length||X!=ne&&(!X||!ne||X.bgClass!=ne.bgClass||X.textClass!=ne.textClass),he=0;!ae&&hen)return ui(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&kr(e,function(){for(var x=0;x=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&lo(e)==0)return!1;To(e)&&(ln(e),t.dims=da(e));var i=r.first+r.size,x=Math.max(t.visible.from-e.options.viewportMargin,r.first),I=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFromI&&n.viewTo-I<20&&(I=Math.min(i,n.viewTo)),Cr&&(x=bt(e.doc,x),I=Et(e.doc,I));var W=x!=n.viewFrom||I!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,x,I),n.viewOffset=Ft(tt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var K=lo(e);if(!W&&K==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var X=sl(e);return K>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),K>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(X),c(n.cursorDiv),c(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,W&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ui(e,400)),n.updateLineNumbers=null,!0}function Eo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==yn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ra(e.display)-na(e),n.top)}),t.visible=Ii(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ii(e.display,e.doc,n));if(!va(e,t))break;ki(e);var i=si(e);ii(e),Fn(e,i),Ea(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ya(e,t){var n=new Ui(e,t);if(va(e,n)){ki(e),Eo(e,n);var r=si(e);ii(e),Fn(e,r),Ea(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,x=r.lineDiv,I=x.firstChild;function W(Oe){var Ne=Oe.nextSibling;return D&&u&&e.display.currentWheelTarget==Oe?Oe.style.display="none":Oe.parentNode.removeChild(Oe),Ne}for(var K=r.view,X=r.viewFrom,ne=0;ne-1&&(ce=!1),Ka(e,ae,X,n)),ce&&(c(ae.lineNumber),ae.lineNumber.appendChild(document.createTextNode(nr(e.options,X)))),I=ae.node.nextSibling}X+=ae.size}for(;I;)I=W(I)}function ba(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ea(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Vr(e)+"px"}function xo(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=ca(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,x=r+"px",I=0;II.clientWidth,K=I.scrollHeight>I.clientHeight;if(!(r&&W||i&&K))return;if(i&&u&&D){e:for(var X=t.target,ne=x.view;X!=I;X=X.parentNode)for(var ae=0;ae=0&&dt(e,r.to())<=0)return n}return-1};var Rt=function(e,t){this.anchor=e,this.head=t};Rt.prototype.from=function(){return wr(this.anchor,this.head)},Rt.prototype.to=function(){return Ve(this.anchor,this.head)},Rt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zr(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(he,ce){return dt(he.from(),ce.from())}),n=ie(t,i);for(var x=1;x0:K>=0){var X=wr(W.from(),I.from()),ne=Ve(W.to(),I.to()),ae=W.empty()?I.from()==I.head:W.from()==W.head;x<=n&&--n,t.splice(--x,2,new Rt(ae?ne:X,ae?X:ne))}}return new Br(t,n)}function un(e,t){return new Br([new Rt(e,t||e)],0)}function dn(e){return e.text?Fe(e.from.line+e.text.length-1,Ee(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Co(e,t){if(dt(e,t.from)<0)return e;if(dt(e,t.to)<=0)return dn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=dn(t).ch-t.to.ch),Fe(n,r)}function Ta(e,t){for(var n=[],r=0;r1&&e.remove(W.line+1,Oe-1),e.insert(W.line+1,Ze)}mr(e,"change",e,t)}function cn(e,t,n){function r(i,x,I){if(i.linked)for(var W=0;W1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ee(e.done)}function Po(e,t,n,r){var i=e.history;i.undone.length=0;var x=+new Date,I,W;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>x-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(I=ml(i,i.lastOp==r)))W=Ee(I.changes),dt(t.from,t.to)==0&&dt(t.from,W.to)==0?W.to=dn(t):I.changes.push(wa(e,t));else{var K=Ee(i.done);for((!K||!K.ranges)&&ji(e.sel,i.done),I={changes:[wa(e,t)],generation:i.generation},i.done.push(I);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=x,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,W||xe(e,"historyAdded")}function pl(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,x=r&&r.origin;n==i.lastSelOp||x&&i.lastSelOrigin==x&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==x||pl(e,x,Ee(i.done),t))?i.done[i.done.length-1]=t:ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=x,i.lastSelOp=n,r&&r.clearRedo!==!1&&Ro(i.undone)}function ji(e,t){var n=Ee(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Mo(e,t,n,r){var i=t["spans_"+e.id],x=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(I){I.markedSpans&&((i||(i=t["spans_"+e.id]={}))[x]=I.markedSpans),++x})}function vl(e){if(!e)return null;for(var t,n=0;n-1&&(Ee(W)[ae]=X[ae],delete X[ae]))}}return r}function Ca(e,t,n,r){if(r){var i=e.anchor;if(n){var x=dt(t,i)<0;x!=dt(n,i)<0?(i=t,t=n):x!=dt(t,n)<0&&(t=n)}return new Rt(i,t)}else return new Rt(n||t,t)}function Wi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),br(e,new Br([Ca(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),x=0;x=t.ch:W.to>t.ch))){if(i&&(xe(K,"beforeCursorEnter"),K.explicitlyCleared))if(x.markedSpans){--I;continue}else break;if(!K.atomic)continue;if(n){var ae=K.find(r<0?1:-1),he=void 0;if((r<0?ne:X)&&(ae=Wo(e,ae,-r,ae&&ae.line==t.line?x:null)),ae&&ae.line==t.line&&(he=dt(ae,n))&&(r<0?he<0:he>0))return jn(e,ae,t,r,i)}var ce=K.find(r<0?-1:1);return(r<0?X:ne)&&(ce=Wo(e,ce,r,ce.line==t.line?x:null)),ce?jn(e,ce,t,r,i):null}}return t}function Ki(e,t,n,r,i){var x=r||1,I=jn(e,t,n,x,i)||!i&&jn(e,t,n,x,!0)||jn(e,t,n,-x,i)||!i&&jn(e,t,n,-x,!0);return I||(e.cantEdit=!0,Fe(e.first,0))}function Wo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ct(e,Fe(t.line-1)):null:n>0&&t.ch==(r||tt(e,t.line)).text.length?t.line=0;--i)zo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else zo(e,t)}function zo(e,t){if(t.text.length==1&&t.text[0]==""&&dt(t.from,t.to)==0)return;var n=Ta(e,t);Po(e,t,n,e.cm?e.cm.curOp.id:NaN),fi(e,t,n,Qr(e,t));var r=[];cn(e,function(i,x){!x&&ie(r,i.history)==-1&&(Yo(i.history,t),r.push(i.history)),fi(i,t,null,Qr(i,t))})}function zi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,x,I=e.sel,W=t=="undo"?i.done:i.undone,K=t=="undo"?i.undone:i.done,X=0;X=0;--ce){var Oe=he(ce);if(Oe)return Oe.v}}function Go(e,t){if(t==0)return;if(e.first+=t,e.sel=new Br(Ge(e.sel.ranges,function(i){return new Rt(Fe(i.anchor.line+t,i.anchor.ch),Fe(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){Ar(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())return;if(t.from.linex&&(t={from:t.from,to:Fe(x,tt(e,x).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Yt(e,t.from,t.to),n||(n=Ta(e,t)),e.cm?El(e.cm,t,r):_a(e,t,r),Hi(e,n,fe),e.cantEdit&&Ki(e,Fe(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,n){var r=e.doc,i=e.display,x=t.from,I=t.to,W=!1,K=x.line;e.options.lineWrapping||(K=St(Hr(tt(r,x.line))),r.iter(K,I.line+1,function(ce){if(ce==i.maxLine)return W=!0,!0})),r.sel.contains(t.from,t.to)>-1&&se(e),_a(r,t,n,so(e)),e.options.lineWrapping||(r.iter(K,x.line+t.text.length,function(ce){var Oe=Qt(ce);Oe>i.maxLineLength&&(i.maxLine=ce,i.maxLineLength=Oe,i.maxLineChanged=!0,W=!1)}),W&&(e.curOp.updateMaxLine=!0)),Mr(r,x.line),ui(e,400);var X=t.text.length-(I.line-x.line)-1;t.full?Ar(e):x.line==I.line&&t.text.length==1&&!Lo(e.doc,t)?sn(e,x.line,"text"):Ar(e,x.line,I.line+1,X);var ne=te(e,"changes"),ae=te(e,"change");if(ae||ne){var he={from:x,to:I,text:t.text,removed:t.removed,origin:t.origin};ae&&mr(e,"change",e,he),ne&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(he)}e.display.selForContextMenu=null}function Hn(e,t,n,r,i){var x;r||(r=n),dt(r,n)<0&&(x=[r,n],n=x[0],r=x[1]),typeof t=="string"&&(t=e.splitLines(t)),Wn(e,{from:n,to:r,text:t,origin:i})}function Vo(e,t,n,r){n1||!(this.children[0]instanceof mi))){var W=[];this.collapse(W),this.children=[new mi(W)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var I=i.lines.length%25+25,W=I;W10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=X,e.display.maxLineLength=ne,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Ar(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Bo(e.doc)),e&&mr(e,"markerCleared",e,this,r,i),t&&wn(e),this.parent&&this.parent.clear()},fn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||I==0&&x.clearWhenEmpty!==!1)return x;if(x.replacedWith&&(x.collapsed=!0,x.widgetNode=m("span",[x.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||x.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(x.widgetNode.insertLeft=!0)),x.collapsed){if(ea(e,t.line,t,n,x)||t.line!=n.line&&ea(e,n.line,t,n,x))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ci()}x.addToHistory&&Po(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var W=t.line,K=e.cm,X;if(e.iter(W,n.line+1,function(ae){K&&x.collapsed&&!K.options.lineWrapping&&Hr(ae)==K.display.maxLine&&(X=!0),x.collapsed&&W!=t.line&&fr(ae,0),Ai(ae,new pn(x,W==t.line?t.ch:null,W==n.line?n.ch:null)),++W}),x.collapsed&&e.iter(t.line,n.line+1,function(ae){Lt(e,ae)&&fr(ae,0)}),x.clearOnEnter&&ge(x,"beforeCursorEnter",function(){return x.clear()}),x.readOnly&&(wi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),x.collapsed&&(x.id=++Zo,x.atomic=!0),K){if(X&&(K.curOp.updateMaxLine=!0),x.collapsed)Ar(K,t.line,n.line+1);else if(x.className||x.startStyle||x.endStyle||x.css||x.attributes||x.title)for(var ne=t.line;ne<=n.line;ne++)sn(K,ne,"text");x.atomic&&Bo(K.doc),mr(K,"markerAdded",K,x)}return x}var vi=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;K--)Wn(this,r[K]);W?Uo(this,W):this.cm&&Un(this.cm)}),undo:ur(function(){zi(this,"undo")}),redo:ur(function(){zi(this,"redo")}),undoSelection:ur(function(){zi(this,"undo",!0)}),redoSelection:ur(function(){zi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ct(this,e),t=ct(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(x){var I=x.markedSpans;if(I)for(var W=0;W=K.to||K.from==null&&i!=e.line||K.from!=null&&i==t.line&&K.from>=t.ch)&&(!n||n(K.marker))&&r.push(K.marker.parent||K.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=x,++n}),ct(this,Fe(n,t))},indexFromPos:function(e){e=ct(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ne=e.dataTransfer.getData("Text");if(ne){var ae;if(t.state.draggingText&&!t.state.draggingText.copy&&(ae=t.listSelections()),Hi(t.doc,un(n,n)),ae)for(var he=0;he=0;W--)Hn(e.doc,"",r[W].from,r[W].to,"+delete");Un(e)})}function La(e,t,n){var r=Pe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Da(e,t,n){var r=La(e,t.ch,n);return r==null?null:new Fe(t.line,r,n<0?"after":"before")}function Oa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var x=Ke(n,t.doc.direction);if(x){var I=i<0?Ee(x):x[0],W=i<0==(I.level==1),K=W?"after":"before",X;if(I.level>0||t.doc.direction=="rtl"){var ne=Mn(t,n);X=i<0?n.text.length-1:0;var ae=Xr(t,ne,X).top;X=Le(function(he){return Xr(t,ne,he).top==ae},i<0==(I.level==1)?I.from:I.to-1,X),K=="before"&&(X=La(n,X,1))}else X=i<0?I.to:I.from;return new Fe(r,X,K)}}return new Fe(r,i<0?n.text.length:0,i<0?"before":"after")}function kl(e,t,n,r){var i=Ke(t,e.doc.direction);if(!i)return Da(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var x=We(i,n.ch,n.sticky),I=i[x];if(e.doc.direction=="ltr"&&I.level%2==0&&(r>0?I.to>n.ch:I.from=I.from&&he>=ne.begin)){var ce=ae?"before":"after";return new Fe(n.line,he,ce)}}var Oe=function(Ze,rt,Je){for(var it=function(It,dr){return dr?new Fe(n.line,W(It,1),"before"):new Fe(n.line,It,"after")};Ze>=0&&Ze0==(mt.level!=1),Tt=ft?Je.begin:W(Je.end,-1);if(mt.from<=Tt&&Tt0?ne.end:W(ne.begin,-1);return Xe!=null&&!(r>0&&Xe==t.text.length)&&(Ne=Oe(r>0?0:i.length-1,r,X(Xe)),Ne)?Ne:null}var Ei={selectAll:Ho,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fe)},killLine:function(e){return Gn(e,function(t){if(t.empty()){var n=tt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new Fe(i.line,i.ch+1),e.replaceRange(x.charAt(i.ch-1)+x.charAt(i.ch-2),Fe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var I=tt(e.doc,i.line-1).text;I&&(i=new Fe(i.line,1),e.replaceRange(x.charAt(0)+e.doc.lineSeparator()+I.charAt(I.length-1),Fe(i.line-1,I.length-1),i,"+transpose"))}}n.push(new Rt(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return kr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&dt(t,this.pos)==0&&n==this.button};var Ti,Si;function Wl(e,t){var n=+new Date;return Si&&Si.compare(n,e,t)?(Ti=Si=null,"triple"):Ti&&Ti.compare(n,e,t)?(Si=new Pa(n,e,t),Ti=null,"double"):(Ti=new Pa(n,e,t),Si=null,"single")}function fs(e){var t=this,n=t.display;if(Ie(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,en(n,e)){D||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ma(t,e))return;var r=En(t,e),i=ye(e),x=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,i,r,x,e))return;i==1?r?zl(t,r,x,e):de(e)==n.scroller&&Y(e):i==2?(r&&Wi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(C?t.display.input.onContextMenu(e):ho(t))}function Hl(e,t,n,r,i){var x="Click";return r=="double"?x="Double"+x:r=="triple"&&(x="Triple"+x),x=(t==1?"Left":t==2?"Middle":"Right")+x,xi(e,ns(x,i),i,function(I){if(typeof I=="string"&&(I=Ei[I]),!I)return!1;var W=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),W=I(e,n)!=_e}finally{e.state.suppressEdits=!1}return W})}function Kl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var x=l?n.shiftKey&&n.metaKey:n.altKey;i.unit=x?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=u?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(u?n.altKey:n.ctrlKey)),i}function zl(e,t,n,r){F?setTimeout(B(fo,e),0):e.curOp.focus=O();var i=Kl(e,n,r),x=e.doc.sel,I;e.options.dragDrop&&Me&&!e.isReadOnly()&&n=="single"&&(I=x.contains(t))>-1&&(dt((I=x.ranges[I]).from(),t)<0||t.xRel>0)&&(dt(I.to(),t)>0||t.xRel<0)?Gl(e,r,t,i):Vl(e,r,t,i)}function Gl(e,t,n,r){var i=e.display,x=!1,I=lr(e,function(X){D&&(i.scroller.draggable=!1),e.state.draggingText=!1,He(i.wrapper.ownerDocument,"mouseup",I),He(i.wrapper.ownerDocument,"mousemove",W),He(i.scroller,"dragstart",K),He(i.scroller,"drop",I),x||(Y(X),r.addNew||Wi(e.doc,n,null,null,r.extend),D&&!T||F&&M==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),W=function(X){x=x||Math.abs(t.clientX-X.clientX)+Math.abs(t.clientY-X.clientY)>=10},K=function(){return x=!0};D&&(i.scroller.draggable=!0),e.state.draggingText=I,I.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ge(i.wrapper.ownerDocument,"mouseup",I),ge(i.wrapper.ownerDocument,"mousemove",W),ge(i.scroller,"dragstart",K),ge(i.scroller,"drop",I),ho(e),setTimeout(function(){return i.input.focus()},20)}function hs(e,t,n){if(n=="char")return new Rt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Rt(Fe(t.line,0),ct(e.doc,Fe(t.line+1,0)));var r=n(e,t);return new Rt(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,x=e.doc;Y(t);var I,W,K=x.sel,X=K.ranges;if(r.addNew&&!r.extend?(W=x.sel.contains(n),W>-1?I=X[W]:I=new Rt(n,n)):(I=x.sel.primary(),W=x.sel.primIndex),r.unit=="rectangle")r.addNew||(I=new Rt(n,n)),n=En(e,t,!0,!0),W=-1;else{var ne=hs(e,n,r.unit);r.extend?I=Ca(I,ne.anchor,ne.head,r.extend):I=ne}r.addNew?W==-1?(W=X.length,br(x,zr(e,X.concat([I]),W),{scroll:!1,origin:"*mouse"})):X.length>1&&X[W].empty()&&r.unit=="char"&&!r.extend?(br(x,zr(e,X.slice(0,W).concat(X.slice(W+1)),0),{scroll:!1,origin:"*mouse"}),K=x.sel):Aa(x,W,I,Se):(W=0,br(x,new Br([I],0),Se),K=x.sel);var ae=n;function he(Je){if(dt(ae,Je)==0)return;if(ae=Je,r.unit=="rectangle"){for(var it=[],mt=e.options.tabSize,ft=V(tt(x,n.line).text,n.ch,mt),Tt=V(tt(x,Je.line).text,Je.ch,mt),It=Math.min(ft,Tt),dr=Math.max(ft,Tt),zt=Math.min(n.line,Je.line),Ir=Math.min(e.lastLine(),Math.max(n.line,Je.line));zt<=Ir;zt++){var Dr=tt(x,zt).text,er=me(Dr,It,mt);It==dr?it.push(new Rt(Fe(zt,er),Fe(zt,er))):Dr.length>er&&it.push(new Rt(Fe(zt,er),Fe(zt,me(Dr,dr,mt))))}it.length||it.push(new Rt(n,n)),br(x,zr(e,K.ranges.slice(0,W).concat(it),W),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Je)}else{var Or=I,pr=hs(e,Je,r.unit),ir=Or.anchor,tr;dt(pr.anchor,ir)>0?(tr=pr.head,ir=wr(Or.from(),pr.anchor)):(tr=pr.anchor,ir=Ve(Or.to(),pr.head));var Zt=K.ranges.slice(0);Zt[W]=Xl(e,new Rt(ct(x,ir),tr)),br(x,zr(e,Zt,W),Se)}}var ce=i.wrapper.getBoundingClientRect(),Oe=0;function Ne(Je){var it=++Oe,mt=En(e,Je,!0,r.unit=="rectangle");if(!mt)return;if(dt(mt,ae)!=0){e.curOp.focus=O(),he(mt);var ft=Ii(i,x);(mt.line>=ft.to||mt.linece.bottom?20:0;Tt&&setTimeout(lr(e,function(){if(Oe!=it)return;i.scroller.scrollTop+=Tt,Ne(Je)}),50)}}function Xe(Je){e.state.selectingText=!1,Oe=Infinity,Je&&(Y(Je),i.input.focus()),He(i.wrapper.ownerDocument,"mousemove",Ze),He(i.wrapper.ownerDocument,"mouseup",rt),x.history.lastSelOrigin=null}var Ze=lr(e,function(Je){Je.buttons===0||!ye(Je)?Xe(Je):Ne(Je)}),rt=lr(e,Xe);e.state.selectingText=rt,ge(i.wrapper.ownerDocument,"mousemove",Ze),ge(i.wrapper.ownerDocument,"mouseup",rt)}function Xl(e,t){var n=t.anchor,r=t.head,i=tt(e.doc,n.line);if(dt(n,r)==0&&n.sticky==r.sticky)return t;var x=Ke(i);if(!x)return t;var I=We(x,n.ch,n.sticky),W=x[I];if(W.from!=n.ch&&W.to!=n.ch)return t;var K=I+(W.from==n.ch==(W.level!=1)?0:1);if(K==0||K==x.length)return t;var X;if(r.line!=n.line)X=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ne=We(x,r.ch,r.sticky),ae=ne-I||(r.ch-n.ch)*(W.level==1?-1:1);ne==K-1||ne==K?X=ae<0:X=ae>0}var he=x[K+(X?-1:0)],ce=X==(he.level==1),Oe=ce?he.from:he.to,Ne=ce?"after":"before";return n.ch==Oe&&n.sticky==Ne?t:new Rt(new Fe(n.line,Oe,Ne),r)}function ms(e,t,n,r){var i,x;if(t.touches)i=t.touches[0].clientX,x=t.touches[0].clientY;else try{i=t.clientX,x=t.clientY}catch(he){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Y(t);var I=e.display,W=I.lineDiv.getBoundingClientRect();if(x>W.bottom||!te(e,n))return Z(t);x-=W.top-I.viewOffset;for(var K=0;K=i){var ne=hr(e.doc,x),ae=e.display.gutterSpecs[K];return xe(e,n,e,ne,ae.className,t),Z(t)}}}function Ma(e,t){return ms(e,t,"gutterClick",!0)}function ps(e,t){if(en(e.display,t)||Yl(e,t))return;if(Ie(e,t,"contextmenu"))return;C||e.display.input.onContextMenu(t)}function Yl(e,t){return te(e,"gutterContextMenu")?ms(e,t,"gutterContextMenu",!1):!1}function gs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ni(e)}var Vn={toString:function(){return"CodeMirror.Init"}},vs={},Yi={};function Ql(e){var t=e.optionHandlers;function n(r,i,x,I){e.defaults[r]=i,x&&(t[r]=I?function(W,K,X){X!=Vn&&x(W,K,X)}:x)}e.defineOption=n,e.Init=Vn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Sa(r)},!0),n("indentUnit",2,Sa,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){ci(r),ni(r),Ar(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var x=[],I=r.doc.first;r.doc.iter(function(K){for(var X=0;;){var ne=K.text.indexOf(i,X);if(ne==-1)break;X=ne+i.length,x.push(Fe(I,ne))}I++});for(var W=x.length-1;W>=0;W--)Hn(r.doc,i,x[W],Fe(x[W].line,x[W].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,x){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),x!=Vn&&r.refresh()}),n("specialCharPlaceholder",qn,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!S),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){gs(r),di(r)},!0),n("keyMap","default",function(r,i,x){var I=Vi(i),W=x!=Vn&&Vi(x);W&&W.detach&&W.detach(r,I),I.attach&&I.attach(r,W||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Jl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=xa(i,r.options.lineNumbers),di(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?ca(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Fn(r)},!0),n("scrollbarStyle","native",function(r){bo(r),Fn(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=xa(r.options.gutters,i),di(r)},!0),n("firstLineNumber",1,di,!0),n("lineNumberFormatter",function(r){return r},di,!0),n("showCursorWhenSelecting",!1,ii,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Nn(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Zl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ii,!0),n("singleCursorHeightPerLine",!0,ii,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ci,!0),n("addModeClass",!1,ci,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,ci,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Zl(e,t,n){var r=n&&n!=Vn;if(!t!=!r){var i=e.display.dragFunctions,x=t?ge:He;x(e.display.scroller,"dragstart",i.start),x(e.display.scroller,"dragenter",i.enter),x(e.display.scroller,"dragover",i.over),x(e.display.scroller,"dragleave",i.leave),x(e.display.scroller,"drop",i.drop)}}function Jl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),or(e)),fa(e),Ar(e),ni(e),setTimeout(function(){return Fn(e)},100)}function Wt(e,t){var n=this;if(!(this instanceof Wt))return new Wt(e,t);this.options=t=t?N(t):{},N(vs,t,!1);var r=t.value;typeof r=="string"?r=new Lr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Wt.inputStyles[t.inputStyle](this),x=this.display=new dl(e,r,i,t);x.wrapper.CodeMirror=this,gs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),bo(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 $,keySeq:null,specialChars:null},t.autofocus&&!s&&x.input.focus(),F&&M<11&&setTimeout(function(){return n.display.input.reset(!0)},20),$l(this),Dl(),_n(this),this.curOp.forceUpdate=!0,Do(this,r),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ma(n)},20):Nn(this);for(var I in Yi)Yi.hasOwnProperty(I)&&Yi[I](this,t[I],Vn);To(this),t.finishInit&&t.finishInit(this);for(var W=0;W20*20}ge(t.scroller,"touchstart",function(K){if(!Ie(e,K)&&!x(K)&&!Ma(e,K)){t.input.ensurePolled(),clearTimeout(n);var X=+new Date;t.activeTouch={start:X,moved:!1,prev:X-r.end<=300?r:null},K.touches.length==1&&(t.activeTouch.left=K.touches[0].pageX,t.activeTouch.top=K.touches[0].pageY)}}),ge(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ge(t.scroller,"touchend",function(K){var X=t.activeTouch;if(X&&!en(t,K)&&X.left!=null&&!X.moved&&new Date-X.start<300){var ne=e.coordsChar(t.activeTouch,"page"),ae;!X.prev||I(X,X.prev)?ae=new Rt(ne,ne):!X.prev.prev||I(X,X.prev.prev)?ae=e.findWordAt(ne):ae=new Rt(Fe(ne.line,0),ct(e.doc,Fe(ne.line+1,0))),e.setSelection(ae.anchor,ae.head),e.focus(),Y(K)}i()}),ge(t.scroller,"touchcancel",i),ge(t.scroller,"scroll",function(){t.scroller.clientHeight&&(oi(e,t.scroller.scrollTop),Tn(e,t.scroller.scrollLeft,!0),xe(e,"scroll",e))}),ge(t.scroller,"mousewheel",function(K){return wo(e,K)}),ge(t.scroller,"DOMMouseScroll",function(K){return wo(e,K)}),ge(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(K){Ie(e,K)||q(K)},over:function(K){Ie(e,K)||(Ll(e,K),q(K))},start:function(K){return Al(e,K)},drop:lr(e,Cl),leave:function(K){Ie(e,K)||qo(e)}};var W=t.input.getField();ge(W,"keyup",function(K){return ds.call(e,K)}),ge(W,"keydown",lr(e,us)),ge(W,"keypress",lr(e,cs)),ge(W,"focus",function(K){return ma(e,K)}),ge(W,"blur",function(K){return Nn(e,K)})}var ka=[];Wt.defineInitHook=function(e){return ka.push(e)};function _i(e,t,n,r){var i=e.doc,x;n==null&&(n="add"),n=="smart"&&(i.mode.indent?x=ve(e,t).state:n="prev");var I=e.options.tabSize,W=tt(i,t),K=V(W.text,null,I);W.stateAfter&&(W.stateAfter=null);var X=W.text.match(/^\s*/)[0],ne;if(!r&&!/\S/.test(W.text))ne=0,n="not";else if(n=="smart"&&(ne=i.mode.indent(x,W.text.slice(X.length),W.text),ne==_e||ne>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?ne=V(tt(i,t-1).text,null,I):ne=0:n=="add"?ne=K+e.options.indentUnit:n=="subtract"?ne=K-e.options.indentUnit:typeof n=="number"&&(ne=K+n),ne=Math.max(0,ne);var ae="",he=0;if(e.options.indentWithTabs)for(var ce=Math.floor(ne/I);ce;--ce)he+=I,ae+=" ";if(heI,K=yt(t),X=null;if(W&&r.ranges.length>1)if(Gr&&Gr.text.join(` `)==t){if(r.ranges.length%Gr.text.length==0){X=[];for(var ne=0;ne=0;he--){var ce=r.ranges[he],Oe=ce.from(),Ne=ce.to();ce.empty()&&(n&&n>0?Oe=Fe(Oe.line,Oe.ch-n):e.state.overwrite&&!W?Ne=Fe(Ne.line,Math.min(tt(x,Ne.line).text.length,Ne.ch+Ee(K).length)):W&&Gr&&Gr.lineWise&&Gr.text.join(` `)==K.join(` `)&&(Oe=Ne=Fe(Oe.line,0)));var Xe={from:Oe,to:Ne,text:X?X[he%X.length]:K,origin:i||(W?"paste":e.state.cutIncoming>I?"cut":"+input")};Wn(e.doc,Xe),mr(e,"inputRead",e,Xe)}t&&!W&&bs(e,t),Un(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ae),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ys(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&kr(t,function(){return Ia(t,n,0,null,"paste")}),!0}function bs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var x=e.getModeAt(i.head),I=!1;if(x.electricChars){for(var W=0;W-1){I=_i(e,i.head.line,"smart");break}}else x.electricInput&&(x.electricInput.test(tt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(I=_i(e,i.head.line,"smart")));I&&mr(e,"electricInput",e,i.head.line)}}function Es(e){for(var t=[],n=[],r=0;rx&&(_i(this,W.head.line,r,!0),x=W.head.line,I==this.doc.sel.primIndex&&Un(this));else{var K=W.from(),X=W.to(),ne=Math.max(x,K.line);x=Math.min(this.lastLine(),X.line-(X.ch?0:1))+1;for(var ae=ne;ae0&&Aa(this.doc,I,new Rt(K,he[I].to()),fe)}}}),getTokenAt:function(r,i){return ar(this,r,i)},getLineTokens:function(r,i){return ar(this,Fe(r),i,!0)},getTokenTypeAt:function(r){r=ct(this.doc,r);var i=ot(this,tt(this.doc,r.line)),x=0,I=(i.length-1)/2,W=r.ch,K;if(W==0)K=i[2];else for(;;){var X=x+I>>1;if((X?i[X*2-1]:0)>=W)I=X;else if(i[X*2+1]K&&(r=K,I=!0),W=tt(this.doc,r)}else W=r;return Ri(this,W,{top:0,left:0},i||"page",x||I).top+(I?this.doc.height-Ft(W):0)},defaultTextHeight:function(){return kn(this.display)},defaultCharWidth:function(){return In(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,x,I,W){var K=this.display;r=Kr(this,ct(this.doc,r));var X=r.bottom,ne=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),K.sizer.appendChild(i),I=="over")X=r.top;else if(I=="above"||I=="near"){var ae=Math.max(K.wrapper.clientHeight,this.doc.height),he=Math.max(K.sizer.clientWidth,K.lineSpace.clientWidth);(I=="above"||r.bottom+i.offsetHeight>ae)&&r.top>i.offsetHeight?X=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=ae&&(X=r.bottom),ne+i.offsetWidth>he&&(ne=he-i.offsetWidth)}i.style.top=X+"px",i.style.left=i.style.right="",W=="right"?(ne=K.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(W=="left"?ne=0:W=="middle"&&(ne=(K.sizer.clientWidth-i.offsetWidth)/2),i.style.left=ne+"px"),x&&Zs(this,{left:ne,top:X,right:ne+i.offsetWidth,bottom:X+i.offsetHeight})},triggerOnKeyDown:Tr(us),triggerOnKeyPress:Tr(cs),triggerOnKeyUp:ds,triggerOnMouseDown:Tr(fs),execCommand:function(r){if(Ei.hasOwnProperty(r))return Ei[r].call(null,this)},triggerElectric:Tr(function(r){bs(this,r)}),findPosH:function(r,i,x,I){var W=1;i<0&&(W=-1,i=-i);for(var K=ct(this.doc,r),X=0;X0&&ne(x.charAt(I-1));)--I;for(;W.5||this.options.lineWrapping)&&fa(this),xe(this,"refresh",this)}),swapDoc:Tr(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Do(this,r),ni(this),this.display.input.reset(),ai(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,mr(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},ee(e),e.registerHelper=function(r,i,x){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=x},e.registerGlobalHelper=function(r,i,x,I){e.registerHelper(r,i,I),n[r]._global.push({pred:x,val:I})}}function Na(e,t,n,r,i){var x=t,I=n,W=tt(e,t.line),K=i&&e.direction=="rtl"?-n:n;function X(){var rt=t.line+K;return rt=e.first+e.size?!1:(t=new Fe(rt,t.ch,t.sticky),W=tt(e,rt))}function ne(rt){var Je;if(r=="codepoint"){var it=W.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(it)?Je=null:Je=new Fe(t.line,Math.max(0,Math.min(W.text.length,t.ch+n*(it>=55296&&it<56320?2:1))),-n)}else i?Je=kl(e.cm,W,t,n):Je=Da(W,t,n);if(Je==null)if(!rt&&X())t=Oa(i,e.cm,W,t.line,K);else return!1;else t=Je;return!0}if(r=="char"||r=="codepoint")ne();else if(r=="column")ne(!0);else if(r=="word"||r=="group")for(var ae=null,he=r=="group",ce=e.cm&&e.cm.getHelper(t,"wordChars"),Oe=!0;!(n<0&&!ne(!Oe));Oe=!1){var Ne=W.text.charAt(t.ch)||` `,Xe=Be(Ne,ce)?"w":he&&Ne==` `?"n":!he||/\s/.test(Ne)?null:"p";if(he&&!Oe&&!Xe&&(Xe="s"),ae&&ae!=Xe){n<0&&(n=1,ne(),t.sticky="after");break}if(Xe&&(ae=Xe),n>0&&!ne(!Oe))break}var Ze=Ki(e,t,x,I,!0);return _r(x,Ze)&&(Ze.hitSide=!0),Ze}function Ss(e,t,n,r){var i=e.doc,x=t.left,I;if(r=="page"){var W=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),K=Math.max(W-.5*kn(e.display),3);I=(n>0?t.bottom:t.top)+n*K}else r=="line"&&(I=n>0?t.bottom+3:t.top-3);for(var X;!(X=la(e,x,I),!X.outside);){if(n<0?I<=0:I>=i.height){X.hitSide=!0;break}I+=n*5}return X}var Mt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Mt.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;xs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function x(W){for(var K=W.target;K;K=K.parentNode){if(K==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(K.className))break}return!1}ge(i,"paste",function(W){if(!x(W)||Ie(r,W)||ys(W,r))return;M<=11&&setTimeout(lr(r,function(){return t.updateFromDOM()}),20)}),ge(i,"compositionstart",function(W){t.composing={data:W.data,done:!1}}),ge(i,"compositionupdate",function(W){t.composing||(t.composing={data:W.data,done:!1})}),ge(i,"compositionend",function(W){t.composing&&(W.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ge(i,"touchstart",function(){return n.forceCompositionEnd()}),ge(i,"input",function(){t.composing||t.readFromDOMSoon()});function I(W){if(!x(W)||Ie(r,W))return;if(r.somethingSelected())Qi({lineWise:!1,text:r.getSelections()}),W.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var K=Es(r);Qi({lineWise:!0,text:K.text}),W.type=="cut"&&r.operation(function(){r.setSelections(K.ranges,0,fe),r.replaceSelection("",null,"cut")})}else return;if(W.clipboardData){W.clipboardData.clearData();var X=Gr.text.join(` `);if(W.clipboardData.setData("Text",X),W.clipboardData.getData("Text")==X){W.preventDefault();return}}var ne=Ts(),ae=ne.firstChild;r.display.lineSpace.insertBefore(ne,r.display.lineSpace.firstChild),ae.value=Gr.text.join(` `);var he=document.activeElement;G(ae),setTimeout(function(){r.display.lineSpace.removeChild(ne),he.focus(),he==i&&n.showPrimarySelection()},50)}ge(i,"copy",I),ge(i,"cut",I)},Mt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Mt.prototype.prepareSelection=function(){var e=uo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Mt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Mt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Mt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&_s(t,r)||{node:W[0].measure.map[2],offset:0},X=i.linee.firstLine()&&(r=Fe(r.line-1,tt(e.doc,r.line-1).length)),i.ch==tt(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var x,I,W;r.line==t.viewFrom||(x=xn(e,r.line))==0?(I=St(t.view[0].line),W=t.view[0].node):(I=St(t.view[x].line),W=t.view[x-1].node.nextSibling);var K=xn(e,i.line),X,ne;if(K==t.view.length-1?(X=t.viewTo-1,ne=t.lineDiv.lastChild):(X=St(t.view[K+1].line)-1,ne=t.view[K+1].node.previousSibling),!W)return!1;for(var ae=e.doc.splitLines(tu(e,W,ne,I,X)),he=Yt(e.doc,Fe(I,0),Fe(X,tt(e.doc,X).text.length));ae.length>1&&he.length>1;)if(Ee(ae)==Ee(he))ae.pop(),he.pop(),X--;else if(ae[0]==he[0])ae.shift(),he.shift(),I++;else break;for(var ce=0,Oe=0,Ne=ae[0],Xe=he[0],Ze=Math.min(Ne.length,Xe.length);cer.ch&&rt.charCodeAt(rt.length-Oe-1)==Je.charCodeAt(Je.length-Oe-1);)ce--,Oe++;ae[ae.length-1]=rt.slice(0,rt.length-Oe).replace(/^\u200b+/,""),ae[0]=ae[0].slice(ce).replace(/\u200b+$/,"");var mt=Fe(I,ce),ft=Fe(X,he.length?Ee(he).length-Oe:0);if(ae.length>1||ae[0]||dt(mt,ft))return Hn(e.doc,ae,mt,ft,"+input"),!0},Mt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Mt.prototype.reset=function(){this.forceCompositionEnd()},Mt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Mt.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)},Mt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&kr(this.cm,function(){return Ar(e.cm)})},Mt.prototype.setUneditable=function(e){e.contentEditable="false"},Mt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||lr(this.cm,Ia)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Mt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Mt.prototype.onContextMenu=function(){},Mt.prototype.resetPosition=function(){},Mt.prototype.needsContentAttribute=!0;function _s(e,t){var n=ia(e,t.line);if(!n||n.hidden)return null;var r=tt(e.doc,t.line),i=Qa(n,r,t.line),x=Ke(r,e.doc.direction),I="left";if(x){var W=We(x,t.ch);I=W%2?"right":"left"}var K=$a(i.map,t.ch,I);return K.offset=K.collapse=="right"?K.end:K.start,K}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Xn(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var x="",I=!1,W=e.doc.lineSeparator(),K=!1;function X(ce){return function(Oe){return Oe.id==ce}}function ne(){I&&(x+=W,K&&(x+=W),I=K=!1)}function ae(ce){ce&&(ne(),x+=ce)}function he(ce){if(ce.nodeType==1){var Oe=ce.getAttribute("cm-text");if(Oe){ae(Oe);return}var Ne=ce.getAttribute("cm-marker"),Xe;if(Ne){var Ze=e.findMarks(Fe(r,0),Fe(i+1,0),X(+Ne));Ze.length&&(Xe=Ze[0].find(0))&&ae(Yt(e.doc,Xe.from,Xe.to).join(W));return}if(ce.getAttribute("contenteditable")=="false")return;var rt=/^(pre|div|p|li|table|br)$/i.test(ce.nodeName);if(!/^br$/i.test(ce.nodeName)&&ce.textContent.length==0)return;rt&&ne();for(var Je=0;Je=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ge(i,"paste",function(I){if(Ie(r,I)||ys(I,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function x(I){if(Ie(r,I))return;if(r.somethingSelected())Qi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var W=Es(r);Qi({lineWise:!0,text:W.text}),I.type=="cut"?r.setSelections(W.ranges,null,fe):(n.prevInput="",i.value=W.text.join(` `),G(i))}else return;I.type=="cut"&&(r.state.cutIncoming=+new Date)}ge(i,"cut",x),ge(i,"copy",x),ge(e.scroller,"paste",function(I){if(en(e,I)||Ie(r,I))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var W=new Event("paste");W.clipboardData=I.clipboardData,i.dispatchEvent(W)}),ge(e.lineSpace,"selectstart",function(I){en(e,I)||Y(I)}),ge(i,"compositionstart",function(){var I=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:I,range:r.markText(I,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ge(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$t.prototype.createField=function(e){this.wrapper=Ts(),this.textarea=this.wrapper.firstChild},$t.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$t.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=uo(e);if(e.options.moveInputWithCursor){var i=Kr(e,n.sel.primary().head,"div"),x=t.wrapper.getBoundingClientRect(),I=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+I.top-x.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+I.left-x.left))}return r},$t.prototype.showSelection=function(e){var t=this.cm,n=t.display;o(n.cursorDiv,e.cursors),o(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$t.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&G(this.textarea),F&&M>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",F&&M>=9&&(this.hasSelection=null))},$t.prototype.getField=function(){return this.textarea},$t.prototype.supportsTouch=function(){return!1},$t.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},$t.prototype.blur=function(){this.textarea.blur()},$t.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$t.prototype.receivedFocus=function(){this.slowPoll()},$t.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()})},$t.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},$t.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(F&&M>=9&&this.hasSelection===i||u&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var x=i.charCodeAt(0);if(x==8203&&!r&&(r="\u200B"),x==8666)return this.reset(),this.cm.execCommand("undo")}for(var I=0,W=Math.min(r.length,i.length);I1e3||i.indexOf(` `)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},$t.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$t.prototype.onKeyPress=function(){F&&M>=9&&(this.hasSelection=null),this.fastPoll()},$t.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var x=En(n,e),I=r.scroller.scrollTop;if(!x||w)return;var W=n.options.resetSelectionOnContextMenu;W&&n.doc.sel.contains(x)==-1&&lr(n,br)(n.doc,un(x),fe);var K=i.style.cssText,X=t.wrapper.style.cssText,ne=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-ne.top-5)+"px; left: "+(e.clientX-ne.left-5)+`px; z-index: 1000; background: `+(F?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ae;D&&(ae=window.scrollY),r.input.focus(),D&&window.scrollTo(null,ae),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=ce,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function he(){if(i.selectionStart!=null){var Ne=n.somethingSelected(),Xe="\u200B"+(Ne?i.value:"");i.value="\u21DA",i.value=Xe,t.prevInput=Ne?"":"\u200B",i.selectionStart=1,i.selectionEnd=Xe.length,r.selForContextMenu=n.doc.sel}}function ce(){if(t.contextMenuPending!=ce)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=X,i.style.cssText=K,F&&M<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=I),i.selectionStart!=null){(!F||F&&M<9)&&he();var Ne=0,Xe=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?lr(n,Ho)(n):Ne++<10?r.detectingSelectAll=setTimeout(Xe,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Xe,200)}}if(F&&M>=9&&he(),C){q(e);var Oe=function(){He(window,"mouseup",Oe),setTimeout(ce,20)};ge(window,"mouseup",Oe)}else setTimeout(ce,50)},$t.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},$t.prototype.setUneditable=function(){},$t.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?N(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=O();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=W.getValue()}var i;if(e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var x=e.form;i=x.submit;try{var I=x.submit=function(){r(),x.submit=i,x.submit(),x.submit=I}}catch(K){}}t.finishInit=function(K){K.save=r,K.getTextArea=function(){return e},K.toTextArea=function(){K.toTextArea=isNaN,r(),e.parentNode.removeChild(K.getWrapperElement()),e.style.display="",e.form&&(He(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var W=Wt(function(K){return e.parentNode.insertBefore(K,e.nextSibling)},t);return W}function iu(e){e.off=He,e.on=ge,e.wheelEventPixels=cl,e.Doc=Lr,e.splitLines=yt,e.countColumn=V,e.findColumn=me,e.isWordChar=we,e.Pass=_e,e.signal=xe,e.Line=sr,e.changeEnd=dn,e.scrollbarModel=yo,e.Pos=Fe,e.cmpPos=dt,e.modes=Dt,e.mimeModes=pt,e.resolveMode=Gt,e.getMode=Vt,e.modeExtensions=Xt,e.extendMode=Pr,e.copyState=Ht,e.startState=jt,e.innerMode=kt,e.commands=Ei,e.keyMap=tn,e.keyName=is,e.isModifierKey=rs,e.lookupKey=zn,e.normalizeKeyMap=Ml,e.StringStream=Ot,e.SharedTextMarker=vi,e.TextMarker=fn,e.LineWidget=gi,e.e_preventDefault=Y,e.e_stopPropagation=Q,e.e_stop=q,e.addClass=U,e.contains=v,e.rmClass=f,e.keyNames=hn}Ql(Wt),ql(Wt);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ji in Lr.prototype)Lr.prototype.hasOwnProperty(Ji)&&ie(au,Ji)<0&&(Wt.prototype[Ji]=function(e){return function(){return e.apply(this.doc,arguments)}}(Lr.prototype[Ji]));return ee(Lr),Wt.inputStyles={textarea:$t,contenteditable:Mt},Wt.defineMode=function(e){!Wt.defaults.mode&&e!="null"&&(Wt.defaults.mode=e),Nt.apply(this,arguments)},Wt.defineMIME=rr,Wt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wt.defineMIME("text/plain","null"),Wt.defineExtension=function(e,t){Wt.prototype[e]=t},Wt.defineDocExtension=function(e,t){Lr.prototype[e]=t},Wt.fromTextArea=nu,iu(Wt),Wt.version="5.58.2",Wt})},Y1PL:function(ut,$e,J){"use strict";J.r($e),J.d($e,"ResizableTextArea",function(){return ie});var re=J("wx14"),z=J("1OyB"),L=J("vuIU"),H=J("Ji7U"),k=J("LK+K"),P=J("q1tI"),F=J("VTBJ"),M=J("rePB"),D=J("Zm9Q"),R=J("Kwbf"),E=J("c+Xe"),w=J("m+aA"),T=J("bdgK"),A=new Map;function _(fe){fe.forEach(function(Se){var be,me=Se.target;(be=A.get(me))===null||be===void 0||be.forEach(function(le){return le(me)})})}var b=new T.default(_),d=null,s=null;function u(fe,Se){A.has(fe)||(A.set(fe,new Set),b.observe(fe)),A.get(fe).add(Se)}function l(fe,Se){A.has(fe)&&(A.get(fe).delete(Se),A.get(fe).size||(b.unobserve(fe),A.delete(fe)))}var S=function(fe){Object(H.a)(be,fe);var Se=Object(k.a)(be);function be(){return Object(z.a)(this,be),Se.apply(this,arguments)}return Object(L.a)(be,[{key:"render",value:function(){return this.props.children}}]),be}(P.Component),h=P.createContext(null);function g(fe){var Se=fe.children,be=fe.onBatchResize,me=P.useRef(0),le=P.useRef([]),ue=P.useContext(h),Ee=P.useCallback(function(Ge,Te,pe){me.current+=1;var Ae=me.current;le.current.push({size:Ge,element:Te,data:pe}),Promise.resolve().then(function(){Ae===me.current&&(be==null||be(le.current),le.current=[])}),ue==null||ue(Ge,Te,pe)},[be,ue]);return P.createElement(h.Provider,{value:Ee},Se)}function C(fe){var Se=fe.children,be=fe.disabled,me=P.useRef(null),le=P.useRef(null),ue=P.useContext(h),Ee=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ge=P.isValidElement(Se)&&Object(E.c)(Se),Te=Ge?Se.ref:null,pe=P.useMemo(function(){return Object(E.a)(Te,me)},[Te,me]),Ae=P.useRef(fe);Ae.current=fe;var Ce=P.useCallback(function(we){var Be=Ae.current,Qe=Be.onResize,je=Be.data,De=we.getBoundingClientRect(),Pe=De.width,Le=De.height,Re=we.offsetWidth,Ue=we.offsetHeight,We=Math.floor(Pe),ke=Math.floor(Le);if(Ee.current.width!==We||Ee.current.height!==ke||Ee.current.offsetWidth!==Re||Ee.current.offsetHeight!==Ue){var Ke={width:We,height:ke,offsetWidth:Re,offsetHeight:Ue};Ee.current=Ke;var ze=Re===Math.round(Pe)?Pe:Re,ge=Ue===Math.round(Le)?Le:Ue,Ye=Object(F.a)(Object(F.a)({},Ke),{},{offsetWidth:ze,offsetHeight:ge});ue==null||ue(Ye,we,je),Qe&&Promise.resolve().then(function(){Qe(Ye,we)})}},[]);return P.useEffect(function(){var we=Object(w.a)(me.current)||Object(w.a)(le.current);return we&&!be&&u(we,Ce),function(){return l(we,Ce)}},[me.current,be]),P.createElement(S,{ref:le},Ge?P.cloneElement(Se,{ref:pe}):Se)}var y="rc-observer-key";function f(fe){var Se=fe.children,be=Object(D.a)(Se);return be.map(function(me,le){var ue=(me==null?void 0:me.key)||"".concat(y,"-").concat(le);return P.createElement(C,Object(re.a)({},fe,{key:ue}),me)})}f.Collection=g;var c=f,o=J("bT9E"),a=J("TSYQ"),m=J.n(a),p=` 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 `,v=["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"],O={},U;function j(fe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,be=fe.getAttribute("id")||fe.getAttribute("data-reactid")||fe.getAttribute("name");if(Se&&O[be])return O[be];var me=window.getComputedStyle(fe),le=me.getPropertyValue("box-sizing")||me.getPropertyValue("-moz-box-sizing")||me.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(me.getPropertyValue("padding-bottom"))+parseFloat(me.getPropertyValue("padding-top")),Ee=parseFloat(me.getPropertyValue("border-bottom-width"))+parseFloat(me.getPropertyValue("border-top-width")),Ge=v.map(function(pe){return"".concat(pe,":").concat(me.getPropertyValue(pe))}).join(";"),Te={sizingStyle:Ge,paddingSize:ue,borderSize:Ee,boxSizing:le};return Se&&be&&(O[be]=Te),Te}function G(fe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),fe.getAttribute("wrap")?U.setAttribute("wrap",fe.getAttribute("wrap")):U.removeAttribute("wrap");var le=j(fe,Se),ue=le.paddingSize,Ee=le.borderSize,Ge=le.boxSizing,Te=le.sizingStyle;U.setAttribute("style","".concat(Te,";").concat(p)),U.value=fe.value||fe.placeholder||"";var pe=Number.MIN_SAFE_INTEGER,Ae=Number.MAX_SAFE_INTEGER,Ce=U.scrollHeight,we;if(Ge==="border-box"?Ce+=Ee:Ge==="content-box"&&(Ce-=ue),be!==null||me!==null){U.value=" ";var Be=U.scrollHeight-ue;be!==null&&(pe=Be*be,Ge==="border-box"&&(pe=pe+ue+Ee),Ce=Math.max(pe,Ce)),me!==null&&(Ae=Be*me,Ge==="border-box"&&(Ae=Ae+ue+Ee),we=Ce>Ae?"":"hidden",Ce=Math.min(Ae,Ce))}return{height:Ce,minHeight:pe,maxHeight:Ae,overflowY:we,resize:"none"}}var B=J("Gytx"),N=J.n(B),V;(function(fe){fe[fe.NONE=0]="NONE",fe[fe.RESIZING=1]="RESIZING",fe[fe.RESIZED=2]="RESIZED"})(V||(V={}));var $=function(fe){Object(H.a)(be,fe);var Se=Object(k.a)(be);function be(me){var le;return Object(z.a)(this,be),le=Se.call(this,me),le.nextFrameActionId=void 0,le.resizeFrameId=void 0,le.textArea=void 0,le.saveTextArea=function(ue){le.textArea=ue},le.handleResize=function(ue){var Ee=le.state.resizeStatus,Ge=le.props,Te=Ge.autoSize,pe=Ge.onResize;if(Ee!==V.NONE)return;typeof pe=="function"&&pe(ue),Te&&le.resizeOnNextFrame()},le.resizeOnNextFrame=function(){cancelAnimationFrame(le.nextFrameActionId),le.nextFrameActionId=requestAnimationFrame(le.resizeTextarea)},le.resizeTextarea=function(){var ue=le.props.autoSize;if(!ue||!le.textArea)return;var Ee=ue.minRows,Ge=ue.maxRows,Te=G(le.textArea,!1,Ee,Ge);le.setState({textareaStyles:Te,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(le.resizeFrameId),le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:V.RESIZED},function(){le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:V.NONE}),le.fixFirefoxAutoScroll()})})})})},le.renderTextArea=function(){var ue=le.props,Ee=ue.prefixCls,Ge=Ee===void 0?"rc-textarea":Ee,Te=ue.autoSize,pe=ue.onResize,Ae=ue.className,Ce=ue.disabled,we=le.state,Be=we.textareaStyles,Qe=we.resizeStatus,je=Object(o.a)(le.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),De=m()(Ge,Ae,Object(M.a)({},"".concat(Ge,"-disabled"),Ce));"value"in je&&(je.value=je.value||"");var Pe=Object(F.a)(Object(F.a)(Object(F.a)({},le.props.style),Be),Qe===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(c,{onResize:le.handleResize,disabled:!(Te||pe)},P.createElement("textarea",Object(re.a)({},je,{className:De,style:Pe,ref:le.saveTextArea})))},le.state={textareaStyles:{},resizeStatus:V.NONE},le}return Object(L.a)(be,[{key:"componentDidUpdate",value:function(le){(le.value!==this.props.value||!N()(le.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 le=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(le,ue)}}catch(Ee){}}},{key:"render",value:function(){return this.renderTextArea()}}]),be}(P.Component),ie=$,oe=function(fe){Object(H.a)(be,fe);var Se=Object(k.a)(be);function be(me){var le;Object(z.a)(this,be),le=Se.call(this,me),le.resizableTextArea=void 0,le.focus=function(){le.resizableTextArea.textArea.focus()},le.saveTextArea=function(Ee){le.resizableTextArea=Ee},le.handleChange=function(Ee){var Ge=le.props.onChange;le.setValue(Ee.target.value,function(){le.resizableTextArea.resizeTextarea()}),Ge&&Ge(Ee)},le.handleKeyDown=function(Ee){var Ge=le.props,Te=Ge.onPressEnter,pe=Ge.onKeyDown;Ee.keyCode===13&&Te&&Te(Ee),pe&&pe(Ee)};var ue=typeof me.value=="undefined"||me.value===null?me.defaultValue:me.value;return le.state={value:ue},le}return Object(L.a)(be,[{key:"setValue",value:function(le,ue){"value"in this.props||this.setState({value:le},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(ie,Object(re.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(le){return"value"in le?{value:le.value}:null}}]),be}(P.Component),_e=$e.default=oe},ZW9T:function(ut,$e,J){"use strict";J.d($e,"a",function(){return S});var re=J("k1fw"),z=J("miYZ"),L=J("tsqr"),H=J("rAM+"),k=J("tJVT"),P=J("PpiC"),F=J("q1tI"),M=J.n(F),D=J("bdgK");function R(h,g,C,y,f){var c=g.getWordUntilPosition(C),o={startLineNumber:C.lineNumber,endLineNumber:C.lineNumber,startColumn:c.startColumn,endColumn:c.endColumn},a=y.map(function(m){return{label:m,kind:h.languages.CompletionItemKind.Keyword,insertText:m,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}});return f.map(function(m){a.push(Object(re.a)(Object(re.a)({},m),{},{range:o}))}),a}var E=function(h){var g={label:"ifelse",kind:h.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet},C=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];h.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(o,a){var m=R(h,o,a,C,[g]);return{suggestions:m}}});var y=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];h.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(o,a){var m=[{label:"print",kind:h.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}],p=R(h,o,a,y,m);return{suggestions:p}}});var f=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];h.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(o,a){var m=[g,{label:"main",kind:h.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:h.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}],p=R(h,o,a,f,m);return{suggestions:p}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=J("LvDl");function A(h){return/^\d+$/.test(h)?"".concat(h,"px"):h}function _(){}var b=!1,d={"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 s(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=h;if(Array.isArray(h)){for(var C=0;C0||Me.target.offsetWidth>0)&&Ae.current.instance.layout()}}catch(et){de.e(et)}finally{de.f()}}),Z.observe(pe.current)),Z}function Re(){L.b.warn(decodeURIComponent(w))}var Ue=function(){var q=Ae.current.instance;if(c!=null&&q&&De){var de=q.getModel();de&&c!==de.getValue()&&(b=!0,de.setValue(c),q.layout(),b=!1)}};Object(F.useEffect)(function(){Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(function(){Ue()},500)},[c,De,Ae.current]);function We(){var Z=Ae.current.instance;if(Z){var q=Z.getSelection(),de=Ae.current.pastePos||{},ye=new u.Range(de.startLineNumber||q.endLineNumber,de.startColumn||q.endColumn,de.endLineNumber||q.endLineNumber,de.endColumn||q.endColumn);setTimeout(function(){Z.executeEdits("",[{range:ye,text:""}])},300)}}function ke(Z){(window.navigator.platform.match("Mac")?Z.metaKey:Z.ctrlKey)&&Z.keyCode==83&&(Z.preventDefault(),V())}var Ke=function(){if(ie&&Ae.current.instance){var q=Ae.current.instance.getContentHeight();Y(q0||be.target.offsetWidth>0)&&ie.layout()}}catch(me){fe.e(me)}finally{fe.f()}}),oe.observe(v.current)),oe}Object(F.useEffect)(function(){v.current&&J.e(26).then(J.t.bind(null,"M/lh",7)).then(function(ie){u=ie;var oe=u.editor.createDiffEditor(v.current,Object(re.a)(Object(re.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},p),{},{wordWrap:!0}));G(oe);var _e=B(oe);return function(){oe.dispose();var fe=oe.getModel();fe&&fe.dispose(),_e.unobserve(v.current)}})},[]),Object(F.useEffect)(function(){j&&j.setModel({original:u.editor.createModel(c,a),modified:u.editor.createModel(o,a)})},[c,o,a,j]);var N=A(C),V=A(f),$={width:N,height:V};return M.a.createElement("div",{className:"my-diff-editor",ref:v,style:$})}},ZpRC:function(ut,$e,J){"use strict";function re(E){return typeof E=="object"&&E!=null&&E.nodeType===1}function z(E,w){return(!w||E!=="hidden")&&E!=="visible"&&E!=="clip"}function L(E,w){if(E.clientHeightw||b>E&&d=w&&s>=T?b-E-A:d>w&&sT?d-w+_:0}var k=function(E,w){var T=window,A=w.scrollMode,_=w.block,b=w.inline,d=w.boundary,s=w.skipOverflowHiddenElements,u=typeof d=="function"?d:function(Be){return Be!==d};if(!re(E))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,S=[],h=E;re(h)&&u(h);){if((h=h.parentElement)===l){S.push(h);break}h!=null&&h===document.body&&L(h)&&!L(document.documentElement)||h!=null&&L(h,s)&&S.push(h)}for(var g=T.visualViewport?T.visualViewport.width:innerWidth,C=T.visualViewport?T.visualViewport.height:innerHeight,y=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,c=E.getBoundingClientRect(),o=c.height,a=c.width,m=c.top,p=c.right,v=c.bottom,O=c.left,U=_==="start"||_==="nearest"?m:_==="end"?v:m+o/2,j=b==="center"?O+a/2:b==="end"?p:O,G=[],B=0;B=0&&O>=0&&v<=C&&p<=g&&m>=oe&&v<=fe&&O>=Se&&p<=_e)return G;var be=getComputedStyle(N),me=parseInt(be.borderLeftWidth,10),le=parseInt(be.borderTopWidth,10),ue=parseInt(be.borderRightWidth,10),Ee=parseInt(be.borderBottomWidth,10),Ge=0,Te=0,pe="offsetWidth"in N?N.offsetWidth-N.clientWidth-me-ue:0,Ae="offsetHeight"in N?N.offsetHeight-N.clientHeight-le-Ee:0;if(l===N)Ge=_==="start"?U:_==="end"?U-C:_==="nearest"?H(f,f+C,C,le,Ee,f+U,f+U+o,o):U-C/2,Te=b==="start"?j:b==="center"?j-g/2:b==="end"?j-g:H(y,y+g,g,me,ue,y+j,y+j+a,a),Ge=Math.max(0,Ge+f),Te=Math.max(0,Te+y);else{Ge=_==="start"?U-oe-le:_==="end"?U-fe+Ee+Ae:_==="nearest"?H(oe,fe,$,le,Ee+Ae,U,U+o,o):U-(oe+$/2)+Ae/2,Te=b==="start"?j-Se-me:b==="center"?j-(Se+ie/2)+pe/2:b==="end"?j-_e+ue+pe:H(Se,_e,ie,me,ue+pe,j,j+a,a);var Ce=N.scrollLeft,we=N.scrollTop;U+=we-(Ge=Math.max(0,Math.min(we+Ge,N.scrollHeight-$+Ae))),j+=Ce-(Te=Math.max(0,Math.min(Ce+Te,N.scrollWidth-ie+pe)))}G.push({el:N,top:Ge,left:Te})}return G};function P(E){return E===Object(E)&&Object.keys(E).length!==0}function F(E,w){w===void 0&&(w="auto");var T="scrollBehavior"in document.body.style;E.forEach(function(A){var _=A.el,b=A.top,d=A.left;_.scroll&&T?_.scroll({top:b,left:d,behavior:w}):(_.scrollTop=b,_.scrollLeft=d)})}function M(E){return E===!1?{block:"end",inline:"nearest"}:P(E)?E:{block:"start",inline:"nearest"}}function D(E,w){var T=!E.ownerDocument.documentElement.contains(E);if(P(w)&&typeof w.behavior=="function")return w.behavior(T?[]:k(E,w));if(T)return;var A=M(w);return F(k(E,A),A.behavior)}var R=$e.a=D},bT9E:function(ut,$e,J){"use strict";J.d($e,"a",function(){return z});var re=J("VTBJ");function z(L,H){var k=Object(re.a)({},L);return Array.isArray(H)&&H.forEach(function(P){delete k[P]}),k}},c5Ni:function(ut,$e,J){},dejd:function(ut,$e,J){},dmUQ:function(ut,$e,J){"use strict";var re=J("Ff2n"),z=J("rePB"),L=J("1OyB"),H=J("vuIU"),k=J("Ji7U"),P=J("md7G"),F=J("foSv"),M=J("q1tI"),D=J.n(M),R=J("TSYQ"),E=J.n(R),w=J("4IlW");function T(o,a){var m=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);a&&(p=p.filter(function(v){return Object.getOwnPropertyDescriptor(o,v).enumerable})),m.push.apply(m,p)}return m}function A(o){for(var a=1;a1?ie-1:0),_e=1;_e1?B-1:0),V=1;V=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var B=0;return G.indexOf(".")>=0&&(B=G.length-G.indexOf(".")-1),B},v.getInputDisplayValue=function(j){var G=j||v.state,B=G.focused,N=G.inputValue,V=G.value,$;B?$=N:$=v.toPrecisionAsStep(V),$==null&&($="");var ie=v.formatWrapper($);return g(v.props.decimalSeparator)&&(ie=ie.toString().replace(".",v.props.decimalSeparator)),ie},v.recordCursorPosition=function(){try{v.cursorStart=v.input.selectionStart,v.cursorEnd=v.input.selectionEnd,v.currentValue=v.input.value,v.cursorBefore=v.input.value.substring(0,v.cursorStart),v.cursorAfter=v.input.value.substring(v.cursorEnd)}catch(j){}},v.restoreByAfter=function(j){if(j===void 0)return!1;var G=v.input.value,B=G.lastIndexOf(j);if(B===-1)return!1;var N=v.cursorBefore.length;return v.lastKeyCode===w.a.DELETE&&v.cursorBefore.charAt(N-1)===j[0]?(v.fixCaret(N,N),!0):B+j.length===G.length?(v.fixCaret(B,B),!0):!1},v.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(G,B){var N=j.substring(B);return v.restoreByAfter(N)})},v.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(j,G,B){v.pressingUpOrDown=!0,v.step("down",j,G,B)},v.up=function(j,G,B){v.pressingUpOrDown=!0,v.step("up",j,G,B)},v.saveInput=function(j){v.input=j};var O=p.value;O===void 0&&(O=p.defaultValue),v.state={focused:p.autoFocus};var U=v.getValidValue(v.toNumber(O));return v.state=A(A({},v.state),{},{inputValue:v.toPrecisionAsStep(U),value:U}),v}return Object(H.a)(m,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(v){var O=this.props,U=O.value,j=O.onChange,G=O.max,B=O.min,N=this.state.focused;if(v){if(!C(v.value,U)||!C(v.max,G)||!C(v.min,B)){var V=N?U:this.getValidValue(U),$;this.pressingUpOrDown?$=V:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:$})}var ie="value"in this.props?U:this.state.value;"max"in this.props&&v.max!==G&&typeof ie=="number"&&ie>G&&j&&j(G),"min"in this.props&&v.min!==B&&typeof ie=="number"&&ie1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(v);return isNaN(j)?v:(jU&&(j=U),j)}},{key:"setValue",value:function(v,O){var U=this.props.precision,j=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),G=this.state.value,B=G===void 0?null:G,N=this.state.inputValue,V=N===void 0?null:N,$=typeof j=="number"?j.toFixed(U):"".concat(j),ie=j!==B||$!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},O)):this.setState({value:j,inputValue:this.toPrecisionAsStep(v)},O),ie&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(v){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,j=U.precision,G=U.step;if(g(j))return j;var B=this.getPrecision(O),N=this.getPrecision(G),V=this.getPrecision(v);return v?Math.max(V,B+N):B+N}},{key:"getPrecisionFactor",value:function(v){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(v,O);return Math.pow(10,U)}},{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(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var O=Math.abs(this.getMaxPrecision(v));return isNaN(O)?v.toString():Number(v).toFixed(O)}},{key:"toNumber",value:function(v){var O=this.props.precision,U=this.state.focused,j=v&&v.length>16&&U;return this.isNotCompleteNumber(v)||j?v:g(O)?Math.round(v*Math.pow(10,O))/Math.pow(10,O):Number(v)}},{key:"upStep",value:function(v,O){var U=this.props.step,j=this.getPrecisionFactor(v,O),G=Math.abs(this.getMaxPrecision(v,O)),B=((j*v+j*U*O)/j).toFixed(G);return this.toNumber(B)}},{key:"downStep",value:function(v,O){var U=this.props.step,j=this.getPrecisionFactor(v,O),G=Math.abs(this.getMaxPrecision(v,O)),B=((j*v-j*U*O)/j).toFixed(G);return this.toNumber(B)}},{key:"step",value:function(v,O){var U=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),O&&(O.persist(),O.preventDefault());var B=this.props;if(B.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var V=this["".concat(v,"Step")](N,j),$=V>B.max||VB.max?V=B.max:V=oe),Ie=(ke||ke===0)&&(isNaN(ke)||Number(ke)<=_e),se=xe||j||G,te=Ie||j||G,ee=E()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(z.a)({},"".concat(U,"-handler-up-disabled"),se)),Y=E()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(z.a)({},"".concat(U,"-handler-down-disabled"),te)),Q=B?{onTouchStart:se?d:this.up,onTouchEnd:this.stop}:{onMouseDown:se?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=B?{onTouchStart:te?d:this.down,onTouchEnd:this.stop}:{onMouseDown:te?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return D.a.createElement("div",{className:ze,style:fe,title:Se,onMouseEnter:be,onMouseLeave:me,onMouseOver:le,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},D.a.createElement("div",{className:"".concat(U,"-handler-wrap")},D.a.createElement("span",Object.assign({unselectable:"on"},Q,{role:"button","aria-label":"Increase Value","aria-disabled":se,className:ee}),V||D.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:s})),D.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":te,className:Y}),$||D.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:s}))),D.a.createElement("div",{className:"".concat(U,"-input-wrap")},D.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":_e,"aria-valuemax":oe,"aria-valuenow":ke,required:Ee,type:pe,placeholder:Ae,onPaste:Le,onClick:Ge,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:Te,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ye?this.onKeyDown:d,onKeyUp:Ye?this.onKeyUp:d,autoFocus:De,maxLength:je,readOnly:G,disabled:j,max:oe,min:_e,step:Qe,name:Pe,title:Se,id:Ce,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(He),pattern:Be,inputMode:we,onInput:Re},ge))))}}]),m}(D.a.Component);y.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:h,min:-h,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:u,required:!1,autoComplete:"off"};var f=y,c=$e.a=f},hLB0:function(ut,$e,J){},kSUc:function(ut,$e,J){},lZu9:function(ut,$e,J){(function(re){re(J("VrN/"),J("1eCo"),J("8EBN"))})(function(re){"use strict";re.defineMode("markdown",function(z,L){var H=re.getMode(z,"text/html"),k=H.name=="null";function P(B){if(re.findModeByName){var N=re.findModeByName(B);N&&(B=N.mime||N.mimes[0])}var V=re.getMode(z,B);return V.name=="null"?null:V}L.highlightFormatting===void 0&&(L.highlightFormatting=!1),L.maxBlockquoteDepth===void 0&&(L.maxBlockquoteDepth=0),L.taskLists===void 0&&(L.taskLists=!1),L.strikethrough===void 0&&(L.strikethrough=!1),L.emoji===void 0&&(L.emoji=!1),L.fencedCodeBlockHighlighting===void 0&&(L.fencedCodeBlockHighlighting=!0),L.fencedCodeBlockDefaultMode===void 0&&(L.fencedCodeBlockDefaultMode="text/plain"),L.xml===void 0&&(L.xml=!0),L.tokenTypeOverrides===void 0&&(L.tokenTypeOverrides={});var F={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 M in F)F.hasOwnProperty(M)&&L.tokenTypeOverrides[M]&&(F[M]=L.tokenTypeOverrides[M]);var D=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,E=/^\[(x| )\](?=\s)/i,w=L.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ {0,3}(?:\={1,}|-{2,})\s*$/,A=/^[^#!\[\]*_\\<>` "'(~:]+/,_=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,b=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,s=" ";function u(B,N,V){return N.f=N.inline=V,V(B,N)}function l(B,N,V){return N.f=N.block=V,V(B,N)}function S(B){return!B||!/\S/.test(B.string)}function h(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==C){var N=k;if(!N){var V=re.innerMode(H,B.htmlState);N=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}N&&(B.f=o,B.block=g,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function g(B,N){var V=B.column()===N.indentation,$=S(N.prevLine.stream),ie=N.indentedCode,oe=N.prevLine.hr,_e=N.list!==!1,fe=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var Se=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,_e)){for(N.list=null;Se=4&&(ie||N.prevLine.fencedCodeEnd||N.prevLine.header||$))return B.skipToEnd(),N.indentedCode=!0,F.code;if(B.eatSpace())return null;if(V&&N.indentation<=fe&&(le=B.match(w))&&le[1].length<=6)return N.quote=0,N.header=le[1].length,N.thisLine.header=!0,L.highlightFormatting&&(N.formatting="header"),N.f=N.inline,f(N);if(N.indentation<=fe&&B.eat(">"))return N.quote=V?1:N.quote+1,L.highlightFormatting&&(N.formatting="quote"),B.eatSpace(),f(N);if(!me&&!N.setext&&V&&N.indentation<=fe&&(le=B.match(R))){var ue=le[1]?"ol":"ul";return N.indentation=Se+B.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,L.taskLists&&B.match(E,!1)&&(N.taskList=!0),N.f=N.inline,L.highlightFormatting&&(N.formatting=["list","list-"+ue]),f(N)}else{if(V&&N.indentation<=fe&&(le=B.match(_,!0)))return N.quote=0,N.fencedEndRE=new RegExp(le[1]+"+ *$"),N.localMode=L.fencedCodeBlockHighlighting&&P(le[2]||L.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=re.startState(N.localMode)),N.f=N.block=y,L.highlightFormatting&&(N.formatting="code-block"),N.code=-1,f(N);if(N.setext||(!be||!_e)&&!N.quote&&N.list===!1&&!N.code&&!me&&!b.test(B.string)&&(le=B.lookAhead(1))&&(le=le.match(T)))return N.setext?(N.header=N.setext,N.setext=0,B.skipToEnd(),L.highlightFormatting&&(N.formatting="header")):(N.header=le[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,f(N);if(me)return B.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,F.hr;if(B.peek()==="[")return u(B,N,O)}return u(B,N,N.inline)}function C(B,N){var V=H.token(B,N.htmlState);if(!k){var $=re.innerMode(H,N.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||N.md_inside&&B.current().indexOf(">")>-1)&&(N.f=o,N.block=g,N.htmlState=null)}return V}function y(B,N){var V=N.listStack[N.listStack.length-1]||0,$=N.indentation=B.quote?N.push(F.formatting+"-"+B.formatting[V]+"-"+B.quote):N.push("error"))}if(B.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(B.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(B.linkHref?N.push(F.linkHref,"url"):(B.strong&&N.push(F.strong),B.em&&N.push(F.em),B.strikethrough&&N.push(F.strikethrough),B.emoji&&N.push(F.emoji),B.linkText&&N.push(F.linkText),B.code&&N.push(F.code),B.image&&N.push(F.image),B.imageAltText&&N.push(F.imageAltText,"link"),B.imageMarker&&N.push(F.imageMarker)),B.header&&N.push(F.header,F.header+"-"+B.header),B.quote&&(N.push(F.quote),!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=B.quote?N.push(F.quote+"-"+B.quote):N.push(F.quote+"-"+L.maxBlockquoteDepth)),B.list!==!1){var $=(B.listStack.length-1)%3;$?$===1?N.push(F.list2):N.push(F.list3):N.push(F.list1)}return B.trailingSpaceNewLine?N.push("trailing-space-new-line"):B.trailingSpace&&N.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function c(B,N){return B.match(A,!0)?f(N):void 0}function o(B,N){var V=N.text(B,N);if(typeof V!="undefined")return V;if(N.list)return N.list=null,f(N);if(N.taskList){var $=B.match(E,!0)[1]===" ";return $?N.taskOpen=!0:N.taskClosed=!0,L.highlightFormatting&&(N.formatting="task"),N.taskList=!1,f(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&B.match(/^#+$/,!0))return L.highlightFormatting&&(N.formatting="header"),f(N);var ie=B.next();if(N.linkTitle){N.linkTitle=!1;var oe=ie;ie==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var _e="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(B.match(new RegExp(_e),!0))return F.linkHref}if(ie==="`"){var fe=N.formatting;L.highlightFormatting&&(N.formatting="code"),B.eatWhile("`");var Se=B.current().length;if(N.code==0&&(!N.quote||Se==1))return N.code=Se,f(N);if(Se==N.code){var be=f(N);return N.code=0,be}else return N.formatting=fe,f(N)}else if(N.code)return f(N);if(ie==="\\"&&(B.next(),L.highlightFormatting)){var me=f(N),le=F.formatting+"-escape";return me?me+" "+le:le}if(ie==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,L.highlightFormatting&&(N.formatting="image"),f(N);if(ie==="["&&N.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,L.highlightFormatting&&(N.formatting="image"),f(N);if(ie==="]"&&N.imageAltText){L.highlightFormatting&&(N.formatting="image");var me=f(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=m,me}if(ie==="["&&!N.image)return N.linkText&&B.match(/^.*?\]/)||(N.linkText=!0,L.highlightFormatting&&(N.formatting="link")),f(N);if(ie==="]"&&N.linkText){L.highlightFormatting&&(N.formatting="link");var me=f(N);return N.linkText=!1,N.inline=N.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?m:o,me}if(ie==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=a,L.highlightFormatting&&(N.formatting="link");var me=f(N);return me?me+=" ":me="",me+F.linkInline}if(ie==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=a,L.highlightFormatting&&(N.formatting="link");var me=f(N);return me?me+=" ":me="",me+F.linkEmail}if(L.xml&&ie==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=B.string.indexOf(">",B.pos);if(ue!=-1){var Ee=B.string.substring(B.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ee)&&(N.md_inside=!0)}return B.backUp(1),N.htmlState=re.startState(H),l(B,N,C)}if(L.xml&&ie==="<"&&B.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var Ge=1,Te=B.pos==1?" ":B.string.charAt(B.pos-2);Ge<3&&B.eat(ie);)Ge++;var pe=B.peek()||" ",Ae=!/\s/.test(pe)&&(!d.test(pe)||/\s/.test(Te)||d.test(Te)),Ce=!/\s/.test(Te)&&(!d.test(Te)||/\s/.test(pe)||d.test(pe)),we=null,Be=null;if(Ge%2&&(!N.em&&Ae&&(ie==="*"||!Ce||d.test(Te))?we=!0:N.em==ie&&Ce&&(ie==="*"||!Ae||d.test(pe))&&(we=!1)),Ge>1&&(!N.strong&&Ae&&(ie==="*"||!Ce||d.test(Te))?Be=!0:N.strong==ie&&Ce&&(ie==="*"||!Ae||d.test(pe))&&(Be=!1)),Be!=null||we!=null){L.highlightFormatting&&(N.formatting=we==null?"strong":Be==null?"em":"strong em"),we===!0&&(N.em=ie),Be===!0&&(N.strong=ie);var be=f(N);return we===!1&&(N.em=!1),Be===!1&&(N.strong=!1),be}}else if(ie===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return f(N);B.backUp(1)}if(L.strikethrough){if(ie==="~"&&B.eatWhile(ie)){if(N.strikethrough){L.highlightFormatting&&(N.formatting="strikethrough");var be=f(N);return N.strikethrough=!1,be}else if(B.match(/^[^\s]/,!1))return N.strikethrough=!0,L.highlightFormatting&&(N.formatting="strikethrough"),f(N)}else if(ie===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return f(N);B.backUp(2)}}if(L.emoji&&ie===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,L.highlightFormatting&&(N.formatting="emoji");var Qe=f(N);return N.emoji=!1,Qe}return ie===" "&&(B.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),f(N)}function a(B,N){var V=B.next();if(V===">"){N.f=N.inline=o,L.highlightFormatting&&(N.formatting="link");var $=f(N);return $?$+=" ":$="",$+F.linkInline}return B.match(/^[^>]+/,!0),F.linkInline}function m(B,N){if(B.eatSpace())return null;var V=B.next();return V==="("||V==="["?(N.f=N.inline=v(V==="("?")":"]"),L.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,f(N)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(B){return function(N,V){var $=N.next();if($===B){V.f=V.inline=o,L.highlightFormatting&&(V.formatting="link-string");var ie=f(V);return V.linkHref=!1,ie}return N.match(p[B]),V.linkHref=!0,f(V)}}function O(B,N){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=U,B.next(),L.highlightFormatting&&(N.formatting="link"),N.linkText=!0,f(N)):u(B,N,o)}function U(B,N){if(B.match(/^\]:/,!0)){N.f=N.inline=j,L.highlightFormatting&&(N.formatting="link");var V=f(N);return N.linkText=!1,V}return B.match(/^([^\]\\]|\\.)+/,!0),F.linkText}function j(B,N){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?N.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=o,F.linkHref+" url")}var G={startState:function(){return{f:g,prevLine:{stream:null},thisLine:{stream:null},block:g,htmlState:null,indentation:0,inline:o,text:c,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&re.copyState(H,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?re.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,N){if(N.formatting=!1,B!=N.thisLine.stream){if(N.header=0,N.hr=!1,B.match(/^\s*$/,!0))return h(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:B},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=C)){var V=B.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(N.indentation=V,N.indentationDiff=null,V>0)return null}}return N.f(B,N)},innerMode:function(B){return B.block==C?{state:B.htmlState,mode:H}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:G}},indent:function(B,N,V){return B.block==C&&H.indent?H.indent(B.htmlState,N,V):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,N,V):re.Pass},blankLine:h,getType:f,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),re.defineMIME("text/markdown","markdown"),re.defineMIME("text/x-markdown","markdown")})},lfxj:function(ut,$e,J){ut.exports={priseBox:"priseBox___wSohZ",iconfont:"iconfont___2Xk32"}},osHv:function(ut,$e,J){(function(re){re(J("VrN/"))})(function(re){"use strict";var z=re.Pos;function L(d,s){return d.line-s.line||d.ch-s.ch}var H="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",k=H+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+H+"]["+k+"]*)","g");function F(d,s,u,l){this.line=s,this.ch=u,this.cm=d,this.text=d.getLine(s),this.min=l?Math.max(l.from,d.firstLine()):d.firstLine(),this.max=l?Math.min(l.to-1,d.lastLine()):d.lastLine()}function M(d,s){var u=d.cm.getTokenTypeAt(z(d.line,s));return u&&/\btag\b/.test(u)}function D(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function R(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function E(d){for(;;){var s=d.text.indexOf(">",d.ch);if(s==-1){if(D(d))continue;return}if(!M(d,s+1)){d.ch=s+1;continue}var u=d.text.lastIndexOf("/",s),l=u>-1&&!/\S/.test(d.text.slice(u+1,s));return d.ch=s+1,l?"selfClose":"regular"}}function w(d){for(;;){var s=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(s==-1){if(R(d))continue;return}if(!M(d,s+1)){d.ch=s;continue}P.lastIndex=s,d.ch=s;var u=P.exec(d.text);if(u&&u.index==s)return u}}function T(d){for(;;){P.lastIndex=d.ch;var s=P.exec(d.text);if(!s){if(D(d))continue;return}if(!M(d,s.index+1)){d.ch=s.index+1;continue}return d.ch=s.index+s[0].length,s}}function A(d){for(;;){var s=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(s==-1){if(R(d))continue;return}if(!M(d,s+1)){d.ch=s;continue}var u=d.text.lastIndexOf("/",s),l=u>-1&&!/\S/.test(d.text.slice(u+1,s));return d.ch=s+1,l?"selfClose":"regular"}}function _(d,s){for(var u=[];;){var l=T(d),S,h=d.line,g=d.ch-(l?l[0].length:0);if(!l||!(S=E(d)))return;if(S=="selfClose")continue;if(l[1]){for(var C=u.length-1;C>=0;--C)if(u[C]==l[2]){u.length=C;break}if(C<0&&(!s||s==l[2]))return{tag:l[2],from:z(h,g),to:z(d.line,d.ch)}}else u.push(l[2])}}function b(d,s){for(var u=[];;){var l=A(d);if(!l)return;if(l=="selfClose"){w(d);continue}var S=d.line,h=d.ch,g=w(d);if(!g)return;if(g[1])u.push(g[2]);else{for(var C=u.length-1;C>=0;--C)if(u[C]==g[2]){u.length=C;break}if(C<0&&(!s||s==g[2]))return{tag:g[2],from:z(d.line,d.ch),to:z(S,h)}}}}re.registerHelper("fold","xml",function(d,s){for(var u=new F(d,s.line,0);;){var l=T(u);if(!l||u.line!=s.line)return;var S=E(u);if(!S)return;if(!l[1]&&S!="selfClose"){var h=z(u.line,u.ch),g=_(u,l[2]);return g&&L(g.from,h)>0?{from:h,to:g.from}:null}}}),re.findMatchingTag=function(d,s,u){var l=new F(d,s.line,s.ch,u);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var S=E(l),h=S&&z(l.line,l.ch),g=S&&w(l);if(!S||!g||L(l,s)>0)return;var C={from:z(l.line,l.ch),to:h,tag:g[2]};return S=="selfClose"?{open:C,close:null,at:"open"}:g[1]?{open:b(l,g[2]),close:C,at:"close"}:(l=new F(d,h.line,h.ch,u),{open:C,close:_(l,g[2]),at:"open"})},re.findEnclosingTag=function(d,s,u,l){for(var S=new F(d,s.line,s.ch,u);;){var h=b(S,l);if(!h)break;var g=new F(d,s.line,s.ch,u),C=_(g,h.tag);if(C)return{open:h,close:C}}},re.scanForClosingTag=function(d,s,u,l){var S=new F(d,s.line,s.ch,l?{from:0,to:l}:null);return _(S,u)}})},p5ED:function(ut,$e,J){"use strict";var re=J("+L6B"),z=J("2/Rp"),L=J("5Dmo"),H=J("3S7+"),k=J("k1fw"),P=J("tJVT"),F=J("q1tI"),M=J.n(F),D=J("vHTk"),R=J.n(D),E=J("yEEn"),w=J("ZW9T"),T=J("1vsH");$e.a=function(A){var _=A.name,b=A.data,d=A.theme,s=A.type,u=A.filename,l=A.monacoEditor,S=A.className,h=A.style,g=A.close,C=A.onClose,y=A.hasMask,f=Object(F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),c=Object(P.a)(f,2),o=c[0],a=c[1],m=Object(F.useState)(""),p=Object(P.a)(m,2),v=p[0],O=p[1],U=Object(F.useRef)();u&&(l.filename=u),Object(F.useEffect)(function(){var B,N,V=(B=document.cookie)===null||B===void 0||((N=B.replace(/\s/g,""))===null||N===void 0)?void 0:N.split(";");V==null||V.map(function($){var ie=$.split("=");ie[0]==="_educoder_session"&&O(ie[1])})},[]);var j=function(){if(b.startsWith("http")||b.startsWith("/")){G();return}Object(T.y)(u||"educoder",b,u)},G=function(){Object(T.w)(u||_,b)};return console.log("data:",b,"fileanme:",u," name:",_),M.a.createElement("div",{style:Object(k.a)({},h||{}),className:"".concat(y&&R.a.bgBlack," ").concat(s?R.a.wrp:"hide")},g&&M.a.createElement("div",{className:R.a.close,ref:U},M.a.createElement(H.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},M.a.createElement("span",{onClick:G},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(H.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},M.a.createElement("span",{className:"",onClick:C},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(R.a[S]," ").concat(S," ").concat(R.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&M.a.createElement(w.b,l)),s==="audio"&&M.a.createElement("audio",{src:"".concat(b!=null&&b.startsWith("/")||(b==null?void 0:b.indexOf("https://"))>-1?b:"data:audio/mp3;base64,").concat(b),autoPlay:!0}),s==="video"&&M.a.createElement(M.a.Fragment,null,b!=null&&b.startsWith("/")?M.a.createElement("video",{controls:!0,src:"".concat(b),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(b),autoPlay:!0})),s==="pdf"&&M.a.createElement("embed",{className:R.a.embed,src:b}),s==="image"&&M.a.createElement(M.a.Fragment,null,M.a.createElement("img",{src:"".concat(b!=null&&b.startsWith("/")||(b==null?void 0:b.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(b)})),s==="other"&&M.a.createElement("div",null,M.a.createElement(z.a,{type:"primary",size:"large",onClick:j},M.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&M.a.createElement(z.a,{type:"primary",size:"large",onClick:j},M.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ut,$e,J){},"rAM+":function(ut,$e,J){"use strict";J.d($e,"a",function(){return z});var re=J("Qw5x");function z(L,H){var k;if(typeof Symbol=="undefined"||L[Symbol.iterator]==null){if(Array.isArray(L)||(k=Object(re.a)(L))||H&&L&&typeof L.length=="number"){k&&(L=k);var P=0,F=function(){};return{s:F,n:function(){return P>=L.length?{done:!0}:{done:!1,value:L[P++]}},e:function(w){throw w},f:F}}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 M=!0,D=!1,R;return{s:function(){k=L[Symbol.iterator]()},n:function(){var w=k.next();return M=w.done,w},e:function(w){D=!0,R=w},f:function(){try{!M&&k.return!=null&&k.return()}finally{if(D)throw R}}}}},rUJ1:function(ut,$e){const J=/[&<>"']/,re=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,H={"&":"&","<":"<",">":">",'"':""","'":"'"},k=y=>H[y];function P(y,f){if(f){if(J.test(y))return y.replace(re,k)}else if(z.test(y))return y.replace(L,k);return y}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(y){return y.replace(F,(f,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const D=/(^|[^\[])\^/g;function R(y,f){y=y.source||y,f=f||"";const c={replace:(o,a)=>(a=a.source||a,a=a.replace(D,"$1"),y=y.replace(o,a),c),getRegex:()=>new RegExp(y,f)};return c}const E=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(y,f,c){if(y){let o;try{o=decodeURIComponent(M(c)).replace(E,"").toLowerCase()}catch(a){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}f&&!w.test(c)&&(c=s(f,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(o){return null}return c}const A={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(y,f){A[" "+y]||(_.test(y)?A[" "+y]=y+"/":A[" "+y]=h(y,"/",!0)),y=A[" "+y];const c=y.indexOf(":")===-1;return f.substring(0,2)==="//"?c?f:y.replace(b,"$1")+f:f.charAt(0)==="/"?c?f:y.replace(d,"$1")+f:y+f}const u={exec:function(){}};function l(y){let f=1,c,o;for(;f{let O=!1,U=p;for(;--U>=0&&v[U]==="\\";)O=!O;return O?"|":" |"}),o=c.split(/ \|/);let a=0;if(o.length>f)o.splice(f);else for(;o.length0},!1)}function E(w,T){for(var A={main:[T]},_={main:[]},b={main:{}};R(A);)for(var d=Object.keys(A),s=0;s=2*C/f||v<=U)return;var j=Number.POSITIVE_INFINITY,G;for(G=d.level-1;G>o;G--){var B=c[G].maxBitrate;if(j=C*B/(8*.8*p),j=v)return;var N=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+d.sn+(s?" part "+s.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+` Current BW estimate: `+(Object(H.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+v.toFixed(3)+` s Estimated load time for the next fragment: `+j.toFixed(3)+` s Time to underbuffer: `+U.toFixed(3)+" s"),u.nextLoadLevel=G,this.bwEstimator.sample(y,g.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),u.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:s,stats:g})},_.onFragLoaded=function(d,s){var u=s.frag,l=s.part;if(u.type===D.PlaylistLevelType.MAIN&&Object(H.isFiniteNumber)(u.sn)){var S=l?l.stats:u.stats,h=l?l.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[u.level],C=(g.loaded?g.loaded.bytes:0)+S.loaded,y=(g.loaded?g.loaded.duration:0)+h;g.loaded={bytes:C,duration:y},g.realBitrate=Math.round(8*C/y)}if(u.bitrateTest){var f={stats:S,frag:u,part:l,id:u.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,f),u.bitrateTest=!1}}},_.onFragBuffered=function(d,s){var u=s.frag,l=s.part,S=l?l.stats:u.stats;if(S.aborted)return;if(u.type!==D.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var h=S.parsing.end-S.loading.start;this.bwEstimator.sample(h,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=h/1e3:this.bitrateTestDelay=0},_.onError=function(d,s){switch(s.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},_.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},_.getNextABRAutoLevel=function(){var d=this.fragCurrent,s=this.partCurrent,u=this.hls,l=u.maxAutoLevel,S=u.config,h=u.minAutoLevel,g=u.media,C=s?s.duration:d?d.duration:0,y=g?g.currentTime:0,f=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,o=(F.BufferHelper.bufferInfo(g,y,S.maxBufferHole).end-y)/f,a=this.findBestLevel(c,h,l,o,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(a>=0)return a;R.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var m=C?Math.min(C,S.maxStarvationDelay):S.maxStarvationDelay,p=S.abrBandWidthFactor,v=S.abrBandWidthUpFactor;if(!o){var O=this.bitrateTestDelay;if(O){var U=C?Math.min(C,S.maxLoadingDelay):S.maxLoadingDelay;m=U-O,R.logger.trace("bitrate test took "+Math.round(1e3*O)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*m)+" ms"),p=v=1}}return a=this.findBestLevel(c,h,l,o+m,p,v),Math.max(a,0)},_.findBestLevel=function(d,s,u,l,S,h){for(var g,C=this.fragCurrent,y=this.partCurrent,f=this.lastLoadedFragLevel,c=this.hls.levels,o=c[f],a=!!(o!=null&&(g=o.details)!==null&&g!==void 0&&g.live),m=o==null?void 0:o.codecSet,p=y?y.duration:C?C.duration:0,v=u;v>=s;v--){var O=c[v];if(!O||m&&O.codecSet!==m)continue;var U=O.details,j=(y?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||p,G=void 0;v<=f?G=S*d:G=h*d;var B=c[v].maxBitrate,N=B*j/G;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(G)+"/"+B+"/"+j+"/"+l+"/"+N),G>B&&(!N||a&&!this.bitrateTestDelay||N0&&o===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=k.State.IDLE):(this.loadedmetadata=!1,this.state=k.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()},f.doTick=function(){switch(this.state){case k.State.IDLE:this.doTickIdle();break;case k.State.WAITING_TRACK:{var o,a=this.levels,m=this.trackId,p=a==null||((o=a[m])===null||o===void 0)?void 0:o.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=k.State.WAITING_INIT_PTS}break}case k.State.FRAG_LOADING_WAITING_RETRY:{var v,O=performance.now(),U=this.retryDate;(!U||O>=U||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=k.State.IDLE);break}case k.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var G=j.frag,B=j.part,N=j.cache,V=j.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=k.State.FRAG_LOADING;var $=N.flush(),ie={frag:G,part:B,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ie),V&&C.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),_e=F.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),fe=Object(_.fragmentWithinToleranceTest)(_e.end,this.config.maxFragLookUpTolerance,G);fe<0&&(s.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+_e.end+" is needed"),this.clearWaitingFragment())}}else this.state=k.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var o=this.waitingData;o&&(this.fragmentTracker.removeFragment(o.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=k.State.IDLE)},f.onTickEnd=function(){var o=this.media;if(!o||!o.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:o,m=a.buffered;!this.loadedmetadata&&m.length&&(this.loadedmetadata=!0),this.lastCurrentTime=o.currentTime},f.doTickIdle=function(){var o,a,m=this.hls,p=this.levels,v=this.media,O=this.trackId,U=m.config;if(!p||!p[O])return;if(!v&&(this.startFragRequested||!U.startFragPrefetch))return;var j=p[O],G=j.details;if(!G||G.live&&this.levelLastLoaded!==O||this.waitForCdnTuneIn(G)){this.state=k.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(B===null)return;var N=B.len,V=this.getMaxBufferLength(),$=this.audioSwitch;if(N>=V&&!$)return;if(!$&&this._streamEnded(B,G)){m.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=k.State.ENDED;return}var ie=G.fragments,oe=ie[0].start,_e=B.end;if($){var fe=this.getLoadPosition();_e=fe,G.PTSKnown&&feoe||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=oe+.05))}var Se=this.getNextFragment(_e,G);if(!Se){this.bufferFlushed=!0;return}((o=Se.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((a=Se.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Se,G):this.loadFragment(Se,G,_e)},f.getMaxBufferLength=function(){var o=C.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return a===null?o:Math.max(o,a.len)},f.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(o,a){var m=a.audioTracks;this.resetTransmuxer(),this.levels=m.map(function(p){return new D.Level(p)})},f.onAudioTrackSwitching=function(o,a){var m=!!a.url;this.trackId=a.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),m?this.setInterval(h):this.resetTransmuxer(),m?(this.audioSwitch=!0,this.state=k.State.IDLE):this.state=k.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(o,a){this.mainDetails=a.details},f.onAudioTrackLoaded=function(o,a){var m,p=this.levels,v=a.details,O=a.id;if(!p){this.warn("Audio tracks were reset while loading level "+O);return}this.log("Track "+O+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var U=p[O],j=0;if(v.live||(m=U.details)!==null&&m!==void 0&&m.live){var G=this.mainDetails;if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed||!G)return;!U.details&&v.hasProgramDateTime&&G.hasProgramDateTime?(Object(b.alignMediaPlaylistByPDT)(v,G),j=v.fragments[0].start):j=this.alignPlaylists(v,U.details)}U.details=v,this.levelLastLoaded=O,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(U.details,j),this.state===k.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=k.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(o){var a,m=o.frag,p=o.part,v=o.payload,O=this.config,U=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+m.sn+" of level "+m.level+" will not be buffered");return}var G=j[U];console.assert(G,"Audio track is defined on fragment load progress");var B=G.details;console.assert(B,"Audio track details are defined on fragment load progress");var N=O.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new T.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[m.cc],ie=(a=m.initSegment)===null||a===void 0?void 0:a.data;if($!==void 0){var oe=!1,_e=p?p.index:-1,fe=_e!==-1,Se=new A.ChunkMetadata(m.level,m.sn,m.stats.chunkCount,v.byteLength,_e,fe);V.push(v,ie,N,"",m,p,B.totalduration,oe,Se,$)}else{s.logger.log("Unknown video PTS for cc "+m.cc+", waiting for video PTS before demuxing audio frag "+m.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+U);var be=this.waitingData=this.waitingData||{frag:m,part:p,cache:new w.default,complete:!1},me=be.cache;me.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=k.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(o){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,o)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(o,a){var m=a.tracks.audio;m&&(this.mediaBuffer=m.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},f.onFragBuffered=function(o,a){var m=a.frag,p=a.part;if(m.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(m)){this.warn("Fragment "+m.sn+(p?" p: "+p.index:"")+" of level "+m.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}m.sn!=="initSegment"&&(this.fragPrevious=m,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(m,p)},f.onError=function(o,a){switch(a.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,a);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==k.State.ERROR&&this.state!==k.State.STOPPED&&(this.state=a.fatal?k.State.ERROR:k.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var m=!0,p=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);p&&p.len>.5&&(m=!this.reduceMaxBufferLength(p.len)),m&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(o,a){var m=a.type;m===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(o){var a,m="audio",p=this.hls,v=o.remuxResult,O=o.chunkMeta,U=this.getCurrentContext(O);if(!U){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var j=U.frag,G=U.part,B=v.audio,N=v.text,V=v.id3,$=v.initSegment;if(this.fragContextChanged(j))return;if(this.state=k.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,j,O),p.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:m,tracks:$.tracks})),B){var ie=B.startPTS,oe=B.endPTS,_e=B.startDTS,fe=B.endDTS;G&&(G.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:oe,startDTS:_e,endDTS:fe}),j.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ie,oe,_e,fe),this.bufferFragmentData(B,j,G,O)}if(V!=null&&(a=V.samples)!==null&&a!==void 0&&a.length){var Se=u({frag:j,id:m},V);p.trigger(P.Events.FRAG_PARSING_METADATA,Se)}if(N){var be=u({frag:j,id:m},N);p.trigger(P.Events.FRAG_PARSING_USERDATA,be)}},f._bufferInitSegment=function(o,a,m){if(this.state!==k.State.PARSING)return;o.video&&delete o.video;var p=o.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,o);var v=p.initSegment;if(v!=null&&v.byteLength){var O={type:"audio",frag:a,part:null,chunkMeta:m,parent:a.type,data:v};this.hls.trigger(P.Events.BUFFER_APPENDING,O)}this.tick()},f.loadFragment=function(o,a,m){var p=this.fragmentTracker.getState(o);this.fragCurrent=o,(this.audioSwitch||p===M.FragmentState.NOT_LOADED||p===M.FragmentState.PARTIAL)&&(o.sn==="initSegment"?this._loadInitSegment(o):a.live&&!Object(H.isFiniteNumber)(this.initPTS[o.cc])?(this.log("Waiting for video PTS in continuity counter "+o.cc+" of live stream before loading audio fragment "+o.sn+" of level "+this.trackId),this.state=k.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,o,a,m)))},f.completeAudioSwitch=function(){var o=this.hls,a=this.media,m=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,o.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:m})},y}(k.default);z.default=g},"./src/controller/audio-track-controller.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/events.ts"),k=L("./src/errors.ts"),P=L("./src/controller/base-playlist-controller.ts"),F=L("./src/types/loader.ts");function M(T,A){for(var _=0;_=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=s[this.trackId];this.log("Now switching to audio-track index "+d);var l=s[d],S=l.id,h=l.groupId,g=h===void 0?"":h,C=l.name,y=l.type,f=l.url;if(this.trackId=d,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(H.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:g,name:C,type:y,url:f}),l.details&&!l.details.live)return;var c=this.switchParams(l.url,u==null?void 0:u.details);this.loadPlaylist(c)},_.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,u=this.findTrackId(s)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(H.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},_.findTrackId=function(d){for(var s=this.tracksInGroup,u=0;uA.partTarget&&(l+=1)}if(Object(H.isFiniteNumber)(u))return new k.HlsUrlParameters(u,Object(H.isFiniteNumber)(l)?l:void 0,k.HlsSkip.No)}}},E.loadPlaylist=function(T){},E.shouldLoadTrack=function(T){return this.canLoad&&T&&!!T.url&&(!T.details||T.details.live)},E.playlistLoaded=function(T,A,_){var b=this,d=A.details,s=A.stats,u=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(d.advancedDateTime=Date.now()-u,d.live||_!=null&&_.live){if(d.reloaded(_),_&&this.log("live playlist "+T+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),_&&d.fragments.length>0&&Object(P.mergeDetails)(_,d),!this.canLoad||!d.live)return;var l,S=void 0,h=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var g=this.hls.config.lowLatencyMode,C=d.lastPartSn,y=d.endSN,f=d.lastPartIndex,c=f!==-1,o=C===y,a=g?0:f;c?(S=o?y+1:C,h=o?a:f+1):S=y+1;var m=d.age,p=m+d.ageHeader,v=Math.min(p-d.partTarget,d.targetduration*1.5);if(v>0){if(_&&v>_.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+_.tuneInGoal+" to: "+v+" with playlist age: "+d.age),v=0;else{var O=Math.floor(v/d.targetduration);if(S+=O,h!==void 0){var U=Math.round(v%d.targetduration/d.partTarget);h+=U}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+m.toFixed(2)+"s goal: "+v+" skip sn "+O+" to part "+h)}d.tuneInGoal=v}if(l=this.getDeliveryDirectives(d,A.deliveryDirectives,S,h),g||!o){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(d,A.deliveryDirectives,S,h);var j=Object(P.computeReloadInterval)(d,s);S!==void 0&&d.canBlockReload&&(j-=d.partTarget||1),this.log("reload live playlist "+T+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return b.loadPlaylist(l)},j)}else this.clearTimer()},E.getDeliveryDirectives=function(T,A,_,b){var d=Object(k.getSkipValue)(T,_);return A!=null&&A.skip&&T.deltaUpdateFailed&&(_=A.msn,b=A.part,d=k.HlsSkip.No),new k.HlsUrlParameters(_,b,d)},E.retryLoadingOrFail=function(T){var A=this,_=this.hls.config,b=this.retryCount<_.levelLoadingMaxRetry;if(b){var d;if(this.retryCount++,T.details.indexOf("LoadTimeOut")>-1&&(d=T.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+T.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*_.levelLoadingRetryDelay,_.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return A.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+T.details+'"')}}else this.warn('cannot recover from error "'+T.details+'"'),this.clearTimer(),T.fatal=!0;return b},R}()},"./src/controller/base-stream-controller.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"State",function(){return y}),L.d(z,"default",function(){return f});var H=L("./src/polyfills/number.ts"),k=L("./src/task-loop.ts"),P=L("./src/controller/fragment-tracker.ts"),F=L("./src/utils/buffer-helper.ts"),M=L("./src/utils/logger.ts"),D=L("./src/events.ts"),R=L("./src/errors.ts"),E=L("./src/types/transmuxer.ts"),w=L("./src/utils/mp4-tools.ts"),T=L("./src/utils/discontinuities.ts"),A=L("./src/controller/fragment-finders.ts"),_=L("./src/controller/level-helper.ts"),b=L("./src/loader/fragment-loader.ts"),d=L("./src/crypt/decrypter.ts"),s=L("./src/utils/time-ranges.ts"),u=L("./src/types/loader.ts");function l(c,o){for(var a=0;a$;(G0&&G&&G.key&&G.iv&&G.method==="AES-128"){var B=self.performance.now();return v.decrypter.webCryptoDecrypt(new Uint8Array(j),G.key.buffer,G.iv.buffer).then(function(N){var V=self.performance.now();return U.trigger(D.Events.FRAG_DECRYPTED,{frag:p,payload:N,stats:{tstart:B,tdecrypt:V}}),O.payload=N,O})}return O}).then(function(O){var U=v.fragCurrent,j=v.hls,G=v.levels;if(!G)throw new Error("init load aborted, missing levels");var B=G[p.level].details;console.assert(B,"Level details are defined when init segment is loaded");var N=p.stats;v.state=y.IDLE,v.fragLoadError=0,p.data=new Uint8Array(O.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),O.frag===U&&j.trigger(D.Events.FRAG_BUFFERED,{stats:N,frag:U,part:null,id:p.type}),v.tick()}).catch(function(O){v.warn(O),v.resetFragmentLoading(p)})},a.fragContextChanged=function(p){var v=this.fragCurrent;return!p||!v||p.level!==v.level||p.sn!==v.sn||p.urlId!==v.urlId},a.fragBufferedComplete=function(p,v){var O=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(v?" part: "+v.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+s.default.toString(F.BufferHelper.getBuffered(O))),this.state=y.IDLE,this.tick()},a._handleFragmentLoadComplete=function(p){var v=this.transmuxer;if(!v)return;var O=p.frag,U=p.part,j=p.partsLoaded,G=!j||j.length===0||j.some(function(N){return!N}),B=new E.ChunkMetadata(O.level,O.sn,O.stats.chunkCount+1,0,U?U.index:-1,!G);v.flush(B)},a._handleFragmentLoadProgress=function(p){},a._doFragLoad=function(p,v,O,U){var j=this;if(O===void 0&&(O=null),!this.levels)throw new Error("frag load aborted, missing levels");if(O=Math.max(p.start,O||0),this.config.lowLatencyMode&&v){var G=v.partList;if(G&&U){O>p.end&&v.fragmentHint&&(p=v.fragmentHint);var B=this.getNextPart(G,p,O);if(B>-1){var N=G[B];return this.log("Loading part sn: "+p.sn+" p: "+N.index+" cc: "+p.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+B+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=y.FRAG_LOADING,this.hls.trigger(D.Events.FRAG_LOADING,{frag:p,part:G[B],targetBufferTime:O}),this.doFragPartsLoad(p,G,B,U).catch(function(V){return j.handleFragLoadError(V)})}else if(!p.url||this.loadedEndOfParts(G,O))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(v?"of ["+v.startSN+"-"+v.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(O.toFixed(3))),Object(H.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=y.FRAG_LOADING,this.hls.trigger(D.Events.FRAG_LOADING,{frag:p,targetBufferTime:O}),this.fragmentLoader.load(p,U).catch(function(V){return j.handleFragLoadError(V)})},a.doFragPartsLoad=function(p,v,O,U){var j=this;return new Promise(function(G,B){var N=[],V=function $(ie){var oe=v[ie];j.fragmentLoader.loadPart(p,oe,U).then(function(_e){N[oe.index]=_e;var fe=_e.part;j.hls.trigger(D.Events.FRAG_LOADED,_e);var Se=v[ie+1];if(Se&&Se.fragment===p)$(ie+1);else return G({frag:p,part:fe,partsLoaded:N})}).catch(B)};V(O)})},a.handleFragLoadError=function(p){var v=p.data;return v&&v.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(v.frag,v.part):this.hls.trigger(D.Events.ERROR,v),null},a._handleTransmuxerFlush=function(p){var v=this.getCurrentContext(p);if(!v||this.state!==y.PARSING){this.fragCurrent||(this.state=y.IDLE);return}var O=v.frag,U=v.part,j=v.level,G=self.performance.now();O.stats.parsing.end=G,U&&(U.stats.parsing.end=G),this.updateLevelTiming(O,U,j,p.partial)},a.getCurrentContext=function(p){var v=this.levels,O=p.level,U=p.sn,j=p.part;if(!v||!v[O])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+O+". The current chunk will not be buffered."),null;var G=v[O],B=j>-1?Object(_.getPartWith)(G,U,j):null,N=B?B.fragment:Object(_.getFragmentWithSN)(G,U,this.fragCurrent);return N?{frag:N,part:B,level:G}:null},a.bufferFragmentData=function(p,v,O,U){if(!p||this.state!==y.PARSING)return;var j=p.data1,G=p.data2,B=j;if(j&&G&&(B=Object(w.appendUint8Array)(j,G)),!B||!B.length)return;var N={type:p.type,frag:v,part:O,chunkMeta:U,parent:v.type,data:B};this.hls.trigger(D.Events.BUFFER_APPENDING,N),p.dropped&&p.independent&&!O&&this.flushBufferGap(v)},a.flushBufferGap=function(p){var v=this.media;if(!v)return;if(!F.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,p.start);return}var O=v.currentTime,U=F.BufferHelper.bufferInfo(v,O,0),j=p.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),B=Math.max(Math.min(p.start-G,U.end-G),O+G);p.start-B>G&&this.flushMainBuffer(B,p.start)},a.getFwdBufferInfo=function(p,v){var O=this.config,U=this.getLoadPosition();if(!Object(H.isFiniteNumber)(U))return null;var j=F.BufferHelper.bufferInfo(p,U,O.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(U,v);if(G&&j.nextStart=O?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(p,v){var O,U,j=v.fragments,G=j.length;if(!G)return null;var B=this.config,N=j[0].start,V;if(v.live){var $=B.initialLiveManifestSize;if(G<$)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+$+")"),null;!v.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(v,j),this.startPosition=V?this.hls.liveSyncPosition||V.start:p)}else p<=N&&(V=j[0]);if(!V){var ie=B.lowLatencyMode?v.partEnd:v.fragmentEnd;V=this.getFragmentAtPosition(p,ie,v)}return(O=V)!==null&&O!==void 0&&O.initSegment&&!((U=V)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},a.getNextPart=function(p,v,O){for(var U=-1,j=!1,G=!0,B=0,N=p.length;B-1&&OO.start&&O.loaded},a.getInitialLiveFragment=function(p,v){var O=this.fragPrevious,U=null;if(O){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+O.programDateTime),U=Object(A.findFragmentByPDT)(v,O.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var j=O.sn+1;if(j>=p.startSN&&j<=p.endSN){var G=v[j-p.startSN];O.cc===G.cc&&(U=G,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(A.findFragWithCC)(v,O.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(U=this.getFragmentAtPosition(B,this.bitrateTest?p.fragmentEnd:p.edge,p))}return U},a.getFragmentAtPosition=function(p,v,O){var U=this.config,j=this.fragPrevious,G=O.fragments,B=O.endSN,N=O.fragmentHint,V=U.maxFragLookUpTolerance,$=!!(U.lowLatencyMode&&O.partList&&N);$&&N&&!this.bitrateTest&&(G=G.concat(N),B=N.sn);var ie;if(pv-V?0:V;ie=Object(A.findFragmentByPTS)(j,G,p,oe)}else ie=G[G.length-1];if(ie){var _e=ie.sn-O.startSN,fe=j&&ie.level===j.level,Se=G[_e+1],be=this.fragmentTracker.getState(ie);if(be===P.FragmentState.BACKTRACKED){ie=null;for(var me=_e;G[me]&&this.fragmentTracker.getState(G[me])===P.FragmentState.BACKTRACKED;)j?ie=G[me--]:ie=G[--me];ie||(ie=Se)}else j&&ie.sn===j.sn&&!$&&(fe&&(ie.sn=G-v.maxFragLookUpTolerance&&j<=B;if(U!==null&&O.duration>U&&(j"+p.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+B),ie}return N},a.waitForCdnTuneIn=function(p){var v=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*v)},a.setStartPosition=function(p,v){var O=this.startPosition;if(O"+p))}}]),o}(k.default)},"./src/controller/buffer-controller.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return A});var H=L("./src/polyfills/number.ts"),k=L("./src/events.ts"),P=L("./src/utils/logger.ts"),F=L("./src/errors.ts"),M=L("./src/utils/buffer-helper.ts"),D=L("./src/utils/mediasource-helper.ts"),R=L("./src/loader/fragment.ts"),E=L("./src/controller/buffer-operation-queue.ts"),w=Object(D.getMediaSource)(),T=/([ha]vc.)(?:\.[^.,]+)+/,A=function(){function _(d){var s=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 u=s.hls,l=s.media,S=s.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),l&&(s.updateMediaElementDuration(),u.trigger(k.Events.MEDIA_ATTACHED,{media:l})),S&&S.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=d,this._initSourceBuffer(),this.registerListeners()}var b=_.prototype;return b.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},b.destroy=function(){this.unregisterListeners(),this.details=null},b.registerListeners=function(){var s=this.hls;s.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(k.Events.BUFFER_RESET,this.onBufferReset,this),s.on(k.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(k.Events.BUFFER_EOS,this.onBufferEos,this),s.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(k.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(k.Events.FRAG_PARSED,this.onFragParsed,this),s.on(k.Events.FRAG_CHANGED,this.onFragChanged,this)},b.unregisterListeners=function(){var s=this.hls;s.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(k.Events.BUFFER_RESET,this.onBufferReset,this),s.off(k.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(k.Events.BUFFER_EOS,this.onBufferEos,this),s.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(k.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(k.Events.FRAG_PARSED,this.onFragParsed,this),s.off(k.Events.FRAG_CHANGED,this.onFragChanged,this)},b._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},b.onManifestParsed=function(s,u){var l=2;(u.audio&&!u.video||!u.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},b.onMediaAttaching=function(s,u){var l=this.media=u.media;if(l&&w){var S=this.mediaSource=new w;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(S),this._objectUrl=l.src}},b.onMediaDetaching=function(){var s=this.media,u=this.mediaSource,l=this._objectUrl;if(u){if(P.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(S){P.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(l&&self.URL.revokeObjectURL(l),s.src===l?(s.removeAttribute("src"),s.load()):P.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(k.Events.MEDIA_DETACHED,void 0)},b.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(u){var l=s.sourceBuffer[u];try{l&&(s.removeBufferListeners(u),s.mediaSource&&s.mediaSource.removeSourceBuffer(l),s.sourceBuffer[u]=void 0)}catch(S){P.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",S)}}),this._initSourceBuffer()},b.onBufferCodecs=function(s,u){var l=this,S=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(h){if(S){var g=l.tracks[h];if(g&&typeof g.buffer.changeType=="function"){var C=u[h],y=C.codec,f=C.levelCodec,c=C.container,o=(g.levelCodec||g.codec).replace(T,"$1"),a=(f||y).replace(T,"$1");if(o!==a){var m=c+";codecs="+(f||y);l.appendChangeType(h,m)}}}else l.pendingTracks[h]=u[h]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},b.appendChangeType=function(s,u){var l=this,S=this.operationQueue,h={execute:function(){var C=l.sourceBuffer[s];C&&(P.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+u),C.changeType(u)),S.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(C){P.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",C)}};S.append(h,s)},b.onBufferAppending=function(s,u){var l=this,S=this.hls,h=this.operationQueue,g=this.tracks,C=u.data,y=u.type,f=u.frag,c=u.part,o=u.chunkMeta,a=o.buffering[y],m=self.performance.now();a.start=m;var p=f.stats.buffering,v=c?c.stats.buffering:null;p.start===0&&(p.start=m),v&&v.start===0&&(v.start=m);var O=g.audio,U=y==="audio"&&o.id===1&&(O==null?void 0:O.container)==="audio/mpeg",j={execute:function(){if(a.executeStart=self.performance.now(),U){var B=l.sourceBuffer[y];if(B){var N=f.start-B.timestampOffset;Math.abs(N)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+N+") sn: "+f.sn+")"),B.timestampOffset=f.start)}}l.appendExecutor(C,y)},onStart:function(){},onComplete:function(){var B=self.performance.now();a.executeEnd=a.end=B,p.first===0&&(p.first=B),v&&v.first===0&&(v.first=B);var N=l.sourceBuffer,V={};for(var $ in N)V[$]=M.BufferHelper.getBuffered(N[$]);l.appendError=0,l.hls.trigger(k.Events.BUFFER_APPENDED,{type:y,frag:f,part:c,chunkMeta:o,parent:f.type,timeRanges:V})},onError:function(B){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+y+" SourceBuffer",B);var N={type:F.ErrorTypes.MEDIA_ERROR,parent:f.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=F.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,N.details=F.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>S.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),S.trigger(k.Events.ERROR,N)}};h.append(j,y)},b.onBufferFlushing=function(s,u){var l=this,S=this.operationQueue,h=function(C){return{execute:l.removeExecutor.bind(l,C,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(k.Events.BUFFER_FLUSHED,{type:C})},onError:function(f){P.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",f)}}};u.type?S.append(h(u.type),u.type):this.getSourceBufferTypes().forEach(function(g){S.append(h(g),g)})},b.onFragParsed=function(s,u){var l=this,S=u.frag,h=u.part,g=[],C=h?h.elementaryStreams:S.elementaryStreams;C[R.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(C[R.ElementaryStreamTypes.AUDIO]&&g.push("audio"),C[R.ElementaryStreamTypes.VIDEO]&&g.push("video"));var y=function(){var c=self.performance.now();S.stats.buffering.end=c,h&&(h.stats.buffering.end=c);var o=h?h.stats:S.stats;l.hls.trigger(k.Events.FRAG_BUFFERED,{frag:S,part:h,stats:o,id:S.type})};g.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(y,g)},b.onFragChanged=function(s,u){this.flushBackBuffer()},b.onBufferEos=function(s,u){var l=this,S=this.getSourceBufferTypes().reduce(function(h,g){var C=l.sourceBuffer[g];return(!u.type||u.type===g)&&(C&&!C.ended&&(C.ended=!0,P.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),h&&!!(!C||C.ended)},!0);S&&this.blockBuffers(function(){var h=l.mediaSource;if(!h||h.readyState!=="open")return;h.endOfStream()})},b.onLevelUpdated=function(s,u){var l=u.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},b.flushBackBuffer=function(){var s=this.hls,u=this.details,l=this.media,S=this.sourceBuffer;if(!l||u===null)return;var h=this.getSourceBufferTypes();if(!h.length)return;var g=u.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(H.isFiniteNumber)(g)||g<0)return;var C=l.currentTime,y=u.levelTargetDuration,f=Math.max(g,y),c=Math.floor(C/y)*y-f;h.forEach(function(o){var a=S[o];if(a){var m=M.BufferHelper.getBuffered(a);m.length>0&&c>m.start(0)&&(s.trigger(k.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),u.live&&s.trigger(k.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),s.trigger(k.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:o}))}})},b.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,u=this.hls,l=this.media,S=this.mediaSource,h=s.fragments[0].start+s.totalduration,g=l.duration,C=Object(H.isFiniteNumber)(S.duration)?S.duration:0;s.live&&u.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(s)):(h>C&&h>g||!Object(H.isFiniteNumber)(g))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+h.toFixed(3)),S.duration=h)},b.updateSeekableRange=function(s){var u=this.mediaSource,l=s.fragments,S=l.length;if(S&&s.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var h=Math.max(0,l[0].start),g=Math.max(h,h+s.totalduration);u.setLiveSeekableRange(h,g)}},b.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,u=this.operationQueue,l=this.pendingTracks,S=Object.keys(l).length;if(S&&!s||S===2){this.createSourceBuffers(l),this.pendingTracks={};var h=this.getSourceBufferTypes();if(h.length===0){this.hls.trigger(k.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}h.forEach(function(g){u.executeNext(g)})}},b.createSourceBuffers=function(s){var u=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var h in s)if(!u[h]){var g=s[h];if(!g)throw Error("source buffer exists for track "+h+", however track does not");var C=g.levelCodec||g.codec,y=g.container+";codecs="+C;P.logger.log("[buffer-controller]: creating sourceBuffer("+y+")");try{var f=u[h]=l.addSourceBuffer(y),c=h;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[h]={buffer:f,codec:C,container:g.container,levelCodec:g.levelCodec,id:g.id},S++}catch(o){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(k.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:y})}}S&&this.hls.trigger(k.Events.BUFFER_CREATED,{tracks:this.tracks})},b._onSBUpdateStart=function(s){var u=this.operationQueue,l=u.current(s);l.onStart()},b._onSBUpdateEnd=function(s){var u=this.operationQueue,l=u.current(s);l.onComplete(),u.shiftAndExecuteNext(s)},b._onSBUpdateError=function(s,u){P.logger.error("[buffer-controller]: "+s+" SourceBuffer error",u),this.hls.trigger(k.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(s);l&&l.onError(u)},b.removeExecutor=function(s,u,l){var S=this.media,h=this.mediaSource,g=this.operationQueue,C=this.sourceBuffer,y=C[s];if(!S||!h||!y){P.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(s);return}var f=Object(H.isFiniteNumber)(S.duration)?S.duration:Infinity,c=Object(H.isFiniteNumber)(h.duration)?h.duration:Infinity,o=Math.max(0,u),a=Math.min(l,f,c);a>o?(P.logger.log("[buffer-controller]: Removing ["+o+","+a+"] from the "+s+" SourceBuffer"),console.assert(!y.updating,s+" sourceBuffer must not be updating"),y.remove(o,a)):g.shiftAndExecuteNext(s)},b.appendExecutor=function(s,u){var l=this.operationQueue,S=this.sourceBuffer,h=S[u];if(!h){P.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(u);return}h.ended=!1,console.assert(!h.updating,u+" sourceBuffer must not be updating"),h.appendBuffer(s)},b.blockBuffers=function(s,u){var l=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var S=this.operationQueue,h=u.map(function(g){return S.appendBlocker(g)});Promise.all(h).then(function(){s(),u.forEach(function(g){var C=l.sourceBuffer[g];(!C||!C.updating)&&S.shiftAndExecuteNext(g)})})},b.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},b.addBufferListener=function(s,u,l){var S=this.sourceBuffer[s];if(!S)return;var h=l.bind(this,s);this.listeners[s].push({event:u,listener:h}),S.addEventListener(u,h)},b.removeBufferListeners=function(s){var u=this.sourceBuffer[s];if(!u)return;this.listeners[s].forEach(function(l){u.removeEventListener(l.event,l.listener)})},_}()},"./src/controller/buffer-operation-queue.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return k});var H=L("./src/utils/logger.ts"),k=function(){function P(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var F=P.prototype;return F.append=function(D,R){var E=this.queues[R];E.push(D),E.length===1&&this.buffers[R]&&this.executeNext(R)},F.insertAbort=function(D,R){var E=this.queues[R];E.unshift(D),this.executeNext(R)},F.appendBlocker=function(D){var R,E=new Promise(function(T){R=T}),w={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(w,D),E},F.executeNext=function(D){var R=this.buffers,E=this.queues,w=R[D],T=E[D];if(T.length){var A=T[0];try{A.execute()}catch(_){H.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),A.onError(_),(!w||!w.updating)&&(T.shift(),this.executeNext(D))}}},F.shiftAndExecuteNext=function(D){this.queues[D].shift(),this.executeNext(D)},F.current=function(D){return this.queues[D][0]},P}()},"./src/controller/cap-level-controller.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/events.ts");function k(M,D){for(var R=0;R0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var w=this.hls;w.autoLevelCapping=this.getMaxLevel(E.length-1),w.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=w.autoLevelCapping}}},D.getMaxLevel=function(E){var w=this,T=this.hls.levels;if(!T.length)return-1;var A=T.filter(function(_,b){return M.isLevelAllowed(b,w.restrictedLevels)&&b<=E});return this.clientRect=null,M.getMaxLevelByMediaSize(A,this.mediaWidth,this.mediaHeight)},D.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()},D.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},D.getDimensions=function(){if(this.clientRect)return this.clientRect;var E=this.media,w={width:0,height:0};if(E){var T=E.getBoundingClientRect();w.width=T.width,w.height=T.height,!w.width&&!w.height&&(w.width=T.right-T.left||E.width||0,w.height=T.bottom-T.top||E.height||0)}return this.clientRect=w,w},M.isLevelAllowed=function(E,w){return w===void 0&&(w=[]),w.indexOf(E)===-1},M.getMaxLevelByMediaSize=function(E,w,T){if(!E||!E.length)return-1;for(var A=function(u,l){return l?u.width!==l.width||u.height!==l.height:!0},_=E.length-1,b=0;b=w||d.height>=T)&&A(d,E[b+1])){_=b;break}}return _},P(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var E=1;try{E=self.devicePixelRatio}catch(w){}return E}}]),M}();z.default=F},"./src/controller/cmcd-controller.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return A});var H=L("./src/events.ts"),k=L("./src/types/cmcd.ts"),P=L("./src/utils/buffer-helper.ts"),F=L("./src/utils/logger.ts");function M(_,b){for(var d=0;d=_.length?{done:!0}:{done:!1,value:_[s++]}}}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 E(_,b){if(!_)return;if(typeof _=="string")return w(_,b);var d=Object.prototype.toString.call(_).slice(8,-1);if(d==="Object"&&_.constructor&&(d=_.constructor.name),d==="Map"||d==="Set")return Array.from(_);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return w(_,b)}function w(_,b){(b==null||b>_.length)&&(b=_.length);for(var d=0,s=new Array(b);du&&(u=g.bitrate)}return u>0?u:NaN},b.getBufferLength=function(s){var u=this.hls.media,l=s===k.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!u)return NaN;var S=P.BufferHelper.bufferInfo(l,u.currentTime,this.config.maxBufferHole);return S.len*1e3},b.createPlaylistLoader=function(){var s=this.config.pLoader,u=this.applyPlaylistData,l=s||this.config.loader;return function(){function S(g){this.loader=void 0,this.loader=new l(g)}var h=S.prototype;return h.destroy=function(){this.loader.destroy()},h.abort=function(){this.loader.abort()},h.load=function(C,y,f){u(C),this.loader.load(C,y,f)},D(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},b.createFragmentLoader=function(){var s=this.config.fLoader,u=this.applyFragmentData,l=s||this.config.loader;return function(){function S(g){this.loader=void 0,this.loader=new l(g)}var h=S.prototype;return h.destroy=function(){this.loader.destroy()},h.abort=function(){this.loader.abort()},h.load=function(C,y,f){u(C),this.loader.load(C,y,f)},D(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},_.uuid=function(){var s=URL.createObjectURL(new Blob),u=s.toString();return URL.revokeObjectURL(s),u.substr(u.lastIndexOf("/")+1)},_.serialize=function(s){for(var u=[],l=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},S=function(U){return Math.round(U)},h=function(U){return S(U/100)*100},g=function(U){return encodeURIComponent(U)},C={br:S,d:S,bl:h,dl:h,mtp:h,nor:g,rtp:h,tb:S},y=Object.keys(s||{}).sort(),f=R(y),c;!(c=f()).done;){var o=c.value,a=s[o];if(!l(a))continue;if(o==="v"&&a===1)continue;if(o=="pr"&&a===1)continue;var m=C[o];m&&(a=m(a));var p=typeof a,v=void 0;o==="ot"||o==="sf"||o==="st"?v=o+"="+a:p==="boolean"?v=o:p==="number"?v=o+"="+a:v=o+"="+JSON.stringify(a),u.push(v)}return u.join(",")},_.toHeaders=function(s){for(var u=Object.keys(s),l={},S=["Object","Request","Session","Status"],h=[{},{},{},{}],g={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},C=0,y=u;CR){this.hls.trigger(H.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=R-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(u,l)}break}},_._generateLicenseRequestChallenge=function(d,s){switch(d.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},_._requestLicense=function(d,s){P.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(u.mediaKeySystemDomain),S=this._createLicenseXhr(l,d,s);P.logger.log("Sending license request to URL: "+l);var h=this._generateLicenseRequestChallenge(u,d);S.send(h)}catch(g){P.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(H.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},_.onMediaAttached=function(d,s){if(!this._emeEnabled)return;var u=s.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},_.onMediaDetached=function(){var d=this._media,s=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},_.onManifestParsed=function(d,s){if(!this._emeEnabled)return;var u=s.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),l=s.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(F.KeySystems.WIDEVINE,u,l)},D(A,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),A}();z.default=T},"./src/controller/fps-controller.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/events.ts"),k=L("./src/utils/logger.ts"),P=function(){function F(D){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=D,this.registerListeners()}var M=F.prototype;return M.setStreamController=function(R){this.streamController=R},M.registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(R,E){var w=this.hls.config;if(w.capLevelOnFPSDrop){var T=E.media instanceof self.HTMLVideoElement?E.media:null;this.media=T,T&&typeof T.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),w.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(R,E,w){var T=performance.now();if(E){if(this.lastTime){var A=T-this.lastTime,_=w-this.lastDroppedFrames,b=E-this.lastDecodedFrames,d=1e3*_/A,s=this.hls;if(s.trigger(H.Events.FPS_DROP,{currentDropped:_,currentDecoded:b,totalDroppedFrames:w}),d>0&&_>s.config.fpsDroppedMonitoringThreshold*b){var u=s.currentLevel;k.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=u)&&(u=u-1,s.trigger(H.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:s.currentLevel}),s.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=T,this.lastDroppedFrames=w,this.lastDecodedFrames=E}},M.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var E=R.getVideoPlaybackQuality();this.checkFPS(R,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},F}();z.default=P},"./src/controller/fragment-finders.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"findFragmentByPDT",function(){return P}),L.d(z,"findFragmentByPTS",function(){return F}),L.d(z,"fragmentWithinToleranceTest",function(){return M}),L.d(z,"pdtWithinToleranceTest",function(){return D}),L.d(z,"findFragWithCC",function(){return R});var H=L("./src/polyfills/number.ts"),k=L("./src/utils/binary-search.ts");function P(E,w,T){if(w===null||!Array.isArray(E)||!E.length||!Object(H.isFiniteNumber)(w))return null;var A=E[0].programDateTime;if(w<(A||0))return null;var _=E[E.length-1].endProgramDateTime;if(w>=(_||0))return null;T=T||0;for(var b=0;bE&&T.start?-1:0}function D(E,w,T){var A=Math.min(w,T.duration+(T.deltaPTS?T.deltaPTS:0))*1e3,_=T.endProgramDateTime||0;return _-A>E}function R(E,w){return k.default.search(E,function(T){return T.ccw?-1:0})}},"./src/controller/fragment-tracker.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"FragmentState",function(){return P}),L.d(z,"FragmentTracker",function(){return F});var H=L("./src/events.ts"),k=L("./src/types/loader.ts"),P;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(P||(P={}));var F=function(){function R(w){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=w,this._registerListeners()}var E=R.prototype;return E._registerListeners=function(){var T=this.hls;T.on(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),T.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),T.on(H.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var T=this.hls;T.off(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),T.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),T.off(H.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(T,A){if(A===k.PlaylistLevelType.MAIN){var _=this.activeFragment,b=this.activeParts;if(!_)return null;if(b)for(var d=b.length;d--;){var s=b[d],u=s?s.end:_.appendedPTS;if(s.start<=T&&u!==void 0&&T<=u)return d>9&&(this.activeParts=b.slice(d-9)),s}else if(_.start<=T&&_.appendedPTS!==void 0&&T<=_.appendedPTS)return _}return this.getBufferedFrag(T,A)},E.getBufferedFrag=function(T,A){for(var _=this.fragments,b=Object.keys(_),d=b.length;d--;){var s=_[b[d]];if((s==null?void 0:s.body.type)===A&&s.buffered){var u=s.body;if(u.start<=T&&T<=u.end)return u}}return null},E.detectEvictedFragments=function(T,A,_){var b=this;Object.keys(this.fragments).forEach(function(d){var s=b.fragments[d];if(!s)return;if(!s.buffered){s.body.type===_&&b.removeFragment(s.body);return}var u=s.range[T];if(!u)return;u.time.some(function(l){var S=!b.isTimeBuffered(l.startPTS,l.endPTS,A);return S&&b.removeFragment(s.body),S})})},E.detectPartialFragments=function(T){var A=this,_=this.timeRanges,b=T.frag,d=T.part;if(!_||b.sn==="initSegment")return;var s=D(b),u=this.fragments[s];if(!u)return;Object.keys(_).forEach(function(l){var S=b.elementaryStreams[l];if(!S)return;var h=_[l],g=d!==null||S.partial===!0;u.range[l]=A.getBufferedTimes(b,d,g,h)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},E.fragBuffered=function(T){var A=D(T),_=this.fragments[A];_&&(_.backtrack=_.loaded=null,_.buffered=!0)},E.getBufferedTimes=function(T,A,_,b){for(var d={time:[],partial:_},s=A?A.start:T.start,u=A?A.end:T.end,l=T.minEndPTS||u,S=T.maxStartPTS||s,h=0;h=g&&l<=C){d.time.push({startPTS:Math.max(s,b.start(h)),endPTS:Math.min(u,b.end(h))});break}else if(sg)d.partial=!0,d.time.push({startPTS:Math.max(s,b.start(h)),endPTS:Math.min(u,b.end(h))});else if(u<=g)break}return d},E.getPartialFragment=function(T){var A=null,_,b,d,s=0,u=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(S){var h=l[S];if(!h)return;M(h)&&(b=h.body.start-u,d=h.body.end+u,T>=b&&T<=d&&(_=Math.min(T-b,d-T),s<=_&&(A=h.body,s=_)))}),A},E.getState=function(T){var A=D(T),_=this.fragments[A];return _?_.buffered?M(_)?P.PARTIAL:P.OK:_.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},E.backtrack=function(T,A){var _=D(T),b=this.fragments[_];if(!b||b.backtrack)return null;var d=b.backtrack=A||b.loaded;return b.loaded=null,d},E.getBacktrackData=function(T){var A=D(T),_=this.fragments[A];if(_){var b,d=_.backtrack;if(d!=null&&(b=d.payload)!==null&&b!==void 0&&b.byteLength)return d;this.removeFragment(T)}return null},E.isTimeBuffered=function(T,A,_){for(var b,d,s=0;s<_.length;s++){if(b=_.start(s)-this.bufferPadding,d=_.end(s)+this.bufferPadding,T>=b&&A<=d)return!0;if(A<=b)return!1}return!1},E.onFragLoaded=function(T,A){var _=A.frag,b=A.part;if(_.sn==="initSegment"||_.bitrateTest||b)return;var d=D(_);this.fragments[d]={body:_,loaded:A,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(T,A){var _=this,b=A.frag,d=A.part,s=A.timeRanges;if(b.type===k.PlaylistLevelType.MAIN)if(this.activeFragment=b,d){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(d)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(l){var S=s[l];if(_.detectEvictedFragments(l,S),!d)for(var h=0;hT&&b.removeFragment(u)}})},E.removeFragment=function(T){var A=D(T);T.stats.loaded=0,T.clearElementaryStreamInfo(),delete this.fragments[A]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function M(R){var E,w;return R.buffered&&(((E=R.range.video)===null||E===void 0?void 0:E.partial)||((w=R.range.audio)===null||w===void 0?void 0:w.partial))}function D(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"STALL_MINIMUM_DURATION_MS",function(){return M}),L.d(z,"MAX_START_GAP_JUMP",function(){return D}),L.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),L.d(z,"SKIP_BUFFER_RANGE_START",function(){return E}),L.d(z,"default",function(){return w});var H=L("./src/utils/buffer-helper.ts"),k=L("./src/errors.ts"),P=L("./src/events.ts"),F=L("./src/utils/logger.ts"),M=250,D=2,R=.1,E=.05,w=function(){function T(_,b,d,s){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=_,this.media=b,this.fragmentTracker=d,this.hls=s}var A=T.prototype;return A.destroy=function(){this.hls=this.fragmentTracker=this.media=null},A.poll=function(b){var d=this.config,s=this.media,u=this.stalled,l=s.currentTime,S=s.seeking,h=this.seeking&&!S,g=!this.seeking&&S;if(this.seeking=S,l!==b){if(this.moved=!0,u!==null){if(this.stallReported){var C=self.performance.now()-u;F.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(C)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||h)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!H.BufferHelper.getBuffered(s).length)return;var y=H.BufferHelper.bufferInfo(s,l,0),f=y.len>0,c=y.nextStart||0;if(!f&&!c)return;if(S){var o=y.len>D,a=!c||c-l>D&&!this.fragmentTracker.getPartialFragment(l);if(o||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var m,p=Math.max(c,y.start||0)-l,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,O=v==null||((m=v.details)===null||m===void 0)?void 0:m.live,U=O?v.details.targetduration*2:D;if(p>0&&p<=U){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(u===null){this.stalled=j;return}var G=j-u;!S&&G>=M&&this._reportStall(y.len);var B=H.BufferHelper.bufferInfo(s,l,d.maxBufferHole);this._tryFixBufferStall(B,G)},A._tryFixBufferStall=function(b,d){var s=this.config,u=this.fragmentTracker,l=this.media,S=l.currentTime,h=u.getPartialFragment(S);if(h){var g=this._trySkipBufferHole(h);if(g)return}b.len>s.maxBufferHole&&d>s.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},A._reportStall=function(b){var d=this.hls,s=this.media,u=this.stallReported;u||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+b+")"),d.trigger(P.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:b}))},A._trySkipBufferHole=function(b){for(var d=this.config,s=this.hls,u=this.media,l=u.currentTime,S=0,h=H.BufferHelper.getBuffered(u),g=0;g=S&&l.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,s)),C=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;T.playbackRate=Math.min(g,Math.max(1,C))}else T.playbackRate!==1&&T.playbackRate!==0&&(T.playbackRate=1)},E.estimateLiveEdge=function(){var T=this.levelDetails;return T===null?null:T.edge+T.age},E.computeLatency=function(){var T=this.estimateLiveEdge();return T===null?null:T-this.currentTime},M(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var T=this.config,A=this.levelDetails;return T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:A?T.liveMaxLatencyDurationCount*A.targetduration:0}},{key:"targetLatency",get:function(){var T=this.levelDetails;if(T===null)return null;var A=T.holdBack,_=T.partHoldBack,b=T.targetduration,d=this.config,s=d.liveSyncDuration,u=d.liveSyncDurationCount,l=d.lowLatencyMode,S=this.hls.userConfig,h=l&&_||A;(S.liveSyncDuration||S.liveSyncDurationCount||h===0)&&(h=s!==void 0?s:u*b);var g=b,C=1;return h+Math.min(this.stallCount*C,g)}},{key:"liveSyncPosition",get:function(){var T=this.estimateLiveEdge(),A=this.targetLatency,_=this.levelDetails;if(T===null||A===null||_===null)return null;var b=_.edge,d=T-A-this.edgeStalled,s=b-_.totalduration,u=b-(this.config.lowLatencyMode&&_.partTarget||_.targetduration);return Math.min(Math.max(s,d),u)}},{key:"drift",get:function(){var T=this.levelDetails;return T===null?1:T.drift}},{key:"edgeStalled",get:function(){var T=this.levelDetails;if(T===null)return 0;var A=(this.config.lowLatencyMode&&T.partTarget||T.targetduration)*3;return Math.max(T.age-A,0)}},{key:"forwardBufferLength",get:function(){var T=this.media,A=this.levelDetails;if(!T||!A)return 0;var _=T.buffered.length;return _?T.buffered.end(_-1):A.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return d});var H=L("./src/types/level.ts"),k=L("./src/events.ts"),P=L("./src/errors.ts"),F=L("./src/utils/codecs.ts"),M=L("./src/controller/level-helper.ts"),D=L("./src/controller/base-playlist-controller.ts"),R=L("./src/types/loader.ts");function E(){return E=Object.assign||function(s){for(var u=1;u0){c=C[0].bitrate,C.sort(function(G,B){return G.bitrate-B.bitrate}),this._levels=C;for(var O=0;Othis.hls.config.fragLoadingMaxRetry&&(o=g.frag.level)):o=g.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(c=!1),o=C.level),f=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:o=g.level,f=!0;break}o!==void 0&&this.recoverLevel(g,o,f,c)},l.recoverLevel=function(h,g,C,y){var f=h.details,c=this._levels[g];if(c.loadError++,C){var o=this.retryLoadingOrFail(h);if(o)h.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(y){var a=c.url.length;if(a>1&&c.loadError1){var y=(g.urlId+1)%C;this.warn("Switching to redundant URL-id "+y),this._levels.forEach(function(f){f.urlId=y}),this.level=h}},l.onFragLoaded=function(h,g){var C=g.frag;if(C!==void 0&&C.type===R.PlaylistLevelType.MAIN){var y=this._levels[C.level];y!==void 0&&(y.fragmentError=0,y.loadError=0)}},l.onLevelLoaded=function(h,g){var C,y=g.level,f=g.details,c=this._levels[y];if(!c){var o;this.warn("Invalid level index "+y),(o=g.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(f.deltaUpdateFailed=!0);return}y===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(y,g,c.details)):(C=g.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(f.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(h,g){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var y=-1,f=this.hls.audioTracks[g.id].groupId,c=0;c0){var y=C.urlId,f=C.url[y];if(h)try{f=h.addDirectives(f)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+g+(h?" at sn "+h.msn+" part "+h.part:"")+" with URL-id "+y+" "+f),this.clearTimer(),this.hls.trigger(k.Events.LEVEL_LOADING,{url:f,level:g,id:y,deliveryDirectives:h||null})}},l.removeLevel=function(h,g){var C=function(c,o){return o!==g},y=this._levels.filter(function(f,c){return c!==h?!0:f.url.length>1&&g!==void 0?(f.url=f.url.filter(C),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(C)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(C)),f.urlId=0,!0):!1}).map(function(f,c){var o=f.details;return o!=null&&o.fragments&&o.fragments.forEach(function(a){a.level=c}),f});this._levels=y,this.hls.trigger(k.Events.LEVELS_UPDATED,{levels:y})},T(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(h){var g,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===h&&(g=C[h])!==null&&g!==void 0&&g.details)return;if(h<0||h>=C.length){var y=h<0;if(this.hls.trigger(k.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:h,fatal:y,reason:"invalid level idx"}),y)return;h=Math.min(h,C.length-1)}this.clearTimer();var f=this.currentLevelIndex,c=C[f],o=C[h];this.log("switching to level "+h+" from "+f),this.currentLevelIndex=h;var a=E({},o,{level:h,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete a._urlId,this.hls.trigger(k.Events.LEVEL_SWITCHING,a);var m=o.details;if(!m||m.live){var p=this.switchParams(o.uri,c==null?void 0:c.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(h){this.manualLevelIndex=h,this._startLevel===void 0&&(this._startLevel=h),h!==-1&&(this.level=h)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(h){this._firstLevel=h}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var h=this.hls.config.startLevel;return h!==void 0?h:this._firstLevel}else return this._startLevel},set:function(h){this._startLevel=h}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(h){this.level=h,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=h)}}]),u}(D.default)},"./src/controller/level-helper.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"addGroupId",function(){return P}),L.d(z,"assignTrackIdsByGroup",function(){return F}),L.d(z,"updatePTS",function(){return M}),L.d(z,"updateFragPTSDTS",function(){return R}),L.d(z,"mergeDetails",function(){return E}),L.d(z,"mapPartIntersection",function(){return w}),L.d(z,"mapFragmentIntersection",function(){return T}),L.d(z,"adjustSliding",function(){return A}),L.d(z,"addSliding",function(){return _}),L.d(z,"computeReloadInterval",function(){return b}),L.d(z,"getFragmentWithSN",function(){return d}),L.d(z,"getPartWith",function(){return s});var H=L("./src/polyfills/number.ts"),k=L("./src/utils/logger.ts");function P(u,l,S){switch(l){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(S);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(S);break}}function F(u){var l={};u.forEach(function(S){var h=S.groupId||"";S.id=l[h]=l[h]||0,l[h]++})}function M(u,l,S){var h=u[l],g=u[S];D(h,g)}function D(u,l){var S=l.startPTS;if(Object(H.isFiniteNumber)(S)){var h=0,g;l.sn>u.sn?(h=S-u.start,g=u):(h=u.start-S,g=l),g.duration!==h&&(g.duration=h)}else if(l.sn>u.sn){var C=u.cc===l.cc;C&&u.minEndPTS?l.start=u.start+(u.minEndPTS-u.start):l.start=u.start+u.duration}else l.start=Math.max(u.start-l.duration,0)}function R(u,l,S,h,g,C){var y=h-S;y<=0&&(k.logger.warn("Fragment should have a positive duration",l),h=S+l.duration,C=g+l.duration);var f=S,c=h,o=l.startPTS,a=l.endPTS;if(Object(H.isFiniteNumber)(o)){var m=Math.abs(o-S);Object(H.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(m,l.deltaPTS):l.deltaPTS=m,f=Math.max(S,o),S=Math.min(S,o),g=Math.min(g,l.startDTS),c=Math.min(h,a),h=Math.max(h,a),C=Math.max(C,l.endDTS)}l.duration=h-S;var p=S-l.start;l.appendedPTS=h,l.start=l.startPTS=S,l.maxStartPTS=f,l.startDTS=g,l.endPTS=h,l.minEndPTS=c,l.endDTS=C;var v=l.sn;if(!u||vu.endSN)return 0;var O,U=v-u.startSN,j=u.fragments;for(j[U]=l,O=U;O>0;O--)D(j[O],j[O-1]);for(O=U;O=0;g--){var C=h[g].initSegment;if(C){S=C;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var y=0,f;if(T(u,l,function(O,U){O.relurl&&(y=O.cc-U.cc),Object(H.isFiniteNumber)(O.startPTS)&&Object(H.isFiniteNumber)(O.endPTS)&&(U.start=U.startPTS=O.startPTS,U.startDTS=O.startDTS,U.appendedPTS=O.appendedPTS,U.maxStartPTS=O.maxStartPTS,U.endPTS=O.endPTS,U.endDTS=O.endDTS,U.minEndPTS=O.minEndPTS,U.duration=O.endPTS-O.startPTS,U.duration&&(f=U),l.PTSKnown=l.alignedSliding=!0),U.elementaryStreams=O.elementaryStreams,U.loader=O.loader,U.stats=O.stats,U.urlId=O.urlId,O.initSegment&&(U.initSegment=O.initSegment,S=O.initSegment)}),S){var c=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;c.forEach(function(O){var U;(!O.initSegment||O.initSegment.relurl===((U=S)===null||U===void 0?void 0:U.relurl))&&(O.initSegment=S)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(O){return!O}),l.deltaUpdateFailed)){k.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var o=l.skippedSegments;o--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var a=l.fragments;if(y){k.logger.warn("discontinuity sliding from playlist, take drift into account");for(var m=0;m=h.length)return;_(l,h[S].start)}function _(u,l){if(l){for(var S=u.fragments,h=u.skippedSegments;h0&&g0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),c=o),this.state=k.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=k.State.STOPPED},y.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},y.doTick=function(){switch(this.state){case k.State.IDLE:this.doTickIdle();break;case k.State.WAITING_LEVEL:{var c,o=this.levels,a=this.level,m=o==null||((c=o[a])===null||c===void 0)?void 0:c.details;if(m&&(!m.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(m))break;this.state=k.State.IDLE;break}break}case k.State.FRAG_LOADING_WAITING_RETRY:{var p,v=self.performance.now(),O=this.retryDate;(!O||v>=O||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=k.State.IDLE)}break;default:break}this.onTickEnd()},y.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},y.doTickIdle=function(){var c,o,a=this.hls,m=this.levelLastLoaded,p=this.levels,v=this.media,O=a.config,U=a.nextLoadLevel;if(m===null||!v&&(this.startFragRequested||!O.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[U])return;var j=p[U];this.level=a.nextLoadLevel=U;var G=j.details;if(!G||this.state===k.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==U){this.state=k.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,R.PlaylistLevelType.MAIN);if(B===null)return;var N=B.len,V=this.getMaxBufferLength(j.maxBitrate);if(N>=V)return;if(this._streamEnded(B,G)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,$),this.state=k.State.ENDED;return}var ie=B.end,oe=this.getNextFragment(ie,G);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var _e=oe.sn-G.startSN;_e>1&&(oe=G.fragments[_e-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===D.FragmentState.OK&&this.nextLoadPosition>ie){var fe=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,fe,R.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,G)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((c=oe.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((o=oe.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(oe,G):this.loadFragment(oe,G,ie)},y.loadFragment=function(c,o,a){var m,p=this.fragmentTracker.getState(c);if(this.fragCurrent=c,p===D.FragmentState.BACKTRACKED){var v=this.fragmentTracker.getBacktrackData(c);if(v){this._handleFragmentLoadProgress(v),this._handleFragmentLoadComplete(v);return}else p=D.FragmentState.NOT_LOADED}p===D.FragmentState.NOT_LOADED||p===D.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,c,o,a)):p===D.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((m=this.media)===null||m===void 0?void 0:m.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},y.getAppendedFrag=function(c){var o=this.fragmentTracker.getAppendedFrag(c,R.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},y.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,R.PlaylistLevelType.MAIN)},y.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},y.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},y.nextLevelSwitch=function(){var c=this.levels,o=this.media;if(o!=null&&o.readyState){var a,m=this.getAppendedFrag(o.currentTime);if(m&&m.start>1&&this.flushMainBuffer(0,m.start-1),!o.paused&&c){var p=this.hls.nextLoadLevel,v=c[p],O=this.fragLastKbps;O&&this.fragCurrent?a=this.fragCurrent.duration*v.maxBitrate/(1e3*O)+1:a=0}else a=0;var U=this.getBufferedFrag(o.currentTime+a);if(U){var j=this.followingBufferedFrag(U);if(j){this.abortCurrentFrag();var G=j.maxStartPTS?j.maxStartPTS:j.start,B=j.duration,N=Math.max(U.end,G+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},y.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===k.State.KEY_LOADING&&(this.state=k.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},y.flushMainBuffer=function(c,o){g.prototype.flushMainBuffer.call(this,c,o,this.altAudio?"video":null)},y.onMediaAttached=function(c,o){g.prototype.onMediaAttached.call(this,c,o);var a=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new A.default(this.config,a,this.fragmentTracker,this.hls)},y.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),g.prototype.onMediaDetaching.call(this)},y.onMediaPlaying=function(){this.tick()},y.onMediaSeeked=function(){var c=this.media,o=c?c.currentTime:null;Object(H.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},y.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(F.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},y.onManifestParsed=function(c,o){var a=!1,m=!1,p;o.levels.forEach(function(v){p=v.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(a=!0),p.indexOf("mp4a.40.5")!==-1&&(m=!0))}),this.audioCodecSwitch=a&&m&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=o.levels,this.startFragRequested=!1},y.onLevelLoading=function(c,o){var a=this.levels;if(!a||this.state!==k.State.IDLE)return;var m=a[o.level];(!m.details||m.details.live&&this.levelLastLoaded!==o.level||this.waitForCdnTuneIn(m.details))&&(this.state=k.State.WAITING_LEVEL)},y.onLevelLoaded=function(c,o){var a,m=this.levels,p=o.level,v=o.details,O=v.totalduration;if(!m){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+v.startSN+","+v.endSN+"], cc ["+v.startCC+", "+v.endCC+"] duration:"+O);var U=this.fragCurrent;U&&(this.state===k.State.FRAG_LOADING||this.state===k.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==o.level&&U.loader&&(this.state=k.State.IDLE,U.loader.abort()));var j=m[p],G=0;if(v.live||(a=j.details)!==null&&a!==void 0&&a.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;G=this.alignPlaylists(v,j.details)}if(j.details=v,this.levelLastLoaded=p,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:v,level:p}),this.state===k.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=k.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,G),this.tick()},y._handleFragmentLoadProgress=function(c){var o,a=c.frag,m=c.part,p=c.payload,v=this.levels;if(!v){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var O=v[a.level],U=O.details;if(!U){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var j=O.videoCodec,G=U.PTSKnown||!U.live,B=(o=a.initSegment)===null||o===void 0?void 0:o.data,N=this._getAudioCodec(O),V=this.transmuxer=this.transmuxer||new w.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=m?m.index:-1,ie=$!==-1,oe=new T.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,p.byteLength,$,ie),_e=this.initPTS[a.cc];V.push(p,B,N,j,a,m,U.totalduration,G,oe,_e)},y.onAudioTrackSwitching=function(c,o){var a=this.altAudio,m=!!o.url,p=o.id;if(!m){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var v=this.fragCurrent;v!=null&&v.loader&&(this.log("Switching to main audio track, cancel main fragment load"),v.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var O=this.hls;a&&O.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),O.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:p})}},y.onAudioTrackSwitched=function(c,o){var a=o.id,m=!!this.hls.audioTracks[a].url;if(m){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=m,this.tick()},y.onBufferCreated=function(c,o){var a=o.tracks,m,p,v=!1;for(var O in a){var U=a[O];if(U.id==="main"){if(p=O,m=U,O==="video"){var j=a[O];j&&(this.videoBuffer=j.buffer)}}else v=!0}v&&m?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=m.buffer):this.mediaBuffer=this.media},y.onFragBuffered=function(c,o){var a=o.frag,m=o.part;if(a&&a.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(m?" p: "+m.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===k.State.PARSED&&(this.state=k.State.IDLE);return}var p=m?m.stats:a.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,m)},y.onError=function(c,o){switch(o.details){case _.ErrorDetails.FRAG_LOAD_ERROR:case _.ErrorDetails.FRAG_LOAD_TIMEOUT:case _.ErrorDetails.KEY_LOAD_ERROR:case _.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,o);break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.State.ERROR&&(o.fatal?(this.warn(""+o.details),this.state=k.State.ERROR):!o.levelRetry&&this.state===k.State.WAITING_LEVEL&&(this.state=k.State.IDLE));break;case _.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="main"&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var a=!0,m=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);m&&m.len>.5&&(a=!this.reduceMaxBufferLength(m.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},y.checkBuffer=function(){var c=this.media,o=this.gapController;if(!c||!o||!c.readyState)return;var a=M.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):o.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},y.onFragLoadEmergencyAborted=function(){this.state=k.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},y.onBufferFlushed=function(c,o){var a=o.type;if(a!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var m=(a===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(m,a,R.PlaylistLevelType.MAIN)}},y.onLevelsUpdated=function(c,o){this.levels=o.levels},y.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},y.seekToStartPos=function(){var c=this.media,o=c.currentTime,a=this.startPosition;if(a>=0&&o0&&(v1&&c.seeking===!1){var a=c.currentTime;if(M.BufferHelper.isBuffered(c,a)?o=this.getAppendedFrag(a):M.BufferHelper.isBuffered(c,a+.1)&&(o=this.getAppendedFrag(a+.1)),o){var m=this.fragPlaying,p=o.level;(!m||o.sn!==m.sn||m.level!==p||o.urlId!==m.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:o}),(!m||m.level!==p)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=o)}}},s(C,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var o=this.getAppendedFrag(c.currentTime);if(o)return o.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var o=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(o)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(k.default)},"./src/controller/subtitle-stream-controller.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"SubtitleStreamController",function(){return u});var H=L("./src/events.ts"),k=L("./src/utils/logger.ts"),P=L("./src/utils/buffer-helper.ts"),F=L("./src/controller/fragment-finders.ts"),M=L("./src/utils/discontinuities.ts"),D=L("./src/controller/level-helper.ts"),R=L("./src/controller/fragment-tracker.ts"),E=L("./src/controller/base-stream-controller.ts"),w=L("./src/types/loader.ts"),T=L("./src/types/level.ts");function A(l,S){for(var h=0;h=o[p].start&&m<=o[p].end){a=o[p];break}var v=f.start+f.duration;a?a.end=v:(a={start:m,end:v},o.push(a)),this.fragmentTracker.fragBuffered(f)},h.onBufferFlushing=function(C,y){var f=y.startOffset,c=y.endOffset;if(f===0&&c!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,a=this.levels;if(!a.length||!a[o]||!a[o].details)return;var m=a[o].details,p=m.targetduration,v=c-p;if(v<=0)return;y.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(O){for(var U=0;U=m.length||o!==a||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(f=p.details)!==null&&f!==void 0&&f.live){var v=this.mainDetails;if(c.deltaUpdateFailed||!v)return;var O=v.fragments[0];if(!p.details)c.hasProgramDateTime&&v.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(c,v):O&&Object(D.addSliding)(c,O.start);else{var U=this.alignPlaylists(c,p.details);U===0&&O&&Object(D.addSliding)(c,O.start)}}if(p.details=c,this.levelLastLoaded=o,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var j=Object(F.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},h._handleFragmentLoadComplete=function(C){var y=C.frag,f=C.payload,c=y.decryptdata,o=this.hls;if(this.fragContextChanged(y))return;if(f&&f.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),c.key.buffer,c.iv.buffer).then(function(m){var p=performance.now();o.trigger(H.Events.FRAG_DECRYPTED,{frag:y,payload:m,stats:{tstart:a,tdecrypt:p}})})}},h.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var C,y=this.currentTrackId,f=this.levels;if(!f.length||!f[y]||!f[y].details)return;var c=f[y].details,o=c.targetduration,a=this.config,m=this.media,p=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,m.currentTime-o,a.maxBufferHole),v=p.end,O=p.len,U=this.getMaxBufferLength()+o;if(O>U)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var j=c.fragments,G=j.length,B=c.edge,N,V=this.fragPrevious;if(v-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)},b.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},b.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 s=T(this.media.textTracks);s.forEach(function(u){Object(k.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},b.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},b.onManifestParsed=function(s,u){this.tracks=u.subtitleTracks},b.onSubtitleTrackLoaded=function(s,u){var l=u.id,S=u.details,h=this.trackId,g=this.tracksInGroup[h];if(!g){this.warn("Invalid subtitle track id "+l);return}var C=g.details;g.details=u.details,this.log("subtitle track "+l+" loaded ["+S.startSN+"-"+S.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,u,C))},b.onLevelLoading=function(s,u){this.switchLevel(u.level)},b.onLevelSwitching=function(s,u){this.switchLevel(u.level)},b.switchLevel=function(s){var u=this.hls.levels[s];if(!(u!=null&&u.textGroupIds))return;var l=u.textGroupIds[u.urlId];if(this.groupId!==l){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,h=this.tracks.filter(function(y){return!l||y.groupId===l});this.tracksInGroup=h;var g=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=l;var C={subtitleTracks:h};this.log("Updating subtitle tracks, "+h.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(H.Events.SUBTITLE_TRACKS_UPDATED,C),g!==-1&&this.setSubtitleTrack(g,S)}},b.findTrackId=function(s){for(var u=this.tracksInGroup,l=0;l=S.length)return;this.clearTimer();var h=S[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,h){var g=h.id,C=h.groupId,y=C===void 0?"":C,f=h.name,c=h.type,o=h.url;this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:y,name:f,type:c,url:o});var a=this.switchParams(h.url,u==null?void 0:u.details);this.loadPlaylist(a)}else this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:s})},b.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,u=T(this.media.textTracks),l=0;l=0&&(c[0]=Math.min(c[0],S),c[1]=Math.max(c[1],h),y=!0,o/(h-S)>.5))return}if(y||C.push([S,h]),this.config.renderTextTracksNatively){var a=this.captionsTracks[l];this.Cues.newCue(a,S,h,g)}else{var m=this.Cues.newCue(null,S,h,g);this.hls.trigger(k.Events.CUES_PARSED,{type:"captions",cues:m,track:l})}},s.onInitPtsFound=function(l,S){var h=this,g=S.frag,C=S.id,y=S.initPTS,f=S.timescale,c=this.unparsedVttFrags;C==="main"&&(this.initPTS[g.cc]=y,this.timescale[g.cc]=f),c.length&&(this.unparsedVttFrags=[],c.forEach(function(o){h.onFragLoaded(k.Events.FRAG_LOADED,o)}))},s.getExistingTrack=function(l){var S=this.media;if(S)for(var h=0;h>>8^f&255^99,R[g]=f,E[f]=g;var c=h[g],o=h[c],a=h[o],m=h[f]*257^f*16843008;T[g]=m<<24|m>>>8,A[g]=m<<16|m>>>16,_[g]=m<<8|m>>>24,b[g]=m,m=a*16843009^o*65537^c*257^g*16843008,s[f]=m<<24|m>>>8,u[f]=m<<16|m>>>16,l[f]=m<<8|m>>>24,S[f]=m,g?(g=c^h[h[h[a^c]]],C^=h[h[C]]):g=C=1}},M.expandKey=function(R){for(var E=this.uint8ArrayToUint32Array_(R),w=!0,T=0;T>>6)+1;var m=(l[S+2]&60)>>>2;if(m>a.length-1){u.trigger(P.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+m});return}return y=(l[S+2]&1)<<2,y|=(l[S+3]&192)>>>6,H.logger.log("manifest codec:"+h+", ADTS type:"+g+", samplingIndex:"+m),/firefox/i.test(c)?m>=6?(g=5,f=new Array(4),C=m-3):(g=2,f=new Array(2),C=m):c.indexOf("android")!==-1?(g=2,f=new Array(2),C=m):(g=5,f=new Array(4),h&&(h.indexOf("mp4a.40.29")!==-1||h.indexOf("mp4a.40.5")!==-1)||!h&&m>=6?C=m-3:((h&&h.indexOf("mp4a.40.2")!==-1&&(m>=6&&y===1||/vivaldi/i.test(c))||!h&&y===1)&&(g=2,f=new Array(2)),C=m)),f[0]=g<<3,f[0]|=(m&14)>>1,f[1]|=(m&1)<<7,f[1]|=y<<3,g===5&&(f[1]|=(C&14)>>1,f[2]=(C&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:a[m],channelCount:y,codec:"mp4a.40."+g,manifestCodec:o}}function M(u,l){return u[l]===255&&(u[l+1]&246)===240}function D(u,l){return u[l+1]&1?7:9}function R(u,l){return(u[l+3]&3)<<11|u[l+4]<<3|(u[l+5]&224)>>>5}function E(u,l){return l+5=u.length)return!1;var h=R(u,l);if(h<=S)return!1;var g=l+h;return g===u.length||w(u,g)}return!1}function _(u,l,S,h,g){if(!u.samplerate){var C=F(l,S,h,g);if(!C)return;u.config=C.config,u.samplerate=C.samplerate,u.channelCount=C.channelCount,u.codec=C.codec,u.manifestCodec=C.manifestCodec,H.logger.log("parsed codec:"+u.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function b(u){return 1024*9e4/u}function d(u,l,S,h,g){var C=D(u,l),y=R(u,l);if(y-=C,y>0){var f=S+h*g;return{headerLength:C,frameLength:y,stamp:f}}}function s(u,l,S,h,g){var C=b(u.samplerate),y=d(l,S,h,g,C);if(y){var f=y.frameLength,c=y.headerLength,o=y.stamp,a=c+f,m=Math.max(0,S+a-l.length),p;m?(p=new Uint8Array(a-c),p.set(l.subarray(S+c,l.length),0)):p=l.subarray(S+c,S+a);var v={unit:p,pts:o};return m||u.samples.push(v),{sample:v,length:a,missing:m}}}},"./src/demux/base-audio-demuxer.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"initPTSFn",function(){return R});var H=L("./src/polyfills/number.ts"),k=L("./src/demux/id3.ts"),P=L("./src/demux/dummy-demuxed-track.ts"),F=L("./src/utils/mp4-tools.ts"),M=L("./src/utils/typed-array.ts"),D=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var w=E.prototype;return w.resetInitSegment=function(A,_,b){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},w.resetTimeStamp=function(){},w.resetContiguity=function(){},w.canParse=function(A,_){return!1},w.appendFrame=function(A,_,b){},w.demux=function(A,_){this.cachedData&&(A=Object(F.appendUint8Array)(this.cachedData,A),this.cachedData=null);var b=k.getID3Data(A,0),d=b?b.length:0,s,u,l=this._audioTrack,S=this._id3Track,h=b?k.getTimeStamp(b):void 0,g=A.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(h,_)),b&&b.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:b}),u=this.initPTS;dD?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,R=D>>3,D-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},F.readBits=function(D){var R=Math.min(this.bitsAvailable,D),E=this.word>>>32-R;return D>32&&H.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=D-R,R>0&&this.bitsAvailable?E<>>D)!==0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},F.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},F.readBoolean=function(){return this.readBits(1)===1},F.readUByte=function(){return this.readBits(8)},F.readUShort=function(){return this.readBits(16)},F.readUInt=function(){return this.readBits(32)},F.skipScalingList=function(D){for(var R=8,E=8,w,T=0;T0?g.subarray(y,y+f):void 0},F=function(g,C){var y=0;return y=(g[C]&127)<<21,y|=(g[C+1]&127)<<14,y|=(g[C+2]&127)<<7,y|=g[C+3]&127,y},M=function(g,C){return H(g,C)&&F(g,C+6)+10<=g.length-C},D=function(g){for(var C=w(g),y=0;y>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:v+=String.fromCharCode(a);break;case 12:case 13:m=g[O++],v+=String.fromCharCode((a&31)<<6|m&63);break;case 14:m=g[O++],p=g[O++],v+=String.fromCharCode((a&15)<<12|(m&63)<<6|(p&63)<<0);break;default:}}return v},u={decodeTextFrame:_},l;function S(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/demux/base-audio-demuxer.ts"),k=L("./src/demux/id3.ts"),P=L("./src/utils/logger.ts"),F=L("./src/demux/mpegaudio.ts");function M(E,w){E.prototype=Object.create(w.prototype),E.prototype.constructor=E,D(E,w)}function D(E,w){return D=Object.setPrototypeOf||function(A,_){return A.__proto__=_,A},D(E,w)}var R=function(E){M(w,E);function w(){return E.apply(this,arguments)||this}var T=w.prototype;return T.resetInitSegment=function(_,b,d){E.prototype.resetInitSegment.call(this,_,b,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:_,duration:d,inputTimeScale:9e4,dropped:0}},w.probe=function(_){if(!_)return!1;for(var b=k.getID3Data(_,0)||[],d=b.length,s=_.length;d0},M.demux=function(R){var E=R,w=Object(k.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(H.appendUint8Array)(this.remainderData,R));var T=Object(H.segmentValidRange)(E);this.remainderData=T.remainder,w.samples=T.valid||new Uint8Array}else w.samples=E;return{audioTrack:Object(k.dummyTrack)(),avcTrack:w,id3Track:Object(k.dummyTrack)(),textTrack:Object(k.dummyTrack)()}},M.flush=function(){var R=Object(k.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(k.dummyTrack)(),avcTrack:R,id3Track:Object(k.dummyTrack)(),textTrack:Object(k.dummyTrack)()}},M.demuxSampleAes=function(R,E,w){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},F}();P.minProbeByteLength=1024,z.default=P},"./src/demux/mpegaudio.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"appendFrame",function(){return D}),L.d(z,"parseHeader",function(){return R}),L.d(z,"isHeaderPattern",function(){return E}),L.d(z,"isHeader",function(){return w}),L.d(z,"canParse",function(){return T}),L.d(z,"probe",function(){return A});var H=null,k=[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],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],F=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function D(_,b,d,s,u){if(d+24>b.length)return;var l=R(b,d);if(l&&d+l.frameLength<=b.length){var S=l.samplesPerFrame*9e4/l.sampleRate,h=s+u*S,g={unit:b.subarray(d,d+l.frameLength),pts:h,dts:h};return _.config=[],_.channelCount=l.channelCount,_.samplerate=l.sampleRate,_.samples.push(g),{sample:g,length:l.frameLength,missing:0}}}function R(_,b){var d=_[b+1]>>3&3,s=_[b+1]>>1&3,u=_[b+2]>>4&15,l=_[b+2]>>2&3;if(d!==1&&u!==0&&u!==15&&l!==3){var S=_[b+2]>>1&1,h=_[b+3]>>6,g=d===3?3-s:s===3?3:4,C=k[g*14+u-1]*1e3,y=d===3?0:d===2?1:2,f=P[y*3+l],c=h===3?1:2,o=F[d][s],a=M[s],m=o*8*a,p=Math.floor(o*C/f+S)*a;if(H===null){var v=navigator.userAgent||"",O=v.match(/Chrome\/(\d+)/i);H=O?parseInt(O[1]):0}var U=!!H&&H<=87;return U&&s===2&&C>=224e3&&h===0&&(_[b+3]=_[b+3]|128),{sampleRate:f,channelCount:c,frameLength:p,samplesPerFrame:m}}}function E(_,b){return _[b]===255&&(_[b+1]&224)===224&&(_[b+1]&6)!==0}function w(_,b){return b+1<_.length&&E(_,b)}function T(_,b){var d=4;return E(_,b)&&d<=_.length-b}function A(_,b){if(b+1<_.length&&E(_,b)){var d=4,s=R(_,b),u=d;s!=null&&s.frameLength&&(u=s.frameLength);var l=b+u;return l===_.length||w(_,l)}return!1}},"./src/demux/sample-aes.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/crypt/decrypter.ts"),k=L("./src/demux/tsdemuxer.ts"),P=function(){function F(D,R,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new H.default(D,R,{removePKCS7Padding:!1})}var M=F.prototype;return M.decryptBuffer=function(R,E){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,E)},M.decryptAacSample=function(R,E,w,T){var A=R[E].unit,_=A.subarray(16,A.length-A.length%16),b=_.buffer.slice(_.byteOffset,_.byteOffset+_.length),d=this;this.decryptBuffer(b,function(s){var u=new Uint8Array(s);A.set(u,16),T||d.decryptAacSamples(R,E+1,w)})},M.decryptAacSamples=function(R,E,w){for(;;E++){if(E>=R.length){w();return}if(R[E].unit.length<32)continue;var T=this.decrypter.isSync();if(this.decryptAacSample(R,E,w,T),!T)return}},M.getAvcEncryptedData=function(R){for(var E=Math.floor((R.length-48)/160)*16+16,w=new Int8Array(E),T=0,A=32;A<=R.length-16;A+=160,T+=16)w.set(R.subarray(A,A+16),T);return w},M.getAvcDecryptedUnit=function(R,E){for(var w=new Uint8Array(E),T=0,A=32;A<=R.length-16;A+=160,T+=16)R.set(w.subarray(T,T+16),A);return R},M.decryptAvcSample=function(R,E,w,T,A,_){var b=Object(k.discardEPB)(A.data),d=this.getAvcEncryptedData(b),s=this;this.decryptBuffer(d.buffer,function(u){A.data=s.getAvcDecryptedUnit(b,u),_||s.decryptAvcSamples(R,E,w+1,T)})},M.decryptAvcSamples=function(R,E,w,T){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,w=0){if(E>=R.length){T();return}for(var A=R[E].units;!(w>=A.length);w++){var _=A[w];if(_.data.length<=48||_.type!==1&&_.type!==5)continue;var b=this.decrypter.isSync();if(this.decryptAvcSample(R,E,w,T,_,b),!b)return}}},F}();z.default=P},"./src/demux/transmuxer-interface.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return A});var H=L("./node_modules/webworkify-webpack/index.js"),k=L.n(H),P=L("./src/events.ts"),F=L("./src/demux/transmuxer.ts"),M=L("./src/utils/logger.ts"),D=L("./src/errors.ts"),R=L("./src/utils/mediasource-helper.ts"),E=L("./node_modules/eventemitter3/index.js"),w=L.n(E),T=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},A=function(){function _(d,s,u,l){var S=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=d,this.id=s,this.onTransmuxComplete=u,this.onFlush=l;var h=d.config,g=function(o,a){a=a||{},a.frag=S.frag,a.id=S.id,d.trigger(o,a)};this.observer=new E.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,g),this.observer.on(P.Events.ERROR,g);var C={mp4:T.isTypeSupported("video/mp4"),mpeg:T.isTypeSupported("audio/mpeg"),mp3:T.isTypeSupported('audio/mp4; codecs="mp3"')},y=navigator.vendor;if(h.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var f;try{f=this.worker=H("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(c){d.trigger(P.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},f.postMessage({cmd:"init",typeSupported:C,vendor:y,id:s,config:JSON.stringify(h)})}catch(c){M.logger.warn("Error in worker:",c),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new F.default(this.observer,C,h,y,s),this.worker=null}}else this.transmuxer=new F.default(this.observer,C,h,y,s)}var b=_.prototype;return b.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},b.push=function(s,u,l,S,h,g,C,y,f,c){var o=this;f.transmuxing.start=self.performance.now();var a=this.transmuxer,m=this.worker,p=g?g.start:h.start,v=h.decryptdata,O=this.frag,U=!(O&&h.cc===O.cc),j=!(O&&f.level===O.level),G=O?f.sn-O.sn:-1,B=this.part?f.part-this.part.index:1,N=!j&&(G===1||G===0&&B===1),V=self.performance.now();(j||G||h.stats.parsing.start===0)&&(h.stats.parsing.start=V),g&&(B||!N)&&(g.stats.parsing.start=V);var $=new F.TransmuxState(U,N,y,j,p);if(!N||U){M.logger.log("[transmuxer-interface, "+h.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+` discontinuity: `+U+` trackSwitch: `+j+` contiguous: `+N+` accurateTimeOffset: `+y+` timeOffset: `+p);var ie=new F.TransmuxConfig(l,S,u,C,c);this.configureTransmuxer(ie)}if(this.frag=h,this.part=g,m)m.postMessage({cmd:"demux",data:s,decryptdata:v,chunkMeta:f,state:$},s instanceof ArrayBuffer?[s]:[]);else if(a){var oe=a.push(s,v,f,$);Object(F.isPromise)(oe)?oe.then(function(_e){o.handleTransmuxComplete(_e)}):this.handleTransmuxComplete(oe)}},b.flush=function(s){var u=this;s.transmuxing.start=self.performance.now();var l=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:s});else if(l){var h=l.flush(s);Object(F.isPromise)(h)?h.then(function(g){u.handleFlushResult(g,s)}):this.handleFlushResult(h,s)}},b.handleFlushResult=function(s,u){var l=this;s.forEach(function(S){l.handleTransmuxComplete(S)}),this.onFlush(u)},b.onWorkerMessage=function(s){var u=s.data,l=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,l.trigger(u.event,u.data);break}}},b.configureTransmuxer=function(s){var u=this.worker,l=this.transmuxer;u?u.postMessage({cmd:"configure",config:s}):l&&l.configure(s)},b.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},_}()},"./src/demux/transmuxer-worker.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return D});var H=L("./src/demux/transmuxer.ts"),k=L("./src/events.ts"),P=L("./src/utils/logger.ts"),F=L("./node_modules/eventemitter3/index.js"),M=L.n(F);function D(A){var _=new F.EventEmitter,b=function(s,u){A.postMessage({event:s,data:u})};_.on(k.Events.FRAG_DECRYPTED,b),_.on(k.Events.ERROR,b),A.addEventListener("message",function(d){var s=d.data;switch(s.cmd){case"init":{var u=JSON.parse(s.config);A.transmuxer=new H.default(_,s.typeSupported,u,s.vendor,s.id),Object(P.enableLogs)(u.debug),b("init",null);break}case"configure":{A.transmuxer.configure(s.config);break}case"demux":{var l=A.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(H.isPromise)(l)?l.then(function(g){R(A,g)}):R(A,l);break}case"flush":{var S=s.chunkMeta,h=A.transmuxer.flush(S);Object(H.isPromise)(h)?h.then(function(g){w(A,g,S)}):w(A,h,S);break}default:break}})}function R(A,_){if(T(_.remuxResult))return;var b=[],d=_.remuxResult,s=d.audio,u=d.video;s&&E(b,s),u&&E(b,u),A.postMessage({event:"transmuxComplete",data:_},b)}function E(A,_){_.data1&&A.push(_.data1.buffer),_.data2&&A.push(_.data2.buffer)}function w(A,_,b){_.forEach(function(d){R(A,d)}),A.postMessage({event:"flush",data:b})}function T(A){return!A.audio&&!A.video&&!A.text&&!A.id3&&!A.initSegment}},"./src/demux/transmuxer.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return u}),L.d(z,"isPromise",function(){return h}),L.d(z,"TransmuxConfig",function(){return g}),L.d(z,"TransmuxState",function(){return C});var H=L("./src/events.ts"),k=L("./src/errors.ts"),P=L("./src/crypt/decrypter.ts"),F=L("./src/demux/aacdemuxer.ts"),M=L("./src/demux/mp4demuxer.ts"),D=L("./src/demux/tsdemuxer.ts"),R=L("./src/demux/mp3demuxer.ts"),E=L("./src/remux/mp4-remuxer.ts"),w=L("./src/remux/passthrough-remuxer.ts"),T=L("./src/demux/chunk-cache.ts"),A=L("./src/utils/mp4-tools.ts"),_=L("./src/utils/logger.ts"),b;try{b=self.performance.now.bind(self.performance)}catch(y){_.logger.debug("Unable to use Performance API on this environment"),b=self.Date.now}var d=[{demux:D.default,remux:E.default},{demux:M.default,remux:w.default},{demux:F.default,remux:E.default},{demux:R.default,remux:E.default}],s=1024;d.forEach(function(y){var f=y.demux;s=Math.max(s,f.minProbeByteLength)});var u=function(){function y(c,o,a,m,p){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 T.default,this.observer=c,this.typeSupported=o,this.config=a,this.vendor=m,this.id=p}var f=y.prototype;return f.configure=function(o){this.transmuxConfig=o,this.decrypter&&this.decrypter.reset()},f.push=function(o,a,m,p){var v=this,O=m.transmuxing;O.executeStart=b();var U=new Uint8Array(o),j=this.cache,G=this.config,B=this.currentTransmuxState,N=this.transmuxConfig;p&&(this.currentTransmuxState=p);var V=l(U,a);if(V&&V.method==="AES-128"){var $=this.getDecrypter();if(G.enableSoftwareAES){var ie=$.softwareDecrypt(U,V.key.buffer,V.iv.buffer);if(!ie)return O.executeEnd=b(),S(m);U=new Uint8Array(ie)}else return this.decryptionPromise=$.webCryptoDecrypt(U,V.key.buffer,V.iv.buffer).then(function(we){var Be=v.push(we,null,m);return v.decryptionPromise=null,Be}),this.decryptionPromise}var oe=p||B,_e=oe.contiguous,fe=oe.discontinuity,Se=oe.trackSwitch,be=oe.accurateTimeOffset,me=oe.timeOffset,le=N.audioCodec,ue=N.videoCodec,Ee=N.defaultInitPts,Ge=N.duration,Te=N.initSegmentData;if((fe||Se)&&this.resetInitSegment(Te,le,ue,Ge),fe&&this.resetInitialTimestamp(Ee),_e||this.resetContiguity(),this.needsProbing(U,fe,Se)){if(j.dataLength){var pe=j.flush();U=Object(A.appendUint8Array)(pe,U)}this.configureTransmuxer(U,N)}var Ae=this.transmux(U,V,me,be,m),Ce=this.currentTransmuxState;return Ce.contiguous=!0,Ce.discontinuity=!1,Ce.trackSwitch=!1,O.executeEnd=b(),Ae},f.flush=function(o){var a=this,m=o.transmuxing;m.executeStart=b();var p=this.decrypter,v=this.cache,O=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return a.flush(o)});var j=[],G=O.timeOffset;if(p){var B=p.flush();B&&j.push(this.push(B,null,o))}var N=v.dataLength;v.reset();var V=this.demuxer,$=this.remuxer;if(!V||!$)return N>=s&&this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),m.executeEnd=b(),[S(o)];var ie=V.flush(G);return h(ie)?ie.then(function(oe){return a.flushRemux(j,oe,o),j}):(this.flushRemux(j,ie,o),j)},f.flushRemux=function(o,a,m){var p=a.audioTrack,v=a.avcTrack,O=a.id3Track,U=a.textTrack,j=this.currentTransmuxState,G=j.accurateTimeOffset,B=j.timeOffset;_.logger.log("[transmuxer.ts]: Flushed fragment "+m.sn+(m.part>-1?" p: "+m.part:"")+" of level "+m.level);var N=this.remuxer.remux(p,v,O,U,B,G,!0,this.id);o.push({remuxResult:N,chunkMeta:m}),m.transmuxing.executeEnd=b()},f.resetInitialTimestamp=function(o){var a=this.demuxer,m=this.remuxer;if(!a||!m)return;a.resetTimeStamp(o),m.resetTimeStamp(o)},f.resetContiguity=function(){var o=this.demuxer,a=this.remuxer;if(!o||!a)return;o.resetContiguity(),a.resetNextTimestamp()},f.resetInitSegment=function(o,a,m,p){var v=this.demuxer,O=this.remuxer;if(!v||!O)return;v.resetInitSegment(a,m,p),O.resetInitSegment(o,a,m)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(o,a,m,p,v){var O;return a&&a.method==="SAMPLE-AES"?O=this.transmuxSampleAes(o,a,m,p,v):O=this.transmuxUnencrypted(o,m,p,v),O},f.transmuxUnencrypted=function(o,a,m,p){var v=this.demuxer.demux(o,a,!1,!this.config.progressive),O=v.audioTrack,U=v.avcTrack,j=v.id3Track,G=v.textTrack,B=this.remuxer.remux(O,U,j,G,a,m,!1,this.id);return{remuxResult:B,chunkMeta:p}},f.transmuxSampleAes=function(o,a,m,p,v){var O=this;return this.demuxer.demuxSampleAes(o,a,m).then(function(U){var j=O.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,m,p,!1,O.id);return{remuxResult:j,chunkMeta:v}})},f.configureTransmuxer=function(o,a){for(var m=this.config,p=this.observer,v=this.typeSupported,O=this.vendor,U=a.audioCodec,j=a.defaultInitPts,G=a.duration,B=a.initSegmentData,N=a.videoCodec,V,$=0,ie=d.length;$0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(c=f),c}var S=function(f){return{remuxResult:{},chunkMeta:f}};function h(y){return"then"in y&&y.then instanceof Function}var g=function(f,c,o,a,m){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=c,this.initSegmentData=o,this.duration=a,this.defaultInitPts=m},C=function(f,c,o,a,m){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=c,this.accurateTimeOffset=o,this.trackSwitch=a,this.timeOffset=m}},"./src/demux/tsdemuxer.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"discardEPB",function(){return S});var H=L("./src/demux/adts.ts"),k=L("./src/demux/mpegaudio.ts"),P=L("./src/demux/exp-golomb.ts"),F=L("./src/demux/id3.ts"),M=L("./src/demux/sample-aes.ts"),D=L("./src/events.ts"),R=L("./src/utils/mp4-tools.ts"),E=L("./src/utils/logger.ts"),w=L("./src/errors.ts"),T={video:1,audio:2,id3:3,text:4},A=function(){function h(C,y,f){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=C,this.config=y,this.typeSupported=f}h.probe=function(y){var f=h.syncOffset(y);return f<0?!1:(f&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},h.syncOffset=function(y){for(var f=Math.min(1e3,y.length-3*188),c=0;c>4,le=void 0;if(me>1){if(le=fe+5+y[fe+4],le===fe+188)continue}else le=fe+4;switch(be){case O:Se&&(U&&(a=s(U))&&this.parseAVCPES(a,!1),U={data:[],size:0}),U&&(U.data.push(y.subarray(le,fe+188)),U.size+=fe+188-le);break;case j:Se&&(B&&(a=s(B))&&(p.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),B={data:[],size:0}),B&&(B.data.push(y.subarray(le,fe+188)),B.size+=fe+188-le);break;case G:Se&&(N&&(a=s(N))&&this.parseID3PES(a),N={data:[],size:0}),N&&(N.data.push(y.subarray(le,fe+188)),N.size+=fe+188-le);break;case 0:Se&&(le+=y[le]+1),ie=this._pmtId=b(y,le);break;case ie:{Se&&(le+=y[le]+1);var ue=d(y,le,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);O=ue.avc,O>0&&(m.pid=O),j=ue.audio,j>0&&(p.pid=j,p.isAAC=ue.isAAC),G=ue.id3,G>0&&(v.pid=G),V&&!$&&(E.logger.log("reparse from beginning"),V=!1,fe=_e-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});m.pesData=U,p.pesData=B,v.pesData=N;var Ee={audioTrack:p,avcTrack:m,id3Track:v,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(Ee),Ee},g.flush=function(){var y=this.remainderData;this.remainderData=null;var f;return y?f=this.demux(y,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},g.extractRemainingSamples=function(y){var f=y.audioTrack,c=y.avcTrack,o=y.id3Track,a=c.pesData,m=f.pesData,p=o.pesData,v;a&&(v=s(a))?(this.parseAVCPES(v,!0),c.pesData=null):c.pesData=a,m&&(v=s(m))?(f.isAAC?this.parseAACPES(v):this.parseMPEGPES(v),f.pesData=null):(m!=null&&m.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=m),p&&(v=s(p))?(this.parseID3PES(v),o.pesData=null):o.pesData=p},g.demuxSampleAes=function(y,f,c){var o=this.demux(y,c,!0,!this.config.progressive),a=this.sampleAes=new M.default(this.observer,this.config,f);return this.decrypt(o,a)},g.decrypt=function(y,f){return new Promise(function(c){var o=y.audioTrack,a=y.avcTrack;o.samples&&o.isAAC?f.decryptAacSamples(o.samples,0,function(){a.samples?f.decryptAvcSamples(a.samples,0,0,function(){c(y)}):c(y)}):a.samples&&f.decryptAvcSamples(a.samples,0,0,function(){c(y)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(y,f){var c=this,o=this._avcTrack,a=this.parseAVCNALu(y.data),m=!1,p=this.avcSample,v,O=!1;y.data=null,p&&a.length&&!o.audFound&&(u(p,o),p=this.avcSample=_(!1,y.pts,y.dts,"")),a.forEach(function(U){switch(U.type){case 1:{v=!0,p||(p=c.avcSample=_(!0,y.pts,y.dts,"")),m&&(p.debug+="NDR "),p.frame=!0;var j=U.data;if(O&&j.length>4){var G=new P.default(j).readSliceType();(G===2||G===4||G===7||G===9)&&(p.key=!0)}break}case 5:v=!0,p||(p=c.avcSample=_(!0,y.pts,y.dts,"")),m&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{v=!0,m&&p&&(p.debug+="SEI ");var B=new P.default(S(U.data));B.readUByte();for(var N=0,V=0,$=!1,ie=0;!$&&B.bytesAvailable>1;){N=0;do ie=B.readUByte(),N+=ie;while(ie===255);V=0;do ie=B.readUByte(),V+=ie;while(ie===255);if(N===4&&B.bytesAvailable!==0){$=!0;var oe=B.readUByte();if(oe===181){var _e=B.readUShort();if(_e===49){var fe=B.readUInt();if(fe===1195456820){var Se=B.readUByte();if(Se===3){for(var be=B.readUByte(),me=B.readUByte(),le=31&be,ue=[be,me],Ee=0;Ee16){for(var Ge=[],Te=0;Te<16;Te++)Ge.push(B.readUByte().toString(16)),(Te===3||Te===5||Te===7||Te===9)&&Ge.push("-");for(var pe=V-16,Ae=new Uint8Array(pe),Ce=0;Ce=0){var B={data:y.subarray(j,p-o-1),type:G};m.push(B)}else{var N=this.getLastNalUnit();if(N&&(a&&p<=4-a&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-a))),O=p-o-1,O>0)){var V=new Uint8Array(N.data.byteLength+O);V.set(N.data,0),V.set(y.subarray(0,O),N.data.byteLength),N.data=V,N.state=0}}p=0&&o>=0){var $={data:y.subarray(j,f),type:G,state:o};m.push($)}if(m.length===0){var ie=this.getLastNalUnit();if(ie){var oe=new Uint8Array(ie.data.byteLength+y.byteLength);oe.set(ie.data,0),oe.set(y,ie.data.byteLength),ie.data=oe}}return c.naluState=o,m},g.parseAACPES=function(y){var f=0,c=this._audioTrack,o=this.aacOverFlow,a=y.data;if(o){this.aacOverFlow=null;var m=o.sample.unit.byteLength,p=Math.min(o.missing,m),v=m-p;o.sample.unit.set(a.subarray(0,p),v),c.samples.push(o.sample),f=o.missing}var O,U;for(O=f,U=a.length;O1;){var m=new Uint8Array(a[0].length+a[1].length);m.set(a[0]),m.set(a[1],a[0].length),a[0]=m,a.splice(1,1)}C=a[0];var p=(C[0]<<16)+(C[1]<<8)+C[2];if(p===1){if(y=(C[4]<<8)+C[5],y&&y>h.size-6)return null;var v=C[7];v&192&&(c=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,v&64?(o=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,c-o>60*9e4&&(E.logger.warn(Math.round((c-o)/9e4)+"s delta between PTS and DTS, align them"),c=o)):o=c),f=C[8];var O=f+9;if(h.size<=O)return null;h.size-=O;for(var U=new Uint8Array(h.size),j=0,G=a.length;jB){O-=B;continue}else C=C.subarray(O),B-=O,O=0;U.set(C,g),g+=B}return y&&(y-=f+3),{data:U,pts:c,dts:o,len:y}}return null}function u(h,g){if(h.units.length&&h.frame){if(h.pts===void 0){var C=g.samples,y=C.length;if(y){var f=C[y-1];h.pts=f.pts,h.dts=f.dts}else{g.dropped++;return}}g.samples.push(h)}h.debug.length&&E.logger.log(h.pts+"/"+h.dts+":"+h.debug)}function l(h,g){var C=h.length;if(C>0){if(g.pts>=h[C-1].pts)h.push(g);else for(var y=C-1;y>=0;y--)if(g.ptsc)return a;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,c=this.autoLevelCapping,o;return c===-1&&f&&f.length?o=f.length-1:o=c,o}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var c=this.audioTrackController;c&&(c.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var c=this.subtitleTrackController;c&&(c.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{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 s.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:_.hlsDefaultConfig},set:function(f){g.defaultConfig=f}}]),g}();h.defaultConfig=void 0},"./src/is-supported.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"isSupported",function(){return P}),L.d(z,"changeTypeSupported",function(){return F});var H=L("./src/utils/mediasource-helper.ts");function k(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var M=Object(H.getMediaSource)();if(!M)return!1;var D=k(),R=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!D||D.prototype&&typeof D.prototype.appendBuffer=="function"&&typeof D.prototype.remove=="function";return!!R&&!!E}function F(){var M,D=k();return typeof(D==null||((M=D.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return A}),L.d(z,"LoadError",function(){return b});var H=L("./src/polyfills/number.ts"),k=L("./src/errors.ts");function P(d,s){d.prototype=Object.create(s.prototype),d.prototype.constructor=d,E(d,s)}function F(d){var s=typeof Map=="function"?new Map:void 0;return F=function(l){if(l===null||!R(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(l))return s.get(l);s.set(l,S)}function S(){return M(l,arguments,w(this).constructor)}return S.prototype=Object.create(l.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),E(S,l)},F(d)}function M(d,s,u){return D()?M=Reflect.construct:M=function(S,h,g){var C=[null];C.push.apply(C,h);var y=Function.bind.apply(S,C),f=new y;return g&&E(f,g.prototype),f},M.apply(null,arguments)}function D(){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 R(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function E(d,s){return E=Object.setPrototypeOf||function(l,S){return l.__proto__=S,l},E(d,s)}function w(d){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},w(d)}var T=Math.pow(2,17),A=function(){function d(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var s=d.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(l,S){var h=this,g=l.url;if(!g)return Promise.reject(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var C=this.config,y=C.fLoader,f=C.loader;return new Promise(function(c,o){h.loader&&h.loader.destroy();var a=h.loader=l.loader=y?new y(C):new f(C),m=_(l),p={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:T};l.stats=a.stats,a.load(m,p,{onSuccess:function(O,U,j,G){h.resetLoader(l,a),c({frag:l,part:null,payload:O.data,networkDetails:G})},onError:function(O,U,j){h.resetLoader(l,a),o(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:O,networkDetails:j}))},onAbort:function(O,U,j){h.resetLoader(l,a),o(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:j}))},onTimeout:function(O,U,j){h.resetLoader(l,a),o(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:j}))},onProgress:function(O,U,j,G){S&&S({frag:l,part:null,payload:j,networkDetails:G})}})})},s.loadPart=function(l,S,h){var g=this;this.abort();var C=this.config,y=C.fLoader,f=C.loader;return new Promise(function(c,o){g.loader&&g.loader.destroy();var a=g.loader=l.loader=y?new y(C):new f(C),m=_(l,S),p={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:T};S.stats=a.stats,a.load(m,p,{onSuccess:function(O,U,j,G){g.resetLoader(l,a),g.updateStatsFromPart(l,S);var B={frag:l,part:S,payload:O.data,networkDetails:G};h(B),c(B)},onError:function(O,U,j){g.resetLoader(l,a),o(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:S,response:O,networkDetails:j}))},onAbort:function(O,U,j){l.stats.aborted=S.stats.aborted,g.resetLoader(l,a),o(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:S,networkDetails:j}))},onTimeout:function(O,U,j){g.resetLoader(l,a),o(new b({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:S,networkDetails:j}))}})})},s.updateStatsFromPart=function(l,S){var h=l.stats,g=S.stats,C=g.total;if(h.loaded+=g.loaded,C){var y=Math.round(l.duration/S.duration),f=Math.min(Math.round(h.loaded/C),y),c=y-f,o=c*Math.round(h.loaded/f);h.total=h.loaded+o}else h.total=Math.max(h.loaded,h.total);var a=h.loading,m=g.loading;a.start?a.first+=m.first-m.start:(a.start=m.start,a.first=m.first),a.end=m.end},s.resetLoader=function(l,S){l.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},d}();function _(d,s){s===void 0&&(s=null);var u=s||d,l={frag:d,part:s,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},S=u.byteRangeStartOffset,h=u.byteRangeEndOffset;return Object(H.isFiniteNumber)(S)&&Object(H.isFiniteNumber)(h)&&(l.rangeStart=S,l.rangeEnd=h),l}var b=function(d){P(s,d);function s(u){for(var l,S=arguments.length,h=new Array(S>1?S-1:0),g=1;g>8*(15-C)&255;return g},l.setDecryptDataFromLevelKey=function(h,g){var C=h;return(h==null?void 0:h.method)==="AES-128"&&h.uri&&!h.iv&&(C=M.LevelKey.fromURI(h.uri),C.method=h.method,C.iv=this.createInitializationVector(g),C.keyFormat="identity"),C},l.setElementaryStreamInfo=function(h,g,C,y,f,c){c===void 0&&(c=!1);var o=this.elementaryStreams,a=o[h];if(!a){o[h]={startPTS:g,endPTS:C,startDTS:y,endDTS:f,partial:c};return}a.startPTS=Math.min(a.startPTS,g),a.endPTS=Math.max(a.endPTS,C),a.startDTS=Math.min(a.startDTS,y),a.endDTS=Math.max(a.endDTS,f)},l.clearElementaryStreamInfo=function(){var h=this.elementaryStreams;h[A.AUDIO]=null,h[A.VIDEO]=null,h[A.AUDIOVIDEO]=null},T(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var h=this.sn;typeof h!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&F.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),h=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,h)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(H.isFiniteNumber)(this.programDateTime))return null;var h=Object(H.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+h*1e3}},{key:"encrypted",get:function(){var h;return!!((h=this.decryptdata)!==null&&h!==void 0&&h.keyFormat&&this.decryptdata.uri)}}]),u}(_),d=function(s){R(u,s);function u(l,S,h,g,C){var y;y=s.call(this,h)||this,y.fragOffset=0,y.duration=0,y.gap=!1,y.independent=!1,y.relurl=void 0,y.fragment=void 0,y.index=void 0,y.stats=new D.LoadStats,y.duration=l.decimalFloatingPoint("DURATION"),y.gap=l.bool("GAP"),y.independent=l.bool("INDEPENDENT"),y.relurl=l.enumeratedString("URI"),y.fragment=S,y.index=g;var f=l.enumeratedString("BYTERANGE");return f&&y.setByteRange(f,C),C&&(y.fragOffset=C.fragOffset+C.duration),y}return T(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),u}(_)},"./src/loader/key-loader.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return F});var H=L("./src/events.ts"),k=L("./src/errors.ts"),P=L("./src/utils/logger.ts"),F=function(){function M(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var D=M.prototype;return D._registerListeners=function(){this.hls.on(H.Events.KEY_LOADING,this.onKeyLoading,this)},D._unregisterListeners=function(){this.hls.off(H.Events.KEY_LOADING,this.onKeyLoading)},D.destroy=function(){this._unregisterListeners();for(var E in this.loaders){var w=this.loaders[E];w&&w.destroy()}this.loaders={}},D.onKeyLoading=function(E,w){var T=w.frag,A=T.type,_=this.loaders[A];if(!T.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var b=T.decryptdata.uri;if(b!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(_&&(P.logger.warn("abort previous key loader for type:"+A),_.abort()),!b){P.logger.warn("key uri is falsy");return}var s=d.loader,u=T.loader=this.loaders[A]=new s(d);this.decrypturl=b,this.decryptkey=null;var l={url:b,frag:T,responseType:"arraybuffer"},S={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(l,S,h)}else this.decryptkey&&(T.decryptdata.key=this.decryptkey,this.hls.trigger(H.Events.KEY_LOADED,{frag:T}))},D.loadsuccess=function(E,w,T){var A=T.frag;if(!A.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=A.decryptdata.key=new Uint8Array(E.data),A.loader=null,delete this.loaders[A.type],this.hls.trigger(H.Events.KEY_LOADED,{frag:A})},D.loaderror=function(E,w){var T=w.frag,A=T.loader;A&&A.abort(),delete this.loaders[T.type],this.hls.trigger(H.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:T,response:E})},D.loadtimeout=function(E,w){var T=w.frag,A=T.loader;A&&A.abort(),delete this.loaders[T.type],this.hls.trigger(H.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:T})},M}()},"./src/loader/level-details.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"LevelDetails",function(){return M});var H=L("./src/polyfills/number.ts");function k(D,R){for(var E=0;Ew.endSN||T>0||T===0&&A>0,this.updated||this.advanced?this.misses=Math.floor(w.misses*.6):this.misses=w.misses+1,this.availabilityDelay=w.availabilityDelay},P(D,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(H.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var w=this.driftEndTime-this.driftStartTime;if(w>0){var T=this.driftEnd-this.driftStart;return T*1e3/w}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var w;return(w=this.fragments)!==null&&w!==void 0&&w.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 w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),D}()},"./src/loader/level-key.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"LevelKey",function(){return M});var H=L("./node_modules/url-toolkit/src/url-toolkit.js"),k=L.n(H);function P(D,R){for(var E=0;E2){var o=c.shift()+".";return o+=parseInt(c.shift()).toString(16),o+=("000"+parseInt(c.shift()).toString(16)).substr(-4),o}return f},C.resolve=function(f,c){return k.buildAbsoluteURL(c,f,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(f,c){var o=[],a={},m=!1;T.lastIndex=0;for(var p;(p=T.exec(f))!=null;)if(p[1]){var v=new R.AttrList(p[1]),O={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:C.resolve(p[2],c)},U=v.decimalResolution("RESOLUTION");U&&(O.width=U.width,O.height=U.height),l((v.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),O),O.videoCodec&&O.videoCodec.indexOf("avc1")!==-1&&(O.videoCodec=C.convertAVC1ToAVCOTI(O.videoCodec)),o.push(O)}else if(p[3]){var j=new R.AttrList(p[3]);j["DATA-ID"]&&(m=!0,a[j["DATA-ID"]]=j)}return{levels:o,sessionData:m?a:null}},C.parseMasterPlaylistMedia=function(f,c,o,a){a===void 0&&(a=[]);var m,p=[],v=0;for(A.lastIndex=0;(m=A.exec(f))!==null;){var O=new R.AttrList(m[1]);if(O.TYPE===o){var U={attrs:O,bitrate:0,id:v++,groupId:O["GROUP-ID"],instreamId:O["INSTREAM-ID"],name:O.NAME||O.LANGUAGE||"",type:o,default:O.bool("DEFAULT"),autoselect:O.bool("AUTOSELECT"),forced:O.bool("FORCED"),lang:O.LANGUAGE,url:O.URI?C.resolve(O.URI,c):""};if(a.length){var j=C.findGroup(a,U.groupId)||a[0];S(U,j,"audioCodec"),S(U,j,"textCodec")}p.push(U)}}return p},C.parseLevelPlaylist=function(f,c,o,a,m){var p=new M.LevelDetails(c),v=p.fragments,O=null,U=0,j=0,G=0,B=0,N=null,V=new F.Fragment(a,c),$,ie,oe,_e=-1,fe=!1;for(_.lastIndex=0,p.m3u8=f;($=_.exec(f))!==null;){fe&&(fe=!1,V=new F.Fragment(a,c),V.start=G,V.sn=U,V.cc=B,V.level=o,O&&(V.initSegment=O,V.rawProgramDateTime=O.rawProgramDateTime));var Se=$[1];if(Se){V.duration=parseFloat(Se);var be=(" "+$[2]).slice(1);V.title=be||null,V.tagList.push(be?["INF",Se,be]:["INF",Se])}else if($[3])Object(H.isFiniteNumber)(V.duration)&&(V.start=G,oe&&(V.levelkey=oe),V.sn=U,V.level=o,V.cc=B,V.urlId=m,v.push(V),V.relurl=(" "+$[3]).slice(1),g(V,N),N=V,G+=V.duration,U++,j=0,fe=!0);else if($[4]){var me=(" "+$[4]).slice(1);N?V.setByteRange(me,N):V.setByteRange(me)}else if($[5])V.rawProgramDateTime=(" "+$[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),_e===-1&&(_e=v.length);else{if($=$[0].match(b),!$){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<$.length&&!(typeof $[ie]!="undefined");ie++);var le=(" "+$[ie]).slice(1),ue=(" "+$[ie+1]).slice(1),Ee=$[ie+2]?(" "+$[ie+2]).slice(1):"";switch(le){case"PLAYLIST-TYPE":p.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":U=p.startSN=parseInt(ue);break;case"SKIP":{var Ge=new R.AttrList(ue),Te=Ge.decimalInteger("SKIPPED-SEGMENTS");if(Object(H.isFiniteNumber)(Te)){p.skippedSegments=Te;for(var pe=Te;pe--;)v.unshift(null);U+=Te}var Ae=Ge.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ae&&(p.recentlyRemovedDateranges=Ae.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(ue);break;case"VERSION":p.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(ue||Ee)&&V.tagList.push(Ee?[ue,Ee]:[ue]);break;case"DIS":B++;case"GAP":V.tagList.push([le]);break;case"BITRATE":V.tagList.push([le,ue]);break;case"DISCONTINUITY-SEQ":B=parseInt(ue);break;case"KEY":{var Ce,we=new R.AttrList(ue),Be=we.enumeratedString("METHOD"),Qe=we.URI,je=we.hexadecimalInteger("IV"),De=we.enumeratedString("KEYFORMATVERSIONS"),Pe=we.enumeratedString("KEYID"),Le=(Ce=we.enumeratedString("KEYFORMAT"))!=null?Ce:"identity",Re=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Re.indexOf(Le)>-1){E.logger.warn("Keyformat "+Le+" is not supported from the manifest");continue}else if(Le!=="identity")continue;Be&&(oe=D.LevelKey.fromURL(c,Qe),Qe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Be)>=0&&(oe.method=Be,oe.keyFormat=Le,Pe&&(oe.keyID=Pe),De&&(oe.keyFormatVersions=De),oe.iv=je));break}case"START":{var Ue=new R.AttrList(ue),We=Ue.decimalFloatingPoint("TIME-OFFSET");Object(H.isFiniteNumber)(We)&&(p.startTimeOffset=We);break}case"MAP":{var ke=new R.AttrList(ue);V.relurl=ke.URI,ke.BYTERANGE&&V.setByteRange(ke.BYTERANGE),V.level=o,V.sn="initSegment",oe&&(V.levelkey=oe),V.initSegment=null,O=V,fe=!0;break}case"SERVER-CONTROL":{var Ke=new R.AttrList(ue);p.canBlockReload=Ke.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Ke.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Ke.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Ke.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ze=new R.AttrList(ue);p.partTarget=ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ge=p.partList;ge||(ge=p.partList=[]);var Ye=j>0?ge[ge.length-1]:void 0,He=j++,xe=new F.Part(new R.AttrList(ue),V,c,He,Ye);ge.push(xe),V.duration+=xe.duration;break}case"PRELOAD-HINT":{var Ie=new R.AttrList(ue);p.preloadHint=Ie;break}case"RENDITION-REPORT":{var se=new R.AttrList(ue);p.renditionReports=p.renditionReports||[],p.renditionReports.push(se);break}default:E.logger.warn("line parsed but not handled: "+$);break}}}N&&!N.relurl?(v.pop(),G-=N.duration,p.partList&&(p.fragmentHint=N)):p.partList&&(g(V,N),V.cc=B,p.fragmentHint=V);var te=v.length,ee=v[0],Y=v[te-1];if(G+=p.skippedSegments*p.targetduration,G>0&&te&&Y){p.averagetargetduration=G/te;var Q=Y.sn;p.endSN=Q!=="initSegment"?Q:0,ee&&(p.startCC=ee.cc,ee.initSegment||p.fragments.every(function(Z){return Z.relurl&&s(Z.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new F.Fragment(a,c),V.relurl=Y.relurl,V.level=o,V.sn="initSegment",ee.initSegment=V,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(G+=p.fragmentHint.duration),p.totalduration=G,p.endCC=B,_e>0&&h(v,_e),p},C}();function l(C,y){["video","audio","text"].forEach(function(f){var c=C.filter(function(a){return Object(w.isCodecType)(a,f)});if(c.length){var o=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});y[f+"Codec"]=o.length>0?o[0]:c[0],C=C.filter(function(a){return c.indexOf(a)===-1})}}),y.unknownCodecs=C}function S(C,y,f){var c=y[f];c&&(C[f]=c)}function h(C,y){for(var f=C[y],c=y;c--;){var o=C[c];if(!o)return;o.programDateTime=f.programDateTime-o.duration*1e3,f=o}}function g(C,y){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):y!=null&&y.programDateTime&&(C.programDateTime=y.endProgramDateTime),Object(H.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/polyfills/number.ts"),k=L("./src/events.ts"),P=L("./src/errors.ts"),F=L("./src/utils/logger.ts"),M=L("./src/utils/mp4-tools.ts"),D=L("./src/loader/m3u8-parser.ts"),R=L("./src/types/loader.ts"),E=L("./src/utils/attr-list.ts");function w(_){var b=_.type;switch(b){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function T(_,b){var d=_.url;return(d===void 0||d.indexOf("data:")===0)&&(d=b.url),d}var A=function(){function _(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var b=_.prototype;return b.registerListeners=function(){var s=this.hls;s.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(k.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(k.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},b.unregisterListeners=function(){var s=this.hls;s.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(k.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(k.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},b.createInternalLoader=function(s){var u=this.hls.config,l=u.pLoader,S=u.loader,h=l||S,g=new h(u);return s.loader=g,this.loaders[s.type]=g,g},b.getInternalLoader=function(s){return this.loaders[s.type]},b.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},b.destroyInternalLoaders=function(){for(var s in this.loaders){var u=this.loaders[s];u&&u.destroy(),this.resetInternalLoader(s)}},b.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},b.onManifestLoading=function(s,u){var l=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},b.onLevelLoading=function(s,u){var l=u.id,S=u.level,h=u.url,g=u.deliveryDirectives;this.load({id:l,groupId:null,level:S,responseType:"text",type:R.PlaylistContextType.LEVEL,url:h,deliveryDirectives:g})},b.onAudioTrackLoading=function(s,u){var l=u.id,S=u.groupId,h=u.url,g=u.deliveryDirectives;this.load({id:l,groupId:S,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:h,deliveryDirectives:g})},b.onSubtitleTrackLoading=function(s,u){var l=u.id,S=u.groupId,h=u.url,g=u.deliveryDirectives;this.load({id:l,groupId:S,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:h,deliveryDirectives:g})},b.load=function(s){var u,l=this.hls.config,S=this.getInternalLoader(s);if(S){var h=S.context;if(h&&h.url===s.url){F.logger.trace("[playlist-loader]: playlist request ongoing");return}F.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),S.abort()}var g,C,y,f;switch(s.type){case R.PlaylistContextType.MANIFEST:g=l.manifestLoadingMaxRetry,C=l.manifestLoadingTimeOut,y=l.manifestLoadingRetryDelay,f=l.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:g=0,C=l.levelLoadingTimeOut;break;default:g=l.levelLoadingMaxRetry,C=l.levelLoadingTimeOut,y=l.levelLoadingRetryDelay,f=l.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(s),(u=s.deliveryDirectives)!==null&&u!==void 0&&u.part){var c;if(s.type===R.PlaylistContextType.LEVEL&&s.level!==null?c=this.hls.levels[s.level].details:s.type===R.PlaylistContextType.AUDIO_TRACK&&s.id!==null?c=this.hls.audioTracks[s.id].details:s.type===R.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(c=this.hls.subtitleTracks[s.id].details),c){var o=c.partTarget,a=c.targetduration;o&&a&&(C=Math.min(Math.max(o*3,a*.8)*1e3,C))}}var m={timeout:C,maxRetry:g,retryDelay:y,maxRetryDelay:f,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(s,m,p)},b.loadsuccess=function(s,u,l,S){if(S===void 0&&(S=null),l.isSidxRequest){this.handleSidxRequest(s,l),this.handlePlaylistLoaded(s,u,l,S);return}this.resetInternalLoader(l.type);var h=s.data;if(h.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,l,"no EXTM3U delimiter",S);return}u.parsing.start=performance.now(),h.indexOf("#EXTINF:")>0||h.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,u,l,S):this.handleMasterPlaylist(s,u,l,S)},b.loaderror=function(s,u,l){l===void 0&&(l=null),this.handleNetworkError(u,l,!1,s)},b.loadtimeout=function(s,u,l){l===void 0&&(l=null),this.handleNetworkError(u,l,!0)},b.handleMasterPlaylist=function(s,u,l,S){var h=this.hls,g=s.data,C=T(s,l),y=D.default.parseMasterPlaylist(g,C),f=y.levels,c=y.sessionData;if(!f.length){this.handleManifestParsingError(s,l,"no level found in manifest",S);return}var o=f.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),a=f.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),m=D.default.parseMasterPlaylistMedia(g,C,"AUDIO",o),p=D.default.parseMasterPlaylistMedia(g,C,"SUBTITLES",a),v=D.default.parseMasterPlaylistMedia(g,C,"CLOSED-CAPTIONS");if(m.length){var O=m.some(function(U){return!U.url});!O&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new E.AttrList({}),bitrate:0,url:""}))}h.trigger(k.Events.MANIFEST_LOADED,{levels:f,audioTracks:m,subtitles:p,captions:v,url:C,stats:u,networkDetails:S,sessionData:c})},b.handleTrackOrLevelPlaylist=function(s,u,l,S){var h=this.hls,g=l.id,C=l.level,y=l.type,f=T(s,l),c=Object(H.isFiniteNumber)(g)?g:0,o=Object(H.isFiniteNumber)(C)?C:c,a=w(l),m=D.default.parseLevelPlaylist(s.data,f,o,a,c);if(!m.fragments.length){h.trigger(k.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(y===R.PlaylistContextType.MANIFEST){var p={attrs:new E.AttrList({}),bitrate:0,details:m,name:"",url:f};h.trigger(k.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:f,stats:u,networkDetails:S,sessionData:null})}if(u.parsing.end=performance.now(),m.needSidxRanges){var v,O=(v=m.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:O,isSidxRequest:!0,type:y,level:C,levelDetails:m,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=m,this.handlePlaylistLoaded(s,u,l,S)},b.handleSidxRequest=function(s,u){var l=Object(M.parseSegmentIndex)(new Uint8Array(s.data));if(!l)return;var S=l.references,h=u.levelDetails;S.forEach(function(g,C){var y=g.info,f=h.fragments[C];f.byteRange.length===0&&f.setByteRange(String(1+y.end-y.start)+"@"+String(y.start)),f.initSegment&&f.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},b.handleManifestParsingError=function(s,u,l,S){this.hls.trigger(k.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===R.PlaylistContextType.MANIFEST,url:s.url,reason:l,response:s,context:u,networkDetails:S})},b.handleNetworkError=function(s,u,l,S){l===void 0&&(l=!1),F.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var h=P.ErrorDetails.UNKNOWN,g=!1,C=this.getInternalLoader(s);switch(s.type){case R.PlaylistContextType.MANIFEST:h=l?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case R.PlaylistContextType.LEVEL:h=l?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case R.PlaylistContextType.AUDIO_TRACK:h=l?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:h=l?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}C&&this.resetInternalLoader(s.type);var y={type:P.ErrorTypes.NETWORK_ERROR,details:h,fatal:g,url:s.url,loader:C,context:s,networkDetails:u};S&&(y.response=S),this.hls.trigger(k.Events.ERROR,y)},b.handlePlaylistLoaded=function(s,u,l,S){var h=l.type,g=l.level,C=l.id,y=l.groupId,f=l.loader,c=l.levelDetails,o=l.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(s,l,"invalid target duration",S);return}if(!f)return;c.live&&(f.getCacheAge&&(c.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(h){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(k.Events.LEVEL_LOADED,{details:c,level:g||0,id:C||0,stats:u,networkDetails:S,deliveryDirectives:o});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(k.Events.AUDIO_TRACK_LOADED,{details:c,id:C||0,groupId:y||"",stats:u,networkDetails:S,deliveryDirectives:o});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADED,{details:c,id:C||0,groupId:y||"",stats:u,networkDetails:S,deliveryDirectives:o});break}},_}();z.default=A},"./src/polyfills/number.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"isFiniteNumber",function(){return H}),L.d(z,"MAX_SAFE_INTEGER",function(){return k});var H=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},k=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(re,z,L){"use strict";L.r(z);var H=function(){function k(){}return k.getSilentFrame=function(F,M){switch(F){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===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(M===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(M===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(M===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(M===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},k}();z.default=H},"./src/remux/mp4-generator.ts":function(re,z,L){"use strict";L.r(z);var H=Math.pow(2,32)-1,k=function(){function P(){}return P.init=function(){P.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 M;for(M in P.types)P.types.hasOwnProperty(M)&&(P.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var D=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]),R=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]);P.HDLR_TYPES={video:D,audio:R};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=w,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var T=new Uint8Array([105,115,111,109]),A=new Uint8Array([97,118,99,49]),_=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,T,_,T,A),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,E))},P.box=function(M){for(var D=8,R=arguments.length,E=new Array(R>1?R-1:0),w=1;w>24&255,_[1]=D>>16&255,_[2]=D>>8&255,_[3]=D&255,_.set(M,4),T=0,D=8;T>24&255,M>>16&255,M>>8&255,M&255,R>>24,R>>16&255,R>>8&255,R&255,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},P.mdia=function(M){return P.box(P.types.mdia,P.mdhd(M.timescale,M.duration),P.hdlr(M.type),P.minf(M))},P.mfhd=function(M){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},P.minf=function(M){return M.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(M)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(M))},P.moof=function(M,D,R){return P.box(P.types.moof,P.mfhd(M),P.traf(R,D))},P.moov=function(M){for(var D=M.length,R=[];D--;)R[D]=P.trak(M[D]);return P.box.apply(null,[P.types.moov,P.mvhd(M[0].timescale,M[0].duration)].concat(R).concat(P.mvex(M)))},P.mvex=function(M){for(var D=M.length,R=[];D--;)R[D]=P.trex(M[D]);return P.box.apply(null,[P.types.mvex].concat(R))},P.mvhd=function(M,D){D*=M;var R=Math.floor(D/(H+1)),E=Math.floor(D%(H+1)),w=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,R>>24,R>>16&255,R>>8&255,R&255,E>>24,E>>16&255,E>>8&255,E&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 P.box(P.types.mvhd,w)},P.sdtp=function(M){var D=M.samples||[],R=new Uint8Array(4+D.length),E,w;for(E=0;E>>8&255),D.push(T&255),D=D.concat(Array.prototype.slice.call(w));for(E=0;E>>8&255),R.push(T&255),R=R.concat(Array.prototype.slice.call(w));var A=P.box(P.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|M.sps.length].concat(D).concat([M.pps.length]).concat(R))),_=M.width,b=M.height,d=M.pixelRatio[0],s=M.pixelRatio[1];return P.box(P.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,_>>8&255,_&255,b>>8&255,b&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]),A,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,s>>24,s>>16&255,s>>8&255,s&255])))},P.esds=function(M){var D=M.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(M.config).concat([6,1,2]))},P.mp4a=function(M){var D=M.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),P.box(P.types.esds,P.esds(M)))},P.mp3=function(M){var D=M.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},P.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(M)):P.box(P.types.stsd,P.STSD,P.mp4a(M)):P.box(P.types.stsd,P.STSD,P.avc1(M))},P.tkhd=function(M){var D=M.id,R=M.duration*M.timescale,E=M.width,w=M.height,T=Math.floor(R/(H+1)),A=Math.floor(R%(H+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,A>>24,A>>16&255,A>>8&255,A&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,E>>8&255,E&255,0,0,w>>8&255,w&255,0,0]))},P.traf=function(M,D){var R=P.sdtp(M),E=M.id,w=Math.floor(D/(H+1)),T=Math.floor(D%(H+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,T>>24,T>>16&255,T>>8&255,T&255])),P.trun(M,R.length+16+20+8+16+8+8),R)},P.trak=function(M){return M.duration=M.duration||4294967295,P.box(P.types.trak,P.tkhd(M),P.mdia(M))},P.trex=function(M){var D=M.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(M,D){var R=M.samples||[],E=R.length,w=12+16*E,T=new Uint8Array(w),A,_,b,d,s,u;for(D+=8+w,T.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),A=0;A>>24&255,b>>>16&255,b>>>8&255,b&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*A);return P.box(P.types.trun,T)},P.initSegment=function(M){P.types||P.init();var D=P.moov(M),R=new Uint8Array(P.FTYP.byteLength+D.byteLength);return R.set(P.FTYP),R.set(D,P.FTYP.byteLength),R},P}();k.types=void 0,k.HDLR_TYPES=void 0,k.STTS=void 0,k.STSC=void 0,k.STCO=void 0,k.STSZ=void 0,k.VMHD=void 0,k.SMHD=void 0,k.STSD=void 0,k.FTYP=void 0,k.DINF=void 0,z.default=k},"./src/remux/mp4-remuxer.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return u}),L.d(z,"normalizePts",function(){return l});var H=L("./src/polyfills/number.ts"),k=L("./src/remux/aac-helper.ts"),P=L("./src/remux/mp4-generator.ts"),F=L("./src/events.ts"),M=L("./src/errors.ts"),D=L("./src/utils/logger.ts"),R=L("./src/types/loader.ts"),E=L("./src/utils/timescale-conversion.ts");function w(){return w=Object.assign||function(C){for(var y=1;y0?m:p.pts},c[0].pts);return o&&D.logger.debug("PTS rollover detected"),a},y.remux=function(c,o,a,m,p,v,O,U){var j,G,B,N,V,$,ie=p,oe=p,_e=c.pid>-1,fe=o.pid>-1,Se=o.samples.length,be=c.samples.length>0,me=Se>1,le=(!_e||be)&&(!fe||me)||this.ISGenerated||O;if(le){this.ISGenerated||(B=this.generateIS(c,o,p));var ue=this.isVideoContiguous,Ee=-1;if(me&&(Ee=S(o.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,Ee>0){D.logger.warn("[mp4-remuxer]: Dropped "+Ee+" out of "+Se+" video samples due to a missing keyframe");var Ge=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(Ee),o.dropped+=Ee,oe+=(o.samples[0].pts-Ge)/(o.timescale||9e4)}else Ee===-1&&(D.logger.warn("[mp4-remuxer]: No keyframe found out of "+Se+" video samples"),$=!1);if(this.ISGenerated){if(be&&me){var Te=this.getVideoStartPts(o.samples),pe=l(c.samples[0].pts,Te)-Te,Ae=pe/o.inputTimeScale;ie+=Math.max(0,Ae),oe+=Math.max(0,-Ae)}if(be){if(c.samplerate||(D.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(c,o,p)),G=this.remuxAudio(c,ie,this.isAudioContiguous,v,fe||me||U===R.PlaylistLevelType.AUDIO?oe:void 0),me){var Ce=G?G.endPTS-G.startPTS:0;o.inputTimeScale||(D.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(c,o,p)),j=this.remuxVideo(o,oe,ue,Ce)}}else me&&(j=this.remuxVideo(o,oe,ue,0));j&&(j.firstKeyFrame=Ee,j.independent=Ee!==-1)}}return this.ISGenerated&&(a.samples.length&&(V=this.remuxID3(a,p)),m.samples.length&&(N=this.remuxText(m,p))),{audio:G,video:j,initSegment:B,independent:$,text:N,id3:V}},y.generateIS=function(c,o,a){var m=c.samples,p=o.samples,v=this.typeSupported,O={},U=!Object(H.isFiniteNumber)(this._initPTS),j="audio/mp4",G,B,N;if(U&&(G=B=Infinity),c.config&&m.length&&(c.timescale=c.samplerate,c.isAAC||(v.mpeg?(j="audio/mpeg",c.codec=""):v.mp3&&(c.codec="mp3")),O.audio={id:"audio",container:j,codec:c.codec,initSegment:!c.isAAC&&v.mpeg?new Uint8Array(0):P.default.initSegment([c]),metadata:{channelCount:c.channelCount}},U&&(N=c.inputTimeScale,G=B=m[0].pts-Math.round(N*a))),o.sps&&o.pps&&p.length&&(o.timescale=o.inputTimeScale,O.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:P.default.initSegment([o]),metadata:{width:o.width,height:o.height}},U)){N=o.inputTimeScale;var V=this.getVideoStartPts(p),$=Math.round(N*a);B=Math.min(B,l(p[0].dts,V)-$),G=Math.min(G,V-$)}if(Object.keys(O).length)return this.ISGenerated=!0,U&&(this._initPTS=G,this._initDTS=B),{tracks:O,initPTS:G,timescale:N}},y.remuxVideo=function(c,o,a,m){var p=c.inputTimeScale,v=c.samples,O=[],U=v.length,j=this._initPTS,G=this.nextAvcDts,B=8,N,V,$,ie=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,_e=0,fe=!1;if(!a||G===null){var Se=o*p,be=v[0].pts-l(v[0].dts,v[0].pts);G=Se-be}for(var me=0;mele.pts){var ue=9e4*.2;_e=Math.max(Math.min(_e,le.pts-le.dts),-1*ue)}le.dts0?me-1:me].dts&&(fe=!0)}fe&&v.sort(function(gt,yt){var st=gt.dts-yt.dts,_t=gt.pts-yt.pts;return st||_t}),V=v[0].dts,$=v[v.length-1].dts;var Ee=Math.round(($-V)/(U-1));if(_e<0){if(_eEe,we=Ae<-1;if(Ce||we){Ce?D.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(Ae,!0)+" ms ("+Ae+"dts) hole between fragments detected, filling it"):D.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-Ae,!0)+" ms ("+Ae+"dts) overlapping between fragments detected"),V=G;var Be=v[0].pts-Ae;v[0].dts=V,v[0].pts=Be,D.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(Be,!0)+"/"+Object(E.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(Ae,!0)+" ms")}}s&&(V=Math.max(0,V));for(var Qe=0,je=0,De=0;De0?ge-1:ge].dts;if(Q.stretchShortVideoTrack&&this.nextAudioPts!==null){var q=Math.floor(Q.maxBufferHole*p),de=(m?ie+m*p:this.nextAudioPts)-Ye.pts;de>q?(N=de-Z,N<0&&(N=Z),D.logger.log("[mp4-remuxer]: It is approximately "+de/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=Z}else N=Z}var ye=Math.round(Ye.pts-Ye.dts);O.push(new h(Ye.key,N,xe,ye))}if(O.length&&b&&b<70){var Me=O[0].flags;Me.dependsOn=2,Me.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=$+N,this.isVideoContiguous=!0;var et=P.default.moof(c.sequenceNumber++,V,w({},c,{samples:O})),qe="video",at={data1:et,data2:Ke,startPTS:ie/p,endPTS:(oe+N)/p,startDTS:V/p,endDTS:G/p,type:qe,hasAudio:!1,hasVideo:!0,nb:O.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(Ke.length,"MDAT length must not be zero"),at},y.remuxAudio=function(c,o,a,m,p){var v=c.inputTimeScale,O=c.samplerate?c.samplerate:v,U=v/O,j=c.isAAC?A:_,G=j*U,B=this._initPTS,N=!c.isAAC&&this.typeSupported.mpeg,V=[],$=c.samples,ie=N?0:8,oe=this.nextAudioPts||-1,_e=o*v;if(this.isAudioContiguous=a=a||$.length&&oe>0&&(m&&Math.abs(_e-oe)<9e3||Math.abs(l($[0].pts-B,_e)-oe)<20*G),$.forEach(function(ee){ee.pts=l(ee.pts-B,_e)}),!a||oe<0){if($=$.filter(function(ee){return ee.pts>=0}),!$.length)return;p===0?oe=0:m?oe=Math.max(0,_e):oe=$[0].pts}if(c.isAAC)for(var fe=p!==void 0,Se=this.config.maxAudioFramesDrift,be=0,me=oe;be<$.length;be++){var le=$[be],ue=le.pts,Ee=ue-me,Ge=Math.abs(1e3*Ee/v);if(Ee<=-Se*G&&fe)be===0&&(D.logger.warn("Audio frame @ "+(ue/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ee/v)+" ms."),this.nextAudioPts=oe=me=ue);else if(Ee>=Se*G&&Ge0){je+=ie;try{Qe=new Uint8Array(je)}catch(ee){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:je,reason:"fail allocating audio mdat "+je});return}if(!N){var Ke=new DataView(Qe.buffer);Ke.setUint32(0,je),Qe.set(P.default.types.mdat,4)}}else return;Qe.set(Ue,ie);var ze=Ue.byteLength;ie+=ze,V.push(new h(!0,j,ze,0)),Be=We}var ge=V.length;if(!ge)return;var Ye=V[V.length-1];this.nextAudioPts=oe=Be+U*Ye.duration;var He=N?new Uint8Array(0):P.default.moof(c.sequenceNumber++,we/U,w({},c,{samples:V}));c.samples=[];var xe=we/v,Ie=oe/v,se="audio",te={data1:He,data2:Qe,startPTS:xe,endPTS:Ie,startDTS:xe,endDTS:Ie,type:se,hasAudio:!0,hasVideo:!1,nb:ge};return this.isAudioContiguous=!0,console.assert(Qe.length,"MDAT length must not be zero"),te},y.remuxEmptyAudio=function(c,o,a,m){var p=c.inputTimeScale,v=c.samplerate?c.samplerate:p,O=p/v,U=this.nextAudioPts,j=(U!==null?U:m.startDTS*p)+this._initDTS,G=m.endDTS*p+this._initDTS,B=O*A,N=Math.ceil((G-j)/B),V=k.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(D.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){D.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ie=0;ie4294967296;)C+=f;return C}function S(C){for(var y=0;y0?this.lastEndDTS=c:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var o=!!C.audio,a=!!C.video,m="";o&&(m+="audio"),a&&(m+="video");var p={data1:h,startPTS:f,startDTS:f,endPTS:c,endDTS:c,type:m,hasAudio:o,hasVideo:a,nb:1,dropped:0};return S.audio=p.type==="audio"?p:void 0,S.video=p.type!=="audio"?p:void 0,S.text=d,S.id3=b,S.initSegment=g,S},E}(),D=function(w,T,A){return Object(k.getStartDTS)(w,T)-A};function R(E,w){var T=E==null?void 0:E.codec;return T&&T.length>4?T:T==="hvc1"?"hvc1.1.c.L120.90":T==="av01"?"av01.0.04M.08":T==="avc1"||w===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=M},"./src/task-loop.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"default",function(){return H});var H=function(){function k(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=k.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},k}()},"./src/types/cmcd.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"CMCDVersion",function(){return H}),L.d(z,"CMCDObjectType",function(){return k}),L.d(z,"CMCDStreamingFormat",function(){return P}),L.d(z,"CMCDStreamType",function(){return F});var H=1,k;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(k||(k={}));var P;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(P||(P={}));var F;(function(M){M.VOD="v",M.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"HlsSkip",function(){return P}),L.d(z,"getSkipValue",function(){return F}),L.d(z,"HlsUrlParameters",function(){return M}),L.d(z,"Level",function(){return D});function H(R,E){for(var w=0;wNumber.MAX_SAFE_INTEGER?Infinity:E},M.hexadecimalInteger=function(R){if(this[R]){var E=(this[R]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var w=new Uint8Array(E.length/2),T=0;TNumber.MAX_SAFE_INTEGER?Infinity:E},M.decimalFloatingPoint=function(R){return parseFloat(this[R])},M.optionalFloat=function(R,E){var w=this[R];return w?parseFloat(w):E},M.enumeratedString=function(R){return this[R]},M.bool=function(R){return this[R]==="YES"},M.decimalResolution=function(R){var E=H.exec(this[R]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},F.parseAttrList=function(R){var E,w={},T='"';for(k.lastIndex=0;(E=k.exec(R))!==null;){var A=E[2];A.indexOf(T)===0&&A.lastIndexOf(T)===A.length-1&&(A=A.slice(1,-1)),w[E[1]]=A}return w},F}()},"./src/utils/binary-search.ts":function(re,z,L){"use strict";L.r(z);var H={search:function(P,F){for(var M=0,D=P.length-1,R=null,E=null;M<=D;){R=(M+D)/2|0,E=P[R];var w=F(E);if(w>0)M=R+1;else if(w<0)D=R-1;else return E}return null}};z.default=H},"./src/utils/buffer-helper.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"BufferHelper",function(){return P});var H=L("./src/utils/logger.ts"),k={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function F(){}return F.isBuffered=function(D,R){try{if(D){for(var E=F.getBuffered(D),w=0;w=E.start(w)&&R<=E.end(w))return!0}}catch(T){}return!1},F.bufferInfo=function(D,R,E){try{if(D){var w=F.getBuffered(D),T=[],A;for(A=0;A_&&(w[A-1].end=D[T].end):w.push(D[T])}else w.push(D[T])}else w=D;for(var b=0,d,s=R,u=R,l=0;l=S&&R=a&&H.logger.log(this.time+" ["+a+"] "+m)},f}(),b=function(c){for(var o=[],a=0;aM&&(this.logger.log(A.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},c.moveCursor=function(a){var m=this.pos+a;if(a>1)for(var p=this.pos+1;p=144&&this.backSpace();var m=P(a);if(this.pos>=M){this.logger.log(A.ERROR,"Cannot insert "+a.toString(16)+" ("+m+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(m,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(a){var m;for(m=a;m0&&(a?p="["+m.join(" | ")+"]":p=m.join(` `)),p},c.getTextAndFormat=function(){return this.rows},f}(),S=function(){function f(o,a,m){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=o,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new l(m),this.nonDisplayedMemory=new l(m),this.lastOutputScreen=new l(m),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=m}var c=f.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(a){this.outputFilter=a},c.setPAC=function(a){this.writeScreen.setPAC(a)},c.setBkgData=function(a){this.writeScreen.setBkgData(a)},c.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(A.INFO,"MODE="+a),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=a},c.insertChars=function(a){for(var m=0;m=46,m.italics)m.foreground="white";else{var p=Math.floor(a/2)-16,v=["white","green","blue","cyan","red","yellow","magenta"];m.foreground=v[p]}this.logger.log(A.INFO,"MIDROW: "+JSON.stringify(m)),this.writeScreen.setPen(m)},c.outputDataUpdate=function(a){a===void 0&&(a=!1);var m=this.logger.time;if(m===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=m:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,m,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:m),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},f}(),h=function(){function f(o,a,m){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new _;this.channels=[null,new S(o,a,p),new S(o+1,m,p)],this.cmdHistory=y(),this.logger=p}var c=f.prototype;return c.getHandler=function(a){return this.channels[a].getHandler()},c.setHandler=function(a,m){this.channels[a].setHandler(m)},c.addData=function(a,m){var p,v,O,U=!1;this.logger.time=a;for(var j=0;j ("+b([v,O])+")"),p=this.parseCmd(v,O),p||(p=this.parseMidrow(v,O)),p||(p=this.parsePAC(v,O)),p||(p=this.parseBackgroundAttributes(v,O)),!p&&(U=this.parseChars(v,O),U)){var G=this.currentChannel;if(G&&G>0){var B=this.channels[G];B.insertChars(U)}else this.logger.log(A.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!U&&this.logger.log(A.WARNING,"Couldn't parse cleaned data "+b([v,O])+" orig: "+b([m[j],m[j+1]]))}},c.parseCmd=function(a,m){var p=this.cmdHistory,v=(a===20||a===28||a===21||a===29)&&m>=32&&m<=47,O=(a===23||a===31)&&m>=33&&m<=35;if(!(v||O))return!1;if(C(a,m,p))return g(null,null,p),this.logger.log(A.DEBUG,"Repeated command ("+b([a,m])+") is dropped"),!0;var U=a===20||a===21||a===23?1:2,j=this.channels[U];return a===20||a===21||a===28||a===29?m===32?j.ccRCL():m===33?j.ccBS():m===34?j.ccAOF():m===35?j.ccAON():m===36?j.ccDER():m===37?j.ccRU(2):m===38?j.ccRU(3):m===39?j.ccRU(4):m===40?j.ccFON():m===41?j.ccRDC():m===42?j.ccTR():m===43?j.ccRTD():m===44?j.ccEDM():m===45?j.ccCR():m===46?j.ccENM():m===47&&j.ccEOC():j.ccTO(m-32),g(a,m,p),this.currentChannel=U,!0},c.parseMidrow=function(a,m){var p=0;if((a===17||a===25)&&m>=32&&m<=47){if(a===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(A.ERROR,"Mismatch channel in midrow parsing"),!1;var v=this.channels[p];return v?(v.ccMIDROW(m),this.logger.log(A.DEBUG,"MIDROW ("+b([a,m])+")"),!0):!1}return!1},c.parsePAC=function(a,m){var p,v=this.cmdHistory,O=(a>=17&&a<=23||a>=25&&a<=31)&&m>=64&&m<=127,U=(a===16||a===24)&&m>=64&&m<=95;if(!(O||U))return!1;if(C(a,m,v))return g(null,null,v),!0;var j=a<=23?1:2;m>=64&&m<=95?p=j===1?D[a]:E[a]:p=j===1?R[a]:w[a];var G=this.channels[j];return G?(G.setPAC(this.interpretPAC(p,m)),g(a,m,v),this.currentChannel=j,!0):!1},c.interpretPAC=function(a,m){var p,v={color:null,italics:!1,indent:null,underline:!1,row:a};return m>95?p=m-96:p=m-64,v.underline=(p&1)===1,p<=13?v.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(v.italics=!0,v.color="white"):v.indent=Math.floor((p-16)/2)*4,v},c.parseChars=function(a,m){var p,v=null,O=null;if(a>=25?(p=2,O=a-8):(p=1,O=a),O>=17&&O<=19){var U;O===17?U=m+80:O===18?U=m+112:U=m+144,this.logger.log(A.INFO,"Special char '"+P(U)+"' in channel "+p),v=[U]}else a>=32&&a<=127&&(v=m===0?[a]:[a,m]);if(v){var j=b(v);this.logger.log(A.DEBUG,"Char codes = "+j.join(",")),g(a,m,this.cmdHistory)}return v},c.parseBackgroundAttributes=function(a,m){var p=(a===16||a===24)&&m>=32&&m<=47,v=(a===23||a===31)&&m>=45&&m<=47;if(!(p||v))return!1;var O,U={};a===16||a===24?(O=Math.floor((m-32)/2),U.background=T[O],m%2===1&&(U.background=U.background+"_semi")):m===45?U.background="transparent":(U.foreground="black",m===47&&(U.underline=!0));var j=a<=23?1:2,G=this.channels[j];return G.setBkgData(U),g(a,m,this.cmdHistory),!0},c.reset=function(){for(var a=0;a=16?s--:s++;var g=Object(H.fixLineBreaks)(u.trim()),C=Object(k.generateCueId)(E,w,g);(!R||!R.cues||!R.cues.getCueById(C))&&(b=new l(E,w,g),b.id=C,b.line=S+1,b.align="left",b.position=10+Math.min(80,Math.floor(s*8/32)*10),A.push(b))}return R&&A.length&&(A.sort(function(y,f){return y.line==="auto"||f.line==="auto"?0:y.line>8&&f.line>8?f.line-y.line:y.line-f.line}),A.forEach(function(y){return Object(P.addCueToTrack)(R,y)})),A}};z.default=M},"./src/utils/discontinuities.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"findFirstFragWithCC",function(){return F}),L.d(z,"shouldAlignOnDiscontinuities",function(){return M}),L.d(z,"findDiscontinuousReferenceFrag",function(){return D}),L.d(z,"adjustSlidingStart",function(){return E}),L.d(z,"alignStream",function(){return w}),L.d(z,"alignPDT",function(){return A}),L.d(z,"alignFragmentByPDTDelta",function(){return _}),L.d(z,"alignMediaPlaylistByPDT",function(){return b});var H=L("./src/polyfills/number.ts"),k=L("./src/utils/logger.ts"),P=L("./src/controller/level-helper.ts");function F(d,s){for(var u=null,l=0,S=d.length;lu.startCC||d&&d.cc=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},P}();z.default=k},"./src/utils/ewma.ts":function(re,z,L){"use strict";L.r(z);var H=function(){function k(F,M,D){M===void 0&&(M=0),D===void 0&&(D=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=F,this.alpha_=F?Math.exp(Math.log(.5)/F):0,this.estimate_=M,this.totalWeight_=D}var P=k.prototype;return P.sample=function(M,D){var R=Math.pow(this.alpha_,M);this.estimate_=D*(1-R)+R*this.estimate_,this.totalWeight_+=M},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},k}();z.default=H},"./src/utils/fetch-loader.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"fetchSupported",function(){return _});var H=L("./src/polyfills/number.ts"),k=L("./src/loader/load-stats.ts"),P=L("./src/demux/chunk-cache.ts");function F(l,S){l.prototype=Object.create(S.prototype),l.prototype.constructor=l,w(l,S)}function M(l){var S=typeof Map=="function"?new Map:void 0;return M=function(g){if(g===null||!E(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(g))return S.get(g);S.set(g,C)}function C(){return D(g,arguments,T(this).constructor)}return C.prototype=Object.create(g.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),w(C,g)},M(l)}function D(l,S,h){return R()?D=Reflect.construct:D=function(C,y,f){var c=[null];c.push.apply(c,y);var o=Function.bind.apply(C,c),a=new o;return f&&w(a,f.prototype),a},D.apply(null,arguments)}function R(){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(l){return!1}}function E(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function w(l,S){return w=Object.setPrototypeOf||function(g,C){return g.__proto__=C,g},w(l,S)}function T(l){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},T(l)}function A(){return A=Object.assign||function(l){for(var S=1;S=f&&c(C,y,o.flush(),g)):c(C,y,O,g),p()}).catch(function(){return Promise.reject()})};return m()},l}();function d(l,S){var h={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(A({},l.headers))};return l.rangeEnd&&h.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),h}function s(l,S){return new self.Request(l.url,S)}var u=function(l){F(S,l);function S(h,g,C){var y;return y=l.call(this,h)||this,y.code=void 0,y.details=void 0,y.code=g,y.details=C,y}return S}(M(Error));z.default=b},"./src/utils/imsc1-ttml-parser.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"IMSC1_CODEC",function(){return E}),L.d(z,"parseIMSC1",function(){return _});var H=L("./src/utils/mp4-tools.ts"),k=L("./src/utils/vttparser.ts"),P=L("./src/utils/vttcue.ts"),F=L("./src/demux/id3.ts"),M=L("./src/utils/timescale-conversion.ts"),D=L("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(f){for(var c=1;c"):H}function M(E){for(var w=arguments.length,T=new Array(w>1?w-1:0),A=1;A>24,S[h+1]=g>>16&255,S[h+2]=g>>8&255,S[h+3]=g&255}function w(S,h){var g=[];if(!h.length)return g;var C,y,f;"data"in S?(C=S.data,y=S.start,f=S.end):(C=S,y=0,f=C.byteLength);for(var c=y;c1?c+o:f;if(a===h[0])if(h.length===1)g.push({data:C,start:c+8,end:m});else{var p=w({data:C,start:c+8,end:m},h.slice(1));p.length&&F.apply(g,p)}c=m}return g}function T(S){var h=w(S,["moov"]),g=h[0],C=g?g.end:null,y=w(S,["sidx"]);if(!y||!y[0])return null;var f=[],c=y[0],o=c.data[0],a=o===0?8:16,m=R(c,a);a+=4;var p=0,v=0;o===0?a+=8:a+=16,a+=2;var O=c.end+v,U=D(c,a);a+=2;for(var j=0;j>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=R(c,G);G+=4,f.push({referenceSize:N,subsegmentDuration:$,info:{duration:$/m,start:O,end:O+N-1}}),O+=N,G+=4,a=G}return{earliestPresentationTime:p,timescale:m,version:o,referencesCount:U,references:f,moovEndOffset:C}}function A(S){for(var h=[],g=w(S,["moov","trak"]),C=0;CM)&&(this.startTime=M),this.endTime=D,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},k}()},"./src/utils/texttrack-utils.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"sendAddTrackEvent",function(){return k}),L.d(z,"addCueToTrack",function(){return P}),L.d(z,"clearCurrentCues",function(){return F}),L.d(z,"removeCuesInRange",function(){return M}),L.d(z,"getCuesInRange",function(){return R});var H=L("./src/utils/logger.ts");function k(E,w){var T;try{T=new Event("addtrack")}catch(A){T=document.createEvent("Event"),T.initEvent("addtrack",!1,!1)}T.track=E,w.dispatchEvent(T)}function P(E,w){var T=E.mode;if(T==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(w.id))try{if(E.addCue(w),!E.cues.getCueById(w.id))throw new Error("addCue is failed for: "+w)}catch(_){H.logger.debug("[texttrack-utils]: "+_);var A=new self.TextTrackCue(w.startTime,w.endTime,w.text);A.id=w.id,E.addCue(A)}T==="disabled"&&(E.mode=T)}function F(E){var w=E.mode;if(w==="disabled"&&(E.mode="hidden"),E.cues)for(var T=E.cues.length;T--;)E.removeCue(E.cues[T]);w==="disabled"&&(E.mode=w)}function M(E,w,T){var A=E.mode;if(A==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var _=R(E.cues,w,T),b=0;b<_.length;b++)E.removeCue(_[b]);A==="disabled"&&(E.mode=A)}function D(E,w){if(wE[T].endTime)return-1;for(var A=0,_=T;A<=_;){var b=Math.floor((_+A)/2);if(wE[b].startTime&&A-1)for(var b=_,d=E.length;b=w&&s.endTime<=T)A.push(s);else if(s.startTime>T)return A}return A}},"./src/utils/time-ranges.ts":function(re,z,L){"use strict";L.r(z);var H={toString:function(P){for(var F="",M=P.length,D=0;D1?w-1:0),A=1;A100)throw new Error("Position must be between 0 and 100.");f=p,this.hasBeenReset=!0}})),Object.defineProperty(A,"positionAlign",D({},_,{get:function(){return c},set:function(p){var v=M(p);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");c=v,this.hasBeenReset=!0}})),Object.defineProperty(A,"size",D({},_,{get:function(){return o},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(A,"align",D({},_,{get:function(){return a},set:function(p){var v=M(p);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");a=v,this.hasBeenReset=!0}})),A.displayState=void 0}return R.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"parseTimeStamp",function(){return P}),L.d(z,"fixLineBreaks",function(){return w}),L.d(z,"VTTParser",function(){return T});var H=L("./src/utils/vttcue.ts"),k=function(){function A(){}var _=A.prototype;return _.decode=function(d,s){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},A}();function P(A){function _(d,s,u,l){return(d|0)*3600+(s|0)*60+(u|0)+parseFloat(l||0)}var b=A.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return b?parseFloat(b[2])>59?_(b[2],b[3],0,b[4]):_(b[1],b[2],b[3],b[4]):null}var F=function(){function A(){this.values=Object.create(null)}var _=A.prototype;return _.set=function(d,s){!this.get(d)&&s!==""&&(this.values[d]=s)},_.get=function(d,s,u){return u?this.has(d)?this.values[d]:s[u]:this.has(d)?this.values[d]:s},_.has=function(d){return d in this.values},_.alt=function(d,s,u){for(var l=0;l=0&&u<=100)return this.set(d,u),!0}return!1},A}();function M(A,_,b,d){var s=d?A.split(d):[A];for(var u in s){if(typeof s[u]!="string")continue;var l=s[u].split(b);if(l.length!==2)continue;var S=l[0],h=l[1];_(S,h)}}var D=new H.default(0,0,""),R=D.align==="middle"?"middle":"center";function E(A,_,b){var d=A;function s(){var S=P(A);if(S===null)throw new Error("Malformed timestamp: "+d);return A=A.replace(/^[^\sa-zA-Z-]+/,""),S}function u(S,h){var g=new F;M(S,function(f,c){var o;switch(f){case"region":for(var a=b.length-1;a>=0;a--)if(b[a].id===c){g.set(f,b[a].region);break}break;case"vertical":g.alt(f,c,["rl","lr"]);break;case"line":o=c.split(","),g.integer(f,o[0]),g.percent(f,o[0])&&g.set("snapToLines",!1),g.alt(f,o[0],["auto"]),o.length===2&&g.alt("lineAlign",o[1],["start",R,"end"]);break;case"position":o=c.split(","),g.percent(f,o[0]),o.length===2&&g.alt("positionAlign",o[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":g.percent(f,c);break;case"align":g.alt(f,c,["start",R,"end","left","right"]);break}},/:/,/\s/),h.region=g.get("region",null),h.vertical=g.get("vertical","");var C=g.get("line","auto");C==="auto"&&D.line===-1&&(C=-1),h.line=C,h.lineAlign=g.get("lineAlign","start"),h.snapToLines=g.get("snapToLines",!0),h.size=g.get("size",100),h.align=g.get("align",R);var y=g.get("position","auto");y==="auto"&&D.position===50&&(y=h.align==="start"||h.align==="left"?0:h.align==="end"||h.align==="right"?100:50),h.position=y}function l(){A=A.replace(/^\s+/,"")}if(l(),_.startTime=s(),l(),A.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);A=A.substr(3),l(),_.endTime=s(),l(),u(A,_)}function w(A){return A.replace(//gi,` `)}var T=function(){function A(){this.state="INITIAL",this.buffer="",this.decoder=new k,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var _=A.prototype;return _.parse=function(d){var s=this;d&&(s.buffer+=s.decoder.decode(d,{stream:!0}));function u(){var y=s.buffer,f=0;for(y=w(y);f")===-1){s.cue.id=S;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{E(S,s.cue,s.regionList)}catch(y){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var C=S.indexOf("-->")!==-1;if(!S||C&&(g=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=` `),s.cue.text+=S}continue;case"BADCUE":S||(s.state="ID")}}}catch(y){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},_.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=` `,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){d.onparsingerror&&d.onparsingerror(s)}return d.onflush&&d.onflush(),this},A}()},"./src/utils/webvtt-parser.ts":function(re,z,L){"use strict";L.r(z),L.d(z,"generateCueId",function(){return T}),L.d(z,"parseWebVTT",function(){return _});var H=L("./src/polyfills/number.ts"),k=L("./src/utils/vttparser.ts"),P=L("./src/demux/id3.ts"),F=L("./src/utils/timescale-conversion.ts"),M=L("./src/remux/mp4-remuxer.ts"),D=/\r\n|\n\r|\n|\r/g,R=function(d,s,u){return u===void 0&&(u=0),d.substr(u,s.length)===s},E=function(d){var s=parseInt(d.substr(-3)),u=parseInt(d.substr(-6,2)),l=parseInt(d.substr(-9,2)),S=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(H.isFiniteNumber)(s)||!Object(H.isFiniteNumber)(u)||!Object(H.isFiniteNumber)(l)||!Object(H.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return s+=1e3*u,s+=60*1e3*l,s+=60*60*1e3*S,s},w=function(d){for(var s=5381,u=d.length;u;)s=s*33^d.charCodeAt(--u);return(s>>>0).toString()};function T(b,d,s){return w(b.toString())+w(d.toString())+w(s)}var A=function(d,s,u){var l=d[s],S=d[l.prevCC];if(!S||!S.new&&l.new){d.ccOffset=d.presentationOffset=l.start,l.new=!1;return}for(;(h=S)!==null&&h!==void 0&&h.new;){var h;d.ccOffset+=l.start-S.start,l.new=!1,l=S,S=d[l.prevCC]}d.presentationOffset=u};function _(b,d,s,u,l,S,h,g){var C=new k.VTTParser,y=Object(P.utf8ArrayToStr)(new Uint8Array(b)).trim().replace(D,` `).split(` `),f=[],c=Object(F.toMpegTsClockFromTimescale)(d,s),o="00:00.000",a=0,m=0,p,v=!0,O=!1;C.oncue=function(U){var j=u[l],G=u.ccOffset,B=(a-c)/9e4;if(j!=null&&j.new&&(m!==void 0?G=u.ccOffset=j.start:A(u,l,B)),B&&(G=B-u.presentationOffset),O){var N=U.endTime-U.startTime,V=Object(M.normalizePts)((U.startTime+G-m)*9e4,S*9e4)/9e4;U.startTime=V,U.endTime=V+N}var $=U.text.trim();U.text=decodeURIComponent(encodeURIComponent($)),U.id||(U.id=T(U.startTime,U.endTime,$)),U.endTime>0&&f.push(U)},C.onparsingerror=function(U){p=U},C.onflush=function(){if(p){g(p);return}h(f)},y.forEach(function(U){if(v)if(R(U,"X-TIMESTAMP-MAP=")){v=!1,O=!0,U.substr(16).split(",").forEach(function(j){R(j,"LOCAL:")?o=j.substr(6):R(j,"MPEGTS:")&&(a=parseInt(j.substr(7)))});try{m=E(o)/1e3}catch(j){O=!1,p=j}return}else U===""&&(v=!1);C.parse(U+` `)}),C.flush()}},"./src/utils/xhr-loader.ts":function(re,z,L){"use strict";L.r(z);var H=L("./src/utils/logger.ts"),k=L("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,F=function(){function M(R){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=R?R.xhrSetup:null,this.stats=new k.LoadStats,this.retryDelay=0}var D=M.prototype;return D.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},D.abortInternal=function(){var E=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),E&&(E.onreadystatechange=null,E.onprogress=null,E.readyState!==4&&(this.stats.aborted=!0,E.abort()))},D.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},D.load=function(E,w,T){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=E,this.config=w,this.callbacks=T,this.retryDelay=w.retryDelay,this.loadInternal()},D.loadInternal=function(){var E=this.config,w=this.context;if(!E)return;var T=this.loader=new self.XMLHttpRequest,A=this.stats;A.loading.first=0,A.loaded=0;var _=this.xhrSetup;try{if(_)try{_(T,w.url)}catch(s){T.open("GET",w.url,!0),_(T,w.url)}T.readyState||T.open("GET",w.url,!0);var b=this.context.headers;if(b)for(var d in b)T.setRequestHeader(d,b[d])}catch(s){this.callbacks.onError({code:T.status,text:s.message},w,T);return}w.rangeEnd&&T.setRequestHeader("Range","bytes="+w.rangeStart+"-"+(w.rangeEnd-1)),T.onreadystatechange=this.readystatechange.bind(this),T.onprogress=this.loadprogress.bind(this),T.responseType=w.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),T.send()},D.readystatechange=function(){var E=this.context,w=this.loader,T=this.stats;if(!E||!w)return;var A=w.readyState,_=this.config;if(T.aborted)return;if(A>=2)if(self.clearTimeout(this.requestTimeout),T.loading.first===0&&(T.loading.first=Math.max(self.performance.now(),T.loading.start)),A===4){w.onreadystatechange=null,w.onprogress=null;var b=w.status;if(b>=200&&b<300){T.loading.end=Math.max(self.performance.now(),T.loading.first);var d,s;if(E.responseType==="arraybuffer"?(d=w.response,s=d.byteLength):(d=w.responseText,s=d.length),T.loaded=T.total=s,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(T,E,d,w),!this.callbacks)return;var l={url:w.responseURL,data:d};this.callbacks.onSuccess(l,T,E,w)}else T.retry>=_.maxRetry||b>=400&&b<499?(H.logger.error(b+" while loading "+E.url),this.callbacks.onError({code:b,text:w.statusText},E,w)):(H.logger.warn(b+" while loading "+E.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,_.maxRetryDelay),T.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),_.timeout)},D.loadtimeout=function(){H.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},D.loadprogress=function(E){var w=this.stats;w.loaded=E.loaded,E.lengthComputable&&(w.total=E.total)},D.getCacheAge=function(){var E=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var w=this.loader.getResponseHeader("age");E=w?parseFloat(w):null}return E},M}();z.default=F}}).default})},vHTk:function(ut,$e,J){ut.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wMS7:function(ut,$e,J){/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */(function(re,z){ut.exports=z()})(this,function(){"use strict";function re(Te){if(Array.isArray(Te)){for(var pe=0,Ae=Array(Te.length);pe1?Ae-1:0),we=1;we/gm),ie=F(/^data-[\-\w.\u00B7-\uFFFF]/),oe=F(/^aria-[\-\w]+$/),_e=F(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fe=F(/^(?:\w+script|data):/i),Se=F(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te};function me(Te){if(Array.isArray(Te)){for(var pe=0,Ae=Array(Te.length);pe0&&arguments[0]!==void 0?arguments[0]:le(),pe=function(ve){return Ee(ve)};if(pe.version="2.0.15",pe.removed=[],!Te||!Te.document||Te.document.nodeType!==9)return pe.isSupported=!1,pe;var Ae=Te.document,Ce=!1,we=Te.document,Be=Te.DocumentFragment,Qe=Te.HTMLTemplateElement,je=Te.Node,De=Te.NodeFilter,Pe=Te.NamedNodeMap,Le=Pe===void 0?Te.NamedNodeMap||Te.MozNamedAttrMap:Pe,Re=Te.Text,Ue=Te.Comment,We=Te.DOMParser,ke=Te.trustedTypes;if(typeof Qe=="function"){var Ke=we.createElement("template");Ke.content&&Ke.content.ownerDocument&&(we=Ke.content.ownerDocument)}var ze=ue(ke,Ae),ge=ze&&kt?ze.createHTML(""):"",Ye=we,He=Ye.implementation,xe=Ye.createNodeIterator,Ie=Ye.getElementsByTagName,se=Ye.createDocumentFragment,te=Ae.importNode,ee=a(we).documentMode?we.documentMode:{},Y={};pe.isSupported=He&&typeof He.createHTMLDocument!="undefined"&&ee!==9;var Q=V,Z=$,q=ie,de=oe,ye=fe,Me=Se,et=_e,qe=null,at=o({},[].concat(me(m),me(p),me(v),me(O),me(U))),gt=null,yt=o({},[].concat(me(j),me(G),me(B),me(N))),st=null,_t=null,xt=!0,Bt=!0,Dt=!1,pt=!1,Nt=!1,rr=!1,Gt=!1,Vt=!1,Xt=!1,Pr=!1,Ht=!1,kt=!1,jt=!0,Ot=!0,tt=!1,Yt={},Nr=o({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),fr=null,St=o({},["audio","video","img","source","image","track"]),hr=null,gr=o({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),nr=null,Fe=we.createElement("form"),dt=function(ve){if(nr&&nr===ve)return;(!ve||(typeof ve=="undefined"?"undefined":be(ve))!=="object")&&(ve={}),ve=a(ve),qe="ALLOWED_TAGS"in ve?o({},ve.ALLOWED_TAGS):at,gt="ALLOWED_ATTR"in ve?o({},ve.ALLOWED_ATTR):yt,hr="ADD_URI_SAFE_ATTR"in ve?o(a(gr),ve.ADD_URI_SAFE_ATTR):gr,fr="ADD_DATA_URI_TAGS"in ve?o(a(St),ve.ADD_DATA_URI_TAGS):St,st="FORBID_TAGS"in ve?o({},ve.FORBID_TAGS):{},_t="FORBID_ATTR"in ve?o({},ve.FORBID_ATTR):{},Yt="USE_PROFILES"in ve?ve.USE_PROFILES:!1,xt=ve.ALLOW_ARIA_ATTR!==!1,Bt=ve.ALLOW_DATA_ATTR!==!1,Dt=ve.ALLOW_UNKNOWN_PROTOCOLS||!1,pt=ve.SAFE_FOR_JQUERY||!1,Nt=ve.SAFE_FOR_TEMPLATES||!1,rr=ve.WHOLE_DOCUMENT||!1,Xt=ve.RETURN_DOM||!1,Pr=ve.RETURN_DOM_FRAGMENT||!1,Ht=ve.RETURN_DOM_IMPORT||!1,kt=ve.RETURN_TRUSTED_TYPE||!1,Vt=ve.FORCE_BODY||!1,jt=ve.SANITIZE_DOM!==!1,Ot=ve.KEEP_CONTENT!==!1,tt=ve.IN_PLACE||!1,et=ve.ALLOWED_URI_REGEXP||et,Nt&&(Bt=!1),Pr&&(Xt=!0),Yt&&(qe=o({},[].concat(me(U))),gt=[],Yt.html===!0&&(o(qe,m),o(gt,j)),Yt.svg===!0&&(o(qe,p),o(gt,G),o(gt,N)),Yt.svgFilters===!0&&(o(qe,v),o(gt,G),o(gt,N)),Yt.mathMl===!0&&(o(qe,O),o(gt,B),o(gt,N))),ve.ADD_TAGS&&(qe===at&&(qe=a(qe)),o(qe,ve.ADD_TAGS)),ve.ADD_ATTR&&(gt===yt&&(gt=a(gt)),o(gt,ve.ADD_ATTR)),ve.ADD_URI_SAFE_ATTR&&o(hr,ve.ADD_URI_SAFE_ATTR),Ot&&(qe["#text"]=!0),rr&&o(qe,["html","head","body"]),qe.table&&(o(qe,["tbody"]),delete st.tbody),P&&P(ve),nr=ve},_r=function(ve){b(pe.removed,{element:ve});try{ve.parentNode.removeChild(ve)}catch(nt){ve.outerHTML=ge}},vr=function(ve,nt){try{b(pe.removed,{attribute:nt.getAttributeNode(ve),from:nt})}catch(lt){b(pe.removed,{attribute:null,from:nt})}nt.removeAttribute(ve)},Ve=function(ve){var nt=void 0,lt=void 0;if(Vt)ve=""+ve;else{var At=u(ve,/^[\r\n\t ]+/);lt=At&&At[0]}var Jt=ze?ze.createHTML(ve):ve;try{nt=new We().parseFromString(Jt,"text/html")}catch(Ut){}if(Ce&&o(st,["title"]),!nt||!nt.documentElement){nt=He.createHTMLDocument("");var ar=nt,Kt=ar.body;Kt.parentNode.removeChild(Kt.parentNode.firstElementChild),Kt.outerHTML=Jt}return ve&<&&nt.body.insertBefore(we.createTextNode(lt),nt.body.childNodes[0]||null),Ie.call(nt,rr?"html":"body")[0]};pe.isSupported&&function(){try{var ot=Ve("</title><img>");g(/<\/title/,ot.querySelector("title").innerHTML)&&(Ce=!0)}catch(ve){}}();var wr=function(ve){return xe.call(ve.ownerDocument||ve,ve,De.SHOW_ELEMENT|De.SHOW_COMMENT|De.SHOW_TEXT,function(){return De.FILTER_ACCEPT},!1)},jr=function(ve){return ve instanceof Re||ve instanceof Ue?!1:typeof ve.nodeName!="string"||typeof ve.textContent!="string"||typeof ve.removeChild!="function"||!(ve.attributes instanceof Le)||typeof ve.removeAttribute!="function"||typeof ve.setAttribute!="function"||typeof ve.namespaceURI!="string"},ct=function(ve){return(typeof je=="undefined"?"undefined":be(je))==="object"?ve instanceof je:ve&&(typeof ve=="undefined"?"undefined":be(ve))==="object"&&typeof ve.nodeType=="number"&&typeof ve.nodeName=="string"},Ct=function(ve,nt,lt){if(!Y[ve])return;w(Y[ve],function(At){At.call(pe,nt,lt,nr)})},Ur=function(ve){var nt=void 0;if(Ct("beforeSanitizeElements",ve,null),jr(ve))return _r(ve),!0;if(u(ve.nodeName,/[\u0080-\uFFFF]/))return _r(ve),!0;var lt=s(ve.nodeName);if(Ct("uponSanitizeElement",ve,{tagName:lt,allowedTags:qe}),(lt==="svg"||lt==="math")&&ve.querySelectorAll("p, br").length!==0)return _r(ve),!0;if(!qe[lt]||st[lt]){if(Ot&&!Nr[lt]&&typeof ve.insertAdjacentHTML=="function")try{var At=ve.innerHTML;ve.insertAdjacentHTML("AfterEnd",ze?ze.createHTML(At):At)}catch(Jt){}return _r(ve),!0}return lt==="noscript"&&g(/<\/noscript/i,ve.innerHTML)||lt==="noembed"&&g(/<\/noembed/i,ve.innerHTML)?(_r(ve),!0):(pt&&!ct(ve.firstElementChild)&&(!ct(ve.content)||!ct(ve.content.firstElementChild))&&g(/</g,ve.textContent)&&(b(pe.removed,{element:ve.cloneNode()}),ve.innerHTML?ve.innerHTML=l(ve.innerHTML,/</g,"<"):ve.innerHTML=l(ve.textContent,/</g,"<")),Nt&&ve.nodeType===3&&(nt=ve.textContent,nt=l(nt,Q," "),nt=l(nt,Z," "),ve.textContent!==nt&&(b(pe.removed,{element:ve.cloneNode()}),ve.textContent=nt)),Ct("afterSanitizeElements",ve,null),!1)},xr=function(ve,nt,lt){if(jt&&(nt==="id"||nt==="name")&&(lt in we||lt in Fe))return!1;if(!(Bt&&g(q,nt))){if(!(xt&&g(de,nt))){if(!gt[nt]||_t[nt])return!1;if(!hr[nt]){if(!g(et,l(lt,Me,""))){if(!((nt==="src"||nt==="xlink:href"||nt==="href")&&ve!=="script"&&S(lt,"data:")===0&&fr[ve])){if(!(Dt&&!g(ye,l(lt,Me,"")))){if(lt)return!1}}}}}}return!0},ht=function(ve){var nt=void 0,lt=void 0,At=void 0,Jt=void 0,ar=void 0;Ct("beforeSanitizeAttributes",ve,null);var Kt=ve.attributes;if(!Kt)return;var Ut={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:gt};for(ar=Kt.length;ar--;){nt=Kt[ar];var Ln=nt,Mr=Ln.name,Wr=Ln.namespaceURI;if(lt=h(nt.value),At=s(Mr),Ut.attrName=At,Ut.attrValue=lt,Ut.keepAttr=!0,Ut.forceKeepAttr=void 0,Ct("uponSanitizeAttribute",ve,Ut),lt=Ut.attrValue,Ut.forceKeepAttr)continue;if(At==="name"&&ve.nodeName==="IMG"&&Kt.id)Jt=Kt.id,Kt=d(Kt,[]),vr("id",ve),vr(Mr,ve),T(Kt,Jt)>ar&&ve.setAttribute("id",Jt.value);else{if(ve.nodeName==="INPUT"&&At==="type"&<==="file"&&Ut.keepAttr&&(gt[At]||!_t[At]))continue;Mr==="id"&&ve.setAttribute(Mr,""),vr(Mr,ve)}if(!Ut.keepAttr)continue;if(pt&&g(/\/>/i,lt)){vr(Mr,ve);continue}if(g(/svg|math/i,ve.namespaceURI)&&g(C("</("+A(k(Nr),"|")+")","i"),lt)){vr(Mr,ve);continue}Nt&&(lt=l(lt,Q," "),lt=l(lt,Z," "));var Cr=ve.nodeName.toLowerCase();if(!xr(Cr,At,lt))continue;try{Wr?ve.setAttributeNS(Wr,Mr,lt):ve.setAttribute(Mr,lt),_(pe.removed)}catch(wi){}}Ct("afterSanitizeAttributes",ve,null)},wt=function ot(ve){var nt=void 0,lt=wr(ve);for(Ct("beforeSanitizeShadowDOM",ve,null);nt=lt.nextNode();){if(Ct("uponSanitizeShadowNode",nt,null),Ur(nt))continue;nt.content instanceof Be&&ot(nt.content),ht(nt)}Ct("afterSanitizeShadowDOM",ve,null)};return pe.sanitize=function(ot,ve){var nt=void 0,lt=void 0,At=void 0,Jt=void 0,ar=void 0;if(ot||(ot="<!-->"),typeof ot!="string"&&!ct(ot)){if(typeof ot.toString!="function")throw y("toString is not a function");if(ot=ot.toString(),typeof ot!="string")throw y("dirty is not a string, aborting")}if(!pe.isSupported){if(be(Te.toStaticHTML)==="object"||typeof Te.toStaticHTML=="function"){if(typeof ot=="string")return Te.toStaticHTML(ot);if(ct(ot))return Te.toStaticHTML(ot.outerHTML)}return ot}if(Gt||dt(ve),pe.removed=[],typeof ot=="string"&&(tt=!1),!tt)if(ot instanceof je)nt=Ve("<!-->"),lt=nt.ownerDocument.importNode(ot,!0),lt.nodeType===1&<.nodeName==="BODY"||lt.nodeName==="HTML"?nt=lt:nt.appendChild(lt);else{if(!Xt&&!Nt&&!rr&&ot.indexOf("<")===-1)return ze&&kt?ze.createHTML(ot):ot;if(nt=Ve(ot),!nt)return Xt?null:ge}nt&&Vt&&_r(nt.firstChild);for(var Kt=wr(tt?ot:nt);At=Kt.nextNode();){if(At.nodeType===3&&At===Jt)continue;if(Ur(At))continue;At.content instanceof Be&&wt(At.content),ht(At),Jt=At}if(Jt=null,tt)return ot;if(Xt){if(Pr)for(ar=se.call(nt.ownerDocument);nt.firstChild;)ar.appendChild(nt.firstChild);else ar=nt;return Ht&&(ar=te.call(Ae,ar,!0)),ar}var Ut=rr?nt.outerHTML:nt.innerHTML;return Nt&&(Ut=l(Ut,Q," "),Ut=l(Ut,Z," ")),ze&&kt?ze.createHTML(Ut):Ut},pe.setConfig=function(ot){dt(ot),Gt=!0},pe.clearConfig=function(){nr=null,Gt=!1},pe.isValidAttribute=function(ot,ve,nt){nr||dt({});var lt=s(ot),At=s(ve);return xr(lt,At,nt)},pe.addHook=function(ot,ve){if(typeof ve!="function")return;Y[ot]=Y[ot]||[],b(Y[ot],ve)},pe.removeHook=function(ot){Y[ot]&&_(Y[ot])},pe.removeHooks=function(ot){Y[ot]&&(Y[ot]=[])},pe.removeAllHooks=function(){Y={}},pe}var Ge=Ee();return Ge})},zeoU:function(ut,$e,J){"use strict";J.r($e);var re=J("T2oS"),z=J("W9HT"),L=J("R9oj"),H=J("ECub"),k=J("sPJy"),P=J("bE4q"),F=J("9og8"),M=J("tJVT"),D=J("PpiC"),R=J("WmNS"),E=J.n(R),w=J("q1tI"),T=J.n(w),A=J("Ty5D"),_=J("9kvl"),b=J("m3rI"),d=J("BdwD"),s=J("55Ip"),u=J("G8my"),l=J.n(u),S=J("9Bee"),h=J("h+Ho"),g=J("Jtvl"),C=J.n(g),y=J("9BLJ"),f=J("WhZy"),c=J("miYZ"),o=J("tsqr"),a=J("lfxj"),m=J.n(a),p=function(Le){var Re=Le.isPrised,Ue=Le.num,We=Le.memo_id,ke=Le.container_type,Ke=Le.current_login,ze=Le.showLoginDialog,ge=Object(w.useState)(void 0),Ye=Object(M.a)(ge,2),He=Ye[0],xe=Ye[1],Ie=Object(w.useState)(void 0),se=Object(M.a)(Ie,2),te=se[0],ee=se[1];Object(w.useEffect)(function(){xe(Re),ee(Ue)},[]);function Y(){if(Ke)Object(h.w)({container_type:ke,id:We,type:He?0:1}).then(function(Q){ee(Q.praise_count),xe(!He),o.b.success(He?"\u53D6\u6D88\u70B9\u8D5E":"\u5DF2\u70B9\u8D5E")}).catch(function(Q){o.b.error(Q)});else{ze();return}}return T.a.createElement("div",{className:m.a.priseBox},T.a.createElement("span",{onClick:Y},T.a.createElement("i",{className:He?"iconfont icon-dianzan":"iconfont icon-dianzan-xian"})),T.a.createElement("span",null,te))},v=J("DjyN"),O=J("NUBc"),U=J("Mwp2"),j=J("VXEj"),G=J("oBTY"),B=J("+L6B"),N=J("2/Rp"),V=J("Ot1p");function $(Le){var Re=Le.memo_id,Ue=Le.user_image,We=Le.click_button,ke=Le.new_reply,Ke=Object(w.useState)(!1),ze=Object(M.a)(Ke,2),ge=ze[0],Ye=ze[1],He=Object(w.useState)(""),xe=Object(M.a)(He,2),Ie=xe[0],se=xe[1];function te(Q){se(Q)}function ee(){Ye(!0),Object(h.a)({parent_id:Re,content:Ie}).then(function(Q){Q&&(Q.status===0&&ke(Q.reply)),Ye(!1)}).catch(function(Q){Ye(!1),o.b.error(Q)})}function Y(){We(!1)}return T.a.createElement("div",{className:"grid-item-top pt20"},T.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+Ue,className:"user-image mr10"}),T.a.createElement("div",null,T.a.createElement(V.a,{placeholder:"\u6DFB\u52A0\u8BC4\u8BBA...",watch:!0,height:200,id:Re?"orderdetail-add-descriptions"+Re:"orderdetail-add-descriptions",onChange:te}),T.a.createElement("p",{className:"clearfix mt20"},T.a.createElement(N.a,{type:"primary",onClick:ee,loading:ge,className:"mr15 commentBtn btnSize"},"\u8BC4\u8BBA"),T.a.createElement(N.a,{className:"btnSize",onClick:Y},"\u53D6\u6D88"))))}var ie=$,oe=J("P2fV"),_e=J("NJEC");function fe(Le){var Re=Le.replies,Ue=Le.user_image,We=Le.current_login,ke=Le.reload,Ke=Le.reload_children;return T.a.createElement("div",{className:"children-memo-item"},T.a.createElement(j.b,{size:"large",header:"",dataSource:Re,renderItem:function(ge){return T.a.createElement(j.b.Item,null,T.a.createElement(Ee,{item:ge,reload_children:Ke,user_image:Ue,current_login:We,is_children:!0,reload:ke}))}}))}var Se=fe,be=function(Re){var Ue=Re.className;return T.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2108",width:"200",height:"200",className:Ue},T.a.createElement("path",{d:"M174.592 886.784c-9.216 0-18.944-3.584-26.112-10.752-14.336-14.336-14.336-37.376 0-51.712L823.296 149.504c14.336-14.336 37.376-14.336 51.712 0s14.336 37.376 0 51.712L200.192 876.032c-7.168 7.168-16.384 10.752-25.6 10.752z",fill:"","p-id":"2109"}),T.a.createElement("path",{d:"M824.832 250.368c-9.216-22.016-25.088-40.448-46.08-53.76-34.816-21.504-77.312-24.576-114.176-7.168L382.464 305.152H263.168c-65.536 0-119.296 53.248-119.296 119.296v208.384c0 65.536 53.248 119.296 119.296 119.296h59.904m72.704-72.704c-2.048-0.512-4.096-0.512-6.144-0.512H263.168c-25.6 0-46.08-20.48-46.08-46.08V424.448c0-25.6 20.48-46.08 46.08-46.08h126.464c4.608 0 9.216-1.024 13.824-2.56l289.792-118.784c0.512-0.512 1.536-0.512 2.048-1.024 14.336-7.168 30.72-6.144 44.544 2.56 13.824 8.704 21.504 23.04 21.504 38.912v16.384m0 0l-365.568 365.568m365.568-262.144v342.016c0 16.384-7.68 30.208-21.504 38.912-13.824 8.704-29.696 9.728-44.544 2.56-0.512-0.512-1.536-0.512-2.048-1.024l-223.232-91.648-56.32 56.32 250.88 102.912c16.384 7.68 33.28 11.264 50.688 11.264 22.016 0 44.032-6.144 63.488-18.432 34.816-22.016 55.808-59.904 55.808-100.864V344.064",fill:"","p-id":"2110"}))},me=function(Re){var Ue=Re.className;return T.a.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7298",width:"200",height:"200",className:Ue},T.a.createElement("path",{d:"M616.533333 156.8a53.333333 53.333333 0 0 0-48.426666-2.986667l-307.626667 137.6h-85.333333A88.533333 88.533333 0 0 0 85.333333 378.24v267.52a88.533333 88.533333 0 0 0 90.026667 86.826667h85.333333l307.626667 137.6a52.906667 52.906667 0 0 0 48.426667-2.986667A48 48 0 0 0 640 826.026667V197.973333a48 48 0 0 0-23.466667-41.173333zM578.346667 810.666667l-293.973334-132.48a52.48 52.48 0 0 0-21.333333-4.48H175.36a28.373333 28.373333 0 0 1-28.373333-27.946667V378.24a28.373333 28.373333 0 0 1 28.373333-27.946667h87.68a52.48 52.48 0 0 0 21.333333-4.48L578.346667 213.333333zM715.946667 366.506667a32 32 0 0 0-4.906667 45.013333 159.573333 159.573333 0 0 1 0 200.96 32 32 0 0 0 49.92 40.106667 223.573333 223.573333 0 0 0 0-281.173334 32 32 0 0 0-45.013333-4.906666z","p-id":"7299"}),T.a.createElement("path",{d:"M868.266667 301.44a32 32 0 1 0-51.2 38.4 286.08 286.08 0 0 1 0 344.32 32 32 0 0 0 6.4 44.8 32.426667 32.426667 0 0 0 19.2 6.4 31.786667 31.786667 0 0 0 25.6-12.8 350.08 350.08 0 0 0 0-421.12z","p-id":"7300"}))},le=J("X72a");function ue(Le){var Re,Ue,We,ke=Le.item,Ke=Le.user_image,ze=Le.current_login,ge=Le.is_children,Ye=Le.target_type,He=Le.commet_destroy,xe=Le.user,Ie=Le.reload,se=Le.reload_children,te=Le.props,ee=Object(w.useState)(!1),Y=Object(M.a)(ee,2),Q=Y[0],Z=Y[1],q=Object(w.useState)(!1),de=Object(M.a)(q,2),ye=de[0],Me=de[1],et=Object(w.useState)(!1),qe=Object(M.a)(et,2),at=qe[0],gt=qe[1],yt=Object(w.useState)([]),st=Object(M.a)(yt,2),_t=st[0],xt=st[1],Bt=Object(w.useState)(0),Dt=Object(M.a)(Bt,2),pt=Dt[0],Nt=Dt[1],rr=Object(w.useState)(1),Gt=Object(M.a)(rr,2),Vt=Gt[0],Xt=Gt[1],Pr=Object(w.useState)(!1),Ht=Object(M.a)(Pr,2),kt=Ht[0],jt=Ht[1],Ot=Object(w.useState)(0),tt=Object(M.a)(Ot,2),Yt=tt[0],Nr=tt[1],fr=Object(w.useState)(!1),St=Object(M.a)(fr,2),hr=St[0],gr=St[1],nr=Object(w.useState)(5),Fe=Object(M.a)(nr,2),dt=Fe[0],_r=Fe[1];Object(w.useEffect)(function(){xt(ke.children),ke.children?Nt(ke.children.length):Nt(0),jt(ke.user_praise),Nr(ke.praise_count)},[ke]);var vr=function(wt){if(ze)Z(wt);else{te.showLoginDialog();return}},Ve=function(wt){if(ze){var ot={container_type:"Memo",id:wt,type:kt?0:1};Object(h.w)(ot).then(function(ve){Nr(ve.praise_count),jt(!kt),o.b.success(kt?"\u53D6\u6D88\u70B9\u8D5E":"\u5DF2\u70B9\u8D5E")}).catch(function(ve){o.b.error(ve)})}else{te.showLoginDialog();return}};function wr(ht){gt(!0),Object(h.g)(ht).then(function(wt){wt&&(wt.status===0?(Me(!0),ge?Nt(pt-1):He(),o.b.success(wt.message)):o.b.error(wt.message)),gt(!1)}).catch(function(wt){gt(!1),o.b.error(wt)})}var jr=function(wt){if(ge){se(wt),Z(!1);return}_t&&_t.length>0?xt([].concat(Object(G.a)(_t),[wt])):xt([wt]),Nt(pt+1),Z(!1)},ct=function(wt){xt([].concat(Object(G.a)(_t),[wt])),Nt(pt+1)};function Ct(ht){var wt=Vt;pt<dt?(Xt(1),wt=1):(wt=Vt+1,Xt(wt)),gr(!0);var ot={page:wt,limit:dt,target_type:Ye,target_id:ht};Object(h.u)(ot).then(function(ve){ve&&ve.memo_replies&&xt(_t.concat(ve.memo_replies)),gr(!1)}).catch(function(ve){gr(!1),o.b.error(ve)})}var Ur=(Re=xe.userInfo)===null||Re===void 0?void 0:Re.admin,xr=function(){var ht=Object(F.a)(E.a.mark(function wt(ot,ve,nt){var lt;return E.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(h.d)(ot,{banned:nt,user_id:ve});case 2:lt=Jt.sent,lt.status===0&&Ie();case 4:case"end":return Jt.stop()}},wt)}));return function(ot,ve,nt){return ht.apply(this,arguments)}}();return T.a.createElement("div",{className:"width100"},ye?T.a.createElement("div",{className:"pd20 edu-text-center"},"\u5DF2\u5220\u9664"):T.a.createElement("div",null,T.a.createElement("div",{className:"pb5",style:{display:"flex",alignItems:"center"}},T.a.createElement(s.a,{to:"/forums/accounts/".concat(ke&&ke.user_login,"/memos"),className:"show-user-link"},T.a.createElement("img",{className:"user-image",src:b.a.IMG_SERVER+"/images/"+ke.image_url})),T.a.createElement(s.a,{to:"/forums/accounts/".concat(ke&&ke.user_login,"/memos"),className:"show-user-link color-black ml10 fwb fs14"},ke&&ke.username),ge&&!!(ke!=null&&ke.parent_data)&&T.a.createElement(T.a.Fragment,null,T.a.createElement(le.a,{style:{marginTop:1},className:"ml5 mr5 font12"}),T.a.createElement(s.a,{to:"/forums/accounts/".concat(ke==null||((Ue=ke.parent_data)===null||Ue===void 0)?void 0:Ue.user_login,"/memos"),className:"show-user-link color-black fwb fs14"},ke==null||((We=ke.parent_data)===null||We===void 0)?void 0:We.name))),T.a.createElement("div",{className:"ml40"},ke.content&&T.a.createElement(S.a,{className:"tipsContent",value:ke.content}),T.a.createElement("div",{className:"grid-item-left mt5"},T.a.createElement("span",{className:"color-grey-8 fs14"},ke.time),T.a.createElement("div",{className:"text-right grid-item-4"},Ur&&(ke.is_banned?T.a.createElement(N.a,{className:"link-btn",type:"link",icon:T.a.createElement(me,{className:"relieve-icon mr5"}),onClick:function(){return xr(ke.id,ke.user_id,0)}},T.a.createElement("span",{className:"allow-comment"},"\u6062\u590D\u8BC4\u8BBA")):T.a.createElement(_e.a,{placement:"bottom",title:"\u786E\u5B9A\u8981\u7981\u8A00\u6B64\u7528\u6237\u5417?",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){return xr(ke.id,ke.user_id,1)}},T.a.createElement(N.a,{className:"link-btn",type:"link",icon:T.a.createElement(be,{className:"ban-icon mr5"})},T.a.createElement("span",{className:"font-14 color-grey-8 ver-middle"},"\u7981\u6B62\u8BC4\u8BBA")))),ke.admin||ze===ke.user_login?T.a.createElement(_e.a,{placement:"bottom",title:"\u786E\u5B9A\u8981\u5220\u9664\u5F53\u524D\u8BC4\u8BBA\u5417?",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){return wr(ke.id)}},T.a.createElement(N.a,{className:"link-btn",type:"link",loading:at},T.a.createElement("i",{className:"iconfont icon-shanchu font-14 color-grey-8 mr5 ver-middle"}),T.a.createElement("span",{className:"font-14 color-grey-8 ver-middle"},"\u5220\u9664"))):"",ge&&T.a.createElement(N.a,{onClick:function(){vr(!0)},className:"link-btn",type:"link"},T.a.createElement("i",{className:"iconfont icon-pinglun1 font-14 color-grey-8 mr5 ver-middle"}),T.a.createElement("span",{className:"font-14 color-grey-8 ver-middle"},"\u56DE\u590D")),!ge&&T.a.createElement(N.a,{type:"link",className:"link-btn ml-10",onClick:function(){Ve(ke.id)}},kt?T.a.createElement("i",{className:"iconfont icon-dianzan color-green font-14 mr5 ver-middle"}):T.a.createElement("i",{className:"iconfont icon-dianzan-xian font-14 color-grey-8 mr5 ver-middle"}),T.a.createElement("span",{className:"font-14 color-grey-8 ver-middle"},Yt)),!ge&&T.a.createElement(N.a,{type:"link",className:"link-btn ml-10",onClick:function(){vr(!0)}},T.a.createElement("i",{className:"iconfont icon-pinglun1 font-14 color-grey-8 mr5 ver-middle"}),T.a.createElement("span",{className:"font-14 color-grey-8 ver-middle"},pt)))),Q&&T.a.createElement(ie,{memo_id:ke.id,user_image:Ke,click_button:vr,new_reply:jr}),_t&&pt>0&&T.a.createElement(Se,{replies:_t,user_image:Ke,current_login:ze,reload:Ie,reload_children:ct}),ke&&_t&&ke.replies_count>pt&&ke.replies_count>=Vt*dt&&T.a.createElement("div",{className:"mt10 edu-text-center"},T.a.createElement(N.a,{loading:hr,type:"primary",className:"commentBtn btnSize",onClick:function(){return Ct(ke.id)}},"\u67E5\u770B\u66F4\u591A\u56DE\u590D")))))}var Ee=Object(_.a)(function(Le){var Re=Le.user;return{user:Re}})(ue);function Ge(Le){var Re=Le.user_image,Ue=Le.click_button,We=function(){Ue(!0)};return T.a.createElement("div",{className:"new-comment-head grid-item pd20"},T.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+Re,className:"user-image"}),T.a.createElement("span",{className:"reply-comment-input mr20"},T.a.createElement(N.a,{className:"add_reply_button ml10",onClick:We},T.a.createElement("span",null,"\u6DFB\u52A0\u8BC4\u8BBA..."))))}var Te=Ge,pe=J("FdIy");function Ae(Le){var Re=Le.target_id,Ue=Le.target_type,We=Le.current_user_image,ke=Le.current_login,Ke=Object(D.a)(Le,["target_id","target_type","current_user_image","current_login"]),ze=Object(w.useState)(null),ge=Object(M.a)(ze,2),Ye=ge[0],He=ge[1],xe=Object(w.useState)([]),Ie=Object(M.a)(xe,2),se=Ie[0],te=Ie[1],ee=Object(w.useState)(0),Y=Object(M.a)(ee,2),Q=Y[0],Z=Y[1],q=Object(w.useState)(!1),de=Object(M.a)(q,2),ye=de[0],Me=de[1],et=Object(w.useState)(1),qe=Object(M.a)(et,2),at=qe[0],gt=qe[1],yt=Object(w.useState)(10),st=Object(M.a)(yt,2),_t=st[0],xt=st[1],Bt=Object(w.useState)(!1),Dt=Object(M.a)(Bt,2),pt=Dt[0],Nt=Dt[1],rr=function(){Me(!0);var kt={target_type:Ue,target_id:Re,page:at,limit:_t};Object(h.u)(kt).then(function(jt){jt&&jt.memo_replies&&(te(jt.memo_replies),Z(jt.memos_count)),Me(!1)}).catch(function(jt){Me(!1),o.b.error(jt)})};Object(w.useEffect)(function(){rr()},[at,Re]),Object(w.useEffect)(function(){He(We||"/images/avatars/User/boy.jpg")},[]);function Gt(Ht){gt(Ht)}var Vt=function(kt){if(ke)Nt(kt);else{Ke.showLoginDialog();return}},Xt=function(kt){var jt=Q+1;Z(jt),te([kt].concat(Object(G.a)(se))),Nt(!1)},Pr=function(kt){var jt=Q-1;Z(jt)};return T.a.createElement("div",null,T.a.createElement("div",{className:"b-bottom-none title"},T.a.createElement("span",{className:"greenLiftLine"},"\u8BC4\u8BBA",Q>0&&T.a.createElement("span",{className:"tip_tag"},Q))),T.a.createElement(z.a,{spinning:ye},T.a.createElement("div",{className:"comments-lists"},pt?T.a.createElement(ie,{click_button:Vt,memo_id:Re,user_image:Ye,new_reply:Xt}):T.a.createElement(Te,{user_image:Ye,click_button:Vt}),se&&se.length>0&&T.a.createElement(j.b,{size:"large",loading:ye,header:"",dataSource:se,renderItem:function(kt){return T.a.createElement(j.b.Item,null,T.a.createElement(Ee,{item:kt,user_image:Ye,current_login:ke,reload:rr,is_children:!1,target_type:Ue,commet_destroy:Pr,props:Ke}))}}),Q>_t&&T.a.createElement("div",{className:"edu-text-center pd20"},T.a.createElement(O.a,{showQuickJumper:!0,current:at,onChange:Gt,total:Q,pageSize:_t})))))}var Ce=Ae,we=J("6S+g"),Be=J("hLB0"),Qe=function(Le){var Re=Le.user;Object(w.useEffect)(function(){Re&&Ke(Re.watchers_count)},[]);var Ue=Object(w.useState)(0),We=Object(M.a)(Ue,2),ke=We[0],Ke=We[1],ze=function(Ye){var He=ke+Ye;Ke(He)};return T.a.createElement("div",{className:"whiteBack authorCard"},T.a.createElement("a",{href:"/forums/accounts/".concat(Re&&Re.login,"/memos")},T.a.createElement("span",{className:"kvFNwe"},T.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(Re&&Re.image_url),alt:""}),T.a.createElement("span",{className:"task-hide",style:{maxWidth:"84px",textAlign:"center"}},Re&&Re.username))),T.a.createElement("p",{style:{width:"100%",fontSize:"14px"},className:"task-hide grey-8 mt10 mb15 edu-text-center"},Re&&Re.description?Re.description:"\u8FD9\u5BB6\u4F19\u592A\u61D2\u4E86\uFF0C\u8FD8\u672A\u586B\u5199\u4E2A\u4EBA\u63CF\u8FF0\uFF01"),T.a.createElement("div",{className:"Grid mt20"},T.a.createElement("span",{className:"UDStructure"},T.a.createElement("span",null,Re&&Re.memos_count),T.a.createElement("span",null,"\u6587\u7AE0\u6570")),T.a.createElement("span",{className:"UDStructure"},T.a.createElement("span",null,Re&&Re.replies_count),T.a.createElement("span",null,"\u8BC4\u8BBA\u6570")),T.a.createElement("span",{className:"UDStructure"},T.a.createElement("span",null,ke),T.a.createElement("span",null,"\u5173\u6CE8\u8005"))))},je=J("sNeV"),De=function(Re){var Ue,We=Re.globalSetting,ke=Re.loading,Ke=Re.user,ze=Re.dispatch,ge=Object(D.a)(Re,["globalSetting","loading","user","dispatch"]),Ye=Object(A.i)(),He=Ye.memoId,xe=Ke.userInfo,Ie=Object(w.useState)(null),se=Object(M.a)(Ie,2),te=se[0],ee=se[1],Y=Object(w.useState)(null),Q=Object(M.a)(Y,2),Z=Q[0],q=Q[1],de=Object(w.useState)([]),ye=Object(M.a)(de,2),Me=ye[0],et=ye[1],qe=Object(w.useState)(null),at=Object(M.a)(qe,2),gt=at[0],yt=at[1],st=Object(w.useState)([]),_t=Object(M.a)(st,2),xt=_t[0],Bt=_t[1],Dt=Object(w.useState)(void 0),pt=Object(M.a)(Dt,2),Nt=pt[0],rr=pt[1],Gt=Object(w.useState)(!1),Vt=Object(M.a)(Gt,2),Xt=Vt[0],Pr=Vt[1],Ht=Object(w.useState)(1),kt=Object(M.a)(Ht,2),jt=kt[0],Ot=kt[1],tt=Object(w.useState)(5),Yt=Object(M.a)(tt,2),Nr=Yt[0],fr=Yt[1],St=Object(w.useState)(!1),hr=Object(M.a)(St,2),gr=hr[0],nr=hr[1],Fe=Object(w.useState)({}),dt=Object(M.a)(Fe,2),_r=dt[0],vr=dt[1];Object(w.useEffect)(function(){Ve(),jr()},[He]);function Ve(){return wr.apply(this,arguments)}function wr(){return wr=Object(F.a)(E.a.mark(function Ct(){return E.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:nr(!0),Object(h.j)({memo_id:He}).then(function(ht){if(ht){var wt={admin:ht&&ht.is_current_admin,login:ht&&ht.current_login,banned_permission:ht.banned_permission,is_currentUser:ht.author_info?ht.author_info.is_current_user:void 0,is_fine:ht.memo&&ht.memo.is_fine,sticky:ht.memo&&ht.memo.sticky,memo_watched:ht.memo&&ht.memo.memo_watched,is_deleted:ht.memo&&ht.memo.apply_destroy};rr(wt),ee(ht.memo),yt(ht.memo_image_info),Bt(ht.recent_memos),Pr(ht.is_banned),q(ht.author_info)}nr(!1)}).catch(function(ht){nr(!1),console.log(ht)});case 2:case"end":return xr.stop()}},Ct)})),wr.apply(this,arguments)}function jr(){Object(h.s)({memo_id:He}).then(function(Ct){Ct&&et(Ct.memos),nr(!1)}).catch(function(Ct){nr(!1),console.log(Ct)})}function ct(){var Ct;window.location.href=We==null||((Ct=We.setting)===null||Ct===void 0)?void 0:Ct.sso_url}return T.a.createElement("div",{className:l.a.educontent},T.a.createElement(z.a,{spinning:gr},te&&Z?T.a.createElement("div",null,T.a.createElement(P.a,{separator:">",style:{marginBottom:"10px"}},T.a.createElement(P.a.Item,null,T.a.createElement(s.a,{to:"/forums"},"\u8BBA\u575B")),te&&te.forum_tag&&te.forum_tag.id&&T.a.createElement(P.a.Item,null,T.a.createElement(s.a,{to:"/forums/subject/".concat(te&&te.forum_tag.id)},te&&te.forum_tag.title)),T.a.createElement(P.a.Item,null,te?te.subject:"\u5E16\u5B50\u8BE6\u60C5")),T.a.createElement("div",{className:l.a.box},T.a.createElement("div",{className:l.a.long},T.a.createElement("div",{className:l.a.whiteBack},T.a.createElement("div",{style:{padding:"0px 30px"}},T.a.createElement("div",{className:"".concat(l.a.gMAmTc," ").concat(l.a.headerInfo)},T.a.createElement("div",{className:l.a.headerInfoLeft},T.a.createElement("span",{className:te.tag_name=="\u4EA4\u6D41"?l.a.blue:l.a.tag_Orange},"\u3010",te.tag_name,"\u3011"),T.a.createElement("p",{className:l.a.titleStyle},te&&te.subject),te.sticky===!0?T.a.createElement("span",{className:"".concat(l.a.tag," ").concat(l.a.tagRed)},"\u7F6E\u9876"):"",te.is_fine===!0?T.a.createElement("span",{className:"".concat(l.a.tag," ").concat(l.a.tagBlue)},"\u7CBE\u534E"):""),T.a.createElement("div",{style:{width:"130px",textAlign:"right"}},xe&&xe.login?T.a.createElement(je.a,{permission:Nt,id:He,calbackFunc:Ve}):""),te&&te.is_original&&T.a.createElement("img",{src:C.a,className:l.a.originalTag,width:"80px"})),T.a.createElement("div",{className:l.a.kTLhbM,style:{padding:"15px 0"}},T.a.createElement("a",{href:"/forums/accounts/".concat(Z.login,"/memos")},T.a.createElement("span",{className:l.a.igfjXB},T.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+Z.image_url,alt:""}),T.a.createElement("span",{className:l.a.taskHide},Z.username))),T.a.createElement("span",{className:l.a.iconWrap},T.a.createElement(y.a,null),T.a.createElement("span",{className:"span-text"},te&&te.viewed_count)),T.a.createElement("span",{className:l.a.iconWrap},T.a.createElement(f.a,null),T.a.createElement("span",{className:"span-text"},te&&te.replies_count)),T.a.createElement("span",{className:"grey-8 ml20"},te&&te.published_time),te&&te.apply_destroy&&T.a.createElement("span",{style:{marginLeft:"20px",color:"#fa6400"}},"\u5DF2\u7533\u8BF7\u5220\u5E16")),T.a.createElement("div",{className:l.a.content},gt&&T.a.createElement("div",{style:{paddingBottom:"20px"}},T.a.createElement("img",{src:b.a.IMG_SERVER+gt.url,style:{width:"100%"}})),T.a.createElement(S.a,{style:{textAlign:"justify",wordBreak:"break-all"},value:te.content}),T.a.createElement("div",{className:l.a.row},te.attachment_url&&te.attachment_url.length>0&&((Ue=te.attachment_url)===null||Ue===void 0?void 0:Ue.map(function(Ct){return T.a.createElement("a",{key:Ct.id,target:"_blank",href:Ct.url},T.a.createElement("i",{className:"iconfont icon-fujian font14 mr10"}),T.a.createElement("span",{className:"mr10"},Ct.title),T.a.createElement("span",null,Ct.filesize))})))),te.reprint_link&&T.a.createElement("p",{style:{fontSize:"12px",color:"#888"}},"\u8F6C\u8F7D\u81EA\uFF1A",te.reprint_link),T.a.createElement(p,{isPrised:te.user_praise,num:te.praises_count,memo_id:te.id,container_type:"Memo",current_login:Z&&Z.current_login,showLoginDialog:ct}))),T.a.createElement("div",{className:"".concat(l.a.whiteBack," ").concat(l.a.mt15)},T.a.createElement(Ce,{target_id:te&&te.id,target_type:"memos",current_user_image:Z&&Z.current_image_url,current_login:Z&&Z.current_login,showLoginDialog:ct})),Me&&Me.length>0&&T.a.createElement("div",{className:"".concat(l.a.whiteBack," ").concat(l.a.mt15)},T.a.createElement("div",{className:l.a.title},T.a.createElement("span",{className:l.a.greenLiftLine},"\u76F8\u5173\u63A8\u8350")),T.a.createElement(we.a,{memos:Me,calbackFunc:jr}))),T.a.createElement("div",{className:l.a.Short},T.a.createElement(Qe,{user:Z}),T.a.createElement("div",{className:"".concat(l.a.whiteBack," ").concat(l.a.mt15)},T.a.createElement("div",{className:l.a.title},T.a.createElement("span",null,"\u4F5C\u8005\u6700\u8FD1\u6587\u7AE0"),T.a.createElement("a",{style:{fontSize:"12px",color:"#999"},href:"/forums/accounts/".concat(Z&&Z.login,"/memos")},"\u66F4\u591A",T.a.createElement("i",{className:"iconfont icon-youjiantou ml5",style:{fontSize:"12px"}}))),T.a.createElement("div",{className:"memo-detail-ul"},T.a.createElement("ul",{className:l.a.BestUl},xt&&xt.length>0?xt.map(function(Ct){return T.a.createElement("li",{key:Ct.id},T.a.createElement("a",{href:"/forums/".concat(Ct.id)},Ct.subject))}):T.a.createElement(d.a,{customText:"\u6682\u65E0\u63A8\u8350"}))))))):T.a.createElement(H.a,{image:H.a.PRESENTED_IMAGE_SIMPLE,style:{padding:"200px"}})))},Pe=$e.default=Object(_.a)(function(Le){var Re=Le.loading,Ue=Le.user,We=Le.globalSetting;return{globalSetting:We,loading:Re.effects,user:Ue}})(De)}}]);