You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
871 KiB
143 lines
871 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[52,5,6,7,9],{"+NIl":function(Fe,Le,z){(function(re){re(z("VrN/"))})(function(re){"use strict";re.defineMode("stex",function(V,R){"use strict";function G(C,A){C.cmdState.push(A)}function k(C){return C.cmdState.length>0?C.cmdState[C.cmdState.length-1]:null}function O(C){var A=C.cmdState.pop();A&&A.closeBracket()}function F(C){for(var A=C.cmdState,v=A.length-1;v>=0;v--){var c=A[v];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function U(C,A,v){return function(){this.name=C,this.bracketNo=0,this.style=A,this.styles=v,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=U("importmodule","tag",["string","builtin"]),P.documentclass=U("documentclass","tag",["","atom"]),P.usepackage=U("usepackage","tag",["atom"]),P.begin=U("begin","tag",["atom"]),P.end=U("end","tag",["atom"]),P.label=U("label","tag",["atom"]),P.ref=U("ref","tag",["atom"]),P.eqref=U("eqref","tag",["atom"]),P.cite=U("cite","tag",["atom"]),P.bibitem=U("bibitem","tag",["atom"]),P.Bibitem=U("Bibitem","tag",["atom"]),P.RBibitem=U("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(C,A){C.f=A}function E(C,A){var v;if(C.match(/^\\[a-zA-Z@]+/)){var c=C.current().slice(1);return v=P.hasOwnProperty(c)?P[c]:P.DEFAULT,v=new v,G(A,v),D(A,_),v.style}if(C.match(/^\\[$&%#{}_]/))return"tag";if(C.match(/^\\[,;!\/\\]/))return"tag";if(C.match("\\["))return D(A,function(d,l){return b(d,l,"\\]")}),"keyword";if(C.match("\\("))return D(A,function(d,l){return b(d,l,"\\)")}),"keyword";if(C.match("$$"))return D(A,function(d,l){return b(d,l,"$$")}),"keyword";if(C.match("$"))return D(A,function(d,l){return b(d,l,"$")}),"keyword";var s=C.next();if(s=="%")return C.skipToEnd(),"comment";if(s=="}"||s=="]"){if(v=k(A),v)v.closeBracket(s),D(A,_);else return"error";return"bracket"}else return s=="{"||s=="["?(v=P.DEFAULT,v=new v,G(A,v),"bracket"):/\d/.test(s)?(C.eatWhile(/[\w.%]/),"atom"):(C.eatWhile(/[\w\-_]/),v=F(A),v.name=="begin"&&(v.argument=C.current()),v.styleIdentifier())}function b(C,A,v){if(C.eatSpace())return null;if(v&&C.match(v))return D(A,E),"keyword";if(C.match(/^\\[a-zA-Z@]+/))return"tag";if(C.match(/^[a-zA-Z]+/))return"variable-2";if(C.match(/^\\[$&%#{}_]/))return"tag";if(C.match(/^\\[,;!\/]/))return"tag";if(C.match(/^[\^_&]/))return"tag";if(C.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(C.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=C.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(C.skipToEnd(),"comment"):"error"}function _(C,A){var v=C.peek(),c;return v=="{"||v=="["?(c=k(A),c.openBracket(v),C.eat(v),D(A,E),"bracket"):/[ \t\r]/.test(v)?(C.eat(v),null):(D(A,E),O(A),E(C,A))}return{startState:function(){var C=R.inMathMode?function(A,v){return b(A,v)}:E;return{cmdState:[],f:C}},copyState:function(C){return{cmdState:C.cmdState.slice(),f:C.f}},token:function(C,A){return A.f(C,A)},blankLine:function(C){C.f=E,C.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"+ua5":function(Fe,Le,z){},"/GNS":function(Fe,Le,z){Fe.exports=z.p+"static/search1.c4136dd4.png"},"19Vz":function(Fe,Le,z){(function(re){re(z("VrN/"))})(function(re){re.defineOption("placeholder","",function(U,P,D){var E=D&&D!=re.Init;if(P&&!E)U.on("blur",k),U.on("change",O),U.on("swapDoc",O),re.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){G(U)}),O(U);else if(!P&&E){U.off("blur",k),U.off("change",O),U.off("swapDoc",O),re.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),V(U);var b=U.getWrapperElement();b.className=b.className.replace(" CodeMirror-empty","")}P&&!U.hasFocus()&&k(U)});function V(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function R(U){V(U);var P=U.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=U.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var D=U.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),P.appendChild(D),U.display.lineSpace.insertBefore(P,U.display.lineSpace.firstChild)}function G(U){setTimeout(function(){var P=!1,D=U.getInputField();D.nodeName=="TEXTAREA"?P=!D.value:U.lineCount()==1&&(P=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),P?R(U):V(U)},20)}function k(U){F(U)&&R(U)}function O(U){var P=U.getWrapperElement(),D=F(U);P.className=P.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?R(U):V(U)}function F(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(Fe,Le,z){(function(re){re(z("VrN/"))})(function(re){"use strict";var V={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(G,k){var O=G.indentUnit,F={},U=k.htmlMode?V:R;for(var P in U)F[P]=U[P];for(var P in k)F[P]=k[P];var D,E;function b(o,y){function p(N){return y.tokenize=N,N(o,y)}var x=o.next();if(x=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?p(A("atom","]]>")):null:o.match("--")?p(A("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),p(v(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),y.tokenize=A("meta","?>"),"meta"):(D=o.eat("/")?"closeTag":"openTag",y.tokenize=_,"tag bracket");if(x=="&"){var M;return o.eat("#")?o.eat("x")?M=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):M=o.eatWhile(/[\d]/)&&o.eat(";"):M=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),M?"atom":"error"}else return o.eatWhile(/[^&<]/),null}b.isInText=!0;function _(o,y){var p=o.next();if(p==">"||p=="/"&&o.eat(">"))return y.tokenize=b,D=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return D="equals",null;if(p=="<"){y.tokenize=b,y.state=l,y.tagName=y.tagStart=null;var x=y.tokenize(o,y);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(p)?(y.tokenize=C(p),y.stringStartCol=o.column(),y.tokenize(o,y)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function C(o){var y=function(p,x){for(;!p.eol();)if(p.next()==o){x.tokenize=_;break}return"string"};return y.isInAttribute=!0,y}function A(o,y){return function(p,x){for(;!p.eol();){if(p.match(y)){x.tokenize=b;break}p.next()}return o}}function v(o){return function(y,p){for(var x;(x=y.next())!=null;){if(x=="<")return p.tokenize=v(o+1),p.tokenize(y,p);if(x==">")if(o==1){p.tokenize=b;break}else return p.tokenize=v(o-1),p.tokenize(y,p)}return"meta"}}function c(o,y,p){this.prev=o.context,this.tagName=y,this.indent=o.indented,this.startOfLine=p,(F.doNotIndent.hasOwnProperty(y)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function s(o){o.context&&(o.context=o.context.prev)}function d(o,y){for(var p;;){if(!o.context)return;if(p=o.context.tagName,!F.contextGrabbers.hasOwnProperty(p)||!F.contextGrabbers[p].hasOwnProperty(y))return;s(o)}}function l(o,y,p){return o=="openTag"?(p.tagStart=y.column(),S):o=="closeTag"?m:l}function S(o,y,p){return o=="word"?(p.tagName=y.current(),E="tag",g):F.allowMissingTagName&&o=="endTag"?(E="tag bracket",g(o,y,p)):(E="error",S)}function m(o,y,p){if(o=="word"){var x=y.current();return p.context&&p.context.tagName!=x&&F.implicitlyClosed.hasOwnProperty(p.context.tagName)&&s(p),p.context&&p.context.tagName==x||F.matchClosing===!1?(E="tag",f):(E="tag error",w)}else return F.allowMissingTagName&&o=="endTag"?(E="tag bracket",f(o,y,p)):(E="error",w)}function f(o,y,p){return o!="endTag"?(E="error",f):(s(p),l)}function w(o,y,p){return E="error",f(o,y,p)}function g(o,y,p){if(o=="word")return E="attribute",h;if(o=="endTag"||o=="selfcloseTag"){var x=p.tagName,M=p.tagStart;return p.tagName=p.tagStart=null,o=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(x)?d(p,x):(d(p,x),p.context=new c(p,x,M==p.indented)),l}return E="error",g}function h(o,y,p){return o=="equals"?a:(F.allowMissing||(E="error"),g(o,y,p))}function a(o,y,p){return o=="string"?u:o=="word"&&F.allowUnquoted?(E="string",g):(E="error",g(o,y,p))}function u(o,y,p){return o=="string"?u:g(o,y,p)}return{startState:function(o){var y={tokenize:b,state:l,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(y.baseIndent=o),y},token:function(o,y){if(!y.tagName&&o.sol()&&(y.indented=o.indentation()),o.eatSpace())return null;D=null;var p=y.tokenize(o,y);return(p||D)&&p!="comment"&&(E=null,y.state=y.state(D||p,o,y),E&&(p=E=="error"?p+" error":E)),p},indent:function(o,y,p){var x=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+O;if(x&&x.noIndent)return re.Pass;if(o.tokenize!=_&&o.tokenize!=b)return p?p.match(/^(\s*)/)[0].length:0;if(o.tagName)return F.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+O*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/<!\[CDATA\[/.test(y))return 0;var M=y&&/^<(\/)?([\w_:\.-]*)/.exec(y);if(M&&M[1])for(;x;)if(x.tagName==M[2]){x=x.prev;break}else if(F.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(M)for(;x;){var N=F.contextGrabbers[x.tagName];if(N&&N.hasOwnProperty(M[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+O:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(o){o.state==a&&(o.state=g)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var y=[],p=o.context;p;p=p.prev)p.tagName&&y.push(p.tagName);return y.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4qgm":function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55HssbZ0sLd3N3LF+k47pZ70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xTgRayocjbJpTvSzh4yd2G7vsj2dGsAi/C6dugriOqi5bCLDRsuNRFOVu3uYtAhAhETXQtlaFk4HDq1QilcZu5CJggEBXRtWRuwsNH2Z6gyF0+F4EoEYiY6FoqNdFY7X5NOsoVcJvHBIGIiO5LXSFJRGOXMTcmcLiDxCsCYRNd0/CQ6s2n6MsYH6/QuHLFEwLhEz3Z+9VoX/LseILClSWeEQiL6N7suOd4J7vyqscz0K5sOYuAbaJrqdQjw5tly7nEQzkruzt6AiFgi+jaAEpwEklTWyuBsHFFjSMELImupZFEOh+gcUscye2KkmAIWBM9ldFkeL8h6hYXgVyLQEiia324i3OE+LBlrpXbnXiCIWBKdF/WW0n2nf0f20ow0F1xY4+AIdG1PpT2+ZZXi/2U3BFdBJxHIAvRNfX150/QaOn8cG6PLgI5g0BWoicj3+D2fSM7Zybljuoi4DQCmYiupdKNDEw+GeH00G5/LgKxQ+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"500L":function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return m});var re=z("+L6B"),V=z("2/Rp"),R=z("2qtc"),G=z("kLXV"),k=z("9og8"),O=z("k1fw"),F=z("miYZ"),U=z("tsqr"),P=z("oBTY"),D=z("tJVT"),E=z("DZo9"),b=z("8z0m"),_=z("WmNS"),C=z.n(_),A=z("cDcd"),v=z.n(A),c=z("m3rI"),s=z("wzkS"),d=z("y5JW"),l=z("LtfV"),S=b.a.Dragger;function m(f){var w=[];return f&&f.length>0&&(w=f.map(function(g){return{uid:g.id,id:g.id,name:g.title+d.c+g.filesize,url:g.url,filesize:g.filesize,status:"done",response:{id:g.id}}})),w}Le.b=function(f){var w=f.value,g=f.onChange,h=f.action,a=f.className,u=f.maxSize,o=u===void 0?150:u,y=f.title,p=y===void 0?"\u4E0A\u4F20\u9644\u4EF6":y,x=f.showRemoveModal,M=x===void 0?!1:x,N=f.accept,j=N===void 0?"":N,W=f.additionalText,L=f.isDragger,I=f.number,K=I===void 0?1e3:I,Y=f.aloneClear,ee=Y===void 0?!1:Y,oe=Object(A.useState)(!1),xe=Object(D.a)(oe,2),ve=xe[0],ge=xe[1],me=Object(A.useState)(w||[]),ce=Object(D.a)(me,2),ie=ce[0],pe=ce[1];Object(A.useEffect)(function(){w&&(pe(Object(P.a)(w)),K===(w==null?void 0:w.length)&&ge(!0))},[w]);var J=function(){setTimeout(function(){ie.pop(),pe(Object(P.a)(ie))},500)},ne={multiple:!0,disabled:ve,accept:j,withCredentials:!0,fileList:ie,beforeUpload:function(Te,ye){var Se=Te.size/1024/1024;return ie.concat(ye).length>K?(ie.pop(),pe(Object(P.a)(ie)),U.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(K,"\u4E2A\u6587\u4EF6")),ee?Promise.reject():(J(),!1)):!0},action:h||"".concat(c.a.API_SERVER,"/api/attachments.json"),onChange:function(Te){var ye,Se,Pe=Object(P.a)(Te.fileList);if(Te.file.status==="done"&&((ye=Te.file)===null||ye===void 0||((Se=ye.response)===null||Se===void 0)?void 0:Se.status)===-1){var Ie,Ue;U.b.error((Ie=Te.file)===null||Ie===void 0||((Ue=Ie.response)===null||Ue===void 0)?void 0:Ue.message);return}Pe.length>=K?ge(!0):ge(!1),pe(Object(P.a)(Pe)),Pe=Pe.map(function(Re){var Oe;if(Re!=null&&(Oe=Re.response)!==null&&Oe!==void 0&&Oe.id){var Ve;Re.url="/api/attachments/".concat(Re==null||((Ve=Re.response)===null||Ve===void 0)?void 0:Ve.id)}return Re.name.indexOf(d.c)===-1&&(Re.name="".concat(Re.name).concat(d.c).concat(Object(d.a)(Re.size))),Object(O.a)({},Re)}),console.log("info:",Te),g(Pe)},onRemove:function(){var be=Object(k.a)(C.a.mark(function ye(Se){var Pe;return C.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(Pe=function(){var Re=Object(k.a)(C.a.mark(function Oe(){var Ve,qe;return C.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(Ve=Se.response?Se.response.id:Se.id,!Ve){ze.next=8;break}return ze.next=4,Object(s.d)(Se.response?Se.response.id:Se.uid);case 4:return qe=ze.sent,ze.abrupt("return",qe);case 8:return ze.abrupt("return",!0);case 9:case"end":return ze.stop()}},Oe)}));return function(){return Re.apply(this,arguments)}}(),!M){Ue.next=5;break}return Ue.abrupt("return",new Promise(function(Re,Oe){G.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:v.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Ve=Object(k.a)(C.a.mark(function He(){var ze;return C.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return Je.next=2,Pe();case 2:ze=Je.sent,U.b.success("\u5220\u9664\u6210\u529F"),Re(!0);case 5:case"end":return Je.stop()}},He)}));function qe(){return Ve.apply(this,arguments)}return qe}(),onCancel:function(){return Re(!1)}})}));case 5:return Ue.next=7,Pe();case 7:return Ue.abrupt("return",Ue.sent);case 8:case"end":return Ue.stop()}},ye)}));function Te(ye){return be.apply(this,arguments)}return Te}()};function $(be){be.preventDefault(),be.stopPropagation()}return v.a.createElement("div",{className:"multi-upload ".concat(a||"")},L&&v.a.createElement(S,ne,v.a.createElement("p",{className:"ant-upload-drag-icon"},v.a.createElement(l.a,null)),v.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",v.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",o,"MB)"," "),W),!L&&v.a.createElement(b.a,ne,v.a.createElement(V.a,{disabled:ve},p),v.a.createElement("span",{onClick:$,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",o,"MB)"," ")))}},"55Ip":function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return d});var re=z("Ty5D"),V=z("dI71"),R=z("cDcd"),G=z.n(R),k=z("YS25"),O=z("17x9"),F=z.n(O),U=z("wx14"),P=z("zLVn"),D=z("9R94"),E=function(a){Object(V.a)(u,a);function u(){for(var y,p=arguments.length,x=new Array(p),M=0;M<p;M++)x[M]=arguments[M];return y=a.call.apply(a,[this].concat(x))||this,y.history=Object(k.a)(y.props),y}var o=u.prototype;return o.render=function(){return G.a.createElement(re.c,{history:this.history,children:this.props.children})},u}(G.a.Component),b=function(a){Object(V.a)(u,a);function u(){for(var y,p=arguments.length,x=new Array(p),M=0;M<p;M++)x[M]=arguments[M];return y=a.call.apply(a,[this].concat(x))||this,y.history=Object(k.b)(y.props),y}var o=u.prototype;return o.render=function(){return G.a.createElement(re.c,{history:this.history,children:this.props.children})},u}(G.a.Component),_=function(u,o){return typeof u=="function"?u(o):u},C=function(u,o){return typeof u=="string"?Object(k.c)(u,null,null,o):u},A=function(u){return u},v=G.a.forwardRef;typeof v=="undefined"&&(v=A);function c(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}var s=v(function(a,u){var o=a.innerRef,y=a.navigate,p=a.onClick,x=Object(P.a)(a,["innerRef","navigate","onClick"]),M=x.target,N=Object(U.a)({},x,{onClick:function(W){try{p&&p(W)}catch(L){throw W.preventDefault(),L}!W.defaultPrevented&&W.button===0&&(!M||M==="_self")&&!c(W)&&(W.preventDefault(),y())}});return A!==v?N.ref=u||o:N.ref=o,G.a.createElement("a",N)}),d=v(function(a,u){var o=a.component,y=o===void 0?s:o,p=a.replace,x=a.to,M=a.innerRef,N=Object(P.a)(a,["component","replace","to","innerRef"]);return G.a.createElement(re.e.Consumer,null,function(j){j||Object(D.a)(!1);var W=j.history,L=C(_(x,j.location),j.location),I=L?W.createHref(L):"",K=Object(U.a)({},N,{href:I,navigate:function(){var ee=_(x,j.location),oe=p?W.replace:W.push;oe(ee)}});return A!==v?K.ref=u||M:K.innerRef=M,G.a.createElement(y,K)})});if(!1)var l,S;var m=function(u){return u},f=G.a.forwardRef;typeof f=="undefined"&&(f=m);function w(){for(var a=arguments.length,u=new Array(a),o=0;o<a;o++)u[o]=arguments[o];return u.filter(function(y){return y}).join(" ")}var g=f(function(a,u){var o=a["aria-current"],y=o===void 0?"page":o,p=a.activeClassName,x=p===void 0?"active":p,M=a.activeStyle,N=a.className,j=a.exact,W=a.isActive,L=a.location,I=a.sensitive,K=a.strict,Y=a.style,ee=a.to,oe=a.innerRef,xe=Object(P.a)(a,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(re.e.Consumer,null,function(ve){ve||Object(D.a)(!1);var ge=L||ve.location,me=C(_(ee,ge),ge),ce=me.pathname,ie=ce&&ce.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),pe=ie?Object(re.f)(ge.pathname,{path:ie,exact:j,sensitive:I,strict:K}):null,J=!!(W?W(pe,ge):pe),ne=J?w(N,x):N,$=J?Object(U.a)({},Y,{},M):Y,be=Object(U.a)({"aria-current":J&&y||null,className:ne,style:$,to:me},xe);return m!==f?be.ref=u||oe:be.innerRef=oe,G.a.createElement(d,be)})});if(!1)var h},"5D2P":function(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q2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Fe,Le,z){"use strict";var re=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function R(){if(!re)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re(V)}var G=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function k(_){return typeof _=="string"&&G.test(_)}for(var O=k,F=[],U=0;U<256;++U)F.push((U+256).toString(16).substr(1));function P(_){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(F[_[C+0]]+F[_[C+1]]+F[_[C+2]]+F[_[C+3]]+"-"+F[_[C+4]]+F[_[C+5]]+"-"+F[_[C+6]]+F[_[C+7]]+"-"+F[_[C+8]]+F[_[C+9]]+"-"+F[_[C+10]]+F[_[C+11]]+F[_[C+12]]+F[_[C+13]]+F[_[C+14]]+F[_[C+15]]).toLowerCase();if(!O(A))throw TypeError("Stringified UUID is invalid");return A}var D=P;function E(_,C,A){_=_||{};var v=_.random||(_.rng||R)();if(v[6]=v[6]&15|64,v[8]=v[8]&63|128,C){A=A||0;for(var c=0;c<16;++c)C[A+c]=v[c];return C}return D(v)}var b=Le.a=E},"7ZXX":function(Fe,Le,z){Fe.exports=z.p+"static/err.6e7c5817.png"},"7ahc":function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return S});var re=z("k1fw"),V=z("0Owb"),R=z("+L6B"),G=z("2/Rp"),k=z("y8nQ"),O=z("Vl3Y"),F=z("tJVT"),U=z("OaEy"),P=z("2fM7"),D=z("cDcd"),E=z.n(D),b=z("VrN/"),_=z.n(b),C=z("p77/"),A=z.n(C),v=z("c5Ni"),c=z.n(v),s=P.a.Option,d={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"]};Le.b=function(m){var f=m.callback,w=m.onCancel,g=Object(D.useState)("python"),h=Object(F.a)(g,2),a=h[0],u=h[1];function o(p){u(l[p][1])}function y(p){f(p)}return E.a.createElement(O.a,Object(V.a)({},d,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),E.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(P.a,{onChange:o},Object.keys(l).map(function(p){return E.a.createElement(s,{key:p,value:p},l[p][0])}))),E.a.createElement(O.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:a})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(G.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function S(m){var f=m.value,w=m.onChange,g=m.mode,h=m.options,a=h===void 0?{}:h,u=Object(D.useRef)(),o=Object(D.useState)(),y=Object(F.a)(o,2),p=y[0],x=y[1];return Object(D.useEffect)(function(){if(p){function M(N){var j=N.getValue();w&&w(j)}return p.on("change",M),function(){p.off("change",M)}}},[p,w]),Object(D.useEffect)(function(){p&&p.setOption("mode",g)},[p,g]),Object(D.useEffect)(function(){p&&((f!==p.getValue()||f==="")&&setTimeout(function(){p.setValue(f||" ")},300))},[p,f]),Object(D.useEffect)(function(){if(u.current&&!p){var M=_.a.fromTextArea(u.current,Object(re.a)({mode:g,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},a));x(M)}},[u.current,p]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:u}))}},"7v3h":function(Fe,Le,z){Fe.exports=z.p+"static/empty2.dd73f390.png"},"8/bI":function(Fe,Le,z){Fe.exports=z.p+"static/empty.8918e228.png"},"8EBN":function(Fe,Le,z){(function(re){re(z("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 V=0;V<re.modeInfo.length;V++){var R=re.modeInfo[V];R.mimes&&(R.mime=R.mimes[0])}re.findModeByMIME=function(G){G=G.toLowerCase();for(var k=0;k<re.modeInfo.length;k++){var O=re.modeInfo[k];if(O.mime==G)return O;if(O.mimes){for(var F=0;F<O.mimes.length;F++)if(O.mimes[F]==G)return O}}if(/\+xml$/.test(G))return re.findModeByMIME("application/xml");if(/\+json$/.test(G))return re.findModeByMIME("application/json")},re.findModeByExtension=function(G){G=G.toLowerCase();for(var k=0;k<re.modeInfo.length;k++){var O=re.modeInfo[k];if(O.ext){for(var F=0;F<O.ext.length;F++)if(O.ext[F]==G)return O}}},re.findModeByFileName=function(G){for(var k=0;k<re.modeInfo.length;k++){var O=re.modeInfo[k];if(O.file&&O.file.test(G))return O}var F=G.lastIndexOf("."),U=F>-1&&G.substring(F+1,G.length);if(U)return re.findModeByExtension(U)},re.findModeByName=function(G){G=G.toLowerCase();for(var k=0;k<re.modeInfo.length;k++){var O=re.modeInfo[k];if(O.name.toLowerCase()==G)return O;if(O.alias){for(var F=0;F<O.alias.length;F++)if(O.alias[F].toLowerCase()==G)return O}}}})},"8hTe":function(Fe,Le,z){Fe.exports={button:"button___1wy9m"}},"9Bee":function(Fe,Le,z){"use strict";var re=z("DYRE"),V=z("zeV3"),R=z("+L6B"),G=z("2/Rp"),k=z("k1fw"),O=z("tJVT"),F=z("cDcd"),U=z.n(F),P=z("vg9a"),D=z("DlQD"),E=z.n(D),b=z("rUJ1");function _(ge,me){var ce=ge.match(/^(\s+)(?:```)/);if(ce===null)return me;var ie=ce[1];return me.split(`
|
|
`).map(function(pe){var J=pe.match(/^\s+/);if(J===null)return pe;var ne=Object(O.a)(J,1),$=ne[0];return $.length>=ie.length?pe.slice(ie.length):pe}).join(`
|
|
`)}var C=[],A=["<ul>"],v=new E.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function s(){C.length=0,A=["<ul>"]}var d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function l(ge,me,ce,ie){if(me>=ge.length||ge[me].level<=ce)return me;var pe=ge[me];ie.push("<li><a href='#"+pe.anchor+"'>"+pe.text+"</a>"),me++;var J=[];return me=l(ge,me,pe.level,J),J.length>0&&(ie.push("<ul>"),J.forEach(function(ne){ie.push(ne)}),ie.push("</ul>")),ie.push("</li>"),me=l(ge,me,ce,ie),me}function S(){return l(C,0,0,A),A.push("</ul>"),A.join("")}var m={heading:function(me){var ce=c.exec(me);if(ce)return{type:"heading",raw:ce[0],depth:ce[1].length,text:ce[2]}},fences:function(me){var ce=this.rules.block.fences.exec(me);if(ce){var ie=ce[0],pe=_(ie,ce[3]||""),J=ce[2]?ce[2].trim():ce[2];if(["latex","katex","math"].indexOf(J)>=0){var ne=g(),$=pe;pe=ne,h[ne]={type:"block",expression:$}}return{type:"code",raw:ie,lang:J,text:pe}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,g=function(){return"__special_katext_id_".concat(w++,"__")},h={};function a(){return h}function u(){w=0,h={}}function o(ge){return ge=ge.replace(f,function(me,ce){var ie=g();return h[ie]={type:"inline",expression:ce},ie}),ge}var y=v.listitem;v.listitem=function(ge){return y(o(ge))};var p=v.paragraph;v.paragraph=function(ge){return p(o(ge))};var x=v.tablecell;v.tablecell=function(ge,me){return x(o(ge),me)},v.code=function(ge,me,ce){var ie=(me||"").match(/\S*/)[0];return ie?["latex","katex","math"].indexOf(ie)>=0?"<p class='editormd-tex'>".concat(ge,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(me,'">').concat(ce?ge:Object(b.escape)(ge,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(ce?ge:Object(b.escape)(ge,!0))+"</code></pre>"},v.heading=function(ge,me,ce){var ie=this.options.headerPrefix+ce.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return C.push({anchor:ie,level:me,text:ge}),"<h"+me+' id="'+ie+'">'+ge+"</h"+me+">"},E.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),E.a.use({tokenizer:m,renderer:v});var M=E.a,N=z("SJMd"),j=z("ulZh"),W=z.n(j),L=z("m3rI"),I=z("Oy/b"),K=z("p5ED"),Y=z("8hTe"),ee=z.n(Y),oe=/<pre[^>]*>/g;function xe(ge){var me=document.createElement("div");return me.innerHTML=ge,me.childNodes.length===0?"":me.childNodes[0].nodeValue}var ve=Le.a=function(ge){var me=ge.value,ce=me===void 0?"":me,ie=ge.edit,pe=ie===void 0?!1:ie,J=ge.className,ne=ge.showTextOnly,$=ge.showLines,be=ge.replaces,Te=ge.zoomImg,ye=ge.hasMask,Se=ge.style,Pe=Se===void 0?{}:Se,Ie=ge.stylesPrev,Ue=Ie===void 0?{}:Ie,Re=String(ce),Oe=Object(F.useRef)(),Ve=Object(F.useRef)(),qe=Object(F.useState)(""),He=Object(O.a)(qe,2),ze=He[0],nt=He[1],Je=Object(F.useState)("office"),$e=Object(O.a)(Je,2),we=$e[0],rt=$e[1],Ze=Object(F.useMemo)(function(){try{var de=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Z=/\"\/api\/attachments\/|\"\/attachments\/download\//g,q=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Re=Re.replace(de,"("+L.a.API_SERVER+"/api/attachments/").replace(Z,'"'+L.a.API_SERVER+"/api/attachments/").replace(q,'"'+L.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(_e){}var te=M(Re),se=a();if(Re.match(/\[TOC\]/)&&(te=te.replace("<p>[TOC]</p>",S()),s()),te=te.replace(/(__special_katext_id_\d+__)/g,function(_e,De){var We=se[De],Xe=We.type,Ce=We.expression;return Object(I.renderToString)(xe(Ce)||"",{displayMode:Xe==="block",throwOnError:!1,output:"html"})}),te=te.replace(/▁/g,"\u2581\u2581\u2581"),u(),ne){var fe=document.createElement("div");return fe.innerHTML=te,fe.innerText}return setTimeout(function(){return he()},500),te},[Re]),Me=Object(F.useRef)();d.WebkitLineClamp=$,$&&(Pe=Object(k.a)(Object(k.a)({},Pe),d));function je(de){var Z=de.target;if(Z.tagName.toUpperCase()==="IMG"){if(Te){var q=Z.getAttribute("src");nt(q),rt("image")}}else if(Z.tagName.toUpperCase()==="A"){var te=Z.getAttribute("href");if(te.indexOf("office")>-1)de.preventDefault(),nt(te),rt("office");else if(te.indexOf("application/pdf")>-1)de.preventDefault(),nt(te),rt("pdf");else if(te.indexOf("text/html")>-1)de.preventDefault(),nt(te),rt("html");else if(te.startsWith("#")){de.preventDefault();var se=document.getElementById(te.replace("#",""));se&&se.scrollIntoView(!0)}}}var he=function(){var Z,q=(Z=Me.current)===null||Z===void 0?void 0:Z.querySelectorAll("video");q==null||q.forEach(function(te){if(te.oncontextmenu=function(){return!1},te.src.indexOf(".m3u8")>-1&&!te.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var se=new W.a;se.loadSource(te.src),se.attachMedia(te)}}})};Object(F.useEffect)(function(){if(Me.current&&Ze&&(Ze.match(oe)&&window.PR.prettyPrint()),Me.current)return Me.current.addEventListener("click",je),function(){Me.current.removeEventListener("click",je),u(),s()}},[Ze,Me.current,je]);var ue=function(Z){if(!pe)return;Z.target.nodeName==="IMG"?(Oe.current.style.display="flex",Oe.current.style.width=Z.target.clientWidth+"px",Oe.current.style.height=Z.target.clientHeight+"px",Oe.current.style.top=Z.target.offsetTop+"px",Oe.current.style.left=Z.target.offsetLeft+"px",Ve.current.src=Z.target.getAttribute("src")):Oe.current.style.display="none"};return U.a.createElement("div",{style:{position:"relative"}},U.a.createElement("div",{ref:Me,style:Object(k.a)({},Pe),className:"".concat(J||""," markdown-body ").concat(ee.a.mdBody),onMouseOver:ue,dangerouslySetInnerHTML:{__html:Ze}}),U.a.createElement("div",{ref:Oe,className:ee.a.button},U.a.createElement(V.a,null,U.a.createElement(G.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),U.a.createElement(G.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),U.a.createElement("img",{ref:Ve,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),U.a.createElement(K.a,{close:!0,data:ze,type:ze!=null&&ze.length?we:"",style:Object(k.a)({},Ue),onClose:function(){return nt("")}}))}},"9VGf":function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return R});var re=z("cDcd"),V=z.n(re);function R(G,k){var O=Object(re.useRef)();Object(re.useEffect)(function(){O.current=G}),Object(re.useEffect)(function(){function F(){O.current()}if(k!==null){var U=setInterval(F,k);return function(){return clearInterval(U)}}},[k])}},"A/g1":function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXN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BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},BU3w:function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return O});var re=z("MNnm"),V="rc-util-key";function R(F){if(F.attachTo)return F.attachTo;var U=document.querySelector("head");return U||document.body}function G(F){var U,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var D=document.createElement("style");if((U=P.csp)===null||U===void 0?void 0:U.nonce){var E;D.nonce=(E=P.csp)===null||E===void 0?void 0:E.nonce}D.innerHTML=F;var b=R(P),_=b.firstChild;return P.prepend&&b.prepend?b.prepend(D):P.prepend&&_?b.insertBefore(D,_):b.appendChild(D),D}var k=new Map;function O(F,U){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=R(P);if(!k.has(D)){var E=G("",P),b=E.parentNode;k.set(D,b),b.removeChild(E)}var _=Array.from(k.get(D).children).find(function(s){return s.tagName==="STYLE"&&s[V]===U});if(_){var C,A;if(((C=P.csp)===null||C===void 0?void 0:C.nonce)&&_.nonce!==((A=P.csp)===null||A===void 0?void 0:A.nonce)){var v;_.nonce=(v=P.csp)===null||v===void 0?void 0:v.nonce}return _.innerHTML!==F&&(_.innerHTML=F),_}var c=G(F,P);return c[V]=U,c}},Bd2K:function(Fe,Le,z){(function(re){re(z("VrN/"),z("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(P,D,E){if(E!=re.Init&&E&&P.removeKeyMap("autoCloseTags"),!D)return;var b={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(b["'/'"]=function(_){return O(_)}),(typeof D!="object"||D.whenOpening!==!1)&&(b["'>'"]=function(_){return G(_)}),P.addKeyMap(b)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 G(P){if(P.getOption("disableInput"))return re.Pass;for(var D=P.listSelections(),E=[],b=P.getOption("autoCloseTags"),_=0;_<D.length;_++){if(!D[_].empty())return re.Pass;var C=D[_].head,A=P.getTokenAt(C),v=re.innerMode(P.getMode(),A.state),c=v.state,s=v.mode.xmlCurrentTag&&v.mode.xmlCurrentTag(c),d=s&&s.name;if(!d)return re.Pass;var l=v.mode.configuration=="html",S=typeof b=="object"&&b.dontCloseTags||l&&V,m=typeof b=="object"&&b.indentTags||l&&R;A.end>C.ch&&(d=d.slice(0,d.length-A.end+C.ch));var f=d.toLowerCase();if(!d||A.type=="string"&&(A.end!=C.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&s.close||A.string.indexOf("/")==C.ch-A.start-1||S&&F(S,f)>-1||U(P,v.mode.xmlCurrentContext&&v.mode.xmlCurrentContext(c)||[],d,C,!0))return re.Pass;var w=typeof b=="object"&&b.emptyTags;if(w&&F(w,d)>-1){E[_]={text:"/>",newPos:re.Pos(C.line,C.ch+2)};continue}var g=m&&F(m,f)>-1;E[_]={indent:g,text:">"+(g?`
|
|
|
|
`:"")+"</"+d+">",newPos:g?re.Pos(C.line+1,0):re.Pos(C.line,C.ch+1)}}for(var h=typeof b=="object"&&b.dontIndentOnAutoClose,_=D.length-1;_>=0;_--){var a=E[_];P.replaceRange(a.text,D[_].head,D[_].anchor,"+insert");var u=P.listSelections().slice(0);u[_]={head:a.newPos,anchor:a.newPos},P.setSelections(u),!h&&a.indent&&(P.indentLine(a.newPos.line,null,!0),P.indentLine(a.newPos.line+1,null,!0))}}function k(P,D){for(var E=P.listSelections(),b=[],_=D?"/":"</",C=P.getOption("autoCloseTags"),A=typeof C=="object"&&C.dontIndentOnSlash,v=0;v<E.length;v++){if(!E[v].empty())return re.Pass;var c=E[v].head,s=P.getTokenAt(c),d=re.innerMode(P.getMode(),s.state),l=d.state;if(D&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=c.ch-1))return re.Pass;var S,m=d.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(m&&d.mode.name=="javascript")S=_+"script";else if(m&&d.mode.name=="css")S=_+"style";else{var f=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(l);if(!f||f.length&&U(P,f,f[f.length-1],c))return re.Pass;S=_+f[f.length-1]}P.getLine(c.line).charAt(s.end)!=">"&&(S+=">"),b[v]=S}if(P.replaceSelections(b),E=P.listSelections(),!A)for(var v=0;v<E.length;v++)(v==E.length-1||E[v].head.line<E[v+1].head.line)&&P.indentLine(E[v].head.line)}function O(P){return P.getOption("disableInput")?re.Pass:k(P,!0)}re.commands.closeTag=function(P){return k(P)};function F(P,D){if(P.indexOf)return P.indexOf(D);for(var E=0,b=P.length;E<b;++E)if(P[E]==D)return E;return-1}function U(P,D,E,b,_){if(!re.scanForClosingTag)return!1;var C=Math.min(P.lastLine()+1,b.line+500),A=re.scanForClosingTag(P,b,null,C);if(!A||A.tag!=E)return!1;for(var v=_?1:0,c=D.length-1;c>=0&&D[c]==E;c--)++v;b=A.to;for(var c=1;c<v;c++){var s=re.scanForClosingTag(P,b,null,C);if(!s||s.tag!=E)return!1;b=s.to}return!0}})},BjJ7:function(Fe,Le,z){"use strict";z.d(Le,"d",function(){return V}),z.d(Le,"c",function(){return R}),z.d(Le,"e",function(){return G}),z.d(Le,"b",function(){return k}),z.d(Le,"a",function(){return F});var re=z("m3rI");function V(U){var P=!0;if(U.length>0){for(var D=0;D<U.length;D++)if(U[D].compile_success==0||!U[D].compile_success){P=!1;break}}else P=!1;return P}function R(U){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],E=0;E<U.length;E++){var b=U[E],_=P?"".concat(P,"/").concat(b.name):"".concat(b.name);D.push({title:b.name,isLeaf:!(b.type==="tree"),key:_})}return D}function G(U,P,D){for(var E=0;E<U.length;E++){var b=U[E];if(b.key===P){b.children=D;break}b.children&&G(b.children,P,D)}return U}function k(U,P,D){var E;return function(){var b=this,_=arguments,C=function(){E=null,D||U.apply(b,_)},A=D&&!E;clearTimeout(E),E=setTimeout(C,P),A&&U.apply(b,_)}}var O=!0,F=re.a.API_SERVER},"C+DQ":function(Fe,Le,z){},DlQD:function(Fe,Le,z){(function(re,V){Fe.exports=V()})(this,function(){"use strict";function re(he,ue){for(var de=0;de<ue.length;de++){var Z=ue[de];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(he,Z.key,Z)}}function V(he,ue,de){return ue&&re(he.prototype,ue),de&&re(he,de),he}function R(he,ue){if(!he)return;if(typeof he=="string")return G(he,ue);var de=Object.prototype.toString.call(he).slice(8,-1);if(de==="Object"&&he.constructor&&(de=he.constructor.name),de==="Map"||de==="Set")return Array.from(he);if(de==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(de))return G(he,ue)}function G(he,ue){(ue==null||ue>he.length)&&(ue=he.length);for(var de=0,Z=new Array(ue);de<ue;de++)Z[de]=he[de];return Z}function k(he,ue){var de;if(typeof Symbol=="undefined"||he[Symbol.iterator]==null){if(Array.isArray(he)||(de=R(he))||ue&&he&&typeof he.length=="number"){de&&(he=de);var Z=0;return function(){return Z>=he.length?{done:!0}:{done:!1,value:he[Z++]}}}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 de=he[Symbol.iterator](),de.next.bind(de)}function O(he,ue){return ue={exports:{}},he(ue,ue.exports),ue.exports}var F=O(function(he){function ue(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function de(Z){he.exports.defaults=Z}he.exports={defaults:ue(),getDefaults:ue,changeDefaults:de}}),U=F.defaults,P=F.getDefaults,D=F.changeDefaults,E=/[&<>"']/,b=/[&<>"']/g,_=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},v=function(ue){return A[ue]};function c(he,ue){if(ue){if(E.test(he))return he.replace(b,v)}else if(_.test(he))return he.replace(C,v);return he}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function d(he){return he.replace(s,function(ue,de){return de=de.toLowerCase(),de==="colon"?":":de.charAt(0)==="#"?de.charAt(1)==="x"?String.fromCharCode(parseInt(de.substring(2),16)):String.fromCharCode(+de.substring(1)):""})}var l=/(^|[^\[])\^/g;function S(he,ue){he=he.source||he,ue=ue||"";var de={replace:function(q,te){return te=te.source||te,te=te.replace(l,"$1"),he=he.replace(q,te),de},getRegex:function(){return new RegExp(he,ue)}};return de}var m=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(he,ue,de){if(he){var Z;try{Z=decodeURIComponent(d(de)).replace(m,"").toLowerCase()}catch(q){return null}if(Z.indexOf("javascript:")===0||Z.indexOf("vbscript:")===0||Z.indexOf("data:")===0)return null}ue&&!f.test(de)&&(de=o(ue,de));try{de=encodeURI(de).replace(/%25/g,"%")}catch(q){return null}return de}var g={},h=/^[^:]+:\/*[^/]*$/,a=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(he,ue){g[" "+he]||(h.test(he)?g[" "+he]=he+"/":g[" "+he]=M(he,"/",!0)),he=g[" "+he];var de=he.indexOf(":")===-1;return ue.substring(0,2)==="//"?de?ue:he.replace(a,"$1")+ue:ue.charAt(0)==="/"?de?ue:he.replace(u,"$1")+ue:he+ue}var y={exec:function(){}};function p(he){for(var ue=1,de,Z;ue<arguments.length;ue++){de=arguments[ue];for(Z in de)Object.prototype.hasOwnProperty.call(de,Z)&&(he[Z]=de[Z])}return he}function x(he,ue){var de=he.replace(/\|/g,function(te,se,fe){for(var _e=!1,De=se;--De>=0&&fe[De]==="\\";)_e=!_e;return _e?"|":" |"}),Z=de.split(/ \|/),q=0;if(Z.length>ue)Z.splice(ue);else for(;Z.length<ue;)Z.push("");for(;q<Z.length;q++)Z[q]=Z[q].trim().replace(/\\\|/g,"|");return Z}function M(he,ue,de){var Z=he.length;if(Z===0)return"";for(var q=0;q<Z;){var te=he.charAt(Z-q-1);if(te===ue&&!de)q++;else if(te!==ue&&de)q++;else break}return he.substr(0,Z-q)}function N(he,ue){if(he.indexOf(ue[1])===-1)return-1;for(var de=he.length,Z=0,q=0;q<de;q++)if(he[q]==="\\")q++;else if(he[q]===ue[0])Z++;else if(he[q]===ue[1]&&(Z--,Z<0))return q;return-1}function j(he){he&&he.sanitize&&!he.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var W={escape:c,unescape:d,edit:S,cleanUrl:w,resolveUrl:o,noopTest:y,merge:p,splitCells:x,rtrim:M,findClosingBracket:N,checkSanitizeDeprecation:j},L=F.defaults,I=W.rtrim,K=W.splitCells,Y=W.escape,ee=W.findClosingBracket;function oe(he,ue,de){var Z=ue.href,q=ue.title?Y(ue.title):null,te=he[1].replace(/\\([\[\]])/g,"$1");return he[0].charAt(0)!=="!"?{type:"link",raw:de,href:Z,title:q,text:te}:{type:"image",raw:de,href:Z,title:q,text:Y(te)}}function xe(he,ue){var de=he.match(/^(\s+)(?:```)/);if(de===null)return ue;var Z=de[1];return ue.split(`
|
|
`).map(function(q){var te=q.match(/^\s+/);if(te===null)return q;var se=te[0];return se.length>=Z.length?q.slice(Z.length):q}).join(`
|
|
`)}var ve=function(){function he(de){this.options=de||L}var ue=he.prototype;return ue.space=function(Z){var q=this.rules.block.newline.exec(Z);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
|
|
`}},ue.code=function(Z,q){var te=this.rules.block.code.exec(Z);if(te){var se=q[q.length-1];if(se&&se.type==="paragraph")return{raw:te[0],text:te[0].trimRight()};var fe=te[0].replace(/^ {4}/gm,"");return{type:"code",raw:te[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:I(fe,`
|
|
`)}}},ue.fences=function(Z){var q=this.rules.block.fences.exec(Z);if(q){var te=q[0],se=xe(te,q[3]||"");return{type:"code",raw:te,lang:q[2]?q[2].trim():q[2],text:se}}},ue.heading=function(Z){var q=this.rules.block.heading.exec(Z);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},ue.nptable=function(Z){var q=this.rules.block.nptable.exec(Z);if(q){var te={type:"table",header:K(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
|
|
`):[],raw:q[0]};if(te.header.length===te.align.length){var se=te.align.length,fe;for(fe=0;fe<se;fe++)/^ *-+: *$/.test(te.align[fe])?te.align[fe]="right":/^ *:-+: *$/.test(te.align[fe])?te.align[fe]="center":/^ *:-+ *$/.test(te.align[fe])?te.align[fe]="left":te.align[fe]=null;for(se=te.cells.length,fe=0;fe<se;fe++)te.cells[fe]=K(te.cells[fe],te.header.length);return te}}},ue.hr=function(Z){var q=this.rules.block.hr.exec(Z);if(q)return{type:"hr",raw:q[0]}},ue.blockquote=function(Z){var q=this.rules.block.blockquote.exec(Z);if(q){var te=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:te}}},ue.list=function(Z){var q=this.rules.block.list.exec(Z);if(q){for(var te=q[0],se=q[2],fe=se.length>1,_e=se[se.length-1]===")",De={type:"list",raw:te,ordered:fe,start:fe?+se.slice(0,-1):"",loose:!1,items:[]},We=q[0].match(this.rules.block.item),Xe=!1,Ce,vt,ft,ke,yt,Et,tr,Yt=We.length,Ct=0;Ct<Yt;Ct++)Ce=We[Ct],te=Ce,vt=Ce.length,Ce=Ce.replace(/^ *([*+-]|\d+[.)]) */,""),~Ce.indexOf(`
|
|
`)&&(vt-=Ce.length,Ce=this.options.pedantic?Ce.replace(/^ {1,4}/gm,""):Ce.replace(new RegExp("^ {1,"+vt+"}","gm"),"")),Ct!==Yt-1&&(ft=this.rules.block.bullet.exec(We[Ct+1])[0],(fe?ft.length===1||!_e&&ft[ft.length-1]===")":ft.length>1||this.options.smartLists&&ft!==se)&&(ke=We.slice(Ct+1).join(`
|
|
`),De.raw=De.raw.substring(0,De.raw.length-ke.length),Ct=Yt-1)),yt=Xe||/\n\n(?!\s*$)/.test(Ce),Ct!==Yt-1&&(Xe=Ce.charAt(Ce.length-1)===`
|
|
`,yt||(yt=Xe)),yt&&(De.loose=!0),Et=/^\[[ xX]\] /.test(Ce),tr=void 0,Et&&(tr=Ce[1]!==" ",Ce=Ce.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:te,task:Et,checked:tr,loose:yt,text:Ce});return De}},ue.html=function(Z){var q=this.rules.block.html.exec(Z);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]):Y(q[0]):q[0]}},ue.def=function(Z){var q=this.rules.block.def.exec(Z);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var te=q[1].toLowerCase().replace(/\s+/g," ");return{tag:te,raw:q[0],href:q[2],title:q[3]}}},ue.table=function(Z){var q=this.rules.block.table.exec(Z);if(q){var te={type:"table",header:K(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
|
|
`):[]};if(te.header.length===te.align.length){te.raw=q[0];var se=te.align.length,fe;for(fe=0;fe<se;fe++)/^ *-+: *$/.test(te.align[fe])?te.align[fe]="right":/^ *:-+: *$/.test(te.align[fe])?te.align[fe]="center":/^ *:-+ *$/.test(te.align[fe])?te.align[fe]="left":te.align[fe]=null;for(se=te.cells.length,fe=0;fe<se;fe++)te.cells[fe]=K(te.cells[fe].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},ue.lheading=function(Z){var q=this.rules.block.lheading.exec(Z);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},ue.paragraph=function(Z){var q=this.rules.block.paragraph.exec(Z);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
|
|
`?q[1].slice(0,-1):q[1]}},ue.text=function(Z,q){var te=this.rules.block.text.exec(Z);if(te){var se=q[q.length-1];return se&&se.type==="text"?{raw:te[0],text:te[0]}:{type:"text",raw:te[0],text:te[0]}}},ue.escape=function(Z){var q=this.rules.inline.escape.exec(Z);if(q)return{type:"escape",raw:q[0],text:Y(q[1])}},ue.tag=function(Z,q,te){var se=this.rules.inline.tag.exec(Z);if(se)return!q&&/^<a /i.test(se[0])?q=!0:q&&/^<\/a>/i.test(se[0])&&(q=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(se[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(se[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:se[0],inLink:q,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):Y(se[0]):se[0]}},ue.link=function(Z){var q=this.rules.inline.link.exec(Z);if(q){var te=ee(q[2],"()");if(te>-1){var se=q[0].indexOf("!")===0?5:4,fe=se+q[1].length+te;q[2]=q[2].substring(0,te),q[0]=q[0].substring(0,fe).trim(),q[3]=""}var _e=q[2],De="";if(this.options.pedantic){var We=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(_e);We?(_e=We[1],De=We[3]):De=""}else De=q[3]?q[3].slice(1,-1):"";_e=_e.trim().replace(/^<([\s\S]*)>$/,"$1");var Xe=oe(q,{href:_e&&_e.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},q[0]);return Xe}},ue.reflink=function(Z,q){var te;if((te=this.rules.inline.reflink.exec(Z))||(te=this.rules.inline.nolink.exec(Z))){var se=(te[2]||te[1]).replace(/\s+/g," ");if(se=q[se.toLowerCase()],!se||!se.href){var fe=te[0].charAt(0);return{type:"text",raw:fe,text:fe}}var _e=oe(te,se,te[0]);return _e}},ue.strong=function(Z,q,te){te===void 0&&(te="");var se=this.rules.inline.strong.start.exec(Z);if(se&&(!se[1]||se[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){q=q.slice(-1*Z.length);var fe=se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;fe.lastIndex=0;for(var _e;(se=fe.exec(q))!=null;)if(_e=this.rules.inline.strong.middle.exec(q.slice(0,se.index+3)),_e)return{type:"strong",raw:Z.slice(0,_e[0].length),text:Z.slice(2,_e[0].length-2)}}},ue.em=function(Z,q,te){te===void 0&&(te="");var se=this.rules.inline.em.start.exec(Z);if(se&&(!se[1]||se[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){q=q.slice(-1*Z.length);var fe=se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;fe.lastIndex=0;for(var _e;(se=fe.exec(q))!=null;)if(_e=this.rules.inline.em.middle.exec(q.slice(0,se.index+2)),_e)return{type:"em",raw:Z.slice(0,_e[0].length),text:Z.slice(1,_e[0].length-1)}}},ue.codespan=function(Z){var q=this.rules.inline.code.exec(Z);if(q){var te=q[2].replace(/\n/g," "),se=/[^ ]/.test(te),fe=te.startsWith(" ")&&te.endsWith(" ");return se&&fe&&(te=te.substring(1,te.length-1)),te=Y(te,!0),{type:"codespan",raw:q[0],text:te}}},ue.br=function(Z){var q=this.rules.inline.br.exec(Z);if(q)return{type:"br",raw:q[0]}},ue.del=function(Z){var q=this.rules.inline.del.exec(Z);if(q)return{type:"del",raw:q[0],text:q[1]}},ue.autolink=function(Z,q){var te=this.rules.inline.autolink.exec(Z);if(te){var se,fe;return te[2]==="@"?(se=Y(this.options.mangle?q(te[1]):te[1]),fe="mailto:"+se):(se=Y(te[1]),fe=se),{type:"link",raw:te[0],text:se,href:fe,tokens:[{type:"text",raw:se,text:se}]}}},ue.url=function(Z,q){var te;if(te=this.rules.inline.url.exec(Z)){var se,fe;if(te[2]==="@")se=Y(this.options.mangle?q(te[0]):te[0]),fe="mailto:"+se;else{var _e;do _e=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(_e!==te[0]);se=Y(te[0]),te[1]==="www."?fe="http://"+se:fe=se}return{type:"link",raw:te[0],text:se,href:fe,tokens:[{type:"text",raw:se,text:se}]}}},ue.inlineText=function(Z,q,te){var se=this.rules.inline.text.exec(Z);if(se){var fe;return q?fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):Y(se[0]):se[0]:fe=Y(this.options.smartypants?te(se[0]):se[0]),{type:"text",raw:se[0],text:fe}}},he}(),ge=W.noopTest,me=W.edit,ce=W.merge,ie={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ge,table:ge,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ie._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ie._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ie.def=me(ie.def).replace("label",ie._label).replace("title",ie._title).getRegex(),ie.bullet=/(?:[*+-]|\d{1,9}[.)])/,ie.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ie.item=me(ie.item,"gm").replace(/bull/g,ie.bullet).getRegex(),ie.list=me(ie.list).replace(/bull/g,ie.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ie.def.source+")").getRegex(),ie._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",ie._comment=/<!--(?!-?>)[\s\S]*?-->/,ie.html=me(ie.html,"i").replace("comment",ie._comment).replace("tag",ie._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie.paragraph=me(ie._paragraph).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ie._tag).getRegex(),ie.blockquote=me(ie.blockquote).replace("paragraph",ie.paragraph).getRegex(),ie.normal=ce({},ie),ie.gfm=ce({},ie.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*|$)"}),ie.gfm.nptable=me(ie.gfm.nptable).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ie._tag).getRegex(),ie.gfm.table=me(ie.gfm.table).replace("hr",ie.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ie._tag).getRegex(),ie.pedantic=ce({},ie.normal,{html:me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ie._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ge,paragraph:me(ie.normal._paragraph).replace("hr",ie.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ie.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var pe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ge,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ge,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};pe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",pe.punctuation=me(pe.punctuation).replace(/punctuation/g,pe._punctuation).getRegex(),pe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",pe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",pe.em.start=me(pe.em.start).replace(/punctuation/g,pe._punctuation).getRegex(),pe.em.middle=me(pe.em.middle).replace(/punctuation/g,pe._punctuation).replace(/overlapSkip/g,pe._overlapSkip).getRegex(),pe.em.endAst=me(pe.em.endAst,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.em.endUnd=me(pe.em.endUnd,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.start=me(pe.strong.start).replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.middle=me(pe.strong.middle).replace(/punctuation/g,pe._punctuation).replace(/blockSkip/g,pe._blockSkip).getRegex(),pe.strong.endAst=me(pe.strong.endAst,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.endUnd=me(pe.strong.endUnd,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.blockSkip=me(pe._blockSkip,"g").getRegex(),pe.overlapSkip=me(pe._overlapSkip,"g").getRegex(),pe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,pe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,pe._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])?)+(?![-_])/,pe.autolink=me(pe.autolink).replace("scheme",pe._scheme).replace("email",pe._email).getRegex(),pe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,pe.tag=me(pe.tag).replace("comment",ie._comment).replace("attribute",pe._attribute).getRegex(),pe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,pe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,pe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,pe.link=me(pe.link).replace("label",pe._label).replace("href",pe._href).replace("title",pe._title).getRegex(),pe.reflink=me(pe.reflink).replace("label",pe._label).getRegex(),pe.reflinkSearch=me(pe.reflinkSearch,"g").replace("reflink",pe.reflink).replace("nolink",pe.nolink).getRegex(),pe.normal=ce({},pe),pe.pedantic=ce({},pe.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:me(/^!?\[(label)\]\((.*?)\)/).replace("label",pe._label).getRegex(),reflink:me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pe._label).getRegex()}),pe.gfm=ce({},pe.normal,{escape:me(pe.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),pe.gfm.url=me(pe.gfm.url,"i").replace("email",pe.gfm._extended_email).getRegex(),pe.breaks=ce({},pe.gfm,{br:me(pe.br).replace("{2,}","*").getRegex(),text:me(pe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var J={block:ie,inline:pe},ne=F.defaults,$=J.block,be=J.inline;function Te(he){return he.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ye(he){var ue="",de,Z,q=he.length;for(de=0;de<q;de++)Z=he.charCodeAt(de),Math.random()>.5&&(Z="x"+Z.toString(16)),ue+="&#"+Z+";";return ue}var Se=function(){function he(de){this.tokens=[],this.tokens.links=Object.create(null),this.options=de||ne,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Z={block:$.normal,inline:be.normal};this.options.pedantic?(Z.block=$.pedantic,Z.inline=be.pedantic):this.options.gfm&&(Z.block=$.gfm,this.options.breaks?Z.inline=be.breaks:Z.inline=be.gfm),this.tokenizer.rules=Z}he.lex=function(Z,q){var te=new he(q);return te.lex(Z)};var ue=he.prototype;return ue.lex=function(Z){return Z=Z.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(Z,this.tokens,!0),this.inline(this.tokens),this.tokens},ue.blockTokens=function(Z,q,te){q===void 0&&(q=[]),te===void 0&&(te=!0),Z=Z.replace(/^ +$/gm,"");for(var se,fe,_e,De;Z;){if(se=this.tokenizer.space(Z)){Z=Z.substring(se.raw.length),se.type&&q.push(se);continue}if(se=this.tokenizer.code(Z,q)){Z=Z.substring(se.raw.length),se.type?q.push(se):(De=q[q.length-1],De.raw+=`
|
|
`+se.raw,De.text+=`
|
|
`+se.text);continue}if(se=this.tokenizer.fences(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.heading(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.nptable(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.hr(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.blockquote(Z)){Z=Z.substring(se.raw.length),se.tokens=this.blockTokens(se.text,[],te),q.push(se);continue}if(se=this.tokenizer.list(Z)){for(Z=Z.substring(se.raw.length),_e=se.items.length,fe=0;fe<_e;fe++)se.items[fe].tokens=this.blockTokens(se.items[fe].text,[],!1);q.push(se);continue}if(se=this.tokenizer.html(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(te&&(se=this.tokenizer.def(Z))){Z=Z.substring(se.raw.length),this.tokens.links[se.tag]||(this.tokens.links[se.tag]={href:se.href,title:se.title});continue}if(se=this.tokenizer.table(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.lheading(Z)){Z=Z.substring(se.raw.length),q.push(se);continue}if(te&&(se=this.tokenizer.paragraph(Z))){Z=Z.substring(se.raw.length),q.push(se);continue}if(se=this.tokenizer.text(Z,q)){Z=Z.substring(se.raw.length),se.type?q.push(se):(De=q[q.length-1],De.raw+=`
|
|
`+se.raw,De.text+=`
|
|
`+se.text);continue}if(Z){var We="Infinite loop on byte: "+Z.charCodeAt(0);if(this.options.silent){console.error(We);break}else throw new Error(We)}}return q},ue.inline=function(Z){var q,te,se,fe,_e,De,We=Z.length;for(q=0;q<We;q++){De=Z[q];switch(De.type){case"paragraph":case"text":case"heading":{De.tokens=[],this.inlineTokens(De.text,De.tokens);break}case"table":{for(De.tokens={header:[],cells:[]},fe=De.header.length,te=0;te<fe;te++)De.tokens.header[te]=[],this.inlineTokens(De.header[te],De.tokens.header[te]);for(fe=De.cells.length,te=0;te<fe;te++)for(_e=De.cells[te],De.tokens.cells[te]=[],se=0;se<_e.length;se++)De.tokens.cells[te][se]=[],this.inlineTokens(_e[se],De.tokens.cells[te][se]);break}case"blockquote":{this.inline(De.tokens);break}case"list":{for(fe=De.items.length,te=0;te<fe;te++)this.inline(De.items[te].tokens);break}}}return Z},ue.inlineTokens=function(Z,q,te,se,fe){q===void 0&&(q=[]),te===void 0&&(te=!1),se===void 0&&(se=!1),fe===void 0&&(fe="");var _e,De=Z,We;if(this.tokens.links){var Xe=Object.keys(this.tokens.links);if(Xe.length>0)for(;(We=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)Xe.includes(We[0].slice(We[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,We.index)+"["+"a".repeat(We[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(We=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,We.index)+"["+"a".repeat(We[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Z;){if(_e=this.tokenizer.escape(Z)){Z=Z.substring(_e.raw.length),q.push(_e);continue}if(_e=this.tokenizer.tag(Z,te,se)){Z=Z.substring(_e.raw.length),te=_e.inLink,se=_e.inRawBlock,q.push(_e);continue}if(_e=this.tokenizer.link(Z)){Z=Z.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,se)),q.push(_e);continue}if(_e=this.tokenizer.reflink(Z,this.tokens.links)){Z=Z.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,se)),q.push(_e);continue}if(_e=this.tokenizer.strong(Z,De,fe)){Z=Z.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],te,se),q.push(_e);continue}if(_e=this.tokenizer.em(Z,De,fe)){Z=Z.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],te,se),q.push(_e);continue}if(_e=this.tokenizer.codespan(Z)){Z=Z.substring(_e.raw.length),q.push(_e);continue}if(_e=this.tokenizer.br(Z)){Z=Z.substring(_e.raw.length),q.push(_e);continue}if(_e=this.tokenizer.del(Z)){Z=Z.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],te,se),q.push(_e);continue}if(_e=this.tokenizer.autolink(Z,ye)){Z=Z.substring(_e.raw.length),q.push(_e);continue}if(!te&&(_e=this.tokenizer.url(Z,ye))){Z=Z.substring(_e.raw.length),q.push(_e);continue}if(_e=this.tokenizer.inlineText(Z,se,Te)){Z=Z.substring(_e.raw.length),fe=_e.raw.slice(-1),q.push(_e);continue}if(Z){var Ce="Infinite loop on byte: "+Z.charCodeAt(0);if(this.options.silent){console.error(Ce);break}else throw new Error(Ce)}}return q},V(he,null,[{key:"rules",get:function(){return{block:$,inline:be}}}]),he}(),Pe=F.defaults,Ie=W.cleanUrl,Ue=W.escape,Re=function(){function he(de){this.options=de||Pe}var ue=he.prototype;return ue.code=function(Z,q,te){var se=(q||"").match(/\S*/)[0];if(this.options.highlight){var fe=this.options.highlight(Z,se);fe!=null&&fe!==Z&&(te=!0,Z=fe)}return se?'<pre><code class="'+this.options.langPrefix+Ue(se,!0)+'">'+(te?Z:Ue(Z,!0))+`</code></pre>
|
|
`:"<pre><code>"+(te?Z:Ue(Z,!0))+`</code></pre>
|
|
`},ue.blockquote=function(Z){return`<blockquote>
|
|
`+Z+`</blockquote>
|
|
`},ue.html=function(Z){return Z},ue.heading=function(Z,q,te,se){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+se.slug(te)+'">'+Z+"</h"+q+`>
|
|
`:"<h"+q+">"+Z+"</h"+q+`>
|
|
`},ue.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ue.list=function(Z,q,te){var se=q?"ol":"ul",fe=q&&te!==1?' start="'+te+'"':"";return"<"+se+fe+`>
|
|
`+Z+"</"+se+`>
|
|
`},ue.listitem=function(Z){return"<li>"+Z+`</li>
|
|
`},ue.checkbox=function(Z){return"<input "+(Z?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ue.paragraph=function(Z){return"<p>"+Z+`</p>
|
|
`},ue.table=function(Z,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
|
|
<thead>
|
|
`+Z+`</thead>
|
|
`+q+`</table>
|
|
`},ue.tablerow=function(Z){return`<tr>
|
|
`+Z+`</tr>
|
|
`},ue.tablecell=function(Z,q){var te=q.header?"th":"td",se=q.align?"<"+te+' align="'+q.align+'">':"<"+te+">";return se+Z+"</"+te+`>
|
|
`},ue.strong=function(Z){return"<strong>"+Z+"</strong>"},ue.em=function(Z){return"<em>"+Z+"</em>"},ue.codespan=function(Z){return"<code>"+Z+"</code>"},ue.br=function(){return this.options.xhtml?"<br/>":"<br>"},ue.del=function(Z){return"<del>"+Z+"</del>"},ue.link=function(Z,q,te){if(Z=Ie(this.options.sanitize,this.options.baseUrl,Z),Z===null)return te;var se='<a href="'+Ue(Z)+'"';return q&&(se+=' title="'+q+'"'),se+=">"+te+"</a>",se},ue.image=function(Z,q,te){if(Z=Ie(this.options.sanitize,this.options.baseUrl,Z),Z===null)return te;var se='<img src="'+Z+'" alt="'+te+'"';return q&&(se+=' title="'+q+'"'),se+=this.options.xhtml?"/>":">",se},ue.text=function(Z){return Z},he}(),Oe=function(){function he(){}var ue=he.prototype;return ue.strong=function(Z){return Z},ue.em=function(Z){return Z},ue.codespan=function(Z){return Z},ue.del=function(Z){return Z},ue.html=function(Z){return Z},ue.text=function(Z){return Z},ue.link=function(Z,q,te){return""+te},ue.image=function(Z,q,te){return""+te},ue.br=function(){return""},he}(),Ve=function(){function he(){this.seen={}}var ue=he.prototype;return ue.slug=function(Z){var q=Z.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(q)){var te=q;do this.seen[te]++,q=te+"-"+this.seen[te];while(this.seen.hasOwnProperty(q))}return this.seen[q]=0,q},he}(),qe=F.defaults,He=W.unescape,ze=function(){function he(de){this.options=de||qe,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Oe,this.slugger=new Ve}he.parse=function(Z,q){var te=new he(q);return te.parse(Z)};var ue=he.prototype;return ue.parse=function(Z,q){q===void 0&&(q=!0);var te="",se,fe,_e,De,We,Xe,Ce,vt,ft,ke,yt,Et,tr,Yt,Ct,Dr,Kr,yr,Rr=Z.length;for(se=0;se<Rr;se++){ke=Z[se];switch(ke.type){case"space":continue;case"hr":{te+=this.renderer.hr();continue}case"heading":{te+=this.renderer.heading(this.parseInline(ke.tokens),ke.depth,He(this.parseInline(ke.tokens,this.textRenderer)),this.slugger);continue}case"code":{te+=this.renderer.code(ke.text,ke.lang,ke.escaped);continue}case"table":{for(vt="",Ce="",De=ke.header.length,fe=0;fe<De;fe++)Ce+=this.renderer.tablecell(this.parseInline(ke.tokens.header[fe]),{header:!0,align:ke.align[fe]});for(vt+=this.renderer.tablerow(Ce),ft="",De=ke.cells.length,fe=0;fe<De;fe++){for(Xe=ke.tokens.cells[fe],Ce="",We=Xe.length,_e=0;_e<We;_e++)Ce+=this.renderer.tablecell(this.parseInline(Xe[_e]),{header:!1,align:ke.align[_e]});ft+=this.renderer.tablerow(Ce)}te+=this.renderer.table(vt,ft);continue}case"blockquote":{ft=this.parse(ke.tokens),te+=this.renderer.blockquote(ft);continue}case"list":{for(yt=ke.ordered,Et=ke.start,tr=ke.loose,De=ke.items.length,ft="",fe=0;fe<De;fe++)Ct=ke.items[fe],Dr=Ct.checked,Kr=Ct.task,Yt="",Ct.task&&(yr=this.renderer.checkbox(Dr),tr?Ct.tokens.length>0&&Ct.tokens[0].type==="text"?(Ct.tokens[0].text=yr+" "+Ct.tokens[0].text,Ct.tokens[0].tokens&&Ct.tokens[0].tokens.length>0&&Ct.tokens[0].tokens[0].type==="text"&&(Ct.tokens[0].tokens[0].text=yr+" "+Ct.tokens[0].tokens[0].text)):Ct.tokens.unshift({type:"text",text:yr}):Yt+=yr),Yt+=this.parse(Ct.tokens,tr),ft+=this.renderer.listitem(Yt,Kr,Dr);te+=this.renderer.list(ft,yt,Et);continue}case"html":{te+=this.renderer.html(ke.text);continue}case"paragraph":{te+=this.renderer.paragraph(this.parseInline(ke.tokens));continue}case"text":{for(ft=ke.tokens?this.parseInline(ke.tokens):ke.text;se+1<Rr&&Z[se+1].type==="text";)ke=Z[++se],ft+=`
|
|
`+(ke.tokens?this.parseInline(ke.tokens):ke.text);te+=q?this.renderer.paragraph(ft):ft;continue}default:{var fr='Token with "'+ke.type+'" type was not found.';if(this.options.silent){console.error(fr);return}else throw new Error(fr)}}}return te},ue.parseInline=function(Z,q){q=q||this.renderer;var te="",se,fe,_e=Z.length;for(se=0;se<_e;se++){fe=Z[se];switch(fe.type){case"escape":{te+=q.text(fe.text);break}case"html":{te+=q.html(fe.text);break}case"link":{te+=q.link(fe.href,fe.title,this.parseInline(fe.tokens,q));break}case"image":{te+=q.image(fe.href,fe.title,fe.text);break}case"strong":{te+=q.strong(this.parseInline(fe.tokens,q));break}case"em":{te+=q.em(this.parseInline(fe.tokens,q));break}case"codespan":{te+=q.codespan(fe.text);break}case"br":{te+=q.br();break}case"del":{te+=q.del(this.parseInline(fe.tokens,q));break}case"text":{te+=q.text(fe.text);break}default:{var De='Token with "'+fe.type+'" type was not found.';if(this.options.silent){console.error(De);return}else throw new Error(De)}}}return te},he}(),nt=W.merge,Je=W.checkSanitizeDeprecation,$e=W.escape,we=F.getDefaults,rt=F.changeDefaults,Ze=F.defaults;function Me(he,ue,de){if(typeof he=="undefined"||he===null)throw new Error("marked(): input parameter is undefined or null");if(typeof he!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(he)+", string expected");if(typeof ue=="function"&&(de=ue,ue=null),ue=nt({},Me.defaults,ue||{}),Je(ue),de){var Z=ue.highlight,q;try{q=Se.lex(he,ue)}catch(_e){return de(_e)}var te=function(De){var We;if(!De)try{We=ze.parse(q,ue)}catch(Xe){De=Xe}return ue.highlight=Z,De?de(De):de(null,We)};if(!Z||Z.length<3)return te();if(delete ue.highlight,!q.length)return te();var se=0;Me.walkTokens(q,function(_e){_e.type==="code"&&(se++,setTimeout(function(){Z(_e.text,_e.lang,function(De,We){if(De)return te(De);We!=null&&We!==_e.text&&(_e.text=We,_e.escaped=!0),se--,se===0&&te()})},0))}),se===0&&te();return}try{var fe=Se.lex(he,ue);return ue.walkTokens&&Me.walkTokens(fe,ue.walkTokens),ze.parse(fe,ue)}catch(_e){if(_e.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ue.silent)return"<p>An error occurred:</p><pre>"+$e(_e.message+"",!0)+"</pre>";throw _e}}Me.options=Me.setOptions=function(he){return nt(Me.defaults,he),rt(Me.defaults),Me},Me.getDefaults=we,Me.defaults=Ze,Me.use=function(he){var ue=nt({},he);if(he.renderer&&function(){var Z=Me.defaults.renderer||new Re,q=function(fe){var _e=Z[fe];Z[fe]=function(){for(var De=arguments.length,We=new Array(De),Xe=0;Xe<De;Xe++)We[Xe]=arguments[Xe];var Ce=he.renderer[fe].apply(Z,We);return Ce===!1&&(Ce=_e.apply(Z,We)),Ce}};for(var te in he.renderer)q(te);ue.renderer=Z}(),he.tokenizer&&function(){var Z=Me.defaults.tokenizer||new ve,q=function(fe){var _e=Z[fe];Z[fe]=function(){for(var De=arguments.length,We=new Array(De),Xe=0;Xe<De;Xe++)We[Xe]=arguments[Xe];var Ce=he.tokenizer[fe].apply(Z,We);return Ce===!1&&(Ce=_e.apply(Z,We)),Ce}};for(var te in he.tokenizer)q(te);ue.tokenizer=Z}(),he.walkTokens){var de=Me.defaults.walkTokens;ue.walkTokens=function(Z){he.walkTokens(Z),de&&de(Z)}}Me.setOptions(ue)},Me.walkTokens=function(he,ue){for(var de=k(he),Z;!(Z=de()).done;){var q=Z.value;ue(q);switch(q.type){case"table":{for(var te=k(q.tokens.header),se;!(se=te()).done;){var fe=se.value;Me.walkTokens(fe,ue)}for(var _e=k(q.tokens.cells),De;!(De=_e()).done;)for(var We=De.value,Xe=k(We),Ce;!(Ce=Xe()).done;){var vt=Ce.value;Me.walkTokens(vt,ue)}break}case"list":{Me.walkTokens(q.items,ue);break}default:q.tokens&&Me.walkTokens(q.tokens,ue)}}},Me.Parser=ze,Me.parser=ze.parse,Me.Renderer=Re,Me.TextRenderer=Oe,Me.Lexer=Se,Me.lexer=Se.lex,Me.Tokenizer=ve,Me.Slugger=Ve,Me.parse=Me;var je=Me;return je})},E7E6:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHyq9cuaJZACHEJCklIOgHQUqZ0QIAACg/FB+//niPwxD/H3793QqwJkePHqW2tjaSUsKinCOibwWDwfVulcFIPg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kJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Fe,Le,z){(function(re){re(z("VrN/"))})(function(re){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},R=re.Pos;re.defineOption("autoCloseBrackets",!1,function(A,v,c){c&&c!=re.Init&&(A.removeKeyMap(k),A.state.closeBrackets=null),v&&(O(G(v,"pairs")),A.state.closeBrackets=v,A.addKeyMap(k))});function G(A,v){return v=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[v]!=null?A[v]:V[v]}var k={Backspace:P,Enter:D};function O(A){for(var v=0;v<A.length;v++){var c=A.charAt(v),s="'"+c+"'";k[s]||(k[s]=F(c))}}O(V.pairs+"`");function F(A){return function(v){return b(v,A)}}function U(A){var v=A.state.closeBrackets;if(!v||v.override)return v;var c=A.getModeAt(A.getCursor());return c.closeBrackets||v}function P(A){var v=U(A);if(!v||A.getOption("disableInput"))return re.Pass;for(var c=G(v,"pairs"),s=A.listSelections(),d=0;d<s.length;d++){if(!s[d].empty())return re.Pass;var l=_(A,s[d].head);if(!l||c.indexOf(l)%2!=0)return re.Pass}for(var d=s.length-1;d>=0;d--){var S=s[d].head;A.replaceRange("",R(S.line,S.ch-1),R(S.line,S.ch+1),"+delete")}}function D(A){var v=U(A),c=v&&G(v,"explode");if(!c||A.getOption("disableInput"))return re.Pass;for(var s=A.listSelections(),d=0;d<s.length;d++){if(!s[d].empty())return re.Pass;var l=_(A,s[d].head);if(!l||c.indexOf(l)%2!=0)return re.Pass}A.operation(function(){var S=A.lineSeparator()||`
|
|
`;A.replaceSelection(S+S,null),A.execCommand("goCharLeft"),s=A.listSelections();for(var m=0;m<s.length;m++){var f=s[m].head.line;A.indentLine(f,null,!0),A.indentLine(f+1,null,!0)}})}function E(A){var v=re.cmpPos(A.anchor,A.head)>0;return{anchor:new R(A.anchor.line,A.anchor.ch+(v?-1:1)),head:new R(A.head.line,A.head.ch+(v?1:-1))}}function b(A,v){var c=U(A);if(!c||A.getOption("disableInput"))return re.Pass;var s=G(c,"pairs"),d=s.indexOf(v);if(d==-1)return re.Pass;for(var l=G(c,"closeBefore"),S=G(c,"triples"),m=s.charAt(d+1)==v,f=A.listSelections(),w=d%2==0,g,h=0;h<f.length;h++){var a=f[h],u=a.head,o,y=A.getRange(u,R(u.line,u.ch+1));if(w&&!a.empty())o="surround";else if((m||!w)&&y==v)m&&C(A,u)?o="both":S.indexOf(v)>=0&&A.getRange(u,R(u.line,u.ch+3))==v+v+v?o="skipThree":o="skip";else if(m&&u.ch>1&&S.indexOf(v)>=0&&A.getRange(R(u.line,u.ch-2),u)==v+v){if(u.ch>2&&/\bstring/.test(A.getTokenTypeAt(R(u.line,u.ch-2))))return re.Pass;o="addFour"}else if(m){var p=u.ch==0?" ":A.getRange(R(u.line,u.ch-1),u);if(!re.isWordChar(y)&&p!=v&&!re.isWordChar(p))o="both";else return re.Pass}else if(w&&(y.length===0||/\s/.test(y)||l.indexOf(y)>-1))o="both";else return re.Pass;if(!g)g=o;else if(g!=o)return re.Pass}var x=d%2?s.charAt(d-1):v,M=d%2?v:s.charAt(d+1);A.operation(function(){if(g=="skip")A.execCommand("goCharRight");else if(g=="skipThree")for(var N=0;N<3;N++)A.execCommand("goCharRight");else if(g=="surround"){for(var j=A.getSelections(),N=0;N<j.length;N++)j[N]=x+j[N]+M;A.replaceSelections(j,"around"),j=A.listSelections().slice();for(var N=0;N<j.length;N++)j[N]=E(j[N]);A.setSelections(j)}else g=="both"?(A.replaceSelection(x+M,null),A.triggerElectric(x+M),A.execCommand("goCharLeft")):g=="addFour"&&(A.replaceSelection(x+x+x+x,"before"),A.execCommand("goCharRight"))})}function _(A,v){var c=A.getRange(R(v.line,v.ch-1),R(v.line,v.ch+1));return c.length==2?c:null}function C(A,v){var c=A.getTokenAt(R(v.line,v.ch+1));return/\bstring/.test(c.type)&&c.start==v.ch&&(v.ch==0||!/\bstring/.test(A.getTokenTypeAt(v)))}})},FOrL:function(Fe,Le,z){Fe.exports=z.p+"static/nodata.a6b3f948.png"},FPkq:function(Fe,Le,z){Fe.exports=z.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCBrO0IrqYcApx1xsV6XLt2nWl43kyQqyB38dQJPZ7MY56qdLsHGIL/iY3m24R0p2jc6BDZrkVHf3XTiBFfMy9PdbSgN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fblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},GfqC:function(Fe,Le,z){"use strict";var re=z("cDcd"),V=z.n(re),R=z("TSYQ"),G=z.n(R);function k(W,L){var I="cannot "+W.method+" "+W.action+" "+L.status+"'",K=new Error(I);return K.status=L.status,K.method=W.method,K.url=W.action,K}function O(W){var L=W.responseText||W.response;if(!L)return L;try{return JSON.parse(L)}catch(I){return L}}function F(W){var L=new XMLHttpRequest;W.onProgress&&L.upload&&(L.upload.onprogress=function(ee){ee.total>0&&(ee.percent=ee.loaded/ee.total*100),W.onProgress(ee)});var I=new FormData;W.data&&Object.keys(W.data).forEach(function(Y){var ee=W.data[Y];if(Array.isArray(ee)){ee.forEach(function(oe){I.append(Y+"[]",oe)});return}I.append(Y,W.data[Y])}),W.file instanceof Blob?I.append(W.filename,W.file,W.file.name):I.append(W.filename,W.file),L.onerror=function(ee){W.onError(ee)},L.onload=function(){return L.status<200||L.status>=300?W.onError(k(W,L),O(L)):W.onSuccess(O(L),L)},L.open(W.method,W.action,!0),W.withCredentials&&"withCredentials"in L&&(L.withCredentials=!0);var K=W.headers||{};return K["X-Requested-With"]!==null&&L.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(K).forEach(function(Y){K[Y]!==null&&L.setRequestHeader(Y,K[Y])}),L.send(I),{abort:function(){L.abort()}}}var U=+new Date,P=0;function D(){return"rc-upload-"+U+"-"+ ++P}function E(W,L){return W.indexOf(L,W.length-L.length)!==-1}var b=function(W,L){if(W&&L){var I=Array.isArray(L)?L:L.split(","),K=W.name||"",Y=W.type||"",ee=Y.replace(/\/.*$/,"");return I.some(function(oe){var xe=oe.trim();return xe.charAt(0)==="."?E(K.toLowerCase(),xe.toLowerCase()):/\/\*$/.test(xe)?ee===xe.replace(/\/.*$/,""):Y===xe})}return!0};function _(W,L){var I=W.createReader(),K=[];function Y(){I.readEntries(function(ee){var oe=Array.prototype.slice.apply(ee);K=K.concat(oe);var xe=!oe.length;xe?L(K):Y()})}Y()}var C=function(L,I,K){var Y=function ee(oe,xe){xe=xe||"",oe.isFile?oe.file(function(ve){K(ve)&&(oe.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),I([ve]))}):oe.isDirectory&&_(oe,function(ve){ve.forEach(function(ge){ee(ge,""+xe+oe.name+"/")})})};L.forEach(function(ee){Y(ee.webkitGetAsEntry())})},A=C,v=Object.assign||function(W){for(var L=1;L<arguments.length;L++){var I=arguments[L];for(var K in I)Object.prototype.hasOwnProperty.call(I,K)&&(W[K]=I[K])}return W},c=function(){function W(L,I){var K=[],Y=!0,ee=!1,oe=void 0;try{for(var xe=L[Symbol.iterator](),ve;!(Y=(ve=xe.next()).done)&&!(K.push(ve.value),I&&K.length===I);Y=!0);}catch(ge){ee=!0,oe=ge}finally{try{!Y&&xe.return&&xe.return()}finally{if(ee)throw oe}}return K}return function(L,I){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return W(L,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function W(L,I){for(var K=0;K<I.length;K++){var Y=I[K];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(L,Y.key,Y)}}return function(L,I,K){return I&&W(L.prototype,I),K&&W(L,K),L}}();function d(W,L,I){return L in W?Object.defineProperty(W,L,{value:I,enumerable:!0,configurable:!0,writable:!0}):W[L]=I,W}function l(W,L){var I={};for(var K in W){if(L.indexOf(K)>=0)continue;if(!Object.prototype.hasOwnProperty.call(W,K))continue;I[K]=W[K]}return I}function S(W,L){if(!(W instanceof L))throw new TypeError("Cannot call a class as a function")}function m(W,L){if(!W)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:W}function f(W,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);W.prototype=Object.create(L&&L.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(W,L):W.__proto__=L)}var w=function(L){return Object.keys(L).reduce(function(I,K){return(K.substr(0,5)==="data-"||K.substr(0,5)==="aria-"||K==="role")&&(I[K]=L[K]),I},{})},g=function(W){f(L,W);function L(){var I,K,Y,ee;S(this,L);for(var oe=arguments.length,xe=Array(oe),ve=0;ve<oe;ve++)xe[ve]=arguments[ve];return ee=(K=(Y=m(this,(I=L.__proto__||Object.getPrototypeOf(L)).call.apply(I,[this].concat(xe))),Y),Y.state={uid:D()},Y.reqs={},Y.onChange=function(ge){var me=ge.target.files;Y.uploadFiles(me),Y.reset()},Y.onClick=function(ge){var me=Y.fileInput;if(!me)return;var ce=Y.props,ie=ce.children,pe=ce.onClick;ie&&ie.type==="button"&&(me.parentNode.focus(),me.parentNode.querySelector("button").blur()),me.click(),pe&&pe(ge)},Y.onKeyDown=function(ge){ge.key==="Enter"&&Y.onClick()},Y.onFileDrop=function(ge){var me=Y.props.multiple;if(ge.preventDefault(),ge.type==="dragover")return;if(Y.props.directory)A(Array.prototype.slice.call(ge.dataTransfer.items),Y.uploadFiles,function(ie){return b(ie,Y.props.accept)});else{var ce=Array.prototype.slice.call(ge.dataTransfer.files).filter(function(ie){return b(ie,Y.props.accept)});me===!1&&(ce=ce.slice(0,1)),Y.uploadFiles(ce)}},Y.uploadFiles=function(ge){var me=Array.prototype.slice.call(ge);me.map(function(ce){return ce.uid=D(),ce}).forEach(function(ce){Y.upload(ce,me)})},Y.saveFileInput=function(ge){Y.fileInput=ge},K),m(Y,ee)}return s(L,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(K,Y){var ee=this,oe=this.props;if(!oe.beforeUpload)return setTimeout(function(){return ee.post(K)},0);var xe=oe.beforeUpload(K,Y);xe&&xe.then?xe.then(function(ve){var ge=Object.prototype.toString.call(ve);return ge==="[object File]"||ge==="[object Blob]"?ee.post(ve):ee.post(K)}).catch(function(ve){console.log(ve)}):xe!==!1&&setTimeout(function(){return ee.post(K)},0);return}},{key:"post",value:function(K){var Y=this;if(!this._isMounted)return;var ee=this.props,oe=ee.onStart,xe=ee.onProgress,ve=ee.transformFile,ge=ve===void 0?function(me){return me}:ve;new Promise(function(me){var ce=ee.action;return typeof ce=="function"&&(ce=ce(K)),me(ce)}).then(function(me){var ce=K.uid,ie=ee.customRequest||F,pe=Promise.resolve(ge(K)).then(function(J){var ne=ee.data;return typeof ne=="function"&&(ne=ne(J)),Promise.all([J,ne])}).catch(function(J){console.error(J)});pe.then(function(J){var ne=c(J,2),$=ne[0],be=ne[1],Te={action:me,filename:ee.name,data:be,file:$,headers:ee.headers,withCredentials:ee.withCredentials,method:ee.method||"post",onProgress:xe?function(ye){xe(ye,K)}:null,onSuccess:function(Se,Pe){delete Y.reqs[ce],ee.onSuccess(Se,K,Pe)},onError:function(Se,Pe){delete Y.reqs[ce],ee.onError(Se,Pe,K)}};oe(K),Y.reqs[ce]=ie(Te)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(K){var Y=this.reqs;if(K){var ee=K;K&&K.uid&&(ee=K.uid),Y[ee]&&Y[ee].abort&&Y[ee].abort(),delete Y[ee]}else Object.keys(Y).forEach(function(oe){Y[oe]&&Y[oe].abort&&Y[oe].abort(),delete Y[oe]})}},{key:"render",value:function(){var K,Y=this.props,ee=Y.component,oe=Y.prefixCls,xe=Y.className,ve=Y.disabled,ge=Y.id,me=Y.style,ce=Y.multiple,ie=Y.accept,pe=Y.children,J=Y.directory,ne=Y.openFileDialogOnClick,$=Y.onMouseEnter,be=Y.onMouseLeave,Te=l(Y,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ye=G()((K={},d(K,oe,!0),d(K,oe+"-disabled",ve),d(K,xe,xe),K)),Se=ve?{}:{onClick:ne?this.onClick:function(){},onKeyDown:ne?this.onKeyDown:function(){},onMouseEnter:$,onMouseLeave:be,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return V.a.createElement(ee,v({},Se,{className:ye,role:"button",style:me}),V.a.createElement("input",v({},w(Te),{id:ge,type:"file",ref:this.saveFileInput,onClick:function(Ie){return Ie.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ie,directory:J?"directory":null,webkitdirectory:J?"webkitdirectory":null,multiple:ce,onChange:this.onChange})),pe)}}]),L}(re.Component),h=g,a=Object.assign||function(W){for(var L=1;L<arguments.length;L++){var I=arguments[L];for(var K in I)Object.prototype.hasOwnProperty.call(I,K)&&(W[K]=I[K])}return W},u=function(){function W(L,I){for(var K=0;K<I.length;K++){var Y=I[K];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(L,Y.key,Y)}}return function(L,I,K){return I&&W(L.prototype,I),K&&W(L,K),L}}();function o(W,L){if(!(W instanceof L))throw new TypeError("Cannot call a class as a function")}function y(W,L){if(!W)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:W}function p(W,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);W.prototype=Object.create(L&&L.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(W,L):W.__proto__=L)}function x(){}var M=function(W){p(L,W);function L(){var I,K,Y,ee;o(this,L);for(var oe=arguments.length,xe=Array(oe),ve=0;ve<oe;ve++)xe[ve]=arguments[ve];return ee=(K=(Y=y(this,(I=L.__proto__||Object.getPrototypeOf(L)).call.apply(I,[this].concat(xe))),Y),Y.saveUploader=function(ge){Y.uploader=ge},K),y(Y,ee)}return u(L,[{key:"abort",value:function(K){this.uploader.abort(K)}},{key:"render",value:function(){return V.a.createElement(h,a({},this.props,{ref:this.saveUploader}))}}]),L}(re.Component);M.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:x,onError:x,onSuccess:x,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var N=M,j=Le.a=N},HmJG:function(Fe,Le,z){},HpTS:function(Fe,Le,z){Fe.exports=z.p+"static/small_program.f74069ec.png"},JWDV:function(Fe,Le,z){Fe.exports=z.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJL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zfP9ngPuc6SU3AU7mo0bgCYrXg/Hi2dETrHyXVa+HS2l5Ft21+6usMBuhMtidE/UECdlDYSggk6oV1psa893Qb3rlCW54ZepouXg37l3d0aAfzL/cNSYZcT0LvEYnuqyvnIrIChHo/dbZYjDbPxslSFLAfGUEIIcZ3gppTpvd6zLqweOVZuI0TUVDRgSOzjVy5yWFKSmTNn6vv2LxlMx7jdEMtiZcbR6h/kdmh7nkIlctlUCiLnQNL7Xs7W5g6mrq+sTExNDg6gM9eE5xFEM4HhLL4pJKYdwvg5msCsgg4AwFceueyptKZ/XNO3pkIdqkPaXVdAGjfwkt1FTzeXveCAN7QYNp/gMDEzxYFhaLAaneaH8xTY5hrvasu1/5ebmzuvcuXOTn8KRUpLZ5sQpWVD+EgvfAKEcBWQ1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(Fe,Le,z){Fe.exports=z.p+"static/qrcode.2267e4d5.png"},LdHM:function(Fe,Le,z){"use strict";z.d(Le,"b",function(){return l}),z.d(Le,"a",function(){return m});var re=z("1OyB"),V=z("vuIU"),R=z("Ji7U"),G=z("LK+K"),k=z("cDcd"),O=z("rePB"),F=z("Ff2n"),U=z("ODXe"),P=z("4IlW"),D=z("bX4T"),E=z("YrtM"),b=z("TSYQ"),_=z.n(b),C=z("+nKL"),A=z("8OUc"),v=function(K,Y){var ee=K.prefixCls,oe=K.id,xe=K.flattenOptions,ve=K.childrenAsData,ge=K.values,me=K.searchValue,ce=K.multiple,ie=K.defaultActiveFirstOption,pe=K.height,J=K.itemHeight,ne=K.notFoundContent,$=K.open,be=K.menuItemSelectedIcon,Te=K.virtual,ye=K.onSelect,Se=K.onToggleOpen,Pe=K.onActiveValue,Ie=K.onScroll,Ue=K.onMouseEnter,Re="".concat(ee,"-item"),Oe=Object(E.a)(function(){return xe},[$,xe],function(je,he){return he[0]&&je[1]!==he[1]}),Ve=k.useRef(null),qe=function(he){he.preventDefault()},He=function(he){Ve.current&&Ve.current.scrollTo({index:he})},ze=function(he){for(var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,de=Oe.length,Z=0;Z<de;Z+=1){var q=(he+Z*ue+de)%de,te=Oe[q],se=te.group,fe=te.data;if(!se&&!fe.disabled)return q}return-1},nt=k.useState(function(){return ze(0)}),Je=Object(U.a)(nt,2),$e=Je[0],we=Je[1],rt=function(he){we(he);var ue=Oe[he];if(!ue){Pe(null,-1);return}Pe(ue.data.value,he)};k.useEffect(function(){rt(ie!==!1?ze(0):-1)},[Oe.length,me]),k.useEffect(function(){var je=setTimeout(function(){if(!ce&&$&&ge.size===1){var he=Array.from(ge)[0],ue=Oe.findIndex(function(de){var Z=de.data;return Z.value===he});rt(ue),He(ue)}});return function(){return clearTimeout(je)}},[$]);var Ze=function(he){he!==void 0&&ye(he,{selected:!ge.has(he)}),ce||Se(!1)};if(k.useImperativeHandle(Y,function(){return{onKeyDown:function(he){var ue=he.which;switch(ue){case P.a.UP:case P.a.DOWN:{var de=0;if(ue===P.a.UP?de=-1:ue===P.a.DOWN&&(de=1),de!==0){var Z=ze($e+de,de);He(Z),rt(Z)}break}case P.a.ENTER:{var q=Oe[$e];q&&!q.data.disabled?Ze(q.data.value):Ze(void 0),$&&he.preventDefault();break}case P.a.ESC:Se(!1)}},onKeyUp:function(){},scrollTo:function(he){He(he)}}}),Oe.length===0)return k.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),className:"".concat(Re,"-empty"),onMouseDown:qe},ne);function Me(je){var he=Oe[je];if(!he)return null;var ue=he.data||{},de=ue.value,Z=ue.label,q=ue.children,te=Object(D.a)(ue,!0),se=ve?q:Z;return he?k.createElement("div",Object.assign({"aria-label":typeof se=="string"?se:null},te,{key:je,role:"option",id:"".concat(oe,"_list_").concat(je),"aria-selected":ge.has(de)}),de):null}return k.createElement(k.Fragment,null,k.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Me($e-1),Me($e),Me($e+1)),k.createElement(C.a,{itemKey:"key",ref:Ve,data:Oe,height:pe,itemHeight:J,fullHeight:!1,onMouseDown:qe,onScroll:Ie,virtual:Te,onMouseEnter:Ue},function(je,he){var ue,de=je.group,Z=je.groupOption,q=je.data,te=q.label,se=q.key;if(de)return k.createElement("div",{className:_()(Re,"".concat(Re,"-group"))},te!==void 0?te:se);var fe=q.disabled,_e=q.value,De=q.title,We=q.children,Xe=q.style,Ce=q.className,vt=Object(F.a)(q,["disabled","value","title","children","style","className"]),ft=ge.has(_e),ke="".concat(Re,"-option"),yt=_()(Re,ke,Ce,(ue={},Object(O.a)(ue,"".concat(ke,"-grouped"),Z),Object(O.a)(ue,"".concat(ke,"-active"),$e===he&&!fe),Object(O.a)(ue,"".concat(ke,"-disabled"),fe),Object(O.a)(ue,"".concat(ke,"-selected"),ft),ue)),Et=ve?We:te,tr=!be||typeof be=="function"||ft;return k.createElement("div",Object.assign({},vt,{"aria-selected":ft,className:yt,title:De,onMouseMove:function(){if($e===he||fe)return;rt(he)},onClick:function(){fe||Ze(_e)},style:Xe}),k.createElement("div",{className:"".concat(ke,"-content")},Et||_e),k.isValidElement(be)||ft,tr&&k.createElement(A.a,{className:"".concat(Re,"-option-state"),customizeIcon:be,customizeIconProps:{isSelected:ft}},ft?"\u2713":null))}))},c=k.forwardRef(v);c.displayName="OptionList";var s=c,d=function(){return null};d.isSelectOption=!0;var l=d,S=function(){return null};S.isSelectOptGroup=!0;var m=S,f=z("VTBJ"),w=z("Zm9Q");function g(I){var K=I.key,Y=I.props,ee=Y.children,oe=Y.value,xe=Object(F.a)(Y,["children","value"]);return Object(f.a)({key:K,value:oe!==void 0?oe:K,children:ee},xe)}function h(I){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(I).map(function(Y,ee){if(!k.isValidElement(Y)||!Y.type)return null;var oe=Y.type.isSelectOptGroup,xe=Y.key,ve=Y.props,ge=ve.children,me=Object(F.a)(ve,["children"]);return K||!oe?g(Y):Object(f.a)(Object(f.a)({key:"__RC_SELECT_GRP__".concat(xe===null?ee:xe,"__"),label:xe},me),{},{options:h(ge)})}).filter(function(Y){return Y})}var a=z("2Qr1"),u=z("qNPg"),o=z("U8pU"),y=z("Kwbf"),p=z("WKfj");function x(I){var K=I.mode,Y=I.options,ee=I.children,oe=I.backfill,xe=I.allowClear,ve=I.placeholder,ge=I.getInputElement,me=I.showSearch,ce=I.onSearch,ie=I.defaultOpen,pe=I.autoFocus,J=I.labelInValue,ne=I.value,$=I.inputValue,be=I.optionLabelProp,Te=K==="multiple"||K==="tags",ye=me!==void 0?me:Te||K==="combobox",Se=Y||h(ee);if(Object(y.a)(K!=="tags"||Se.every(function(Re){return!Re.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Pe=Se.some(function(Re){return Re.options?Re.options.some(function(Oe){return typeof("value"in Oe?Oe.value:Oe.key)=="number"}):typeof("value"in Re?Re.value:Re.key)=="number"});Object(y.a)(!Pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(K!=="combobox"||!be,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(K==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(y.a)(K==="combobox"||!ge,"`getInputElement` only work with `combobox` mode."),Object(y.b)(K!=="combobox"||!ge||!xe||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ce&&!ye&&K!=="combobox"&&K!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!ie||pe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ne!=null){var Ie=Object(p.d)(ne);Object(y.a)(!J||Ie.every(function(Re){return Object(o.a)(Re)==="object"&&("key"in Re||"value"in Re)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!Te||Array.isArray(ne),"`value` should be array when `mode` is `multiple` or `tags`")}if(ee){var Ue=null;Object(w.a)(ee).some(function(Re){if(!k.isValidElement(Re)||!Re.type)return!1;var Oe=Re.type;if(Oe.isSelectOption)return!1;if(Oe.isSelectOptGroup){var Ve=Object(w.a)(Re.props.children).every(function(qe){return!k.isValidElement(qe)||!Re.type||qe.type.isSelectOption?!0:(Ue=qe.type,!1)});return!Ve}return Ue=Oe,!0}),Ue&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ue.displayName||Ue.name||Ue,"`.")),Object(y.a)($===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=x,N=Object(u.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:h,flattenOptions:a.d,getLabeledValue:a.e,filterOptions:a.b,isValueDisabled:a.g,findValueOption:a.c,warningProps:M,fillOptionsWithMissingValue:a.a}),j=function(I){Object(R.a)(Y,I);var K=Object(G.a)(Y);function Y(){var ee;return Object(re.a)(this,Y),ee=K.apply(this,arguments),ee.selectRef=k.createRef(),ee.focus=function(){ee.selectRef.current.focus()},ee.blur=function(){ee.selectRef.current.blur()},ee}return Object(V.a)(Y,[{key:"render",value:function(){return k.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),Y}(k.Component);j.Option=l,j.OptGroup=m;var W=j,L=Le.c=W},M8RZ:function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return P});var re=z("fWQN"),V=z("mtLc"),R=z("yKVA"),G=z("879j"),k=z("cDcd"),O=z.n(k),F=z("faye"),U=z.n(F),P=function(D){Object(R.a)(b,D);var E=Object(G.a)(b);function b(_){var C;Object(re.a)(this,b),C=E.call(this,_);var A=window.document;return C.node=A.createElement("div"),A.body.appendChild(C.node),C}return Object(V.a)(b,[{key:"render",value:function(){var C=this.props.children;return Object(F.createPortal)(C,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),b}(O.a.Component)},Nmxd:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0FYveYoTj7xdiL2ggqKsvMnCyYnJcEBPw0nA4/kUuNM9AINX9MMnMIEDzXeSpIISvs/A1pJu2/TgzSZ4BRVf7ALxQQSVeqPuNcLy5qIHJcb7HS4ZKYxncNnOemH4DyqmehaiW58D8UKVFeOIn+gljYrmxsu2XWa2Eomt7AN7uidwd+CKBPy8EZdA7hSlprxGO7Zg2EPxSW8q35WDZehv7Ri4KEuuGQtu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NudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},Ohmc:function(Fe,Le,z){Fe.exports=z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Fe,Le,z){"use strict";var re=z("2qtc"),V=z("kLXV"),R=z("rAM+"),G=z("miYZ"),k=z("tsqr"),O=z("9og8"),F=z("tJVT"),U=z("jrin"),P=z("WmNS"),D=z.n(P),E=z("cDcd"),b=z.n(E),_=z("VrN/"),C=z.n(_),A=z("bdgK"),v=z("p77/"),c=z("Bd2K"),s=z("ELLl"),d=z("19Vz"),l=z("lZu9"),S=z("+NIl"),m=z("kSUc"),f=z("9Bee"),w=function(fe){var _e=fe.value,De=_e===void 0?"":_e,We=fe.className,Xe=fe.showTextOnly,Ce=fe.showLines,vt=fe.style,ft=vt===void 0?{}:vt,ke=Object(E.useMemo)(function(){return""},[De]);return b.a.createElement(b.a.Fragment,null,b.a.createElement("div",{dangerouslySetInnerHTML:{__html:ke}}))},g=z("0Owb"),h=z("dejd"),a=z("C+DQ"),u=z("1vsH"),o=z("m3rI"),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 p(fe){var _e=fe.onActionCallback,De=fe.title,We=fe.icon,Xe=fe.actionName,Ce=fe.className,vt=Ce===void 0?"":Ce,ft=fe.children;function ke(){_e(Xe)}return b.a.createElement("a",{title:De,className:vt,onClick:ke},b.a.createElement("i",{className:"md-iconfont ".concat(We)}),ft)}var x=function(fe){var _e=fe.watch,De=fe.showNullButton,We=fe.onActionCallback,Xe=fe.fullScreen,Ce=fe.insertTemp,vt=fe.hidetoolBar,ft=fe.uuid,ke=fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.G)("_educoder_session"),"&key=").concat(ft,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var yt=[].concat(y,[{title:"".concat(_e?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(_e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return b.a.createElement("ul",{className:"markdown-toolbar-container"},!vt&&yt.map(function(Et,tr){return b.a.createElement("li",{key:tr},Et.actionName?b.a.createElement(p,Object(g.a)({},Et,{onActionCallback:We})):b.a.createElement("span",{className:"v-line"}))}),De?b.a.createElement("li",null,b.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:We},b.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ce&&b.a.createElement("li",null,b.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ce),onActionCallback:We},b.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),b.a.createElement("li",{className:"btn-full-screen"},b.a.createElement(p,{icon:"".concat(Xe?"icon-shrink":"icon-enlarge"),title:Xe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:We})))},M=z("M8RZ"),N=z("+L6B"),j=z("2/Rp"),W=z("y8nQ"),L=z("Vl3Y"),I=z("5NDa"),K=z("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ee=function(fe){var _e=fe.callback,De=fe.onCancel;function We(Xe){_e(Xe)}return b.a.createElement(L.a,Object(g.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:We}),b.a.createElement(L.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},b.a.createElement(K.a,null)),b.a.createElement(L.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},b.a.createElement(K.a,null)),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(j.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},oe=z("7ahc"),xe=z("HmJG"),ve=z("BjJ7"),ge=L.a.useForm,me={width:280,marginRight:10},ce={labelCol:{span:5},wrapperCol:{span:19}},ie=function(fe){var _e=fe.callback,De=fe.onCancel,We=ge(),Xe=Object(F.a)(We,1),Ce=Xe[0];function vt(yt){_e(yt)}function ft(yt,Et){if(yt.status===-1){k.b.error(yt.message);return}Ce.setFieldsValue({src:"/api/attachments/".concat(yt.id),type:Et.type})}function ke(yt){var Et=yt.target.files[0];J(Et,ft)}return b.a.createElement(L.a,Object(g.a)({form:Ce},ce,{className:"upload-image-panel",onFinish:vt}),b.a.createElement(L.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},b.a.createElement("div",{className:"flex-container"},b.a.createElement(L.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},b.a.createElement(K.a,{style:me})),b.a.createElement(pe,{onFileChange:ke}))),b.a.createElement(L.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},b.a.createElement(K.a,{style:{width:264}})),b.a.createElement(L.a.Item,{style:{textAlign:"right"}},b.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(j.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function pe(fe){var _e=fe.onFileChange;return b.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",b.a.createElement("input",{type:"file",onChange:_e}))}function J(fe,_e){if(!fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var De=new FormData;De.append("editormd-image-file",fe),De.append("file_param_name","editormd-image-file"),De.append("byxhr","true");var We=new window.XMLHttpRequest;We.withCredentials=!0,We.addEventListener("load",function(Xe){_e(JSON.parse(Xe.target.responseText),fe)},!1),We.addEventListener("error",function(Xe){console.error(Xe)},!1),We.open("POST","".concat(ve.a,"/api/attachments.json")),We.send(De)}var ne=z("giR+"),$=z("fyUT"),be=z("7Kak"),Te=z("9yH6"),ye=Te.a.Group,Se={margin:"0 8px"},Pe=function(fe){var _e=fe.callback,De=fe.onCancel;function We(Xe){_e(Xe)}return b.a.createElement(L.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:We},b.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},b.a.createElement("span",{style:Se},"\u5355\u5143\u683C\u6570\uFF1A"),b.a.createElement("span",{style:Se},"\u884C\u6570"),b.a.createElement(L.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},b.a.createElement($.a,null)),b.a.createElement("span",{style:Se},"\u5217\u6570"),b.a.createElement(L.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},b.a.createElement($.a,null))),b.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},b.a.createElement("span",{style:Se},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),b.a.createElement(L.a.Item,{name:"align"},b.a.createElement(ye,null,b.a.createElement(Te.a,{value:"default"},b.a.createElement("i",{className:"fa fa-align-justify"})),b.a.createElement(Te.a,{value:"left"},b.a.createElement("i",{className:"fa fa-align-left"})),b.a.createElement(Te.a,{value:"center"},b.a.createElement("i",{className:"fa fa-align-center"})),b.a.createElement(Te.a,{value:"right"},b.a.createElement("i",{className:"fa fa-align-right"}))))),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(j.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},Ie=z("ErOA"),Ue=z("7Cbv"),Re="link",Oe="upload-image",Ve="code-block",qe="add-table",He="------------",ze={default:He,left:":".concat(He),center:":".concat(He,":"),right:"".concat(He,":")},nt=z("9VGf"),Je,$e;function we(){}var rt=0,Ze=1e4,Me="\u2581",je=`
|
|
**\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 he(fe){return/^\d+$/.test(fe)?"".concat(fe,"px"):fe}var ue=navigator.platform.toUpperCase().indexOf("MAC")>=0,de=ue?"Cmd":"Ctrl",Z=["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"],q=(Je={},Object(U.a)(Je,de+"-B","bold"),Object(U.a)(Je,de+"-I","italic"),Je),te=($e={},Object(U.a)($e,Re,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)($e,Ve,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)($e,Oe,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)($e,qe,"\u6DFB\u52A0\u8868\u683C"),$e),se=Le.a=function(fe){var _e=fe.defaultValue,De=_e===void 0?"":_e,We=fe.onChange,Xe=fe.width,Ce=Xe===void 0?"100%":Xe,vt=fe.height,ft=vt===void 0?400:vt,ke=fe.miniToolbar,yt=ke===void 0?!1:ke,Et=fe.isFocus,tr=Et===void 0?!1:Et,Yt=fe.watch,Ct=fe.insertTemp,Dr=fe.mode,Kr=Dr===void 0?"markdown":Dr,yr=fe.id,Rr=yr===void 0?"markdown-editor-id":yr,fr=fe.showResizeBar,Xr=fr===void 0?!1:fr,Fr=fe.noStorage,hn=Fr===void 0?!1:Fr,mn=fe.showNullButton,Kt=mn===void 0?!1:mn,ot=fe.hidetoolBar,jr=ot===void 0?!1:ot,Xt=fe.fullScreen,ur=Xt===void 0?!1:Xt,Dt=fe.onBlur,Lr=fe.onCMBeforeChange,Ht=fe.onFullScreen,nn=fe.className,Ge=nn===void 0?"":nn,mt=fe.disablePaste,Jr=mt===void 0?!1:mt,pn=fe.placeholder,an=pn===void 0?"":pn,on=fe.values,Zr=on===void 0?"":on,pt=Object(E.useState)(null),Ln=Object(F.a)(pt,2),Qe=Ln[0],gn=Ln[1],_r=Object(E.useState)(De),vn=Object(F.a)(_r,2),Or=vn[0],Er=vn[1],yn=Object(E.useState)(Yt),Rt=Object(F.a)(yn,2),Zt=Rt[0],_n=Rt[1],En=Object(E.useState)(ur),On=Object(F.a)(En,2),Ir=On[0],Gn=On[1],In=Object(E.useState)(""),Be=Object(F.a)(In,2),ct=Be[0],Lt=Be[1],At=Object(E.useState)(0),jt=Object(F.a)(At,2),Ot=jt[0],Gt=jt[1],Tt=Object(E.useState)(ft),ut=Object(F.a)(Tt,2),Pt=ut[0],Nt=ut[1],kt=Object(E.useState)(!1),Wt=Object(F.a)(kt,2),qt=Wt[0],rr=Wt[1],Hr=Object(E.useRef)(Object(Ue.a)()),Gr=Object(E.useRef)(!1),qr=Object(E.useRef)(),kr=Object(E.useRef)(),sn=Object(E.useRef)(),ln=Object(E.useRef)(),zn=Object(E.useRef)(),Bi=function(){var st=Object(O.a)(D.a.mark(function gt(){var dt,xt;return D.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,Object(Ie.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Hr.current}});case 2:xt=Bt.sent,xt!=null&&(dt=xt.attachments)!==null&&dt!==void 0&&dt.length&&(console.log("cm:",Qe,kr),xt.attachments.map(function(wt){wt.content_type.indexOf("image")>-1?Qe.replaceSelection(".concat(wt.content_type,")")):wt.content_type.indexOf("video")>-1?Qe.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):wt.content_type.indexOf("pdf")>-1?Qe.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(wt.id,"?type=").concat(wt.content_type,'&disposition=inline" target="_blank">').concat(wt.name,"</a>")):Qe.replaceSelection("[".concat(wt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(wt.id,"?type=").concat(wt.content_type,")"))}));case 4:case"end":return Bt.stop()}},gt)}));return function(){return st.apply(this,arguments)}}();Object(E.useEffect)(function(){Er(Zr),Qe==null||Qe.setValue(Zr)},[Zr]),Object(E.useEffect)(function(){Ht==null||Ht(Ir)},[Ir]),Object(E.useEffect)(function(){if(kr.current){var st=C.a.fromTextArea(kr.current,{mode:Kr,lineNumbers:!yt,lineWrapping:!0,value:De,autoCloseTags:!0,autoCloseBrackets:!0});tr&&st.focus();function gt(dt,xt){if(Jr){xt.preventDefault();return}var _t=xt.clipboardData;if(_t){var Bt=_t.types.toString(),wt=_t.items;if(Bt==="Files"||_t.types.indexOf("Files")>-1){if(xt.preventDefault(),Kr=="stex")return;try{var nr,br=wt[1];((nr=wt[0])===null||nr===void 0?void 0:nr.kind)==="file"&&(br=wt[0]);var St=br.getAsFile(),un=St.name.split(".").pop();J(St,function(It){if(It.id){var xr,hr,Wr;(St==null||((xr=St.type)===null||xr===void 0)?void 0:xr.indexOf("image"))>-1?st.replaceSelection(".concat(It.content_type,")")):(St==null||((hr=St.type)===null||hr===void 0)?void 0:hr.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(St==null||((Wr=St.type)===null||Wr===void 0)?void 0:Wr.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):Z.includes(un)?st.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):st.replaceSelection("[".concat(St.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}else(It==null?void 0:It.status)===401&&(document.location.href="/user/login")})}catch(It){k.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return st.on("paste",gt),st.on("dragleave",function(dt,xt){sn.current.classList.remove("mouse-hover-md")}),st.on("dragover",function(dt,xt){sn.current.classList.add("mouse-hover-md")}),st.on("drop",function(dt,xt){sn.current.classList.add("mouse-hover-md");var _t;if(_t=xt.dataTransfer.files,_t.length>0){xt.preventDefault(),xt.stopPropagation();for(var Bt=function(br){var St=_t[br],un=St.name.split(".").pop();J(St,function(It){if(It.id){var xr,hr,Wr;(St==null||((xr=St.type)===null||xr===void 0)?void 0:xr.indexOf("image"))>-1?st.replaceSelection(".concat(It.content_type,")")):(St==null||((hr=St.type)===null||hr===void 0)?void 0:hr.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,'"></video>')):(St==null||((Wr=St.type)===null||Wr===void 0)?void 0:Wr.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):Z.includes(un)?st.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):st.replaceSelection("[".concat(St.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}else(It==null?void 0:It.status)===401&&(document.location.href="/user/login")})},wt=0;wt<_t.length;wt++)Bt(wt)}}),gn(st),function(){st.off("paste",gt)}}},[]);var Ur=Object(E.useCallback)(function(){if(sn.current)try{}catch(st){console.log(st,"---- to set md editor body height")}},[Pt,sn,Ir]);Object(E.useEffect)(function(){function st(){var dt=new A.default(function(xt){var _t=Object(R.a)(xt),Bt;try{for(_t.s();!(Bt=_t.n()).done;){var wt=Bt.value;(wt.target.offsetHeight>0||wt.target.offsetWidth>0)&&(Ur(),Qe.setSize("100%","100%"),Qe.refresh())}}catch(nr){_t.e(nr)}finally{_t.f()}});return dt.observe(kr.current.parentElement),dt}if(Qe){var gt=st();return function(){gt.unobserve(kr.current.parentElement)}}},[Qe,Ur]),Object(E.useEffect)(function(){if(Qe){for(var st=[],gt=function(){var wt=xt[dt];_t=Object(F.a)(wt,2);var nr=_t[0],br=_t[1],St=Object(U.a)({},nr,function(){Fi(br)});st.push(St),Qe.addKeyMap(St)},dt=0,xt=Object.entries(q);dt<xt.length;dt++){var _t;gt()}return qr.current=setInterval(function(){Gr.current&&Bi()},4e3),function(){clearInterval(qr.current);var Bt=Object(R.a)(st),wt;try{for(Bt.s();!(wt=Bt.n()).done;){var nr=wt.value;Qe.removeKeyMap(nr)}}catch(br){Bt.e(br)}finally{Bt.f()}}}},[Qe]),Object(E.useEffect)(function(){ur!==Ir&&Gn(ur)},[ur]),Object(nt.a)(function(){if(!hn&&Ot>0){var st=new Date().getTime(),gt=window.sessionStorage.getItem(Rr);st>=Ot+Ze&&(!gt||gt!==Or)&&(window.sessionStorage.setItem(Rr,Or),rr(!0))}},Ze),Object(E.useEffect)(function(){_n(Yt)},[Qe,Yt]),Object(E.useEffect)(function(){Qe&&(tr&&Qe.focus())},[Qe,tr]),Object(E.useEffect)(function(){if(Zt&&Qe){var st=Qe.getScrollerElement();function gt(dt){var xt=dt.target;if(zn.current){var _t=xt.scrollTop/xt.scrollHeight;zn.current.scrollTop=zn.current.scrollHeight*_t}}return st.addEventListener("scroll",gt),function(){st.removeEventListener("scroll",gt)}}},[Qe,Zt]),Object(E.useEffect)(function(){if(Qe&&Lr){function st(gt,dt){Lr(gt,dt)}return Qe.on("beforeChange",st),function(){Qe.off("beforeChange",st)}}},[Qe,Lr]),Object(E.useEffect)(function(){if(Qe&&Dt){function st(){Dt(Qe.getValue())}return Qe.on("blur",st),function(){Qe.off("blur",st)}}},[Qe,Dt]),Object(E.useEffect)(function(){if(Qe){function st(gt){var dt=gt.getValue();Er(dt),Gt(new Date().getTime()),gt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),We&&We(dt)}return Qe.on("change",st),function(){Qe.off("change",st)}}},[Qe,We]),Object(E.useEffect)(function(){Qe&&(De==null?(Qe.setValue(""),Er("")):De!==Qe.getValue()&&(Qe.setValue(De),Er(De),Qe.setCursor(Qe.lineCount(),0)))},[Qe,De]);var Fi=Object(E.useCallback)(function(st){var gt=Qe.getCursor(),dt=Qe.getSelection(),xt=dt.split(`
|
|
`);switch(st){case"bold":return Qe.replaceSelection("**"+dt+"**"),dt===""&&Qe.setCursor(gt.line,gt.ch+2),Qe.focus();case"italic":return Qe.replaceSelection("*"+dt+"*"),dt===""&&Qe.setCursor(gt.line,gt.ch+1),Qe.focus();case"code":return Qe.replaceSelection("`"+dt+"`"),dt===""&&Qe.setCursor(gt.line,gt.ch+1),Qe.focus();case"inline-latex":return Qe.replaceSelection("`$$"+dt+"$$`"),dt===""&&Qe.setCursor(gt.line,gt.ch+3),Qe.focus();case"latex":return Qe.replaceSelection("```latex\n"+dt+"\n```"),Qe.setCursor(gt.line+1,dt.length+1),Qe.focus();case"line-break":return Qe.replaceSelection(`<br/>
|
|
`),Qe.focus();case"list-ul":return dt===""?Qe.replaceSelection("- "+dt):Qe.replaceSelection(xt.map(function(_t){return _t===""?"":"- ".concat(_t)}).join(`
|
|
`)),Qe.focus();case"list-ol":return dt===""?Qe.replaceSelection("1. "+dt):Qe.replaceSelection(xt.map(function(_t,Bt){return _t===""?"":"".concat(Bt+1,". ").concat(_t)}).join(`
|
|
`)),Qe.focus();case"add-null-ch":return dt===""&&Qe.setCursor(gt.line,gt.ch+1),Qe.replaceSelection(Me),Qe.focus();case"inster-template-1":return dt===""&&Qe.setCursor(gt.line,gt.ch),Qe.replaceSelection(je),Qe.focus();case"eraser":return Qe.setValue(""),Qe.focus();case"trigger-watch":return _n(!Zt),Qe.focus();case"trigger-full-screen":return Gn(!Ir),Qe.focus();case Re:Lt(Re);return;case Ve:Lt(Ve);return;case Oe:Lt(Oe);return;case qe:Lt(qe);return;default:throw new Error}},[Qe,Zt,Ir]),Vn=Object(E.useCallback)(function(st){Lt("");switch(ct){case Re:var gt=st.title,dt=st.link;return Qe.replaceSelection("[".concat(gt,"](").concat(dt,")")),Qe.focus();case Ve:var xt=st.language,_t=st.content;return Qe.replaceSelection(["```"+xt,_t,"```"].join(`
|
|
`)),Qe.focus();case Oe:var Bt=st.src,wt=st.alt;return wt?Qe.replaceSelection(".concat(Bt,' "').concat(wt,'" )')):Qe.replaceSelection("")),Qe.focus();case qe:for(var nr=st.row,br=st.col,St=st.align,un=`
|
|
`,It=0;It<nr;It++){for(var xr=[],hr=[],Wr=0;Wr<br;Wr++)It===1&&hr.push(ze[St]),xr.push(" ");It===1&&(un+="| ".concat(hr.join(" | "),` |
|
|
`)),un+="| ".concat(xr.join(br===1?"":" | "),` |
|
|
`)}return Qe.replaceSelection(un+`
|
|
`),Qe.focus();default:throw new Error}},[Qe,ct]),di=Object(E.useMemo)(function(){switch(ct){case Re:return b.a.createElement(ee,{callback:Vn,onCancel:bn});case Ve:return b.a.createElement(oe.b,{callback:Vn,onCancel:bn});case Oe:return b.a.createElement(ie,{callback:Vn,onCancel:bn});case qe:return b.a.createElement(Pe,{callback:Vn,onCancel:bn});default:return null}},[ct]);function bn(){Lt("")}Object(E.useEffect)(function(){if(ln.current){var st=ln.current,gt=!1,dt=0;function xt(wt){gt=!0,dt=wt.pageY}function _t(){gt=!1}function Bt(wt){if(gt){var nr=wt.pageY-dt;nr<0&&(nr=0),nr>300&&(nr=300);var br=ft+nr+"px";Nt(br)}}return st.addEventListener("mousedown",xt),document.addEventListener("mousemove",Bt),document.addEventListener("mouseup",_t),function(){st.removeEventListener("mousedown",xt),document.removeEventListener("mousemove",Bt),document.removeEventListener("mouseup",_t)}}},[Qe,ln]),Object(E.useEffect)(function(){Nt(ft)},[ft]);var $r=he(Ce),ci=he(Pt),zr={width:$r,height:ci},fi=Object(E.useMemo)(function(){if(Ot){var st=new Date(Ot),gt=st.getHours(),dt=st.getMinutes(),xt=st.getSeconds();return gt=gt<10?"0"+gt:gt,dt=dt<10?"0"+dt:dt,xt=xt<10?"0"+xt:xt,"".concat(gt,":").concat(dt,":").concat(xt)}return 0},[Ot]);function ji(){window.sessionStorage.removeItem(Rr),rr(!1),Gt(0)}function Mn(){rr(!1),Gt(0),Qe.setValue(window.sessionStorage.getItem(Rr))}function ua(st,gt){var dt=Qe.getValue();dt=dt.replace(st,gt),Er(dt),Qe==null||Qe.setValue(dt)}return b.a.createElement(E.Fragment,null,b.a.createElement("div",{className:"markdown-editor-wrapper",ref:sn},b.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Zt?"on-preview":""," ").concat(yt?"mini":""," ").concat(Ir?"full-screen":""),style:zr},b.a.createElement(x,{insertTemp:Ct,watch:Zt,fullScreen:Ir,showNullButton:Kt,onActionCallback:Fi,hidetoolBar:jr,uuid:Hr.current,setOpenPhones:function(){Gr.current=!0}}),b.a.createElement("div",{className:"markdown-editor-body"},b.a.createElement("div",{className:"codemirror-container"},b.a.createElement("textarea",{ref:kr,placeholder:an})),Zt?b.a.createElement("div",{ref:zn,className:"preview-container"},Kr==="stex"&&b.a.createElement(w,{value:Or}),Kr!=="stex"&&b.a.createElement(f.a,{edit:!0,value:Or,replaces:ua})):null))),Xr?b.a.createElement("a",{ref:ln,className:"editor-resize"}):null,b.a.createElement(M.a,null,te[ct]?b.a.createElement(V.a,{centered:!0,title:te[ct],visible:!0,onCancel:bn,footer:null,className:"markdown-popup-form"},di):null))}},RMFE:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYax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A4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Fe,Le){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var z,re,V,R=!1,G,k;window.PR_SHOULD_USE_CONTINUATION=!0;var O,F;(function(){var U=window,P=["break,continue,do,else,for,if,return,while"],D=[P,"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=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],b=[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"],_=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],C=[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"],A="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",v=[E,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="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=[P,"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"],d=[P,"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=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[b,C,_,v,c,s,d,l],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,f="str",w="kwd",g="com",h="typ",a="lit",u="pun",o="pln",y="tag",p="dec",x="src",M="atn",N="atv",j="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function L(ye){for(var Se=0,Pe=!1,Ie=!1,Ue=0,Re=ye.length;Ue<Re;++Ue){var Oe=ye[Ue];if(Oe.ignoreCase)Ie=!0;else if(/[a-z]/i.test(Oe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Pe=!0,Ie=!1;break}}var Ve={b:8,t:9,n:10,v:11,f:12,r:13};function qe($e){var we=$e.charCodeAt(0);if(we!==92)return we;var rt=$e.charAt(1);return we=Ve[rt],we||("0"<=rt&&rt<="7"?parseInt($e.substring(1),8):rt==="u"||rt==="x"?parseInt($e.substring(2),16):$e.charCodeAt(1))}function He($e){if($e<32)return($e<16?"\\x0":"\\x")+$e.toString(16);var we=String.fromCharCode($e);return we==="\\"||we==="-"||we==="]"||we==="^"?"\\"+we:we}function ze($e){var we=$e.substring(1,$e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),rt=[],Ze=we[0]==="^",Me=["["];Ze&&Me.push("^");for(var je=Ze?1:0,he=we.length;je<he;++je){var ue=we[je];if(/\\[bdsw]/i.test(ue))Me.push(ue);else{var de=qe(ue),Z;je+2<he&&we[je+1]==="-"?(Z=qe(we[je+2]),je+=2):Z=de,rt.push([de,Z]),Z<65||de>122||(Z<65||de>90||rt.push([Math.max(65,de)|32,Math.min(Z,90)|32]),Z<97||de>122||rt.push([Math.max(97,de)&~32,Math.min(Z,122)&~32]))}}rt.sort(function(fe,_e){return fe[0]-_e[0]||_e[1]-fe[1]});for(var q=[],te=[],je=0;je<rt.length;++je){var se=rt[je];se[0]<=te[1]+1?te[1]=Math.max(te[1],se[1]):q.push(te=se)}for(var je=0;je<q.length;++je){var se=q[je];Me.push(He(se[0])),se[1]>se[0]&&(se[1]+1>se[0]&&Me.push("-"),Me.push(He(se[1])))}return Me.push("]"),Me.join("")}function nt($e){for(var we=$e.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")),rt=we.length,Ze=[],Me=0,je=0;Me<rt;++Me){var he=we[Me];if(he==="(")++je;else if(he.charAt(0)==="\\"){var ue=+he.substring(1);ue&&(ue<=je?Ze[ue]=-1:we[Me]=He(ue))}}for(var Me=1;Me<Ze.length;++Me)Ze[Me]===-1&&(Ze[Me]=++Se);for(var Me=0,je=0;Me<rt;++Me){var he=we[Me];if(he==="(")++je,Ze[je]||(we[Me]="(?:");else if(he.charAt(0)==="\\"){var ue=+he.substring(1);ue&&ue<=je&&(we[Me]="\\"+Ze[ue])}}for(var Me=0;Me<rt;++Me)we[Me]==="^"&&we[Me+1]!=="^"&&(we[Me]="");if($e.ignoreCase&&Pe)for(var Me=0;Me<rt;++Me){var he=we[Me],de=he.charAt(0);he.length>=2&&de==="["?we[Me]=ze(he):de!=="\\"&&(we[Me]=he.replace(/[a-zA-Z]/g,function(te){var se=te.charCodeAt(0);return"["+String.fromCharCode(se&~32,se|32)+"]"}))}return we.join("")}for(var Je=[],Ue=0,Re=ye.length;Ue<Re;++Ue){var Oe=ye[Ue];if(Oe.global||Oe.multiline)throw new Error(""+Oe);Je.push("(?:"+nt(Oe)+")")}return new RegExp(Je.join("|"),Ie?"gi":"g")}function I(ye,Se){var Pe=/(?:^|\s)nocode(?:\s|$)/,Ie=[],Ue=0,Re=[],Oe=0;function Ve(qe){var He=qe.nodeType;if(He==1){if(Pe.test(qe.className))return;for(var ze=qe.firstChild;ze;ze=ze.nextSibling)Ve(ze);var nt=qe.nodeName.toLowerCase();(nt==="br"||nt==="li")&&(Ie[Oe]=`
|
|
`,Re[Oe<<1]=Ue++,Re[Oe++<<1|1]=qe)}else if(He==3||He==4){var Je=qe.nodeValue;Je.length&&(Se?Je=Je.replace(/\r\n?/g,`
|
|
`):Je=Je.replace(/[ \t\r\n]+/g," "),Ie[Oe]=Je,Re[Oe<<1]=Ue,Ue+=Je.length,Re[Oe++<<1|1]=qe)}}return Ve(ye),{sourceCode:Ie.join("").replace(/\n$/,""),spans:Re}}function K(ye,Se,Pe,Ie,Ue){if(!Pe)return;var Re={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:Pe,spans:null,basePos:Se,decorations:null};Ie(Re),Ue.push.apply(Ue,Re.decorations)}var Y=/\S/;function ee(ye){for(var Se=void 0,Pe=ye.firstChild;Pe;Pe=Pe.nextSibling){var Ie=Pe.nodeType;Se=Ie===1?Se?ye:Pe:Ie===3&&Y.test(Pe.nodeValue)?ye:Se}return Se===ye?void 0:Se}function oe(ye,Se){var Pe={},Ie;(function(){for(var Oe=ye.concat(Se),Ve=[],qe={},He=0,ze=Oe.length;He<ze;++He){var nt=Oe[He],Je=nt[3];if(Je)for(var $e=Je.length;--$e>=0;)Pe[Je.charAt($e)]=nt;var we=nt[1],rt=""+we;qe.hasOwnProperty(rt)||(Ve.push(we),qe[rt]=null)}Ve.push(/[\0-\uffff]/),Ie=L(Ve)})();var Ue=Se.length,Re=function(Oe){for(var Ve=Oe.sourceCode,qe=Oe.basePos,He=Oe.sourceNode,ze=[qe,o],nt=0,Je=Ve.match(Ie)||[],$e={},we=0,rt=Je.length;we<rt;++we){var Ze=Je[we],Me=$e[Ze],je=void 0,he;if(typeof Me=="string")he=!1;else{var ue=Pe[Ze.charAt(0)];if(ue)je=Ze.match(ue[1]),Me=ue[0];else{for(var de=0;de<Ue;++de)if(ue=Se[de],je=Ze.match(ue[1]),je){Me=ue[0];break}je||(Me=o)}he=Me.length>=5&&Me.substring(0,5)==="lang-",he&&!(je&&typeof je[1]=="string")&&(he=!1,Me=x),he||($e[Ze]=Me)}var Z=nt;if(nt+=Ze.length,!he)ze.push(qe+Z,Me);else{var q=je[1],te=Ze.indexOf(q),se=te+q.length;je[2]&&(se=Ze.length-je[2].length,te=se-q.length);var fe=Me.substring(5);K(He,qe+Z,Ze.substring(0,te),Re,ze),K(He,qe+Z+te,q,pe(fe,q),ze),K(He,qe+Z+se,Ze.substring(se),Re,ze)}}Oe.decorations=ze};return Re}function xe(ye){var Se=[],Pe=[];ye.tripleQuotedStrings?Se.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Se.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Se.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Pe.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ie=ye.hashComments;Ie&&(ye.cStyleComments?(Ie>1?Se.push([g,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Se.push([g,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Pe.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Se.push([g,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Pe.push([g,/^\/\/[^\r\n]*/,null]),Pe.push([g,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ue=ye.regexLiterals;if(Ue){var Re=Ue>1?"":`
|
|
\r`,Oe=Re?".":"[\\S\\s]",Ve="/(?=[^/*"+Re+"])(?:[^/\\x5B\\x5C"+Re+"]|\\x5C"+Oe+"|\\x5B(?:[^\\x5C\\x5D"+Re+"]|\\x5C"+Oe+")*(?:\\x5D|$))+/";Pe.push(["lang-regex",RegExp("^"+W+"("+Ve+")")])}var qe=ye.types;qe&&Pe.push([h,qe]);var He=(""+ye.keywords).replace(/^ | $/g,"");He.length&&Pe.push([w,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),Se.push([o,/^\s+/,null,` \r
|
|
\xA0`]);var ze="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(ze+="(?!s*/)"),Pe.push([a,/^@[a-z_$][a-z_$@0-9]*/i,null],[h,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[a,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[u,new RegExp(ze),null]),oe(Se,Pe)}var ve=xe({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ge(ye,Se,Pe){for(var Ie=/(?:^|\s)nocode(?:\s|$)/,Ue=/\r\n?|\n/,Re=ye.ownerDocument,Oe=Re.createElement("li");ye.firstChild;)Oe.appendChild(ye.firstChild);var Ve=[Oe];function qe(we){var rt=we.nodeType;if(rt==1&&!Ie.test(we.className))if(we.nodeName==="br")He(we),we.parentNode&&we.parentNode.removeChild(we);else for(var Ze=we.firstChild;Ze;Ze=Ze.nextSibling)qe(Ze);else if((rt==3||rt==4)&&Pe){var Me=we.nodeValue,je=Me.match(Ue);if(je){var he=Me.substring(0,je.index);we.nodeValue=he;var ue=Me.substring(je.index+je[0].length);if(ue){var de=we.parentNode;de.insertBefore(Re.createTextNode(ue),we.nextSibling)}He(we),he||we.parentNode.removeChild(we)}}}function He(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function rt(je,he){var ue=he?je.cloneNode(!1):je,de=je.parentNode;if(de){var Z=rt(de,1),q=je.nextSibling;Z.appendChild(ue);for(var te=q;te;te=q)q=te.nextSibling,Z.appendChild(te)}return ue}for(var Ze=rt(we.nextSibling,0),Me;(Me=Ze.parentNode)&&Me.nodeType===1;)Ze=Me;Ve.push(Ze)}for(var ze=0;ze<Ve.length;++ze)qe(Ve[ze]);Se===(Se|0)&&Ve[0].setAttribute("value",Se);var nt=Re.createElement("ol");nt.className="linenums";for(var Je=Math.max(0,Se-1|0)||0,ze=0,$e=Ve.length;ze<$e;++ze)Oe=Ve[ze],Oe.className="L"+(ze+Je)%10,Oe.firstChild||Oe.appendChild(Re.createTextNode("\xA0")),nt.appendChild(Oe);ye.appendChild(nt)}function me(ye){var Se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Se=Se&&+Se[1]<=8;var Pe=/\n/g,Ie=ye.sourceCode,Ue=Ie.length,Re=0,Oe=ye.spans,Ve=Oe.length,qe=0,He=ye.decorations,ze=He.length,nt=0;He[ze]=Ue;var Je,$e;for($e=Je=0;$e<ze;)He[$e]!==He[$e+2]?(He[Je++]=He[$e++],He[Je++]=He[$e++]):$e+=2;for(ze=Je,$e=Je=0;$e<ze;){for(var we=He[$e],rt=He[$e+1],Ze=$e+2;Ze+2<=ze&&He[Ze+1]===rt;)Ze+=2;He[Je++]=we,He[Je++]=rt,$e=Ze}ze=He.length=Je;var Me=ye.sourceNode,je="";Me&&(je=Me.style.display,Me.style.display="none");try{for(var he=null;qe<Ve;){var ue=Oe[qe],de=Oe[qe+2]||Ue,Z=He[nt+2]||Ue,Ze=Math.min(de,Z),q=Oe[qe+1],te;if(q.nodeType!==1&&(te=Ie.substring(Re,Ze))){Se&&(te=te.replace(Pe,"\r")),q.nodeValue=te;var se=q.ownerDocument,fe=se.createElement("span");fe.className=He[nt+1];var _e=q.parentNode;_e.replaceChild(fe,q),fe.appendChild(q),Re<de&&(Oe[qe+1]=q=se.createTextNode(Ie.substring(Ze,de)),_e.insertBefore(q,fe.nextSibling))}Re=Ze,Re>=de&&(qe+=2),Re>=Z&&(nt+=2)}}finally{Me&&(Me.style.display=je)}}var ce={};function ie(ye,Se){for(var Pe=Se.length;--Pe>=0;){var Ie=Se[Pe];ce.hasOwnProperty(Ie)?U.console&&console.warn("cannot override language handler %s",Ie):ce[Ie]=ye}}function pe(ye,Se){return ye&&ce.hasOwnProperty(ye)||(ye=/^\s*</.test(Se)?"default-markup":"default-code"),ce[ye]}ie(ve,["default-code"]),ie(oe([],[[o,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[g,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ie(oe([[o,/^[\s]+/,null,` \r
|
|
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["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"]),ie(oe([],[[N,/^[\s\S]+/]]),["uq.val"]),ie(xe({keywords:b,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),ie(xe({keywords:"null,true,false"}),["json"]),ie(xe({keywords:C,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),ie(xe({keywords:_,cStyleComments:!0}),["java"]),ie(xe({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ie(xe({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ie(xe({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ie(xe({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ie(xe({keywords:v,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ie(xe({keywords:A,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ie(oe([],[[f,/^[\s\S]+/]]),["regex"]);function J(ye){var Se=ye.langExtension;try{var Pe=I(ye.sourceNode,ye.pre),Ie=Pe.sourceCode;ye.sourceCode=Ie,ye.spans=Pe.spans,ye.basePos=0,pe(Se,Ie)(ye),me(ye)}catch(Ue){U.console&&console.log(Ue&&Ue.stack||Ue)}}function ne(ye,Se,Pe){var Ie=Pe||!1,Ue=Se||null,Re=document.createElement("div");Re.innerHTML="<pre>"+ye+"</pre>",Re=Re.firstChild,Ie&&ge(Re,Ie,!0);var Oe={langExtension:Ue,numberLines:Ie,sourceNode:Re,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return J(Oe),Re.innerHTML}function $(ye,Se){var Pe=Se||document.body,Ie=Pe.ownerDocument||document;function Ue(ue){return Pe.getElementsByTagName(ue)}for(var Re=[Ue("pre"),Ue("code"),Ue("xmp")],Oe=[],Ve=0;Ve<Re.length;++Ve)for(var qe=0,He=Re[Ve].length;qe<He;++qe)Oe.push(Re[Ve][qe]);Re=null;var ze=Date;ze.now||(ze={now:function(){return+new Date}});var nt=0,Je=/\blang(?:uage)?-([\w.]+)(?!\S)/,$e=/\bprettyprint\b/,we=/\bprettyprinted\b/,rt=/pre|xmp/i,Ze=/^code$/i,Me=/^(?:pre|code|xmp)$/i,je={};function he(){for(var ue=U.PR_SHOULD_USE_CONTINUATION?ze.now()+250:Infinity;nt<Oe.length&&ze.now()<ue;nt++){for(var de=Oe[nt],Z=je,q=de;q=q.previousSibling;){var te=q.nodeType,se=(te===7||te===8)&&q.nodeValue;if(se?!/^\??prettify\b/.test(se):te!==3||/\S/.test(q.nodeValue))break;if(se){Z={},se.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Yt,Ct,Dr){Z[Ct]=Dr});break}}var fe=de.className;if((Z!==je||$e.test(fe))&&!we.test(fe)){for(var _e=!1,De=de.parentNode;De;De=De.parentNode){var We=De.tagName;if(Me.test(We)&&De.className&&$e.test(De.className)){_e=!0;break}}if(!_e){de.className+=" prettyprinted";var Xe=Z.lang;if(!Xe){Xe=fe.match(Je);var Ce;!Xe&&(Ce=ee(de))&&Ze.test(Ce.tagName)&&(Xe=Ce.className.match(Je)),Xe&&(Xe=Xe[1])}var vt;if(rt.test(de.tagName))vt=1;else{var ft=de.currentStyle,ke=Ie.defaultView,yt=ft?ft.whiteSpace:ke&&ke.getComputedStyle?ke.getComputedStyle(de,null).getPropertyValue("white-space"):0;vt=yt&&yt.substring(0,3)==="pre"}var Et=Z.linenums;(Et=Et==="true"||+Et)||(Et=fe.match(/\blinenums\b(?::(\d+))?/),Et=Et?Et[1]&&Et[1].length?+Et[1]:!0:!1),Et&&ge(de,Et,vt);var tr={langExtension:Xe,sourceNode:de,numberLines:Et,pre:vt,sourceCode:null,basePos:null,spans:null,decorations:null};J(tr)}}}nt<Oe.length?U.setTimeout(he,250):typeof ye=="function"&&ye()}he()}var be=U.PR={createSimpleLexer:oe,registerLangHandler:ie,sourceDecorator:xe,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:N,PR_COMMENT:g,PR_DECLARATION:p,PR_KEYWORD:w,PR_LITERAL:a,PR_NOCODE:j,PR_PLAIN:o,PR_PUNCTUATION:u,PR_SOURCE:x,PR_STRING:f,PR_TAG:y,PR_TYPE:h,prettyPrintOne:R?U.prettyPrintOne=ne:O=ne,prettyPrint:F=R?U.prettyPrint=$:F=$},Te=U.define;typeof Te=="function"&&Te.amd&&Te("google-code-prettify",[],function(){return be})})()},SMhR:function(Fe,Le){Fe.ex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Z22yA3GibpwDZtM0NIJ+sbTZAbgB5U9s8qW02QDZt861OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI2ffDkgT2qbJwF5UttsgLwJyJPa5gaQG0De0jY3gGza5gaQG22zAXKjbZ4EZAPkTUBuANm0zac6kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjR+ole1zZvaZgPkRtvcAPIkIJu22QDZtM3fCsiNttkAudE2TwKyaZtN22yAbNrmBpAbbbMBsgGyaZu3nEiSpHEiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaP9FHA3KjbTZAngRk0zafDMiTgPyptrkB5Eltc6Nt3gTkTW1zA8imbZ7UNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(Fe,Le,z){Fe.exports=z.p+"static/lockclose.365036e8.svg"},UZu5:function(Fe,Le,z){},"VrN/":function(Fe,Le,z){(function(re,V){Fe.exports=V()})(this,function(){"use strict";var re=navigator.userAgent,V=navigator.platform,R=/gecko\/\d/i.test(re),G=/MSIE \d/.test(re),k=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(re),O=/Edge\/(\d+)/.exec(re),F=G||k||O,U=F&&(G?document.documentMode||6:+(O||k)[1]),P=!O&&/WebKit\//.test(re),D=P&&/Qt\/\d+\.\d+/.test(re),E=!O&&/Chrome\//.test(re),b=/Opera\//.test(re),_=/Apple Computer/.test(navigator.vendor),C=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),A=/PhantomJS/.test(re),v=!O&&/AppleWebKit/.test(re)&&/Mobile\/\w+/.test(re),c=/Android/.test(re),s=v||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),d=v||/Mac/.test(V),l=/\bCrOS\b/.test(re),S=/win/i.test(V),m=b&&re.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(b=!1,P=!0);var f=d&&(D||b&&(m==null||m<12.11)),w=R||F&&U>=9;function g(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var h=function(e,t){var n=e.className,r=g(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 a(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function u(e,t){return a(e).appendChild(t)}function o(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 T=0;T<t.length;++T)i.appendChild(t[T]);return i}function y(e,t,n,r){var i=o(e,t,n,r);return i.setAttribute("role","presentation"),i}var p;document.createRange?p=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:p=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function x(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function M(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function N(e,t){var n=e.className;g(t).test(n)||(e.className+=(n?" ":"")+t)}function j(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!g(n[r]).test(t)&&(t+=" "+n[r]);return t}var W=function(e){e.select()};v?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:F&&(W=function(e){try{e.select()}catch(t){}});function L(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function K(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var T=r||0,B=i||0;;){var H=e.indexOf(" ",T);if(H<0||H>=t)return B+(t-T);B+=H-T,B+=n-B%n,T=H+1}}var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=L(this.onTimeout,this)};Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ee(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var oe=50,xe={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},ge={origin:"*mouse"},me={origin:"+move"};function ce(e,t,n){for(var r=0,i=0;;){var T=e.indexOf(" ",r);T==-1&&(T=e.length);var B=T-r;if(T==e.length||i+B>=t)return r+Math.min(B,t-i);if(i+=T-r,i+=n-i%n,r=T+1,i>=t)return r}}var ie=[""];function pe(e){for(;ie.length<=e;)ie.push(J(ie)+" ");return ie[e]}function J(e){return e[e.length-1]}function ne(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function $(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function be(){}function Te(e,t){var n;return Object.create?n=Object.create(e):(be.prototype=e,n=new be),t&&I(t,n),n}var ye=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Se(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function Pe(e,t){return t?t.source.indexOf("\\w")>-1&&Se(e)?!0:t.test(e):Se(e)}function Ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ue=/[\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 Re(e){return e.charCodeAt(0)>=768&&Ue.test(e)}function Oe(e,t,n){for(;(n<0?t>0:t<e.length)&&Re(e.charAt(t));)t+=n;return t}function Ve(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,T=r<0?Math.ceil(i):Math.floor(i);if(T==t)return e(T)?t:n;e(T)?n=T:t=T+r}}function qe(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,T=0;T<e.length;++T){var B=e[T];(B.from<n&&B.to>t||t==n&&B.to==t)&&(r(Math.max(B.from,t),Math.min(B.to,n),B.level==1?"rtl":"ltr",T),i=!0)}i||r(t,n,"ltr")}var He=null;function ze(e,t,n){var r;He=null;for(var i=0;i<e.length;++i){var T=e[i];if(T.from<t&&T.to>t)return i;T.to==t&&(T.from!=T.to&&n=="before"?r=i:He=i),T.from==t&&(T.from!=T.to&&n!="before"?r=i:He=i)}return r!=null?r:He}var nt=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]/,T=/[LRr]/,B=/[Lb1n]/,H=/[1n]/;function Q(X,ae,le){this.level=X,this.from=ae,this.to=le}return function(X,ae){var le=ae=="ltr"?"L":"R";if(X.length==0||ae=="ltr"&&!r.test(X))return!1;for(var Ae=X.length,Ee=[],Ne=0;Ne<Ae;++Ne)Ee.push(n(X.charCodeAt(Ne)));for(var Ke=0,Ye=le;Ke<Ae;++Ke){var et=Ee[Ke];et=="m"?Ee[Ke]=Ye:Ye=et}for(var it=0,tt=le;it<Ae;++it){var at=Ee[it];at=="1"&&tt=="r"?Ee[it]="n":T.test(at)&&(tt=at,at=="r"&&(Ee[it]="R"))}for(var ht=1,lt=Ee[0];ht<Ae-1;++ht){var bt=Ee[ht];bt=="+"&<=="1"&&Ee[ht+1]=="1"?Ee[ht]="1":bt==","&<==Ee[ht+1]&&(lt=="1"||lt=="n")&&(Ee[ht]=lt),lt=bt}for(var Ft=0;Ft<Ae;++Ft){var sr=Ee[Ft];if(sr==",")Ee[Ft]="N";else if(sr=="%"){var Vt=void 0;for(Vt=Ft+1;Vt<Ae&&Ee[Vt]=="%";++Vt);for(var Pr=Ft&&Ee[Ft-1]=="!"||Vt<Ae&&Ee[Vt]=="1"?"1":"N",Sr=Ft;Sr<Vt;++Sr)Ee[Sr]=Pr;Ft=Vt-1}}for(var $t=0,Cr=le;$t<Ae;++$t){var cr=Ee[$t];Cr=="L"&&cr=="1"?Ee[$t]="L":T.test(cr)&&(Cr=cr)}for(var ir=0;ir<Ae;++ir)if(i.test(Ee[ir])){var er=void 0;for(er=ir+1;er<Ae&&i.test(Ee[er]);++er);for(var Qt=(ir?Ee[ir-1]:le)=="L",wr=(er<Ae?Ee[er]:le)=="L",li=Qt==wr?Qt?"L":"R":le,Rn=ir;Rn<er;++Rn)Ee[Rn]=li;ir=er-1}for(var pr=[],rn,lr=0;lr<Ae;)if(B.test(Ee[lr])){var Va=lr;for(++lr;lr<Ae&&B.test(Ee[lr]);++lr);pr.push(new Q(0,Va,lr))}else{var fn=lr,Kn=pr.length,Hn=ae=="rtl"?1:0;for(++lr;lr<Ae&&Ee[lr]!="L";++lr);for(var vr=fn;vr<lr;)if(H.test(Ee[vr])){fn<vr&&(pr.splice(Kn,0,new Q(1,fn,vr)),Kn+=Hn);var ui=vr;for(++vr;vr<lr&&H.test(Ee[vr]);++vr);pr.splice(Kn,0,new Q(2,ui,vr)),Kn+=Hn,fn=vr}else++vr;fn<lr&&pr.splice(Kn,0,new Q(1,fn,lr))}return ae=="ltr"&&(pr[0].level==1&&(rn=X.match(/^\s+/))&&(pr[0].from=rn[0].length,pr.unshift(new Q(0,0,rn[0].length))),J(pr).level==1&&(rn=X.match(/\s+$/))&&(J(pr).to-=rn[0].length,pr.push(new Q(0,Ae-rn[0].length,Ae)))),ae=="rtl"?pr.reverse():pr}}();function Je(e,t){var n=e.order;return n==null&&(n=e.order=nt(e.text,t)),n}var $e=[],we=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||$e).concat(n)}};function rt(e,t){return e._handlers&&e._handlers[t]||$e}function Ze(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var T=ee(i,n);T>-1&&(r[t]=i.slice(0,T).concat(i.slice(T+1)))}}}function Me(e,t){var n=rt(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function je(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Me(e,n||t.type,e,t),te(t)||t.codemirrorIgnore}function he(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ee(n,t[r])==-1&&n.push(t[r])}function ue(e,t){return rt(e,t).length>0}function de(e){e.prototype.on=function(t,n){we(this,t,n)},e.prototype.off=function(t,n){Ze(this,t,n)}}function Z(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function q(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function te(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function se(e){Z(e),q(e)}function fe(e){return e.target||e.srcElement}function _e(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),d&&e.ctrlKey&&t==1&&(t=3),t}var De=function(){if(F&&U<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),We;function Xe(e){if(We==null){var t=o("span","\u200B");u(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(We=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&U<8))}var n=We?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Ce;function vt(e){if(Ce!=null)return Ce;var t=u(e,document.createTextNode("A\u062EA")),n=p(t,0,1).getBoundingClientRect(),r=p(t,1,2).getBoundingClientRect();return a(e),!n||n.left==n.right?!1:Ce=r.right-n.right<3}var ft=`
|
|
|
|
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 T=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),B=T.indexOf("\r");B!=-1?(n.push(T.slice(0,B)),t+=B+1):(n.push(T),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ke=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},yt=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Et=null;function tr(e){if(Et!=null)return Et;var t=u(e,o("span","x")),n=t.getBoundingClientRect(),r=p(t,0,1).getBoundingClientRect();return Et=Math.abs(n.left-r.left)>1}var Yt={},Ct={};function Dr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Yt[e]=t}function Kr(e,t){Ct[e]=t}function yr(e){if(typeof e=="string"&&Ct.hasOwnProperty(e))e=Ct[e];else if(e&&typeof e.name=="string"&&Ct.hasOwnProperty(e.name)){var t=Ct[e.name];typeof t=="string"&&(t={name:t}),e=Te(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Rr(e,t){t=yr(t);var n=Yt[t.name];if(!n)return Rr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var T in i){if(!i.hasOwnProperty(T))continue;r.hasOwnProperty(T)&&(r["_"+T]=r[T]),r[T]=i[T]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var B in t.modeProps)r[B]=t.modeProps[B];return r}var fr={};function Xr(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};I(t,n)}function Fr(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 hn(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 mn(e,t,n){return e.startState?e.startState(t,n):!0}var Kt=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};Kt.prototype.eol=function(){return this.pos>=this.string.length},Kt.prototype.sol=function(){return this.pos==this.lineStart},Kt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Kt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Kt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Kt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Kt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Kt.prototype.skipToEnd=function(){this.pos=this.string.length},Kt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Kt.prototype.backUp=function(e){this.pos-=e},Kt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=K(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},Kt.prototype.indentation=function(){return K(this.string,null,this.tabSize)-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},Kt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(B){return n?B.toLowerCase():B},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var T=this.string.slice(this.pos).match(e);return T&&T.index>0?null:(T&&t!==!1&&(this.pos+=T[0].length),T)}},Kt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Kt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Kt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Kt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ot(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],T=i.chunkSize();if(t<T){n=i;break}t-=T}return n.lines[t]}function jr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(T){var B=T.text;i==n.line&&(B=B.slice(0,n.ch)),i==t.line&&(B=B.slice(t.ch)),r.push(B),++i}),r}function Xt(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function ur(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Dt(e){if(e.parent==null)return null;for(var t=e.parent,n=ee(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function Lr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],T=i.height;if(t<T){e=i;continue e}t-=T,n+=i.chunkSize()}return n}while(!e.lines);for(var B=0;B<e.lines.length;++B){var H=e.lines[B],Q=H.height;if(t<Q)break;t-=Q}return n+B}function Ht(e,t){return t>=e.first&&t<e.first+e.size}function nn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ge(e,t,n){if(n===void 0&&(n=null),!(this instanceof Ge))return new Ge(e,t,n);this.line=e,this.ch=t,this.sticky=n}function mt(e,t){return e.line-t.line||e.ch-t.ch}function Jr(e,t){return e.sticky==t.sticky&&mt(e,t)==0}function pn(e){return Ge(e.line,e.ch)}function an(e,t){return mt(e,t)<0?t:e}function on(e,t){return mt(e,t)<0?e:t}function Zr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.line<e.first)return Ge(e.first,0);var n=e.first+e.size-1;return t.line>n?Ge(n,ot(e,n).text.length):Ln(t,ot(e,t.line).text.length)}function Ln(e,t){var n=e.ch;return n==null||n>t?Ge(e.line,t):n<0?Ge(e.line,0):e}function Qe(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=pt(e,t[r]);return n}var gn=function(e,t){this.state=e,this.lookAhead=t},_r=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};_r.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},_r.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}},_r.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_r.fromSaved=function(e,t,n){return t instanceof gn?new _r(e,Fr(e.mode,t.state),n,t.lookAhead):new _r(e,Fr(e.mode,t),n)},_r.prototype.save=function(e){var t=e!==!1?Fr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gn(t,this.maxLookAhead):t};function vn(e,t,n,r){var i=[e.state.modeGen],T={};Ir(e,t.text,e.doc.mode,n,function(X,ae){return i.push(X,ae)},T,r);for(var B=n.state,H=function(X){n.baseTokens=i;var ae=e.state.overlays[X],le=1,Ae=0;n.state=!0,Ir(e,t.text,ae.mode,n,function(Ee,Ne){for(var Ke=le;Ae<Ee;){var Ye=i[le];Ye>Ee&&i.splice(le,1,Ee,i[le+1],Ye),le+=2,Ae=Math.min(Ee,Ye)}if(!Ne)return;if(ae.opaque)i.splice(Ke,le-Ke,Ee,"overlay "+Ne),le=Ke+2;else for(;Ke<le;Ke+=2){var et=i[Ke+1];i[Ke+1]=(et?et+" ":"")+"overlay "+Ne}},T),n.state=B,n.baseTokens=null,n.baseTokenPos=1},Q=0;Q<e.state.overlays.length;++Q)H(Q);return{styles:i,classes:T.bgClass||T.textClass?T:null}}function Or(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Er(e,Dt(t)),i=t.text.length>e.options.maxHighlightLength&&Fr(e.doc.mode,r.state),T=vn(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=T.styles,T.classes?t.styleClasses=T.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 Er(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new _r(r,!0,t);var T=Gn(e,t,n),B=T>r.first&&ot(r,T-1).stateAfter,H=B?_r.fromSaved(r,B,T):new _r(r,mn(r.mode),T);return r.iter(T,t,function(Q){yn(e,Q.text,H);var X=H.line;Q.stateAfter=X==t-1||X%5==0||X>=i.viewFrom&&X<i.viewTo?H.save():null,H.nextLine()}),n&&(r.modeFrontier=H.line),H}function yn(e,t,n,r){var i=e.doc.mode,T=new Kt(t,e.options.tabSize,n);for(T.start=T.pos=r||0,t==""&&Rt(i,n.state);!T.eol();)Zt(i,T,n.state),T.start=T.pos}function Rt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=hn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Zt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=hn(e,n).mode);var T=e.token(t,n);if(t.pos>t.start)return T}throw new Error("Mode "+e.name+" failed to advance stream.")}var _n=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function En(e,t,n,r){var i=e.doc,T=i.mode,B;t=pt(i,t);var H=ot(i,t.line),Q=Er(e,t.line,n),X=new Kt(H.text,e.options.tabSize,Q),ae;for(r&&(ae=[]);(r||X.pos<t.ch)&&!X.eol();)X.start=X.pos,B=Zt(T,X,Q.state),r&&ae.push(new _n(X,B,Fr(i.mode,Q.state)));return r?ae:new _n(X,B,Q.state)}function On(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Ir(e,t,n,r,i,T,B){var H=n.flattenSpans;H==null&&(H=e.options.flattenSpans);var Q=0,X=null,ae=new Kt(t,e.options.tabSize,r),le,Ae=e.options.addModeClass&&[null];for(t==""&&On(Rt(n,r.state),T);!ae.eol();){if(ae.pos>e.options.maxHighlightLength?(H=!1,B&&yn(e,t,r,ae.pos),ae.pos=t.length,le=null):le=On(Zt(n,ae,r.state,Ae),T),Ae){var Ee=Ae[0].name;Ee&&(le="m-"+(le?Ee+" "+le:Ee))}if(!H||X!=le){for(;Q<ae.start;)Q=Math.min(ae.start,Q+5e3),i(Q,X);X=le}ae.start=ae.pos}for(;Q<ae.pos;){var Ne=Math.min(ae.pos,Q+5e3);i(Ne,X),Q=Ne}}function Gn(e,t,n){for(var r,i,T=e.doc,B=n?-1:t-(e.doc.mode.innerMode?1e3:100),H=t;H>B;--H){if(H<=T.first)return T.first;var Q=ot(T,H-1),X=Q.stateAfter;if(X&&(!n||H+(X instanceof gn?X.lookAhead:0)<=T.modeFrontier))return H;var ae=K(Q.text,null,e.options.tabSize);(i==null||r>ae)&&(i=H-1,r=ae)}return i}function In(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=ot(e,r).stateAfter;if(i&&(!(i instanceof gn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Be=!1,ct=!1;function Lt(){Be=!0}function At(){ct=!0}function jt(e,t,n){this.marker=e,this.from=t,this.to=n}function Ot(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Gt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Tt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ut(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var T=e[i],B=T.marker,H=T.from==null||(B.inclusiveLeft?T.from<=t:T.from<t);if(H||T.from==t&&B.type=="bookmark"&&(!n||!T.marker.insertLeft)){var Q=T.to==null||(B.inclusiveRight?T.to>=t:T.to>t);(r||(r=[])).push(new jt(B,T.from,Q?null:T.to))}}return r}function Pt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var T=e[i],B=T.marker,H=T.to==null||(B.inclusiveRight?T.to>=t:T.to>t);if(H||T.from==t&&B.type=="bookmark"&&(!n||T.marker.insertLeft)){var Q=T.from==null||(B.inclusiveLeft?T.from<=t:T.from<t);(r||(r=[])).push(new jt(B,Q?null:T.from-t,T.to==null?null:T.to-t))}}return r}function Nt(e,t){if(t.full)return null;var n=Ht(e,t.from.line)&&ot(e,t.from.line).markedSpans,r=Ht(e,t.to.line)&&ot(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,T=t.to.ch,B=mt(t.from,t.to)==0,H=ut(n,i,B),Q=Pt(r,T,B),X=t.text.length==1,ae=J(t.text).length+(X?i:0);if(H)for(var le=0;le<H.length;++le){var Ae=H[le];if(Ae.to==null){var Ee=Ot(Q,Ae.marker);Ee?X&&(Ae.to=Ee.to==null?null:Ee.to+ae):Ae.to=i}}if(Q)for(var Ne=0;Ne<Q.length;++Ne){var Ke=Q[Ne];if(Ke.to!=null&&(Ke.to+=ae),Ke.from==null){var Ye=Ot(H,Ke.marker);Ye||(Ke.from=ae,X&&(H||(H=[])).push(Ke))}else Ke.from+=ae,X&&(H||(H=[])).push(Ke)}H&&(H=kt(H)),Q&&Q!=H&&(Q=kt(Q));var et=[H];if(!X){var it=t.text.length-2,tt;if(it>0&&H)for(var at=0;at<H.length;++at)H[at].to==null&&(tt||(tt=[])).push(new jt(H[at].marker,null,null));for(var ht=0;ht<it;++ht)et.push(tt);et.push(Q)}return et}function kt(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Wt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Ee){if(Ee.markedSpans)for(var Ne=0;Ne<Ee.markedSpans.length;++Ne){var Ke=Ee.markedSpans[Ne].marker;Ke.readOnly&&(!r||ee(r,Ke)==-1)&&(r||(r=[])).push(Ke)}}),!r)return null;for(var i=[{from:t,to:n}],T=0;T<r.length;++T)for(var B=r[T],H=B.find(0),Q=0;Q<i.length;++Q){var X=i[Q];if(mt(X.to,H.from)<0||mt(X.from,H.to)>0)continue;var ae=[Q,1],le=mt(X.from,H.from),Ae=mt(X.to,H.to);(le<0||!B.inclusiveLeft&&!le)&&ae.push({from:X.from,to:H.from}),(Ae>0||!B.inclusiveRight&&!Ae)&&ae.push({from:H.to,to:X.to}),i.splice.apply(i,ae),Q+=ae.length-3}return i}function qt(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function rr(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Hr(e){return e.inclusiveLeft?-1:0}function Gr(e){return e.inclusiveRight?1:0}function qr(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),T=mt(r.from,i.from)||Hr(e)-Hr(t);if(T)return-T;var B=mt(r.to,i.to)||Gr(e)-Gr(t);return B||t.id-e.id}function kr(e,t){var n=ct&&e.markedSpans,r;if(n)for(var i=void 0,T=0;T<n.length;++T)i=n[T],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||qr(r,i.marker)<0)&&(r=i.marker);return r}function sn(e){return kr(e,!0)}function ln(e){return kr(e,!1)}function zn(e,t){var n=ct&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var T=n[i];T.marker.collapsed&&(T.from==null||T.from<t)&&(T.to==null||T.to>t)&&(!r||qr(r,T.marker)<0)&&(r=T.marker)}return r}function Bi(e,t,n,r,i){var T=ot(e,t),B=ct&&T.markedSpans;if(B)for(var H=0;H<B.length;++H){var Q=B[H];if(!Q.marker.collapsed)continue;var X=Q.marker.find(0),ae=mt(X.from,n)||Hr(Q.marker)-Hr(i),le=mt(X.to,r)||Gr(Q.marker)-Gr(i);if(ae>=0&&le<=0||ae<=0&&le>=0)continue;if(ae<=0&&(Q.marker.inclusiveRight&&i.inclusiveLeft?mt(X.to,n)>=0:mt(X.to,n)>0)||ae>=0&&(Q.marker.inclusiveRight&&i.inclusiveLeft?mt(X.from,r)<=0:mt(X.from,r)<0))return!0}}function Ur(e){for(var t;t=sn(e);)e=t.find(-1,!0).line;return e}function Fi(e){for(var t;t=ln(e);)e=t.find(1,!0).line;return e}function Vn(e){for(var t,n;t=ln(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function di(e,t){var n=ot(e,t),r=Ur(n);return n==r?t:Dt(r)}function bn(e,t){if(t>e.lastLine())return t;var n=ot(e,t),r;if(!$r(e,n))return t;for(;r=ln(n);)n=r.find(1,!0).line;return Dt(n)+1}function $r(e,t){var n=ct&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&ci(e,t,r))return!0}}function ci(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return ci(e,r.line,Ot(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,T=0;T<t.markedSpans.length;++T)if(i=t.markedSpans[T],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ci(e,t,i))return!0}function zr(e){e=Ur(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var T=n.parent;T;n=T,T=n.parent)for(var B=0;B<T.children.length;++B){var H=T.children[B];if(H==n)break;t+=H.height}return t}function fi(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=sn(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=ln(r);){var T=n.find(0,!0);t-=r.text.length-T.from.ch,r=T.to.line,t+=r.text.length-T.to.ch}return t}function ji(e){var t=e.display,n=e.doc;t.maxLine=ot(n,n.first),t.maxLineLength=fi(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=fi(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Mn=function(e,t,n){this.text=e,rr(this,t),this.height=n?n(this):1};Mn.prototype.lineNo=function(){return Dt(this)},de(Mn);function ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),qt(e),rr(e,n);var i=r?r(e):1;i!=e.height&&ur(e,i)}function st(e){e.parent=null,qt(e)}var gt={},dt={};function xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?dt:gt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function _t(e,t){var n=y("span",null,null,P?"padding-right: .1px":null),r={pre:y("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 T=i?t.rest[i-1]:t.line,B=void 0;r.pos=0,r.addToken=wt,vt(e.display.measure)&&(B=Je(T,e.doc.direction))&&(r.addToken=br(r.addToken,B)),r.map=[];var H=t!=e.display.externalMeasured&&Dt(T);un(T,r,Or(e,T,H)),T.styleClasses&&(T.styleClasses.bgClass&&(r.bgClass=j(T.styleClasses.bgClass,r.bgClass||"")),T.styleClasses.textClass&&(r.textClass=j(T.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Xe(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(P){var Q=r.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function Bt(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function wt(e,t,n,r,i,T,B){if(!t)return;var H=e.splitSpaces?nr(t,e.trailingSpace):t,Q=e.cm.state.specialChars,X=!1,ae;if(!Q.test(t))e.col+=t.length,ae=document.createTextNode(H),e.map.push(e.pos,e.pos+t.length,ae),F&&U<9&&(X=!0),e.pos+=t.length;else{ae=document.createDocumentFragment();for(var le=0;;){Q.lastIndex=le;var Ae=Q.exec(t),Ee=Ae?Ae.index-le:t.length-le;if(Ee){var Ne=document.createTextNode(H.slice(le,le+Ee));F&&U<9?ae.appendChild(o("span",[Ne])):ae.appendChild(Ne),e.map.push(e.pos,e.pos+Ee,Ne),e.col+=Ee,e.pos+=Ee}if(!Ae)break;le+=Ee+1;var Ke=void 0;if(Ae[0]==" "){var Ye=e.cm.options.tabSize,et=Ye-e.col%Ye;Ke=ae.appendChild(o("span",pe(et),"cm-tab")),Ke.setAttribute("role","presentation"),Ke.setAttribute("cm-text"," "),e.col+=et}else Ae[0]=="\r"||Ae[0]==`
|
|
`?(Ke=ae.appendChild(o("span",Ae[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ke.setAttribute("cm-text",Ae[0]),e.col+=1):(Ke=e.cm.options.specialCharPlaceholder(Ae[0]),Ke.setAttribute("cm-text",Ae[0]),F&&U<9?ae.appendChild(o("span",[Ke])):ae.appendChild(Ke),e.col+=1);e.map.push(e.pos,e.pos+1,Ke),e.pos++}}if(e.trailingSpace=H.charCodeAt(t.length-1)==32,n||r||i||X||T||B){var it=n||"";r&&(it+=r),i&&(it+=i);var tt=o("span",[ae],it,T);if(B)for(var at in B)B.hasOwnProperty(at)&&at!="style"&&at!="class"&&tt.setAttribute(at,B[at]);return e.content.appendChild(tt)}e.content.appendChild(ae)}function nr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var T=e.charAt(i);T==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(T="\xA0"),r+=T,n=T==" "}return r}function br(e,t){return function(n,r,i,T,B,H,Q){i=i?i+" cm-force-border":"cm-force-border";for(var X=n.pos,ae=X+r.length;;){for(var le=void 0,Ae=0;Ae<t.length&&!(le=t[Ae],le.to>X&&le.from<=X);Ae++);if(le.to>=ae)return e(n,r,i,T,B,H,Q);e(n,r.slice(0,le.to-X),i,T,null,H,Q),T=null,r=r.slice(le.to-X),X=le.to}}}function St(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 un(e,t,n){var r=e.markedSpans,i=e.text,T=0;if(!r){for(var B=1;B<n.length;B+=2)t.addToken(t,i.slice(T,T=n[B]),xt(n[B+1],t.cm.options));return}for(var H=i.length,Q=0,X=1,ae="",le,Ae,Ee=0,Ne,Ke,Ye,et,it;;){if(Ee==Q){Ne=Ke=Ye=Ae="",it=null,et=null,Ee=Infinity;for(var tt=[],at=void 0,ht=0;ht<r.length;++ht){var lt=r[ht],bt=lt.marker;if(bt.type=="bookmark"&<.from==Q&&bt.widgetNode)tt.push(bt);else if(lt.from<=Q&&(lt.to==null||lt.to>Q||bt.collapsed&<.to==Q&<.from==Q)){if(lt.to!=null&<.to!=Q&&Ee>lt.to&&(Ee=lt.to,Ke=""),bt.className&&(Ne+=" "+bt.className),bt.css&&(Ae=(Ae?Ae+";":"")+bt.css),bt.startStyle&<.from==Q&&(Ye+=" "+bt.startStyle),bt.endStyle&<.to==Ee&&(at||(at=[])).push(bt.endStyle,lt.to),bt.title&&((it||(it={})).title=bt.title),bt.attributes)for(var Ft in bt.attributes)(it||(it={}))[Ft]=bt.attributes[Ft];bt.collapsed&&(!et||qr(et.marker,bt)<0)&&(et=lt)}else lt.from>Q&&Ee>lt.from&&(Ee=lt.from)}if(at)for(var sr=0;sr<at.length;sr+=2)at[sr+1]==Ee&&(Ke+=" "+at[sr]);if(!et||et.from==Q)for(var Vt=0;Vt<tt.length;++Vt)St(t,0,tt[Vt]);if(et&&(et.from||0)==Q){if(St(t,(et.to==null?H+1:et.to)-Q,et.marker,et.from==null),et.to==null)return;et.to==Q&&(et=!1)}}if(Q>=H)break;for(var Pr=Math.min(H,Ee);;){if(ae){var Sr=Q+ae.length;if(!et){var $t=Sr>Pr?ae.slice(0,Pr-Q):ae;t.addToken(t,$t,le?le+Ne:Ne,Ye,Q+$t.length==Ee?Ke:"",Ae,it)}if(Sr>=Pr){ae=ae.slice(Pr-Q),Q=Pr;break}Q=Sr,Ye=""}ae=i.slice(T,T=n[X++]),le=xt(n[X++],t.cm.options)}}}function It(e,t,n){this.line=t,this.rest=Vn(t),this.size=this.rest?Dt(J(this.rest))-n+1:1,this.node=this.text=null,this.hidden=$r(e,t)}function xr(e,t,n){for(var r=[],i,T=t;T<n;T=i){var B=new It(e.doc,ot(e.doc,T),T);i=T+B.size,r.push(B)}return r}var hr=null;function Wr(e){hr?hr.ops.push(e):e.ownsGroup=hr={ops:[e],delayedCallbacks:[]}}function _s(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Os(e,t){var n=e.ownsGroup;if(!n)return;try{_s(n)}finally{hr=null,t(n)}}var hi=null;function dr(e,t){var n=rt(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;hr?i=hr.delayedCallbacks:hi?i=hi:(i=hi=[],setTimeout(Is,0));for(var T=function(H){i.push(function(){return n[H].apply(null,r)})},B=0;B<n.length;++B)T(B)}function Is(){var e=hi;hi=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,n,r){for(var i=0;i<t.changes.length;i++){var T=t.changes[i];T=="text"?Ps(e,t):T=="gutter"?Ja(e,t,n,r):T=="class"?da(e,t):T=="widget"&&ks(e,t,r)}t.changes=null}function mi(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),F&&U<8&&(e.node.style.zIndex=2)),e.node}function Ms(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=mi(t);t.background=r.insertBefore(o("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Xa(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):_t(e,t)}function Ps(e,t){var n=t.text.className,r=Xa(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,da(e,t)):n&&(t.text.className=n)}function da(e,t){Ms(e,t),t.line.wrapClass?mi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ja(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=mi(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var T=t.line.gutterMarkers;if(e.options.lineNumbers||T){var B=mi(t),H=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(H),B.insertBefore(H,t.text),t.line.gutterClass&&(H.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!T||!T["CodeMirror-linenumbers"])&&(t.lineNumber=H.appendChild(o("div",nn(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),T)for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var X=e.display.gutterSpecs[Q].className,ae=T.hasOwnProperty(X)&&T[X];ae&&H.appendChild(o("div",[ae],"CodeMirror-gutter-elt","left: "+r.gutterLeft[X]+"px; width: "+r.gutterWidth[X]+"px"))}}}function ks(e,t,n){t.alignable&&(t.alignable=null);for(var r=g("CodeMirror-linewidget"),i=t.node.firstChild,T=void 0;i;i=T)T=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Za(e,t,n)}function Us(e,t,n,r){var i=Xa(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),da(e,t),Ja(e,t,n,r),Za(e,t,r),t.node}function Za(e,t,n){if(qa(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)qa(e,t.rest[r],t,n,!1)}function qa(e,t,n,r,i){if(!t.widgets)return;for(var T=mi(n),B=0,H=t.widgets;B<H.length;++B){var Q=H[B],X=o("div",[Q.node],"CodeMirror-linewidget"+(Q.className?" "+Q.className:""));Q.handleMouseEvents||X.setAttribute("cm-ignore-events","true"),Ns(Q,X,n,r),e.display.input.setUneditable(X),i&&Q.above?T.insertBefore(X,n.gutter||n.text):T.appendChild(X),dr(Q,"redraw")}}function Ns(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function pi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),u(t.display.measure,o("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function dn(e,t){for(var n=fe(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Wi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $a(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=u(e.measure,o("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function en(e){return oe-e.display.nativeBarWidth}function Pn(e){return e.display.scroller.clientWidth-en(e)-e.display.barWidth}function fa(e){return e.display.scroller.clientHeight-en(e)-e.display.barHeight}function Bs(e,t,n){var r=e.options.lineWrapping,i=r&&Pn(e);if(!t.measure.heights||r&&t.measure.width!=i){var T=t.measure.heights=[];if(r){t.measure.width=i;for(var B=t.text.firstChild.getClientRects(),H=0;H<B.length-1;H++){var Q=B[H],X=B[H+1];Math.abs(Q.bottom-X.bottom)>2&&T.push((Q.bottom+X.top)/2-n.top)}}T.push(n.bottom-n.top)}}function eo(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Dt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=Ur(t);var n=Dt(t),r=e.display.externalMeasured=new It(e.doc,t,n);r.lineN=n;var i=r.built=_t(e,r);return r.text=i.pre,u(e.display.lineMeasure,i.pre),r}function to(e,t,n,r){return tn(e,Qn(e,t),n,r)}function ha(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Nn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Qn(e,t){var n=Dt(t),r=ha(e,n);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,n,Ea(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=eo(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tn(e,t,n,r,i){t.before&&(n=-1);var T=n+(r||""),B;return t.cache.hasOwnProperty(T)?B=t.cache[T]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bs(e,t.view,t.rect),t.hasHeights=!0),B=Ws(e,t,n,r),B.bogus||(t.cache[T]=B)),{left:B.left,right:B.right,top:i?B.rtop:B.top,bottom:i?B.rbottom:B.bottom}}var ro={left:0,right:0,top:0,bottom:0};function no(e,t,n){for(var r,i,T,B,H,Q,X=0;X<e.length;X+=3)if(H=e[X],Q=e[X+1],t<H?(i=0,T=1,B="left"):t<Q?(i=t-H,T=i+1):(X==e.length-3||t==Q&&e[X+3]>t)&&(T=Q-H,i=T-1,t>=Q&&(B="right")),i!=null){if(r=e[X+2],H==Q&&n==(r.insertLeft?"left":"right")&&(B=n),n=="left"&&i==0)for(;X&&e[X-2]==e[X-3]&&e[X-1].insertLeft;)r=e[(X-=3)+2],B="left";if(n=="right"&&i==Q-H)for(;X<e.length-3&&e[X+3]==e[X+4]&&!e[X+5].insertLeft;)r=e[(X+=3)+2],B="right";break}return{node:r,start:i,end:T,collapse:B,coverStart:H,coverEnd:Q}}function js(e,t){var n=ro;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function Ws(e,t,n,r){var i=no(t.map,n,r),T=i.node,B=i.start,H=i.end,Q=i.collapse,X;if(T.nodeType==3){for(var ae=0;ae<4;ae++){for(;B&&Re(t.line.text.charAt(i.coverStart+B));)--B;for(;i.coverStart+H<i.coverEnd&&Re(t.line.text.charAt(i.coverStart+H));)++H;if(F&&U<9&&B==0&&H==i.coverEnd-i.coverStart?X=T.parentNode.getBoundingClientRect():X=js(p(T,B,H).getClientRects(),r),X.left||X.right||B==0)break;H=B,B=B-1,Q="right"}F&&U<11&&(X=Ks(e.display.measure,X))}else{B>0&&(Q=r="right");var le;e.options.lineWrapping&&(le=T.getClientRects()).length>1?X=le[r=="right"?le.length-1:0]:X=T.getBoundingClientRect()}if(F&&U<9&&!B&&(!X||!X.left&&!X.right)){var Ae=T.parentNode.getClientRects()[0];Ae?X={left:Ae.left,right:Ae.left+Xn(e.display),top:Ae.top,bottom:Ae.bottom}:X=ro}for(var Ee=X.top-t.rect.top,Ne=X.bottom-t.rect.top,Ke=(Ee+Ne)/2,Ye=t.view.measure.heights,et=0;et<Ye.length-1&&!(Ke<Ye[et]);et++);var it=et?Ye[et-1]:0,tt=Ye[et],at={left:(Q=="right"?X.right:X.left)-t.rect.left,right:(Q=="left"?X.left:X.right)-t.rect.left,top:it,bottom:tt};return!X.left&&!X.right&&(at.bogus=!0),e.options.singleCursorHeightPerLine||(at.rtop=Ee,at.rbottom=Ne),at}function Ks(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!tr(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function io(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ao(e){e.display.externalMeasure=null,a(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)io(e.display.view[t])}function gi(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return E&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return E&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ma(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=pi(e.widgets[n]));return t}function Ki(e,t,n,r,i){if(!i){var T=ma(t);n.top+=T,n.bottom+=T}if(r=="line")return n;r||(r="local");var B=zr(t);if(r=="local"?B+=Wi(e.display):B-=e.display.viewOffset,r=="page"||r=="window"){var H=e.display.lineSpace.getBoundingClientRect();B+=H.top+(r=="window"?0:so());var Q=H.left+(r=="window"?0:oo());n.left+=Q,n.right+=Q}return n.top+=B,n.bottom+=B,n}function lo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=oo(),i-=so();else if(n=="local"||!n){var T=e.display.sizer.getBoundingClientRect();r+=T.left,i+=T.top}var B=e.display.lineSpace.getBoundingClientRect();return{left:r-B.left,top:i-B.top}}function pa(e,t,n,r,i){return r||(r=ot(e.doc,t.line)),Ki(e,r,to(e,r,t.ch,i),n)}function Vr(e,t,n,r,i,T){r=r||ot(e.doc,t.line),i||(i=Qn(e,r));function B(Ne,Ke){var Ye=tn(e,i,Ne,Ke?"right":"left",T);return Ke?Ye.left=Ye.right:Ye.right=Ye.left,Ki(e,r,Ye,n)}var H=Je(r,e.doc.direction),Q=t.ch,X=t.sticky;if(Q>=r.text.length?(Q=r.text.length,X="before"):Q<=0&&(Q=0,X="after"),!H)return B(X=="before"?Q-1:Q,X=="before");function ae(Ne,Ke,Ye){var et=H[Ke],it=et.level==1;return B(Ye?Ne-1:Ne,it!=Ye)}var le=ze(H,Q,X),Ae=He,Ee=ae(Q,le,X=="before");return Ae!=null&&(Ee.other=ae(Q,Ae,X!="before")),Ee}function uo(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Xn(e.display)*t.ch);var r=ot(e.doc,t.line),i=zr(r)+Wi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function ga(e,t,n,r,i){var T=Ge(e,t,n);return T.xRel=i,r&&(T.outside=r),T}function va(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return ga(r.first,0,null,-1,-1);var i=Lr(r,n),T=r.first+r.size-1;if(i>T)return ga(r.first+r.size-1,ot(r,T).text.length,null,1,1);t<0&&(t=0);for(var B=ot(r,i);;){var H=Hs(e,B,i,t,n),Q=zn(B,H.ch+(H.xRel>0||H.outside>0?1:0));if(!Q)return H;var X=Q.find(1);if(X.line==i)return X;B=ot(r,i=X.line)}}function co(e,t,n,r){r-=ma(t);var i=t.text.length,T=Ve(function(B){return tn(e,n,B-1).bottom<=r},i,0);return i=Ve(function(B){return tn(e,n,B).top>r},T,i),{begin:T,end:i}}function fo(e,t,n,r){n||(n=Qn(e,t));var i=Ki(e,t,tn(e,n,r),"line").top;return co(e,t,n,i)}function ya(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Hs(e,t,n,r,i){i-=zr(t);var T=Qn(e,t),B=ma(t),H=0,Q=t.text.length,X=!0,ae=Je(t,e.doc.direction);if(ae){var le=(e.options.lineWrapping?zs:Gs)(e,t,n,T,ae,r,i);X=le.level!=1,H=X?le.from:le.to-1,Q=X?le.to:le.from-1}var Ae=null,Ee=null,Ne=Ve(function(ht){var lt=tn(e,T,ht);return lt.top+=B,lt.bottom+=B,ya(lt,r,i,!1)?(lt.top<=i&<.left<=r&&(Ae=ht,Ee=lt),!0):!1},H,Q),Ke,Ye,et=!1;if(Ee){var it=r-Ee.left<Ee.right-r,tt=it==X;Ne=Ae+(tt?0:1),Ye=tt?"after":"before",Ke=it?Ee.left:Ee.right}else{!X&&(Ne==Q||Ne==H)&&Ne++,Ye=Ne==0?"after":Ne==t.text.length?"before":tn(e,T,Ne-(X?1:0)).bottom+B<=i==X?"after":"before";var at=Vr(e,Ge(n,Ne,Ye),"line",t,T);Ke=at.left,et=i<at.top?-1:i>=at.bottom?1:0}return Ne=Oe(t.text,Ne,1),ga(n,Ne,Ye,et,r-Ke)}function Gs(e,t,n,r,i,T,B){var H=Ve(function(le){var Ae=i[le],Ee=Ae.level!=1;return ya(Vr(e,Ge(n,Ee?Ae.to:Ae.from,Ee?"before":"after"),"line",t,r),T,B,!0)},0,i.length-1),Q=i[H];if(H>0){var X=Q.level!=1,ae=Vr(e,Ge(n,X?Q.from:Q.to,X?"after":"before"),"line",t,r);ya(ae,T,B,!0)&&ae.top>B&&(Q=i[H-1])}return Q}function zs(e,t,n,r,i,T,B){var H=co(e,t,r,B),Q=H.begin,X=H.end;/\s/.test(t.text.charAt(X-1))&&X--;for(var ae=null,le=null,Ae=0;Ae<i.length;Ae++){var Ee=i[Ae];if(Ee.from>=X||Ee.to<=Q)continue;var Ne=Ee.level!=1,Ke=tn(e,r,Ne?Math.min(X,Ee.to)-1:Math.max(Q,Ee.from)).right,Ye=Ke<T?T-Ke+1e9:Ke-T;(!ae||le>Ye)&&(ae=Ee,le=Ye)}return ae||(ae=i[i.length-1]),ae.from<Q&&(ae={from:Q,to:ae.to,level:ae.level}),ae.to>X&&(ae={from:ae.from,to:X,level:ae.level}),ae}var kn;function Yn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(kn==null){kn=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)kn.appendChild(document.createTextNode("x")),kn.appendChild(o("br"));kn.appendChild(document.createTextNode("x"))}u(e.measure,kn);var n=kn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),a(e.measure),n||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),n=o("pre",[t],"CodeMirror-line-like");u(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ea(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,T=t.gutters.firstChild,B=0;T;T=T.nextSibling,++B){var H=e.display.gutterSpecs[B].className;n[H]=T.offsetLeft+T.clientLeft+i,r[H]=T.clientWidth}return{fixedPos:ba(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ho(e){var t=Yn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Xn(e.display)-3);return function(i){if($r(e.doc,i))return 0;var T=0;if(i.widgets)for(var B=0;B<i.widgets.length;B++)i.widgets[B].height&&(T+=i.widgets[B].height);return n?T+(Math.ceil(i.text.length/r)||1)*t:T+t}}function xa(e){var t=e.doc,n=ho(e);t.iter(function(r){var i=n(r);i!=r.height&&ur(r,i)})}function Un(e,t,n,r){var i=e.display;if(!n&&fe(t).getAttribute("cm-not-content")=="true")return null;var T,B,H=i.lineSpace.getBoundingClientRect();try{T=t.clientX-H.left,B=t.clientY-H.top}catch(le){return null}var Q=va(e,T,B),X;if(r&&Q.xRel>0&&(X=ot(e.doc,Q.line).text).length==Q.ch){var ae=K(X,X.length,e.options.tabSize)-X.length;Q=Ge(Q.line,Math.max(0,Math.round((T-$a(e.display).left)/Xn(e.display))-ae))}return Q}function Nn(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;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Ar(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)ct&&di(e.doc,t)<i.viewTo&&An(e);else if(n<=i.viewFrom)ct&&bn(e.doc,n+r)>i.viewFrom?An(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)An(e);else if(t<=i.viewFrom){var T=Hi(e,n,n+r,1);T?(i.view=i.view.slice(T.index),i.viewFrom=T.lineN,i.viewTo+=r):An(e)}else if(n>=i.viewTo){var B=Hi(e,t,t,-1);B?(i.view=i.view.slice(0,B.index),i.viewTo=B.lineN):An(e)}else{var H=Hi(e,t,t,-1),Q=Hi(e,n,n+r,1);H&&Q?(i.view=i.view.slice(0,H.index).concat(xr(e,H.lineN,Q.lineN)).concat(i.view.slice(Q.index)),i.viewTo+=r):An(e)}var X=i.externalMeasured;X&&(n<X.lineN?X.lineN+=r:t<X.lineN+X.size&&(i.externalMeasured=null))}function xn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var T=r.view[Nn(e,t)];if(T.node==null)return;var B=T.changes||(T.changes=[]);ee(B,n)==-1&&B.push(n)}function An(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hi(e,t,n,r){var i=Nn(e,t),T,B=e.display.view;if(!ct||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var H=e.display.viewFrom,Q=0;Q<i;Q++)H+=B[Q].size;if(H!=t){if(r>0){if(i==B.length-1)return null;T=H+B[i].size-t,i++}else T=H-t;t+=T,n+=T}for(;di(e.doc,n)!=n;){if(i==(r<0?0:B.length-1))return null;n+=r*B[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=xr(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=xr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Nn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(xr(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Nn(e,n)))),r.viewTo=n}function mo(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function vi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function po(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),T=r.selection=document.createDocumentFragment(),B=0;B<n.sel.ranges.length;B++){if(!t&&B==n.sel.primIndex)continue;var H=n.sel.ranges[B];if(H.from().line>=e.display.viewTo||H.to().line<e.display.viewFrom)continue;var Q=H.empty();(Q||e.options.showCursorWhenSelecting)&&go(e,H.head,i),Q||Qs(e,H,T)}return r}function go(e,t,n){var r=Vr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(o("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var T=n.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));T.style.display="",T.style.left=r.other.left+"px",T.style.top=r.other.top+"px",T.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Gi(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,n){var r=e.display,i=e.doc,T=document.createDocumentFragment(),B=$a(e.display),H=B.left,Q=Math.max(r.sizerWidth,Pn(e)-r.sizer.offsetLeft)-B.right,X=i.direction=="ltr";function ae(tt,at,ht,lt){at<0&&(at=0),at=Math.round(at),lt=Math.round(lt),T.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+tt+`px;
|
|
top: `+at+"px; width: "+(ht==null?Q-tt:ht)+`px;
|
|
height: `+(lt-at)+"px"))}function le(tt,at,ht){var lt=ot(i,tt),bt=lt.text.length,Ft,sr;function Vt($t,Cr){return pa(e,Ge(tt,$t),"div",lt,Cr)}function Pr($t,Cr,cr){var ir=fo(e,lt,null,$t),er=Cr=="ltr"==(cr=="after")?"left":"right",Qt=cr=="after"?ir.begin:ir.end-(/\s/.test(lt.text.charAt(ir.end-1))?2:1);return Vt(Qt,er)[er]}var Sr=Je(lt,i.direction);return qe(Sr,at||0,ht==null?bt:ht,function($t,Cr,cr,ir){var er=cr=="ltr",Qt=Vt($t,er?"left":"right"),wr=Vt(Cr-1,er?"right":"left"),li=at==null&&$t==0,Rn=ht==null&&Cr==bt,pr=ir==0,rn=!Sr||ir==Sr.length-1;if(wr.top-Qt.top<=3){var lr=(X?li:Rn)&&pr,Va=(X?Rn:li)&&rn,fn=lr?H:(er?Qt:wr).left,Kn=Va?Q:(er?wr:Qt).right;ae(fn,Qt.top,Kn-fn,Qt.bottom)}else{var Hn,vr,ui,Qa;er?(Hn=X&&li&&pr?H:Qt.left,vr=X?Q:Pr($t,cr,"before"),ui=X?H:Pr(Cr,cr,"after"),Qa=X&&Rn&&rn?Q:wr.right):(Hn=X?Pr($t,cr,"before"):H,vr=!X&&li&&pr?Q:Qt.right,ui=!X&&Rn&&rn?H:wr.left,Qa=X?Pr(Cr,cr,"after"):Q),ae(Hn,Qt.top,vr-Hn,Qt.bottom),Qt.bottom<wr.top&&ae(H,Qt.bottom,null,wr.top),ae(ui,wr.top,Qa-ui,wr.bottom)}(!Ft||Gi(Qt,Ft)<0)&&(Ft=Qt),Gi(wr,Ft)<0&&(Ft=wr),(!sr||Gi(Qt,sr)<0)&&(sr=Qt),Gi(wr,sr)<0&&(sr=wr)}),{start:Ft,end:sr}}var Ae=t.from(),Ee=t.to();if(Ae.line==Ee.line)le(Ae.line,Ae.ch,Ee.ch);else{var Ne=ot(i,Ae.line),Ke=ot(i,Ee.line),Ye=Ur(Ne)==Ur(Ke),et=le(Ae.line,Ae.ch,Ye?Ne.text.length+1:null).end,it=le(Ee.line,Ye?0:null,Ee.ch).start;Ye&&(et.top<it.top-2?(ae(et.right,et.top,null,et.bottom),ae(H,it.top,it.left,it.bottom)):ae(et.right,et.top,it.left-et.right,et.bottom)),et.bottom<it.top&&ae(H,et.bottom,null,it.top)}n.appendChild(T)}function Aa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Jn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Ta(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Jn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Me(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Aa(e)}function Jn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Me(e,"blur",e,t),e.state.focused=!1,h(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],T=e.options.lineWrapping,B=void 0,H=0;if(i.hidden)continue;if(F&&U<8){var Q=i.node.offsetTop+i.node.offsetHeight;B=Q-n,n=Q}else{var X=i.node.getBoundingClientRect();B=X.bottom-X.top,!T&&i.text.firstChild&&(H=i.text.firstChild.getBoundingClientRect().right-X.left-1)}var ae=i.line.height-B;if((ae>.005||ae<-.005)&&(ur(i.line,B),Eo(i.line),i.rest))for(var le=0;le<i.rest.length;le++)Eo(i.rest[le]);if(H>e.display.sizerWidth){var Ae=Math.ceil(H/Xn(e.display));Ae>e.display.maxLineLength&&(e.display.maxLineLength=Ae,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Eo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Vi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Wi(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,T=Lr(t,r),B=Lr(t,i);if(n&&n.ensure){var H=n.ensure.from.line,Q=n.ensure.to.line;H<T?(T=H,B=Lr(t,zr(ot(t,H))+e.wrapper.clientHeight)):Math.min(Q,t.lastLine())>=B&&(T=Lr(t,zr(ot(t,Q))-e.wrapper.clientHeight),B=Q)}return{from:T,to:Math.max(B,T+1)}}function Ys(e,t){if(je(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&&!A){var T=o("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Wi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+en(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(T),T.scrollIntoView(i),e.display.lineSpace.removeChild(T)}}function Xs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var T=0;T<5;T++){var B=!1,H=Vr(e,t),Q=!n||n==t?H:Vr(e,n);i={left:Math.min(H.left,Q.left),top:Math.min(H.top,Q.top)-r,right:Math.max(H.left,Q.left),bottom:Math.max(H.bottom,Q.bottom)+r};var X=Sa(e,i),ae=e.doc.scrollTop,le=e.doc.scrollLeft;if(X.scrollTop!=null&&(Ei(e,X.scrollTop),Math.abs(e.doc.scrollTop-ae)>1&&(B=!0)),X.scrollLeft!=null&&(Bn(e,X.scrollLeft),Math.abs(e.doc.scrollLeft-le)>1&&(B=!0)),!B)break}return i}function Js(e,t){var n=Sa(e,t);n.scrollTop!=null&&Ei(e,n.scrollTop),n.scrollLeft!=null&&Bn(e,n.scrollLeft)}function Sa(e,t){var n=e.display,r=Yn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,T=fa(e),B={};t.bottom-t.top>T&&(t.bottom=t.top+T);var H=e.doc.height+ca(n),Q=t.top<r,X=t.bottom>H-r;if(t.top<i)B.scrollTop=Q?0:t.top;else if(t.bottom>i+T){var ae=Math.min(t.top,(X?H:t.bottom)-T);ae!=i&&(B.scrollTop=ae)}var le=e.options.fixedGutter?0:n.gutters.offsetWidth,Ae=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-le,Ee=Pn(e)-n.gutters.offsetWidth,Ne=t.right-t.left>Ee;return Ne&&(t.right=t.left+Ee),t.left<10?B.scrollLeft=0:t.left<Ae?B.scrollLeft=Math.max(0,t.left+le-(Ne?0:10)):t.right>Ee+Ae-3&&(B.scrollLeft=t.right+(Ne?0:10)-Ee),B}function Ca(e,t){if(t==null)return;Qi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zn(e){Qi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function yi(e,t,n){(t!=null||n!=null)&&Qi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Qi(e),e.curOp.scrollToPos=t}function Qi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=uo(e,t.from),r=uo(e,t.to);bo(e,n,r,t.margin)}}function bo(e,t,n,r){var i=Sa(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});yi(e,i.scrollLeft,i.scrollTop)}function Ei(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||Da(e,{top:t}),xo(e,t,!0),R&&Da(e),Ai(e,100)}function xo(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 Bn(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,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function bi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ca(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+en(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Fn=function(e,t,n){this.cm=n;var r=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),we(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),we(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fn.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 T=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+T)+"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}},Fn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fn.prototype.zeroWidthHack=function(){var e=d&&!C?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},Fn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),T=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);T!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Fn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xi=function(){};xi.prototype.update=function(){return{bottom:0,right:0}},xi.prototype.setScrollLeft=function(){},xi.prototype.setScrollTop=function(){},xi.prototype.clear=function(){};function qn(e,t){t||(t=bi(e));var n=e.display.barWidth,r=e.display.barHeight;Ao(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&zi(e),Ao(e,bi(e)),n=e.display.barWidth,r=e.display.barHeight}function Ao(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 To={native:Fn,null:xi};function So(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&h(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new To[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),we(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"?Bn(e,t):Ei(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function jn(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:++qs},Wr(e.curOp)}function Wn(e){var t=e.curOp;t&&Os(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;$s(n)})}function $s(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var i=0;i<t.length;i++)rl(t[i]);for(var T=0;T<t.length;T++)nl(t[T]);for(var B=0;B<t.length;B++)il(t[B])}function el(e){var t=e.cm,n=t.display;ol(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&wa(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&zi(t),e.barMeasure=bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(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+en(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Pn(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<t.doc.scrollLeft&&Bn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qn(t,e.barMeasure),e.updatedDisplay&&La(t,e.barMeasure),e.selectionChanged&&Aa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&vo(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Co(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&xo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Bn(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xs(t,pt(r,e.scrollToPos.from),pt(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,i)}var T=e.maybeHiddenMarkers,B=e.maybeUnhiddenMarkers;if(T)for(var H=0;H<T.length;++H)T[H].lines.length||Me(T[H],"hide");if(B)for(var Q=0;Q<B.length;++Q)B[Q].lines.length&&Me(B[Q],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Me(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Mr(e,t){if(e.curOp)return t();jn(e);try{return t()}finally{Wn(e)}}function ar(e,t){return function(){if(e.curOp)return t.apply(e,arguments);jn(e);try{return t.apply(e,arguments)}finally{Wn(e)}}}function gr(e){return function(){if(this.curOp)return e.apply(this,arguments);jn(this);try{return e.apply(this,arguments)}finally{Wn(this)}}}function or(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);jn(t);try{return e.apply(this,arguments)}finally{Wn(t)}}}function Ai(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,L(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=Er(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(T){if(r.line>=e.display.viewFrom){var B=T.styles,H=T.text.length>e.options.maxHighlightLength?Fr(t.mode,r.state):null,Q=vn(e,T,r,!0);H&&(r.state=H),T.styles=Q.styles;var X=T.styleClasses,ae=Q.classes;ae?T.styleClasses=ae:X&&(T.styleClasses=null);for(var le=!B||B.length!=T.styles.length||X!=ae&&(!X||!ae||X.bgClass!=ae.bgClass||X.textClass!=ae.textClass),Ae=0;!le&&Ae<B.length;++Ae)le=B[Ae]!=T.styles[Ae];le&&i.push(r.line),T.stateAfter=r.save(),r.nextLine()}else T.text.length<=e.options.maxHighlightLength&&yn(e,T.text,r),T.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Ai(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mr(e,function(){for(var T=0;T<i.length;T++)xn(e,i[T],"text")})}var Yi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Vi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Pn(e),this.force=n,this.dims=Ea(e),this.events=[]};Yi.prototype.signal=function(e,t){ue(e,t)&&this.events.push(arguments)},Yi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Me.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=en(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=en(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=M();if(!t||!x(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&x(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function wa(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return An(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&mo(e)==0)return!1;Do(e)&&(An(e),t.dims=Ea(e));var i=r.first+r.size,T=Math.max(t.visible.from-e.options.viewportMargin,r.first),B=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<T&&T-n.viewFrom<20&&(T=Math.max(r.first,n.viewFrom)),n.viewTo>B&&n.viewTo-B<20&&(B=Math.min(i,n.viewTo)),ct&&(T=di(e.doc,T),B=bn(e.doc,B));var H=T!=n.viewFrom||B!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,T,B),n.viewOffset=zr(ot(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var Q=mo(e);if(!H&&Q==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var X=sl(e);return Q>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),Q>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(X),a(n.cursorDiv),a(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,H&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ai(e,400)),n.updateLineNumbers=null,!0}function Co(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-fa(e),n.top)}),t.visible=Vi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vi(e.display,e.doc,n));if(!wa(e,t))break;zi(e);var i=bi(e);vi(e),qn(e,i),La(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 Da(e,t){var n=new Yi(e,t);if(wa(e,n)){zi(e),Co(e,n);var r=bi(e);vi(e),qn(e,r),La(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,T=r.lineDiv,B=T.firstChild;function H(Ne){var Ke=Ne.nextSibling;return P&&d&&e.display.currentWheelTarget==Ne?Ne.style.display="none":Ne.parentNode.removeChild(Ne),Ke}for(var Q=r.view,X=r.viewFrom,ae=0;ae<Q.length;ae++){var le=Q[ae];if(!le.hidden)if(!le.node||le.node.parentNode!=T){var Ae=Us(e,le,X,n);T.insertBefore(Ae,B)}else{for(;B!=le.node;)B=H(B);var Ee=i&&t!=null&&t<=X&&le.lineNumber;le.changes&&(ee(le.changes,"gutter")>-1&&(Ee=!1),Ya(e,le,X,n)),Ee&&(a(le.lineNumber),le.lineNumber.appendChild(document.createTextNode(nn(e.options,X)))),B=le.node.nextSibling}X+=le.size}for(;B;)B=H(B)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function La(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+en(e)+"px"}function wo(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=ba(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,T=r+"px",B=0;B<n.length;B++)if(!n[B].hidden){e.options.fixedGutter&&(n[B].gutter&&(n[B].gutter.style.left=T),n[B].gutterBackground&&(n[B].gutterBackground.style.left=T));var H=n[B].alignable;if(H)for(var Q=0;Q<H.length;Q++)H[Q].style.left=T}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function Do(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=nn(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(o("div",[o("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),T=i.firstChild.offsetWidth,B=i.offsetWidth-T;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(T,r.lineGutter.offsetWidth-B)+1,r.lineNumWidth=r.lineNumInnerWidth+B,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ra(e.display),!0}return!1}function _a(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var T=e[i],B=null;if(typeof T!="string"&&(B=T.style,T=T.className),T=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:T,style:B})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ro(e){var t=e.gutters,n=e.gutterSpecs;a(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],T=i.className,B=i.style,H=t.appendChild(o("div",null,"CodeMirror-gutter "+T));B&&(H.style.cssText=B),T=="CodeMirror-linenumbers"&&(e.lineGutter=H,H.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ra(e)}function Ti(e){Ro(e.display),Ar(e),wo(e)}function dl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=y("div",null,"CodeMirror-code"),i.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=o("div",null,"CodeMirror-cursors"),i.measure=o("div",null,"CodeMirror-measure"),i.lineMeasure=o("div",null,"CodeMirror-measure"),i.lineSpace=y("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var T=y("div",[i.lineSpace],"CodeMirror-lines");i.mover=o("div",[T],null,"position: relative"),i.sizer=o("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=o("div",null,null,"position: absolute; height: "+oe+"px; width: 1px;"),i.gutters=o("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=o("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=o("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),F&&U<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!P&&!(R&&s)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=_a(r.gutters,r.lineNumbers),Ro(i),n.init(i)}var Xi=0,Nr=null;F?Nr=-.53:R?Nr=15:E?Nr=-.7:_&&(Nr=-1/3);function Lo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=Lo(e);return t.x*=Nr,t.y*=Nr,t}function _o(e,t){var n=Lo(t),r=n.x,i=n.y,T=e.display,B=T.scroller,H=B.scrollWidth>B.clientWidth,Q=B.scrollHeight>B.clientHeight;if(!(r&&H||i&&Q))return;if(i&&d&&P){e:for(var X=t.target,ae=T.view;X!=B;X=X.parentNode)for(var le=0;le<ae.length;le++)if(ae[le].node==X){e.display.currentWheelTarget=X;break e}}if(r&&!R&&!b&&Nr!=null){i&&Q&&Ei(e,Math.max(0,B.scrollTop+i*Nr)),Bn(e,Math.max(0,B.scrollLeft+r*Nr)),(!i||i&&Q)&&Z(t),T.wheelStartX=null;return}if(i&&Nr!=null){var Ae=i*Nr,Ee=e.doc.scrollTop,Ne=Ee+T.wrapper.clientHeight;Ae<0?Ee=Math.max(0,Ee+Ae-50):Ne=Math.min(e.doc.height,Ne+Ae+50),Da(e,{top:Ee,bottom:Ne})}Xi<20&&(T.wheelStartX==null?(T.wheelStartX=B.scrollLeft,T.wheelStartY=B.scrollTop,T.wheelDX=r,T.wheelDY=i,setTimeout(function(){if(T.wheelStartX==null)return;var Ke=B.scrollLeft-T.wheelStartX,Ye=B.scrollTop-T.wheelStartY,et=Ye&&T.wheelDY&&Ye/T.wheelDY||Ke&&T.wheelDX&&Ke/T.wheelDX;if(T.wheelStartX=T.wheelStartY=null,!et)return;Nr=(Nr*Xi+et)/(Xi+1),++Xi},200)):(T.wheelDX+=r,T.wheelDY+=i))}var Br=function(e,t){this.ranges=e,this.primIndex=t};Br.prototype.primary=function(){return this.ranges[this.primIndex]},Br.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!Jr(n.anchor,r.anchor)||!Jr(n.head,r.head))return!1}return!0},Br.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Mt(pn(this.ranges[t].anchor),pn(this.ranges[t].head));return new Br(e,this.primIndex)},Br.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Br.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(mt(t,r.from())>=0&&mt(e,r.to())<=0)return n}return-1};var Mt=function(e,t){this.anchor=e,this.head=t};Mt.prototype.from=function(){return on(this.anchor,this.head)},Mt.prototype.to=function(){return an(this.anchor,this.head)},Mt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Qr(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(Ae,Ee){return mt(Ae.from(),Ee.from())}),n=ee(t,i);for(var T=1;T<t.length;T++){var B=t[T],H=t[T-1],Q=mt(H.to(),B.from());if(r&&!B.empty()?Q>0:Q>=0){var X=on(H.from(),B.from()),ae=an(H.to(),B.to()),le=H.empty()?B.from()==B.head:H.from()==H.head;T<=n&&--n,t.splice(--T,2,new Mt(le?ae:X,le?X:ae))}}return new Br(t,n)}function Tn(e,t){return new Br([new Mt(e,t||e)],0)}function Sn(e){return e.text?Ge(e.from.line+e.text.length-1,J(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Oo(e,t){if(mt(e,t.from)<0)return e;if(mt(e,t.to)<=0)return Sn(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+=Sn(t).ch-t.to.ch),Ge(n,r)}function Oa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Mt(Oo(i.anchor,t),Oo(i.head,t)))}return Qr(e.cm,n,e.sel.primIndex)}function Io(e,t,n){return e.line==t.line?Ge(n.line,e.ch-t.ch+n.ch):Ge(n.line+(e.line-t.line),e.ch)}function fl(e,t,n){for(var r=[],i=Ge(e.first,0),T=i,B=0;B<t.length;B++){var H=t[B],Q=Io(H.from,i,T),X=Io(Sn(H),i,T);if(i=H.to,T=X,n=="around"){var ae=e.sel.ranges[B],le=mt(ae.head,ae.anchor)<0;r[B]=new Mt(le?X:Q,le?Q:X)}else r[B]=new Mt(Q,Q)}return new Br(r,e.sel.primIndex)}function Ia(e){e.doc.mode=Rr(e.options,e.doc.modeOption),Si(e)}function Si(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ai(e,100),e.state.modeGen++,e.curOp&&Ar(e)}function Mo(e,t){return t.from.ch==0&&t.to.ch==0&&J(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ma(e,t,n,r){function i(it){return n?n[it]:null}function T(it,tt,at){ua(it,tt,at,r),dr(it,"change",it,t)}function B(it,tt){for(var at=[],ht=it;ht<tt;++ht)at.push(new Mn(X[ht],i(ht),r));return at}var H=t.from,Q=t.to,X=t.text,ae=ot(e,H.line),le=ot(e,Q.line),Ae=J(X),Ee=i(X.length-1),Ne=Q.line-H.line;if(t.full)e.insert(0,B(0,X.length)),e.remove(X.length,e.size-X.length);else if(Mo(e,t)){var Ke=B(0,X.length-1);T(le,le.text,Ee),Ne&&e.remove(H.line,Ne),Ke.length&&e.insert(H.line,Ke)}else if(ae==le)if(X.length==1)T(ae,ae.text.slice(0,H.ch)+Ae+ae.text.slice(Q.ch),Ee);else{var Ye=B(1,X.length-1);Ye.push(new Mn(Ae+ae.text.slice(Q.ch),Ee,r)),T(ae,ae.text.slice(0,H.ch)+X[0],i(0)),e.insert(H.line+1,Ye)}else if(X.length==1)T(ae,ae.text.slice(0,H.ch)+X[0]+le.text.slice(Q.ch),i(0)),e.remove(H.line+1,Ne);else{T(ae,ae.text.slice(0,H.ch)+X[0],i(0)),T(le,Ae+le.text.slice(Q.ch),Ee);var et=B(1,X.length-1);Ne>1&&e.remove(H.line+1,Ne-1),e.insert(H.line+1,et)}dr(e,"change",e,t)}function Cn(e,t,n){function r(i,T,B){if(i.linked)for(var H=0;H<i.linked.length;++H){var Q=i.linked[H];if(Q.doc==T)continue;var X=B&&Q.sharedHist;if(n&&!X)continue;t(Q.doc,X),r(Q.doc,i,X)}}r(e,null,!0)}function Po(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xa(e),Ia(e),ko(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,Ar(e)}function ko(e){(e.doc.direction=="rtl"?N:h)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){Mr(e,function(){ko(e),Ar(e)})}function Ji(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Pa(e,t){var n={from:pn(t.from),to:Sn(t),text:jr(e,t.from,t.to)};return Bo(e,n,t.from.line,t.to.line+1),Cn(e,function(r){return Bo(r,n,t.from.line,t.to.line+1)},!0),n}function Uo(e){for(;e.length;){var t=J(e);if(t.ranges)e.pop();else break}}function ml(e,t){if(t)return Uo(e.done),J(e.done);if(e.done.length&&!J(e.done).ranges)return J(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),J(e.done)}function No(e,t,n,r){var i=e.history;i.undone.length=0;var T=+new Date,B,H;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>T-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(B=ml(i,i.lastOp==r)))H=J(B.changes),mt(t.from,t.to)==0&&mt(t.from,H.to)==0?H.to=Sn(t):B.changes.push(Pa(e,t));else{var Q=J(i.done);for((!Q||!Q.ranges)&&Zi(e.sel,i.done),B={changes:[Pa(e,t)],generation:i.generation},i.done.push(B);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=T,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,H||Me(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,T=r&&r.origin;n==i.lastSelOp||T&&i.lastSelOrigin==T&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==T||pl(e,T,J(i.done),t))?i.done[i.done.length-1]=t:Zi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=T,i.lastSelOp=n,r&&r.clearRedo!==!1&&Uo(i.undone)}function Zi(e,t){var n=J(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Bo(e,t,n,r){var i=t["spans_"+e.id],T=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(B){B.markedSpans&&((i||(i=t["spans_"+e.id]={}))[T]=B.markedSpans),++T})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(vl(n[i]));return r}function Fo(e,t){var n=yl(e,t),r=Nt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var T=n[i],B=r[i];if(T&&B){e:for(var H=0;H<B.length;++H){for(var Q=B[H],X=0;X<T.length;++X)if(T[X].marker==Q.marker)continue e;T.push(Q)}}else B&&(n[i]=B)}return n}function $n(e,t,n){for(var r=[],i=0;i<e.length;++i){var T=e[i];if(T.ranges){r.push(n?Br.prototype.deepCopy.call(T):T);continue}var B=T.changes,H=[];r.push({changes:H});for(var Q=0;Q<B.length;++Q){var X=B[Q],ae=void 0;if(H.push({from:X.from,to:X.to,text:X.text}),t)for(var le in X)(ae=le.match(/^spans_(\d+)$/))&&(ee(t,Number(ae[1]))>-1&&(J(H)[le]=X[le],delete X[le]))}}return r}function ka(e,t,n,r){if(r){var i=e.anchor;if(n){var T=mt(t,i)<0;T!=mt(n,i)<0?(i=t,t=n):T!=mt(t,n)<0&&(t=n)}return new Mt(i,t)}else return new Mt(n||t,t)}function qi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),mr(e,new Br([ka(e.sel.primary(),t,n,i)],0),r)}function jo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),T=0;T<e.sel.ranges.length;T++)r[T]=ka(e.sel.ranges[T],t[T],null,i);var B=Qr(e.cm,r,e.sel.primIndex);mr(e,B,n)}function Ua(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,mr(e,Qr(e.cm,i,e.sel.primIndex),r)}function Wo(e,t,n,r){mr(e,Tn(t,n),r)}function El(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var T=0;T<i.length;T++)this.ranges[T]=new Mt(pt(e,i[T].anchor),pt(e,i[T].head))},origin:n&&n.origin};return Me(e,"beforeSelectionChange",e,r),e.cm&&Me(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Qr(e.cm,r.ranges,r.ranges.length-1):t}function Ko(e,t,n){var r=e.history.done,i=J(r);i&&i.ranges?(r[r.length-1]=t,$i(e,t,n)):mr(e,t,n)}function mr(e,t,n){$i(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function $i(e,t,n){(ue(e,"beforeSelectionChange")||e.cm&&ue(e.cm,"beforeSelectionChange"))&&(t=El(e,t,n));var r=n&&n.bias||(mt(t.primary().head,e.sel.primary().head)<0?-1:1);Ho(e,zo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Zn(e.cm)}function Ho(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,he(e.cm)),dr(e,"cursorActivity",e)}function Go(e){Ho(e,zo(e,e.sel,null,!1))}function zo(e,t,n,r){for(var i,T=0;T<t.ranges.length;T++){var B=t.ranges[T],H=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[T],Q=ea(e,B.anchor,H&&H.anchor,n,r),X=ea(e,B.head,H&&H.head,n,r);(i||Q!=B.anchor||X!=B.head)&&(i||(i=t.ranges.slice(0,T)),i[T]=new Mt(Q,X))}return i?Qr(e.cm,i,t.primIndex):t}function ei(e,t,n,r,i){var T=ot(e,t.line);if(T.markedSpans)for(var B=0;B<T.markedSpans.length;++B){var H=T.markedSpans[B],Q=H.marker,X="selectLeft"in Q?!Q.selectLeft:Q.inclusiveLeft,ae="selectRight"in Q?!Q.selectRight:Q.inclusiveRight;if((H.from==null||(X?H.from<=t.ch:H.from<t.ch))&&(H.to==null||(ae?H.to>=t.ch:H.to>t.ch))){if(i&&(Me(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(T.markedSpans){--B;continue}else break;if(!Q.atomic)continue;if(n){var le=Q.find(r<0?1:-1),Ae=void 0;if((r<0?ae:X)&&(le=Vo(e,le,-r,le&&le.line==t.line?T:null)),le&&le.line==t.line&&(Ae=mt(le,n))&&(r<0?Ae<0:Ae>0))return ei(e,le,t,r,i)}var Ee=Q.find(r<0?-1:1);return(r<0?X:ae)&&(Ee=Vo(e,Ee,r,Ee.line==t.line?T:null)),Ee?ei(e,Ee,t,r,i):null}}return t}function ea(e,t,n,r,i){var T=r||1,B=ei(e,t,n,T,i)||!i&&ei(e,t,n,T,!0)||ei(e,t,n,-T,i)||!i&&ei(e,t,n,-T,!0);return B||(e.cantEdit=!0,Ge(e.first,0))}function Vo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?pt(e,Ge(t.line-1)):null:n>0&&t.ch==(r||ot(e,t.line)).text.length?t.line<e.first+e.size-1?Ge(t.line+1,0):null:new Ge(t.line,t.ch+n)}function Qo(e){e.setSelection(Ge(e.firstLine(),0),Ge(e.lastLine()),ve)}function Yo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,T,B,H){i&&(r.from=pt(e,i)),T&&(r.to=pt(e,T)),B&&(r.text=B),H!==void 0&&(r.origin=H)}),Me(e,"beforeChange",e,r),e.cm&&Me(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ti(e,t,n){if(e.cm){if(!e.cm.curOp)return ar(e.cm,ti)(e,t,n);if(e.cm.state.suppressEdits)return}if((ue(e,"beforeChange")||e.cm&&ue(e.cm,"beforeChange"))&&(t=Yo(e,t,!0),!t))return;var r=Be&&!n&&Wt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Xo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Xo(e,t)}function Xo(e,t){if(t.text.length==1&&t.text[0]==""&&mt(t.from,t.to)==0)return;var n=Oa(e,t);No(e,t,n,e.cm?e.cm.curOp.id:NaN),Ci(e,t,n,Nt(e,t));var r=[];Cn(e,function(i,T){!T&&ee(r,i.history)==-1&&($o(i.history,t),r.push(i.history)),Ci(i,t,null,Nt(i,t))})}function ta(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,T,B=e.sel,H=t=="undo"?i.done:i.undone,Q=t=="undo"?i.undone:i.done,X=0;X<H.length&&!(T=H[X],n?T.ranges&&!T.equals(e.sel):!T.ranges);X++);if(X==H.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(T=H.pop(),T.ranges){if(Zi(T,Q),n&&!T.equals(e.sel)){mr(e,T,{clearRedo:!1});return}B=T}else if(r){H.push(T);return}else break;var ae=[];Zi(B,Q),Q.push({changes:ae,generation:i.generation}),i.generation=T.generation||++i.maxGeneration;for(var le=ue(e,"beforeChange")||e.cm&&ue(e.cm,"beforeChange"),Ae=function(Ke){var Ye=T.changes[Ke];if(Ye.origin=t,le&&!Yo(e,Ye,!1))return H.length=0,{};ae.push(Pa(e,Ye));var et=Ke?Oa(e,Ye):J(H);Ci(e,Ye,et,Fo(e,Ye)),!Ke&&e.cm&&e.cm.scrollIntoView({from:Ye.from,to:Sn(Ye)});var it=[];Cn(e,function(tt,at){!at&&ee(it,tt.history)==-1&&($o(tt.history,Ye),it.push(tt.history)),Ci(tt,Ye,null,Fo(tt,Ye))})},Ee=T.changes.length-1;Ee>=0;--Ee){var Ne=Ae(Ee);if(Ne)return Ne.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Br(ne(e.sel.ranges,function(i){return new Mt(Ge(i.anchor.line+t,i.anchor.ch),Ge(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;r<n.viewTo;r++)xn(e.cm,r,"gutter")}}function Ci(e,t,n,r){if(e.cm&&!e.cm.curOp)return ar(e.cm,Ci)(e,t,n,r);if(t.to.line<e.first){Jo(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Jo(e,i),t={from:Ge(e.first,0),to:Ge(t.to.line+i,t.to.ch),text:[J(t.text)],origin:t.origin}}var T=e.lastLine();t.to.line>T&&(t={from:t.from,to:Ge(T,ot(e,T).text.length),text:[t.text[0]],origin:t.origin}),t.removed=jr(e,t.from,t.to),n||(n=Oa(e,t)),e.cm?bl(e.cm,t,r):Ma(e,t,r),$i(e,n,ve),e.cantEdit&&ea(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,n){var r=e.doc,i=e.display,T=t.from,B=t.to,H=!1,Q=T.line;e.options.lineWrapping||(Q=Dt(Ur(ot(r,T.line))),r.iter(Q,B.line+1,function(Ee){if(Ee==i.maxLine)return H=!0,!0})),r.sel.contains(t.from,t.to)>-1&&he(e),Ma(r,t,n,ho(e)),e.options.lineWrapping||(r.iter(Q,T.line+t.text.length,function(Ee){var Ne=fi(Ee);Ne>i.maxLineLength&&(i.maxLine=Ee,i.maxLineLength=Ne,i.maxLineChanged=!0,H=!1)}),H&&(e.curOp.updateMaxLine=!0)),In(r,T.line),Ai(e,400);var X=t.text.length-(B.line-T.line)-1;t.full?Ar(e):T.line==B.line&&t.text.length==1&&!Mo(e.doc,t)?xn(e,T.line,"text"):Ar(e,T.line,B.line+1,X);var ae=ue(e,"changes"),le=ue(e,"change");if(le||ae){var Ae={from:T,to:B,text:t.text,removed:t.removed,origin:t.origin};le&&dr(e,"change",e,Ae),ae&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ae)}e.display.selForContextMenu=null}function ri(e,t,n,r,i){var T;r||(r=n),mt(r,n)<0&&(T=[r,n],n=T[0],r=T[1]),typeof t=="string"&&(t=e.splitLines(t)),ti(e,{from:n,to:r,text:t,origin:i})}function Zo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function qo(e,t,n,r){for(var i=0;i<e.length;++i){var T=e[i],B=!0;if(T.ranges){T.copied||(T=e[i]=T.deepCopy(),T.copied=!0);for(var H=0;H<T.ranges.length;H++)Zo(T.ranges[H].anchor,t,n,r),Zo(T.ranges[H].head,t,n,r);continue}for(var Q=0;Q<T.changes.length;++Q){var X=T.changes[Q];if(n<X.from.line)X.from=Ge(X.from.line+r,X.from.ch),X.to=Ge(X.to.line+r,X.to.ch);else if(t<=X.to.line){B=!1;break}}B||(e.splice(0,i+1),i=0)}}function $o(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;qo(e.done,n,r,i),qo(e.undone,n,r,i)}function wi(e,t,n,r){var i=t,T=t;return typeof t=="number"?T=ot(e,Zr(e,t)):i=Dt(t),i==null?null:(r(T,i)&&e.cm&&xn(e.cm,i,n),T)}function Di(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Di.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,st(i),dr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Ri(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Ri.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var T=Math.min(t,i-e),B=r.height;if(r.removeInner(e,T),this.height-=B-r.height,i==T&&(this.children.splice(n--,1),r.parent=null),(t-=T)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Di))){var H=[];this.collapse(H),this.children=[new Di(H)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],T=i.chunkSize();if(e<=T){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var B=i.lines.length%25+25,H=B;H<i.lines.length;){var Q=new Di(i.lines.slice(H,H+=25));i.height-=Q.height,this.children.splice(++r,0,Q),Q.parent=this}i.lines=i.lines.slice(0,B),this.maybeSpill()}break}e-=T}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Ri(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=ee(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Ri(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],T=i.chunkSize();if(e<T){var B=Math.min(t,T-e);if(i.iterN(e,B,n))return!0;if((t-=B)==0)break;e=0}else e-=T}}};var Li=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Li.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Dt(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var T=pi(this);ur(n,Math.max(0,n.height-T)),e&&(Mr(e,function(){es(e,n,-T),xn(e,r,"widget")}),dr(e,"lineWidgetCleared",e,this,r))},Li.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=pi(this)-t;if(!i)return;$r(this.doc,r)||ur(r,r.height+i),n&&Mr(n,function(){n.curOp.forceUpdate=!0,es(n,r,i),dr(n,"lineWidgetChanged",n,e,Dt(r))})},de(Li);function es(e,t,n){zr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ca(e,n)}function xl(e,t,n,r){var i=new Li(e,n,r),T=e.cm;return T&&i.noHScroll&&(T.display.alignWidgets=!0),wi(e,t,"widget",function(B){var H=B.widgets||(B.widgets=[]);if(i.insertAt==null?H.push(i):H.splice(Math.min(H.length-1,Math.max(0,i.insertAt)),0,i),i.line=B,T&&!$r(e,B)){var Q=zr(B)<e.scrollTop;ur(B,B.height+pi(i)),Q&&Ca(T,i.height),T.curOp.forceUpdate=!0}return!0}),T&&dr(T,"lineWidgetAdded",T,i,typeof t=="number"?t:Dt(t)),i}var ts=0,wn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};wn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&jn(e),ue(this,"clear")){var n=this.find();n&&dr(this,"clear",n.from,n.to)}for(var r=null,i=null,T=0;T<this.lines.length;++T){var B=this.lines[T],H=Ot(B.markedSpans,this);e&&!this.collapsed?xn(e,Dt(B),"text"):e&&(H.to!=null&&(i=Dt(B)),H.from!=null&&(r=Dt(B))),B.markedSpans=Gt(B.markedSpans,H),H.from==null&&this.collapsed&&!$r(this.doc,B)&&e&&ur(B,Yn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var Q=0;Q<this.lines.length;++Q){var X=Ur(this.lines[Q]),ae=fi(X);ae>e.display.maxLineLength&&(e.display.maxLine=X,e.display.maxLineLength=ae,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&&Go(e.doc)),e&&dr(e,"markerCleared",e,this,r,i),t&&Wn(e),this.parent&&this.parent.clear()},wn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var T=this.lines[i],B=Ot(T.markedSpans,this);if(B.from!=null&&(n=Ge(t?T:Dt(T),B.from),e==-1))return n;if(B.to!=null&&(r=Ge(t?T:Dt(T),B.to),e==1))return r}return n&&{from:n,to:r}},wn.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;Mr(r,function(){var i=t.line,T=Dt(t.line),B=ha(r,T);if(B&&(io(B),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!$r(n.doc,i)&&n.height!=null){var H=n.height;n.height=null;var Q=pi(n)-H;Q&&ur(i,i.height+Q)}dr(r,"markerChanged",r,e)})},wn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ee(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},wn.prototype.detachLine=function(e){if(this.lines.splice(ee(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},de(wn);function ni(e,t,n,r,i){if(r&&r.shared)return Al(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ar(e.cm,ni)(e,t,n,r,i);var T=new wn(e,i),B=mt(t,n);if(r&&I(r,T,!1),B>0||B==0&&T.clearWhenEmpty!==!1)return T;if(T.replacedWith&&(T.collapsed=!0,T.widgetNode=y("span",[T.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||T.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(T.widgetNode.insertLeft=!0)),T.collapsed){if(Bi(e,t.line,t,n,T)||t.line!=n.line&&Bi(e,n.line,t,n,T))throw new Error("Inserting collapsed marker partially overlapping an existing one");At()}T.addToHistory&&No(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var H=t.line,Q=e.cm,X;if(e.iter(H,n.line+1,function(le){Q&&T.collapsed&&!Q.options.lineWrapping&&Ur(le)==Q.display.maxLine&&(X=!0),T.collapsed&&H!=t.line&&ur(le,0),Tt(le,new jt(T,H==t.line?t.ch:null,H==n.line?n.ch:null)),++H}),T.collapsed&&e.iter(t.line,n.line+1,function(le){$r(e,le)&&ur(le,0)}),T.clearOnEnter&&we(T,"beforeCursorEnter",function(){return T.clear()}),T.readOnly&&(Lt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),T.collapsed&&(T.id=++ts,T.atomic=!0),Q){if(X&&(Q.curOp.updateMaxLine=!0),T.collapsed)Ar(Q,t.line,n.line+1);else if(T.className||T.startStyle||T.endStyle||T.css||T.attributes||T.title)for(var ae=t.line;ae<=n.line;ae++)xn(Q,ae,"text");T.atomic&&Go(Q.doc),dr(Q,"markerAdded",Q,T)}return T}var _i=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};_i.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();dr(this,"clear")},_i.prototype.find=function(e,t){return this.primary.find(e,t)},de(_i);function Al(e,t,n,r,i){r=I(r),r.shared=!1;var T=[ni(e,t,n,r,i)],B=T[0],H=r.widgetNode;return Cn(e,function(Q){H&&(r.widgetNode=H.cloneNode(!0)),T.push(ni(Q,pt(Q,t),pt(Q,n),r,i));for(var X=0;X<Q.linked.length;++X)if(Q.linked[X].isParent)return;B=J(T)}),new _i(T,B)}function rs(e){return e.findMarks(Ge(e.first,0),e.clipPos(Ge(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),T=e.clipPos(i.from),B=e.clipPos(i.to);if(mt(T,B)){var H=ni(e,T,B,r.primary,r.primary.type);r.markers.push(H),H.parent=r}}}function Sl(e){for(var t=function(r){var i=e[r],T=[i.primary.doc];Cn(i.primary.doc,function(Q){return T.push(Q)});for(var B=0;B<i.markers.length;B++){var H=i.markers[B];ee(T,H.doc)==-1&&(H.parent=null,i.markers.splice(B--,1))}},n=0;n<e.length;n++)t(n)}var Cl=0,Tr=function(e,t,n,r,i){if(!(this instanceof Tr))return new Tr(e,t,n,r,i);n==null&&(n=0),Ri.call(this,[new Di([new Mn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var T=Ge(n,0);this.sel=Tn(T),this.history=new Ji(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ma(this,{from:T,to:T,text:e}),mr(this,Tn(T),ve)};Tr.prototype=Te(Ri.prototype,{constructor:Tr,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Xt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:or(function(e){var t=Ge(this.first,0),n=this.first+this.size-1;ti(this,{from:t,to:Ge(n,ot(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&yi(this.cm,0,0),mr(this,Tn(t),ve)}),replaceRange:function(e,t,n,r){t=pt(this,t),n=n?pt(this,n):t,ri(this,e,t,n,r)},getRange:function(e,t,n){var r=jr(this,pt(this,e),pt(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ht(this,e))return ot(this,e)},getLineNumber:function(e){return Dt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ot(this,e)),Ur(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pt(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:or(function(e,t,n){Wo(this,pt(this,typeof e=="number"?Ge(e,t||0):e),null,n)}),setSelection:or(function(e,t,n){Wo(this,pt(this,e),pt(this,t||e),n)}),extendSelection:or(function(e,t,n){qi(this,pt(this,e),t&&pt(this,t),n)}),extendSelections:or(function(e,t){jo(this,Qe(this,e),t)}),extendSelectionsBy:or(function(e,t){var n=ne(this.sel.ranges,e);jo(this,Qe(this,n),t)}),setSelections:or(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new Mt(pt(this,e[i].anchor),pt(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),mr(this,Qr(this.cm,r,t),n)}),addSelection:or(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Mt(pt(this,e),pt(this,t||e))),mr(this,Qr(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=jr(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=jr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:or(function(e,t,n){for(var r=[],i=this.sel,T=0;T<i.ranges.length;T++){var B=i.ranges[T];r[T]={from:B.from(),to:B.to(),text:this.splitLines(e[T]),origin:n}}for(var H=t&&t!="end"&&fl(this,r,t),Q=r.length-1;Q>=0;Q--)ti(this,r[Q]);H?Ko(this,H):this.cm&&Zn(this.cm)}),undo:or(function(){ta(this,"undo")}),redo:or(function(){ta(this,"redo")}),undoSelection:or(function(){ta(this,"undo",!0)}),redoSelection:or(function(){ta(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.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ji(this.history.maxGeneration),Cn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:$n(this.history.done),undone:$n(this.history.undone)}},setHistory:function(e){var t=this.history=new Ji(this.history.maxGeneration);t.done=$n(e.done.slice(0),null,!0),t.undone=$n(e.undone.slice(0),null,!0)},setGutterMarker:or(function(e,t,n){return wi(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Ie(i)&&(r.gutterMarkers=null),!0})}),clearGutter:or(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&wi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Ie(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ht(this,e))return null;if(t=e,e=ot(this,e),!e)return null}else if(t=Dt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:or(function(e,t,n){return wi(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(g(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:or(function(e,t,n){return wi(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",T=r[i];if(T)if(n==null)r[i]=null;else{var B=T.match(g(n));if(!B)return!1;var H=B.index+B[0].length;r[i]=T.slice(0,B.index)+(!B.index||H==T.length?"":" ")+T.slice(H)||null}else return!1;return!0})}),addLineWidget:or(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ni(this,pt(this,e),pt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=pt(this,e),ni(this,e,e,n,"bookmark")},findMarksAt:function(e){e=pt(this,e);var t=[],n=ot(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(T){var B=T.markedSpans;if(B)for(var H=0;H<B.length;H++){var Q=B[H];!(Q.to!=null&&i==e.line&&e.ch>=Q.to||Q.from==null&&i!=e.line||Q.from!=null&&i==t.line&&Q.from>=t.ch)&&(!n||n(Q.marker))&&r.push(Q.marker.parent||Q.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var T=i.text.length+r;if(T>e)return t=e,!0;e-=T,++n}),pt(this,Ge(n,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Tr(Xt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Tr(Xt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,rs(this)),r},unlinkDoc:function(e){if(e instanceof zt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(rs(this));break}if(e.history==this.history){var r=[e.id];Cn(e,function(i){return r.push(i.id)},!0),e.history=new Ji(null),e.history.done=$n(this.history.done,r),e.history.undone=$n(this.history.undone,r)}},iterLinkedDocs:function(e){Cn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ft(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:or(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),Tr.prototype.eachLine=Tr.prototype.iter;var ns=0;function wl(e){var t=this;if(is(t),je(t,e)||dn(t.display,e))return;Z(e),F&&(ns=+new Date);var n=Un(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,T=Array(i),B=0,H=function(){++B==i&&ar(t,function(){n=pt(t.doc,n);var Ee={from:n,to:n,text:t.doc.splitLines(T.filter(function(Ne){return Ne!=null}).join(t.doc.lineSeparator())),origin:"paste"};ti(t.doc,Ee),Ko(t.doc,Tn(pt(t.doc,n),pt(t.doc,Sn(Ee))))})()},Q=function(Ee,Ne){if(t.options.allowDropFileTypes&&ee(t.options.allowDropFileTypes,Ee.type)==-1){H();return}var Ke=new FileReader;Ke.onerror=function(){return H()},Ke.onload=function(){var Ye=Ke.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ye)){H();return}T[Ne]=Ye,H()},Ke.readAsText(Ee)},X=0;X<r.length;X++)Q(r[X],X);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ae=e.dataTransfer.getData("Text");if(ae){var le;if(t.state.draggingText&&!t.state.draggingText.copy&&(le=t.listSelections()),$i(t.doc,Tn(n,n)),le)for(var Ae=0;Ae<le.length;++Ae)ri(t.doc,"",le[Ae].anchor,le[Ae].head,"drag");t.replaceSelection(ae,"around","paste"),t.display.input.focus()}}catch(Ee){}}}function Dl(e,t){if(F&&(!e.state.draggingText||+new Date-ns<100)){se(t);return}if(je(e,t)||dn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!_){var n=o("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),b&&n.parentNode.removeChild(n)}}function Rl(e,t){var n=Un(e,t);if(!n)return;var r=document.createDocumentFragment();go(e,n,r),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),u(e.display.dragCursor,r)}function is(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var T=0;T<n.length;T++)e(n[T])})}var os=!1;function Ll(){if(os)return;_l(),os=!0}function _l(){var e;we(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Ol)},100))}),we(window,"blur",function(){return as(Jn)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Dn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Oi=0;Oi<10;Oi++)Dn[Oi+48]=Dn[Oi+96]=String(Oi);for(var ra=65;ra<=90;ra++)Dn[ra]=String.fromCharCode(ra);for(var Ii=1;Ii<=12;Ii++)Dn[Ii+111]=Dn[Ii+63235]="F"+Ii;var cn={};cn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},cn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},cn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},cn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},cn.default=d?cn.macDefault:cn.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,T,B=0;B<t.length-1;B++){var H=t[B];if(/^(cmd|meta|m)$/i.test(H))T=!0;else if(/^a(lt)?$/i.test(H))n=!0;else if(/^(c|ctrl|control)$/i.test(H))r=!0;else if(/^s(hift)?$/i.test(H))i=!0;else throw new Error("Unrecognized modifier name: "+H)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),T&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ml(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=ne(n.split(" "),Il),T=0;T<i.length;T++){var B=void 0,H=void 0;T==i.length-1?(H=i.join(" "),B=r):(H=i.slice(0,T+1).join(" "),B="...");var Q=t[H];if(!Q)t[H]=B;else if(Q!=B)throw new Error("Inconsistent bindings for "+H)}delete e[n]}for(var X in t)e[X]=t[X];return e}function ii(e,t,n,r){t=na(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ii(e,t.fallthrough,n,r);for(var T=0;T<t.fallthrough.length;T++){var B=ii(e,t.fallthrough[T],n,r);if(B)return B}}}function ss(e){var t=typeof e=="string"?e:Dn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(f?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(f?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(b&&e.keyCode==34&&e.char)return!1;var n=Dn[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ls(n,e,t))}function na(e){return typeof e=="string"?cn[e]:e}function ai(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var T=t(n[i]);r.length&&mt(T.from,J(r).to)<=0;){var B=r.pop();if(mt(B.from,T.from)<0){T.from=B.from;break}}r.push(T)}Mr(e,function(){for(var H=r.length-1;H>=0;H--)ri(e.doc,"",r[H].from,r[H].to,"+delete");Zn(e)})}function Na(e,t,n){var r=Oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ba(e,t,n){var r=Na(e,t.ch,n);return r==null?null:new Ge(t.line,r,n<0?"after":"before")}function Fa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var T=Je(n,t.doc.direction);if(T){var B=i<0?J(T):T[0],H=i<0==(B.level==1),Q=H?"after":"before",X;if(B.level>0||t.doc.direction=="rtl"){var ae=Qn(t,n);X=i<0?n.text.length-1:0;var le=tn(t,ae,X).top;X=Ve(function(Ae){return tn(t,ae,Ae).top==le},i<0==(B.level==1)?B.from:B.to-1,X),Q=="before"&&(X=Na(n,X,1))}else X=i<0?B.to:B.from;return new Ge(r,X,Q)}}return new Ge(r,i<0?n.text.length:0,i<0?"before":"after")}function Pl(e,t,n,r){var i=Je(t,e.doc.direction);if(!i)return Ba(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 T=ze(i,n.ch,n.sticky),B=i[T];if(e.doc.direction=="ltr"&&B.level%2==0&&(r>0?B.to>n.ch:B.from<n.ch))return Ba(t,n,r);var H=function(et,it){return Na(t,et instanceof Ge?et.ch:et,it)},Q,X=function(et){return e.options.lineWrapping?(Q=Q||Qn(e,t),fo(e,t,Q,et)):{begin:0,end:t.text.length}},ae=X(n.sticky=="before"?H(n,-1):n.ch);if(e.doc.direction=="rtl"||B.level==1){var le=B.level==1==r<0,Ae=H(n,le?1:-1);if(Ae!=null&&(le?Ae<=B.to&&Ae<=ae.end:Ae>=B.from&&Ae>=ae.begin)){var Ee=le?"before":"after";return new Ge(n.line,Ae,Ee)}}var Ne=function(et,it,tt){for(var at=function(Ft,sr){return sr?new Ge(n.line,H(Ft,1),"before"):new Ge(n.line,Ft,"after")};et>=0&&et<i.length;et+=it){var ht=i[et],lt=it>0==(ht.level!=1),bt=lt?tt.begin:H(tt.end,-1);if(ht.from<=bt&&bt<ht.to)return at(bt,lt);if(bt=lt?ht.from:H(ht.to,-1),tt.begin<=bt&&bt<tt.end)return at(bt,lt)}},Ke=Ne(T+r,r,ae);if(Ke)return Ke;var Ye=r>0?ae.end:H(ae.begin,-1);return Ye!=null&&!(r>0&&Ye==t.text.length)&&(Ke=Ne(r>0?0:i.length-1,r,X(Ye)),Ke)?Ke:null}var Mi={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return ai(e,function(t){if(t.empty()){var n=ot(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Ge(t.head.line+1,0)}:{from:t.head,to:Ge(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ai(e,function(t){return{from:Ge(t.from().line,0),to:pt(e.doc,Ge(t.to().line+1,0))}})},delLineLeft:function(e){return ai(e,function(t){return{from:Ge(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ai(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return ai(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return cs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},me)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?cs(e,t.head):r},me)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var T=n[i].from(),B=K(e.getLine(T.line),T.ch,r);t.push(pe(r-B%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Mr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,T=ot(e.doc,i.line).text;if(T){if(i.ch==T.length&&(i=new Ge(i.line,i.ch-1)),i.ch>0)i=new Ge(i.line,i.ch+1),e.replaceRange(T.charAt(i.ch-1)+T.charAt(i.ch-2),Ge(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var B=ot(e.doc,i.line-1).text;B&&(i=new Ge(i.line,1),e.replaceRange(T.charAt(0)+e.doc.lineSeparator()+B.charAt(B.length-1),Ge(i.line-1,B.length-1),i,"+transpose"))}}n.push(new Mt(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Mr(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;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Zn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var n=ot(e.doc,t),r=Ur(n);return r!=n&&(t=Dt(r)),Fa(!0,e,r,t,1)}function kl(e,t){var n=ot(e.doc,t),r=Fi(n);return r!=n&&(t=Dt(r)),Fa(!0,e,n,t,-1)}function cs(e,t){var n=ds(e,t.line),r=ot(e.doc,n.line),i=Je(r,e.doc.direction);if(!i||i[0].level==0){var T=Math.max(n.ch,r.text.search(/\S/)),B=t.line==n.line&&t.ch<=T&&t.ch;return Ge(n.line,B?0:T,n.sticky)}return n}function ia(e,t,n){if(typeof t=="string"&&(t=Mi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=xe}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Ul(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=ii(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&ii(t,e.options.extraKeys,n,e)||ii(t,e.options.keyMap,n,e)}var Nl=new Y;function Pi(e,t,n,r){var i=e.state.keySeq;if(i){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fs(e,i+" "+t,n,r))return!0}return fs(e,t,n,r)}function fs(e,t,n,r){var i=Ul(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&dr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Z(n),Aa(e)),!!i}function hs(e,t){var n=us(t,!0);return n?t.shiftKey&&!e.state.keySeq?Pi(e,"Shift-"+n,t,function(r){return ia(e,r,!0)})||Pi(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ia(e,r)}):Pi(e,n,t,function(r){return ia(e,r)}):!1}function Bl(e,t,n){return Pi(e,"'"+n+"'",t,function(r){return ia(e,r,!0)})}var ja=null;function ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=M(),je(t,e))return;F&&U<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=hs(t,e);b&&(ja=r?n:null,!r&&n==88&&!yt&&(d?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),R&&!d&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(h(t,"CodeMirror-crosshair"),Ze(document,"keyup",n),Ze(document,"mouseover",n))}we(document,"keyup",n),we(document,"mouseover",n)}function ps(e){e.keyCode==16&&(this.doc.sel.shift=!1),je(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(dn(t.display,e)||je(t,e)||e.ctrlKey&&!e.altKey||d&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(b&&n==ja){ja=null,Z(e);return}if(b&&(!e.which||e.which<10)&&hs(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Bl(t,e,i))return;t.display.input.onKeyPress(e)}var jl=400,Wa=function(e,t,n){this.time=e,this.pos=t,this.button=n};Wa.prototype.compare=function(e,t,n){return this.time+jl>e&&mt(t,this.pos)==0&&n==this.button};var ki,Ui;function Wl(e,t){var n=+new Date;return Ui&&Ui.compare(n,e,t)?(ki=Ui=null,"triple"):ki&&ki.compare(n,e,t)?(Ui=new Wa(n,e,t),ki=null,"double"):(ki=new Wa(n,e,t),Ui=null,"single")}function vs(e){var t=this,n=t.display;if(je(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,dn(n,e)){P||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ka(t,e))return;var r=Un(t,e),i=_e(e),T=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Kl(t,i,r,T,e))return;i==1?r?Gl(t,r,T,e):fe(e)==n.scroller&&Z(e):i==2?(r&&qi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):yo(t))}function Kl(e,t,n,r,i){var T="Click";return r=="double"?T="Double"+T:r=="triple"&&(T="Triple"+T),T=(t==1?"Left":t==2?"Middle":"Right")+T,Pi(e,ls(T,i),i,function(B){if(typeof B=="string"&&(B=Mi[B]),!B)return!1;var H=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),H=B(e,n)!=xe}finally{e.state.suppressEdits=!1}return H})}function Hl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var T=l?n.shiftKey&&n.metaKey:n.altKey;i.unit=T?"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=d?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(d?n.altKey:n.ctrlKey)),i}function Gl(e,t,n,r){F?setTimeout(L(vo,e),0):e.curOp.focus=M();var i=Hl(e,n,r),T=e.doc.sel,B;e.options.dragDrop&&De&&!e.isReadOnly()&&n=="single"&&(B=T.contains(t))>-1&&(mt((B=T.ranges[B]).from(),t)<0||t.xRel>0)&&(mt(B.to(),t)>0||t.xRel<0)?zl(e,r,t,i):Vl(e,r,t,i)}function zl(e,t,n,r){var i=e.display,T=!1,B=ar(e,function(X){P&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ze(i.wrapper.ownerDocument,"mouseup",B),Ze(i.wrapper.ownerDocument,"mousemove",H),Ze(i.scroller,"dragstart",Q),Ze(i.scroller,"drop",B),T||(Z(X),r.addNew||qi(e.doc,n,null,null,r.extend),P&&!_||F&&U==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),H=function(X){T=T||Math.abs(t.clientX-X.clientX)+Math.abs(t.clientY-X.clientY)>=10},Q=function(){return T=!0};P&&(i.scroller.draggable=!0),e.state.draggingText=B,B.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),we(i.wrapper.ownerDocument,"mouseup",B),we(i.wrapper.ownerDocument,"mousemove",H),we(i.scroller,"dragstart",Q),we(i.scroller,"drop",B),yo(e),setTimeout(function(){return i.input.focus()},20)}function ys(e,t,n){if(n=="char")return new Mt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Mt(Ge(t.line,0),pt(e.doc,Ge(t.line+1,0)));var r=n(e,t);return new Mt(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,T=e.doc;Z(t);var B,H,Q=T.sel,X=Q.ranges;if(r.addNew&&!r.extend?(H=T.sel.contains(n),H>-1?B=X[H]:B=new Mt(n,n)):(B=T.sel.primary(),H=T.sel.primIndex),r.unit=="rectangle")r.addNew||(B=new Mt(n,n)),n=Un(e,t,!0,!0),H=-1;else{var ae=ys(e,n,r.unit);r.extend?B=ka(B,ae.anchor,ae.head,r.extend):B=ae}r.addNew?H==-1?(H=X.length,mr(T,Qr(e,X.concat([B]),H),{scroll:!1,origin:"*mouse"})):X.length>1&&X[H].empty()&&r.unit=="char"&&!r.extend?(mr(T,Qr(e,X.slice(0,H).concat(X.slice(H+1)),0),{scroll:!1,origin:"*mouse"}),Q=T.sel):Ua(T,H,B,ge):(H=0,mr(T,new Br([B],0),ge),Q=T.sel);var le=n;function Ae(tt){if(mt(le,tt)==0)return;if(le=tt,r.unit=="rectangle"){for(var at=[],ht=e.options.tabSize,lt=K(ot(T,n.line).text,n.ch,ht),bt=K(ot(T,tt.line).text,tt.ch,ht),Ft=Math.min(lt,bt),sr=Math.max(lt,bt),Vt=Math.min(n.line,tt.line),Pr=Math.min(e.lastLine(),Math.max(n.line,tt.line));Vt<=Pr;Vt++){var Sr=ot(T,Vt).text,$t=ce(Sr,Ft,ht);Ft==sr?at.push(new Mt(Ge(Vt,$t),Ge(Vt,$t))):Sr.length>$t&&at.push(new Mt(Ge(Vt,$t),Ge(Vt,ce(Sr,sr,ht))))}at.length||at.push(new Mt(n,n)),mr(T,Qr(e,Q.ranges.slice(0,H).concat(at),H),{origin:"*mouse",scroll:!1}),e.scrollIntoView(tt)}else{var Cr=B,cr=ys(e,tt,r.unit),ir=Cr.anchor,er;mt(cr.anchor,ir)>0?(er=cr.head,ir=on(Cr.from(),cr.anchor)):(er=cr.anchor,ir=an(Cr.to(),cr.head));var Qt=Q.ranges.slice(0);Qt[H]=Ql(e,new Mt(pt(T,ir),er)),mr(T,Qr(e,Qt,H),ge)}}var Ee=i.wrapper.getBoundingClientRect(),Ne=0;function Ke(tt){var at=++Ne,ht=Un(e,tt,!0,r.unit=="rectangle");if(!ht)return;if(mt(ht,le)!=0){e.curOp.focus=M(),Ae(ht);var lt=Vi(i,T);(ht.line>=lt.to||ht.line<lt.from)&&setTimeout(ar(e,function(){Ne==at&&Ke(tt)}),150)}else{var bt=tt.clientY<Ee.top?-20:tt.clientY>Ee.bottom?20:0;bt&&setTimeout(ar(e,function(){if(Ne!=at)return;i.scroller.scrollTop+=bt,Ke(tt)}),50)}}function Ye(tt){e.state.selectingText=!1,Ne=Infinity,tt&&(Z(tt),i.input.focus()),Ze(i.wrapper.ownerDocument,"mousemove",et),Ze(i.wrapper.ownerDocument,"mouseup",it),T.history.lastSelOrigin=null}var et=ar(e,function(tt){tt.buttons===0||!_e(tt)?Ye(tt):Ke(tt)}),it=ar(e,Ye);e.state.selectingText=it,we(i.wrapper.ownerDocument,"mousemove",et),we(i.wrapper.ownerDocument,"mouseup",it)}function Ql(e,t){var n=t.anchor,r=t.head,i=ot(e.doc,n.line);if(mt(n,r)==0&&n.sticky==r.sticky)return t;var T=Je(i);if(!T)return t;var B=ze(T,n.ch,n.sticky),H=T[B];if(H.from!=n.ch&&H.to!=n.ch)return t;var Q=B+(H.from==n.ch==(H.level!=1)?0:1);if(Q==0||Q==T.length)return t;var X;if(r.line!=n.line)X=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ae=ze(T,r.ch,r.sticky),le=ae-B||(r.ch-n.ch)*(H.level==1?-1:1);ae==Q-1||ae==Q?X=le<0:X=le>0}var Ae=T[Q+(X?-1:0)],Ee=X==(Ae.level==1),Ne=Ee?Ae.from:Ae.to,Ke=Ee?"after":"before";return n.ch==Ne&&n.sticky==Ke?t:new Mt(new Ge(n.line,Ne,Ke),r)}function Es(e,t,n,r){var i,T;if(t.touches)i=t.touches[0].clientX,T=t.touches[0].clientY;else try{i=t.clientX,T=t.clientY}catch(Ae){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Z(t);var B=e.display,H=B.lineDiv.getBoundingClientRect();if(T>H.bottom||!ue(e,n))return te(t);T-=H.top-B.viewOffset;for(var Q=0;Q<e.display.gutterSpecs.length;++Q){var X=B.gutters.childNodes[Q];if(X&&X.getBoundingClientRect().right>=i){var ae=Lr(e.doc,T),le=e.display.gutterSpecs[Q];return Me(e,n,e,ae,le.className,t),te(t)}}}function Ka(e,t){return Es(e,t,"gutterClick",!0)}function bs(e,t){if(dn(e.display,t)||Yl(e,t))return;if(je(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Yl(e,t){return ue(e,"gutterContextMenu")?Es(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gi(e)}var oi={toString:function(){return"CodeMirror.Init"}},As={},aa={};function Xl(e){var t=e.optionHandlers;function n(r,i,T,B){e.defaults[r]=i,T&&(t[r]=B?function(H,Q,X){X!=oi&&T(H,Q,X)}:T)}e.defineOption=n,e.Init=oi,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ia(r)},!0),n("indentUnit",2,Ia,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Si(r),gi(r),Ar(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var T=[],B=r.doc.first;r.doc.iter(function(Q){for(var X=0;;){var ae=Q.text.indexOf(i,X);if(ae==-1)break;X=ae+i.length,T.push(Ge(B,ae))}B++});for(var H=T.length-1;H>=0;H--)ri(r.doc,i,T[H],Ge(T[H].line,T[H].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,T){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),T!=oi&&r.refresh()}),n("specialCharPlaceholder",Bt,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){xs(r),Ti(r)},!0),n("keyMap","default",function(r,i,T){var B=na(i),H=T!=oi&&na(T);H&&H.detach&&H.detach(r,B),B.attach&&B.attach(r,H||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=_a(i,r.options.lineNumbers),Ti(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?ba(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return qn(r)},!0),n("scrollbarStyle","native",function(r){So(r),qn(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=_a(r.options.gutters,i),Ti(r)},!0),n("firstLineNumber",1,Ti,!0),n("lineNumberFormatter",function(r){return r},Ti,!0),n("showCursorWhenSelecting",!1,vi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Jn(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,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vi,!0),n("singleCursorHeightPerLine",!0,vi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Si,!0),n("addModeClass",!1,Si,!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,Si,!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 Jl(e,t,n){var r=n&&n!=oi;if(!t!=!r){var i=e.display.dragFunctions,T=t?we:Ze;T(e.display.scroller,"dragstart",i.start),T(e.display.scroller,"dragenter",i.enter),T(e.display.scroller,"dragover",i.over),T(e.display.scroller,"dragleave",i.leave),T(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(h(e.display.wrapper,"CodeMirror-wrap"),ji(e)),xa(e),Ar(e),gi(e),setTimeout(function(){return qn(e)},100)}function zt(e,t){var n=this;if(!(this instanceof zt))return new zt(e,t);this.options=t=t?I(t):{},I(As,t,!1);var r=t.value;typeof r=="string"?r=new Tr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new zt.inputStyles[t.inputStyle](this),T=this.display=new dl(e,r,i,t);T.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),So(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 Y,keySeq:null,specialChars:null},t.autofocus&&!s&&T.input.focus(),F&&U<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Ll(),jn(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Jn(this);for(var B in aa)aa.hasOwnProperty(B)&&aa[B](this,t[B],oi);Do(this),t.finishInit&&t.finishInit(this);for(var H=0;H<Ha.length;++H)Ha[H](this);Wn(this),P&&t.lineWrapping&&getComputedStyle(T.lineDiv).textRendering=="optimizelegibility"&&(T.lineDiv.style.textRendering="auto")}zt.defaults=As,zt.optionHandlers=aa;function ql(e){var t=e.display;we(t.scroller,"mousedown",ar(e,vs)),F&&U<11?we(t.scroller,"dblclick",ar(e,function(Q){if(je(e,Q))return;var X=Un(e,Q);if(!X||Ka(e,Q)||dn(e.display,Q))return;Z(Q);var ae=e.findWordAt(X);qi(e.doc,ae.anchor,ae.head)})):we(t.scroller,"dblclick",function(Q){return je(e,Q)||Z(Q)}),we(t.scroller,"contextmenu",function(Q){return bs(e,Q)}),we(t.input.getField(),"contextmenu",function(Q){t.scroller.contains(Q.target)||bs(e,Q)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function T(Q){if(Q.touches.length!=1)return!1;var X=Q.touches[0];return X.radiusX<=1&&X.radiusY<=1}function B(Q,X){if(X.left==null)return!0;var ae=X.left-Q.left,le=X.top-Q.top;return ae*ae+le*le>20*20}we(t.scroller,"touchstart",function(Q){if(!je(e,Q)&&!T(Q)&&!Ka(e,Q)){t.input.ensurePolled(),clearTimeout(n);var X=+new Date;t.activeTouch={start:X,moved:!1,prev:X-r.end<=300?r:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),we(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),we(t.scroller,"touchend",function(Q){var X=t.activeTouch;if(X&&!dn(t,Q)&&X.left!=null&&!X.moved&&new Date-X.start<300){var ae=e.coordsChar(t.activeTouch,"page"),le;!X.prev||B(X,X.prev)?le=new Mt(ae,ae):!X.prev.prev||B(X,X.prev.prev)?le=e.findWordAt(ae):le=new Mt(Ge(ae.line,0),pt(e.doc,Ge(ae.line+1,0))),e.setSelection(le.anchor,le.head),e.focus(),Z(Q)}i()}),we(t.scroller,"touchcancel",i),we(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ei(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),Me(e,"scroll",e))}),we(t.scroller,"mousewheel",function(Q){return _o(e,Q)}),we(t.scroller,"DOMMouseScroll",function(Q){return _o(e,Q)}),we(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){je(e,Q)||se(Q)},over:function(Q){je(e,Q)||(Rl(e,Q),se(Q))},start:function(Q){return Dl(e,Q)},drop:ar(e,wl),leave:function(Q){je(e,Q)||is(e)}};var H=t.input.getField();we(H,"keyup",function(Q){return ps.call(e,Q)}),we(H,"keydown",ar(e,ms)),we(H,"keypress",ar(e,gs)),we(H,"focus",function(Q){return Ta(e,Q)}),we(H,"blur",function(Q){return Jn(e,Q)})}var Ha=[];zt.defineInitHook=function(e){return Ha.push(e)};function Ni(e,t,n,r){var i=e.doc,T;n==null&&(n="add"),n=="smart"&&(i.mode.indent?T=Er(e,t).state:n="prev");var B=e.options.tabSize,H=ot(i,t),Q=K(H.text,null,B);H.stateAfter&&(H.stateAfter=null);var X=H.text.match(/^\s*/)[0],ae;if(!r&&!/\S/.test(H.text))ae=0,n="not";else if(n=="smart"&&(ae=i.mode.indent(T,H.text.slice(X.length),H.text),ae==xe||ae>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?ae=K(ot(i,t-1).text,null,B):ae=0:n=="add"?ae=Q+e.options.indentUnit:n=="subtract"?ae=Q-e.options.indentUnit:typeof n=="number"&&(ae=Q+n),ae=Math.max(0,ae);var le="",Ae=0;if(e.options.indentWithTabs)for(var Ee=Math.floor(ae/B);Ee;--Ee)Ae+=B,le+=" ";if(Ae<ae&&(le+=pe(ae-Ae)),le!=X)return ri(i,le,Ge(t,0),Ge(t,X.length),"+input"),H.stateAfter=null,!0;for(var Ne=0;Ne<i.sel.ranges.length;Ne++){var Ke=i.sel.ranges[Ne];if(Ke.head.line==t&&Ke.head.ch<X.length){var Ye=Ge(t,X.length);Ua(i,Ne,new Mt(Ye,Ye));break}}}var Yr=null;function oa(e){Yr=e}function Ga(e,t,n,r,i){var T=e.doc;e.display.shift=!1,r||(r=T.sel);var B=+new Date-200,H=i=="paste"||e.state.pasteIncoming>B,Q=ft(t),X=null;if(H&&r.ranges.length>1)if(Yr&&Yr.text.join(`
|
|
`)==t){if(r.ranges.length%Yr.text.length==0){X=[];for(var ae=0;ae<Yr.text.length;ae++)X.push(T.splitLines(Yr.text[ae]))}}else Q.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(X=ne(Q,function(et){return[et]}));for(var le=e.curOp.updateInput,Ae=r.ranges.length-1;Ae>=0;Ae--){var Ee=r.ranges[Ae],Ne=Ee.from(),Ke=Ee.to();Ee.empty()&&(n&&n>0?Ne=Ge(Ne.line,Ne.ch-n):e.state.overwrite&&!H?Ke=Ge(Ke.line,Math.min(ot(T,Ke.line).text.length,Ke.ch+J(Q).length)):H&&Yr&&Yr.lineWise&&Yr.text.join(`
|
|
`)==Q.join(`
|
|
`)&&(Ne=Ke=Ge(Ne.line,0)));var Ye={from:Ne,to:Ke,text:X?X[Ae%X.length]:Q,origin:i||(H?"paste":e.state.cutIncoming>B?"cut":"+input")};ti(e.doc,Ye),dr(e,"inputRead",e,Ye)}t&&!H&&Ss(e,t),Zn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=le),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Mr(t,function(){return Ga(t,n,0,null,"paste")}),!0}function Ss(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 T=e.getModeAt(i.head),B=!1;if(T.electricChars){for(var H=0;H<T.electricChars.length;H++)if(t.indexOf(T.electricChars.charAt(H))>-1){B=Ni(e,i.head.line,"smart");break}}else T.electricInput&&(T.electricInput.test(ot(e.doc,i.head.line).text.slice(0,i.head.ch))&&(B=Ni(e,i.head.line,"smart")));B&&dr(e,"electricInput",e,i.head.line)}}function Cs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,T={anchor:Ge(i,0),head:Ge(i+1,0)};n.push(T),t.push(e.getRange(T.anchor,T.head))}return{text:t,ranges:n}}function ws(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ds(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),ws(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var T=this.options,B=T[r];if(T[r]==i&&r!="mode")return;T[r]=i,t.hasOwnProperty(r)&&ar(this,t[r])(this,i,B),Me(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](na(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,T=0;T<i.length;++T)if(i[T]==r||i[T].name==r)return i.splice(T,1),!0},addOverlay:gr(function(r,i){var T=r.token?r:e.getMode(this.options,r);if(T.startState)throw new Error("Overlays may not be stateful.");$(this.state.overlays,{mode:T,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(B){return B.priority}),this.state.modeGen++,Ar(this)}),removeOverlay:gr(function(r){for(var i=this.state.overlays,T=0;T<i.length;++T){var B=i[T].modeSpec;if(B==r||typeof r=="string"&&B.name==r){i.splice(T,1),this.state.modeGen++,Ar(this);return}}}),indentLine:gr(function(r,i,T){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Ht(this.doc,r)&&Ni(this,r,i,T)}),indentSelection:gr(function(r){for(var i=this.doc.sel.ranges,T=-1,B=0;B<i.length;B++){var H=i[B];if(H.empty())H.head.line>T&&(Ni(this,H.head.line,r,!0),T=H.head.line,B==this.doc.sel.primIndex&&Zn(this));else{var Q=H.from(),X=H.to(),ae=Math.max(T,Q.line);T=Math.min(this.lastLine(),X.line-(X.ch?0:1))+1;for(var le=ae;le<T;++le)Ni(this,le,r);var Ae=this.doc.sel.ranges;Q.ch==0&&i.length==Ae.length&&Ae[B].from().ch>0&&Ua(this.doc,B,new Mt(Q,Ae[B].to()),ve)}}}),getTokenAt:function(r,i){return En(this,r,i)},getLineTokens:function(r,i){return En(this,Ge(r),i,!0)},getTokenTypeAt:function(r){r=pt(this.doc,r);var i=Or(this,ot(this.doc,r.line)),T=0,B=(i.length-1)/2,H=r.ch,Q;if(H==0)Q=i[2];else for(;;){var X=T+B>>1;if((X?i[X*2-1]:0)>=H)B=X;else if(i[X*2+1]<H)T=X+1;else{Q=i[X*2+2];break}}var ae=Q?Q.indexOf("overlay "):-1;return ae<0?Q:ae==0?null:Q.slice(0,ae-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var T=[];if(!n.hasOwnProperty(i))return T;var B=n[i],H=this.getModeAt(r);if(typeof H[i]=="string")B[H[i]]&&T.push(B[H[i]]);else if(H[i])for(var Q=0;Q<H[i].length;Q++){var X=B[H[i][Q]];X&&T.push(X)}else H.helperType&&B[H.helperType]?T.push(B[H.helperType]):B[H.name]&&T.push(B[H.name]);for(var ae=0;ae<B._global.length;ae++){var le=B._global[ae];le.pred(H,this)&&ee(T,le.val)==-1&&T.push(le.val)}return T},getStateAfter:function(r,i){var T=this.doc;return r=Zr(T,r==null?T.first+T.size-1:r),Er(this,r+1,i).state},cursorCoords:function(r,i){var T,B=this.doc.sel.primary();return r==null?T=B.head:typeof r=="object"?T=pt(this.doc,r):T=r?B.from():B.to(),Vr(this,T,i||"page")},charCoords:function(r,i){return pa(this,pt(this.doc,r),i||"page")},coordsChar:function(r,i){return r=lo(this,r,i||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,i){return r=lo(this,{top:r,left:0},i||"page").top,Lr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,T){var B=!1,H;if(typeof r=="number"){var Q=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>Q&&(r=Q,B=!0),H=ot(this.doc,r)}else H=r;return Ki(this,H,{top:0,left:0},i||"page",T||B).top+(B?this.doc.height-zr(H):0)},defaultTextHeight:function(){return Yn(this.display)},defaultCharWidth:function(){return Xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,T,B,H){var Q=this.display;r=Vr(this,pt(this.doc,r));var X=r.bottom,ae=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),Q.sizer.appendChild(i),B=="over")X=r.top;else if(B=="above"||B=="near"){var le=Math.max(Q.wrapper.clientHeight,this.doc.height),Ae=Math.max(Q.sizer.clientWidth,Q.lineSpace.clientWidth);(B=="above"||r.bottom+i.offsetHeight>le)&&r.top>i.offsetHeight?X=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=le&&(X=r.bottom),ae+i.offsetWidth>Ae&&(ae=Ae-i.offsetWidth)}i.style.top=X+"px",i.style.left=i.style.right="",H=="right"?(ae=Q.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(H=="left"?ae=0:H=="middle"&&(ae=(Q.sizer.clientWidth-i.offsetWidth)/2),i.style.left=ae+"px"),T&&Js(this,{left:ae,top:X,right:ae+i.offsetWidth,bottom:X+i.offsetHeight})},triggerOnKeyDown:gr(ms),triggerOnKeyPress:gr(gs),triggerOnKeyUp:ps,triggerOnMouseDown:gr(vs),execCommand:function(r){if(Mi.hasOwnProperty(r))return Mi[r].call(null,this)},triggerElectric:gr(function(r){Ss(this,r)}),findPosH:function(r,i,T,B){var H=1;i<0&&(H=-1,i=-i);for(var Q=pt(this.doc,r),X=0;X<i&&!(Q=za(this.doc,Q,H,T,B),Q.hitSide);++X);return Q},moveH:gr(function(r,i){var T=this;this.extendSelectionsBy(function(B){return T.display.shift||T.doc.extend||B.empty()?za(T.doc,B.head,r,i,T.options.rtlMoveVisually):r<0?B.from():B.to()},me)}),deleteH:gr(function(r,i){var T=this.doc.sel,B=this.doc;T.somethingSelected()?B.replaceSelection("",null,"+delete"):ai(this,function(H){var Q=za(B,H.head,r,i,!1);return r<0?{from:Q,to:H.head}:{from:H.head,to:Q}})}),findPosV:function(r,i,T,B){var H=1,Q=B;i<0&&(H=-1,i=-i);for(var X=pt(this.doc,r),ae=0;ae<i;++ae){var le=Vr(this,X,"div");if(Q==null?Q=le.left:le.left=Q,X=Rs(this,le,H,T),X.hitSide)break}return X},moveV:gr(function(r,i){var T=this,B=this.doc,H=[],Q=!this.display.shift&&!B.extend&&B.sel.somethingSelected();if(B.extendSelectionsBy(function(ae){if(Q)return r<0?ae.from():ae.to();var le=Vr(T,ae.head,"div");ae.goalColumn!=null&&(le.left=ae.goalColumn),H.push(le.left);var Ae=Rs(T,le,r,i);return i=="page"&&ae==B.sel.primary()&&Ca(T,pa(T,Ae,"div").top-le.top),Ae},me),H.length)for(var X=0;X<B.sel.ranges.length;X++)B.sel.ranges[X].goalColumn=H[X]}),findWordAt:function(r){var i=this.doc,T=ot(i,r.line).text,B=r.ch,H=r.ch;if(T){var Q=this.getHelper(r,"wordChars");(r.sticky=="before"||H==T.length)&&B?--B:++H;for(var X=T.charAt(B),ae=Pe(X,Q)?function(le){return Pe(le,Q)}:/\s/.test(X)?function(le){return/\s/.test(le)}:function(le){return!/\s/.test(le)&&!Pe(le)};B>0&&ae(T.charAt(B-1));)--B;for(;H<T.length&&ae(T.charAt(H));)++H}return new Mt(Ge(r.line,B),Ge(r.line,H))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):h(this.display.cursorDiv,"CodeMirror-overwrite"),Me(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gr(function(r,i){yi(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-en(this)-this.display.barHeight,width:r.scrollWidth-en(this)-this.display.barWidth,clientHeight:fa(this),clientWidth:Pn(this)}},scrollIntoView:gr(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Ge(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Zs(this,r):bo(this,r.from,r.to,r.margin)}),setSize:gr(function(r,i){var T=this,B=function(Q){return typeof Q=="number"||/^\d+$/.test(String(Q))?Q+"px":Q};r!=null&&(this.display.wrapper.style.width=B(r)),i!=null&&(this.display.wrapper.style.height=B(i)),this.options.lineWrapping&&ao(this);var H=this.display.viewFrom;this.doc.iter(H,this.display.viewTo,function(Q){if(Q.widgets){for(var X=0;X<Q.widgets.length;X++)if(Q.widgets[X].noHScroll){xn(T,H,"widget");break}}++H}),this.curOp.forceUpdate=!0,Me(this,"refresh",this)}),operation:function(r){return Mr(this,r)},startOperation:function(){return jn(this)},endOperation:function(){return Wn(this)},refresh:gr(function(){var r=this.display.cachedTextHeight;Ar(this),this.curOp.forceUpdate=!0,gi(this),yi(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(r==null||Math.abs(r-Yn(this.display))>.5||this.options.lineWrapping)&&xa(this),Me(this,"refresh",this)}),swapDoc:gr(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,r),gi(this),this.display.input.reset(),yi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,dr(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}},de(e),e.registerHelper=function(r,i,T){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=T},e.registerGlobalHelper=function(r,i,T,B){e.registerHelper(r,i,B),n[r]._global.push({pred:T,val:B})}}function za(e,t,n,r,i){var T=t,B=n,H=ot(e,t.line),Q=i&&e.direction=="rtl"?-n:n;function X(){var it=t.line+Q;return it<e.first||it>=e.first+e.size?!1:(t=new Ge(it,t.ch,t.sticky),H=ot(e,it))}function ae(it){var tt;if(r=="codepoint"){var at=H.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(at)?tt=null:tt=new Ge(t.line,Math.max(0,Math.min(H.text.length,t.ch+n*(at>=55296&&at<56320?2:1))),-n)}else i?tt=Pl(e.cm,H,t,n):tt=Ba(H,t,n);if(tt==null)if(!it&&X())t=Fa(i,e.cm,H,t.line,Q);else return!1;else t=tt;return!0}if(r=="char"||r=="codepoint")ae();else if(r=="column")ae(!0);else if(r=="word"||r=="group")for(var le=null,Ae=r=="group",Ee=e.cm&&e.cm.getHelper(t,"wordChars"),Ne=!0;!(n<0&&!ae(!Ne));Ne=!1){var Ke=H.text.charAt(t.ch)||`
|
|
`,Ye=Pe(Ke,Ee)?"w":Ae&&Ke==`
|
|
`?"n":!Ae||/\s/.test(Ke)?null:"p";if(Ae&&!Ne&&!Ye&&(Ye="s"),le&&le!=Ye){n<0&&(n=1,ae(),t.sticky="after");break}if(Ye&&(le=Ye),n>0&&!ae(!Ne))break}var et=ea(e,t,T,B,!0);return Jr(T,et)&&(et.hitSide=!0),et}function Rs(e,t,n,r){var i=e.doc,T=t.left,B;if(r=="page"){var H=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Q=Math.max(H-.5*Yn(e.display),3);B=(n>0?t.bottom:t.top)+n*Q}else r=="line"&&(B=n>0?t.bottom+3:t.top-3);for(var X;!(X=va(e,T,B),!X.outside);){if(n<0?B<=0:B>=i.height){X.hitSide=!0;break}B+=n*5}return X}var Ut=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ut.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;ws(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function T(H){for(var Q=H.target;Q;Q=Q.parentNode){if(Q==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Q.className))break}return!1}we(i,"paste",function(H){if(!T(H)||je(r,H)||Ts(H,r))return;U<=11&&setTimeout(ar(r,function(){return t.updateFromDOM()}),20)}),we(i,"compositionstart",function(H){t.composing={data:H.data,done:!1}}),we(i,"compositionupdate",function(H){t.composing||(t.composing={data:H.data,done:!1})}),we(i,"compositionend",function(H){t.composing&&(H.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(i,"touchstart",function(){return n.forceCompositionEnd()}),we(i,"input",function(){t.composing||t.readFromDOMSoon()});function B(H){if(!T(H)||je(r,H))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()}),H.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var Q=Cs(r);oa({lineWise:!0,text:Q.text}),H.type=="cut"&&r.operation(function(){r.setSelections(Q.ranges,0,ve),r.replaceSelection("",null,"cut")})}else return;if(H.clipboardData){H.clipboardData.clearData();var X=Yr.text.join(`
|
|
`);if(H.clipboardData.setData("Text",X),H.clipboardData.getData("Text")==X){H.preventDefault();return}}var ae=Ds(),le=ae.firstChild;r.display.lineSpace.insertBefore(ae,r.display.lineSpace.firstChild),le.value=Yr.text.join(`
|
|
`);var Ae=document.activeElement;W(le),setTimeout(function(){r.display.lineSpace.removeChild(ae),Ae.focus(),Ae==i&&n.showPrimarySelection()},50)}we(i,"copy",B),we(i,"cut",B)},Ut.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ut.prototype.prepareSelection=function(){var e=po(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ut.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ut.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ut.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){e.removeAllRanges();return}var T=sa(t,e.anchorNode,e.anchorOffset),B=sa(t,e.focusNode,e.focusOffset);if(T&&!T.bad&&B&&!B.bad&&mt(on(T,B),r)==0&&mt(an(T,B),i)==0)return;var H=t.display.view,Q=r.line>=t.display.viewFrom&&Ls(t,r)||{node:H[0].measure.map[2],offset:0},X=i.line<t.display.viewTo&&Ls(t,i);if(!X){var ae=H[H.length-1].measure,le=ae.maps?ae.maps[ae.maps.length-1]:ae.map;X={node:le[le.length-1],offset:le[le.length-2]-le[le.length-3]}}if(!Q||!X){e.removeAllRanges();return}var Ae=e.rangeCount&&e.getRangeAt(0),Ee;try{Ee=p(Q.node,Q.offset,X.offset,X.node)}catch(Ne){}Ee&&(!R&&t.state.focused?(e.collapse(Q.node,Q.offset),Ee.collapsed||(e.removeAllRanges(),e.addRange(Ee))):(e.removeAllRanges(),e.addRange(Ee)),Ae&&e.anchorNode==null?e.addRange(Ae):R&&this.startGracePeriod()),this.rememberSelection()},Ut.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ut.prototype.showMultipleSelections=function(e){u(this.cm.display.cursorDiv,e.cursors),u(this.cm.display.selectionDiv,e.selection)},Ut.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ut.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},Ut.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ut.prototype.blur=function(){this.div.blur()},Ut.prototype.getField=function(){return this.div},Ut.prototype.supportsTouch=function(){return!0},Ut.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Mr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Ut.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ut.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&E&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=sa(t,e.anchorNode,e.anchorOffset),r=sa(t,e.focusNode,e.focusOffset);n&&r&&Mr(t,function(){mr(t.doc,Tn(n,r),ve),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Ut.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Ge(r.line-1,ot(e.doc,r.line-1).length)),i.ch==ot(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=Ge(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var T,B,H;r.line==t.viewFrom||(T=Nn(e,r.line))==0?(B=Dt(t.view[0].line),H=t.view[0].node):(B=Dt(t.view[T].line),H=t.view[T-1].node.nextSibling);var Q=Nn(e,i.line),X,ae;if(Q==t.view.length-1?(X=t.viewTo-1,ae=t.lineDiv.lastChild):(X=Dt(t.view[Q+1].line)-1,ae=t.view[Q+1].node.previousSibling),!H)return!1;for(var le=e.doc.splitLines(tu(e,H,ae,B,X)),Ae=jr(e.doc,Ge(B,0),Ge(X,ot(e.doc,X).text.length));le.length>1&&Ae.length>1;)if(J(le)==J(Ae))le.pop(),Ae.pop(),X--;else if(le[0]==Ae[0])le.shift(),Ae.shift(),B++;else break;for(var Ee=0,Ne=0,Ke=le[0],Ye=Ae[0],et=Math.min(Ke.length,Ye.length);Ee<et&&Ke.charCodeAt(Ee)==Ye.charCodeAt(Ee);)++Ee;for(var it=J(le),tt=J(Ae),at=Math.min(it.length-(le.length==1?Ee:0),tt.length-(Ae.length==1?Ee:0));Ne<at&&it.charCodeAt(it.length-Ne-1)==tt.charCodeAt(tt.length-Ne-1);)++Ne;if(le.length==1&&Ae.length==1&&B==r.line)for(;Ee&&Ee>r.ch&&it.charCodeAt(it.length-Ne-1)==tt.charCodeAt(tt.length-Ne-1);)Ee--,Ne++;le[le.length-1]=it.slice(0,it.length-Ne).replace(/^\u200b+/,""),le[0]=le[0].slice(Ee).replace(/\u200b+$/,"");var ht=Ge(B,Ee),lt=Ge(X,Ae.length?J(Ae).length-Ne:0);if(le.length>1||le[0]||mt(ht,lt))return ri(e.doc,le,ht,lt,"+input"),!0},Ut.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ut.prototype.reset=function(){this.forceCompositionEnd()},Ut.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ut.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)},Ut.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Mr(this.cm,function(){return Ar(e.cm)})},Ut.prototype.setUneditable=function(e){e.contentEditable="false"},Ut.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ar(this.cm,Ga)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ut.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ut.prototype.onContextMenu=function(){},Ut.prototype.resetPosition=function(){},Ut.prototype.needsContentAttribute=!0;function Ls(e,t){var n=ha(e,t.line);if(!n||n.hidden)return null;var r=ot(e.doc,t.line),i=eo(n,r,t.line),T=Je(r,e.doc.direction),B="left";if(T){var H=ze(T,t.ch);B=H%2?"right":"left"}var Q=no(i.map,t.ch,B);return Q.offset=Q.collapse=="right"?Q.end:Q.start,Q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function si(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var T="",B=!1,H=e.doc.lineSeparator(),Q=!1;function X(Ee){return function(Ne){return Ne.id==Ee}}function ae(){B&&(T+=H,Q&&(T+=H),B=Q=!1)}function le(Ee){Ee&&(ae(),T+=Ee)}function Ae(Ee){if(Ee.nodeType==1){var Ne=Ee.getAttribute("cm-text");if(Ne){le(Ne);return}var Ke=Ee.getAttribute("cm-marker"),Ye;if(Ke){var et=e.findMarks(Ge(r,0),Ge(i+1,0),X(+Ke));et.length&&(Ye=et[0].find(0))&&le(jr(e.doc,Ye.from,Ye.to).join(H));return}if(Ee.getAttribute("contenteditable")=="false")return;var it=/^(pre|div|p|li|table|br)$/i.test(Ee.nodeName);if(!/^br$/i.test(Ee.nodeName)&&Ee.textContent.length==0)return;it&&ae();for(var tt=0;tt<Ee.childNodes.length;tt++)Ae(Ee.childNodes[tt]);/^(pre|p)$/i.test(Ee.nodeName)&&(Q=!0),it&&(B=!0)}else Ee.nodeType==3&&le(Ee.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ae(t),t==n);)t=t.nextSibling,Q=!1;return T}function sa(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return si(e.clipPos(Ge(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var T=e.display.view[i];if(T.node==r)return ru(T,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!x(r,t))return si(Ge(Dt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var T=e.rest?J(e.rest):e.line;return si(Ge(Dt(T),T.text.length),i)}var B=t.nodeType==3?t:null,H=t;for(!B&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(B=t.firstChild,n&&(n=B.nodeValue.length));H.parentNode!=r;)H=H.parentNode;var Q=e.measure,X=Q.maps;function ae(Ye,et,it){for(var tt=-1;tt<(X?X.length:0);tt++)for(var at=tt<0?Q.map:X[tt],ht=0;ht<at.length;ht+=3){var lt=at[ht+2];if(lt==Ye||lt==et){var bt=Dt(tt<0?e.line:e.rest[tt]),Ft=at[ht]+it;return(it<0||lt!=Ye)&&(Ft=at[ht+(it?1:0)]),Ge(bt,Ft)}}}var le=ae(B,H,n);if(le)return si(le,i);for(var Ae=H.nextSibling,Ee=B?B.nodeValue.length-n:0;Ae;Ae=Ae.nextSibling){if(le=ae(Ae,Ae.firstChild,0),le)return si(Ge(le.line,le.ch-Ee),i);Ee+=Ae.textContent.length}for(var Ne=H.previousSibling,Ke=n;Ne;Ne=Ne.previousSibling){if(le=ae(Ne,Ne.firstChild,-1),le)return si(Ge(le.line,le.ch+Ke),i);Ke+=Ne.textContent.length}}var Jt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};Jt.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),we(i,"input",function(){F&&U>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),we(i,"paste",function(B){if(je(r,B)||Ts(B,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function T(B){if(je(r,B))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var H=Cs(r);oa({lineWise:!0,text:H.text}),B.type=="cut"?r.setSelections(H.ranges,null,ve):(n.prevInput="",i.value=H.text.join(`
|
|
`),W(i))}else return;B.type=="cut"&&(r.state.cutIncoming=+new Date)}we(i,"cut",T),we(i,"copy",T),we(e.scroller,"paste",function(B){if(dn(e,B)||je(r,B))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var H=new Event("paste");H.clipboardData=B.clipboardData,i.dispatchEvent(H)}),we(e.lineSpace,"selectstart",function(B){dn(e,B)||Z(B)}),we(i,"compositionstart",function(){var B=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:B,range:r.markText(B,r.getCursor("to"),{className:"CodeMirror-composing"})}}),we(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Jt.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},Jt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Jt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=po(e);if(e.options.moveInputWithCursor){var i=Vr(e,n.sel.primary().head,"div"),T=t.wrapper.getBoundingClientRect(),B=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+B.top-T.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+B.left-T.left))}return r},Jt.prototype.showSelection=function(e){var t=this.cm,n=t.display;u(n.cursorDiv,e.cursors),u(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Jt.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&&W(this.textarea),F&&U>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",F&&U>=9&&(this.hasSelection=null))},Jt.prototype.getField=function(){return this.textarea},Jt.prototype.supportsTouch=function(){return!1},Jt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Jt.prototype.blur=function(){this.textarea.blur()},Jt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Jt.prototype.receivedFocus=function(){this.slowPoll()},Jt.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()})},Jt.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)},Jt.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ke(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&&U>=9&&this.hasSelection===i||d&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var T=i.charCodeAt(0);if(T==8203&&!r&&(r="\u200B"),T==8666)return this.reset(),this.cm.execCommand("undo")}for(var B=0,H=Math.min(r.length,i.length);B<H&&r.charCodeAt(B)==i.charCodeAt(B);)++B;return Mr(t,function(){Ga(t,i.slice(B),r.length-B,null,e.composing?"*compose":null),i.length>1e3||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},Jt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Jt.prototype.onKeyPress=function(){F&&U>=9&&(this.hasSelection=null),this.fastPoll()},Jt.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var T=Un(n,e),B=r.scroller.scrollTop;if(!T||b)return;var H=n.options.resetSelectionOnContextMenu;H&&n.doc.sel.contains(T)==-1&&ar(n,mr)(n.doc,Tn(T),ve);var Q=i.style.cssText,X=t.wrapper.style.cssText,ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ae.top-5)+"px; left: "+(e.clientX-ae.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 le;P&&(le=window.scrollY),r.input.focus(),P&&window.scrollTo(null,le),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Ee,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Ae(){if(i.selectionStart!=null){var Ke=n.somethingSelected(),Ye="\u200B"+(Ke?i.value:"");i.value="\u21DA",i.value=Ye,t.prevInput=Ke?"":"\u200B",i.selectionStart=1,i.selectionEnd=Ye.length,r.selForContextMenu=n.doc.sel}}function Ee(){if(t.contextMenuPending!=Ee)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=X,i.style.cssText=Q,F&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=B),i.selectionStart!=null){(!F||F&&U<9)&&Ae();var Ke=0,Ye=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?ar(n,Qo)(n):Ke++<10?r.detectingSelectAll=setTimeout(Ye,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ye,200)}}if(F&&U>=9&&Ae(),w){se(e);var Ne=function(){Ze(window,"mouseup",Ne),setTimeout(Ee,20)};we(window,"mouseup",Ne)}else setTimeout(Ee,50)},Jt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Jt.prototype.setUneditable=function(){},Jt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?I(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=M();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=H.getValue()}var i;if(e.form&&(we(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var T=e.form;i=T.submit;try{var B=T.submit=function(){r(),T.submit=i,T.submit(),T.submit=B}}catch(Q){}}t.finishInit=function(Q){Q.save=r,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,r(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var H=zt(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return H}function iu(e){e.off=Ze,e.on=we,e.wheelEventPixels=cl,e.Doc=Tr,e.splitLines=ft,e.countColumn=K,e.findColumn=ce,e.isWordChar=Se,e.Pass=xe,e.signal=Me,e.Line=Mn,e.changeEnd=Sn,e.scrollbarModel=To,e.Pos=Ge,e.cmpPos=mt,e.modes=Yt,e.mimeModes=Ct,e.resolveMode=yr,e.getMode=Rr,e.modeExtensions=fr,e.extendMode=Xr,e.copyState=Fr,e.startState=mn,e.innerMode=hn,e.commands=Mi,e.keyMap=cn,e.keyName=us,e.isModifierKey=ss,e.lookupKey=ii,e.normalizeKeyMap=Ml,e.StringStream=Kt,e.SharedTextMarker=_i,e.TextMarker=wn,e.LineWidget=Li,e.e_preventDefault=Z,e.e_stopPropagation=q,e.e_stop=se,e.addClass=N,e.contains=x,e.rmClass=h,e.keyNames=Dn}Xl(zt),$l(zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Tr.prototype)Tr.prototype.hasOwnProperty(la)&&ee(au,la)<0&&(zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tr.prototype[la]));return de(Tr),zt.inputStyles={textarea:Jt,contenteditable:Ut},zt.defineMode=function(e){!zt.defaults.mode&&e!="null"&&(zt.defaults.mode=e),Dr.apply(this,arguments)},zt.defineMIME=Kr,zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),zt.defineMIME("text/plain","null"),zt.defineExtension=function(e,t){zt.prototype[e]=t},zt.defineDocExtension=function(e,t){Tr.prototype[e]=t},zt.fromTextArea=nu,iu(zt),zt.version="5.58.2",zt})},W6BS:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKt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OctSk+NqtYDNzU3W1tfpdbvm2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Fe,Le,z){Fe.exports=z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Fe,Le,z){"use strict";z.r(Le),z.d(Le,"ResizableTextArea",function(){return ee});var re=z("wx14"),V=z("1OyB"),R=z("vuIU"),G=z("Ji7U"),k=z("LK+K"),O=z("cDcd"),F=z("VTBJ"),U=z("rePB"),P=z("Zm9Q"),D=z("Kwbf"),E=z("c+Xe"),b=z("m+aA"),_=z("bdgK"),C=new Map;function A(ve){ve.forEach(function(ge){var me,ce=ge.target;(me=C.get(ce))===null||me===void 0||me.forEach(function(ie){return ie(ce)})})}var v=new _.default(A),c=null,s=null;function d(ve,ge){C.has(ve)||(C.set(ve,new Set),v.observe(ve)),C.get(ve).add(ge)}function l(ve,ge){C.has(ve)&&(C.get(ve).delete(ge),C.get(ve).size||(v.unobserve(ve),C.delete(ve)))}var S=function(ve){Object(G.a)(me,ve);var ge=Object(k.a)(me);function me(){return Object(V.a)(this,me),ge.apply(this,arguments)}return Object(R.a)(me,[{key:"render",value:function(){return this.props.children}}]),me}(O.Component),m=O.createContext(null);function f(ve){var ge=ve.children,me=ve.onBatchResize,ce=O.useRef(0),ie=O.useRef([]),pe=O.useContext(m),J=O.useCallback(function(ne,$,be){ce.current+=1;var Te=ce.current;ie.current.push({size:ne,element:$,data:be}),Promise.resolve().then(function(){Te===ce.current&&(me==null||me(ie.current),ie.current=[])}),pe==null||pe(ne,$,be)},[me,pe]);return O.createElement(m.Provider,{value:J},ge)}function w(ve){var ge=ve.children,me=ve.disabled,ce=O.useRef(null),ie=O.useRef(null),pe=O.useContext(m),J=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ne=O.isValidElement(ge)&&Object(E.c)(ge),$=ne?ge.ref:null,be=O.useMemo(function(){return Object(E.a)($,ce)},[$,ce]),Te=O.useRef(ve);Te.current=ve;var ye=O.useCallback(function(Se){var Pe=Te.current,Ie=Pe.onResize,Ue=Pe.data,Re=Se.getBoundingClientRect(),Oe=Re.width,Ve=Re.height,qe=Se.offsetWidth,He=Se.offsetHeight,ze=Math.floor(Oe),nt=Math.floor(Ve);if(J.current.width!==ze||J.current.height!==nt||J.current.offsetWidth!==qe||J.current.offsetHeight!==He){var Je={width:ze,height:nt,offsetWidth:qe,offsetHeight:He};J.current=Je;var $e=qe===Math.round(Oe)?Oe:qe,we=He===Math.round(Ve)?Ve:He,rt=Object(F.a)(Object(F.a)({},Je),{},{offsetWidth:$e,offsetHeight:we});pe==null||pe(rt,Se,Ue),Ie&&Promise.resolve().then(function(){Ie(rt,Se)})}},[]);return O.useEffect(function(){var Se=Object(b.a)(ce.current)||Object(b.a)(ie.current);return Se&&!me&&d(Se,ye),function(){return l(Se,ye)}},[ce.current,me]),O.createElement(S,{ref:ie},ne?O.cloneElement(ge,{ref:be}):ge)}var g="rc-observer-key";function h(ve){var ge=ve.children,me=Object(P.a)(ge);return me.map(function(ce,ie){var pe=(ce==null?void 0:ce.key)||"".concat(g,"-").concat(ie);return O.createElement(w,Object(re.a)({},ve,{key:pe}),ce)})}h.Collection=f;var a=h,u=z("bT9E"),o=z("TSYQ"),y=z.n(o),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
|
|
`,x=["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"],M={},N;function j(ve){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(ge&&M[me])return M[me];var ce=window.getComputedStyle(ve),ie=ce.getPropertyValue("box-sizing")||ce.getPropertyValue("-moz-box-sizing")||ce.getPropertyValue("-webkit-box-sizing"),pe=parseFloat(ce.getPropertyValue("padding-bottom"))+parseFloat(ce.getPropertyValue("padding-top")),J=parseFloat(ce.getPropertyValue("border-bottom-width"))+parseFloat(ce.getPropertyValue("border-top-width")),ne=x.map(function(be){return"".concat(be,":").concat(ce.getPropertyValue(be))}).join(";"),$={sizingStyle:ne,paddingSize:pe,borderSize:J,boxSizing:ie};return ge&&me&&(M[me]=$),$}function W(ve){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ce=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),ve.getAttribute("wrap")?N.setAttribute("wrap",ve.getAttribute("wrap")):N.removeAttribute("wrap");var ie=j(ve,ge),pe=ie.paddingSize,J=ie.borderSize,ne=ie.boxSizing,$=ie.sizingStyle;N.setAttribute("style","".concat($,";").concat(p)),N.value=ve.value||ve.placeholder||"";var be=Number.MIN_SAFE_INTEGER,Te=Number.MAX_SAFE_INTEGER,ye=N.scrollHeight,Se;if(ne==="border-box"?ye+=J:ne==="content-box"&&(ye-=pe),me!==null||ce!==null){N.value=" ";var Pe=N.scrollHeight-pe;me!==null&&(be=Pe*me,ne==="border-box"&&(be=be+pe+J),ye=Math.max(be,ye)),ce!==null&&(Te=Pe*ce,ne==="border-box"&&(Te=Te+pe+J),Se=ye>Te?"":"hidden",ye=Math.min(Te,ye))}return{height:ye,minHeight:be,maxHeight:Te,overflowY:Se,resize:"none"}}var L=z("Gytx"),I=z.n(L),K;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(K||(K={}));var Y=function(ve){Object(G.a)(me,ve);var ge=Object(k.a)(me);function me(ce){var ie;return Object(V.a)(this,me),ie=ge.call(this,ce),ie.nextFrameActionId=void 0,ie.resizeFrameId=void 0,ie.textArea=void 0,ie.saveTextArea=function(pe){ie.textArea=pe},ie.handleResize=function(pe){var J=ie.state.resizeStatus,ne=ie.props,$=ne.autoSize,be=ne.onResize;if(J!==K.NONE)return;typeof be=="function"&&be(pe),$&&ie.resizeOnNextFrame()},ie.resizeOnNextFrame=function(){cancelAnimationFrame(ie.nextFrameActionId),ie.nextFrameActionId=requestAnimationFrame(ie.resizeTextarea)},ie.resizeTextarea=function(){var pe=ie.props.autoSize;if(!pe||!ie.textArea)return;var J=pe.minRows,ne=pe.maxRows,$=W(ie.textArea,!1,J,ne);ie.setState({textareaStyles:$,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(ie.resizeFrameId),ie.resizeFrameId=requestAnimationFrame(function(){ie.setState({resizeStatus:K.RESIZED},function(){ie.resizeFrameId=requestAnimationFrame(function(){ie.setState({resizeStatus:K.NONE}),ie.fixFirefoxAutoScroll()})})})})},ie.renderTextArea=function(){var pe=ie.props,J=pe.prefixCls,ne=J===void 0?"rc-textarea":J,$=pe.autoSize,be=pe.onResize,Te=pe.className,ye=pe.disabled,Se=ie.state,Pe=Se.textareaStyles,Ie=Se.resizeStatus,Ue=Object(u.a)(ie.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Re=y()(ne,Te,Object(U.a)({},"".concat(ne,"-disabled"),ye));"value"in Ue&&(Ue.value=Ue.value||"");var Oe=Object(F.a)(Object(F.a)(Object(F.a)({},ie.props.style),Pe),Ie===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(a,{onResize:ie.handleResize,disabled:!($||be)},O.createElement("textarea",Object(re.a)({},Ue,{className:Re,style:Oe,ref:ie.saveTextArea})))},ie.state={textareaStyles:{},resizeStatus:K.NONE},ie}return Object(R.a)(me,[{key:"componentDidUpdate",value:function(ie){(ie.value!==this.props.value||!I()(ie.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 ie=this.textArea.selectionStart,pe=this.textArea.selectionEnd;this.textArea.setSelectionRange(ie,pe)}}catch(J){}}},{key:"render",value:function(){return this.renderTextArea()}}]),me}(O.Component),ee=Y,oe=function(ve){Object(G.a)(me,ve);var ge=Object(k.a)(me);function me(ce){var ie;Object(V.a)(this,me),ie=ge.call(this,ce),ie.resizableTextArea=void 0,ie.focus=function(){ie.resizableTextArea.textArea.focus()},ie.saveTextArea=function(J){ie.resizableTextArea=J},ie.handleChange=function(J){var ne=ie.props.onChange;ie.setValue(J.target.value,function(){ie.resizableTextArea.resizeTextarea()}),ne&&ne(J)},ie.handleKeyDown=function(J){var ne=ie.props,$=ne.onPressEnter,be=ne.onKeyDown;J.keyCode===13&&$&&$(J),be&&be(J)};var pe=typeof ce.value=="undefined"||ce.value===null?ce.defaultValue:ce.value;return ie.state={value:pe},ie}return Object(R.a)(me,[{key:"setValue",value:function(ie,pe){"value"in this.props||this.setState({value:ie},pe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(ee,Object(re.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ie){return"value"in ie?{value:ie.value}:null}}]),me}(O.Component),xe=Le.default=oe},ZW9T:function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return m});var re=z("k1fw"),V=z("miYZ"),R=z("tsqr"),G=z("rAM+"),k=z("tJVT"),O=z("PpiC"),F=z("cDcd"),U=z.n(F),P=z("bdgK");function D(f,w,g,h,a){var u=w.getWordUntilPosition(g),o={startLineNumber:g.lineNumber,endLineNumber:g.lineNumber,startColumn:u.startColumn,endColumn:u.endColumn},y=h.map(function(p){return{label:p,kind:f.languages.CompletionItemKind.Keyword,insertText:p,insertTextRules:f.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}});return a.map(function(p){y.push(Object(re.a)(Object(re.a)({},p),{},{range:o}))}),y}var E=function(f){var w={label:"ifelse",kind:f.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:f.languages.CompletionItemInsertTextRule.InsertAsSnippet},g=["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"];f.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(o,y){var p=D(f,o,y,g,[w]);return{suggestions:p}}});var h=["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"];f.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(o,y){var p=[{label:"print",kind:f.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:f.languages.CompletionItemInsertTextRule.InsertAsSnippet}],x=D(f,o,y,h,p);return{suggestions:x}}});var a=["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"];f.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(o,y){var p=[w,{label:"main",kind:f.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:f.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:f.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:f.languages.CompletionItemInsertTextRule.InsertAsSnippet}],x=D(f,o,y,a,p);return{suggestions:x}}})},b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=z("LvDl"),C=z("+ua5");function A(f){return/^\d+$/.test(f)?"".concat(f,"px"):f}function v(){}var c=!1,s={"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 d(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],w=f;if(Array.isArray(f)){for(var g=0;g<f.length;g++){var h=s[f[g]];if(h)return h}return w[0]}return s[w]||w}var l=null,S=Le.b=function(f){var w=f.width,g=w===void 0?"100%":w,h=f.height,a=h===void 0?"100%":h,u=f.value,o=f.language,y=o===void 0?"javascript":o,p=f.style,x=p===void 0?{}:p,M=f.options,N=M===void 0?{}:M,j=f.overrideServices,W=j===void 0?{}:j,L=f.theme,I=L===void 0?"vs-dark":L,K=f.onEditBlur,Y=f.onSave,ee=f.autoHeight,oe=ee===void 0?!1:ee,xe=f.forbidCopy,ve=xe===void 0?!1:xe,ge=f.onChange,me=ge===void 0?v:ge,ce=f.editorDidMount,ie=ce===void 0?v:ce,pe=f.onFocus,J=pe===void 0?v:pe,ne=f.filename,$=ne===void 0?"educoder.txt":ne,be=f.errorLine,Te=f.errorContent,ye=Te===void 0?"":Te,Se=Object(O.a)(f,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Pe=Object(F.useRef)(),Ie=Object(F.useRef)({}),Ue=Object(F.useRef)(),Re=Object(F.useRef)(!1),Oe=Object(F.useRef)(),Ve=Object(F.useState)(!1),qe=Object(k.a)(Ve,2),He=qe[0],ze=qe[1];function nt(){var De;return Pe.current&&(De=new P.default(function(We){var Xe=Object(G.a)(We),Ce;try{for(Xe.s();!(Ce=Xe.n()).done;){var vt=Ce.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&Ie.current.instance.layout()}}catch(ft){Xe.e(ft)}finally{Xe.f()}}),De.observe(Pe.current)),De}function Je(){R.b.warn(decodeURIComponent(b))}var $e=function(){var We=Ie.current.instance;if(u!=null&&We&&He){var Xe=We.getModel();Xe&&u!==Xe.getValue()&&(c=!0,Xe.setValue(u),We.layout(),c=!1)}};Object(F.useEffect)(function(){Ue.current&&clearTimeout(Ue.current),Ue.current=setTimeout(function(){$e()},500)},[u,He,Ie.current]),Object(F.useEffect)(function(){if(be&&Ie.current&&Ie.current.instance){var De=Ie.current.instance;De.changeViewZones(function(Xe){var Ce=document.createElement("div");Ce.style.padding="10px 20px",Ce.style.width="calc(100% - 20px)",Ce.className="my-error-line-wrp",Ce.innerHTML=ye,Xe.addZone({afterLineNumber:be||11,heightInLines:3,domNode:Ce})});var We={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};De.addOverlayWidget(We),De.revealPositionInCenter({lineNumber:20,column:1})}},[be,Ie.current,He]);function we(){var De=Ie.current.instance;if(De){var We=De.getSelection(),Xe=Ie.current.pastePos||{},Ce=new l.Range(Xe.startLineNumber||We.endLineNumber,Xe.startColumn||We.endColumn,Xe.endLineNumber||We.endLineNumber,Xe.endColumn||We.endColumn);setTimeout(function(){De.executeEdits("",[{range:Ce,text:""}])},300)}}function rt(De){(window.navigator.platform.match("Mac")?De.metaKey:De.ctrlKey)&&De.keyCode==83&&(De.preventDefault(),Y())}var Ze=function(){if(oe&&Ie.current.instance){var We=Ie.current.instance.getContentHeight();fe(We<a?a:We)}else fe(a)};function Me(De){var We=document.createEvent("MouseEvents");We.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),De.dispatchEvent(We)}function je(De,We){var Xe=window.URL||window.webkitURL||window,Ce=new Blob([We]),vt=document.createElementNS("http://www.w3.org/1999/xhtml","a");vt.href=Xe.createObjectURL(Ce),vt.download=De,Me(vt)}Object(F.useEffect)(function(){Ze()},[Ze]),Object(F.useEffect)(function(){Pe.current&&!He&&z.e(27).then(z.t.bind(null,"M/lh",7)).then(function(De){try{l=De,Ie.current.instance=l.editor.create(Pe.current,{value:u,language:d(y),theme:I,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},W);var We=Ie.current.instance;if(ie(We,l),setTimeout(function(){Ze(),Ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){je($||"educoder.txt",We.getValue())}})},500),Ie.current.subscription=We.onDidChangeModelContent(function(Ce){Re.current?clearTimeout(Oe.current):(Ze(),me(We.getValue(),Ce)),Oe.current=setTimeout(function(){Re.current=!1},500)}),window.Monaco||E(l),ve&&(We.addCommand(l.KeyMod.CtrlCmd|l.KeyMod.Shift|l.KeyCode.KEY_V,function(){return Je(),null}),We.addCommand(l.KeyMod.CtrlCmd|l.KeyCode.KEY_C,function(){return Je(),null})),window.Monaco=l,K&&We.onDidBlurEditorWidget(function(){K(We.getValue())}),J&&We.onDidFocusEditorText(function(){J(We.getValue())}),ve){We.addCommand(l.KeyMod.CtrlCmd|l.KeyCode.KEY_V,function(){return Je(),null}),We.onDidPaste(function(Ce){Ie.current.pastePos=Ce});try{window.addEventListener("paste",we)}catch(Ce){}}var Xe=nt();return ze(!0),function(){var Ce=Ie.current.instance;Ce.dispose();var vt=Ce.getModel();vt&&vt.dispose(),Ie.current.subscription&&Ie.current.subscription.dispose(),ve&&window.removeEventListener("paste",we),Xe.unobserve(Pe.current)}}catch(Ce){}})},[]),Object(F.useEffect)(function(){var De=Ie.current.instance;if(De&&He)return document.addEventListener("keydown",rt,!1),function(){document.removeEventListener("keydown",rt)}},[Y,He]),Object(F.useEffect)(function(){var De=Ie.current.instance;if(De&&He){var We=d(y);l.editor.setModelLanguage(De.getModel(),We),console.log("language:",y,De.getModel(),We)}},[y,He]),Object(F.useEffect)(function(){var De=Ie.current.instance;De&&He&&l.editor.setTheme(I)},[I,He]),Object(F.useEffect)(function(){var De=Ie.current.instance;De&&He&&(De.updateOptions(Object(re.a)({},N)),setTimeout(function(){De.getModel().updateOptions(Object(re.a)({},N))},200))},[JSON.stringify(N),He]),Object(F.useEffect)(function(){var De=Ie.current.instance;De&&He&&De.layout()},[g,a,He]);var he=Object(F.useState)(A(g)),ue=Object(k.a)(he,2),de=ue[0],Z=ue[1],q=Object(F.useState)(A(a)),te=Object(k.a)(q,2),se=te[0],fe=te[1],_e=Object(re.a)(Object(re.a)({},x),{},{width:de,height:se});return U.a.createElement("div",{className:"my-monaco-editor",ref:Pe,style:_e})};function m(f){var w=f.width,g=w===void 0?"100%":w,h=f.height,a=h===void 0?"100%":h,u=f.original,o=f.modified,y=f.language,p=f.options,x=p===void 0?{}:p,M=Object(F.useRef)(),N=Object(F.useState)(null),j=Object(k.a)(N,2),W=j[0],L=j[1];function I(oe){var xe;return M.current&&(xe=new P.default(function(ve){var ge=Object(G.a)(ve),me;try{for(ge.s();!(me=ge.n()).done;){var ce=me.value;(ce.target.offsetHeight>0||ce.target.offsetWidth>0)&&oe.layout()}}catch(ie){ge.e(ie)}finally{ge.f()}}),xe.observe(M.current)),xe}Object(F.useEffect)(function(){M.current&&z.e(27).then(z.t.bind(null,"M/lh",7)).then(function(oe){l=oe;var xe=l.editor.createDiffEditor(M.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},x),{},{wordWrap:!0}));L(xe);var ve=I(xe);return function(){xe.dispose();var ge=xe.getModel();ge&&ge.dispose(),ve.unobserve(M.current)}})},[]),Object(F.useEffect)(function(){W&&W.setModel({original:l.editor.createModel(u,y),modified:l.editor.createModel(o,y)})},[u,o,y,W]);var K=A(g),Y=A(a),ee={width:K,height:Y};return U.a.createElement("div",{className:"my-diff-editor",ref:M,style:ee})}},ZpRC:function(Fe,Le,z){"use strict";function re(E){return typeof E=="object"&&E!=null&&E.nodeType===1}function V(E,b){return(!b||E!=="hidden")&&E!=="visible"&&E!=="clip"}function R(E,b){if(E.clientHeight<E.scrollHeight||E.clientWidth<E.scrollWidth){var _=getComputedStyle(E,null);return V(_.overflowY,b)||V(_.overflowX,b)||function(C){var A=function(v){if(!v.ownerDocument||!v.ownerDocument.defaultView)return null;try{return v.ownerDocument.defaultView.frameElement}catch(c){return null}}(C);return!!A&&(A.clientHeight<C.scrollHeight||A.clientWidth<C.scrollWidth)}(E)}return!1}function G(E,b,_,C,A,v,c,s){return v<E&&c>b||v>E&&c<b?0:v<=E&&s<=_||c>=b&&s>=_?v-E-C:c>b&&s<_||v<E&&s>_?c-b+A:0}var k=function(E,b){var _=window,C=b.scrollMode,A=b.block,v=b.inline,c=b.boundary,s=b.skipOverflowHiddenElements,d=typeof c=="function"?c:function(Pe){return Pe!==c};if(!re(E))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,S=[],m=E;re(m)&&d(m);){if((m=m.parentElement)===l){S.push(m);break}m!=null&&m===document.body&&R(m)&&!R(document.documentElement)||m!=null&&R(m,s)&&S.push(m)}for(var f=_.visualViewport?_.visualViewport.width:innerWidth,w=_.visualViewport?_.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,a=E.getBoundingClientRect(),u=a.height,o=a.width,y=a.top,p=a.right,x=a.bottom,M=a.left,N=A==="start"||A==="nearest"?y:A==="end"?x:y+u/2,j=v==="center"?M+o/2:v==="end"?p:M,W=[],L=0;L<S.length;L++){var I=S[L],K=I.getBoundingClientRect(),Y=K.height,ee=K.width,oe=K.top,xe=K.right,ve=K.bottom,ge=K.left;if(C==="if-needed"&&y>=0&&M>=0&&x<=w&&p<=f&&y>=oe&&x<=ve&&M>=ge&&p<=xe)return W;var me=getComputedStyle(I),ce=parseInt(me.borderLeftWidth,10),ie=parseInt(me.borderTopWidth,10),pe=parseInt(me.borderRightWidth,10),J=parseInt(me.borderBottomWidth,10),ne=0,$=0,be="offsetWidth"in I?I.offsetWidth-I.clientWidth-ce-pe:0,Te="offsetHeight"in I?I.offsetHeight-I.clientHeight-ie-J:0;if(l===I)ne=A==="start"?N:A==="end"?N-w:A==="nearest"?G(h,h+w,w,ie,J,h+N,h+N+u,u):N-w/2,$=v==="start"?j:v==="center"?j-f/2:v==="end"?j-f:G(g,g+f,f,ce,pe,g+j,g+j+o,o),ne=Math.max(0,ne+h),$=Math.max(0,$+g);else{ne=A==="start"?N-oe-ie:A==="end"?N-ve+J+Te:A==="nearest"?G(oe,ve,Y,ie,J+Te,N,N+u,u):N-(oe+Y/2)+Te/2,$=v==="start"?j-ge-ce:v==="center"?j-(ge+ee/2)+be/2:v==="end"?j-xe+pe+be:G(ge,xe,ee,ce,pe+be,j,j+o,o);var ye=I.scrollLeft,Se=I.scrollTop;N+=Se-(ne=Math.max(0,Math.min(Se+ne,I.scrollHeight-Y+Te))),j+=ye-($=Math.max(0,Math.min(ye+$,I.scrollWidth-ee+be)))}W.push({el:I,top:ne,left:$})}return W};function O(E){return E===Object(E)&&Object.keys(E).length!==0}function F(E,b){b===void 0&&(b="auto");var _="scrollBehavior"in document.body.style;E.forEach(function(C){var A=C.el,v=C.top,c=C.left;A.scroll&&_?A.scroll({top:v,left:c,behavior:b}):(A.scrollTop=v,A.scrollLeft=c)})}function U(E){return E===!1?{block:"end",inline:"nearest"}:O(E)?E:{block:"start",inline:"nearest"}}function P(E,b){var _=!E.ownerDocument.documentElement.contains(E);if(O(b)&&typeof b.behavior=="function")return b.behavior(_?[]:k(E,b));if(_)return;var C=U(b);return F(k(E,C),C.behavior)}var D=Le.a=P},Zss7:function(Fe,Le,z){var re;(function(V){var R=/^\s+/,G=/\s+$/,k=0,O=V.round,F=V.min,U=V.max,P=V.random;function D(J,ne){if(J=J||"",ne=ne||{},J instanceof D)return J;if(!(this instanceof D))return new D(J,ne);var $=E(J);this._originalInput=J,this._r=$.r,this._g=$.g,this._b=$.b,this._a=$.a,this._roundA=O(100*this._a)/100,this._format=ne.format||$.format,this._gradientType=ne.gradientType,this._r<1&&(this._r=O(this._r)),this._g<1&&(this._g=O(this._g)),this._b<1&&(this._b=O(this._b)),this._ok=$.ok,this._tc_id=k++}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var J=this.toRgb();return(J.r*299+J.g*587+J.b*114)/1e3},getLuminance:function(){var J=this.toRgb(),ne,$,be,Te,ye,Se;return ne=J.r/255,$=J.g/255,be=J.b/255,ne<=.03928?Te=ne/12.92:Te=V.pow((ne+.055)/1.055,2.4),$<=.03928?ye=$/12.92:ye=V.pow(($+.055)/1.055,2.4),be<=.03928?Se=be/12.92:Se=V.pow((be+.055)/1.055,2.4),.2126*Te+.7152*ye+.0722*Se},setAlpha:function(J){return this._a=W(J),this._roundA=O(100*this._a)/100,this},toHsv:function(){var J=A(this._r,this._g,this._b);return{h:J.h*360,s:J.s,v:J.v,a:this._a}},toHsvString:function(){var J=A(this._r,this._g,this._b),ne=O(J.h*360),$=O(J.s*100),be=O(J.v*100);return this._a==1?"hsv("+ne+", "+$+"%, "+be+"%)":"hsva("+ne+", "+$+"%, "+be+"%, "+this._roundA+")"},toHsl:function(){var J=_(this._r,this._g,this._b);return{h:J.h*360,s:J.s,l:J.l,a:this._a}},toHslString:function(){var J=_(this._r,this._g,this._b),ne=O(J.h*360),$=O(J.s*100),be=O(J.l*100);return this._a==1?"hsl("+ne+", "+$+"%, "+be+"%)":"hsla("+ne+", "+$+"%, "+be+"%, "+this._roundA+")"},toHex:function(J){return c(this._r,this._g,this._b,J)},toHexString:function(J){return"#"+this.toHex(J)},toHex8:function(J){return s(this._r,this._g,this._b,this._a,J)},toHex8String:function(J){return"#"+this.toHex8(J)},toRgb:function(){return{r:O(this._r),g:O(this._g),b:O(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+O(this._r)+", "+O(this._g)+", "+O(this._b)+")":"rgba("+O(this._r)+", "+O(this._g)+", "+O(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:O(L(this._r,255)*100)+"%",g:O(L(this._g,255)*100)+"%",b:O(L(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+O(L(this._r,255)*100)+"%, "+O(L(this._g,255)*100)+"%, "+O(L(this._b,255)*100)+"%)":"rgba("+O(L(this._r,255)*100)+"%, "+O(L(this._g,255)*100)+"%, "+O(L(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(J){var ne="#"+d(this._r,this._g,this._b,this._a),$=ne,be=this._gradientType?"GradientType = 1, ":"";if(J){var Te=D(J);$="#"+d(Te._r,Te._g,Te._b,Te._a)}return"progid:DXImageTransform.Microsoft.gradient("+be+"startColorstr="+ne+",endColorstr="+$+")"},toString:function(J){var ne=!!J;J=J||this._format;var $=!1,be=this._a<1&&this._a>=0,Te=!ne&&be&&(J==="hex"||J==="hex6"||J==="hex3"||J==="hex4"||J==="hex8"||J==="name");return Te?J==="name"&&this._a===0?this.toName():this.toRgbString():(J==="rgb"&&($=this.toRgbString()),J==="prgb"&&($=this.toPercentageRgbString()),(J==="hex"||J==="hex6")&&($=this.toHexString()),J==="hex3"&&($=this.toHexString(!0)),J==="hex4"&&($=this.toHex8String(!0)),J==="hex8"&&($=this.toHex8String()),J==="name"&&($=this.toName()),J==="hsl"&&($=this.toHslString()),J==="hsv"&&($=this.toHsvString()),$||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(J,ne){var $=J.apply(null,[this].concat([].slice.call(ne)));return this._r=$._r,this._g=$._g,this._b=$._b,this.setAlpha($._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(g,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(S,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(h,arguments)},_applyCombination:function(J,ne){return J.apply(null,[this].concat([].slice.call(ne)))},analogous:function(){return this._applyCombination(p,arguments)},complement:function(){return this._applyCombination(a,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(u,arguments)},tetrad:function(){return this._applyCombination(o,arguments)}},D.fromRatio=function(J,ne){if(typeof J=="object"){var $={};for(var be in J)J.hasOwnProperty(be)&&(be==="a"?$[be]=J[be]:$[be]=xe(J[be]));J=$}return D(J,ne)};function E(J){var ne={r:0,g:0,b:0},$=1,be=null,Te=null,ye=null,Se=!1,Pe=!1;return typeof J=="string"&&(J=ie(J)),typeof J=="object"&&(ce(J.r)&&ce(J.g)&&ce(J.b)?(ne=b(J.r,J.g,J.b),Se=!0,Pe=String(J.r).substr(-1)==="%"?"prgb":"rgb"):ce(J.h)&&ce(J.s)&&ce(J.v)?(be=xe(J.s),Te=xe(J.v),ne=v(J.h,be,Te),Se=!0,Pe="hsv"):ce(J.h)&&ce(J.s)&&ce(J.l)&&(be=xe(J.s),ye=xe(J.l),ne=C(J.h,be,ye),Se=!0,Pe="hsl"),J.hasOwnProperty("a")&&($=J.a)),$=W($),{ok:Se,format:J.format||Pe,r:F(255,U(ne.r,0)),g:F(255,U(ne.g,0)),b:F(255,U(ne.b,0)),a:$}}function b(J,ne,$){return{r:L(J,255)*255,g:L(ne,255)*255,b:L($,255)*255}}function _(J,ne,$){J=L(J,255),ne=L(ne,255),$=L($,255);var be=U(J,ne,$),Te=F(J,ne,$),ye,Se,Pe=(be+Te)/2;if(be==Te)ye=Se=0;else{var Ie=be-Te;Se=Pe>.5?Ie/(2-be-Te):Ie/(be+Te);switch(be){case J:ye=(ne-$)/Ie+(ne<$?6:0);break;case ne:ye=($-J)/Ie+2;break;case $:ye=(J-ne)/Ie+4;break}ye/=6}return{h:ye,s:Se,l:Pe}}function C(J,ne,$){var be,Te,ye;J=L(J,360),ne=L(ne,100),$=L($,100);function Se(Ue,Re,Oe){return Oe<0&&(Oe+=1),Oe>1&&(Oe-=1),Oe<1/6?Ue+(Re-Ue)*6*Oe:Oe<1/2?Re:Oe<2/3?Ue+(Re-Ue)*(2/3-Oe)*6:Ue}if(ne===0)be=Te=ye=$;else{var Pe=$<.5?$*(1+ne):$+ne-$*ne,Ie=2*$-Pe;be=Se(Ie,Pe,J+1/3),Te=Se(Ie,Pe,J),ye=Se(Ie,Pe,J-1/3)}return{r:be*255,g:Te*255,b:ye*255}}function A(J,ne,$){J=L(J,255),ne=L(ne,255),$=L($,255);var be=U(J,ne,$),Te=F(J,ne,$),ye,Se,Pe=be,Ie=be-Te;if(Se=be===0?0:Ie/be,be==Te)ye=0;else{switch(be){case J:ye=(ne-$)/Ie+(ne<$?6:0);break;case ne:ye=($-J)/Ie+2;break;case $:ye=(J-ne)/Ie+4;break}ye/=6}return{h:ye,s:Se,v:Pe}}function v(J,ne,$){J=L(J,360)*6,ne=L(ne,100),$=L($,100);var be=V.floor(J),Te=J-be,ye=$*(1-ne),Se=$*(1-Te*ne),Pe=$*(1-(1-Te)*ne),Ie=be%6,Ue=[$,Se,ye,ye,Pe,$][Ie],Re=[Pe,$,$,Se,ye,ye][Ie],Oe=[ye,ye,Pe,$,$,Se][Ie];return{r:Ue*255,g:Re*255,b:Oe*255}}function c(J,ne,$,be){var Te=[oe(O(J).toString(16)),oe(O(ne).toString(16)),oe(O($).toString(16))];return be&&Te[0].charAt(0)==Te[0].charAt(1)&&Te[1].charAt(0)==Te[1].charAt(1)&&Te[2].charAt(0)==Te[2].charAt(1)?Te[0].charAt(0)+Te[1].charAt(0)+Te[2].charAt(0):Te.join("")}function s(J,ne,$,be,Te){var ye=[oe(O(J).toString(16)),oe(O(ne).toString(16)),oe(O($).toString(16)),oe(ve(be))];return Te&&ye[0].charAt(0)==ye[0].charAt(1)&&ye[1].charAt(0)==ye[1].charAt(1)&&ye[2].charAt(0)==ye[2].charAt(1)&&ye[3].charAt(0)==ye[3].charAt(1)?ye[0].charAt(0)+ye[1].charAt(0)+ye[2].charAt(0)+ye[3].charAt(0):ye.join("")}function d(J,ne,$,be){var Te=[oe(ve(be)),oe(O(J).toString(16)),oe(O(ne).toString(16)),oe(O($).toString(16))];return Te.join("")}D.equals=function(J,ne){return!J||!ne?!1:D(J).toRgbString()==D(ne).toRgbString()},D.random=function(){return D.fromRatio({r:P(),g:P(),b:P()})};function l(J,ne){ne=ne===0?0:ne||10;var $=D(J).toHsl();return $.s-=ne/100,$.s=I($.s),D($)}function S(J,ne){ne=ne===0?0:ne||10;var $=D(J).toHsl();return $.s+=ne/100,$.s=I($.s),D($)}function m(J){return D(J).desaturate(100)}function f(J,ne){ne=ne===0?0:ne||10;var $=D(J).toHsl();return $.l+=ne/100,$.l=I($.l),D($)}function w(J,ne){ne=ne===0?0:ne||10;var $=D(J).toRgb();return $.r=U(0,F(255,$.r-O(255*-(ne/100)))),$.g=U(0,F(255,$.g-O(255*-(ne/100)))),$.b=U(0,F(255,$.b-O(255*-(ne/100)))),D($)}function g(J,ne){ne=ne===0?0:ne||10;var $=D(J).toHsl();return $.l-=ne/100,$.l=I($.l),D($)}function h(J,ne){var $=D(J).toHsl(),be=($.h+ne)%360;return $.h=be<0?360+be:be,D($)}function a(J){var ne=D(J).toHsl();return ne.h=(ne.h+180)%360,D(ne)}function u(J){var ne=D(J).toHsl(),$=ne.h;return[D(J),D({h:($+120)%360,s:ne.s,l:ne.l}),D({h:($+240)%360,s:ne.s,l:ne.l})]}function o(J){var ne=D(J).toHsl(),$=ne.h;return[D(J),D({h:($+90)%360,s:ne.s,l:ne.l}),D({h:($+180)%360,s:ne.s,l:ne.l}),D({h:($+270)%360,s:ne.s,l:ne.l})]}function y(J){var ne=D(J).toHsl(),$=ne.h;return[D(J),D({h:($+72)%360,s:ne.s,l:ne.l}),D({h:($+216)%360,s:ne.s,l:ne.l})]}function p(J,ne,$){ne=ne||6,$=$||30;var be=D(J).toHsl(),Te=360/$,ye=[D(J)];for(be.h=(be.h-(Te*ne>>1)+720)%360;--ne;)be.h=(be.h+Te)%360,ye.push(D(be));return ye}function x(J,ne){ne=ne||6;for(var $=D(J).toHsv(),be=$.h,Te=$.s,ye=$.v,Se=[],Pe=1/ne;ne--;)Se.push(D({h:be,s:Te,v:ye})),ye=(ye+Pe)%1;return Se}D.mix=function(J,ne,$){$=$===0?0:$||50;var be=D(J).toRgb(),Te=D(ne).toRgb(),ye=$/100,Se={r:(Te.r-be.r)*ye+be.r,g:(Te.g-be.g)*ye+be.g,b:(Te.b-be.b)*ye+be.b,a:(Te.a-be.a)*ye+be.a};return D(Se)},D.readability=function(J,ne){var $=D(J),be=D(ne);return(V.max($.getLuminance(),be.getLuminance())+.05)/(V.min($.getLuminance(),be.getLuminance())+.05)},D.isReadable=function(J,ne,$){var be=D.readability(J,ne),Te,ye;ye=!1,Te=pe($);switch(Te.level+Te.size){case"AAsmall":case"AAAlarge":ye=be>=4.5;break;case"AAlarge":ye=be>=3;break;case"AAAsmall":ye=be>=7;break}return ye},D.mostReadable=function(J,ne,$){var be=null,Te=0,ye,Se,Pe,Ie;$=$||{},Se=$.includeFallbackColors,Pe=$.level,Ie=$.size;for(var Ue=0;Ue<ne.length;Ue++)ye=D.readability(J,ne[Ue]),ye>Te&&(Te=ye,be=D(ne[Ue]));return D.isReadable(J,be,{level:Pe,size:Ie})||!Se?be:($.includeFallbackColors=!1,D.mostReadable(J,["#fff","#000"],$))};var M=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=D.hexNames=j(M);function j(J){var ne={};for(var $ in J)J.hasOwnProperty($)&&(ne[J[$]]=$);return ne}function W(J){return J=parseFloat(J),(isNaN(J)||J<0||J>1)&&(J=1),J}function L(J,ne){Y(J)&&(J="100%");var $=ee(J);return J=F(ne,U(0,parseFloat(J))),$&&(J=parseInt(J*ne,10)/100),V.abs(J-ne)<1e-6?1:J%ne/parseFloat(ne)}function I(J){return F(1,U(0,J))}function K(J){return parseInt(J,16)}function Y(J){return typeof J=="string"&&J.indexOf(".")!=-1&&parseFloat(J)===1}function ee(J){return typeof J=="string"&&J.indexOf("%")!=-1}function oe(J){return J.length==1?"0"+J:""+J}function xe(J){return J<=1&&(J=J*100+"%"),J}function ve(J){return V.round(parseFloat(J)*255).toString(16)}function ge(J){return K(J)/255}var me=function(){var J="[-\\+]?\\d+%?",ne="[-\\+]?\\d*\\.\\d+%?",$="(?:"+ne+")|(?:"+J+")",be="[\\s|\\(]+("+$+")[,|\\s]+("+$+")[,|\\s]+("+$+")\\s*\\)?",Te="[\\s|\\(]+("+$+")[,|\\s]+("+$+")[,|\\s]+("+$+")[,|\\s]+("+$+")\\s*\\)?";return{CSS_UNIT:new RegExp($),rgb:new RegExp("rgb"+be),rgba:new RegExp("rgba"+Te),hsl:new RegExp("hsl"+be),hsla:new RegExp("hsla"+Te),hsv:new RegExp("hsv"+be),hsva:new RegExp("hsva"+Te),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ce(J){return!!me.CSS_UNIT.exec(J)}function ie(J){J=J.replace(R,"").replace(G,"").toLowerCase();var ne=!1;if(M[J])J=M[J],ne=!0;else if(J=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var $;return($=me.rgb.exec(J))?{r:$[1],g:$[2],b:$[3]}:($=me.rgba.exec(J))?{r:$[1],g:$[2],b:$[3],a:$[4]}:($=me.hsl.exec(J))?{h:$[1],s:$[2],l:$[3]}:($=me.hsla.exec(J))?{h:$[1],s:$[2],l:$[3],a:$[4]}:($=me.hsv.exec(J))?{h:$[1],s:$[2],v:$[3]}:($=me.hsva.exec(J))?{h:$[1],s:$[2],v:$[3],a:$[4]}:($=me.hex8.exec(J))?{r:K($[1]),g:K($[2]),b:K($[3]),a:ge($[4]),format:ne?"name":"hex8"}:($=me.hex6.exec(J))?{r:K($[1]),g:K($[2]),b:K($[3]),format:ne?"name":"hex"}:($=me.hex4.exec(J))?{r:K($[1]+""+$[1]),g:K($[2]+""+$[2]),b:K($[3]+""+$[3]),a:ge($[4]+""+$[4]),format:ne?"name":"hex8"}:($=me.hex3.exec(J))?{r:K($[1]+""+$[1]),g:K($[2]+""+$[2]),b:K($[3]+""+$[3]),format:ne?"name":"hex"}:!1}function pe(J){var ne,$;return J=J||{level:"AA",size:"small"},ne=(J.level||"AA").toUpperCase(),$=(J.size||"small").toLowerCase(),ne!=="AA"&&ne!=="AAA"&&(ne="AA"),$!=="small"&&$!=="large"&&($="small"),{level:ne,size:$}}Fe.exports?Fe.exports=D:!(re=function(){return D}.call(Le,z,Le,Fe),re!==void 0&&(Fe.exports=re))})(Math)},bT9E:function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return V});var re=z("VTBJ");function V(R,G){var k=Object(re.a)({},R);return Array.isArray(G)&&G.forEach(function(O){delete k[O]}),k}},c5Ni:function(Fe,Le,z){},cRFk:function(Fe,Le,z){Fe.exports=z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Fe,Le,z){Fe.exports=z.p+"static/choose.4ad1045f.svg"},dejd:function(Fe,Le,z){},djh8:function(Fe,Le,z){Fe.exports=z.p+"static/qrCode.42927872.png"},dmUQ:function(Fe,Le,z){"use strict";var re=z("Ff2n"),V=z("rePB"),R=z("1OyB"),G=z("vuIU"),k=z("Ji7U"),O=z("md7G"),F=z("foSv"),U=z("cDcd"),P=z.n(U),D=z("TSYQ"),E=z.n(D),b=z("4IlW");function _(u,o){var y=Object.keys(u);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(u);o&&(p=p.filter(function(x){return Object.getOwnPropertyDescriptor(u,x).enumerable})),y.push.apply(y,p)}return y}function C(u){for(var o=1;o<arguments.length;o++){var y=arguments[o]!=null?arguments[o]:{};o%2?_(Object(y),!0).forEach(function(p){Object(V.a)(u,p,y[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(y)):_(Object(y)).forEach(function(p){Object.defineProperty(u,p,Object.getOwnPropertyDescriptor(y,p))})}return u}function A(u){var o=v();return function(){var p=Object(F.a)(u),x;if(o){var M=Object(F.a)(this).constructor;x=Reflect.construct(p,arguments,M)}else x=p.apply(this,arguments);return Object(O.a)(this,x)}}function v(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function c(){}function s(u){u.preventDefault()}var d=function(o){return o.replace(/[^\w.-]+/g,"")},l=200,S=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,f=function(o){return o!=null},w=function(o,y){return y===o||typeof y=="number"&&typeof o=="number"&&isNaN(y)&&isNaN(o)},g=function(u){Object(k.a)(y,u);var o=A(y);function y(p){var x;Object(R.a)(this,y),x=o.call(this,p),x.onKeyDown=function(j){var W=x.props,L=W.onKeyDown,I=W.onPressEnter;if(j.keyCode===b.a.UP){var K=x.getRatio(j);x.up(j,K,null),x.stop()}else if(j.keyCode===b.a.DOWN){var Y=x.getRatio(j);x.down(j,Y,null),x.stop()}else j.keyCode===b.a.ENTER&&I&&I(j);if(x.recordCursorPosition(),x.lastKeyCode=j.keyCode,L){for(var ee=arguments.length,oe=new Array(ee>1?ee-1:0),xe=1;xe<ee;xe++)oe[xe-1]=arguments[xe];L.apply(void 0,[j].concat(oe))}},x.onKeyUp=function(j){var W=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),W){for(var L=arguments.length,I=new Array(L>1?L-1:0),K=1;K<L;K++)I[K-1]=arguments[K];W.apply(void 0,[j].concat(I))}},x.onChange=function(j){var W=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(j)),x.setState({inputValue:x.rawInput}),W(x.toNumber(x.rawInput))},x.onMouseUp=function(){var j=x.props.onMouseUp;x.recordCursorPosition(),j&&j.apply(void 0,arguments)},x.onFocus=function(){var j;x.setState({focused:!0}),(j=x.props).onFocus.apply(j,arguments)},x.onBlur=function(){var j=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var W=x.getCurrentValidValue(x.state.inputValue),L=x.setValue(W,c);if(j){var I=x.input.value,K=x.getInputDisplayValue({focus:!1,value:L});x.input.value=K&&Number(K),j.apply(void 0,arguments),x.input.value=I}},x.getRatio=function(j){var W=1;return j.metaKey||j.ctrlKey?W=.1:j.shiftKey&&(W=10),W},x.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},x.getPrecision=function(j){if(f(x.props.precision))return x.props.precision;var W=String(j);if(W.indexOf("e-")>=0)return parseInt(W.slice(W.indexOf("e-")+2),10);var L=0;return W.indexOf(".")>=0&&(L=W.length-W.indexOf(".")-1),L},x.getInputDisplayValue=function(j){var W=j||x.state,L=W.focused,I=W.inputValue,K=W.value,Y;L?Y=I:Y=x.toPrecisionAsStep(K),Y==null&&(Y="");var ee=x.formatWrapper(Y);return f(x.props.decimalSeparator)&&(ee=ee.toString().replace(".",x.props.decimalSeparator)),ee},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(j){}},x.restoreByAfter=function(j){if(j===void 0)return!1;var W=x.input.value,L=W.lastIndexOf(j);if(L===-1)return!1;var I=x.cursorBefore.length;return x.lastKeyCode===b.a.DELETE&&x.cursorBefore.charAt(I-1)===j[0]?(x.fixCaret(I,I),!0):L+j.length===W.length?(x.fixCaret(L,L),!0):!1},x.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(W,L){var I=j.substring(L);return x.restoreByAfter(I)})},x.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(j,W,L){x.pressingUpOrDown=!0,x.step("down",j,W,L)},x.up=function(j,W,L){x.pressingUpOrDown=!0,x.step("up",j,W,L)},x.saveInput=function(j){x.input=j};var M=p.value;M===void 0&&(M=p.defaultValue),x.state={focused:p.autoFocus};var N=x.getValidValue(x.toNumber(M));return x.state=C(C({},x.state),{},{inputValue:x.toPrecisionAsStep(N),value:N}),x}return Object(G.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var M=this.props,N=M.value,j=M.onChange,W=M.max,L=M.min,I=this.state.focused;if(x){if(!w(x.value,N)||!w(x.max,W)||!w(x.min,L)){var K=I?N:this.getValidValue(N),Y;this.pressingUpOrDown?Y=K:this.inputting?Y=this.rawInput:Y=this.toPrecisionAsStep(K),this.setState({value:K,inputValue:Y})}var ee="value"in this.props?N:this.state.value;"max"in this.props&&x.max!==W&&typeof ee=="number"&&ee>W&&j&&j(W),"min"in this.props&&x.min!==L&&typeof ee=="number"&&ee<L&&j&&j(L)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var oe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===b.a.BACKSPACE?oe=this.cursorStart-1:this.lastKeyCode===b.a.DELETE&&(oe=this.cursorStart):oe=this.input.value.length,this.fixCaret(oe,oe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case b.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case b.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(xe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(x){var M=x;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(x){var M=x.target.value.trim().replace(/。/g,".");return f(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(x){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(x);return isNaN(j)?x:(j<M&&(j=M),j>N&&(j=N),j)}},{key:"setValue",value:function(x,M){var N=this.props.precision,j=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),W=this.state.value,L=W===void 0?null:W,I=this.state.inputValue,K=I===void 0?null:I,Y=typeof j=="number"?j.toFixed(N):"".concat(j),ee=j!==L||Y!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},M)):this.setState({value:j,inputValue:this.toPrecisionAsStep(x)},M),ee&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(x){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,j=N.precision,W=N.step;if(f(j))return j;var L=this.getPrecision(M),I=this.getPrecision(W),K=this.getPrecision(x);return x?Math.max(K,L+I):L+I}},{key:"getPrecisionFactor",value:function(x){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(x,M);return Math.pow(10,N)}},{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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var M=Math.abs(this.getMaxPrecision(x));return isNaN(M)?x.toString():Number(x).toFixed(M)}},{key:"toNumber",value:function(x){var M=this.props.precision,N=this.state.focused,j=x&&x.length>16&&N;return this.isNotCompleteNumber(x)||j?x:f(M)?Math.round(x*Math.pow(10,M))/Math.pow(10,M):Number(x)}},{key:"upStep",value:function(x,M){var N=this.props.step,j=this.getPrecisionFactor(x,M),W=Math.abs(this.getMaxPrecision(x,M)),L=((j*x+j*N*M)/j).toFixed(W);return this.toNumber(L)}},{key:"downStep",value:function(x,M){var N=this.props.step,j=this.getPrecisionFactor(x,M),W=Math.abs(this.getMaxPrecision(x,M)),L=((j*x-j*N*M)/j).toFixed(W);return this.toNumber(L)}},{key:"step",value:function(x,M){var N=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,W=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var L=this.props;if(L.disabled)return;var I=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(I))return;var K=this["".concat(x,"Step")](I,j),Y=K>L.max||K<L.min;if(K>L.max?K=L.max:K<L.min&&(K=L.min),this.setValue(K,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),Y)return;this.autoStepTimer=setTimeout(function(){N[x](M,j,!0)},W?l:S)}},{key:"fixCaret",value:function(x,M){if(x===void 0||M===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,j=this.input.selectionEnd;(x!==N||M!==j)&&this.input.setSelectionRange(x,M)}catch(W){}}},{key:"render",value:function(){var x,M=this.props,N=M.prefixCls,j=M.disabled,W=M.readOnly,L=M.useTouch,I=M.autoComplete,K=M.upHandler,Y=M.downHandler,ee=M.className,oe=M.max,xe=M.min,ve=M.style,ge=M.title,me=M.onMouseEnter,ce=M.onMouseLeave,ie=M.onMouseOver,pe=M.onMouseOut,J=M.required,ne=M.onClick,$=M.tabIndex,be=M.type,Te=M.placeholder,ye=M.id,Se=M.inputMode,Pe=M.pattern,Ie=M.step,Ue=M.maxLength,Re=M.autoFocus,Oe=M.name,Ve=M.onPaste,qe=M.onInput,He=Object(re.a)(M,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ze=this.state,nt=ze.value,Je=ze.focused,$e=E()(N,(x={},Object(V.a)(x,ee,!!ee),Object(V.a)(x,"".concat(N,"-disabled"),j),Object(V.a)(x,"".concat(N,"-focused"),Je),x)),we={};Object.keys(He).forEach(function(se){(se.substr(0,5)==="data-"||se.substr(0,5)==="aria-"||se==="role")&&(we[se]=He[se])});var rt=!W&&!j,Ze=this.getInputDisplayValue(null),Me=(nt||nt===0)&&(isNaN(nt)||Number(nt)>=oe),je=(nt||nt===0)&&(isNaN(nt)||Number(nt)<=xe),he=Me||j||W,ue=je||j||W,de=E()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(V.a)({},"".concat(N,"-handler-up-disabled"),he)),Z=E()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(V.a)({},"".concat(N,"-handler-down-disabled"),ue)),q=L?{onTouchStart:he?c:this.up,onTouchEnd:this.stop}:{onMouseDown:he?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},te=L?{onTouchStart:ue?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ue?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:$e,style:ve,title:ge,onMouseEnter:me,onMouseLeave:ce,onMouseOver:ie,onMouseOut:pe,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(N,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Increase Value","aria-disabled":he,className:de}),K||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:s})),P.a.createElement("span",Object.assign({unselectable:"on"},te,{role:"button","aria-label":"Decrease Value","aria-disabled":ue,className:Z}),Y||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:s}))),P.a.createElement("div",{className:"".concat(N,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":xe,"aria-valuemax":oe,"aria-valuenow":nt,required:J,type:be,placeholder:Te,onPaste:Ve,onClick:ne,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:$,autoComplete:I,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:rt?this.onKeyDown:c,onKeyUp:rt?this.onKeyUp:c,autoFocus:Re,maxLength:Ue,readOnly:W,disabled:j,max:oe,min:xe,step:Ie,name:Oe,title:ge,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:Pe,inputMode:Se,onInput:qe},we))))}}]),y}(P.a.Component);g.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:d,required:!1,autoComplete:"off"};var h=g,a=Le.a=h},h78n:function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return x});var re=z("cDcd"),V=z.n(re),R=z("TSYQ"),G=z.n(R),k={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},O=function(j){var W=j.map(function(){return Object(re.useRef)()}),L=Object(re.useRef)();return Object(re.useEffect)(function(){var I=Date.now(),K=!1;Object.keys(W).forEach(function(Y){var ee=W[Y].current;if(!ee)return;K=!0;var oe=ee.style;oe.transitionDuration=".3s, .3s, .3s, .06s",L.current&&I-L.current<100&&(oe.transitionDuration="0s, 0s")}),K&&(L.current=Date.now())}),[W]};function F(){return F=Object.assign||function(N){for(var j=1;j<arguments.length;j++){var W=arguments[j];for(var L in W)Object.prototype.hasOwnProperty.call(W,L)&&(N[L]=W[L])}return N},F.apply(this,arguments)}function U(N,j){return _(N)||b(N,j)||D(N,j)||P()}function P(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(N,j){if(!N)return;if(typeof N=="string")return E(N,j);var W=Object.prototype.toString.call(N).slice(8,-1);if(W==="Object"&&N.constructor&&(W=N.constructor.name),W==="Map"||W==="Set")return Array.from(N);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return E(N,j)}function E(N,j){(j==null||j>N.length)&&(j=N.length);for(var W=0,L=new Array(j);W<j;W++)L[W]=N[W];return L}function b(N,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var W=[],L=!0,I=!1,K=void 0;try{for(var Y=N[Symbol.iterator](),ee;!(L=(ee=Y.next()).done)&&!(W.push(ee.value),j&&W.length===j);L=!0);}catch(oe){I=!0,K=oe}finally{try{!L&&Y.return!=null&&Y.return()}finally{if(I)throw K}}return W}function _(N){if(Array.isArray(N))return N}function C(N,j){if(N==null)return{};var W=A(N,j),L,I;if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(N);for(I=0;I<K.length;I++){if(L=K[I],j.indexOf(L)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,L))continue;W[L]=N[L]}}return W}function A(N,j){if(N==null)return{};var W={},L=Object.keys(N),I,K;for(K=0;K<L.length;K++){if(I=L[K],j.indexOf(I)>=0)continue;W[I]=N[I]}return W}var v=function(j){var W=j.className,L=j.percent,I=j.prefixCls,K=j.strokeColor,Y=j.strokeLinecap,ee=j.strokeWidth,oe=j.style,xe=j.trailColor,ve=j.trailWidth,ge=j.transition,me=C(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete me.gapPosition;var ce=Array.isArray(L)?L:[L],ie=Array.isArray(K)?K:[K],pe=O(ce),J=U(pe,1),ne=J[0],$=ee/2,be=100-ee/2,Te="M ".concat(Y==="round"?$:0,",").concat($,`
|
|
L `).concat(Y==="round"?be:100,",").concat($),ye="0 0 100 ".concat(ee),Se=0;return V.a.createElement("svg",F({className:G()("".concat(I,"-line"),W),viewBox:ye,preserveAspectRatio:"none",style:oe},me),V.a.createElement("path",{className:"".concat(I,"-line-trail"),d:Te,strokeLinecap:Y,stroke:xe,strokeWidth:ve||ee,fillOpacity:"0"}),ce.map(function(Pe,Ie){var Ue={strokeDasharray:"".concat(Pe,"px, 100px"),strokeDashoffset:"-".concat(Se,"px"),transition:ge||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Re=ie[Ie]||ie[ie.length-1];return Se+=Pe,V.a.createElement("path",{key:Ie,className:"".concat(I,"-line-path"),d:Te,strokeLinecap:Y,stroke:Re,strokeWidth:ee,fillOpacity:"0",ref:ne[Ie],style:Ue})}))};v.defaultProps=k;var c=v;function s(){return s=Object.assign||function(N){for(var j=1;j<arguments.length;j++){var W=arguments[j];for(var L in W)Object.prototype.hasOwnProperty.call(W,L)&&(N[L]=W[L])}return N},s.apply(this,arguments)}function d(N,j){return w(N)||f(N,j)||S(N,j)||l()}function l(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(N,j){if(!N)return;if(typeof N=="string")return m(N,j);var W=Object.prototype.toString.call(N).slice(8,-1);if(W==="Object"&&N.constructor&&(W=N.constructor.name),W==="Map"||W==="Set")return Array.from(N);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return m(N,j)}function m(N,j){(j==null||j>N.length)&&(j=N.length);for(var W=0,L=new Array(j);W<j;W++)L[W]=N[W];return L}function f(N,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var W=[],L=!0,I=!1,K=void 0;try{for(var Y=N[Symbol.iterator](),ee;!(L=(ee=Y.next()).done)&&!(W.push(ee.value),j&&W.length===j);L=!0);}catch(oe){I=!0,K=oe}finally{try{!L&&Y.return!=null&&Y.return()}finally{if(I)throw K}}return W}function w(N){if(Array.isArray(N))return N}function g(N,j){if(N==null)return{};var W=h(N,j),L,I;if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(N);for(I=0;I<K.length;I++){if(L=K[I],j.indexOf(L)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,L))continue;W[L]=N[L]}}return W}function h(N,j){if(N==null)return{};var W={},L=Object.keys(N),I,K;for(K=0;K<L.length;K++){if(I=L[K],j.indexOf(I)>=0)continue;W[I]=N[I]}return W}var a=0;function u(N){return+N.replace("%","")}function o(N){return Array.isArray(N)?N:[N]}function y(N,j,W,L){var I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,K=arguments.length>5?arguments[5]:void 0,Y=50-L/2,ee=0,oe=-Y,xe=0,ve=-2*Y;switch(K){case"left":ee=-Y,oe=0,xe=2*Y,ve=0;break;case"right":ee=Y,oe=0,xe=-2*Y,ve=0;break;case"bottom":oe=Y,ve=2*Y;break;default:}var ge="M 50,50 m ".concat(ee,",").concat(oe,`
|
|
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(xe,",").concat(-ve,`
|
|
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(-xe,",").concat(ve),me=Math.PI*2*Y,ce={stroke:W,strokeDasharray:"".concat(j/100*(me-I),"px ").concat(me,"px"),strokeDashoffset:"-".concat(I/2+N/100*(me-I),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ge,pathStyle:ce}}var p=function(j){var W=j.prefixCls,L=j.strokeWidth,I=j.trailWidth,K=j.gapDegree,Y=j.gapPosition,ee=j.trailColor,oe=j.strokeLinecap,xe=j.style,ve=j.className,ge=j.strokeColor,me=j.percent,ce=g(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ie=Object(re.useMemo)(function(){return a+=1,a},[]),pe=y(0,100,ee,L,K,Y),J=pe.pathString,ne=pe.pathStyle,$=o(me),be=o(ge),Te=be.find(function(Ue){return Object.prototype.toString.call(Ue)==="[object Object]"}),ye=O($),Se=d(ye,1),Pe=Se[0],Ie=function(){var Re=0;return $.map(function(Oe,Ve){var qe=be[Ve]||be[be.length-1],He=Object.prototype.toString.call(qe)==="[object Object]"?"url(#".concat(W,"-gradient-").concat(ie,")"):"",ze=y(Re,Oe,qe,L,K,Y);return Re+=Oe,V.a.createElement("path",{key:Ve,className:"".concat(W,"-circle-path"),d:ze.pathString,stroke:He,strokeLinecap:oe,strokeWidth:L,opacity:Oe===0?0:1,fillOpacity:"0",style:ze.pathStyle,ref:Pe[Ve]})})};return V.a.createElement("svg",s({className:G()("".concat(W,"-circle"),ve),viewBox:"0 0 100 100",style:xe},ce),Te&&V.a.createElement("defs",null,V.a.createElement("linearGradient",{id:"".concat(W,"-gradient-").concat(ie),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Te).sort(function(Ue,Re){return u(Ue)-u(Re)}).map(function(Ue,Re){return V.a.createElement("stop",{key:Re,offset:Ue,stopColor:Te[Ue]})}))),V.a.createElement("path",{className:"".concat(W,"-circle-trail"),d:J,stroke:ee,strokeLinecap:oe,strokeWidth:I||L,fillOpacity:"0",style:ne}),Ie().reverse())};p.defaultProps=k;var x=p,M={Line:c,Circle:x}},isY5:function(Fe,Le,z){"use strict";z.r(Le);var re=z("5Dmo"),V=z("3S7+"),R=z("giR+"),G=z("fyUT"),k=z("+L6B"),O=z("2/Rp"),F=z("/zsF"),U=z("PArb"),P=z("14J3"),D=z("BMrR"),E=z("jCWc"),b=z("kPKH"),_=z("sPJy"),C=z("bE4q"),A=z("miYZ"),v=z("tsqr"),c=z("9og8"),s=z("k1fw"),d=z("y8nQ"),l=z("Vl3Y"),S=z("2qtc"),m=z("kLXV"),f=z("tJVT"),w=z("WmNS"),g=z.n(w),h=z("cDcd"),a=z.n(h),u=z("Ty5D"),o=z("9kvl"),y=z("55Ip"),p=z("jhfD"),x=z("/MfK"),M=z("kaH+"),N=z("ErOA"),j=z("Ot1p"),W=z("dhSg"),L=z("p5ED"),I=z("wd/R"),K=z.n(I),Y=z("m3rI"),ee=z("XYT7"),oe=z("5NDa"),xe=z("5rEg"),ve=function(Ue){var Re=Ue.shixunHomeworks,Oe=Ue.dispatch,Ve=Object(u.i)(),qe=Object(h.useState)(!0),He=Object(f.a)(qe,2),ze=He[0],nt=He[1],Je=l.a.useForm(),$e=Object(f.a)(Je,1),we=$e[0];return a.a.createElement(a.a.Fragment,null,a.a.createElement(m.a,{centered:!0,title:"\u8C03\u5206",visible:Re.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(c.a)(g.a.mark(function rt(){var Ze,Me;return g.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:return he.next=2,we.validateFields();case 2:return Ze=we.getFieldsValue(),he.next=5,Object(N.a)("/api/student_works/".concat(Re.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(s.a)({},Ze)});case 5:Me=he.sent,Me.status===0&&(v.b.success("\u8BC4\u9605\u6210\u529F"),we.resetFields(),Oe({type:"shixunHomeworks/setActionTabs",payload:{}}),Oe({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(s.a)({},Ve)}));case 7:case"end":return he.stop()}},rt)})),onCancel:function(){Oe({type:"shixunHomeworks/setActionTabs",payload:{}})}},a.a.createElement("p",{className:"tc"},"\u8BE5\u5B66\u751F\u7684\u6700\u7EC8\u6210\u7EE9\u5C06\u4E0D\u4F1A\u6309\u7167\u8BC4\u5206\u89C4\u5219\u8FDB\u884C\u8BA1\u7B97"),a.a.createElement(l.a,{form:we,layout:"horizontal"},a.a.createElement("div",{style:{display:"flex",alignItems:"baseline"}},a.a.createElement(l.a.Item,{label:"\u6210\u7EE9",name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},a.a.createElement(G.a,{min:0,placeholder:"\u8BF7\u586B\u5199\u5206\u6570"})),a.a.createElement("span",{className:"ml10"},"\u5206")),a.a.createElement("div",null,a.a.createElement(l.a.Item,{name:"comment"},a.a.createElement(xe.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8}))))))},ge=Object(o.a)(function(Ie){var Ue=Ie.shixunHomeworks;return{shixunHomeworks:Ue}})(ve),me=z("pAaK"),ce=z.n(me),ie=z("9Bee"),pe=z("LvDl"),J=z("500L"),ne=function(Ue){var Re=Ue.classroomList,Oe=Ue.loading,Ve=Ue.dispatch,qe=Object(u.i)(),He=l.a.useForm(),ze=Object(f.a)(He,1),nt=ze[0];return a.a.createElement(m.a,{centered:!0,title:"\u8865\u4EA4\u9644\u4EF6",visible:Re.actionTabs.key==="\u8865\u4EA4\u9644\u4EF6",bodyStyle:{minHeight:200},onOk:Object(c.a)(g.a.mark(function Je(){var $e,we,rt,Ze;return g.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,nt.validateFields();case 2:return we=Object(s.a)({},nt.getFieldValue()),rt=Re.actionTabs.selectArrs,we.attachment_ids=($e=we.attachment_ids)===null||$e===void 0?void 0:$e.map(function(he){return he.response.id}),je.next=7,Object(ee.V)(Object(s.a)(Object(s.a)({},we),{},{homeworkId:rt.work_id}));case 7:Ze=je.sent,Ze.status===0&&(nt.resetFields(),Ve({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(s.a)({},Re.actionTabs.params)}),Ve({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return je.stop()}},Je)})),onCancel:function(){nt.resetFields(),Ve({type:"classroomList/setActionTabs",payload:{}})}},a.a.createElement(l.a,{form:nt,initialValues:{}},a.a.createElement(l.a.Item,{name:"attachment_ids",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},a.a.createElement(J.b,null)),a.a.createElement(l.a.Item,{name:"description"},a.a.createElement(xe.a.TextArea,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",rows:7}))))},$=Object(o.a)(function(Ie){var Ue=Ie.classroomList,Re=Ie.loading;return{classroomList:Ue,loading:Re}})(ne),be=z("1vsH"),Te=z("xKgJ"),ye=z("lzim"),Se=function(Ue){var Re,Oe,Ve,qe,He,ze,nt,Je,$e,we,rt,Ze,Me,je,he,ue,de,Z,q,te,se,fe=Ue.shixunHomeworks,_e=Ue.globalSetting,De=Ue.loading,We=Ue.user,Xe=Ue.dispatch,Ce=Object(u.i)(),vt=Object(h.useRef)(),ft=We.userInfo,ke=fe.studentWorkDetail,yt=fe.studentWorkCommon,Et=fe.studentWorkSupplyDetail,tr=fe.workList,Yt=Object(h.useState)(""),Ct=Object(f.a)(Yt,2),Dr=Ct[0],Kr=Ct[1],yr=Object(h.useState)({show:!1,type:0,active:null}),Rr=Object(f.a)(yr,2),fr=Rr[0],Xr=Rr[1],Fr=m.a.useModal(),hn=Object(f.a)(Fr,2),mn=hn[0],Kt=hn[1],ot=Object(h.useState)({last:!1}),jr=Object(f.a)(ot,2),Xt=jr[0],ur=jr[1],Dt=Object(h.useState)({last:!1}),Lr=Object(f.a)(Dt,2),Ht=Lr[0],nn=Lr[1],Ge=l.a.useForm(),mt=Object(f.a)(Ge,1),Jr=mt[0],pn=Object(h.useState)(!1),an=Object(f.a)(pn,2),on=an[0],Zr=an[1],pt=Object(h.useState)(""),Ln=Object(f.a)(pt,2),Qe=Ln[0],gn=Ln[1],_r=Object(h.useState)({content:"",type:""}),vn=Object(f.a)(_r,2),Or=vn[0],Er=vn[1],yn=Object(h.useRef)(),Rt=Object(u.h)(),Zt=function(){Xe({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(s.a)({},Ce)})};Object(h.useEffect)(function(){Xe({type:"shixunHomeworks/getStudentWorkDetail",payload:Object(s.a)({},Ce)}),Xe({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(s.a)({},Ce)}),Zt(),_n(),vt.current.onclick=function(Be){Be.target.nodeName==="IMG"&&Be.target.alt!==""&&W.a.publish("preview-image",Be.target.src)}},[Ce.categoryId,Ce.userId]);function _n(){return En.apply(this,arguments)}function En(){return En=Object(c.a)(g.a.mark(function Be(){var ct,Lt,At,jt,Ot,Gt,Tt,ut,Pt,Nt;return g.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return jt=JSON.parse(sessionStorage.all_student_works_params||"{}"),Ot={},Rt!=null&&(ct=Rt.query)!==null&&ct!==void 0&&ct.ids&&(Ot.course_group=Rt==null||((Gt=Rt.query)===null||Gt===void 0)?void 0:Gt.ids.split(",")),Wt.next=5,Xe({type:"shixunHomeworks/getAllStudentWorks",payload:Object(s.a)(Object(s.a)(Object(s.a)({},Ce),jt),Ot)});case 5:Tt=Wt.sent,ut=(Lt=Tt.all_student_works)===null||Lt===void 0?void 0:Lt.map(function(qt){return String(qt.student_work_id)}).indexOf(Ce.userId),ut===((At=Tt.all_student_works)===null||At===void 0?void 0:At.length)-1?ur({last:!0}):ur((Pt=Tt.all_student_works)===null||Pt===void 0?void 0:Pt[ut+1]),ut===0?nn({last:!0}):nn((Nt=Tt.all_student_works)===null||Nt===void 0?void 0:Nt[ut-1]);case 9:case"end":return Wt.stop()}},Be)})),En.apply(this,arguments)}Object(h.useEffect)(function(){return Xe({type:"globalSetting/footerToggle",payload:!1}),function(){Xe({type:"globalSetting/footerToggle",payload:!0})}},[]);var On=function(ct){mn.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Lt=Object(c.a)(g.a.mark(function jt(){var Ot;return g.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Xe({type:"shixunHomeworks/deleteReply",payload:{object_id:ct.id,object_type:"journals_for_message"}});case 2:Ot=Tt.sent,Ot.status===0&&(v.b.success("\u5220\u9664\u6210\u529F"),Zt());case 4:case"end":return Tt.stop()}},jt)}));function At(){return Lt.apply(this,arguments)}return At}()})},Ir=function(ct){mn.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Lt=Object(c.a)(g.a.mark(function jt(){var Ot;return g.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(ee.k)({score_id:ct.comment_id,userId:Ce.userId});case 2:Ot=Tt.sent,Ot.status===0&&(v.b.success("\u5220\u9664\u6210\u529F"),Zt());case 4:case"end":return Tt.stop()}},jt)}));function At(){return Lt.apply(this,arguments)}return At}()})},Gn=function(){var Be=Object(c.a)(g.a.mark(function ct(Lt){var At,jt;return g.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Lt.attachment_ids=(At=Lt.attachment_ids)===null||At===void 0?void 0:At.map(function(Tt){var ut;return Tt==null||((ut=Tt.response)===null||ut===void 0)?void 0:ut.id}),Gt.next=3,Object(ee.e)(Object(s.a)(Object(s.a)({},Lt),{},{userId:Ce.userId}));case 3:jt=Gt.sent,jt.status===0&&(Jr.resetFields(),v.b.success("\u63D0\u4EA4\u6210\u529F"),Zt());case 5:case"end":return Gt.stop()}},ct)}));return function(Lt){return Be.apply(this,arguments)}}(),In=function(){var Be=Object(c.a)(g.a.mark(function ct(Lt){var At,jt,Ot,Gt,Tt,ut,Pt,Nt,kt;return g.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:if(At=Jr.getFieldsValue(),jt=At.comment,Ot=At.score,Gt=At.attachment_ids,Tt=!Object(pe.isNil)(Ot),!(jt||Tt||Gt)){qt.next=5;break}return m.a.confirm({centered:!0,okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:a.a.createElement("div",{className:"tc"},"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539"),onOk:function(){if(Jr.resetFields(),Lt==="last"){var Hr,Gr;o.d.push(Rt!=null&&(Hr=Rt.query)!==null&&Hr!==void 0&&Hr.ids?"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Ht==null?void 0:Ht.student_work_id,"?ids=").concat(Rt==null||((Gr=Rt.query)===null||Gr===void 0)?void 0:Gr.ids):"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Ht==null?void 0:Ht.student_work_id))}else if(Lt==="read"){var qr,kr;o.d.push(Rt!=null&&(qr=Rt.query)!==null&&qr!==void 0&&qr.ids?"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Xt==null?void 0:Xt.student_work_id,"?ids=").concat(Rt==null||((kr=Rt.query)===null||kr===void 0)?void 0:kr.ids):"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Xt==null?void 0:Xt.student_work_id))}else o.d.push("/classrooms/".concat(Ce.coursesId,"/common_homework/").concat(Ce.categoryId,"/detail"))}}),qt.abrupt("return");case 5:Lt==="last"?o.d.push(Rt!=null&&(ut=Rt.query)!==null&&ut!==void 0&&ut.ids?"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Ht==null?void 0:Ht.student_work_id,"?ids=").concat(Rt==null||((Pt=Rt.query)===null||Pt===void 0)?void 0:Pt.ids):"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Ht==null?void 0:Ht.student_work_id)):Lt==="read"?o.d.push(Rt!=null&&(Nt=Rt.query)!==null&&Nt!==void 0&&Nt.ids?"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Xt==null?void 0:Xt.student_work_id,"?ids=").concat(Rt==null||((kt=Rt.query)===null||kt===void 0)?void 0:kt.ids):"/classrooms/".concat(Ce==null?void 0:Ce.coursesId,"/common_homework/").concat(Ce==null?void 0:Ce.categoryId,"/review/").concat(Xt==null?void 0:Xt.student_work_id)):o.d.push("/classrooms/".concat(Ce.coursesId,"/common_homework/").concat(Ce.categoryId,"/detail"));case 6:case"end":return qt.stop()}},ct)}));return function(Lt){return Be.apply(this,arguments)}}();return a.a.createElement("section",{className:"edu-container",ref:vt},a.a.createElement("section",{className:"animated fadeIn"},a.a.createElement("aside",{className:"mt10"},ft&&a.a.createElement(C.a,{separator:">"},a.a.createElement(C.a.Item,null,a.a.createElement(y.a,{to:"/classrooms/".concat(Ce.coursesId,"/common_homework/").concat(ke!=null&&(Re=ke.category)!==null&&Re!==void 0&&Re.main?"":ke==null||((Oe=ke.category)===null||Oe===void 0)?void 0:Oe.category_id)},ft==null||((Ve=ft.course)===null||Ve===void 0)?void 0:Ve.course_name)),a.a.createElement(C.a.Item,null,a.a.createElement(y.a,{to:"/classrooms/".concat(Ce.coursesId,"/common_homework/").concat(ke!=null&&(qe=ke.category)!==null&&qe!==void 0&&qe.main?"":ke==null||((He=ke.category)===null||He===void 0)?void 0:He.category_id)},ke==null||((ze=ke.category)===null||ze===void 0)?void 0:ze.category_name)),a.a.createElement(C.a.Item,null,a.a.createElement(y.a,{to:"/classrooms/".concat(Ce.coursesId,"/common_homework/").concat(Ce.categoryId,"/detail")},"\u4F5C\u4E1A\u8BE6\u60C5")),a.a.createElement(C.a.Item,null,ke==null?void 0:ke.author_name))),a.a.createElement("aside",{className:[ce.a.title,"mt20"].join(" ")},a.a.createElement(D.a,{style:{width:"100%"}},a.a.createElement(b.a,{flex:"1"},a.a.createElement(y.a,{to:"/classrooms/".concat(Ce.coursesId,"/common_homework")},a.a.createElement(p.a,{className:"font16 c-black"})),a.a.createElement("strong",{className:"font20 ml5"},ke==null?void 0:ke.homework_name),a.a.createElement(be.m,{status:ke==null?void 0:ke.homework_status})),a.a.createElement(b.a,null,Object(Te.s)()&&(ke==null||((nt=ke.homework_status)===null||nt===void 0)?void 0:nt.includes("\u8865\u4EA4\u4E2D"))&&a.a.createElement("span",{onClick:function(){Xe({type:"classroomList/setActionTabs",payload:{key:"\u8865\u4EA4\u9644\u4EF6",params:Ce,selectArrs:{homework_id:Ce.commonHomeworkId,work_id:Ce.userId}}})},className:"c-blue current font14"},"\u8865\u4EA4\u9644\u4EF6"))))),a.a.createElement("ul",{className:ce.a["nav-tab"]},a.a.createElement("li",{className:"active"},"\u4F5C\u4E1A\u8BE6\u60C5"),Object(Te.u)()&&a.a.createElement("li",null,a.a.createElement(y.a,{to:"/classrooms/".concat(Ce.coursesId,"/common_homework/").concat(Ce.categoryId,"/lab-report-view/").concat(Ce.userId)}," ","\u5B9E\u9A8C\u62A5\u544A"," "))),a.a.createElement("section",{className:[ce.a.bg,"pt30","pl30","pr30","pb30"].join(" ")},(ke==null?void 0:ke.description)&&a.a.createElement("aside",null,a.a.createElement("div",{className:"font16"},"\u5185\u5BB9"),a.a.createElement("div",{className:"pl30 mt20"},a.a.createElement(ie.a,{value:(ke==null?void 0:ke.description)||"\u6682\u65E0\uFF5E"})),ke==null||((Je=ke.attachments)===null||Je===void 0)?void 0:Je.map(function(Be,ct){return a.a.createElement("div",{className:"pl30",key:ct},a.a.createElement("a",{href:"".concat(Y.a.API_SERVER).concat(Be.url),onClick:function(){var Lt=Object(c.a)(g.a.mark(function At(jt){var Ot;return g.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(jt.preventDefault(),!(Be.file_type==="txt")){Tt.next=6;break}return Tt.next=4,Object(N.a)(Be.url,{method:"get",headers:{"Content-Type":"application/xml"}});case 4:Ot=Tt.sent,yn.current=Ot;case 6:Er({type:Be.file_type,content:Y.a.API_SERVER+Be.url});case 7:case"end":return Tt.stop()}},At)}));return function(At){return Lt.apply(this,arguments)}}()},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},Be.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},Be.filesize),a.a.createElement("span",{onClick:function(At){At.stopPropagation(),Object(be.x)("","".concat(Y.a.API_SERVER).concat(Be.url))},className:"ml10 c-light-primary current"},"\u4E0B\u8F7D")))}),a.a.createElement("aside",{className:"tr"},a.a.createElement("span",{className:" c-light-black"},K()(ke.commit_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ke.commit_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),a.a.createElement("span",{className:"ml30 c-light-black"},K()(ke.update_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ke.update_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(ke==null?void 0:ke.redo_description)&&a.a.createElement("aside",null,a.a.createElement(U.a,null),a.a.createElement("div",{className:"font16"},"\u91CD\u505A\u8BB0\u5F55"),a.a.createElement("div",{className:"pl30 mt20"},a.a.createElement(ie.a,{value:(ke==null?void 0:ke.redo_description)||"\u6682\u65E0\uFF5E"})),ke==null||(($e=ke.redo_attachments)===null||$e===void 0)?void 0:$e.map(function(Be,ct){return a.a.createElement("div",{className:"pl30",key:ct},a.a.createElement("a",{href:"".concat(Y.a.API_SERVER).concat(Be.url)},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},Be.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},Be.filesize)))}),a.a.createElement("aside",{className:"tr"},a.a.createElement("span",{className:" c-light-black"},K()(ke.redo_commit_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ke.commit_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),a.a.createElement("span",{className:"ml30 c-light-black"},K()(ke.redo_update_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ke.update_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(Et==null?void 0:Et.revise_reason)&&a.a.createElement("aside",null,a.a.createElement(U.a,null),a.a.createElement("div",{className:"font16"},"\u8865\u4EA4\u5185\u5BB9"),a.a.createElement("div",{className:"pl30 mt20"},a.a.createElement(ie.a,{value:(Et==null?void 0:Et.revise_reason)||"\u6682\u65E0\uFF5E"})),Et==null||((we=Et.revise_attachments)===null||we===void 0)?void 0:we.map(function(Be,ct){return a.a.createElement("div",{className:"pl30",key:ct},a.a.createElement("a",{onClick:function(At){At.preventDefault(),Er({type:Be.file_type,content:Y.a.API_SERVER+Be.url})},href:"".concat(Y.a.API_SERVER).concat(Be.url)},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},Be.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},Be.filesize)))}),a.a.createElement("aside",{className:"tr"},a.a.createElement("span",{className:"ml30 c-light-black"},K()(Et.atta_update_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},Et.atta_update_user),a.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0")))),(ke==null?void 0:ke.anonymous_comment)&&Object(Te.i)()&&a.a.createElement("section",{className:[ce.a.bg,"mt30","pt30","pl30","pr30","pb30"].join(" ")},a.a.createElement("p",null,"\u533F\u8BC4\u5B66\u751F"),!!(ke!=null&&(rt=ke.no_commented_user_names)!==null&&rt!==void 0&&rt.length)&&a.a.createElement("p",null,"\u672A\u5B8C\u6210\u533F\u8BC4\uFF1A",ke.no_commented_user_names.join("\u3001")),a.a.createElement("div",null,"\u5DF2\u5B8C\u6210\u533F\u8BC4\uFF1A",(Ze=ke.commented_user_names)===null||Ze===void 0?void 0:Ze.join("\u3001"))),(Object(Te.h)()||(ke==null||((Me=ke.homework_status)===null||Me===void 0)?void 0:Me.includes("\u533F\u8BC4\u4E2D")))&&a.a.createElement("section",null,a.a.createElement("aside",{className:[ce.a.replyList,"bg-white"].join(" ")},a.a.createElement(D.a,{gutter:[10,20]},a.a.createElement(b.a,{flex:1},!!(yt!=null&&(je=yt.comment_scores)!==null&&je!==void 0&&je.length)&&a.a.createElement("span",{className:"font-16"},"\u5168\u90E8\u8BC4\u9605(",yt==null?void 0:yt.comment_count,")")),a.a.createElement(b.a,{style:{lineHeight:"40px"}},Object(Te.c)()&&(yt==null?void 0:yt.ultimate)&&a.a.createElement("span",{className:"font-16 c-blue current",onClick:function(){Xe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8C03\u5206",selectArrs:ke,id:Ce.userId,params:Ce}})}},"\u8C03\u5206")),a.a.createElement(b.a,null,Object(Te.i)()&&((ke==null||((he=ke.homework_status)===null||he===void 0)?void 0:he.includes("\u63D0\u4EA4\u4E2D"))||(ke==null||((ue=ke.homework_status)===null||ue===void 0)?void 0:ue.includes("\u8865\u4EA4\u4E2D"))||(ke==null||((de=ke.homework_status)===null||de===void 0)?void 0:de.includes("\u8FDB\u884C\u4E2D")))&&a.a.createElement(O.a,{style:{width:"124px",height:"40px"},type:"primary",onClick:function(){return Zr(!0)}},"\u6253\u56DE\u91CD\u505A"))),!yt.is_author&&!(yt!=null&&yt.ultimate)&&(Object(Te.c)()||(ke==null||((Z=ke.homework_status)===null||Z===void 0)?void 0:Z.includes("\u533F\u8BC4\u4E2D")))&&a.a.createElement("aside",null,a.a.createElement(l.a,{layout:"vertical",form:Jr,onFinish:function(ct){return Gn(ct)}},a.a.createElement(l.a.Item,{label:"\u8BC4\u8BED",name:"comment",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BC4\u8BED"}]},a.a.createElement(j.a,{defaultValue:"",height:250})),a.a.createElement("div",null,a.a.createElement(l.a.Item,{name:"attachment_ids"},a.a.createElement(J.b,null))),a.a.createElement("div",{className:"mt10"},a.a.createElement(D.a,null,a.a.createElement(b.a,{flex:"1"},a.a.createElement(D.a,{align:"middle",justify:"start"},a.a.createElement(b.a,null,a.a.createElement(l.a.Item,{noStyle:!0,name:"score",rules:[{required:!Object(Te.c)(),message:"\u8BF7\u586B\u5199\u5206\u6570"}]},a.a.createElement(G.a,{step:.1,min:0,style:{width:100},size:"large",placeholder:"\u8BF7\u586B\u5199\u5206\u6570"}))),a.a.createElement(b.a,null,a.a.createElement("span",{className:"ml5 mr20"},"\u5206")))),a.a.createElement(b.a,null))),a.a.createElement("aside",{className:"".concat(ce.a.buttonFixed)},a.a.createElement("aside",{className:"edu-container"},a.a.createElement(D.a,{align:"middle"},a.a.createElement(b.a,{flex:"1"},a.a.createElement(O.a,{type:"default",onClick:function(){return In("list")}},"\u8FD4\u56DE\u5217\u8868")),a.a.createElement(b.a,{flex:"1",className:"tr"},!Object(Te.s)()&&a.a.createElement(O.a,{type:"default",onClick:function(){return In("last")},disabled:Ht==null?void 0:Ht.last},"\u4E0A\u4E00\u4E2A"),!Object(Te.s)()&&a.a.createElement(O.a,{type:"default",disabled:Xt==null?void 0:Xt.last,style:{marginLeft:"20px",marginRight:"20px"},onClick:function(){return In("read")}},"\u4E0B\u4E00\u4E2A"),a.a.createElement(O.a,{htmlType:"submit",type:"primary"},"\u63D0\u4EA4\u8BC4\u9605"))))))),a.a.createElement(U.a,null),(Object(Te.h)()||(ke==null||((q=ke.homework_status)===null||q===void 0)?void 0:q.includes("\u533F\u8BC4\u4E2D"))||(ke==null||((te=ke.homework_status)===null||te===void 0)?void 0:te.includes("\u7533\u8BC9\u4E2D")))&&(yt==null||((se=yt.comment_scores)===null||se===void 0)?void 0:se.map(function(Be,ct){var Lt,At,jt,Ot,Gt,Tt;return a.a.createElement("aside",{key:ct},a.a.createElement(D.a,{gutter:[12,12],key:ct},a.a.createElement(b.a,{flex:"40px"},(Be==null?void 0:Be.user_image_url)==="--"&&a.a.createElement("img",{className:ce.a.headpic,width:"40",src:ye.b}),(Be==null?void 0:Be.user_image_url)!=="--"&&a.a.createElement("img",{className:ce.a.headpic,width:"40",src:"".concat(Y.a.IMG_SERVER,"/images/").concat(Be==null?void 0:Be.user_image_url)})),a.a.createElement(b.a,{flex:"1"},a.a.createElement(D.a,{align:"middle"},a.a.createElement(b.a,{span:24},a.a.createElement(D.a,null,a.a.createElement(b.a,{flex:1},a.a.createElement("span",{className:"c-light-black"},Be==null?void 0:Be.user_name),a.a.createElement("span",{className:"c-light-black ml10"},K()(Be==null?void 0:Be.comment_time).format("YYYY-MM-DD HH:mm")),Be.score!==null&&a.a.createElement("span",{className:"ml30 c-orange"},Be.score,"\u5206")),a.a.createElement(b.a,null,ct===0?a.a.createElement("aside",null,Be.delete&&a.a.createElement("span",{className:"c-blue current",onClick:function(){Ir(Be)}},"\u5220\u9664"),Be.can_appeal&&a.a.createElement("span",{className:"c-blue current",onClick:function(){Xr({show:!0,type:1,active:ct})}},"\u7533\u8BC9"),Be.can_reply&&a.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return Xr({show:!0,type:0,active:ct})}},"\u56DE\u590D")):a.a.createElement("aside",null,Be.delete&&a.a.createElement("span",{className:"c-blue current",onClick:function(){Ir(Be)}},"\u5220\u9664"),Be.can_appeal&&a.a.createElement("span",{className:"c-blue current",onClick:function(){Xr({show:!0,type:1,active:ct})}},"\u7533\u8BC9"),Be.can_reply&&a.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return Xr({show:!0,type:0,active:ct})}},"\u56DE\u590D"),!Be.can_reply&&a.a.createElement("span",{className:"c-light-black ml10"},"\u5931\u6548"))))),a.a.createElement(b.a,{span:24},Be.content&&a.a.createElement(ie.a,{value:Be.content}),!Be.content&&a.a.createElement("span",{className:"c-light-black"},"\u6682\u672A\u5199\u8BC4\u8BED"),Be==null||((Lt=Be.attachments)===null||Lt===void 0)?void 0:Lt.map(function(ut,Pt){return a.a.createElement("div",{key:Pt},a.a.createElement("a",{href:"".concat(Y.a.API_SERVER).concat(ut.url)},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},ut.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},ut.filesize)))})),a.a.createElement("div",{className:"w100"},a.a.createElement(U.a,null),a.a.createElement("aside",{className:[ce.a.comment,"w100"].join(" ")},Be.appeal_info&&Be.appeal_info!=""&&a.a.createElement("aside",null,a.a.createElement(D.a,null,a.a.createElement(b.a,{span:24},a.a.createElement(D.a,null,a.a.createElement(b.a,{flex:"50px"},(Be==null||((At=Be.appeal_info)===null||At===void 0)?void 0:At.user_image_url)==="--"&&a.a.createElement("img",{className:ce.a.headpic,width:"40",src:ye.b}),(Be==null||((jt=Be.appeal_info)===null||jt===void 0)?void 0:jt.user_image_url)!=="--"&&a.a.createElement("img",{className:ce.a.headpic,width:"40",src:"".concat(Y.a.IMG_SERVER,"/images/").concat(Be==null||((Ot=Be.appeal_info)===null||Ot===void 0)?void 0:Ot.user_image_url)})),a.a.createElement(b.a,{flex:"1"},a.a.createElement(D.a,null,a.a.createElement(b.a,{flex:"1"},Be==null||((Gt=Be.appeal_info)===null||Gt===void 0)?void 0:Gt.user_name,a.a.createElement("span",{className:"c-light-black ml10"},K()(Be==null||((Tt=Be.appeal_info)===null||Tt===void 0)?void 0:Tt.time).format("YYYY-MM-DD HH:mm")),(Be==null?void 0:Be.appeal_status)===1&&a.a.createElement("span",{className:"tag-style bg-blue ml10"},"\u7533\u8BC9\u4E2D"),(Be==null?void 0:Be.appeal_status)===2&&a.a.createElement("span",{className:"tag-style bg-grey-ede c-light-black ml10"},"\u7533\u8BC9\u5DF2\u64A4\u9500"),(Be==null?void 0:Be.appeal_status)===3&&a.a.createElement("span",{className:"tag-style bg-blue ml10"},"\u7533\u8BC9\u6210\u529F"),(Be==null?void 0:Be.appeal_status)===4&&a.a.createElement("span",{className:"tag-style bg-grey-ede c-light-black ml10"},"\u7533\u8BC9\u88AB\u62D2\u7EDD"),(Be==null?void 0:Be.appeal_status)===5&&a.a.createElement("span",{className:"tag-style bg-grey-ede c-light-black ml10"},"\u7533\u8BC9\u5931\u8D25")),a.a.createElement(b.a,null,(Be==null?void 0:Be.appeal_status)===1&&Be.can_appeal&&a.a.createElement("span",{onClick:function(){m.a.confirm({title:a.a.createElement("div",null,"\u64A4\u9500\u7533\u8BC9\u540E\uFF0C\u65E0\u6CD5\u518D\u5BF9\u672C\u8BC4\u9605\u8BB0\u5F55\u8FDB\u884C\u7533\u8BC9",a.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u7533\u8BC9"),onOk:function(){var Pt=Object(c.a)(g.a.mark(function kt(){return g.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:Zt();case 1:case"end":return qt.stop()}},kt)}));function Nt(){return Pt.apply(this,arguments)}return Nt}()})},className:"c-blue current"},"\u64A4\u9500\u7533\u8BC9"),(Be==null?void 0:Be.appeal_status)===1&&Object(Te.c)()&&a.a.createElement("span",{onClick:function(){m.a.confirm({title:a.a.createElement("div",null,"\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u5E9F\u5F03\uFF0C\u8BC4\u9605\u4EBA\u7684\u4F5C\u54C1\u5C06\u88AB\u8FDD\u89C4\u6263\u5206",a.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u63A5\u53D7\u7533\u8BC9"),onOk:function(){var Pt=Object(c.a)(g.a.mark(function kt(){var Wt;return g.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return rr.next=2,Object(N.a)("/api/student_works/".concat(Ce.userId,"/deal_appeal_score.json"),{method:"post",body:{score_id:Be.score_id,status:3}});case 2:Wt=rr.sent,(Wt==null?void 0:Wt.status)===0&&Zt();case 4:case"end":return rr.stop()}},kt)}));function Nt(){return Pt.apply(this,arguments)}return Nt}()})},className:"c-red current"},"\u63A5\u53D7\u7533\u8BC9"),(Be==null?void 0:Be.appeal_status)===1&&Object(Te.c)()&&a.a.createElement("span",{onClick:function(){m.a.confirm({title:a.a.createElement("div",null,"\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u8BA4\u4E3A\u5408\u7406",a.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u7533\u8BC9"),onOk:function(){var Pt=Object(c.a)(g.a.mark(function kt(){var Wt;return g.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return rr.next=2,Object(N.a)("/api/student_works/".concat(Ce.userId,"/deal_appeal_score.json"),{method:"post",body:{score_id:Be.score_id,status:4}});case 2:Wt=rr.sent,(Wt==null?void 0:Wt.status)===0&&Zt();case 4:case"end":return rr.stop()}},kt)}));function Nt(){return Pt.apply(this,arguments)}return Nt}()})},className:"c-light-black current ml10"},"\u62D2\u7EDD\u7533\u8BC9"))),a.a.createElement(ie.a,{value:Be==null?void 0:Be.appeal_info.content})),a.a.createElement(b.a,null))))),Be.journals.map(function(ut,Pt){var Nt,kt,Wt,qt;return a.a.createElement("aside",{key:Pt},a.a.createElement(D.a,{key:Pt},a.a.createElement(b.a,{span:24},a.a.createElement(D.a,null,a.a.createElement(b.a,{flex:"50px"},(ut==null||((Nt=ut.user_info)===null||Nt===void 0)?void 0:Nt.user_image_url)==="--"&&a.a.createElement("img",{className:ce.a.headpic,width:"40",src:ye.b}),(ut==null||((kt=ut.user_info)===null||kt===void 0)?void 0:kt.user_image_url)!=="--"&&a.a.createElement("img",{className:ce.a.headpic,width:"40",src:"".concat(Y.a.IMG_SERVER,"/images/").concat(ut==null||((Wt=ut.user_info)===null||Wt===void 0)?void 0:Wt.user_image_url)})),a.a.createElement(b.a,{flex:"1"},ut==null||((qt=ut.user_info)===null||qt===void 0)?void 0:qt.user_name,a.a.createElement("span",{className:"c-light-black ml10"},K()(ut==null?void 0:ut.time).format("YYYY-MM-DD HH:mm")),a.a.createElement(ie.a,{value:ut.content})),a.a.createElement(b.a,null,(ut==null?void 0:ut.can_delete)&&a.a.createElement(V.a,{title:"\u5220\u9664"},a.a.createElement(x.a,{className:"current c-light-black",onClick:function(){On(ut)}})))))),Pt!==Be.journals.length-1&&a.a.createElement(U.a,null))})))),fr.show&&ct===fr.active&&a.a.createElement("aside",{className:["bg-white"].join(" ")},a.a.createElement(j.a,{onChange:function(Pt){Kr(Pt)},height:150,isFocus:!0,watch:!0}),a.a.createElement(D.a,null,a.a.createElement(b.a,{span:24,className:"tr"},a.a.createElement(O.a,{type:"default",size:"large",onClick:Object(c.a)(g.a.mark(function ut(){return g.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:Xr({show:!1,type:0,active:ct});case 1:case"end":return Nt.stop()}},ut)}))},"\u53D6\u6D88"),a.a.createElement(O.a,{type:"primary",size:"large",className:"ml20",onClick:Object(c.a)(g.a.mark(function ut(){var Pt;return g.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(!(Dr==="")){kt.next=4;break}v.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),kt.next=14;break;case 4:if(!(fr.type===0)){kt.next=10;break}return kt.next=7,Object(ee.f)({comment:Dr,userId:Ce.userId,score_id:Be.score_id});case 7:Pt=kt.sent,kt.next=13;break;case 10:return kt.next=12,Object(ee.g)({comment:Dr,score_id:Be.score_id,userId:Ce.userId});case 12:Pt=kt.sent;case 13:Pt.status===0&&(v.b.success("\u64CD\u4F5C\u6210\u529F"),Xr({show:!1,type:0,active:ct}),Zt());case 14:case"end":return kt.stop()}},ut)}))},fr.type===0?"\u56DE\u590D":"\u7533\u8BC9")))))),a.a.createElement(U.a,null))})))),a.a.createElement(ge,null),a.a.createElement($,null),a.a.createElement(M.a,null),a.a.createElement(m.a,{title:"\u786E\u8BA4\u6253\u56DE\u91CD\u505A",visible:on,destroyOnClose:!0,forceRender:!0,onCancel:function(){Zr(!1)},onOk:Object(c.a)(g.a.mark(function Be(){var ct;return g.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(Qe){At.next=3;break}return v.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),At.abrupt("return");case 3:return At.next=5,Object(N.a)("/api/student_works/".concat(Ce.userId,"/redo_modal.json"),{method:"post",body:{comment:Qe,id:Ce.userId}});case 5:ct=At.sent,(ct==null?void 0:ct.status)===0&&(v.b.info("\u6253\u56DE\u91CD\u505A\u6210\u529F"),Zr(!1),Zt());case 7:case"end":return At.stop()}},Be)})),width:728},a.a.createElement("div",{style:{padding:"32px"}},a.a.createElement("span",null,"\u786E\u8BA4\u5C06",ke==null?void 0:ke.author_name,"\u7684\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417"),a.a.createElement("div",{style:{marginTop:"20px"}},a.a.createElement("label",null,a.a.createElement("span",{style:{marginRight:"5px",color:"red"}},"*"),"\u8BC4\u8BED\uFF1A"),a.a.createElement(j.a,{className:ce.a.MdEditor,onChange:function(ct){return gn(ct)},defaultValue:"",height:250})))),Kt,a.a.createElement(L.a,{close:!0,data:Or==null?void 0:Or.content,type:Or==null?void 0:Or.type,hasMask:!0,monacoEditor:{value:yn.current,language:"txt",onChange:function(){},options:{readOnly:!0,fontSize:14,minimap:{enabled:!1}}},onClose:function(){return Er({content:"",type:""})}}))},Pe=Le.default=Object(o.a)(function(Ie){var Ue=Ie.shixunHomeworks,Re=Ie.loading,Oe=Ie.user,Ve=Ie.globalSetting;return{shixunHomeworks:Ue,globalSetting:Ve,user:Oe,loading:Re.effects}})(Se)},ji0R:function(Fe,Le,z){Fe.exports=z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Fe,Le,z){Fe.exports=z.p+"static/question.cb52bef9.gif"},kPYp:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6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Oaltv3E0id1lMlR1hRJnk8PK+H0mqu7DmHBDB4vw6HtneQ8N06YNalIp4HmF6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Fe,Le,z){},"kaH+":function(Fe,Le,z){"use strict";var re=z("+L6B"),V=z("2/Rp"),R=z("tJVT"),G=z("cDcd"),k=z.n(G),O=z("UZu5"),F=z.n(O),U=z("dhSg"),P=z("rLCj"),D=z("dF/Y"),E=z("4i/N");Le.a=function(){var b=Object(G.useState)(""),_=Object(R.a)(b,2),C=_[0],A=_[1],v=Object(G.useState)(0),c=Object(R.a)(v,2),s=c[0],d=c[1],l=Object(G.useRef)("");Object(G.useEffect)(function(){var a=U.a.subscribe("preview-image",function(u){A(u),document.body.style.overflow="hidden"});return a},[]),Object(G.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(G.useEffect)(function(){l.current=C},[C]);function S(a){a.keyCode==27&&l.current&&m()}function m(){document.body.style.overflow="auto",A("")}function f(){d(s+90)}var w=Object(G.useRef)(),g=Object(G.useRef)(),h=function(u){(u.nativeEvent.target===w.current||u.nativeEvent.target===g.current)&&m()};return k.a.createElement(G.Fragment,null,C?k.a.createElement("div",{className:"image-preview-container",ref:w,onClick:h},k.a.createElement("div",{className:"button-group"},k.a.createElement(V.a,{onClick:f},"\u65CB\u8F6C",k.a.createElement(P.a,null)),k.a.createElement(V.a,{href:C},"\u4E0B\u8F7D",k.a.createElement(D.a,null)),k.a.createElement(V.a,{onClick:m},"\u5173\u95ED",k.a.createElement(E.a,null))),k.a.createElement("div",{className:"preview-wrp-group",ref:g},k.a.createElement("img",{className:"image-preview",src:C,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(s,"deg)")}}))):null)}},l2Kq:function(Fe,Le,z){Fe.exports=z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Fe,Le,z){(function(re){re(z("VrN/"),z("1eCo"),z("8EBN"))})(function(re){"use strict";re.defineMode("markdown",function(V,R){var G=re.getMode(V,"text/html"),k=G.name=="null";function O(L){if(re.findModeByName){var I=re.findModeByName(L);I&&(L=I.mime||I.mimes[0])}var K=re.getMode(V,L);return K.name=="null"?null:K}R.highlightFormatting===void 0&&(R.highlightFormatting=!1),R.maxBlockquoteDepth===void 0&&(R.maxBlockquoteDepth=0),R.taskLists===void 0&&(R.taskLists=!1),R.strikethrough===void 0&&(R.strikethrough=!1),R.emoji===void 0&&(R.emoji=!1),R.fencedCodeBlockHighlighting===void 0&&(R.fencedCodeBlockHighlighting=!0),R.fencedCodeBlockDefaultMode===void 0&&(R.fencedCodeBlockDefaultMode="text/plain"),R.xml===void 0&&(R.xml=!0),R.tokenTypeOverrides===void 0&&(R.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 U in F)F.hasOwnProperty(U)&&R.tokenTypeOverrides[U]&&(F[U]=R.tokenTypeOverrides[U]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,E=/^\[(x| )\](?=\s)/i,b=R.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,_=/^ {0,3}(?:\={1,}|-{2,})\s*$/,C=/^[^#!\[\]*_\\<>` "'(~:]+/,A=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,v=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 d(L,I,K){return I.f=I.inline=K,K(L,I)}function l(L,I,K){return I.f=I.block=K,K(L,I)}function S(L){return!L||!/\S/.test(L.string)}function m(L){if(L.linkTitle=!1,L.linkHref=!1,L.linkText=!1,L.em=!1,L.strong=!1,L.strikethrough=!1,L.quote=0,L.indentedCode=!1,L.f==w){var I=k;if(!I){var K=re.innerMode(G,L.htmlState);I=K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText}I&&(L.f=u,L.block=f,L.htmlState=null)}return L.trailingSpace=0,L.trailingSpaceNewLine=!1,L.prevLine=L.thisLine,L.thisLine={stream:null},null}function f(L,I){var K=L.column()===I.indentation,Y=S(I.prevLine.stream),ee=I.indentedCode,oe=I.prevLine.hr,xe=I.list!==!1,ve=(I.listStack[I.listStack.length-1]||0)+3;I.indentedCode=!1;var ge=I.indentation;if(I.indentationDiff===null&&(I.indentationDiff=I.indentation,xe)){for(I.list=null;ge<I.listStack[I.listStack.length-1];)I.listStack.pop(),I.listStack.length?I.indentation=I.listStack[I.listStack.length-1]:I.list=!1;I.list!==!1&&(I.indentationDiff=ge-I.listStack[I.listStack.length-1])}var me=!Y&&!oe&&!I.prevLine.header&&(!xe||!ee)&&!I.prevLine.fencedCodeEnd,ce=(I.list===!1||oe||Y)&&I.indentation<=ve&&L.match(P),ie=null;if(I.indentationDiff>=4&&(ee||I.prevLine.fencedCodeEnd||I.prevLine.header||Y))return L.skipToEnd(),I.indentedCode=!0,F.code;if(L.eatSpace())return null;if(K&&I.indentation<=ve&&(ie=L.match(b))&&ie[1].length<=6)return I.quote=0,I.header=ie[1].length,I.thisLine.header=!0,R.highlightFormatting&&(I.formatting="header"),I.f=I.inline,h(I);if(I.indentation<=ve&&L.eat(">"))return I.quote=K?1:I.quote+1,R.highlightFormatting&&(I.formatting="quote"),L.eatSpace(),h(I);if(!ce&&!I.setext&&K&&I.indentation<=ve&&(ie=L.match(D))){var pe=ie[1]?"ol":"ul";return I.indentation=ge+L.current().length,I.list=!0,I.quote=0,I.listStack.push(I.indentation),I.em=!1,I.strong=!1,I.code=!1,I.strikethrough=!1,R.taskLists&&L.match(E,!1)&&(I.taskList=!0),I.f=I.inline,R.highlightFormatting&&(I.formatting=["list","list-"+pe]),h(I)}else{if(K&&I.indentation<=ve&&(ie=L.match(A,!0)))return I.quote=0,I.fencedEndRE=new RegExp(ie[1]+"+ *$"),I.localMode=R.fencedCodeBlockHighlighting&&O(ie[2]||R.fencedCodeBlockDefaultMode),I.localMode&&(I.localState=re.startState(I.localMode)),I.f=I.block=g,R.highlightFormatting&&(I.formatting="code-block"),I.code=-1,h(I);if(I.setext||(!me||!xe)&&!I.quote&&I.list===!1&&!I.code&&!ce&&!v.test(L.string)&&(ie=L.lookAhead(1))&&(ie=ie.match(_)))return I.setext?(I.header=I.setext,I.setext=0,L.skipToEnd(),R.highlightFormatting&&(I.formatting="header")):(I.header=ie[0].charAt(0)=="="?1:2,I.setext=I.header),I.thisLine.header=!0,I.f=I.inline,h(I);if(ce)return L.skipToEnd(),I.hr=!0,I.thisLine.hr=!0,F.hr;if(L.peek()==="[")return d(L,I,M)}return d(L,I,I.inline)}function w(L,I){var K=G.token(L,I.htmlState);if(!k){var Y=re.innerMode(G,I.htmlState);(Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText||I.md_inside&&L.current().indexOf(">")>-1)&&(I.f=u,I.block=f,I.htmlState=null)}return K}function g(L,I){var K=I.listStack[I.listStack.length-1]||0,Y=I.indentation<K,ee=K+3;if(I.fencedEndRE&&I.indentation<=ee&&(Y||L.match(I.fencedEndRE))){R.highlightFormatting&&(I.formatting="code-block");var oe;return Y||(oe=h(I)),I.localMode=I.localState=null,I.block=f,I.f=u,I.fencedEndRE=null,I.code=0,I.thisLine.fencedCodeEnd=!0,Y?l(L,I,I.block):oe}else return I.localMode?I.localMode.token(L,I.localState):(L.skipToEnd(),F.code)}function h(L){var I=[];if(L.formatting){I.push(F.formatting),typeof L.formatting=="string"&&(L.formatting=[L.formatting]);for(var K=0;K<L.formatting.length;K++)I.push(F.formatting+"-"+L.formatting[K]),L.formatting[K]==="header"&&I.push(F.formatting+"-"+L.formatting[K]+"-"+L.header),L.formatting[K]==="quote"&&(!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=L.quote?I.push(F.formatting+"-"+L.formatting[K]+"-"+L.quote):I.push("error"))}if(L.taskOpen)return I.push("meta"),I.length?I.join(" "):null;if(L.taskClosed)return I.push("property"),I.length?I.join(" "):null;if(L.linkHref?I.push(F.linkHref,"url"):(L.strong&&I.push(F.strong),L.em&&I.push(F.em),L.strikethrough&&I.push(F.strikethrough),L.emoji&&I.push(F.emoji),L.linkText&&I.push(F.linkText),L.code&&I.push(F.code),L.image&&I.push(F.image),L.imageAltText&&I.push(F.imageAltText,"link"),L.imageMarker&&I.push(F.imageMarker)),L.header&&I.push(F.header,F.header+"-"+L.header),L.quote&&(I.push(F.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=L.quote?I.push(F.quote+"-"+L.quote):I.push(F.quote+"-"+R.maxBlockquoteDepth)),L.list!==!1){var Y=(L.listStack.length-1)%3;Y?Y===1?I.push(F.list2):I.push(F.list3):I.push(F.list1)}return L.trailingSpaceNewLine?I.push("trailing-space-new-line"):L.trailingSpace&&I.push("trailing-space-"+(L.trailingSpace%2?"a":"b")),I.length?I.join(" "):null}function a(L,I){return L.match(C,!0)?h(I):void 0}function u(L,I){var K=I.text(L,I);if(typeof K!="undefined")return K;if(I.list)return I.list=null,h(I);if(I.taskList){var Y=L.match(E,!0)[1]===" ";return Y?I.taskOpen=!0:I.taskClosed=!0,R.highlightFormatting&&(I.formatting="task"),I.taskList=!1,h(I)}if(I.taskOpen=!1,I.taskClosed=!1,I.header&&L.match(/^#+$/,!0))return R.highlightFormatting&&(I.formatting="header"),h(I);var ee=L.next();if(I.linkTitle){I.linkTitle=!1;var oe=ee;ee==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var xe="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(L.match(new RegExp(xe),!0))return F.linkHref}if(ee==="`"){var ve=I.formatting;R.highlightFormatting&&(I.formatting="code"),L.eatWhile("`");var ge=L.current().length;if(I.code==0&&(!I.quote||ge==1))return I.code=ge,h(I);if(ge==I.code){var me=h(I);return I.code=0,me}else return I.formatting=ve,h(I)}else if(I.code)return h(I);if(ee==="\\"&&(L.next(),R.highlightFormatting)){var ce=h(I),ie=F.formatting+"-escape";return ce?ce+" "+ie:ie}if(ee==="!"&&L.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return I.imageMarker=!0,I.image=!0,R.highlightFormatting&&(I.formatting="image"),h(I);if(ee==="["&&I.imageMarker&&L.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return I.imageMarker=!1,I.imageAltText=!0,R.highlightFormatting&&(I.formatting="image"),h(I);if(ee==="]"&&I.imageAltText){R.highlightFormatting&&(I.formatting="image");var ce=h(I);return I.imageAltText=!1,I.image=!1,I.inline=I.f=y,ce}if(ee==="["&&!I.image)return I.linkText&&L.match(/^.*?\]/)||(I.linkText=!0,R.highlightFormatting&&(I.formatting="link")),h(I);if(ee==="]"&&I.linkText){R.highlightFormatting&&(I.formatting="link");var ce=h(I);return I.linkText=!1,I.inline=I.f=L.match(/\(.*?\)| ?\[.*?\]/,!1)?y:u,ce}if(ee==="<"&&L.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){I.f=I.inline=o,R.highlightFormatting&&(I.formatting="link");var ce=h(I);return ce?ce+=" ":ce="",ce+F.linkInline}if(ee==="<"&&L.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){I.f=I.inline=o,R.highlightFormatting&&(I.formatting="link");var ce=h(I);return ce?ce+=" ":ce="",ce+F.linkEmail}if(R.xml&&ee==="<"&&L.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var pe=L.string.indexOf(">",L.pos);if(pe!=-1){var J=L.string.substring(L.start,pe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(J)&&(I.md_inside=!0)}return L.backUp(1),I.htmlState=re.startState(G),l(L,I,w)}if(R.xml&&ee==="<"&&L.match(/^\/\w*?>/))return I.md_inside=!1,"tag";if(ee==="*"||ee==="_"){for(var ne=1,$=L.pos==1?" ":L.string.charAt(L.pos-2);ne<3&&L.eat(ee);)ne++;var be=L.peek()||" ",Te=!/\s/.test(be)&&(!c.test(be)||/\s/.test($)||c.test($)),ye=!/\s/.test($)&&(!c.test($)||/\s/.test(be)||c.test(be)),Se=null,Pe=null;if(ne%2&&(!I.em&&Te&&(ee==="*"||!ye||c.test($))?Se=!0:I.em==ee&&ye&&(ee==="*"||!Te||c.test(be))&&(Se=!1)),ne>1&&(!I.strong&&Te&&(ee==="*"||!ye||c.test($))?Pe=!0:I.strong==ee&&ye&&(ee==="*"||!Te||c.test(be))&&(Pe=!1)),Pe!=null||Se!=null){R.highlightFormatting&&(I.formatting=Se==null?"strong":Pe==null?"em":"strong em"),Se===!0&&(I.em=ee),Pe===!0&&(I.strong=ee);var me=h(I);return Se===!1&&(I.em=!1),Pe===!1&&(I.strong=!1),me}}else if(ee===" "&&(L.eat("*")||L.eat("_"))){if(L.peek()===" ")return h(I);L.backUp(1)}if(R.strikethrough){if(ee==="~"&&L.eatWhile(ee)){if(I.strikethrough){R.highlightFormatting&&(I.formatting="strikethrough");var me=h(I);return I.strikethrough=!1,me}else if(L.match(/^[^\s]/,!1))return I.strikethrough=!0,R.highlightFormatting&&(I.formatting="strikethrough"),h(I)}else if(ee===" "&&L.match(/^~~/,!0)){if(L.peek()===" ")return h(I);L.backUp(2)}}if(R.emoji&&ee===":"&&L.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){I.emoji=!0,R.highlightFormatting&&(I.formatting="emoji");var Ie=h(I);return I.emoji=!1,Ie}return ee===" "&&(L.match(/^ +$/,!1)?I.trailingSpace++:I.trailingSpace&&(I.trailingSpaceNewLine=!0)),h(I)}function o(L,I){var K=L.next();if(K===">"){I.f=I.inline=u,R.highlightFormatting&&(I.formatting="link");var Y=h(I);return Y?Y+=" ":Y="",Y+F.linkInline}return L.match(/^[^>]+/,!0),F.linkInline}function y(L,I){if(L.eatSpace())return null;var K=L.next();return K==="("||K==="["?(I.f=I.inline=x(K==="("?")":"]"),R.highlightFormatting&&(I.formatting="link-string"),I.linkHref=!0,h(I)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(L){return function(I,K){var Y=I.next();if(Y===L){K.f=K.inline=u,R.highlightFormatting&&(K.formatting="link-string");var ee=h(K);return K.linkHref=!1,ee}return I.match(p[L]),K.linkHref=!0,h(K)}}function M(L,I){return L.match(/^([^\]\\]|\\.)*\]:/,!1)?(I.f=N,L.next(),R.highlightFormatting&&(I.formatting="link"),I.linkText=!0,h(I)):d(L,I,u)}function N(L,I){if(L.match(/^\]:/,!0)){I.f=I.inline=j,R.highlightFormatting&&(I.formatting="link");var K=h(I);return I.linkText=!1,K}return L.match(/^([^\]\\]|\\.)+/,!0),F.linkText}function j(L,I){return L.eatSpace()?null:(L.match(/^[^\s]+/,!0),L.peek()===void 0?I.linkTitle=!0:L.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),I.f=I.inline=u,F.linkHref+" url")}var W={startState:function(){return{f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:u,text:a,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(L){return{f:L.f,prevLine:L.prevLine,thisLine:L.thisLine,block:L.block,htmlState:L.htmlState&&re.copyState(G,L.htmlState),indentation:L.indentation,localMode:L.localMode,localState:L.localMode?re.copyState(L.localMode,L.localState):null,inline:L.inline,text:L.text,formatting:!1,linkText:L.linkText,linkTitle:L.linkTitle,linkHref:L.linkHref,code:L.code,em:L.em,strong:L.strong,strikethrough:L.strikethrough,emoji:L.emoji,header:L.header,setext:L.setext,hr:L.hr,taskList:L.taskList,list:L.list,listStack:L.listStack.slice(0),quote:L.quote,indentedCode:L.indentedCode,trailingSpace:L.trailingSpace,trailingSpaceNewLine:L.trailingSpaceNewLine,md_inside:L.md_inside,fencedEndRE:L.fencedEndRE}},token:function(L,I){if(I.formatting=!1,L!=I.thisLine.stream){if(I.header=0,I.hr=!1,L.match(/^\s*$/,!0))return m(I),null;if(I.prevLine=I.thisLine,I.thisLine={stream:L},I.taskList=!1,I.trailingSpace=0,I.trailingSpaceNewLine=!1,!I.localState&&(I.f=I.block,I.f!=w)){var K=L.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(I.indentation=K,I.indentationDiff=null,K>0)return null}}return I.f(L,I)},innerMode:function(L){return L.block==w?{state:L.htmlState,mode:G}:L.localState?{state:L.localState,mode:L.localMode}:{state:L,mode:W}},indent:function(L,I,K){return L.block==w&&G.indent?G.indent(L.htmlState,I,K):L.localState&&L.localMode.indent?L.localMode.indent(L.localState,I,K):re.Pass},blankLine:m,getType:h,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return W},"xml"),re.defineMIME("text/markdown","markdown"),re.defineMIME("text/x-markdown","markdown")})},lzim:function(Fe,Le,z){"use strict";var re=z("E7E6"),V=z.n(re);z.d(Le,"z",function(){return V.a});var R=z("/GNS"),G=z.n(R);z.d(Le,"y",function(){return G.a});var k=z("FOrL"),O=z.n(k);z.d(Le,"s",function(){return O.a});var F=z("HpTS"),U=z.n(F);z.d(Le,"A",function(){return U.a});var P=z("tWlo"),D=z.n(P);z.d(Le,"b",function(){return D.a});var E=z("7ZXX"),b=z.n(E);z.d(Le,"m",function(){return b.a});var _=z("GABl"),C=z.n(_);z.d(Le,"f",function(){return C.a});var A=z("onxn"),v=z.n(A);z.d(Le,"o",function(){return v.a});var c=z("nKGa"),s=z.n(c);z.d(Le,"n",function(){return s.a});var d=z("4qgm"),l=z.n(d);z.d(Le,"C",function(){return l.a});var S=z("JeFH"),m=z.n(S);z.d(Le,"c",function(){return m.a});var f=z("ji0R"),w=z.n(f);z.d(Le,"j",function(){return w.a});var g=z("W6BS"),h=z.n(g);z.d(Le,"D",function(){return h.a});var a=z("kPYp"),u=z.n(a);z.d(Le,"E",function(){return u.a});var o=z("nukY"),y=z.n(o),p=z("4u4S"),x=z.n(p),M=z("yslc"),N=z.n(M),j=z("l2Kq"),W=z.n(j);z.d(Le,"r",function(){return W.a});var L=z("RMFE"),I=z.n(L);z.d(Le,"p",function(){return I.a});var K=z("TGq3"),Y=z.n(K),ee=z("SMhR"),oe=z.n(ee);z.d(Le,"B",function(){return oe.a});var xe=z("8/bI"),ve=z.n(xe);z.d(Le,"k",function(){return ve.a});var ge=z("JWDV"),me=z.n(ge),ce=z("Xsq0"),ie=z.n(ce);z.d(Le,"q",function(){return ie.a});var pe=z("Ohmc"),J=z.n(pe);z.d(Le,"d",function(){return J.a});var ne=z("csWT"),$=z.n(ne);z.d(Le,"e",function(){return $.a});var be=z("7v3h"),Te=z.n(be);z.d(Le,"l",function(){return Te.a});var ye=z("cRFk"),Se=z.n(ye);z.d(Le,"x",function(){return Se.a});var Pe=z("kPWJ"),Ie=z.n(Pe);z.d(Le,"w",function(){return Ie.a});var Ue=z("qgvg"),Re=z.n(Ue);z.d(Le,"t",function(){return Re.a});var Oe=z("FPkq"),Ve=z.n(Oe);z.d(Le,"v",function(){return Ve.a});var qe=z("A/g1"),He=z.n(qe);z.d(Le,"g",function(){return He.a});var ze=z("Nmxd"),nt=z.n(ze);z.d(Le,"h",function(){return nt.a});var Je=z("5D2P"),$e=z.n(Je);z.d(Le,"i",function(){return $e.a});var we=z("djh8"),rt=z.n(we);z.d(Le,"u",function(){return rt.a});var Ze=z("Jq4h"),Me=z.n(Ze);z.d(Le,"a",function(){return Me.a})},nKGa:function(Fe,Le,z){Fe.exports=z.p+"static/export_exercise-template.f7655c19.png"},nukY:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLOAa9CLsB4ioLSW6azUyZAFPoBdh/w4RvZYhG2lVU2ABz6AXYf8FEb2cAv21ChmxgC/Qu7q6moeHh/9KRB/JiJ20mnVuAV+gQ+fu7u4FQ0ND/yGiLXVuAy1+BizgG/Ri2HEjEZ1k5kUZsJVWsY4tEAh06N3e3v7B8fHxt4hoWh3bIRbRm5qaaHx83NOzDcMg/DCz+RNlamhoMKtXSkX5mJrUHRh0SCml/CIzn8D+mJpInYKHNDY20p49e2hoaIguX75MIyMjrrRatWoVLVu2jJ48eUJnzpxxVcZPpunTp9POnTvNot3d3TQ8POynmsSUCQ1MIcSrzPx6YjSrIMiSJUvM3jCK9PTpU3r48KHrqhcvXkxr166lQqFAp06dMn+7SRp0N1Z6Nk+orS6E+Bkzf8WfKNGX2rdvH6Enj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kU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Fe,Le,z){(function(re){re(z("VrN/"))})(function(re){"use strict";var V=re.Pos;function R(c,s){return c.line-s.line||c.ch-s.ch}var G="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=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=new RegExp("<(/?)(["+G+"]["+k+"]*)","g");function F(c,s,d,l){this.line=s,this.ch=d,this.cm=c,this.text=c.getLine(s),this.min=l?Math.max(l.from,c.firstLine()):c.firstLine(),this.max=l?Math.min(l.to-1,c.lastLine()):c.lastLine()}function U(c,s){var d=c.cm.getTokenTypeAt(V(c.line,s));return d&&/\btag\b/.test(d)}function P(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function D(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function E(c){for(;;){var s=c.text.indexOf(">",c.ch);if(s==-1){if(P(c))continue;return}if(!U(c,s+1)){c.ch=s+1;continue}var d=c.text.lastIndexOf("/",s),l=d>-1&&!/\S/.test(c.text.slice(d+1,s));return c.ch=s+1,l?"selfClose":"regular"}}function b(c){for(;;){var s=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(s==-1){if(D(c))continue;return}if(!U(c,s+1)){c.ch=s;continue}O.lastIndex=s,c.ch=s;var d=O.exec(c.text);if(d&&d.index==s)return d}}function _(c){for(;;){O.lastIndex=c.ch;var s=O.exec(c.text);if(!s){if(P(c))continue;return}if(!U(c,s.index+1)){c.ch=s.index+1;continue}return c.ch=s.index+s[0].length,s}}function C(c){for(;;){var s=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(s==-1){if(D(c))continue;return}if(!U(c,s+1)){c.ch=s;continue}var d=c.text.lastIndexOf("/",s),l=d>-1&&!/\S/.test(c.text.slice(d+1,s));return c.ch=s+1,l?"selfClose":"regular"}}function A(c,s){for(var d=[];;){var l=_(c),S,m=c.line,f=c.ch-(l?l[0].length:0);if(!l||!(S=E(c)))return;if(S=="selfClose")continue;if(l[1]){for(var w=d.length-1;w>=0;--w)if(d[w]==l[2]){d.length=w;break}if(w<0&&(!s||s==l[2]))return{tag:l[2],from:V(m,f),to:V(c.line,c.ch)}}else d.push(l[2])}}function v(c,s){for(var d=[];;){var l=C(c);if(!l)return;if(l=="selfClose"){b(c);continue}var S=c.line,m=c.ch,f=b(c);if(!f)return;if(f[1])d.push(f[2]);else{for(var w=d.length-1;w>=0;--w)if(d[w]==f[2]){d.length=w;break}if(w<0&&(!s||s==f[2]))return{tag:f[2],from:V(c.line,c.ch),to:V(S,m)}}}}re.registerHelper("fold","xml",function(c,s){for(var d=new F(c,s.line,0);;){var l=_(d);if(!l||d.line!=s.line)return;var S=E(d);if(!S)return;if(!l[1]&&S!="selfClose"){var m=V(d.line,d.ch),f=A(d,l[2]);return f&&R(f.from,m)>0?{from:m,to:f.from}:null}}}),re.findMatchingTag=function(c,s,d){var l=new F(c,s.line,s.ch,d);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var S=E(l),m=S&&V(l.line,l.ch),f=S&&b(l);if(!S||!f||R(l,s)>0)return;var w={from:V(l.line,l.ch),to:m,tag:f[2]};return S=="selfClose"?{open:w,close:null,at:"open"}:f[1]?{open:v(l,f[2]),close:w,at:"close"}:(l=new F(c,m.line,m.ch,d),{open:w,close:A(l,f[2]),at:"open"})},re.findEnclosingTag=function(c,s,d,l){for(var S=new F(c,s.line,s.ch,d);;){var m=v(S,l);if(!m)break;var f=new F(c,s.line,s.ch,d),w=A(f,m.tag);if(w)return{open:m,close:w}}},re.scanForClosingTag=function(c,s,d,l){var S=new F(c,s.line,s.ch,l?{from:0,to:l}:null);return A(S,d)}})},p5ED:function(Fe,Le,z){"use strict";var re=z("+L6B"),V=z("2/Rp"),R=z("5Dmo"),G=z("3S7+"),k=z("k1fw"),O=z("tJVT"),F=z("cDcd"),U=z.n(F),P=z("vHTk"),D=z.n(P),E=z("yEEn"),b=z("ZW9T"),_=z("1vsH");Le.a=function(C){var A=C.name,v=C.data,c=C.theme,s=C.type,d=C.filename,l=C.monacoEditor,S=C.className,m=C.style,f=C.close,w=C.onClose,g=C.hasMask,h=Object(F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),a=Object(O.a)(h,2),u=a[0],o=a[1],y=Object(F.useState)(""),p=Object(O.a)(y,2),x=p[0],M=p[1],N,j=1024*1024,W=10*j,L=Object(F.useRef)();s==="office"&&(N=Object(_.V)(v).filesize,N>W&&(s="other")),d&&(l.filename=d),Object(F.useEffect)(function(){var Y,ee,oe=(Y=document.cookie)===null||Y===void 0||((ee=Y.replace(/\s/g,""))===null||ee===void 0)?void 0:ee.split(";");oe==null||oe.map(function(xe){var ve=xe.split("=");ve[0]==="_educoder_session"&&M(ve[1])})},[]);var I=function(){if(v.startsWith("http")||v.startsWith("/")){K();return}Object(_.z)(d||"educoder",v,d)},K=function(){Object(_.x)(d||A,v)};return console.log("data:",v,"fileanme:",d," name:",A),U.a.createElement("div",{style:Object(k.a)({},m||{}),className:"".concat(g&&D.a.bgBlack," ").concat(s?D.a.wrp:"hide")},f&&U.a.createElement("div",{className:D.a.close,ref:L},U.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return L.current}},U.a.createElement("span",{onClick:K},U.a.createElement("i",{className:"icon-quxiaozhiding"}))),U.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return L.current}},U.a.createElement("span",{className:"",onClick:w},U.a.createElement("i",{className:"icon-guanbi1"})))),U.a.createElement("div",{className:"".concat(D.a[S]," ").concat(S," ").concat(D.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&U.a.createElement(b.b,l)),s==="audio"&&U.a.createElement("audio",{src:"".concat(v!=null&&v.startsWith("/")||(v==null?void 0:v.indexOf("https://"))>-1?v:"data:audio/mp3;base64,").concat(v),autoPlay:!0}),s==="video"&&U.a.createElement(U.a.Fragment,null,v!=null&&v.startsWith("/")?U.a.createElement("video",{controls:!0,src:"".concat(v),autoPlay:!0}):U.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(v),autoPlay:!0})),s==="html"&&U.a.createElement("iframe",{src:v+"&disposition=inline"}),s==="pdf"&&U.a.createElement("embed",{className:D.a.embed,src:v}),s==="image"&&U.a.createElement(U.a.Fragment,null,U.a.createElement("img",{src:"".concat(v!=null&&v.startsWith("/")||(v==null?void 0:v.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(v)})),s==="other"&&U.a.createElement("div",null,U.a.createElement(V.a,{type:"primary",size:"large",onClick:I},U.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&U.a.createElement(V.a,{type:"primary",size:"large",onClick:I},U.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Fe,Le,z){},pAaK:function(Fe,Le,z){Fe.exports={flex_box_center:"flex_box_center___3d46B",flex_space_between:"flex_space_between___3a07p",flex_box_vertical_center:"flex_box_vertical_center___3U-TP",flex_box_center_end:"flex_box_center_end___2f78_",flex_box_column:"flex_box_column___2G3XJ",bg:"bg___1MTM3",title:"title___161Lo",replyList:"replyList___3TAxX","nav-tab":"nav-tab___2QveN",buttonFixed:"buttonFixed___3jsue",exitComment:"exitComment___2ZV_r",nextComment:"nextComment___1M4hZ",modal:"modal___14a4J",MdEditor:"MdEditor___2fxIJ"}},qgvg:function(Fe,Le){Fe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1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+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"rAM+":function(Fe,Le,z){"use strict";z.d(Le,"a",function(){return V});var re=z("Qw5x");function V(R,G){var k;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(k=Object(re.a)(R))||G&&R&&typeof R.length=="number"){k&&(R=k);var O=0,F=function(){};return{s:F,n:function(){return O>=R.length?{done:!0}:{done:!1,value:R[O++]}},e:function(b){throw b},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 U=!0,P=!1,D;return{s:function(){k=R[Symbol.iterator]()},n:function(){var b=k.next();return U=b.done,b},e:function(b){P=!0,D=b},f:function(){try{!U&&k.return!=null&&k.return()}finally{if(P)throw D}}}}},rUJ1:function(Fe,Le){const z=/[&<>"']/,re=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,G={"&":"&","<":"<",">":">",'"':""","'":"'"},k=g=>G[g];function O(g,h){if(h){if(z.test(g))return g.replace(re,k)}else if(V.test(g))return g.replace(R,k);return g}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(g){return g.replace(F,(h,a)=>(a=a.toLowerCase(),a==="colon"?":":a.charAt(0)==="#"?a.charAt(1)==="x"?String.fromCharCode(parseInt(a.substring(2),16)):String.fromCharCode(+a.substring(1)):""))}const P=/(^|[^\[])\^/g;function D(g,h){g=g.source||g,h=h||"";const a={replace:(u,o)=>(o=o.source||o,o=o.replace(P,"$1"),g=g.replace(u,o),a),getRegex:()=>new RegExp(g,h)};return a}const E=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(g,h,a){if(g){let u;try{u=decodeURIComponent(U(a)).replace(E,"").toLowerCase()}catch(o){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}h&&!b.test(a)&&(a=s(h,a));try{a=encodeURI(a).replace(/%25/g,"%")}catch(u){return null}return a}const C={},A=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(g,h){C[" "+g]||(A.test(g)?C[" "+g]=g+"/":C[" "+g]=m(g,"/",!0)),g=C[" "+g];const a=g.indexOf(":")===-1;return h.substring(0,2)==="//"?a?h:g.replace(v,"$1")+h:h.charAt(0)==="/"?a?h:g.replace(c,"$1")+h:g+h}const d={exec:function(){}};function l(g){let h=1,a,u;for(;h<arguments.length;h++){a=arguments[h];for(u in a)Object.prototype.hasOwnProperty.call(a,u)&&(g[u]=a[u])}return g}function S(g,h){const a=g.replace(/\|/g,(y,p,x)=>{let M=!1,N=p;for(;--N>=0&&x[N]==="\\";)M=!M;return M?"|":" |"}),u=a.split(/ \|/);let o=0;if(u.length>h)u.splice(h);else for(;u.length<h;)u.push("");for(;o<u.length;o++)u[o]=u[o].trim().replace(/\\\|/g,"|");return u}function m(g,h,a){const u=g.length;if(u===0)return"";let o=0;for(;o<u;){const y=g.charAt(u-o-1);if(y===h&&!a)o++;else if(y!==h&&a)o++;else break}return g.substr(0,u-o)}function f(g,h){if(g.indexOf(h[1])===-1)return-1;const a=g.length;let u=0,o=0;for(;o<a;o++)if(g[o]==="\\")o++;else if(g[o]===h[0])u++;else if(g[o]===h[1]&&(u--,u<0))return o;return-1}function w(g){g&&g.sanitize&&!g.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Fe.exports={escape:O,unescape:U,edit:D,cleanUrl:_,resolveUrl:s,noopTest:d,merge:l,splitCells:S,rtrim:m,findClosingBracket:f,checkSanitizeDeprecation:w}},tWlo:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6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CXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Fe,Le,z){typeof window!="undefined"&&function(V,R){Fe.exports=R()}(this,function(){return function(re){var V={};function R(G){if(V[G])return V[G].exports;var k=V[G]={i:G,l:!1,exports:{}};return re[G].call(k.exports,k,k.exports,R),k.l=!0,k.exports}return R.m=re,R.c=V,R.d=function(G,k,O){R.o(G,k)||Object.defineProperty(G,k,{enumerable:!0,get:O})},R.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},R.t=function(G,k){if(k&1&&(G=R(G)),k&8)return G;if(k&4&&typeof G=="object"&&G&&G.__esModule)return G;var O=Object.create(null);if(R.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:G}),k&2&&typeof G!="string")for(var F in G)R.d(O,F,function(U){return G[U]}.bind(null,F));return O},R.n=function(G){var k=G&&G.__esModule?function(){return G.default}:function(){return G};return R.d(k,"a",k),k},R.o=function(G,k){return Object.prototype.hasOwnProperty.call(G,k)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(re,V,R){"use strict";var G=Object.prototype.hasOwnProperty,k="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(k=!1));function F(E,b,_){this.fn=E,this.context=b,this.once=_||!1}function U(E,b,_,C,A){if(typeof _!="function")throw new TypeError("The listener must be a function");var v=new F(_,C||E,A),c=k?k+b:b;return E._events[c]?E._events[c].fn?E._events[c]=[E._events[c],v]:E._events[c].push(v):(E._events[c]=v,E._eventsCount++),E}function P(E,b){--E._eventsCount===0?E._events=new O:delete E._events[b]}function D(){this._events=new O,this._eventsCount=0}D.prototype.eventNames=function(){var b=[],_,C;if(this._eventsCount===0)return b;for(C in _=this._events)G.call(_,C)&&b.push(k?C.slice(1):C);return Object.getOwnPropertySymbols?b.concat(Object.getOwnPropertySymbols(_)):b},D.prototype.listeners=function(b){var _=k?k+b:b,C=this._events[_];if(!C)return[];if(C.fn)return[C.fn];for(var A=0,v=C.length,c=new Array(v);A<v;A++)c[A]=C[A].fn;return c},D.prototype.listenerCount=function(b){var _=k?k+b:b,C=this._events[_];return C?C.fn?1:C.length:0},D.prototype.emit=function(b,_,C,A,v,c){var s=k?k+b:b;if(!this._events[s])return!1;var d=this._events[s],l=arguments.length,S,m;if(d.fn){d.once&&this.removeListener(b,d.fn,void 0,!0);switch(l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,_),!0;case 3:return d.fn.call(d.context,_,C),!0;case 4:return d.fn.call(d.context,_,C,A),!0;case 5:return d.fn.call(d.context,_,C,A,v),!0;case 6:return d.fn.call(d.context,_,C,A,v,c),!0}for(m=1,S=new Array(l-1);m<l;m++)S[m-1]=arguments[m];d.fn.apply(d.context,S)}else{var f=d.length,w;for(m=0;m<f;m++){d[m].once&&this.removeListener(b,d[m].fn,void 0,!0);switch(l){case 1:d[m].fn.call(d[m].context);break;case 2:d[m].fn.call(d[m].context,_);break;case 3:d[m].fn.call(d[m].context,_,C);break;case 4:d[m].fn.call(d[m].context,_,C,A);break;default:if(!S)for(w=1,S=new Array(l-1);w<l;w++)S[w-1]=arguments[w];d[m].fn.apply(d[m].context,S)}}}return!0},D.prototype.on=function(b,_,C){return U(this,b,_,C,!1)},D.prototype.once=function(b,_,C){return U(this,b,_,C,!0)},D.prototype.removeListener=function(b,_,C,A){var v=k?k+b:b;if(!this._events[v])return this;if(!_)return P(this,v),this;var c=this._events[v];if(c.fn)c.fn===_&&(!A||c.once)&&(!C||c.context===C)&&P(this,v);else{for(var s=0,d=[],l=c.length;s<l;s++)(c[s].fn!==_||A&&!c[s].once||C&&c[s].context!==C)&&d.push(c[s]);d.length?this._events[v]=d.length===1?d[0]:d:P(this,v)}return this},D.prototype.removeAllListeners=function(b){var _;return b?(_=k?k+b:b,this._events[_]&&P(this,_)):(this._events=new O,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=k,D.EventEmitter=D,re.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(re,V,R){(function(G){var k=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,F=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,P={buildAbsoluteURL:function(D,E,b){if(b=b||{},D=D.trim(),E=E.trim(),!E){if(!b.alwaysNormalize)return D;var _=P.parseURL(D);if(!_)throw new Error("Error trying to parse base URL.");return _.path=P.normalizePath(_.path),P.buildURLFromParts(_)}var C=P.parseURL(E);if(!C)throw new Error("Error trying to parse relative URL.");if(C.scheme)return b.alwaysNormalize?(C.path=P.normalizePath(C.path),P.buildURLFromParts(C)):E;var A=P.parseURL(D);if(!A)throw new Error("Error trying to parse base URL.");if(!A.netLoc&&A.path&&A.path[0]!=="/"){var v=O.exec(A.path);A.netLoc=v[1],A.path=v[2]}A.netLoc&&!A.path&&(A.path="/");var c={scheme:A.scheme,netLoc:C.netLoc,path:null,params:C.params,query:C.query,fragment:C.fragment};if(!C.netLoc&&(c.netLoc=A.netLoc,C.path[0]!=="/"))if(!C.path)c.path=A.path,C.params||(c.params=A.params,C.query||(c.query=A.query));else{var s=A.path,d=s.substring(0,s.lastIndexOf("/")+1)+C.path;c.path=P.normalizePath(d)}return c.path===null&&(c.path=b.alwaysNormalize?P.normalizePath(C.path):C.path),P.buildURLFromParts(c)},parseURL:function(D){var E=k.exec(D);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(F,"");D.length!==(D=D.replace(U,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};re.exports=P})(this)},"./node_modules/webworkify-webpack/index.js":function(re,V,R){function G(b){var _={};function C(v){if(_[v])return _[v].exports;var c=_[v]={i:v,l:!1,exports:{}};return b[v].call(c.exports,c,c.exports,C),c.l=!0,c.exports}C.m=b,C.c=_,C.i=function(v){return v},C.d=function(v,c,s){C.o(v,c)||Object.defineProperty(v,c,{configurable:!1,enumerable:!0,get:s})},C.r=function(v){Object.defineProperty(v,"__esModule",{value:!0})},C.n=function(v){var c=v&&v.__esModule?function(){return v.default}:function(){return v};return C.d(c,"a",c),c},C.o=function(v,c){return Object.prototype.hasOwnProperty.call(v,c)},C.p="/",C.oe=function(v){throw console.error(v),v};var A=C(C.s=ENTRY_MODULE);return A.default||A}var k="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+k+").*?\\)";function F(b){return(b+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(b){return!isNaN(1*b)}function P(b,_,C){var A={};A[C]=[];var v=_.toString(),c=v.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return A;for(var s=c[1],d=new RegExp("(\\\\n|\\W)"+F(s)+O,"g"),l;l=d.exec(v);){if(l[3]==="dll-reference")continue;A[C].push(l[3])}for(d=new RegExp("\\("+F(s)+'\\("(dll-reference\\s('+k+'))"\\)\\)'+O,"g");l=d.exec(v);)b[l[2]]||(A[C].push(l[1]),b[l[2]]=R(l[1]).m),A[l[2]]=A[l[2]]||[],A[l[2]].push(l[4]);for(var S=Object.keys(A),m=0;m<S.length;m++)for(var f=0;f<A[S[m]].length;f++)U(A[S[m]][f])&&(A[S[m]][f]=1*A[S[m]][f]);return A}function D(b){var _=Object.keys(b);return _.reduce(function(C,A){return C||b[A].length>0},!1)}function E(b,_){for(var C={main:[_]},A={main:[]},v={main:{}};D(C);)for(var c=Object.keys(C),s=0;s<c.length;s++){var d=c[s],l=C[d],S=l.pop();if(v[d]=v[d]||{},v[d][S]||!b[d][S])continue;v[d][S]=!0,A[d]=A[d]||[],A[d].push(S);for(var m=P(b,b[d][S],d),f=Object.keys(m),w=0;w<f.length;w++)C[f[w]]=C[f[w]]||[],C[f[w]]=C[f[w]].concat(m[f[w]])}return A}re.exports=function(b,_){_=_||{};var C={main:R.m},A=_.all?{main:Object.keys(C.main)}:E(C,b),v="";Object.keys(A).filter(function(S){return S!=="main"}).forEach(function(S){for(var m=0;A[S][m];)m++;A[S].push(m),C[S][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",v=v+"var "+S+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+A[S].map(function(f){return""+JSON.stringify(f)+": "+C[S][f].toString()}).join(",")+`});
|
|
`}),v=v+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(b))+")({"+A.main.map(function(S){return""+JSON.stringify(S)+": "+C.main[S].toString()}).join(",")+"}))(self);";var c=new window.Blob([v],{type:"text/javascript"});if(_.bare)return c;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,d=s.createObjectURL(c),l=new window.Worker(d);return l.objectURL=d,l}},"./src/config.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"hlsDefaultConfig",function(){return w}),R.d(V,"mergeConfig",function(){return h}),R.d(V,"enableStreamingMode",function(){return a});var G=R("./src/controller/abr-controller.ts"),k=R("./src/controller/audio-stream-controller.ts"),O=R("./src/controller/audio-track-controller.ts"),F=R("./src/controller/subtitle-stream-controller.ts"),U=R("./src/controller/subtitle-track-controller.ts"),P=R("./src/controller/buffer-controller.ts"),D=R("./src/controller/timeline-controller.ts"),E=R("./src/controller/cap-level-controller.ts"),b=R("./src/controller/fps-controller.ts"),_=R("./src/controller/eme-controller.ts"),C=R("./src/controller/cmcd-controller.ts"),A=R("./src/utils/xhr-loader.ts"),v=R("./src/utils/fetch-loader.ts"),c=R("./src/utils/cues.ts"),s=R("./src/utils/mediakeys-helper.ts"),d=R("./src/utils/logger.ts");function l(){return l=Object.assign||function(u){for(var o=1;o<arguments.length;o++){var y=arguments[o];for(var p in y)Object.prototype.hasOwnProperty.call(y,p)&&(u[p]=y[p])}return u},l.apply(this,arguments)}function S(u,o){var y=Object.keys(u);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(u);o&&(p=p.filter(function(x){return Object.getOwnPropertyDescriptor(u,x).enumerable})),y.push.apply(y,p)}return y}function m(u){for(var o=1;o<arguments.length;o++){var y=arguments[o]!=null?arguments[o]:{};o%2?S(Object(y),!0).forEach(function(p){f(u,p,y[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(y)):S(Object(y)).forEach(function(p){Object.defineProperty(u,p,Object.getOwnPropertyDescriptor(y,p))})}return u}function f(u,o,y){return o in u?Object.defineProperty(u,o,{value:y,enumerable:!0,configurable:!0,writable:!0}):u[o]=y,u}var w=m(m({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:A.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:P.default,capLevelController:E.default,fpsController:b.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},g()),{},{subtitleStreamController:F.SubtitleStreamController,subtitleTrackController:U.default,timelineController:D.TimelineController,audioStreamController:k.default,audioTrackController:O.default,emeController:_.default,cmcdController:C.default});function g(){return{cueHandler:c.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function h(u,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return l({},u,o)}function a(u){var o=u.loader;if(o!==v.default&&o!==A.default)d.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var y=Object(v.fetchSupported)();y&&(u.loader=v.default,u.progressive=!0,u.enableSoftwareAES=!0,d.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/polyfills/number.ts"),k=R("./src/utils/ewma-bandwidth-estimator.ts"),O=R("./src/events.ts"),F=R("./src/utils/buffer-helper.ts"),U=R("./src/errors.ts"),P=R("./src/types/loader.ts"),D=R("./src/utils/logger.ts");function E(C,A){for(var v=0;v<A.length;v++){var c=A[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,c.key,c)}}function b(C,A,v){return A&&E(C.prototype,A),v&&E(C,v),C}var _=function(){function C(v){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=v;var c=v.config;this.bwEstimator=new k.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var A=C.prototype;return A.registerListeners=function(){var c=this.hls;c.on(O.Events.FRAG_LOADING,this.onFragLoading,this),c.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(O.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var c=this.hls;c.off(O.Events.FRAG_LOADING,this.onFragLoading,this),c.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(O.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},A.onFragLoading=function(c,s){var d=s.frag;if(d.type===P.PlaylistLevelType.MAIN&&!this.timer){var l;this.fragCurrent=d,this.partCurrent=(l=s.part)!=null?l:null,this.timer=self.setInterval(this.onCheck,100)}},A.onLevelLoaded=function(c,s){var d=this.hls.config;s.details.live?this.bwEstimator.update(d.abrEwmaSlowLive,d.abrEwmaFastLive):this.bwEstimator.update(d.abrEwmaSlowVoD,d.abrEwmaFastVoD)},A._abandonRulesCheck=function(){var c=this.fragCurrent,s=this.partCurrent,d=this.hls,l=d.autoLevelEnabled,S=d.config,m=d.media;if(!c||!m)return;var f=s?s.stats:c.stats,w=s?s.duration:c.duration;if(f.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!l||m.paused||!m.playbackRate||!m.readyState)return;var g=performance.now()-f.loading.start,h=Math.abs(m.playbackRate);if(g<=500*w/h)return;var a=d.levels,u=d.minAutoLevel,o=a[c.level],y=f.total||Math.max(f.loaded,Math.round(w*o.maxBitrate/8)),p=Math.max(1,f.bwEstimate?f.bwEstimate/8:f.loaded*1e3/g),x=(y-f.loaded)/p,M=m.currentTime,N=(F.BufferHelper.bufferInfo(m,M,S.maxBufferHole).end-M)/h;if(N>=2*w/h||x<=N)return;var j=Number.POSITIVE_INFINITY,W;for(W=c.level-1;W>u;W--){var L=a[W].maxBitrate;if(j=w*L/(8*.8*p),j<N)break}if(j>=x)return;var I=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+c.sn+(s?" part "+s.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
|
|
Current BW estimate: `+(Object(G.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+x.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+j.toFixed(3)+` s
|
|
Time to underbuffer: `+N.toFixed(3)+" s"),d.nextLoadLevel=W,this.bwEstimator.sample(g,f.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),d.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:s,stats:f})},A.onFragLoaded=function(c,s){var d=s.frag,l=s.part;if(d.type===P.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(d.sn)){var S=l?l.stats:d.stats,m=l?l.duration:d.duration;if(this.clearTimer(),this.lastLoadedFragLevel=d.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var f=this.hls.levels[d.level],w=(f.loaded?f.loaded.bytes:0)+S.loaded,g=(f.loaded?f.loaded.duration:0)+m;f.loaded={bytes:w,duration:g},f.realBitrate=Math.round(8*w/g)}if(d.bitrateTest){var h={stats:S,frag:d,part:l,id:d.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,h),d.bitrateTest=!1}}},A.onFragBuffered=function(c,s){var d=s.frag,l=s.part,S=l?l.stats:d.stats;if(S.aborted)return;if(d.type!==P.PlaylistLevelType.MAIN||d.sn==="initSegment")return;var m=S.parsing.end-S.loading.start;this.bwEstimator.sample(m,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),d.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},A.onError=function(c,s){switch(s.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},A.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},A.getNextABRAutoLevel=function(){var c=this.fragCurrent,s=this.partCurrent,d=this.hls,l=d.maxAutoLevel,S=d.config,m=d.minAutoLevel,f=d.media,w=s?s.duration:c?c.duration:0,g=f?f.currentTime:0,h=f&&f.playbackRate!==0?Math.abs(f.playbackRate):1,a=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,u=(F.BufferHelper.bufferInfo(f,g,S.maxBufferHole).end-g)/h,o=this.findBestLevel(a,m,l,u,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(o>=0)return o;D.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=w?Math.min(w,S.maxStarvationDelay):S.maxStarvationDelay,p=S.abrBandWidthFactor,x=S.abrBandWidthUpFactor;if(!u){var M=this.bitrateTestDelay;if(M){var N=w?Math.min(w,S.maxLoadingDelay):S.maxLoadingDelay;y=N-M,D.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),p=x=1}}return o=this.findBestLevel(a,m,l,u+y,p,x),Math.max(o,0)},A.findBestLevel=function(c,s,d,l,S,m){for(var f,w=this.fragCurrent,g=this.partCurrent,h=this.lastLoadedFragLevel,a=this.hls.levels,u=a[h],o=!!(u!=null&&(f=u.details)!==null&&f!==void 0&&f.live),y=u==null?void 0:u.codecSet,p=g?g.duration:w?w.duration:0,x=d;x>=s;x--){var M=a[x];if(!M||y&&M.codecSet!==y)continue;var N=M.details,j=(g?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||p,W=void 0;x<=h?W=S*c:W=m*c;var L=a[x].maxBitrate,I=L*j/W;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(W)+"/"+L+"/"+j+"/"+l+"/"+I),W>L&&(!I||o&&!this.bitrateTestDelay||I<l))return x}return-1},b(C,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,s=this.bwEstimator;if(c!==-1&&(!s||!s.canEstimate()))return c;var d=this.getNextABRAutoLevel();return c!==-1&&(d=Math.min(c,d)),d},set:function(c){this._nextAutoLevel=c}}]),C}();V.default=_},"./src/controller/audio-stream-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/polyfills/number.ts"),k=R("./src/controller/base-stream-controller.ts"),O=R("./src/events.ts"),F=R("./src/utils/buffer-helper.ts"),U=R("./src/controller/fragment-tracker.ts"),P=R("./src/types/level.ts"),D=R("./src/types/loader.ts"),E=R("./src/loader/fragment.ts"),b=R("./src/demux/chunk-cache.ts"),_=R("./src/demux/transmuxer-interface.ts"),C=R("./src/types/transmuxer.ts"),A=R("./src/controller/fragment-finders.ts"),v=R("./src/utils/discontinuities.ts"),c=R("./src/errors.ts"),s=R("./src/utils/logger.ts");function d(){return d=Object.assign||function(w){for(var g=1;g<arguments.length;g++){var h=arguments[g];for(var a in h)Object.prototype.hasOwnProperty.call(h,a)&&(w[a]=h[a])}return w},d.apply(this,arguments)}function l(w,g){w.prototype=Object.create(g.prototype),w.prototype.constructor=w,S(w,g)}function S(w,g){return S=Object.setPrototypeOf||function(a,u){return a.__proto__=u,a},S(w,g)}var m=100,f=function(w){l(g,w);function g(a,u){var o;return o=w.call(this,a,u,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var h=g.prototype;return h.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},h._registerListeners=function(){var u=this.hls;u.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(O.Events.ERROR,this.onError,this),u.on(O.Events.BUFFER_RESET,this.onBufferReset,this),u.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},h._unregisterListeners=function(){var u=this.hls;u.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(O.Events.ERROR,this.onError,this),u.off(O.Events.BUFFER_RESET,this.onBufferReset,this),u.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},h.onInitPtsFound=function(u,o){var y=o.frag,p=o.id,x=o.initPTS;if(p==="main"){var M=y.cc;this.initPTS[y.cc]=x,this.log("InitPTS for cc: "+M+" found from main: "+x),this.videoTrackCC=M,this.state===k.State.WAITING_INIT_PTS&&this.tick()}},h.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=k.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,o>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=k.State.IDLE):(this.loadedmetadata=!1,this.state=k.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},h.doTick=function(){switch(this.state){case k.State.IDLE:this.doTickIdle();break;case k.State.WAITING_TRACK:{var u,o=this.levels,y=this.trackId,p=o==null||((u=o[y])===null||u===void 0)?void 0:u.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=k.State.WAITING_INIT_PTS}break}case k.State.FRAG_LOADING_WAITING_RETRY:{var x,M=performance.now(),N=this.retryDate;(!N||M>=N||(x=this.media)!==null&&x!==void 0&&x.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 W=j.frag,L=j.part,I=j.cache,K=j.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=k.State.FRAG_LOADING;var Y=I.flush(),ee={frag:W,part:L,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(ee),K&&w.prototype._handleFragmentLoadComplete.call(this,ee)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+W.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),xe=F.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),ve=Object(A.fragmentWithinToleranceTest)(xe.end,this.config.maxFragLookUpTolerance,W);ve<0&&(s.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+xe.end+" is needed"),this.clearWaitingFragment())}}else this.state=k.State.IDLE}}this.onTickEnd()},h.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=k.State.IDLE)},h.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:u,y=o.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},h.doTickIdle=function(){var u,o,y=this.hls,p=this.levels,x=this.media,M=this.trackId,N=y.config;if(!p||!p[M])return;if(!x&&(this.startFragRequested||!N.startFragPrefetch))return;var j=p[M],W=j.details;if(!W||W.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(W)){this.state=k.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var L=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(L===null)return;var I=L.len,K=this.getMaxBufferLength(),Y=this.audioSwitch;if(I>=K&&!Y)return;if(!Y&&this._streamEnded(L,W)){y.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=k.State.ENDED;return}var ee=W.fragments,oe=ee[0].start,xe=L.end;if(Y){var ve=this.getLoadPosition();xe=ve,W.PTSKnown&&ve<oe&&((L.end>oe||L.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=oe+.05))}var ge=this.getNextFragment(xe,W);if(!ge){this.bufferFlushed=!0;return}((u=ge.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((o=ge.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ge,W):this.loadFragment(ge,W,xe)},h.getMaxBufferLength=function(){var u=w.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return o===null?u:Math.max(u,o.len)},h.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},h.onAudioTracksUpdated=function(u,o){var y=o.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(p){return new P.Level(p)})},h.onAudioTrackSwitching=function(u,o){var y=!!o.url;this.trackId=o.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(m):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=k.State.IDLE):this.state=k.State.STOPPED,this.tick()},h.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},h.onLevelLoaded=function(u,o){this.mainDetails=o.details},h.onAudioTrackLoaded=function(u,o){var y,p=this.levels,x=o.details,M=o.id;if(!p){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var N=p[M],j=0;if(x.live||(y=N.details)!==null&&y!==void 0&&y.live){var W=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!W)return;!N.details&&x.hasProgramDateTime&&W.hasProgramDateTime?(Object(v.alignMediaPlaylistByPDT)(x,W),j=x.fragments[0].start):j=this.alignPlaylists(x,N.details)}N.details=x,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(N.details,j),this.state===k.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=k.State.IDLE),this.tick()},h._handleFragmentLoadProgress=function(u){var o,y=u.frag,p=u.part,x=u.payload,M=this.config,N=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var W=j[N];console.assert(W,"Audio track is defined on fragment load progress");var L=W.details;console.assert(L,"Audio track details are defined on fragment load progress");var I=M.defaultAudioCodec||W.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new _.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[y.cc],ee=(o=y.initSegment)===null||o===void 0?void 0:o.data;if(Y!==void 0){var oe=!1,xe=p?p.index:-1,ve=xe!==-1,ge=new C.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,x.byteLength,xe,ve);K.push(x,ee,I,"",y,p,L.totalduration,oe,ge,Y)}else{s.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+L.startSN+" ,"+L.endSN+"],track "+N);var me=this.waitingData=this.waitingData||{frag:y,part:p,cache:new b.default,complete:!1},ce=me.cache;ce.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=k.State.WAITING_INIT_PTS}},h._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,u)},h.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},h.onBufferCreated=function(u,o){var y=o.tracks.audio;y&&(this.mediaBuffer=y.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},h.onFragBuffered=function(u,o){var y=o.frag,p=o.part;if(y.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(p?" p: "+p.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,p)},h.onError=function(u,o){switch(o.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,o);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==k.State.ERROR&&this.state!==k.State.STOPPED&&(this.state=o.fatal?k.State.ERROR:k.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var y=!0,p=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);p&&p.len>.5&&(y=!this.reduceMaxBufferLength(p.len)),y&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},h.onBufferFlushed=function(u,o){var y=o.type;y===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},h._handleTransmuxComplete=function(u){var o,y="audio",p=this.hls,x=u.remuxResult,M=u.chunkMeta,N=this.getCurrentContext(M);if(!N){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var j=N.frag,W=N.part,L=x.audio,I=x.text,K=x.id3,Y=x.initSegment;if(this.fragContextChanged(j))return;if(this.state=k.State.PARSING,this.audioSwitch&&L&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,j,M),p.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:y,tracks:Y.tracks})),L){var ee=L.startPTS,oe=L.endPTS,xe=L.startDTS,ve=L.endDTS;W&&(W.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ee,endPTS:oe,startDTS:xe,endDTS:ve}),j.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ee,oe,xe,ve),this.bufferFragmentData(L,j,W,M)}if(K!=null&&(o=K.samples)!==null&&o!==void 0&&o.length){var ge=d({frag:j,id:y},K);p.trigger(O.Events.FRAG_PARSING_METADATA,ge)}if(I){var me=d({frag:j,id:y},I);p.trigger(O.Events.FRAG_PARSING_USERDATA,me)}},h._bufferInitSegment=function(u,o,y){if(this.state!==k.State.PARSING)return;u.video&&delete u.video;var p=u.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(O.Events.BUFFER_CODECS,u);var x=p.initSegment;if(x!=null&&x.byteLength){var M={type:"audio",frag:o,part:null,chunkMeta:y,parent:o.type,data:x};this.hls.trigger(O.Events.BUFFER_APPENDING,M)}this.tick()},h.loadFragment=function(u,o,y){var p=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||p===U.FragmentState.NOT_LOADED||p===U.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):o.live&&!Object(G.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=k.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,u,o,y)))},h.completeAudioSwitch=function(){var u=this.hls,o=this.media,y=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:y})},g}(k.default);V.default=f},"./src/controller/audio-track-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/events.ts"),k=R("./src/errors.ts"),O=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function U(_,C){for(var A=0;A<C.length;A++){var v=C[A];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(_,v.key,v)}}function P(_,C,A){return C&&U(_.prototype,C),A&&U(_,A),_}function D(_,C){_.prototype=Object.create(C.prototype),_.prototype.constructor=_,E(_,C)}function E(_,C){return E=Object.setPrototypeOf||function(v,c){return v.__proto__=c,v},E(_,C)}var b=function(_){D(C,_);function C(v){var c;return c=_.call(this,v,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var A=C.prototype;return A.registerListeners=function(){var c=this.hls;c.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(G.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var c=this.hls;c.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(G.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,_.prototype.destroy.call(this)},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},A.onManifestParsed=function(c,s){this.tracks=s.audioTracks||[]},A.onAudioTrackLoaded=function(c,s){var d=s.id,l=s.details,S=this.tracksInGroup[d];if(!S){this.warn("Invalid audio track id "+d);return}var m=S.details;S.details=s.details,this.log("audioTrack "+d+" loaded ["+l.startSN+"-"+l.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,s,m))},A.onLevelLoading=function(c,s){this.switchLevel(s.level)},A.onLevelSwitching=function(c,s){this.switchLevel(s.level)},A.switchLevel=function(c){var s=this.hls.levels[c];if(!(s!=null&&s.audioGroupIds))return;var d=s.audioGroupIds[s.urlId];if(this.groupId!==d){this.groupId=d;var l=this.tracks.filter(function(m){return!d||m.groupId===d});this.selectDefaultTrack&&!l.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var S={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},A.onError=function(c,s){if(_.prototype.onError.call(this,c,s),s.fatal||!s.context)return;s.context.type===F.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},A.setAudioTrack=function(c){var s=this.tracksInGroup;if(c<0||c>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var d=s[this.trackId];this.log("Now switching to audio-track index "+c);var l=s[c],S=l.id,m=l.groupId,f=m===void 0?"":m,w=l.name,g=l.type,h=l.url;if(this.trackId=c,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:f,name:w,type:g,url:h}),l.details&&!l.details.live)return;var a=this.switchParams(l.url,d==null?void 0:d.details);this.loadPlaylist(a)},A.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,d=this.findTrackId(s)||this.findTrackId();d!==-1?this.setAudioTrack(d):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},A.findTrackId=function(c){for(var s=this.tracksInGroup,d=0;d<s.length;d++){var l=s[d];if((!this.selectDefaultTrack||l.default)&&(!c||c===l.name))return l.id}return-1},A.loadPlaylist=function(c){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var d=s.id,l=s.groupId,S=s.url;if(c)try{S=c.addDirectives(S)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+d),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:S,id:d,groupId:l,deliveryDirectives:c||null})}},P(C,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),C}(O.default);V.default=b},"./src/controller/base-playlist-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return P});var G=R("./src/polyfills/number.ts"),k=R("./src/types/level.ts"),O=R("./src/controller/level-helper.ts"),F=R("./src/utils/logger.ts"),U=R("./src/errors.ts"),P=function(){function D(b,_){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=F.logger.log.bind(F.logger,_+":"),this.warn=F.logger.warn.bind(F.logger,_+":"),this.hls=b}var E=D.prototype;return E.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},E.onError=function(_,C){C.fatal&&C.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},E.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},E.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},E.stopLoad=function(){this.canLoad=!1,this.clearTimer()},E.switchParams=function(_,C){var A=C==null?void 0:C.renditionReports;if(A)for(var v=0;v<A.length;v++){var c=A[v],s=""+c.URI;if(s===_.substr(-s.length)){var d=parseInt(c["LAST-MSN"]),l=parseInt(c["LAST-PART"]);if(C&&this.hls.config.lowLatencyMode){var S=Math.min(C.age-C.partTarget,C.targetduration);l!==void 0&&S>C.partTarget&&(l+=1)}if(Object(G.isFiniteNumber)(d))return new k.HlsUrlParameters(d,Object(G.isFiniteNumber)(l)?l:void 0,k.HlsSkip.No)}}},E.loadPlaylist=function(_){},E.shouldLoadTrack=function(_){return this.canLoad&&_&&!!_.url&&(!_.details||_.details.live)},E.playlistLoaded=function(_,C,A){var v=this,c=C.details,s=C.stats,d=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(c.advancedDateTime=Date.now()-d,c.live||A!=null&&A.live){if(c.reloaded(A),A&&this.log("live playlist "+_+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),A&&c.fragments.length>0&&Object(O.mergeDetails)(A,c),!this.canLoad||!c.live)return;var l,S=void 0,m=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var f=this.hls.config.lowLatencyMode,w=c.lastPartSn,g=c.endSN,h=c.lastPartIndex,a=h!==-1,u=w===g,o=f?0:h;a?(S=u?g+1:w,m=u?o:h+1):S=g+1;var y=c.age,p=y+c.ageHeader,x=Math.min(p-c.partTarget,c.targetduration*1.5);if(x>0){if(A&&x>A.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+A.tuneInGoal+" to: "+x+" with playlist age: "+c.age),x=0;else{var M=Math.floor(x/c.targetduration);if(S+=M,m!==void 0){var N=Math.round(x%c.targetduration/c.partTarget);m+=N}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+x+" skip sn "+M+" to part "+m)}c.tuneInGoal=x}if(l=this.getDeliveryDirectives(c,C.deliveryDirectives,S,m),f||!u){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(c,C.deliveryDirectives,S,m);var j=Object(O.computeReloadInterval)(c,s);S!==void 0&&c.canBlockReload&&(j-=c.partTarget||1),this.log("reload live playlist "+_+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return v.loadPlaylist(l)},j)}else this.clearTimer()},E.getDeliveryDirectives=function(_,C,A,v){var c=Object(k.getSkipValue)(_,A);return C!=null&&C.skip&&_.deltaUpdateFailed&&(A=C.msn,v=C.part,c=k.HlsSkip.No),new k.HlsUrlParameters(A,v,c)},E.retryLoadingOrFail=function(_){var C=this,A=this.hls.config,v=this.retryCount<A.levelLoadingMaxRetry;if(v){var c;if(this.retryCount++,_.details.indexOf("LoadTimeOut")>-1&&(c=_.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+_.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*A.levelLoadingRetryDelay,A.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return C.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+_.details+'"')}}else this.warn('cannot recover from error "'+_.details+'"'),this.clearTimer(),_.fatal=!0;return v},D}()},"./src/controller/base-stream-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"State",function(){return g}),R.d(V,"default",function(){return h});var G=R("./src/polyfills/number.ts"),k=R("./src/task-loop.ts"),O=R("./src/controller/fragment-tracker.ts"),F=R("./src/utils/buffer-helper.ts"),U=R("./src/utils/logger.ts"),P=R("./src/events.ts"),D=R("./src/errors.ts"),E=R("./src/types/transmuxer.ts"),b=R("./src/utils/mp4-tools.ts"),_=R("./src/utils/discontinuities.ts"),C=R("./src/controller/fragment-finders.ts"),A=R("./src/controller/level-helper.ts"),v=R("./src/loader/fragment-loader.ts"),c=R("./src/crypt/decrypter.ts"),s=R("./src/utils/time-ranges.ts"),d=R("./src/types/loader.ts");function l(a,u){for(var o=0;o<u.length;o++){var y=u[o];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(a,y.key,y)}}function S(a,u,o){return u&&l(a.prototype,u),o&&l(a,o),a}function m(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function f(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,w(a,u)}function w(a,u){return w=Object.setPrototypeOf||function(y,p){return y.__proto__=p,y},w(a,u)}var g={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},h=function(a){f(u,a);function u(y,p,x){var M;return M=a.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=g.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=x,M.log=U.logger.log.bind(U.logger,x+":"),M.warn=U.logger.warn.bind(U.logger,x+":"),M.hls=y,M.fragmentLoader=new v.default(y.config),M.fragmentTracker=p,M.config=y.config,M.decrypter=new c.default(y,y.config),y.on(P.Events.KEY_LOADED,M.onKeyLoaded,m(M)),M}var o=u.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(p){},o.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=g.STOPPED},o._streamEnded=function(p,x){var M=this.fragCurrent,N=this.fragmentTracker;if(!x.live&&M&&M.sn===x.endSN&&!p.nextStart){var j=N.getState(M);return j===O.FragmentState.PARTIAL||j===O.FragmentState.OK}return!1},o.onMediaAttached=function(p,x){var M=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===g.STOPPED&&this.startLoad(N.startPosition)},o.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var p=this.config,x=this.fragCurrent,M=this.media,N=this.mediaBuffer,j=this.state,W=M?M.currentTime:0,L=F.BufferHelper.bufferInfo(N||M,W,p.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+j),j===g.ENDED)this.resetLoadingState();else if(x&&!L.len){var I=p.maxFragLookUpTolerance,K=x.start-I,Y=x.start+x.duration+I,ee=W>Y;(W<K||ee)&&(ee&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=W),!this.loadedmetadata&&!L.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(p,x){if(this.state!==g.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=g.IDLE;var M=this.levels[x.frag.level].details;M&&this.loadFragment(x.frag,M,x.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),a.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=g.STOPPED,this.hls.off(P.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,a.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(p,x){this.log("Loading key for "+p.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=g.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(P.Events.KEY_LOADING,{frag:p})},o.loadFragment=function(p,x,M){this._loadFragForPlayback(p,x,M)},o._loadFragForPlayback=function(p,x,M){var N=this,j=function(L){if(N.fragContextChanged(p)){N.warn("Fragment "+p.sn+(L.part?" p: "+L.part.index:"")+" of level "+p.level+" was dropped during download."),N.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,N._handleFragmentLoadProgress(L)};this._doFragLoad(p,x,M,j).then(function(W){if(!W)return;N.fragLoadError=0;var L=N.state;if(N.fragContextChanged(p)){(L===g.FRAG_LOADING||L===g.BACKTRACKING||!N.fragCurrent&&L===g.PARSING)&&(N.fragmentTracker.removeFragment(p),N.state=g.IDLE);return}if("payload"in W&&(N.log("Loaded fragment "+p.sn+" of level "+p.level),N.hls.trigger(P.Events.FRAG_LOADED,W),N.state===g.BACKTRACKING)){N.fragmentTracker.backtrack(p,W),N.resetFragmentLoading(p);return}N._handleFragmentLoadComplete(W)}).catch(function(W){N.warn(W),N.resetFragmentLoading(p)})},o.flushMainBuffer=function(p,x,M){if(M===void 0&&(M=null),!(p-x))return;var N={startOffset:p,endOffset:x,type:M};this.fragLoadError=0,this.hls.trigger(P.Events.BUFFER_FLUSHING,N)},o._loadInitSegment=function(p){var x=this;this._doFragLoad(p).then(function(M){if(!M||x.fragContextChanged(p)||!x.levels)throw new Error("init load aborted");return M}).then(function(M){var N=x.hls,j=M.payload,W=p.decryptdata;if(j&&j.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var L=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(j),W.key.buffer,W.iv.buffer).then(function(I){var K=self.performance.now();return N.trigger(P.Events.FRAG_DECRYPTED,{frag:p,payload:I,stats:{tstart:L,tdecrypt:K}}),M.payload=I,M})}return M}).then(function(M){var N=x.fragCurrent,j=x.hls,W=x.levels;if(!W)throw new Error("init load aborted, missing levels");var L=W[p.level].details;console.assert(L,"Level details are defined when init segment is loaded");var I=p.stats;x.state=g.IDLE,x.fragLoadError=0,p.data=new Uint8Array(M.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),M.frag===N&&j.trigger(P.Events.FRAG_BUFFERED,{stats:I,frag:N,part:null,id:p.type}),x.tick()}).catch(function(M){x.warn(M),x.resetFragmentLoading(p)})},o.fragContextChanged=function(p){var x=this.fragCurrent;return!p||!x||p.level!==x.level||p.sn!==x.sn||p.urlId!==x.urlId},o.fragBufferedComplete=function(p,x){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+s.default.toString(F.BufferHelper.getBuffered(M))),this.state=g.IDLE,this.tick()},o._handleFragmentLoadComplete=function(p){var x=this.transmuxer;if(!x)return;var M=p.frag,N=p.part,j=p.partsLoaded,W=!j||j.length===0||j.some(function(I){return!I}),L=new E.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,N?N.index:-1,!W);x.flush(L)},o._handleFragmentLoadProgress=function(p){},o._doFragLoad=function(p,x,M,N){var j=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(p.start,M||0),this.config.lowLatencyMode&&x){var W=x.partList;if(W&&N){M>p.end&&x.fragmentHint&&(p=x.fragmentHint);var L=this.getNextPart(W,p,M);if(L>-1){var I=W[L];return this.log("Loading part sn: "+p.sn+" p: "+I.index+" cc: "+p.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+L+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=g.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:p,part:W[L],targetBufferTime:M}),this.doFragPartsLoad(p,W,L,N).catch(function(K){return j.handleFragLoadError(K)})}else if(!p.url||this.loadedEndOfParts(W,M))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(M.toFixed(3))),Object(G.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=g.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:p,targetBufferTime:M}),this.fragmentLoader.load(p,N).catch(function(K){return j.handleFragLoadError(K)})},o.doFragPartsLoad=function(p,x,M,N){var j=this;return new Promise(function(W,L){var I=[],K=function Y(ee){var oe=x[ee];j.fragmentLoader.loadPart(p,oe,N).then(function(xe){I[oe.index]=xe;var ve=xe.part;j.hls.trigger(P.Events.FRAG_LOADED,xe);var ge=x[ee+1];if(ge&&ge.fragment===p)Y(ee+1);else return W({frag:p,part:ve,partsLoaded:I})}).catch(L)};K(M)})},o.handleFragLoadError=function(p){var x=p.data;return x&&x.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(P.Events.ERROR,x),null},o._handleTransmuxerFlush=function(p){var x=this.getCurrentContext(p);if(!x||this.state!==g.PARSING){this.fragCurrent||(this.state=g.IDLE);return}var M=x.frag,N=x.part,j=x.level,W=self.performance.now();M.stats.parsing.end=W,N&&(N.stats.parsing.end=W),this.updateLevelTiming(M,N,j,p.partial)},o.getCurrentContext=function(p){var x=this.levels,M=p.level,N=p.sn,j=p.part;if(!x||!x[M])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+M+". The current chunk will not be buffered."),null;var W=x[M],L=j>-1?Object(A.getPartWith)(W,N,j):null,I=L?L.fragment:Object(A.getFragmentWithSN)(W,N,this.fragCurrent);return I?{frag:I,part:L,level:W}:null},o.bufferFragmentData=function(p,x,M,N){if(!p||this.state!==g.PARSING)return;var j=p.data1,W=p.data2,L=j;if(j&&W&&(L=Object(b.appendUint8Array)(j,W)),!L||!L.length)return;var I={type:p.type,frag:x,part:M,chunkMeta:N,parent:x.type,data:L};this.hls.trigger(P.Events.BUFFER_APPENDING,I),p.dropped&&p.independent&&!M&&this.flushBufferGap(x)},o.flushBufferGap=function(p){var x=this.media;if(!x)return;if(!F.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,p.start);return}var M=x.currentTime,N=F.BufferHelper.bufferInfo(x,M,0),j=p.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),L=Math.max(Math.min(p.start-W,N.end-W),M+W);p.start-L>W&&this.flushMainBuffer(L,p.start)},o.getFwdBufferInfo=function(p,x){var M=this.config,N=this.getLoadPosition();if(!Object(G.isFiniteNumber)(N))return null;var j=F.BufferHelper.bufferInfo(p,N,M.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(N,x);if(W&&j.nextStart<W.end)return F.BufferHelper.bufferInfo(p,N,Math.max(j.nextStart,M.maxBufferHole))}return j},o.getMaxBufferLength=function(p){var x=this.config,M;return p?M=Math.max(8*x.maxBufferSize/p,x.maxBufferLength):M=x.maxBufferLength,Math.min(M,x.maxMaxBufferLength)},o.reduceMaxBufferLength=function(p){var x=this.config,M=p||x.maxBufferLength;return x.maxMaxBufferLength>=M?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(p,x){var M,N,j=x.fragments,W=j.length;if(!W)return null;var L=this.config,I=j[0].start,K;if(x.live){var Y=L.initialLiveManifestSize;if(W<Y)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+Y+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(x,j),this.startPosition=K?this.hls.liveSyncPosition||K.start:p)}else p<=I&&(K=j[0]);if(!K){var ee=L.lowLatencyMode?x.partEnd:x.fragmentEnd;K=this.getFragmentAtPosition(p,ee,x)}return(M=K)!==null&&M!==void 0&&M.initSegment&&!((N=K)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},o.getNextPart=function(p,x,M){for(var N=-1,j=!1,W=!0,L=0,I=p.length;L<I;L++){var K=p[L];if(W=W&&!K.independent,N>-1&&M<K.start)break;var Y=K.loaded;!Y&&(j||K.independent||W)&&K.fragment===x&&(N=L),j=Y}return N},o.loadedEndOfParts=function(p,x){var M=p[p.length-1];return M&&x>M.start&&M.loaded},o.getInitialLiveFragment=function(p,x){var M=this.fragPrevious,N=null;if(M){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),N=Object(C.findFragmentByPDT)(x,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var j=M.sn+1;if(j>=p.startSN&&j<=p.endSN){var W=x[j-p.startSN];M.cc===W.cc&&(N=W,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(C.findFragWithCC)(x,M.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var L=this.hls.liveSyncPosition;L!==null&&(N=this.getFragmentAtPosition(L,this.bitrateTest?p.fragmentEnd:p.edge,p))}return N},o.getFragmentAtPosition=function(p,x,M){var N=this.config,j=this.fragPrevious,W=M.fragments,L=M.endSN,I=M.fragmentHint,K=N.maxFragLookUpTolerance,Y=!!(N.lowLatencyMode&&M.partList&&I);Y&&I&&!this.bitrateTest&&(W=W.concat(I),L=I.sn);var ee;if(p<x){var oe=p>x-K?0:K;ee=Object(C.findFragmentByPTS)(j,W,p,oe)}else ee=W[W.length-1];if(ee){var xe=ee.sn-M.startSN,ve=j&&ee.level===j.level,ge=W[xe+1],me=this.fragmentTracker.getState(ee);if(me===O.FragmentState.BACKTRACKED){ee=null;for(var ce=xe;W[ce]&&this.fragmentTracker.getState(W[ce])===O.FragmentState.BACKTRACKED;)j?ee=W[ce--]:ee=W[--ce];ee||(ee=ge)}else j&&ee.sn===j.sn&&!Y&&(ve&&(ee.sn<L&&this.fragmentTracker.getState(ge)!==O.FragmentState.OK?(this.log("SN "+ee.sn+" just loaded, load next one: "+ge.sn),ee=ge):ee=null))}return ee},o.synchronizeToLiveEdge=function(p){var x=this.config,M=this.media;if(!M)return;var N=this.hls.liveSyncPosition,j=M.currentTime,W=p.fragments[0].start,L=p.edge,I=j>=W-x.maxFragLookUpTolerance&&j<=L;if(N!==null&&M.duration>N&&(j<N||!I)){var K=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*p.targetduration;(!I&&M.readyState<4||j<L-K)&&(this.loadedmetadata||(this.nextLoadPosition=N),M.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+L+", reset currentTime to : "+N.toFixed(3)),M.currentTime=N))}},o.alignPlaylists=function(p,x){var M=this.levels,N=this.levelLastLoaded,j=this.fragPrevious,W=N!==null?M[N]:null,L=p.fragments.length;if(!L)return this.warn("No fragments in live playlist"),0;var I=p.fragments[0].start,K=!x,Y=p.alignedSliding&&Object(G.isFiniteNumber)(I);if(K||!Y&&!I){Object(_.alignStream)(j,W,p);var ee=p.fragments[0].start;return this.log("Live playlist sliding: "+ee.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+p.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+L),ee}return I},o.waitForCdnTuneIn=function(p){var x=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*x)},o.setStartPosition=function(p,x){var M=this.startPosition;if(M<x&&(M=-1),M===-1||this.lastCurrentTime===-1){var N=p.startTimeOffset;Object(G.isFiniteNumber)(N)?(M=x+N,N<0&&(M+=p.totalduration),M=Math.min(Math.max(x,M),x+p.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+M),this.startPosition=M):p.live?M=this.hls.liveSyncPosition||x:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},o.getLoadPosition=function(){var p=this.media,x=0;return this.loadedmetadata&&p?x=p.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},o.handleFragLoadAborted=function(p,x){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(x?" part"+x.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},o.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=g.IDLE)},o.onFragmentOrKeyLoadError=function(p,x){if(x.fatal)return;var M=x.frag;if(!M||M.type!==p)return;var N=this.fragCurrent;console.assert(N&&M.sn===N.sn&&M.level===N.level&&M.urlId===N.urlId,"Frag load error must match current frag to retry");var j=this.config;if(this.fragLoadError+1<=j.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+p+" "+M.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=g.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(p===d.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=g.IDLE):(U.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=g.ERROR)},o.afterBufferFlushed=function(p,x,M){if(!p)return;var N=F.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(x,N,M),this.state===g.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=g.IDLE},o.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[p].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(p,x,M,N){var j=this,W=M.details;console.assert(!!W,"level.details must be defined");var L=Object.keys(p.elementaryStreams).reduce(function(I,K){var Y=p.elementaryStreams[K];if(Y){var ee=Y.endPTS-Y.startPTS;if(ee<=0)return j.warn("Could not parse fragment "+p.sn+" "+K+" duration reliably ("+ee+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),I||!1;var oe=N?0:Object(A.updateFragPTSDTS)(W,p,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return j.hls.trigger(P.Events.LEVEL_PTS_UPDATED,{details:W,level:M,drift:oe,type:K,frag:p,start:Y.startPTS,end:Y.endPTS}),!0}return I},!1);L?(this.state=g.PARSED,this.hls.trigger(P.Events.FRAG_PARSED,{frag:p,part:x})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(u,[{key:"state",get:function(){return this._state},set:function(p){var x=this._state;x!==p&&(this._state=p,this.log(x+"->"+p))}}]),u}(k.default)},"./src/controller/buffer-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return C});var G=R("./src/polyfills/number.ts"),k=R("./src/events.ts"),O=R("./src/utils/logger.ts"),F=R("./src/errors.ts"),U=R("./src/utils/buffer-helper.ts"),P=R("./src/utils/mediasource-helper.ts"),D=R("./src/loader/fragment.ts"),E=R("./src/controller/buffer-operation-queue.ts"),b=Object(P.getMediaSource)(),_=/([ha]vc.)(?:\.[^.,]+)+/,C=function(){function A(c){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 d=s.hls,l=s.media,S=s.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),l&&(s.updateMediaElementDuration(),d.trigger(k.Events.MEDIA_ATTACHED,{media:l})),S&&S.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var v=A.prototype;return v.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},v.destroy=function(){this.unregisterListeners(),this.details=null},v.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)},v.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)},v._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},v.onManifestParsed=function(s,d){var l=2;(d.audio&&!d.video||!d.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},v.onMediaAttaching=function(s,d){var l=this.media=d.media;if(l&&b){var S=this.mediaSource=new b;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}},v.onMediaDetaching=function(){var s=this.media,d=this.mediaSource,l=this._objectUrl;if(d){if(O.logger.log("[buffer-controller]: media source detaching"),d.readyState==="open")try{d.endOfStream()}catch(S){O.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),d.removeEventListener("sourceopen",this._onMediaSourceOpen),d.removeEventListener("sourceended",this._onMediaSourceEnded),d.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(l&&self.URL.revokeObjectURL(l),s.src===l?(s.removeAttribute("src"),s.load()):O.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)},v.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(d){var l=s.sourceBuffer[d];try{l&&(s.removeBufferListeners(d),s.mediaSource&&s.mediaSource.removeSourceBuffer(l),s.sourceBuffer[d]=void 0)}catch(S){O.logger.warn("[buffer-controller]: Failed to reset the "+d+" buffer",S)}}),this._initSourceBuffer()},v.onBufferCodecs=function(s,d){var l=this,S=this.getSourceBufferTypes().length;if(Object.keys(d).forEach(function(m){if(S){var f=l.tracks[m];if(f&&typeof f.buffer.changeType=="function"){var w=d[m],g=w.codec,h=w.levelCodec,a=w.container,u=(f.levelCodec||f.codec).replace(_,"$1"),o=(h||g).replace(_,"$1");if(u!==o){var y=a+";codecs="+(h||g);l.appendChangeType(m,y)}}}else l.pendingTracks[m]=d[m]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},v.appendChangeType=function(s,d){var l=this,S=this.operationQueue,m={execute:function(){var w=l.sourceBuffer[s];w&&(O.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+d),w.changeType(d)),S.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(w){O.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",w)}};S.append(m,s)},v.onBufferAppending=function(s,d){var l=this,S=this.hls,m=this.operationQueue,f=this.tracks,w=d.data,g=d.type,h=d.frag,a=d.part,u=d.chunkMeta,o=u.buffering[g],y=self.performance.now();o.start=y;var p=h.stats.buffering,x=a?a.stats.buffering:null;p.start===0&&(p.start=y),x&&x.start===0&&(x.start=y);var M=f.audio,N=g==="audio"&&u.id===1&&(M==null?void 0:M.container)==="audio/mpeg",j={execute:function(){if(o.executeStart=self.performance.now(),N){var L=l.sourceBuffer[g];if(L){var I=h.start-L.timestampOffset;Math.abs(I)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+h.start+" (delta: "+I+") sn: "+h.sn+")"),L.timestampOffset=h.start)}}l.appendExecutor(w,g)},onStart:function(){},onComplete:function(){var L=self.performance.now();o.executeEnd=o.end=L,p.first===0&&(p.first=L),x&&x.first===0&&(x.first=L);var I=l.sourceBuffer,K={};for(var Y in I)K[Y]=U.BufferHelper.getBuffered(I[Y]);l.appendError=0,l.hls.trigger(k.Events.BUFFER_APPENDED,{type:g,frag:h,part:a,chunkMeta:u,parent:h.type,timeRanges:K})},onError:function(L){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+g+" SourceBuffer",L);var I={type:F.ErrorTypes.MEDIA_ERROR,parent:h.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:L,fatal:!1};L.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=F.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,I.details=F.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>S.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),S.trigger(k.Events.ERROR,I)}};m.append(j,g)},v.onBufferFlushing=function(s,d){var l=this,S=this.operationQueue,m=function(w){return{execute:l.removeExecutor.bind(l,w,d.startOffset,d.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(k.Events.BUFFER_FLUSHED,{type:w})},onError:function(h){O.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",h)}}};d.type?S.append(m(d.type),d.type):this.getSourceBufferTypes().forEach(function(f){S.append(m(f),f)})},v.onFragParsed=function(s,d){var l=this,S=d.frag,m=d.part,f=[],w=m?m.elementaryStreams:S.elementaryStreams;w[D.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(w[D.ElementaryStreamTypes.AUDIO]&&f.push("audio"),w[D.ElementaryStreamTypes.VIDEO]&&f.push("video"));var g=function(){var a=self.performance.now();S.stats.buffering.end=a,m&&(m.stats.buffering.end=a);var u=m?m.stats:S.stats;l.hls.trigger(k.Events.FRAG_BUFFERED,{frag:S,part:m,stats:u,id:S.type})};f.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(g,f)},v.onFragChanged=function(s,d){this.flushBackBuffer()},v.onBufferEos=function(s,d){var l=this,S=this.getSourceBufferTypes().reduce(function(m,f){var w=l.sourceBuffer[f];return(!d.type||d.type===f)&&(w&&!w.ended&&(w.ended=!0,O.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),m&&!!(!w||w.ended)},!0);S&&this.blockBuffers(function(){var m=l.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},v.onLevelUpdated=function(s,d){var l=d.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},v.flushBackBuffer=function(){var s=this.hls,d=this.details,l=this.media,S=this.sourceBuffer;if(!l||d===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var f=d.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(G.isFiniteNumber)(f)||f<0)return;var w=l.currentTime,g=d.levelTargetDuration,h=Math.max(f,g),a=Math.floor(w/g)*g-h;m.forEach(function(u){var o=S[u];if(o){var y=U.BufferHelper.getBuffered(o);y.length>0&&a>y.start(0)&&(s.trigger(k.Events.BACK_BUFFER_REACHED,{bufferEnd:a}),d.live&&s.trigger(k.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:a}),s.trigger(k.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:a,type:u}))}})},v.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,d=this.hls,l=this.media,S=this.mediaSource,m=s.fragments[0].start+s.totalduration,f=l.duration,w=Object(G.isFiniteNumber)(S.duration)?S.duration:0;s.live&&d.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(s)):(m>w&&m>f||!Object(G.isFiniteNumber)(f))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),S.duration=m)},v.updateSeekableRange=function(s){var d=this.mediaSource,l=s.fragments,S=l.length;if(S&&s.live&&d!==null&&d!==void 0&&d.setLiveSeekableRange){var m=Math.max(0,l[0].start),f=Math.max(m,m+s.totalduration);d.setLiveSeekableRange(m,f)}},v.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,d=this.operationQueue,l=this.pendingTracks,S=Object.keys(l).length;if(S&&!s||S===2){this.createSourceBuffers(l),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.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}m.forEach(function(f){d.executeNext(f)})}},v.createSourceBuffers=function(s){var d=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var m in s)if(!d[m]){var f=s[m];if(!f)throw Error("source buffer exists for track "+m+", however track does not");var w=f.levelCodec||f.codec,g=f.container+";codecs="+w;O.logger.log("[buffer-controller]: creating sourceBuffer("+g+")");try{var h=d[m]=l.addSourceBuffer(g),a=m;this.addBufferListener(a,"updatestart",this._onSBUpdateStart),this.addBufferListener(a,"updateend",this._onSBUpdateEnd),this.addBufferListener(a,"error",this._onSBUpdateError),this.tracks[m]={buffer:h,codec:w,container:f.container,levelCodec:f.levelCodec,id:f.id},S++}catch(u){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(k.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:g})}}S&&this.hls.trigger(k.Events.BUFFER_CREATED,{tracks:this.tracks})},v._onSBUpdateStart=function(s){var d=this.operationQueue,l=d.current(s);l.onStart()},v._onSBUpdateEnd=function(s){var d=this.operationQueue,l=d.current(s);l.onComplete(),d.shiftAndExecuteNext(s)},v._onSBUpdateError=function(s,d){O.logger.error("[buffer-controller]: "+s+" SourceBuffer error",d),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(d)},v.removeExecutor=function(s,d,l){var S=this.media,m=this.mediaSource,f=this.operationQueue,w=this.sourceBuffer,g=w[s];if(!S||!m||!g){O.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(s);return}var h=Object(G.isFiniteNumber)(S.duration)?S.duration:Infinity,a=Object(G.isFiniteNumber)(m.duration)?m.duration:Infinity,u=Math.max(0,d),o=Math.min(l,h,a);o>u?(O.logger.log("[buffer-controller]: Removing ["+u+","+o+"] from the "+s+" SourceBuffer"),console.assert(!g.updating,s+" sourceBuffer must not be updating"),g.remove(u,o)):f.shiftAndExecuteNext(s)},v.appendExecutor=function(s,d){var l=this.operationQueue,S=this.sourceBuffer,m=S[d];if(!m){O.logger.warn("[buffer-controller]: Attempting to append to the "+d+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(d);return}m.ended=!1,console.assert(!m.updating,d+" sourceBuffer must not be updating"),m.appendBuffer(s)},v.blockBuffers=function(s,d){var l=this;if(d===void 0&&(d=this.getSourceBufferTypes()),!d.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var S=this.operationQueue,m=d.map(function(f){return S.appendBlocker(f)});Promise.all(m).then(function(){s(),d.forEach(function(f){var w=l.sourceBuffer[f];(!w||!w.updating)&&S.shiftAndExecuteNext(f)})})},v.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},v.addBufferListener=function(s,d,l){var S=this.sourceBuffer[s];if(!S)return;var m=l.bind(this,s);this.listeners[s].push({event:d,listener:m}),S.addEventListener(d,m)},v.removeBufferListeners=function(s){var d=this.sourceBuffer[s];if(!d)return;this.listeners[s].forEach(function(l){d.removeEventListener(l.event,l.listener)})},A}()},"./src/controller/buffer-operation-queue.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return k});var G=R("./src/utils/logger.ts"),k=function(){function O(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var F=O.prototype;return F.append=function(P,D){var E=this.queues[D];E.push(P),E.length===1&&this.buffers[D]&&this.executeNext(D)},F.insertAbort=function(P,D){var E=this.queues[D];E.unshift(P),this.executeNext(D)},F.appendBlocker=function(P){var D,E=new Promise(function(_){D=_}),b={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(b,P),E},F.executeNext=function(P){var D=this.buffers,E=this.queues,b=D[P],_=E[P];if(_.length){var C=_[0];try{C.execute()}catch(A){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),C.onError(A),(!b||!b.updating)&&(_.shift(),this.executeNext(P))}}},F.shiftAndExecuteNext=function(P){this.queues[P].shift(),this.executeNext(P)},F.current=function(P){return this.queues[P][0]},O}()},"./src/controller/cap-level-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/events.ts");function k(U,P){for(var D=0;D<P.length;D++){var E=P[D];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(U,E.key,E)}}function O(U,P,D){return P&&k(U.prototype,P),D&&k(U,D),U}var F=function(){function U(D){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var P=U.prototype;return P.setStreamController=function(E){this.streamController=E},P.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},P.registerListeners=function(){var E=this.hls;E.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.unregisterListener=function(){var E=this.hls;E.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.onFpsDropLevelCapping=function(E,b){U.isLevelAllowed(b.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(b.droppedLevel)},P.onMediaAttaching=function(E,b){this.media=b.media instanceof HTMLVideoElement?b.media:null},P.onManifestParsed=function(E,b){var _=this.hls;this.restrictedLevels=[],this.firstLevel=b.firstLevel,_.config.capLevelToPlayerSize&&b.video&&this.startCapping()},P.onBufferCodecs=function(E,b){var _=this.hls;_.config.capLevelToPlayerSize&&b.video&&this.startCapping()},P.onMediaDetaching=function(){this.stopCapping()},P.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var b=this.hls;b.autoLevelCapping=this.getMaxLevel(E.length-1),b.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=b.autoLevelCapping}}},P.getMaxLevel=function(E){var b=this,_=this.hls.levels;if(!_.length)return-1;var C=_.filter(function(A,v){return U.isLevelAllowed(v,b.restrictedLevels)&&v<=E});return this.clientRect=null,U.getMaxLevelByMediaSize(C,this.mediaWidth,this.mediaHeight)},P.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()},P.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},P.getDimensions=function(){if(this.clientRect)return this.clientRect;var E=this.media,b={width:0,height:0};if(E){var _=E.getBoundingClientRect();b.width=_.width,b.height=_.height,!b.width&&!b.height&&(b.width=_.right-_.left||E.width||0,b.height=_.bottom-_.top||E.height||0)}return this.clientRect=b,b},U.isLevelAllowed=function(E,b){return b===void 0&&(b=[]),b.indexOf(E)===-1},U.getMaxLevelByMediaSize=function(E,b,_){if(!E||!E.length)return-1;for(var C=function(d,l){return l?d.width!==l.width||d.height!==l.height:!0},A=E.length-1,v=0;v<E.length;v+=1){var c=E[v];if((c.width>=b||c.height>=_)&&C(c,E[v+1])){A=v;break}}return A},O(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var E=1;try{E=self.devicePixelRatio}catch(b){}return E}}]),U}();V.default=F},"./src/controller/cmcd-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return C});var G=R("./src/events.ts"),k=R("./src/types/cmcd.ts"),O=R("./src/utils/buffer-helper.ts"),F=R("./src/utils/logger.ts");function U(A,v){for(var c=0;c<v.length;c++){var s=v[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(A,s.key,s)}}function P(A,v,c){return v&&U(A.prototype,v),c&&U(A,c),A}function D(A,v){var c=typeof Symbol!="undefined"&&A[Symbol.iterator]||A["@@iterator"];if(c)return(c=c.call(A)).next.bind(c);if(Array.isArray(A)||(c=E(A))||v&&A&&typeof A.length=="number"){c&&(A=c);var s=0;return function(){return s>=A.length?{done:!0}:{done:!1,value:A[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(A,v){if(!A)return;if(typeof A=="string")return b(A,v);var c=Object.prototype.toString.call(A).slice(8,-1);if(c==="Object"&&A.constructor&&(c=A.constructor.name),c==="Map"||c==="Set")return Array.from(A);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return b(A,v)}function b(A,v){(v==null||v>A.length)&&(v=A.length);for(var c=0,s=new Array(v);c<v;c++)s[c]=A[c];return s}function _(){return _=Object.assign||function(A){for(var v=1;v<arguments.length;v++){var c=arguments[v];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(A[s]=c[s])}return A},_.apply(this,arguments)}var C=function(){function A(c){var s=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(S){try{s.apply(S,{ot:k.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(m){F.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(S){try{var m=S.frag,f=s.hls.levels[m.level],w=s.getObjectType(m),g={d:m.duration*1e3,ot:w};(w===k.CMCDObjectType.VIDEO||w===k.CMCDObjectType.AUDIO||w==k.CMCDObjectType.MUXED)&&(g.br=f.bitrate/1e3,g.tb=s.getTopBandwidth(w),g.bl=s.getBufferLength(w)),s.apply(S,g)}catch(h){F.logger.warn("Could not generate segment CMCD data.",h)}},this.hls=c;var d=this.config=c.config,l=d.cmcd;l!=null&&(d.pLoader=this.createPlaylistLoader(),d.fLoader=this.createFragmentLoader(),this.sid=l.sessionId||A.uuid(),this.cid=l.contentId,this.useHeaders=l.useHeaders===!0,this.registerListeners())}var v=A.prototype;return v.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},v.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},v.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},v.onMediaAttached=function(s,d){this.media=d.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},v.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},v.onBufferCreated=function(s,d){var l,S;this.audioBuffer=(l=d.tracks.audio)===null||l===void 0?void 0:l.buffer,this.videoBuffer=(S=d.tracks.video)===null||S===void 0?void 0:S.buffer},v.createData=function(){var s;return{v:k.CMCDVersion,sf:k.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},v.apply=function(s,d){d===void 0&&(d={}),_(d,this.createData());var l=d.ot===k.CMCDObjectType.INIT||d.ot===k.CMCDObjectType.VIDEO||d.ot===k.CMCDObjectType.MUXED;if(this.starved&&l&&(d.bs=!0,d.su=!0,this.starved=!1),d.su==null&&(d.su=this.buffering),this.useHeaders){var S=A.toHeaders(d);if(!Object.keys(S).length)return;s.headers||(s.headers={}),_(s.headers,S)}else{var m=A.toQuery(d);if(!m)return;s.url=A.appendQueryToUri(s.url,m)}},v.getObjectType=function(s){var d=s.type;return d==="subtitle"?k.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?k.CMCDObjectType.INIT:d==="audio"?k.CMCDObjectType.AUDIO:d==="main"?this.hls.audioTracks.length?k.CMCDObjectType.VIDEO:k.CMCDObjectType.MUXED:void 0},v.getTopBandwidth=function(s){for(var d=0,l=s===k.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=D(l),m;!(m=S()).done;){var f=m.value;f.bitrate>d&&(d=f.bitrate)}return d>0?d:NaN},v.getBufferLength=function(s){var d=this.hls.media,l=s===k.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!d)return NaN;var S=O.BufferHelper.bufferInfo(l,d.currentTime,this.config.maxBufferHole);return S.len*1e3},v.createPlaylistLoader=function(){var s=this.config.pLoader,d=this.applyPlaylistData,l=s||this.config.loader;return function(){function S(f){this.loader=void 0,this.loader=new l(f)}var m=S.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(w,g,h){d(w),this.loader.load(w,g,h)},P(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},v.createFragmentLoader=function(){var s=this.config.fLoader,d=this.applyFragmentData,l=s||this.config.loader;return function(){function S(f){this.loader=void 0,this.loader=new l(f)}var m=S.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(w,g,h){d(w),this.loader.load(w,g,h)},P(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},A.uuid=function(){var s=URL.createObjectURL(new Blob),d=s.toString();return URL.revokeObjectURL(s),d.substr(d.lastIndexOf("/")+1)},A.serialize=function(s){for(var d=[],l=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},S=function(N){return Math.round(N)},m=function(N){return S(N/100)*100},f=function(N){return encodeURIComponent(N)},w={br:S,d:S,bl:m,dl:m,mtp:m,nor:f,rtp:m,tb:S},g=Object.keys(s||{}).sort(),h=D(g),a;!(a=h()).done;){var u=a.value,o=s[u];if(!l(o))continue;if(u==="v"&&o===1)continue;if(u=="pr"&&o===1)continue;var y=w[u];y&&(o=y(o));var p=typeof o,x=void 0;u==="ot"||u==="sf"||u==="st"?x=u+"="+o:p==="boolean"?x=u:p==="number"?x=u+"="+o:x=u+"="+JSON.stringify(o),d.push(x)}return d.join(",")},A.toHeaders=function(s){for(var d=Object.keys(s),l={},S=["Object","Request","Session","Status"],m=[{},{},{},{}],f={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},w=0,g=d;w<g.length;w++){var h=g[w],a=f[h]!=null?f[h]:1;m[a][h]=s[h]}for(var u=0;u<m.length;u++){var o=A.serialize(m[u]);o&&(l["CMCD-"+S[u]]=o)}return l},A.toQuery=function(s){return"CMCD="+encodeURIComponent(A.serialize(s))},A.appendQueryToUri=function(s,d){if(!d)return s;var l=s.includes("?")?"&":"?";return""+s+l+d},A}()},"./src/controller/eme-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/events.ts"),k=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),F=R("./src/utils/mediakeys-helper.ts");function U(C,A){for(var v=0;v<A.length;v++){var c=A[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,c.key,c)}}function P(C,A,v){return A&&U(C.prototype,A),v&&U(C,v),C}var D=3,E=function(A,v,c){var s={audioCapabilities:[],videoCapabilities:[]};return A.forEach(function(d){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+d+'"',robustness:c.audioRobustness||""})}),v.forEach(function(d){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+d+'"',robustness:c.videoRobustness||""})}),[s]},b=function(A,v,c,s){switch(A){case F.KeySystems.WIDEVINE:return E(v,c,s);default:throw new Error("Unknown key-system: "+A)}},_=function(){function C(v){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=v,this._config=v.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var A=C.prototype;return A.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},A._registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A._unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A.getLicenseServerUrl=function(c){switch(c){case F.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},A._attemptKeySystemAccess=function(c,s,d){var l=this,S=b(c,s,d,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(c,S);this.mediaKeysPromise=m.then(function(f){return l._onMediaKeySystemAccessObtained(c,f)}),m.catch(function(f){O.logger.error('Failed to obtain key-system "'+c+'" access:',f)})},A._onMediaKeySystemAccessObtained=function(c,s){var d=this;O.logger.log('Access for key-system "'+c+'" obtained');var l={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:c};this._mediaKeysList.push(l);var S=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(m){return l.mediaKeys=m,O.logger.log('Media-keys created for key-system "'+c+'"'),d._onMediaKeysCreated(),m});return S.catch(function(m){O.logger.error("Failed to create media-keys:",m)}),S},A._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),c._onNewMediaKeySession(s.mediaKeysSession))})},A._onNewMediaKeySession=function(c){var s=this;O.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(d){s._onKeySessionMessage(c,d.message)},!1)},A._onKeySessionMessage=function(c,s){O.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(d){O.logger.log("Received license data (length: "+(d&&d.byteLength)+"), updating key-session"),c.update(d)})},A.onMediaEncrypted=function(c){var s=this;if(O.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var d=function(S){if(!s._media)return;s._attemptSetMediaKeys(S),s._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(d).catch(d)},A._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},A._generateRequestWithPreferredKeySession=function(c,s){var d=this,l=this._mediaKeysList[0];if(!l){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(l.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var S=l.mediaKeysSession;if(!S){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+c+'" init data type'),l.mediaKeysSessionInitialized=!0,S.generateRequest(c,s).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(m){O.logger.error("Error generating key-session request:",m),d.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},A._createLicenseXhr=function(c,s,d){var l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,l,c,s,d);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,l,c),S=void 0}catch(m){O.logger.error(m)}try{l.readyState||l.open("POST",c,!0),S&&S.call(this.hls,l,c)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return l},A._onLicenseRequestReadyStageChange=function(c,s,d,l){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var S=c.response,m=this._licenseResponseCallback;if(m)try{S=m.call(this.hls,c,s)}catch(w){O.logger.error(w)}l(S)}else{if(O.logger.error("License Request XHR failed ("+s+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var f=D-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+f+" attempts left"),this._requestLicense(d,l)}break}},A._generateLicenseRequestChallenge=function(c,s){switch(c.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},A._requestLicense=function(c,s){O.logger.log("Requesting content license for key-system");var d=this._mediaKeysList[0];if(!d){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(d.mediaKeySystemDomain),S=this._createLicenseXhr(l,c,s);O.logger.log("Sending license request to URL: "+l);var m=this._generateLicenseRequestChallenge(d,c);S.send(m)}catch(f){O.logger.error("Failure requesting DRM license: "+f),this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.KEY_SYSTEM_ERROR,details:k.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},A.onMediaAttached=function(c,s){if(!this._emeEnabled)return;var d=s.media;this._media=d,d.addEventListener("encrypted",this._onMediaEncrypted)},A.onMediaDetached=function(){var c=this._media,s=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(d){if(d.mediaKeysSession)return d.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},A.onManifestParsed=function(c,s){if(!this._emeEnabled)return;var d=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,d,l)},P(C,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),C}();V.default=_},"./src/controller/fps-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/events.ts"),k=R("./src/utils/logger.ts"),O=function(){function F(P){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=P,this.registerListeners()}var U=F.prototype;return U.setStreamController=function(D){this.streamController=D},U.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(D,E){var b=this.hls.config;if(b.capLevelOnFPSDrop){var _=E.media instanceof self.HTMLVideoElement?E.media:null;this.media=_,_&&typeof _.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),b.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(D,E,b){var _=performance.now();if(E){if(this.lastTime){var C=_-this.lastTime,A=b-this.lastDroppedFrames,v=E-this.lastDecodedFrames,c=1e3*A/C,s=this.hls;if(s.trigger(G.Events.FPS_DROP,{currentDropped:A,currentDecoded:v,totalDroppedFrames:b}),c>0&&A>s.config.fpsDroppedMonitoringThreshold*v){var d=s.currentLevel;k.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=d)&&(d=d-1,s.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:s.currentLevel}),s.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=b,this.lastDecodedFrames=E}},U.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var E=D.getVideoPlaybackQuality();this.checkFPS(D,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},F}();V.default=O},"./src/controller/fragment-finders.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"findFragmentByPDT",function(){return O}),R.d(V,"findFragmentByPTS",function(){return F}),R.d(V,"fragmentWithinToleranceTest",function(){return U}),R.d(V,"pdtWithinToleranceTest",function(){return P}),R.d(V,"findFragWithCC",function(){return D});var G=R("./src/polyfills/number.ts"),k=R("./src/utils/binary-search.ts");function O(E,b,_){if(b===null||!Array.isArray(E)||!E.length||!Object(G.isFiniteNumber)(b))return null;var C=E[0].programDateTime;if(b<(C||0))return null;var A=E[E.length-1].endProgramDateTime;if(b>=(A||0))return null;_=_||0;for(var v=0;v<E.length;++v){var c=E[v];if(P(b,_,c))return c}return null}function F(E,b,_,C){_===void 0&&(_=0),C===void 0&&(C=0);var A=null;if(E?A=b[E.sn-b[0].sn+1]||null:_===0&&b[0].start===0&&(A=b[0]),A&&U(_,C,A)===0)return A;var v=k.default.search(b,U.bind(null,_,C));return v||A}function U(E,b,_){E===void 0&&(E=0),b===void 0&&(b=0);var C=Math.min(b,_.duration+(_.deltaPTS?_.deltaPTS:0));return _.start+_.duration-C<=E?1:_.start-C>E&&_.start?-1:0}function P(E,b,_){var C=Math.min(b,_.duration+(_.deltaPTS?_.deltaPTS:0))*1e3,A=_.endProgramDateTime||0;return A-C>E}function D(E,b){return k.default.search(E,function(_){return _.cc<b?1:_.cc>b?-1:0})}},"./src/controller/fragment-tracker.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"FragmentState",function(){return O}),R.d(V,"FragmentTracker",function(){return F});var G=R("./src/events.ts"),k=R("./src/types/loader.ts"),O;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(O||(O={}));var F=function(){function D(b){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=b,this._registerListeners()}var E=D.prototype;return E._registerListeners=function(){var _=this.hls;_.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var _=this.hls;_.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(_,C){if(C===k.PlaylistLevelType.MAIN){var A=this.activeFragment,v=this.activeParts;if(!A)return null;if(v)for(var c=v.length;c--;){var s=v[c],d=s?s.end:A.appendedPTS;if(s.start<=_&&d!==void 0&&_<=d)return c>9&&(this.activeParts=v.slice(c-9)),s}else if(A.start<=_&&A.appendedPTS!==void 0&&_<=A.appendedPTS)return A}return this.getBufferedFrag(_,C)},E.getBufferedFrag=function(_,C){for(var A=this.fragments,v=Object.keys(A),c=v.length;c--;){var s=A[v[c]];if((s==null?void 0:s.body.type)===C&&s.buffered){var d=s.body;if(d.start<=_&&_<=d.end)return d}}return null},E.detectEvictedFragments=function(_,C,A){var v=this;Object.keys(this.fragments).forEach(function(c){var s=v.fragments[c];if(!s)return;if(!s.buffered){s.body.type===A&&v.removeFragment(s.body);return}var d=s.range[_];if(!d)return;d.time.some(function(l){var S=!v.isTimeBuffered(l.startPTS,l.endPTS,C);return S&&v.removeFragment(s.body),S})})},E.detectPartialFragments=function(_){var C=this,A=this.timeRanges,v=_.frag,c=_.part;if(!A||v.sn==="initSegment")return;var s=P(v),d=this.fragments[s];if(!d)return;Object.keys(A).forEach(function(l){var S=v.elementaryStreams[l];if(!S)return;var m=A[l],f=c!==null||S.partial===!0;d.range[l]=C.getBufferedTimes(v,c,f,m)}),d.backtrack=d.loaded=null,Object.keys(d.range).length?d.buffered=!0:this.removeFragment(d.body)},E.fragBuffered=function(_){var C=P(_),A=this.fragments[C];A&&(A.backtrack=A.loaded=null,A.buffered=!0)},E.getBufferedTimes=function(_,C,A,v){for(var c={time:[],partial:A},s=C?C.start:_.start,d=C?C.end:_.end,l=_.minEndPTS||d,S=_.maxStartPTS||s,m=0;m<v.length;m++){var f=v.start(m)-this.bufferPadding,w=v.end(m)+this.bufferPadding;if(S>=f&&l<=w){c.time.push({startPTS:Math.max(s,v.start(m)),endPTS:Math.min(d,v.end(m))});break}else if(s<w&&d>f)c.partial=!0,c.time.push({startPTS:Math.max(s,v.start(m)),endPTS:Math.min(d,v.end(m))});else if(d<=f)break}return c},E.getPartialFragment=function(_){var C=null,A,v,c,s=0,d=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(S){var m=l[S];if(!m)return;U(m)&&(v=m.body.start-d,c=m.body.end+d,_>=v&&_<=c&&(A=Math.min(_-v,c-_),s<=A&&(C=m.body,s=A)))}),C},E.getState=function(_){var C=P(_),A=this.fragments[C];return A?A.buffered?U(A)?O.PARTIAL:O.OK:A.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},E.backtrack=function(_,C){var A=P(_),v=this.fragments[A];if(!v||v.backtrack)return null;var c=v.backtrack=C||v.loaded;return v.loaded=null,c},E.getBacktrackData=function(_){var C=P(_),A=this.fragments[C];if(A){var v,c=A.backtrack;if(c!=null&&(v=c.payload)!==null&&v!==void 0&&v.byteLength)return c;this.removeFragment(_)}return null},E.isTimeBuffered=function(_,C,A){for(var v,c,s=0;s<A.length;s++){if(v=A.start(s)-this.bufferPadding,c=A.end(s)+this.bufferPadding,_>=v&&C<=c)return!0;if(C<=v)return!1}return!1},E.onFragLoaded=function(_,C){var A=C.frag,v=C.part;if(A.sn==="initSegment"||A.bitrateTest||v)return;var c=P(A);this.fragments[c]={body:A,loaded:C,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(_,C){var A=this,v=C.frag,c=C.part,s=C.timeRanges;if(v.type===k.PlaylistLevelType.MAIN)if(this.activeFragment=v,c){var d=this.activeParts;d||(this.activeParts=d=[]),d.push(c)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(l){var S=s[l];if(A.detectEvictedFragments(l,S),!c)for(var m=0;m<S.length;m++)v.appendedPTS=Math.max(S.end(m),v.appendedPTS||0)})},E.onFragBuffered=function(_,C){this.detectPartialFragments(C)},E.hasFragment=function(_){var C=P(_);return!!this.fragments[C]},E.removeFragmentsInRange=function(_,C,A){var v=this;Object.keys(this.fragments).forEach(function(c){var s=v.fragments[c];if(!s)return;if(s.buffered){var d=s.body;d.type===A&&d.start<C&&d.end>_&&v.removeFragment(d)}})},E.removeFragment=function(_){var C=P(_);_.stats.loaded=0,_.clearElementaryStreamInfo(),delete this.fragments[C]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function U(D){var E,b;return D.buffered&&(((E=D.range.video)===null||E===void 0?void 0:E.partial)||((b=D.range.audio)===null||b===void 0?void 0:b.partial))}function P(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"STALL_MINIMUM_DURATION_MS",function(){return U}),R.d(V,"MAX_START_GAP_JUMP",function(){return P}),R.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),R.d(V,"SKIP_BUFFER_RANGE_START",function(){return E}),R.d(V,"default",function(){return b});var G=R("./src/utils/buffer-helper.ts"),k=R("./src/errors.ts"),O=R("./src/events.ts"),F=R("./src/utils/logger.ts"),U=250,P=2,D=.1,E=.05,b=function(){function _(A,v,c,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=A,this.media=v,this.fragmentTracker=c,this.hls=s}var C=_.prototype;return C.destroy=function(){this.hls=this.fragmentTracker=this.media=null},C.poll=function(v){var c=this.config,s=this.media,d=this.stalled,l=s.currentTime,S=s.seeking,m=this.seeking&&!S,f=!this.seeking&&S;if(this.seeking=S,l!==v){if(this.moved=!0,d!==null){if(this.stallReported){var w=self.performance.now()-d;F.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((f||m)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!G.BufferHelper.getBuffered(s).length)return;var g=G.BufferHelper.bufferInfo(s,l,0),h=g.len>0,a=g.nextStart||0;if(!h&&!a)return;if(S){var u=g.len>P,o=!a||a-l>P&&!this.fragmentTracker.getPartialFragment(l);if(u||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,p=Math.max(a,g.start||0)-l,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=x==null||((y=x.details)===null||y===void 0)?void 0:y.live,N=M?x.details.targetduration*2:P;if(p>0&&p<=N){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(d===null){this.stalled=j;return}var W=j-d;!S&&W>=U&&this._reportStall(g.len);var L=G.BufferHelper.bufferInfo(s,l,c.maxBufferHole);this._tryFixBufferStall(L,W)},C._tryFixBufferStall=function(v,c){var s=this.config,d=this.fragmentTracker,l=this.media,S=l.currentTime,m=d.getPartialFragment(S);if(m){var f=this._trySkipBufferHole(m);if(f)return}v.len>s.maxBufferHole&&c>s.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},C._reportStall=function(v){var c=this.hls,s=this.media,d=this.stallReported;d||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+v+")"),c.trigger(O.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:v}))},C._trySkipBufferHole=function(v){for(var c=this.config,s=this.hls,d=this.media,l=d.currentTime,S=0,m=G.BufferHelper.getBuffered(d),f=0;f<m.length;f++){var w=m.start(f);if(l+c.maxBufferHole>=S&&l<w){var g=Math.max(w+E,d.currentTime+D);return F.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+g),this.moved=!0,this.stalled=null,d.currentTime=g,v&&s.trigger(O.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+g,frag:v}),g}S=m.end(f)}return 0},C._tryNudgeBuffer=function(){var v=this.config,c=this.hls,s=this.media,d=s.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<v.nudgeMaxRetry){var S=d+l*v.nudgeOffset;F.logger.warn("Nudging 'currentTime' from "+d+" to "+S),s.currentTime=S,c.trigger(O.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else F.logger.error("Playhead still not moving while enough data buffered @"+d+" after "+v.nudgeMaxRetry+" nudges"),c.trigger(O.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},_}()},"./src/controller/id3-track-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/events.ts"),k=R("./src/utils/texttrack-utils.ts"),O=R("./src/demux/id3.ts"),F=.25,U=function(){function P(E){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=E,this._registerListeners()}var D=P.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var b=this.hls;b.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),b.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var b=this.hls;b.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),b.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(b,_){this.media=_.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(k.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(b){if(!this.media)return;for(var _=0;_<b.length;_++){var C=b[_];if(C.kind==="metadata"&&C.label==="id3")return Object(k.sendAddTrackEvent)(C,this.media),C}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(b,_){if(!this.media)return;var C=_.frag,A=_.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var v=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<A.length;c++){var s=O.getID3Frames(A[c].data);if(s){var d=A[c].pts,l=c<A.length-1?A[c+1].pts:C.end,S=l-d;S<=0&&(l=d+F);for(var m=0;m<s.length;m++){var f=s[m];if(!O.isTimeStampFrame(f)){var w=new v(d,l,"");w.value=f,this.id3Track.addCue(w)}}}}},D.onBufferFlushing=function(b,_){var C=_.startOffset,A=_.endOffset,v=_.type;if(!v||v==="audio"){var c=this.id3Track;c&&Object(k.removeCuesInRange)(c,C,A)}},P}();V.default=U},"./src/controller/latency-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return P});var G=R("./src/errors.ts"),k=R("./src/events.ts"),O=R("./src/utils/logger.ts");function F(D,E){for(var b=0;b<E.length;b++){var _=E[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(D,_.key,_)}}function U(D,E,b){return E&&F(D.prototype,E),b&&F(D,b),D}var P=function(){function D(b){var _=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return _.timeupdate()},this.hls=b,this.config=b.config,this.registerListeners()}var E=D.prototype;return E.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},E.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(k.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(k.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(k.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(k.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(k.Events.ERROR,this.onError)},E.onMediaAttached=function(_,C){this.media=C.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},E.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},E.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},E.onLevelUpdated=function(_,C){var A=C.details;this.levelDetails=A,A.advanced&&this.timeupdate(),!A.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},E.onError=function(_,C){if(C.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},E.timeupdate=function(){var _=this.media,C=this.levelDetails;if(!_||!C)return;this.currentTime=_.currentTime;var A=this.computeLatency();if(A===null)return;this._latency=A;var v=this.config,c=v.lowLatencyMode,s=v.maxLiveSyncPlaybackRate;if(!c||s===1)return;var d=this.targetLatency;if(d===null)return;var l=A-d,S=Math.min(this.maxLatency,d+C.targetduration),m=l<S;if(C.live&&m&&l>.05&&this.forwardBufferLength>1){var f=Math.min(2,Math.max(1,s)),w=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;_.playbackRate=Math.min(f,Math.max(1,w))}else _.playbackRate!==1&&_.playbackRate!==0&&(_.playbackRate=1)},E.estimateLiveEdge=function(){var _=this.levelDetails;return _===null?null:_.edge+_.age},E.computeLatency=function(){var _=this.estimateLiveEdge();return _===null?null:_-this.currentTime},U(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var _=this.config,C=this.levelDetails;return _.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:C?_.liveMaxLatencyDurationCount*C.targetduration:0}},{key:"targetLatency",get:function(){var _=this.levelDetails;if(_===null)return null;var C=_.holdBack,A=_.partHoldBack,v=_.targetduration,c=this.config,s=c.liveSyncDuration,d=c.liveSyncDurationCount,l=c.lowLatencyMode,S=this.hls.userConfig,m=l&&A||C;(S.liveSyncDuration||S.liveSyncDurationCount||m===0)&&(m=s!==void 0?s:d*v);var f=v,w=1;return m+Math.min(this.stallCount*w,f)}},{key:"liveSyncPosition",get:function(){var _=this.estimateLiveEdge(),C=this.targetLatency,A=this.levelDetails;if(_===null||C===null||A===null)return null;var v=A.edge,c=_-C-this.edgeStalled,s=v-A.totalduration,d=v-(this.config.lowLatencyMode&&A.partTarget||A.targetduration);return Math.min(Math.max(s,c),d)}},{key:"drift",get:function(){var _=this.levelDetails;return _===null?1:_.drift}},{key:"edgeStalled",get:function(){var _=this.levelDetails;if(_===null)return 0;var C=(this.config.lowLatencyMode&&_.partTarget||_.targetduration)*3;return Math.max(_.age-C,0)}},{key:"forwardBufferLength",get:function(){var _=this.media,C=this.levelDetails;if(!_||!C)return 0;var A=_.buffered.length;return A?_.buffered.end(A-1):C.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return c});var G=R("./src/types/level.ts"),k=R("./src/events.ts"),O=R("./src/errors.ts"),F=R("./src/utils/codecs.ts"),U=R("./src/controller/level-helper.ts"),P=R("./src/controller/base-playlist-controller.ts"),D=R("./src/types/loader.ts");function E(){return E=Object.assign||function(s){for(var d=1;d<arguments.length;d++){var l=arguments[d];for(var S in l)Object.prototype.hasOwnProperty.call(l,S)&&(s[S]=l[S])}return s},E.apply(this,arguments)}function b(s,d){for(var l=0;l<d.length;l++){var S=d[l];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function _(s,d,l){return d&&b(s.prototype,d),l&&b(s,l),s}function C(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,A(s,d)}function A(s,d){return A=Object.setPrototypeOf||function(S,m){return S.__proto__=m,S},A(s,d)}var v=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(s){C(d,s);function d(S){var m;return m=s.call(this,S,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var l=d.prototype;return l._registerListeners=function(){var m=this.hls;m.on(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(k.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(k.Events.ERROR,this.onError,this)},l._unregisterListeners=function(){var m=this.hls;m.off(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(k.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(k.Events.ERROR,this.onError,this)},l.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},l.startLoad=function(){var m=this._levels;m.forEach(function(f){f.loadError=0}),s.prototype.startLoad.call(this)},l.onManifestLoaded=function(m,f){var w=[],g=[],h=[],a,u={},o,y=!1,p=!1,x=!1;if(f.levels.forEach(function(W){var L=W.attrs;y=y||!!(W.width&&W.height),p=p||!!W.videoCodec,x=x||!!W.audioCodec,v&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var I=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;o=u[I],o?o.url.push(W.url):(o=new G.Level(W),u[I]=o,w.push(o)),L&&(L.AUDIO&&Object(U.addGroupId)(o,"audio",L.AUDIO),L.SUBTITLES&&Object(U.addGroupId)(o,"text",L.SUBTITLES))}),(y||p)&&x&&(w=w.filter(function(W){var L=W.videoCodec,I=W.width,K=W.height;return!!L||!!(I&&K)})),w=w.filter(function(W){var L=W.audioCodec,I=W.videoCodec;return(!L||Object(F.isCodecSupportedInMp4)(L,"audio"))&&(!I||Object(F.isCodecSupportedInMp4)(I,"video"))}),f.audioTracks&&(g=f.audioTracks.filter(function(W){return!W.audioCodec||Object(F.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(g)),f.subtitles&&(h=f.subtitles,Object(U.assignTrackIdsByGroup)(h)),w.length>0){a=w[0].bitrate,w.sort(function(W,L){return W.bitrate-L.bitrate}),this._levels=w;for(var M=0;M<w.length;M++)if(w[M].bitrate===a){this._firstLevel=M,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+a);break}var N=x&&!p,j={levels:w,audioTracks:g,subtitleTracks:h,firstLevel:this._firstLevel,stats:f.stats,audio:x,video:p,altAudio:!N&&g.some(function(W){return!!W.url})};this.hls.trigger(k.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(k.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:f.url,reason:"no level with compatible codecs found in manifest"})},l.onError=function(m,f){if(s.prototype.onError.call(this,m,f),f.fatal)return;var w=f.context,g=this._levels[this.currentLevelIndex];if(w&&(w.type===D.PlaylistContextType.AUDIO_TRACK&&g.audioGroupIds&&w.groupId===g.audioGroupIds[g.urlId]||w.type===D.PlaylistContextType.SUBTITLE_TRACK&&g.textGroupIds&&w.groupId===g.textGroupIds[g.urlId])){this.redundantFailover(this.currentLevelIndex);return}var h=!1,a=!0,u;switch(f.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:case O.ErrorDetails.KEY_LOAD_ERROR:case O.ErrorDetails.KEY_LOAD_TIMEOUT:if(f.frag){var o=this._levels[f.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=f.frag.level)):u=f.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(a=!1),u=w.level),h=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:u=f.level,h=!0;break}u!==void 0&&this.recoverLevel(f,u,h,a)},l.recoverLevel=function(m,f,w,g){var h=m.details,a=this._levels[f];if(a.loadError++,w){var u=this.retryLoadingOrFail(m);if(u)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(g){var o=a.url.length;if(o>1&&a.loadError<o)m.levelRetry=!0,this.redundantFailover(f);else if(this.manualLevelIndex===-1){var y=f===0?this._levels.length-1:f-1;this.currentLevelIndex!==y&&this._levels[y].loadError===0&&(this.warn(h+": switch to "+y),m.levelRetry=!0,this.hls.nextAutoLevel=y)}}},l.redundantFailover=function(m){var f=this._levels[m],w=f.url.length;if(w>1){var g=(f.urlId+1)%w;this.warn("Switching to redundant URL-id "+g),this._levels.forEach(function(h){h.urlId=g}),this.level=m}},l.onFragLoaded=function(m,f){var w=f.frag;if(w!==void 0&&w.type===D.PlaylistLevelType.MAIN){var g=this._levels[w.level];g!==void 0&&(g.fragmentError=0,g.loadError=0)}},l.onLevelLoaded=function(m,f){var w,g=f.level,h=f.details,a=this._levels[g];if(!a){var u;this.warn("Invalid level index "+g),(u=f.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(h.deltaUpdateFailed=!0);return}g===this.currentLevelIndex?(a.fragmentError===0&&(a.loadError=0,this.retryCount=0),this.playlistLoaded(g,f,a.details)):(w=f.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(h.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(m,f){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var g=-1,h=this.hls.audioTracks[f.id].groupId,a=0;a<w.audioGroupIds.length;a++)if(w.audioGroupIds[a]===h){g=a;break}g!==w.urlId&&(w.urlId=g,this.startLoad())}},l.loadPlaylist=function(m){var f=this.currentLevelIndex,w=this._levels[f];if(this.canLoad&&w&&w.url.length>0){var g=w.urlId,h=w.url[g];if(m)try{h=m.addDirectives(h)}catch(a){this.warn("Could not construct new URL with HLS Delivery Directives: "+a)}this.log("Attempt loading level index "+f+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+g+" "+h),this.clearTimer(),this.hls.trigger(k.Events.LEVEL_LOADING,{url:h,level:f,id:g,deliveryDirectives:m||null})}},l.removeLevel=function(m,f){var w=function(a,u){return u!==f},g=this._levels.filter(function(h,a){return a!==m?!0:h.url.length>1&&f!==void 0?(h.url=h.url.filter(w),h.audioGroupIds&&(h.audioGroupIds=h.audioGroupIds.filter(w)),h.textGroupIds&&(h.textGroupIds=h.textGroupIds.filter(w)),h.urlId=0,!0):!1}).map(function(h,a){var u=h.details;return u!=null&&u.fragments&&u.fragments.forEach(function(o){o.level=a}),h});this._levels=g,this.hls.trigger(k.Events.LEVELS_UPDATED,{levels:g})},_(d,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var f,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===m&&(f=w[m])!==null&&f!==void 0&&f.details)return;if(m<0||m>=w.length){var g=m<0;if(this.hls.trigger(k.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:g,reason:"invalid level idx"}),g)return;m=Math.min(m,w.length-1)}this.clearTimer();var h=this.currentLevelIndex,a=w[h],u=w[m];this.log("switching to level "+m+" from "+h),this.currentLevelIndex=m;var o=E({},u,{level:m,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete o._urlId,this.hls.trigger(k.Events.LEVEL_SWITCHING,o);var y=u.details;if(!y||y.live){var p=this.switchParams(u.uri,a==null?void 0:a.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),d}(P.default)},"./src/controller/level-helper.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"addGroupId",function(){return O}),R.d(V,"assignTrackIdsByGroup",function(){return F}),R.d(V,"updatePTS",function(){return U}),R.d(V,"updateFragPTSDTS",function(){return D}),R.d(V,"mergeDetails",function(){return E}),R.d(V,"mapPartIntersection",function(){return b}),R.d(V,"mapFragmentIntersection",function(){return _}),R.d(V,"adjustSliding",function(){return C}),R.d(V,"addSliding",function(){return A}),R.d(V,"computeReloadInterval",function(){return v}),R.d(V,"getFragmentWithSN",function(){return c}),R.d(V,"getPartWith",function(){return s});var G=R("./src/polyfills/number.ts"),k=R("./src/utils/logger.ts");function O(d,l,S){switch(l){case"audio":d.audioGroupIds||(d.audioGroupIds=[]),d.audioGroupIds.push(S);break;case"text":d.textGroupIds||(d.textGroupIds=[]),d.textGroupIds.push(S);break}}function F(d){var l={};d.forEach(function(S){var m=S.groupId||"";S.id=l[m]=l[m]||0,l[m]++})}function U(d,l,S){var m=d[l],f=d[S];P(m,f)}function P(d,l){var S=l.startPTS;if(Object(G.isFiniteNumber)(S)){var m=0,f;l.sn>d.sn?(m=S-d.start,f=d):(m=d.start-S,f=l),f.duration!==m&&(f.duration=m)}else if(l.sn>d.sn){var w=d.cc===l.cc;w&&d.minEndPTS?l.start=d.start+(d.minEndPTS-d.start):l.start=d.start+d.duration}else l.start=Math.max(d.start-l.duration,0)}function D(d,l,S,m,f,w){var g=m-S;g<=0&&(k.logger.warn("Fragment should have a positive duration",l),m=S+l.duration,w=f+l.duration);var h=S,a=m,u=l.startPTS,o=l.endPTS;if(Object(G.isFiniteNumber)(u)){var y=Math.abs(u-S);Object(G.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(y,l.deltaPTS):l.deltaPTS=y,h=Math.max(S,u),S=Math.min(S,u),f=Math.min(f,l.startDTS),a=Math.min(m,o),m=Math.max(m,o),w=Math.max(w,l.endDTS)}l.duration=m-S;var p=S-l.start;l.appendedPTS=m,l.start=l.startPTS=S,l.maxStartPTS=h,l.startDTS=f,l.endPTS=m,l.minEndPTS=a,l.endDTS=w;var x=l.sn;if(!d||x<d.startSN||x>d.endSN)return 0;var M,N=x-d.startSN,j=d.fragments;for(j[N]=l,M=N;M>0;M--)P(j[M],j[M-1]);for(M=N;M<j.length-1;M++)P(j[M],j[M+1]);return d.fragmentHint&&P(j[j.length-1],d.fragmentHint),d.PTSKnown=d.alignedSliding=!0,p}function E(d,l){for(var S=null,m=d.fragments,f=m.length-1;f>=0;f--){var w=m[f].initSegment;if(w){S=w;break}}d.fragmentHint&&delete d.fragmentHint.endPTS;var g=0,h;if(_(d,l,function(M,N){M.relurl&&(g=M.cc-N.cc),Object(G.isFiniteNumber)(M.startPTS)&&Object(G.isFiniteNumber)(M.endPTS)&&(N.start=N.startPTS=M.startPTS,N.startDTS=M.startDTS,N.appendedPTS=M.appendedPTS,N.maxStartPTS=M.maxStartPTS,N.endPTS=M.endPTS,N.endDTS=M.endDTS,N.minEndPTS=M.minEndPTS,N.duration=M.endPTS-M.startPTS,N.duration&&(h=N),l.PTSKnown=l.alignedSliding=!0),N.elementaryStreams=M.elementaryStreams,N.loader=M.loader,N.stats=M.stats,N.urlId=M.urlId,M.initSegment&&(N.initSegment=M.initSegment,S=M.initSegment)}),S){var a=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;a.forEach(function(M){var N;(!M.initSegment||M.initSegment.relurl===((N=S)===null||N===void 0?void 0:N.relurl))&&(M.initSegment=S)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(M){return!M}),l.deltaUpdateFailed)){k.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=l.skippedSegments;u--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var o=l.fragments;if(g){k.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y<o.length;y++)o[y].cc+=g}l.skippedSegments&&(l.startCC=l.fragments[0].cc),b(d.partList,l.partList,function(M,N){N.elementaryStreams=M.elementaryStreams,N.stats=M.stats}),h?D(l,h,h.startPTS,h.endPTS,h.startDTS,h.endDTS):C(d,l),o.length&&(l.totalduration=l.edge-o[0].start),l.driftStartTime=d.driftStartTime,l.driftStart=d.driftStart;var p=l.advancedDateTime;if(l.advanced&&p){var x=l.edge;l.driftStart||(l.driftStartTime=p,l.driftStart=x),l.driftEndTime=p,l.driftEnd=x}else l.driftEndTime=d.driftEndTime,l.driftEnd=d.driftEnd,l.advancedDateTime=d.advancedDateTime}function b(d,l,S){if(d&&l)for(var m=0,f=0,w=d.length;f<=w;f++){var g=d[f],h=l[f+m];g&&h&&g.index===h.index&&g.fragment.sn===h.fragment.sn?S(g,h):m--}}function _(d,l,S){for(var m=l.skippedSegments,f=Math.max(d.startSN,l.startSN)-l.startSN,w=(d.fragmentHint?1:0)+(m?l.endSN:Math.min(d.endSN,l.endSN))-l.startSN,g=l.startSN-d.startSN,h=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,a=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,u=f;u<=w;u++){var o=a[g+u],y=h[u];m&&!y&&u<m&&(y=l.fragments[u]=o),o&&y&&S(o,y)}}function C(d,l){var S=l.startSN+l.skippedSegments-d.startSN,m=d.fragments;if(S<0||S>=m.length)return;A(l,m[S].start)}function A(d,l){if(l){for(var S=d.fragments,m=d.skippedSegments;m<S.length;m++)S[m].start+=l;d.fragmentHint&&(d.fragmentHint.start+=l)}}function v(d,l){var S=1e3*d.levelTargetDuration,m=S/2,f=d.age,w=f>0&&f<S*3,g=l.loading.end-l.loading.start,h,a=d.availabilityDelay;if(d.updated===!1)if(w){var u=333*d.misses;h=Math.max(Math.min(m,g*2),u),d.availabilityDelay=(d.availabilityDelay||0)+h}else h=m;else w?(a=Math.min(a||S/2,f),d.availabilityDelay=a,h=a+S-f):h=S-g;return Math.round(h)}function c(d,l,S){if(!d||!d.details)return null;var m=d.details,f=m.fragments[l-m.startSN];return f||(f=m.fragmentHint,f&&f.sn===l?f:l<m.startSN&&S&&S.sn===l?S:null)}function s(d,l,S){if(!d||!d.details)return null;var m=d.details.partList;if(m)for(var f=m.length;f--;){var w=m[f];if(w.index===S&&w.fragment.sn===l)return w}return null}},"./src/controller/stream-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return m});var G=R("./src/polyfills/number.ts"),k=R("./src/controller/base-stream-controller.ts"),O=R("./src/is-supported.ts"),F=R("./src/events.ts"),U=R("./src/utils/buffer-helper.ts"),P=R("./src/controller/fragment-tracker.ts"),D=R("./src/types/loader.ts"),E=R("./src/loader/fragment.ts"),b=R("./src/demux/transmuxer-interface.ts"),_=R("./src/types/transmuxer.ts"),C=R("./src/controller/gap-controller.ts"),A=R("./src/errors.ts"),v=R("./src/utils/logger.ts");function c(f,w){for(var g=0;g<w.length;g++){var h=w[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}function s(f,w,g){return w&&c(f.prototype,w),g&&c(f,g),f}function d(f,w){f.prototype=Object.create(w.prototype),f.prototype.constructor=f,l(f,w)}function l(f,w){return l=Object.setPrototypeOf||function(h,a){return h.__proto__=a,h},l(f,w)}var S=100,m=function(f){d(w,f);function w(h,a){var u;return u=f.call(this,h,a,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var g=w.prototype;return g._registerListeners=function(){var a=this.hls;a.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),a.on(F.Events.ERROR,this.onError,this),a.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),a.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),a.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var a=this.hls;a.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),a.off(F.Events.ERROR,this.onError,this),a.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),a.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),a.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},g.startLoad=function(a){if(this.levels){var u=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var y=o.startLevel;y===-1&&(o.config.testBandwidth?(y=0,this.bitrateTest=!0):y=o.nextAutoLevel),this.level=o.nextLoadLevel=y,this.loadedmetadata=!1}u>0&&a===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),a=u),this.state=k.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()}else this._forceStartLoad=!0,this.state=k.State.STOPPED},g.stopLoad=function(){this._forceStartLoad=!1,f.prototype.stopLoad.call(this)},g.doTick=function(){switch(this.state){case k.State.IDLE:this.doTickIdle();break;case k.State.WAITING_LEVEL:{var a,u=this.levels,o=this.level,y=u==null||((a=u[o])===null||a===void 0)?void 0:a.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=k.State.IDLE;break}break}case k.State.FRAG_LOADING_WAITING_RETRY:{var p,x=self.performance.now(),M=this.retryDate;(!M||x>=M||(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()},g.onTickEnd=function(){f.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},g.doTickIdle=function(){var a,u,o=this.hls,y=this.levelLastLoaded,p=this.levels,x=this.media,M=o.config,N=o.nextLoadLevel;if(y===null||!x&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[N])return;var j=p[N];this.level=o.nextLoadLevel=N;var W=j.details;if(!W||this.state===k.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==N){this.state=k.State.WAITING_LEVEL;return}var L=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,D.PlaylistLevelType.MAIN);if(L===null)return;var I=L.len,K=this.getMaxBufferLength(j.maxBitrate);if(I>=K)return;if(this._streamEnded(L,W)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,Y),this.state=k.State.ENDED;return}var ee=L.end,oe=this.getNextFragment(ee,W);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var xe=oe.sn-W.startSN;xe>1&&(oe=W.fragments[xe-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===P.FragmentState.OK&&this.nextLoadPosition>ee){var ve=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,ve,D.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,W)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((a=oe.decryptdata)===null||a===void 0?void 0:a.keyFormat)==="identity"&&!((u=oe.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(oe,W):this.loadFragment(oe,W,ee)},g.loadFragment=function(a,u,o){var y,p=this.fragmentTracker.getState(a);if(this.fragCurrent=a,p===P.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(a);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else p=P.FragmentState.NOT_LOADED}p===P.FragmentState.NOT_LOADED||p===P.FragmentState.PARTIAL?a.sn==="initSegment"?this._loadInitSegment(a):this.bitrateTest?(a.bitrateTest=!0,this.log("Fragment "+a.sn+" of level "+a.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(a)):(this.startFragRequested=!0,f.prototype.loadFragment.call(this,a,u,o)):p===P.FragmentState.APPENDING?this.reduceMaxBufferLength(a.duration)&&this.fragmentTracker.removeFragment(a):((y=this.media)===null||y===void 0?void 0:y.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},g.getAppendedFrag=function(a){var u=this.fragmentTracker.getAppendedFrag(a,D.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},g.getBufferedFrag=function(a){return this.fragmentTracker.getBufferedFrag(a,D.PlaylistLevelType.MAIN)},g.followingBufferedFrag=function(a){return a?this.getBufferedFrag(a.end+.5):null},g.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},g.nextLevelSwitch=function(){var a=this.levels,u=this.media;if(u!=null&&u.readyState){var o,y=this.getAppendedFrag(u.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!u.paused&&a){var p=this.hls.nextLoadLevel,x=a[p],M=this.fragLastKbps;M&&this.fragCurrent?o=this.fragCurrent.duration*x.maxBitrate/(1e3*M)+1:o=0}else o=0;var N=this.getBufferedFrag(u.currentTime+o);if(N){var j=this.followingBufferedFrag(N);if(j){this.abortCurrentFrag();var W=j.maxStartPTS?j.maxStartPTS:j.start,L=j.duration,I=Math.max(N.end,W+Math.min(Math.max(L-this.config.maxFragLookUpTolerance,L*.5),L*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},g.abortCurrentFrag=function(){var a=this.fragCurrent;this.fragCurrent=null,a!=null&&a.loader&&a.loader.abort(),this.state===k.State.KEY_LOADING&&(this.state=k.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},g.flushMainBuffer=function(a,u){f.prototype.flushMainBuffer.call(this,a,u,this.altAudio?"video":null)},g.onMediaAttached=function(a,u){f.prototype.onMediaAttached.call(this,a,u);var o=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new C.default(this.config,o,this.fragmentTracker,this.hls)},g.onMediaDetaching=function(){var a=this.media;a&&(a.removeEventListener("playing",this.onvplaying),a.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),f.prototype.onMediaDetaching.call(this)},g.onMediaPlaying=function(){this.tick()},g.onMediaSeeked=function(){var a=this.media,u=a?a.currentTime:null;Object(G.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},g.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},g.onManifestParsed=function(a,u){var o=!1,y=!1,p;u.levels.forEach(function(x){p=x.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(o=!0),p.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=o&&y&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},g.onLevelLoading=function(a,u){var o=this.levels;if(!o||this.state!==k.State.IDLE)return;var y=o[u.level];(!y.details||y.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(y.details))&&(this.state=k.State.WAITING_LEVEL)},g.onLevelLoaded=function(a,u){var o,y=this.levels,p=u.level,x=u.details,M=x.totalduration;if(!y){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+M);var N=this.fragCurrent;N&&(this.state===k.State.FRAG_LOADING||this.state===k.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==u.level&&N.loader&&(this.state=k.State.IDLE,N.loader.abort()));var j=y[p],W=0;if(x.live||(o=j.details)!==null&&o!==void 0&&o.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;W=this.alignPlaylists(x,j.details)}if(j.details=x,this.levelLastLoaded=p,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:x,level:p}),this.state===k.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=k.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,W),this.tick()},g._handleFragmentLoadProgress=function(a){var u,o=a.frag,y=a.part,p=a.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var M=x[o.level],N=M.details;if(!N){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var j=M.videoCodec,W=N.PTSKnown||!N.live,L=(u=o.initSegment)===null||u===void 0?void 0:u.data,I=this._getAudioCodec(M),K=this.transmuxer=this.transmuxer||new b.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=y?y.index:-1,ee=Y!==-1,oe=new _.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,p.byteLength,Y,ee),xe=this.initPTS[o.cc];K.push(p,L,I,j,o,y,N.totalduration,W,oe,xe)},g.onAudioTrackSwitching=function(a,u){var o=this.altAudio,y=!!u.url,p=u.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;o&&M.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:p})}},g.onAudioTrackSwitched=function(a,u){var o=u.id,y=!!this.hls.audioTracks[o].url;if(y){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=y,this.tick()},g.onBufferCreated=function(a,u){var o=u.tracks,y,p,x=!1;for(var M in o){var N=o[M];if(N.id==="main"){if(p=M,y=N,M==="video"){var j=o[M];j&&(this.videoBuffer=j.buffer)}}else x=!0}x&&y?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},g.onFragBuffered=function(a,u){var o=u.frag,y=u.part;if(o&&o.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(y?" p: "+y.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===k.State.PARSED&&(this.state=k.State.IDLE);return}var p=y?y.stats:o.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,y)},g.onError=function(a,u){switch(u.details){case A.ErrorDetails.FRAG_LOAD_ERROR:case A.ErrorDetails.FRAG_LOAD_TIMEOUT:case A.ErrorDetails.KEY_LOAD_ERROR:case A.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,u);break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=k.State.ERROR):!u.levelRetry&&this.state===k.State.WAITING_LEVEL&&(this.state=k.State.IDLE));break;case A.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===k.State.PARSING||this.state===k.State.PARSED)){var o=!0,y=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);y&&y.len>.5&&(o=!this.reduceMaxBufferLength(y.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},g.checkBuffer=function(){var a=this.media,u=this.gapController;if(!a||!u||!a.readyState)return;var o=U.BufferHelper.getBuffered(a);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=a.currentTime},g.onFragLoadEmergencyAborted=function(){this.state=k.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},g.onBufferFlushed=function(a,u){var o=u.type;if(o!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var y=(o===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,o,D.PlaylistLevelType.MAIN)}},g.onLevelsUpdated=function(a,u){this.levels=u.levels},g.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},g.seekToStartPos=function(){var a=this.media,u=a.currentTime,o=this.startPosition;if(o>=0&&u<o){if(a.seeking){v.logger.log("could not seek to "+o+", already seeking at "+u);return}var y=U.BufferHelper.getBuffered(a),p=y.length?y.start(0):0,x=p-o;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(v.logger.log("adjusting start position by "+x+" to match buffer start"),o+=x,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+u),a.currentTime=o}},g._getAudioCodec=function(a){var u=this.config.defaultAudioCodec||a.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},g._loadBitrateTestFrag=function(a){var u=this;this._doFragLoad(a).then(function(o){var y=u.hls;if(!o||y.nextLoadLevel||u.fragContextChanged(a))return;u.fragLoadError=0,u.state=k.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var p=a.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),y.trigger(F.Events.FRAG_LOADED,o)})},g._handleTransmuxComplete=function(a){var u,o="main",y=this.hls,p=a.remuxResult,x=a.chunkMeta,M=this.getCurrentContext(x);if(!M){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var N=M.frag,j=M.part,W=M.level,L=p.video,I=p.text,K=p.id3,Y=p.initSegment,ee=this.altAudio?void 0:p.audio;if(this.fragContextChanged(N))return;if(this.state=k.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(W,Y.tracks,N,x),y.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:o,tracks:Y.tracks}));var oe=Y.initPTS,xe=Y.timescale;Object(G.isFiniteNumber)(oe)&&(this.initPTS[N.cc]=oe,y.trigger(F.Events.INIT_PTS_FOUND,{frag:N,id:o,initPTS:oe,timescale:xe}))}if(L&&p.independent!==!1){if(W.details){var ve=L.startPTS,ge=L.endPTS,me=L.startDTS,ce=L.endDTS;if(j)j.elementaryStreams[L.type]={startPTS:ve,endPTS:ge,startDTS:me,endDTS:ce};else if(L.firstKeyFrame&&L.independent&&(this.couldBacktrack=!0),L.dropped&&L.independent){var ie=this.getLoadPosition()+this.config.maxBufferHole;if(ie<ve){this.backtrack(N);return}N.setElementaryStreamInfo(L.type,N.start,ge,N.start,ce,!0)}N.setElementaryStreamInfo(L.type,ve,ge,me,ce),this.bufferFragmentData(L,N,j,x)}}else if(p.independent===!1){this.backtrack(N);return}if(ee){var pe=ee.startPTS,J=ee.endPTS,ne=ee.startDTS,$=ee.endDTS;j&&(j.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:pe,endPTS:J,startDTS:ne,endDTS:$}),N.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,pe,J,ne,$),this.bufferFragmentData(ee,N,j,x)}if(K!=null&&(u=K.samples)!==null&&u!==void 0&&u.length){var be={frag:N,id:o,samples:K.samples};y.trigger(F.Events.FRAG_PARSING_METADATA,be)}if(I){var Te={frag:N,id:o,samples:I.samples};y.trigger(F.Events.FRAG_PARSING_USERDATA,Te)}},g._bufferInitSegment=function(a,u,o,y){var p=this;if(this.state!==k.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var x=u.audio,M=u.video,N=u.audiovideo;if(x){var j=a.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),x.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(j="mp4a.40.5")),W.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),a.audioCodec&&a.audioCodec!==j&&this.log('Swapping manifest audio codec "'+a.audioCodec+'" for "'+j+'"'),x.levelCodec=j,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(a.audioCodec||"")+"/"+x.codec+"]")}M&&(M.levelCodec=a.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(a.videoCodec||"")+"/"+M.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(a.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(L){var I=u[L],K=I.initSegment;K!=null&&K.byteLength&&p.hls.trigger(F.Events.BUFFER_APPENDING,{type:L,data:K,frag:o,part:null,chunkMeta:y,parent:o.type})}),this.tick()},g.backtrack=function(a){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(a);var u=this.fragmentTracker.backtrack(a);this.fragPrevious=null,this.nextLoadPosition=a.start,u?this.resetFragmentLoading(a):this.state=k.State.BACKTRACKING},g.checkFragmentChanged=function(){var a=this.media,u=null;if(a&&a.readyState>1&&a.seeking===!1){var o=a.currentTime;if(U.BufferHelper.isBuffered(a,o)?u=this.getAppendedFrag(o):U.BufferHelper.isBuffered(a,o+.1)&&(u=this.getAppendedFrag(o+.1)),u){var y=this.fragPlaying,p=u.level;(!y||u.sn!==y.sn||y.level!==p||u.urlId!==y.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:u}),(!y||y.level!==p)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=u)}}},s(w,[{key:"nextLevel",get:function(){var a=this.nextBufferedFrag;return a?a.level:-1}},{key:"currentLevel",get:function(){var a=this.media;if(a){var u=this.getAppendedFrag(a.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var a=this.media;if(a){var u=this.getAppendedFrag(a.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(k.default)},"./src/controller/subtitle-stream-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"SubtitleStreamController",function(){return d});var G=R("./src/events.ts"),k=R("./src/utils/logger.ts"),O=R("./src/utils/buffer-helper.ts"),F=R("./src/controller/fragment-finders.ts"),U=R("./src/utils/discontinuities.ts"),P=R("./src/controller/level-helper.ts"),D=R("./src/controller/fragment-tracker.ts"),E=R("./src/controller/base-stream-controller.ts"),b=R("./src/types/loader.ts"),_=R("./src/types/level.ts");function C(l,S){for(var m=0;m<S.length;m++){var f=S[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(l,f.key,f)}}function A(l,S,m){return S&&C(l.prototype,S),m&&C(l,m),l}function v(l,S){l.prototype=Object.create(S.prototype),l.prototype.constructor=l,c(l,S)}function c(l,S){return c=Object.setPrototypeOf||function(f,w){return f.__proto__=w,f},c(l,S)}var s=500,d=function(l){v(S,l);function S(f,w){var g;return g=l.call(this,f,w,"[subtitle-stream-controller]")||this,g.levels=[],g.currentTrackId=-1,g.tracksBuffered=[],g.mainDetails=null,g._registerListeners(),g}var m=S.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var w=this.hls;w.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(G.Events.ERROR,this.onError,this),w.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var w=this.hls;w.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(G.Events.ERROR,this.onError,this),w.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=E.State.IDLE,this.setInterval(s),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(w,g){this.mainDetails=g.details},m.onSubtitleFragProcessed=function(w,g){var h=g.frag,a=g.success;if(this.fragPrevious=h,this.state=E.State.IDLE,!a)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var o,y=h.start,p=0;p<u.length;p++)if(y>=u[p].start&&y<=u[p].end){o=u[p];break}var x=h.start+h.duration;o?o.end=x:(o={start:y,end:x},u.push(o)),this.fragmentTracker.fragBuffered(h)},m.onBufferFlushing=function(w,g){var h=g.startOffset,a=g.endOffset;if(h===0&&a!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,o=this.levels;if(!o.length||!o[u]||!o[u].details)return;var y=o[u].details,p=y.targetduration,x=a-p;if(x<=0)return;g.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(M){for(var N=0;N<M.length;){if(M[N].end<=x){M.shift();continue}else if(M[N].start<x)M[N].start=x;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(h,x,b.PlaylistLevelType.SUBTITLE)}},m.onError=function(w,g){var h,a=g.frag;if(!a||a.type!==b.PlaylistLevelType.SUBTITLE)return;(h=this.fragCurrent)!==null&&h!==void 0&&h.loader&&this.fragCurrent.loader.abort(),this.state=E.State.IDLE},m.onSubtitleTracksUpdated=function(w,g){var h=this,a=g.subtitleTracks;this.tracksBuffered=[],this.levels=a.map(function(u){return new _.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){h.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(w,g){if(this.currentTrackId=g.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var h=this.levels[this.currentTrackId];h!=null&&h.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,h&&this.setInterval(s)},m.onSubtitleTrackLoaded=function(w,g){var h,a=g.details,u=g.id,o=this.currentTrackId,y=this.levels;if(!y.length)return;var p=y[o];if(u>=y.length||u!==o||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,a.live||(h=p.details)!==null&&h!==void 0&&h.live){var x=this.mainDetails;if(a.deltaUpdateFailed||!x)return;var M=x.fragments[0];if(!p.details)a.hasProgramDateTime&&x.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(a,x):M&&Object(P.addSliding)(a,M.start);else{var N=this.alignPlaylists(a,p.details);N===0&&M&&Object(P.addSliding)(a,M.start)}}if(p.details=a,this.levelLastLoaded=u,this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var j=Object(F.findFragmentByPTS)(null,a.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},m._handleFragmentLoadComplete=function(w){var g=w.frag,h=w.payload,a=g.decryptdata,u=this.hls;if(this.fragContextChanged(g))return;if(h&&h.byteLength>0&&a&&a.key&&a.iv&&a.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(h),a.key.buffer,a.iv.buffer).then(function(y){var p=performance.now();u.trigger(G.Events.FRAG_DECRYPTED,{frag:g,payload:y,stats:{tstart:o,tdecrypt:p}})})}},m.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var w,g=this.currentTrackId,h=this.levels;if(!h.length||!h[g]||!h[g].details)return;var a=h[g].details,u=a.targetduration,o=this.config,y=this.media,p=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-u,o.maxBufferHole),x=p.end,M=p.len,N=this.getMaxBufferLength()+u;if(M>N)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var j=a.fragments,W=j.length,L=a.edge,I,K=this.fragPrevious;if(x<L){var Y=o.maxFragLookUpTolerance;K&&a.hasProgramDateTime&&(I=Object(F.findFragmentByPDT)(j,K.endProgramDateTime,Y)),I||(I=Object(F.findFragmentByPTS)(K,j,x,Y),!I&&K&&K.start<j[0].start&&(I=j[0]))}else I=j[W-1];(w=I)!==null&&w!==void 0&&w.encrypted?(k.logger.log("Loading key for "+I.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===D.FragmentState.NOT_LOADED&&this.loadFragment(I,a,x)}},m.loadFragment=function(w,g,h){this.fragCurrent=w,l.prototype.loadFragment.call(this,w,g,h)},A(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(E.default)},"./src/controller/subtitle-track-controller.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/events.ts"),k=R("./src/utils/texttrack-utils.ts"),O=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function U(C,A){for(var v=0;v<A.length;v++){var c=A[v];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(C,c.key,c)}}function P(C,A,v){return A&&U(C.prototype,A),v&&U(C,v),C}function D(C,A){C.prototype=Object.create(A.prototype),C.prototype.constructor=C,E(C,A)}function E(C,A){return E=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},E(C,A)}var b=function(C){D(A,C);function A(c){var s;return s=C.call(this,c,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var v=A.prototype;return v.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,C.prototype.destroy.call(this)},v.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(G.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(G.Events.ERROR,this.onError,this)},v.onMediaAttached=function(s,d){if(this.media=d.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},v.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},v.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=_(this.media.textTracks);s.forEach(function(d){Object(k.clearCurrentCues)(d)}),this.subtitleTrack=-1,this.media=null},v.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},v.onManifestParsed=function(s,d){this.tracks=d.subtitleTracks},v.onSubtitleTrackLoaded=function(s,d){var l=d.id,S=d.details,m=this.trackId,f=this.tracksInGroup[m];if(!f){this.warn("Invalid subtitle track id "+l);return}var w=f.details;f.details=d.details,this.log("subtitle track "+l+" loaded ["+S.startSN+"-"+S.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,d,w))},v.onLevelLoading=function(s,d){this.switchLevel(d.level)},v.onLevelSwitching=function(s,d){this.switchLevel(d.level)},v.switchLevel=function(s){var d=this.hls.levels[s];if(!(d!=null&&d.textGroupIds))return;var l=d.textGroupIds[d.urlId];if(this.groupId!==l){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(g){return!l||g.groupId===l});this.tracksInGroup=m;var f=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=l;var w={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,w),f!==-1&&this.setSubtitleTrack(f,S)}},v.findTrackId=function(s){for(var d=this.tracksInGroup,l=0;l<d.length;l++){var S=d[l];if((!this.selectDefaultTrack||S.default)&&(!s||s===S.name))return S.id}return-1},v.onError=function(s,d){if(C.prototype.onError.call(this,s,d),d.fatal||!d.context)return;d.context.type===F.PlaylistContextType.SUBTITLE_TRACK&&d.context.id===this.trackId&&d.context.groupId===this.groupId&&this.retryLoadingOrFail(d)},v.loadPlaylist=function(s){var d=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(d)){var l=d.id,S=d.groupId,m=d.url;if(s)try{m=s.addDirectives(m)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:m,id:l,groupId:S,deliveryDirectives:s||null})}},v.toggleTrackModes=function(s){var d=this,l=this.media,S=this.subtitleDisplay,m=this.trackId;if(!l)return;var f=_(l.textTracks),w=f.filter(function(a){return a.groupId===d.groupId});if(s===-1)[].slice.call(f).forEach(function(a){a.mode="disabled"});else{var g=w[m];g&&(g.mode="disabled")}var h=w[s];h&&(h.mode=S?"showing":"hidden")},v.setSubtitleTrack=function(s,d){var l,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(l=S[s])!==null&&l!==void 0&&l.details)||s<-1||s>=S.length)return;this.clearTimer();var m=S[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,m){var f=m.id,w=m.groupId,g=w===void 0?"":w,h=m.name,a=m.type,u=m.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:f,groupId:g,name:h,type:a,url:u});var o=this.switchParams(m.url,d==null?void 0:d.details);this.loadPlaylist(o)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:s})},v.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,d=_(this.media.textTracks),l=0;l<d.length;l++)if(d[l].mode==="hidden")s=l;else if(d[l].mode==="showing"){s=l;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},P(A,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var d=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,d)}}]),A}(O.default);function _(C){for(var A=[],v=0;v<C.length;v++){var c=C[v];c.kind==="subtitles"&&c.label&&A.push(C[v])}return A}V.default=b},"./src/controller/timeline-controller.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"TimelineController",function(){return _});var G=R("./src/polyfills/number.ts"),k=R("./src/events.ts"),O=R("./src/utils/cea-608-parser.ts"),F=R("./src/utils/output-filter.ts"),U=R("./src/utils/webvtt-parser.ts"),P=R("./src/utils/texttrack-utils.ts"),D=R("./src/utils/imsc1-ttml-parser.ts"),E=R("./src/types/loader.ts"),b=R("./src/utils/logger.ts"),_=function(){function c(d){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=v(),this.captionsProperties=void 0,this.hls=d,this.config=d.config,this.Cues=d.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var l=new F.default(this,"textTrack1"),S=new F.default(this,"textTrack2"),m=new F.default(this,"textTrack3"),f=new F.default(this,"textTrack4");this.cea608Parser1=new O.default(1,l,S),this.cea608Parser2=new O.default(3,m,f)}d.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.on(k.Events.FRAG_LOADING,this.onFragLoading,this),d.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(k.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.on(k.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(k.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=c.prototype;return s.destroy=function(){var l=this.hls;l.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(k.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.off(k.Events.FRAG_LOADING,this.onFragLoading,this),l.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(k.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.off(k.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(k.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(l,S,m,f,w){for(var g=!1,h=w.length;h--;){var a=w[h],u=A(a[0],a[1],S,m);if(u>=0&&(a[0]=Math.min(a[0],S),a[1]=Math.max(a[1],m),g=!0,u/(m-S)>.5))return}if(g||w.push([S,m]),this.config.renderTextTracksNatively){var o=this.captionsTracks[l];this.Cues.newCue(o,S,m,f)}else{var y=this.Cues.newCue(null,S,m,f);this.hls.trigger(k.Events.CUES_PARSED,{type:"captions",cues:y,track:l})}},s.onInitPtsFound=function(l,S){var m=this,f=S.frag,w=S.id,g=S.initPTS,h=S.timescale,a=this.unparsedVttFrags;w==="main"&&(this.initPTS[f.cc]=g,this.timescale[f.cc]=h),a.length&&(this.unparsedVttFrags=[],a.forEach(function(u){m.onFragLoaded(k.Events.FRAG_LOADED,u)}))},s.getExistingTrack=function(l){var S=this.media;if(S)for(var m=0;m<S.textTracks.length;m++){var f=S.textTracks[m];if(f[l])return f}return null},s.createCaptionsTrack=function(l){this.config.renderTextTracksNatively?this.createNativeTrack(l):this.createNonNativeTrack(l)},s.createNativeTrack=function(l){if(this.captionsTracks[l])return;var S=this.captionsProperties,m=this.captionsTracks,f=this.media,w=S[l],g=w.label,h=w.languageCode,a=this.getExistingTrack(l);if(a)m[l]=a,Object(P.clearCurrentCues)(m[l]),Object(P.sendAddTrackEvent)(m[l],f);else{var u=this.createTextTrack("captions",g,h);u&&(u[l]=!0,m[l]=u)}},s.createNonNativeTrack=function(l){if(this.nonNativeCaptionsTracks[l])return;var S=this.captionsProperties[l];if(!S)return;var m=S.label,f={_id:l,label:m,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[l]=f,this.hls.trigger(k.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[f]})},s.createTextTrack=function(l,S,m){var f=this.media;return f?f.addTextTrack(l,S,m):void 0},s.onMediaAttaching=function(l,S){this.media=S.media,this._cleanTracks()},s.onMediaDetaching=function(){var l=this.captionsTracks;Object.keys(l).forEach(function(S){Object(P.clearCurrentCues)(l[S]),delete l[S]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=v(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},s._cleanTracks=function(){var l=this.media;if(!l)return;var S=l.textTracks;if(S)for(var m=0;m<S.length;m++)Object(P.clearCurrentCues)(S[m])},s.onSubtitleTracksUpdated=function(l,S){var m=this;this.textTracks=[];var f=S.subtitleTracks||[],w=f.some(function(u){return u.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var g=this.tracks&&f&&this.tracks.length===f.length;if(this.tracks=f||[],this.config.renderTextTracksNatively){var h=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,o){var y;if(o<h.length){for(var p=null,x=0;x<h.length;x++)if(C(h[x],u)){p=h[x];break}p&&(y=p)}y?Object(P.clearCurrentCues)(y):(y=m.createTextTrack("subtitles",u.name,u.lang),y&&(y.mode="disabled")),y&&(y.groupId=u.groupId,m.textTracks.push(y))})}else if(!g&&this.tracks&&this.tracks.length){var a=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(k.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}},s.onManifestLoaded=function(l,S){var m=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(f){var w=/(?:CC|SERVICE)([1-4])/.exec(f.instreamId);if(!w)return;var g="textTrack"+w[1],h=m.captionsProperties[g];if(!h)return;h.label=f.name,f.lang&&(h.languageCode=f.lang),h.media=f})},s.onFragLoading=function(l,S){var m=this.cea608Parser1,f=this.cea608Parser2,w=this.lastSn,g=this.lastPartIndex;if(!this.enabled||!(m&&f))return;if(S.frag.type===E.PlaylistLevelType.MAIN){var h,a,u=S.frag.sn,o=(h=S==null||((a=S.part)===null||a===void 0)?void 0:a.index)!=null?h:-1;u===w+1||u===w&&o===g+1||(m.reset(),f.reset()),this.lastSn=u,this.lastPartIndex=o}},s.onFragLoaded=function(l,S){var m=S.frag,f=S.payload,w=this.initPTS,g=this.unparsedVttFrags;if(m.type===E.PlaylistLevelType.SUBTITLE)if(f.byteLength){if(!Object(G.isFiniteNumber)(w[m.cc])){g.push(S),w.length&&this.hls.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var h=m.decryptdata;if(h==null||h.key==null||h.method!=="AES-128"){var a=this.tracks[m.level],u=this.vttCCs;u[m.cc]||(u[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),a&&a.textCodec===D.IMSC1_CODEC?this._parseIMSC1(m,f):this._parseVTTs(m,f,u)}}else this.hls.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(l,S){var m=this,f=this.hls;Object(D.parseIMSC1)(S,this.initPTS[l.cc],this.timescale[l.cc],function(w){m._appendCues(w,l.level),f.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(w){b.logger.log("Failed to parse IMSC1: "+w),f.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:w})})},s._parseVTTs=function(l,S,m){var f=this,w=this.hls;Object(U.parseWebVTT)(S,this.initPTS[l.cc],this.timescale[l.cc],m,l.cc,l.start,function(g){f._appendCues(g,l.level),w.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(g){f._fallbackToIMSC1(l,S),b.logger.log("Failed to parse VTT cue: "+g),w.trigger(k.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:g})})},s._fallbackToIMSC1=function(l,S){var m=this,f=this.tracks[l.level];f.textCodec||Object(D.parseIMSC1)(S,this.initPTS[l.cc],this.timescale[l.cc],function(){f.textCodec=D.IMSC1_CODEC,m._parseIMSC1(l,S)},function(){f.textCodec="wvtt"})},s._appendCues=function(l,S){var m=this.hls;if(this.config.renderTextTracksNatively){var f=this.textTracks[S];if(f.mode==="disabled")return;l.forEach(function(h){return Object(P.addCueToTrack)(f,h)})}else{var w=this.tracks[S],g=w.default?"default":"subtitles"+S;m.trigger(k.Events.CUES_PARSED,{type:"subtitles",cues:l,track:g})}},s.onFragDecrypted=function(l,S){var m=S.frag;if(m.type===E.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(k.Events.FRAG_LOADED,S)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(l,S){var m=this.cea608Parser1,f=this.cea608Parser2;if(!this.enabled||!(m&&f))return;for(var w=0;w<S.samples.length;w++){var g=S.samples[w].bytes;if(g){var h=this.extractCea608Data(g);m.addData(S.samples[w].pts,h[0]),f.addData(S.samples[w].pts,h[1])}}},s.onBufferFlushing=function(l,S){var m=S.startOffset,f=S.endOffset,w=S.endOffsetSubtitles,g=S.type,h=this.media;if(!h||h.currentTime<f)return;if(!g||g==="video"){var a=this.captionsTracks;Object.keys(a).forEach(function(o){return Object(P.removeCuesInRange)(a[o],m,f)})}if(this.config.renderTextTracksNatively&&(m===0&&w!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(o){return Object(P.removeCuesInRange)(u[o],m,w)})}},s.extractCea608Data=function(l){for(var S=l[0]&31,m=2,f=[[],[]],w=0;w<S;w++){var g=l[m++],h=127&l[m++],a=127&l[m++],u=(4&g)!==0,o=3&g;if(h===0&&a===0)continue;u&&((o===0||o===1)&&(f[o].push(h),f[o].push(a)))}return f},c}();function C(c,s){return c&&c.label===s.name&&!(c.textTrack1||c.textTrack2)}function A(c,s,d,l){return Math.min(s,l)-Math.max(c,d)}function v(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return G});var G=function(){function k(F,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=F,this.aesIV=U}var O=k.prototype;return O.decrypt=function(U,P){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},P,U)},k}()},"./src/crypt/aes-decryptor.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"removePadding",function(){return k}),R.d(V,"default",function(){return O});var G=R("./src/utils/typed-array.ts");function k(F){var U=F.byteLength,P=U&&new DataView(F.buffer).getUint8(U-1);return P?Object(G.sliceUint8)(F,0,U-P):F}var O=function(){function F(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=F.prototype;return U.uint8ArrayToUint32Array_=function(D){for(var E=new DataView(D),b=new Uint32Array(4),_=0;_<4;_++)b[_]=E.getUint32(_*4);return b},U.initTable=function(){var D=this.sBox,E=this.invSBox,b=this.subMix,_=b[0],C=b[1],A=b[2],v=b[3],c=this.invSubMix,s=c[0],d=c[1],l=c[2],S=c[3],m=new Uint32Array(256),f=0,w=0,g=0;for(g=0;g<256;g++)g<128?m[g]=g<<1:m[g]=g<<1^283;for(g=0;g<256;g++){var h=w^w<<1^w<<2^w<<3^w<<4;h=h>>>8^h&255^99,D[f]=h,E[h]=f;var a=m[f],u=m[a],o=m[u],y=m[h]*257^h*16843008;_[f]=y<<24|y>>>8,C[f]=y<<16|y>>>16,A[f]=y<<8|y>>>24,v[f]=y,y=o*16843009^u*65537^a*257^f*16843008,s[h]=y<<24|y>>>8,d[h]=y<<16|y>>>16,l[h]=y<<8|y>>>24,S[h]=y,f?(f=a^m[m[m[o^a]]],w^=m[m[w]]):f=w=1}},U.expandKey=function(D){for(var E=this.uint8ArrayToUint32Array_(D),b=!0,_=0;_<E.length&&b;)b=E[_]===this.key[_],_++;if(b)return;this.key=E;var C=this.keySize=E.length;if(C!==4&&C!==6&&C!==8)throw new Error("Invalid aes key size="+C);var A=this.ksRows=(C+6+1)*4,v,c,s=this.keySchedule=new Uint32Array(A),d=this.invKeySchedule=new Uint32Array(A),l=this.sBox,S=this.rcon,m=this.invSubMix,f=m[0],w=m[1],g=m[2],h=m[3],a,u;for(v=0;v<A;v++){if(v<C){a=s[v]=E[v];continue}u=a,v%C===0?(u=u<<8|u>>>24,u=l[u>>>24]<<24|l[u>>>16&255]<<16|l[u>>>8&255]<<8|l[u&255],u^=S[v/C|0]<<24):C>6&&v%C===4&&(u=l[u>>>24]<<24|l[u>>>16&255]<<16|l[u>>>8&255]<<8|l[u&255]),s[v]=a=(s[v-C]^u)>>>0}for(c=0;c<A;c++)v=A-c,c&3?u=s[v]:u=s[v-4],c<4||v<=4?d[c]=u:d[c]=f[l[u>>>24]]^w[l[u>>>16&255]]^g[l[u>>>8&255]]^h[l[u&255]],d[c]=d[c]>>>0},U.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},U.decrypt=function(D,E,b){for(var _=this.keySize+6,C=this.invKeySchedule,A=this.invSBox,v=this.invSubMix,c=v[0],s=v[1],d=v[2],l=v[3],S=this.uint8ArrayToUint32Array_(b),m=S[0],f=S[1],w=S[2],g=S[3],h=new Int32Array(D),a=new Int32Array(h.length),u,o,y,p,x,M,N,j,W,L,I,K,Y,ee,oe=this.networkToHostOrderSwap;E<h.length;){for(W=oe(h[E]),L=oe(h[E+1]),I=oe(h[E+2]),K=oe(h[E+3]),x=W^C[0],M=K^C[1],N=I^C[2],j=L^C[3],Y=4,ee=1;ee<_;ee++)u=c[x>>>24]^s[M>>16&255]^d[N>>8&255]^l[j&255]^C[Y],o=c[M>>>24]^s[N>>16&255]^d[j>>8&255]^l[x&255]^C[Y+1],y=c[N>>>24]^s[j>>16&255]^d[x>>8&255]^l[M&255]^C[Y+2],p=c[j>>>24]^s[x>>16&255]^d[M>>8&255]^l[N&255]^C[Y+3],x=u,M=o,N=y,j=p,Y=Y+4;u=A[x>>>24]<<24^A[M>>16&255]<<16^A[N>>8&255]<<8^A[j&255]^C[Y],o=A[M>>>24]<<24^A[N>>16&255]<<16^A[j>>8&255]<<8^A[x&255]^C[Y+1],y=A[N>>>24]<<24^A[j>>16&255]<<16^A[x>>8&255]<<8^A[M&255]^C[Y+2],p=A[j>>>24]<<24^A[x>>16&255]<<16^A[M>>8&255]<<8^A[N&255]^C[Y+3],a[E]=oe(u^m),a[E+1]=oe(p^f),a[E+2]=oe(y^w),a[E+3]=oe(o^g),m=W,f=L,w=I,g=K,E=E+4}return a.buffer},F}()},"./src/crypt/decrypter.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return E});var G=R("./src/crypt/aes-crypto.ts"),k=R("./src/crypt/fast-aes-key.ts"),O=R("./src/crypt/aes-decryptor.ts"),F=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),P=R("./src/utils/typed-array.ts"),D=16,E=function(){function b(C,A,v){var c=v===void 0?{}:v,s=c.removePKCS7Padding,d=s===void 0?!0:s;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=C,this.config=A,this.removePKCS7Padding=d,d)try{var l=self.crypto;l&&(this.subtle=l.subtle||l.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var _=b.prototype;return _.destroy=function(){this.observer=null},_.isSync=function(){return this.config.enableSoftwareAES},_.flush=function(){var A=this.currentResult;if(!A){this.reset();return}var v=new Uint8Array(A);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(v):v},_.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},_.decrypt=function(A,v,c,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(A),v,c);var d=this.flush();d&&s(d.buffer)}else this.webCryptoDecrypt(new Uint8Array(A),v,c).then(s)},_.softwareDecrypt=function(A,v,c){var s=this.currentIV,d=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(A=Object(U.appendUint8Array)(l,A),this.remainderData=null);var S=this.getValidChunk(A);if(!S.length)return null;s&&(c=s);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new O.default),m.expandKey(v);var f=d;return this.currentResult=m.decrypt(S.buffer,0,c),this.currentIV=Object(P.sliceUint8)(S,-16).buffer,f||null},_.webCryptoDecrypt=function(A,v,c){var s=this,d=this.subtle;return(this.key!==v||!this.fastAesKey)&&(this.key=v,this.fastAesKey=new k.default(d,v)),this.fastAesKey.expandKey().then(function(l){if(!d)return Promise.reject(new Error("web crypto not initialized"));var S=new G.default(d,c);return S.decrypt(A.buffer,l)}).catch(function(l){return s.onWebCryptoError(l,A,v,c)})},_.onWebCryptoError=function(A,v,c,s){return F.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",A),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(v,c,s)},_.getValidChunk=function(A){var v=A,c=A.length-A.length%D;return c!==A.length&&(v=Object(P.sliceUint8)(A,0,c),this.remainderData=Object(P.sliceUint8)(A,c)),v},_.logOnce=function(A){if(!this.logEnabled)return;F.logger.log("[decrypter.ts]: "+A),this.logEnabled=!1},b}()},"./src/crypt/fast-aes-key.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return G});var G=function(){function k(F,U){this.subtle=void 0,this.key=void 0,this.subtle=F,this.key=U}var O=k.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},k}()},"./src/demux/aacdemuxer.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/demux/base-audio-demuxer.ts"),k=R("./src/demux/adts.ts"),O=R("./src/utils/logger.ts"),F=R("./src/demux/id3.ts");function U(E,b){E.prototype=Object.create(b.prototype),E.prototype.constructor=E,P(E,b)}function P(E,b){return P=Object.setPrototypeOf||function(C,A){return C.__proto__=A,C},P(E,b)}var D=function(E){U(b,E);function b(C,A){var v;return v=E.call(this)||this,v.observer=void 0,v.config=void 0,v.observer=C,v.config=A,v}var _=b.prototype;return _.resetInitSegment=function(A,v,c){E.prototype.resetInitSegment.call(this,A,v,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:A,duration:c,inputTimeScale:9e4,dropped:0}},b.probe=function(A){if(!A)return!1;for(var v=F.getID3Data(A,0)||[],c=v.length,s=A.length;c<s;c++)if(k.probe(A,c))return O.logger.log("ADTS sync word found !"),!0;return!1},_.canParse=function(A,v){return k.canParse(A,v)},_.appendFrame=function(A,v,c){k.initTrackConfig(A,this.observer,v,c,A.manifestCodec);var s=k.appendFrame(A,v,c,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},b}(G.default);D.minProbeByteLength=9,V.default=D},"./src/demux/adts.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"getAudioConfig",function(){return F}),R.d(V,"isHeaderPattern",function(){return U}),R.d(V,"getHeaderLength",function(){return P}),R.d(V,"getFullFrameLength",function(){return D}),R.d(V,"canGetFrameLength",function(){return E}),R.d(V,"isHeader",function(){return b}),R.d(V,"canParse",function(){return _}),R.d(V,"probe",function(){return C}),R.d(V,"initTrackConfig",function(){return A}),R.d(V,"getFrameDuration",function(){return v}),R.d(V,"parseFrameHeader",function(){return c}),R.d(V,"appendFrame",function(){return s});var G=R("./src/utils/logger.ts"),k=R("./src/errors.ts"),O=R("./src/events.ts");function F(d,l,S,m){var f,w,g,h,a=navigator.userAgent.toLowerCase(),u=m,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((l[S+2]&192)>>>6)+1;var y=(l[S+2]&60)>>>2;if(y>o.length-1){d.trigger(O.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return g=(l[S+2]&1)<<2,g|=(l[S+3]&192)>>>6,G.logger.log("manifest codec:"+m+", ADTS type:"+f+", samplingIndex:"+y),/firefox/i.test(a)?y>=6?(f=5,h=new Array(4),w=y-3):(f=2,h=new Array(2),w=y):a.indexOf("android")!==-1?(f=2,h=new Array(2),w=y):(f=5,h=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&y>=6?w=y-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(y>=6&&g===1||/vivaldi/i.test(a))||!m&&g===1)&&(f=2,h=new Array(2)),w=y)),h[0]=f<<3,h[0]|=(y&14)>>1,h[1]|=(y&1)<<7,h[1]|=g<<3,f===5&&(h[1]|=(w&14)>>1,h[2]=(w&1)<<7,h[2]|=2<<2,h[3]=0),{config:h,samplerate:o[y],channelCount:g,codec:"mp4a.40."+f,manifestCodec:u}}function U(d,l){return d[l]===255&&(d[l+1]&246)===240}function P(d,l){return d[l+1]&1?7:9}function D(d,l){return(d[l+3]&3)<<11|d[l+4]<<3|(d[l+5]&224)>>>5}function E(d,l){return l+5<d.length}function b(d,l){return l+1<d.length&&U(d,l)}function _(d,l){return E(d,l)&&U(d,l)&&D(d,l)<=d.length-l}function C(d,l){if(b(d,l)){var S=P(d,l);if(l+S>=d.length)return!1;var m=D(d,l);if(m<=S)return!1;var f=l+m;return f===d.length||b(d,f)}return!1}function A(d,l,S,m,f){if(!d.samplerate){var w=F(l,S,m,f);if(!w)return;d.config=w.config,d.samplerate=w.samplerate,d.channelCount=w.channelCount,d.codec=w.codec,d.manifestCodec=w.manifestCodec,G.logger.log("parsed codec:"+d.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function v(d){return 1024*9e4/d}function c(d,l,S,m,f){var w=P(d,l),g=D(d,l);if(g-=w,g>0){var h=S+m*f;return{headerLength:w,frameLength:g,stamp:h}}}function s(d,l,S,m,f){var w=v(d.samplerate),g=c(l,S,m,f,w);if(g){var h=g.frameLength,a=g.headerLength,u=g.stamp,o=a+h,y=Math.max(0,S+o-l.length),p;y?(p=new Uint8Array(o-a),p.set(l.subarray(S+a,l.length),0)):p=l.subarray(S+a,S+o);var x={unit:p,pts:u};return y||d.samples.push(x),{sample:x,length:o,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"initPTSFn",function(){return D});var G=R("./src/polyfills/number.ts"),k=R("./src/demux/id3.ts"),O=R("./src/demux/dummy-demuxed-track.ts"),F=R("./src/utils/mp4-tools.ts"),U=R("./src/utils/typed-array.ts"),P=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var b=E.prototype;return b.resetInitSegment=function(C,A,v){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},b.resetTimeStamp=function(){},b.resetContiguity=function(){},b.canParse=function(C,A){return!1},b.appendFrame=function(C,A,v){},b.demux=function(C,A){this.cachedData&&(C=Object(F.appendUint8Array)(this.cachedData,C),this.cachedData=null);var v=k.getID3Data(C,0),c=v?v.length:0,s,d,l=this._audioTrack,S=this._id3Track,m=v?k.getTimeStamp(v):void 0,f=C.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(m,A)),v&&v.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:v}),d=this.initPTS;c<f;){if(this.canParse(C,c)){var w=this.appendFrame(l,C,c);w?(this.frameIndex++,d=w.sample.pts,c+=w.length,s=c):c=f}else k.canParse(C,c)?(v=k.getID3Data(C,c),S.samples.push({pts:d,dts:d,data:v}),c+=v.length,s=c):c++;if(c===f&&s!==f){var g=Object(U.sliceUint8)(C,s);this.cachedData?this.cachedData=Object(F.appendUint8Array)(this.cachedData,g):this.cachedData=g}}return{audioTrack:l,avcTrack:Object(O.dummyTrack)(),id3Track:S,textTrack:Object(O.dummyTrack)()}},b.demuxSampleAes=function(C,A,v){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},b.flush=function(C){var A=this.cachedData;return A&&(this.cachedData=null,this.demux(A,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},b.destroy=function(){},E}(),D=function(b,_){return Object(G.isFiniteNumber)(b)?b*90:_*9e4};V.default=P},"./src/demux/chunk-cache.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return G});var G=function(){function O(){this.chunks=[],this.dataLength=0}var F=O.prototype;return F.push=function(P){this.chunks.push(P),this.dataLength+=P.length},F.flush=function(){var P=this.chunks,D=this.dataLength,E;if(P.length)P.length===1?E=P[0]:E=k(P,D);else return new Uint8Array(0);return this.reset(),E},F.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function k(O,F){for(var U=new Uint8Array(F),P=0,D=0;D<O.length;D++){var E=O[D];U.set(E,P),P+=E.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"dummyTrack",function(){return G});function G(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/utils/logger.ts"),k=function(){function O(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var F=O.prototype;return F.loadWord=function(){var P=this.data,D=this.bytesAvailable,E=P.byteLength-D,b=new Uint8Array(4),_=Math.min(4,D);if(_===0)throw new Error("no bytes available");b.set(P.subarray(E,E+_)),this.word=new DataView(b.buffer).getUint32(0),this.bitsAvailable=_*8,this.bytesAvailable-=_},F.skipBits=function(P){var D;this.bitsAvailable>P?(this.word<<=P,this.bitsAvailable-=P):(P-=this.bitsAvailable,D=P>>3,P-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=P,this.bitsAvailable-=P)},F.readBits=function(P){var D=Math.min(this.bitsAvailable,P),E=this.word>>>32-D;return P>32&&G.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=P-D,D>0&&this.bitsAvailable?E<<D|this.readBits(D):E},F.skipLZ=function(){var P;for(P=0;P<this.bitsAvailable;++P)if((this.word&2147483648>>>P)!==0)return this.word<<=P,this.bitsAvailable-=P,P;return this.loadWord(),P+this.skipLZ()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var P=this.skipLZ();return this.readBits(P+1)-1},F.readEG=function(){var P=this.readUEG();return 1&P?1+P>>>1:-1*(P>>>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(P){for(var D=8,E=8,b,_=0;_<P;_++)E!==0&&(b=this.readEG(),E=(D+b+256)%256),D=E===0?D:E},F.readSPS=function(){var P=0,D=0,E=0,b=0,_,C,A,v=this.readUByte.bind(this),c=this.readBits.bind(this),s=this.readUEG.bind(this),d=this.readBoolean.bind(this),l=this.skipBits.bind(this),S=this.skipEG.bind(this),m=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);v();var w=v();if(c(5),l(3),v(),m(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var g=s();if(g===3&&l(1),m(),m(),l(1),d())for(C=g!==3?8:12,A=0;A<C;A++)d()&&(A<6?f(16):f(64))}m();var h=s();if(h===0)s();else if(h===1)for(l(1),S(),S(),_=s(),A=0;A<_;A++)S();m(),l(1);var a=s(),u=s(),o=c(1);o===0&&l(1),l(1),d()&&(P=s(),D=s(),E=s(),b=s());var y=[1,1];if(d()&&d()){var p=v();switch(p){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:{y=[v()<<8|v(),v()<<8|v()];break}}}return{width:Math.ceil((a+1)*16-P*2-D*2),height:(2-o)*(u+1)*16-(o?2:4)*(E+b),pixelRatio:y}},F.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();V.default=k},"./src/demux/id3.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"isHeader",function(){return G}),R.d(V,"isFooter",function(){return k}),R.d(V,"getID3Data",function(){return O}),R.d(V,"canParse",function(){return U}),R.d(V,"getTimeStamp",function(){return P}),R.d(V,"isTimeStampFrame",function(){return D}),R.d(V,"getID3Frames",function(){return b}),R.d(V,"decodeFrame",function(){return _}),R.d(V,"utf8ArrayToStr",function(){return s}),R.d(V,"testables",function(){return d});var G=function(f,w){return w+10<=f.length&&(f[w]===73&&f[w+1]===68&&f[w+2]===51&&(f[w+3]<255&&f[w+4]<255&&(f[w+6]<128&&f[w+7]<128&&f[w+8]<128&&f[w+9]<128)))},k=function(f,w){return w+10<=f.length&&(f[w]===51&&f[w+1]===68&&f[w+2]===73&&(f[w+3]<255&&f[w+4]<255&&(f[w+6]<128&&f[w+7]<128&&f[w+8]<128&&f[w+9]<128)))},O=function(f,w){for(var g=w,h=0;G(f,w);){h+=10;var a=F(f,w+6);h+=a,k(f,w+10)&&(h+=10),w+=h}return h>0?f.subarray(g,g+h):void 0},F=function(f,w){var g=0;return g=(f[w]&127)<<21,g|=(f[w+1]&127)<<14,g|=(f[w+2]&127)<<7,g|=f[w+3]&127,g},U=function(f,w){return G(f,w)&&F(f,w+6)+10<=f.length-w},P=function(f){for(var w=b(f),g=0;g<w.length;g++){var h=w[g];if(D(h))return c(h)}return},D=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},E=function(f){var w=String.fromCharCode(f[0],f[1],f[2],f[3]),g=F(f,4),h=10;return{type:w,size:g,data:f.subarray(h,h+g)}},b=function(f){for(var w=0,g=[];G(f,w);){var h=F(f,w+6);w+=10;for(var a=w+h;w+8<a;){var u=E(f.subarray(w)),o=_(u);o&&g.push(o),w+=u.size+10}k(f,w)&&(w+=10)}return g},_=function(f){return f.type==="PRIV"?C(f):f.type[0]==="W"?v(f):A(f)},C=function(f){if(f.size<2)return;var w=s(f.data,!0),g=new Uint8Array(f.data.subarray(w.length+1));return{key:f.type,info:w,data:g.buffer}},A=function(f){if(f.size<2)return;if(f.type==="TXXX"){var w=1,g=s(f.data.subarray(w),!0);w+=g.length+1;var h=s(f.data.subarray(w));return{key:f.type,info:g,data:h}}var a=s(f.data.subarray(1));return{key:f.type,data:a}},v=function(f){if(f.type==="WXXX"){if(f.size<2)return;var w=1,g=s(f.data.subarray(w),!0);w+=g.length+1;var h=s(f.data.subarray(w));return{key:f.type,info:g,data:h}}var a=s(f.data);return{key:f.type,data:a}},c=function(f){if(f.data.byteLength===8){var w=new Uint8Array(f.data),g=w[3]&1,h=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return h/=45,g&&(h+=4772185884e-2),Math.round(h)}return},s=function(f,w){w===void 0&&(w=!1);var g=S();if(g){var h=g.decode(f);if(w){var a=h.indexOf("\0");return a!==-1?h.substring(0,a):h}return h.replace(/\0/g,"")}for(var u=f.length,o,y,p,x="",M=0;M<u;){if(o=f[M++],o===0&&w)return x;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(o);break;case 12:case 13:y=f[M++],x+=String.fromCharCode((o&31)<<6|y&63);break;case 14:y=f[M++],p=f[M++],x+=String.fromCharCode((o&15)<<12|(y&63)<<6|(p&63)<<0);break;default:}}return x},d={decodeTextFrame:A},l;function S(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/demux/base-audio-demuxer.ts"),k=R("./src/demux/id3.ts"),O=R("./src/utils/logger.ts"),F=R("./src/demux/mpegaudio.ts");function U(E,b){E.prototype=Object.create(b.prototype),E.prototype.constructor=E,P(E,b)}function P(E,b){return P=Object.setPrototypeOf||function(C,A){return C.__proto__=A,C},P(E,b)}var D=function(E){U(b,E);function b(){return E.apply(this,arguments)||this}var _=b.prototype;return _.resetInitSegment=function(A,v,c){E.prototype.resetInitSegment.call(this,A,v,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:A,duration:c,inputTimeScale:9e4,dropped:0}},b.probe=function(A){if(!A)return!1;for(var v=k.getID3Data(A,0)||[],c=v.length,s=A.length;c<s;c++)if(F.probe(A,c))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},_.canParse=function(A,v){return F.canParse(A,v)},_.appendFrame=function(A,v,c){return this.initPTS===null?void 0:F.appendFrame(A,v,c,this.initPTS,this.frameIndex)},b}(G.default);D.minProbeByteLength=4,V.default=D},"./src/demux/mp4demuxer.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/utils/mp4-tools.ts"),k=R("./src/demux/dummy-demuxed-track.ts"),O=function(){function F(P,D){this.remainderData=null,this.config=void 0,this.config=D}var U=F.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},F.probe=function(D){return Object(G.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},U.demux=function(D){var E=D,b=Object(k.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(G.appendUint8Array)(this.remainderData,D));var _=Object(G.segmentValidRange)(E);this.remainderData=_.remainder,b.samples=_.valid||new Uint8Array}else b.samples=E;return{audioTrack:Object(k.dummyTrack)(),avcTrack:b,id3Track:Object(k.dummyTrack)(),textTrack:Object(k.dummyTrack)()}},U.flush=function(){var D=Object(k.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(k.dummyTrack)(),avcTrack:D,id3Track:Object(k.dummyTrack)(),textTrack:Object(k.dummyTrack)()}},U.demuxSampleAes=function(D,E,b){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},F}();O.minProbeByteLength=1024,V.default=O},"./src/demux/mpegaudio.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"appendFrame",function(){return P}),R.d(V,"parseHeader",function(){return D}),R.d(V,"isHeaderPattern",function(){return E}),R.d(V,"isHeader",function(){return b}),R.d(V,"canParse",function(){return _}),R.d(V,"probe",function(){return C});var G=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],O=[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]],U=[0,1,1,4];function P(A,v,c,s,d){if(c+24>v.length)return;var l=D(v,c);if(l&&c+l.frameLength<=v.length){var S=l.samplesPerFrame*9e4/l.sampleRate,m=s+d*S,f={unit:v.subarray(c,c+l.frameLength),pts:m,dts:m};return A.config=[],A.channelCount=l.channelCount,A.samplerate=l.sampleRate,A.samples.push(f),{sample:f,length:l.frameLength,missing:0}}}function D(A,v){var c=A[v+1]>>3&3,s=A[v+1]>>1&3,d=A[v+2]>>4&15,l=A[v+2]>>2&3;if(c!==1&&d!==0&&d!==15&&l!==3){var S=A[v+2]>>1&1,m=A[v+3]>>6,f=c===3?3-s:s===3?3:4,w=k[f*14+d-1]*1e3,g=c===3?0:c===2?1:2,h=O[g*3+l],a=m===3?1:2,u=F[c][s],o=U[s],y=u*8*o,p=Math.floor(u*w/h+S)*o;if(G===null){var x=navigator.userAgent||"",M=x.match(/Chrome\/(\d+)/i);G=M?parseInt(M[1]):0}var N=!!G&&G<=87;return N&&s===2&&w>=224e3&&m===0&&(A[v+3]=A[v+3]|128),{sampleRate:h,channelCount:a,frameLength:p,samplesPerFrame:y}}}function E(A,v){return A[v]===255&&(A[v+1]&224)===224&&(A[v+1]&6)!==0}function b(A,v){return v+1<A.length&&E(A,v)}function _(A,v){var c=4;return E(A,v)&&c<=A.length-v}function C(A,v){if(v+1<A.length&&E(A,v)){var c=4,s=D(A,v),d=c;s!=null&&s.frameLength&&(d=s.frameLength);var l=v+d;return l===A.length||b(A,l)}return!1}},"./src/demux/sample-aes.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/crypt/decrypter.ts"),k=R("./src/demux/tsdemuxer.ts"),O=function(){function F(P,D,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new G.default(P,D,{removePKCS7Padding:!1})}var U=F.prototype;return U.decryptBuffer=function(D,E){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,E)},U.decryptAacSample=function(D,E,b,_){var C=D[E].unit,A=C.subarray(16,C.length-C.length%16),v=A.buffer.slice(A.byteOffset,A.byteOffset+A.length),c=this;this.decryptBuffer(v,function(s){var d=new Uint8Array(s);C.set(d,16),_||c.decryptAacSamples(D,E+1,b)})},U.decryptAacSamples=function(D,E,b){for(;;E++){if(E>=D.length){b();return}if(D[E].unit.length<32)continue;var _=this.decrypter.isSync();if(this.decryptAacSample(D,E,b,_),!_)return}},U.getAvcEncryptedData=function(D){for(var E=Math.floor((D.length-48)/160)*16+16,b=new Int8Array(E),_=0,C=32;C<=D.length-16;C+=160,_+=16)b.set(D.subarray(C,C+16),_);return b},U.getAvcDecryptedUnit=function(D,E){for(var b=new Uint8Array(E),_=0,C=32;C<=D.length-16;C+=160,_+=16)D.set(b.subarray(_,_+16),C);return D},U.decryptAvcSample=function(D,E,b,_,C,A){var v=Object(k.discardEPB)(C.data),c=this.getAvcEncryptedData(v),s=this;this.decryptBuffer(c.buffer,function(d){C.data=s.getAvcDecryptedUnit(v,d),A||s.decryptAvcSamples(D,E,b+1,_)})},U.decryptAvcSamples=function(D,E,b,_){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,b=0){if(E>=D.length){_();return}for(var C=D[E].units;!(b>=C.length);b++){var A=C[b];if(A.data.length<=48||A.type!==1&&A.type!==5)continue;var v=this.decrypter.isSync();if(this.decryptAvcSample(D,E,b,_,A,v),!v)return}}},F}();V.default=O},"./src/demux/transmuxer-interface.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return C});var G=R("./node_modules/webworkify-webpack/index.js"),k=R.n(G),O=R("./src/events.ts"),F=R("./src/demux/transmuxer.ts"),U=R("./src/utils/logger.ts"),P=R("./src/errors.ts"),D=R("./src/utils/mediasource-helper.ts"),E=R("./node_modules/eventemitter3/index.js"),b=R.n(E),_=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},C=function(){function A(c,s,d,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=c,this.id=s,this.onTransmuxComplete=d,this.onFlush=l;var m=c.config,f=function(u,o){o=o||{},o.frag=S.frag,o.id=S.id,c.trigger(u,o)};this.observer=new E.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,f),this.observer.on(O.Events.ERROR,f);var w={mp4:_.isTypeSupported("video/mp4"),mpeg:_.isTypeSupported("audio/mpeg"),mp3:_.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var h;try{h=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),h.addEventListener("message",this.onwmsg),h.onerror=function(a){c.trigger(O.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(a.message+" ("+a.filename+":"+a.lineno+")")})},h.postMessage({cmd:"init",typeSupported:w,vendor:g,id:s,config:JSON.stringify(m)})}catch(a){U.logger.warn("Error in worker:",a),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),h&&self.URL.revokeObjectURL(h.objectURL),this.transmuxer=new F.default(this.observer,w,m,g,s),this.worker=null}}else this.transmuxer=new F.default(this.observer,w,m,g,s)}var v=A.prototype;return v.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var d=this.transmuxer;d&&(d.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},v.push=function(s,d,l,S,m,f,w,g,h,a){var u=this;h.transmuxing.start=self.performance.now();var o=this.transmuxer,y=this.worker,p=f?f.start:m.start,x=m.decryptdata,M=this.frag,N=!(M&&m.cc===M.cc),j=!(M&&h.level===M.level),W=M?h.sn-M.sn:-1,L=this.part?h.part-this.part.index:1,I=!j&&(W===1||W===0&&L===1),K=self.performance.now();(j||W||m.stats.parsing.start===0)&&(m.stats.parsing.start=K),f&&(L||!I)&&(f.stats.parsing.start=K);var Y=new F.TransmuxState(N,I,g,j,p);if(!I||N){U.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+h.sn+" p: "+h.part+" level: "+h.level+" id: "+h.id+`
|
|
discontinuity: `+N+`
|
|
trackSwitch: `+j+`
|
|
contiguous: `+I+`
|
|
accurateTimeOffset: `+g+`
|
|
timeOffset: `+p);var ee=new F.TransmuxConfig(l,S,d,w,a);this.configureTransmuxer(ee)}if(this.frag=m,this.part=f,y)y.postMessage({cmd:"demux",data:s,decryptdata:x,chunkMeta:h,state:Y},s instanceof ArrayBuffer?[s]:[]);else if(o){var oe=o.push(s,x,h,Y);Object(F.isPromise)(oe)?oe.then(function(xe){u.handleTransmuxComplete(xe)}):this.handleTransmuxComplete(oe)}},v.flush=function(s){var d=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 m=l.flush(s);Object(F.isPromise)(m)?m.then(function(f){d.handleFlushResult(f,s)}):this.handleFlushResult(m,s)}},v.handleFlushResult=function(s,d){var l=this;s.forEach(function(S){l.handleTransmuxComplete(S)}),this.onFlush(d)},v.onWorkerMessage=function(s){var d=s.data,l=this.hls;switch(d.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(d.data);break}case"flush":{this.onFlush(d.data);break}default:{d.data=d.data||{},d.data.frag=this.frag,d.data.id=this.id,l.trigger(d.event,d.data);break}}},v.configureTransmuxer=function(s){var d=this.worker,l=this.transmuxer;d?d.postMessage({cmd:"configure",config:s}):l&&l.configure(s)},v.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},A}()},"./src/demux/transmuxer-worker.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return P});var G=R("./src/demux/transmuxer.ts"),k=R("./src/events.ts"),O=R("./src/utils/logger.ts"),F=R("./node_modules/eventemitter3/index.js"),U=R.n(F);function P(C){var A=new F.EventEmitter,v=function(s,d){C.postMessage({event:s,data:d})};A.on(k.Events.FRAG_DECRYPTED,v),A.on(k.Events.ERROR,v),C.addEventListener("message",function(c){var s=c.data;switch(s.cmd){case"init":{var d=JSON.parse(s.config);C.transmuxer=new G.default(A,s.typeSupported,d,s.vendor,s.id),Object(O.enableLogs)(d.debug),v("init",null);break}case"configure":{C.transmuxer.configure(s.config);break}case"demux":{var l=C.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(G.isPromise)(l)?l.then(function(f){D(C,f)}):D(C,l);break}case"flush":{var S=s.chunkMeta,m=C.transmuxer.flush(S);Object(G.isPromise)(m)?m.then(function(f){b(C,f,S)}):b(C,m,S);break}default:break}})}function D(C,A){if(_(A.remuxResult))return;var v=[],c=A.remuxResult,s=c.audio,d=c.video;s&&E(v,s),d&&E(v,d),C.postMessage({event:"transmuxComplete",data:A},v)}function E(C,A){A.data1&&C.push(A.data1.buffer),A.data2&&C.push(A.data2.buffer)}function b(C,A,v){A.forEach(function(c){D(C,c)}),C.postMessage({event:"flush",data:v})}function _(C){return!C.audio&&!C.video&&!C.text&&!C.id3&&!C.initSegment}},"./src/demux/transmuxer.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return d}),R.d(V,"isPromise",function(){return m}),R.d(V,"TransmuxConfig",function(){return f}),R.d(V,"TransmuxState",function(){return w});var G=R("./src/events.ts"),k=R("./src/errors.ts"),O=R("./src/crypt/decrypter.ts"),F=R("./src/demux/aacdemuxer.ts"),U=R("./src/demux/mp4demuxer.ts"),P=R("./src/demux/tsdemuxer.ts"),D=R("./src/demux/mp3demuxer.ts"),E=R("./src/remux/mp4-remuxer.ts"),b=R("./src/remux/passthrough-remuxer.ts"),_=R("./src/demux/chunk-cache.ts"),C=R("./src/utils/mp4-tools.ts"),A=R("./src/utils/logger.ts"),v;try{v=self.performance.now.bind(self.performance)}catch(g){A.logger.debug("Unable to use Performance API on this environment"),v=self.Date.now}var c=[{demux:P.default,remux:E.default},{demux:U.default,remux:b.default},{demux:F.default,remux:E.default},{demux:D.default,remux:E.default}],s=1024;c.forEach(function(g){var h=g.demux;s=Math.max(s,h.minProbeByteLength)});var d=function(){function g(a,u,o,y,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 _.default,this.observer=a,this.typeSupported=u,this.config=o,this.vendor=y,this.id=p}var h=g.prototype;return h.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},h.push=function(u,o,y,p){var x=this,M=y.transmuxing;M.executeStart=v();var N=new Uint8Array(u),j=this.cache,W=this.config,L=this.currentTransmuxState,I=this.transmuxConfig;p&&(this.currentTransmuxState=p);var K=l(N,o);if(K&&K.method==="AES-128"){var Y=this.getDecrypter();if(W.enableSoftwareAES){var ee=Y.softwareDecrypt(N,K.key.buffer,K.iv.buffer);if(!ee)return M.executeEnd=v(),S(y);N=new Uint8Array(ee)}else return this.decryptionPromise=Y.webCryptoDecrypt(N,K.key.buffer,K.iv.buffer).then(function(Se){var Pe=x.push(Se,null,y);return x.decryptionPromise=null,Pe}),this.decryptionPromise}var oe=p||L,xe=oe.contiguous,ve=oe.discontinuity,ge=oe.trackSwitch,me=oe.accurateTimeOffset,ce=oe.timeOffset,ie=I.audioCodec,pe=I.videoCodec,J=I.defaultInitPts,ne=I.duration,$=I.initSegmentData;if((ve||ge)&&this.resetInitSegment($,ie,pe,ne),ve&&this.resetInitialTimestamp(J),xe||this.resetContiguity(),this.needsProbing(N,ve,ge)){if(j.dataLength){var be=j.flush();N=Object(C.appendUint8Array)(be,N)}this.configureTransmuxer(N,I)}var Te=this.transmux(N,K,ce,me,y),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,M.executeEnd=v(),Te},h.flush=function(u){var o=this,y=u.transmuxing;y.executeStart=v();var p=this.decrypter,x=this.cache,M=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return o.flush(u)});var j=[],W=M.timeOffset;if(p){var L=p.flush();L&&j.push(this.push(L,null,u))}var I=x.dataLength;x.reset();var K=this.demuxer,Y=this.remuxer;if(!K||!Y)return I>=s&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=v(),[S(u)];var ee=K.flush(W);return m(ee)?ee.then(function(oe){return o.flushRemux(j,oe,u),j}):(this.flushRemux(j,ee,u),j)},h.flushRemux=function(u,o,y){var p=o.audioTrack,x=o.avcTrack,M=o.id3Track,N=o.textTrack,j=this.currentTransmuxState,W=j.accurateTimeOffset,L=j.timeOffset;A.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var I=this.remuxer.remux(p,x,M,N,L,W,!0,this.id);u.push({remuxResult:I,chunkMeta:y}),y.transmuxing.executeEnd=v()},h.resetInitialTimestamp=function(u){var o=this.demuxer,y=this.remuxer;if(!o||!y)return;o.resetTimeStamp(u),y.resetTimeStamp(u)},h.resetContiguity=function(){var u=this.demuxer,o=this.remuxer;if(!u||!o)return;u.resetContiguity(),o.resetNextTimestamp()},h.resetInitSegment=function(u,o,y,p){var x=this.demuxer,M=this.remuxer;if(!x||!M)return;x.resetInitSegment(o,y,p),M.resetInitSegment(u,o,y)},h.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},h.transmux=function(u,o,y,p,x){var M;return o&&o.method==="SAMPLE-AES"?M=this.transmuxSampleAes(u,o,y,p,x):M=this.transmuxUnencrypted(u,y,p,x),M},h.transmuxUnencrypted=function(u,o,y,p){var x=this.demuxer.demux(u,o,!1,!this.config.progressive),M=x.audioTrack,N=x.avcTrack,j=x.id3Track,W=x.textTrack,L=this.remuxer.remux(M,N,j,W,o,y,!1,this.id);return{remuxResult:L,chunkMeta:p}},h.transmuxSampleAes=function(u,o,y,p,x){var M=this;return this.demuxer.demuxSampleAes(u,o,y).then(function(N){var j=M.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,y,p,!1,M.id);return{remuxResult:j,chunkMeta:x}})},h.configureTransmuxer=function(u,o){for(var y=this.config,p=this.observer,x=this.typeSupported,M=this.vendor,N=o.audioCodec,j=o.defaultInitPts,W=o.duration,L=o.initSegmentData,I=o.videoCodec,K,Y=0,ee=c.length;Y<ee;Y++)if(c[Y].demux.probe(u)){K=c[Y];break}K||(A.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:U.default,remux:b.default});var oe=this.demuxer,xe=this.remuxer,ve=K.remux,ge=K.demux;(!xe||!(xe instanceof ve))&&(this.remuxer=new ve(p,y,x,M)),(!oe||!(oe instanceof ge))&&(this.demuxer=new ge(p,y,x),this.probe=ge.probe),this.resetInitSegment(L,N,I,W),this.resetInitialTimestamp(j)},h.needsProbing=function(u,o,y){return!this.demuxer||!this.remuxer||o||y},h.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new O.default(this.observer,this.config)),u},g}();function l(g,h){var a=null;return g.byteLength>0&&h!=null&&h.key!=null&&h.iv!==null&&h.method!=null&&(a=h),a}var S=function(h){return{remuxResult:{},chunkMeta:h}};function m(g){return"then"in g&&g.then instanceof Function}var f=function(h,a,u,o,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=h,this.videoCodec=a,this.initSegmentData=u,this.duration=o,this.defaultInitPts=y},w=function(h,a,u,o,y){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=h,this.contiguous=a,this.accurateTimeOffset=u,this.trackSwitch=o,this.timeOffset=y}},"./src/demux/tsdemuxer.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"discardEPB",function(){return S});var G=R("./src/demux/adts.ts"),k=R("./src/demux/mpegaudio.ts"),O=R("./src/demux/exp-golomb.ts"),F=R("./src/demux/id3.ts"),U=R("./src/demux/sample-aes.ts"),P=R("./src/events.ts"),D=R("./src/utils/mp4-tools.ts"),E=R("./src/utils/logger.ts"),b=R("./src/errors.ts"),_={video:1,audio:2,id3:3,text:4},C=function(){function m(w,g,h){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=w,this.config=g,this.typeSupported=h}m.probe=function(g){var h=m.syncOffset(g);return h<0?!1:(h&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+h+", junk ahead ?"),!0)},m.syncOffset=function(g){for(var h=Math.min(1e3,g.length-3*188),a=0;a<h;){if(g[a]===71&&g[a+188]===71&&g[a+2*188]===71)return a;a++}return-1},m.createTrack=function(g,h){return{container:g==="video"||g==="audio"?"video/mp2t":void 0,type:g,id:_[g],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:g==="audio"?h:void 0}};var f=m.prototype;return f.resetInitSegment=function(g,h,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",a),this._audioTrack=m.createTrack("audio",a),this._id3Track=m.createTrack("id3",a),this._txtTrack=m.createTrack("text",a),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=g,this.videoCodec=h,this._duration=a},f.resetTimeStamp=function(){},f.resetContiguity=function(){var g=this._audioTrack,h=this._avcTrack,a=this._id3Track;g&&(g.pesData=null),h&&(h.pesData=null),a&&(a.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},f.demux=function(g,h,a,u){a===void 0&&(a=!1),u===void 0&&(u=!1),a||(this.sampleAes=null);var o,y=this._avcTrack,p=this._audioTrack,x=this._id3Track,M=y.pid,N=y.pesData,j=p.pid,W=x.pid,L=p.pesData,I=x.pesData,K=!1,Y=this.pmtParsed,ee=this._pmtId,oe=g.length;if(this.remainderData&&(g=Object(D.appendUint8Array)(this.remainderData,g),oe=g.length,this.remainderData=null),oe<188&&!u)return this.remainderData=g,{audioTrack:p,avcTrack:y,id3Track:x,textTrack:this._txtTrack};var xe=Math.max(0,m.syncOffset(g));oe-=(oe+xe)%188,oe<g.byteLength&&!u&&(this.remainderData=new Uint8Array(g.buffer,oe,g.buffer.byteLength-oe));for(var ve=xe;ve<oe;ve+=188)if(g[ve]===71){var ge=!!(g[ve+1]&64),me=((g[ve+1]&31)<<8)+g[ve+2],ce=(g[ve+3]&48)>>4,ie=void 0;if(ce>1){if(ie=ve+5+g[ve+4],ie===ve+188)continue}else ie=ve+4;switch(me){case M:ge&&(N&&(o=s(N))&&this.parseAVCPES(o,!1),N={data:[],size:0}),N&&(N.data.push(g.subarray(ie,ve+188)),N.size+=ve+188-ie);break;case j:ge&&(L&&(o=s(L))&&(p.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),L={data:[],size:0}),L&&(L.data.push(g.subarray(ie,ve+188)),L.size+=ve+188-ie);break;case W:ge&&(I&&(o=s(I))&&this.parseID3PES(o),I={data:[],size:0}),I&&(I.data.push(g.subarray(ie,ve+188)),I.size+=ve+188-ie);break;case 0:ge&&(ie+=g[ie]+1),ee=this._pmtId=v(g,ie);break;case ee:{ge&&(ie+=g[ie]+1);var pe=c(g,ie,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,a);M=pe.avc,M>0&&(y.pid=M),j=pe.audio,j>0&&(p.pid=j,p.isAAC=pe.isAAC),W=pe.id3,W>0&&(x.pid=W),K&&!Y&&(E.logger.log("reparse from beginning"),K=!1,ve=xe-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y.pesData=N,p.pesData=L,x.pesData=I;var J={audioTrack:p,avcTrack:y,id3Track:x,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(J),J},f.flush=function(){var g=this.remainderData;this.remainderData=null;var h;return g?h=this.demux(g,-1,!1,!0):h={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(h),this.sampleAes?this.decrypt(h,this.sampleAes):h},f.extractRemainingSamples=function(g){var h=g.audioTrack,a=g.avcTrack,u=g.id3Track,o=a.pesData,y=h.pesData,p=u.pesData,x;o&&(x=s(o))?(this.parseAVCPES(x,!0),a.pesData=null):a.pesData=o,y&&(x=s(y))?(h.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),h.pesData=null):(y!=null&&y.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=y),p&&(x=s(p))?(this.parseID3PES(x),u.pesData=null):u.pesData=p},f.demuxSampleAes=function(g,h,a){var u=this.demux(g,a,!0,!this.config.progressive),o=this.sampleAes=new U.default(this.observer,this.config,h);return this.decrypt(u,o)},f.decrypt=function(g,h){return new Promise(function(a){var u=g.audioTrack,o=g.avcTrack;u.samples&&u.isAAC?h.decryptAacSamples(u.samples,0,function(){o.samples?h.decryptAvcSamples(o.samples,0,0,function(){a(g)}):a(g)}):o.samples&&h.decryptAvcSamples(o.samples,0,0,function(){a(g)})})},f.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},f.parseAVCPES=function(g,h){var a=this,u=this._avcTrack,o=this.parseAVCNALu(g.data),y=!1,p=this.avcSample,x,M=!1;g.data=null,p&&o.length&&!u.audFound&&(d(p,u),p=this.avcSample=A(!1,g.pts,g.dts,"")),o.forEach(function(N){switch(N.type){case 1:{x=!0,p||(p=a.avcSample=A(!0,g.pts,g.dts,"")),y&&(p.debug+="NDR "),p.frame=!0;var j=N.data;if(M&&j.length>4){var W=new O.default(j).readSliceType();(W===2||W===4||W===7||W===9)&&(p.key=!0)}break}case 5:x=!0,p||(p=a.avcSample=A(!0,g.pts,g.dts,"")),y&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{x=!0,y&&p&&(p.debug+="SEI ");var L=new O.default(S(N.data));L.readUByte();for(var I=0,K=0,Y=!1,ee=0;!Y&&L.bytesAvailable>1;){I=0;do ee=L.readUByte(),I+=ee;while(ee===255);K=0;do ee=L.readUByte(),K+=ee;while(ee===255);if(I===4&&L.bytesAvailable!==0){Y=!0;var oe=L.readUByte();if(oe===181){var xe=L.readUShort();if(xe===49){var ve=L.readUInt();if(ve===1195456820){var ge=L.readUByte();if(ge===3){for(var me=L.readUByte(),ce=L.readUByte(),ie=31&me,pe=[me,ce],J=0;J<ie;J++)pe.push(L.readUByte()),pe.push(L.readUByte()),pe.push(L.readUByte());l(a._txtTrack.samples,{type:3,pts:g.pts,bytes:pe})}}}}}else if(I===5&&L.bytesAvailable!==0){if(Y=!0,K>16){for(var ne=[],$=0;$<16;$++)ne.push(L.readUByte().toString(16)),($===3||$===5||$===7||$===9)&&ne.push("-");for(var be=K-16,Te=new Uint8Array(be),ye=0;ye<be;ye++)Te[ye]=L.readUByte();l(a._txtTrack.samples,{pts:g.pts,payloadType:I,uuid:ne.join(""),userData:Object(F.utf8ArrayToStr)(Te),userDataBytes:Te})}}else if(K<L.bytesAvailable)for(var Se=0;Se<K;Se++)L.readUByte()}break}case 7:if(x=!0,M=!0,y&&p&&(p.debug+="SPS "),!u.sps){var Pe=new O.default(N.data),Ie=Pe.readSPS();u.width=Ie.width,u.height=Ie.height,u.pixelRatio=Ie.pixelRatio,u.sps=[N.data],u.duration=a._duration;for(var Ue=N.data.subarray(1,4),Re="avc1.",Oe=0;Oe<3;Oe++){var Ve=Ue[Oe].toString(16);Ve.length<2&&(Ve="0"+Ve),Re+=Ve}u.codec=Re}break;case 8:x=!0,y&&p&&(p.debug+="PPS "),u.pps||(u.pps=[N.data]);break;case 9:x=!1,u.audFound=!0,p&&d(p,u),p=a.avcSample=A(!1,g.pts,g.dts,y?"AUD ":"");break;case 12:x=!1;break;default:x=!1,p&&(p.debug+="unknown NAL "+N.type+" ");break}if(p&&x){var qe=p.units;qe.push(N)}}),h&&p&&(d(p,u),this.avcSample=null)},f.getLastNalUnit=function(){var g,h=this.avcSample,a;if(!h||h.units.length===0){var u=this._avcTrack.samples;h=u[u.length-1]}if((g=h)!==null&&g!==void 0&&g.units){var o=h.units;a=o[o.length-1]}return a},f.parseAVCNALu=function(g){var h=g.byteLength,a=this._avcTrack,u=a.naluState||0,o=u,y=[],p=0,x,M,N,j=-1,W=0;for(u===-1&&(j=0,W=g[0]&31,u=0,p=1);p<h;){if(x=g[p++],!u){u=x?0:1;continue}if(u===1){u=x?0:2;continue}if(!x)u=3;else if(x===1){if(j>=0){var L={data:g.subarray(j,p-u-1),type:W};y.push(L)}else{var I=this.getLastNalUnit();if(I&&(o&&p<=4-o&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-o))),M=p-u-1,M>0)){var K=new Uint8Array(I.data.byteLength+M);K.set(I.data,0),K.set(g.subarray(0,M),I.data.byteLength),I.data=K,I.state=0}}p<h?(N=g[p]&31,j=p,W=N,u=0):u=-1}else u=0}if(j>=0&&u>=0){var Y={data:g.subarray(j,h),type:W,state:u};y.push(Y)}if(y.length===0){var ee=this.getLastNalUnit();if(ee){var oe=new Uint8Array(ee.data.byteLength+g.byteLength);oe.set(ee.data,0),oe.set(g,ee.data.byteLength),ee.data=oe}}return a.naluState=u,y},f.parseAACPES=function(g){var h=0,a=this._audioTrack,u=this.aacOverFlow,o=g.data;if(u){this.aacOverFlow=null;var y=u.sample.unit.byteLength,p=Math.min(u.missing,y),x=y-p;u.sample.unit.set(o.subarray(0,p),x),a.samples.push(u.sample),h=u.missing}var M,N;for(M=h,N=o.length;M<N-1&&!G.isHeader(o,M);M++);if(M!==h){var j,W;if(M<N-1?(j="AAC PES did not start with ADTS header,offset:"+M,W=!1):(j="no ADTS header found in AAC PES",W=!0),E.logger.warn("parsing error:"+j),this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:j}),W)return}G.initTrackConfig(a,this.observer,o,M,this.audioCodec);var L;if(g.pts!==void 0)L=g.pts;else if(u){var I=G.getFrameDuration(a.samplerate);L=u.sample.pts+I}else{E.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;M<N;)if(G.isHeader(o,M)){if(M+5<N){var Y=G.appendFrame(a,o,M,L,K);if(Y)if(Y.missing)this.aacOverFlow=Y;else{M+=Y.length,K++;continue}}break}else M++},f.parseMPEGPES=function(g){var h=g.data,a=h.length,u=0,o=0,y=g.pts;if(y===void 0){E.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<a;)if(k.isHeader(h,o)){var p=k.appendFrame(this._audioTrack,h,o,y,u);if(p)o+=p.length,u++;else break}else o++},f.parseID3PES=function(g){if(g.pts===void 0){E.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(g)},m}();C.minProbeByteLength=188;function A(m,f,w,g){return{key:m,frame:!1,pts:f,dts:w,units:[],debug:g,length:0}}function v(m,f){return(m[f+10]&31)<<8|m[f+11]}function c(m,f,w,g){var h={audio:-1,avc:-1,id3:-1,isAAC:!0},a=(m[f+1]&15)<<8|m[f+2],u=f+3+a-4,o=(m[f+10]&15)<<8|m[f+11];for(f+=12+o;f<u;){var y=(m[f+1]&31)<<8|m[f+2];switch(m[f]){case 207:if(!g){E.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:h.audio===-1&&(h.audio=y);break;case 21:h.id3===-1&&(h.id3=y);break;case 219:if(!g){E.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:h.avc===-1&&(h.avc=y);break;case 3:case 4:w?h.audio===-1&&(h.audio=y,h.isAAC=!1):E.logger.log("MPEG audio found, not supported in this browser");break;case 36:E.logger.warn("Unsupported HEVC stream type found");break;default:break}f+=((m[f+3]&15)<<8|m[f+4])+5}return h}function s(m){var f=0,w,g,h,a,u,o=m.data;if(!m||m.size===0)return null;for(;o[0].length<19&&o.length>1;){var y=new Uint8Array(o[0].length+o[1].length);y.set(o[0]),y.set(o[1],o[0].length),o[0]=y,o.splice(1,1)}w=o[0];var p=(w[0]<<16)+(w[1]<<8)+w[2];if(p===1){if(g=(w[4]<<8)+w[5],g&&g>m.size-6)return null;var x=w[7];x&192&&(a=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,x&64?(u=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,a-u>60*9e4&&(E.logger.warn(Math.round((a-u)/9e4)+"s delta between PTS and DTS, align them"),a=u)):u=a),h=w[8];var M=h+9;if(m.size<=M)return null;m.size-=M;for(var N=new Uint8Array(m.size),j=0,W=o.length;j<W;j++){w=o[j];var L=w.byteLength;if(M)if(M>L){M-=L;continue}else w=w.subarray(M),L-=M,M=0;N.set(w,f),f+=L}return g&&(g-=h+3),{data:N,pts:a,dts:u,len:g}}return null}function d(m,f){if(m.units.length&&m.frame){if(m.pts===void 0){var w=f.samples,g=w.length;if(g){var h=w[g-1];m.pts=h.pts,m.dts=h.dts}else{f.dropped++;return}}f.samples.push(m)}m.debug.length&&E.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function l(m,f){var w=m.length;if(w>0){if(f.pts>=m[w-1].pts)m.push(f);else for(var g=w-1;g>=0;g--)if(f.pts<m[g].pts){m.splice(g,0,f);break}}else m.push(f)}function S(m){for(var f=m.byteLength,w=[],g=1;g<f-2;)m[g]===0&&m[g+1]===0&&m[g+2]===3?(w.push(g+2),g+=2):g++;if(w.length===0)return m;var h=f-w.length,a=new Uint8Array(h),u=0;for(g=0;g<h;u++,g++)u===w[0]&&(u++,w.shift()),a[g]=m[u];return a}V.default=C},"./src/errors.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"ErrorTypes",function(){return G}),R.d(V,"ErrorDetails",function(){return k});var G;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(G||(G={}));var k;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(k||(k={}))},"./src/events.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"Events",function(){return G});var G;(function(k){k.MEDIA_ATTACHING="hlsMediaAttaching",k.MEDIA_ATTACHED="hlsMediaAttached",k.MEDIA_DETACHING="hlsMediaDetaching",k.MEDIA_DETACHED="hlsMediaDetached",k.BUFFER_RESET="hlsBufferReset",k.BUFFER_CODECS="hlsBufferCodecs",k.BUFFER_CREATED="hlsBufferCreated",k.BUFFER_APPENDING="hlsBufferAppending",k.BUFFER_APPENDED="hlsBufferAppended",k.BUFFER_EOS="hlsBufferEos",k.BUFFER_FLUSHING="hlsBufferFlushing",k.BUFFER_FLUSHED="hlsBufferFlushed",k.MANIFEST_LOADING="hlsManifestLoading",k.MANIFEST_LOADED="hlsManifestLoaded",k.MANIFEST_PARSED="hlsManifestParsed",k.LEVEL_SWITCHING="hlsLevelSwitching",k.LEVEL_SWITCHED="hlsLevelSwitched",k.LEVEL_LOADING="hlsLevelLoading",k.LEVEL_LOADED="hlsLevelLoaded",k.LEVEL_UPDATED="hlsLevelUpdated",k.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",k.LEVELS_UPDATED="hlsLevelsUpdated",k.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",k.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",k.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",k.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",k.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",k.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",k.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",k.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",k.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",k.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",k.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",k.CUES_PARSED="hlsCuesParsed",k.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",k.INIT_PTS_FOUND="hlsInitPtsFound",k.FRAG_LOADING="hlsFragLoading",k.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",k.FRAG_LOADED="hlsFragLoaded",k.FRAG_DECRYPTED="hlsFragDecrypted",k.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",k.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",k.FRAG_PARSING_METADATA="hlsFragParsingMetadata",k.FRAG_PARSED="hlsFragParsed",k.FRAG_BUFFERED="hlsFragBuffered",k.FRAG_CHANGED="hlsFragChanged",k.FPS_DROP="hlsFpsDrop",k.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",k.ERROR="hlsError",k.DESTROYING="hlsDestroying",k.KEY_LOADING="hlsKeyLoading",k.KEY_LOADED="hlsKeyLoaded",k.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",k.BACK_BUFFER_REACHED="hlsBackBufferReached"})(G||(G={}))},"./src/hls.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return m});var G=R("./node_modules/url-toolkit/src/url-toolkit.js"),k=R.n(G),O=R("./src/loader/playlist-loader.ts"),F=R("./src/loader/key-loader.ts"),U=R("./src/controller/id3-track-controller.ts"),P=R("./src/controller/latency-controller.ts"),D=R("./src/controller/level-controller.ts"),E=R("./src/controller/fragment-tracker.ts"),b=R("./src/controller/stream-controller.ts"),_=R("./src/is-supported.ts"),C=R("./src/utils/logger.ts"),A=R("./src/config.ts"),v=R("./node_modules/eventemitter3/index.js"),c=R.n(v),s=R("./src/events.ts"),d=R("./src/errors.ts");function l(f,w){for(var g=0;g<w.length;g++){var h=w[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}function S(f,w,g){return w&&l(f.prototype,w),g&&l(f,g),f}var m=function(){f.isSupported=function(){return Object(_.isSupported)()};function f(g){g===void 0&&(g={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new v.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var h=this.config=Object(A.mergeConfig)(f.DefaultConfig,g);this.userConfig=g,Object(C.enableLogs)(h.debug),this._autoLevelCapping=-1,h.progressive&&Object(A.enableStreamingMode)(h);var a=h.abrController,u=h.bufferController,o=h.capLevelController,y=h.fpsController,p=this.abrController=new a(this),x=this.bufferController=new u(this),M=this.capLevelController=new o(this),N=new y(this),j=new O.default(this),W=new F.default(this),L=new U.default(this),I=this.levelController=new D.default(this),K=new E.FragmentTracker(this),Y=this.streamController=new b.default(this,K);M.setStreamController(Y),N.setStreamController(Y);var ee=[I,Y];this.networkControllers=ee;var oe=[j,W,p,x,M,N,L,K];this.audioTrackController=this.createController(h.audioTrackController,null,ee),this.createController(h.audioStreamController,K,ee),this.subtitleTrackController=this.createController(h.subtitleTrackController,null,ee),this.createController(h.subtitleStreamController,K,ee),this.createController(h.timelineController,null,oe),this.emeController=this.createController(h.emeController,null,oe),this.cmcdController=this.createController(h.cmcdController,null,oe),this.latencyController=this.createController(P.default,null,oe),this.coreComponents=oe}var w=f.prototype;return w.createController=function(h,a,u){if(h){var o=a?new h(this,a):new h(this);return u&&u.push(o),o}return null},w.on=function(h,a,u){u===void 0&&(u=this),this._emitter.on(h,a,u)},w.once=function(h,a,u){u===void 0&&(u=this),this._emitter.once(h,a,u)},w.removeAllListeners=function(h){this._emitter.removeAllListeners(h)},w.off=function(h,a,u,o){u===void 0&&(u=this),this._emitter.off(h,a,u,o)},w.listeners=function(h){return this._emitter.listeners(h)},w.emit=function(h,a,u){return this._emitter.emit(h,a,u)},w.trigger=function(h,a){if(this.config.debug)return this.emit(h,h,a);try{return this.emit(h,h,a)}catch(u){C.logger.error("An internal error happened while handling event "+h+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(s.Events.ERROR,{type:d.ErrorTypes.OTHER_ERROR,details:d.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:h,error:u})}return!1},w.listenerCount=function(h){return this._emitter.listenerCount(h)},w.destroy=function(){C.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(h){return h.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(h){return h.destroy()}),this.coreComponents.length=0},w.attachMedia=function(h){C.logger.log("attachMedia"),this._media=h,this.trigger(s.Events.MEDIA_ATTACHING,{media:h})},w.detachMedia=function(){C.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(h){this.stopLoad();var a=this.media,u=this.url,o=this.url=G.buildAbsoluteURL(self.location.href,h,{alwaysNormalize:!0});C.logger.log("loadSource:"+o),a&&u&&u!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(a)),this.trigger(s.Events.MANIFEST_LOADING,{url:h})},w.startLoad=function(h){h===void 0&&(h=-1),C.logger.log("startLoad("+h+")"),this.networkControllers.forEach(function(a){a.startLoad(h)})},w.stopLoad=function(){C.logger.log("stopLoad"),this.networkControllers.forEach(function(h){h.stopLoad()})},w.swapAudioCodec=function(){C.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){C.logger.log("recoverMediaError");var h=this._media;this.detachMedia(),h&&this.attachMedia(h)},w.removeLevel=function(h,a){a===void 0&&(a=0),this.levelController.removeLevel(h,a)},S(f,[{key:"levels",get:function(){var h=this.levelController.levels;return h||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(h){C.logger.log("set currentLevel:"+h),this.loadLevel=h,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(h){C.logger.log("set nextLevel:"+h),this.levelController.manualLevel=h,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(h){C.logger.log("set loadLevel:"+h),this.levelController.manualLevel=h}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(h){this.levelController.nextLoadLevel=h}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(h){C.logger.log("set firstLevel:"+h),this.levelController.firstLevel=h}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(h){C.logger.log("set startLevel:"+h),h!==-1&&(h=Math.max(h,this.minAutoLevel)),this.levelController.startLevel=h}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(h){var a=!!h;a!==this.config.capLevelToPlayerSize&&(a?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=a)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(h){this._autoLevelCapping!==h&&(C.logger.log("set autoLevelCapping:"+h),this._autoLevelCapping=h)}},{key:"bandwidthEstimate",get:function(){var h=this.abrController.bwEstimator;return h?h.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var h=this.levels,a=this.config.minAutoBitrate;if(!h)return 0;for(var u=h.length,o=0;o<u;o++)if(h[o].maxBitrate>a)return o;return 0}},{key:"maxAutoLevel",get:function(){var h=this.levels,a=this.autoLevelCapping,u;return a===-1&&h&&h.length?u=h.length-1:u=a,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(h){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,h)}},{key:"audioTracks",get:function(){var h=this.audioTrackController;return h?h.audioTracks:[]}},{key:"audioTrack",get:function(){var h=this.audioTrackController;return h?h.audioTrack:-1},set:function(h){var a=this.audioTrackController;a&&(a.audioTrack=h)}},{key:"subtitleTracks",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var h=this.subtitleTrackController;return h?h.subtitleTrack:-1},set:function(h){var a=this.subtitleTrackController;a&&(a.subtitleTrack=h)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var h=this.subtitleTrackController;return h?h.subtitleDisplay:!1},set:function(h){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=h)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(h){this.config.lowLatencyMode=h}},{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 d.ErrorTypes}},{key:"ErrorDetails",get:function(){return d.ErrorDetails}},{key:"DefaultConfig",get:function(){return f.defaultConfig?f.defaultConfig:A.hlsDefaultConfig},set:function(h){f.defaultConfig=h}}]),f}();m.defaultConfig=void 0},"./src/is-supported.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"isSupported",function(){return O}),R.d(V,"changeTypeSupported",function(){return F});var G=R("./src/utils/mediasource-helper.ts");function k(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var U=Object(G.getMediaSource)();if(!U)return!1;var P=k(),D=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!P||P.prototype&&typeof P.prototype.appendBuffer=="function"&&typeof P.prototype.remove=="function";return!!D&&!!E}function F(){var U,P=k();return typeof(P==null||((U=P.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return C}),R.d(V,"LoadError",function(){return v});var G=R("./src/polyfills/number.ts"),k=R("./src/errors.ts");function O(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,E(c,s)}function F(c){var s=typeof Map=="function"?new Map:void 0;return F=function(l){if(l===null||!D(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 U(l,arguments,b(this).constructor)}return S.prototype=Object.create(l.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),E(S,l)},F(c)}function U(c,s,d){return P()?U=Reflect.construct:U=function(S,m,f){var w=[null];w.push.apply(w,m);var g=Function.bind.apply(S,w),h=new g;return f&&E(h,f.prototype),h},U.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function D(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function E(c,s){return E=Object.setPrototypeOf||function(l,S){return l.__proto__=S,l},E(c,s)}function b(c){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},b(c)}var _=Math.pow(2,17),C=function(){function c(d){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=d}var s=c.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 m=this,f=l.url;if(!f)return Promise.reject(new v({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(f?"part list":"url")));this.abort();var w=this.config,g=w.fLoader,h=w.loader;return new Promise(function(a,u){m.loader&&m.loader.destroy();var o=m.loader=l.loader=g?new g(w):new h(w),y=A(l),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:_};l.stats=o.stats,o.load(y,p,{onSuccess:function(M,N,j,W){m.resetLoader(l,o),a({frag:l,part:null,payload:M.data,networkDetails:W})},onError:function(M,N,j){m.resetLoader(l,o),u(new v({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:M,networkDetails:j}))},onAbort:function(M,N,j){m.resetLoader(l,o),u(new v({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:j}))},onTimeout:function(M,N,j){m.resetLoader(l,o),u(new v({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:j}))},onProgress:function(M,N,j,W){S&&S({frag:l,part:null,payload:j,networkDetails:W})}})})},s.loadPart=function(l,S,m){var f=this;this.abort();var w=this.config,g=w.fLoader,h=w.loader;return new Promise(function(a,u){f.loader&&f.loader.destroy();var o=f.loader=l.loader=g?new g(w):new h(w),y=A(l,S),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:_};S.stats=o.stats,o.load(y,p,{onSuccess:function(M,N,j,W){f.resetLoader(l,o),f.updateStatsFromPart(l,S);var L={frag:l,part:S,payload:M.data,networkDetails:W};m(L),a(L)},onError:function(M,N,j){f.resetLoader(l,o),u(new v({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:S,response:M,networkDetails:j}))},onAbort:function(M,N,j){l.stats.aborted=S.stats.aborted,f.resetLoader(l,o),u(new v({type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:S,networkDetails:j}))},onTimeout:function(M,N,j){f.resetLoader(l,o),u(new v({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 m=l.stats,f=S.stats,w=f.total;if(m.loaded+=f.loaded,w){var g=Math.round(l.duration/S.duration),h=Math.min(Math.round(m.loaded/w),g),a=g-h,u=a*Math.round(m.loaded/h);m.total=m.loaded+u}else m.total=Math.max(m.loaded,m.total);var o=m.loading,y=f.loading;o.start?o.first+=y.first-y.start:(o.start=y.start,o.first=y.first),o.end=y.end},s.resetLoader=function(l,S){l.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},c}();function A(c,s){s===void 0&&(s=null);var d=s||c,l={frag:c,part:s,responseType:"arraybuffer",url:d.url,headers:{},rangeStart:0,rangeEnd:0},S=d.byteRangeStartOffset,m=d.byteRangeEndOffset;return Object(G.isFiniteNumber)(S)&&Object(G.isFiniteNumber)(m)&&(l.rangeStart=S,l.rangeEnd=m),l}var v=function(c){O(s,c);function s(d){for(var l,S=arguments.length,m=new Array(S>1?S-1:0),f=1;f<S;f++)m[f-1]=arguments[f];return l=c.call.apply(c,[this].concat(m))||this,l.data=void 0,l.data=d,l}return s}(F(Error))},"./src/loader/fragment.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"ElementaryStreamTypes",function(){return C}),R.d(V,"BaseSegment",function(){return A}),R.d(V,"Fragment",function(){return v}),R.d(V,"Part",function(){return c});var G=R("./src/polyfills/number.ts"),k=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(k),F=R("./src/utils/logger.ts"),U=R("./src/loader/level-key.ts"),P=R("./src/loader/load-stats.ts");function D(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,E(s,d)}function E(s,d){return E=Object.setPrototypeOf||function(S,m){return S.__proto__=m,S},E(s,d)}function b(s,d){for(var l=0;l<d.length;l++){var S=d[l];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function _(s,d,l){return d&&b(s.prototype,d),l&&b(s,l),s}var C;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(C||(C={}));var A=function(){function s(l){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[C.AUDIO]=null,S[C.VIDEO]=null,S[C.AUDIOVIDEO]=null,S),this.baseurl=l}var d=s.prototype;return d.setByteRange=function(S,m){var f=S.split("@",2),w=[];f.length===1?w[0]=m?m.byteRangeEndOffset:0:w[0]=parseInt(f[1]),w[1]=parseInt(f[0])+w[0],this._byteRange=w},_(s,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(k.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),s}(),v=function(s){D(d,s);function d(S,m){var f;return f=s.call(this,m)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkey=void 0,f.type=void 0,f.loader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new P.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.type=S,f}var l=d.prototype;return l.createInitializationVector=function(m){for(var f=new Uint8Array(16),w=12;w<16;w++)f[w]=m>>8*(15-w)&255;return f},l.setDecryptDataFromLevelKey=function(m,f){var w=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(w=U.LevelKey.fromURI(m.uri),w.method=m.method,w.iv=this.createInitializationVector(f),w.keyFormat="identity"),w},l.setElementaryStreamInfo=function(m,f,w,g,h,a){a===void 0&&(a=!1);var u=this.elementaryStreams,o=u[m];if(!o){u[m]={startPTS:f,endPTS:w,startDTS:g,endDTS:h,partial:a};return}o.startPTS=Math.min(o.startPTS,f),o.endPTS=Math.max(o.endPTS,w),o.startDTS=Math.min(o.startDTS,g),o.endDTS=Math.max(o.endDTS,h)},l.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[C.AUDIO]=null,m[C.VIDEO]=null,m[C.AUDIOVIDEO]=null},_(d,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="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'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(G.isFiniteNumber)(this.programDateTime))return null;var m=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),d}(A),c=function(s){D(d,s);function d(l,S,m,f,w){var g;g=s.call(this,m)||this,g.fragOffset=0,g.duration=0,g.gap=!1,g.independent=!1,g.relurl=void 0,g.fragment=void 0,g.index=void 0,g.stats=new P.LoadStats,g.duration=l.decimalFloatingPoint("DURATION"),g.gap=l.bool("GAP"),g.independent=l.bool("INDEPENDENT"),g.relurl=l.enumeratedString("URI"),g.fragment=S,g.index=f;var h=l.enumeratedString("BYTERANGE");return h&&g.setByteRange(h,w),w&&(g.fragOffset=w.fragOffset+w.duration),g}return _(d,[{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)}}]),d}(A)},"./src/loader/key-loader.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return F});var G=R("./src/events.ts"),k=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),F=function(){function U(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var P=U.prototype;return P._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},P._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},P.destroy=function(){this._unregisterListeners();for(var E in this.loaders){var b=this.loaders[E];b&&b.destroy()}this.loaders={}},P.onKeyLoading=function(E,b){var _=b.frag,C=_.type,A=this.loaders[C];if(!_.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var v=_.decryptdata.uri;if(v!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(A&&(O.logger.warn("abort previous key loader for type:"+C),A.abort()),!v){O.logger.warn("key uri is falsy");return}var s=c.loader,d=_.loader=this.loaders[C]=new s(c);this.decrypturl=v,this.decryptkey=null;var l={url:v,frag:_,responseType:"arraybuffer"},S={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};d.load(l,S,m)}else this.decryptkey&&(_.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:_}))},P.loadsuccess=function(E,b,_){var C=_.frag;if(!C.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=C.decryptdata.key=new Uint8Array(E.data),C.loader=null,delete this.loaders[C.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:C})},P.loaderror=function(E,b){var _=b.frag,C=_.loader;C&&C.abort(),delete this.loaders[_.type],this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:_,response:E})},P.loadtimeout=function(E,b){var _=b.frag,C=_.loader;C&&C.abort(),delete this.loaders[_.type],this.hls.trigger(G.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:_})},U}()},"./src/loader/level-details.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"LevelDetails",function(){return U});var G=R("./src/polyfills/number.ts");function k(P,D){for(var E=0;E<D.length;E++){var b=D[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}function O(P,D,E){return D&&k(P.prototype,D),E&&k(P,E),P}var F=10,U=function(){function P(E){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=E}var D=P.prototype;return D.reloaded=function(b){if(!b){this.advanced=!0,this.updated=!0;return}var _=this.lastPartSn-b.lastPartSn,C=this.lastPartIndex-b.lastPartIndex;this.updated=this.endSN!==b.endSN||!!C||!!_,this.advanced=this.endSN>b.endSN||_>0||_===0&&C>0,this.updated||this.advanced?this.misses=Math.floor(b.misses*.6):this.misses=b.misses+1,this.availabilityDelay=b.availabilityDelay},O(P,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(G.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var b=this.driftEndTime-this.driftStartTime;if(b>0){var _=this.driftEnd-this.driftStart;return _*1e3/b}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var b;return(b=this.partList)!==null&&b!==void 0&&b.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var b;return(b=this.fragments)!==null&&b!==void 0&&b.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 b;return(b=this.partList)!==null&&b!==void 0&&b.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var b;return(b=this.partList)!==null&&b!==void 0&&b.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),P}()},"./src/loader/level-key.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"LevelKey",function(){return U});var G=R("./node_modules/url-toolkit/src/url-toolkit.js"),k=R.n(G);function O(P,D){for(var E=0;E<D.length;E++){var b=D[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}function F(P,D,E){return D&&O(P.prototype,D),E&&O(P,E),P}var U=function(){P.fromURL=function(E,b){return new P(E,b)},P.fromURI=function(E){return new P(E)};function P(D,E){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,E?this._uri=Object(G.buildAbsoluteURL)(D,E,{alwaysNormalize:!0}):this._uri=D}return F(P,[{key:"uri",get:function(){return this._uri}}]),P}()},"./src/loader/load-stats.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"LoadStats",function(){return G});var G=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return d});var G=R("./src/polyfills/number.ts"),k=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(k),F=R("./src/loader/fragment.ts"),U=R("./src/loader/level-details.ts"),P=R("./src/loader/level-key.ts"),D=R("./src/utils/attr-list.ts"),E=R("./src/utils/logger.ts"),b=R("./src/utils/codecs.ts"),_=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,C=/#EXT-X-MEDIA:(.*)/g,A=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),v=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function s(w){var g,h;return c.test((g=(h=k.parseURL(w))===null||h===void 0?void 0:h.path)!=null?g:"")}var d=function(){function w(){}return w.findGroup=function(h,a){for(var u=0;u<h.length;u++){var o=h[u];if(o.id===a)return o}},w.convertAVC1ToAVCOTI=function(h){var a=h.split(".");if(a.length>2){var u=a.shift()+".";return u+=parseInt(a.shift()).toString(16),u+=("000"+parseInt(a.shift()).toString(16)).substr(-4),u}return h},w.resolve=function(h,a){return k.buildAbsoluteURL(a,h,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(h,a){var u=[],o={},y=!1;_.lastIndex=0;for(var p;(p=_.exec(h))!=null;)if(p[1]){var x=new D.AttrList(p[1]),M={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:w.resolve(p[2],a)},N=x.decimalResolution("RESOLUTION");N&&(M.width=N.width,M.height=N.height),l((x.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=w.convertAVC1ToAVCOTI(M.videoCodec)),u.push(M)}else if(p[3]){var j=new D.AttrList(p[3]);j["DATA-ID"]&&(y=!0,o[j["DATA-ID"]]=j)}return{levels:u,sessionData:y?o:null}},w.parseMasterPlaylistMedia=function(h,a,u,o){o===void 0&&(o=[]);var y,p=[],x=0;for(C.lastIndex=0;(y=C.exec(h))!==null;){var M=new D.AttrList(y[1]);if(M.TYPE===u){var N={attrs:M,bitrate:0,id:x++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:u,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?w.resolve(M.URI,a):""};if(o.length){var j=w.findGroup(o,N.groupId)||o[0];S(N,j,"audioCodec"),S(N,j,"textCodec")}p.push(N)}}return p},w.parseLevelPlaylist=function(h,a,u,o,y){var p=new U.LevelDetails(a),x=p.fragments,M=null,N=0,j=0,W=0,L=0,I=null,K=new F.Fragment(o,a),Y,ee,oe,xe=-1,ve=!1;for(A.lastIndex=0,p.m3u8=h;(Y=A.exec(h))!==null;){ve&&(ve=!1,K=new F.Fragment(o,a),K.start=W,K.sn=N,K.cc=L,K.level=u,M&&(K.initSegment=M,K.rawProgramDateTime=M.rawProgramDateTime));var ge=Y[1];if(ge){K.duration=parseFloat(ge);var me=(" "+Y[2]).slice(1);K.title=me||null,K.tagList.push(me?["INF",ge,me]:["INF",ge])}else if(Y[3])Object(G.isFiniteNumber)(K.duration)&&(K.start=W,oe&&(K.levelkey=oe),K.sn=N,K.level=u,K.cc=L,K.urlId=y,x.push(K),K.relurl=(" "+Y[3]).slice(1),f(K,I),I=K,W+=K.duration,N++,j=0,ve=!0);else if(Y[4]){var ce=(" "+Y[4]).slice(1);I?K.setByteRange(ce,I):K.setByteRange(ce)}else if(Y[5])K.rawProgramDateTime=(" "+Y[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),xe===-1&&(xe=x.length);else{if(Y=Y[0].match(v),!Y){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(ee=1;ee<Y.length&&!(typeof Y[ee]!="undefined");ee++);var ie=(" "+Y[ee]).slice(1),pe=(" "+Y[ee+1]).slice(1),J=Y[ee+2]?(" "+Y[ee+2]).slice(1):"";switch(ie){case"PLAYLIST-TYPE":p.type=pe.toUpperCase();break;case"MEDIA-SEQUENCE":N=p.startSN=parseInt(pe);break;case"SKIP":{var ne=new D.AttrList(pe),$=ne.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)($)){p.skippedSegments=$;for(var be=$;be--;)x.unshift(null);N+=$}var Te=ne.enumeratedString("RECENTLY-REMOVED-DATERANGES");Te&&(p.recentlyRemovedDateranges=Te.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(pe);break;case"VERSION":p.version=parseInt(pe);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(pe||J)&&K.tagList.push(J?[pe,J]:[pe]);break;case"DIS":L++;case"GAP":K.tagList.push([ie]);break;case"BITRATE":K.tagList.push([ie,pe]);break;case"DISCONTINUITY-SEQ":L=parseInt(pe);break;case"KEY":{var ye,Se=new D.AttrList(pe),Pe=Se.enumeratedString("METHOD"),Ie=Se.URI,Ue=Se.hexadecimalInteger("IV"),Re=Se.enumeratedString("KEYFORMATVERSIONS"),Oe=Se.enumeratedString("KEYID"),Ve=(ye=Se.enumeratedString("KEYFORMAT"))!=null?ye:"identity",qe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(qe.indexOf(Ve)>-1){E.logger.warn("Keyformat "+Ve+" is not supported from the manifest");continue}else if(Ve!=="identity")continue;Pe&&(oe=P.LevelKey.fromURL(a,Ie),Ie&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Pe)>=0&&(oe.method=Pe,oe.keyFormat=Ve,Oe&&(oe.keyID=Oe),Re&&(oe.keyFormatVersions=Re),oe.iv=Ue));break}case"START":{var He=new D.AttrList(pe),ze=He.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(ze)&&(p.startTimeOffset=ze);break}case"MAP":{var nt=new D.AttrList(pe);K.relurl=nt.URI,nt.BYTERANGE&&K.setByteRange(nt.BYTERANGE),K.level=u,K.sn="initSegment",oe&&(K.levelkey=oe),K.initSegment=null,M=K,ve=!0;break}case"SERVER-CONTROL":{var Je=new D.AttrList(pe);p.canBlockReload=Je.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Je.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Je.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Je.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var $e=new D.AttrList(pe);p.partTarget=$e.decimalFloatingPoint("PART-TARGET");break}case"PART":{var we=p.partList;we||(we=p.partList=[]);var rt=j>0?we[we.length-1]:void 0,Ze=j++,Me=new F.Part(new D.AttrList(pe),K,a,Ze,rt);we.push(Me),K.duration+=Me.duration;break}case"PRELOAD-HINT":{var je=new D.AttrList(pe);p.preloadHint=je;break}case"RENDITION-REPORT":{var he=new D.AttrList(pe);p.renditionReports=p.renditionReports||[],p.renditionReports.push(he);break}default:E.logger.warn("line parsed but not handled: "+Y);break}}}I&&!I.relurl?(x.pop(),W-=I.duration,p.partList&&(p.fragmentHint=I)):p.partList&&(f(K,I),K.cc=L,p.fragmentHint=K);var ue=x.length,de=x[0],Z=x[ue-1];if(W+=p.skippedSegments*p.targetduration,W>0&&ue&&Z){p.averagetargetduration=W/ue;var q=Z.sn;p.endSN=q!=="initSegment"?q:0,de&&(p.startCC=de.cc,de.initSegment||p.fragments.every(function(te){return te.relurl&&s(te.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new F.Fragment(o,a),K.relurl=Z.relurl,K.level=u,K.sn="initSegment",de.initSegment=K,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(W+=p.fragmentHint.duration),p.totalduration=W,p.endCC=L,xe>0&&m(x,xe),p},w}();function l(w,g){["video","audio","text"].forEach(function(h){var a=w.filter(function(o){return Object(b.isCodecType)(o,h)});if(a.length){var u=a.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});g[h+"Codec"]=u.length>0?u[0]:a[0],w=w.filter(function(o){return a.indexOf(o)===-1})}}),g.unknownCodecs=w}function S(w,g,h){var a=g[h];a&&(w[h]=a)}function m(w,g){for(var h=w[g],a=g;a--;){var u=w[a];if(!u)return;u.programDateTime=h.programDateTime-u.duration*1e3,h=u}}function f(w,g){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):g!=null&&g.programDateTime&&(w.programDateTime=g.endProgramDateTime),Object(G.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/polyfills/number.ts"),k=R("./src/events.ts"),O=R("./src/errors.ts"),F=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),P=R("./src/loader/m3u8-parser.ts"),D=R("./src/types/loader.ts"),E=R("./src/utils/attr-list.ts");function b(A){var v=A.type;switch(v){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function _(A,v){var c=A.url;return(c===void 0||c.indexOf("data:")===0)&&(c=v.url),c}var C=function(){function A(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var v=A.prototype;return v.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)},v.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)},v.createInternalLoader=function(s){var d=this.hls.config,l=d.pLoader,S=d.loader,m=l||S,f=new m(d);return s.loader=f,this.loaders[s.type]=f,f},v.getInternalLoader=function(s){return this.loaders[s.type]},v.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},v.destroyInternalLoaders=function(){for(var s in this.loaders){var d=this.loaders[s];d&&d.destroy(),this.resetInternalLoader(s)}},v.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},v.onManifestLoading=function(s,d){var l=d.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},v.onLevelLoading=function(s,d){var l=d.id,S=d.level,m=d.url,f=d.deliveryDirectives;this.load({id:l,groupId:null,level:S,responseType:"text",type:D.PlaylistContextType.LEVEL,url:m,deliveryDirectives:f})},v.onAudioTrackLoading=function(s,d){var l=d.id,S=d.groupId,m=d.url,f=d.deliveryDirectives;this.load({id:l,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:f})},v.onSubtitleTrackLoading=function(s,d){var l=d.id,S=d.groupId,m=d.url,f=d.deliveryDirectives;this.load({id:l,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:f})},v.load=function(s){var d,l=this.hls.config,S=this.getInternalLoader(s);if(S){var m=S.context;if(m&&m.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 f,w,g,h;switch(s.type){case D.PlaylistContextType.MANIFEST:f=l.manifestLoadingMaxRetry,w=l.manifestLoadingTimeOut,g=l.manifestLoadingRetryDelay,h=l.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:f=0,w=l.levelLoadingTimeOut;break;default:f=l.levelLoadingMaxRetry,w=l.levelLoadingTimeOut,g=l.levelLoadingRetryDelay,h=l.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(s),(d=s.deliveryDirectives)!==null&&d!==void 0&&d.part){var a;if(s.type===D.PlaylistContextType.LEVEL&&s.level!==null?a=this.hls.levels[s.level].details:s.type===D.PlaylistContextType.AUDIO_TRACK&&s.id!==null?a=this.hls.audioTracks[s.id].details:s.type===D.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(a=this.hls.subtitleTracks[s.id].details),a){var u=a.partTarget,o=a.targetduration;u&&o&&(w=Math.min(Math.max(u*3,o*.8)*1e3,w))}}var y={timeout:w,maxRetry:f,retryDelay:g,maxRetryDelay:h,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(s,y,p)},v.loadsuccess=function(s,d,l,S){if(S===void 0&&(S=null),l.isSidxRequest){this.handleSidxRequest(s,l),this.handlePlaylistLoaded(s,d,l,S);return}this.resetInternalLoader(l.type);var m=s.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,l,"no EXTM3U delimiter",S);return}d.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,d,l,S):this.handleMasterPlaylist(s,d,l,S)},v.loaderror=function(s,d,l){l===void 0&&(l=null),this.handleNetworkError(d,l,!1,s)},v.loadtimeout=function(s,d,l){l===void 0&&(l=null),this.handleNetworkError(d,l,!0)},v.handleMasterPlaylist=function(s,d,l,S){var m=this.hls,f=s.data,w=_(s,l),g=P.default.parseMasterPlaylist(f,w),h=g.levels,a=g.sessionData;if(!h.length){this.handleManifestParsingError(s,l,"no level found in manifest",S);return}var u=h.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),o=h.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),y=P.default.parseMasterPlaylistMedia(f,w,"AUDIO",u),p=P.default.parseMasterPlaylistMedia(f,w,"SUBTITLES",o),x=P.default.parseMasterPlaylistMedia(f,w,"CLOSED-CAPTIONS");if(y.length){var M=y.some(function(N){return!N.url});!M&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new E.AttrList({}),bitrate:0,url:""}))}m.trigger(k.Events.MANIFEST_LOADED,{levels:h,audioTracks:y,subtitles:p,captions:x,url:w,stats:d,networkDetails:S,sessionData:a})},v.handleTrackOrLevelPlaylist=function(s,d,l,S){var m=this.hls,f=l.id,w=l.level,g=l.type,h=_(s,l),a=Object(G.isFiniteNumber)(f)?f:0,u=Object(G.isFiniteNumber)(w)?w:a,o=b(l),y=P.default.parseLevelPlaylist(s.data,h,u,o,a);if(!y.fragments.length){m.trigger(k.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:h,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(g===D.PlaylistContextType.MANIFEST){var p={attrs:new E.AttrList({}),bitrate:0,details:y,name:"",url:h};m.trigger(k.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:h,stats:d,networkDetails:S,sessionData:null})}if(d.parsing.end=performance.now(),y.needSidxRanges){var x,M=(x=y.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:M,isSidxRequest:!0,type:g,level:w,levelDetails:y,id:f,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=y,this.handlePlaylistLoaded(s,d,l,S)},v.handleSidxRequest=function(s,d){var l=Object(U.parseSegmentIndex)(new Uint8Array(s.data));if(!l)return;var S=l.references,m=d.levelDetails;S.forEach(function(f,w){var g=f.info,h=m.fragments[w];h.byteRange.length===0&&h.setByteRange(String(1+g.end-g.start)+"@"+String(g.start)),h.initSegment&&h.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},v.handleManifestParsingError=function(s,d,l,S){this.hls.trigger(k.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:d.type===D.PlaylistContextType.MANIFEST,url:s.url,reason:l,response:s,context:d,networkDetails:S})},v.handleNetworkError=function(s,d,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 m=O.ErrorDetails.UNKNOWN,f=!1,w=this.getInternalLoader(s);switch(s.type){case D.PlaylistContextType.MANIFEST:m=l?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case D.PlaylistContextType.LEVEL:m=l?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case D.PlaylistContextType.AUDIO_TRACK:m=l?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:m=l?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}w&&this.resetInternalLoader(s.type);var g={type:O.ErrorTypes.NETWORK_ERROR,details:m,fatal:f,url:s.url,loader:w,context:s,networkDetails:d};S&&(g.response=S),this.hls.trigger(k.Events.ERROR,g)},v.handlePlaylistLoaded=function(s,d,l,S){var m=l.type,f=l.level,w=l.id,g=l.groupId,h=l.loader,a=l.levelDetails,u=l.deliveryDirectives;if(!(a!=null&&a.targetduration)){this.handleManifestParsingError(s,l,"invalid target duration",S);return}if(!h)return;a.live&&(h.getCacheAge&&(a.ageHeader=h.getCacheAge()||0),(!h.getCacheAge||isNaN(a.ageHeader))&&(a.ageHeader=0));switch(m){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(k.Events.LEVEL_LOADED,{details:a,level:f||0,id:w||0,stats:d,networkDetails:S,deliveryDirectives:u});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(k.Events.AUDIO_TRACK_LOADED,{details:a,id:w||0,groupId:g||"",stats:d,networkDetails:S,deliveryDirectives:u});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADED,{details:a,id:w||0,groupId:g||"",stats:d,networkDetails:S,deliveryDirectives:u});break}},A}();V.default=C},"./src/polyfills/number.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"isFiniteNumber",function(){return G}),R.d(V,"MAX_SAFE_INTEGER",function(){return k});var G=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},k=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(re,V,R){"use strict";R.r(V);var G=function(){function k(){}return k.getSilentFrame=function(F,U){switch(F){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===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(U===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(U===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(U===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(U===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}();V.default=G},"./src/remux/mp4-generator.ts":function(re,V,R){"use strict";R.r(V);var G=Math.pow(2,32)-1,k=function(){function O(){}return O.init=function(){O.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 U;for(U in O.types)O.types.hasOwnProperty(U)&&(O.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var P=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]),D=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]);O.HDLR_TYPES={video:P,audio:D};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),b=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=b,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var _=new Uint8Array([105,115,111,109]),C=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,_,A,_,C),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,E))},O.box=function(U){for(var P=8,D=arguments.length,E=new Array(D>1?D-1:0),b=1;b<D;b++)E[b-1]=arguments[b];for(var _=E.length,C=_;_--;)P+=E[_].byteLength;var A=new Uint8Array(P);for(A[0]=P>>24&255,A[1]=P>>16&255,A[2]=P>>8&255,A[3]=P&255,A.set(U,4),_=0,P=8;_<C;_++)A.set(E[_],P),P+=E[_].byteLength;return A},O.hdlr=function(U){return O.box(O.types.hdlr,O.HDLR_TYPES[U])},O.mdat=function(U){return O.box(O.types.mdat,U)},O.mdhd=function(U,P){P*=U;var D=Math.floor(P/(G+1)),E=Math.floor(P%(G+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,D>>24,D>>16&255,D>>8&255,D&255,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},O.mdia=function(U){return O.box(O.types.mdia,O.mdhd(U.timescale,U.duration),O.hdlr(U.type),O.minf(U))},O.mfhd=function(U){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},O.minf=function(U){return U.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(U)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(U))},O.moof=function(U,P,D){return O.box(O.types.moof,O.mfhd(U),O.traf(D,P))},O.moov=function(U){for(var P=U.length,D=[];P--;)D[P]=O.trak(U[P]);return O.box.apply(null,[O.types.moov,O.mvhd(U[0].timescale,U[0].duration)].concat(D).concat(O.mvex(U)))},O.mvex=function(U){for(var P=U.length,D=[];P--;)D[P]=O.trex(U[P]);return O.box.apply(null,[O.types.mvex].concat(D))},O.mvhd=function(U,P){P*=U;var D=Math.floor(P/(G+1)),E=Math.floor(P%(G+1)),b=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,D>>24,D>>16&255,D>>8&255,D&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 O.box(O.types.mvhd,b)},O.sdtp=function(U){var P=U.samples||[],D=new Uint8Array(4+P.length),E,b;for(E=0;E<P.length;E++)b=P[E].flags,D[E+4]=b.dependsOn<<4|b.isDependedOn<<2|b.hasRedundancy;return O.box(O.types.sdtp,D)},O.stbl=function(U){return O.box(O.types.stbl,O.stsd(U),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(U){var P=[],D=[],E,b,_;for(E=0;E<U.sps.length;E++)b=U.sps[E],_=b.byteLength,P.push(_>>>8&255),P.push(_&255),P=P.concat(Array.prototype.slice.call(b));for(E=0;E<U.pps.length;E++)b=U.pps[E],_=b.byteLength,D.push(_>>>8&255),D.push(_&255),D=D.concat(Array.prototype.slice.call(b));var C=O.box(O.types.avcC,new Uint8Array([1,P[3],P[4],P[5],252|3,224|U.sps.length].concat(P).concat([U.pps.length]).concat(D))),A=U.width,v=U.height,c=U.pixelRatio[0],s=U.pixelRatio[1];return O.box(O.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,A>>8&255,A&255,v>>8&255,v&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),C,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])))},O.esds=function(U){var P=U.config.length;return new Uint8Array([0,0,0,0,3,23+P,0,1,0,4,15+P,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([P]).concat(U.config).concat([6,1,2]))},O.mp4a=function(U){var P=U.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]),O.box(O.types.esds,O.esds(U)))},O.mp3=function(U){var P=U.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]))},O.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(U)):O.box(O.types.stsd,O.STSD,O.mp4a(U)):O.box(O.types.stsd,O.STSD,O.avc1(U))},O.tkhd=function(U){var P=U.id,D=U.duration*U.timescale,E=U.width,b=U.height,_=Math.floor(D/(G+1)),C=Math.floor(D%(G+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,C>>24,C>>16&255,C>>8&255,C&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,E>>8&255,E&255,0,0,b>>8&255,b&255,0,0]))},O.traf=function(U,P){var D=O.sdtp(U),E=U.id,b=Math.floor(P/(G+1)),_=Math.floor(P%(G+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,b>>24,b>>16&255,b>>8&255,b&255,_>>24,_>>16&255,_>>8&255,_&255])),O.trun(U,D.length+16+20+8+16+8+8),D)},O.trak=function(U){return U.duration=U.duration||4294967295,O.box(O.types.trak,O.tkhd(U),O.mdia(U))},O.trex=function(U){var P=U.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(U,P){var D=U.samples||[],E=D.length,b=12+16*E,_=new Uint8Array(b),C,A,v,c,s,d;for(P+=8+b,_.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0),C=0;C<E;C++)A=D[C],v=A.duration,c=A.size,s=A.flags,d=A.cts,_.set([v>>>24&255,v>>>16&255,v>>>8&255,v&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*C);return O.box(O.types.trun,_)},O.initSegment=function(U){O.types||O.init();var P=O.moov(U),D=new Uint8Array(O.FTYP.byteLength+P.byteLength);return D.set(O.FTYP),D.set(P,O.FTYP.byteLength),D},O}();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,V.default=k},"./src/remux/mp4-remuxer.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return d}),R.d(V,"normalizePts",function(){return l});var G=R("./src/polyfills/number.ts"),k=R("./src/remux/aac-helper.ts"),O=R("./src/remux/mp4-generator.ts"),F=R("./src/events.ts"),U=R("./src/errors.ts"),P=R("./src/utils/logger.ts"),D=R("./src/types/loader.ts"),E=R("./src/utils/timescale-conversion.ts");function b(){return b=Object.assign||function(w){for(var g=1;g<arguments.length;g++){var h=arguments[g];for(var a in h)Object.prototype.hasOwnProperty.call(h,a)&&(w[a]=h[a])}return w},b.apply(this,arguments)}var _=10*1e3,C=1024,A=1152,v=null,c=null,s=!1,d=function(){function w(h,a,u,o){if(o===void 0&&(o=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=h,this.config=a,this.typeSupported=u,this.ISGenerated=!1,v===null){var y=navigator.userAgent||"",p=y.match(/Chrome\/(\d+)/i);v=p?parseInt(p[1]):0}if(c===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);c=x?parseInt(x[1]):0}s=!!v&&v<75||!!c&&c<600}var g=w.prototype;return g.destroy=function(){},g.resetTimeStamp=function(a){P.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=a},g.resetNextTimestamp=function(){P.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},g.resetInitSegment=function(){P.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},g.getVideoStartPts=function(a){var u=!1,o=a.reduce(function(y,p){var x=p.pts-y;return x<-4294967296?(u=!0,l(y,p.pts)):x>0?y:p.pts},a[0].pts);return u&&P.logger.debug("PTS rollover detected"),o},g.remux=function(a,u,o,y,p,x,M,N){var j,W,L,I,K,Y,ee=p,oe=p,xe=a.pid>-1,ve=u.pid>-1,ge=u.samples.length,me=a.samples.length>0,ce=ge>1,ie=(!xe||me)&&(!ve||ce)||this.ISGenerated||M;if(ie){this.ISGenerated||(L=this.generateIS(a,u,p));var pe=this.isVideoContiguous,J=-1;if(ce&&(J=S(u.samples),!pe&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,J>0){P.logger.warn("[mp4-remuxer]: Dropped "+J+" out of "+ge+" video samples due to a missing keyframe");var ne=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(J),u.dropped+=J,oe+=(u.samples[0].pts-ne)/(u.timescale||9e4)}else J===-1&&(P.logger.warn("[mp4-remuxer]: No keyframe found out of "+ge+" video samples"),Y=!1);if(this.ISGenerated){if(me&&ce){var $=this.getVideoStartPts(u.samples),be=l(a.samples[0].pts,$)-$,Te=be/u.inputTimeScale;ee+=Math.max(0,Te),oe+=Math.max(0,-Te)}if(me){if(a.samplerate||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),L=this.generateIS(a,u,p)),W=this.remuxAudio(a,ee,this.isAudioContiguous,x,ve||ce||N===D.PlaylistLevelType.AUDIO?oe:void 0),ce){var ye=W?W.endPTS-W.startPTS:0;u.inputTimeScale||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),L=this.generateIS(a,u,p)),j=this.remuxVideo(u,oe,pe,ye)}}else ce&&(j=this.remuxVideo(u,oe,pe,0));j&&(j.firstKeyFrame=J,j.independent=J!==-1)}}return this.ISGenerated&&(o.samples.length&&(K=this.remuxID3(o,p)),y.samples.length&&(I=this.remuxText(y,p))),{audio:W,video:j,initSegment:L,independent:Y,text:I,id3:K}},g.generateIS=function(a,u,o){var y=a.samples,p=u.samples,x=this.typeSupported,M={},N=!Object(G.isFiniteNumber)(this._initPTS),j="audio/mp4",W,L,I;if(N&&(W=L=Infinity),a.config&&y.length&&(a.timescale=a.samplerate,a.isAAC||(x.mpeg?(j="audio/mpeg",a.codec=""):x.mp3&&(a.codec="mp3")),M.audio={id:"audio",container:j,codec:a.codec,initSegment:!a.isAAC&&x.mpeg?new Uint8Array(0):O.default.initSegment([a]),metadata:{channelCount:a.channelCount}},N&&(I=a.inputTimeScale,W=L=y[0].pts-Math.round(I*o))),u.sps&&u.pps&&p.length&&(u.timescale=u.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:O.default.initSegment([u]),metadata:{width:u.width,height:u.height}},N)){I=u.inputTimeScale;var K=this.getVideoStartPts(p),Y=Math.round(I*o);L=Math.min(L,l(p[0].dts,K)-Y),W=Math.min(W,K-Y)}if(Object.keys(M).length)return this.ISGenerated=!0,N&&(this._initPTS=W,this._initDTS=L),{tracks:M,initPTS:W,timescale:I}},g.remuxVideo=function(a,u,o,y){var p=a.inputTimeScale,x=a.samples,M=[],N=x.length,j=this._initPTS,W=this.nextAvcDts,L=8,I,K,Y,ee=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,xe=0,ve=!1;if(!o||W===null){var ge=u*p,me=x[0].pts-l(x[0].dts,x[0].pts);W=ge-me}for(var ce=0;ce<N;ce++){var ie=x[ce];if(ie.pts=l(ie.pts-j,W),ie.dts=l(ie.dts-j,W),ie.dts>ie.pts){var pe=9e4*.2;xe=Math.max(Math.min(xe,ie.pts-ie.dts),-1*pe)}ie.dts<x[ce>0?ce-1:ce].dts&&(ve=!0)}ve&&x.sort(function(vt,ft){var ke=vt.dts-ft.dts,yt=vt.pts-ft.pts;return ke||yt}),K=x[0].dts,Y=x[x.length-1].dts;var J=Math.round((Y-K)/(N-1));if(xe<0){if(xe<J*-2){P.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(E.toMsFromMpegTsClock)(-J,!0)+" ms");for(var ne=xe,$=0;$<N;$++)x[$].dts=ne=Math.max(ne,x[$].pts-J),x[$].pts=Math.max(ne,x[$].pts)}else{P.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(E.toMsFromMpegTsClock)(xe,!0)+" ms to overcome this issue");for(var be=0;be<N;be++)x[be].dts=x[be].dts+xe}K=x[0].dts}if(o){var Te=K-W,ye=Te>J,Se=Te<-1;if(ye||Se){ye?P.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(Te,!0)+" ms ("+Te+"dts) hole between fragments detected, filling it"):P.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-Te,!0)+" ms ("+Te+"dts) overlapping between fragments detected"),K=W;var Pe=x[0].pts-Te;x[0].dts=K,x[0].pts=Pe,P.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(Pe,!0)+"/"+Object(E.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(Te,!0)+" ms")}}s&&(K=Math.max(0,K));for(var Ie=0,Ue=0,Re=0;Re<N;Re++){for(var Oe=x[Re],Ve=Oe.units,qe=Ve.length,He=0,ze=0;ze<qe;ze++)He+=Ve[ze].data.length;Ue+=He,Ie+=qe,Oe.length=He,Oe.dts=Math.max(Oe.dts,K),Oe.pts=Math.max(Oe.pts,Oe.dts,0),ee=Math.min(Oe.pts,ee),oe=Math.max(Oe.pts,oe)}Y=x[N-1].dts;var nt=Ue+4*Ie+8,Je;try{Je=new Uint8Array(nt)}catch(vt){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:nt,reason:"fail allocating video mdat "+nt});return}var $e=new DataView(Je.buffer);$e.setUint32(0,nt),Je.set(O.default.types.mdat,4);for(var we=0;we<N;we++){for(var rt=x[we],Ze=rt.units,Me=0,je=0,he=Ze.length;je<he;je++){var ue=Ze[je],de=ue.data,Z=ue.data.byteLength;$e.setUint32(L,Z),L+=4,Je.set(de,L),L+=Z,Me+=4+Z}if(we<N-1)I=x[we+1].dts-rt.dts;else{var q=this.config,te=rt.dts-x[we>0?we-1:we].dts;if(q.stretchShortVideoTrack&&this.nextAudioPts!==null){var se=Math.floor(q.maxBufferHole*p),fe=(y?ee+y*p:this.nextAudioPts)-rt.pts;fe>se?(I=fe-te,I<0&&(I=te),P.logger.log("[mp4-remuxer]: It is approximately "+fe/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=te}else I=te}var _e=Math.round(rt.pts-rt.dts);M.push(new m(rt.key,I,Me,_e))}if(M.length&&v&&v<70){var De=M[0].flags;De.dependsOn=2,De.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=Y+I,this.isVideoContiguous=!0;var We=O.default.moof(a.sequenceNumber++,K,b({},a,{samples:M})),Xe="video",Ce={data1:We,data2:Je,startPTS:ee/p,endPTS:(oe+I)/p,startDTS:K/p,endDTS:W/p,type:Xe,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:a.dropped};return a.samples=[],a.dropped=0,console.assert(Je.length,"MDAT length must not be zero"),Ce},g.remuxAudio=function(a,u,o,y,p){var x=a.inputTimeScale,M=a.samplerate?a.samplerate:x,N=x/M,j=a.isAAC?C:A,W=j*N,L=this._initPTS,I=!a.isAAC&&this.typeSupported.mpeg,K=[],Y=a.samples,ee=I?0:8,oe=this.nextAudioPts||-1,xe=u*x;if(this.isAudioContiguous=o=o||Y.length&&oe>0&&(y&&Math.abs(xe-oe)<9e3||Math.abs(l(Y[0].pts-L,xe)-oe)<20*W),Y.forEach(function(de){de.pts=l(de.pts-L,xe)}),!o||oe<0){if(Y=Y.filter(function(de){return de.pts>=0}),!Y.length)return;p===0?oe=0:y?oe=Math.max(0,xe):oe=Y[0].pts}if(a.isAAC)for(var ve=p!==void 0,ge=this.config.maxAudioFramesDrift,me=0,ce=oe;me<Y.length;me++){var ie=Y[me],pe=ie.pts,J=pe-ce,ne=Math.abs(1e3*J/x);if(J<=-ge*W&&ve)me===0&&(P.logger.warn("Audio frame @ "+(pe/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*J/x)+" ms."),this.nextAudioPts=oe=ce=pe);else if(J>=ge*W&&ne<_&&ve){var $=Math.round(J/W);ce=pe-$*W,ce<0&&($--,ce+=W),me===0&&(this.nextAudioPts=oe=ce),P.logger.warn("[mp4-remuxer]: Injecting "+$+" audio frame @ "+(ce/x).toFixed(3)+"s due to "+Math.round(1e3*J/x)+" ms gap.");for(var be=0;be<$;be++){var Te=Math.max(ce,0),ye=k.default.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);ye||(P.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=ie.unit.subarray()),Y.splice(me,0,{unit:ye,pts:Te}),ce+=W,me++}}ie.pts=ce,ce+=W}for(var Se=null,Pe=null,Ie,Ue=0,Re=Y.length;Re--;)Ue+=Y[Re].unit.byteLength;for(var Oe=0,Ve=Y.length;Oe<Ve;Oe++){var qe=Y[Oe],He=qe.unit,ze=qe.pts;if(Pe!==null){var nt=K[Oe-1];nt.duration=Math.round((ze-Pe)/N)}else if(o&&a.isAAC&&(ze=oe),Se=ze,Ue>0){Ue+=ee;try{Ie=new Uint8Array(Ue)}catch(de){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ue,reason:"fail allocating audio mdat "+Ue});return}if(!I){var Je=new DataView(Ie.buffer);Je.setUint32(0,Ue),Ie.set(O.default.types.mdat,4)}}else return;Ie.set(He,ee);var $e=He.byteLength;ee+=$e,K.push(new m(!0,j,$e,0)),Pe=ze}var we=K.length;if(!we)return;var rt=K[K.length-1];this.nextAudioPts=oe=Pe+N*rt.duration;var Ze=I?new Uint8Array(0):O.default.moof(a.sequenceNumber++,Se/N,b({},a,{samples:K}));a.samples=[];var Me=Se/x,je=oe/x,he="audio",ue={data1:Ze,data2:Ie,startPTS:Me,endPTS:je,startDTS:Me,endDTS:je,type:he,hasAudio:!0,hasVideo:!1,nb:we};return this.isAudioContiguous=!0,console.assert(Ie.length,"MDAT length must not be zero"),ue},g.remuxEmptyAudio=function(a,u,o,y){var p=a.inputTimeScale,x=a.samplerate?a.samplerate:p,M=p/x,N=this.nextAudioPts,j=(N!==null?N:y.startDTS*p)+this._initDTS,W=y.endDTS*p+this._initDTS,L=M*C,I=Math.ceil((W-j)/L),K=k.default.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);if(P.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){P.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],ee=0;ee<I;ee++){var oe=j+ee*L;Y.push({unit:K,pts:oe,dts:oe})}return a.samples=Y,this.remuxAudio(a,u,o,!1)},g.remuxID3=function(a,u){var o=a.samples.length;if(!o)return;for(var y=a.inputTimeScale,p=this._initPTS,x=this._initDTS,M=0;M<o;M++){var N=a.samples[M];N.pts=l(N.pts-p,u*y)/y,N.dts=l(N.dts-x,u*y)/y}var j=a.samples;return a.samples=[],{samples:j}},g.remuxText=function(a,u){var o=a.samples.length;if(!o)return;for(var y=a.inputTimeScale,p=this._initPTS,x=0;x<o;x++){var M=a.samples[x];M.pts=l(M.pts-p,u*y)/y}a.samples.sort(function(j,W){return j.pts-W.pts});var N=a.samples;return a.samples=[],{samples:N}},w}();function l(w,g){var h;if(g===null)return w;for(g<w?h=-8589934592:h=8589934592;Math.abs(w-g)>4294967296;)w+=h;return w}function S(w){for(var g=0;g<w.length;g++)if(w[g].key)return g;return-1}var m=function(g,h,a,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=h,this.size=a,this.cts=u,this.flags=new f(g)},f=function(g){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=g?2:1,this.isNonSync=g?0:1}},"./src/remux/passthrough-remuxer.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/polyfills/number.ts"),k=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/fragment.ts"),F=R("./src/utils/logger.ts"),U=function(){function E(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var b=E.prototype;return b.destroy=function(){},b.resetTimeStamp=function(C){this.initPTS=C,this.lastEndDTS=null},b.resetNextTimestamp=function(){this.lastEndDTS=null},b.resetInitSegment=function(C,A,v){this.audioCodec=A,this.videoCodec=v,this.generateInitSegment(C),this.emitInitSegment=!0},b.generateInitSegment=function(C){var A=this.audioCodec,v=this.videoCodec;if(!C||!C.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(k.parseInitSegment)(C);A||(A=D(c.audio,O.ElementaryStreamTypes.AUDIO)),v||(v=D(c.video,O.ElementaryStreamTypes.VIDEO));var s={};c.audio&&c.video?s.audiovideo={container:"video/mp4",codec:A+","+v,initSegment:C,id:"main"}:c.audio?s.audio={container:"audio/mp4",codec:A,initSegment:C,id:"audio"}:c.video?s.video={container:"video/mp4",codec:v,initSegment:C,id:"main"}:F.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},b.remux=function(C,A,v,c,s){var d=this.initPTS,l=this.lastEndDTS,S={audio:void 0,video:void 0,text:c,id3:v,initSegment:void 0};Object(G.isFiniteNumber)(l)||(l=this.lastEndDTS=s||0);var m=A.samples;if(!m||!m.length)return S;var f={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(m),w=this.initData),!w||!w.length)return F.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(d)||(this.initPTS=f.initPTS=d=P(w,m,l));var g=Object(k.getDuration)(m,w),h=l,a=g+h;Object(k.offsetStartDTS)(w,m,d),g>0?this.lastEndDTS=a:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!w.audio,o=!!w.video,y="";u&&(y+="audio"),o&&(y+="video");var p={data1:m,startPTS:h,startDTS:h,endPTS:a,endDTS:a,type:y,hasAudio:u,hasVideo:o,nb:1,dropped:0};return S.audio=p.type==="audio"?p:void 0,S.video=p.type!=="audio"?p:void 0,S.text=c,S.id3=v,S.initSegment=f,S},E}(),P=function(b,_,C){return Object(k.getStartDTS)(b,_)-C};function D(E,b){var _=E==null?void 0:E.codec;return _&&_.length>4?_:_==="hvc1"?"hvc1.1.c.L120.90":_==="av01"?"av01.0.04M.08":_==="avc1"||b===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=U},"./src/task-loop.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return G});var G=function(){function k(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=k.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},k}()},"./src/types/cmcd.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"CMCDVersion",function(){return G}),R.d(V,"CMCDObjectType",function(){return k}),R.d(V,"CMCDStreamingFormat",function(){return O}),R.d(V,"CMCDStreamType",function(){return F});var G=1,k;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(k||(k={}));var O;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(O||(O={}));var F;(function(U){U.VOD="v",U.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"HlsSkip",function(){return O}),R.d(V,"getSkipValue",function(){return F}),R.d(V,"HlsUrlParameters",function(){return U}),R.d(V,"Level",function(){return P});function G(D,E){for(var b=0;b<E.length;b++){var _=E[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(D,_.key,_)}}function k(D,E,b){return E&&G(D.prototype,E),b&&G(D,b),D}var O;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(O||(O={}));function F(D,E){var b=D.canSkipUntil,_=D.canSkipDateRanges,C=D.endSN,A=E!==void 0?E-C:0;return b&&A<b?_?O.v2:O.Yes:O.No}var U=function(){function D(b,_,C){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=b,this.part=_,this.skip=C}var E=D.prototype;return E.addDirectives=function(_){var C=new self.URL(_);return this.msn!==void 0&&C.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&C.searchParams.set("_HLS_part",this.part.toString()),this.skip&&C.searchParams.set("_HLS_skip",this.skip),C.toString()},D}(),P=function(){function D(E){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[E.url],this.attrs=E.attrs,this.bitrate=E.bitrate,E.details&&(this.details=E.details),this.id=E.id||0,this.name=E.name,this.width=E.width||0,this.height=E.height||0,this.audioCodec=E.audioCodec,this.videoCodec=E.videoCodec,this.unknownCodecs=E.unknownCodecs,this.codecSet=[E.videoCodec,E.audioCodec].filter(function(b){return b}).join(",").replace(/\.[^.,]+/g,"")}return k(D,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(b){var _=b%this.url.length;this._urlId!==_&&(this.details=void 0,this._urlId=_)}}]),D}()},"./src/types/loader.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"PlaylistContextType",function(){return G}),R.d(V,"PlaylistLevelType",function(){return k});var G;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var k;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(k||(k={}))},"./src/types/transmuxer.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"ChunkMetadata",function(){return G});var G=function(F,U,P,D,E,b){D===void 0&&(D=0),E===void 0&&(E=-1),b===void 0&&(b=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=k(),this.buffering={audio:k(),video:k(),audiovideo:k()},this.level=F,this.sn=U,this.id=P,this.size=D,this.part=E,this.partial=b};function k(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"AttrList",function(){return O});var G=/^(\d+)x(\d+)$/,k=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function F(P){typeof P=="string"&&(P=F.parseAttrList(P));for(var D in P)P.hasOwnProperty(D)&&(this[D]=P[D])}var U=F.prototype;return U.decimalInteger=function(D){var E=parseInt(this[D],10);return E>Number.MAX_SAFE_INTEGER?Infinity:E},U.hexadecimalInteger=function(D){if(this[D]){var E=(this[D]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var b=new Uint8Array(E.length/2),_=0;_<E.length/2;_++)b[_]=parseInt(E.slice(_*2,_*2+2),16);return b}else return null},U.hexadecimalIntegerAsNumber=function(D){var E=parseInt(this[D],16);return E>Number.MAX_SAFE_INTEGER?Infinity:E},U.decimalFloatingPoint=function(D){return parseFloat(this[D])},U.optionalFloat=function(D,E){var b=this[D];return b?parseFloat(b):E},U.enumeratedString=function(D){return this[D]},U.bool=function(D){return this[D]==="YES"},U.decimalResolution=function(D){var E=G.exec(this[D]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},F.parseAttrList=function(D){var E,b={},_='"';for(k.lastIndex=0;(E=k.exec(D))!==null;){var C=E[2];C.indexOf(_)===0&&C.lastIndexOf(_)===C.length-1&&(C=C.slice(1,-1)),b[E[1]]=C}return b},F}()},"./src/utils/binary-search.ts":function(re,V,R){"use strict";R.r(V);var G={search:function(O,F){for(var U=0,P=O.length-1,D=null,E=null;U<=P;){D=(U+P)/2|0,E=O[D];var b=F(E);if(b>0)U=D+1;else if(b<0)P=D-1;else return E}return null}};V.default=G},"./src/utils/buffer-helper.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"BufferHelper",function(){return O});var G=R("./src/utils/logger.ts"),k={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function F(){}return F.isBuffered=function(P,D){try{if(P){for(var E=F.getBuffered(P),b=0;b<E.length;b++)if(D>=E.start(b)&&D<=E.end(b))return!0}}catch(_){}return!1},F.bufferInfo=function(P,D,E){try{if(P){var b=F.getBuffered(P),_=[],C;for(C=0;C<b.length;C++)_.push({start:b.start(C),end:b.end(C)});return this.bufferedInfo(_,D,E)}}catch(A){}return{len:0,start:D,end:D,nextStart:void 0}},F.bufferedInfo=function(P,D,E){D=Math.max(0,D),P.sort(function(f,w){var g=f.start-w.start;return g||w.end-f.end});var b=[];if(E)for(var _=0;_<P.length;_++){var C=b.length;if(C){var A=b[C-1].end;P[_].start-A<E?P[_].end>A&&(b[C-1].end=P[_].end):b.push(P[_])}else b.push(P[_])}else b=P;for(var v=0,c,s=D,d=D,l=0;l<b.length;l++){var S=b[l].start,m=b[l].end;if(D+E>=S&&D<m)s=S,d=m,v=d-D;else if(D+E<S){c=S;break}}return{len:v,start:s||0,end:d||0,nextStart:c}},F.getBuffered=function(P){try{return P.buffered}catch(D){return G.logger.log("failed to get media.buffered",D),k}},F}()},"./src/utils/cea-608-parser.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"Row",function(){return d}),R.d(V,"CaptionScreen",function(){return l});var G=R("./src/utils/logger.ts"),k={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},O=function(a){var u=a;return k.hasOwnProperty(a)&&(u=k[a]),String.fromCharCode(u)},F=15,U=100,P={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},b={25:2,26:4,29:6,30:8,31:10,27:13,28:15},_=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],C;(function(h){h[h.ERROR=0]="ERROR",h[h.TEXT=1]="TEXT",h[h.WARNING=2]="WARNING",h[h.INFO=2]="INFO",h[h.DEBUG=3]="DEBUG",h[h.DATA=3]="DATA"})(C||(C={}));var A=function(){function h(){this.time=null,this.verboseLevel=C.ERROR}var a=h.prototype;return a.log=function(o,y){this.verboseLevel>=o&&G.logger.log(this.time+" ["+o+"] "+y)},h}(),v=function(a){for(var u=[],o=0;o<a.length;o++)u.push(a[o].toString(16));return u},c=function(){function h(u,o,y,p,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=o||!1,this.italics=y||!1,this.background=p||"black",this.flash=x||!1}var a=h.prototype;return a.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},a.setStyles=function(o){for(var y=["foreground","underline","italics","background","flash"],p=0;p<y.length;p++){var x=y[p];o.hasOwnProperty(x)&&(this[x]=o[x])}},a.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},a.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},a.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},a.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},h}(),s=function(){function h(u,o,y,p,x,M){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new c(o,y,p,x,M)}var a=h.prototype;return a.reset=function(){this.uchar=" ",this.penState.reset()},a.setChar=function(o,y){this.uchar=o,this.penState.copy(y)},a.setPenState=function(o){this.penState.copy(o)},a.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},a.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},a.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},h}(),d=function(){function h(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<U;o++)this.chars.push(new s);this.logger=u,this.pos=0,this.currPenState=new c}var a=h.prototype;return a.equals=function(o){for(var y=!0,p=0;p<U;p++)if(!this.chars[p].equals(o.chars[p])){y=!1;break}return y},a.copy=function(o){for(var y=0;y<U;y++)this.chars[y].copy(o.chars[y])},a.isEmpty=function(){for(var o=!0,y=0;y<U;y++)if(!this.chars[y].isEmpty()){o=!1;break}return o},a.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(C.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(C.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},a.moveCursor=function(o){var y=this.pos+o;if(o>1)for(var p=this.pos+1;p<y+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(y)},a.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},a.insertChar=function(o){o>=144&&this.backSpace();var y=O(o);if(this.pos>=U){this.logger.log(C.ERROR,"Cannot insert "+o.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},a.clearFromPos=function(o){var y;for(y=o;y<U;y++)this.chars[y].reset()},a.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},a.clearToEndOfRow=function(){this.clearFromPos(this.pos)},a.getTextString=function(){for(var o=[],y=!0,p=0;p<U;p++){var x=this.chars[p].uchar;x!==" "&&(y=!1),o.push(x)}return y?"":o.join("")},a.setPenStyles=function(o){this.currPenState.setStyles(o);var y=this.chars[this.pos];y.setPenState(this.currPenState)},h}(),l=function(){function h(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<F;o++)this.rows.push(new d(u));this.logger=u,this.currRow=F-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var a=h.prototype;return a.reset=function(){for(var o=0;o<F;o++)this.rows[o].clear();this.currRow=F-1},a.equals=function(o){for(var y=!0,p=0;p<F;p++)if(!this.rows[p].equals(o.rows[p])){y=!1;break}return y},a.copy=function(o){for(var y=0;y<F;y++)this.rows[y].copy(o.rows[y])},a.isEmpty=function(){for(var o=!0,y=0;y<F;y++)if(!this.rows[y].isEmpty()){o=!1;break}return o},a.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},a.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},a.insertChar=function(o){var y=this.rows[this.currRow];y.insertChar(o)},a.setPen=function(o){var y=this.rows[this.currRow];y.setPenStyles(o)},a.moveCursor=function(o){var y=this.rows[this.currRow];y.moveCursor(o)},a.setCursor=function(o){this.logger.log(C.INFO,"setCursor: "+o);var y=this.rows[this.currRow];y.setCursor(o)},a.setPAC=function(o){this.logger.log(C.INFO,"pacData = "+JSON.stringify(o));var y=o.row-1;if(this.nrRollUpRows&&y<this.nrRollUpRows-1&&(y=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==y){for(var p=0;p<F;p++)this.rows[p].clear();var x=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var N=M.rows[x].cueStartTime,j=this.logger.time;if(N&&j!==null&&N<j)for(var W=0;W<this.nrRollUpRows;W++)this.rows[y-this.nrRollUpRows+W+1].copy(M.rows[x+W])}}this.currRow=y;var L=this.rows[this.currRow];if(o.indent!==null){var I=o.indent,K=Math.max(I-1,0);L.setCursor(o.indent),o.color=L.chars[K].penState.foreground}var Y={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(Y)},a.setBkgData=function(o){this.logger.log(C.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},a.setRollUpRows=function(o){this.nrRollUpRows=o},a.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(C.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(C.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,y=this.rows.splice(o,1)[0];y.clear(),this.rows.splice(this.currRow,0,y),this.logger.log(C.INFO,"Rolling up")},a.getDisplayText=function(o){o=o||!1;for(var y=[],p="",x=-1,M=0;M<F;M++){var N=this.rows[M].getTextString();N&&(x=M+1,o?y.push("Row "+x+": '"+N+"'"):y.push(N.trim()))}return y.length>0&&(o?p="["+y.join(" | ")+"]":p=y.join(`
|
|
`)),p},a.getTextAndFormat=function(){return this.rows},h}(),S=function(){function h(u,o,y){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=u,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new l(y),this.nonDisplayedMemory=new l(y),this.lastOutputScreen=new l(y),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}var a=h.prototype;return a.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},a.getHandler=function(){return this.outputFilter},a.setHandler=function(o){this.outputFilter=o},a.setPAC=function(o){this.writeScreen.setPAC(o)},a.setBkgData=function(o){this.writeScreen.setBkgData(o)},a.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(C.INFO,"MODE="+o),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=o},a.insertChars=function(o){for(var y=0;y<o.length;y++)this.writeScreen.insertChar(o[y]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(C.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(C.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},a.ccRCL=function(){this.logger.log(C.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},a.ccBS=function(){if(this.logger.log(C.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},a.ccAOF=function(){},a.ccAON=function(){},a.ccDER=function(){this.logger.log(C.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},a.ccRU=function(o){this.logger.log(C.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},a.ccFON=function(){this.logger.log(C.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},a.ccRDC=function(){this.logger.log(C.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},a.ccTR=function(){this.logger.log(C.INFO,"TR"),this.setMode("MODE_TEXT")},a.ccRTD=function(){this.logger.log(C.INFO,"RTD"),this.setMode("MODE_TEXT")},a.ccEDM=function(){this.logger.log(C.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},a.ccCR=function(){this.logger.log(C.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},a.ccENM=function(){this.logger.log(C.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},a.ccEOC=function(){if(this.logger.log(C.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(C.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},a.ccTO=function(o){this.logger.log(C.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},a.ccMIDROW=function(o){var y={flash:!1};if(y.underline=o%2===1,y.italics=o>=46,y.italics)y.foreground="white";else{var p=Math.floor(o/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=x[p]}this.logger.log(C.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},a.outputDataUpdate=function(o){o===void 0&&(o=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),this.lastOutputScreen.copy(this.displayedMemory))},a.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},h}(),m=function(){function h(u,o,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new A;this.channels=[null,new S(u,o,p),new S(u+1,y,p)],this.cmdHistory=g(),this.logger=p}var a=h.prototype;return a.getHandler=function(o){return this.channels[o].getHandler()},a.setHandler=function(o,y){this.channels[o].setHandler(y)},a.addData=function(o,y){var p,x,M,N=!1;this.logger.time=o;for(var j=0;j<y.length;j+=2){if(x=y[j]&127,M=y[j+1]&127,x===0&&M===0)continue;if(this.logger.log(C.DATA,"["+v([y[j],y[j+1]])+"] -> ("+v([x,M])+")"),p=this.parseCmd(x,M),p||(p=this.parseMidrow(x,M)),p||(p=this.parsePAC(x,M)),p||(p=this.parseBackgroundAttributes(x,M)),!p&&(N=this.parseChars(x,M),N)){var W=this.currentChannel;if(W&&W>0){var L=this.channels[W];L.insertChars(N)}else this.logger.log(C.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!N&&this.logger.log(C.WARNING,"Couldn't parse cleaned data "+v([x,M])+" orig: "+v([y[j],y[j+1]]))}},a.parseCmd=function(o,y){var p=this.cmdHistory,x=(o===20||o===28||o===21||o===29)&&y>=32&&y<=47,M=(o===23||o===31)&&y>=33&&y<=35;if(!(x||M))return!1;if(w(o,y,p))return f(null,null,p),this.logger.log(C.DEBUG,"Repeated command ("+v([o,y])+") is dropped"),!0;var N=o===20||o===21||o===23?1:2,j=this.channels[N];return o===20||o===21||o===28||o===29?y===32?j.ccRCL():y===33?j.ccBS():y===34?j.ccAOF():y===35?j.ccAON():y===36?j.ccDER():y===37?j.ccRU(2):y===38?j.ccRU(3):y===39?j.ccRU(4):y===40?j.ccFON():y===41?j.ccRDC():y===42?j.ccTR():y===43?j.ccRTD():y===44?j.ccEDM():y===45?j.ccCR():y===46?j.ccENM():y===47&&j.ccEOC():j.ccTO(y-32),f(o,y,p),this.currentChannel=N,!0},a.parseMidrow=function(o,y){var p=0;if((o===17||o===25)&&y>=32&&y<=47){if(o===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(C.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[p];return x?(x.ccMIDROW(y),this.logger.log(C.DEBUG,"MIDROW ("+v([o,y])+")"),!0):!1}return!1},a.parsePAC=function(o,y){var p,x=this.cmdHistory,M=(o>=17&&o<=23||o>=25&&o<=31)&&y>=64&&y<=127,N=(o===16||o===24)&&y>=64&&y<=95;if(!(M||N))return!1;if(w(o,y,x))return f(null,null,x),!0;var j=o<=23?1:2;y>=64&&y<=95?p=j===1?P[o]:E[o]:p=j===1?D[o]:b[o];var W=this.channels[j];return W?(W.setPAC(this.interpretPAC(p,y)),f(o,y,x),this.currentChannel=j,!0):!1},a.interpretPAC=function(o,y){var p,x={color:null,italics:!1,indent:null,underline:!1,row:o};return y>95?p=y-96:p=y-64,x.underline=(p&1)===1,p<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((p-16)/2)*4,x},a.parseChars=function(o,y){var p,x=null,M=null;if(o>=25?(p=2,M=o-8):(p=1,M=o),M>=17&&M<=19){var N;M===17?N=y+80:M===18?N=y+112:N=y+144,this.logger.log(C.INFO,"Special char '"+O(N)+"' in channel "+p),x=[N]}else o>=32&&o<=127&&(x=y===0?[o]:[o,y]);if(x){var j=v(x);this.logger.log(C.DEBUG,"Char codes = "+j.join(",")),f(o,y,this.cmdHistory)}return x},a.parseBackgroundAttributes=function(o,y){var p=(o===16||o===24)&&y>=32&&y<=47,x=(o===23||o===31)&&y>=45&&y<=47;if(!(p||x))return!1;var M,N={};o===16||o===24?(M=Math.floor((y-32)/2),N.background=_[M],y%2===1&&(N.background=N.background+"_semi")):y===45?N.background="transparent":(N.foreground="black",y===47&&(N.underline=!0));var j=o<=23?1:2,W=this.channels[j];return W.setBkgData(N),f(o,y,this.cmdHistory),!0},a.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var y=this.channels[o];y&&y.reset()}this.cmdHistory=g()},a.cueSplitAtTime=function(o){for(var y=0;y<this.channels.length;y++){var p=this.channels[y];p&&p.cueSplitAtTime(o)}},h}();function f(h,a,u){u.a=h,u.b=a}function w(h,a,u){return u.a===h&&u.b===a}function g(){return{a:null,b:null}}V.default=m},"./src/utils/codecs.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"isCodecType",function(){return k}),R.d(V,"isCodecSupportedInMp4",function(){return O});var G={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function k(F,U){var P=G[U];return!!P&&P[F.slice(0,4)]===!0}function O(F,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+F+'"')}},"./src/utils/cues.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/utils/vttparser.ts"),k=R("./src/utils/webvtt-parser.ts"),O=R("./src/utils/texttrack-utils.ts"),F=/\s/,U={newCue:function(D,E,b,_){for(var C=[],A,v,c,s,d,l=self.VTTCue||self.TextTrackCue,S=0;S<_.rows.length;S++)if(A=_.rows[S],c=!0,s=0,d="",!A.isEmpty()){for(var m=0;m<A.chars.length;m++)F.test(A.chars[m].uchar)&&c?s++:(d+=A.chars[m].uchar,c=!1);A.cueStartTime=E,E===b&&(b+=1e-4),s>=16?s--:s++;var f=Object(G.fixLineBreaks)(d.trim()),w=Object(k.generateCueId)(E,b,f);(!D||!D.cues||!D.cues.getCueById(w))&&(v=new l(E,b,f),v.id=w,v.line=S+1,v.align="left",v.position=10+Math.min(80,Math.floor(s*8/32)*10),C.push(v))}return D&&C.length&&(C.sort(function(g,h){return g.line==="auto"||h.line==="auto"?0:g.line>8&&h.line>8?h.line-g.line:g.line-h.line}),C.forEach(function(g){return Object(O.addCueToTrack)(D,g)})),C}};V.default=U},"./src/utils/discontinuities.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"findFirstFragWithCC",function(){return F}),R.d(V,"shouldAlignOnDiscontinuities",function(){return U}),R.d(V,"findDiscontinuousReferenceFrag",function(){return P}),R.d(V,"adjustSlidingStart",function(){return E}),R.d(V,"alignStream",function(){return b}),R.d(V,"alignPDT",function(){return C}),R.d(V,"alignFragmentByPDTDelta",function(){return A}),R.d(V,"alignMediaPlaylistByPDT",function(){return v});var G=R("./src/polyfills/number.ts"),k=R("./src/utils/logger.ts"),O=R("./src/controller/level-helper.ts");function F(c,s){for(var d=null,l=0,S=c.length;l<S;l++){var m=c[l];if(m&&m.cc===s){d=m;break}}return d}function U(c,s,d){return!!(s.details&&(d.endCC>d.startCC||c&&c.cc<d.startCC))}function P(c,s){var d=c.fragments,l=s.fragments;if(!l.length||!d.length){k.logger.log("No fragments to align");return}var S=F(d,l[0].cc);if(!S||S&&!S.startPTS){k.logger.log("No frag in previous level to align on");return}return S}function D(c,s){if(c){var d=c.start+s;c.start=c.startPTS=d,c.endPTS=d+c.duration}}function E(c,s){for(var d=s.fragments,l=0,S=d.length;l<S;l++)D(d[l],c);s.fragmentHint&&D(s.fragmentHint,c),s.alignedSliding=!0}function b(c,s,d){if(!s)return;_(c,d,s),!d.alignedSliding&&s.details&&C(d,s.details),!d.alignedSliding&&s.details&&!d.skippedSegments&&Object(O.adjustSliding)(s.details,d)}function _(c,s,d){if(U(c,d,s)){var l=P(d.details,s);l&&Object(G.isFiniteNumber)(l.start)&&(k.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),E(l.start,s))}}function C(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var d=s.fragments[0].programDateTime,l=c.fragments[0].programDateTime,S=(l-d)/1e3+s.fragments[0].start;S&&Object(G.isFiniteNumber)(S)&&(k.logger.log("Adjusting PTS using programDateTime delta "+(l-d)+"ms, sliding:"+S.toFixed(3)+" "+c.url+" "),E(S,c))}function A(c,s){var d=c.programDateTime;if(!d)return;var l=(d-s)/1e3;c.start=c.startPTS=l,c.endPTS=l+c.duration}function v(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var d=s.fragments[0].programDateTime,l=s.fragments[0].start,S=d-l*1e3;c.fragments.forEach(function(m){A(m,S)}),c.fragmentHint&&A(c.fragmentHint,S),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/utils/ewma.ts"),k=function(){function O(U,P,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new G.default(U),this.fast_=new G.default(P)}var F=O.prototype;return F.update=function(P,D){var E=this.slow_,b=this.fast_;this.slow_.halfLife!==P&&(this.slow_=new G.default(P,E.getEstimate(),E.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new G.default(D,b.getEstimate(),b.getTotalWeight()))},F.sample=function(P,D){P=Math.max(P,this.minDelayMs_);var E=8*D,b=P/1e3,_=E/b;this.fast_.sample(b,_),this.slow_.sample(b,_)},F.canEstimate=function(){var P=this.fast_;return P&&P.getTotalWeight()>=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},O}();V.default=k},"./src/utils/ewma.ts":function(re,V,R){"use strict";R.r(V);var G=function(){function k(F,U,P){U===void 0&&(U=0),P===void 0&&(P=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_=U,this.totalWeight_=P}var O=k.prototype;return O.sample=function(U,P){var D=Math.pow(this.alpha_,U);this.estimate_=P*(1-D)+D*this.estimate_,this.totalWeight_+=U},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},k}();V.default=G},"./src/utils/fetch-loader.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"fetchSupported",function(){return A});var G=R("./src/polyfills/number.ts"),k=R("./src/loader/load-stats.ts"),O=R("./src/demux/chunk-cache.ts");function F(l,S){l.prototype=Object.create(S.prototype),l.prototype.constructor=l,b(l,S)}function U(l){var S=typeof Map=="function"?new Map:void 0;return U=function(f){if(f===null||!E(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(f))return S.get(f);S.set(f,w)}function w(){return P(f,arguments,_(this).constructor)}return w.prototype=Object.create(f.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b(w,f)},U(l)}function P(l,S,m){return D()?P=Reflect.construct:P=function(w,g,h){var a=[null];a.push.apply(a,g);var u=Function.bind.apply(w,a),o=new u;return h&&b(o,h.prototype),o},P.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(l){return!1}}function E(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function b(l,S){return b=Object.setPrototypeOf||function(f,w){return f.__proto__=w,f},b(l,S)}function _(l){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},_(l)}function C(){return C=Object.assign||function(l){for(var S=1;S<arguments.length;S++){var m=arguments[S];for(var f in m)Object.prototype.hasOwnProperty.call(m,f)&&(l[f]=m[f])}return l},C.apply(this,arguments)}function A(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(l){}return!1}var v=function(){function l(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||s,this.controller=new self.AbortController,this.stats=new k.LoadStats}var S=l.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var f=this.response;(!f||!f.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(f,w,g){var h=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var u=c(f,this.controller.signal),o=g.onProgress,y=f.responseType==="arraybuffer",p=y?"byteLength":"length";this.context=f,this.config=w,this.callbacks=g,this.request=this.fetchSetup(f,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){h.abortInternal(),g.onTimeout(a,f,h.response)},w.timeout),self.fetch(this.request).then(function(x){if(h.response=h.loader=x,!x.ok){var M=x.status,N=x.statusText;throw new d(N||"fetch, bad network response",M,x)}return a.loading.first=Math.max(self.performance.now(),a.loading.start),a.total=parseInt(x.headers.get("Content-Length")||"0"),o&&Object(G.isFiniteNumber)(w.highWaterMark)?h.loadProgressively(x,a,f,w.highWaterMark,o):y?x.arrayBuffer():x.text()}).then(function(x){var M=h.response;self.clearTimeout(h.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first),a.loaded=a.total=x[p];var N={url:M.url,data:x};o&&!Object(G.isFiniteNumber)(w.highWaterMark)&&o(a,f,x,M),g.onSuccess(N,a,f,M)}).catch(function(x){if(self.clearTimeout(h.requestTimeout),a.aborted)return;var M=x.code||0;g.onError({code:M,text:x.message},f,x.details)})},S.getCacheAge=function(){var f=null;if(this.response){var w=this.response.headers.get("age");f=w?parseFloat(w):null}return f},S.loadProgressively=function(f,w,g,h,a){h===void 0&&(h=0);var u=new O.default,o=f.body.getReader(),y=function p(){return o.read().then(function(x){if(x.done)return u.dataLength&&a(w,g,u.flush(),f),Promise.resolve(new ArrayBuffer(0));var M=x.value,N=M.length;return w.loaded+=N,N<h||u.dataLength?(u.push(M),u.dataLength>=h&&a(w,g,u.flush(),f)):a(w,g,M,f),p()}).catch(function(){return Promise.reject()})};return y()},l}();function c(l,S){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(C({},l.headers))};return l.rangeEnd&&m.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),m}function s(l,S){return new self.Request(l.url,S)}var d=function(l){F(S,l);function S(m,f,w){var g;return g=l.call(this,m)||this,g.code=void 0,g.details=void 0,g.code=f,g.details=w,g}return S}(U(Error));V.default=v},"./src/utils/imsc1-ttml-parser.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"IMSC1_CODEC",function(){return E}),R.d(V,"parseIMSC1",function(){return A});var G=R("./src/utils/mp4-tools.ts"),k=R("./src/utils/vttparser.ts"),O=R("./src/utils/vttcue.ts"),F=R("./src/demux/id3.ts"),U=R("./src/utils/timescale-conversion.ts"),P=R("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(h){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(h[o]=u[o])}return h},D.apply(this,arguments)}var E="stpp.ttml.im1t",b=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,_=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,C={left:"start",center:"center",right:"end",start:"start",end:"end"};function A(h,a,u,o,y){var p=Object(G.findBox)(new Uint8Array(h),["mdat"]);if(p.length===0){y(new Error("Could not parse IMSC1 mdat"));return}var x=p[0],M=Object(F.utf8ArrayToStr)(new Uint8Array(h,x.start,x.end-x.start)),N=Object(U.toTimescaleFromScale)(a,1,u);try{o(v(M,N))}catch(j){y(j)}}function v(h,a){var u=new DOMParser,o=u.parseFromString(h,"text/xml"),y=o.getElementsByTagName("tt")[0];if(!y)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(p).reduce(function(L,I){return L[I]=y.getAttribute("ttp:"+I)||p[I],L},{}),M=y.getAttribute("xml:space")!=="preserve",N=s(c(y,"styling","style")),j=s(c(y,"layout","region")),W=c(y,"body","[begin]");return[].map.call(W,function(L){var I=d(L,M);if(!I||!L.hasAttribute("begin"))return null;var K=f(L.getAttribute("begin"),x),Y=f(L.getAttribute("dur"),x),ee=f(L.getAttribute("end"),x);if(K===null)throw m(L);if(ee===null){if(Y===null)throw m(L);ee=K+Y}var oe=new O.default(K-a,ee-a,I);oe.id=Object(P.generateCueId)(oe.startTime,oe.endTime,oe.text);var xe=j[L.getAttribute("region")],ve=N[L.getAttribute("style")];oe.position=10,oe.size=80;var ge=l(xe,ve),me=ge.textAlign;if(me){var ce=C[me];ce&&(oe.lineAlign=ce),oe.align=me}return D(oe,ge),oe}).filter(function(L){return L!==null})}function c(h,a,u){var o=h.getElementsByTagName(a)[0];return o?[].slice.call(o.querySelectorAll(u)):[]}function s(h){return h.reduce(function(a,u){var o=u.getAttribute("xml:id");return o&&(a[o]=u),a},{})}function d(h,a){return[].slice.call(h.childNodes).reduce(function(u,o,y){var p;return o.nodeName==="br"&&y?u+`
|
|
`:(p=o.childNodes)!==null&&p!==void 0&&p.length?d(o,a):a?u+o.textContent.trim().replace(/\s+/g," "):u+o.textContent},"")}function l(h,a){var u="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(y,p){var x=S(a,u,p)||S(h,u,p);return x&&(y[p]=x),y},{})}function S(h,a,u){return h.hasAttributeNS(a,u)?h.getAttributeNS(a,u):null}function m(h){return new Error("Could not parse ttml timestamp "+h)}function f(h,a){if(!h)return null;var u=Object(k.parseTimeStamp)(h);return u===null&&(b.test(h)?u=w(h,a):_.test(h)&&(u=g(h,a))),u}function w(h,a){var u=b.exec(h),o=(u[4]|0)+(u[5]|0)/a.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+o/a.frameRate}function g(h,a){var u=_.exec(h),o=Number(u[1]),y=u[2];switch(y){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/a.frameRate;case"t":return o/a.tickRate}return o}},"./src/utils/logger.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"enableLogs",function(){return P}),R.d(V,"logger",function(){return D});var G=function(){},k={trace:G,debug:G,log:G,warn:G,info:G,error:G},O=k;function F(E){var b=self.console[E];return b?b.bind(self.console,"["+E+"] >"):G}function U(E){for(var b=arguments.length,_=new Array(b>1?b-1:0),C=1;C<b;C++)_[C-1]=arguments[C];_.forEach(function(A){O[A]=E[A]?E[A].bind(E):F(A)})}function P(E){if(self.console&&E===!0||typeof E=="object"){U(E,"debug","log","info","warn","error");try{O.log()}catch(b){O=k}}else O=k}var D=O},"./src/utils/mediakeys-helper.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"KeySystems",function(){return G}),R.d(V,"requestMediaKeySystemAccess",function(){return k});var G;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(G||(G={}));var k=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"bin2str",function(){return U}),R.d(V,"readUint16",function(){return P}),R.d(V,"readUint32",function(){return D}),R.d(V,"writeUint32",function(){return E}),R.d(V,"findBox",function(){return b}),R.d(V,"parseSegmentIndex",function(){return _}),R.d(V,"parseInitSegment",function(){return C}),R.d(V,"getStartDTS",function(){return A}),R.d(V,"getDuration",function(){return v}),R.d(V,"computeRawDurationFromSamples",function(){return c}),R.d(V,"offsetStartDTS",function(){return s}),R.d(V,"segmentValidRange",function(){return d}),R.d(V,"appendUint8Array",function(){return l});var G=R("./src/utils/typed-array.ts"),k=R("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,F=[].push;function U(S){return String.fromCharCode.apply(null,S)}function P(S,m){"data"in S&&(m+=S.start,S=S.data);var f=S[m]<<8|S[m+1];return f<0?65536+f:f}function D(S,m){"data"in S&&(m+=S.start,S=S.data);var f=S[m]<<24|S[m+1]<<16|S[m+2]<<8|S[m+3];return f<0?4294967296+f:f}function E(S,m,f){"data"in S&&(m+=S.start,S=S.data),S[m]=f>>24,S[m+1]=f>>16&255,S[m+2]=f>>8&255,S[m+3]=f&255}function b(S,m){var f=[];if(!m.length)return f;var w,g,h;"data"in S?(w=S.data,g=S.start,h=S.end):(w=S,g=0,h=w.byteLength);for(var a=g;a<h;){var u=D(w,a),o=U(w.subarray(a+4,a+8)),y=u>1?a+u:h;if(o===m[0])if(m.length===1)f.push({data:w,start:a+8,end:y});else{var p=b({data:w,start:a+8,end:y},m.slice(1));p.length&&F.apply(f,p)}a=y}return f}function _(S){var m=b(S,["moov"]),f=m[0],w=f?f.end:null,g=b(S,["sidx"]);if(!g||!g[0])return null;var h=[],a=g[0],u=a.data[0],o=u===0?8:16,y=D(a,o);o+=4;var p=0,x=0;u===0?o+=8:o+=16,o+=2;var M=a.end+x,N=P(a,o);o+=2;for(var j=0;j<N;j++){var W=o,L=D(a,W);W+=4;var I=L&2147483647,K=(L&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=D(a,W);W+=4,h.push({referenceSize:I,subsegmentDuration:Y,info:{duration:Y/y,start:M,end:M+I-1}}),M+=I,W+=4,o=W}return{earliestPresentationTime:p,timescale:y,version:u,referencesCount:N,references:h,moovEndOffset:w}}function C(S){for(var m=[],f=b(S,["moov","trak"]),w=0;w<f.length;w++){var g=f[w],h=b(g,["tkhd"])[0];if(h){var a=h.data[h.start],u=a===0?12:20,o=D(h,u),y=b(g,["mdia","mdhd"])[0];if(y){a=y.data[y.start],u=a===0?12:20;var p=D(y,u),x=b(g,["mdia","hdlr"])[0];if(x){var M=U(x.data.subarray(x.start+8,x.start+12)),N={soun:k.ElementaryStreamTypes.AUDIO,vide:k.ElementaryStreamTypes.VIDEO}[M];if(N){var j=b(g,["mdia","minf","stbl","stsd"])[0],W=void 0;j&&(W=U(j.data.subarray(j.start+12,j.start+16))),m[o]={timescale:p,type:N},m[N]={timescale:p,id:o,codec:W}}}}}}var L=b(S,["moov","mvex","trex"]);return L.forEach(function(I){var K=D(I,4),Y=m[K];Y&&(Y.default={duration:D(I,12),flags:D(I,20)})}),m}function A(S,m){return b(m,["moof","traf"]).reduce(function(f,w){var g=b(w,["tfdt"])[0],h=g.data[g.start],a=b(w,["tfhd"]).reduce(function(u,o){var y=D(o,4),p=S[y];if(p){var x=D(g,4);h===1&&(x*=Math.pow(2,32),x+=D(g,8));var M=p.timescale||9e4,N=x/M;if(isFinite(N)&&(u===null||N<u))return N}return u},null);return a!==null&&isFinite(a)&&(f===null||a<f)?a:f},null)||0}function v(S,m){for(var f=0,w=0,g=0,h=b(S,["moof","traf"]),a=0;a<h.length;a++){var u=h[a],o=b(u,["tfhd"])[0],y=D(o,4),p=m[y];if(!p)continue;var x=p.default,M=D(o,0)|(x==null?void 0:x.flags),N=x==null?void 0:x.duration;M&8&&(M&2?N=D(o,12):N=D(o,8));for(var j=p.timescale||9e4,W=b(u,["trun"]),L=0;L<W.length;L++){if(N){var I=D(W[L],4);f=N*I}else f=c(W[L]);p.type===k.ElementaryStreamTypes.VIDEO?w+=f/j:p.type===k.ElementaryStreamTypes.AUDIO&&(g+=f/j)}}if(w===0&&g===0){var K=_(S);if(K!=null&&K.references)return K.references.reduce(function(Y,ee){return Y+ee.info.duration||0},0)}return w||g}function c(S){var m=D(S,0),f=8;m&1&&(f+=4),m&4&&(f+=4);for(var w=0,g=D(S,4),h=0;h<g;h++){if(m&256){var a=D(S,f);w+=a,f+=4}m&512&&(f+=4),m&1024&&(f+=4),m&2048&&(f+=4)}return w}function s(S,m,f){b(m,["moof","traf"]).forEach(function(w){b(w,["tfhd"]).forEach(function(g){var h=D(g,4),a=S[h];if(!a)return;var u=a.timescale||9e4;b(w,["tfdt"]).forEach(function(o){var y=o.data[o.start],p=D(o,4);if(y===0)E(o,4,p-f*u);else{p*=Math.pow(2,32),p+=D(o,8),p-=f*u,p=Math.max(p,0);var x=Math.floor(p/(O+1)),M=Math.floor(p%(O+1));E(o,4,x),E(o,8,M)}})})})}function d(S){var m={valid:null,remainder:null},f=b(S,["moof"]);if(f){if(f.length<2)return m.remainder=S,m}else return m;var w=f[f.length-1];return m.valid=Object(G.sliceUint8)(S,0,w.start-8),m.remainder=Object(G.sliceUint8)(S,w.start-8),m}function l(S,m){var f=new Uint8Array(S.length+m.length);return f.set(S),f.set(m,S.length),f}},"./src/utils/output-filter.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"default",function(){return G});var G=function(){function k(F,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=F,this.trackName=U}var O=k.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(U,P,D){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=P,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},k}()},"./src/utils/texttrack-utils.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"sendAddTrackEvent",function(){return k}),R.d(V,"addCueToTrack",function(){return O}),R.d(V,"clearCurrentCues",function(){return F}),R.d(V,"removeCuesInRange",function(){return U}),R.d(V,"getCuesInRange",function(){return D});var G=R("./src/utils/logger.ts");function k(E,b){var _;try{_=new Event("addtrack")}catch(C){_=document.createEvent("Event"),_.initEvent("addtrack",!1,!1)}_.track=E,b.dispatchEvent(_)}function O(E,b){var _=E.mode;if(_==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(b.id))try{if(E.addCue(b),!E.cues.getCueById(b.id))throw new Error("addCue is failed for: "+b)}catch(A){G.logger.debug("[texttrack-utils]: "+A);var C=new self.TextTrackCue(b.startTime,b.endTime,b.text);C.id=b.id,E.addCue(C)}_==="disabled"&&(E.mode=_)}function F(E){var b=E.mode;if(b==="disabled"&&(E.mode="hidden"),E.cues)for(var _=E.cues.length;_--;)E.removeCue(E.cues[_]);b==="disabled"&&(E.mode=b)}function U(E,b,_){var C=E.mode;if(C==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var A=D(E.cues,b,_),v=0;v<A.length;v++)E.removeCue(A[v]);C==="disabled"&&(E.mode=C)}function P(E,b){if(b<E[0].startTime)return 0;var _=E.length-1;if(b>E[_].endTime)return-1;for(var C=0,A=_;C<=A;){var v=Math.floor((A+C)/2);if(b<E[v].startTime)A=v-1;else if(b>E[v].startTime&&C<_)C=v+1;else return v}return E[C].startTime-b<b-E[A].startTime?C:A}function D(E,b,_){var C=[],A=P(E,b);if(A>-1)for(var v=A,c=E.length;v<c;v++){var s=E[v];if(s.startTime>=b&&s.endTime<=_)C.push(s);else if(s.startTime>_)return C}return C}},"./src/utils/time-ranges.ts":function(re,V,R){"use strict";R.r(V);var G={toString:function(O){for(var F="",U=O.length,P=0;P<U;P++)F+="["+O.start(P).toFixed(3)+","+O.end(P).toFixed(3)+"]";return F}};V.default=G},"./src/utils/timescale-conversion.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"toTimescaleFromBase",function(){return k}),R.d(V,"toTimescaleFromScale",function(){return O}),R.d(V,"toMsFromMpegTsClock",function(){return F}),R.d(V,"toMpegTsClockFromTimescale",function(){return U});var G=9e4;function k(P,D,E,b){E===void 0&&(E=1),b===void 0&&(b=!1);var _=P*D*E;return b?Math.round(_):_}function O(P,D,E,b){return E===void 0&&(E=1),b===void 0&&(b=!1),k(P,D,1/E,b)}function F(P,D){return D===void 0&&(D=!1),k(P,1e3,1/G,D)}function U(P,D){return D===void 0&&(D=1),k(P,G,1/D)}},"./src/utils/typed-array.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"sliceUint8",function(){return G});function G(k,O,F){return Uint8Array.prototype.slice?k.slice(O,F):new Uint8Array(Array.prototype.slice.call(k,O,F))}},"./src/utils/vttcue.ts":function(re,V,R){"use strict";R.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],k=["start","middle","end","left","right"];function O(E,b){if(typeof b!="string")return!1;if(!Array.isArray(E))return!1;var _=b.toLowerCase();return~E.indexOf(_)?_:!1}function F(E){return O(G,E)}function U(E){return O(k,E)}function P(E){for(var b=arguments.length,_=new Array(b>1?b-1:0),C=1;C<b;C++)_[C-1]=arguments[C];for(var A=1;A<arguments.length;A++){var v=arguments[A];for(var c in v)E[c]=v[c]}return E}function D(E,b,_){var C=this,A={enumerable:!0};C.hasBeenReset=!1;var v="",c=!1,s=E,d=b,l=_,S=null,m="",f=!0,w="auto",g="start",h=50,a="middle",u=50,o="middle";Object.defineProperty(C,"id",P({},A,{get:function(){return v},set:function(p){v=""+p}})),Object.defineProperty(C,"pauseOnExit",P({},A,{get:function(){return c},set:function(p){c=!!p}})),Object.defineProperty(C,"startTime",P({},A,{get:function(){return s},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");s=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"endTime",P({},A,{get:function(){return d},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");d=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"text",P({},A,{get:function(){return l},set:function(p){l=""+p,this.hasBeenReset=!0}})),Object.defineProperty(C,"region",P({},A,{get:function(){return S},set:function(p){S=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"vertical",P({},A,{get:function(){return m},set:function(p){var x=F(p);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=x,this.hasBeenReset=!0}})),Object.defineProperty(C,"snapToLines",P({},A,{get:function(){return f},set:function(p){f=!!p,this.hasBeenReset=!0}})),Object.defineProperty(C,"line",P({},A,{get:function(){return w},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"lineAlign",P({},A,{get:function(){return g},set:function(p){var x=U(p);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");g=x,this.hasBeenReset=!0}})),Object.defineProperty(C,"position",P({},A,{get:function(){return h},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");h=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"positionAlign",P({},A,{get:function(){return a},set:function(p){var x=U(p);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");a=x,this.hasBeenReset=!0}})),Object.defineProperty(C,"size",P({},A,{get:function(){return u},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");u=p,this.hasBeenReset=!0}})),Object.defineProperty(C,"align",P({},A,{get:function(){return o},set:function(p){var x=U(p);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");o=x,this.hasBeenReset=!0}})),C.displayState=void 0}return D.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"parseTimeStamp",function(){return O}),R.d(V,"fixLineBreaks",function(){return b}),R.d(V,"VTTParser",function(){return _});var G=R("./src/utils/vttcue.ts"),k=function(){function C(){}var A=C.prototype;return A.decode=function(c,s){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},C}();function O(C){function A(c,s,d,l){return(c|0)*3600+(s|0)*60+(d|0)+parseFloat(l||0)}var v=C.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return v?parseFloat(v[2])>59?A(v[2],v[3],0,v[4]):A(v[1],v[2],v[3],v[4]):null}var F=function(){function C(){this.values=Object.create(null)}var A=C.prototype;return A.set=function(c,s){!this.get(c)&&s!==""&&(this.values[c]=s)},A.get=function(c,s,d){return d?this.has(c)?this.values[c]:s[d]:this.has(c)?this.values[c]:s},A.has=function(c){return c in this.values},A.alt=function(c,s,d){for(var l=0;l<d.length;++l)if(s===d[l]){this.set(c,s);break}},A.integer=function(c,s){/^-?\d+$/.test(s)&&this.set(c,parseInt(s,10))},A.percent=function(c,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var d=parseFloat(s);if(d>=0&&d<=100)return this.set(c,d),!0}return!1},C}();function U(C,A,v,c){var s=c?C.split(c):[C];for(var d in s){if(typeof s[d]!="string")continue;var l=s[d].split(v);if(l.length!==2)continue;var S=l[0],m=l[1];A(S,m)}}var P=new G.default(0,0,""),D=P.align==="middle"?"middle":"center";function E(C,A,v){var c=C;function s(){var S=O(C);if(S===null)throw new Error("Malformed timestamp: "+c);return C=C.replace(/^[^\sa-zA-Z-]+/,""),S}function d(S,m){var f=new F;U(S,function(h,a){var u;switch(h){case"region":for(var o=v.length-1;o>=0;o--)if(v[o].id===a){f.set(h,v[o].region);break}break;case"vertical":f.alt(h,a,["rl","lr"]);break;case"line":u=a.split(","),f.integer(h,u[0]),f.percent(h,u[0])&&f.set("snapToLines",!1),f.alt(h,u[0],["auto"]),u.length===2&&f.alt("lineAlign",u[1],["start",D,"end"]);break;case"position":u=a.split(","),f.percent(h,u[0]),u.length===2&&f.alt("positionAlign",u[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":f.percent(h,a);break;case"align":f.alt(h,a,["start",D,"end","left","right"]);break}},/:/,/\s/),m.region=f.get("region",null),m.vertical=f.get("vertical","");var w=f.get("line","auto");w==="auto"&&P.line===-1&&(w=-1),m.line=w,m.lineAlign=f.get("lineAlign","start"),m.snapToLines=f.get("snapToLines",!0),m.size=f.get("size",100),m.align=f.get("align",D);var g=f.get("position","auto");g==="auto"&&P.position===50&&(g=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=g}function l(){C=C.replace(/^\s+/,"")}if(l(),A.startTime=s(),l(),C.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);C=C.substr(3),l(),A.endTime=s(),l(),d(C,A)}function b(C){return C.replace(/<br(?: \/)?>/gi,`
|
|
`)}var _=function(){function C(){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=C.prototype;return A.parse=function(c){var s=this;c&&(s.buffer+=s.decoder.decode(c,{stream:!0}));function d(){var g=s.buffer,h=0;for(g=b(g);h<g.length&&g[h]!=="\r"&&g[h]!==`
|
|
`;)++h;var a=g.substr(0,h);return g[h]==="\r"&&++h,g[h]===`
|
|
`&&++h,s.buffer=g.substr(h),a}function l(g){U(g,function(h,a){},/:/)}try{var S="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;S=d();var m=S.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var f=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;f?f=!1:S=d();switch(s.state){case"HEADER":/:/.test(S)?l(S):S||(s.state="ID");continue;case"NOTE":S||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){s.state="NOTE";break}if(!S)continue;if(s.cue=new G.default(0,0,""),s.state="CUE",S.indexOf("-->")===-1){s.cue.id=S;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{E(S,s.cue,s.regionList)}catch(g){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var w=S.indexOf("-->")!==-1;if(!S||w&&(f=!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(g){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},A.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
|
|
|
|
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){c.onparsingerror&&c.onparsingerror(s)}return c.onflush&&c.onflush(),this},C}()},"./src/utils/webvtt-parser.ts":function(re,V,R){"use strict";R.r(V),R.d(V,"generateCueId",function(){return _}),R.d(V,"parseWebVTT",function(){return A});var G=R("./src/polyfills/number.ts"),k=R("./src/utils/vttparser.ts"),O=R("./src/demux/id3.ts"),F=R("./src/utils/timescale-conversion.ts"),U=R("./src/remux/mp4-remuxer.ts"),P=/\r\n|\n\r|\n|\r/g,D=function(c,s,d){return d===void 0&&(d=0),c.substr(d,s.length)===s},E=function(c){var s=parseInt(c.substr(-3)),d=parseInt(c.substr(-6,2)),l=parseInt(c.substr(-9,2)),S=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(s)||!Object(G.isFiniteNumber)(d)||!Object(G.isFiniteNumber)(l)||!Object(G.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return s+=1e3*d,s+=60*1e3*l,s+=60*60*1e3*S,s},b=function(c){for(var s=5381,d=c.length;d;)s=s*33^c.charCodeAt(--d);return(s>>>0).toString()};function _(v,c,s){return b(v.toString())+b(c.toString())+b(s)}var C=function(c,s,d){var l=c[s],S=c[l.prevCC];if(!S||!S.new&&l.new){c.ccOffset=c.presentationOffset=l.start,l.new=!1;return}for(;(m=S)!==null&&m!==void 0&&m.new;){var m;c.ccOffset+=l.start-S.start,l.new=!1,l=S,S=c[l.prevCC]}c.presentationOffset=d};function A(v,c,s,d,l,S,m,f){var w=new k.VTTParser,g=Object(O.utf8ArrayToStr)(new Uint8Array(v)).trim().replace(P,`
|
|
`).split(`
|
|
`),h=[],a=Object(F.toMpegTsClockFromTimescale)(c,s),u="00:00.000",o=0,y=0,p,x=!0,M=!1;w.oncue=function(N){var j=d[l],W=d.ccOffset,L=(o-a)/9e4;if(j!=null&&j.new&&(y!==void 0?W=d.ccOffset=j.start:C(d,l,L)),L&&(W=L-d.presentationOffset),M){var I=N.endTime-N.startTime,K=Object(U.normalizePts)((N.startTime+W-y)*9e4,S*9e4)/9e4;N.startTime=K,N.endTime=K+I}var Y=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(Y)),N.id||(N.id=_(N.startTime,N.endTime,Y)),N.endTime>0&&h.push(N)},w.onparsingerror=function(N){p=N},w.onflush=function(){if(p){f(p);return}m(h)},g.forEach(function(N){if(x)if(D(N,"X-TIMESTAMP-MAP=")){x=!1,M=!0,N.substr(16).split(",").forEach(function(j){D(j,"LOCAL:")?u=j.substr(6):D(j,"MPEGTS:")&&(o=parseInt(j.substr(7)))});try{y=E(u)/1e3}catch(j){M=!1,p=j}return}else N===""&&(x=!1);w.parse(N+`
|
|
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(re,V,R){"use strict";R.r(V);var G=R("./src/utils/logger.ts"),k=R("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,F=function(){function U(D){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=D?D.xhrSetup:null,this.stats=new k.LoadStats,this.retryDelay=0}var P=U.prototype;return P.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},P.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()))},P.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},P.load=function(E,b,_){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=b,this.callbacks=_,this.retryDelay=b.retryDelay,this.loadInternal()},P.loadInternal=function(){var E=this.config,b=this.context;if(!E)return;var _=this.loader=new self.XMLHttpRequest,C=this.stats;C.loading.first=0,C.loaded=0;var A=this.xhrSetup;try{if(A)try{A(_,b.url)}catch(s){_.open("GET",b.url,!0),A(_,b.url)}_.readyState||_.open("GET",b.url,!0);var v=this.context.headers;if(v)for(var c in v)_.setRequestHeader(c,v[c])}catch(s){this.callbacks.onError({code:_.status,text:s.message},b,_);return}b.rangeEnd&&_.setRequestHeader("Range","bytes="+b.rangeStart+"-"+(b.rangeEnd-1)),_.onreadystatechange=this.readystatechange.bind(this),_.onprogress=this.loadprogress.bind(this),_.responseType=b.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),_.send()},P.readystatechange=function(){var E=this.context,b=this.loader,_=this.stats;if(!E||!b)return;var C=b.readyState,A=this.config;if(_.aborted)return;if(C>=2)if(self.clearTimeout(this.requestTimeout),_.loading.first===0&&(_.loading.first=Math.max(self.performance.now(),_.loading.start)),C===4){b.onreadystatechange=null,b.onprogress=null;var v=b.status;if(v>=200&&v<300){_.loading.end=Math.max(self.performance.now(),_.loading.first);var c,s;if(E.responseType==="arraybuffer"?(c=b.response,s=c.byteLength):(c=b.responseText,s=c.length),_.loaded=_.total=s,!this.callbacks)return;var d=this.callbacks.onProgress;if(d&&d(_,E,c,b),!this.callbacks)return;var l={url:b.responseURL,data:c};this.callbacks.onSuccess(l,_,E,b)}else _.retry>=A.maxRetry||v>=400&&v<499?(G.logger.error(v+" while loading "+E.url),this.callbacks.onError({code:v,text:b.statusText},E,b)):(G.logger.warn(v+" 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,A.maxRetryDelay),_.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout)},P.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},P.loadprogress=function(E){var b=this.stats;b.loaded=E.loaded,E.lengthComputable&&(b.total=E.total)},P.getCacheAge=function(){var E=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var b=this.loader.getResponseHeader("age");E=b?parseFloat(b):null}return E},U}();V.default=F}}).default})},vHTk:function(Fe,Le,z){Fe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(Fe,Le,z){"use strict";z.d(Le,"c",function(){return k}),z.d(Le,"b",function(){return O}),z.d(Le,"d",function(){return F}),z.d(Le,"a",function(){return P}),z.d(Le,"e",function(){return D});var re=z("9og8"),V=z("WmNS"),R=z.n(V),G=z("ErOA");function k(E){return Object(G.c)("libraries/".concat(E,".json"))}function O(){return Object(G.c)("library_tags.json")}function F(E){return U.apply(this,arguments)}function U(){return U=Object(re.a)(R.a.mark(function E(b){var _;return R.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,Object(G.b)("attachments/".concat(b,".json"));case 2:return _=A.sent,A.abrupt("return",_.status===0);case 4:case"end":return A.stop()}},E)})),U.apply(this,arguments)}function P(E){return Object(G.f)("libraries.json",E)}function D(E,b){return Object(G.g)("libraries/".concat(E,".json"),b)}},y5JW:function(Fe,Le,z){"use strict";z.d(Le,"c",function(){return v}),z.d(Le,"a",function(){return c});var re=z("DZo9"),V=z("8z0m"),R=z("+L6B"),G=z("2/Rp"),k=z("9og8"),O=z("miYZ"),F=z("tsqr"),U=z("k1fw"),P=z("oBTY"),D=z("WmNS"),E=z.n(D),b=z("cDcd"),_=z.n(b),C=z("m3rI"),A=z("wzkS"),v="\u3000\u3000";function c(s){var d=["Bytes","KB","MB","GB","TB"];if(s==0)return"0 Byte";var l=parseInt(""+Math.floor(Math.log(s)/Math.log(1024)),10);return(s/Math.pow(1024,l)).toFixed(1)+" "+d[l]}Le.b=function(s){var d=s.value,l=d===void 0?[]:d,S=s.action,m=s.onChange,f=s.className,w=s.maxSize,g=w===void 0?150:w,h=s.title,a=h===void 0?"\u6587\u4EF6\u4E0A\u4F20":h,u=s.accept,o=u===void 0?null:u,y={multiple:!1,fileList:l,accept:o,withCredentials:!0,beforeUpload:function(M){var N=M.size/1024/1024;return!0},action:"".concat(C.a.API_SERVER,"/api/attachments.json"),onChange:function(M){var N,j,W=Object(P.a)(M.fileList);if(W=W.map(function(K){return K.name.indexOf(v)===-1&&(K.name="".concat(K.name).concat(v).concat(c(K.size))),Object(U.a)({},K)}),M.file.status==="done"&&((N=M.file)===null||N===void 0||((j=N.response)===null||j===void 0)?void 0:j.status)===-1){var L,I;F.b.error((L=M.file)===null||L===void 0||((I=L.response)===null||I===void 0)?void 0:I.message),m([]);return}m(W)},onRemove:function(){var x=Object(k.a)(E.a.mark(function N(j){var W,L,I;return E.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:if(W=j.size/1024/1024,!(j.status==="uploading")){Y.next=3;break}return Y.abrupt("return",!0);case 3:if(W<g){Y.next=7;break}return Y.abrupt("return",!0);case 7:if(L=j.response?j.response.id:j.uid,!L){Y.next=15;break}return Y.next=11,Object(A.d)(j.response?j.response.id:j.id);case 11:return I=Y.sent,Y.abrupt("return",I);case 15:return Y.abrupt("return",!0);case 16:case"end":return Y.stop()}},N)}));function M(N){return x.apply(this,arguments)}return M}()};function p(x){x.preventDefault(),x.stopPropagation()}return _.a.createElement("div",{className:"single-upload ".concat(f||"")},_.a.createElement(V.a,y,_.a.createElement(G.a,{type:"primary",title:l.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:l.length>0,ghost:!0},a),_.a.createElement("span",{onClick:p,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",g,"M)"," ")))}},yslc:function(Fe,Le){Fe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4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