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.
NewEduCoderBuild/p__Shixuns__New__ImagePrevi...

447 lines
1.5 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[252,5,6,7,18],{"+NIl":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";V.defineMode("stex",function(L,I){"use strict";function k(n,t){n.cmdState.push(t)}function M(n){return n.cmdState.length>0?n.cmdState[n.cmdState.length-1]:null}function f(n){var t=n.cmdState.pop();t&&t.closeBracket()}function E(n){for(var t=n.cmdState,i=t.length-1;i>=0;i--){var s=t[i];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function x(n,t,i){return function(){this.name=n,this.bracketNo=0,this.style=t,this.styles=i,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var g={};g.importmodule=x("importmodule","tag",["string","builtin"]),g.documentclass=x("documentclass","tag",["","atom"]),g.usepackage=x("usepackage","tag",["atom"]),g.begin=x("begin","tag",["atom"]),g.end=x("end","tag",["atom"]),g.label=x("label","tag",["atom"]),g.ref=x("ref","tag",["atom"]),g.eqref=x("eqref","tag",["atom"]),g.cite=x("cite","tag",["atom"]),g.bibitem=x("bibitem","tag",["atom"]),g.Bibitem=x("Bibitem","tag",["atom"]),g.RBibitem=x("RBibitem","tag",["atom"]),g.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function h(n,t){n.f=t}function o(n,t){var i;if(n.match(/^\\[a-zA-Z@]+/)){var s=n.current().slice(1);return i=g.hasOwnProperty(s)?g[s]:g.DEFAULT,i=new i,k(t,i),h(t,r),i.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return h(t,function(c,d){return u(c,d,"\\]")}),"keyword";if(n.match("\\("))return h(t,function(c,d){return u(c,d,"\\)")}),"keyword";if(n.match("$$"))return h(t,function(c,d){return u(c,d,"$$")}),"keyword";if(n.match("$"))return h(t,function(c,d){return u(c,d,"$")}),"keyword";var l=n.next();if(l=="%")return n.skipToEnd(),"comment";if(l=="}"||l=="]"){if(i=M(t),i)i.closeBracket(l),h(t,r);else return"error";return"bracket"}else return l=="{"||l=="["?(i=g.DEFAULT,i=new i,k(t,i),"bracket"):/\d/.test(l)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),i=E(t),i.name=="begin"&&(i.argument=n.current()),i.styleIdentifier())}function u(n,t,i){if(n.eatSpace())return null;if(i&&n.match(i))return h(t,o),"keyword";if(n.match(/^\\[a-zA-Z@]+/))return"tag";if(n.match(/^[a-zA-Z]+/))return"variable-2";if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/]/))return"tag";if(n.match(/^[\^_&]/))return"tag";if(n.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(n.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=n.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(n.skipToEnd(),"comment"):"error"}function r(n,t){var i=n.peek(),s;return i=="{"||i=="["?(s=M(t),s.openBracket(i),n.eat(i),h(t,o),"bracket"):/[ \t\r]/.test(i)?(n.eat(i),null):(h(t,o),f(t),o(n,t))}return{startState:function(){var n=I.inMathMode?function(t,i){return u(t,i)}:o;return{cmdState:[],f:n}},copyState:function(n){return{cmdState:n.cmdState.slice(),f:n.f}},token:function(n,t){return t.f(n,t)},blankLine:function(n){n.f=o,n.cmdState.length=0},lineComment:"%"}}),V.defineMIME("text/x-stex","stex"),V.defineMIME("text/x-latex","stex")})},"+ua5":function(at,fe,oe){},"/POA":function(at,fe,oe){!function(V,L){if(!0)at.exports=L();else var I,k}(window,function(){return function(V){var L={};function I(k){if(L[k])return L[k].exports;var M=L[k]={i:k,l:!1,exports:{}};return V[k].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=V,I.c=L,I.d=function(k,M,f){I.o(k,M)||Object.defineProperty(k,M,{enumerable:!0,get:f})},I.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},I.t=function(k,M){if(1&M&&(k=I(k)),8&M)return k;if(4&M&&typeof k=="object"&&k&&k.__esModule)return k;var f=Object.create(null);if(I.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:k}),2&M&&typeof k!="string")for(var E in k)I.d(f,E,function(x){return k[x]}.bind(null,E));return f},I.n=function(k){var M=k&&k.__esModule?function(){return k.default}:function(){return k};return I.d(M,"a",M),M},I.o=function(k,M){return Object.prototype.hasOwnProperty.call(k,M)},I.p="",I(I.s=34)}([function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.forwardEvent=L.EventEmitter=void 0;var k=function(){function M(){this._listeners=[],this._disposed=!1}return Object.defineProperty(M.prototype,"event",{get:function(){var f=this;return this._event||(this._event=function(E){return f._listeners.push(E),{dispose:function(){if(!f._disposed){for(var x=0;x<f._listeners.length;x++)if(f._listeners[x]===E)return void f._listeners.splice(x,1)}}}}),this._event},enumerable:!1,configurable:!0}),M.prototype.fire=function(f,E){for(var x=[],g=0;g<this._listeners.length;g++)x.push(this._listeners[g]);for(g=0;g<x.length;g++)x[g].call(void 0,f,E)},M.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},M}();L.EventEmitter=k,L.forwardEvent=function(M,f){return M(function(E){return f.fire(E)})}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.IUnicodeService=L.IOptionsService=L.ILogService=L.IInstantiationService=L.IDirtyRowService=L.ICharsetService=L.ICoreService=L.ICoreMouseService=L.IBufferService=void 0;var k=I(14);L.IBufferService=k.createDecorator("BufferService"),L.ICoreMouseService=k.createDecorator("CoreMouseService"),L.ICoreService=k.createDecorator("CoreService"),L.ICharsetService=k.createDecorator("CharsetService"),L.IDirtyRowService=k.createDecorator("DirtyRowService"),L.IInstantiationService=k.createDecorator("InstantiationService"),L.ILogService=k.createDecorator("LogService"),L.IOptionsService=k.createDecorator("OptionsService"),L.IUnicodeService=k.createDecorator("UnicodeService")},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.getDisposeArrayDisposable=L.disposeArray=L.Disposable=void 0;var k=function(){function f(){this._disposables=[],this._isDisposed=!1}return f.prototype.dispose=function(){this._isDisposed=!0;for(var E=0,x=this._disposables;E<x.length;E++)x[E].dispose();this._disposables.length=0},f.prototype.register=function(E){return this._disposables.push(E),E},f.prototype.unregister=function(E){var x=this._disposables.indexOf(E);x!==-1&&this._disposables.splice(x,1)},f}();function M(f){for(var E=0,x=f;E<x.length;E++)x[E].dispose();f.length=0}L.Disposable=k,L.disposeArray=M,L.getDisposeArrayDisposable=function(f){return{dispose:function(){return M(f)}}}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.WHITESPACE_CELL_CODE=L.WHITESPACE_CELL_WIDTH=L.WHITESPACE_CELL_CHAR=L.NULL_CELL_CODE=L.NULL_CELL_WIDTH=L.NULL_CELL_CHAR=L.CHAR_DATA_CODE_INDEX=L.CHAR_DATA_WIDTH_INDEX=L.CHAR_DATA_CHAR_INDEX=L.CHAR_DATA_ATTR_INDEX=L.DEFAULT_ATTR=L.DEFAULT_COLOR=void 0,L.DEFAULT_COLOR=256,L.DEFAULT_ATTR=256|L.DEFAULT_COLOR<<9,L.CHAR_DATA_ATTR_INDEX=0,L.CHAR_DATA_CHAR_INDEX=1,L.CHAR_DATA_WIDTH_INDEX=2,L.CHAR_DATA_CODE_INDEX=3,L.NULL_CELL_CHAR="",L.NULL_CELL_WIDTH=1,L.NULL_CELL_CODE=0,L.WHITESPACE_CELL_CHAR=" ",L.WHITESPACE_CELL_WIDTH=1,L.WHITESPACE_CELL_CODE=32},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(h,o){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,r){u.__proto__=r}||function(u,r){for(var n in r)r.hasOwnProperty(n)&&(u[n]=r[n])})(h,o)},function(h,o){function u(){this.constructor=h}k(h,o),h.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)});Object.defineProperty(L,"__esModule",{value:!0}),L.CellData=void 0;var f=I(8),E=I(3),x=I(6),g=function(h){function o(){var u=h!==null&&h.apply(this,arguments)||this;return u.content=0,u.fg=0,u.bg=0,u.extended=new x.ExtendedAttrs,u.combinedData="",u}return M(o,h),o.fromCharData=function(u){var r=new o;return r.setFromCharData(u),r},o.prototype.isCombined=function(){return 2097152&this.content},o.prototype.getWidth=function(){return this.content>>22},o.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?f.stringFromCodePoint(2097151&this.content):""},o.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},o.prototype.setFromCharData=function(u){this.fg=u[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var r=!1;if(u[E.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(u[E.CHAR_DATA_CHAR_INDEX].length===2){var n=u[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){var t=u[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=t&&t<=57343?this.content=1024*(n-55296)+t-56320+65536|u[E.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=u[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[E.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=u[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|u[E.CHAR_DATA_WIDTH_INDEX]<<22)},o.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},o}(x.AttributeData);L.CellData=g},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ISoundService=L.ISelectionService=L.IRenderService=L.IMouseService=L.ICoreBrowserService=L.ICharSizeService=void 0;var k=I(14);L.ICharSizeService=k.createDecorator("CharSizeService"),L.ICoreBrowserService=k.createDecorator("CoreBrowserService"),L.IMouseService=k.createDecorator("MouseService"),L.IRenderService=k.createDecorator("RenderService"),L.ISelectionService=k.createDecorator("SelectionService"),L.ISoundService=k.createDecorator("SoundService")},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ExtendedAttrs=L.AttributeData=void 0;var k=function(){function f(){this.fg=0,this.bg=0,this.extended=new M}return f.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},f.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},f.prototype.clone=function(){var E=new f;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},f.prototype.isInverse=function(){return 67108864&this.fg},f.prototype.isBold=function(){return 134217728&this.fg},f.prototype.isUnderline=function(){return 268435456&this.fg},f.prototype.isBlink=function(){return 536870912&this.fg},f.prototype.isInvisible=function(){return 1073741824&this.fg},f.prototype.isItalic=function(){return 67108864&this.bg},f.prototype.isDim=function(){return 134217728&this.bg},f.prototype.getFgColorMode=function(){return 50331648&this.fg},f.prototype.getBgColorMode=function(){return 50331648&this.bg},f.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},f.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},f.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},f.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},f.prototype.isFgDefault=function(){return(50331648&this.fg)==0},f.prototype.isBgDefault=function(){return(50331648&this.bg)==0},f.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},f.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},f.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},f.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},f.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},f.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},f.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},f.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},f.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},f.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},f.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},f}();L.AttributeData=k;var M=function(){function f(E,x){E===void 0&&(E=0),x===void 0&&(x=-1),this.underlineStyle=E,this.underlineColor=x}return f.prototype.clone=function(){return new f(this.underlineStyle,this.underlineColor)},f.prototype.isEmpty=function(){return this.underlineStyle===0},f}();L.ExtendedAttrs=M},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.addDisposableDomListener=void 0,L.addDisposableDomListener=function(k,M,f,E){k.addEventListener(M,f,E);var x=!1;return{dispose:function(){x||(x=!0,k.removeEventListener(M,f,E))}}}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Utf8ToUtf32=L.StringToUtf32=L.utf32ToString=L.stringFromCodePoint=void 0,L.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},L.utf32ToString=function(f,E,x){E===void 0&&(E=0),x===void 0&&(x=f.length);for(var g="",h=E;h<x;++h){var o=f[h];o>65535?(o-=65536,g+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):g+=String.fromCharCode(o)}return g};var k=function(){function f(){this._interim=0}return f.prototype.clear=function(){this._interim=0},f.prototype.decode=function(E,x){var g=E.length;if(!g)return 0;var h=0,o=0;this._interim&&(56320<=(n=E.charCodeAt(o++))&&n<=57343?x[h++]=1024*(this._interim-55296)+n-56320+65536:(x[h++]=this._interim,x[h++]=n),this._interim=0);for(var u=o;u<g;++u){var r=E.charCodeAt(u);if(55296<=r&&r<=56319){if(++u>=g)return this._interim=r,h;var n;56320<=(n=E.charCodeAt(u))&&n<=57343?x[h++]=1024*(r-55296)+n-56320+65536:(x[h++]=r,x[h++]=n)}else x[h++]=r}return h},f}();L.StringToUtf32=k;var M=function(){function f(){this.interim=new Uint8Array(3)}return f.prototype.clear=function(){this.interim.fill(0)},f.prototype.decode=function(E,x){var g=E.length;if(!g)return 0;var h,o,u,r,n=0,t=0,i=0;if(this.interim[0]){var s=!1,l=this.interim[0];l&=(224&l)==192?31:(240&l)==224?15:7;for(var c=0,d=void 0;(d=63&this.interim[++c])&&c<4;)l<<=6,l|=d;for(var w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=w-c;i<m;){if(i>=g)return 0;if((192&(d=E[i++]))!=128){i--,s=!0;break}this.interim[c++]=d,l<<=6,l|=63&d}s||(w===2?l<128?i--:x[n++]=l:w===3?l<2048||l>=55296&&l<=57343||(x[n++]=l):l<65536||l>1114111||(x[n++]=l)),this.interim.fill(0)}for(var S=g-4,C=i;C<g;){for(;!(!(C<S)||128&(h=E[C])||128&(o=E[C+1])||128&(u=E[C+2])||128&(r=E[C+3]));)x[n++]=h,x[n++]=o,x[n++]=u,x[n++]=r,C+=4;if((h=E[C++])<128)x[n++]=h;else if((224&h)==192){if(C>=g)return this.interim[0]=h,n;if((192&(o=E[C++]))!=128){C--;continue}if((t=(31&h)<<6|63&o)<128){C--;continue}x[n++]=t}else if((240&h)==224){if(C>=g)return this.interim[0]=h,n;if((192&(o=E[C++]))!=128){C--;continue}if(C>=g)return this.interim[0]=h,this.interim[1]=o,n;if((192&(u=E[C++]))!=128){C--;continue}if((t=(15&h)<<12|(63&o)<<6|63&u)<2048||t>=55296&&t<=57343)continue;x[n++]=t}else if((248&h)==240){if(C>=g)return this.interim[0]=h,n;if((192&(o=E[C++]))!=128){C--;continue}if(C>=g)return this.interim[0]=h,this.interim[1]=o,n;if((192&(u=E[C++]))!=128){C--;continue}if(C>=g)return this.interim[0]=h,this.interim[1]=o,this.interim[2]=u,n;if((192&(r=E[C++]))!=128){C--;continue}if((t=(7&h)<<18|(63&o)<<12|(63&u)<<6|63&r)<65536||t>1114111)continue;x[n++]=t}}return n},f}();L.Utf8ToUtf32=M},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CHAR_ATLAS_CELL_SPACING=L.DIM_OPACITY=L.INVERTED_DEFAULT_COLOR=void 0,L.INVERTED_DEFAULT_COLOR=257,L.DIM_OPACITY=.5,L.CHAR_ATLAS_CELL_SPACING=1},function(V,L,I){"use strict";var k,M,f,E;function x(h){var o=h.toString(16);return o.length<2?"0"+o:o}function g(h,o){return h<o?(o+.05)/(h+.05):(h+.05)/(o+.05)}Object.defineProperty(L,"__esModule",{value:!0}),L.contrastRatio=L.toPaddedHex=L.rgba=L.rgb=L.css=L.color=L.channels=void 0,function(h){h.toCss=function(o,u,r,n){return n!==void 0?"#"+x(o)+x(u)+x(r)+x(n):"#"+x(o)+x(u)+x(r)},h.toRgba=function(o,u,r,n){return n===void 0&&(n=255),(o<<24|u<<16|r<<8|n)>>>0}}(k=L.channels||(L.channels={})),(M=L.color||(L.color={})).blend=function(h,o){var u=(255&o.rgba)/255;if(u===1)return{css:o.css,rgba:o.rgba};var r=o.rgba>>24&255,n=o.rgba>>16&255,t=o.rgba>>8&255,i=h.rgba>>24&255,s=h.rgba>>16&255,l=h.rgba>>8&255,c=i+Math.round((r-i)*u),d=s+Math.round((n-s)*u),w=l+Math.round((t-l)*u);return{css:k.toCss(c,d,w),rgba:k.toRgba(c,d,w)}},M.isOpaque=function(h){return(255&h.rgba)==255},M.ensureContrastRatio=function(h,o,u){var r=E.ensureContrastRatio(h.rgba,o.rgba,u);if(r)return E.toColor(r>>24&255,r>>16&255,r>>8&255)},M.opaque=function(h){var o=(255|h.rgba)>>>0,u=E.toChannels(o),r=u[0],n=u[1],t=u[2];return{css:k.toCss(r,n,t),rgba:o}},M.opacity=function(h,o){var u=Math.round(255*o),r=E.toChannels(h.rgba),n=r[0],t=r[1],i=r[2];return{css:k.toCss(n,t,i,u),rgba:k.toRgba(n,t,i,u)}},(L.css||(L.css={})).toColor=function(h){switch(h.length){case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(h){function o(u,r,n){var t=u/255,i=r/255,s=n/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}h.relativeLuminance=function(u){return o(u>>16&255,u>>8&255,255&u)},h.relativeLuminance2=o}(f=L.rgb||(L.rgb={})),function(h){function o(r,n,t){for(var i=r>>24&255,s=r>>16&255,l=r>>8&255,c=n>>24&255,d=n>>16&255,w=n>>8&255,m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));m<t&&(c>0||d>0||w>0);)c-=Math.max(0,Math.ceil(.1*c)),d-=Math.max(0,Math.ceil(.1*d)),w-=Math.max(0,Math.ceil(.1*w)),m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));return(c<<24|d<<16|w<<8|255)>>>0}function u(r,n,t){for(var i=r>>24&255,s=r>>16&255,l=r>>8&255,c=n>>24&255,d=n>>16&255,w=n>>8&255,m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));m<t&&(c<255||d<255||w<255);)c=Math.min(255,c+Math.ceil(.1*(255-c))),d=Math.min(255,d+Math.ceil(.1*(255-d))),w=Math.min(255,w+Math.ceil(.1*(255-w))),m=g(f.relativeLuminance2(c,w,d),f.relativeLuminance2(i,s,l));return(c<<24|d<<16|w<<8|255)>>>0}h.ensureContrastRatio=function(r,n,t){var i=f.relativeLuminance(r>>8),s=f.relativeLuminance(n>>8);if(g(i,s)<t)return s<i?o(r,n,t):u(r,n,t)},h.reduceLuminance=o,h.increaseLuminance=u,h.toChannels=function(r){return[r>>24&255,r>>16&255,r>>8&255,255&r]},h.toColor=function(r,n,t){return{css:k.toCss(r,n,t),rgba:k.toRgba(r,n,t)}}}(E=L.rgba||(L.rgba={})),L.toPaddedHex=x,L.contrastRatio=g},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.isLinux=L.isWindows=L.isIphone=L.isIpad=L.isMac=L.isSafari=L.isFirefox=void 0;var k=typeof navigator=="undefined",M=k?"node":navigator.userAgent,f=k?"node":navigator.platform;function E(x,g){return x.indexOf(g)>=0}L.isFirefox=!!~M.indexOf("Firefox"),L.isSafari=/^((?!chrome|android).)*safari/i.test(M),L.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],f),L.isIpad=f==="iPad",L.isIphone=f==="iPhone",L.isWindows=E(["Windows","Win16","Win32","WinCE"],f),L.isLinux=f.indexOf("Linux")>=0},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.C1=L.C0=void 0,function(k){k.NUL="\0",k.SOH="",k.STX="",k.ETX="",k.EOT="",k.ENQ="",k.ACK="",k.BEL="\x07",k.BS="\b",k.HT=" ",k.LF=`
`,k.VT="\v",k.FF="\f",k.CR="\r",k.SO="",k.SI="",k.DLE="",k.DC1="",k.DC2="",k.DC3="",k.DC4="",k.NAK="",k.SYN="",k.ETB="",k.CAN="",k.EM="",k.SUB="",k.ESC="",k.FS="",k.GS="",k.RS="",k.US="",k.SP=" ",k.DEL="\x7F"}(L.C0||(L.C0={})),function(k){k.PAD="\x80",k.HOP="\x81",k.BPH="\x82",k.NBH="\x83",k.IND="\x84",k.NEL="\x85",k.SSA="\x86",k.ESA="\x87",k.HTS="\x88",k.HTJ="\x89",k.VTS="\x8A",k.PLD="\x8B",k.PLU="\x8C",k.RI="\x8D",k.SS2="\x8E",k.SS3="\x8F",k.DCS="\x90",k.PU1="\x91",k.PU2="\x92",k.STS="\x93",k.CCH="\x94",k.MW="\x95",k.SPA="\x96",k.EPA="\x97",k.SOS="\x98",k.SGCI="\x99",k.SCI="\x9A",k.CSI="\x9B",k.ST="\x9C",k.OSC="\x9D",k.PM="\x9E",k.APC="\x9F"}(L.C1||(L.C1={}))},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BaseRenderLayer=void 0;var k=I(3),M=I(9),f=I(25),E=I(6),x=I(28),g=I(10),h=I(17),o=function(){function u(r,n,t,i,s,l,c,d){this._container=r,this._alpha=i,this._colors=s,this._rendererId=l,this._bufferService=c,this._optionsService=d,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+n+"-layer"),this._canvas.style.zIndex=t.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return u.prototype.dispose=function(){var r;h.removeElementFromParent(this._canvas),(r=this._charAtlas)===null||r===void 0||r.dispose()},u.prototype._initCanvas=function(){this._ctx=x.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},u.prototype.onOptionsChanged=function(){},u.prototype.onBlur=function(){},u.prototype.onFocus=function(){},u.prototype.onCursorMove=function(){},u.prototype.onGridChanged=function(r,n){},u.prototype.onSelectionChanged=function(r,n,t){t===void 0&&(t=!1)},u.prototype.setColors=function(r){this._refreshCharAtlas(r)},u.prototype._setTransparency=function(r){if(r!==this._alpha){var n=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},u.prototype._refreshCharAtlas=function(r){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=f.acquireCharAtlas(this._optionsService.options,this._rendererId,r,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},u.prototype.resize=function(r){this._scaledCellWidth=r.scaledCellWidth,this._scaledCellHeight=r.scaledCellHeight,this._scaledCharWidth=r.scaledCharWidth,this._scaledCharHeight=r.scaledCharHeight,this._scaledCharLeft=r.scaledCharLeft,this._scaledCharTop=r.scaledCharTop,this._canvas.width=r.scaledCanvasWidth,this._canvas.height=r.scaledCanvasHeight,this._canvas.style.width=r.canvasWidth+"px",this._canvas.style.height=r.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},u.prototype._fillCells=function(r,n,t,i){this._ctx.fillRect(r*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,i*this._scaledCellHeight)},u.prototype._fillBottomLineAtCells=function(r,n,t){t===void 0&&(t=1),this._ctx.fillRect(r*this._scaledCellWidth,(n+1)*this._scaledCellHeight-window.devicePixelRatio-1,t*this._scaledCellWidth,window.devicePixelRatio)},u.prototype._fillLeftLineAtCell=function(r,n,t){this._ctx.fillRect(r*this._scaledCellWidth,n*this._scaledCellHeight,window.devicePixelRatio*t,this._scaledCellHeight)},u.prototype._strokeRectAtCell=function(r,n,t,i){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(r*this._scaledCellWidth+window.devicePixelRatio/2,n*this._scaledCellHeight+window.devicePixelRatio/2,t*this._scaledCellWidth-window.devicePixelRatio,i*this._scaledCellHeight-window.devicePixelRatio)},u.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},u.prototype._clearCells=function(r,n,t,i){this._alpha?this._ctx.clearRect(r*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(r*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,i*this._scaledCellHeight))},u.prototype._fillCharTrueColor=function(r,n,t){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(t),this._ctx.fillText(r.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},u.prototype._drawChars=function(r,n,t){var i,s,l=this._getContrastColor(r);l||r.isFgRGB()||r.isBgRGB()?this._drawUncachedChars(r,n,t,l):(r.isInverse()?(i=r.isBgDefault()?M.INVERTED_DEFAULT_COLOR:r.getBgColor(),s=r.isFgDefault()?M.INVERTED_DEFAULT_COLOR:r.getFgColor()):(s=r.isBgDefault()?k.DEFAULT_COLOR:r.getBgColor(),i=r.isFgDefault()?k.DEFAULT_COLOR:r.getFgColor()),i+=this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&i<8?8:0,this._currentGlyphIdentifier.chars=r.getChars()||k.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=r.getCode()||k.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=i,this._currentGlyphIdentifier.bold=!!r.isBold(),this._currentGlyphIdentifier.dim=!!r.isDim(),this._currentGlyphIdentifier.italic=!!r.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(r,n,t))},u.prototype._drawUncachedChars=function(r,n,t,i){if(this._ctx.save(),this._ctx.font=this._getFont(!!r.isBold(),!!r.isItalic()),this._ctx.textBaseline="middle",r.isInverse())if(i)this._ctx.fillStyle=i.css;else if(r.isBgDefault())this._ctx.fillStyle=g.color.opaque(this._colors.background).css;else if(r.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(r.getBgColor()).join(",")+")";else{var s=r.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(i)this._ctx.fillStyle=i.css;else if(r.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(r.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(r.getFgColor()).join(",")+")";else{var l=r.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&l<8&&(l+=8),this._ctx.fillStyle=this._colors.ansi[l].css}this._clipRow(t),r.isDim()&&(this._ctx.globalAlpha=M.DIM_OPACITY),this._ctx.fillText(r.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},u.prototype._clipRow=function(r){this._ctx.beginPath(),this._ctx.rect(0,r*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},u.prototype._getFont=function(r,n){return(n?"italic":"")+" "+(r?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},u.prototype._getContrastColor=function(r){if(this._optionsService.options.minimumContrastRatio!==1){var n=this._colors.contrastCache.getColor(r.bg,r.fg);if(n!==void 0)return n||void 0;var t=r.getFgColor(),i=r.getFgColorMode(),s=r.getBgColor(),l=r.getBgColorMode(),c=!!r.isInverse(),d=!!r.isInverse();if(c){var w=t;t=s,s=w;var m=i;i=l,l=m}var S=this._resolveBackgroundRgba(l,s,c),C=this._resolveForegroundRgba(i,t,c,d),v=g.rgba.ensureContrastRatio(S,C,this._optionsService.options.minimumContrastRatio);if(v){var y={css:g.channels.toCss(v>>24&255,v>>16&255,v>>8&255),rgba:v};return this._colors.contrastCache.setColor(r.bg,r.fg,y),y}this._colors.contrastCache.setColor(r.bg,r.fg,null)}},u.prototype._resolveBackgroundRgba=function(r,n,t){switch(r){case 16777216:case 33554432:return this._colors.ansi[n].rgba;case 50331648:return n<<8;case 0:default:return t?this._colors.foreground.rgba:this._colors.background.rgba}},u.prototype._resolveForegroundRgba=function(r,n,t,i){switch(r){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&i&&n<8&&(n+=8),this._colors.ansi[n].rgba;case 50331648:return n<<8;case 0:default:return t?this._colors.background.rgba:this._colors.foreground.rgba}},u}();L.BaseRenderLayer=o},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.createDecorator=L.getServiceDependencies=L.serviceRegistry=void 0;function k(M,f,E){f.di$target===f?f.di$dependencies.push({id:M,index:E}):(f.di$dependencies=[{id:M,index:E}],f.di$target=f)}L.serviceRegistry=new Map,L.getServiceDependencies=function(M){return M.di$dependencies||[]},L.createDecorator=function(M){if(L.serviceRegistry.has(M))return L.serviceRegistry.get(M);var f=function(E,x,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");k(f,E,g)};return f.toString=function(){return M},L.serviceRegistry.set(M,f),f}},function(V,L,I){"use strict";function k(M,f,E,x){if(E===void 0&&(E=0),x===void 0&&(x=M.length),E>=M.length)return M;E=(M.length+E)%M.length,x=x>=M.length?M.length:(M.length+x)%M.length;for(var g=E;g<x;++g)M[g]=f;return M}Object.defineProperty(L,"__esModule",{value:!0}),L.concat=L.fillFallback=L.fill=void 0,L.fill=function(M,f,E,x){return M.fill?M.fill(f,E,x):k(M,f,E,x)},L.fillFallback=k,L.concat=function(M,f){var E=new M.constructor(M.length+f.length);return E.set(M),E.set(f,M.length),E}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BufferLine=L.DEFAULT_ATTR_DATA=void 0;var k=I(8),M=I(3),f=I(4),E=I(6);L.DEFAULT_ATTR_DATA=Object.freeze(new E.AttributeData);var x=function(){function g(h,o,u){u===void 0&&(u=!1),this.isWrapped=u,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);for(var r=o||f.CellData.fromCharData([0,M.NULL_CELL_CHAR,M.NULL_CELL_WIDTH,M.NULL_CELL_CODE]),n=0;n<h;++n)this.setCell(n,r);this.length=h}return g.prototype.get=function(h){var o=this._data[3*h+0],u=2097151&o;return[this._data[3*h+1],2097152&o?this._combined[h]:u?k.stringFromCodePoint(u):"",o>>22,2097152&o?this._combined[h].charCodeAt(this._combined[h].length-1):u]},g.prototype.set=function(h,o){this._data[3*h+1]=o[M.CHAR_DATA_ATTR_INDEX],o[M.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=o[1],this._data[3*h+0]=2097152|h|o[M.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=o[M.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[M.CHAR_DATA_WIDTH_INDEX]<<22},g.prototype.getWidth=function(h){return this._data[3*h+0]>>22},g.prototype.hasWidth=function(h){return 12582912&this._data[3*h+0]},g.prototype.getFg=function(h){return this._data[3*h+1]},g.prototype.getBg=function(h){return this._data[3*h+2]},g.prototype.hasContent=function(h){return 4194303&this._data[3*h+0]},g.prototype.getCodePoint=function(h){var o=this._data[3*h+0];return 2097152&o?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&o},g.prototype.isCombined=function(h){return 2097152&this._data[3*h+0]},g.prototype.getString=function(h){var o=this._data[3*h+0];return 2097152&o?this._combined[h]:2097151&o?k.stringFromCodePoint(2097151&o):""},g.prototype.loadCell=function(h,o){var u=3*h;return o.content=this._data[u+0],o.fg=this._data[u+1],o.bg=this._data[u+2],2097152&o.content&&(o.combinedData=this._combined[h]),268435456&o.bg&&(o.extended=this._extendedAttrs[h]),o},g.prototype.setCell=function(h,o){2097152&o.content&&(this._combined[h]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[h]=o.extended),this._data[3*h+0]=o.content,this._data[3*h+1]=o.fg,this._data[3*h+2]=o.bg},g.prototype.setCellFromCodePoint=function(h,o,u,r,n,t){268435456&n&&(this._extendedAttrs[h]=t),this._data[3*h+0]=o|u<<22,this._data[3*h+1]=r,this._data[3*h+2]=n},g.prototype.addCodepointToCell=function(h,o){var u=this._data[3*h+0];2097152&u?this._combined[h]+=k.stringFromCodePoint(o):(2097151&u?(this._combined[h]=k.stringFromCodePoint(2097151&u)+k.stringFromCodePoint(o),u&=-2097152,u|=2097152):u=o|1<<22,this._data[3*h+0]=u)},g.prototype.insertCells=function(h,o,u,r){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs),o<this.length-h){for(var n=new f.CellData,t=this.length-h-o-1;t>=0;--t)this.setCell(h+o+t,this.loadCell(h+t,n));for(t=0;t<o;++t)this.setCell(h+t,u)}else for(t=h;t<this.length;++t)this.setCell(t,u);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs)},g.prototype.deleteCells=function(h,o,u,r){if(h%=this.length,o<this.length-h){for(var n=new f.CellData,t=0;t<this.length-h-o;++t)this.setCell(h+t,this.loadCell(h+o+t,n));for(t=this.length-o;t<this.length;++t)this.setCell(t,u)}else for(t=h;t<this.length;++t)this.setCell(t,u);h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodePoint(h,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs)},g.prototype.replaceCells=function(h,o,u,r){for(h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new E.ExtendedAttrs);h<o&&h<this.length;)this.setCell(h++,u)},g.prototype.resize=function(h,o){if(h!==this.length){if(h>this.length){var u=new Uint32Array(3*h);this.length&&(3*h<this._data.length?u.set(this._data.subarray(0,3*h)):u.set(this._data)),this._data=u;for(var r=this.length;r<h;++r)this.setCell(r,o)}else if(h){(u=new Uint32Array(3*h)).set(this._data.subarray(0,3*h)),this._data=u;var n=Object.keys(this._combined);for(r=0;r<n.length;r++){var t=parseInt(n[r],10);t>=h&&delete this._combined[t]}}else this._data=new Uint32Array(0),this._combined={};this.length=h}},g.prototype.fill=function(h){this._combined={},this._extendedAttrs={};for(var o=0;o<this.length;++o)this.setCell(o,h)},g.prototype.copyFrom=function(h){for(var o in this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={},h._combined)this._combined[o]=h._combined[o];for(var o in this._extendedAttrs={},h._extendedAttrs)this._extendedAttrs[o]=h._extendedAttrs[o];this.isWrapped=h.isWrapped},g.prototype.clone=function(){var h=new g(0);for(var o in h._data=new Uint32Array(this._data),h.length=this.length,this._combined)h._combined[o]=this._combined[o];for(var o in this._extendedAttrs)h._extendedAttrs[o]=this._extendedAttrs[o];return h.isWrapped=this.isWrapped,h},g.prototype.getTrimmedLength=function(){for(var h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0},g.prototype.copyCellsFrom=function(h,o,u,r,n){var t=h._data;if(n)for(var i=r-1;i>=0;i--)for(var s=0;s<3;s++)this._data[3*(u+i)+s]=t[3*(o+i)+s];else for(i=0;i<r;i++)for(s=0;s<3;s++)this._data[3*(u+i)+s]=t[3*(o+i)+s];var l=Object.keys(h._combined);for(s=0;s<l.length;s++){var c=parseInt(l[s],10);c>=o&&(this._combined[c-o+u]=h._combined[c])}},g.prototype.translateToString=function(h,o,u){h===void 0&&(h=!1),o===void 0&&(o=0),u===void 0&&(u=this.length),h&&(u=Math.min(u,this.getTrimmedLength()));for(var r="";o<u;){var n=this._data[3*o+0],t=2097151&n;r+=2097152&n?this._combined[o]:t?k.stringFromCodePoint(t):M.WHITESPACE_CELL_CHAR,o+=n>>22||1}return r},g}();L.BufferLine=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.removeElementFromParent=void 0,L.removeElementFromParent=function(){for(var k,M=[],f=0;f<arguments.length;f++)M[f]=arguments[f];for(var E=0,x=M;E<x.length;E++){var g=x[E];(k=g==null?void 0:g.parentElement)===null||k===void 0||k.removeChild(g)}}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.tooMuchOutput=L.promptLabel=void 0,L.promptLabel="Terminal input",L.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(C,v){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var A in T)T.hasOwnProperty(A)&&(y[A]=T[A])})(C,v)},function(C,v){function y(){this.constructor=C}k(C,v),C.prototype=v===null?Object.create(v):(y.prototype=v.prototype,new y)});Object.defineProperty(L,"__esModule",{value:!0}),L.InputHandler=L.WindowsOptionsReportType=void 0;var f,E=I(12),x=I(20),g=I(39),h=I(2),o=I(15),u=I(8),r=I(16),n=I(0),t=I(3),i=I(4),s=I(6),l=I(22),c=I(24),d={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function w(C,v){if(C>24)return v.setWinLines||!1;switch(C){case 1:return!!v.restoreWin;case 2:return!!v.minimizeWin;case 3:return!!v.setWinPosition;case 4:return!!v.setWinSizePixels;case 5:return!!v.raiseWin;case 6:return!!v.lowerWin;case 7:return!!v.refreshWin;case 8:return!!v.setWinSizeChars;case 9:return!!v.maximizeWin;case 10:return!!v.fullscreenWin;case 11:return!!v.getWinState;case 13:return!!v.getWinPosition;case 14:return!!v.getWinSizePixels;case 15:return!!v.getScreenSizePixels;case 16:return!!v.getCellSizePixels;case 18:return!!v.getWinSizeChars;case 19:return!!v.getScreenSizeChars;case 20:return!!v.getIconTitle;case 21:return!!v.getWinTitle;case 22:return!!v.pushTitle;case 23:return!!v.popTitle;case 24:return!!v.setWinLines}return!1}!function(C){C[C.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",C[C.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(f=L.WindowsOptionsReportType||(L.WindowsOptionsReportType={}));var m=function(){function C(v,y,T,A){this._bufferService=v,this._coreService=y,this._logService=T,this._optionsService=A,this._data=new Uint32Array(0)}return C.prototype.hook=function(v){this._data=new Uint32Array(0)},C.prototype.put=function(v,y,T){this._data=o.concat(this._data,v.subarray(y,T))},C.prototype.unhook=function(v){if(v){var y=u.utf32ToString(this._data);switch(this._data=new Uint32Array(0),y){case'"q':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r0"q'+E.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(E.C0.ESC+'P1$r61;1"p'+E.C0.ESC+"\\");case"r":var T=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+T+E.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r0m"+E.C0.ESC+"\\");case" q":var A={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return A-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+A+" q"+E.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",y),this._coreService.triggerDataEvent(E.C0.ESC+"P0$r"+E.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},C}(),S=function(C){function v(y,T,A,p,D,O,P,j,K){K===void 0&&(K=new g.EscapeSequenceParser);var U=C.call(this)||this;U._bufferService=y,U._charsetService=T,U._coreService=A,U._dirtyRowService=p,U._logService=D,U._optionsService=O,U._coreMouseService=P,U._unicodeService=j,U._parser=K,U._parseBuffer=new Uint32Array(4096),U._stringDecoder=new u.StringToUtf32,U._utf8Decoder=new u.Utf8ToUtf32,U._workCell=new i.CellData,U._windowTitle="",U._iconName="",U._windowTitleStack=[],U._iconNameStack=[],U._curAttrData=r.DEFAULT_ATTR_DATA.clone(),U._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),U._onRequestBell=new n.EventEmitter,U._onRequestRefreshRows=new n.EventEmitter,U._onRequestReset=new n.EventEmitter,U._onRequestScroll=new n.EventEmitter,U._onRequestSyncScrollBar=new n.EventEmitter,U._onRequestWindowsOptionsReport=new n.EventEmitter,U._onA11yChar=new n.EventEmitter,U._onA11yTab=new n.EventEmitter,U._onCursorMove=new n.EventEmitter,U._onLineFeed=new n.EventEmitter,U._onScroll=new n.EventEmitter,U._onTitleChange=new n.EventEmitter,U.register(U._parser),U._parser.setCsiHandlerFallback(function(z,te){U._logService.debug("Unknown CSI code: ",{identifier:U._parser.identToString(z),params:te.toArray()})}),U._parser.setEscHandlerFallback(function(z){U._logService.debug("Unknown ESC code: ",{identifier:U._parser.identToString(z)})}),U._parser.setExecuteHandlerFallback(function(z){U._logService.debug("Unknown EXECUTE code: ",{code:z})}),U._parser.setOscHandlerFallback(function(z,te,ce){U._logService.debug("Unknown OSC code: ",{identifier:z,action:te,data:ce})}),U._parser.setDcsHandlerFallback(function(z,te,ce){te==="HOOK"&&(ce=ce.toArray()),U._logService.debug("Unknown DCS code: ",{identifier:U._parser.identToString(z),action:te,payload:ce})}),U._parser.setPrintHandler(function(z,te,ce){return U.print(z,te,ce)}),U._parser.setCsiHandler({final:"@"},function(z){return U.insertChars(z)}),U._parser.setCsiHandler({intermediates:" ",final:"@"},function(z){return U.scrollLeft(z)}),U._parser.setCsiHandler({final:"A"},function(z){return U.cursorUp(z)}),U._parser.setCsiHandler({intermediates:" ",final:"A"},function(z){return U.scrollRight(z)}),U._parser.setCsiHandler({final:"B"},function(z){return U.cursorDown(z)}),U._parser.setCsiHandler({final:"C"},function(z){return U.cursorForward(z)}),U._parser.setCsiHandler({final:"D"},function(z){return U.cursorBackward(z)}),U._parser.setCsiHandler({final:"E"},function(z){return U.cursorNextLine(z)}),U._parser.setCsiHandler({final:"F"},function(z){return U.cursorPrecedingLine(z)}),U._parser.setCsiHandler({final:"G"},function(z){return U.cursorCharAbsolute(z)}),U._parser.setCsiHandler({final:"H"},function(z){return U.cursorPosition(z)}),U._parser.setCsiHandler({final:"I"},function(z){return U.cursorForwardTab(z)}),U._parser.setCsiHandler({final:"J"},function(z){return U.eraseInDisplay(z)}),U._parser.setCsiHandler({prefix:"?",final:"J"},function(z){return U.eraseInDisplay(z)}),U._parser.setCsiHandler({final:"K"},function(z){return U.eraseInLine(z)}),U._parser.setCsiHandler({prefix:"?",final:"K"},function(z){return U.eraseInLine(z)}),U._parser.setCsiHandler({final:"L"},function(z){return U.insertLines(z)}),U._parser.setCsiHandler({final:"M"},function(z){return U.deleteLines(z)}),U._parser.setCsiHandler({final:"P"},function(z){return U.deleteChars(z)}),U._parser.setCsiHandler({final:"S"},function(z){return U.scrollUp(z)}),U._parser.setCsiHandler({final:"T"},function(z){return U.scrollDown(z)}),U._parser.setCsiHandler({final:"X"},function(z){return U.eraseChars(z)}),U._parser.setCsiHandler({final:"Z"},function(z){return U.cursorBackwardTab(z)}),U._parser.setCsiHandler({final:"`"},function(z){return U.charPosAbsolute(z)}),U._parser.setCsiHandler({final:"a"},function(z){return U.hPositionRelative(z)}),U._parser.setCsiHandler({final:"b"},function(z){return U.repeatPrecedingCharacter(z)}),U._parser.setCsiHandler({final:"c"},function(z){return U.sendDeviceAttributesPrimary(z)}),U._parser.setCsiHandler({prefix:">",final:"c"},function(z){return U.sendDeviceAttributesSecondary(z)}),U._parser.setCsiHandler({final:"d"},function(z){return U.linePosAbsolute(z)}),U._parser.setCsiHandler({final:"e"},function(z){return U.vPositionRelative(z)}),U._parser.setCsiHandler({final:"f"},function(z){return U.hVPosition(z)}),U._parser.setCsiHandler({final:"g"},function(z){return U.tabClear(z)}),U._parser.setCsiHandler({final:"h"},function(z){return U.setMode(z)}),U._parser.setCsiHandler({prefix:"?",final:"h"},function(z){return U.setModePrivate(z)}),U._parser.setCsiHandler({final:"l"},function(z){return U.resetMode(z)}),U._parser.setCsiHandler({prefix:"?",final:"l"},function(z){return U.resetModePrivate(z)}),U._parser.setCsiHandler({final:"m"},function(z){return U.charAttributes(z)}),U._parser.setCsiHandler({final:"n"},function(z){return U.deviceStatus(z)}),U._parser.setCsiHandler({prefix:"?",final:"n"},function(z){return U.deviceStatusPrivate(z)}),U._parser.setCsiHandler({intermediates:"!",final:"p"},function(z){return U.softReset(z)}),U._parser.setCsiHandler({intermediates:" ",final:"q"},function(z){return U.setCursorStyle(z)}),U._parser.setCsiHandler({final:"r"},function(z){return U.setScrollRegion(z)}),U._parser.setCsiHandler({final:"s"},function(z){return U.saveCursor(z)}),U._parser.setCsiHandler({final:"t"},function(z){return U.windowOptions(z)}),U._parser.setCsiHandler({final:"u"},function(z){return U.restoreCursor(z)}),U._parser.setCsiHandler({intermediates:"'",final:"}"},function(z){return U.insertColumns(z)}),U._parser.setCsiHandler({intermediates:"'",final:"~"},function(z){return U.deleteColumns(z)}),U._parser.setExecuteHandler(E.C0.BEL,function(){return U.bell()}),U._parser.setExecuteHandler(E.C0.LF,function(){return U.lineFeed()}),U._parser.setExecuteHandler(E.C0.VT,function(){return U.lineFeed()}),U._parser.setExecuteHandler(E.C0.FF,function(){return U.lineFeed()}),U._parser.setExecuteHandler(E.C0.CR,function(){return U.carriageReturn()}),U._parser.setExecuteHandler(E.C0.BS,function(){return U.backspace()}),U._parser.setExecuteHandler(E.C0.HT,function(){return U.tab()}),U._parser.setExecuteHandler(E.C0.SO,function(){return U.shiftOut()}),U._parser.setExecuteHandler(E.C0.SI,function(){return U.shiftIn()}),U._parser.setExecuteHandler(E.C1.IND,function(){return U.index()}),U._parser.setExecuteHandler(E.C1.NEL,function(){return U.nextLine()}),U._parser.setExecuteHandler(E.C1.HTS,function(){return U.tabSet()}),U._parser.setOscHandler(0,new l.OscHandler(function(z){U.setTitle(z),U.setIconName(z)})),U._parser.setOscHandler(1,new l.OscHandler(function(z){return U.setIconName(z)})),U._parser.setOscHandler(2,new l.OscHandler(function(z){return U.setTitle(z)})),U._parser.setEscHandler({final:"7"},function(){return U.saveCursor()}),U._parser.setEscHandler({final:"8"},function(){return U.restoreCursor()}),U._parser.setEscHandler({final:"D"},function(){return U.index()}),U._parser.setEscHandler({final:"E"},function(){return U.nextLine()}),U._parser.setEscHandler({final:"H"},function(){return U.tabSet()}),U._parser.setEscHandler({final:"M"},function(){return U.reverseIndex()}),U._parser.setEscHandler({final:"="},function(){return U.keypadApplicationMode()}),U._parser.setEscHandler({final:">"},function(){return U.keypadNumericMode()}),U._parser.setEscHandler({final:"c"},function(){return U.fullReset()}),U._parser.setEscHandler({final:"n"},function(){return U.setgLevel(2)}),U._parser.setEscHandler({final:"o"},function(){return U.setgLevel(3)}),U._parser.setEscHandler({final:"|"},function(){return U.setgLevel(3)}),U._parser.setEscHandler({final:"}"},function(){return U.setgLevel(2)}),U._parser.setEscHandler({final:"~"},function(){return U.setgLevel(1)}),U._parser.setEscHandler({intermediates:"%",final:"@"},function(){return U.selectDefaultCharset()}),U._parser.setEscHandler({intermediates:"%",final:"G"},function(){return U.selectDefaultCharset()});var X=function(z){B._parser.setEscHandler({intermediates:"(",final:z},function(){return U.selectCharset("("+z)}),B._parser.setEscHandler({intermediates:")",final:z},function(){return U.selectCharset(")"+z)}),B._parser.setEscHandler({intermediates:"*",final:z},function(){return U.selectCharset("*"+z)}),B._parser.setEscHandler({intermediates:"+",final:z},function(){return U.selectCharset("+"+z)}),B._parser.setEscHandler({intermediates:"-",final:z},function(){return U.selectCharset("-"+z)}),B._parser.setEscHandler({intermediates:".",final:z},function(){return U.selectCharset("."+z)}),B._parser.setEscHandler({intermediates:"/",final:z},function(){return U.selectCharset("/"+z)})},B=this;for(var N in x.CHARSETS)X(N);return U._parser.setEscHandler({intermediates:"#",final:"8"},function(){return U.screenAlignmentPattern()}),U._parser.setErrorHandler(function(z){return U._logService.error("Parsing error: ",z),z}),U._parser.setDcsHandler({intermediates:"$",final:"q"},new m(U._bufferService,U._coreService,U._logService,U._optionsService)),U}return M(v,C),Object.defineProperty(v.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){C.prototype.dispose.call(this)},v.prototype.parse=function(y){var T=this._bufferService.buffer,A=T.x,p=T.y;if(this._logService.debug("parsing data",y),this._parseBuffer.length<y.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(y.length,131072))),this._dirtyRowService.clearRange(),y.length>131072)for(var D=0;D<y.length;D+=131072){var O=D+131072<y.length?D+131072:y.length,P=typeof y=="string"?this._stringDecoder.decode(y.substring(D,O),this._parseBuffer):this._utf8Decoder.decode(y.subarray(D,O),this._parseBuffer);this._parser.parse(this._parseBuffer,P)}else P=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer),this._parser.parse(this._parseBuffer,P);(T=this._bufferService.buffer).x===A&&T.y===p||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},v.prototype.print=function(y,T,A){var p,D,O=this._bufferService.buffer,P=this._charsetService.charset,j=this._optionsService.options.screenReaderMode,K=this._bufferService.cols,U=this._coreService.decPrivateModes.wraparound,X=this._coreService.modes.insertMode,B=this._curAttrData,N=O.lines.get(O.ybase+O.y);this._dirtyRowService.markDirty(O.y),O.x&&A-T>0&&N.getWidth(O.x-1)===2&&N.setCellFromCodePoint(O.x-1,0,1,B.fg,B.bg,B.extended);for(var z=T;z<A;++z){if(p=y[z],D=this._unicodeService.wcwidth(p),p<127&&P){var te=P[String.fromCharCode(p)];te&&(p=te.charCodeAt(0))}if(j&&this._onA11yChar.fire(u.stringFromCodePoint(p)),D||!O.x){if(O.x+D-1>=K){if(U){for(;O.x<K;)N.setCellFromCodePoint(O.x++,0,1,B.fg,B.bg,B.extended);O.x=0,O.y++,O.y===O.scrollBottom+1?(O.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(O.y>=this._bufferService.rows&&(O.y=this._bufferService.rows-1),O.lines.get(O.ybase+O.y).isWrapped=!0),N=O.lines.get(O.ybase+O.y)}else if(O.x=K-1,D===2)continue}if(X&&(N.insertCells(O.x,D,O.getNullCell(B),B),N.getWidth(K-1)===2&&N.setCellFromCodePoint(K-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,B.fg,B.bg,B.extended)),N.setCellFromCodePoint(O.x++,p,D,B.fg,B.bg,B.extended),D>0)for(;--D;)N.setCellFromCodePoint(O.x++,0,0,B.fg,B.bg,B.extended)}else N.getWidth(O.x-1)?N.addCodepointToCell(O.x-1,p):N.addCodepointToCell(O.x-2,p)}A-T>0&&(N.loadCell(O.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),O.x<K&&A-T>0&&N.getWidth(O.x)===0&&!N.hasContent(O.x)&&N.setCellFromCodePoint(O.x,0,1,B.fg,B.bg,B.extended),this._dirtyRowService.markDirty(O.y)},v.prototype.addCsiHandler=function(y,T){var A=this;return y.final!=="t"||y.prefix||y.intermediates?this._parser.addCsiHandler(y,T):this._parser.addCsiHandler(y,function(p){return!w(p.params[0],A._optionsService.options.windowOptions)||T(p)})},v.prototype.addDcsHandler=function(y,T){return this._parser.addDcsHandler(y,new c.DcsHandler(T))},v.prototype.addEscHandler=function(y,T){return this._parser.addEscHandler(y,T)},v.prototype.addOscHandler=function(y,T){return this._parser.addOscHandler(y,new l.OscHandler(T))},v.prototype.bell=function(){this._onRequestBell.fire()},v.prototype.lineFeed=function(){var y=this._bufferService.buffer;this._dirtyRowService.markDirty(y.y),this._optionsService.options.convertEol&&(y.x=0),y.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),y.x>=this._bufferService.cols&&y.x--,this._dirtyRowService.markDirty(y.y),this._onLineFeed.fire()},v.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},v.prototype.backspace=function(){var y,T=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(T.x>0&&T.x--);if(this._restrictCursor(this._bufferService.cols),T.x>0)T.x--;else if(T.x===0&&T.y>T.scrollTop&&T.y<=T.scrollBottom&&((y=T.lines.get(T.ybase+T.y))===null||y===void 0?void 0:y.isWrapped)){T.lines.get(T.ybase+T.y).isWrapped=!1,T.y--,T.x=this._bufferService.cols-1;var A=T.lines.get(T.ybase+T.y);A.hasWidth(T.x)&&!A.hasContent(T.x)&&T.x--}this._restrictCursor()},v.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var y=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-y)}},v.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},v.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},v.prototype._restrictCursor=function(y){y===void 0&&(y=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(y,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},v.prototype._setCursor=function(y,T){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=y,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+T):(this._bufferService.buffer.x=y,this._bufferService.buffer.y=T),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},v.prototype._moveCursor=function(y,T){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+y,this._bufferService.buffer.y+T)},v.prototype.cursorUp=function(y){var T=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;T>=0?this._moveCursor(0,-Math.min(T,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1))},v.prototype.cursorDown=function(y){var T=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;T>=0?this._moveCursor(0,Math.min(T,y.params[0]||1)):this._moveCursor(0,y.params[0]||1)},v.prototype.cursorForward=function(y){this._moveCursor(y.params[0]||1,0)},v.prototype.cursorBackward=function(y){this._moveCursor(-(y.params[0]||1),0)},v.prototype.cursorNextLine=function(y){this.cursorDown(y),this._bufferService.buffer.x=0},v.prototype.cursorPrecedingLine=function(y){this.cursorUp(y),this._bufferService.buffer.x=0},v.prototype.cursorCharAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},v.prototype.cursorPosition=function(y){this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1)},v.prototype.charPosAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},v.prototype.hPositionRelative=function(y){this._moveCursor(y.params[0]||1,0)},v.prototype.linePosAbsolute=function(y){this._setCursor(this._bufferService.buffer.x,(y.params[0]||1)-1)},v.prototype.vPositionRelative=function(y){this._moveCursor(0,y.params[0]||1)},v.prototype.hVPosition=function(y){this.cursorPosition(y)},v.prototype.tabClear=function(y){var T=y.params[0];T===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:T===3&&(this._bufferService.buffer.tabs={})},v.prototype.cursorForwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1;T--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},v.prototype.cursorBackwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var T=y.params[0]||1,A=this._bufferService.buffer;T--;)A.x=A.prevStop()},v.prototype._eraseInBufferLine=function(y,T,A,p){p===void 0&&(p=!1);var D=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);D.replaceCells(T,A,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),p&&(D.isWrapped=!1)},v.prototype._resetBufferLine=function(y){var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);T.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),T.isWrapped=!1},v.prototype.eraseInDisplay=function(y){var T;switch(this._restrictCursor(),y.params[0]){case 0:for(T=this._bufferService.buffer.y,this._dirtyRowService.markDirty(T),this._eraseInBufferLine(T++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);T<this._bufferService.rows;T++)this._resetBufferLine(T);this._dirtyRowService.markDirty(T);break;case 1:for(T=this._bufferService.buffer.y,this._dirtyRowService.markDirty(T),this._eraseInBufferLine(T,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T);this._dirtyRowService.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowService.markDirty(T-1);T--;)this._resetBufferLine(T);this._dirtyRowService.markDirty(0);break;case 3:var A=this._bufferService.buffer.lines.length-this._bufferService.rows;A>0&&(this._bufferService.buffer.lines.trimStart(A),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-A,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-A,0),this._onScroll.fire(0))}},v.prototype.eraseInLine=function(y){switch(this._restrictCursor(),y.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},v.prototype.insertLines=function(y){this._restrictCursor();var T=y.params[0]||1,A=this._bufferService.buffer;if(!(A.y>A.scrollBottom||A.y<A.scrollTop)){for(var p=A.ybase+A.y,D=this._bufferService.rows-1-A.scrollBottom,O=this._bufferService.rows-1+A.ybase-D+1;T--;)A.lines.splice(O-1,1),A.lines.splice(p,0,A.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(A.y,A.scrollBottom),A.x=0}},v.prototype.deleteLines=function(y){this._restrictCursor();var T=y.params[0]||1,A=this._bufferService.buffer;if(!(A.y>A.scrollBottom||A.y<A.scrollTop)){var p,D=A.ybase+A.y;for(p=this._bufferService.rows-1-A.scrollBottom,p=this._bufferService.rows-1+A.ybase-p;T--;)A.lines.splice(D,1),A.lines.splice(p,0,A.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(A.y,A.scrollBottom),A.x=0}},v.prototype.insertChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.insertCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},v.prototype.deleteChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.deleteCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},v.prototype.scrollUp=function(y){for(var T=y.params[0]||1,A=this._bufferService.buffer;T--;)A.lines.splice(A.ybase+A.scrollTop,1),A.lines.splice(A.ybase+A.scrollBottom,0,A.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(A.scrollTop,A.scrollBottom)},v.prototype.scrollDown=function(y){for(var T=y.params[0]||1,A=this._bufferService.buffer;T--;)A.lines.splice(A.ybase+A.scrollBottom,1),A.lines.splice(A.ybase+A.scrollTop,0,A.getBlankLine(r.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(A.scrollTop,A.scrollBottom)},v.prototype.scrollLeft=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var A=y.params[0]||1,p=T.scrollTop;p<=T.scrollBottom;++p){var D=T.lines.get(T.ybase+p);D.deleteCells(0,A,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},v.prototype.scrollRight=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var A=y.params[0]||1,p=T.scrollTop;p<=T.scrollBottom;++p){var D=T.lines.get(T.ybase+p);D.insertCells(0,A,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},v.prototype.insertColumns=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var A=y.params[0]||1,p=T.scrollTop;p<=T.scrollBottom;++p){var D=this._bufferService.buffer.lines.get(T.ybase+p);D.insertCells(T.x,A,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},v.prototype.deleteColumns=function(y){var T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var A=y.params[0]||1,p=T.scrollTop;p<=T.scrollBottom;++p){var D=T.lines.get(T.ybase+p);D.deleteCells(T.x,A,T.getNullCell(this._eraseAttrData()),this._eraseAttrData()),D.isWrapped=!1}this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)}},v.prototype.eraseChars=function(y){this._restrictCursor();var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);T&&(T.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(y.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},v.prototype.repeatPrecedingCharacter=function(y){if(this._parser.precedingCodepoint){for(var T=y.params[0]||1,A=new Uint32Array(T),p=0;p<T;++p)A[p]=this._parser.precedingCodepoint;this.print(A,0,A.length)}},v.prototype.sendDeviceAttributesPrimary=function(y){y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(E.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(E.C0.ESC+"[?6c"))},v.prototype.sendDeviceAttributesSecondary=function(y){y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(E.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(E.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.C0.ESC+"[>83;40003;0c"))},v.prototype._is=function(y){return(this._optionsService.options.termName+"").indexOf(y)===0},v.prototype.setMode=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 4:this._coreService.modes.insertMode=!0}},v.prototype.setModePrivate=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},v.prototype.resetMode=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 4:this._coreService.modes.insertMode=!1}},v.prototype.resetModePrivate=function(y){for(var T=0;T<y.length;T++)switch(y.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),y.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},v.prototype._updateAttrColor=function(y,T,A,p,D){return T===2?(y|=50331648,y&=-16777216,y|=s.AttributeData.fromColorRGB([A,p,D])):T===5&&(y&=-50331904,y|=33554432|255&A),y},v.prototype._extractColor=function(y,T,A){var p=[0,0,-1,0,0,0],D=0,O=0;do{if(p[O+D]=y.params[T+O],y.hasSubParams(T+O)){var P=y.getSubParams(T+O),j=0;do p[1]===5&&(D=1),p[O+j+1+D]=P[j];while(++j<P.length&&j+O+1+D<p.length);break}if(p[1]===5&&O+D>=2||p[1]===2&&O+D>=5)break;p[1]&&(D=1)}while(++O+T<y.length&&O+D<p.length);for(j=2;j<p.length;++j)p[j]===-1&&(p[j]=0);switch(p[0]){case 38:A.fg=this._updateAttrColor(A.fg,p[1],p[3],p[4],p[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,p[1],p[3],p[4],p[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,p[1],p[3],p[4],p[5])}return O},v.prototype._processUnderline=function(y,T){T.extended=T.extended.clone(),(!~y||y>5)&&(y=1),T.extended.underlineStyle=y,T.fg|=268435456,y===0&&(T.fg&=-268435457),T.updateExtended()},v.prototype.charAttributes=function(y){if(y.length===1&&y.params[0]===0)return this._curAttrData.fg=r.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=r.DEFAULT_ATTR_DATA.bg);for(var T,A=y.length,p=this._curAttrData,D=0;D<A;D++)(T=y.params[D])>=30&&T<=37?(p.fg&=-50331904,p.fg|=16777216|T-30):T>=40&&T<=47?(p.bg&=-50331904,p.bg|=16777216|T-40):T>=90&&T<=97?(p.fg&=-50331904,p.fg|=16777224|T-90):T>=100&&T<=107?(p.bg&=-50331904,p.bg|=16777224|T-100):T===0?(p.fg=r.DEFAULT_ATTR_DATA.fg,p.bg=r.DEFAULT_ATTR_DATA.bg):T===1?p.fg|=134217728:T===3?p.bg|=67108864:T===4?(p.fg|=268435456,this._processUnderline(y.hasSubParams(D)?y.getSubParams(D)[0]:1,p)):T===5?p.fg|=536870912:T===7?p.fg|=67108864:T===8?p.fg|=1073741824:T===2?p.bg|=134217728:T===21?this._processUnderline(2,p):T===22?(p.fg&=-134217729,p.bg&=-134217729):T===23?p.bg&=-67108865:T===24?p.fg&=-268435457:T===25?p.fg&=-536870913:T===27?p.fg&=-67108865:T===28?p.fg&=-1073741825:T===39?(p.fg&=-67108864,p.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):T===49?(p.bg&=-67108864,p.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?D+=this._extractColor(y,D,p):T===59?(p.extended=p.extended.clone(),p.extended.underlineColor=-1,p.updateExtended()):T===100?(p.fg&=-67108864,p.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,p.bg&=-67108864,p.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T)},v.prototype.deviceStatus=function(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(E.C0.ESC+"[0n");break;case 6:var T=this._bufferService.buffer.y+1,A=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+T+";"+A+"R")}},v.prototype.deviceStatusPrivate=function(y){switch(y.params[0]){case 6:var T=this._bufferService.buffer.y+1,A=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+T+";"+A+"R")}},v.prototype.softReset=function(y){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},v.prototype.setCursorStyle=function(y){var T=y.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var A=T%2==1;this._optionsService.options.cursorBlink=A},v.prototype.setScrollRegion=function(y){var T,A=y.params[0]||1;(y.length<2||(T=y.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>A&&(this._bufferService.buffer.scrollTop=A-1,this._bufferService.buffer.scrollBottom=T-1,this._setCursor(0,0))},v.prototype.windowOptions=function(y){if(w(y.params[0],this._optionsService.options.windowOptions)){var T=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(f.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(f.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(E.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},v.prototype.saveCursor=function(y){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},v.prototype.restoreCursor=function(y){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},v.prototype.setTitle=function(y){this._windowTitle=y,this._onTitleChange.fire(y)},v.prototype.setIconName=function(y){this._iconName=y},v.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},v.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},v.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},v.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,x.DEFAULT_CHARSET)},v.prototype.selectCharset=function(y){y.length===2?y[0]!=="/"&&this._charsetService.setgCharset(d[y[0]],x.CHARSETS[y[1]]||x.DEFAULT_CHARSET):this.selectDefaultCharset()},v.prototype.index=function(){this._restrictCursor();var y=this._bufferService.buffer;this._bufferService.buffer.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),this._restrictCursor()},v.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},v.prototype.reverseIndex=function(){this._restrictCursor();var y=this._bufferService.buffer;if(y.y===y.scrollTop){var T=y.scrollBottom-y.scrollTop;y.lines.shiftElements(y.ybase+y.y,T,1),y.lines.set(y.ybase+y.y,y.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(y.scrollTop,y.scrollBottom)}else y.y--,this._restrictCursor()},v.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},v.prototype.reset=function(){this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()},v.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},v.prototype.setgLevel=function(y){this._charsetService.setgLevel(y)},v.prototype.screenAlignmentPattern=function(){var y=new i.CellData;y.content=1<<22|"E".charCodeAt(0),y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg;var T=this._bufferService.buffer;this._setCursor(0,0);for(var A=0;A<this._bufferService.rows;++A){var p=T.ybase+T.y+A,D=T.lines.get(p);D&&(D.fill(y),D.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},v}(h.Disposable);L.InputHandler=S},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DEFAULT_CHARSET=L.CHARSETS=void 0,L.CHARSETS={},L.DEFAULT_CHARSET=L.CHARSETS.B,L.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},L.CHARSETS.A={"#":"\xA3"},L.CHARSETS.B=void 0,L.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},L.CHARSETS.C=L.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},L.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},L.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},L.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},L.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},L.CHARSETS.E=L.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},L.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},L.CHARSETS.H=L.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},L.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Params=void 0;var k=function(){function M(f,E){if(f===void 0&&(f=32),E===void 0&&(E=32),this.maxLength=f,this.maxSubParamsLength=E,E>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return M.fromArray=function(f){var E=new M;if(!f.length)return E;for(var x=f[0]instanceof Array?1:0;x<f.length;++x){var g=f[x];if(g instanceof Array)for(var h=0;h<g.length;++h)E.addSubParam(g[h]);else E.addParam(g)}return E},M.prototype.clone=function(){var f=new M(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f},M.prototype.toArray=function(){for(var f=[],E=0;E<this.length;++E){f.push(this.params[E]);var x=this._subParamsIdx[E]>>8,g=255&this._subParamsIdx[E];g-x>0&&f.push(Array.prototype.slice.call(this._subParams,x,g))}return f},M.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},M.prototype.addParam=function(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>2147483647?2147483647:f}},M.prototype.addSubParam=function(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>2147483647?2147483647:f,this._subParamsIdx[this.length-1]++}},M.prototype.hasSubParams=function(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0},M.prototype.getSubParams=function(f){var E=this._subParamsIdx[f]>>8,x=255&this._subParamsIdx[f];return x-E>0?this._subParams.subarray(E,x):null},M.prototype.getSubParamsAll=function(){for(var f={},E=0;E<this.length;++E){var x=this._subParamsIdx[E]>>8,g=255&this._subParamsIdx[E];g-x>0&&(f[E]=this._subParams.slice(x,g))}return f},M.prototype.addDigit=function(f){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var x=this._digitIsSub?this._subParams:this.params,g=x[E-1];x[E-1]=~g?Math.min(10*g+f,2147483647):f}},M}();L.Params=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.OscHandler=L.OscParser=void 0;var k=I(23),M=I(8),f=function(){function x(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return x.prototype.addHandler=function(g,h){this._handlers[g]===void 0&&(this._handlers[g]=[]);var o=this._handlers[g];return o.push(h),{dispose:function(){var u=o.indexOf(h);u!==-1&&o.splice(u,1)}}},x.prototype.setHandler=function(g,h){this._handlers[g]=[h]},x.prototype.clearHandler=function(g){this._handlers[g]&&delete this._handlers[g]},x.prototype.setHandlerFallback=function(g){this._handlerFb=g},x.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},x.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},x.prototype._start=function(){var g=this._handlers[this._id];if(g)for(var h=g.length-1;h>=0;h--)g[h].start();else this._handlerFb(this._id,"START")},x.prototype._put=function(g,h,o){var u=this._handlers[this._id];if(u)for(var r=u.length-1;r>=0;r--)u[r].put(g,h,o);else this._handlerFb(this._id,"PUT",M.utf32ToString(g,h,o))},x.prototype._end=function(g){var h=this._handlers[this._id];if(h){for(var o=h.length-1;o>=0&&h[o].end(g)===!1;o--);for(o--;o>=0;o--)h[o].end(!1)}else this._handlerFb(this._id,"END",g)},x.prototype.start=function(){this.reset(),this._id=-1,this._state=1},x.prototype.put=function(g,h,o){if(this._state!==3){if(this._state===1)for(;h<o;){var u=g[h++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&o-h>0&&this._put(g,h,o)}},x.prototype.end=function(g){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(g)),this._id=-1,this._state=0)},x}();L.OscParser=f;var E=function(){function x(g){this._handler=g,this._data="",this._hitLimit=!1}return x.prototype.start=function(){this._data="",this._hitLimit=!1},x.prototype.put=function(g,h,o){this._hitLimit||(this._data+=M.utf32ToString(g,h,o),this._data.length>k.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},x.prototype.end=function(g){var h;return this._hitLimit?h=!1:g&&(h=this._handler(this._data)),this._data="",this._hitLimit=!1,h},x}();L.OscHandler=E},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.PAYLOAD_LIMIT=void 0,L.PAYLOAD_LIMIT=1e7},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DcsHandler=L.DcsParser=void 0;var k=I(8),M=I(21),f=I(23),E=[],x=function(){function h(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return h.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},h.prototype.addHandler=function(o,u){this._handlers[o]===void 0&&(this._handlers[o]=[]);var r=this._handlers[o];return r.push(u),{dispose:function(){var n=r.indexOf(u);n!==-1&&r.splice(n,1)}}},h.prototype.setHandler=function(o,u){this._handlers[o]=[u]},h.prototype.clearHandler=function(o){this._handlers[o]&&delete this._handlers[o]},h.prototype.setHandlerFallback=function(o){this._handlerFb=o},h.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},h.prototype.hook=function(o,u){if(this.reset(),this._ident=o,this._active=this._handlers[o]||E,this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].hook(u);else this._handlerFb(this._ident,"HOOK",u)},h.prototype.put=function(o,u,r){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(o,u,r);else this._handlerFb(this._ident,"PUT",k.utf32ToString(o,u,r))},h.prototype.unhook=function(o){if(this._active.length){for(var u=this._active.length-1;u>=0&&this._active[u].unhook(o)===!1;u--);for(u--;u>=0;u--)this._active[u].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",o);this._active=E,this._ident=0},h}();L.DcsParser=x;var g=function(){function h(o){this._handler=o,this._data="",this._hitLimit=!1}return h.prototype.hook=function(o){this._params=o.clone(),this._data="",this._hitLimit=!1},h.prototype.put=function(o,u,r){this._hitLimit||(this._data+=k.utf32ToString(o,u,r),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},h.prototype.unhook=function(o){var u;return this._hitLimit?u=!1:o&&(u=this._handler(this._data,this._params||new M.Params)),this._params=void 0,this._data="",this._hitLimit=!1,u},h}();L.DcsHandler=g},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.removeTerminalFromCache=L.acquireCharAtlas=void 0;var k=I(26),M=I(43),f=[];L.acquireCharAtlas=function(E,x,g,h,o){for(var u=k.generateConfig(h,o,E,g),r=0;r<f.length;r++){var n=(t=f[r]).ownedBy.indexOf(x);if(n>=0){if(k.configEquals(t.config,u))return t.atlas;t.ownedBy.length===1?(t.atlas.dispose(),f.splice(r,1)):t.ownedBy.splice(n,1);break}}for(r=0;r<f.length;r++){var t=f[r];if(k.configEquals(t.config,u))return t.ownedBy.push(x),t.atlas}var i={atlas:new M.DynamicCharAtlas(document,u),config:u,ownedBy:[x]};return f.push(i),i.atlas},L.removeTerminalFromCache=function(E){for(var x=0;x<f.length;x++){var g=f[x].ownedBy.indexOf(E);if(g!==-1){f[x].ownedBy.length===1?(f[x].atlas.dispose(),f.splice(x,1)):f[x].ownedBy.splice(g,1);break}}}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.is256Color=L.configEquals=L.generateConfig=void 0;var k=I(3);L.generateConfig=function(M,f,E,x){var g={foreground:x.foreground,background:x.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:x.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:M,scaledCharHeight:f,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,colors:g}},L.configEquals=function(M,f){for(var E=0;E<M.colors.ansi.length;E++)if(M.colors.ansi[E].rgba!==f.colors.ansi[E].rgba)return!1;return M.devicePixelRatio===f.devicePixelRatio&&M.fontFamily===f.fontFamily&&M.fontSize===f.fontSize&&M.fontWeight===f.fontWeight&&M.fontWeightBold===f.fontWeightBold&&M.allowTransparency===f.allowTransparency&&M.scaledCharWidth===f.scaledCharWidth&&M.scaledCharHeight===f.scaledCharHeight&&M.colors.foreground===f.colors.foreground&&M.colors.background===f.colors.background},L.is256Color=function(M){return M<k.DEFAULT_COLOR}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ColorManager=L.DEFAULT_ANSI_COLORS=void 0;var k=I(10),M=I(45),f=k.css.toColor("#ffffff"),E=k.css.toColor("#000000"),x=k.css.toColor("#ffffff"),g=k.css.toColor("#000000"),h={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};L.DEFAULT_ANSI_COLORS=function(){for(var u=[k.css.toColor("#2e3436"),k.css.toColor("#cc0000"),k.css.toColor("#4e9a06"),k.css.toColor("#c4a000"),k.css.toColor("#3465a4"),k.css.toColor("#75507b"),k.css.toColor("#06989a"),k.css.toColor("#d3d7cf"),k.css.toColor("#555753"),k.css.toColor("#ef2929"),k.css.toColor("#8ae234"),k.css.toColor("#fce94f"),k.css.toColor("#729fcf"),k.css.toColor("#ad7fa8"),k.css.toColor("#34e2e2"),k.css.toColor("#eeeeec")],r=[0,95,135,175,215,255],n=0;n<216;n++){var t=r[n/36%6|0],i=r[n/6%6|0],s=r[n%6];u.push({css:k.channels.toCss(t,i,s),rgba:k.channels.toRgba(t,i,s)})}for(n=0;n<24;n++){var l=8+10*n;u.push({css:k.channels.toCss(l,l,l),rgba:k.channels.toRgba(l,l,l)})}return u}();var o=function(){function u(r,n){this.allowTransparency=n;var t=r.createElement("canvas");t.width=1,t.height=1;var i=t.getContext("2d");if(!i)throw new Error("Could not get rendering context");this._ctx=i,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new M.ColorContrastCache,this.colors={foreground:f,background:E,cursor:x,cursorAccent:g,selectionTransparent:h,selectionOpaque:k.color.blend(E,h),ansi:L.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return u.prototype.onOptionsChange=function(r){r==="minimumContrastRatio"&&this._contrastCache.clear()},u.prototype.setTheme=function(r){(r===void 0&&(r={}),this.colors.foreground=this._parseColor(r.foreground,f),this.colors.background=this._parseColor(r.background,E),this.colors.cursor=this._parseColor(r.cursor,x,!0),this.colors.cursorAccent=this._parseColor(r.cursorAccent,g,!0),this.colors.selectionTransparent=this._parseColor(r.selection,h,!0),this.colors.selectionOpaque=k.color.blend(this.colors.background,this.colors.selectionTransparent),k.color.isOpaque(this.colors.selectionTransparent))&&(this.colors.selectionTransparent=k.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(r.black,L.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(r.red,L.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(r.green,L.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(r.yellow,L.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(r.blue,L.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(r.magenta,L.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(r.cyan,L.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(r.white,L.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(r.brightBlack,L.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(r.brightRed,L.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(r.brightGreen,L.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(r.brightYellow,L.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(r.brightBlue,L.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(r.brightMagenta,L.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(r.brightCyan,L.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(r.brightWhite,L.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},u.prototype._parseColor=function(r,n,t){if(t===void 0&&(t=this.allowTransparency),r===void 0)return n;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=r,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+r+" is invalid using fallback "+n.css),n;this._ctx.fillRect(0,0,1,1);var i=this._ctx.getImageData(0,0,1,1).data;if(i[3]!==255){if(!t)return console.warn("Color: "+r+" is using transparency, but allowTransparency is false. Using fallback "+n.css+"."),n;var s=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(S){return Number(S)}),l=s[0],c=s[1],d=s[2],w=s[3],m=Math.round(255*w);return{rgba:k.channels.toRgba(l,c,d,m),css:r}}return{css:this._ctx.fillStyle,rgba:k.channels.toRgba(i[0],i[1],i[2],i[3])}},u}();L.ColorManager=o},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.throwIfFalsy=void 0,L.throwIfFalsy=function(k){if(!k)throw new Error("value must not be falsy");return k}},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(o,u){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var t in n)n.hasOwnProperty(t)&&(r[t]=n[t])})(o,u)},function(o,u){function r(){this.constructor=o}k(o,u),o.prototype=u===null?Object.create(u):(r.prototype=u.prototype,new r)});Object.defineProperty(L,"__esModule",{value:!0}),L.CharacterJoinerRegistry=L.JoinedCellData=void 0;var f=I(6),E=I(3),x=I(4),g=function(o){function u(r,n,t){var i=o.call(this)||this;return i.content=0,i.combinedData="",i.fg=r.fg,i.bg=r.bg,i.combinedData=n,i._width=t,i}return M(u,o),u.prototype.isCombined=function(){return 2097152},u.prototype.getWidth=function(){return this._width},u.prototype.getChars=function(){return this.combinedData},u.prototype.getCode=function(){return 2097151},u.prototype.setFromCharData=function(r){throw new Error("not implemented")},u.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},u}(f.AttributeData);L.JoinedCellData=g;var h=function(){function o(u){this._bufferService=u,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}return o.prototype.registerCharacterJoiner=function(u){var r={id:this._nextCharacterJoinerId++,handler:u};return this._characterJoiners.push(r),r.id},o.prototype.deregisterCharacterJoiner=function(u){for(var r=0;r<this._characterJoiners.length;r++)if(this._characterJoiners[r].id===u)return this._characterJoiners.splice(r,1),!0;return!1},o.prototype.getJoinedCharacters=function(u){if(this._characterJoiners.length===0)return[];var r=this._bufferService.buffer.lines.get(u);if(!r||r.length===0)return[];for(var n=[],t=r.translateToString(!0),i=0,s=0,l=0,c=r.getFg(0),d=r.getBg(0),w=0;w<r.getTrimmedLength();w++)if(r.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==d){if(w-i>1)for(var m=this._getJoinedRanges(t,l,s,r,i),S=0;S<m.length;S++)n.push(m[S]);i=w,l=s,c=this._workCell.fg,d=this._workCell.bg}s+=this._workCell.getChars().length||E.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1)for(m=this._getJoinedRanges(t,l,s,r,i),S=0;S<m.length;S++)n.push(m[S]);return n},o.prototype._getJoinedRanges=function(u,r,n,t,i){for(var s=u.substring(r,n),l=this._characterJoiners[0].handler(s),c=1;c<this._characterJoiners.length;c++)for(var d=this._characterJoiners[c].handler(s),w=0;w<d.length;w++)o._mergeRanges(l,d[w]);return this._stringRangesToCellRanges(l,t,i),l},o.prototype._stringRangesToCellRanges=function(u,r,n){var t=0,i=!1,s=0,l=u[t];if(l){for(var c=n;c<this._bufferService.cols;c++){var d=r.getWidth(c),w=r.getString(c).length||E.WHITESPACE_CELL_CHAR.length;if(d!==0){if(!i&&l[0]<=s&&(l[0]=c,i=!0),l[1]<=s){if(l[1]=c,!(l=u[++t]))break;l[0]<=s?(l[0]=c,i=!0):i=!1}s+=w}}l&&(l[1]=this._bufferService.cols)}},o._mergeRanges=function(u,r){for(var n=!1,t=0;t<u.length;t++){var i=u[t];if(n){if(r[1]<=i[0])return u[t-1][1]=r[1],u;if(r[1]<=i[1])return u[t-1][1]=Math.max(r[1],i[1]),u.splice(t,1),u;u.splice(t,1),t--}else{if(r[1]<=i[0])return u.splice(t,0,r),u;if(r[1]<=i[1])return i[0]=Math.min(r[0],i[0]),u;r[0]<i[1]&&(i[0]=Math.min(r[0],i[0]),n=!0)}}return n?u[u.length-1][1]=r[1]:u.push(r),u},o}();L.CharacterJoinerRegistry=h},function(V,L,I){"use strict";function k(M,f){var E=f.getBoundingClientRect();return[M.clientX-E.left,M.clientY-E.top]}Object.defineProperty(L,"__esModule",{value:!0}),L.getRawByteCoords=L.getCoords=L.getCoordsRelativeToElement=void 0,L.getCoordsRelativeToElement=k,L.getCoords=function(M,f,E,x,g,h,o,u){if(g){var r=k(M,f);if(r)return r[0]=Math.ceil((r[0]+(u?h/2:0))/h),r[1]=Math.ceil(r[1]/o),r[0]=Math.min(Math.max(r[0],1),E+(u?1:0)),r[1]=Math.min(Math.max(r[1],1),x),r}},L.getRawByteCoords=function(M){if(M)return{x:M[0]+32,y:M[1]+32}}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.RenderDebouncer=void 0;var k=function(){function M(f){this._renderCallback=f}return M.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},M.prototype.refresh=function(f,E,x){var g=this;this._rowCount=x,f=f!==void 0?f:0,E=E!==void 0?E:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,E):E,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return g._innerRefresh()}))},M.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var f=Math.max(this._rowStart,0),E=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(f,E)}},M}();L.RenderDebouncer=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(E,x){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var o in h)h.hasOwnProperty(o)&&(g[o]=h[o])})(E,x)},function(E,x){function g(){this.constructor=E}k(E,x),E.prototype=x===null?Object.create(x):(g.prototype=x.prototype,new g)});Object.defineProperty(L,"__esModule",{value:!0}),L.ScreenDprMonitor=void 0;var f=function(E){function x(){var g=E!==null&&E.apply(this,arguments)||this;return g._currentDevicePixelRatio=window.devicePixelRatio,g}return M(x,E),x.prototype.setListener=function(g){var h=this;this._listener&&this.clearListener(),this._listener=g,this._outerListener=function(){h._listener&&(h._listener(window.devicePixelRatio,h._currentDevicePixelRatio),h._updateDpr())},this._updateDpr()},x.prototype.dispose=function(){E.prototype.dispose.call(this),this.clearListener()},x.prototype._updateDpr=function(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)===null||g===void 0||g.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},x.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},x}(I(2).Disposable);L.ScreenDprMonitor=f},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.clone=void 0,L.clone=function k(M,f){if(f===void 0&&(f=5),typeof M!="object")return M;var E=Array.isArray(M)?[]:{};for(var x in M)E[x]=f<=1?M[x]:M[x]?k(M[x],f-1):M[x];return E}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.Terminal=void 0;var k=I(4),M=I(35),f=I(18),E=I(0),x=I(83),g=function(){function t(i){this._core=new M.Terminal(i),this._addonManager=new x.AddonManager}return t.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new r(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unicode",{get:function(){return this._checkProposedApi(),new n(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._checkProposedApi(),new o(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),t.prototype.blur=function(){this._core.blur()},t.prototype.focus=function(){this._core.focus()},t.prototype.resize=function(i,s){this._verifyIntegers(i,s),this._core.resize(i,s)},t.prototype.open=function(i){this._core.open(i)},t.prototype.attachCustomKeyEventHandler=function(i){this._core.attachCustomKeyEventHandler(i)},t.prototype.registerLinkMatcher=function(i,s,l){return this._checkProposedApi(),this._core.registerLinkMatcher(i,s,l)},t.prototype.deregisterLinkMatcher=function(i){this._checkProposedApi(),this._core.deregisterLinkMatcher(i)},t.prototype.registerLinkProvider=function(i){return this._checkProposedApi(),this._core.registerLinkProvider(i)},t.prototype.registerCharacterJoiner=function(i){return this._checkProposedApi(),this._core.registerCharacterJoiner(i)},t.prototype.deregisterCharacterJoiner=function(i){this._checkProposedApi(),this._core.deregisterCharacterJoiner(i)},t.prototype.registerMarker=function(i){return this._checkProposedApi(),this._verifyIntegers(i),this._core.addMarker(i)},t.prototype.addMarker=function(i){return this.registerMarker(i)},t.prototype.hasSelection=function(){return this._core.hasSelection()},t.prototype.select=function(i,s,l){this._verifyIntegers(i,s,l),this._core.select(i,s,l)},t.prototype.getSelection=function(){return this._core.getSelection()},t.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},t.prototype.clearSelection=function(){this._core.clearSelection()},t.prototype.selectAll=function(){this._core.selectAll()},t.prototype.selectLines=function(i,s){this._verifyIntegers(i,s),this._core.selectLines(i,s)},t.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},t.prototype.scrollLines=function(i){this._verifyIntegers(i),this._core.scrollLines(i)},t.prototype.scrollPages=function(i){this._verifyIntegers(i),this._core.scrollPages(i)},t.prototype.scrollToTop=function(){this._core.scrollToTop()},t.prototype.scrollToBottom=function(){this._core.scrollToBottom()},t.prototype.scrollToLine=function(i){this._verifyIntegers(i),this._core.scrollToLine(i)},t.prototype.clear=function(){this._core.clear()},t.prototype.write=function(i,s){this._core.write(i,s)},t.prototype.writeUtf8=function(i,s){this._core.write(i,s)},t.prototype.writeln=function(i,s){this._core.write(i),this._core.write(`\r
`,s)},t.prototype.paste=function(i){this._core.paste(i)},t.prototype.getOption=function(i){return this._core.optionsService.getOption(i)},t.prototype.setOption=function(i,s){this._core.optionsService.setOption(i,s)},t.prototype.refresh=function(i,s){this._verifyIntegers(i,s),this._core.refresh(i,s)},t.prototype.reset=function(){this._core.reset()},t.prototype.loadAddon=function(i){return this._addonManager.loadAddon(this,i)},Object.defineProperty(t,"strings",{get:function(){return f},enumerable:!1,configurable:!0}),t.prototype._verifyIntegers=function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];for(var l=0,c=i;l<c.length;l++){var d=c[l];if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}},t}();L.Terminal=g;var h=function(){function t(i,s){this._buffer=i,this.type=s}return t.prototype.init=function(i){return this._buffer=i,this},Object.defineProperty(t.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),t.prototype.getLine=function(i){var s=this._buffer.lines.get(i);if(s)return new u(s)},t.prototype.getNullCell=function(){return new k.CellData},t}(),o=function(){function t(i){var s=this;this._buffers=i,this._onBufferChange=new E.EventEmitter,this._normal=new h(this._buffers.normal,"normal"),this._alternate=new h(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return s._onBufferChange.fire(s.active)})}return Object.defineProperty(t.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),t}(),u=function(){function t(i){this._line=i}return Object.defineProperty(t.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),t.prototype.getCell=function(i,s){if(!(i<0||i>=this._line.length))return s?(this._line.loadCell(i,s),s):this._line.loadCell(i,new k.CellData)},t.prototype.translateToString=function(i,s,l){return this._line.translateToString(i,s,l)},t}(),r=function(){function t(i){this._core=i}return t.prototype.registerCsiHandler=function(i,s){return this._core.addCsiHandler(i,function(l){return s(l.toArray())})},t.prototype.addCsiHandler=function(i,s){return this.registerCsiHandler(i,s)},t.prototype.registerDcsHandler=function(i,s){return this._core.addDcsHandler(i,function(l,c){return s(l,c.toArray())})},t.prototype.addDcsHandler=function(i,s){return this.registerDcsHandler(i,s)},t.prototype.registerEscHandler=function(i,s){return this._core.addEscHandler(i,s)},t.prototype.addEscHandler=function(i,s){return this.registerEscHandler(i,s)},t.prototype.registerOscHandler=function(i,s){return this._core.addOscHandler(i,s)},t.prototype.addOscHandler=function(i,s){return this.registerOscHandler(i,s)},t}(),n=function(){function t(i){this._core=i}return t.prototype.register=function(i){this._core.unicodeService.register(i)},Object.defineProperty(t.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(i){this._core.unicodeService.activeVersion=i},enumerable:!1,configurable:!0}),t}()},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(K,U){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,B){X.__proto__=B}||function(X,B){for(var N in B)B.hasOwnProperty(N)&&(X[N]=B[N])})(K,U)},function(K,U){function X(){this.constructor=K}k(K,U),K.prototype=U===null?Object.create(U):(X.prototype=U.prototype,new X)});Object.defineProperty(L,"__esModule",{value:!0}),L.Terminal=void 0;var f=I(36),E=I(37),x=I(38),g=I(12),h=I(19),o=I(40),u=I(50),r=I(51),n=I(11),t=I(7),i=I(18),s=I(54),l=I(55),c=I(56),d=I(57),w=I(59),m=I(0),S=I(16),C=I(27),v=I(60),y=I(5),T=I(61),A=I(62),p=I(63),D=I(64),O=I(65),P=typeof window!="undefined"?window.document:null,j=function(K){function U(X){X===void 0&&(X={});var B=K.call(this,X)||this;return B.browser=n,B._keyDownHandled=!1,B._onCursorMove=new m.EventEmitter,B._onKey=new m.EventEmitter,B._onRender=new m.EventEmitter,B._onSelectionChange=new m.EventEmitter,B._onTitleChange=new m.EventEmitter,B._onFocus=new m.EventEmitter,B._onBlur=new m.EventEmitter,B._onA11yCharEmitter=new m.EventEmitter,B._onA11yTabEmitter=new m.EventEmitter,B._setup(),B.linkifier=B._instantiationService.createInstance(u.Linkifier),B.linkifier2=B.register(B._instantiationService.createInstance(p.Linkifier2)),B.register(B._inputHandler.onRequestBell(function(){return B.bell()})),B.register(B._inputHandler.onRequestRefreshRows(function(N,z){return B.refresh(N,z)})),B.register(B._inputHandler.onRequestReset(function(){return B.reset()})),B.register(B._inputHandler.onRequestScroll(function(N,z){return B.scroll(N,z||void 0)})),B.register(B._inputHandler.onRequestWindowsOptionsReport(function(N){return B._reportWindowsOptions(N)})),B.register(m.forwardEvent(B._inputHandler.onCursorMove,B._onCursorMove)),B.register(m.forwardEvent(B._inputHandler.onTitleChange,B._onTitleChange)),B.register(m.forwardEvent(B._inputHandler.onA11yChar,B._onA11yCharEmitter)),B.register(m.forwardEvent(B._inputHandler.onA11yTab,B._onA11yTabEmitter)),B.register(B._bufferService.onResize(function(N){return B._afterResize(N.cols,N.rows)})),B}return M(U,K),Object.defineProperty(U.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),U.prototype.dispose=function(){var X,B,N;this._isDisposed||(K.prototype.dispose.call(this),(X=this._renderService)===null||X===void 0||X.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(N=(B=this.element)===null||B===void 0?void 0:B.parentNode)===null||N===void 0||N.removeChild(this.element))},U.prototype._setup=function(){K.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(U.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),U.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},U.prototype._updateOptions=function(X){var B,N,z,te;switch(K.prototype._updateOptions.call(this,X),X){case"fontFamily":case"fontSize":(B=this._renderService)===null||B===void 0||B.clear(),(N=this._charSizeService)===null||N===void 0||N.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(z=this.viewport)===null||z===void 0||z.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new c.AccessibilityManager(this,this._renderService)):((te=this._accessibilityManager)===null||te===void 0||te.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},U.prototype._onTextAreaFocus=function(X){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(g.C0.ESC+"[I"),this.updateCursorStyle(X),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},U.prototype.blur=function(){var X;return(X=this.textarea)===null||X===void 0?void 0:X.blur()},U.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(g.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},U.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var X=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),B=this._bufferService.buffer.y*X,N=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=N+"px",this.textarea.style.top=B+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=X+"px",this.textarea.style.lineHeight=X+"px",this.textarea.style.zIndex="-5"}},U.prototype._initGlobal=function(){var X=this;this._bindKeys(),this.register(t.addDisposableDomListener(this.element,"copy",function(N){X.hasSelection()&&x.copyHandler(N,X._selectionService)}));var B=function(N){return x.handlePasteEvent(N,X.textarea,X._coreService)};this.register(t.addDisposableDomListener(this.textarea,"paste",B)),this.register(t.addDisposableDomListener(this.element,"paste",B)),n.isFirefox?this.register(t.addDisposableDomListener(this.element,"mousedown",function(N){N.button===2&&x.rightClickHandler(N,X.textarea,X.screenElement,X._selectionService,X.options.rightClickSelectsWord)})):this.register(t.addDisposableDomListener(this.element,"contextmenu",function(N){x.rightClickHandler(N,X.textarea,X.screenElement,X._selectionService,X.options.rightClickSelectsWord)})),n.isLinux&&this.register(t.addDisposableDomListener(this.element,"auxclick",function(N){N.button===1&&x.moveTextAreaUnderMouseCursor(N,X.textarea,X.screenElement)}))},U.prototype._bindKeys=function(){var X=this;this.register(t.addDisposableDomListener(this.textarea,"keyup",function(B){return X._keyUp(B)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keydown",function(B){return X._keyDown(B)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keypress",function(B){return X._keyPress(B)},!0)),this.register(t.addDisposableDomListener(this.textarea,"compositionstart",function(){return X._compositionHelper.compositionstart()})),this.register(t.addDisposableDomListener(this.textarea,"compositionupdate",function(B){return X._compositionHelper.compositionupdate(B)})),this.register(t.addDisposableDomListener(this.textarea,"compositionend",function(){return X._compositionHelper.compositionend()})),this.register(this.onRender(function(){return X._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(B){return X._queueLinkification(B.start,B.end)}))},U.prototype.open=function(X){var B=this;if(!X)throw new Error("Terminal requires a parent element.");P.body.contains(X)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=X.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),X.appendChild(this.element);var N=P.createDocumentFragment();this._viewportElement=P.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.appendChild(this._viewportElement),this._viewportScrollArea=P.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=P.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=P.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=P.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",i.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(t.addDisposableDomListener(this.textarea,"focus",function(ce){return B._onTextAreaFocus(ce)})),this.register(t.addDisposableDomListener(this.textarea,"blur",function(){return B._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var z=this._instantiationService.createInstance(D.CoreBrowserService,this.textarea);this._instantiationService.setService(y.ICoreBrowserService,z),this._charSizeService=this._instantiationService.createInstance(T.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._compositionView=P.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(N),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(P,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(ce){return B._colorManager.onOptionsChange(ce)})),this._colorManager.setTheme(this._theme);var te=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(v.RenderService,te,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(ce){return B._onRender.fire(ce)})),this.onResize(function(ce){return B._renderService.resize(ce.cols,ce.rows)}),this._soundService=this._instantiationService.createInstance(s.SoundService),this._instantiationService.setService(y.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(ce,be){return B.scrollLines(ce,be)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return B.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){B._renderService.onCursorMove(),B._syncTextArea()})),this.register(this.onResize(function(){return B._renderService.onResize(B.cols,B.rows)})),this.register(this.onBlur(function(){return B._renderService.onBlur()})),this.register(this.onFocus(function(){return B._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return B.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(r.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(ce){return B.scrollLines(ce.amount,ce.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return B._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(ce){return B._renderService.onSelectionChanged(ce.start,ce.end,ce.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(ce){B.textarea.value=ce,B.textarea.focus(),B.textarea.select()})),this.register(this.onScroll(function(){B.viewport.syncScrollArea(),B._selectionService.refresh()})),this.register(t.addDisposableDomListener(this._viewportElement,"scroll",function(){return B._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(l.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return B._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(t.addDisposableDomListener(this.element,"mousedown",function(ce){return B._selectionService.onMouseDown(ce)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new c.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},U.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(o.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(d.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},U.prototype._setTheme=function(X){var B,N,z;this._theme=X,(B=this._colorManager)===null||B===void 0||B.setTheme(X),(N=this._renderService)===null||N===void 0||N.setColors(this._colorManager.colors),(z=this.viewport)===null||z===void 0||z.onThemeChange(this._colorManager.colors)},U.prototype.bindMouse=function(){var X=this,B=this,N=this.element;function z(Re){var Be,Ke,Ae=B._mouseService.getRawByteCoords(Re,B.screenElement,B.cols,B.rows);if(!Ae)return!1;switch(Re.overrideType||Re.type){case"mousemove":Ke=32,Re.buttons===void 0?(Be=3,Re.button!==void 0&&(Be=Re.button<3?Re.button:3)):Be=1&Re.buttons?0:4&Re.buttons?1:2&Re.buttons?2:3;break;case"mouseup":Ke=0,Be=Re.button<3?Re.button:3;break;case"mousedown":Ke=1,Be=Re.button<3?Re.button:3;break;case"wheel":Re.deltaY!==0&&(Ke=Re.deltaY<0?0:1),Be=4;break;default:return!1}return!(Ke===void 0||Be===void 0||Be>4)&&B._coreMouseService.triggerMouseEvent({col:Ae.x-33,row:Ae.y-33,button:Be,action:Ke,ctrl:Re.ctrlKey,alt:Re.altKey,shift:Re.shiftKey})}var te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce=function(Re){return z(Re),Re.buttons||(X._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&X._document.removeEventListener("mousemove",te.mousedrag)),X.cancel(Re)},be=function(Re){return z(Re),Re.preventDefault(),X.cancel(Re)},Fe=function(Re){Re.buttons&&z(Re)},Oe=function(Re){Re.buttons||z(Re)};this.register(this._coreMouseService.onProtocolChange(function(Re){Re?(X.optionsService.options.logLevel==="debug"&&X._logService.debug("Binding to mouse events:",X._coreMouseService.explainEvents(Re)),X.element.classList.add("enable-mouse-events"),X._selectionService.disable()):(X._logService.debug("Unbinding from mouse events."),X.element.classList.remove("enable-mouse-events"),X._selectionService.enable()),8&Re?te.mousemove||(N.addEventListener("mousemove",Oe),te.mousemove=Oe):(N.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&Re?te.wheel||(N.addEventListener("wheel",be,{passive:!1}),te.wheel=be):(N.removeEventListener("wheel",te.wheel),te.wheel=null),2&Re?te.mouseup||(te.mouseup=ce):(X._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&Re?te.mousedrag||(te.mousedrag=Fe):(X._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(t.addDisposableDomListener(N,"mousedown",function(Re){if(Re.preventDefault(),X.focus(),X._coreMouseService.areMouseEventsActive&&!X._selectionService.shouldForceSelection(Re))return z(Re),te.mouseup&&X._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&X._document.addEventListener("mousemove",te.mousedrag),X.cancel(Re)})),this.register(t.addDisposableDomListener(N,"wheel",function(Re){if(!te.wheel){if(!X.buffer.hasScrollback){var Be=X.viewport.getLinesScrolled(Re);if(Be===0)return;for(var Ke=g.C0.ESC+(X._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Re.deltaY<0?"A":"B"),Ae="",_e=0;_e<Math.abs(Be);_e++)Ae+=Ke;X._coreService.triggerDataEvent(Ae,!0)}}},{passive:!0})),this.register(t.addDisposableDomListener(N,"wheel",function(Re){if(!te.wheel)return X.viewport.onWheel(Re)?void 0:X.cancel(Re)},{passive:!1})),this.register(t.addDisposableDomListener(N,"touchstart",function(Re){if(!X._coreMouseService.areMouseEventsActive)return X.viewport.onTouchStart(Re),X.cancel(Re)},{passive:!0})),this.register(t.addDisposableDomListener(N,"touchmove",function(Re){if(!X._coreMouseService.areMouseEventsActive)return X.viewport.onTouchMove(Re)?void 0:X.cancel(Re)},{passive:!1}))},U.prototype.refresh=function(X,B){var N;(N=this._renderService)===null||N===void 0||N.refreshRows(X,B)},U.prototype._queueLinkification=function(X,B){var N;(N=this.linkifier)===null||N===void 0||N.linkifyRows(X,B)},U.prototype.updateCursorStyle=function(X){this._selectionService&&this._selectionService.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},U.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},U.prototype.scrollLines=function(X,B){K.prototype.scrollLines.call(this,X,B),this.refresh(0,this.rows-1)},U.prototype.paste=function(X){x.paste(X,this.textarea,this._coreService)},U.prototype.attachCustomKeyEventHandler=function(X){this._customKeyEventHandler=X},U.prototype.registerLinkMatcher=function(X,B,N){var z=this.linkifier.registerLinkMatcher(X,B,N);return this.refresh(0,this.rows-1),z},U.prototype.deregisterLinkMatcher=function(X){this.linkifier.deregisterLinkMatcher(X)&&this.refresh(0,this.rows-1)},U.prototype.registerLinkProvider=function(X){return this.linkifier2.registerLinkProvider(X)},U.prototype.registerCharacterJoiner=function(X){var B=this._renderService.registerCharacterJoiner(X);return this.refresh(0,this.rows-1),B},U.prototype.deregisterCharacterJoiner=function(X){this._renderService.deregisterCharacterJoiner(X)&&this.refresh(0,this.rows-1)},Object.defineProperty(U.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),U.prototype.addMarker=function(X){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)},U.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},U.prototype.select=function(X,B,N){this._selectionService.setSelection(X,B,N)},U.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},U.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},U.prototype.clearSelection=function(){var X;(X=this._selectionService)===null||X===void 0||X.clearSelection()},U.prototype.selectAll=function(){var X;(X=this._selectionService)===null||X===void 0||X.selectAll()},U.prototype.selectLines=function(X,B){var N;(N=this._selectionService)===null||N===void 0||N.selectLines(X,B)},U.prototype._keyDown=function(X){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(!this._compositionHelper.keydown(X))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var B=w.evaluateKeyboardEvent(X,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),B.type===3||B.type===2){var N=this.rows-1;return this.scrollLines(B.type===2?-N:N),this.cancel(X,!0)}return B.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(B.cancel&&this.cancel(X,!0),!B.key||(B.key!==g.C0.ETX&&B.key!==g.C0.CR||(this.textarea.value=""),this._onKey.fire({key:B.key,domEvent:X}),this._showCursor(),this._coreService.triggerDataEvent(B.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(X,!0)))},U.prototype._isThirdLevelShift=function(X,B){var N=X.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||X.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey;return B.type==="keypress"?N:N&&(!B.keyCode||B.keyCode>47)},U.prototype._keyUp=function(X){this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}(X)||this.focus(),this.updateCursorStyle(X))},U.prototype._keyPress=function(X){var B;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)B=X.charCode;else if(X.which===null||X.which===void 0)B=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;B=X.which}return!(!B||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X))&&(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:X}),this._showCursor(),this._coreService.triggerDataEvent(B,!0),!0)},U.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},U.prototype.resize=function(X,B){X!==this.cols||B!==this.rows?K.prototype.resize.call(this,X,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},U.prototype._afterResize=function(X,B){var N,z;(N=this._charSizeService)===null||N===void 0||N.measure(),(z=this.viewport)===null||z===void 0||z.syncScrollArea(!0)},U.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var X=1;X<this.rows;X++)this.buffer.lines.push(this.buffer.getBlankLine(S.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},U.prototype.reset=function(){var X,B;this.options.rows=this.rows,this.options.cols=this.cols;var N=this._customKeyEventHandler;this._setup(),K.prototype.reset.call(this),(X=this._selectionService)===null||X===void 0||X.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1),(B=this.viewport)===null||B===void 0||B.syncScrollArea()},U.prototype._reportWindowsOptions=function(X){if(this._renderService)switch(X){case h.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var B=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),N=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(g.C0.ESC+"[4;"+N+";"+B+"t");break;case h.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var z=this._renderService.dimensions.scaledCellWidth.toFixed(0),te=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(g.C0.ESC+"[6;"+te+";"+z+"t")}},U.prototype.cancel=function(X,B){if(this.options.cancelEvents||B)return X.preventDefault(),X.stopPropagation(),!1},U.prototype._visualBell=function(){return!1},U.prototype._soundBell=function(){return this.options.bellStyle==="sound"},U}(O.CoreTerminal);L.Terminal=j},function(V,L,I){"use strict";var k=this&&this.__decorate||function(g,h,o,u){var r,n=arguments.length,t=n<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(g,h,o,u);else for(var i=g.length-1;i>=0;i--)(r=g[i])&&(t=(n<3?r(t):n>3?r(h,o,t):r(h,o))||t);return n>3&&t&&Object.defineProperty(h,o,t),t},M=this&&this.__param||function(g,h){return function(o,u){h(o,u,g)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CompositionHelper=void 0;var f=I(5),E=I(1),x=function(){function g(h,o,u,r,n,t){this._textarea=h,this._compositionView=o,this._bufferService=u,this._optionsService=r,this._charSizeService=n,this._coreService=t,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(g.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),g.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},g.prototype.compositionupdate=function(h){var o=this;this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(function(){o._compositionPosition.end=o._textarea.value.length},0)},g.prototype.compositionend=function(){this._finalizeComposition(!0)},g.prototype.keydown=function(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229)return!1;if(h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},g.prototype._finalizeComposition=function(h){var o=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){var u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(o._isSendingComposition){o._isSendingComposition=!1;var n=void 0;n=o._isComposing?o._textarea.value.substring(u.start,u.end):o._textarea.value.substring(u.start),o._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}},g.prototype._handleAnyTextareaChanges=function(){var h=this,o=this._textarea.value;setTimeout(function(){if(!h._isComposing){var u=h._textarea.value.replace(o,"");u.length>0&&h._coreService.triggerDataEvent(u,!0)}},0)},g.prototype.updateCompositionElements=function(h){var o=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var u=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),r=this._bufferService.buffer.y*u,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var t=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=t.width+"px",this._textarea.style.height=t.height+"px",this._textarea.style.lineHeight=t.height+"px"}h||setTimeout(function(){return o.updateCompositionElements(!0)},0)}},g=k([M(2,E.IBufferService),M(3,E.IOptionsService),M(4,f.ICharSizeService),M(5,E.ICoreService)],g)}();L.CompositionHelper=x},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),f=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Viewport=void 0;var x=I(2),g=I(7),h=I(5),o=I(1),u=function(r){function n(t,i,s,l,c,d,w){var m=r.call(this)||this;return m._scrollLines=t,m._viewportElement=i,m._scrollArea=s,m._bufferService=l,m._optionsService=c,m._charSizeService=d,m._renderService=w,m.scrollBarWidth=0,m._currentRowHeight=0,m._lastRecordedBufferLength=0,m._lastRecordedViewportHeight=0,m._lastRecordedBufferHeight=0,m._lastTouchY=0,m._lastScrollTop=0,m._wheelPartialScroll=0,m._refreshAnimationFrame=null,m._ignoreNextScrollEvent=!1,m.scrollBarWidth=m._viewportElement.offsetWidth-m._scrollArea.offsetWidth||15,m.register(g.addDisposableDomListener(m._viewportElement,"scroll",m._onScroll.bind(m))),setTimeout(function(){return m.syncScrollArea()},0),m}return M(n,r),n.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},n.prototype._refresh=function(t){var i=this;if(t)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return i._innerRefresh()}))},n.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==i&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=i),this._refreshAnimationFrame=null},n.prototype.syncScrollArea=function(t){if(t===void 0&&(t=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(t);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var i=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===i&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(t)}else this._refresh(t)},n.prototype._onScroll=function(t){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(i,!0)}},n.prototype._bubbleScroll=function(t,i){var s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&s<this._lastRecordedBufferHeight)||(t.cancelable&&t.preventDefault(),!1)},n.prototype.onWheel=function(t){var i=this._getPixelsScrolled(t);return i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(t,i))},n.prototype._getPixelsScrolled=function(t){if(t.deltaY===0)return 0;var i=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i},n.prototype.getLinesScrolled=function(t){if(t.deltaY===0)return 0;var i=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i},n.prototype._applyScrollModifier=function(t,i){var s=this._optionsService.options.fastScrollModifier;return s==="alt"&&i.altKey||s==="ctrl"&&i.ctrlKey||s==="shift"&&i.shiftKey?t*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:t*this._optionsService.options.scrollSensitivity},n.prototype.onTouchStart=function(t){this._lastTouchY=t.touches[0].pageY},n.prototype.onTouchMove=function(t){var i=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(t,i))},n=f([E(3,o.IBufferService),E(4,o.IOptionsService),E(5,h.ICharSizeService),E(6,h.IRenderService)],n)}(x.Disposable);L.Viewport=u},function(V,L,I){"use strict";function k(x){return x.replace(/\r?\n/g,"\r")}function M(x,g){return g?"[200~"+x+"[201~":x}function f(x,g,h){x=M(x=k(x),h.decPrivateModes.bracketedPasteMode),h.triggerDataEvent(x,!0),g.value=""}function E(x,g,h){var o=h.getBoundingClientRect(),u=x.clientX-o.left-10,r=x.clientY-o.top-10;g.style.width="20px",g.style.height="20px",g.style.left=u+"px",g.style.top=r+"px",g.style.zIndex="1000",g.focus()}Object.defineProperty(L,"__esModule",{value:!0}),L.rightClickHandler=L.moveTextAreaUnderMouseCursor=L.paste=L.handlePasteEvent=L.copyHandler=L.bracketTextForPaste=L.prepareTextForTerminal=void 0,L.prepareTextForTerminal=k,L.bracketTextForPaste=M,L.copyHandler=function(x,g){x.clipboardData&&x.clipboardData.setData("text/plain",g.selectionText),x.preventDefault()},L.handlePasteEvent=function(x,g,h){x.stopPropagation(),x.clipboardData&&f(x.clipboardData.getData("text/plain"),g,h)},L.paste=f,L.moveTextAreaUnderMouseCursor=E,L.rightClickHandler=function(x,g,h,o,u){E(x,g,h),u&&!o.isClickInSelection(x)&&o.selectWordAtCursor(x),g.value=o.selectionText,g.select()}},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)});Object.defineProperty(L,"__esModule",{value:!0}),L.EscapeSequenceParser=L.VT500_TRANSITION_TABLE=L.TransitionTable=void 0;var f=I(2),E=I(15),x=I(21),g=I(22),h=I(24),o=function(){function r(n){this.table=new Uint8Array(n)}return r.prototype.setDefault=function(n,t){E.fill(this.table,n<<4|t)},r.prototype.add=function(n,t,i,s){this.table[t<<8|n]=i<<4|s},r.prototype.addMany=function(n,t,i,s){for(var l=0;l<n.length;l++)this.table[t<<8|n[l]]=i<<4|s},r}();L.TransitionTable=o,L.VT500_TRANSITION_TABLE=function(){var r=new o(4095),n=Array.apply(null,Array(256)).map(function(d,w){return w}),t=function(d,w){return n.slice(d,w)},i=t(32,127),s=t(0,24);s.push(25),s.push.apply(s,t(28,32));var l,c=t(0,14);for(l in r.setDefault(1,0),r.addMany(i,0,2,0),c)r.addMany([24,26,153,154],l,3,0),r.addMany(t(128,144),l,3,0),r.addMany(t(144,152),l,3,0),r.add(156,l,0,0),r.add(27,l,11,1),r.add(157,l,4,8),r.addMany([152,158,159],l,0,7),r.add(155,l,11,3),r.add(144,l,11,9);return r.addMany(s,0,3,0),r.addMany(s,1,3,1),r.add(127,1,0,1),r.addMany(s,8,0,8),r.addMany(s,3,3,3),r.add(127,3,0,3),r.addMany(s,4,3,4),r.add(127,4,0,4),r.addMany(s,6,3,6),r.addMany(s,5,3,5),r.add(127,5,0,5),r.addMany(s,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(i,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(t(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(i,7,0,7),r.addMany(s,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(t(64,127),3,7,0),r.addMany(t(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(t(48,60),4,8,4),r.addMany(t(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(t(32,64),6,0,6),r.add(127,6,0,6),r.addMany(t(64,127),6,0,0),r.addMany(t(32,48),3,9,5),r.addMany(t(32,48),5,9,5),r.addMany(t(48,64),5,0,6),r.addMany(t(64,127),5,7,0),r.addMany(t(32,48),4,9,5),r.addMany(t(32,48),1,9,2),r.addMany(t(32,48),2,9,2),r.addMany(t(48,127),2,10,0),r.addMany(t(48,80),1,10,0),r.addMany(t(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(t(96,127),1,10,0),r.add(80,1,11,9),r.addMany(s,9,0,9),r.add(127,9,0,9),r.addMany(t(28,32),9,0,9),r.addMany(t(32,48),9,9,12),r.addMany(t(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(s,11,0,11),r.addMany(t(32,128),11,0,11),r.addMany(t(28,32),11,0,11),r.addMany(s,10,0,10),r.add(127,10,0,10),r.addMany(t(28,32),10,0,10),r.addMany(t(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(t(32,48),10,9,12),r.addMany(s,12,0,12),r.add(127,12,0,12),r.addMany(t(28,32),12,0,12),r.addMany(t(32,48),12,9,12),r.addMany(t(48,64),12,0,11),r.addMany(t(64,127),12,12,13),r.addMany(t(64,127),10,12,13),r.addMany(t(64,127),9,12,13),r.addMany(s,13,13,13),r.addMany(i,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(160,0,2,0),r.add(160,8,5,8),r.add(160,6,0,6),r.add(160,11,0,11),r.add(160,13,13,13),r}();var u=function(r){function n(t){t===void 0&&(t=L.VT500_TRANSITION_TABLE);var i=r.call(this)||this;return i._transitions=t,i.initialState=0,i.currentState=i.initialState,i._params=new x.Params,i._params.addParam(0),i._collect=0,i.precedingCodepoint=0,i._printHandlerFb=function(s,l,c){},i._executeHandlerFb=function(s){},i._csiHandlerFb=function(s,l){},i._escHandlerFb=function(s){},i._errorHandlerFb=function(s){return s},i._printHandler=i._printHandlerFb,i._executeHandlers=Object.create(null),i._csiHandlers=Object.create(null),i._escHandlers=Object.create(null),i._oscParser=new g.OscParser,i._dcsParser=new h.DcsParser,i._errorHandler=i._errorHandlerFb,i.setEscHandler({final:"\\"},function(){}),i}return M(n,r),n.prototype._identifier=function(t,i){i===void 0&&(i=[64,126]);var s=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if((s=t.prefix.charCodeAt(0))&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var l=0;l<t.intermediates.length;++l){var c=t.intermediates.charCodeAt(l);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=c}}if(t.final.length!==1)throw new Error("final must be a single byte");var d=t.final.charCodeAt(0);if(i[0]>d||d>i[1])throw new Error("final must be in range "+i[0]+" .. "+i[1]);return s<<=8,s|=d},n.prototype.identToString=function(t){for(var i=[];t;)i.push(String.fromCharCode(255&t)),t>>=8;return i.reverse().join("")},n.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},n.prototype.setPrintHandler=function(t){this._printHandler=t},n.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},n.prototype.addEscHandler=function(t,i){var s=this._identifier(t,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);var l=this._escHandlers[s];return l.push(i),{dispose:function(){var c=l.indexOf(i);c!==-1&&l.splice(c,1)}}},n.prototype.setEscHandler=function(t,i){this._escHandlers[this._identifier(t,[48,126])]=[i]},n.prototype.clearEscHandler=function(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]},n.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},n.prototype.setExecuteHandler=function(t,i){this._executeHandlers[t.charCodeAt(0)]=i},n.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},n.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},n.prototype.addCsiHandler=function(t,i){var s=this._identifier(t);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);var l=this._csiHandlers[s];return l.push(i),{dispose:function(){var c=l.indexOf(i);c!==-1&&l.splice(c,1)}}},n.prototype.setCsiHandler=function(t,i){this._csiHandlers[this._identifier(t)]=[i]},n.prototype.clearCsiHandler=function(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]},n.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},n.prototype.addDcsHandler=function(t,i){return this._dcsParser.addHandler(this._identifier(t),i)},n.prototype.setDcsHandler=function(t,i){this._dcsParser.setHandler(this._identifier(t),i)},n.prototype.clearDcsHandler=function(t){this._dcsParser.clearHandler(this._identifier(t))},n.prototype.setDcsHandlerFallback=function(t){this._dcsParser.setHandlerFallback(t)},n.prototype.addOscHandler=function(t,i){return this._oscParser.addHandler(t,i)},n.prototype.setOscHandler=function(t,i){this._oscParser.setHandler(t,i)},n.prototype.clearOscHandler=function(t){this._oscParser.clearHandler(t)},n.prototype.setOscHandlerFallback=function(t){this._oscParser.setHandlerFallback(t)},n.prototype.setErrorHandler=function(t){this._errorHandler=t},n.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},n.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},n.prototype.parse=function(t,i){for(var s=0,l=0,c=this.currentState,d=this._oscParser,w=this._dcsParser,m=this._collect,S=this._params,C=this._transitions.table,v=0;v<i;++v){switch((l=C[c<<8|((s=t[v])<160?s:160)])>>4){case 2:for(var y=v+1;;++y){if(y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}if(++y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}if(++y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}if(++y>=i||(s=t[y])<32||s>126&&s<160){this._printHandler(t,v,y),v=y-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:s,currentState:c,collect:m,params:S,abort:!1}).abort)return;break;case 7:for(var T=this._csiHandlers[m<<8|s],A=T?T.length-1:-1;A>=0&&T[A](S)===!1;A--);A<0&&this._csiHandlerFb(m<<8|s,S),this.precedingCodepoint=0;break;case 8:do switch(s){case 59:S.addParam(0);break;case 58:S.addSubParam(-1);break;default:S.addDigit(s-48)}while(++v<i&&(s=t[v])>47&&s<60);v--;break;case 9:m<<=8,m|=s;break;case 10:for(var p=this._escHandlers[m<<8|s],D=p?p.length-1:-1;D>=0&&p[D]()===!1;D--);D<0&&this._escHandlerFb(m<<8|s),this.precedingCodepoint=0;break;case 11:S.reset(),S.addParam(0),m=0;break;case 12:w.hook(m<<8|s,S);break;case 13:for(var O=v+1;;++O)if(O>=i||(s=t[O])===24||s===26||s===27||s>127&&s<160){w.put(t,v,O),v=O-1;break}break;case 14:w.unhook(s!==24&&s!==26),s===27&&(l|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0;break;case 4:d.start();break;case 5:for(var P=v+1;;P++)if(P>=i||(s=t[P])<32||s>127&&s<=159){d.put(t,v,P),v=P-1;break}break;case 6:d.end(s!==24&&s!==26),s===27&&(l|=1),S.reset(),S.addParam(0),m=0,this.precedingCodepoint=0}c=15&l}this._collect=m,this.currentState=c},n}(f.Disposable);L.EscapeSequenceParser=u},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(d,w){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(d,w)},function(d,w){function m(){this.constructor=d}k(d,w),d.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),f=this&&this.__decorate||function(d,w,m,S){var C,v=arguments.length,y=v<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,w,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(v<3?C(y):v>3?C(w,m,y):C(w,m))||y);return v>3&&y&&Object.defineProperty(w,m,y),y},E=this&&this.__param||function(d,w){return function(m,S){w(m,S,d)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Renderer=void 0;var x=I(41),g=I(47),h=I(48),o=I(49),u=I(29),r=I(2),n=I(5),t=I(1),i=I(25),s=I(0),l=1,c=function(d){function w(m,S,C,v,y,T,A,p,D){var O=d.call(this)||this;O._colors=m,O._screenElement=S,O._bufferService=y,O._charSizeService=T,O._optionsService=A,O._id=l++,O._onRequestRedraw=new s.EventEmitter;var P=O._optionsService.options.allowTransparency;return O._characterJoinerRegistry=new u.CharacterJoinerRegistry(O._bufferService),O._renderLayers=[new x.TextRenderLayer(O._screenElement,0,O._colors,O._characterJoinerRegistry,P,O._id,O._bufferService,A),new g.SelectionRenderLayer(O._screenElement,1,O._colors,O._id,O._bufferService,A),new o.LinkRenderLayer(O._screenElement,2,O._colors,O._id,C,v,O._bufferService,A),new h.CursorRenderLayer(O._screenElement,3,O._colors,O._id,O._onRequestRedraw,O._bufferService,A,p,D)],O.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},O._devicePixelRatio=window.devicePixelRatio,O._updateDimensions(),O.onOptionsChanged(),O}return M(w,d),Object.defineProperty(w.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){for(var m=0,S=this._renderLayers;m<S.length;m++)S[m].dispose();d.prototype.dispose.call(this),i.removeTerminalFromCache(this._id)},w.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},w.prototype.setColors=function(m){this._colors=m;for(var S=0,C=this._renderLayers;S<C.length;S++){var v=C[S];v.setColors(this._colors),v.reset()}},w.prototype.onResize=function(m,S){this._updateDimensions();for(var C=0,v=this._renderLayers;C<v.length;C++)v[C].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},w.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},w.prototype.onBlur=function(){this._runOperation(function(m){return m.onBlur()})},w.prototype.onFocus=function(){this._runOperation(function(m){return m.onFocus()})},w.prototype.onSelectionChanged=function(m,S,C){C===void 0&&(C=!1),this._runOperation(function(v){return v.onSelectionChanged(m,S,C)})},w.prototype.onCursorMove=function(){this._runOperation(function(m){return m.onCursorMove()})},w.prototype.onOptionsChanged=function(){this._runOperation(function(m){return m.onOptionsChanged()})},w.prototype.clear=function(){this._runOperation(function(m){return m.reset()})},w.prototype._runOperation=function(m){for(var S=0,C=this._renderLayers;S<C.length;S++)m(C[S])},w.prototype.renderRows=function(m,S){for(var C=0,v=this._renderLayers;C<v.length;C++)v[C].onGridChanged(m,S)},w.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},w.prototype.registerCharacterJoiner=function(m){return this._characterJoinerRegistry.registerCharacterJoiner(m)},w.prototype.deregisterCharacterJoiner=function(m){return this._characterJoinerRegistry.deregisterCharacterJoiner(m)},w=f([E(4,t.IBufferService),E(5,n.ICharSizeService),E(6,t.IOptionsService),E(7,t.ICoreService),E(8,n.ICoreBrowserService)],w)}(r.Disposable);L.Renderer=c},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)});Object.defineProperty(L,"__esModule",{value:!0}),L.TextRenderLayer=void 0;var f=I(42),E=I(13),x=I(6),g=I(3),h=I(29),o=I(4),u=function(r){function n(t,i,s,l,c,d,w,m){var S=r.call(this,t,"text",i,c,s,d,w,m)||this;return S._characterWidth=0,S._characterFont="",S._characterOverlapCache={},S._workCell=new o.CellData,S._state=new f.GridCache,S._characterJoinerRegistry=l,S}return M(n,r),n.prototype.resize=function(t){r.prototype.resize.call(this,t);var i=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===i||(this._characterWidth=t.scaledCharWidth,this._characterFont=i,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},n.prototype.reset=function(){this._state.clear(),this._clearAll()},n.prototype._forEachCell=function(t,i,s,l){for(var c=t;c<=i;c++)for(var d=c+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.lines.get(d),m=s?s.getJoinedCharacters(d):[],S=0;S<this._bufferService.cols;S++){w.loadCell(S,this._workCell);var C=this._workCell,v=!1,y=S;if(C.getWidth()!==0){if(m.length>0&&S===m[0][0]){v=!0;var T=m.shift();C=new h.JoinedCellData(this._workCell,w.translateToString(!0,T[0],T[1]),T[1]-T[0]),y=T[1]-1}!v&&this._isOverlapping(C)&&y<w.length-1&&w.getCodePoint(y+1)===g.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=2<<22),l(C,S,c),S=y}}},n.prototype._drawBackground=function(t,i){var s=this,l=this._ctx,c=this._bufferService.cols,d=0,w=0,m=null;l.save(),this._forEachCell(t,i,null,function(S,C,v){var y=null;S.isInverse()?y=S.isFgDefault()?s._colors.foreground.css:S.isFgRGB()?"rgb("+x.AttributeData.toColorRGB(S.getFgColor()).join(",")+")":s._colors.ansi[S.getFgColor()].css:S.isBgRGB()?y="rgb("+x.AttributeData.toColorRGB(S.getBgColor()).join(",")+")":S.isBgPalette()&&(y=s._colors.ansi[S.getBgColor()].css),m===null&&(d=C,w=v),v!==w?(l.fillStyle=m||"",s._fillCells(d,w,c-d,1),d=C,w=v):m!==y&&(l.fillStyle=m||"",s._fillCells(d,w,C-d,1),d=C,w=v),m=y}),m!==null&&(l.fillStyle=m,this._fillCells(d,w,c-d,1)),l.restore()},n.prototype._drawForeground=function(t,i){var s=this;this._forEachCell(t,i,this._characterJoinerRegistry,function(l,c,d){if(!l.isInvisible()&&(s._drawChars(l,c,d),l.isUnderline())){if(s._ctx.save(),l.isInverse())if(l.isBgDefault())s._ctx.fillStyle=s._colors.background.css;else if(l.isBgRGB())s._ctx.fillStyle="rgb("+x.AttributeData.toColorRGB(l.getBgColor()).join(",")+")";else{var w=l.getBgColor();s._optionsService.options.drawBoldTextInBrightColors&&l.isBold()&&w<8&&(w+=8),s._ctx.fillStyle=s._colors.ansi[w].css}else if(l.isFgDefault())s._ctx.fillStyle=s._colors.foreground.css;else if(l.isFgRGB())s._ctx.fillStyle="rgb("+x.AttributeData.toColorRGB(l.getFgColor()).join(",")+")";else{var m=l.getFgColor();s._optionsService.options.drawBoldTextInBrightColors&&l.isBold()&&m<8&&(m+=8),s._ctx.fillStyle=s._colors.ansi[m].css}s._fillBottomLineAtCells(c,d,l.getWidth()),s._ctx.restore()}})},n.prototype.onGridChanged=function(t,i){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,t,this._bufferService.cols,i-t+1),this._drawBackground(t,i),this._drawForeground(t,i))},n.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},n.prototype._isOverlapping=function(t){if(t.getWidth()!==1)return!1;if(t.getCode()<256)return!1;var i=t.getChars();if(this._characterOverlapCache.hasOwnProperty(i))return this._characterOverlapCache[i];this._ctx.save(),this._ctx.font=this._characterFont;var s=Math.floor(this._ctx.measureText(i).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[i]=s,s},n}(E.BaseRenderLayer);L.TextRenderLayer=u},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.GridCache=void 0;var k=function(){function M(){this.cache=[]}return M.prototype.resize=function(f,E){for(var x=0;x<f;x++){this.cache.length<=x&&this.cache.push([]);for(var g=this.cache[x].length;g<E;g++)this.cache[x].push(void 0);this.cache[x].length=E}this.cache.length=f},M.prototype.clear=function(){for(var f=0;f<this.cache.length;f++)for(var E=0;E<this.cache[f].length;E++)this.cache[f][E]=void 0},M}();L.GridCache=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(s,l){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var w in d)d.hasOwnProperty(w)&&(c[w]=d[w])})(s,l)},function(s,l){function c(){this.constructor=s}k(s,l),s.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)});Object.defineProperty(L,"__esModule",{value:!0}),L.NoneCharAtlas=L.DynamicCharAtlas=L.getGlyphCacheKey=void 0;var f=I(9),E=I(44),x=I(27),g=I(46),h=I(11),o=I(28),u=I(10),r={css:"rgba(0, 0, 0, 0)",rgba:0};function n(s){return s.code<<21|s.bg<<12|s.fg<<3|(s.bold?0:4)+(s.dim?0:2)+(s.italic?0:1)}L.getGlyphCacheKey=n;var t=function(s){function l(c,d){var w=s.call(this)||this;w._config=d,w._drawToCacheCount=0,w._glyphsWaitingOnBitmap=[],w._bitmapCommitTimeout=null,w._bitmap=null,w._cacheCanvas=c.createElement("canvas"),w._cacheCanvas.width=1024,w._cacheCanvas.height=1024,w._cacheCtx=o.throwIfFalsy(w._cacheCanvas.getContext("2d",{alpha:!0}));var m=c.createElement("canvas");m.width=w._config.scaledCharWidth,m.height=w._config.scaledCharHeight,w._tmpCtx=o.throwIfFalsy(m.getContext("2d",{alpha:w._config.allowTransparency})),w._width=Math.floor(1024/w._config.scaledCharWidth),w._height=Math.floor(1024/w._config.scaledCharHeight);var S=w._width*w._height;return w._cacheMap=new g.LRUMap(S),w._cacheMap.prealloc(S),w}return M(l,s),l.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},l.prototype.beginFrame=function(){this._drawToCacheCount=0},l.prototype.draw=function(c,d,w,m){if(d.code===32)return!0;if(!this._canCache(d))return!1;var S=n(d),C=this._cacheMap.get(S);if(C!=null)return this._drawFromCache(c,C,w,m),!0;if(this._drawToCacheCount<100){var v=void 0;v=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var y=this._drawToCache(d,v);return this._cacheMap.set(S,y),this._drawFromCache(c,y,w,m),!0}return!1},l.prototype._canCache=function(c){return c.code<256},l.prototype._toCoordinateX=function(c){return c%this._width*this._config.scaledCharWidth},l.prototype._toCoordinateY=function(c){return Math.floor(c/this._width)*this._config.scaledCharHeight},l.prototype._drawFromCache=function(c,d,w,m){if(!d.isEmpty){var S=this._toCoordinateX(d.index),C=this._toCoordinateY(d.index);c.drawImage(d.inBitmap?this._bitmap:this._cacheCanvas,S,C,this._config.scaledCharWidth,this._config.scaledCharHeight,w,m,this._config.scaledCharWidth,this._config.scaledCharHeight)}},l.prototype._getColorFromAnsiIndex=function(c){return c<this._config.colors.ansi.length?this._config.colors.ansi[c]:x.DEFAULT_ANSI_COLORS[c]},l.prototype._getBackgroundColor=function(c){return this._config.allowTransparency?r:c.bg===f.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:c.bg<256?this._getColorFromAnsiIndex(c.bg):this._config.colors.background},l.prototype._getForegroundColor=function(c){return c.fg===f.INVERTED_DEFAULT_COLOR?u.color.opaque(this._config.colors.background):c.fg<256?this._getColorFromAnsiIndex(c.fg):this._config.colors.foreground},l.prototype._drawToCache=function(c,d){this._drawToCacheCount++,this._tmpCtx.save();var w=this._getBackgroundColor(c);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=w.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var m=c.bold?this._config.fontWeightBold:this._config.fontWeight,S=c.italic?"italic":"";this._tmpCtx.font=S+" "+m+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(c).css,c.dim&&(this._tmpCtx.globalAlpha=f.DIM_OPACITY),this._tmpCtx.fillText(c.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var C=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),v=!1;this._config.allowTransparency||(v=function(p,D){for(var O=!0,P=D.rgba>>>24,j=D.rgba>>>16&255,K=D.rgba>>>8&255,U=0;U<p.data.length;U+=4)p.data[U]===P&&p.data[U+1]===j&&p.data[U+2]===K?p.data[U+3]=0:O=!1;return O}(C,w));var y=this._toCoordinateX(d),T=this._toCoordinateY(d);this._cacheCtx.putImageData(C,y,T);var A={index:d,isEmpty:v,inBitmap:!1};return this._addGlyphToBitmap(A),A},l.prototype._addGlyphToBitmap=function(c){var d=this;!("createImageBitmap"in window)||h.isFirefox||h.isSafari||(this._glyphsWaitingOnBitmap.push(c),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return d._generateBitmap()},100)))},l.prototype._generateBitmap=function(){var c=this,d=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(w){c._bitmap=w;for(var m=0;m<d.length;m++)d[m].inBitmap=!0}),this._bitmapCommitTimeout=null},l}(E.BaseCharAtlas);L.DynamicCharAtlas=t;var i=function(s){function l(c,d){return s.call(this)||this}return M(l,s),l.prototype.draw=function(c,d,w,m){return!1},l}(E.BaseCharAtlas);L.NoneCharAtlas=i},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BaseCharAtlas=void 0;var k=function(){function M(){this._didWarmUp=!1}return M.prototype.dispose=function(){},M.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},M.prototype._doWarmUp=function(){},M.prototype.beginFrame=function(){},M}();L.BaseCharAtlas=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.ColorContrastCache=void 0;var k=function(){function M(){this._color={},this._rgba={}}return M.prototype.clear=function(){this._color={},this._rgba={}},M.prototype.setCss=function(f,E,x){this._rgba[f]||(this._rgba[f]={}),this._rgba[f][E]=x},M.prototype.getCss=function(f,E){return this._rgba[f]?this._rgba[f][E]:void 0},M.prototype.setColor=function(f,E,x){this._color[f]||(this._color[f]={}),this._color[f][E]=x},M.prototype.getColor=function(f,E){return this._color[f]?this._color[f][E]:void 0},M}();L.ColorContrastCache=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.LRUMap=void 0;var k=function(){function M(f){this.capacity=f,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return M.prototype._unlinkNode=function(f){var E=f.prev,x=f.next;f===this._head&&(this._head=x),f===this._tail&&(this._tail=E),E!==null&&(E.next=x),x!==null&&(x.prev=E)},M.prototype._appendNode=function(f){var E=this._tail;E!==null&&(E.next=f),f.prev=E,f.next=null,this._tail=f,this._head===null&&(this._head=f)},M.prototype.prealloc=function(f){for(var E=this._nodePool,x=0;x<f;x++)E.push({prev:null,next:null,key:null,value:null})},M.prototype.get=function(f){var E=this._map[f];return E!==void 0?(this._unlinkNode(E),this._appendNode(E),E.value):null},M.prototype.peekValue=function(f){var E=this._map[f];return E!==void 0?E.value:null},M.prototype.peek=function(){var f=this._head;return f===null?null:f.value},M.prototype.set=function(f,E){var x=this._map[f];if(x!==void 0)x=this._map[f],this._unlinkNode(x),x.value=E;else if(this.size>=this.capacity)x=this._head,this._unlinkNode(x),delete this._map[x.key],x.key=f,x.value=E,this._map[f]=x;else{var g=this._nodePool;g.length>0?((x=g.pop()).key=f,x.value=E):x={prev:null,next:null,key:f,value:E},this._map[f]=x,this.size++}this._appendNode(x)},M}();L.LRUMap=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(E,x){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,h){g.__proto__=h}||function(g,h){for(var o in h)h.hasOwnProperty(o)&&(g[o]=h[o])})(E,x)},function(E,x){function g(){this.constructor=E}k(E,x),E.prototype=x===null?Object.create(x):(g.prototype=x.prototype,new g)});Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionRenderLayer=void 0;var f=function(E){function x(g,h,o,u,r,n){var t=E.call(this,g,"selection",h,!0,o,u,r,n)||this;return t._clearState(),t}return M(x,E),x.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},x.prototype.resize=function(g){E.prototype.resize.call(this,g),this._clearState()},x.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},x.prototype.onSelectionChanged=function(g,h,o){if(this._didStateChange(g,h,o,this._bufferService.buffer.ydisp))if(this._clearAll(),g&&h){var u=g[1]-this._bufferService.buffer.ydisp,r=h[1]-this._bufferService.buffer.ydisp,n=Math.max(u,0),t=Math.min(r,this._bufferService.rows-1);if(!(n>=this._bufferService.rows||t<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var i=g[0],s=h[0]-i,l=t-n+1;this._fillCells(i,n,s,l)}else{i=u===n?g[0]:0;var c=n===t?h[0]:this._bufferService.cols;this._fillCells(i,n,c-i,1);var d=Math.max(t-n-1,0);if(this._fillCells(0,n+1,this._bufferService.cols,d),n!==t){var w=r===t?h[0]:this._bufferService.cols;this._fillCells(0,t,w,1)}}this._state.start=[g[0],g[1]],this._state.end=[h[0],h[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},x.prototype._didStateChange=function(g,h,o,u){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(h,this._state.end)||o!==this._state.columnSelectMode||u!==this._state.ydisp},x.prototype._areCoordinatesEqual=function(g,h){return!(!g||!h)&&g[0]===h[0]&&g[1]===h[1]},x}(I(13).BaseRenderLayer);L.SelectionRenderLayer=f},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(h,o){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,r){u.__proto__=r}||function(u,r){for(var n in r)r.hasOwnProperty(n)&&(u[n]=r[n])})(h,o)},function(h,o){function u(){this.constructor=h}k(h,o),h.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)});Object.defineProperty(L,"__esModule",{value:!0}),L.CursorRenderLayer=void 0;var f=I(13),E=I(4),x=function(h){function o(u,r,n,t,i,s,l,c,d){var w=h.call(this,u,"cursor",r,!0,n,t,s,l)||this;return w._onRequestRedraw=i,w._coreService=c,w._coreBrowserService=d,w._cell=new E.CellData,w._state={x:0,y:0,isFocused:!1,style:"",width:0},w._cursorRenderers={bar:w._renderBarCursor.bind(w),block:w._renderBlockCursor.bind(w),underline:w._renderUnderlineCursor.bind(w)},w}return M(o,h),o.prototype.resize=function(u){h.prototype.resize.call(this,u),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},o.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},o.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onOptionsChanged=function(){var u,r=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new g(this._coreBrowserService.isFocused,function(){r._render(!0)})):((u=this._cursorBlinkStateManager)===null||u===void 0||u.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype.onGridChanged=function(u,r){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype._render=function(u){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var r=this._bufferService.buffer.ybase+this._bufferService.buffer.y,n=r-this._bufferService.buffer.ydisp;if(n<0||n>=this._bufferService.rows)this._clearCursor();else{var t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(r).loadCell(t,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var i=this._optionsService.options.cursorStyle;return i&&i!=="block"?this._cursorRenderers[i](t,n,this._cell):this._renderBlurCursor(t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=i,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},o.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},o.prototype._renderBarCursor=function(u,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(u,r,this._optionsService.options.cursorWidth),this._ctx.restore()},o.prototype._renderBlockCursor=function(u,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(u,r,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(n,u,r),this._ctx.restore()},o.prototype._renderUnderlineCursor=function(u,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(u,r),this._ctx.restore()},o.prototype._renderBlurCursor=function(u,r,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(u,r,n.getWidth(),1),this._ctx.restore()},o}(f.BaseRenderLayer);L.CursorRenderLayer=x;var g=function(){function h(o,u){this._renderCallback=u,this.isCursorVisible=!0,o&&this._restartInterval()}return Object.defineProperty(h.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),h.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},h.prototype.restartBlinkAnimation=function(){var o=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){o._renderCallback(),o._animationFrame=void 0})))},h.prototype._restartInterval=function(o){var u=this;o===void 0&&(o=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(u._animationTimeRestarted){var r=600-(Date.now()-u._animationTimeRestarted);if(u._animationTimeRestarted=void 0,r>0)return void u._restartInterval(r)}u.isCursorVisible=!1,u._animationFrame=window.requestAnimationFrame(function(){u._renderCallback(),u._animationFrame=void 0}),u._blinkInterval=window.setInterval(function(){if(u._animationTimeRestarted){var n=600-(Date.now()-u._animationTimeRestarted);return u._animationTimeRestarted=void 0,void u._restartInterval(n)}u.isCursorVisible=!u.isCursorVisible,u._animationFrame=window.requestAnimationFrame(function(){u._renderCallback(),u._animationFrame=void 0})},600)},o)},h.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},h.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},h}()},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(h,o){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,r){u.__proto__=r}||function(u,r){for(var n in r)r.hasOwnProperty(n)&&(u[n]=r[n])})(h,o)},function(h,o){function u(){this.constructor=h}k(h,o),h.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)});Object.defineProperty(L,"__esModule",{value:!0}),L.LinkRenderLayer=void 0;var f=I(13),E=I(9),x=I(26),g=function(h){function o(u,r,n,t,i,s,l,c){var d=h.call(this,u,"link",r,!0,n,t,l,c)||this;return i.onShowLinkUnderline(function(w){return d._onShowLinkUnderline(w)}),i.onHideLinkUnderline(function(w){return d._onHideLinkUnderline(w)}),s.onShowLinkUnderline(function(w){return d._onShowLinkUnderline(w)}),s.onHideLinkUnderline(function(w){return d._onHideLinkUnderline(w)}),d}return M(o,h),o.prototype.resize=function(u){h.prototype.resize.call(this,u),this._state=void 0},o.prototype.reset=function(){this._clearCurrentLink()},o.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var u=this._state.y2-this._state.y1-1;u>0&&this._clearCells(0,this._state.y1+1,this._state.cols,u),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},o.prototype._onShowLinkUnderline=function(u){if(u.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:u.fg&&x.is256Color(u.fg)?this._ctx.fillStyle=this._colors.ansi[u.fg].css:this._ctx.fillStyle=this._colors.foreground.css,u.y1===u.y2)this._fillBottomLineAtCells(u.x1,u.y1,u.x2-u.x1);else{this._fillBottomLineAtCells(u.x1,u.y1,u.cols-u.x1);for(var r=u.y1+1;r<u.y2;r++)this._fillBottomLineAtCells(0,r,u.cols);this._fillBottomLineAtCells(0,u.y2,u.x2)}this._state=u},o.prototype._onHideLinkUnderline=function(u){this._clearCurrentLink()},o}(f.BaseRenderLayer);L.LinkRenderLayer=g},function(V,L,I){"use strict";var k=this&&this.__decorate||function(h,o,u,r){var n,t=arguments.length,i=t<3?o:r===null?r=Object.getOwnPropertyDescriptor(o,u):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(h,o,u,r);else for(var s=h.length-1;s>=0;s--)(n=h[s])&&(i=(t<3?n(i):t>3?n(o,u,i):n(o,u))||i);return t>3&&i&&Object.defineProperty(o,u,i),i},M=this&&this.__param||function(h,o){return function(u,r){o(u,r,h)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseZone=L.Linkifier=void 0;var f=I(0),E=I(1),x=function(){function h(o,u,r){this._bufferService=o,this._logService=u,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new f.EventEmitter,this._onHideLinkUnderline=new f.EventEmitter,this._onLinkTooltip=new f.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(h.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),h.prototype.attachToDom=function(o,u){this._element=o,this._mouseZoneManager=u},h.prototype.linkifyRows=function(o,u){var r=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=o,this._rowsToLinkify.end=u):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,o),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,u)),this._mouseZoneManager.clearAll(o,u),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return r._linkifyRows()},h._timeBeforeLatency))},h.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var o=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var u=o.ydisp+this._rowsToLinkify.start;if(!(u>=o.lines.length)){for(var r=o.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,n=Math.ceil(2e3/this._bufferService.cols),t=this._bufferService.buffer.iterator(!1,u,r,n,n);t.hasNext();)for(var i=t.next(),s=0;s<this._linkMatchers.length;s++)this._doLinkifyRow(i.range.first,i.content,this._linkMatchers[s]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},h.prototype.registerLinkMatcher=function(o,u,r){if(r===void 0&&(r={}),!u)throw new Error("handler must be defined");var n={id:this._nextLinkMatcherId++,regex:o,handler:u,matchIndex:r.matchIndex,validationCallback:r.validationCallback,hoverTooltipCallback:r.tooltipCallback,hoverLeaveCallback:r.leaveCallback,willLinkActivate:r.willLinkActivate,priority:r.priority||0};return this._addLinkMatcherToList(n),n.id},h.prototype._addLinkMatcherToList=function(o){if(this._linkMatchers.length!==0){for(var u=this._linkMatchers.length-1;u>=0;u--)if(o.priority<=this._linkMatchers[u].priority)return void this._linkMatchers.splice(u+1,0,o);this._linkMatchers.splice(0,0,o)}else this._linkMatchers.push(o)},h.prototype.deregisterLinkMatcher=function(o){for(var u=0;u<this._linkMatchers.length;u++)if(this._linkMatchers[u].id===o)return this._linkMatchers.splice(u,1),!0;return!1},h.prototype._doLinkifyRow=function(o,u,r){for(var n,t=this,i=new RegExp(r.regex.source,(r.regex.flags||"")+"g"),s=-1,l=function(){var d=n[typeof r.matchIndex!="number"?0:r.matchIndex];if(!d)return c._logService.debug("match found without corresponding matchIndex",n,r),"break";if(s=u.indexOf(d,s+1),i.lastIndex=s+d.length,s<0)return"break";var w=c._bufferService.buffer.stringIndexToBufferIndex(o,s);if(w[0]<0)return"break";var m=c._bufferService.buffer.lines.get(w[0]);if(!m)return"break";var S=m.getFg(w[1]),C=S?S>>9&511:void 0;r.validationCallback?r.validationCallback(d,function(v){t._rowsTimeoutId||v&&t._addLink(w[1],w[0]-t._bufferService.buffer.ydisp,d,r,C)}):c._addLink(w[1],w[0]-c._bufferService.buffer.ydisp,d,r,C)},c=this;(n=i.exec(u))!==null&&!(l()==="break"););},h.prototype._addLink=function(o,u,r,n,t){var i=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(r),l=o%this._bufferService.cols,c=u+Math.floor(o/this._bufferService.cols),d=(l+s)%this._bufferService.cols,w=c+Math.floor((l+s)/this._bufferService.cols);d===0&&(d=this._bufferService.cols,w--),this._mouseZoneManager.add(new g(l+1,c+1,d+1,w+1,function(m){if(n.handler)return n.handler(m,r);var S=window.open();S?(S.opener=null,S.location.href=r):console.warn("Opening link blocked as opener could not be cleared")},function(){i._onShowLinkUnderline.fire(i._createLinkHoverEvent(l,c,d,w,t)),i._element.classList.add("xterm-cursor-pointer")},function(m){i._onLinkTooltip.fire(i._createLinkHoverEvent(l,c,d,w,t)),n.hoverTooltipCallback&&n.hoverTooltipCallback(m,r,{start:{x:l,y:c},end:{x:d,y:w}})},function(){i._onHideLinkUnderline.fire(i._createLinkHoverEvent(l,c,d,w,t)),i._element.classList.remove("xterm-cursor-pointer"),n.hoverLeaveCallback&&n.hoverLeaveCallback()},function(m){return!n.willLinkActivate||n.willLinkActivate(m,r)}))}},h.prototype._createLinkHoverEvent=function(o,u,r,n,t){return{x1:o,y1:u,x2:r,y2:n,cols:this._bufferService.cols,fg:t}},h._timeBeforeLatency=200,h=k([M(0,E.IBufferService),M(1,E.ILogService),M(2,E.IUnicodeService)],h)}();L.Linkifier=x;var g=function(h,o,u,r,n,t,i,s,l){this.x1=h,this.y1=o,this.x2=u,this.y2=r,this.clickCallback=n,this.hoverCallback=t,this.tooltipCallback=i,this.leaveCallback=s,this.willLinkActivate=l};L.MouseZone=g},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(d,w){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(d,w)},function(d,w){function m(){this.constructor=d}k(d,w),d.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),f=this&&this.__decorate||function(d,w,m,S){var C,v=arguments.length,y=v<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,w,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(v<3?C(y):v>3?C(w,m,y):C(w,m))||y);return v>3&&y&&Object.defineProperty(w,m,y),y},E=this&&this.__param||function(d,w){return function(m,S){w(m,S,d)}};Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionService=void 0;var x=I(11),g=I(52),h=I(4),o=I(0),u=I(5),r=I(1),n=I(30),t=I(53),i=I(2),s=String.fromCharCode(160),l=new RegExp(s,"g"),c=function(d){function w(m,S,C,v,y,T,A){var p=d.call(this)||this;return p._element=m,p._screenElement=S,p._bufferService=C,p._coreService=v,p._mouseService=y,p._optionsService=T,p._renderService=A,p._dragScrollAmount=0,p._enabled=!0,p._workCell=new h.CellData,p._mouseDownTimeStamp=0,p._onLinuxMouseSelection=p.register(new o.EventEmitter),p._onRedrawRequest=p.register(new o.EventEmitter),p._onSelectionChange=p.register(new o.EventEmitter),p._onRequestScrollLines=p.register(new o.EventEmitter),p._mouseMoveListener=function(D){return p._onMouseMove(D)},p._mouseUpListener=function(D){return p._onMouseUp(D)},p._coreService.onUserInput(function(){p.hasSelection&&p.clearSelection()}),p._trimListener=p._bufferService.buffer.lines.onTrim(function(D){return p._onTrim(D)}),p.register(p._bufferService.buffers.onBufferActivate(function(D){return p._onBufferActivate(D)})),p.enable(),p._model=new g.SelectionModel(p._bufferService),p._activeSelectionMode=0,p}return M(w,d),Object.defineProperty(w.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){this._removeMouseDownListeners()},w.prototype.reset=function(){this.clearSelection()},w.prototype.disable=function(){this.clearSelection(),this._enabled=!1},w.prototype.enable=function(){this._enabled=!0},Object.defineProperty(w.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"hasSelection",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!m||!S)&&(m[0]!==S[0]||m[1]!==S[1])},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!m||!S)return"";var C=this._bufferService.buffer,v=[];if(this._activeSelectionMode===3){if(m[0]===S[0])return"";for(var y=m[1];y<=S[1];y++){var T=C.translateBufferLineToString(y,!0,m[0],S[0]);v.push(T)}}else{var A=m[1]===S[1]?S[0]:void 0;for(v.push(C.translateBufferLineToString(m[1],!0,m[0],A)),y=m[1]+1;y<=S[1]-1;y++){var p=C.lines.get(y);T=C.translateBufferLineToString(y,!0),p&&p.isWrapped?v[v.length-1]+=T:v.push(T)}m[1]!==S[1]&&(p=C.lines.get(S[1]),T=C.translateBufferLineToString(S[1],!0,0,S[0]),p&&p.isWrapped?v[v.length-1]+=T:v.push(T))}return v.map(function(D){return D.replace(l," ")}).join(x.isWindows?`\r
`:`
`)},enumerable:!1,configurable:!0}),w.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},w.prototype.refresh=function(m){var S=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return S._refresh()})),x.isLinux&&m)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},w.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},w.prototype.isClickInSelection=function(m){var S=this._getMouseBufferCoords(m),C=this._model.finalSelectionStart,v=this._model.finalSelectionEnd;return!!(C&&v&&S)&&this._areCoordsInSelection(S,C,v)},w.prototype._areCoordsInSelection=function(m,S,C){return m[1]>S[1]&&m[1]<C[1]||S[1]===C[1]&&m[1]===S[1]&&m[0]>=S[0]&&m[0]<C[0]||S[1]<C[1]&&m[1]===C[1]&&m[0]<C[0]||S[1]<C[1]&&m[1]===S[1]&&m[0]>=S[0]},w.prototype.selectWordAtCursor=function(m){var S=this._getMouseBufferCoords(m);S&&(this._selectWordAt(S,!1),this._model.selectionEnd=void 0,this.refresh(!0))},w.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},w.prototype.selectLines=function(m,S){this._model.clearSelection(),m=Math.max(m,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()},w.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},w.prototype._getMouseBufferCoords=function(m){var S=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S},w.prototype._getMouseEventScrollAmount=function(m){var S=n.getCoordsRelativeToElement(m,this._screenElement)[1],C=this._renderService.dimensions.canvasHeight;return S>=0&&S<=C?0:(S>C&&(S-=C),S=Math.min(Math.max(S,-50),50),(S/=50)/Math.abs(S)+Math.round(14*S))},w.prototype.shouldForceSelection=function(m){return x.isMac?m.altKey&&this._optionsService.options.macOptionClickForcesSelection:m.shiftKey},w.prototype.onMouseDown=function(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._onIncrementalClick(m):m.detail===1?this._onSingleClick(m):m.detail===2?this._onDoubleClick(m):m.detail===3&&this._onTripleClick(m),this._addMouseDownListeners(),this.refresh(!0)}},w.prototype._addMouseDownListeners=function(){var m=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return m._dragScroll()},50)},w.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},w.prototype._onIncrementalClick=function(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))},w.prototype._onSingleClick=function(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),this._model.selectionStart){this._model.selectionEnd=void 0;var S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},w.prototype._onDoubleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=1,this._selectWordAt(S,!0))},w.prototype._onTripleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))},w.prototype.shouldColumnSelect=function(m){return m.altKey&&!(x.isMac&&this._optionsService.options.macOptionClickForcesSelection)},w.prototype._onMouseMove=function(m){if(m.stopImmediatePropagation(),this._model.selectionStart){var S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){var v=C.lines.get(this._model.selectionEnd[1]);v&&v.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},w.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}},w.prototype._onMouseUp=function(m){var S=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&m.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var C=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){var v=t.moveToCellSequence(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(v,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},w.prototype._onBufferActivate=function(m){var S=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(C){return S._onTrim(C)})},w.prototype._convertViewportColToCharacterIndex=function(m,S){for(var C=S[0],v=0;S[0]>=v;v++){var y=m.loadCell(v,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&S[0]!==v&&(C+=y-1)}return C},w.prototype.setSelection=function(m,S,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,S],this._model.selectionStartLength=C,this.refresh()},w.prototype._getWordAt=function(m,S,C,v){if(C===void 0&&(C=!0),v===void 0&&(v=!0),!(m[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,T=y.lines.get(m[1]);if(T){var A=y.translateBufferLineToString(m[1],!1),p=this._convertViewportColToCharacterIndex(T,m),D=p,O=m[0]-p,P=0,j=0,K=0,U=0;if(A.charAt(p)===" "){for(;p>0&&A.charAt(p-1)===" ";)p--;for(;D<A.length&&A.charAt(D+1)===" ";)D++}else{var X=m[0],B=m[0];T.getWidth(X)===0&&(P++,X--),T.getWidth(B)===2&&(j++,B++);var N=T.getString(B).length;for(N>1&&(U+=N-1,D+=N-1);X>0&&p>0&&!this._isCharWordSeparator(T.loadCell(X-1,this._workCell));){T.loadCell(X-1,this._workCell);var z=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,X--):z>1&&(K+=z-1,p-=z-1),p--,X--}for(;B<T.length&&D+1<A.length&&!this._isCharWordSeparator(T.loadCell(B+1,this._workCell));){T.loadCell(B+1,this._workCell);var te=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,B++):te>1&&(U+=te-1,D+=te-1),D++,B++}}D++;var ce=p+O-P+K,be=Math.min(this._bufferService.cols,D-p+P+j-K-U);if(S||A.slice(p,D).trim()!==""){if(C&&ce===0&&T.getCodePoint(0)!==32){var Fe=y.lines.get(m[1]-1);if(Fe&&T.isWrapped&&Fe.getCodePoint(this._bufferService.cols-1)!==32){var Oe=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Oe){var Re=this._bufferService.cols-Oe.start;ce-=Re,be+=Re}}}if(v&&ce+be===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){var Be=y.lines.get(m[1]+1);if(Be&&Be.isWrapped&&Be.getCodePoint(0)!==32){var Ke=this._getWordAt([0,m[1]+1],!1,!1,!0);Ke&&(be+=Ke.length)}}return{start:ce,length:be}}}}},w.prototype._selectWordAt=function(m,S){var C=this._getWordAt(m,S);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[C.start,m[1]],this._model.selectionStartLength=C.length}},w.prototype._selectToWordAt=function(m){var S=this._getWordAt(m,!0);if(S){for(var C=m[1];S.start<0;)S.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,C]}},w.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},w.prototype._selectLineAt=function(m){var S=this._bufferService.buffer.getWrappedRangeForLine(m);this._model.selectionStart=[0,S.first],this._model.selectionEnd=[this._bufferService.cols,S.last],this._model.selectionStartLength=0},w=f([E(2,r.IBufferService),E(3,r.ICoreService),E(4,u.IMouseService),E(5,r.IOptionsService),E(6,u.IRenderService)],w)}(i.Disposable);L.SelectionService=c},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.SelectionModel=void 0;var k=function(){function M(f){this._bufferService=f,this.isSelectAllActive=!1,this.selectionStartLength=0}return M.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(M.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),M.prototype.areSelectionValuesReversed=function(){var f=this.selectionStart,E=this.selectionEnd;return!(!f||!E)&&(f[1]>E[1]||f[1]===E[1]&&f[0]>E[0])},M.prototype.onTrim=function(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},M}();L.SelectionModel=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.moveToCellSequence=void 0;var k=I(12);function M(o,u,r,n){var t=o-f(r,o),i=u-f(r,u);return h(Math.abs(t-i)-function(s,l,c){for(var d=0,w=s-f(c,s),m=l-f(c,l),S=0;S<Math.abs(w-m);S++){var C=E(s,l)==="A"?-1:1,v=c.buffer.lines.get(w+C*S);v&&v.isWrapped&&d++}return d}(o,u,r),g(E(o,u),n))}function f(o,u){for(var r=0,n=o.buffer.lines.get(u),t=n&&n.isWrapped;t&&u>=0&&u<o.rows;)r++,t=(n=o.buffer.lines.get(--u))&&n.isWrapped;return r}function E(o,u){return o>u?"A":"B"}function x(o,u,r,n,t,i){for(var s=o,l=u,c="";s!==r||l!==n;)s+=t?1:-1,t&&s>i.cols-1?(c+=i.buffer.translateBufferLineToString(l,!1,o,s),s=0,o=0,l++):!t&&s<0&&(c+=i.buffer.translateBufferLineToString(l,!1,0,o+1),o=s=i.cols-1,l--);return c+i.buffer.translateBufferLineToString(l,!1,o,s)}function g(o,u){var r=u?"O":"[";return k.C0.ESC+r+o}function h(o,u){o=Math.floor(o);for(var r="",n=0;n<o;n++)r+=u;return r}L.moveToCellSequence=function(o,u,r,n){var t,i=r.buffer.x,s=r.buffer.y;if(!r.buffer.hasScrollback)return function(c,d,w,m,S,C){return M(d,m,S,C).length===0?"":h(x(c,d,c,d-f(S,d),!1,S).length,g("D",C))}(i,s,0,u,r,n)+M(s,u,r,n)+function(c,d,w,m,S,C){var v;v=M(d,m,S,C).length>0?m-f(S,m):d;var y=m,T=function(A,p,D,O,P,j){var K;return K=M(D,O,P,j).length>0?O-f(P,O):p,A<D&&K<=O||A>=D&&K<O?"C":"D"}(c,d,w,m,S,C);return h(x(c,v,w,y,T==="C",S).length,g(T,C))}(i,s,o,u,r,n);if(s===u)return t=i>o?"D":"C",h(Math.abs(i-o),g(t,n));t=s>u?"D":"C";var l=Math.abs(s-u);return h(function(c,d){return d.cols-c}(s>u?o:i,r)+(l-1)*r.cols+1+((s>u?i:o)-1),g(t,n))}},function(V,L,I){"use strict";var k=this&&this.__decorate||function(x,g,h,o){var u,r=arguments.length,n=r<3?g:o===null?o=Object.getOwnPropertyDescriptor(g,h):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(x,g,h,o);else for(var t=x.length-1;t>=0;t--)(u=x[t])&&(n=(r<3?u(n):r>3?u(g,h,n):u(g,h))||n);return r>3&&n&&Object.defineProperty(g,h,n),n},M=this&&this.__param||function(x,g){return function(h,o){g(h,o,x)}};Object.defineProperty(L,"__esModule",{value:!0}),L.SoundService=void 0;var f=I(1),E=function(){function x(g){this._optionsService=g}return Object.defineProperty(x,"audioContext",{get:function(){if(!x._audioContext){var g=window.AudioContext||window.webkitAudioContext;if(!g)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;x._audioContext=new g}return x._audioContext},enumerable:!1,configurable:!0}),x.prototype.playBellSound=function(){var g=x.audioContext;if(g){var h=g.createBufferSource();g.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(o){h.buffer=o,h.connect(g.destination),h.start(0)})}},x.prototype._base64ToArrayBuffer=function(g){for(var h=window.atob(g),o=h.length,u=new Uint8Array(o),r=0;r<o;r++)u[r]=h.charCodeAt(r);return u.buffer},x.prototype._removeMimeType=function(g){return g.split(",")[1]},x=k([M(0,f.IOptionsService)],x)}();L.SoundService=E},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),f=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseZoneManager=void 0;var x=I(2),g=I(7),h=I(5),o=I(1),u=function(r){function n(t,i,s,l,c,d){var w=r.call(this)||this;return w._element=t,w._screenElement=i,w._bufferService=s,w._mouseService=l,w._selectionService=c,w._optionsService=d,w._zones=[],w._areZonesActive=!1,w._lastHoverCoords=[void 0,void 0],w._initialSelectionLength=0,w.register(g.addDisposableDomListener(w._element,"mousedown",function(m){return w._onMouseDown(m)})),w._mouseMoveListener=function(m){return w._onMouseMove(m)},w._mouseLeaveListener=function(m){return w._onMouseLeave(m)},w._clickListener=function(m){return w._onClick(m)},w}return M(n,r),n.prototype.dispose=function(){r.prototype.dispose.call(this),this._deactivate()},n.prototype.add=function(t){this._zones.push(t),this._zones.length===1&&this._activate()},n.prototype.clearAll=function(t,i){if(this._zones.length!==0){t&&i||(t=0,i=this._bufferService.rows-1);for(var s=0;s<this._zones.length;s++){var l=this._zones[s];(l.y1>t&&l.y1<=i+1||l.y2>t&&l.y2<=i+1||l.y1<t&&l.y2>i+1)&&(this._currentZone&&this._currentZone===l&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(s--,1))}this._zones.length===0&&this._deactivate()}},n.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},n.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},n.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},n.prototype._onHover=function(t){var i=this,s=this._findZoneEventAt(t);s!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),s&&(this._currentZone=s,s.hoverCallback&&s.hoverCallback(t),this._tooltipTimeout=window.setTimeout(function(){return i._onTooltip(t)},this._optionsService.options.linkTooltipHoverDuration)))},n.prototype._onTooltip=function(t){this._tooltipTimeout=void 0;var i=this._findZoneEventAt(t);i&&i.tooltipCallback&&i.tooltipCallback(t)},n.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var i=this._findZoneEventAt(t);(i==null?void 0:i.willLinkActivate(t))&&(t.preventDefault(),t.stopImmediatePropagation())}},n.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},n.prototype._onClick=function(t){var i=this._findZoneEventAt(t),s=this._getSelectionLength();i&&s===this._initialSelectionLength&&(i.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},n.prototype._getSelectionLength=function(){var t=this._selectionService.selectionText;return t?t.length:0},n.prototype._findZoneEventAt=function(t){var i=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(i)for(var s=i[0],l=i[1],c=0;c<this._zones.length;c++){var d=this._zones[c];if(d.y1===d.y2){if(l===d.y1&&s>=d.x1&&s<d.x2)return d}else if(l===d.y1&&s>=d.x1||l===d.y2&&s<d.x2||l>d.y1&&l<d.y2)return d}},n=f([E(2,o.IBufferService),E(3,h.IMouseService),E(4,h.ISelectionService),E(5,o.IOptionsService)],n)}(x.Disposable);L.MouseZoneManager=u},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(n,t){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var l in s)s.hasOwnProperty(l)&&(i[l]=s[l])})(n,t)},function(n,t){function i(){this.constructor=n}k(n,t),n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(L,"__esModule",{value:!0}),L.AccessibilityManager=void 0;var f=I(18),E=I(11),x=I(31),g=I(7),h=I(2),o=I(32),u=I(17),r=function(n){function t(i,s){var l=n.call(this)||this;l._terminal=i,l._renderService=s,l._liveRegionLineCount=0,l._charsToConsume=[],l._charsToAnnounce="",l._accessibilityTreeRoot=document.createElement("div"),l._accessibilityTreeRoot.classList.add("xterm-accessibility"),l._rowContainer=document.createElement("div"),l._rowContainer.classList.add("xterm-accessibility-tree"),l._rowContainer.setAttribute("role","list"),l._rowElements=[];for(var c=0;c<l._terminal.rows;c++)l._rowElements[c]=l._createAccessibilityTreeNode(),l._rowContainer.appendChild(l._rowElements[c]);if(l._topBoundaryFocusListener=function(d){return l._onBoundaryFocus(d,0)},l._bottomBoundaryFocusListener=function(d){return l._onBoundaryFocus(d,1)},l._rowElements[0].addEventListener("focus",l._topBoundaryFocusListener),l._rowElements[l._rowElements.length-1].addEventListener("focus",l._bottomBoundaryFocusListener),l._refreshRowsDimensions(),l._accessibilityTreeRoot.appendChild(l._rowContainer),l._renderRowsDebouncer=new x.RenderDebouncer(l._renderRows.bind(l)),l._refreshRows(),l._liveRegion=document.createElement("div"),l._liveRegion.classList.add("live-region"),l._liveRegion.setAttribute("aria-live","assertive"),l._accessibilityTreeRoot.appendChild(l._liveRegion),!l._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return l._terminal.element.insertAdjacentElement("afterbegin",l._accessibilityTreeRoot),l.register(l._renderRowsDebouncer),l.register(l._terminal.onResize(function(d){return l._onResize(d.rows)})),l.register(l._terminal.onRender(function(d){return l._refreshRows(d.start,d.end)})),l.register(l._terminal.onScroll(function(){return l._refreshRows()})),l.register(l._terminal.onA11yChar(function(d){return l._onChar(d)})),l.register(l._terminal.onLineFeed(function(){return l._onChar(`
`)})),l.register(l._terminal.onA11yTab(function(d){return l._onTab(d)})),l.register(l._terminal.onKey(function(d){return l._onKey(d.key)})),l.register(l._terminal.onBlur(function(){return l._clearLiveRegion()})),l.register(l._renderService.onDimensionsChange(function(){return l._refreshRowsDimensions()})),l._screenDprMonitor=new o.ScreenDprMonitor,l.register(l._screenDprMonitor),l._screenDprMonitor.setListener(function(){return l._refreshRowsDimensions()}),l.register(g.addDisposableDomListener(window,"resize",function(){return l._refreshRowsDimensions()})),l}return M(t,n),t.prototype.dispose=function(){n.prototype.dispose.call(this),u.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(i,s){var l=i.target,c=this._rowElements[s===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")!==(s===0?"1":""+this._terminal.buffer.lines.length)&&i.relatedTarget===c){var d,w;if(s===0?(d=l,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(d=this._rowElements.shift(),w=l,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){var m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else m=this._createAccessibilityTreeNode(),this._rowElements.push(m),this._rowContainer.appendChild(m);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}},t.prototype._onResize=function(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i},t.prototype._onTab=function(i){for(var s=0;s<i;s++)this._onChar(" ")},t.prototype._onChar=function(i){var s=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){s._accessibilityTreeRoot.appendChild(s._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&u.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(i){this._clearLiveRegion(),this._charsToConsume.push(i)},t.prototype._refreshRows=function(i,s){this._renderRowsDebouncer.refresh(i,s,this._terminal.rows)},t.prototype._renderRows=function(i,s){for(var l=this._terminal.buffer,c=l.lines.length.toString(),d=i;d<=s;d++){var w=l.translateBufferLineToString(l.ydisp+d,!0),m=(l.ydisp+d+1).toString(),S=this._rowElements[d];S&&(w.length===0?S.innerHTML="&nbsp;":S.textContent=w,S.setAttribute("aria-posinset",m),S.setAttribute("aria-setsize",c))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}},t.prototype._refreshRowDimensions=function(i){i.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(h.Disposable);L.AccessibilityManager=r},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(l,c){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,w){d.__proto__=w}||function(d,w){for(var m in w)w.hasOwnProperty(m)&&(d[m]=w[m])})(l,c)},function(l,c){function d(){this.constructor=l}k(l,c),l.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}),f=this&&this.__decorate||function(l,c,d,w){var m,S=arguments.length,C=S<3?c:w===null?w=Object.getOwnPropertyDescriptor(c,d):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,c,d,w);else for(var v=l.length-1;v>=0;v--)(m=l[v])&&(C=(S<3?m(C):S>3?m(c,d,C):m(c,d))||C);return S>3&&C&&Object.defineProperty(c,d,C),C},E=this&&this.__param||function(l,c){return function(d,w){c(d,w,l)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DomRenderer=void 0;var x=I(58),g=I(9),h=I(2),o=I(5),u=I(1),r=I(0),n=I(10),t=I(17),i=1,s=function(l){function c(d,w,m,S,C,v,y,T,A){var p=l.call(this)||this;return p._colors=d,p._element=w,p._screenElement=m,p._viewportElement=S,p._linkifier=C,p._linkifier2=v,p._charSizeService=y,p._optionsService=T,p._bufferService=A,p._terminalClass=i++,p._rowElements=[],p._rowContainer=document.createElement("div"),p._rowContainer.classList.add("xterm-rows"),p._rowContainer.style.lineHeight="normal",p._rowContainer.setAttribute("aria-hidden","true"),p._refreshRowElements(p._bufferService.cols,p._bufferService.rows),p._selectionContainer=document.createElement("div"),p._selectionContainer.classList.add("xterm-selection"),p._selectionContainer.setAttribute("aria-hidden","true"),p.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},p._updateDimensions(),p._injectCss(),p._rowFactory=new x.DomRendererRowFactory(document,p._optionsService,p._colors),p._element.classList.add("xterm-dom-renderer-owner-"+p._terminalClass),p._screenElement.appendChild(p._rowContainer),p._screenElement.appendChild(p._selectionContainer),p._linkifier.onShowLinkUnderline(function(D){return p._onLinkHover(D)}),p._linkifier.onHideLinkUnderline(function(D){return p._onLinkLeave(D)}),p._linkifier2.onShowLinkUnderline(function(D){return p._onLinkHover(D)}),p._linkifier2.onHideLinkUnderline(function(D){return p._onLinkLeave(D)}),p}return M(c,l),Object.defineProperty(c.prototype,"onRequestRedraw",{get:function(){return new r.EventEmitter().event},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),t.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),l.prototype.dispose.call(this)},c.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var d=0,w=this._rowElements;d<w.length;d++){var m=w[d];m.style.width=this.dimensions.canvasWidth+"px",m.style.height=this.dimensions.actualCellHeight+"px",m.style.lineHeight=this.dimensions.actualCellHeight+"px",m.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var S=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=S,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},c.prototype.setColors=function(d){this._colors=d,this._injectCss()},c.prototype._injectCss=function(){var d=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var w=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";w+=this._terminalSelector+" span:not(."+x.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+x.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+x.ITALIC_CLASS+" { font-style: italic;}",w+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",w+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",w+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+x.CURSOR_CLASS+"."+x.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+x.CURSOR_CLASS+"."+x.CURSOR_BLINK_CLASS+":not(."+x.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+x.CURSOR_CLASS+"."+x.CURSOR_BLINK_CLASS+"."+x.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+x.CURSOR_CLASS+"."+x.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+x.CURSOR_CLASS+"."+x.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+x.CURSOR_CLASS+"."+x.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",w+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(m,S){w+=d._terminalSelector+" .xterm-fg-"+S+" { color: "+m.css+"; }"+d._terminalSelector+" .xterm-bg-"+S+" { background-color: "+m.css+"; }"}),w+=this._terminalSelector+" .xterm-fg-"+g.INVERTED_DEFAULT_COLOR+" { color: "+n.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+g.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=w},c.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},c.prototype._refreshRowElements=function(d,w){for(var m=this._rowElements.length;m<=w;m++){var S=document.createElement("div");this._rowContainer.appendChild(S),this._rowElements.push(S)}for(;this._rowElements.length>w;)this._rowContainer.removeChild(this._rowElements.pop())},c.prototype.onResize=function(d,w){this._refreshRowElements(d,w),this._updateDimensions()},c.prototype.onCharSizeChanged=function(){this._updateDimensions()},c.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},c.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},c.prototype.onSelectionChanged=function(d,w,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(d&&w){var S=d[1]-this._bufferService.buffer.ydisp,C=w[1]-this._bufferService.buffer.ydisp,v=Math.max(S,0),y=Math.min(C,this._bufferService.rows-1);if(!(v>=this._bufferService.rows||y<0)){var T=document.createDocumentFragment();if(m)T.appendChild(this._createSelectionElement(v,d[0],w[0],y-v+1));else{var A=S===v?d[0]:0,p=v===y?w[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(v,A,p));var D=y-v-1;if(T.appendChild(this._createSelectionElement(v+1,0,this._bufferService.cols,D)),v!==y){var O=C===y?w[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(y,0,O))}}this._selectionContainer.appendChild(T)}}},c.prototype._createSelectionElement=function(d,w,m,S){S===void 0&&(S=1);var C=document.createElement("div");return C.style.height=S*this.dimensions.actualCellHeight+"px",C.style.top=d*this.dimensions.actualCellHeight+"px",C.style.left=w*this.dimensions.actualCellWidth+"px",C.style.width=this.dimensions.actualCellWidth*(m-w)+"px",C},c.prototype.onCursorMove=function(){},c.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},c.prototype.clear=function(){for(var d=0,w=this._rowElements;d<w.length;d++)w[d].innerHTML=""},c.prototype.renderRows=function(d,w){for(var m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),C=this._optionsService.options.cursorBlink,v=d;v<=w;v++){var y=this._rowElements[v];y.innerHTML="";var T=v+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.lines.get(T),p=this._optionsService.options.cursorStyle;y.appendChild(this._rowFactory.createRow(A,T===m,p,S,C,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(c.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),c.prototype.registerCharacterJoiner=function(d){return-1},c.prototype.deregisterCharacterJoiner=function(d){return!1},c.prototype._onLinkHover=function(d){this._setCellUnderline(d.x1,d.x2,d.y1,d.y2,d.cols,!0)},c.prototype._onLinkLeave=function(d){this._setCellUnderline(d.x1,d.x2,d.y1,d.y2,d.cols,!1)},c.prototype._setCellUnderline=function(d,w,m,S,C,v){for(;d!==w||m!==S;){var y=this._rowElements[m];if(!y)return;var T=y.children[d];T&&(T.style.textDecoration=v?"underline":"none"),++d>=C&&(d=0,m++)}},c=f([E(6,o.ICharSizeService),E(7,u.IOptionsService),E(8,u.IBufferService)],c)}(h.Disposable);L.DomRenderer=s},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.DomRendererRowFactory=L.CURSOR_STYLE_UNDERLINE_CLASS=L.CURSOR_STYLE_BAR_CLASS=L.CURSOR_STYLE_BLOCK_CLASS=L.CURSOR_BLINK_CLASS=L.CURSOR_CLASS=L.UNDERLINE_CLASS=L.ITALIC_CLASS=L.DIM_CLASS=L.BOLD_CLASS=void 0;var k=I(9),M=I(3),f=I(4),E=I(10);L.BOLD_CLASS="xterm-bold",L.DIM_CLASS="xterm-dim",L.ITALIC_CLASS="xterm-italic",L.UNDERLINE_CLASS="xterm-underline",L.CURSOR_CLASS="xterm-cursor",L.CURSOR_BLINK_CLASS="xterm-cursor-blink",L.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",L.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",L.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var x=function(){function h(o,u,r){this._document=o,this._optionsService=u,this._colors=r,this._workCell=new f.CellData}return h.prototype.setColors=function(o){this._colors=o},h.prototype.createRow=function(o,u,r,n,t,i,s){for(var l=this._document.createDocumentFragment(),c=0,d=Math.min(o.length,s)-1;d>=0;d--)if(o.loadCell(d,this._workCell).getCode()!==M.NULL_CELL_CODE||u&&d===n){c=d+1;break}for(d=0;d<c;d++){o.loadCell(d,this._workCell);var w=this._workCell.getWidth();if(w!==0){var m=this._document.createElement("span");if(w>1&&(m.style.width=i*w+"px"),u&&d===n)switch(m.classList.add(L.CURSOR_CLASS),t&&m.classList.add(L.CURSOR_BLINK_CLASS),r){case"bar":m.classList.add(L.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(L.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(L.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&m.classList.add(L.BOLD_CLASS),this._workCell.isItalic()&&m.classList.add(L.ITALIC_CLASS),this._workCell.isDim()&&m.classList.add(L.DIM_CLASS),this._workCell.isUnderline()&&m.classList.add(L.UNDERLINE_CLASS),this._workCell.isInvisible()?m.textContent=M.WHITESPACE_CELL_CHAR:m.textContent=this._workCell.getChars()||M.WHITESPACE_CELL_CHAR;var S=this._workCell.getFgColor(),C=this._workCell.getFgColorMode(),v=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),T=!!this._workCell.isInverse();if(T){var A=S;S=v,v=A;var p=C;C=y,y=p}switch(C){case 16777216:case 33554432:this._workCell.isBold()&&S<8&&this._optionsService.options.drawBoldTextInBrightColors&&(S+=8),this._applyMinimumContrast(m,this._colors.background,this._colors.ansi[S])||m.classList.add("xterm-fg-"+S);break;case 50331648:var D=E.rgba.toColor(S>>16&255,S>>8&255,255&S);this._applyMinimumContrast(m,this._colors.background,D)||this._addStyle(m,"color:#"+g(S.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(m,this._colors.background,this._colors.foreground)||T&&m.classList.add("xterm-fg-"+k.INVERTED_DEFAULT_COLOR)}switch(y){case 16777216:case 33554432:m.classList.add("xterm-bg-"+v);break;case 50331648:this._addStyle(m,"background-color:#"+g(v.toString(16),"0",6));break;case 0:default:T&&m.classList.add("xterm-bg-"+k.INVERTED_DEFAULT_COLOR)}l.appendChild(m)}}return l},h.prototype._applyMinimumContrast=function(o,u,r){if(this._optionsService.options.minimumContrastRatio===1)return!1;var n=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return n===void 0&&(n=E.color.ensureContrastRatio(u,r,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,n!=null?n:null)),!!n&&(this._addStyle(o,"color:"+n.css),!0)},h.prototype._addStyle=function(o,u){o.setAttribute("style",""+(o.getAttribute("style")||"")+u+";")},h}();function g(h,o,u){for(;h.length<u;)h=o+h;return h}L.DomRendererRowFactory=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.evaluateKeyboardEvent=void 0;var k=I(12),M={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};L.evaluateKeyboardEvent=function(f,E,x,g){var h={type:0,cancel:!1,key:void 0},o=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?h.key=E?k.C0.ESC+"OA":k.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?h.key=E?k.C0.ESC+"OD":k.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?h.key=E?k.C0.ESC+"OC":k.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(h.key=E?k.C0.ESC+"OB":k.C0.ESC+"[B");break;case 8:if(f.shiftKey){h.key=k.C0.BS;break}if(f.altKey){h.key=k.C0.ESC+k.C0.DEL;break}h.key=k.C0.DEL;break;case 9:if(f.shiftKey){h.key=k.C0.ESC+"[Z";break}h.key=k.C0.HT,h.cancel=!0;break;case 13:h.key=f.altKey?k.C0.ESC+k.C0.CR:k.C0.CR,h.cancel=!0;break;case 27:h.key=k.C0.ESC,f.altKey&&(h.key=k.C0.ESC+k.C0.ESC),h.cancel=!0;break;case 37:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"D",h.key===k.C0.ESC+"[1;3D"&&(h.key=k.C0.ESC+(x?"b":"[1;5D"))):h.key=E?k.C0.ESC+"OD":k.C0.ESC+"[D";break;case 39:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"C",h.key===k.C0.ESC+"[1;3C"&&(h.key=k.C0.ESC+(x?"f":"[1;5C"))):h.key=E?k.C0.ESC+"OC":k.C0.ESC+"[C";break;case 38:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"A",x||h.key!==k.C0.ESC+"[1;3A"||(h.key=k.C0.ESC+"[1;5A")):h.key=E?k.C0.ESC+"OA":k.C0.ESC+"[A";break;case 40:if(f.metaKey)break;o?(h.key=k.C0.ESC+"[1;"+(o+1)+"B",x||h.key!==k.C0.ESC+"[1;3B"||(h.key=k.C0.ESC+"[1;5B")):h.key=E?k.C0.ESC+"OB":k.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(h.key=k.C0.ESC+"[2~");break;case 46:h.key=o?k.C0.ESC+"[3;"+(o+1)+"~":k.C0.ESC+"[3~";break;case 36:h.key=o?k.C0.ESC+"[1;"+(o+1)+"H":E?k.C0.ESC+"OH":k.C0.ESC+"[H";break;case 35:h.key=o?k.C0.ESC+"[1;"+(o+1)+"F":E?k.C0.ESC+"OF":k.C0.ESC+"[F";break;case 33:f.shiftKey?h.type=2:h.key=k.C0.ESC+"[5~";break;case 34:f.shiftKey?h.type=3:h.key=k.C0.ESC+"[6~";break;case 112:h.key=o?k.C0.ESC+"[1;"+(o+1)+"P":k.C0.ESC+"OP";break;case 113:h.key=o?k.C0.ESC+"[1;"+(o+1)+"Q":k.C0.ESC+"OQ";break;case 114:h.key=o?k.C0.ESC+"[1;"+(o+1)+"R":k.C0.ESC+"OR";break;case 115:h.key=o?k.C0.ESC+"[1;"+(o+1)+"S":k.C0.ESC+"OS";break;case 116:h.key=o?k.C0.ESC+"[15;"+(o+1)+"~":k.C0.ESC+"[15~";break;case 117:h.key=o?k.C0.ESC+"[17;"+(o+1)+"~":k.C0.ESC+"[17~";break;case 118:h.key=o?k.C0.ESC+"[18;"+(o+1)+"~":k.C0.ESC+"[18~";break;case 119:h.key=o?k.C0.ESC+"[19;"+(o+1)+"~":k.C0.ESC+"[19~";break;case 120:h.key=o?k.C0.ESC+"[20;"+(o+1)+"~":k.C0.ESC+"[20~";break;case 121:h.key=o?k.C0.ESC+"[21;"+(o+1)+"~":k.C0.ESC+"[21~";break;case 122:h.key=o?k.C0.ESC+"[23;"+(o+1)+"~":k.C0.ESC+"[23~";break;case 123:h.key=o?k.C0.ESC+"[24;"+(o+1)+"~":k.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(x&&!g||!f.altKey||f.metaKey)x&&!f.altKey&&!f.ctrlKey&&f.metaKey?f.keyCode===65&&(h.type=1):f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?h.key=f.key:f.key&&f.ctrlKey&&f.key==="_"&&(h.key=k.C0.US);else{var u=M[f.keyCode],r=u&&u[f.shiftKey?1:0];if(r)h.key=k.C0.ESC+r;else if(f.keyCode>=65&&f.keyCode<=90){var n=f.ctrlKey?f.keyCode-64:f.keyCode+32;h.key=k.C0.ESC+String.fromCharCode(n)}}else f.keyCode>=65&&f.keyCode<=90?h.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?h.key=k.C0.NUL:f.keyCode>=51&&f.keyCode<=55?h.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?h.key=k.C0.DEL:f.keyCode===219?h.key=k.C0.ESC:f.keyCode===220?h.key=k.C0.FS:f.keyCode===221&&(h.key=k.C0.GS)}return h}},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(i,s){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var d in c)c.hasOwnProperty(d)&&(l[d]=c[d])})(i,s)},function(i,s){function l(){this.constructor=i}k(i,s),i.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}),f=this&&this.__decorate||function(i,s,l,c){var d,w=arguments.length,m=w<3?s:c===null?c=Object.getOwnPropertyDescriptor(s,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(i,s,l,c);else for(var S=i.length-1;S>=0;S--)(d=i[S])&&(m=(w<3?d(m):w>3?d(s,l,m):d(s,l))||m);return w>3&&m&&Object.defineProperty(s,l,m),m},E=this&&this.__param||function(i,s){return function(l,c){s(l,c,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.RenderService=void 0;var x=I(31),g=I(0),h=I(2),o=I(32),u=I(7),r=I(1),n=I(5),t=function(i){function s(l,c,d,w,m,S){var C=i.call(this)||this;if(C._renderer=l,C._rowCount=c,C._isPaused=!1,C._needsFullRefresh=!1,C._isNextRenderRedrawOnly=!0,C._needsSelectionRefresh=!1,C._canvasWidth=0,C._canvasHeight=0,C._selectionState={start:void 0,end:void 0,columnSelectMode:!1},C._onDimensionsChange=new g.EventEmitter,C._onRender=new g.EventEmitter,C._onRefreshRequest=new g.EventEmitter,C.register({dispose:function(){return C._renderer.dispose()}}),C._renderDebouncer=new x.RenderDebouncer(function(y,T){return C._renderRows(y,T)}),C.register(C._renderDebouncer),C._screenDprMonitor=new o.ScreenDprMonitor,C._screenDprMonitor.setListener(function(){return C.onDevicePixelRatioChange()}),C.register(C._screenDprMonitor),C.register(S.onResize(function(y){return C._fullRefresh()})),C.register(w.onOptionChange(function(){return C._renderer.onOptionsChanged()})),C.register(m.onCharSizeChange(function(){return C.onCharSizeChanged()})),C._renderer.onRequestRedraw(function(y){return C.refreshRows(y.start,y.end,!0)}),C.register(u.addDisposableDomListener(window,"resize",function(){return C.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var v=new IntersectionObserver(function(y){return C._onIntersectionChange(y[y.length-1])},{threshold:0});v.observe(d),C.register({dispose:function(){return v.disconnect()}})}return C}return M(s,i),Object.defineProperty(s.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),s.prototype._onIntersectionChange=function(l){this._isPaused=l.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(l,c,d){d===void 0&&(d=!1),this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,c,this._rowCount))},s.prototype._renderRows=function(l,c){this._renderer.renderRows(l,c),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:l,end:c}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(l,c){this._rowCount=c,this._fireOnCanvasResize()},s.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},s.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},s.prototype.dispose=function(){i.prototype.dispose.call(this)},s.prototype.setRenderer=function(l){var c=this;this._renderer.dispose(),this._renderer=l,this._renderer.onRequestRedraw(function(d){return c.refreshRows(d.start,d.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},s.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},s.prototype.setColors=function(l){this._renderer.setColors(l),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(l,c){this._renderer.onResize(l,c),this._fullRefresh()},s.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},s.prototype.onBlur=function(){this._renderer.onBlur()},s.prototype.onFocus=function(){this._renderer.onFocus()},s.prototype.onSelectionChanged=function(l,c,d){this._selectionState.start=l,this._selectionState.end=c,this._selectionState.columnSelectMode=d,this._renderer.onSelectionChanged(l,c,d)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(l){return this._renderer.registerCharacterJoiner(l)},s.prototype.deregisterCharacterJoiner=function(l){return this._renderer.deregisterCharacterJoiner(l)},s=f([E(3,r.IOptionsService),E(4,n.ICharSizeService),E(5,r.IBufferService)],s)}(h.Disposable);L.RenderService=t},function(V,L,I){"use strict";var k=this&&this.__decorate||function(h,o,u,r){var n,t=arguments.length,i=t<3?o:r===null?r=Object.getOwnPropertyDescriptor(o,u):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(h,o,u,r);else for(var s=h.length-1;s>=0;s--)(n=h[s])&&(i=(t<3?n(i):t>3?n(o,u,i):n(o,u))||i);return t>3&&i&&Object.defineProperty(o,u,i),i},M=this&&this.__param||function(h,o){return function(u,r){o(u,r,h)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CharSizeService=void 0;var f=I(1),E=I(0),x=function(){function h(o,u,r){this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new g(o,u,this._optionsService)}return Object.defineProperty(h.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),h.prototype.measure=function(){var o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())},h=k([M(2,f.IOptionsService)],h)}();L.CharSizeService=x;var g=function(){function h(o,u,r){this._document=o,this._parentElement=u,this._optionsService=r,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return h.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._measureElement.getBoundingClientRect();return o.width!==0&&o.height!==0&&(this._result.width=o.width,this._result.height=Math.ceil(o.height)),this._result},h}()},function(V,L,I){"use strict";var k=this&&this.__decorate||function(g,h,o,u){var r,n=arguments.length,t=n<3?h:u===null?u=Object.getOwnPropertyDescriptor(h,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(g,h,o,u);else for(var i=g.length-1;i>=0;i--)(r=g[i])&&(t=(n<3?r(t):n>3?r(h,o,t):r(h,o))||t);return n>3&&t&&Object.defineProperty(h,o,t),t},M=this&&this.__param||function(g,h){return function(o,u){h(o,u,g)}};Object.defineProperty(L,"__esModule",{value:!0}),L.MouseService=void 0;var f=I(5),E=I(30),x=function(){function g(h,o){this._renderService=h,this._charSizeService=o}return g.prototype.getCoords=function(h,o,u,r,n){return E.getCoords(h,o,u,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},g.prototype.getRawByteCoords=function(h,o,u,r){var n=this.getCoords(h,o,u,r);return E.getRawByteCoords(n)},g=k([M(0,f.IRenderService),M(1,f.ICharSizeService)],g)}();L.MouseService=x},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),f=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.Linkifier2=void 0;var x=I(1),g=I(0),h=I(2),o=I(7),u=function(r){function n(t){var i=r.call(this)||this;return i._bufferService=t,i._linkProviders=[],i._linkCacheDisposables=[],i._isMouseOut=!0,i._activeLine=-1,i._onShowLinkUnderline=i.register(new g.EventEmitter),i._onHideLinkUnderline=i.register(new g.EventEmitter),i.register(h.getDisposeArrayDisposable(i._linkCacheDisposables)),i}return M(n,r),Object.defineProperty(n.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),n.prototype.registerLinkProvider=function(t){var i=this;return this._linkProviders.push(t),{dispose:function(){var s=i._linkProviders.indexOf(t);s!==-1&&i._linkProviders.splice(s,1)}}},n.prototype.attachToDom=function(t,i,s){var l=this;this._element=t,this._mouseService=i,this._renderService=s,this.register(o.addDisposableDomListener(this._element,"mouseleave",function(){l._isMouseOut=!0,l._clearCurrentLink()})),this.register(o.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(o.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},n.prototype._onMouseMove=function(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){var i=this._positionFromMouseEvent(t,this._element,this._mouseService);if(i){this._isMouseOut=!1;for(var s=t.composedPath(),l=0;l<s.length;l++){var c=s[l];if(c.classList.contains("xterm"))break;if(c.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._onHover(i),this._lastBufferCell=i)}}},n.prototype._onHover=function(t){if(this._activeLine!==t.y)return this._clearCurrentLink(),void this._askForLink(t,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))},n.prototype._askForLink=function(t,i){var s=this;this._activeProviderReplies&&i||(this._activeProviderReplies=new Map,this._activeLine=t.y);var l=!1;this._linkProviders.forEach(function(c,d){var w;i?((w=s._activeProviderReplies)===null||w===void 0?void 0:w.get(d))&&(l=s._checkLinkProviderResult(d,t,l)):c.provideLinks(t.y,function(m){var S,C;if(!s._isMouseOut){var v=m==null?void 0:m.map(function(y){return{link:y}});(S=s._activeProviderReplies)===null||S===void 0||S.set(d,v),l=s._checkLinkProviderResult(d,t,l),((C=s._activeProviderReplies)===null||C===void 0?void 0:C.size)===s._linkProviders.length&&s._removeIntersectingLinks(t.y,s._activeProviderReplies)}})})},n.prototype._removeIntersectingLinks=function(t,i){for(var s=new Set,l=0;l<i.size;l++){var c=i.get(l);if(c)for(var d=0;d<c.length;d++)for(var w=c[d],m=w.link.range.start.y<t?0:w.link.range.start.x,S=w.link.range.end.y>t?this._bufferService.cols:w.link.range.end.x,C=m;C<=S;C++){if(s.has(C)){c.splice(d--,1);break}s.add(C)}}},n.prototype._checkLinkProviderResult=function(t,i,s){var l,c=this;if(!this._activeProviderReplies)return s;for(var d=this._activeProviderReplies.get(t),w=!1,m=0;m<t;m++)this._activeProviderReplies.has(m)&&!this._activeProviderReplies.get(m)||(w=!0);if(!w&&d){var S=d.find(function(v){return c._linkAtPosition(v.link,i)});S&&(s=!0,this._handleNewLink(S))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(m=0;m<this._activeProviderReplies.size;m++){var C=(l=this._activeProviderReplies.get(m))===null||l===void 0?void 0:l.find(function(v){return c._linkAtPosition(v.link,i)});if(C){s=!0,this._handleNewLink(C);break}}return s},n.prototype._onClick=function(t){if(this._element&&this._mouseService&&this._currentLink){var i=this._positionFromMouseEvent(t,this._element,this._mouseService);i&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(t,this._currentLink.link.text)}},n.prototype._clearCurrentLink=function(t,i){this._element&&this._currentLink&&this._lastMouseEvent&&(!t||!i||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,h.disposeArray(this._linkCacheDisposables))},n.prototype._handleNewLink=function(t){var i=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0||t.link.decorations.underline,pointerCursor:t.link.decorations===void 0||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:function(){var l,c;return(c=(l=i._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:function(l){var c,d;((c=i._currentLink)===null||c===void 0?void 0:c.state)&&i._currentLink.state.decorations.pointerCursor!==l&&(i._currentLink.state.decorations.pointerCursor=l,i._currentLink.state.isHovered&&((d=i._element)===null||d===void 0||d.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:function(){var l,c;return(c=(l=i._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.underline},set:function(l){var c,d,w;((c=i._currentLink)===null||c===void 0?void 0:c.state)&&((w=(d=i._currentLink)===null||d===void 0?void 0:d.state)===null||w===void 0?void 0:w.decorations.underline)!==l&&(i._currentLink.state.decorations.underline=l,i._currentLink.state.isHovered&&i._fireUnderlineEvent(t.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(l){var c=l.start===0?0:l.start+1+i._bufferService.buffer.ydisp;i._clearCurrentLink(c,l.end+1+i._bufferService.buffer.ydisp)})))}},n.prototype._linkHover=function(t,i,s){var l;((l=this._currentLink)===null||l===void 0?void 0:l.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(s,i.text)},n.prototype._fireUnderlineEvent=function(t,i){var s=t.range,l=this._bufferService.buffer.ydisp,c=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-l-1,s.end.x,s.end.y-l-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(c)},n.prototype._linkLeave=function(t,i,s){var l;((l=this._currentLink)===null||l===void 0?void 0:l.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(s,i.text)},n.prototype._linkAtPosition=function(t,i){var s=t.range.start.y===t.range.end.y,l=t.range.start.y<i.y,c=t.range.end.y>i.y;return(s&&t.range.start.x<=i.x&&t.range.end.x>=i.x||l&&t.range.end.x>=i.x||c&&t.range.start.x<=i.x||l&&c)&&t.range.start.y<=i.y&&t.range.end.y>=i.y},n.prototype._positionFromMouseEvent=function(t,i,s){var l=s.getCoords(t,i,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}},n.prototype._createLinkUnderlineEvent=function(t,i,s,l,c){return{x1:t,y1:i,x2:s,y2:l,cols:this._bufferService.cols,fg:c}},n=f([E(0,x.IBufferService)],n)}(h.Disposable);L.Linkifier2=u},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CoreBrowserService=void 0;var k=function(){function M(f){this._textarea=f}return Object.defineProperty(M.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),M}();L.CoreBrowserService=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(m,S){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,v){C.__proto__=v}||function(C,v){for(var y in v)v.hasOwnProperty(y)&&(C[y]=v[y])})(m,S)},function(m,S){function C(){this.constructor=m}k(m,S),m.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)});Object.defineProperty(L,"__esModule",{value:!0}),L.CoreTerminal=void 0;var f=I(2),E=I(1),x=I(66),g=I(67),h=I(68),o=I(74),u=I(75),r=I(0),n=I(76),t=I(77),i=I(78),s=I(80),l=I(81),c=I(19),d=I(82),w=function(m){function S(C){var v=m.call(this)||this;return v._onBinary=new r.EventEmitter,v._onData=new r.EventEmitter,v._onLineFeed=new r.EventEmitter,v._onResize=new r.EventEmitter,v._onScroll=new r.EventEmitter,v._instantiationService=new x.InstantiationService,v.optionsService=new o.OptionsService(C),v._instantiationService.setService(E.IOptionsService,v.optionsService),v._bufferService=v.register(v._instantiationService.createInstance(h.BufferService)),v._instantiationService.setService(E.IBufferService,v._bufferService),v._logService=v._instantiationService.createInstance(g.LogService),v._instantiationService.setService(E.ILogService,v._logService),v._coreService=v.register(v._instantiationService.createInstance(u.CoreService,function(){return v.scrollToBottom()})),v._instantiationService.setService(E.ICoreService,v._coreService),v._coreMouseService=v._instantiationService.createInstance(n.CoreMouseService),v._instantiationService.setService(E.ICoreMouseService,v._coreMouseService),v._dirtyRowService=v._instantiationService.createInstance(t.DirtyRowService),v._instantiationService.setService(E.IDirtyRowService,v._dirtyRowService),v.unicodeService=v._instantiationService.createInstance(i.UnicodeService),v._instantiationService.setService(E.IUnicodeService,v.unicodeService),v._charsetService=v._instantiationService.createInstance(s.CharsetService),v._instantiationService.setService(E.ICharsetService,v._charsetService),v._inputHandler=new c.InputHandler(v._bufferService,v._charsetService,v._coreService,v._dirtyRowService,v._logService,v.optionsService,v._coreMouseService,v.unicodeService),v.register(r.forwardEvent(v._inputHandler.onLineFeed,v._onLineFeed)),v.register(v._inputHandler),v.register(r.forwardEvent(v._bufferService.onResize,v._onResize)),v.register(r.forwardEvent(v._coreService.onData,v._onData)),v.register(r.forwardEvent(v._coreService.onBinary,v._onBinary)),v.register(v.optionsService.onOptionChange(function(y){return v._updateOptions(y)})),v._writeBuffer=new d.WriteBuffer(function(y){return v._inputHandler.parse(y)}),v}return M(S,m),Object.defineProperty(S.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){var C;this._isDisposed||(m.prototype.dispose.call(this),(C=this._windowsMode)===null||C===void 0||C.dispose(),this._windowsMode=void 0)},S.prototype.write=function(C,v){this._writeBuffer.write(C,v)},S.prototype.writeSync=function(C){this._writeBuffer.writeSync(C)},S.prototype.resize=function(C,v){isNaN(C)||isNaN(v)||(C=Math.max(C,h.MINIMUM_COLS),v=Math.max(v,h.MINIMUM_ROWS),this._bufferService.resize(C,v))},S.prototype.scroll=function(C,v){v===void 0&&(v=!1);var y,T=this._bufferService.buffer;(y=this._cachedBlankLine)&&y.length===this.cols&&y.getFg(0)===C.fg&&y.getBg(0)===C.bg||(y=T.getBlankLine(C,v),this._cachedBlankLine=y),y.isWrapped=v;var A=T.ybase+T.scrollTop,p=T.ybase+T.scrollBottom;if(T.scrollTop===0){var D=T.lines.isFull;p===T.lines.length-1?D?T.lines.recycle().copyFrom(y):T.lines.push(y.clone()):T.lines.splice(p+1,0,y.clone()),D?this._bufferService.isUserScrolling&&(T.ydisp=Math.max(T.ydisp-1,0)):(T.ybase++,this._bufferService.isUserScrolling||T.ydisp++)}else{var O=p-A+1;T.lines.shiftElements(A+1,O-1,-1),T.lines.set(p,y.clone())}this._bufferService.isUserScrolling||(T.ydisp=T.ybase),this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom),this._onScroll.fire(T.ydisp)},S.prototype.scrollLines=function(C,v){var y=this._bufferService.buffer;if(C<0){if(y.ydisp===0)return;this._bufferService.isUserScrolling=!0}else C+y.ydisp>=y.ybase&&(this._bufferService.isUserScrolling=!1);var T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+C,y.ybase),0),T!==y.ydisp&&(v||this._onScroll.fire(y.ydisp))},S.prototype.scrollPages=function(C){this.scrollLines(C*(this.rows-1))},S.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},S.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},S.prototype.scrollToLine=function(C){var v=C-this._bufferService.buffer.ydisp;v!==0&&this.scrollLines(v)},S.prototype.addEscHandler=function(C,v){return this._inputHandler.addEscHandler(C,v)},S.prototype.addDcsHandler=function(C,v){return this._inputHandler.addDcsHandler(C,v)},S.prototype.addCsiHandler=function(C,v){return this._inputHandler.addCsiHandler(C,v)},S.prototype.addOscHandler=function(C,v){return this._inputHandler.addOscHandler(C,v)},S.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},S.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},S.prototype._updateOptions=function(C){var v;switch(C){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((v=this._windowsMode)===null||v===void 0||v.dispose(),this._windowsMode=void 0)}},S.prototype._enableWindowsMode=function(){var C=this;if(!this._windowsMode){var v=[];v.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),v.push(this.addCsiHandler({final:"H"},function(){return l.updateWindowsModeWrappedState(C._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,T=v;y<T.length;y++)T[y].dispose()}}}},S}(f.Disposable);L.CoreTerminal=w},function(V,L,I){"use strict";var k=this&&this.__spreadArrays||function(){for(var g=0,h=0,o=arguments.length;h<o;h++)g+=arguments[h].length;var u=Array(g),r=0;for(h=0;h<o;h++)for(var n=arguments[h],t=0,i=n.length;t<i;t++,r++)u[r]=n[t];return u};Object.defineProperty(L,"__esModule",{value:!0}),L.InstantiationService=L.ServiceCollection=void 0;var M=I(1),f=I(14),E=function(){function g(){for(var h=[],o=0;o<arguments.length;o++)h[o]=arguments[o];this._entries=new Map;for(var u=0,r=h;u<r.length;u++){var n=r[u],t=n[0],i=n[1];this.set(t,i)}}return g.prototype.set=function(h,o){var u=this._entries.get(h);return this._entries.set(h,o),u},g.prototype.forEach=function(h){this._entries.forEach(function(o,u){return h(u,o)})},g.prototype.has=function(h){return this._entries.has(h)},g.prototype.get=function(h){return this._entries.get(h)},g}();L.ServiceCollection=E;var x=function(){function g(){this._services=new E,this._services.set(M.IInstantiationService,this)}return g.prototype.setService=function(h,o){this._services.set(h,o)},g.prototype.getService=function(h){return this._services.get(h)},g.prototype.createInstance=function(h){for(var o=[],u=1;u<arguments.length;u++)o[u-1]=arguments[u];for(var r=f.getServiceDependencies(h).sort(function(d,w){return d.index-w.index}),n=[],t=0,i=r;t<i.length;t++){var s=i[t],l=this._services.get(s.id);if(!l)throw new Error("[createInstance] "+h.name+" depends on UNKNOWN service "+s.id+".");n.push(l)}var c=r.length>0?r[0].index:o.length;if(o.length!==c)throw new Error("[createInstance] First service dependency of "+h.name+" at position "+(c+1)+" conflicts with "+o.length+" static arguments");return new(h.bind.apply(h,k([void 0],k(o,n))))},g}();L.InstantiationService=x},function(V,L,I){"use strict";var k=this&&this.__decorate||function(o,u,r,n){var t,i=arguments.length,s=i<3?u:n===null?n=Object.getOwnPropertyDescriptor(u,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,u,r,n);else for(var l=o.length-1;l>=0;l--)(t=o[l])&&(s=(i<3?t(s):i>3?t(u,r,s):t(u,r))||s);return i>3&&s&&Object.defineProperty(u,r,s),s},M=this&&this.__param||function(o,u){return function(r,n){u(r,n,o)}},f=this&&this.__spreadArrays||function(){for(var o=0,u=0,r=arguments.length;u<r;u++)o+=arguments[u].length;var n=Array(o),t=0;for(u=0;u<r;u++)for(var i=arguments[u],s=0,l=i.length;s<l;s++,t++)n[t]=i[s];return n};Object.defineProperty(L,"__esModule",{value:!0}),L.LogService=L.LogLevel=void 0;var E,x=I(1);!function(o){o[o.DEBUG=0]="DEBUG",o[o.INFO=1]="INFO",o[o.WARN=2]="WARN",o[o.ERROR=3]="ERROR",o[o.OFF=4]="OFF"}(E=L.LogLevel||(L.LogLevel={}));var g={debug:E.DEBUG,info:E.INFO,warn:E.WARN,error:E.ERROR,off:E.OFF},h=function(){function o(u){var r=this;this._optionsService=u,this._updateLogLevel(),this._optionsService.onOptionChange(function(n){n==="logLevel"&&r._updateLogLevel()})}return o.prototype._updateLogLevel=function(){this._logLevel=g[this._optionsService.options.logLevel]},o.prototype._evalLazyOptionalParams=function(u){for(var r=0;r<u.length;r++)typeof u[r]=="function"&&(u[r]=u[r]())},o.prototype._log=function(u,r,n){this._evalLazyOptionalParams(n),u.call.apply(u,f([console,"xterm.js: "+r],n))},o.prototype.debug=function(u){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._logLevel<=E.DEBUG&&this._log(console.log,u,r)},o.prototype.info=function(u){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._logLevel<=E.INFO&&this._log(console.info,u,r)},o.prototype.warn=function(u){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._logLevel<=E.WARN&&this._log(console.warn,u,r)},o.prototype.error=function(u){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._logLevel<=E.ERROR&&this._log(console.error,u,r)},o=k([M(0,x.IOptionsService)],o)}();L.LogService=h},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(r,n){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])})(r,n)},function(r,n){function t(){this.constructor=r}k(r,n),r.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),f=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},E=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.BufferService=L.MINIMUM_ROWS=L.MINIMUM_COLS=void 0;var x=I(1),g=I(69),h=I(0),o=I(2);L.MINIMUM_COLS=2,L.MINIMUM_ROWS=1;var u=function(r){function n(t){var i=r.call(this)||this;return i._optionsService=t,i.isUserScrolling=!1,i._onResize=new h.EventEmitter,i.cols=Math.max(t.options.cols,L.MINIMUM_COLS),i.rows=Math.max(t.options.rows,L.MINIMUM_ROWS),i.buffers=new g.BufferSet(t,i),i}return M(n,r),Object.defineProperty(n.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){r.prototype.dispose.call(this),this.buffers.dispose()},n.prototype.resize=function(t,i){this.cols=t,this.rows=i,this.buffers.resize(t,i),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:i})},n.prototype.reset=function(){this.buffers.dispose(),this.buffers=new g.BufferSet(this._optionsService,this),this.isUserScrolling=!1},n=f([E(0,x.IOptionsService)],n)}(o.Disposable);L.BufferService=u},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(g,h){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var r in u)u.hasOwnProperty(r)&&(o[r]=u[r])})(g,h)},function(g,h){function o(){this.constructor=g}k(g,h),g.prototype=h===null?Object.create(h):(o.prototype=h.prototype,new o)});Object.defineProperty(L,"__esModule",{value:!0}),L.BufferSet=void 0;var f=I(70),E=I(0),x=function(g){function h(o,u){var r=g.call(this)||this;return r._onBufferActivate=r.register(new E.EventEmitter),r._normal=new f.Buffer(!0,o,u),r._normal.fillViewportRows(),r._alt=new f.Buffer(!1,o,u),r._activeBuffer=r._normal,r.setupTabStops(),r}return M(h,g),Object.defineProperty(h.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),h.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},h.prototype.activateAltBuffer=function(o){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(o),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},h.prototype.resize=function(o,u){this._normal.resize(o,u),this._alt.resize(o,u)},h.prototype.setupTabStops=function(o){this._normal.setupTabStops(o),this._alt.setupTabStops(o)},h}(I(2).Disposable);L.BufferSet=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.BufferStringIterator=L.Buffer=L.MAX_BUFFER_SIZE=void 0;var k=I(71),M=I(16),f=I(4),E=I(3),x=I(72),g=I(73),h=I(20),o=I(6);L.MAX_BUFFER_SIZE=4294967295;var u=function(){function n(t,i,s){this._hasScrollback=t,this._optionsService=i,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=M.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=f.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=f.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new k.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return n.prototype.getNullCell=function(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell},n.prototype.getWhitespaceCell=function(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell},n.prototype.getBlankLine=function(t,i){return new M.BufferLine(this._bufferService.cols,this.getNullCell(t),i)},Object.defineProperty(n.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows},enumerable:!1,configurable:!0}),n.prototype._getCorrectBufferLength=function(t){if(!this._hasScrollback)return t;var i=t+this._optionsService.options.scrollback;return i>L.MAX_BUFFER_SIZE?L.MAX_BUFFER_SIZE:i},n.prototype.fillViewportRows=function(t){if(this.lines.length===0){t===void 0&&(t=M.DEFAULT_ATTR_DATA);for(var i=this._rows;i--;)this.lines.push(this.getBlankLine(t))}},n.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new k.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},n.prototype.resize=function(t,i){var s=this.getNullCell(M.DEFAULT_ATTR_DATA),l=this._getCorrectBufferLength(i);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols<t)for(var c=0;c<this.lines.length;c++)this.lines.get(c).resize(t,s);var d=0;if(this._rows<i)for(var w=this._rows;w<i;w++)this.lines.length<i+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new M.BufferLine(t,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+d+1?(this.ybase--,d++,this.ydisp>0&&this.ydisp--):this.lines.push(new M.BufferLine(t,s)));else for(w=this._rows;w>i;w--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(l<this.lines.maxLength){var m=this.lines.length-l;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=l}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,i-1),d&&(this.y+=d),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(t,i),this._cols>t))for(c=0;c<this.lines.length;c++)this.lines.get(c).resize(t,s);this._cols=t,this._rows=i},Object.defineProperty(n.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),n.prototype._reflow=function(t,i){this._cols!==t&&(t>this._cols?this._reflowLarger(t,i):this._reflowSmaller(t,i))},n.prototype._reflowLarger=function(t,i){var s=x.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(s.length>0){var l=x.reflowLargerCreateNewLayout(this.lines,s);x.reflowLargerApplyNewLayout(this.lines,l.layout),this._reflowLargerAdjustViewport(t,i,l.countRemoved)}},n.prototype._reflowLargerAdjustViewport=function(t,i,s){for(var l=this.getNullCell(M.DEFAULT_ATTR_DATA),c=s;c-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new M.BufferLine(t,l))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)},n.prototype._reflowSmaller=function(t,i){for(var s=this.getNullCell(M.DEFAULT_ATTR_DATA),l=[],c=0,d=this.lines.length-1;d>=0;d--){var w=this.lines.get(d);if(!(!w||!w.isWrapped&&w.getTrimmedLength()<=t)){for(var m=[w];w.isWrapped&&d>0;)w=this.lines.get(--d),m.unshift(w);var S=this.ybase+this.y;if(!(S>=d&&S<d+m.length)){var C=m[m.length-1].getTrimmedLength(),v=x.reflowSmallerGetNewLineLengths(m,this._cols,t),y=v.length-m.length,T=void 0;T=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+y):Math.max(0,this.lines.length-this.lines.maxLength+y);for(var A=[],p=0;p<y;p++){var D=this.getBlankLine(M.DEFAULT_ATTR_DATA,!0);A.push(D)}A.length>0&&(l.push({start:d+m.length+c,newLines:A}),c+=A.length),m.push.apply(m,A);var O=v.length-1,P=v[O];P===0&&(P=v[--O]);for(var j=m.length-y-1,K=C;j>=0;){var U=Math.min(K,P);if(m[O].copyCellsFrom(m[j],K-U,P-U,U,!0),(P-=U)===0&&(P=v[--O]),(K-=U)===0){j--;var X=Math.max(j,0);K=x.getWrappedLineTrimmedLength(m,X,this._cols)}}for(p=0;p<m.length;p++)v[p]<t&&m[p].setCell(v[p],s);for(var B=y-T;B-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+i-1)}}}if(l.length>0){var N=[],z=[];for(p=0;p<this.lines.length;p++)z.push(this.lines.get(p));var te=this.lines.length,ce=te-1,be=0,Fe=l[be];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);var Oe=0;for(p=Math.min(this.lines.maxLength-1,te+c-1);p>=0;p--)if(Fe&&Fe.start>ce+Oe){for(var Re=Fe.newLines.length-1;Re>=0;Re--)this.lines.set(p--,Fe.newLines[Re]);p++,N.push({index:ce+1,amount:Fe.newLines.length}),Oe+=Fe.newLines.length,Fe=l[++be]}else this.lines.set(p,z[ce--]);var Be=0;for(p=N.length-1;p>=0;p--)N[p].index+=Be,this.lines.onInsertEmitter.fire(N[p]),Be+=N[p].amount;var Ke=Math.max(0,te+c-this.lines.maxLength);Ke>0&&this.lines.onTrimEmitter.fire(Ke)}},n.prototype.stringIndexToBufferIndex=function(t,i,s){for(s===void 0&&(s=!1);i;){var l=this.lines.get(t);if(!l)return[-1,-1];for(var c=s?l.getTrimmedLength():l.length,d=0;d<c;++d)if(l.get(d)[E.CHAR_DATA_WIDTH_INDEX]&&(i-=l.get(d)[E.CHAR_DATA_CHAR_INDEX].length||1),i<0)return[t,d];t++}return[t,0]},n.prototype.translateBufferLineToString=function(t,i,s,l){s===void 0&&(s=0);var c=this.lines.get(t);return c?c.translateToString(i,s,l):""},n.prototype.getWrappedRangeForLine=function(t){for(var i=t,s=t;i>0&&this.lines.get(i).isWrapped;)i--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:i,last:s}},n.prototype.setupTabStops=function(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.options.tabStopWidth)this.tabs[t]=!0},n.prototype.prevStop=function(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t},n.prototype.nextStop=function(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t},n.prototype.addMarker=function(t){var i=this,s=new g.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(function(l){s.line-=l,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(l){s.line>=l.index&&(s.line+=l.amount)})),s.register(this.lines.onDelete(function(l){s.line>=l.index&&s.line<l.index+l.amount&&s.dispose(),s.line>l.index&&(s.line-=l.amount)})),s.register(s.onDispose(function(){return i._removeMarker(s)})),s},n.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},n.prototype.iterator=function(t,i,s,l,c){return new r(this,t,i,s,l,c)},n}();L.Buffer=u;var r=function(){function n(t,i,s,l,c,d){s===void 0&&(s=0),l===void 0&&(l=t.lines.length),c===void 0&&(c=0),d===void 0&&(d=0),this._buffer=t,this._trimRight=i,this._startIndex=s,this._endIndex=l,this._startOverscan=c,this._endOverscan=d,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return n.prototype.hasNext=function(){return this._current<this._endIndex},n.prototype.next=function(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var i="",s=t.first;s<=t.last;++s)i+=this._buffer.translateBufferLineToString(s,this._trimRight);return this._current=t.last+1,{range:t,content:i}},n}();L.BufferStringIterator=r},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CircularList=void 0;var k=I(0),M=function(){function f(E){this._maxLength=E,this.onDeleteEmitter=new k.EventEmitter,this.onInsertEmitter=new k.EventEmitter,this.onTrimEmitter=new k.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(f.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var x=new Array(E),g=0;g<Math.min(E,this.length);g++)x[g]=this._array[this._getCyclicIndex(g)];this._array=x,this._maxLength=E,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"length",{get:function(){return this._length},set:function(E){if(E>this._length)for(var x=this._length;x<E;x++)this._array[x]=void 0;this._length=E},enumerable:!1,configurable:!0}),f.prototype.get=function(E){return this._array[this._getCyclicIndex(E)]},f.prototype.set=function(E,x){this._array[this._getCyclicIndex(E)]=x},f.prototype.push=function(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},f.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(f.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),f.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},f.prototype.splice=function(E,x){for(var g=[],h=2;h<arguments.length;h++)g[h-2]=arguments[h];if(x){for(var o=E;o<this._length-x;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+x)];this._length-=x}for(o=this._length-1;o>=E;o--)this._array[this._getCyclicIndex(o+g.length)]=this._array[this._getCyclicIndex(o)];for(o=0;o<g.length;o++)this._array[this._getCyclicIndex(E+o)]=g[o];if(this._length+g.length>this._maxLength){var u=this._length+g.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=g.length},f.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},f.prototype.shiftElements=function(E,x,g){if(!(x<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(var h=x-1;h>=0;h--)this.set(E+h+g,this.get(E+h));var o=E+x+g-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(h=0;h<x;h++)this.set(E+h+g,this.get(E+h))}},f.prototype._getCyclicIndex=function(E){return(this._startIndex+E)%this._maxLength},f}();L.CircularList=M},function(V,L,I){"use strict";function k(M,f,E){if(f===M.length-1)return M[f].getTrimmedLength();var x=!M[f].hasContent(E-1)&&M[f].getWidth(E-1)===1,g=M[f+1].getWidth(0)===2;return x&&g?E-1:E}Object.defineProperty(L,"__esModule",{value:!0}),L.getWrappedLineTrimmedLength=L.reflowSmallerGetNewLineLengths=L.reflowLargerApplyNewLayout=L.reflowLargerCreateNewLayout=L.reflowLargerGetLinesToRemove=void 0,L.reflowLargerGetLinesToRemove=function(M,f,E,x,g){for(var h=[],o=0;o<M.length-1;o++){var u=o,r=M.get(++u);if(r.isWrapped){for(var n=[M.get(o)];u<M.length&&r.isWrapped;)n.push(r),r=M.get(++u);if(x>=o&&x<u)o+=n.length-1;else{for(var t=0,i=k(n,t,f),s=1,l=0;s<n.length;){var c=k(n,s,f),d=c-l,w=E-i,m=Math.min(d,w);n[t].copyCellsFrom(n[s],l,i,m,!1),(i+=m)===E&&(t++,i=0),(l+=m)===c&&(s++,l=0),i===0&&t!==0&&n[t-1].getWidth(E-1)===2&&(n[t].copyCellsFrom(n[t-1],E-1,i++,1,!1),n[t-1].setCell(E-1,g))}n[t].replaceCells(i,E,g);for(var S=0,C=n.length-1;C>0&&(C>t||n[C].getTrimmedLength()===0);C--)S++;S>0&&(h.push(o+n.length-S),h.push(S)),o+=n.length-1}}}return h},L.reflowLargerCreateNewLayout=function(M,f){for(var E=[],x=0,g=f[x],h=0,o=0;o<M.length;o++)if(g===o){var u=f[++x];M.onDeleteEmitter.fire({index:o-h,amount:u}),o+=u-1,h+=u,g=f[++x]}else E.push(o);return{layout:E,countRemoved:h}},L.reflowLargerApplyNewLayout=function(M,f){for(var E=[],x=0;x<f.length;x++)E.push(M.get(f[x]));for(x=0;x<E.length;x++)M.set(x,E[x]);M.length=f.length},L.reflowSmallerGetNewLineLengths=function(M,f,E){for(var x=[],g=M.map(function(i,s){return k(M,s,f)}).reduce(function(i,s){return i+s}),h=0,o=0,u=0;u<g;){if(g-u<E){x.push(g-u);break}h+=E;var r=k(M,o,f);h>r&&(h-=r,o++);var n=M[o].getWidth(h-1)===2;n&&h--;var t=n?E-1:E;x.push(t),u+=t}return x},L.getWrappedLineTrimmedLength=k},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(x,g){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,o){h.__proto__=o}||function(h,o){for(var u in o)o.hasOwnProperty(u)&&(h[u]=o[u])})(x,g)},function(x,g){function h(){this.constructor=x}k(x,g),x.prototype=g===null?Object.create(g):(h.prototype=g.prototype,new h)});Object.defineProperty(L,"__esModule",{value:!0}),L.Marker=void 0;var f=I(0),E=function(x){function g(h){var o=x.call(this)||this;return o.line=h,o._id=g._nextId++,o.isDisposed=!1,o._onDispose=new f.EventEmitter,o}return M(g,x),Object.defineProperty(g.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),g.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},g._nextId=1,g}(I(2).Disposable);L.Marker=E},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.OptionsService=L.DEFAULT_OPTIONS=L.DEFAULT_BELL_SOUND=void 0;var k=I(0),M=I(11),f=I(33);L.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",L.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:L.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:M.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],x=function(){function g(h){this._onOptionChange=new k.EventEmitter,this.options=f.clone(L.DEFAULT_OPTIONS);for(var o=0,u=Object.keys(h);o<u.length;o++){var r=u[o];if(r in this.options){var n=h[r];this.options[r]=n}}}return Object.defineProperty(g.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),g.prototype.setOption=function(h,o){if(!(h in L.DEFAULT_OPTIONS))throw new Error('No option with key "'+h+'"');if(E.indexOf(h)!==-1)throw new Error('Option "'+h+'" can only be set in the constructor');this.options[h]!==o&&(o=this._sanitizeAndValidateOption(h,o),this.options[h]!==o&&(this.options[h]=o,this._onOptionChange.fire(h)))},g.prototype._sanitizeAndValidateOption=function(h,o){switch(h){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":o||(o=L.DEFAULT_OPTIONS[h]);break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(h+" cannot be less than 1, value: "+o);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(h+" cannot be less than 0, value: "+o);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(h+" cannot be less than or equal to 0, value: "+o)}return o},g.prototype.getOption=function(h){if(!(h in L.DEFAULT_OPTIONS))throw new Error('No option with key "'+h+'"');return this.options[h]},g}();L.OptionsService=x},function(V,L,I){"use strict";var k,M=this&&this.__extends||(k=function(t,i){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var c in l)l.hasOwnProperty(c)&&(s[c]=l[c])})(t,i)},function(t,i){function s(){this.constructor=t}k(t,i),t.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}),f=this&&this.__decorate||function(t,i,s,l){var c,d=arguments.length,w=d<3?i:l===null?l=Object.getOwnPropertyDescriptor(i,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,i,s,l);else for(var m=t.length-1;m>=0;m--)(c=t[m])&&(w=(d<3?c(w):d>3?c(i,s,w):c(i,s))||w);return d>3&&w&&Object.defineProperty(i,s,w),w},E=this&&this.__param||function(t,i){return function(s,l){i(s,l,t)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CoreService=void 0;var x=I(1),g=I(0),h=I(33),o=I(2),u=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),n=function(t){function i(s,l,c,d){var w=t.call(this)||this;return w._bufferService=l,w._logService=c,w._optionsService=d,w.isCursorInitialized=!1,w.isCursorHidden=!1,w._onData=w.register(new g.EventEmitter),w._onUserInput=w.register(new g.EventEmitter),w._onBinary=w.register(new g.EventEmitter),w._scrollToBottom=s,w.register({dispose:function(){return w._scrollToBottom=void 0}}),w.modes=h.clone(u),w.decPrivateModes=h.clone(r),w}return M(i,t),Object.defineProperty(i.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),i.prototype.reset=function(){this.modes=h.clone(u),this.decPrivateModes=h.clone(r)},i.prototype.triggerDataEvent=function(s,l){if(l===void 0&&(l=!1),!this._optionsService.options.disableStdin){var c=this._bufferService.buffer;c.ybase!==c.ydisp&&this._scrollToBottom(),l&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(d){return d.charCodeAt(0)})}),this._onData.fire(s)}},i.prototype.triggerBinaryEvent=function(s){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+s+'"',function(){return s.split("").map(function(l){return l.charCodeAt(0)})}),this._onBinary.fire(s))},i=f([E(1,x.IBufferService),E(2,x.ILogService),E(3,x.IOptionsService)],i)}(o.Disposable);L.CoreService=n},function(V,L,I){"use strict";var k=this&&this.__decorate||function(r,n,t,i){var s,l=arguments.length,c=l<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,t,i);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(l<3?s(c):l>3?s(n,t,c):s(n,t))||c);return l>3&&c&&Object.defineProperty(n,t,c),c},M=this&&this.__param||function(r,n){return function(t,i){n(t,i,r)}};Object.defineProperty(L,"__esModule",{value:!0}),L.CoreMouseService=void 0;var f=I(1),E=I(0),x={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(r){return r.button!==4&&r.action===1&&(r.ctrl=!1,r.alt=!1,r.shift=!1,!0)}},VT200:{events:19,restrict:function(r){return r.action!==32}},DRAG:{events:23,restrict:function(r){return r.action!==32||r.button!==3}},ANY:{events:31,restrict:function(r){return!0}}};function g(r,n){var t=(r.ctrl?16:0)|(r.shift?4:0)|(r.alt?8:0);return r.button===4?(t|=64,t|=r.action):(t|=3&r.button,4&r.button&&(t|=64),8&r.button&&(t|=128),r.action===32?t|=32:r.action!==0||n||(t|=3)),t}var h=String.fromCharCode,o={DEFAULT:function(r){var n=[g(r,!1)+32,r.col+32,r.row+32];return n[0]>255||n[1]>255||n[2]>255?"":""+h(n[0])+h(n[1])+h(n[2])},SGR:function(r){var n=r.action===0&&r.button!==4?"m":"M";return"[<"+g(r,!0)+";"+r.col+";"+r.row+n}},u=function(){function r(n,t){this._bufferService=n,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var i=0,s=Object.keys(x);i<s.length;i++){var l=s[i];this.addProtocol(l,x[l])}for(var c=0,d=Object.keys(o);c<d.length;c++){var w=d[c];this.addEncoding(w,o[w])}this.reset()}return r.prototype.addProtocol=function(n,t){this._protocols[n]=t},r.prototype.addEncoding=function(n,t){this._encodings[n]=t},Object.defineProperty(r.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(n){if(!this._protocols[n])throw new Error('unknown protocol "'+n+'"');this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(n){if(!this._encodings[n])throw new Error('unknown encoding "'+n+'"');this._activeEncoding=n},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(r.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),r.prototype.triggerMouseEvent=function(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows)return!1;if(n.button===4&&n.action===32)return!1;if(n.button===3&&n.action!==32)return!1;if(n.button!==4&&(n.action===2||n.action===3))return!1;if(n.col++,n.row++,n.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,n))return!1;if(!this._protocols[this._activeProtocol].restrict(n))return!1;var t=this._encodings[this._activeEncoding](n);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=n,!0},r.prototype.explainEvents=function(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}},r.prototype._compareEvents=function(n,t){return n.col===t.col&&(n.row===t.row&&(n.button===t.button&&(n.action===t.action&&(n.ctrl===t.ctrl&&n.alt===t.alt))))&&n.shift===t.shift},r=k([M(0,f.IBufferService),M(1,f.ICoreService)],r)}();L.CoreMouseService=u},function(V,L,I){"use strict";var k=this&&this.__decorate||function(x,g,h,o){var u,r=arguments.length,n=r<3?g:o===null?o=Object.getOwnPropertyDescriptor(g,h):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(x,g,h,o);else for(var t=x.length-1;t>=0;t--)(u=x[t])&&(n=(r<3?u(n):r>3?u(g,h,n):u(g,h))||n);return r>3&&n&&Object.defineProperty(g,h,n),n},M=this&&this.__param||function(x,g){return function(h,o){g(h,o,x)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DirtyRowService=void 0;var f=I(1),E=function(){function x(g){this._bufferService=g,this.clearRange()}return Object.defineProperty(x.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),x.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},x.prototype.markDirty=function(g){g<this._start?this._start=g:g>this._end&&(this._end=g)},x.prototype.markRangeDirty=function(g,h){if(g>h){var o=g;g=h,h=o}g<this._start&&(this._start=g),h>this._end&&(this._end=h)},x.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},x=k([M(0,f.IBufferService)],x)}();L.DirtyRowService=E},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.UnicodeService=void 0;var k=I(0),M=I(79),f=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new k.EventEmitter;var x=new M.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}return Object.defineProperty(E.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"activeVersion",{get:function(){return this._active},set:function(x){if(!this._providers[x])throw new Error('unknown Unicode version "'+x+'"');this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)},enumerable:!1,configurable:!0}),E.prototype.register=function(x){this._providers[x.version]=x},E.prototype.wcwidth=function(x){return this._activeProvider.wcwidth(x)},E.prototype.getStringCellWidth=function(x){for(var g=0,h=x.length,o=0;o<h;++o){var u=x.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=h)return g+this.wcwidth(u);var r=x.charCodeAt(o);56320<=r&&r<=57343?u=1024*(u-55296)+r-56320+65536:g+=this.wcwidth(r)}g+=this.wcwidth(u)}return g},E}();L.UnicodeService=f},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.UnicodeV6=void 0;var k,M=I(15),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],E=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],x=function(){function g(){if(this.version="6",!k){k=new Uint8Array(65536),M.fill(k,1),k[0]=0,M.fill(k,0,1,32),M.fill(k,0,127,160),M.fill(k,2,4352,4448),k[9001]=2,k[9002]=2,M.fill(k,2,11904,42192),k[12351]=1,M.fill(k,2,44032,55204),M.fill(k,2,63744,64256),M.fill(k,2,65040,65050),M.fill(k,2,65072,65136),M.fill(k,2,65280,65377),M.fill(k,2,65504,65511);for(var h=0;h<f.length;++h)M.fill(k,0,f[h][0],f[h][1]+1)}}return g.prototype.wcwidth=function(h){return h<32?0:h<127?1:h<65536?k[h]:function(o,u){var r,n=0,t=u.length-1;if(o<u[0][0]||o>u[t][1])return!1;for(;t>=n;)if(o>u[r=n+t>>1][1])n=r+1;else{if(!(o<u[r][0]))return!0;t=r-1}return!1}(h,E)?0:h>=131072&&h<=196605||h>=196608&&h<=262141?2:1},g}();L.UnicodeV6=x},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.CharsetService=void 0;var k=function(){function M(){this.glevel=0,this._charsets=[]}return M.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},M.prototype.setgLevel=function(f){this.glevel=f,this.charset=this._charsets[f]},M.prototype.setgCharset=function(f,E){this._charsets[f]=E,this.glevel===f&&(this.charset=E)},M}();L.CharsetService=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.updateWindowsModeWrappedState=void 0;var k=I(3);L.updateWindowsModeWrappedState=function(M){var f=M.buffer.lines.get(M.buffer.ybase+M.buffer.y-1),E=f==null?void 0:f.get(M.cols-1),x=M.buffer.lines.get(M.buffer.ybase+M.buffer.y);x&&E&&(x.isWrapped=E[k.CHAR_DATA_CODE_INDEX]!==k.NULL_CELL_CODE&&E[k.CHAR_DATA_CODE_INDEX]!==k.WHITESPACE_CELL_CODE)}},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.WriteBuffer=void 0;var k=function(){function M(f){this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return M.prototype.writeSync=function(f){if(this._writeBuffer.length){for(var E=this._bufferOffset;E<this._writeBuffer.length;++E){var x=this._writeBuffer[E],g=this._callbacks[E];this._action(x),g&&g()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(f)},M.prototype.write=function(f,E){var x=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return x._innerWrite()})),this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(E)},M.prototype._innerWrite=function(){for(var f=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var x=this._writeBuffer[this._bufferOffset],g=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(x),this._pendingData-=x.length,g&&g(),Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return f._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},M}();L.WriteBuffer=k},function(V,L,I){"use strict";Object.defineProperty(L,"__esModule",{value:!0}),L.AddonManager=void 0;var k=function(){function M(){this._addons=[]}return M.prototype.dispose=function(){for(var f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()},M.prototype.loadAddon=function(f,E){var x=this,g={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(g),E.dispose=function(){return x._wrappedAddonDispose(g)},E.activate(f)},M.prototype._wrappedAddonDispose=function(f){if(!f.isDisposed){for(var E=-1,x=0;x<this._addons.length;x++)if(this._addons[x]===f){E=x;break}if(E===-1)throw new Error("Could not dispose an addon that has not been loaded");f.isDisposed=!0,f.dispose.apply(f.instance),this._addons.splice(E,1)}},M}();L.AddonManager=k}])})},"07cG":function(at,fe,oe){at.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){V.defineOption("placeholder","",function(x,g,h){var o=h&&h!=V.Init;if(g&&!o)x.on("blur",M),x.on("change",f),x.on("swapDoc",f),V.on(x.getInputField(),"compositionupdate",x.state.placeholderCompose=function(){k(x)}),f(x);else if(!g&&o){x.off("blur",M),x.off("change",f),x.off("swapDoc",f),V.off(x.getInputField(),"compositionupdate",x.state.placeholderCompose),L(x);var u=x.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}g&&!x.hasFocus()&&M(x)});function L(x){x.state.placeholder&&(x.state.placeholder.parentNode.removeChild(x.state.placeholder),x.state.placeholder=null)}function I(x){L(x);var g=x.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=x.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var h=x.getOption("placeholder");typeof h=="string"&&(h=document.createTextNode(h)),g.appendChild(h),x.display.lineSpace.insertBefore(g,x.display.lineSpace.firstChild)}function k(x){setTimeout(function(){var g=!1,h=x.getInputField();h.nodeName=="TEXTAREA"?g=!h.value:x.lineCount()==1&&(g=!/[^\u200b]/.test(h.querySelector(".CodeMirror-line").textContent)),g?I(x):L(x)},20)}function M(x){E(x)&&I(x)}function f(x){var g=x.getWrapperElement(),h=E(x);g.className=g.className.replace(" CodeMirror-empty","")+(h?" CodeMirror-empty":""),h?I(x):L(x)}function E(x){return x.lineCount()===1&&x.getLine(0)===""}})},"1dTM":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=oe("GQ8N"),L=T(oe("Lo0S")),I=oe("VSMT"),k=oe("GdRQ"),M=oe("SZEN"),f=oe("vewr"),E=v(oe("YJ9k")),x=v(oe("MZdM")),g=v(oe("ItS6")),h=v(oe("whVF")),o=v(oe("Fv0C")),u=v(oe("LCi9")),r=v(oe("rwxt")),n=v(oe("Mmt2")),t=v(oe("iUHT")),i=v(oe("mHUz")),s=v(oe("P2ho")),l=oe("NBmB");oe("mdZa");var c=v(oe("34/K")),d=v(oe("hXwI")),w=v(oe("SgaC")),m=v(oe("3690")),S=v(oe("8K/p")),C=v(oe("xO64"));function v(He){return He&&He.__esModule?He:{default:He}}function y(){if(typeof WeakMap!="function")return null;var He=new WeakMap;return y=function(){return He},He}function T(He){if(He&&He.__esModule)return He;if(He===null||A(He)!=="object"&&typeof He!="function")return{default:He};var Ue=y();if(Ue&&Ue.has(He))return Ue.get(He);var Pe={},ke=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var re in He)if(Object.prototype.hasOwnProperty.call(He,re)){var ve=ke?Object.getOwnPropertyDescriptor(He,re):null;ve&&(ve.get||ve.set)?Object.defineProperty(Pe,re,ve):Pe[re]=He[re]}return Pe.default=He,Ue&&Ue.set(He,Pe),Pe}function A(He){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(Pe){return typeof Pe}:A=function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},A(He)}function p(He,Ue){if(!(He instanceof Ue))throw new TypeError("Cannot call a class as a function")}function D(He,Ue){for(var Pe=0;Pe<Ue.length;Pe++){var ke=Ue[Pe];ke.enumerable=ke.enumerable||!1,ke.configurable=!0,"value"in ke&&(ke.writable=!0),Object.defineProperty(He,ke.key,ke)}}function O(He,Ue,Pe){return Ue&&D(He.prototype,Ue),Pe&&D(He,Pe),He}function P(He,Ue){if(typeof Ue!="function"&&Ue!==null)throw new TypeError("Super expression must either be null or a function");He.prototype=Object.create(Ue&&Ue.prototype,{constructor:{value:He,writable:!0,configurable:!0}}),Ue&&j(He,Ue)}function j(He,Ue){return j=Object.setPrototypeOf||function(ke,re){return ke.__proto__=re,ke},j(He,Ue)}function K(He){var Ue=B();return function(){var ke=N(He),re;if(Ue){var ve=N(this).constructor;re=Reflect.construct(ke,arguments,ve)}else re=ke.apply(this,arguments);return U(this,re)}}function U(He,Ue){return Ue&&(A(Ue)==="object"||typeof Ue=="function")?Ue:X(He)}function X(He){if(He===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return He}function B(){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(He){return!1}}function N(He){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},N(He)}var z=3,te="rgb(40, 40, 40)",ce=17,be=50,Fe=19,Oe=75,Re=50,Be=1e3,Ke=50,Ae=1,_e=1<<1,le=1<<2,Ee=1<<3,pe=1<<4,Ge=1<<24,Ye=1<<25,ze=1<<26,Ze=1<<27,Je=1<<28,$e=function(He){P(Pe,He);var Ue=K(Pe);function Pe(ke,re,ve){var ae;if(p(this,Pe),!ke)throw new Error("Must specify target");if(!re)throw new Error("Must specify URL");ae=Ue.call(this),ae._target=ke,ae._url=re,ve=ve||{},ae._rfbCredentials=ve.credentials||{},ae._shared="shared"in ve?!!ve.shared:!0,ae._repeaterID=ve.repeaterID||"",ae._wsProtocols=ve.wsProtocols||[],ae._rfbConnectionState="",ae._rfbInitState="",ae._rfbAuthScheme=-1,ae._rfbCleanDisconnect=!0,ae._rfbVersion=0,ae._rfbMaxVersion=3.8,ae._rfbTightVNC=!1,ae._rfbVeNCryptState=0,ae._rfbXvpVer=0,ae._fbWidth=0,ae._fbHeight=0,ae._fbName="",ae._capabilities={power:!1},ae._supportsFence=!1,ae._supportsContinuousUpdates=!1,ae._enabledContinuousUpdates=!1,ae._supportsSetDesktopSize=!1,ae._screenID=0,ae._screenFlags=0,ae._qemuExtKeyEventSupported=!1,ae._clipboardText=null,ae._clipboardServerCapabilitiesActions={},ae._clipboardServerCapabilitiesFormats={},ae._sock=null,ae._display=null,ae._flushing=!1,ae._keyboard=null,ae._gestures=null,ae._disconnTimer=null,ae._resizeTimeout=null,ae._mouseMoveTimer=null,ae._decoders={},ae._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},ae._mousePos={},ae._mouseButtonMask=0,ae._mouseLastMoveTime=0,ae._viewportDragging=!1,ae._viewportDragPos={},ae._viewportHasMoved=!1,ae._accumulatedWheelDeltaX=0,ae._accumulatedWheelDeltaY=0,ae._gestureLastTapTime=null,ae._gestureFirstDoubleTapEv=null,ae._gestureLastMagnitudeX=0,ae._gestureLastMagnitudeY=0,ae._eventHandlers={focusCanvas:ae._focusCanvas.bind(X(ae)),windowResize:ae._windowResize.bind(X(ae)),handleMouse:ae._handleMouse.bind(X(ae)),handleWheel:ae._handleWheel.bind(X(ae)),handleGesture:ae._handleGesture.bind(X(ae))},L.Debug(">> RFB.constructor"),ae._screen=document.createElement("div"),ae._screen.style.display="flex",ae._screen.style.width="100%",ae._screen.style.height="100%",ae._screen.style.overflow="auto",ae._screen.style.background=te,ae._canvas=document.createElement("canvas"),ae._canvas.style.margin="auto",ae._canvas.style.outline="none",ae._canvas.style.flexShrink="0",ae._canvas.width=0,ae._canvas.height=0,ae._canvas.tabIndex=-1,ae._screen.appendChild(ae._canvas),ae._cursor=new r.default,ae._cursorImage=Pe.cursors.none,ae._decoders[l.encodings.encodingRaw]=new c.default,ae._decoders[l.encodings.encodingCopyRect]=new d.default,ae._decoders[l.encodings.encodingRRE]=new w.default,ae._decoders[l.encodings.encodingHextile]=new m.default,ae._decoders[l.encodings.encodingTight]=new S.default,ae._decoders[l.encodings.encodingTightPNG]=new C.default;try{ae._display=new x.default(ae._canvas)}catch(De){throw L.Error("Display exception: "+De),De}return ae._display.onflush=ae._onFlush.bind(X(ae)),ae._keyboard=new o.default(ae._canvas),ae._keyboard.onkeyevent=ae._handleKeyEvent.bind(X(ae)),ae._gestures=new u.default,ae._sock=new n.default,ae._sock.on("message",function(){ae._handleMessage()}),ae._sock.on("open",function(){ae._rfbConnectionState==="connecting"&&ae._rfbInitState===""?(ae._rfbInitState="ProtocolVersion",L.Debug("Starting VNC handshake")):ae._fail("Unexpected server connection while "+ae._rfbConnectionState)}),ae._sock.on("close",function(De){L.Debug("WebSocket on-close event");var qe="";De.code&&(qe="(code: "+De.code,De.reason&&(qe+=", reason: "+De.reason),qe+=")");switch(ae._rfbConnectionState){case"connecting":ae._fail("Connection closed "+qe);break;case"connected":ae._updateConnectionState("disconnecting"),ae._updateConnectionState("disconnected");break;case"disconnecting":ae._updateConnectionState("disconnected");break;case"disconnected":ae._fail("Unexpected server disconnect when already disconnected "+qe);break;default:ae._fail("Unexpected server disconnect before connecting "+qe);break}ae._sock.off("close")}),ae._sock.on("error",function(De){return L.Warn("WebSocket on-error event")}),setTimeout(ae._updateConnectionState.bind(X(ae),"connecting")),L.Debug("<< RFB.constructor"),ae.dragViewport=!1,ae.focusOnClick=!0,ae._viewOnly=!1,ae._clipViewport=!1,ae._scaleViewport=!1,ae._resizeSession=!1,ae._showDotCursor=!1,ve.showDotCursor!==void 0&&(L.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),ae._showDotCursor=ve.showDotCursor),ae._qualityLevel=6,ae._compressionLevel=2,ae}return O(Pe,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(re){this._rfbCredentials=re,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;L.Info("Sending Ctrl-Alt-Del"),this.sendKey(i.default.XK_Control_L,"ControlLeft",!0),this.sendKey(i.default.XK_Alt_L,"AltLeft",!0),this.sendKey(i.default.XK_Delete,"Delete",!0),this.sendKey(i.default.XK_Delete,"Delete",!1),this.sendKey(i.default.XK_Alt_L,"AltLeft",!1),this.sendKey(i.default.XK_Control_L,"ControlLeft",!1)}},{key:"machineShutdown",value:function(){this._xvpOp(1,2)}},{key:"machineReboot",value:function(){this._xvpOp(1,3)}},{key:"machineReset",value:function(){this._xvpOp(1,4)}},{key:"sendKey",value:function(re,ve,ae){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(ae===void 0){this.sendKey(re,ve,!0),this.sendKey(re,ve,!1);return}var De=s.default[ve];if(this._qemuExtKeyEventSupported&&De)re=re||0,L.Info("Sending key ("+(ae?"down":"up")+"): keysym "+re+", scancode "+De),Pe.messages.QEMUExtendedKeyEvent(this._sock,re,ae,De);else{if(!re)return;L.Info("Sending keysym ("+(ae?"down":"up")+"): "+re),Pe.messages.keyEvent(this._sock,re,ae?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(re){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[Ae]&&this._clipboardServerCapabilitiesActions[Ze])this._clipboardText=re,Pe.messages.extendedClipboardNotify(this._sock,[Ae]);else{for(var ve=new Uint8Array(re.length),ae=0;ae<re.length;ae++)ve[ae]=re.charCodeAt(ae);Pe.messages.clientCutText(this._sock,ve)}}},{key:"_connect",value:function(){L.Debug(">> RFB.connect"),L.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(re){re.name==="SyntaxError"?this._fail("Invalid host or port ("+re+")"):this._fail("Error when opening socket ("+re+")")}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),window.addEventListener("resize",this._eventHandlers.windowResize),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("touchstart",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),L.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){L.Debug(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),window.removeEventListener("resize",this._eventHandlers.windowResize),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(re){if(!(re.name==="NotFoundError"))throw re}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),L.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(re){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function(re){this._fbName=re,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(re){var ve=this;window.requestAnimationFrame(function(){ve._updateClip(),ve._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var re=this._display.clipViewport,ve=this._clipViewport;if(this._scaleViewport&&(ve=!1),re!==ve&&(this._display.clipViewport=ve),ve){var ae=this._screenSize();this._display.viewportChangeSize(ae.w,ae.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var re=this._screenSize();this._display.autoscale(re.w,re.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var re=this._screenSize();Pe.messages.setDesktopSize(this._sock,Math.floor(re.w),Math.floor(re.h),this._screenID,this._screenFlags),L.Debug("Requested new desktop size: "+re.w+"x"+re.h)}},{key:"_screenSize",value:function(){var re=this._screen.getBoundingClientRect();return{w:re.width,h:re.height}}},{key:"_fixScrollbars",value:function(){var re=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=re}},{key:"_updateConnectionState",value:function(re){var ve=this,ae=this._rfbConnectionState;if(re===ae){L.Debug("Already in state '"+re+"', ignoring");return}if(ae==="disconnected"){L.Error("Tried changing state of a disconnected RFB object");return}switch(re){case"connected":if(ae!=="connecting"){L.Error("Bad transition to connected state, previous connection state: "+ae);return}break;case"disconnected":if(ae!=="disconnecting"){L.Error("Bad transition to disconnected state, previous connection state: "+ae);return}break;case"connecting":if(ae!==""){L.Error("Bad transition to connecting state, previous connection state: "+ae);return}break;case"disconnecting":if(ae!=="connected"&&ae!=="connecting"){L.Error("Bad transition to disconnecting state, previous connection state: "+ae);return}break;default:L.Error("Unknown connection state: "+re);return}this._rfbConnectionState=re,L.Debug("New state '"+re+"', was '"+ae+"'."),this._disconnTimer&&re!=="disconnecting"&&(L.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch(re){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){L.Error("Disconnection timed out."),ve._updateConnectionState("disconnected")},z*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function(re){switch(this._rfbConnectionState){case"disconnecting":L.Error("Failed when disconnecting: "+re);break;case"connected":L.Error("Failed while connected: "+re);break;case"connecting":L.Error("Failed when connecting: "+re);break;default:L.Error("RFB failure: "+re);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(re,ve){this._capabilities[re]=ve,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){L.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":L.Error("Got data while disconnected");break;case"connected":for(;!this._flushing;){if(!this._normalMsg())break;if(this._sock.rQlen===0)break}break;default:this._initMsg();break}}},{key:"_handleKeyEvent",value:function(re,ve,ae){this.sendKey(re,ve,ae)}},{key:"_handleMouse",value:function(re){if(re.type==="click"&&re.target!==this._canvas)return;if(re.stopPropagation(),re.preventDefault(),re.type==="click"||re.type==="contextmenu")return;var ve=(0,M.clientToElement)(re.clientX,re.clientY,this._canvas);switch(re.type){case"mousedown":(0,f.setCapture)(this._canvas),this._handleMouseButton(ve.x,ve.y,!0,1<<re.button);break;case"mouseup":this._handleMouseButton(ve.x,ve.y,!1,1<<re.button);break;case"mousemove":this._handleMouseMove(ve.x,ve.y);break}}},{key:"_handleMouseButton",value:function(re,ve,ae,De){if(this.dragViewport)if(ae&&!this._viewportDragging){this._viewportDragging=!0,this._viewportDragPos={x:re,y:ve},this._viewportHasMoved=!1;return}else{if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(re,ve,De)}this._mouseMoveTimer!==null&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(re,ve,this._mouseButtonMask)),ae?this._mouseButtonMask|=De:this._mouseButtonMask&=~De,this._sendMouse(re,ve,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(re,ve){var ae=this;if(this._viewportDragging){var De=this._viewportDragPos.x-re,qe=this._viewportDragPos.y-ve;(this._viewportHasMoved||Math.abs(De)>k.dragThreshold||Math.abs(qe)>k.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:re,y:ve},this._display.viewportChangePos(De,qe));return}if(this._mousePos={x:re,y:ve},this._mouseMoveTimer==null){var et=Date.now()-this._mouseLastMoveTime;et>ce?(this._sendMouse(re,ve,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){ae._handleDelayedMouseMove()},ce-et)}}},{key:"_handleDelayedMouseMove",value:function(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}},{key:"_sendMouse",value:function(re,ve,ae){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Pe.messages.pointerEvent(this._sock,this._display.absX(re),this._display.absY(ve),ae)}},{key:"_handleWheel",value:function(re){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;re.stopPropagation(),re.preventDefault();var ve=(0,M.clientToElement)(re.clientX,re.clientY,this._canvas),ae=re.deltaX,De=re.deltaY;re.deltaMode!==0&&(ae*=Fe,De*=Fe),this._accumulatedWheelDeltaX+=ae,this._accumulatedWheelDeltaY+=De,Math.abs(this._accumulatedWheelDeltaX)>=be&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(ve.x,ve.y,!0,1<<5),this._handleMouseButton(ve.x,ve.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(ve.x,ve.y,!0,1<<6),this._handleMouseButton(ve.x,ve.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=be&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(ve.x,ve.y,!0,1<<3),this._handleMouseButton(ve.x,ve.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(ve.x,ve.y,!0,1<<4),this._handleMouseButton(ve.x,ve.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function(re,ve,ae){this._handleMouseMove(ve,ae),this._cursor.move(re.detail.clientX,re.detail.clientY)}},{key:"_handleTapEvent",value:function(re,ve){var ae=(0,M.clientToElement)(re.detail.clientX,re.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTime<Be&&this._gestureFirstDoubleTapEv.detail.type===re.detail.type){var De=this._gestureFirstDoubleTapEv.detail.clientX-re.detail.clientX,qe=this._gestureFirstDoubleTapEv.detail.clientY-re.detail.clientY,et=Math.hypot(De,qe);et<Ke?ae=(0,M.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=re}else this._gestureFirstDoubleTapEv=re;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!0,ve),this._handleMouseButton(ae.x,ae.y,!1,ve)}},{key:"_handleGesture",value:function(re){var ve,ae=(0,M.clientToElement)(re.detail.clientX,re.detail.clientY,this._canvas);switch(re.type){case"gesturestart":switch(re.detail.type){case"onetap":this._handleTapEvent(re,1);break;case"twotap":this._handleTapEvent(re,4);break;case"threetap":this._handleTapEvent(re,2);break;case"drag":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!0,1);break;case"longpress":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=re.detail.magnitudeX,this._gestureLastMagnitudeY=re.detail.magnitudeY,this._fakeMouseMove(re,ae.x,ae.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(re.detail.magnitudeX,re.detail.magnitudeY),this._fakeMouseMove(re,ae.x,ae.y);break}break;case"gesturemove":switch(re.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(re,ae.x,ae.y);break;case"twodrag":for(this._fakeMouseMove(re,ae.x,ae.y);re.detail.magnitudeY-this._gestureLastMagnitudeY>Re;)this._handleMouseButton(ae.x,ae.y,!0,8),this._handleMouseButton(ae.x,ae.y,!1,8),this._gestureLastMagnitudeY+=Re;for(;re.detail.magnitudeY-this._gestureLastMagnitudeY<-Re;)this._handleMouseButton(ae.x,ae.y,!0,16),this._handleMouseButton(ae.x,ae.y,!1,16),this._gestureLastMagnitudeY-=Re;for(;re.detail.magnitudeX-this._gestureLastMagnitudeX>Re;)this._handleMouseButton(ae.x,ae.y,!0,32),this._handleMouseButton(ae.x,ae.y,!1,32),this._gestureLastMagnitudeX+=Re;for(;re.detail.magnitudeX-this._gestureLastMagnitudeX<-Re;)this._handleMouseButton(ae.x,ae.y,!0,64),this._handleMouseButton(ae.x,ae.y,!1,64),this._gestureLastMagnitudeX-=Re;break;case"pinch":if(this._fakeMouseMove(re,ae.x,ae.y),ve=Math.hypot(re.detail.magnitudeX,re.detail.magnitudeY),Math.abs(ve-this._gestureLastMagnitudeX)>Oe){for(this._handleKeyEvent(i.default.XK_Control_L,"ControlLeft",!0);ve-this._gestureLastMagnitudeX>Oe;)this._handleMouseButton(ae.x,ae.y,!0,8),this._handleMouseButton(ae.x,ae.y,!1,8),this._gestureLastMagnitudeX+=Oe;for(;ve-this._gestureLastMagnitudeX<-Oe;)this._handleMouseButton(ae.x,ae.y,!0,16),this._handleMouseButton(ae.x,ae.y,!1,16),this._gestureLastMagnitudeX-=Oe}this._handleKeyEvent(i.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(re.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!1,1);break;case"longpress":this._fakeMouseMove(re,ae.x,ae.y),this._handleMouseButton(ae.x,ae.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var re=this._sock.rQshiftStr(12).substr(4,7);L.Info("Server ProtocolVersion: "+re);var ve=0;switch(re){case"000.000":ve=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+re)}if(ve){for(var ae="ID:"+this._repeaterID;ae.length<250;)ae+="\0";return this._sock.sendString(ae),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var De="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+De+`
`),L.Debug("Sent ProtocolVersion: "+De),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function re(De,qe){for(var et=0;et<qe.length;et++)if(qe[et]===De)return!0;return!1}if(this._rfbVersion>=3.7){var ve=this._sock.rQshift8();if(this._sock.rQwait("security type",ve,1))return!1;if(ve===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var ae=this._sock.rQshiftBytes(ve);if(L.Debug("Server security types: "+ae),re(1,ae))this._rfbAuthScheme=1;else if(re(22,ae))this._rfbAuthScheme=22;else if(re(16,ae))this._rfbAuthScheme=16;else if(re(2,ae))this._rfbAuthScheme=2;else if(re(19,ae))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+ae+")");this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),this._rfbAuthScheme==0)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",L.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var re=this._sock.rQshift32(),ve="";if(re>0){if(this._sock.rQwait("reason",re,4))return!1;ve=this._sock.rQshiftStr(re)}return ve!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:ve}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+ve+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0||this._rfbCredentials.target===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var re=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(re),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var re=this._sock.rQshift8(),ve=this._sock.rQshift8();if(!(re==0&&ve==2))return this._fail("Unsupported VeNCrypt version "+re+"."+ve);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var ae=this._sock.rQshift8();if(ae!=0)return this._fail("VeNCrypt failure "+ae);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var De=this._sock.rQshift8();if(De<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=De,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var qe=[],et=0;et<this._rfbVeNCryptSubtypesLength;et++)qe.push(this._sock.rQshift32());if(qe.indexOf(256)!=-1)this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4;else return this._fail("VeNCrypt Plain subtype not offered by server")}if(this._rfbVeNCryptState==4){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;var je=(0,I.encodeUTF8)(this._rfbCredentials.username),ct=(0,I.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,je.length]),this._sock.send([0,0,0,ct.length]),this._sock.sendString(je),this._sock.sendString(ct),this._rfbInitState="SecurityResult",!0}}},{key:"_negotiateStdVNCAuth",value:function(){if(this._sock.rQwait("auth challenge",16))return!1;if(this._rfbCredentials.password===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;var re=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),ve=Pe.genDES(this._rfbCredentials.password,re);return this._sock.send(ve),this._rfbInitState="SecurityResult",!0}},{key:"_negotiateTightUnixAuth",value:function(){return this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0?(this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1):(this._sock.send([0,0,0,this._rfbCredentials.username.length]),this._sock.send([0,0,0,this._rfbCredentials.password.length]),this._sock.sendString(this._rfbCredentials.username),this._sock.sendString(this._rfbCredentials.password),this._rfbInitState="SecurityResult",!0)}},{key:"_negotiateTightTunnels",value:function(re){for(var ve={0:{vendor:"TGHT",signature:"NOTUNNEL"}},ae={},De=0;De<re;De++){var qe=this._sock.rQshift32(),et=this._sock.rQshiftStr(4),je=this._sock.rQshiftStr(8);ae[qe]={vendor:et,signature:je}}return L.Debug("Server Tight tunnel types: "+ae),ae[1]&&ae[1].vendor==="SICR"&&ae[1].signature==="SCHANNEL"&&(L.Debug("Detected Siemens server. Assuming NOTUNNEL support."),ae[0]={vendor:"TGHT",signature:"NOTUNNEL"}),ae[0]?ae[0].vendor!=ve[0].vendor||ae[0].signature!=ve[0].signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(L.Debug("Selected tunnel type: "+ve[0]),this._sock.send([0,0,0,0]),!1):this._fail("Server wanted tunnels, but doesn't support the notunnel type")}},{key:"_negotiateTightAuth",value:function(){if(!this._rfbTightVNC){if(this._sock.rQwait("num tunnels",4))return!1;var re=this._sock.rQshift32();if(re>0&&this._sock.rQwait("tunnel capabilities",16*re,4))return!1;if(this._rfbTightVNC=!0,re>0)return this._negotiateTightTunnels(re),!1}if(this._sock.rQwait("sub auth count",4))return!1;var ve=this._sock.rQshift32();if(ve===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*ve,4))return!1;for(var ae={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},De=[],qe=0;qe<ve;qe++){this._sock.rQshift32();var et=this._sock.rQshiftStr(12);De.push(et)}L.Debug("Server Tight authentication types: "+De);for(var je in ae)if(De.indexOf(je)!=-1){this._sock.send([0,0,0,ae[je]]),L.Debug("Selected authentication type: "+je);switch(je){case"STDVNOAUTH__":return this._rfbInitState="SecurityResult",!0;case"STDVVNCAUTH_":return this._rfbAuthScheme=2,this._initMsg();case"TGHTULGNAUTH":return this._rfbAuthScheme=129,this._initMsg();default:return this._fail("Unsupported tiny auth scheme (scheme: "+je+")")}}return this._fail("No supported sub-auth types!")}},{key:"_negotiateAuthentication",value:function(){switch(this._rfbAuthScheme){case 1:return this._rfbVersion>=3.8?(this._rfbInitState="SecurityResult",!0):(this._rfbInitState="ClientInitialisation",this._initMsg());case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}},{key:"_handleSecurityResult",value:function(){if(this._sock.rQwait("VNC auth response ",4))return!1;var re=this._sock.rQshift32();return re===0?(this._rfbInitState="ClientInitialisation",L.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=re,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:re}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var re=this._sock.rQshift16(),ve=this._sock.rQshift16(),ae=this._sock.rQshift8(),De=this._sock.rQshift8(),qe=this._sock.rQshift8(),et=this._sock.rQshift8(),je=this._sock.rQshift16(),ct=this._sock.rQshift16(),he=this._sock.rQshift16(),Te=this._sock.rQshift8(),We=this._sock.rQshift8(),xe=this._sock.rQshift8();this._sock.rQskipBytes(3);var ge=this._sock.rQshift32();if(this._sock.rQwait("server init name",ge,24))return!1;var ye=this._sock.rQshiftStr(ge);if(ye=(0,I.decodeUTF8)(ye,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+ge))return!1;var J=this._sock.rQshift16(),ne=this._sock.rQshift16(),q=this._sock.rQshift16();this._sock.rQskipBytes(2);var me=(J+ne+q)*16;if(this._sock.rQwait("TightVNC extended server init header",me,32+ge))return!1;this._sock.rQskipBytes(16*J),this._sock.rQskipBytes(16*ne),this._sock.rQskipBytes(16*q)}return L.Info("Screen: "+re+"x"+ve+", bpp: "+ae+", depth: "+De+", bigEndian: "+qe+", trueColor: "+et+", redMax: "+je+", greenMax: "+ct+", blueMax: "+he+", redShift: "+Te+", greenShift: "+We+", blueShift: "+xe),this._setDesktopName(ye),this._resize(re,ve),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(L.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Pe.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Pe.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var re=[];re.push(l.encodings.encodingCopyRect),this._fbDepth==24&&(re.push(l.encodings.encodingTight),re.push(l.encodings.encodingTightPNG),re.push(l.encodings.encodingHextile),re.push(l.encodings.encodingRRE)),re.push(l.encodings.encodingRaw),re.push(l.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),re.push(l.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),re.push(l.encodings.pseudoEncodingDesktopSize),re.push(l.encodings.pseudoEncodingLastRect),re.push(l.encodings.pseudoEncodingQEMUExtendedKeyEvent),re.push(l.encodings.pseudoEncodingExtendedDesktopSize),re.push(l.encodings.pseudoEncodingXvp),re.push(l.encodings.pseudoEncodingFence),re.push(l.encodings.pseudoEncodingContinuousUpdates),re.push(l.encodings.pseudoEncodingDesktopName),re.push(l.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&(re.push(l.encodings.pseudoEncodingVMwareCursor),re.push(l.encodings.pseudoEncodingCursor)),Pe.messages.clientEncodings(this._sock,re)}},{key:"_initMsg",value:function(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}},{key:"_handleSetColourMapMsg",value:function(){return L.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(L.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var re=this._sock.rQshift32();if(re=(0,V.toSigned32bit)(re),this._sock.rQwait("ServerCutText content",Math.abs(re),8))return!1;if(re>=0){var ve=this._sock.rQshiftStr(re);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ve}}))}else{re=Math.abs(re);var ae=this._sock.rQshift32(),De=ae&65535,qe=ae&4278190080,et=!!(qe&Ge);if(et){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var je=0;je<=15;je++){var ct=1<<je;De&ct&&(this._clipboardServerCapabilitiesFormats[ct]=!0,this._sock.rQshift32())}for(var he=24;he<=31;he++){var Te=1<<he;this._clipboardServerCapabilitiesActions[Te]=!!(qe&Te)}var We=[Ge,Ye,ze,Ze,Je];Pe.messages.extendedClipboardCaps(this._sock,We,{extendedClipboardFormatText:0})}else if(qe===Ye){if(this._viewOnly)return!0;this._clipboardText!=null&&this._clipboardServerCapabilitiesActions[Je]&&(De&Ae&&Pe.messages.extendedClipboardProvide(this._sock,[Ae],[this._clipboardText]))}else if(qe===ze){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[Ze]&&(this._clipboardText!=null?Pe.messages.extendedClipboardNotify(this._sock,[Ae]):Pe.messages.extendedClipboardNotify(this._sock,[]))}else if(qe===Ze){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[Ye]&&(De&Ae&&Pe.messages.extendedClipboardRequest(this._sock,[Ae]))}else if(qe===Je){if(this._viewOnly)return!0;if(!(De&Ae))return!0;this._clipboardText=null;var xe=this._sock.rQshiftBytes(re-4),ge=new g.default,ye=null;ge.setInput(xe);for(var J=0;J<=15;J++){var ne=1<<J;if(De&ne){var q=0,me=ge.inflate(4);q|=me[0]<<24,q|=me[1]<<16,q|=me[2]<<8,q|=me[3];var Ce=ge.inflate(q);ne===Ae&&(ye=Ce)}}if(ge.setInput(null),ye!==null){for(var G="",we=0;we<ye.length;we++)G+=String.fromCharCode(ye[we]);ye=G,ye=(0,I.decodeUTF8)(ye),ye.length>0&&ye.charAt(ye.length-1)==="\0"&&(ye=ye.slice(0,-1)),ye=ye.replace(`\r
`,`
`),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ye}}))}}else return this._fail("Unexpected action in extended clipboard message: "+qe)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var re=this._sock.rQshift32(),ve=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",ve,9))return!1;ve>64&&(L.Warn("Bad payload length ("+ve+") in fence response"),ve=64);var ae=this._sock.rQshiftStr(ve);return this._supportsFence=!0,re&1<<31?(re&=1<<0|1<<1,Pe.messages.clientFence(this._sock,re,ae),!0):this._fail("Unexpected fence response")}},{key:"_handleXvpMsg",value:function(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);var re=this._sock.rQshift8(),ve=this._sock.rQshift8();switch(ve){case 0:L.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=re,L.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+ve+")");break}return!0}},{key:"_normalMsg",value:function(){var re;this._FBU.rects>0?re=0:re=this._sock.rQshift8();var ve,ae;switch(re){case 0:return ae=this._framebufferUpdate(),ae&&!this._enabledContinuousUpdates&&Pe.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),ae;case 1:return this._handleSetColourMapMsg();case 2:return L.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return ve=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,ve&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),L.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+re+")"),L.Debug("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}},{key:"_onFlush",value:function(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}},{key:"_framebufferUpdate",value:function(){if(this._FBU.rects===0){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(this._FBU.encoding===null){if(this._sock.rQwait("rect header",12))return!1;var re=this._sock.rQshiftBytes(12);this._FBU.x=(re[0]<<8)+re[1],this._FBU.y=(re[2]<<8)+re[3],this._FBU.width=(re[4]<<8)+re[5],this._FBU.height=(re[6]<<8)+re[7],this._FBU.encoding=parseInt((re[8]<<24)+(re[9]<<16)+(re[10]<<8)+re[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}},{key:"_handleRect",value:function(){switch(this._FBU.encoding){case l.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case l.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case l.encodings.pseudoEncodingCursor:return this._handleCursor();case l.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var re=document.createEvent("keyboardEvent");re.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(ve){}return!0;case l.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case l.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case l.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var re=this._FBU.x,ve=this._FBU.y,ae=this._FBU.width,De=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var qe=this._sock.rQshift8();this._sock.rQshift8();var et,je=4;if(qe==0){var ct=4294967040|0;if(et=new Array(ae*De*je),this._sock.rQwait("VMware cursor classic encoding",ae*De*je*2,2))return!1;for(var he=new Array(ae*De),Te=0;Te<ae*De;Te++)he[Te]=this._sock.rQshift32();for(var We=new Array(ae*De),xe=0;xe<ae*De;xe++)We[xe]=this._sock.rQshift32();for(var ge=0;ge<ae*De;ge++)if(he[ge]==0){var ye=We[ge],J=ye>>8&255,ne=ye>>16&255,q=ye>>24&255;et[ge*je]=J,et[ge*je+1]=ne,et[ge*je+2]=q,et[ge*je+3]=255}else(he[ge]&ct)==ct?We[ge]==0?(et[ge*je]=0,et[ge*je+1]=0,et[ge*je+2]=0,et[ge*je+3]=0):((We[ge]&ct)==ct,et[ge*je]=0,et[ge*je+1]=0,et[ge*je+2]=0,et[ge*je+3]=255):(et[ge*je]=0,et[ge*je+1]=0,et[ge*je+2]=0,et[ge*je+3]=255)}else if(qe==1){if(this._sock.rQwait("VMware cursor alpha encoding",ae*De*4,2))return!1;et=new Array(ae*De*je);for(var me=0;me<ae*De;me++){var Ce=this._sock.rQshift32();et[me*4]=Ce>>24&255,et[me*4+1]=Ce>>16&255,et[me*4+2]=Ce>>8&255,et[me*4+3]=Ce&255}}else return L.Warn("The given cursor type is not supported: "+qe+" given."),!1;return this._updateCursor(et,re,ve,ae,De),!0}},{key:"_handleCursor",value:function(){var re=this._FBU.x,ve=this._FBU.y,ae=this._FBU.width,De=this._FBU.height,qe=ae*De*4,et=Math.ceil(ae/8)*De,je=qe+et;if(this._sock.rQwait("cursor encoding",je))return!1;for(var ct=this._sock.rQshiftBytes(qe),he=this._sock.rQshiftBytes(et),Te=new Uint8Array(ae*De*4),We=0,xe=0;xe<De;xe++)for(var ge=0;ge<ae;ge++){var ye=xe*Math.ceil(ae/8)+Math.floor(ge/8),J=he[ye]<<ge%8&128?255:0;Te[We]=ct[We+2],Te[We+1]=ct[We+1],Te[We+2]=ct[We],Te[We+3]=J,We+=4}return this._updateCursor(Te,re,ve,ae,De),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var re=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",re,4))return!1;var ve=this._sock.rQshiftStr(re);return ve=(0,I.decodeUTF8)(ve,!0),this._setDesktopName(ve),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var re=this._sock.rQpeek8(),ve=4+re*16;if(this._sock.rQwait("ExtendedDesktopSize",ve))return!1;var ae=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,ae&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var De=0;De<re;De+=1)De===0?(this._screenID=this._sock.rQshiftBytes(4),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._screenFlags=this._sock.rQshiftBytes(4)):this._sock.rQskipBytes(16);if(this._FBU.x===1&&this._FBU.y!==0){var qe="";switch(this._FBU.y){case 1:qe="Resize is administratively prohibited";break;case 2:qe="Out of resources";break;case 3:qe="Invalid screen layout";break;default:qe="Unknown reason";break}L.Warn("Server did not accept the resize request: "+qe)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var re=this._decoders[this._FBU.encoding];if(!re)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return re.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(ve){return this._fail("Error decoding rect: "+ve),!1}}},{key:"_updateContinuousUpdates",value:function(){if(!this._enabledContinuousUpdates)return;Pe.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(re,ve){this._fbWidth=re,this._fbHeight=ve,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(re,ve){if(this._rfbXvpVer<re)return;L.Info("Sending XVP operation "+ve+" (version "+re+")"),Pe.messages.xvpOp(this._sock,re,ve)}},{key:"_updateCursor",value:function(re,ve,ae,De,qe){this._cursorImage={rgbaPixels:re,hotx:ve,hoty:ae,w:De,h:qe},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var re=3;re<this._cursorImage.rgbaPixels.length;re+=4)if(this._cursorImage.rgbaPixels[re])return!1;return!0}},{key:"_refreshCursor",value:function(){if(this._rfbConnectionState!=="connecting"&&this._rfbConnectionState!=="connected")return;var re=this._shouldShowDotCursor()?Pe.cursors.dot:this._cursorImage;this._cursor.change(re.rgbaPixels,re.hotx,re.hoty,re.w,re.h)}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(re){this._viewOnly=re,(this._rfbConnectionState==="connecting"||this._rfbConnectionState==="connected")&&(re?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(re){L.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(re){this._clipViewport=re,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(re){this._scaleViewport=re,re&&this._clipViewport&&this._updateClip(),this._updateScale(),!re&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(re){this._resizeSession=re,re&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(re){this._showDotCursor=re,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(re){this._screen.style.background=re}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(re){if(!Number.isInteger(re)||re<0||re>9){L.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===re)return;this._qualityLevel=re,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(re){if(!Number.isInteger(re)||re<0||re>9){L.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===re)return;this._compressionLevel=re,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function(re,ve){var ae=re.split("").map(function(De){return De.charCodeAt(0)});return new t.default(ae).encrypt(ve)}}]),Pe}(E.default);fe.default=$e,$e.messages={keyEvent:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen;re[ve]=4,re[ve+1]=ke,re[ve+2]=0,re[ve+3]=0,re[ve+4]=Pe>>24,re[ve+5]=Pe>>16,re[ve+6]=Pe>>8,re[ve+7]=Pe,Ue._sQlen+=8,Ue.flush()},QEMUExtendedKeyEvent:function(Ue,Pe,ke,re){function ve(et){var je=re>>8,ct=re&255;return je===224&&ct<127?ct|128:et}var ae=Ue._sQ,De=Ue._sQlen;ae[De]=255,ae[De+1]=0,ae[De+2]=ke>>8,ae[De+3]=ke,ae[De+4]=Pe>>24,ae[De+5]=Pe>>16,ae[De+6]=Pe>>8,ae[De+7]=Pe;var qe=ve(re);ae[De+8]=qe>>24,ae[De+9]=qe>>16,ae[De+10]=qe>>8,ae[De+11]=qe,Ue._sQlen+=12,Ue.flush()},pointerEvent:function(Ue,Pe,ke,re){var ve=Ue._sQ,ae=Ue._sQlen;ve[ae]=5,ve[ae+1]=re,ve[ae+2]=Pe>>8,ve[ae+3]=Pe,ve[ae+4]=ke>>8,ve[ae+5]=ke,Ue._sQlen+=6,Ue.flush()},_buildExtendedClipboardFlags:function(Ue,Pe){for(var ke=new Uint8Array(4),re=0,ve=0,ae=0;ae<Ue.length;ae++)ve|=Ue[ae];for(var De=0;De<Pe.length;De++)re|=Pe[De];return ke[0]=ve>>24,ke[1]=0,ke[2]=0,ke[3]=re,ke},extendedClipboardProvide:function(Ue,Pe,ke){for(var re=new h.default,ve=[],ae=0;ae<Pe.length;ae++){if(Pe[ae]!=Ae)throw new Error("Unsupported extended clipboard format for Provide message.");ke[ae]=ke[ae].replace(/\r\n|\r|\n/gm,`\r
`);var De=(0,I.encodeUTF8)(ke[ae]+"\0");ve.push(De.length>>24&255,De.length>>16&255,De.length>>8&255,De.length&255);for(var qe=0;qe<De.length;qe++)ve.push(De.charCodeAt(qe))}var et=re.deflate(new Uint8Array(ve)),je=new Uint8Array(4+et.length);je.set($e.messages._buildExtendedClipboardFlags([Je],Pe)),je.set(et,4),$e.messages.clientCutText(Ue,je,!0)},extendedClipboardNotify:function(Ue,Pe){var ke=$e.messages._buildExtendedClipboardFlags([Ze],Pe);$e.messages.clientCutText(Ue,ke,!0)},extendedClipboardRequest:function(Ue,Pe){var ke=$e.messages._buildExtendedClipboardFlags([Ye],Pe);$e.messages.clientCutText(Ue,ke,!0)},extendedClipboardCaps:function(Ue,Pe,ke){var re=Object.keys(ke),ve=new Uint8Array(4+4*re.length);re.map(function(qe){return parseInt(qe)}),re.sort(function(qe,et){return qe-et}),ve.set($e.messages._buildExtendedClipboardFlags(Pe,[]));for(var ae=4,De=0;De<re.length;De++)ve[ae]=ke[re[De]]>>24,ve[ae+1]=ke[re[De]]>>16,ve[ae+2]=ke[re[De]]>>8,ve[ae+3]=ke[re[De]]>>0,ae+=4,ve[3]|=1<<re[De];$e.messages.clientCutText(Ue,ve,!0)},clientCutText:function(Ue,Pe){var ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=Ue._sQ,ve=Ue._sQlen;re[ve]=6,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0;var ae;ke?ae=(0,V.toUnsigned32bit)(-Pe.length):ae=Pe.length,re[ve+4]=ae>>24,re[ve+5]=ae>>16,re[ve+6]=ae>>8,re[ve+7]=ae,Ue._sQlen+=8;for(var De=0,qe=Pe.length;qe>0;){for(var et=Math.min(qe,Ue._sQbufferSize-Ue._sQlen),je=0;je<et;je++)re[Ue._sQlen+je]=Pe[De+je];Ue._sQlen+=et,Ue.flush(),qe-=et,De+=et}},setDesktopSize:function(Ue,Pe,ke,re,ve){var ae=Ue._sQ,De=Ue._sQlen;ae[De]=251,ae[De+1]=0,ae[De+2]=Pe>>8,ae[De+3]=Pe,ae[De+4]=ke>>8,ae[De+5]=ke,ae[De+6]=1,ae[De+7]=0,ae[De+8]=re>>24,ae[De+9]=re>>16,ae[De+10]=re>>8,ae[De+11]=re,ae[De+12]=0,ae[De+13]=0,ae[De+14]=0,ae[De+15]=0,ae[De+16]=Pe>>8,ae[De+17]=Pe,ae[De+18]=ke>>8,ae[De+19]=ke,ae[De+20]=ve>>24,ae[De+21]=ve>>16,ae[De+22]=ve>>8,ae[De+23]=ve,Ue._sQlen+=24,Ue.flush()},clientFence:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen;re[ve]=248,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0,re[ve+4]=Pe>>24,re[ve+5]=Pe>>16,re[ve+6]=Pe>>8,re[ve+7]=Pe;var ae=ke.length;re[ve+8]=ae;for(var De=0;De<ae;De++)re[ve+9+De]=ke.charCodeAt(De);Ue._sQlen+=9+ae,Ue.flush()},enableContinuousUpdates:function(Ue,Pe,ke,re,ve,ae){var De=Ue._sQ,qe=Ue._sQlen;De[qe]=150,De[qe+1]=Pe,De[qe+2]=ke>>8,De[qe+3]=ke,De[qe+4]=re>>8,De[qe+5]=re,De[qe+6]=ve>>8,De[qe+7]=ve,De[qe+8]=ae>>8,De[qe+9]=ae,Ue._sQlen+=10,Ue.flush()},pixelFormat:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen,ae;Pe>16?ae=32:Pe>8?ae=16:ae=8;var De=Math.floor(Pe/3);re[ve]=0,re[ve+1]=0,re[ve+2]=0,re[ve+3]=0,re[ve+4]=ae,re[ve+5]=Pe,re[ve+6]=0,re[ve+7]=ke?1:0,re[ve+8]=0,re[ve+9]=(1<<De)-1,re[ve+10]=0,re[ve+11]=(1<<De)-1,re[ve+12]=0,re[ve+13]=(1<<De)-1,re[ve+14]=De*2,re[ve+15]=De*1,re[ve+16]=De*0,re[ve+17]=0,re[ve+18]=0,re[ve+19]=0,Ue._sQlen+=20,Ue.flush()},clientEncodings:function(Ue,Pe){var ke=Ue._sQ,re=Ue._sQlen;ke[re]=2,ke[re+1]=0,ke[re+2]=Pe.length>>8,ke[re+3]=Pe.length;for(var ve=re+4,ae=0;ae<Pe.length;ae++){var De=Pe[ae];ke[ve]=De>>24,ke[ve+1]=De>>16,ke[ve+2]=De>>8,ke[ve+3]=De,ve+=4}Ue._sQlen+=ve-re,Ue.flush()},fbUpdateRequest:function(Ue,Pe,ke,re,ve,ae){var De=Ue._sQ,qe=Ue._sQlen;typeof ke=="undefined"&&(ke=0),typeof re=="undefined"&&(re=0),De[qe]=3,De[qe+1]=Pe?1:0,De[qe+2]=ke>>8&255,De[qe+3]=ke&255,De[qe+4]=re>>8&255,De[qe+5]=re&255,De[qe+6]=ve>>8&255,De[qe+7]=ve&255,De[qe+8]=ae>>8&255,De[qe+9]=ae&255,Ue._sQlen+=10,Ue.flush()},xvpOp:function(Ue,Pe,ke){var re=Ue._sQ,ve=Ue._sQlen;re[ve]=250,re[ve+1]=0,re[ve+2]=Pe,re[ve+3]=ke,Ue._sQlen+=4,Ue.flush()}},$e.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}},"1eCo":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";var L={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},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};V.defineMode("xml",function(k,M){var f=k.indentUnit,E={},x=M.htmlMode?L:I;for(var g in x)E[g]=x[g];for(var g in M)E[g]=M[g];var h,o;function u(p,D){function O(K){return D.tokenize=K,K(p,D)}var P=p.next();if(P=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?O(t("atom","]]>")):null:p.match("--")?O(t("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),O(i(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),D.tokenize=t("meta","?>"),"meta"):(h=p.eat("/")?"closeTag":"openTag",D.tokenize=r,"tag bracket");if(P=="&"){var j;return p.eat("#")?p.eat("x")?j=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):j=p.eatWhile(/[\d]/)&&p.eat(";"):j=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),j?"atom":"error"}else return p.eatWhile(/[^&<]/),null}u.isInText=!0;function r(p,D){var O=p.next();if(O==">"||O=="/"&&p.eat(">"))return D.tokenize=u,h=O==">"?"endTag":"selfcloseTag","tag bracket";if(O=="=")return h="equals",null;if(O=="<"){D.tokenize=u,D.state=d,D.tagName=D.tagStart=null;var P=D.tokenize(p,D);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(O)?(D.tokenize=n(O),D.stringStartCol=p.column(),D.tokenize(p,D)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function n(p){var D=function(O,P){for(;!O.eol();)if(O.next()==p){P.tokenize=r;break}return"string"};return D.isInAttribute=!0,D}function t(p,D){return function(O,P){for(;!O.eol();){if(O.match(D)){P.tokenize=u;break}O.next()}return p}}function i(p){return function(D,O){for(var P;(P=D.next())!=null;){if(P=="<")return O.tokenize=i(p+1),O.tokenize(D,O);if(P==">")if(p==1){O.tokenize=u;break}else return O.tokenize=i(p-1),O.tokenize(D,O)}return"meta"}}function s(p,D,O){this.prev=p.context,this.tagName=D,this.indent=p.indented,this.startOfLine=O,(E.doNotIndent.hasOwnProperty(D)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function l(p){p.context&&(p.context=p.context.prev)}function c(p,D){for(var O;;){if(!p.context)return;if(O=p.context.tagName,!E.contextGrabbers.hasOwnProperty(O)||!E.contextGrabbers[O].hasOwnProperty(D))return;l(p)}}function d(p,D,O){return p=="openTag"?(O.tagStart=D.column(),w):p=="closeTag"?m:d}function w(p,D,O){return p=="word"?(O.tagName=D.current(),o="tag",v):E.allowMissingTagName&&p=="endTag"?(o="tag bracket",v(p,D,O)):(o="error",w)}function m(p,D,O){if(p=="word"){var P=D.current();return O.context&&O.context.tagName!=P&&E.implicitlyClosed.hasOwnProperty(O.context.tagName)&&l(O),O.context&&O.context.tagName==P||E.matchClosing===!1?(o="tag",S):(o="tag error",C)}else return E.allowMissingTagName&&p=="endTag"?(o="tag bracket",S(p,D,O)):(o="error",C)}function S(p,D,O){return p!="endTag"?(o="error",S):(l(O),d)}function C(p,D,O){return o="error",S(p,D,O)}function v(p,D,O){if(p=="word")return o="attribute",y;if(p=="endTag"||p=="selfcloseTag"){var P=O.tagName,j=O.tagStart;return O.tagName=O.tagStart=null,p=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(P)?c(O,P):(c(O,P),O.context=new s(O,P,j==O.indented)),d}return o="error",v}function y(p,D,O){return p=="equals"?T:(E.allowMissing||(o="error"),v(p,D,O))}function T(p,D,O){return p=="string"?A:p=="word"&&E.allowUnquoted?(o="string",v):(o="error",v(p,D,O))}function A(p,D,O){return p=="string"?A:v(p,D,O)}return{startState:function(p){var D={tokenize:u,state:d,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(D.baseIndent=p),D},token:function(p,D){if(!D.tagName&&p.sol()&&(D.indented=p.indentation()),p.eatSpace())return null;h=null;var O=D.tokenize(p,D);return(O||h)&&O!="comment"&&(o=null,D.state=D.state(h||O,p,D),o&&(O=o=="error"?O+" error":o)),O},indent:function(p,D,O){var P=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+f;if(P&&P.noIndent)return V.Pass;if(p.tokenize!=r&&p.tokenize!=u)return O?O.match(/^(\s*)/)[0].length:0;if(p.tagName)return E.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+f*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(D))return 0;var j=D&&/^<(\/)?([\w_:\.-]*)/.exec(D);if(j&&j[1])for(;P;)if(P.tagName==j[2]){P=P.prev;break}else if(E.implicitlyClosed.hasOwnProperty(P.tagName))P=P.prev;else break;else if(j)for(;P;){var K=E.contextGrabbers[P.tagName];if(K&&K.hasOwnProperty(j[2]))P=P.prev;else break}for(;P&&P.prev&&!P.startOfLine;)P=P.prev;return P?P.indent+f:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(p){p.state==T&&(p.state=v)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var D=[],O=p.context;O;O=O.prev)O.tagName&&D.push(O.tagName);return D.reverse()}}}),V.defineMIME("text/xml","xml"),V.defineMIME("application/xml","xml"),V.mimeModes.hasOwnProperty("text/html")||V.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=V;function V(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},"34/K":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E<f.length;E++){var x=f[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(M,x.key,x)}}function I(M,f,E){return f&&L(M.prototype,f),E&&L(M,E),M}var k=function(){function M(){V(this,M),this._lines=0}return I(M,[{key:"decodeRect",value:function(E,x,g,h,o,u,r){this._lines===0&&(this._lines=h);var n=r==8?1:4,t=g*n;if(o.rQwait("RAW",t))return!1;var i=x+(h-this._lines),s=Math.min(this._lines,Math.floor(o.rQlen/t)),l=o.rQ,c=o.rQi;if(r==8){for(var d=g*s,w=new Uint8Array(d*4),m=0;m<d;m++)w[m*4+0]=(l[c+m]>>0&3)*255/3,w[m*4+1]=(l[c+m]>>2&3)*255/3,w[m*4+2]=(l[c+m]>>4&3)*255/3,w[m*4+4]=0;l=w,c=0}return u.blitImage(E,i,g,s,l,c),o.rQskipBytes(s*t),this._lines-=s,!(this._lines>0)}}]),M}();fe.default=k},"3690":function(at,fe,oe){"use strict";function V(g){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(o){return typeof o}:V=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},V(g)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return I=function(){return g},g}function k(g){if(g&&g.__esModule)return g;if(g===null||V(g)!=="object"&&typeof g!="function")return{default:g};var h=I();if(h&&h.has(g))return h.get(g);var o={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in g)if(Object.prototype.hasOwnProperty.call(g,r)){var n=u?Object.getOwnPropertyDescriptor(g,r):null;n&&(n.get||n.set)?Object.defineProperty(o,r,n):o[r]=g[r]}return o.default=g,h&&h.set(g,o),o}function M(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function f(g,h){for(var o=0;o<h.length;o++){var u=h[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}function E(g,h,o){return h&&f(g.prototype,h),o&&f(g,o),g}var x=function(){function g(){M(this,g),this._tiles=0,this._lastsubencoding=0}return E(g,[{key:"decodeRect",value:function(o,u,r,n,t,i,s){for(this._tiles===0&&(this._tilesX=Math.ceil(r/16),this._tilesY=Math.ceil(n/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var l=1;if(t.rQwait("HEXTILE",l))return!1;var c=t.rQ,d=t.rQi,w=c[d];if(w>30)throw new Error("Illegal hextile subencoding (subencoding: "+w+")");var m=this._totalTiles-this._tiles,S=m%this._tilesX,C=Math.floor(m/this._tilesX),v=o+S*16,y=u+C*16,T=Math.min(16,o+r-v),A=Math.min(16,u+n-y);if(w&1)l+=T*A*4;else if(w&2&&(l+=4),w&4&&(l+=4),w&8){if(l++,t.rQwait("HEXTILE",l))return!1;var p=c[d+l-1];w&16?l+=p*(4+2):l+=p*2}if(t.rQwait("HEXTILE",l))return!1;if(d++,w===0)this._lastsubencoding&1?L.Debug(" Ignoring blank after RAW"):i.fillRect(v,y,T,A,this._background);else if(w&1)i.blitImage(v,y,T,A,c,d),d+=l-1;else{if(w&2&&(this._background=[c[d],c[d+1],c[d+2],c[d+3]],d+=4),w&4&&(this._foreground=[c[d],c[d+1],c[d+2],c[d+3]],d+=4),i.startTile(v,y,T,A,this._background),w&8){var D=c[d];d++;for(var O=0;O<D;O++){var P=void 0;w&16?(P=[c[d],c[d+1],c[d+2],c[d+3]],d+=4):P=this._foreground;var j=c[d];d++;var K=j>>4,U=j&15,X=c[d];d++;var B=(X>>4)+1,N=(X&15)+1;i.subTile(K,U,B,N,P)}}i.finishTile()}t.rQi=d,this._lastsubencoding=w,this._tiles--}return!0}}]),g}();fe.default=x},"5VLF":function(at,fe,oe){"use strict";var V,L;function I(k,M,f){var E=function(x,g){return k.js_beautify(x,g)};return E.js=k.js_beautify,E.css=M.css_beautify,E.html=f.html_beautify,E.js_beautify=k.js_beautify,E.css_beautify=M.css_beautify,E.html_beautify=f.html_beautify,E}!(V=[oe("6UM0"),oe("TXwP"),oe("psGv")],L=function(k,M,f){return I(k,M,f)}.apply(fe,V),L!==void 0&&(at.exports=L))},"6BzB":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.shrinkBuf=V,fe.arraySet=L,fe.flattenChunks=I,fe.Buf32=fe.Buf16=fe.Buf8=void 0;function V(E,x){return E.length===x?E:E.subarray?E.subarray(0,x):(E.length=x,E)}function L(E,x,g,h,o){if(x.subarray&&E.subarray){E.set(x.subarray(g,g+h),o);return}for(var u=0;u<h;u++)E[o+u]=x[g+u]}function I(E){var x,g,h,o,u,r;for(h=0,x=0,g=E.length;x<g;x++)h+=E[x].length;for(r=new Uint8Array(h),o=0,x=0,g=E.length;x<g;x++)u=E[x],r.set(u,o),o+=u.length;return r}var k=Uint8Array;fe.Buf8=k;var M=Uint16Array;fe.Buf16=M;var f=Int32Array;fe.Buf32=f},"6Qwc":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={8:"Backspace",9:"Tab",10:"NumpadClear",12:"Numpad5",13:"Enter",16:"ShiftLeft",17:"ControlLeft",18:"AltLeft",19:"Pause",20:"CapsLock",21:"Lang1",25:"Lang2",27:"Escape",28:"Convert",29:"NonConvert",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",44:"PrintScreen",45:"Insert",46:"Delete",47:"Help",48:"Digit0",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",91:"MetaLeft",92:"MetaRight",93:"ContextMenu",95:"Sleep",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",108:"NumpadDecimal",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",124:"F13",125:"F14",126:"F15",127:"F16",128:"F17",129:"F18",130:"F19",131:"F20",132:"F21",133:"F22",134:"F23",135:"F24",144:"NumLock",145:"ScrollLock",166:"BrowserBack",167:"BrowserForward",168:"BrowserRefresh",169:"BrowserStop",170:"BrowserSearch",171:"BrowserFavorites",172:"BrowserHome",173:"AudioVolumeMute",174:"AudioVolumeDown",175:"AudioVolumeUp",176:"MediaTrackNext",177:"MediaTrackPrevious",178:"MediaStop",179:"MediaPlayPause",180:"LaunchMail",181:"MediaSelect",182:"LaunchApp1",183:"LaunchApp2",225:"AltRight"};fe.default=V},"6UM0":function(at,fe,oe){var V,L;(function(){var I;(function(){"use strict";var M=[function(g,h,o){var u=o(1).Beautifier,r=o(5).Options;function n(t,i){var s=new u(t,i);return s.beautify()}g.exports=n,g.exports.defaultOptions=function(){return new r}},function(g,h,o){var u=o(2).Output,r=o(3).Token,n=o(4),t=o(5).Options,i=o(7).Tokenizer,s=o(7).line_starters,l=o(7).positionable_operators,c=o(7).TOKEN;function d(N,z){return z.indexOf(N)!==-1}function w(N){return N.replace(/^\s+/g,"")}function m(N){for(var z={},te=0;te<N.length;te++)z[N[te].replace(/-/g,"_")]=N[te];return z}function S(N,z){return N&&N.type===c.RESERVED&&N.text===z}function C(N,z){return N&&N.type===c.RESERVED&&d(N.text,z)}var v=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],T=m(y),A=[T.before_newline,T.preserve_newline],p={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function D(N,z){if(z.multiline_frame||z.mode===p.ForInitializer||z.mode===p.Conditional)return;N.remove_indent(z.start_line_index)}function O(N){N=N.replace(n.allLineBreaks,`
`);for(var z=[],te=N.indexOf(`
`);te!==-1;)z.push(N.substring(0,te)),N=N.substring(te+1),te=N.indexOf(`
`);return N.length&&z.push(N),z}function P(N){return N===p.ArrayLiteral}function j(N){return d(N,[p.Expression,p.ForInitializer,p.Conditional])}function K(N,z){for(var te=0;te<N.length;te++){var ce=N[te].trim();if(ce.charAt(0)!==z)return!1}return!0}function U(N,z){for(var te=0,ce=N.length,be;te<ce;te++)if(be=N[te],be&&be.indexOf(z)!==0)return!1;return!0}function X(N,z){z=z||{},this._source_text=N||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new t(z)}X.prototype.create_flags=function(N,z){var te=0;N&&(te=N.indentation_level,!this._output.just_added_newline()&&N.line_indent_level>te&&(te=N.line_indent_level));var ce={mode:z,parent:N,last_token:N?N.last_token:new r(c.START_BLOCK,""),last_word:N?N.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:te,alignment:0,line_indent_level:N?N.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return ce},X.prototype._reset=function(N){var z=N.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new u(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p.BlockStatement);var te=new i(N,this._options);return this._tokens=te.tokenize(),N},X.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var N,z=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
`,z&&n.lineBreak.test(z||"")&&(te=z.match(n.lineBreak)[0]));for(var ce=this._tokens.next();ce;)this.handle_token(ce),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ce,ce=this._tokens.next();return N=this._output.get_code(te),N},X.prototype.handle_token=function(N,z){N.type===c.START_EXPR?this.handle_start_expr(N):N.type===c.END_EXPR?this.handle_end_expr(N):N.type===c.START_BLOCK?this.handle_start_block(N):N.type===c.END_BLOCK?this.handle_end_block(N):N.type===c.WORD?this.handle_word(N):N.type===c.RESERVED?this.handle_word(N):N.type===c.SEMICOLON?this.handle_semicolon(N):N.type===c.STRING?this.handle_string(N):N.type===c.EQUALS?this.handle_equals(N):N.type===c.OPERATOR?this.handle_operator(N):N.type===c.COMMA?this.handle_comma(N):N.type===c.BLOCK_COMMENT?this.handle_block_comment(N,z):N.type===c.COMMENT?this.handle_comment(N,z):N.type===c.DOT?this.handle_dot(N):N.type===c.EOF?this.handle_eof(N):N.type===c.UNKNOWN?this.handle_unknown(N,z):this.handle_unknown(N,z)},X.prototype.handle_whitespace_and_comments=function(N,z){var te=N.newlines,ce=this._options.keep_array_indentation&&P(this._flags.mode);if(N.comments_before)for(var be=N.comments_before.next();be;)this.handle_whitespace_and_comments(be,z),this.handle_token(be,z),be=N.comments_before.next();if(ce)for(var Fe=0;Fe<te;Fe+=1)this.print_newline(Fe>0,z);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,z);for(var Oe=1;Oe<te;Oe+=1)this.print_newline(!0,z)}};var B=["async","break","continue","return","throw","yield"];X.prototype.allow_wrap_or_preserved_newline=function(N,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var te=this._options.preserve_newlines&&N.newlines||z,ce=d(this._flags.last_token.text,l)||d(N.text,l);if(ce){var be=d(this._flags.last_token.text,l)&&d(this._options.operator_position,A)||d(N.text,l);te=te&&be}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(C(this._flags.last_token,B))return;this._output.set_wrap_point()}},X.prototype.print_newline=function(N,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==c.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var te=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&S(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(N)&&(this._flags.multiline_frame=!0)},X.prototype.print_token_line_indentation=function(N){this._output.just_added_newline()&&(this._options.keep_array_indentation&&N.newlines&&(N.text==="["||P(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(N.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},X.prototype.print_token=function(N){if(this._output.raw){this._output.add_raw_token(N);return}if(this._options.comma_first&&N.previous&&N.previous.type===c.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(N),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(N),this._output.non_breaking_space=!0,this._output.add_token(N.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},X.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},X.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},X.prototype.set_mode=function(N){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,N),this._flags=this.create_flags(this._previous_flags,N),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},X.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===p.Statement&&D(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},X.prototype.start_of_object_property=function(){return this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"]))},X.prototype.start_of_statement=function(N){var z=!1;return z=z||C(this._flags.last_token,["var","let","const"])&&N.type===c.WORD,z=z||S(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&C(this._flags.last_token,B)&&!N.newlines,z=z||S(this._flags.last_token,"else")&&!(S(N,"if")&&!N.comments_before),z=z||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),z=z||this._flags.last_token.type===c.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(N.text==="--"||N.text==="++")&&this._last_last_text!=="function"&&N.type!==c.WORD&&N.type!==c.RESERVED,z=z||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"])),z?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(N,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N,C(N,["do","for","if","while"])),!0):!1},X.prototype.handle_start_expr=function(N){this.start_of_statement(N)||this.handle_whitespace_and_comments(N);var z=p.Expression;if(N.text==="["){if(this._flags.last_token.type===c.WORD||this._flags.last_token.text===")"){C(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(N),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=p.ArrayLiteral,P(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR,c.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=p.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=p.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&N.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var ce=this._tokens.peek(-4);C(te,["async","function"])||te.text==="*"&&C(ce,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(ce.text==="{"||ce.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(N);(this._flags.last_token.type===c.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===c.START_BLOCK?this.print_newline():(this._flags.last_token.type===c.END_EXPR||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===c.COMMA)&&this.allow_wrap_or_preserved_newline(N,N.newlines),this.print_token(N),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},X.prototype.handle_end_expr=function(N){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(N),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(N,N.text==="]"&&P(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===c.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(N),this.restore_mode(),D(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===p.Conditional&&(this._previous_flags.mode=p.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},X.prototype.handle_start_block=function(N){this.handle_whitespace_and_comments(N);var z=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(p.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p.BlockStatement):te&&(d(te.text,[":",","])&&d(z.type,[c.STRING,c.WORD,c.RESERVED])||d(z.text,["get","set","..."])&&d(te.type,[c.WORD,c.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(te.text,[":",","])?this.set_mode(p.BlockStatement):this.set_mode(p.ObjectLiteral):this._flags.last_token.type===c.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(p.BlockStatement):d(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||C(this._flags.last_token,["return","throw","import","default"])?this.set_mode(p.ObjectLiteral):this.set_mode(p.BlockStatement),this._flags.last_token&&(C(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ce=!z.comments_before&&z.text==="}",be=ce&&this._flags.last_word==="function"&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var Fe=0,Oe=null;this._flags.inline_frame=!0;do if(Fe+=1,Oe=this._tokens.peek(Fe-1),Oe.newlines){this._flags.inline_frame=!1;break}while(Oe.type!==c.EOF&&!(Oe.type===c.END_BLOCK&&Oe.opened===N))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&N.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(be||this._flags.last_token.type===c.EQUALS||C(this._flags.last_token,v)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(P(this._previous_flags.mode)&&(this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.COMMA)&&((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(N),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(this._flags.last_token.type===c.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(N),this.indent(),!ce&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},X.prototype.handle_end_block=function(N){for(this.handle_whitespace_and_comments(N);this._flags.mode===p.Statement;)this.restore_mode();var z=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(P(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(N)},X.prototype.handle_word=function(N){if(N.type===c.RESERVED){if(d(N.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)N.type=c.WORD;else if(N.text==="import"&&d(this._tokens.peek().text,["(","."]))N.type=c.WORD;else if(d(N.text,["as","from"])&&!this._flags.import_block)N.type=c.WORD;else if(this._flags.mode===p.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(N.type=c.WORD)}}if(this.start_of_statement(N)?C(this._flags.last_token,["var","let","const"])&&N.type===c.WORD&&(this._flags.declaration_statement=!0):N.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==c.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==c.EQUALS&&(this._options.preserve_newlines||!C(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(N),this.print_newline()):this.handle_whitespace_and_comments(N),this._flags.do_block&&!this._flags.do_while)if(S(N,"while")){this._output.space_before_token=!0,this.print_token(N),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(N,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===p.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&C(N,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(N),this._flags.in_case=!0;return}if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N)),S(N,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===c.OPERATOR))&&(!this._output.just_added_blankline()&&!N.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?C(this._flags.last_token,["get","set","new","export"])||C(this._flags.last_token,B)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===c.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||P(this._flags.mode))||this.print_newline(),this.print_token(N),this._flags.last_word=N.text;return}var te="NONE";if(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":C(N,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&N.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===p.BlockStatement?te="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&j(this._flags.mode)?te="SPACE":this._flags.last_token.type===c.STRING?te="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&d(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===c.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),C(N,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),C(N,["else","catch","finally"]))if((!(this._flags.last_token.type===c.END_BLOCK&&this._previous_flags.mode===p.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&N.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ce=this._output.current_line;ce.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?C(this._flags.last_token,v)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&C(N,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?(this._flags.last_token.type!==c.START_EXPR||!C(N,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(N,"if")&&S(N.previous,"else")?this._output.space_before_token=!0:this.print_newline()):C(N,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&P(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);N.previous&&(N.previous.type===c.WORD||N.previous.type===c.RESERVED)&&(this._output.space_before_token=!0),this.print_token(N),this._flags.last_word=N.text,N.type===c.RESERVED&&(N.text==="do"?this._flags.do_block=!0:N.text==="if"?this._flags.if_block=!0:N.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(N,"from")&&(this._flags.import_block=!1))},X.prototype.handle_semicolon=function(N){this.start_of_statement(N)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(N);for(var z=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&S(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(N)},X.prototype.handle_string=function(N){N.text.startsWith("`")&&N.newlines===0&&N.whitespace_before===""&&(N.previous.text===")"||this._flags.last_token.type===c.WORD)||(this.start_of_statement(N)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(N),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(N):N.text.startsWith("`")&&this._flags.last_token.type===c.END_EXPR&&(N.previous.text==="]"||N.previous.text===")")&&N.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(N)},X.prototype.handle_equals=function(N){this.start_of_statement(N)||this.handle_whitespace_and_comments(N),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(N),this._output.space_before_token=!0},X.prototype.handle_comma=function(N){this.handle_whitespace_and_comments(N,!0),this.print_token(N),this._output.space_before_token=!0,this._flags.declaration_statement?(j(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(N)):this._flags.mode===p.ObjectLiteral||this._flags.mode===p.Statement&&this._flags.parent.mode===p.ObjectLiteral?(this._flags.mode===p.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(N)},X.prototype.handle_operator=function(N){var z=N.text==="*"&&(C(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),te=d(N.text,["-","+"])&&(d(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||d(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(N)){var ce=!z;this.handle_whitespace_and_comments(N,ce)}if(N.text==="*"&&this._flags.last_token.type===c.DOT){this.print_token(N);return}if(N.text==="::"){this.print_token(N);return}if(this._flags.last_token.type===c.OPERATOR&&d(this._options.operator_position,A)&&this.allow_wrap_or_preserved_newline(N),N.text===":"&&this._flags.in_case){this.print_token(N),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==c.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var be=!0,Fe=!0,Oe=!1;if(N.text===":"?this._flags.ternary_depth===0?be=!1:(this._flags.ternary_depth-=1,Oe=!0):N.text==="?"&&(this._flags.ternary_depth+=1),!te&&!z&&this._options.preserve_newlines&&d(N.text,l)){var Re=N.text===":",Be=Re&&Oe,Ke=Re&&!Oe;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Ke,this.print_token(N),(!Re||Be)&&this.allow_wrap_or_preserved_newline(N),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Re||Be?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(N):this._output.space_before_token=!1,this.print_token(N),this._output.space_before_token=!0;return;case T.preserve_newline:Ke||this.allow_wrap_or_preserved_newline(N),be=!(this._output.just_added_newline()||Ke),this._output.space_before_token=be,this.print_token(N),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(N),be=!1;var Ae=this._tokens.peek();Fe=Ae&&d(Ae.type,[c.WORD,c.RESERVED])}else if(N.text==="...")this.allow_wrap_or_preserved_newline(N),be=this._flags.last_token.type===c.START_BLOCK,Fe=!1;else if(d(N.text,["--","++","!","~"])||te){if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR)&&this.allow_wrap_or_preserved_newline(N),be=!1,Fe=!1,N.newlines&&(N.text==="--"||N.text==="++"||N.text==="~")){var _e=C(this._flags.last_token,v)&&N.newlines;_e&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(_e,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(be=!0),this._flags.last_token.type===c.RESERVED?be=!0:this._flags.last_token.type===c.END_EXPR?be=!(this._flags.last_token.text==="]"&&(N.text==="--"||N.text==="++")):this._flags.last_token.type===c.OPERATOR&&(be=d(N.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(N.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(Fe=!0)),(this._flags.mode===p.BlockStatement&&!this._flags.inline_frame||this._flags.mode===p.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||be,this.print_token(N),this._output.space_before_token=Fe},X.prototype.handle_block_comment=function(N,z){if(this._output.raw){this._output.add_raw_token(N),N.directives&&N.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(N.directives){this.print_newline(!1,z),this.print_token(N),N.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(N.text)&&!N.newlines){this._output.space_before_token=!0,this.print_token(N),this._output.space_before_token=!0;return}else this.print_block_commment(N,z)},X.prototype.print_block_commment=function(N,z){var te=O(N.text),ce,be=!1,Fe=!1,Oe=N.whitespace_before,Re=Oe.length;if(this.print_newline(!1,z),this.print_token_line_indentation(N),this._output.add_token(te[0]),this.print_newline(!1,z),te.length>1){for(te=te.slice(1),be=K(te,"*"),Fe=U(te,Oe),be&&(this._flags.alignment=1),ce=0;ce<te.length;ce++)be?(this.print_token_line_indentation(N),this._output.add_token(w(te[ce]))):Fe&&te[ce]?(this.print_token_line_indentation(N),this._output.add_token(te[ce].substring(Re))):(this._output.current_line.set_indent(-1),this._output.add_token(te[ce])),this.print_newline(!1,z);this._flags.alignment=0}},X.prototype.handle_comment=function(N,z){N.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(N),this.print_newline(!1,z)},X.prototype.handle_dot=function(N){this.start_of_statement(N)||this.handle_whitespace_and_comments(N,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),C(this._flags.last_token,v)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(N,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(N)},X.prototype.handle_unknown=function(N,z){this.print_token(N),N.text[N.text.length-1]===`
`&&this.print_newline(!1,z)},X.prototype.handle_eof=function(N){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(N)},g.exports.Beautifier=X},function(g){function h(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}h.prototype.clone_empty=function(){var r=new h(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},h.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},h.prototype.has_match=function(r){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(r))return!0;return!1},h.prototype.set_indent=function(r,n){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},h.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(r){this.__items.push(r);var n=r.lastIndexOf(`
`);n!==-1?this.__character_count=r.length-n:this.__character_count+=r.length},h.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function o(r,n){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),n=n||"",r.indent_level>0&&(n=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}o.prototype.get_indent_size=function(r,n){var t=this.__base_string_length;return n=n||0,r<0&&(t=0),t+=r*this.__indent_size,t+=n,t},o.prototype.get_indent_string=function(r,n){var t=this.__base_string;return n=n||0,r<0&&(r=0,t=""),n+=r*this.__indent_size,this.__ensure_cache(n),t+=this.__cache[n],t},o.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var r=this.__cache.length,n=0,t="";this.__indent_size&&r>=this.__indent_size&&(n=Math.floor(r/this.__indent_size),r-=n*this.__indent_size,t=new Array(n+1).join(this.__indent_string)),r&&(t+=new Array(r+1).join(" ")),this.__cache.push(t)};function u(r,n){this.__indent_cache=new o(r,n),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(r,n){return this.__indent_cache.get_indent_string(r,n)},u.prototype.get_indent_size=function(r,n){return this.__indent_cache.get_indent_size(r,n)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(r){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
`);return r!==`
`&&(t=t.replace(/[\n]/g,r)),t},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(r,n){return r=r||0,n=n||0,this.next_line.set_indent(r,n),this.__lines.length>1?(this.current_line.set_indent(r,n),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(r){for(var n=0;n<r.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(r){for(var n=this.__lines.length;r<n;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(r,n){for(var t=this.__lines.length-2;t>=0;){var i=this.__lines[t];if(i.is_empty())break;if(i.item(0).indexOf(r)!==0&&i.item(-1)!==n){this.__lines.splice(t+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},g.exports.Output=u},function(g){function h(o,u,r,n){this.type=o,this.text=u,this.comments_before=null,this.newlines=r||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=h},function(g,h){var o="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",n="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",t="(?:\\\\u[0-9a-fA-F]{4}|["+o+r+"])",i="(?:\\\\u[0-9a-fA-F]{4}|["+u+r+n+"])*";h.identifier=new RegExp(t+i,"g"),h.identifierStart=new RegExp(t),h.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+u+r+n+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;h.newline=/[\n\r\u2028\u2029]/,h.lineBreak=new RegExp(`\r
|`+h.newline.source),h.allLineBreaks=new RegExp(h.lineBreak.source,"g")},function(g,h,o){var u=o(6).Options,r=["before-newline","after-newline","preserve-newline"];function n(t){u.call(this,t,"js");var i=this.raw_options.brace_style||null;i==="expand-strict"?this.raw_options.brace_style="expand":i==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var l=0;l<s.length;l++)s[l]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[l];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",r),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}n.prototype=new u,g.exports.Options=n},function(g){function h(r,n){this.raw_options=o(r,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(r,n){var t=this.raw_options[r],i=n||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(i=t.concat()):typeof t=="string"&&(i=t.split(/[^a-zA-Z0-9_\/\-]+/)),i},h.prototype._get_boolean=function(r,n){var t=this.raw_options[r],i=t===void 0?!!n:!!t;return i},h.prototype._get_characters=function(r,n){var t=this.raw_options[r],i=n||"";return typeof t=="string"&&(i=t.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),i},h.prototype._get_number=function(r,n){var t=this.raw_options[r];n=parseInt(n,10),isNaN(n)&&(n=0);var i=parseInt(t,10);return isNaN(i)&&(i=n),i},h.prototype._get_selection=function(r,n,t){var i=this._get_selection_list(r,n,t);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[r]+"'");return i[0]},h.prototype._get_selection_list=function(r,n,t){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[n[0]],!this._is_valid_selection(t,n))throw new Error("Invalid Default Value!");var i=this._get_array(r,t);if(!this._is_valid_selection(i,n))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[r]+"'");return i},h.prototype._is_valid_selection=function(r,n){return r.length&&n.length&&!r.some(function(t){return n.indexOf(t)===-1})};function o(r,n){var t={};r=u(r);var i;for(i in r)i!==n&&(t[i]=r[i]);if(n&&r[n])for(i in r[n])t[i]=r[n][i];return t}function u(r){var n={},t;for(t in r){var i=t.replace(/-/g,"_");n[i]=r[t]}return n}g.exports.Options=h,g.exports.normalizeOpts=u,g.exports.mergeOpts=o},function(g,h,o){var u=o(8).InputScanner,r=o(9).Tokenizer,n=o(9).TOKEN,t=o(13).Directives,i=o(4),s=o(12).Pattern,l=o(14).TemplatablePattern;function c(K,U){return U.indexOf(K)!==-1}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},w=new t(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,C=/[^\d\.]/,v=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var T=new RegExp(y),A="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=A.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),D=new RegExp("^(?:"+p.join("|")+")$"),O,P=function(K,U){r.call(this,K,U),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var X=new s(this._input),B=new l(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(i.identifier).matching(i.identifierMatch),number:X.matching(m),punct:X.matching(T),comment:X.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:X.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:X.matching(/<!--/),html_comment_end:X.matching(/-->/),include:X.starting_with(/#include/).until_after(i.lineBreak),shebang:X.starting_with(/#!/).until_after(i.lineBreak),xml:X.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};P.prototype=new r,P.prototype._is_comment=function(K){return K.type===d.COMMENT||K.type===d.BLOCK_COMMENT||K.type===d.UNKNOWN},P.prototype._is_opening=function(K){return K.type===d.START_BLOCK||K.type===d.START_EXPR},P.prototype._is_closing=function(K,U){return(K.type===d.END_BLOCK||K.type===d.END_EXPR)&&U&&(K.text==="]"&&U.text==="["||K.text===")"&&U.text==="("||K.text==="}"&&U.text==="{")},P.prototype._reset=function(){O=!1},P.prototype._get_next_token=function(K,U){var X=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(d.EOF,""):(X=X||this._read_non_javascript(B),X=X||this._read_string(B),X=X||this._read_word(K),X=X||this._read_singles(B),X=X||this._read_comment(B),X=X||this._read_regexp(B,K),X=X||this._read_xml(B,K),X=X||this._read_punctuation(),X=X||this._create_token(d.UNKNOWN,this._input.next()),X)},P.prototype._read_word=function(K){var U;if(U=this.__patterns.identifier.read(),U!=="")return U=U.replace(i.allLineBreaks,`
`),!(K.type===d.DOT||K.type===d.RESERVED&&(K.text==="set"||K.text==="get"))&&D.test(U)?(U==="in"||U==="of")&&(K.type===d.WORD||K.type===d.STRING)?this._create_token(d.OPERATOR,U):this._create_token(d.RESERVED,U):this._create_token(d.WORD,U);if(U=this.__patterns.number.read(),U!=="")return this._create_token(d.WORD,U)},P.prototype._read_singles=function(K){var U=null;return K==="("||K==="["?U=this._create_token(d.START_EXPR,K):K===")"||K==="]"?U=this._create_token(d.END_EXPR,K):K==="{"?U=this._create_token(d.START_BLOCK,K):K==="}"?U=this._create_token(d.END_BLOCK,K):K===";"?U=this._create_token(d.SEMICOLON,K):K==="."&&C.test(this._input.peek(1))?U=this._create_token(d.DOT,K):K===","&&(U=this._create_token(d.COMMA,K)),U&&this._input.next(),U},P.prototype._read_punctuation=function(){var K=this.__patterns.punct.read();if(K!=="")return K==="="?this._create_token(d.EQUALS,K):K==="?."?this._create_token(d.DOT,K):this._create_token(d.OPERATOR,K)},P.prototype._read_non_javascript=function(K){var U="";if(K==="#"){if(this._is_first_token()&&(U=this.__patterns.shebang.read(),U))return this._create_token(d.UNKNOWN,U.trim()+`
`);if(U=this.__patterns.include.read(),U)return this._create_token(d.UNKNOWN,U.trim()+`
`);K=this._input.next();var X="#";if(this._input.hasNext()&&this._input.testChar(S)){do K=this._input.next(),X+=K;while(this._input.hasNext()&&K!=="#"&&K!=="=");return K==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(X+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(X+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,X)}this._input.back()}else if(K==="<"&&this._is_first_token()){if(U=this.__patterns.html_comment_start.read(),U){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)U+=this._input.next();return O=!0,this._create_token(d.COMMENT,U)}}else if(O&&K==="-"&&(U=this.__patterns.html_comment_end.read(),U))return O=!1,this._create_token(d.COMMENT,U);return null},P.prototype._read_comment=function(K){var U=null;if(K==="/"){var X="";if(this._input.peek(1)==="*"){X=this.__patterns.block_comment.read();var B=w.get_directives(X);B&&B.ignore==="start"&&(X+=w.readIgnored(this._input)),X=X.replace(i.allLineBreaks,`
`),U=this._create_token(d.BLOCK_COMMENT,X),U.directives=B}else this._input.peek(1)==="/"&&(X=this.__patterns.comment.read(),U=this._create_token(d.COMMENT,X))}return U},P.prototype._read_string=function(K){if(K==="`"||K==="'"||K==='"'){var U=this._input.next();return this.has_char_escapes=!1,K==="`"?U+=this._read_string_recursive("`",!0,"${"):U+=this._read_string_recursive(K),this.has_char_escapes&&this._options.unescape_strings&&(U=j(U)),this._input.peek()===K&&(U+=this._input.next()),U=U.replace(i.allLineBreaks,`
`),this._create_token(d.STRING,U)}return null},P.prototype._allow_regexp_or_xml=function(K){return K.type===d.RESERVED&&c(K.text,["return","case","throw","else","do","typeof","yield"])||K.type===d.END_EXPR&&K.text===")"&&K.opened.previous.type===d.RESERVED&&c(K.opened.previous.text,["if","while","for"])||c(K.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},P.prototype._read_regexp=function(K,U){if(K==="/"&&this._allow_regexp_or_xml(U)){for(var X=this._input.next(),B=!1,N=!1;this._input.hasNext()&&(B||N||this._input.peek()!==K)&&!this._input.testChar(i.newline);)X+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?N=!0:this._input.peek()==="]"&&(N=!1)),this._input.next();return this._input.peek()===K&&(X+=this._input.next(),X+=this._input.read(i.identifier)),this._create_token(d.STRING,X)}return null},P.prototype._read_xml=function(K,U){if(this._options.e4x&&K==="<"&&this._allow_regexp_or_xml(U)){var X="",B=this.__patterns.xml.read_match();if(B){for(var N=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=N.indexOf("{")===0,te=0;B;){var ce=!!B[1],be=B[2],Fe=!!B[B.length-1]||be.slice(0,8)==="![CDATA[";if(!Fe&&(be===N||z&&be.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ce?--te:++te),X+=B[0],te<=0)break;B=this.__patterns.xml.read_match()}return B||(X+=this._input.match(/[\s\S]*/g)[0]),X=X.replace(i.allLineBreaks,`
`),this._create_token(d.STRING,X)}}return null};function j(K){for(var U="",X=0,B=new u(K),N=null;B.hasNext();)if(N=B.match(/([\s]|[^\\]|\\\\)+/g),N&&(U+=N[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")N=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")N=B.match(/u([0-9A-Fa-f]{4})/g);else{U+="\\",B.hasNext()&&(U+=B.next());continue}if(!N)return K;if(X=parseInt(N[1],16),X>126&&X<=255&&N[0].indexOf("x")===0)return K;if(X>=0&&X<32){U+="\\"+N[0];continue}else X===34||X===39||X===92?U+="\\"+String.fromCharCode(X):U+=String.fromCharCode(X)}return U}P.prototype._read_string_recursive=function(K,U,X){var B,N;K==="'"?N=this.__patterns.single_quote:K==='"'?N=this.__patterns.double_quote:K==="`"?N=this.__patterns.template_text:K==="}"&&(N=this.__patterns.template_expression);for(var z=N.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===K||!U&&i.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
`&&this._input.next(),te+=this._input.next()):X&&(X==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),X===te&&(K==="`"?te+=this._read_string_recursive("}",U,"`"):te+=this._read_string_recursive("`",U,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=N.read(),z+=te}return z},g.exports.Tokenizer=P,g.exports.TOKEN=d,g.exports.positionable_operators=v.slice(),g.exports.line_starters=A.slice()},function(g){var h=RegExp.prototype.hasOwnProperty("sticky");function o(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},o.prototype.peek=function(u){var r=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(r=this.__input.charAt(u)),r},o.prototype.__match=function(u,r){u.lastIndex=r;var n=u.exec(this.__input);return n&&!(h&&u.sticky)&&(n.index!==r&&(n=null)),n},o.prototype.test=function(u,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(u,r):!1},o.prototype.testChar=function(u,r){var n=this.peek(r);return u.lastIndex=0,n!==null&&u.test(n)},o.prototype.match=function(u){var r=this.__match(u,this.__position);return r?this.__position+=r[0].length:r=null,r},o.prototype.read=function(u,r,n){var t="",i;return u&&(i=this.match(u),i&&(t+=i[0])),r&&(i||!u)&&(t+=this.readUntil(r,n)),t},o.prototype.readUntil=function(u,r){var n="",t=this.__position;u.lastIndex=this.__position;var i=u.exec(this.__input);return i?(t=i.index,r&&(t+=i[0].length)):t=this.__input_length,n=this.__input.substring(this.__position,t),this.__position=t,n},o.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},o.prototype.get_regexp=function(u,r){var n=null,t="g";return r&&h&&(t="y"),typeof u=="string"&&u!==""?n=new RegExp(u,t):u&&(n=new RegExp(u.source,t)),n},o.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(u){var r=this.__position,n=this.readUntilAfter(u);return this.__position=r,n},o.prototype.lookBack=function(u){var r=this.__position-1;return r>=u.length&&this.__input.substring(r-u.length,r).toLowerCase()===u},g.exports.InputScanner=o},function(g,h,o){var u=o(8).InputScanner,r=o(3).Token,n=o(10).TokenStream,t=o(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(l,c){this._input=new u(l),this._options=c||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var l,c=new r(i.START,""),d=null,w=[],m=new n;c.type!==i.EOF;){for(l=this._get_next_token(c,d);this._is_comment(l);)m.add(l),l=this._get_next_token(c,d);m.isEmpty()||(l.comments_before=m,m=new n),l.parent=d,this._is_opening(l)?(w.push(d),d=l):d&&this._is_closing(l,d)&&(l.opened=d,d.closed=l,d=w.pop(),l.parent=d),l.previous=c,c.next=l,this.__tokens.add(l),c=l}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(l,c){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(i.RAW,d):this._create_token(i.EOF,"")},s.prototype._is_comment=function(l){return!1},s.prototype._is_opening=function(l){return!1},s.prototype._is_closing=function(l,c){return!1},s.prototype._create_token=function(l,c){var d=new r(l,c,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=s,g.exports.TOKEN=i},function(g){function h(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},h.prototype.peek=function(o){var u=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(u=this.__tokens[o]),u},h.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},g.exports.TokenStream=h},function(g,h,o){var u=o(12).Pattern;function r(n,t){u.call(this,n,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new u,r.prototype.__set_whitespace_patterns=function(n,t){n+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+n+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var n=this._input.read(this._match_pattern);if(n===" ")this.whitespace_before_token=" ";else if(n){var t=this.__split(this._newline_regexp,n);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return n},r.prototype.matching=function(n,t){var i=this._create();return i.__set_whitespace_patterns(n,t),i._update(),i},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(n,t){n.lastIndex=0;for(var i=0,s=[],l=n.exec(t);l;)s.push(t.substring(i,l.index)),i=l.index+l[0].length,l=n.exec(t);return i<t.length?s.push(t.substring(i,t.length)):s.push(""),s},g.exports.WhitespacePattern=r},function(g){function h(o,u){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}h.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(o){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(o),u._update(),u},h.prototype.until=function(o){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(o),u._update(),u},h.prototype.starting_with=function(o){var u=this._create();return u._starting_pattern=this._input.get_regexp(o,!0),u._update(),u},h.prototype.matching=function(o){var u=this._create();return u._match_pattern=this._input.get_regexp(o,!0),u._update(),u},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},g.exports.Pattern=h},function(g){function h(o,u){o=typeof o=="string"?o:o.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+u,"g")}h.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(o);r;)u[r[1]]=r[2],r=this.__directive_pattern.exec(o);return u},h.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=h},function(g,h,o){var u=o(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function n(t,i){u.call(this,t,i),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),i&&(this.__template_pattern=this._input.get_regexp(i.__template_pattern),this._excluded=Object.assign(this._excluded,i._excluded),this._disabled=Object.assign(this._disabled,i._disabled));var s=new u(t);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}n.prototype=new u,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(t){var i=this._create();return i._disabled[t]=!0,i._update(),i},n.prototype.read_options=function(t){var i=this._create();for(var s in r)i._disabled[s]=t.templating.indexOf(s)===-1;return i._update(),i},n.prototype.exclude=function(t){var i=this._create();return i._excluded[t]=!0,i._update(),i},n.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),t+=i,i=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},n.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},n.prototype._read_template=function(){var t="",i=this._input.peek();if(i==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(t=t||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},g.exports.TemplatablePattern=n}],f={};function E(g){var h=f[g];if(h!==void 0)return h.exports;var o=f[g]={exports:{}};return M[g](o,o.exports,E),o.exports}var x=E(0);I=x})();var k=I;!(V=[],L=function(){return{js_beautify:k}}.apply(fe,V),L!==void 0&&(at.exports=L))})()},"7Cbv":function(at,fe,oe){"use strict";var V=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),L=new Uint8Array(16);function I(){if(!V)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return V(L)}var k=/^(?:[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 M(r){return typeof r=="string"&&k.test(r)}for(var f=M,E=[],x=0;x<256;++x)E.push((x+256).toString(16).substr(1));function g(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(E[r[n+0]]+E[r[n+1]]+E[r[n+2]]+E[r[n+3]]+"-"+E[r[n+4]]+E[r[n+5]]+"-"+E[r[n+6]]+E[r[n+7]]+"-"+E[r[n+8]]+E[r[n+9]]+"-"+E[r[n+10]]+E[r[n+11]]+E[r[n+12]]+E[r[n+13]]+E[r[n+14]]+E[r[n+15]]).toLowerCase();if(!f(t))throw TypeError("Stringified UUID is invalid");return t}var h=g;function o(r,n,t){r=r||{};var i=r.random||(r.rng||I)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,n){t=t||0;for(var s=0;s<16;++s)n[t+s]=i[s];return n}return h(i)}var u=fe.a=o},"7ahc":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return w});var V=oe("k1fw"),L=oe("0Owb"),I=oe("+L6B"),k=oe("2/Rp"),M=oe("y8nQ"),f=oe("Vl3Y"),E=oe("tJVT"),x=oe("OaEy"),g=oe("2fM7"),h=oe("q1tI"),o=oe.n(h),u=oe("VrN/"),r=oe.n(u),n=oe("p77/"),t=oe.n(n),i=oe("c5Ni"),s=oe.n(i),l=g.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};fe.b=function(m){var S=m.callback,C=m.onCancel,v=Object(h.useState)("python"),y=Object(E.a)(v,2),T=y[0],A=y[1];function p(O){A(d[O][1])}function D(O){S(O)}return o.a.createElement(f.a,Object(L.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:D}),o.a.createElement(f.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},o.a.createElement(g.a,{onChange:p},Object.keys(d).map(function(O){return o.a.createElement(l,{key:O,value:O},d[O][0])}))),o.a.createElement(f.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},o.a.createElement(w,{mode:T})),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(k.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(k.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function w(m){var S=m.value,C=m.onChange,v=m.mode,y=m.options,T=y===void 0?{}:y,A=Object(h.useRef)(),p=Object(h.useState)(),D=Object(E.a)(p,2),O=D[0],P=D[1];return Object(h.useEffect)(function(){if(O){function j(K){var U=K.getValue();C&&C(U)}return O.on("change",j),function(){O.off("change",j)}}},[O,C]),Object(h.useEffect)(function(){O&&O.setOption("mode",v)},[O,v]),Object(h.useEffect)(function(){O&&((S!==O.getValue()||S==="")&&setTimeout(function(){O.setValue(S||" ")},300))},[O,S]),Object(h.useEffect)(function(){if(A.current&&!O){var j=r.a.fromTextArea(A.current,Object(V.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));P(j)}},[A.current,O]),o.a.createElement("div",{className:"my-codemirror-container"},o.a.createElement("textarea",{ref:A}))}},"7ixt":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return I});var V={adjustX:1,adjustY:1},L=[0,0],I={left:{points:["cr","cl"],overflow:V,offset:[-4,0],targetOffset:L},right:{points:["cl","cr"],overflow:V,offset:[4,0],targetOffset:L},top:{points:["bc","tc"],overflow:V,offset:[0,-4],targetOffset:L},bottom:{points:["tc","bc"],overflow:V,offset:[0,4],targetOffset:L},topLeft:{points:["bl","tl"],overflow:V,offset:[0,-4],targetOffset:L},leftTop:{points:["tr","tl"],overflow:V,offset:[-4,0],targetOffset:L},topRight:{points:["br","tr"],overflow:V,offset:[0,-4],targetOffset:L},rightTop:{points:["tl","tr"],overflow:V,offset:[4,0],targetOffset:L},bottomRight:{points:["tr","br"],overflow:V,offset:[0,4],targetOffset:L},rightBottom:{points:["bl","br"],overflow:V,offset:[4,0],targetOffset:L},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,4],targetOffset:L},leftBottom:{points:["br","bl"],overflow:V,offset:[-4,0],targetOffset:L}},k=I},"8+yF":function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200},L={lookup:function(k){if(k>=32&&k<=255)return k;var M=V[k];return M!==void 0?M:16777216|k}};fe.default=L},"8CQX":function(at,fe,oe){"use strict";function V(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(i){return typeof i}:V=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},V(n)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.getKeycode=o,fe.getKey=u,fe.getKeysym=r;var L=h(oe("mHUz")),I=h(oe("8+yF")),k=h(oe("6Qwc")),M=h(oe("gIYZ")),f=h(oe("mTgk")),E=g(oe("GdRQ"));function x(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return x=function(){return n},n}function g(n){if(n&&n.__esModule)return n;if(n===null||V(n)!=="object"&&typeof n!="function")return{default:n};var t=x();if(t&&t.has(n))return t.get(n);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l)){var c=s?Object.getOwnPropertyDescriptor(n,l):null;c&&(c.get||c.set)?Object.defineProperty(i,l,c):i[l]=n[l]}return i.default=n,t&&t.set(n,i),i}function h(n){return n&&n.__esModule?n:{default:n}}function o(n){if(n.code){switch(n.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return n.code}if(n.type!=="keypress"&&n.keyCode in k.default){var t=k.default[n.keyCode];if(E.isMac()&&t==="ContextMenu"&&(t="MetaRight"),n.location===2)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(n.location===3)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}function u(n){if(n.key!==void 0){switch(n.key){case"Spacebar":return" ";case"Esc":return"Escape";case"Scroll":return"ScrollLock";case"Win":return"Meta";case"Apps":return"ContextMenu";case"Up":return"ArrowUp";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";case"Down":return"ArrowDown";case"Del":return"Delete";case"Divide":return"/";case"Multiply":return"*";case"Subtract":return"-";case"Add":return"+";case"Decimal":return n.char}switch(n.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(n.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(n.key==="\0"&&n.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return n.key;if(n.key.length!==1&&n.key!=="Unidentified")return n.key}var t=o(n);return t in M.default?M.default[t]:n.charCode?String.fromCharCode(n.charCode):"Unidentified"}function r(n){var t=u(n);if(t==="Unidentified")return null;if(t in f.default){var i=n.location;if(t==="Meta"&&i===0&&(i=2),t==="Clear"&&i===3){var s=o(n);s==="NumLock"&&(i=0)}if((i===void 0||i>3)&&(i=0),t==="Meta"){var l=o(n);if(l==="AltLeft")return L.default.XK_Meta_L;if(l==="AltRight")return L.default.XK_Meta_R}if(t==="Clear"){var c=o(n);if(c==="NumLock")return L.default.XK_Num_Lock}return f.default[t][i]}if(t.length!==1)return null;var d=t.charCodeAt();return d?I.default.lookup(d):null}},"8EBN":function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";V.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 L=0;L<V.modeInfo.length;L++){var I=V.modeInfo[L];I.mimes&&(I.mime=I.mimes[0])}V.findModeByMIME=function(k){k=k.toLowerCase();for(var M=0;M<V.modeInfo.length;M++){var f=V.modeInfo[M];if(f.mime==k)return f;if(f.mimes){for(var E=0;E<f.mimes.length;E++)if(f.mimes[E]==k)return f}}if(/\+xml$/.test(k))return V.findModeByMIME("application/xml");if(/\+json$/.test(k))return V.findModeByMIME("application/json")},V.findModeByExtension=function(k){k=k.toLowerCase();for(var M=0;M<V.modeInfo.length;M++){var f=V.modeInfo[M];if(f.ext){for(var E=0;E<f.ext.length;E++)if(f.ext[E]==k)return f}}},V.findModeByFileName=function(k){for(var M=0;M<V.modeInfo.length;M++){var f=V.modeInfo[M];if(f.file&&f.file.test(k))return f}var E=k.lastIndexOf("."),x=E>-1&&k.substring(E+1,k.length);if(x)return V.findModeByExtension(x)},V.findModeByName=function(k){k=k.toLowerCase();for(var M=0;M<V.modeInfo.length;M++){var f=V.modeInfo[M];if(f.name.toLowerCase()==k)return f;if(f.alias){for(var E=0;E<f.alias.length;E++)if(f.alias[E].toLowerCase()==k)return f}}}})},"8K/p":function(at,fe,oe){"use strict";function V(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(r){return typeof r}:V=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},V(o)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=f(oe("Lo0S")),I=k(oe("ItS6"));function k(o){return o&&o.__esModule?o:{default:o}}function M(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return M=function(){return o},o}function f(o){if(o&&o.__esModule)return o;if(o===null||V(o)!=="object"&&typeof o!="function")return{default:o};var u=M();if(u&&u.has(o))return u.get(o);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var i=n?Object.getOwnPropertyDescriptor(o,t):null;i&&(i.get||i.set)?Object.defineProperty(r,t,i):r[t]=o[t]}return r.default=o,u&&u.set(o,r),r}function E(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}function x(o,u){for(var r=0;r<u.length;r++){var n=u[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}function g(o,u,r){return u&&x(o.prototype,u),r&&x(o,r),o}var h=function(){function o(){E(this,o),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var u=0;u<4;u++)this._zlibs[u]=new I.default}return g(o,[{key:"decodeRect",value:function(r,n,t,i,s,l,c){if(this._ctl===null){if(s.rQwait("TIGHT compression-control",1))return!1;this._ctl=s.rQshift8();for(var d=0;d<4;d++)this._ctl>>d&1&&(this._zlibs[d].reset(),L.Info("Reset zlib stream "+d));this._ctl=this._ctl>>4}var w;if(this._ctl===8)w=this._fillRect(r,n,t,i,s,l,c);else if(this._ctl===9)w=this._jpegRect(r,n,t,i,s,l,c);else if(this._ctl===10)w=this._pngRect(r,n,t,i,s,l,c);else if((this._ctl&128)==0)w=this._basicRect(this._ctl,r,n,t,i,s,l,c);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return w&&(this._ctl=null),w}},{key:"_fillRect",value:function(r,n,t,i,s,l,c){if(s.rQwait("TIGHT",3))return!1;var d=s.rQi,w=s.rQ;return l.fillRect(r,n,t,i,[w[d+2],w[d+1],w[d]],!1),s.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(r,n,t,i,s,l,c){var d=this._readData(s);return d===null?!1:(l.imageRect(r,n,t,i,"image/jpeg",d),!0)}},{key:"_pngRect",value:function(r,n,t,i,s,l,c){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(r,n,t,i,s,l,c,d){if(this._filter===null)if(r&4){if(l.rQwait("TIGHT",1))return!1;this._filter=l.rQshift8()}else this._filter=0;var w=r&3,m;switch(this._filter){case 0:m=this._copyFilter(w,n,t,i,s,l,c,d);break;case 1:m=this._paletteFilter(w,n,t,i,s,l,c,d);break;case 2:m=this._gradientFilter(w,n,t,i,s,l,c,d);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return m&&(this._filter=null),m}},{key:"_copyFilter",value:function(r,n,t,i,s,l,c,d){var w=i*s*3,m;if(w<12){if(l.rQwait("TIGHT",w))return!1;m=l.rQshiftBytes(w)}else{if(m=this._readData(l),m===null)return!1;this._zlibs[r].setInput(m),m=this._zlibs[r].inflate(w),this._zlibs[r].setInput(null)}return c.blitRgbImage(n,t,i,s,m,0,!1),!0}},{key:"_paletteFilter",value:function(r,n,t,i,s,l,c,d){if(this._numColors===0){if(l.rQwait("TIGHT palette",1))return!1;var w=l.rQpeek8()+1,m=w*3;if(l.rQwait("TIGHT palette",1+m))return!1;this._numColors=w,l.rQskipBytes(1),l.rQshiftTo(this._palette,m)}var S=this._numColors<=2?1:8,C=Math.floor((i*S+7)/8),v=C*s,y;if(v<12){if(l.rQwait("TIGHT",v))return!1;y=l.rQshiftBytes(v)}else{if(y=this._readData(l),y===null)return!1;this._zlibs[r].setInput(y),y=this._zlibs[r].inflate(v),this._zlibs[r].setInput(null)}return this._numColors==2?this._monoRect(n,t,i,s,y,this._palette,c):this._paletteRect(n,t,i,s,y,this._palette,c),this._numColors=0,!0}},{key:"_monoRect",value:function(r,n,t,i,s,l,c){for(var d=this._getScratchBuffer(t*i*4),w=Math.floor((t+7)/8),m=Math.floor(t/8),S=0;S<i;S++){var C=void 0,v=void 0,y=void 0;for(y=0;y<m;y++)for(var T=7;T>=0;T--)C=(S*t+y*8+7-T)*4,v=(s[S*w+y]>>T&1)*3,d[C]=l[v],d[C+1]=l[v+1],d[C+2]=l[v+2],d[C+3]=255;for(var A=7;A>=8-t%8;A--)C=(S*t+y*8+7-A)*4,v=(s[S*w+y]>>A&1)*3,d[C]=l[v],d[C+1]=l[v+1],d[C+2]=l[v+2],d[C+3]=255}c.blitRgbxImage(r,n,t,i,d,0,!1)}},{key:"_paletteRect",value:function(r,n,t,i,s,l,c){for(var d=this._getScratchBuffer(t*i*4),w=t*i*4,m=0,S=0;m<w;m+=4,S++){var C=s[S]*3;d[m]=l[C],d[m+1]=l[C+1],d[m+2]=l[C+2],d[m+3]=255}c.blitRgbxImage(r,n,t,i,d,0,!1)}},{key:"_gradientFilter",value:function(r,n,t,i,s,l,c,d){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(r){if(this._len===0){if(r.rQwait("TIGHT",3))return null;var n;n=r.rQshift8(),this._len=n&127,n&128&&(n=r.rQshift8(),this._len|=(n&127)<<7,n&128&&(n=r.rQshift8(),this._len|=n<<14))}if(r.rQwait("TIGHT",this._len))return null;var t=r.rQshiftBytes(this._len);return this._len=0,t}},{key:"_getScratchBuffer",value:function(r){return(!this._scratchBuffer||this._scratchBuffer.length<r)&&(this._scratchBuffer=new Uint8Array(r)),this._scratchBuffer}}]),o}();fe.default=h},"8hTe":function(at,fe,oe){at.exports={button:"button___1wy9m"}},"9Bee":function(at,fe,oe){"use strict";var V=oe("DYRE"),L=oe("zeV3"),I=oe("+L6B"),k=oe("2/Rp"),M=oe("k1fw"),f=oe("9og8"),E=oe("tJVT"),x=oe("WmNS"),g=oe.n(x),h=oe("q1tI"),o=oe.n(h),u=oe("vg9a"),r=oe("DlQD"),n=oe.n(r),t=oe("rUJ1");function i($,F){var H=$.match(/^(\s+)(?:```)/);if(H===null)return F;var Y=H[1];return F.split(`
`).map(function(se){var Z=se.match(/^\s+/);if(Z===null)return se;var Me=Object(E.a)(Z,1),rt=Me[0];return rt.length>=Y.length?se.slice(Y.length):se}).join(`
`)}var s=[],l=["<ul>"],c=new n.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){s.length=0,l=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S($,F,H,Y){if(F>=$.length||$[F].level<=H)return F;var se=$[F];Y.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),F++;var Z=[];return F=S($,F,se.level,Z),Z.length>0&&(Y.push("<ul>"),Z.forEach(function(Me){Y.push(Me)}),Y.push("</ul>")),Y.push("</li>"),F=S($,F,H,Y),F}function C(){return S(s,0,0,l),l.push("</ul>"),l.join("")}var v={heading:function(F){var H=d.exec(F);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(F){var H=this.rules.block.fences.exec(F);if(H){var Y=H[0],se=i(Y,H[3]||""),Z=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf(Z)>=0){var Me=A(),rt=se;se=Me,p[Me]={type:"block",expression:rt}}return{type:"code",raw:Y,lang:Z,text:se}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,A=function(){return"__special_katext_id_".concat(T++,"__")},p={};function D(){return p}function O(){T=0,p={}}function P($){return $=$.replace(y,function(F,H){var Y=A();return p[Y]={type:"inline",expression:H},Y}),$}var j=c.listitem;c.listitem=function($){return j(P($))};var K=c.paragraph;c.paragraph=function($){return K(P($))};var U=c.tablecell;c.tablecell=function($,F){return U(P($),F)},c.code=function($,F,H){var Y=(F||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"<p class='editormd-tex'>".concat($,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(F,'">').concat(H?$:Object(t.escape)($,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(H?$:Object(t.escape)($,!0))+"</code></pre>"},c.heading=function($,F,H){var Y=this.options.headerPrefix+H.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:Y,level:F,text:$}),"<h"+F+' id="'+Y+'">'+$+"</h"+F+">"},n.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),n.a.use({tokenizer:v,renderer:c});var X=n.a,B=oe("SJMd"),N=oe("ulZh"),z=oe.n(N),te=oe("m3rI"),ce=oe("Oy/b"),be=oe("p5ED"),Fe=oe("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Oe=function($,F){return(Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var se in Y)Object.prototype.hasOwnProperty.call(Y,se)&&(H[se]=Y[se])})($,F)};function Re($,F){function H(){this.constructor=$}Oe($,F),$.prototype=F===null?Object.create(F):(H.prototype=F.prototype,new H)}function Be($,F,H,Y){return new(H||(H=Promise))(function(se,Z){function Me(Et){try{pt(Y.next(Et))}catch(ot){Z(ot)}}function rt(Et){try{pt(Y.throw(Et))}catch(ot){Z(ot)}}function pt(Et){var ot;Et.done?se(Et.value):(ot=Et.value,ot instanceof H?ot:new H(function(Rt){Rt(ot)})).then(Me,rt)}pt((Y=Y.apply($,F||[])).next())})}function Ke($,F){var H,Y,se,Z,Me={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:rt(0),throw:rt(1),return:rt(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function rt(pt){return function(Et){return function(ot){if(H)throw new TypeError("Generator is already executing.");for(;Me;)try{if(H=1,Y&&(se=2&ot[0]?Y.return:ot[0]?Y.throw||((se=Y.return)&&se.call(Y),0):Y.next)&&!(se=se.call(Y,ot[1])).done)return se;switch(Y=0,se&&(ot=[2&ot[0],se.value]),ot[0]){case 0:case 1:se=ot;break;case 4:return Me.label++,{value:ot[1],done:!1};case 5:Me.label++,Y=ot[1],ot=[0];continue;case 7:ot=Me.ops.pop(),Me.trys.pop();continue;default:if(!(se=Me.trys,(se=se.length>0&&se[se.length-1])||ot[0]!==6&&ot[0]!==2)){Me=0;continue}if(ot[0]===3&&(!se||ot[1]>se[0]&&ot[1]<se[3])){Me.label=ot[1];break}if(ot[0]===6&&Me.label<se[1]){Me.label=se[1],se=ot;break}if(se&&Me.label<se[2]){Me.label=se[2],Me.ops.push(ot);break}se[2]&&Me.ops.pop(),Me.trys.pop();continue}ot=F.call($,Me)}catch(Rt){ot=[6,Rt],Y=0}finally{H=se=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([pt,Et])}}}function Ae(){for(var $=0,F=0,H=arguments.length;F<H;F++)$+=arguments[F].length;var Y=Array($),se=0;for(F=0;F<H;F++)for(var Z=arguments[F],Me=0,rt=Z.length;Me<rt;Me++,se++)Y[se]=Z[Me];return Y}var _e=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(F,H){for(var Y=0,se=H;Y<se.length;Y++){var Z=se[Y],Me=Z[0],rt=Z[1];F.setAttribute(Me,rt)}},$.createRect=function(F,H,Y){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",F.toString()),se.setAttribute("height",H.toString()),Y&&$.setAttributes(se,Y),se},$.createLine=function(F,H,Y,se,Z){var Me=document.createElementNS("http://www.w3.org/2000/svg","line");return Me.setAttribute("x1",F.toString()),Me.setAttribute("y1",H.toString()),Me.setAttribute("x2",Y.toString()),Me.setAttribute("y2",se.toString()),Z&&$.setAttributes(Me,Z),Me},$.createPolygon=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",F),H&&$.setAttributes(Y,H),Y},$.createCircle=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(F/2).toString()),Y.setAttribute("cy",(F/2).toString()),Y.setAttribute("r",F.toString()),H&&$.setAttributes(Y,H),Y},$.createEllipse=function(F,H,Y){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(F/2).toString()),se.setAttribute("cy",(H/2).toString()),se.setAttribute("rx",(F/2).toString()),se.setAttribute("ry",(H/2).toString()),Y&&$.setAttributes(se,Y),se},$.createGroup=function(F){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return F&&$.setAttributes(H,F),H},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(F,H,Y,se,Z,Me,rt){var pt=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(pt,[["id",F],["orient",H],["markerWidth",Y.toString()],["markerHeight",se.toString()],["refX",Z.toString()],["refY",Me.toString()]]),pt.appendChild(rt),pt},$.createText=function(F){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),F&&$.setAttributes(H,F),H},$.createTSpan=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=F,H&&$.setAttributes(Y,H),Y},$.createImage=function(F){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return F&&$.setAttributes(H,F),H},$.createPoint=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=F,Y.y=H,Y},$.createPath=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",F),H&&$.setAttributes(Y,H),Y},$}(),le=function(){function $(){}return $.addKey=function(F){$.key=F},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),Ee=function(){function $(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return $.prototype.rasterize=function(F,H,Y){var se=this;return new Promise(function(Z){var Me=Y!==void 0?Y:document.createElement("canvas");F===null&&(se.markersOnly=!0,se.naturalSize=!1);var rt=document.createElementNS("http://www.w3.org/2000/svg","svg");rt.setAttribute("xmlns","http://www.w3.org/2000/svg"),rt.setAttribute("width",H.width.baseVal.valueAsString),rt.setAttribute("height",H.height.baseVal.valueAsString),rt.setAttribute("viewBox","0 0 "+H.viewBox.baseVal.width.toString()+" "+H.viewBox.baseVal.height.toString()),rt.innerHTML=H.innerHTML,se.naturalSize===!0?(rt.width.baseVal.value=F.naturalWidth,rt.height.baseVal.value=F.naturalHeight):se.width!==void 0&&se.height!==void 0&&(rt.width.baseVal.value=se.width,rt.height.baseVal.value=se.height),Me.width=rt.width.baseVal.value,Me.height=rt.height.baseVal.value;var pt=rt.outerHTML,Et=Me.getContext("2d");se.markersOnly!==!0&&Et.drawImage(F,0,0,Me.width,Me.height);var ot=window.URL,Rt=new Image(Me.width,Me.height);Rt.setAttribute("crossOrigin","anonymous");var Gt=new Blob([pt],{type:"image/svg+xml"}),ei=ot.createObjectURL(Gt);Rt.onload=function(){Et.drawImage(Rt,0,0),ot.revokeObjectURL(ei);var Fi=Me.toDataURL(se.imageType,se.imageQuality);Z(Fi)},Rt.src=ei})},$}(),pe=function(){},Ge=function(){function $(F){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+F+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(F){return this.styleSheet===void 0&&this.addStyleSheet(),F.name=""+this.classNamePrefix+F.localName,this.classes.push(F),this.styleSheet.sheet.insertRule("."+F.name+" {"+F.style+"}",this.styleSheet.sheet.cssRules.length),F},$.prototype.addRule=function(F){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(F),this.styleSheet.sheet.insertRule(F.selector+" {"+F.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var F;this.styleSheet=document.createElement("style"),((F=this.styleSheetRoot)!==null&&F!==void 0?F:document.head).appendChild(this.styleSheet),this.addRule(new Ye("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ye("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ye("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ze("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ze("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var F;this.styleSheet&&(((F=this.styleSheetRoot)!==null&&F!==void 0?F:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),Ye=function($,F){this.selector=$,this.style=F},ze=function($,F){this.localName=$,this.style=F},Ze=function(){function $(F,H,Y,se,Z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=F,this.displayMode=H,this.markerItems=Y,this.uiStyleSettings=se,this.styles=Z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return $.prototype.show=function(F){var H=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=F,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",this.uiContainer.appendChild(Y),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Y,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Z){var Me=document.createElement("div");Me.className=""+H.toolbarButtonStyleClass.name,Me.setAttribute("data-type-name",Z.typeName),Me.innerHTML=Z.icon,Me.addEventListener("click",function(){H.markerToolbarButtonClicked(Me,Z)}),H.buttons.push(Me),H.markerButtons.push(Me)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var se=document.createElement("div");se.className=this.toolbarBlockStyleClass.name,se.style.whiteSpace="nowrap",se.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(se),this.addActionButton(se,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(se,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(F){this.buttonClickListeners.push(F)},$.prototype.removeButtonClickListener=function(F){this.buttonClickListeners.indexOf(F)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(F),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var F=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var H=0;H<this.markerButtons.length;H++)H<F||H===F&&this.markerButtons.length-1===F?this.markerButtonBlock.appendChild(this.markerButtons[H]):(H===F&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[H]))}},$.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},$.prototype.resetButtonStyles=function(){var F=this;this.buttons.forEach(function(H){H.className=H.className.replace(F.uiStyleSettings.toolbarButtonStyleColorsClassName?F.uiStyleSettings.toolbarButtonStyleColorsClassName:F.toolbarButtonStyleColorsClass.name,"").trim(),H.className=H.className.replace(F.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?F.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:F.toolbarActiveButtonStyleColorsClass.name,"").trim(),H.className+=" "+(F.uiStyleSettings.toolbarButtonStyleColorsClassName?F.uiStyleSettings.toolbarButtonStyleColorsClassName:F.toolbarButtonStyleColorsClass.name)})},$.prototype.addActionButton=function(F,H,Y){var se=this,Z=document.createElement("div");switch(Z.className=""+this.toolbarButtonStyleClass.name,Z.innerHTML=H,Z.setAttribute("data-action",Y),Z.addEventListener("click",function(){se.actionToolbarButtonClicked(Z,Y)}),Y){case"select":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Z.style.fill=this.uiStyleSettings.closeButtonColor}F.appendChild(Z),this.buttons.push(Z)},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ze("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ze("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var F=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*F)+`px;
padding: `+F+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ye("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ye("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},$.prototype.markerToolbarButtonClicked=function(F,H){this.setActiveButton(F),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("marker",H)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(F,H){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("action",H)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(F){this.resetButtonStyles(),F.className=F.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),F.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(F){var H=this.markerButtons.find(function(Y){return Y.getAttribute("data-type-name")===F});H&&this.setActiveButton(H)},$.prototype.setCurrentMarker=function(F){var H=this;this.currentMarker=F,this.buttons.filter(function(Y){return/delete|notes/.test(Y.getAttribute("data-action"))}).forEach(function(Y){H.currentMarker===void 0?(Y.style.fillOpacity="0.4",Y.style.pointerEvents="none"):(Y.style.fillOpacity="1",Y.style.pointerEvents="all")})},$}(),Je=function(){function $(F,H,Y,se){this.panels=[],this.panelButtons=[],this.markerjsContainer=F,this.displayMode=H,this.uiStyleSettings=Y,this.styles=se,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var F;this.toolboxStyleClass=this.styles.addClass(new ze("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ze("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var H=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ze("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ze("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ze("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ze("toolbox-panel-row_colors",`
background-color: `+((F=this.uiStyleSettings.toolboxBackgroundColor)!==null&&F!==void 0?F:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ze("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
padding: `+H+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ye("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},$.prototype.show=function(F){var H;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=F,this.uiContainer.className=this.toolboxStyleClass.name+" "+((H=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(F){var H,Y,se=this;this.panels=F,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Z){var Me;Z.uiStyleSettings=se.uiStyleSettings;var rt=document.createElement("div");rt.className=se.toolboxButtonStyleClass.name+" "+((Me=se.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Me!==void 0?Me:se.toolboxButtonStyleColorsClass.name),rt.innerHTML=Z.icon,rt.title=Z.title,rt.addEventListener("click",function(){se.panelButtonClick(Z)}),se.panelButtons.push(rt),se.buttonRow.appendChild(rt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(F){var H=this,Y=-1;if(F!==this.activePanel){Y=this.panels.indexOf(F),this.panelRow.innerHTML="";var se=F.getUi();se.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(se),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=F}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){H.displayMode==="inline"?H.panelRow.style.display="none":H.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Z,Me){var rt,pt;Z.className=H.toolboxButtonStyleClass.name+" "+(Me===Y?""+((rt=H.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&rt!==void 0?rt:H.toolboxActiveButtonStyleColorsClass.name):""+((pt=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pt!==void 0?pt:H.toolboxButtonStyleColorsClass.name))})},$}(),$e=function($,F){this.title=$,this.icon=F},He=function($){function F(H,Y,se,Z){var Me=$.call(this,H,Z||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Me.colors=[],Me.addTransparent=!1,Me.colorBoxes=[],Me.colors=Y,Me.currentColor=se,Me.setCurrentColor=Me.setCurrentColor.bind(Me),Me.getColorBox=Me.getColorBox.bind(Me),Me}return Re(F,$),F.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.whiteSpace="nowrap",this.colors.forEach(function(se){var Z=H.getColorBox(se);Y.appendChild(Z),H.colorBoxes.push(Z)}),Y},F.prototype.getColorBox=function(H){var Y=this,se=this.uiStyleSettings.toolbarHeight/4,Z=this.uiStyleSettings.toolbarHeight-se,Me=document.createElement("div");Me.style.display="inline-block",Me.style.boxSizing="content-box",Me.style.width=Z-2+"px",Me.style.height=Z-2+"px",Me.style.padding="1px",Me.style.marginRight="2px",Me.style.marginBottom="2px",Me.style.borderWidth="2px",Me.style.borderStyle="solid",Me.style.borderRadius=(Z+2)/2+"px",Me.style.borderColor=H===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Me.addEventListener("click",function(){Y.setCurrentColor(H,Me)});var rt=document.createElement("div");return rt.style.display="inline-block",rt.style.width=Z-2+"px",rt.style.height=Z-2+"px",rt.style.backgroundColor=H,rt.style.borderRadius=Z/2+"px",H==="transparent"&&(rt.style.fill=this.uiStyleSettings.toolboxAccentColor,rt.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Me.appendChild(rt),Me},F.prototype.setCurrentColor=function(H,Y){var se=this;this.currentColor=H,this.colorBoxes.forEach(function(Z){Z.style.borderColor=Z===Y?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(H)},F}($e),Ue=function(){function $(F,H,Y){this._state="new",this._isSelected=!1,this._container=F,this._overlayContainer=H,this.globalSettings=Y,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(F){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(F,H){},$.prototype.dblClick=function(F,H){},$.prototype.manipulate=function(F){},$.prototype.pointerUp=function(F){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(F){this.container.childNodes.length>0?this.container.insertBefore(F,this.container.childNodes[0]):this.container.appendChild(F)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(F){this._state=F.state,this.notes=F.notes},$.prototype.scale=function(F,H){},$.prototype.colorChanged=function(F){this.onColorChanged&&this.onColorChanged(F),this.stateChanged()},$.prototype.fillColorChanged=function(F){this.onFillColorChanged&&this.onFillColorChanged(F),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var F=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),F.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(F)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),Pe=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(F){return this.topLeft.ownsTarget(F)?this.topLeft:this.topCenter.ownsTarget(F)?this.topCenter:this.topRight.ownsTarget(F)?this.topRight:this.centerLeft.ownsTarget(F)?this.centerLeft:this.centerRight.ownsTarget(F)?this.centerRight:this.bottomLeft.ownsTarget(F)?this.bottomLeft:this.bottomCenter.ownsTarget(F)?this.bottomCenter:this.bottomRight.ownsTarget(F)?this.bottomRight:void 0},$}(),ke=function(){function $(){this.GRIP_SIZE=10,this.visual=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(F){return F===this.visual||F===this.visual.childNodes[0]||F===this.visual.childNodes[1]},$}(),re=function(){function $(){}return $.toITransformMatrix=function(F){return{a:F.a,b:F.b,c:F.c,d:F.d,e:F.e,f:F.f}},$.toSVGMatrix=function(F,H){return F.a=H.a,F.b=H.b,F.c=H.c,F.d=H.d,F.e=H.e,F.f=H.f,F},$}(),ve=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.left=0,Z.top=0,Z.width=0,Z.height=0,Z.defaultSize={x:50,y:20},Z.offsetX=0,Z.offsetY=0,Z.rotationAngle=0,Z.CB_DISTANCE=10,Z._suppressMarkerCreateEvent=!1,Z.container.transform.baseVal.appendItem(_e.createTransform()),Z.setupControlBox(),Z}return Re(F,$),Object.defineProperty(F.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"visual",{get:function(){return this._visual},set:function(H){this._visual=H;var Y=_e.createTransform();this._visual.transform.baseVal.appendItem(Y)},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(H){return!!$.prototype.ownsTarget.call(this,H)||!!(this.controlGrips.findGripByVisual(H)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H))},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.left=H.x,this.top=H.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var se=this.unrotatePoint(H);if(this.manipulationStartX=se.x,this.manipulationStartY=se.y,this.offsetX=se.x-this.left,this.offsetY=se.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Y),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y)){this.activeGrip=this.rotatorGrip;var Z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Z.x-this.width/2,this.top=Z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Me=this.container.transform.baseVal.getItem(0);Me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},F.prototype.pointerUp=function(H){var Y=this.state;$.prototype.pointerUp.call(this,H),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(H),this._state="select",Y==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},F.prototype.moveVisual=function(H){this.visual.style.transform="translate("+H.x+"px, "+H.y+"px)"},F.prototype.manipulate=function(H){var Y=this.unrotatePoint(H);this.state==="creating"?this.resize(H):this.state==="move"?(this.left=this.manipulationStartLeft+(Y.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Y.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Y):this.state==="rotate"&&this.rotate(H)},F.prototype.resize=function(H){var Y=this.manipulationStartLeft,se=this.manipulationStartWidth,Z=this.manipulationStartTop,Me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Y=this.manipulationStartLeft+H.x-this.manipulationStartX,se=this.manipulationStartWidth+this.manipulationStartLeft-Y;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:se=this.manipulationStartWidth+H.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Z=this.manipulationStartTop+H.y-this.manipulationStartY,Me=this.manipulationStartHeight+this.manipulationStartTop-Z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Me=this.manipulationStartHeight+H.y-this.manipulationStartY}se>=0?(this.left=Y,this.width=se):(this.left=Y+se,this.width=-se),Me>=0?(this.top=Z,this.height=Me):(this.top=Z+Me,this.height=-Me),this.setSize()},F.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},F.prototype.rotate=function(H){if(Math.abs(H.x-this.centerX)>.1){var Y=Math.sign(H.x-this.centerX);this.rotationAngle=180*Math.atan((H.y-this.centerY)/(H.x-this.centerX))/Math.PI+90*Y,this.applyRotation()}},F.prototype.applyRotation=function(){var H=this.container.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(H,0)},F.prototype.rotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM(),se=_e.createPoint(H.x,H.y);return{x:(se=se.matrixTransform(Y)).x,y:se.y}},F.prototype.unrotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM();Y=Y.inverse();var se=_e.createPoint(H.x,H.y);return{x:(se=se.matrixTransform(Y)).x,y:se.y}},F.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},F.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},F.prototype.setupControlBox=function(){this.controlBox=_e.createGroup();var H=_e.createTransform();H.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(H),this.container.appendChild(this.controlBox),this.controlRect=_e.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=_e.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Pe,this.addControlGrips(),this.controlBox.style.display="none"},F.prototype.adjustControlBox=function(){var H=this.controlBox.transform.baseVal.getItem(0);H.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(H,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},F.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},F.prototype.createGrip=function(){var H=new ke;return H.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(H.visual),H},F.prototype.positionGrips=function(){var H=this.controlGrips.topLeft.GRIP_SIZE,Y=-H/2,se=Y,Z=(this.width+this.CB_DISTANCE)/2-H/2,Me=(this.height+this.CB_DISTANCE)/2-H/2,rt=this.height+this.CB_DISTANCE-H/2,pt=this.width+this.CB_DISTANCE-H/2;this.positionGrip(this.controlGrips.topLeft.visual,Y,se),this.positionGrip(this.controlGrips.topCenter.visual,Z,se),this.positionGrip(this.controlGrips.topRight.visual,pt,se),this.positionGrip(this.controlGrips.centerLeft.visual,Y,Me),this.positionGrip(this.controlGrips.centerRight.visual,pt,Me),this.positionGrip(this.controlGrips.bottomLeft.visual,Y,rt),this.positionGrip(this.controlGrips.bottomCenter.visual,Z,rt),this.positionGrip(this.controlGrips.bottomRight.visual,pt,rt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Z,se-3*this.CB_DISTANCE)},F.prototype.positionGrip=function(H,Y,se){var Z=H.transform.baseVal.getItem(0);Z.setTranslate(Y,se),H.transform.baseVal.replaceItem(Z,0)},F.prototype.hideControlBox=function(){this.controlBox.style.display="none"},F.prototype.showControlBox=function(){this.controlBox.style.display=""},F.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:re.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:re.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},F.prototype.restoreState=function(H){$.prototype.restoreState.call(this,H);var Y=H;this.left=Y.left,this.top=Y.top,this.width=Y.width,this.height=Y.height,this.rotationAngle=Y.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Y.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Y.containerTransformMatrix))},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y);var se=this.rotatePoint({x:this.left,y:this.top}),Z=this.unrotatePoint({x:se.x*H,y:se.y*Y});this.left=Z.x,this.top=Z.y,this.width=this.width*H,this.height=this.height*Y,this.adjustControlBox()},F}(Ue),ae=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.visual)},F.prototype.createVisual=function(){this.visual=_e.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},F.prototype.manipulate=function(H){$.prototype.manipulate.call(this,H)},F.prototype.resize=function(H){$.prototype.resize.call(this,H),this.setSize()},F.prototype.setSize=function(){$.prototype.setSize.call(this),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},F.prototype.pointerUp=function(H){$.prototype.pointerUp.call(this,H),this.setSize()},F.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},F.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},F.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},F.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},F.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},F.prototype.restoreState=function(H){var Y=H;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),$.prototype.restoreState.call(this,H),this.setSize()},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y),this.setSize()},F.title="Rectangle marker",F}(ve),De=function($){function F(H,Y,se,Z){var Me=$.call(this,H,Z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Me.widths=[],Me.widthBoxes=[],Me.widths=Y,Me.currentWidth=se,Me.setCurrentWidth=Me.setCurrentWidth.bind(Me),Me}return Re(F,$),F.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.widths.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.flexGrow="2",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===H.currentWidth?H.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){H.setCurrentWidth(se,Z)}),Y.appendChild(Z);var Me=document.createElement("div");Me.innerText=se.toString(),Me.style.marginRight="5px",Z.appendChild(Me);var rt=document.createElement("div");rt.style.minHeight="20px",rt.style.flexGrow="2",rt.style.display="flex",rt.style.alignItems="center";var pt=document.createElement("hr");pt.style.minWidth="20px",pt.style.border="0px",pt.style.borderTop=se+"px solid "+H.uiStyleSettings.toolboxColor,pt.style.flexGrow="2",rt.appendChild(pt),Z.appendChild(rt),H.widthBoxes.push(Z)}),Y},F.prototype.setCurrentWidth=function(H,Y){var se=this;this.currentWidth=H,this.widthBoxes.forEach(function(Z){Z.style.borderColor=Z===Y?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},F}($e),qe=function($){function F(H,Y,se,Z){var Me=$.call(this,H,Z||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Me.styles=[],Me.styleBoxes=[],Me.styles=Y,Me.currentStyle=se,Me.setCurrentStyle=Me.setCurrentStyle.bind(Me),Me}return Re(F,$),F.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.styles.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/H.styles.length-5+"%",Z.style.borderColor=se===H.currentStyle?H.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){H.setCurrentStyle(se,Z)}),Y.appendChild(Z);var Me=document.createElement("div");Me.style.minHeight="20px",Me.style.flexGrow="2",Me.style.overflow="hidden";var rt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+H.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(se!==""?'stroke-dasharray="'+se+'"':"")+` />
</svg>`;Me.innerHTML=rt,Z.appendChild(Me),H.styleBoxes.push(Z)}),Y},F.prototype.setCurrentStyle=function(H,Y){var se=this;this.currentStyle=H,this.styleBoxes.forEach(function(Z){Z.style.borderColor=Z===Y?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},F}($e),et=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new He("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new De("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new qe("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Re(F,$),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=$.prototype.getState.call(this);return H.typeName=F.typeName,H},F.typeName="FrameMarker",F.title="Frame marker",F.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',F}(ae),je=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ct=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.x1=0,Z.y1=0,Z.x2=0,Z.y2=0,Z.defaultLength=50,Z.manipulationStartX=0,Z.manipulationStartY=0,Z.manipulationStartX1=0,Z.manipulationStartY1=0,Z.manipulationStartX2=0,Z.manipulationStartY2=0,Z.setupControlBox(),Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!!$.prototype.ownsTarget.call(this,H)||!(!this.grip1.ownsTarget(H)&&!this.grip2.ownsTarget(H))},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.manipulationStartX=H.x,this.manipulationStartY=H.y,this.state==="new"&&(this.x1=H.x,this.y1=H.y,this.x2=H.x,this.y2=H.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Y)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Y)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},F.prototype.pointerUp=function(H){var Y=this.state;$.prototype.pointerUp.call(this,H),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(H),this._state="select",Y==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},F.prototype.adjustVisual=function(){},F.prototype.manipulate=function(H){this.state==="creating"?this.resize(H):this.state==="move"?(this.x1=this.manipulationStartX1+H.x-this.manipulationStartX,this.y1=this.manipulationStartY1+H.y-this.manipulationStartY,this.x2=this.manipulationStartX2+H.x-this.manipulationStartX,this.y2=this.manipulationStartY2+H.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(H)},F.prototype.resize=function(H){switch(this.activeGrip){case this.grip1:this.x1=H.x,this.y1=H.y;break;case this.grip2:case void 0:this.x2=H.x,this.y2=H.y}this.adjustVisual(),this.adjustControlBox()},F.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},F.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},F.prototype.setupControlBox=function(){this.controlBox=_e.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},F.prototype.adjustControlBox=function(){this.positionGrips()},F.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},F.prototype.createGrip=function(){var H=new ke;return H.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(H.visual),H},F.prototype.positionGrips=function(){var H=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-H/2,this.y1-H/2),this.positionGrip(this.grip2.visual,this.x2-H/2,this.y2-H/2)},F.prototype.positionGrip=function(H,Y,se){var Z=H.transform.baseVal.getItem(0);Z.setTranslate(Y,se),H.transform.baseVal.replaceItem(Z,0)},F.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},F.prototype.restoreState=function(H){$.prototype.restoreState.call(this,H);var Y=H;this.x1=Y.x1,this.y1=Y.y1,this.x2=Y.x2,this.y2=Y.y2},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y),this.x1=this.x1*H,this.y1=this.y1*Y,this.x2=this.x2*H,this.y2=this.y2*Y,this.adjustVisual(),this.adjustControlBox()},F}(Ue),he=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new He("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new De("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new qe("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorLine&&H!==this.visibleLine)},F.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},F.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),_e.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},F.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},F.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},F.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){$.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.createVisual(),this.adjustVisual()},F.typeName="LineMarker",F.title="Line marker",F.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',F}(ct),Te=function($){function F(H,Y,se,Z){var Me=$.call(this,H,Z||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Me.fonts=[],Me.fontBoxes=[],Me.fonts=Y,Me.currentFont=se,Me.setCurrentFont=Me.setCurrentFont.bind(Me),Me}return Re(F,$),F.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.flexGrow="2",this.fonts.forEach(function(se){var Z=document.createElement("div");Z.style.display="inline-block",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/H.fonts.length-5+"%",Z.style.borderColor=se===H.currentFont?H.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){H.setCurrentFont(se,Z)}),Y.appendChild(Z);var Me=document.createElement("div");Me.style.display="flex",Me.style.minHeight="20px",Me.style.flexGrow="2",Me.style.fontFamily=se,Me.style.overflow="hidden";var rt=document.createElement("div");rt.style.whiteSpace="nowrap",rt.style.overflow="hidden",rt.style.textOverflow="ellipsis",rt.innerHTML="The quick brown fox jumps over the lazy dog",Me.appendChild(rt),Z.appendChild(Me),H.fontBoxes.push(Z)}),Y},F.prototype.setCurrentFont=function(H,Y){var se=this;this.currentFont=H,this.fontBoxes.forEach(function(Z){Z.style.borderColor=Z===Y?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},F}($e),We=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.color="transparent",Z.padding=5,Z.DEFAULT_TEXT="your text here",Z.text=Z.DEFAULT_TEXT,Z.isMoved=!1,Z.color=se.defaultColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setColor=Z.setColor.bind(Z),Z.setFont=Z.setFont.bind(Z),Z.renderText=Z.renderText.bind(Z),Z.sizeText=Z.sizeText.bind(Z),Z.textEditDivClicked=Z.textEditDivClicked.bind(Z),Z.showTextEditor=Z.showTextEditor.bind(Z),Z.setSize=Z.setSize.bind(Z),Z.positionTextEditor=Z.positionTextEditor.bind(Z),Z.colorPanel=new He("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.fontFamilyPanel=new Te("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z}return Re(F,$),F.prototype.ownsTarget=function(H){if($.prototype.ownsTarget.call(this,H)||H===this.visual||H===this.textElement||H===this.bgRectangle)return!0;var Y=!1;return this.textElement.childNodes.forEach(function(se){se===H&&(Y=!0)}),Y},F.prototype.createVisual=function(){this.visual=_e.createGroup(),this.bgRectangle=_e.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_e.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.isMoved=!1,this.pointerDownPoint=H,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},F.prototype.renderText=function(){var H=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Y){H.textElement.appendChild(_e.createTSpan(Y.trim()===""?" ":Y.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},F.prototype.getTextScale=function(){var H=this.textElement.getBBox(),Y=1;if(H.width>0&&H.height>0){var se=(1*this.width-this.width*this.padding*2/100)/H.width,Z=(1*this.height-this.height*this.padding*2/100)/H.height;Y=Math.min(se,Z)}return Y},F.prototype.getTextPosition=function(H){var Y=this.textElement.getBBox(),se=0,Z=0;return Y.width>0&&Y.height>0&&(se=(this.width-Y.width*H)/2,Z=this.height/2-Y.height*H/2),{x:se,y:Z}},F.prototype.sizeText=function(){var H=this.textElement.getBBox(),Y=this.getTextScale(),se=this.getTextPosition(Y);se.y-=H.y*Y,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+se.x+"px, "+se.y+"px) scale("+Y+", "+Y+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(se.x,se.y),this.textElement.transform.baseVal.getItem(1).setScale(Y,Y))},F.prototype.manipulate=function(H){$.prototype.manipulate.call(this,H),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(H.x-this.pointerDownPoint.x)>5||Math.abs(H.y-this.pointerDownPoint.y)>5)},F.prototype.resize=function(H){$.prototype.resize.call(this,H),this.isMoved=!0,this.setSize(),this.sizeText()},F.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},F.prototype.pointerUp=function(H){var Y=this.state;Y==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,H),this.setSize(),(Y==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},F.prototype.showTextEditor=function(){var H=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Y){Y.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Y=Number.parseFloat(H.textEditor.style.fontSize);H.textEditor.clientWidth>=Number.parseInt(H.textEditor.style.maxWidth)&&Y>.9;)Y-=.1,H.textEditor.style.fontSize=Math.max(Y,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Y){Y.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Y){if(Y.clipboardData){var se=Y.clipboardData.getData("text"),Z=window.getSelection();if(!Z.rangeCount)return!1;Z.deleteFromDocument(),Z.getRangeAt(0).insertNode(document.createTextNode(se)),Y.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){H.textEditDivClicked(H.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},F.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var H=this.getTextScale(),Y=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),se=this.textElement.getBBox(),Z={x:se.width*H,y:se.height*H};Y.x-=Z.x/2,Y.y-=Z.y/2,this.textEditor.style.top=Y.y+"px",this.textEditor.style.left=Y.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Y.x+"px",this.textEditor.style.fontSize=Math.max(16*H,12)+"px",this.textElement.style.display="none"}},F.prototype.textEditDivClicked=function(H){this.text=H.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},F.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},F.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},F.prototype.dblClick=function(H,Y){$.prototype.dblClick.call(this,H,Y),this.showTextEditor()},F.prototype.setColor=function(H){this.textElement&&_e.setAttributes(this.textElement,[["fill",H]]),this.color=H,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(H)},F.prototype.setFont=function(H){this.textElement&&_e.setAttributes(this.textElement,[["font-family",H]]),this.fontFamily=H,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},F.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},F.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){var Y=H;this.color=Y.color,this.fontFamily=Y.fontFamily,this.padding=Y.padding,this.text=Y.text,this.createVisual(),$.prototype.restoreState.call(this,H),this.setSize()},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y),this.setSize(),this.sizeText(),this.positionTextEditor()},F.typeName="TextMarker",F.title="Text marker",F.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',F}(ve),xe=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.color="transparent",Z.lineWidth=3,Z.drawing=!1,Z.pixelRatio=1,Z.color=se.defaultColor,Z.lineWidth=se.defaultStrokeWidth,Z.pixelRatio=se.freehandPixelRatio,Z.setColor=Z.setColor.bind(Z),Z.addCanvas=Z.addCanvas.bind(Z),Z.finishCreation=Z.finishCreation.bind(Z),Z.setLineWidth=Z.setLineWidth.bind(Z),Z.colorPanel=new He("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.lineWidthPanel=new De("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.lineWidthPanel.onWidthChanged=Z.setLineWidth,Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.drawingImage)},F.prototype.createVisual=function(){this.visual=_e.createGroup(),this.drawingImage=_e.createImage(),this.visual.appendChild(this.drawingImage);var H=_e.createTransform();this.visual.transform.baseVal.appendItem(H),this.addMarkerVisualToContainer(this.visual)},F.prototype.pointerDown=function(H,Y){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(H.x,H.y),this.drawing=!0):$.prototype.pointerDown.call(this,H,Y)},F.prototype.manipulate=function(H){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(H.x,H.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,H)},F.prototype.resize=function(H){$.prototype.resize.call(this,H),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},F.prototype.pointerUp=function(H){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,H)},F.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},F.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},F.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},F.prototype.finishCreation=function(){for(var H=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Y=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],se=Y[0],Z=Y[1],Me=Y[2],rt=Y[3],pt=!1,Et=0;Et<this.canvasElement.height;Et++)for(var ot=0;ot<this.canvasElement.width;ot++)H.data[Et*this.canvasElement.width*4+4*ot+3]>0&&(pt=!0,Et<Z&&(Z=Et),ot<se&&(se=ot),Et>rt&&(rt=Et),ot>Me&&(Me=ot));if(pt){this.left=se/this.pixelRatio,this.top=Z/this.pixelRatio,this.width=(Me-se)/this.pixelRatio,this.height=(rt-Z)/this.pixelRatio;var Rt=document.createElement("canvas");Rt.width=Me-se,Rt.height=rt-Z,Rt.getContext("2d").putImageData(this.canvasContext.getImageData(se,Z,Me-se,rt-Z),0,0),this.drawingImgUrl=Rt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},F.prototype.setDrawingImage=function(){_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},F.prototype.setColor=function(H){this.color=H,this.colorChanged(H)},F.prototype.setLineWidth=function(H){this.lineWidth=H},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){this.createVisual(),$.prototype.restoreState.call(this,H),this.drawingImgUrl=H.drawingImgUrl,this.setDrawingImage()},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y),this.setDrawingImage()},F.typeName="FreehandMarker",F.title="Freehand marker",F.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',F}(ve),ge=function($){function F(H,Y,se){var Z=$.call(this,H,se||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Z.typeBoxes=[],Z.currentType=Y,Z.setCurrentType=Z.setCurrentType.bind(Z),Z}return Re(F,$),F.prototype.getUi=function(){var H=this,Y=document.createElement("div");Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2";for(var se=function(rt){var pt="both";switch(rt){case 0:pt="both";break;case 1:pt="start";break;case 2:pt="end";break;case 3:pt="none"}var Et=document.createElement("div");if(Et.style.display="flex",Et.style.flexGrow="2",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.borderColor=pt===Z.currentType?Z.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){H.setCurrentType(pt,Et)}),Y.appendChild(Et),pt==="both"||pt==="start"){var ot=document.createElement("div");ot.style.display="flex",ot.style.alignItems="center",ot.style.minHeight="20px",ot.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ot.style.marginLeft="5px",Et.appendChild(ot)}var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.style.flexGrow="2";var Gt=document.createElement("hr");if(Gt.style.minWidth="20px",Gt.style.border="0px",Gt.style.borderTop="3px solid "+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee"),Gt.style.flexGrow="2",Rt.appendChild(Gt),Et.appendChild(Rt),pt==="both"||pt==="end"){var ei=document.createElement("div");ei.style.display="flex",ei.style.alignItems="center",ei.style.minHeight="20px",ei.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ei.style.marginRight="5px",Et.appendChild(ei)}Z.typeBoxes.push(Et)},Z=this,Me=0;Me<4;Me++)se(Me);return Y},F.prototype.setCurrentType=function(H,Y){var se=this;this.currentType=H,this.typeBoxes.forEach(function(Z){Z.style.borderColor=Z===Y?se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},F}($e),ye=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.arrowType="end",Z.arrowBaseHeight=10,Z.arrowBaseWidth=10,Z.getArrowPoints=Z.getArrowPoints.bind(Z),Z.setArrowType=Z.setArrowType.bind(Z),Z.arrowTypePanel=new ge("Arrow type","end"),Z.arrowTypePanel.onArrowTypeChanged=Z.setArrowType,Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.arrow1&&H!==this.arrow2)},F.prototype.getArrowPoints=function(H,Y){var se=this.arrowBaseWidth+2*this.strokeWidth,Z=this.arrowBaseHeight+2*this.strokeWidth;return H-se/2+","+(Y+Z/2)+" "+H+","+(Y-Z/2)+" "+(H+se/2)+","+(Y+Z/2)},F.prototype.createTips=function(){this.arrow1=_e.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_e.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow2)},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},F.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",_e.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_e.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.arrow1.transform.baseVal.getItem(0);Y.setRotate(H,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Y,0);var se=this.arrow2.transform.baseVal.getItem(0);se.setRotate(H+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(se,0)}},F.prototype.setArrowType=function(H){this.arrowType=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){$.prototype.restoreState.call(this,H);var Y=H;this.arrowType=Y.arrowType,this.createTips(),this.adjustVisual()},F.typeName="ArrowMarker",F.title="Arrow marker",F.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',F}(he),J=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.fillColor=se.defaultFillColor,Z.strokeWidth=0,Z.fillPanel=new He("Color",se.defaultColorSet,se.defaultFillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z}return Re(F,$),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=$.prototype.getState.call(this);return H.typeName=F.typeName,H},F.typeName="CoverMarker",F.title="Cover marker",F.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',F}(ae),ne=function($){function F(H,Y,se,Z){var Me=$.call(this,H,Z||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Me.opacities=[],Me.opacityBoxes=[],Me.opacities=Y,Me.currentOpacity=se,Me.setCurrentOpacity=Me.setCurrentOpacity.bind(Me),Me}return Re(F,$),F.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",Y.style.justifyContent="space-between",this.opacities.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===H.currentOpacity?H.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){H.setCurrentOpacity(se,Z)}),Y.appendChild(Z);var Me=document.createElement("div");Me.innerText=100*se+"%",Z.appendChild(Me),H.opacityBoxes.push(Z)}),Y},F.prototype.setCurrentOpacity=function(H,Y){var se=this;this.currentOpacity=H,this.opacityBoxes.forEach(function(Z){Z.style.borderColor=Z===Y?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},F}($e),q=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.setOpacity=Z.setOpacity.bind(Z),Z.fillColor=se.defaultHighlightColor,Z.strokeWidth=0,Z.opacity=se.defaultHighlightOpacity,Z.fillPanel=new He("Color",se.defaultColorSet,Z.fillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z.opacityPanel=new ne("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Re(F,$),F.prototype.setOpacity=function(H){this.opacity=H,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=$.prototype.getState.call(this);return H.typeName=F.typeName,H},F.typeName="HighlightMarker",F.title="Highlight marker",F.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',F}(J),me='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ce=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.bgColor="transparent",Z.tipPosition={x:0,y:0},Z.tipBase1Position={x:0,y:0},Z.tipBase2Position={x:0,y:0},Z.tipMoving=!1,Z.color=se.defaultStrokeColor,Z.bgColor=se.defaultFillColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setBgColor=Z.setBgColor.bind(Z),Z.getTipPoints=Z.getTipPoints.bind(Z),Z.positionTip=Z.positionTip.bind(Z),Z.setTipPoints=Z.setTipPoints.bind(Z),Z.colorPanel=new He("Text color",se.defaultColorSet,Z.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Z.colorPanel.onColorChanged=Z.setColor,Z.bgColorPanel=new He("Fill color",se.defaultColorSet,Z.bgColor,me),Z.bgColorPanel.onColorChanged=Z.setBgColor,Z.fontFamilyPanel=new Te("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z.tipGrip=new ke,Z.tipGrip.visual.transform.baseVal.appendItem(_e.createTransform()),Z.controlBox.appendChild(Z.tipGrip.visual),Z}return Re(F,$),F.prototype.ownsTarget=function(H){return $.prototype.ownsTarget.call(this,H)||this.tipGrip.ownsTarget(H)||this.tip===H},F.prototype.createTip=function(){_e.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_e.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},F.prototype.pointerDown=function(H,Y){this.state==="new"&&$.prototype.pointerDown.call(this,H,Y),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Y)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,H,Y)},F.prototype.pointerUp=function(H){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,H);else{var Y=this.state==="creating";$.prototype.pointerUp.call(this,H),this.setTipPoints(Y),this.positionTip()}},F.prototype.manipulate=function(H){if(this.tipMoving){var Y=this.unrotatePoint(H);this.tipPosition={x:Y.x-this.manipulationStartLeft,y:Y.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,H)},F.prototype.setBgColor=function(H){this.bgRectangle&&this.tip&&(_e.setAttributes(this.bgRectangle,[["fill",H]]),_e.setAttributes(this.tip,[["fill",H]])),this.bgColor=H,this.fillColorChanged(H)},F.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},F.prototype.setTipPoints=function(H){H===void 0&&(H=!1);var Y=Math.min(this.height/2,15),se=this.height/5;H&&(this.tipPosition={x:Y+se/2,y:this.height+20});var Z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(se=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:0},this.tipBase2Position={x:Y+se,y:0}):(this.tipBase1Position={x:0,y:Y},this.tipBase2Position={x:0,y:Y+se}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(se=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-se,y:0},this.tipBase2Position={x:this.width-Y,y:0}):(this.tipBase1Position={x:this.width,y:Y},this.tipBase2Position={x:this.width,y:Y+se}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(se=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Y-se,y:this.height},this.tipBase2Position={x:this.width-Y,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Y-se},this.tipBase2Position={x:this.width,y:this.height-Y}):Z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(se=this.width/5,Y=Math.min(this.width/2,15),this.tipBase1Position={x:Y,y:this.height},this.tipBase2Position={x:Y+se,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Y},this.tipBase2Position={x:0,y:this.height-Y-se})},F.prototype.resize=function(H){$.prototype.resize.call(this,H),this.positionTip()},F.prototype.positionTip=function(){_e.setAttributes(this.tip,[["points",this.getTipPoints()]]);var H=this.tipGrip.visual.transform.baseVal.getItem(0);H.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(H,0)},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),F.prototype.select=function(){this.positionTip(),$.prototype.select.call(this)},F.prototype.getState=function(){var H=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){var Y=H;this.bgColor=Y.bgColor,this.tipPosition=Y.tipPosition,$.prototype.restoreState.call(this,H),this.createTip(),this.setTipPoints()},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y),this.tipPosition={x:this.tipPosition.x*H,y:this.tipPosition.y*Y},this.positionTip()},F.typeName="CalloutMarker",F.title="Callout marker",F.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',F}(We),G=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.fillColor=se.defaultFillColor,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.setOpacity=Z.setOpacity.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z.strokePanel=new He("Line color",Ae(se.defaultColorSet,["transparent"]),se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.fillPanel=new He("Fill color",Ae(se.defaultColorSet,["transparent"]),Z.fillColor,me),Z.fillPanel.onColorChanged=Z.setFillColor,Z.strokeWidthPanel=new De("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new qe("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z.opacityPanel=new ne("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.visual)},F.prototype.createVisual=function(){this.visual=_e.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},F.prototype.manipulate=function(H){$.prototype.manipulate.call(this,H)},F.prototype.resize=function(H){$.prototype.resize.call(this,H),this.setSize()},F.prototype.setSize=function(){$.prototype.setSize.call(this),_e.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},F.prototype.pointerUp=function(H){$.prototype.pointerUp.call(this,H),this.setSize()},F.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},F.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(H),this.stateChanged()},F.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},F.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},F.prototype.setOpacity=function(H){this.opacity=H,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){var Y=H;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),$.prototype.restoreState.call(this,H),this.setSize()},F.prototype.scale=function(H,Y){$.prototype.scale.call(this,H,Y),this.setSize()},F.typeName="EllipseMarker",F.title="Ellipse marker",F.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',F}(ve),we=function($){function F(H,Y,se){return $.call(this,H,Y,se)||this}return Re(F,$),Object.defineProperty(F.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.tip1&&H!==this.tip2)},F.prototype.createTips=function(){this.tip1=_e.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_e.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.tip2)},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},F.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(_e.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.tip1.transform.baseVal.getItem(0);Y.setRotate(H,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Y,0);var se=this.tip2.transform.baseVal.getItem(0);se.setRotate(H+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(se,0)}},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=$.prototype.getState.call(this);return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){$.prototype.restoreState.call(this,H),this.createTips(),this.adjustVisual()},F.typeName="MeasurementMarker",F.title="Measurement marker",F.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',F}(he),Ne=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.strokePanel.colors=se.defaultColorSet,Z.fillColor="transparent",Z}return Re(F,$),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=$.prototype.getState.call(this);return H.typeName=F.typeName,H},F.typeName="EllipseFrameMarker",F.title="Ellipse frame marker",F.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',F}(G),de=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(F){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(F)||(this.undoStack.push(F),JSON.stringify(this.lastRedoStep)!==JSON.stringify(F)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(F){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=F)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var F=this.undoStack.pop();return F!==void 0&&this.redoStack.push(F),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),Se=function($){function F(H,Y,se){var Z=$.call(this,H,Y,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.curveX=0,Z.curveY=0,Z.manipulationStartCurveX=0,Z.manipulationStartCurveY=0,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.positionGrips=Z.positionGrips.bind(Z),Z.addControlGrips=Z.addControlGrips.bind(Z),Z.adjustVisual=Z.adjustVisual.bind(Z),Z.setupControlBox=Z.setupControlBox.bind(Z),Z.resize=Z.resize.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new He("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new De("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new qe("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Re(F,$),F.prototype.ownsTarget=function(H){return!(!$.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorCurve&&H!==this.visibleCurve&&!this.curveGrip.ownsTarget(H))},F.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},F.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorCurve=_e.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_e.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},F.prototype.pointerDown=function(H,Y){$.prototype.pointerDown.call(this,H,Y),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=H.x,this.curveY=H.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Y)&&(this.activeGrip=this.curveGrip,this._state="resize")},F.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_e.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},F.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=_e.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_e.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},F.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},F.prototype.positionGrips=function(){$.prototype.positionGrips.call(this);var H=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-H/2,this.curveY-H/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},F.prototype.manipulate=function(H){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+H.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+H.y-this.manipulationStartY),$.prototype.manipulate.call(this,H)},F.prototype.resize=function(H){this.activeGrip===this.curveGrip&&(this.curveX=H.x,this.curveY=H.y),$.prototype.resize.call(this,H),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},F.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},F.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},F.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual()},F.prototype.scale=function(H,Y){this.curveX=this.curveX*H,this.curveY=this.curveY*Y,$.prototype.scale.call(this,H,Y)},Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),F.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return H.typeName=F.typeName,H},F.prototype.restoreState=function(H){$.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.curveX=Y.curveX,this.curveY=Y.curveY,this.createVisual(),this.adjustVisual()},F.typeName="CurveMarker",F.title="Curve marker",F.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',F}(ct),Xe=function(){function $(F,H){H===void 0&&(H=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=F,this.cancelable=H}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),lt=function($){function F(H,Y,se){var Z=$.call(this,H,!1)||this;return Z.dataUrl=Y,Z.state=se,Z}return Re(F,$),F}(Xe),tt=function($){function F(H,Y,se){se===void 0&&(se=!1);var Z=$.call(this,H,se)||this;return Z.marker=Y,Z}return Re(F,$),F}(Xe),st=function(){function $(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return $.prototype.addEventListener=function(F,H){this[F].push(H)},$.prototype.removeEventListener=function(F,H){var Y=this[F].indexOf(H);Y>-1&&this[F].splice(Y,1)},$}(),mt=function(){function $(F){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new je,this._isOpen=!1,this.undoRedoManager=new de,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new st,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new Ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=F,this.targetRoot=document.body,this.width=F.clientWidth,this.height=F.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty($.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,xe,ye,We,Ne,G,q,Ce,we,J,he,Se]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,xe,ye,We,G,q,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,xe,ye,We,q]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(F){var H=this;this._availableMarkerTypes.splice(0),F.forEach(function(Y){if(typeof Y=="string"){var se=H.ALL_MARKER_TYPES.find(function(Z){return Z.typeName===Y});se!==void 0&&H._availableMarkerTypes.push(se)}else H._availableMarkerTypes.push(Y)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(F){this._zoomLevel=F,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),le.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var F=this;this.styles.styleSheetRoot===void 0&&pe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=pe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(H){return H(new Xe(F))})},$.prototype.render=function(){return Be(this,void 0,void 0,function(){var F;return Ke(this,function(H){switch(H.label){case 0:return this.setCurrentMarker(),(F=new Ee).naturalSize=this.renderAtNaturalSize,F.imageType=this.renderImageType,F.imageQuality=this.renderImageQuality,F.markersOnly=this.renderMarkersOnly,F.width=this.renderWidth,F.height=this.renderHeight,[4,F.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return H.sent(),[4,F.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,H.sent()]}})})},$.prototype.close=function(F){var H=this;if(F===void 0&&(F=!1),this.isOpen){var Y=!1;F||this.eventListeners.beforeclose.forEach(function(se){var Z=new Xe(H,!0);se(Z),Z.defaultPrevented&&(Y=!0)}),Y||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(se){return se(new Xe(H))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var F,H=[],Y=0;Y<arguments.length;Y++)H[Y]=arguments[Y];(F=this._availableMarkerTypes).push.apply(F,H)},$.prototype.addRenderEventListener=function(F){this.addEventListener("render",function(H){F(H.dataUrl,H.state)})},$.prototype.removeRenderEventListener=function(F){},$.prototype.addCloseEventListener=function(F){this.addEventListener("close",function(){F()})},$.prototype.removeCloseEventListener=function(F){},$.prototype.setupResizeObserver=function(){var F=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){F.resize(F.target.clientWidth,F.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return F.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupTargetResize=function(){var F=1*this.target.clientWidth/this.target.clientHeight,H=this.editorCanvas.clientWidth/F>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*F:this.editorCanvas.clientWidth,Y=H<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/F;this.resize(H,Y)},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.resize=function(F,H){this._isResizing=!0;var Y=F/this.imageWidth,se=H/this.imageHeight;this.imageWidth=Math.round(F),this.imageHeight=Math.round(H),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Y,se),this._isResizing=!1},$.prototype.scaleMarkers=function(F,H){var Y,se=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(F,H):(Y=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Z){Z!==se._currentMarker&&Z.scale(F,H)}),Y!==void 0&&this.setCurrentMarker(Y)},$.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},$.prototype.setTopLeft=function(){var F=this.editingTarget.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=F.left-H.left,this.top=F.top-H.top},$.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},$.prototype.addDefs=function(){for(var F,H=[],Y=0;Y<arguments.length;Y++)H[Y]=arguments[Y];this.defs=_e.createDefs(),this.addDefsToImage(),(F=this.defs).append.apply(F,H)},$.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},$.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},$.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},$.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},$.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},$.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},$.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},$.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var F=document.createElement("a");F.href="https://markerjs.com/",F.target="_blank",F.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',F.title="Powered by marker.js",F.style.display="grid",F.style.alignItems="center",F.style.justifyItems="center",F.style.padding="3px",F.style.width="20px",F.style.height="20px",this.logoUI.appendChild(F),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},$.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var F=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=F+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ze(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},$.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.removeMarker=function(F){this.markerImage.removeChild(F.container),this.markers.indexOf(F)>-1&&this.markers.splice(this.markers.indexOf(F),1),F.dispose()},$.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},$.prototype.toolbarButtonClicked=function(F,H){if(F==="marker"&&H!==void 0)this.createNewMarker(H);else if(F==="action")switch(H){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},$.prototype.deleteSelectedMarker=function(){var F=this;if(this._currentMarker!==void 0){var H=!1;if(this.eventListeners.markerbeforedelete.forEach(function(se){var Z=new tt(F,F._currentMarker,!0);se(Z),Z.defaultPrevented&&(H=!0)}),!H){var Y=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(se){return se(new tt(F,Y))})}}},$.prototype.clear=function(){var F=this,H=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Me){var rt=new tt(F,void 0,!0);Me(rt),rt.defaultPrevented&&(H=!0)}),!H)){this.setCurrentMarker();for(var Y=function(Me){var rt=se.markers[Me];se.setCurrentMarker(se.markers[Me]),se._currentMarker.dispose(),se.markerImage.removeChild(se._currentMarker.container),se.markers.splice(se.markers.indexOf(se._currentMarker),1),se.eventListeners.markerdelete.forEach(function(pt){return pt(new tt(F,rt))})},se=this,Z=this.markers.length-1;Z>=0;Z--)Y(Z);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var F;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(F=this._currentMarker.notes)!==null&&F!==void 0?F:"",this.overlayContainer.appendChild(this.notesArea))},$.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var F=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var H=this.getState(),Y=this.undoRedoManager.getLastUndoStep();if(!Y||Y.width===H.width&&Y.height===H.height){var se=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(H),se<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Z){return Z(new Xe(F))})}else this.undoRedoManager.replaceLastUndoStep(H),this.eventListeners.statechange.forEach(function(Z){return Z(new Xe(F))})}},$.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},$.prototype.undoStep=function(){var F=this,H=this.undoRedoManager.undo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Xe(F))}))},$.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},$.prototype.redoStep=function(){var F=this,H=this.undoRedoManager.redo();H!==void 0&&(this.restoreState(H),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Y){return Y(new Xe(F))}))},$.prototype.stepZoom=function(){var F=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=F<this.zoomSteps.length-1?this.zoomSteps[F+1]:this.zoomSteps[0]},$.prototype.panTo=function(F){this.contentDiv.scrollBy({left:this.prevPanPoint.x-F.x,top:this.prevPanPoint.y-F.y}),this.prevPanPoint=F},$.prototype.startRenderAndClose=function(){return Be(this,void 0,void 0,function(){var F,H,Y=this;return Ke(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return F=se.sent(),H=this.getState(),this.eventListeners.render.forEach(function(Z){return Z(new lt(Y,F,H))}),this.close(!0),[2]}})})},$.prototype.getState=function(F){F===!0&&this.setCurrentMarker();var H={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Y){return H.markers.push(Y.getState())}),H},$.prototype.restoreState=function(F){var H=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);F.markers.forEach(function(Y){var se=H._availableMarkerTypes.find(function(Me){return Me.typeName===Y.typeName});if(se!==void 0){var Z=H.addNewMarker(se);Z.restoreState(Y),H.markers.push(Z)}}),F.width&&F.height&&(F.width!==this.imageWidth||F.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/F.width,this.imageHeight/F.height),this.eventListeners.restorestate.forEach(function(Y){return Y(new Xe(H))})},$.prototype.addNewMarker=function(F){var H=_e.createGroup();return this.markerImage.appendChild(H),new F(H,this.overlayContainer,this.settings)},$.prototype.createNewMarker=function(F){var H,Y=this;(H=typeof F=="string"?this._availableMarkerTypes.find(function(se){return se.typeName===F}):F)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(H),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(H.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(se){return se(new tt(Y,Y._currentMarker))}))},$.prototype.markerCreated=function(F){var H=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(F),this.setCurrentMarker(F),F instanceof xe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(xe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Y){return Y(new tt(H,H._currentMarker))})},$.prototype.colorChanged=function(F){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=F,this.settings.defaultStrokeColor=F)},$.prototype.fillColorChanged=function(F){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=F)},$.prototype.markerStateChanged=function(F){var H=this;this.eventListeners.markerchange.forEach(function(Y){return Y(new tt(H,F))})},$.prototype.setCurrentMarker=function(F){var H=this;this._currentMarker!==F&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Y){return Y(new tt(H,H._currentMarker))})),this._currentMarker=F,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Y){return Y(new tt(H,H._currentMarker))}))},$.prototype.onPointerDown=function(F){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||F.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var H=this.markers.find(function(Y){return Y.ownsTarget(F.target)});H!==void 0?(this.setCurrentMarker(H),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(F.clientX,F.clientY),F.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:F.clientX,y:F.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(F.clientX,F.clientY))},$.prototype.onDblClick=function(F){if(this._isFocused||this.focus(),this.mode==="select"){var H=this.markers.find(function(Y){return Y.ownsTarget(F.target)});H!==void 0&&H!==this._currentMarker&&this.setCurrentMarker(H),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(F.clientX,F.clientY),F.target):this.setCurrentMarker()}},$.prototype.onPointerMove=function(F){this.touchPoints!==1&&F.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||F.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(F.clientX,F.clientY)):this.zoomLevel>1&&this.panTo({x:F.clientX,y:F.clientY}))},$.prototype.onPointerUp=function(F){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(F.clientX,F.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(F){this._currentMarker===void 0||this.notesArea!==void 0||F.key!=="Delete"&&F.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(F,H){var Y=this.markerImage.getBoundingClientRect();return{x:(F-Y.left)/this.zoomLevel,y:(H-Y.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var F=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=F+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},$.prototype.addLicenseKey=function(F){le.addKey(F)},$.prototype.addEventListener=function(F,H){this.eventListeners.addEventListener(F,H)},$.prototype.removeEventListener=function(F,H){this.eventListeners.removeEventListener(F,H)},$.prototype.renderState=function(F){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(F),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var F=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(H){return H(new Xe(F))}))},$.prototype.blur=function(){var F=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(H){return H(new Xe(F))}))},$.instanceCounter=0,$}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ct=function($,F){return(Ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var se in Y)Object.prototype.hasOwnProperty.call(Y,se)&&(H[se]=Y[se])})($,F)};function _t($,F){if(typeof F!="function"&&F!==null)throw new TypeError("Class extends value "+String(F)+" is not a constructor or null");function H(){this.constructor=$}Ct($,F),$.prototype=F===null?Object.create(F):(H.prototype=F.prototype,new H)}function ft($,F,H,Y){return new(H||(H=Promise))(function(se,Z){function Me(Et){try{pt(Y.next(Et))}catch(ot){Z(ot)}}function rt(Et){try{pt(Y.throw(Et))}catch(ot){Z(ot)}}function pt(Et){var ot;Et.done?se(Et.value):(ot=Et.value,ot instanceof H?ot:new H(function(Rt){Rt(ot)})).then(Me,rt)}pt((Y=Y.apply($,F||[])).next())})}function kt($,F){var H,Y,se,Z,Me={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:rt(0),throw:rt(1),return:rt(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function rt(pt){return function(Et){return function(ot){if(H)throw new TypeError("Generator is already executing.");for(;Me;)try{if(H=1,Y&&(se=2&ot[0]?Y.return:ot[0]?Y.throw||((se=Y.return)&&se.call(Y),0):Y.next)&&!(se=se.call(Y,ot[1])).done)return se;switch(Y=0,se&&(ot=[2&ot[0],se.value]),ot[0]){case 0:case 1:se=ot;break;case 4:return Me.label++,{value:ot[1],done:!1};case 5:Me.label++,Y=ot[1],ot=[0];continue;case 7:ot=Me.ops.pop(),Me.trys.pop();continue;default:if(!(se=Me.trys,(se=se.length>0&&se[se.length-1])||ot[0]!==6&&ot[0]!==2)){Me=0;continue}if(ot[0]===3&&(!se||ot[1]>se[0]&&ot[1]<se[3])){Me.label=ot[1];break}if(ot[0]===6&&Me.label<se[1]){Me.label=se[1],se=ot;break}if(se&&Me.label<se[2]){Me.label=se[2],Me.ops.push(ot);break}se[2]&&Me.ops.pop(),Me.trys.pop();continue}ot=F.call($,Me)}catch(Rt){ot=[6,Rt],Y=0}finally{H=se=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([pt,Et])}}}var Nt=function(){function $(){}return $.addKey=function(F){$.key=F},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),nt=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(F,H){for(var Y=0,se=H;Y<se.length;Y++){var Z=se[Y],Me=Z[0],rt=Z[1];F.setAttribute(Me,rt)}},$.createRect=function(F,H,Y){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",F.toString()),se.setAttribute("height",H.toString()),Y&&$.setAttributes(se,Y),se},$.createLine=function(F,H,Y,se,Z){var Me=document.createElementNS("http://www.w3.org/2000/svg","line");return Me.setAttribute("x1",F.toString()),Me.setAttribute("y1",H.toString()),Me.setAttribute("x2",Y.toString()),Me.setAttribute("y2",se.toString()),Z&&$.setAttributes(Me,Z),Me},$.createPolygon=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Y.setAttribute("points",F),H&&$.setAttributes(Y,H),Y},$.createCircle=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","circle");return Y.setAttribute("cx",(F/2).toString()),Y.setAttribute("cy",(F/2).toString()),Y.setAttribute("r",F.toString()),H&&$.setAttributes(Y,H),Y},$.createEllipse=function(F,H,Y){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(F/2).toString()),se.setAttribute("cy",(H/2).toString()),se.setAttribute("rx",(F/2).toString()),se.setAttribute("ry",(H/2).toString()),Y&&$.setAttributes(se,Y),se},$.createGroup=function(F){var H=document.createElementNS("http://www.w3.org/2000/svg","g");return F&&$.setAttributes(H,F),H},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(F,H,Y,se,Z,Me,rt){var pt=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(pt,[["id",F],["orient",H],["markerWidth",Y.toString()],["markerHeight",se.toString()],["refX",Z.toString()],["refY",Me.toString()]]),pt.appendChild(rt),pt},$.createText=function(F){var H=document.createElementNS("http://www.w3.org/2000/svg","text");return H.setAttribute("x","0"),H.setAttribute("y","0"),F&&$.setAttributes(H,F),H},$.createTSpan=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Y.textContent=F,H&&$.setAttributes(Y,H),Y},$.createImage=function(F){var H=document.createElementNS("http://www.w3.org/2000/svg","image");return F&&$.setAttributes(H,F),H},$.createPoint=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Y.x=F,Y.y=H,Y},$.createPath=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg","path");return Y.setAttribute("d",F),H&&$.setAttributes(Y,H),Y},$.createElement=function(F,H){var Y=document.createElementNS("http://www.w3.org/2000/svg",F);return H&&$.setAttributes(Y,H),Y},$.getHollowRectanglePath=function(F,H,Y,se,Z,Me,rt,pt){return"M"+F+","+H+"V"+(H+se)+"H"+(F+Y)+"V"+H+"H"+Z+"V"+Me+"H"+(Z+rt)+"V"+(Me+pt)+"H"+Z+"V"+H+"Z"},$}(),Tt=function(){function $(F){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+F+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(F){return this.styleSheet===void 0&&this.addStyleSheet(),F.name=""+this.classNamePrefix+F.localName,this.classes.push(F),this.styleSheet.sheet.insertRule("."+F.name+" {"+F.style+"}",this.styleSheet.sheet.cssRules.length),F},$.prototype.addRule=function(F){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(F),this.styleSheet.sheet.insertRule(F.selector+" {"+F.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var F;this.styleSheet=document.createElement("style"),((F=this.styleSheetRoot)!==null&&F!==void 0?F:document.head).appendChild(this.styleSheet),this.addRule(new It("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new It("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new It("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new wt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new wt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var F;this.styleSheet&&(((F=this.styleSheetRoot)!==null&&F!==void 0?F:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),It=function($,F){this.selector=$,this.style=F},wt=function($,F){this.localName=$,this.style=F},Ft=function(){function $(){this.blocks=[],this.display=""}return $.prototype.addButtonBlock=function(F){F.className=this.blockClassName,F.buttonClassName=this.buttonClassName,F.buttonColorsClassName=this.buttonColorsClassName,F.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(F)},$.prototype.addElementBlock=function(F){F.className===void 0&&(F.className=this.blockClassName),this.blocks.push(F)},$.prototype.getUI=function(){var F=document.createElement("div");return F.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,F.style.display=this.display,this.blocks.forEach(function(H){return F.appendChild(H.getUI())}),F},$}(),zt=function(){function $(){}return $.prototype.getUI=function(){var F=document.createElement("div");if(F.className=this.className,this.minWidth!==void 0&&(F.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":F.style.justifyContent="flex-start";break;case"center":F.style.justifyContent="center";break;case"end":F.style.justifyContent="flex-end"}return F.style.whiteSpace="nowrap",F},$}(),ui=function($){function F(){var H=$!==null&&$.apply(this,arguments)||this;return H.buttons=[],H}return _t(F,$),F.prototype.addButton=function(H){H.className=this.buttonClassName,H.colorsClassName=this.buttonColorsClassName,H.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(H)},F.prototype.getUI=function(){var H=$.prototype.getUI.call(this);return this.buttons.forEach(function(Y){return H.appendChild(Y.getUI())}),H},F}(zt),Pt=function(){function $(F,H){this._isActive=!1,this._isHidden=!1,this._icon=F,this.title=H,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty($.prototype,"icon",{get:function(){return this._icon},set:function(F){this._icon=F,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isActive",{get:function(){return this._isActive},set:function(F){this._isActive=F,this.adjustClassName()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){var F=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return F.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},$.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},$.prototype.hide=function(){this._isHidden=!0},$}(),xt=function($){function F(){var H=$!==null&&$.apply(this,arguments)||this;return H.elements=[],H}return _t(F,$),F.prototype.addElement=function(H){this.elements.push(H)},F.prototype.getUI=function(){var H=$.prototype.getUI.call(this);return this.elements.forEach(function(Y){return H.appendChild(Y)}),H},F}(zt),zi=function(){function $(F,H){this.horizontal=F,this.vertical=H}return Object.defineProperty($.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),$.prototype.getVerticalLength=function(F){return F/this.ratio},$.prototype.getHorizontalLength=function(F){return F*this.ratio},$}(),tr=function(){function $(){}return $.getIcon=function(F,H){if(F>0&&H>0){var Y=new zi(F,H),se=Y.ratio>=1?20:Y.getHorizontalLength(20),Z=Y.ratio<1?20:Y.getVerticalLength(20),Me=document.createElementNS("http://www.w3.org/2000/svg","svg");Me.setAttribute("xmlns","http://www.w3.org/2000/svg"),Me.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Me);var rt=nt.createDefs();Me.appendChild(rt);var pt=nt.createElement("clipPath",[["id","text-bg-clip"]]);rt.appendChild(pt);var Et=nt.createPath(nt.getHollowRectanglePath((24-se)/2,(24-Z)/2,se,Z,(24-se)/2+2,(24-Z)/2+2,se-4,Z-4));Me.appendChild(Et);var ot=nt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ot.appendChild(nt.createTSpan(F+":"+H)),Me.appendChild(ot);var Rt=ot.getBBox();nt.setAttributes(ot,[["x",((24-Rt.width)/2).toString()],["y",((24-Rt.height)/2-Rt.y).toString()]]);var Gt=nt.createPath(nt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Rt.width))/2,(24-Math.ceil(Rt.height))/2,Math.ceil(Rt.width),Math.ceil(Rt.height)));return pt.appendChild(Gt),nt.setAttributes(Et,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Me),Me.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},$}(),xi=function($){function F(H,Y,se){var Z=$.call(this,H,Y)||this;return Z.isDropdownOpen=!1,Z.onClick=Z.dropdownButtonClicked,Z.dropdownButtons=se,Z}return _t(F,$),F.prototype.setupDropdown=function(){var H=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(Y){Y.className=H.className,Y.colorsClassName=H.colorsClassName,H.dropdownBlock.appendChild(Y.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},F.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},F.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},F.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},F.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},F.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},F}(Pt),Ht=function(){function $(F,H){this.GRIP_SIZE=10,this.color=F,this.fillColor=H,this.visual=nt.createGroup(),this.visual.appendChild(nt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(nt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(F){return F===this.visual||F===this.visual.childNodes[0]||F===this.visual.childNodes[1]},$.prototype.setCenter=function(F,H){this.visual.childNodes.forEach(function(Y){return nt.setAttributes(Y,[["cx",F.toString()],["cy",H.toString()]])})},$}(),Ki=function(){function $(F,H,Y,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=F,this.canvasHeight=H,this.margin=Y,this.container=se,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty($.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(F){this._aspectRatio=F,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(F){this._isGridVisible=F,this.gridContainer&&nt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(F){this._zoomFactor=F,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),$.prototype.open=function(){var F=this;this.cropShadeElement=nt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=nt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var H=0;H<this.numberOfGridLines;H++)this.horizontalGridLines.push(nt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(nt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Y){return F.gridContainer.appendChild(Y)}),this.verticalGridLines.forEach(function(Y){return F.gridContainer.appendChild(Y)}),this.cropRectElement=nt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ht(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},$.prototype.setCropRectangle=function(F){this.cropRect=F;var H=Object.assign({},this.cropRect);this.zoomFactor!==1&&(H.width=this.cropRect.width*this.zoomFactor,H.height=this.cropRect.height*this.zoomFactor,H.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-H.width/2,H.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-H.height/2),nt.setAttributes(this.cropRectElement,[["x",H.x.toString()],["y",H.y.toString()],["width",H.width.toString()],["height",H.height.toString()]]);var Y=H.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Z,Me){var rt=H.y+Y*(Me+1);nt.setAttributes(Z,[["x1",""+H.x],["y1",""+rt],["x2",""+(H.x+H.width)],["y2",""+rt]])});var se=H.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Z,Me){var rt=H.x+se*(Me+1);nt.setAttributes(Z,[["x1",""+rt],["y1",""+H.y],["x2",""+rt],["y2",""+(H.y+H.height)]])}),nt.setAttributes(this.cropShadeElement,[["d",nt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,H.x,H.y,H.width,H.height)]]),this.topLeftGrip.setCenter(H.x,H.y),this.topRightGrip.setCenter(H.x+H.width,H.y),this.bottomLeftGrip.setCenter(H.x,H.y+H.height),this.bottomRightGrip.setCenter(H.x+H.width,H.y+H.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},$.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},$.prototype.clientToLocalCoordinates=function(F,H){var Y=this.container.getBoundingClientRect();return{x:F-Y.left+this.margin,y:H-Y.top+this.margin}},$.prototype.onPointerDown=function(F){this.container.setPointerCapture(F.pointerId),this.previousPoint=this.clientToLocalCoordinates(F.clientX,F.clientY),this.cropRectElement===F.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(F.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(F.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(F.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(F.target)&&(this.activeGrip=this.bottomRightGrip)},$.prototype.onPointerMove=function(F){if(this.isMoving)this.move(this.clientToLocalCoordinates(F.clientX,F.clientY));else if(this.activeGrip){var H=this.clientToLocalCoordinates(F.clientX,F.clientY);this.resize(H)}F.preventDefault()},$.prototype.onPointerUp=function(F){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(F.pointerId)},$.prototype.move=function(F){var H=F.x-this.previousPoint.x,Y=F.y-this.previousPoint.y;this.zoomFactor!==1&&(H=-H/this.zoomFactor,Y=-Y/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+H),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+Y),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=F},$.prototype.resize=function(F){var H=Object.assign({},this.cropRect),Y=F.x-this.previousPoint.x,se=F.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:H.x+Y<this.margin&&(Y=this.margin-H.x),H.x+=Y,H.width=this.cropRect.x+this.cropRect.width-H.x;break;case this.bottomRightGrip:case this.topRightGrip:H.width+Y>this.canvasWidth*this.zoomFactor&&(Y=this.canvasWidth*this.zoomFactor-H.width),H.width+=Y}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(H.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(Y),H.height=this.aspectRatio.getVerticalLength(H.width)):(H.y+=se,H.height=this.cropRect.y+this.cropRect.height-H.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?H.height=this.aspectRatio.getVerticalLength(H.width):H.height+=se}H.width<10&&(H.x=this.cropRect.x,H.width=10),H.height<10&&(H.y=this.cropRect.y,H.height=10),this.previousPoint=F,H.x>=this.margin&&H.y>=this.margin&&H.x-this.margin+H.width<=this.canvasWidth&&H.y-this.margin+H.height<=this.canvasHeight&&(this.cropRect=H,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},$.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var F=this.cropRect.x+this.cropRect.width/2,H=this.cropRect.y+this.cropRect.height/2,Y=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);Y/this.canvasWidth<se/this.canvasHeight?this.cropRect.width=Y:this.cropRect.height=se,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=F-this.cropRect.width/2,this.cropRect.y=H-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},$.prototype.getRescaledRect=function(F,H,Y,se,Z,Me){var rt=Y/F,pt=se/H;return{x:(Z.x-Me)*rt+Me,y:(Z.y-Me)*pt+Me,width:Z.width*rt,height:Z.height*pt}},$.prototype.scaleCanvas=function(F,H){var Y=this.getRescaledRect(this.canvasWidth,this.canvasHeight,F,H,this.cropRect,this.margin);this.canvasWidth=F,this.canvasHeight=H,this.onCropChange&&this.onCropChange(Y),this.setCropRectangle(Y)},$}(),Yi=function(){function $(F){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=F,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty($.prototype,"angle",{get:function(){return this._angle},set:function(F){this._angle=F,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},$.prototype.onPointerDown=function(F){this.controlContainer.setPointerCapture(F.pointerId),this.isDragging=!0,this.previousPoint={x:F.clientX,y:F.clientY}},$.prototype.onPointerMove=function(F){this.isDragging&&(this.onAngleChange&&this.onAngleChange((F.clientX-this.previousPoint.x)/5),this.previousPoint.x=F.clientX)},$.prototype.onPointerUp=function(F){this.isDragging&&this.onAngleChange&&this.onAngleChange((F.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(F.pointerId)},$.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var F=this.angleLabelText.getBBox();nt.setAttributes(this.angleLabelElement,[["x",((this.width-F.width)/2).toString()],["y",(this.height/2).toString()]])}},$.prototype.positionScaleShape=function(){if(this.scaleShape){var F=this.scaleShape.transform.baseVal.getItem(0);F.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(F,0)}},$.prototype.getVisual=function(){var F=document.createElementNS("http://www.w3.org/2000/svg","svg");F.setAttribute("xmlns","http://www.w3.org/2000/svg"),F.setAttribute("width",this.width+"px"),F.setAttribute("height",this.height+"px"),F.setAttribute("viewBox","0 0 "+this.width+" "+this.height),F.style.flexShrink="0",document.body.appendChild(F);for(var H="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Y=1;Y<=this.width/5+10;Y++){var se=Y%5==0?this.height/3:this.height/6;H+="h4v"+-se+"h1v"+se}H+="v1H0Z",this.scaleShape=nt.createPath(H);var Z=nt.createTransform();this.scaleShape.transform.baseVal.appendItem(Z),F.appendChild(this.scaleShape),this.angleLabelElement=nt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=nt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Me=nt.createTSpan("");return Me.innerHTML="&deg;",this.angleLabelElement.appendChild(Me),F.appendChild(this.angleLabelElement),document.body.removeChild(F),F},$}(),fr=function(){function $(){this.naturalSize=!1,this.imageType="image/png"}return $.prototype.rasterize=function(F,H,Y,se,Z,Me,rt){var pt=this;return new Promise(function(Et){var ot=document.createElement("canvas");ot.width=F.width.baseVal.value-2*se,ot.height=F.height.baseVal.value-2*se;var Rt=1,Gt=1;pt.naturalSize===!0?(Rt=H.naturalWidth/(F.width.baseVal.value-2*se)/Me,Gt=H.naturalHeight/(F.height.baseVal.value-2*se)/rt,ot.width=H.naturalWidth/Me,ot.height=H.naturalHeight/rt):pt.width!==void 0&&pt.height!==void 0&&(Rt=pt.width/Y.width,Gt=pt.height/Y.height,ot.width*=Rt,ot.height*=Gt);var ei=ot.getContext("2d");ei.translate(ot.width/2,ot.height/2),ei.rotate(Z*Math.PI/180),ei.scale(Me,rt),ei.translate(-ot.width/2,-ot.height/2),ei.drawImage(H,0,0,ot.width,ot.height);var Fi=document.createElement("canvas");Fi.width=Y.width*Rt,Fi.height=Y.height*Gt,Fi.getContext("2d").putImageData(ei.getImageData((Y.x-se)*Rt,(Y.y-se)*Gt,Y.width*Rt,Y.height*Gt),0,0),Et(Fi.toDataURL(pt.imageType,pt.imageQuality))})},$}(),ht=function(){function $(F){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=$.instanceCounter++,this.styles=new Tt(this.instanceNo),this.target=F,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(F){this._zoomToCropEnabled=F,F?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(F){this._isGridVisible=F,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"gridLines",{get:function(){return this._gridLines},set:function(F){this._gridLines=F,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(F){this._rotationAngle=F,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"aspectRatio",{get:function(){var F;return(F=this._aspectRatio)!==null&&F!==void 0?F:this.aspectRatios[0]},set:function(F){this._aspectRatio=F},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},$.prototype.show=function(){this.showUI(),this.open()},$.prototype.close=function(F){F===void 0&&(F=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),F||this.closeEventListeners.forEach(function(H){return H()}),this._isOpen=!1)},$.prototype.addRenderEventListener=function(F){this.renderEventListeners.push(F)},$.prototype.removeRenderEventListener=function(F){this.renderEventListeners.indexOf(F)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(F),1)},$.prototype.addCloseEventListener=function(F){this.closeEventListeners.push(F)},$.prototype.removeCloseEventListener=function(F){this.closeEventListeners.indexOf(F)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(F),1)},$.prototype.setupResizeObserver=function(){var F=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){F.resize(F.target.clientWidth,F.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var F=1*this.target.clientWidth/this.target.clientHeight,H=this.contentDiv.clientWidth/F>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*F:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Y=H+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/F;this.resize(H,Y)}},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",nt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},$.prototype.resize=function(F,H){this.imageWidth=Math.round(F),this.imageHeight=Math.round(H),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},$.prototype.setEditingTarget=function(){var F=document.createElement("canvas");F.width=this.target.naturalWidth,F.height=this.target.naturalHeight,F.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var H=F.toDataURL();nt.setAttributes(this.editingTarget,[["href",H]]),this.setEditingTargetSize()},$.prototype.setTopLeft=function(){var F=this.target.getBoundingClientRect(),H=this.editorCanvas.getBoundingClientRect();this.left=F.left-H.left-this.CANVAS_MARGIN,this.top=F.top-H.top-this.CANVAS_MARGIN},$.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=nt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=nt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=nt.createGroup(),this.editingTargetRotationScaleContainer=nt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var F=nt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(F);var H=nt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(H),this.editingTargetContainer=nt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},$.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},$.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=nt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ki(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},$.prototype.zoomToCrop=function(){if(this.cropRect){var F=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,H=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=F+"px "+H+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-F+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-H+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},$.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},$.prototype.cropRectChanged=function(F){this.cropRect=F,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},$.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},$.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var F=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,H=this.target.offsetTop>F+this.CANVAS_MARGIN?this.target.offsetTop-(F+this.CANVAS_MARGIN):0;this.coverDiv.style.top=H+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},$.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},$.prototype.addTopToolbar=function(){var F=this;this.topToolbar=new Ft,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new ui;H.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(H);var Y=[];this.aspectRatios.forEach(function(Gt){var ei=new Pt(tr.getIcon(Gt.horizontal,Gt.vertical),Gt.horizontal===0&&Gt.vertical===0?"FREE":Gt.horizontal+":"+Gt.vertical);ei.onClick=function(){return F.ratioButtonClicked(Gt)},Y.push(ei)}),this.aspectRatioButton=new xi(tr.getIcon(0,0),"Aspect ratio",Y),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,H.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new Pt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");se.isActive=this.isGridVisible,se.onClick=function(){F.isGridVisible=!F.isGridVisible,se.isActive=F.isGridVisible},H.addButton(se);var Z=new Pt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Z.isActive=this.zoomToCropEnabled,Z.onClick=function(){F.zoomToCropEnabled=!F.zoomToCropEnabled,Z.isActive=F.zoomToCropEnabled},H.addButton(Z),!Nt.isLicensed){var Me=new xt;this.topToolbar.addElementBlock(Me);var rt=document.createElement("div");rt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var pt=document.createElement("a");pt.style.color="currentColor",pt.href="https://markerjs.com/products/cropro",pt.target="_blank",pt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',rt.appendChild(pt),Me.addElement(rt)}var Et=new ui;Et.minWidth=3*this.toolbarHeight+"px",Et.contentAlign="end",this.topToolbar.addButtonBlock(Et);var ot=new Pt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ot.onClick=this.startRenderAndClose,Et.addButton(ot),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ot.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Rt=new Pt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Rt.onClick=this.close,Et.addButton(Rt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Rt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},$.prototype.addBottomToolbar=function(){var F=this;this.bottomToolbar=new Ft,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new ui;H.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(H);var Y=new Pt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");Y.onClick=this.rotateLeftButtonClicked,H.addButton(Y);var se=new Pt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");se.onClick=this.rotateRightButtonClicked,H.addButton(se);var Z=new xt;Z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Z),this.straightener=new Yi("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Et){F.rotateBy(Et),F.straightener.angle=F.rotationAngle},Z.addElement(this.straightener.getUI());var Me=new ui;Me.minWidth=2*this.toolbarHeight+"px",Me.contentAlign="end",this.bottomToolbar.addButtonBlock(Me);var rt=new Pt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");rt.onClick=this.flipHorizontallyButtonClicked,Me.addButton(rt);var pt=new Pt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");pt.onClick=this.flipVerticallyButtonClicked,Me.addButton(pt)},$.prototype.ratioButtonClicked=function(F){this.aspectRatio=F,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},$.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=tr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},$.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new zi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},$.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},$.prototype.restoreState=function(F){if(F){var H=this.cropLayer.getRescaledRect(F.width,F.height,this.imageWidth,this.imageHeight,F.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(H),this.cropRectChanged(H),this.flippedHorizontally=F.flippedHorizontally,this.flippedVertically=F.flippedVertically,this.applyFlip(),this.rotationAngle=F.rotationAngle,this.applyRotation()}},$.prototype.clientToLocalCoordinates=function(F,H){var Y=this.cropImage.getBoundingClientRect();return{x:F-Y.left,y:H-Y.top}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var F=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=F+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},$.prototype.rotateLeftButtonClicked=function(){var F=this.rotationAngle-90;this.rotationAngle%90!=0&&(F+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(F)},$.prototype.rotateRightButtonClicked=function(){var F=this.rotationAngle+90;this.rotationAngle%90!=0&&(F-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(F)},$.prototype.rotateTo=function(F){F=(F=F>180?F-360:F)<=-180?F+360:F,this.rotationAngle=F,this.applyRotation()},$.prototype.rotateBy=function(F){this.rotateTo((this.rotationAngle+F)%360)},$.prototype.applyRotation=function(){var F=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var H=this.editingTargetRotationContainer.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(H,0);var Y=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Y.width,this.imageHeight/Y.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=F},$.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},$.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},$.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},$.prototype.startRenderAndClose=function(){return ft(this,void 0,void 0,function(){var F,H;return kt(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return F=Y.sent(),H=this.getState(),this.renderEventListeners.forEach(function(se){return se(F,H)}),this.close(!0),[2]}})})},$.prototype.render=function(){return ft(this,void 0,void 0,function(){var F;return kt(this,function(H){switch(H.label){case 0:return(F=new fr).naturalSize=this.renderAtNaturalSize,F.imageType=this.renderImageType,F.imageQuality=this.renderImageQuality,F.width=this.renderWidth,F.height=this.renderHeight,this.unzoomFromCrop(),nt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,F.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return H.sent(),[4,F.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,H.sent()]}})})},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new wt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new wt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new wt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var F=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new wt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*F)+`px;
height: `+(this.toolbarHeight-2*F)+`px;
padding: `+F+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new wt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new wt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new It("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new It("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new wt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new wt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new wt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new wt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*F)+`px;
padding: `+F+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new wt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},$.instanceCounter=0,$}(),Dt=oe("8hTe"),pr=oe.n(Dt),mr=/<pre[^>]*>/g;function gr($){var F=document.createElement("div");return F.innerHTML=$,F.childNodes.length===0?"":F.childNodes[0].nodeValue}var vr=fe.a=function($){var F=$.value,H=F===void 0?"":F,Y=$.edit,se=Y===void 0?!1:Y,Z=$.className,Me=$.showTextOnly,rt=$.showLines,pt=$.replaces,Et=$.zoomImg,ot=$.hasMask,Rt=$.style,Gt=Rt===void 0?{}:Rt,ei=$.stylesPrev,Fi=ei===void 0?{}:ei,Ei=String(H),wi=Object(h.useRef)(),Qi=Object(h.useRef)(),Or=Object(h.useState)(""),di=Object(E.a)(Or,2),Wi=di[0],or=di[1],lr=Object(h.useState)("office"),Ui=Object(E.a)(lr,2),Ir=Ui[0],_r=Ui[1],Xr=function(){var Vt=new ht(Qi.current);Vt.displayMode="popup",Vt.addRenderEventListener(function(){var _i=Object(f.a)(g.a.mark(function Kt(si){var qt;return g.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return wi.current.style.display="none",fi.next=3,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si}});case 3:qt=fi.sent,qt!=null&&qt.id&&pt(Qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(qt==null?void 0:qt.id,"?type=").concat(qt.content_type));case 5:case"end":return fi.stop()}},Kt)}));return function(Kt){return _i.apply(this,arguments)}}()),Vt.show()},zr=function(){var Vt=new mt(Qi.current);Vt.settings.displayMode="popup",Vt.addEventListener("render",function(){var _i=Object(f.a)(g.a.mark(function Kt(si){var qt;return g.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:if(wi.current.style.display="none",!Qi.current){fi.next=6;break}return fi.next=4,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si.dataUrl}});case 4:qt=fi.sent,qt!=null&&qt.id&&pt(Qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(qt==null?void 0:qt.id,"?type=").concat(qt.content_type));case 6:case"end":return fi.stop()}},Kt)}));return function(Kt){return _i.apply(this,arguments)}}()),Vt.show(),window.markerArea=Vt},qi=Object(h.useMemo)(function(){wi.current&&(wi.current.style.zIndex=-1);try{var ni=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Vt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_i=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ei=Ei.replace(ni,"("+te.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+te.a.API_SERVER+"/api/attachments/").replace(_i,'"'+te.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(ir){}var Kt=X(Ei),si=D();if(Ei.match(/\[TOC\]/)&&(Kt=Kt.replace("<p>[TOC]</p>",C()),w()),Kt=Kt.replace(/(__special_katext_id_\d+__)/g,function(ir,fi){var Ai=si[fi],Gr=Ai.type,xr=Ai.expression;return Object(ce.renderToString)(gr(xr)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),Kt=Kt.replace(/▁/g,"\u2581\u2581\u2581"),O(),Me){var qt=document.createElement("div");return qt.innerHTML=Kt,qt.innerText}return setTimeout(function(){return cn()},500),Kt},[Ei]),Gi=Object(h.useRef)();m.WebkitLineClamp=rt,rt&&(Gt=Object(M.a)(Object(M.a)({},Gt),m));function yr(ni){var Vt=ni.target;if(Vt.tagName.toUpperCase()==="IMG"){if(Et){var _i=Vt.getAttribute("src");or(_i),_r("image")}}else if(Vt.tagName.toUpperCase()==="A"){var Kt=Vt.getAttribute("href");if(Kt.indexOf("office")>-1)ni.preventDefault(),or(Kt),_r("office");else if(Kt.indexOf("application/pdf")>-1)ni.preventDefault(),or(Kt),_r("pdf");else if(Kt.indexOf("text/html")>-1)ni.preventDefault(),or(Kt),_r("html");else if(Kt.startsWith("#")){ni.preventDefault();var si=document.getElementById(Kt.replace("#",""));si&&si.scrollIntoView(!0)}}}var cn=function(){var Vt,_i=(Vt=Gi.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");_i==null||_i.forEach(function(Kt){if(Kt.oncontextmenu=function(){return!1},Kt.src.indexOf(".m3u8")>-1&&!Kt.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var si=new z.a;si.loadSource(Kt.src),si.attachMedia(Kt)}}})};Object(h.useEffect)(function(){if(Gi.current&&qi&&(qi.match(mr)&&window.PR.prettyPrint()),Gi.current)return Gi.current.addEventListener("click",yr),function(){Gi.current.removeEventListener("click",yr),O(),w()}},[qi,Gi.current,yr]);var br=function(Vt){if(!se)return;Vt.target.nodeName==="IMG"?(wi.current.style.zIndex=1,wi.current.style.display="flex",wi.current.style.width=Vt.target.clientWidth+"px",wi.current.style.height=Vt.target.clientHeight+"px",wi.current.style.top=Vt.target.offsetTop+"px",wi.current.style.left=Vt.target.offsetLeft+"px",Qi.current.src=Vt.target.getAttribute("src")):wi.current.style.display="none"};return o.a.createElement("div",{style:{position:"relative"}},o.a.createElement("div",{ref:Gi,style:Object(M.a)({},Gt),className:"".concat(Z||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:br,dangerouslySetInnerHTML:{__html:qi}}),o.a.createElement("div",{ref:wi,className:pr.a.button},o.a.createElement(L.a,null,o.a.createElement(k.a,{onClick:function(){return Xr()}},"\u88C1\u526A"),o.a.createElement(k.a,{onClick:function(){return zr()}},"\u7F16\u8F91"))),o.a.createElement("img",{ref:Qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),o.a.createElement(be.a,{close:!0,data:Wi,type:Wi!=null&&Wi.length?Ir:"",style:Object(M.a)({},Fi),onClose:function(){return or("")}}))}},"9VGf":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return I});var V=oe("q1tI"),L=oe.n(V);function I(k,M){var f=Object(V.useRef)();Object(V.useEffect)(function(){f.current=k}),Object(V.useEffect)(function(){function E(){f.current()}if(M!==null){var x=setInterval(E,M);return function(){return clearInterval(x)}}},[M])}},BU3w:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return f});var V=oe("MNnm"),L="rc-util-key";function I(E){if(E.attachTo)return E.attachTo;var x=document.querySelector("head");return x||document.body}function k(E){var x,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(V.a)())return null;var h=document.createElement("style");if((x=g.csp)===null||x===void 0?void 0:x.nonce){var o;h.nonce=(o=g.csp)===null||o===void 0?void 0:o.nonce}h.innerHTML=E;var u=I(g),r=u.firstChild;return g.prepend&&u.prepend?u.prepend(h):g.prepend&&r?u.insertBefore(h,r):u.appendChild(h),h}var M=new Map;function f(E,x){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h=I(g);if(!M.has(h)){var o=k("",g),u=o.parentNode;M.set(h,u),u.removeChild(o)}var r=Array.from(M.get(h).children).find(function(l){return l.tagName==="STYLE"&&l[L]===x});if(r){var n,t;if(((n=g.csp)===null||n===void 0?void 0:n.nonce)&&r.nonce!==((t=g.csp)===null||t===void 0?void 0:t.nonce)){var i;r.nonce=(i=g.csp)===null||i===void 0?void 0:i.nonce}return r.innerHTML!==E&&(r.innerHTML=E),r}var s=k(E,g);return s[L]=x,s}},Bd2K:function(at,fe,oe){(function(V){V(oe("VrN/"),oe("osHv"))})(function(V){V.defineOption("autoCloseTags",!1,function(g,h,o){if(o!=V.Init&&o&&g.removeKeyMap("autoCloseTags"),!h)return;var u={name:"autoCloseTags"};(typeof h!="object"||h.whenClosing!==!1)&&(u["'/'"]=function(r){return f(r)}),(typeof h!="object"||h.whenOpening!==!1)&&(u["'>'"]=function(r){return k(r)}),g.addKeyMap(u)});var L=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["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 k(g){if(g.getOption("disableInput"))return V.Pass;for(var h=g.listSelections(),o=[],u=g.getOption("autoCloseTags"),r=0;r<h.length;r++){if(!h[r].empty())return V.Pass;var n=h[r].head,t=g.getTokenAt(n),i=V.innerMode(g.getMode(),t.state),s=i.state,l=i.mode.xmlCurrentTag&&i.mode.xmlCurrentTag(s),c=l&&l.name;if(!c)return V.Pass;var d=i.mode.configuration=="html",w=typeof u=="object"&&u.dontCloseTags||d&&L,m=typeof u=="object"&&u.indentTags||d&&I;t.end>n.ch&&(c=c.slice(0,c.length-t.end+n.ch));var S=c.toLowerCase();if(!c||t.type=="string"&&(t.end!=n.ch||!/[\"\']/.test(t.string.charAt(t.string.length-1))||t.string.length==1)||t.type=="tag"&&l.close||t.string.indexOf("/")==n.ch-t.start-1||w&&E(w,S)>-1||x(g,i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(s)||[],c,n,!0))return V.Pass;var C=typeof u=="object"&&u.emptyTags;if(C&&E(C,c)>-1){o[r]={text:"/>",newPos:V.Pos(n.line,n.ch+2)};continue}var v=m&&E(m,S)>-1;o[r]={indent:v,text:">"+(v?`
`:"")+"</"+c+">",newPos:v?V.Pos(n.line+1,0):V.Pos(n.line,n.ch+1)}}for(var y=typeof u=="object"&&u.dontIndentOnAutoClose,r=h.length-1;r>=0;r--){var T=o[r];g.replaceRange(T.text,h[r].head,h[r].anchor,"+insert");var A=g.listSelections().slice(0);A[r]={head:T.newPos,anchor:T.newPos},g.setSelections(A),!y&&T.indent&&(g.indentLine(T.newPos.line,null,!0),g.indentLine(T.newPos.line+1,null,!0))}}function M(g,h){for(var o=g.listSelections(),u=[],r=h?"/":"</",n=g.getOption("autoCloseTags"),t=typeof n=="object"&&n.dontIndentOnSlash,i=0;i<o.length;i++){if(!o[i].empty())return V.Pass;var s=o[i].head,l=g.getTokenAt(s),c=V.innerMode(g.getMode(),l.state),d=c.state;if(h&&(l.type=="string"||l.string.charAt(0)!="<"||l.start!=s.ch-1))return V.Pass;var w,m=c.mode.name!="xml"&&g.getMode().name=="htmlmixed";if(m&&c.mode.name=="javascript")w=r+"script";else if(m&&c.mode.name=="css")w=r+"style";else{var S=c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(d);if(!S||S.length&&x(g,S,S[S.length-1],s))return V.Pass;w=r+S[S.length-1]}g.getLine(s.line).charAt(l.end)!=">"&&(w+=">"),u[i]=w}if(g.replaceSelections(u),o=g.listSelections(),!t)for(var i=0;i<o.length;i++)(i==o.length-1||o[i].head.line<o[i+1].head.line)&&g.indentLine(o[i].head.line)}function f(g){return g.getOption("disableInput")?V.Pass:M(g,!0)}V.commands.closeTag=function(g){return M(g)};function E(g,h){if(g.indexOf)return g.indexOf(h);for(var o=0,u=g.length;o<u;++o)if(g[o]==h)return o;return-1}function x(g,h,o,u,r){if(!V.scanForClosingTag)return!1;var n=Math.min(g.lastLine()+1,u.line+500),t=V.scanForClosingTag(g,u,null,n);if(!t||t.tag!=o)return!1;for(var i=r?1:0,s=h.length-1;s>=0&&h[s]==o;s--)++i;u=t.to;for(var s=1;s<i;s++){var l=V.scanForClosingTag(g,u,null,n);if(!l||l.tag!=o)return!1;u=l.to}return!0}})},BjJ7:function(at,fe,oe){"use strict";oe.d(fe,"d",function(){return L}),oe.d(fe,"c",function(){return I}),oe.d(fe,"e",function(){return k}),oe.d(fe,"b",function(){return M}),oe.d(fe,"a",function(){return E});var V=oe("m3rI");function L(x){var g=!0;if(x.length>0){for(var h=0;h<x.length;h++)if(x[h].compile_success==0||!x[h].compile_success){g=!1;break}}else g=!1;return g}function I(x){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",h=[],o=0;o<x.length;o++){var u=x[o],r=g?"".concat(g,"/").concat(u.name):"".concat(u.name);h.push({title:u.name,isLeaf:!(u.type==="tree"),key:r})}return h}function k(x,g,h){for(var o=0;o<x.length;o++){var u=x[o];if(u.key===g){u.children=h;break}u.children&&k(u.children,g,h)}return x}function M(x,g,h){var o;return function(){var u=this,r=arguments,n=function(){o=null,h||x.apply(u,r)},t=h&&!o;clearTimeout(o),o=setTimeout(n,g),t&&x.apply(u,r)}}var f=!0,E=V.a.API_SERVER},"C+DQ":function(at,fe,oe){},DlQD:function(at,fe,oe){(function(V,L){at.exports=L()})(this,function(){"use strict";function V(xe,ge){for(var ye=0;ye<ge.length;ye++){var J=ge[ye];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(xe,J.key,J)}}function L(xe,ge,ye){return ge&&V(xe.prototype,ge),ye&&V(xe,ye),xe}function I(xe,ge){if(!xe)return;if(typeof xe=="string")return k(xe,ge);var ye=Object.prototype.toString.call(xe).slice(8,-1);if(ye==="Object"&&xe.constructor&&(ye=xe.constructor.name),ye==="Map"||ye==="Set")return Array.from(xe);if(ye==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ye))return k(xe,ge)}function k(xe,ge){(ge==null||ge>xe.length)&&(ge=xe.length);for(var ye=0,J=new Array(ge);ye<ge;ye++)J[ye]=xe[ye];return J}function M(xe,ge){var ye;if(typeof Symbol=="undefined"||xe[Symbol.iterator]==null){if(Array.isArray(xe)||(ye=I(xe))||ge&&xe&&typeof xe.length=="number"){ye&&(xe=ye);var J=0;return function(){return J>=xe.length?{done:!0}:{done:!1,value:xe[J++]}}}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 ye=xe[Symbol.iterator](),ye.next.bind(ye)}function f(xe,ge){return ge={exports:{}},xe(ge,ge.exports),ge.exports}var E=f(function(xe){function ge(){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 ye(J){xe.exports.defaults=J}xe.exports={defaults:ge(),getDefaults:ge,changeDefaults:ye}}),x=E.defaults,g=E.getDefaults,h=E.changeDefaults,o=/[&<>"']/,u=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,n=/[<>"']|&(?!#?\w+;)/g,t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},i=function(ge){return t[ge]};function s(xe,ge){if(ge){if(o.test(xe))return xe.replace(u,i)}else if(r.test(xe))return xe.replace(n,i);return xe}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(xe){return xe.replace(l,function(ge,ye){return ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""})}var d=/(^|[^\[])\^/g;function w(xe,ge){xe=xe.source||xe,ge=ge||"";var ye={replace:function(ne,q){return q=q.source||q,q=q.replace(d,"$1"),xe=xe.replace(ne,q),ye},getRegex:function(){return new RegExp(xe,ge)}};return ye}var m=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(xe,ge,ye){if(xe){var J;try{J=decodeURIComponent(c(ye)).replace(m,"").toLowerCase()}catch(ne){return null}if(J.indexOf("javascript:")===0||J.indexOf("vbscript:")===0||J.indexOf("data:")===0)return null}ge&&!S.test(ye)&&(ye=p(ge,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(ne){return null}return ye}var v={},y=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,A=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(xe,ge){v[" "+xe]||(y.test(xe)?v[" "+xe]=xe+"/":v[" "+xe]=j(xe,"/",!0)),xe=v[" "+xe];var ye=xe.indexOf(":")===-1;return ge.substring(0,2)==="//"?ye?ge:xe.replace(T,"$1")+ge:ge.charAt(0)==="/"?ye?ge:xe.replace(A,"$1")+ge:xe+ge}var D={exec:function(){}};function O(xe){for(var ge=1,ye,J;ge<arguments.length;ge++){ye=arguments[ge];for(J in ye)Object.prototype.hasOwnProperty.call(ye,J)&&(xe[J]=ye[J])}return xe}function P(xe,ge){var ye=xe.replace(/\|/g,function(q,me,Ce){for(var G=!1,we=me;--we>=0&&Ce[we]==="\\";)G=!G;return G?"|":" |"}),J=ye.split(/ \|/),ne=0;if(J.length>ge)J.splice(ge);else for(;J.length<ge;)J.push("");for(;ne<J.length;ne++)J[ne]=J[ne].trim().replace(/\\\|/g,"|");return J}function j(xe,ge,ye){var J=xe.length;if(J===0)return"";for(var ne=0;ne<J;){var q=xe.charAt(J-ne-1);if(q===ge&&!ye)ne++;else if(q!==ge&&ye)ne++;else break}return xe.substr(0,J-ne)}function K(xe,ge){if(xe.indexOf(ge[1])===-1)return-1;for(var ye=xe.length,J=0,ne=0;ne<ye;ne++)if(xe[ne]==="\\")ne++;else if(xe[ne]===ge[0])J++;else if(xe[ne]===ge[1]&&(J--,J<0))return ne;return-1}function U(xe){xe&&xe.sanitize&&!xe.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 X={escape:s,unescape:c,edit:w,cleanUrl:C,resolveUrl:p,noopTest:D,merge:O,splitCells:P,rtrim:j,findClosingBracket:K,checkSanitizeDeprecation:U},B=E.defaults,N=X.rtrim,z=X.splitCells,te=X.escape,ce=X.findClosingBracket;function be(xe,ge,ye){var J=ge.href,ne=ge.title?te(ge.title):null,q=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:ye,href:J,title:ne,text:q}:{type:"image",raw:ye,href:J,title:ne,text:te(q)}}function Fe(xe,ge){var ye=xe.match(/^(\s+)(?:```)/);if(ye===null)return ge;var J=ye[1];return ge.split(`
`).map(function(ne){var q=ne.match(/^\s+/);if(q===null)return ne;var me=q[0];return me.length>=J.length?ne.slice(J.length):ne}).join(`
`)}var Oe=function(){function xe(ye){this.options=ye||B}var ge=xe.prototype;return ge.space=function(J){var ne=this.rules.block.newline.exec(J);if(ne)return ne[0].length>1?{type:"space",raw:ne[0]}:{raw:`
`}},ge.code=function(J,ne){var q=this.rules.block.code.exec(J);if(q){var me=ne[ne.length-1];if(me&&me.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var Ce=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:N(Ce,`
`)}}},ge.fences=function(J){var ne=this.rules.block.fences.exec(J);if(ne){var q=ne[0],me=Fe(q,ne[3]||"");return{type:"code",raw:q,lang:ne[2]?ne[2].trim():ne[2],text:me}}},ge.heading=function(J){var ne=this.rules.block.heading.exec(J);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},ge.nptable=function(J){var ne=this.rules.block.nptable.exec(J);if(ne){var q={type:"table",header:z(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
`):[],raw:ne[0]};if(q.header.length===q.align.length){var me=q.align.length,Ce;for(Ce=0;Ce<me;Ce++)/^ *-+: *$/.test(q.align[Ce])?q.align[Ce]="right":/^ *:-+: *$/.test(q.align[Ce])?q.align[Ce]="center":/^ *:-+ *$/.test(q.align[Ce])?q.align[Ce]="left":q.align[Ce]=null;for(me=q.cells.length,Ce=0;Ce<me;Ce++)q.cells[Ce]=z(q.cells[Ce],q.header.length);return q}}},ge.hr=function(J){var ne=this.rules.block.hr.exec(J);if(ne)return{type:"hr",raw:ne[0]}},ge.blockquote=function(J){var ne=this.rules.block.blockquote.exec(J);if(ne){var q=ne[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ne[0],text:q}}},ge.list=function(J){var ne=this.rules.block.list.exec(J);if(ne){for(var q=ne[0],me=ne[2],Ce=me.length>1,G=me[me.length-1]===")",we={type:"list",raw:q,ordered:Ce,start:Ce?+me.slice(0,-1):"",loose:!1,items:[]},Ne=ne[0].match(this.rules.block.item),de=!1,Se,Xe,lt,tt,st,mt,Ct,_t=Ne.length,ft=0;ft<_t;ft++)Se=Ne[ft],q=Se,Xe=Se.length,Se=Se.replace(/^ *([*+-]|\d+[.)]) */,""),~Se.indexOf(`
`)&&(Xe-=Se.length,Se=this.options.pedantic?Se.replace(/^ {1,4}/gm,""):Se.replace(new RegExp("^ {1,"+Xe+"}","gm"),"")),ft!==_t-1&&(lt=this.rules.block.bullet.exec(Ne[ft+1])[0],(Ce?lt.length===1||!G&&lt[lt.length-1]===")":lt.length>1||this.options.smartLists&&lt!==me)&&(tt=Ne.slice(ft+1).join(`
`),we.raw=we.raw.substring(0,we.raw.length-tt.length),ft=_t-1)),st=de||/\n\n(?!\s*$)/.test(Se),ft!==_t-1&&(de=Se.charAt(Se.length-1)===`
`,st||(st=de)),st&&(we.loose=!0),mt=/^\[[ xX]\] /.test(Se),Ct=void 0,mt&&(Ct=Se[1]!==" ",Se=Se.replace(/^\[[ xX]\] +/,"")),we.items.push({type:"list_item",raw:q,task:mt,checked:Ct,loose:st,text:Se});return we}},ge.html=function(J){var ne=this.rules.block.html.exec(J);if(ne)return{type:this.options.sanitize?"paragraph":"html",raw:ne[0],pre:!this.options.sanitizer&&(ne[1]==="pre"||ne[1]==="script"||ne[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ne[0]):te(ne[0]):ne[0]}},ge.def=function(J){var ne=this.rules.block.def.exec(J);if(ne){ne[3]&&(ne[3]=ne[3].substring(1,ne[3].length-1));var q=ne[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:ne[0],href:ne[2],title:ne[3]}}},ge.table=function(J){var ne=this.rules.block.table.exec(J);if(ne){var q={type:"table",header:z(ne[1].replace(/^ *| *\| *$/g,"")),align:ne[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ne[3]?ne[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=ne[0];var me=q.align.length,Ce;for(Ce=0;Ce<me;Ce++)/^ *-+: *$/.test(q.align[Ce])?q.align[Ce]="right":/^ *:-+: *$/.test(q.align[Ce])?q.align[Ce]="center":/^ *:-+ *$/.test(q.align[Ce])?q.align[Ce]="left":q.align[Ce]=null;for(me=q.cells.length,Ce=0;Ce<me;Ce++)q.cells[Ce]=z(q.cells[Ce].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},ge.lheading=function(J){var ne=this.rules.block.lheading.exec(J);if(ne)return{type:"heading",raw:ne[0],depth:ne[2].charAt(0)==="="?1:2,text:ne[1]}},ge.paragraph=function(J){var ne=this.rules.block.paragraph.exec(J);if(ne)return{type:"paragraph",raw:ne[0],text:ne[1].charAt(ne[1].length-1)===`
`?ne[1].slice(0,-1):ne[1]}},ge.text=function(J,ne){var q=this.rules.block.text.exec(J);if(q){var me=ne[ne.length-1];return me&&me.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},ge.escape=function(J){var ne=this.rules.inline.escape.exec(J);if(ne)return{type:"escape",raw:ne[0],text:te(ne[1])}},ge.tag=function(J,ne,q){var me=this.rules.inline.tag.exec(J);if(me)return!ne&&/^<a /i.test(me[0])?ne=!0:ne&&/^<\/a>/i.test(me[0])&&(ne=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:ne,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]}},ge.link=function(J){var ne=this.rules.inline.link.exec(J);if(ne){var q=ce(ne[2],"()");if(q>-1){var me=ne[0].indexOf("!")===0?5:4,Ce=me+ne[1].length+q;ne[2]=ne[2].substring(0,q),ne[0]=ne[0].substring(0,Ce).trim(),ne[3]=""}var G=ne[2],we="";if(this.options.pedantic){var Ne=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(G);Ne?(G=Ne[1],we=Ne[3]):we=""}else we=ne[3]?ne[3].slice(1,-1):"";G=G.trim().replace(/^<([\s\S]*)>$/,"$1");var de=be(ne,{href:G&&G.replace(this.rules.inline._escapes,"$1"),title:we&&we.replace(this.rules.inline._escapes,"$1")},ne[0]);return de}},ge.reflink=function(J,ne){var q;if((q=this.rules.inline.reflink.exec(J))||(q=this.rules.inline.nolink.exec(J))){var me=(q[2]||q[1]).replace(/\s+/g," ");if(me=ne[me.toLowerCase()],!me||!me.href){var Ce=q[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var G=be(q,me,q[0]);return G}},ge.strong=function(J,ne,q){q===void 0&&(q="");var me=this.rules.inline.strong.start.exec(J);if(me&&(!me[1]||me[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){ne=ne.slice(-1*J.length);var Ce=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var G;(me=Ce.exec(ne))!=null;)if(G=this.rules.inline.strong.middle.exec(ne.slice(0,me.index+3)),G)return{type:"strong",raw:J.slice(0,G[0].length),text:J.slice(2,G[0].length-2)}}},ge.em=function(J,ne,q){q===void 0&&(q="");var me=this.rules.inline.em.start.exec(J);if(me&&(!me[1]||me[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){ne=ne.slice(-1*J.length);var Ce=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var G;(me=Ce.exec(ne))!=null;)if(G=this.rules.inline.em.middle.exec(ne.slice(0,me.index+2)),G)return{type:"em",raw:J.slice(0,G[0].length),text:J.slice(1,G[0].length-1)}}},ge.codespan=function(J){var ne=this.rules.inline.code.exec(J);if(ne){var q=ne[2].replace(/\n/g," "),me=/[^ ]/.test(q),Ce=q.startsWith(" ")&&q.endsWith(" ");return me&&Ce&&(q=q.substring(1,q.length-1)),q=te(q,!0),{type:"codespan",raw:ne[0],text:q}}},ge.br=function(J){var ne=this.rules.inline.br.exec(J);if(ne)return{type:"br",raw:ne[0]}},ge.del=function(J){var ne=this.rules.inline.del.exec(J);if(ne)return{type:"del",raw:ne[0],text:ne[1]}},ge.autolink=function(J,ne){var q=this.rules.inline.autolink.exec(J);if(q){var me,Ce;return q[2]==="@"?(me=te(this.options.mangle?ne(q[1]):q[1]),Ce="mailto:"+me):(me=te(q[1]),Ce=me),{type:"link",raw:q[0],text:me,href:Ce,tokens:[{type:"text",raw:me,text:me}]}}},ge.url=function(J,ne){var q;if(q=this.rules.inline.url.exec(J)){var me,Ce;if(q[2]==="@")me=te(this.options.mangle?ne(q[0]):q[0]),Ce="mailto:"+me;else{var G;do G=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(G!==q[0]);me=te(q[0]),q[1]==="www."?Ce="http://"+me:Ce=me}return{type:"link",raw:q[0],text:me,href:Ce,tokens:[{type:"text",raw:me,text:me}]}}},ge.inlineText=function(J,ne,q){var me=this.rules.inline.text.exec(J);if(me){var Ce;return ne?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):te(me[0]):me[0]:Ce=te(this.options.smartypants?q(me[0]):me[0]),{type:"text",raw:me[0],text:Ce}}},xe}(),Re=X.noopTest,Be=X.edit,Ke=X.merge,Ae={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:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ae.def=Be(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex(),Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ae.item=Be(Ae.item,"gm").replace(/bull/g,Ae.bullet).getRegex(),Ae.list=Be(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex(),Ae._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",Ae._comment=/<!--(?!-?>)[\s\S]*?-->/,Ae.html=Be(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ae.paragraph=Be(Ae._paragraph).replace("hr",Ae.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",Ae._tag).getRegex(),Ae.blockquote=Be(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex(),Ae.normal=Ke({},Ae),Ae.gfm=Ke({},Ae.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*|$)"}),Ae.gfm.nptable=Be(Ae.gfm.nptable).replace("hr",Ae.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",Ae._tag).getRegex(),Ae.gfm.table=Be(Ae.gfm.table).replace("hr",Ae.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",Ae._tag).getRegex(),Ae.pedantic=Ke({},Ae.normal,{html:Be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._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:Re,paragraph:Be(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _e={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,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:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};_e._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",_e.punctuation=Be(_e.punctuation).replace(/punctuation/g,_e._punctuation).getRegex(),_e._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_e._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_e.em.start=Be(_e.em.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.middle=Be(_e.em.middle).replace(/punctuation/g,_e._punctuation).replace(/overlapSkip/g,_e._overlapSkip).getRegex(),_e.em.endAst=Be(_e.em.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.em.endUnd=Be(_e.em.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.start=Be(_e.strong.start).replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.middle=Be(_e.strong.middle).replace(/punctuation/g,_e._punctuation).replace(/blockSkip/g,_e._blockSkip).getRegex(),_e.strong.endAst=Be(_e.strong.endAst,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.strong.endUnd=Be(_e.strong.endUnd,"g").replace(/punctuation/g,_e._punctuation).getRegex(),_e.blockSkip=Be(_e._blockSkip,"g").getRegex(),_e.overlapSkip=Be(_e._overlapSkip,"g").getRegex(),_e._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_e._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_e._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])?)+(?![-_])/,_e.autolink=Be(_e.autolink).replace("scheme",_e._scheme).replace("email",_e._email).getRegex(),_e._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_e.tag=Be(_e.tag).replace("comment",Ae._comment).replace("attribute",_e._attribute).getRegex(),_e._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_e._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_e._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_e.link=Be(_e.link).replace("label",_e._label).replace("href",_e._href).replace("title",_e._title).getRegex(),_e.reflink=Be(_e.reflink).replace("label",_e._label).getRegex(),_e.reflinkSearch=Be(_e.reflinkSearch,"g").replace("reflink",_e.reflink).replace("nolink",_e.nolink).getRegex(),_e.normal=Ke({},_e),_e.pedantic=Ke({},_e.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Be(/^!?\[(label)\]\((.*?)\)/).replace("label",_e._label).getRegex(),reflink:Be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_e._label).getRegex()}),_e.gfm=Ke({},_e.normal,{escape:Be(_e.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),_e.gfm.url=Be(_e.gfm.url,"i").replace("email",_e.gfm._extended_email).getRegex(),_e.breaks=Ke({},_e.gfm,{br:Be(_e.br).replace("{2,}","*").getRegex(),text:Be(_e.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var le={block:Ae,inline:_e},Ee=E.defaults,pe=le.block,Ge=le.inline;function Ye(xe){return xe.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 ze(xe){var ge="",ye,J,ne=xe.length;for(ye=0;ye<ne;ye++)J=xe.charCodeAt(ye),Math.random()>.5&&(J="x"+J.toString(16)),ge+="&#"+J+";";return ge}var Ze=function(){function xe(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||Ee,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var J={block:pe.normal,inline:Ge.normal};this.options.pedantic?(J.block=pe.pedantic,J.inline=Ge.pedantic):this.options.gfm&&(J.block=pe.gfm,this.options.breaks?J.inline=Ge.breaks:J.inline=Ge.gfm),this.tokenizer.rules=J}xe.lex=function(J,ne){var q=new xe(ne);return q.lex(J)};var ge=xe.prototype;return ge.lex=function(J){return J=J.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(J,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(J,ne,q){ne===void 0&&(ne=[]),q===void 0&&(q=!0),J=J.replace(/^ +$/gm,"");for(var me,Ce,G,we;J;){if(me=this.tokenizer.space(J)){J=J.substring(me.raw.length),me.type&&ne.push(me);continue}if(me=this.tokenizer.code(J,ne)){J=J.substring(me.raw.length),me.type?ne.push(me):(we=ne[ne.length-1],we.raw+=`
`+me.raw,we.text+=`
`+me.text);continue}if(me=this.tokenizer.fences(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.heading(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.nptable(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.hr(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.blockquote(J)){J=J.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],q),ne.push(me);continue}if(me=this.tokenizer.list(J)){for(J=J.substring(me.raw.length),G=me.items.length,Ce=0;Ce<G;Ce++)me.items[Ce].tokens=this.blockTokens(me.items[Ce].text,[],!1);ne.push(me);continue}if(me=this.tokenizer.html(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(q&&(me=this.tokenizer.def(J))){J=J.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.lheading(J)){J=J.substring(me.raw.length),ne.push(me);continue}if(q&&(me=this.tokenizer.paragraph(J))){J=J.substring(me.raw.length),ne.push(me);continue}if(me=this.tokenizer.text(J,ne)){J=J.substring(me.raw.length),me.type?ne.push(me):(we=ne[ne.length-1],we.raw+=`
`+me.raw,we.text+=`
`+me.text);continue}if(J){var Ne="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(Ne);break}else throw new Error(Ne)}}return ne},ge.inline=function(J){var ne,q,me,Ce,G,we,Ne=J.length;for(ne=0;ne<Ne;ne++){we=J[ne];switch(we.type){case"paragraph":case"text":case"heading":{we.tokens=[],this.inlineTokens(we.text,we.tokens);break}case"table":{for(we.tokens={header:[],cells:[]},Ce=we.header.length,q=0;q<Ce;q++)we.tokens.header[q]=[],this.inlineTokens(we.header[q],we.tokens.header[q]);for(Ce=we.cells.length,q=0;q<Ce;q++)for(G=we.cells[q],we.tokens.cells[q]=[],me=0;me<G.length;me++)we.tokens.cells[q][me]=[],this.inlineTokens(G[me],we.tokens.cells[q][me]);break}case"blockquote":{this.inline(we.tokens);break}case"list":{for(Ce=we.items.length,q=0;q<Ce;q++)this.inline(we.items[q].tokens);break}}}return J},ge.inlineTokens=function(J,ne,q,me,Ce){ne===void 0&&(ne=[]),q===void 0&&(q=!1),me===void 0&&(me=!1),Ce===void 0&&(Ce="");var G,we=J,Ne;if(this.tokens.links){var de=Object.keys(this.tokens.links);if(de.length>0)for(;(Ne=this.tokenizer.rules.inline.reflinkSearch.exec(we))!=null;)de.includes(Ne[0].slice(Ne[0].lastIndexOf("[")+1,-1))&&(we=we.slice(0,Ne.index)+"["+"a".repeat(Ne[0].length-2)+"]"+we.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ne=this.tokenizer.rules.inline.blockSkip.exec(we))!=null;)we=we.slice(0,Ne.index)+"["+"a".repeat(Ne[0].length-2)+"]"+we.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;J;){if(G=this.tokenizer.escape(J)){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.tag(J,q,me)){J=J.substring(G.raw.length),q=G.inLink,me=G.inRawBlock,ne.push(G);continue}if(G=this.tokenizer.link(J)){J=J.substring(G.raw.length),G.type==="link"&&(G.tokens=this.inlineTokens(G.text,[],!0,me)),ne.push(G);continue}if(G=this.tokenizer.reflink(J,this.tokens.links)){J=J.substring(G.raw.length),G.type==="link"&&(G.tokens=this.inlineTokens(G.text,[],!0,me)),ne.push(G);continue}if(G=this.tokenizer.strong(J,we,Ce)){J=J.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],q,me),ne.push(G);continue}if(G=this.tokenizer.em(J,we,Ce)){J=J.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],q,me),ne.push(G);continue}if(G=this.tokenizer.codespan(J)){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.br(J)){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.del(J)){J=J.substring(G.raw.length),G.tokens=this.inlineTokens(G.text,[],q,me),ne.push(G);continue}if(G=this.tokenizer.autolink(J,ze)){J=J.substring(G.raw.length),ne.push(G);continue}if(!q&&(G=this.tokenizer.url(J,ze))){J=J.substring(G.raw.length),ne.push(G);continue}if(G=this.tokenizer.inlineText(J,me,Ye)){J=J.substring(G.raw.length),Ce=G.raw.slice(-1),ne.push(G);continue}if(J){var Se="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(Se);break}else throw new Error(Se)}}return ne},L(xe,null,[{key:"rules",get:function(){return{block:pe,inline:Ge}}}]),xe}(),Je=E.defaults,$e=X.cleanUrl,He=X.escape,Ue=function(){function xe(ye){this.options=ye||Je}var ge=xe.prototype;return ge.code=function(J,ne,q){var me=(ne||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(J,me);Ce!=null&&Ce!==J&&(q=!0,J=Ce)}return me?'<pre><code class="'+this.options.langPrefix+He(me,!0)+'">'+(q?J:He(J,!0))+`</code></pre>
`:"<pre><code>"+(q?J:He(J,!0))+`</code></pre>
`},ge.blockquote=function(J){return`<blockquote>
`+J+`</blockquote>
`},ge.html=function(J){return J},ge.heading=function(J,ne,q,me){return this.options.headerIds?"<h"+ne+' id="'+this.options.headerPrefix+me.slug(q)+'">'+J+"</h"+ne+`>
`:"<h"+ne+">"+J+"</h"+ne+`>
`},ge.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ge.list=function(J,ne,q){var me=ne?"ol":"ul",Ce=ne&&q!==1?' start="'+q+'"':"";return"<"+me+Ce+`>
`+J+"</"+me+`>
`},ge.listitem=function(J){return"<li>"+J+`</li>
`},ge.checkbox=function(J){return"<input "+(J?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ge.paragraph=function(J){return"<p>"+J+`</p>
`},ge.table=function(J,ne){return ne&&(ne="<tbody>"+ne+"</tbody>"),`<table>
<thead>
`+J+`</thead>
`+ne+`</table>
`},ge.tablerow=function(J){return`<tr>
`+J+`</tr>
`},ge.tablecell=function(J,ne){var q=ne.header?"th":"td",me=ne.align?"<"+q+' align="'+ne.align+'">':"<"+q+">";return me+J+"</"+q+`>
`},ge.strong=function(J){return"<strong>"+J+"</strong>"},ge.em=function(J){return"<em>"+J+"</em>"},ge.codespan=function(J){return"<code>"+J+"</code>"},ge.br=function(){return this.options.xhtml?"<br/>":"<br>"},ge.del=function(J){return"<del>"+J+"</del>"},ge.link=function(J,ne,q){if(J=$e(this.options.sanitize,this.options.baseUrl,J),J===null)return q;var me='<a href="'+He(J)+'"';return ne&&(me+=' title="'+ne+'"'),me+=">"+q+"</a>",me},ge.image=function(J,ne,q){if(J=$e(this.options.sanitize,this.options.baseUrl,J),J===null)return q;var me='<img src="'+J+'" alt="'+q+'"';return ne&&(me+=' title="'+ne+'"'),me+=this.options.xhtml?"/>":">",me},ge.text=function(J){return J},xe}(),Pe=function(){function xe(){}var ge=xe.prototype;return ge.strong=function(J){return J},ge.em=function(J){return J},ge.codespan=function(J){return J},ge.del=function(J){return J},ge.html=function(J){return J},ge.text=function(J){return J},ge.link=function(J,ne,q){return""+q},ge.image=function(J,ne,q){return""+q},ge.br=function(){return""},xe}(),ke=function(){function xe(){this.seen={}}var ge=xe.prototype;return ge.slug=function(J){var ne=J.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ne)){var q=ne;do this.seen[q]++,ne=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(ne))}return this.seen[ne]=0,ne},xe}(),re=E.defaults,ve=X.unescape,ae=function(){function xe(ye){this.options=ye||re,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new ke}xe.parse=function(J,ne){var q=new xe(ne);return q.parse(J)};var ge=xe.prototype;return ge.parse=function(J,ne){ne===void 0&&(ne=!0);var q="",me,Ce,G,we,Ne,de,Se,Xe,lt,tt,st,mt,Ct,_t,ft,kt,Nt,nt,Tt=J.length;for(me=0;me<Tt;me++){tt=J[me];switch(tt.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,ve(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(Xe="",Se="",we=tt.header.length,Ce=0;Ce<we;Ce++)Se+=this.renderer.tablecell(this.parseInline(tt.tokens.header[Ce]),{header:!0,align:tt.align[Ce]});for(Xe+=this.renderer.tablerow(Se),lt="",we=tt.cells.length,Ce=0;Ce<we;Ce++){for(de=tt.tokens.cells[Ce],Se="",Ne=de.length,G=0;G<Ne;G++)Se+=this.renderer.tablecell(this.parseInline(de[G]),{header:!1,align:tt.align[G]});lt+=this.renderer.tablerow(Se)}q+=this.renderer.table(Xe,lt);continue}case"blockquote":{lt=this.parse(tt.tokens),q+=this.renderer.blockquote(lt);continue}case"list":{for(st=tt.ordered,mt=tt.start,Ct=tt.loose,we=tt.items.length,lt="",Ce=0;Ce<we;Ce++)ft=tt.items[Ce],kt=ft.checked,Nt=ft.task,_t="",ft.task&&(nt=this.renderer.checkbox(kt),Ct?ft.tokens.length>0&&ft.tokens[0].type==="text"?(ft.tokens[0].text=nt+" "+ft.tokens[0].text,ft.tokens[0].tokens&&ft.tokens[0].tokens.length>0&&ft.tokens[0].tokens[0].type==="text"&&(ft.tokens[0].tokens[0].text=nt+" "+ft.tokens[0].tokens[0].text)):ft.tokens.unshift({type:"text",text:nt}):_t+=nt),_t+=this.parse(ft.tokens,Ct),lt+=this.renderer.listitem(_t,Nt,kt);q+=this.renderer.list(lt,st,mt);continue}case"html":{q+=this.renderer.html(tt.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(lt=tt.tokens?this.parseInline(tt.tokens):tt.text;me+1<Tt&&J[me+1].type==="text";)tt=J[++me],lt+=`
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);q+=ne?this.renderer.paragraph(lt):lt;continue}default:{var It='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(It);return}else throw new Error(It)}}}return q},ge.parseInline=function(J,ne){ne=ne||this.renderer;var q="",me,Ce,G=J.length;for(me=0;me<G;me++){Ce=J[me];switch(Ce.type){case"escape":{q+=ne.text(Ce.text);break}case"html":{q+=ne.html(Ce.text);break}case"link":{q+=ne.link(Ce.href,Ce.title,this.parseInline(Ce.tokens,ne));break}case"image":{q+=ne.image(Ce.href,Ce.title,Ce.text);break}case"strong":{q+=ne.strong(this.parseInline(Ce.tokens,ne));break}case"em":{q+=ne.em(this.parseInline(Ce.tokens,ne));break}case"codespan":{q+=ne.codespan(Ce.text);break}case"br":{q+=ne.br();break}case"del":{q+=ne.del(this.parseInline(Ce.tokens,ne));break}case"text":{q+=ne.text(Ce.text);break}default:{var we='Token with "'+Ce.type+'" type was not found.';if(this.options.silent){console.error(we);return}else throw new Error(we)}}}return q},xe}(),De=X.merge,qe=X.checkSanitizeDeprecation,et=X.escape,je=E.getDefaults,ct=E.changeDefaults,he=E.defaults;function Te(xe,ge,ye){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof ge=="function"&&(ye=ge,ge=null),ge=De({},Te.defaults,ge||{}),qe(ge),ye){var J=ge.highlight,ne;try{ne=Ze.lex(xe,ge)}catch(G){return ye(G)}var q=function(we){var Ne;if(!we)try{Ne=ae.parse(ne,ge)}catch(de){we=de}return ge.highlight=J,we?ye(we):ye(null,Ne)};if(!J||J.length<3)return q();if(delete ge.highlight,!ne.length)return q();var me=0;Te.walkTokens(ne,function(G){G.type==="code"&&(me++,setTimeout(function(){J(G.text,G.lang,function(we,Ne){if(we)return q(we);Ne!=null&&Ne!==G.text&&(G.text=Ne,G.escaped=!0),me--,me===0&&q()})},0))}),me===0&&q();return}try{var Ce=Ze.lex(xe,ge);return ge.walkTokens&&Te.walkTokens(Ce,ge.walkTokens),ae.parse(Ce,ge)}catch(G){if(G.message+=`
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+et(G.message+"",!0)+"</pre>";throw G}}Te.options=Te.setOptions=function(xe){return De(Te.defaults,xe),ct(Te.defaults),Te},Te.getDefaults=je,Te.defaults=he,Te.use=function(xe){var ge=De({},xe);if(xe.renderer&&function(){var J=Te.defaults.renderer||new Ue,ne=function(Ce){var G=J[Ce];J[Ce]=function(){for(var we=arguments.length,Ne=new Array(we),de=0;de<we;de++)Ne[de]=arguments[de];var Se=xe.renderer[Ce].apply(J,Ne);return Se===!1&&(Se=G.apply(J,Ne)),Se}};for(var q in xe.renderer)ne(q);ge.renderer=J}(),xe.tokenizer&&function(){var J=Te.defaults.tokenizer||new Oe,ne=function(Ce){var G=J[Ce];J[Ce]=function(){for(var we=arguments.length,Ne=new Array(we),de=0;de<we;de++)Ne[de]=arguments[de];var Se=xe.tokenizer[Ce].apply(J,Ne);return Se===!1&&(Se=G.apply(J,Ne)),Se}};for(var q in xe.tokenizer)ne(q);ge.tokenizer=J}(),xe.walkTokens){var ye=Te.defaults.walkTokens;ge.walkTokens=function(J){xe.walkTokens(J),ye&&ye(J)}}Te.setOptions(ge)},Te.walkTokens=function(xe,ge){for(var ye=M(xe),J;!(J=ye()).done;){var ne=J.value;ge(ne);switch(ne.type){case"table":{for(var q=M(ne.tokens.header),me;!(me=q()).done;){var Ce=me.value;Te.walkTokens(Ce,ge)}for(var G=M(ne.tokens.cells),we;!(we=G()).done;)for(var Ne=we.value,de=M(Ne),Se;!(Se=de()).done;){var Xe=Se.value;Te.walkTokens(Xe,ge)}break}case"list":{Te.walkTokens(ne.items,ge);break}default:ne.tokens&&Te.walkTokens(ne.tokens,ge)}}},Te.Parser=ae,Te.parser=ae.parse,Te.Renderer=Ue,Te.TextRenderer=Pe,Te.Lexer=Ze,Te.lexer=Ze.lex,Te.Tokenizer=Oe,Te.Slugger=ke,Te.parse=Te;var We=Te;return We})},Dqnf:function(at,fe,oe){"use strict";var V=oe("k1fw"),L=oe("tJVT"),I=oe("rAM+"),k=oe("q1tI"),M=oe.n(k),f=oe("J66h"),E=oe.n(f),x=oe("/POA"),g=oe.n(x),h=oe("q7KB"),o=oe.n(h),u=oe("ER/M"),r=oe.n(u),n=oe("dhSg"),t=oe("bdgK");function i(c,d,w){var m=w._core._renderService.dimensions.actualCellWidth||9.5,S=w._core._renderService.dimensions.actualCellHeight||18,C=Math.floor(d/S),v=Math.floor(c/m);return[v,C]}function s(c,d){var w=new t.default(function(m){var S=Object(I.a)(m),C;try{for(S.s();!(C=S.n()).done;){var v=C.value;if(v.target.offsetHeight>0||v.target.offsetWidth>0){var y=i(v.target.offsetWidth,v.target.offsetHeight,c),T=Object(L.a)(y,2),A=T[0],p=T[1];console.log("cols, rows",A,p),n.a.publish("ssh-xterm-resize",{columns:A,rows:p,width:v.target.offsetWidth,height:v.target.offsetHeight}),c.resize(A,p);var D=f.Base64.decode("IA=="),O=f.Base64.decode("CBtbSw==");c.write(D),c.write(O)}}}catch(P){S.e(P)}finally{S.f()}});return w.observe(d),w}var l=3e4;fe.a=function(c){var d=c.sshConfigData,w=c.sid,m=Object(k.useState)(null),S=Object(L.a)(m,2),C=S[0],v=S[1],y=d.link_url,T=d.password,A=d.port,p=Object(k.useRef)(),D=Object(k.useRef)(),O=Object(k.useRef)(!1);return Object(k.useEffect)(function(){if(p.current&&y){var P=new x.Terminal({fontSize:16,rendererType:"dom"});P.open(p.current),P.onData(function(K){D.current&&(D.current.readyState===1&&(D.current.send(JSON.stringify({tp:"client",data:K})),n.a.publish("on-operating-ssh")))}),P.write("Connecting..."),v(P);var j=s(P,p.current);return function(){P.dispose(),j.unobserve(p.current)}}},[y,p.current]),Object(k.useEffect)(function(){if(C&&y){function P(){var N=new WebSocket(y);D.current=N,N.onopen=function(){var z=C.element.parentElement;if(z){var te=z.offsetWidth,ce=z.offsetHeight;console.log("init",{tp:"init",data:Object(V.a)(Object(V.a)({},d),{},{secret:T,width:te,height:ce,rows:C.rows,columns:C.cols})}),N.send(JSON.stringify({tp:"init",data:Object(V.a)(Object(V.a)({},d),{},{secret:T,width:te,height:ce,rows:C.rows,columns:C.cols})}))}C.focus()},N.onerror=function(z){console.log("------in socket error----",z,N,y)},N.onmessage=function(z){O.current||(C.write("\r"),setTimeout(function(){},1e3)),O.current=!0,console.log("event:",z);var te=f.Base64.decode(z.data.toString()),ce=C._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",te,ce,C),C.write(te)},N.onclose=function(z){j&&clearInterval(j),C.write(`\r
connection closed`)}}var j=setInterval(function(){D.current&&D.current.send(JSON.stringify({tp:"h"}))},l),K=n.a.subscribe("create-socket",function(N){w==N&&(D.current&&D.current.readyState===1?C.focus():P(),C.focus())}),U=n.a.subscribe("close-socket",function(N){w===N&&(D.current&&(D.current.close(),O.current=!1,C.clear()),D.current=null)}),X=n.a.subscribe("ssh-xterm-resize",function(N){D.current&&D.current.readyState===1&&D.current.send(JSON.stringify({tp:"resize",data:Object(V.a)({},N)}))}),B=n.a.subscribe("ssh-add-connect-time",function(){D.current&&D.current.readyState===1&&D.current.send(JSON.stringify({tp:"overtime"}))});return function(){U(),K(),X(),B(),D.current&&(D.current.close(),O.current=!1)}}},[C,y,A]),M.a.createElement("div",{ref:p,className:r.a["xterm-panel"]},y?null:M.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},ELLl:function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){var L={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=V.Pos;V.defineOption("autoCloseBrackets",!1,function(t,i,s){s&&s!=V.Init&&(t.removeKeyMap(M),t.state.closeBrackets=null),i&&(f(k(i,"pairs")),t.state.closeBrackets=i,t.addKeyMap(M))});function k(t,i){return i=="pairs"&&typeof t=="string"?t:typeof t=="object"&&t[i]!=null?t[i]:L[i]}var M={Backspace:g,Enter:h};function f(t){for(var i=0;i<t.length;i++){var s=t.charAt(i),l="'"+s+"'";M[l]||(M[l]=E(s))}}f(L.pairs+"`");function E(t){return function(i){return u(i,t)}}function x(t){var i=t.state.closeBrackets;if(!i||i.override)return i;var s=t.getModeAt(t.getCursor());return s.closeBrackets||i}function g(t){var i=x(t);if(!i||t.getOption("disableInput"))return V.Pass;for(var s=k(i,"pairs"),l=t.listSelections(),c=0;c<l.length;c++){if(!l[c].empty())return V.Pass;var d=r(t,l[c].head);if(!d||s.indexOf(d)%2!=0)return V.Pass}for(var c=l.length-1;c>=0;c--){var w=l[c].head;t.replaceRange("",I(w.line,w.ch-1),I(w.line,w.ch+1),"+delete")}}function h(t){var i=x(t),s=i&&k(i,"explode");if(!s||t.getOption("disableInput"))return V.Pass;for(var l=t.listSelections(),c=0;c<l.length;c++){if(!l[c].empty())return V.Pass;var d=r(t,l[c].head);if(!d||s.indexOf(d)%2!=0)return V.Pass}t.operation(function(){var w=t.lineSeparator()||`
`;t.replaceSelection(w+w,null),t.execCommand("goCharLeft"),l=t.listSelections();for(var m=0;m<l.length;m++){var S=l[m].head.line;t.indentLine(S,null,!0),t.indentLine(S+1,null,!0)}})}function o(t){var i=V.cmpPos(t.anchor,t.head)>0;return{anchor:new I(t.anchor.line,t.anchor.ch+(i?-1:1)),head:new I(t.head.line,t.head.ch+(i?1:-1))}}function u(t,i){var s=x(t);if(!s||t.getOption("disableInput"))return V.Pass;var l=k(s,"pairs"),c=l.indexOf(i);if(c==-1)return V.Pass;for(var d=k(s,"closeBefore"),w=k(s,"triples"),m=l.charAt(c+1)==i,S=t.listSelections(),C=c%2==0,v,y=0;y<S.length;y++){var T=S[y],A=T.head,p,D=t.getRange(A,I(A.line,A.ch+1));if(C&&!T.empty())p="surround";else if((m||!C)&&D==i)m&&n(t,A)?p="both":w.indexOf(i)>=0&&t.getRange(A,I(A.line,A.ch+3))==i+i+i?p="skipThree":p="skip";else if(m&&A.ch>1&&w.indexOf(i)>=0&&t.getRange(I(A.line,A.ch-2),A)==i+i){if(A.ch>2&&/\bstring/.test(t.getTokenTypeAt(I(A.line,A.ch-2))))return V.Pass;p="addFour"}else if(m){var O=A.ch==0?" ":t.getRange(I(A.line,A.ch-1),A);if(!V.isWordChar(D)&&O!=i&&!V.isWordChar(O))p="both";else return V.Pass}else if(C&&(D.length===0||/\s/.test(D)||d.indexOf(D)>-1))p="both";else return V.Pass;if(!v)v=p;else if(v!=p)return V.Pass}var P=c%2?l.charAt(c-1):i,j=c%2?i:l.charAt(c+1);t.operation(function(){if(v=="skip")t.execCommand("goCharRight");else if(v=="skipThree")for(var K=0;K<3;K++)t.execCommand("goCharRight");else if(v=="surround"){for(var U=t.getSelections(),K=0;K<U.length;K++)U[K]=P+U[K]+j;t.replaceSelections(U,"around"),U=t.listSelections().slice();for(var K=0;K<U.length;K++)U[K]=o(U[K]);t.setSelections(U)}else v=="both"?(t.replaceSelection(P+j,null),t.triggerElectric(P+j),t.execCommand("goCharLeft")):v=="addFour"&&(t.replaceSelection(P+P+P+P,"before"),t.execCommand("goCharRight"))})}function r(t,i){var s=t.getRange(I(i.line,i.ch-1),I(i.line,i.ch+1));return s.length==2?s:null}function n(t,i){var s=t.getTokenAt(I(i.line,i.ch+1));return/\bstring/.test(s.type)&&s.start==i.ch&&(i.ch==0||!/\bstring/.test(t.getTokenTypeAt(i)))}})},"ER/M":function(at,fe,oe){at.exports={"xterm-panel":"xterm-panel___2r2xx"}},Fv0C:function(at,fe,oe){"use strict";function V(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(i){return typeof i}:V=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},V(n)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=g(oe("Lo0S")),I=oe("vewr"),k=g(oe("8CQX")),M=E(oe("mHUz")),f=g(oe("GdRQ"));function E(n){return n&&n.__esModule?n:{default:n}}function x(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return x=function(){return n},n}function g(n){if(n&&n.__esModule)return n;if(n===null||V(n)!=="object"&&typeof n!="function")return{default:n};var t=x();if(t&&t.has(n))return t.get(n);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l)){var c=s?Object.getOwnPropertyDescriptor(n,l):null;c&&(c.get||c.set)?Object.defineProperty(i,l,c):i[l]=n[l]}return i.default=n,t&&t.set(n,i),i}function h(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function o(n,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function u(n,t,i){return t&&o(n.prototype,t),i&&o(n,i),n}var r=function(){function n(t){h(this,n),this._target=t||null,this._keyDownList={},this._pendingKey=null,this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this),checkalt:this._checkAlt.bind(this)},this.onkeyevent=function(){}}return u(n,[{key:"_sendKeyEvent",value:function(i,s,l){if(l)this._keyDownList[s]=i;else{if(!(s in this._keyDownList))return;delete this._keyDownList[s]}L.Debug("onkeyevent "+(l?"down":"up")+", keysym: "+i,", code: "+s),this.onkeyevent(i,s,l)}},{key:"_getKeyCode",value:function(i){var s=k.getKeycode(i);if(s!=="Unidentified")return s;if(i.keyCode&&i.type!=="keypress"&&i.keyCode!==229)return"Platform"+i.keyCode;if(i.keyIdentifier){if(i.keyIdentifier.substr(0,2)!=="U+")return i.keyIdentifier;var l=parseInt(i.keyIdentifier.substr(2),16),c=String.fromCharCode(l).toUpperCase();return"Platform"+c.charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(i){var s=this._getKeyCode(i),l=k.getKeysym(i);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),s==="AltRight"&&i.timeStamp-this._altGrCtrlTime<50?l=M.default.XK_ISO_Level3_Shift:this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),s==="Unidentified"){l&&(this._sendKeyEvent(l,s,!0),this._sendKeyEvent(l,s,!1)),(0,I.stopEvent)(i);return}if(f.isMac()||f.isIOS())switch(l){case M.default.XK_Super_L:l=M.default.XK_Alt_L;break;case M.default.XK_Super_R:l=M.default.XK_Super_L;break;case M.default.XK_Alt_L:l=M.default.XK_Mode_switch;break;case M.default.XK_Alt_R:l=M.default.XK_ISO_Level3_Shift;break}if(s in this._keyDownList&&(l=this._keyDownList[s]),(f.isMac()||f.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1),(0,I.stopEvent)(i);return}if(!l&&(!i.key||f.isIE()||f.isEdge())){this._pendingKey=s,setTimeout(this._handleKeyPressTimeout.bind(this),10,i);return}if(this._pendingKey=null,(0,I.stopEvent)(i),s==="ControlLeft"&&f.isWindows()&&!("ControlLeft"in this._keyDownList)){this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),this._altGrCtrlTime=i.timeStamp;return}this._sendKeyEvent(l,s,!0)}},{key:"_handleKeyPress",value:function(i){if((0,I.stopEvent)(i),this._pendingKey===null)return;var s=this._getKeyCode(i),l=k.getKeysym(i);if(s!=="Unidentified"&&s!=this._pendingKey)return;if(s=this._pendingKey,this._pendingKey=null,!l){L.Info("keypress with no keysym:",i);return}this._sendKeyEvent(l,s,!0)}},{key:"_handleKeyPressTimeout",value:function(i){if(this._pendingKey===null)return;var s,l=this._pendingKey;if(this._pendingKey=null,i.keyCode>=48&&i.keyCode<=57)s=i.keyCode;else if(i.keyCode>=65&&i.keyCode<=90){var c=String.fromCharCode(i.keyCode);i.shiftKey?c=c.toUpperCase():c=c.toLowerCase(),s=c.charCodeAt()}else s=0;this._sendKeyEvent(s,l,!0)}},{key:"_handleKeyUp",value:function(i){(0,I.stopEvent)(i);var s=this._getKeyCode(i);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),(f.isMac()||f.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[s],s,!1),f.isWindows()&&(s==="ShiftLeft"||s==="ShiftRight")&&("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}},{key:"_handleAltGrTimeout",value:function(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){L.Debug(">> Keyboard.allKeysUp");for(var i in this._keyDownList)this._sendKeyEvent(this._keyDownList[i],i,!1);L.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(i){if(i.skipCheckAlt)return;if(i.altKey)return;var s=this._target,l=this._keyDownList;["AltLeft","AltRight"].forEach(function(c){if(!(c in l))return;var d=new KeyboardEvent("keyup",{key:l[c],code:c});d.skipCheckAlt=!0,s.dispatchEvent(d)})}},{key:"grab",value:function(){if(this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),this._target.addEventListener("keypress",this._eventHandlers.keypress),window.addEventListener("blur",this._eventHandlers.blur),f.isWindows()&&f.isFirefox()){var i=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.addEventListener(s,i,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(f.isWindows()&&f.isFirefox()){var i=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.removeEventListener(s,i)})}this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),this._target.removeEventListener("keypress",this._eventHandlers.keypress),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}]),n}();fe.default=r},GQ8N:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.toUnsigned32bit=V,fe.toSigned32bit=L;function V(I){return I>>>0}function L(I){return I|0}},GdRQ:function(at,fe,oe){"use strict";function V(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(y){return typeof y}:V=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},V(C)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.isMac=s,fe.isWindows=l,fe.isIOS=c,fe.isSafari=d,fe.isIE=w,fe.isEdge=m,fe.isFirefox=S,fe.hasScrollbarGutter=fe.supportsImageMetadata=fe.supportsCursorURIs=fe.dragThreshold=fe.isTouchDevice=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return I=function(){return C},C}function k(C){if(C&&C.__esModule)return C;if(C===null||V(C)!=="object"&&typeof C!="function")return{default:C};var v=I();if(v&&v.has(C))return v.get(C);var y={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in C)if(Object.prototype.hasOwnProperty.call(C,A)){var p=T?Object.getOwnPropertyDescriptor(C,A):null;p&&(p.get||p.set)?Object.defineProperty(y,A,p):y[A]=C[A]}return y.default=C,v&&v.set(C,y),y}var M="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;fe.isTouchDevice=M,window.addEventListener("touchstart",function C(){fe.isTouchDevice=M=!0,window.removeEventListener("touchstart",C,!1)},!1);var f=10*(window.devicePixelRatio||1);fe.dragThreshold=f;var E=!1;try{var x=document.createElement("canvas");x.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',x.style.cursor.indexOf("url")===0?(L.Info("Data URI scheme cursor supported"),E=!0):L.Warn("Data URI scheme cursor not supported")}catch(C){L.Error("Data URI scheme cursor test exception: "+C)}var g=E;fe.supportsCursorURIs=g;var h=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),h=!0}catch(C){}var o=h;fe.supportsImageMetadata=o;var u=!0;try{var r=document.createElement("div");r.style.visibility="hidden",r.style.overflow="scroll",document.body.appendChild(r);var n=document.createElement("div");r.appendChild(n);var t=r.offsetWidth-n.offsetWidth;r.parentNode.removeChild(r),u=t!=0}catch(C){L.Error("Scrollbar test exception: "+C)}var i=u;fe.hasScrollbarGutter=i;function s(){return navigator&&!!/mac/i.exec(navigator.platform)}function l(){return navigator&&!!/win/i.exec(navigator.platform)}function c(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function d(){return navigator&&navigator.userAgent.indexOf("Safari")!==-1&&navigator.userAgent.indexOf("Chrome")===-1}function w(){return navigator&&!!/trident/i.exec(navigator.userAgent)}function m(){return navigator&&!!/edge/i.exec(navigator.userAgent)}function S(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}},Gytx:function(at,fe){at.exports=function(V,L,I,k){var M=I?I.call(k,V,L):void 0;if(M!==void 0)return!!M;if(V===L)return!0;if(typeof V!="object"||!V||typeof L!="object"||!L)return!1;var f=Object.keys(V),E=Object.keys(L);if(f.length!==E.length)return!1;for(var x=Object.prototype.hasOwnProperty.bind(L),g=0;g<f.length;g++){var h=f[g];if(!x(h))return!1;var o=V[h],u=L[h];if(M=I?I.call(k,o,u,h):void 0,M===!1||M===void 0&&o!==u)return!1}return!0}},HmJG:function(at,fe,oe){},ItS6:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=oe("eP3c"),L=I(oe("1q3G"));function I(x){return x&&x.__esModule?x:{default:x}}function k(x,g){if(!(x instanceof g))throw new TypeError("Cannot call a class as a function")}function M(x,g){for(var h=0;h<g.length;h++){var o=g[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(x,o.key,o)}}function f(x,g,h){return g&&M(x.prototype,g),h&&M(x,h),x}var E=function(){function x(){k(this,x),this.strm=new L.default,this.chunkSize=1024*10*10,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,V.inflateInit)(this.strm,this.windowBits)}return f(x,[{key:"setInput",value:function(h){h?(this.strm.input=h,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0):(this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0)}},{key:"inflate",value:function(h){h>this.chunkSize&&(this.chunkSize=h,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=h;var o=(0,V.inflate)(this.strm,0);if(o<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=h)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,V.inflateReset)(this.strm)}}]),x}();fe.default=E},IxHN:function(at,fe,oe){"use strict";var V=oe("q1tI"),L=oe.n(V),I=oe("07cG"),k=oe.n(I);fe.a=function(M){var f=M.message,E=M.className,x=M.children,g=M.style,h=g===void 0?{}:g;return L.a.createElement("div",{className:"".concat(k.a.idsRingWrapper," ").concat(E)},L.a.createElement("div",{className:k.a.ldsRing},L.a.createElement("div",null),L.a.createElement("div",null),L.a.createElement("div",null),L.a.createElement("div",null)),f?L.a.createElement("p",{style:h},f):null,x)}},J66h:function(at,fe,oe){(function(V){var L,I;(function(k,M){at.exports=M(k)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof V!="undefined"?V:this,function(k){"use strict";k=k||{};var M=k.Base64,f="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x=function(P){for(var j={},K=0,U=P.length;K<U;K++)j[P.charAt(K)]=K;return j}(E),g=String.fromCharCode,h=function(P){if(P.length<2){var j=P.charCodeAt(0);return j<128?P:j<2048?g(192|j>>>6)+g(128|j&63):g(224|j>>>12&15)+g(128|j>>>6&63)+g(128|j&63)}else{var j=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return g(240|j>>>18&7)+g(128|j>>>12&63)+g(128|j>>>6&63)+g(128|j&63)}},o=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(P){return P.replace(o,h)},r=function(P){var j=[0,2,1][P.length%3],K=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),U=[E.charAt(K>>>18),E.charAt(K>>>12&63),j>=2?"=":E.charAt(K>>>6&63),j>=1?"=":E.charAt(K&63)];return U.join("")},n=k.btoa&&typeof k.btoa=="function"?function(P){return k.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,r)},t=function(P){return n(u(String(P)))},i=function(P){return P.replace(/[+\/]/g,function(j){return j=="+"?"-":"_"}).replace(/=/g,"")},s=function(P,j){return j?i(t(P)):t(P)},l=function(P){return s(P,!0)},c;k.Uint8Array&&(c=function(P,j){for(var K="",U=0,X=P.length;U<X;U+=3){var B=P[U],N=P[U+1],z=P[U+2],te=B<<16|N<<8|z;K+=E.charAt(te>>>18)+E.charAt(te>>>12&63)+(typeof N!="undefined"?E.charAt(te>>>6&63):"=")+(typeof z!="undefined"?E.charAt(te&63):"=")}return j?i(K):K});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(P){switch(P.length){case 4:var j=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),K=j-65536;return g((K>>>10)+55296)+g((K&1023)+56320);case 3:return g((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return g((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},m=function(P){return P.replace(d,w)},S=function(P){var j=P.length,K=j%4,U=(j>0?x[P.charAt(0)]<<18:0)|(j>1?x[P.charAt(1)]<<12:0)|(j>2?x[P.charAt(2)]<<6:0)|(j>3?x[P.charAt(3)]:0),X=[g(U>>>16),g(U>>>8&255),g(U&255)];return X.length-=[0,0,2,1][K],X.join("")},C=k.atob&&typeof k.atob=="function"?function(P){return k.atob(P)}:function(P){return P.replace(/\S{1,4}/g,S)},v=function(P){return C(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(P){return m(C(P))},T=function(P){return String(P).replace(/[-_]/g,function(j){return j=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},A=function(P){return y(T(P))},p;k.Uint8Array&&(p=function(P){return Uint8Array.from(v(T(P)),function(j){return j.charCodeAt(0)})});var D=function(){var P=k.Base64;return k.Base64=M,P};if(k.Base64={VERSION:f,atob:v,btoa:n,fromBase64:A,toBase64:s,utob:u,encode:s,encodeURI:l,btou:m,decode:A,noConflict:D,fromUint8Array:c,toUint8Array:p},typeof Object.defineProperty=="function"){var O=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};k.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",O(function(){return A(this)})),Object.defineProperty(String.prototype,"toBase64",O(function(P){return s(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",O(function(){return s(this,!0)}))}}return k.Meteor&&(Base64=k.Base64),at.exports?at.exports.Base64=k.Base64:!(L=[],I=function(){return k.Base64}.apply(fe,L),I!==void 0&&(at.exports=I)),{Base64:k.Base64}})}).call(this,oe("IyRk"))},JSwD:function(at,fe,oe){"use strict";function V(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(l){return typeof l}:V=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},V(i)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=t;var L=k(oe("6BzB"));function I(){if(typeof WeakMap!="function")return null;var i=new WeakMap;return I=function(){return i},i}function k(i){if(i&&i.__esModule)return i;if(i===null||V(i)!=="object"&&typeof i!="function")return{default:i};var s=I();if(s&&s.has(i))return s.get(i);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in i)if(Object.prototype.hasOwnProperty.call(i,d)){var w=c?Object.getOwnPropertyDescriptor(i,d):null;w&&(w.get||w.set)?Object.defineProperty(l,d,w):l[d]=i[d]}return l.default=i,s&&s.set(i,l),l}var M=15,f=852,E=592,x=0,g=1,h=2,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],r=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function t(i,s,l,c,d,w,m,S){var C=S.bits,v=0,y=0,T=0,A=0,p=0,D=0,O=0,P=0,j=0,K=0,U,X,B,N,z,te=null,ce=0,be,Fe=new L.Buf16(M+1),Oe=new L.Buf16(M+1),Re=null,Be=0,Ke,Ae,_e;for(v=0;v<=M;v++)Fe[v]=0;for(y=0;y<c;y++)Fe[s[l+y]]++;for(p=C,A=M;A>=1&&!(Fe[A]!==0);A--);if(p>A&&(p=A),A===0)return d[w++]=1<<24|64<<16|0,d[w++]=1<<24|64<<16|0,S.bits=1,0;for(T=1;T<A&&!(Fe[T]!==0);T++);for(p<T&&(p=T),P=1,v=1;v<=M;v++)if(P<<=1,P-=Fe[v],P<0)return-1;if(P>0&&(i===x||A!==1))return-1;for(Oe[1]=0,v=1;v<M;v++)Oe[v+1]=Oe[v]+Fe[v];for(y=0;y<c;y++)s[l+y]!==0&&(m[Oe[s[l+y]]++]=y);if(i===x?(te=Re=m,be=19):i===g?(te=o,ce-=257,Re=u,Be-=257,be=256):(te=r,Re=n,be=-1),K=0,y=0,v=T,z=w,D=p,O=0,B=-1,j=1<<p,N=j-1,i===g&&j>f||i===h&&j>E)return 1;for(;;){Ke=v-O,m[y]<be?(Ae=0,_e=m[y]):m[y]>be?(Ae=Re[Be+m[y]],_e=te[ce+m[y]]):(Ae=32+64,_e=0),U=1<<v-O,X=1<<D,T=X;do X-=U,d[z+(K>>O)+X]=Ke<<24|Ae<<16|_e|0;while(X!==0);for(U=1<<v-1;K&U;)U>>=1;if(U!==0?(K&=U-1,K+=U):K=0,y++,--Fe[v]===0){if(v===A)break;v=s[l+m[y]]}if(v>p&&(K&N)!==B){for(O===0&&(O=p),z+=T,D=v-O,P=1<<D;D+O<A&&!(P-=Fe[D+O],P<=0);)D++,P<<=1;if(j+=1<<D,i===g&&j>f||i===h&&j>E)return 1;B=K&N,d[B]=p<<24|D<<16|z-w|0}}return K!==0&&(d[z+K]=v-O<<24|64<<16|0),S.bits=p,0}},LCi9:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")}function L(d,w){for(var m=0;m<w.length;m++){var S=w[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(d,S.key,S)}}function I(d,w,m){return w&&L(d.prototype,w),m&&L(d,m),d}var k=0,M=1,f=2,E=4,x=8,g=16,h=32,o=64,u=127,r=50,n=90,t=250,i=1e3,s=1e3,l=50,c=function(){function d(){V(this,d),this._target=null,this._state=u,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}return I(d,[{key:"attach",value:function(m){this.detach(),this._target=m,this._target.addEventListener("touchstart",this._boundEventHandler),this._target.addEventListener("touchmove",this._boundEventHandler),this._target.addEventListener("touchend",this._boundEventHandler),this._target.addEventListener("touchcancel",this._boundEventHandler)}},{key:"detach",value:function(){if(!this._target)return;this._stopLongpressTimeout(),this._stopTwoTouchTimeout(),this._target.removeEventListener("touchstart",this._boundEventHandler),this._target.removeEventListener("touchmove",this._boundEventHandler),this._target.removeEventListener("touchend",this._boundEventHandler),this._target.removeEventListener("touchcancel",this._boundEventHandler),this._target=null}},{key:"_eventHandler",value:function(m){var S;m.stopPropagation(),m.preventDefault();switch(m.type){case"touchstart":S=this._touchStart;break;case"touchmove":S=this._touchMove;break;case"touchend":case"touchcancel":S=this._touchEnd;break}for(var C=0;C<m.changedTouches.length;C++){var v=m.changedTouches[C];S.call(this,v.identifier,v.clientX,v.clientY)}}},{key:"_touchStart",value:function(m,S,C){if(this._hasDetectedGesture()||this._state===k){this._ignored.push(m);return}if(this._tracked.length>0&&Date.now()-this._tracked[0].started>t){this._state=k,this._ignored.push(m);return}if(this._waitingRelease){this._state=k,this._ignored.push(m);return}this._tracked.push({id:m,started:Date.now(),active:!0,firstX:S,firstY:C,lastX:S,lastY:C,angle:0});switch(this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(M|x|g),this._stopLongpressTimeout();break;case 3:this._state&=~(f|h|o);break;default:this._state=k}}},{key:"_touchMove",value:function(m,S,C){var v=this._tracked.find(function(O){return O.id===m});if(v===void 0)return;v.lastX=S,v.lastY=C;var y=S-v.firstX,T=C-v.firstY;if((v.firstX!==v.lastX||v.firstY!==v.lastY)&&(v.angle=Math.atan2(T,y)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(y,T)<r)return;if(this._state&=~(M|f|E|g),this._stopLongpressTimeout(),this._tracked.length!==1&&(this._state&=~x),this._tracked.length!==2&&(this._state&=~(h|o)),this._tracked.length===2){var A=this._tracked.find(function(O){return O.id!==m}),p=Math.hypot(A.firstX-A.lastX,A.firstY-A.lastY);if(p>r){var D=Math.abs(v.angle-A.angle);D=Math.abs((D+180)%360-180),D>n?this._state&=~h:this._state&=~o,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}},{key:"_touchEnd",value:function(m,S,C){if(this._ignored.indexOf(m)!==-1){this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&this._tracked.length===0&&(this._state=u,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=k),!this._hasDetectedGesture()&&(this._state&=~(x|h|o),this._state&=~g,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(f|E);break;case 2:this._state&=~(M|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>t&&(this._state=k),this._tracked.some(function(T){return Date.now()-T.started>i})&&(this._state=k);var v=this._tracked.find(function(T){return T.id===m});if(v.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==k)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var y=0;y<this._tracked.length;y++)this._tracked[y].active&&this._ignored.push(this._tracked[y].id);this._tracked=[],this._state=k,this._ignored.indexOf(m)!==-1&&this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&(this._state=u,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return this._state===k||this._state&this._state-1?!1:!(this._state&(M|f|E)&&this._tracked.some(function(m){return m.active}))}},{key:"_startLongpressTimeout",value:function(){var m=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout(function(){return m._longpressTimeout()},s)}},{key:"_stopLongpressTimeout",value:function(){clearTimeout(this._longpressTimeoutId),this._longpressTimeoutId=null}},{key:"_longpressTimeout",value:function(){if(this._hasDetectedGesture())throw new Error("A longpress gesture failed, conflict with a different gesture");this._state=g,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var m=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(function(){return m._twoTouchTimeout()},l)}},{key:"_stopTwoTouchTimeout",value:function(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}},{key:"_isTwoTouchTimeoutRunning",value:function(){return this._twoTouchTimeoutId!==null}},{key:"_twoTouchTimeout",value:function(){if(this._tracked.length===0)throw new Error("A pinch or two drag gesture failed, no tracked touches");var m=this._getAverageMovement(),S=Math.abs(m.x),C=Math.abs(m.y),v=this._getAverageDistance(),y=Math.abs(Math.hypot(v.first.x,v.first.y)-Math.hypot(v.last.x,v.last.y));C<y&&S<y?this._state=o:this._state=h,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(m){var S={type:this._stateToGesture(this._state)},C=this._getPosition(),v=C.last;m==="gesturestart"&&(v=C.first);switch(this._state){case h:case o:v=C.first;break}if(S.clientX=v.x,S.clientY=v.y,this._state===o){var y=this._getAverageDistance();m==="gesturestart"?(S.magnitudeX=y.first.x,S.magnitudeY=y.first.y):(S.magnitudeX=y.last.x,S.magnitudeY=y.last.y)}else if(this._state===h)if(m==="gesturestart")S.magnitudeX=0,S.magnitudeY=0;else{var T=this._getAverageMovement();S.magnitudeX=T.x,S.magnitudeY=T.y}var A=new CustomEvent(m,{detail:S});this._target.dispatchEvent(A)}},{key:"_stateToGesture",value:function(m){switch(m){case M:return"onetap";case f:return"twotap";case E:return"threetap";case x:return"drag";case g:return"longpress";case h:return"twodrag";case o:return"pinch"}throw new Error("Unknown gesture state: "+m)}},{key:"_getPosition",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture position, no tracked touches");for(var m=this._tracked.length,S=0,C=0,v=0,y=0,T=0;T<this._tracked.length;T++)S+=this._tracked[T].firstX,C+=this._tracked[T].firstY,v+=this._tracked[T].lastX,y+=this._tracked[T].lastY;return{first:{x:S/m,y:C/m},last:{x:v/m,y:y/m}}}},{key:"_getAverageMovement",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture movement, no tracked touches");var m,S;m=S=0;for(var C=this._tracked.length,v=0;v<this._tracked.length;v++)m+=this._tracked[v].lastX-this._tracked[v].firstX,S+=this._tracked[v].lastY-this._tracked[v].firstY;return{x:m/C,y:S/C}}},{key:"_getAverageDistance",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture distance, no tracked touches");var m=this._tracked[0],S=this._tracked[this._tracked.length-1],C=Math.abs(S.firstX-m.firstX),v=Math.abs(S.firstY-m.firstY),y=Math.abs(S.lastX-m.lastX),T=Math.abs(S.lastY-m.lastY);return{first:{x:C,y:v},last:{x:y,y:T}}}}]),d}();fe.default=c},LdHM:function(at,fe,oe){"use strict";oe.d(fe,"b",function(){return d}),oe.d(fe,"a",function(){return m});var V=oe("1OyB"),L=oe("vuIU"),I=oe("Ji7U"),k=oe("LK+K"),M=oe("q1tI"),f=oe("rePB"),E=oe("Ff2n"),x=oe("ODXe"),g=oe("4IlW"),h=oe("bX4T"),o=oe("YrtM"),u=oe("TSYQ"),r=oe.n(u),n=oe("+nKL"),t=oe("8OUc"),i=function(z,te){var ce=z.prefixCls,be=z.id,Fe=z.flattenOptions,Oe=z.childrenAsData,Re=z.values,Be=z.searchValue,Ke=z.multiple,Ae=z.defaultActiveFirstOption,_e=z.height,le=z.itemHeight,Ee=z.notFoundContent,pe=z.open,Ge=z.menuItemSelectedIcon,Ye=z.virtual,ze=z.onSelect,Ze=z.onToggleOpen,Je=z.onActiveValue,$e=z.onScroll,He=z.onMouseEnter,Ue="".concat(ce,"-item"),Pe=Object(o.a)(function(){return Fe},[pe,Fe],function(We,xe){return xe[0]&&We[1]!==xe[1]}),ke=M.useRef(null),re=function(xe){xe.preventDefault()},ve=function(xe){ke.current&&ke.current.scrollTo({index:xe})},ae=function(xe){for(var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ye=Pe.length,J=0;J<ye;J+=1){var ne=(xe+J*ge+ye)%ye,q=Pe[ne],me=q.group,Ce=q.data;if(!me&&!Ce.disabled)return ne}return-1},De=M.useState(function(){return ae(0)}),qe=Object(x.a)(De,2),et=qe[0],je=qe[1],ct=function(xe){je(xe);var ge=Pe[xe];if(!ge){Je(null,-1);return}Je(ge.data.value,xe)};M.useEffect(function(){ct(Ae!==!1?ae(0):-1)},[Pe.length,Be]),M.useEffect(function(){var We=setTimeout(function(){if(!Ke&&pe&&Re.size===1){var xe=Array.from(Re)[0],ge=Pe.findIndex(function(ye){var J=ye.data;return J.value===xe});ct(ge),ve(ge)}});return function(){return clearTimeout(We)}},[pe]);var he=function(xe){xe!==void 0&&ze(xe,{selected:!Re.has(xe)}),Ke||Ze(!1)};if(M.useImperativeHandle(te,function(){return{onKeyDown:function(xe){var ge=xe.which;switch(ge){case g.a.UP:case g.a.DOWN:{var ye=0;if(ge===g.a.UP?ye=-1:ge===g.a.DOWN&&(ye=1),ye!==0){var J=ae(et+ye,ye);ve(J),ct(J)}break}case g.a.ENTER:{var ne=Pe[et];ne&&!ne.data.disabled?he(ne.data.value):he(void 0),pe&&xe.preventDefault();break}case g.a.ESC:Ze(!1)}},onKeyUp:function(){},scrollTo:function(xe){ve(xe)}}}),Pe.length===0)return M.createElement("div",{role:"listbox",id:"".concat(be,"_list"),className:"".concat(Ue,"-empty"),onMouseDown:re},Ee);function Te(We){var xe=Pe[We];if(!xe)return null;var ge=xe.data||{},ye=ge.value,J=ge.label,ne=ge.children,q=Object(h.a)(ge,!0),me=Oe?ne:J;return xe?M.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},q,{key:We,role:"option",id:"".concat(be,"_list_").concat(We),"aria-selected":Re.has(ye)}),ye):null}return M.createElement(M.Fragment,null,M.createElement("div",{role:"listbox",id:"".concat(be,"_list"),style:{height:0,width:0,overflow:"hidden"}},Te(et-1),Te(et),Te(et+1)),M.createElement(n.a,{itemKey:"key",ref:ke,data:Pe,height:_e,itemHeight:le,fullHeight:!1,onMouseDown:re,onScroll:$e,virtual:Ye,onMouseEnter:He},function(We,xe){var ge,ye=We.group,J=We.groupOption,ne=We.data,q=ne.label,me=ne.key;if(ye)return M.createElement("div",{className:r()(Ue,"".concat(Ue,"-group"))},q!==void 0?q:me);var Ce=ne.disabled,G=ne.value,we=ne.title,Ne=ne.children,de=ne.style,Se=ne.className,Xe=Object(E.a)(ne,["disabled","value","title","children","style","className"]),lt=Re.has(G),tt="".concat(Ue,"-option"),st=r()(Ue,tt,Se,(ge={},Object(f.a)(ge,"".concat(tt,"-grouped"),J),Object(f.a)(ge,"".concat(tt,"-active"),et===xe&&!Ce),Object(f.a)(ge,"".concat(tt,"-disabled"),Ce),Object(f.a)(ge,"".concat(tt,"-selected"),lt),ge)),mt=Oe?Ne:q,Ct=!Ge||typeof Ge=="function"||lt;return M.createElement("div",Object.assign({},Xe,{"aria-selected":lt,className:st,title:we,onMouseMove:function(){if(et===xe||Ce)return;ct(xe)},onClick:function(){Ce||he(G)},style:de}),M.createElement("div",{className:"".concat(tt,"-content")},mt||G),M.isValidElement(Ge)||lt,Ct&&M.createElement(t.a,{className:"".concat(Ue,"-option-state"),customizeIcon:Ge,customizeIconProps:{isSelected:lt}},lt?"\u2713":null))}))},s=M.forwardRef(i);s.displayName="OptionList";var l=s,c=function(){return null};c.isSelectOption=!0;var d=c,w=function(){return null};w.isSelectOptGroup=!0;var m=w,S=oe("VTBJ"),C=oe("Zm9Q");function v(N){var z=N.key,te=N.props,ce=te.children,be=te.value,Fe=Object(E.a)(te,["children","value"]);return Object(S.a)({key:z,value:be!==void 0?be:z,children:ce},Fe)}function y(N){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(N).map(function(te,ce){if(!M.isValidElement(te)||!te.type)return null;var be=te.type.isSelectOptGroup,Fe=te.key,Oe=te.props,Re=Oe.children,Be=Object(E.a)(Oe,["children"]);return z||!be?v(te):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Fe===null?ce:Fe,"__"),label:Fe},Be),{},{options:y(Re)})}).filter(function(te){return te})}var T=oe("2Qr1"),A=oe("qNPg"),p=oe("U8pU"),D=oe("Kwbf"),O=oe("WKfj");function P(N){var z=N.mode,te=N.options,ce=N.children,be=N.backfill,Fe=N.allowClear,Oe=N.placeholder,Re=N.getInputElement,Be=N.showSearch,Ke=N.onSearch,Ae=N.defaultOpen,_e=N.autoFocus,le=N.labelInValue,Ee=N.value,pe=N.inputValue,Ge=N.optionLabelProp,Ye=z==="multiple"||z==="tags",ze=Be!==void 0?Be:Ye||z==="combobox",Ze=te||y(ce);if(Object(D.a)(z!=="tags"||Ze.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Je=Ze.some(function(Ue){return Ue.options?Ue.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(D.a)(!Je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(D.a)(z!=="combobox"||!Ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(D.a)(z==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(D.a)(z==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(D.b)(z!=="combobox"||!Re||!Fe||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ke&&!ze&&z!=="combobox"&&z!=="tags"&&Object(D.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(D.b)(!Ae||_e,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ee!=null){var $e=Object(O.d)(Ee);Object(D.a)(!le||$e.every(function(Ue){return Object(p.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(D.a)(!Ye||Array.isArray(Ee),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var He=null;Object(C.a)(ce).some(function(Ue){if(!M.isValidElement(Ue)||!Ue.type)return!1;var Pe=Ue.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var ke=Object(C.a)(Ue.props.children).every(function(re){return!M.isValidElement(re)||!Ue.type||re.type.isSelectOption?!0:(He=re.type,!1)});return!ke}return He=Pe,!0}),He&&Object(D.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(D.a)(pe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=P,K=Object(A.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:y,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:j,fillOptionsWithMissingValue:T.a}),U=function(N){Object(I.a)(te,N);var z=Object(k.a)(te);function te(){var ce;return Object(V.a)(this,te),ce=z.apply(this,arguments),ce.selectRef=M.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(L.a)(te,[{key:"render",value:function(){return M.createElement(K,Object.assign({ref:this.selectRef},this.props))}}]),te}(M.Component);U.Option=d,U.OptGroup=m;var X=U,B=fe.c=X},Lmeb:function(at,fe,oe){},Lo0S:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.initLogging=f,fe.getLogging=E,fe.Error=fe.Warn=fe.Info=fe.Debug=void 0;var V="warn",L=function(){};fe.Debug=L;var I=function(){};fe.Info=I;var k=function(){};fe.Warn=k;var M=function(){};fe.Error=M;function f(x){if(typeof x=="undefined"?x=V:V=x,fe.Debug=L=fe.Info=I=fe.Warn=k=fe.Error=M=function(){},typeof window.console!="undefined")switch(x){case"debug":fe.Debug=L=console.debug.bind(window.console);case"info":fe.Info=I=console.info.bind(window.console);case"warn":fe.Warn=k=console.warn.bind(window.console);case"error":fe.Error=M=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+x+"'")}}function E(){return V}f()},M8RZ:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return g});var V=oe("fWQN"),L=oe("mtLc"),I=oe("yKVA"),k=oe("879j"),M=oe("q1tI"),f=oe.n(M),E=oe("i8i4"),x=oe.n(E),g=function(h){Object(I.a)(u,h);var o=Object(k.a)(u);function u(r){var n;Object(V.a)(this,u),n=o.call(this,r);var t=window.document;return n.node=t.createElement("div"),t.body.appendChild(n.node),n}return Object(L.a)(u,[{key:"render",value:function(){var n=this.props.children;return Object(E.createPortal)(n,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),u}(f.a.Component)},MZdM:function(at,fe,oe){"use strict";function V(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(t){return typeof t}:V=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(r)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=x(oe("Lo0S")),I=f(oe("N/zr")),k=oe("GdRQ"),M=oe("GQ8N");function f(r){return r&&r.__esModule?r:{default:r}}function E(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return E=function(){return r},r}function x(r){if(r&&r.__esModule)return r;if(r===null||V(r)!=="object"&&typeof r!="function")return{default:r};var n=E();if(n&&n.has(r))return n.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){var l=i?Object.getOwnPropertyDescriptor(r,s):null;l&&(l.get||l.set)?Object.defineProperty(t,s,l):t[s]=r[s]}return t.default=r,n&&n.set(r,t),t}function g(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function h(r,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function o(r,n,t){return n&&h(r.prototype,n),t&&h(r,t),r}var u=function(){function r(n){if(g(this,r),this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",this._tile=null,this._tile16x16=null,this._tileX=0,this._tileY=0,L.Debug(">> Display.constructor"),this._target=n,!this._target)throw new Error("Target must be set");if(typeof this._target=="string")throw new Error("target must be a DOM element");if(!this._target.getContext)throw new Error("no getContext method");if(this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},L.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),L.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return o(r,[{key:"viewportChangePos",value:function(t,i){var s=this._viewportLoc;t=Math.floor(t),i=Math.floor(i),this._clipViewport||(t=-s.w,i=-s.h);var l=s.x+s.w-1,c=s.y+s.h-1;if(t<0&&s.x+t<0&&(t=-s.x),l+t>=this._fbWidth&&(t-=l+t-this._fbWidth+1),s.y+i<0&&(i=-s.y),c+i>=this._fbHeight&&(i-=c+i-this._fbHeight+1),t===0&&i===0)return;L.Debug("viewportChange deltaX: "+t+", deltaY: "+i),s.x+=t,s.y+=i,this._damage(s.x,s.y,s.w,s.h),this.flip()}},{key:"viewportChangeSize",value:function(t,i){(!this._clipViewport||typeof t=="undefined"||typeof i=="undefined")&&(L.Debug("Setting viewport to full display region"),t=this._fbWidth,i=this._fbHeight),t=Math.floor(t),i=Math.floor(i),t>this._fbWidth&&(t=this._fbWidth),i>this._fbHeight&&(i=this._fbHeight);var s=this._viewportLoc;if(s.w!==t||s.h!==i){s.w=t,s.h=i;var l=this._target;l.width=t,l.height=i,this.viewportChangePos(0,0),this._damage(s.x,s.y,s.w,s.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(t,i){this._prevDrawStyle="",this._fbWidth=t,this._fbHeight=i;var s=this._backbuffer;if(s.width!==t||s.height!==i){var l=null;s.width>0&&s.height>0&&(l=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==t&&(s.width=t),s.height!==i&&(s.height=i),l&&this._drawCtx.putImageData(l,0,0)}var c=this._viewportLoc;this.viewportChangeSize(c.w,c.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(t,i,s,l){t<this._damageBounds.left&&(this._damageBounds.left=t),i<this._damageBounds.top&&(this._damageBounds.top=i),t+s>this._damageBounds.right&&(this._damageBounds.right=t+s),i+l>this._damageBounds.bottom&&(this._damageBounds.bottom=i+l)}},{key:"flip",value:function(t){if(this._renderQ.length!==0&&!t)this._renderQPush({type:"flip"});else{var i=this._damageBounds.left,s=this._damageBounds.top,l=this._damageBounds.right-i,c=this._damageBounds.bottom-s,d=i-this._viewportLoc.x,w=s-this._viewportLoc.y;d<0&&(l+=d,i-=d,d=0),w<0&&(c+=w,s-=w,w=0),d+l>this._viewportLoc.w&&(l=this._viewportLoc.w-d),w+c>this._viewportLoc.h&&(c=this._viewportLoc.h-w),l>0&&c>0&&this._targetCtx.drawImage(this._backbuffer,i,s,l,c,d,w,l,c),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){this._renderQ.length===0?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(t,i,s,l,c,d){this._renderQ.length!==0&&!d?this._renderQPush({type:"fill",x:t,y:i,width:s,height:l,color:c}):(this._setFillColor(c),this._drawCtx.fillRect(t,i,s,l),this._damage(t,i,s,l))}},{key:"copyImage",value:function(t,i,s,l,c,d,w){this._renderQ.length!==0&&!w?this._renderQPush({type:"copy",oldX:t,oldY:i,x:s,y:l,width:c,height:d}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,t,i,c,d,s,l,c,d),this._damage(s,l,c,d))}},{key:"imageRect",value:function(t,i,s,l,c,d){if(s===0||l===0)return;var w=new Image;w.src="data: "+c+";base64,"+I.default.encode(d),this._renderQPush({type:"img",img:w,x:t,y:i,width:s,height:l})}},{key:"startTile",value:function(t,i,s,l,c){this._tileX=t,this._tileY=i,s===16&&l===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(s,l);for(var d=c[2],w=c[1],m=c[0],S=this._tile.data,C=0;C<s*l*4;C+=4)S[C]=d,S[C+1]=w,S[C+2]=m,S[C+3]=255}},{key:"subTile",value:function(t,i,s,l,c){for(var d=c[2],w=c[1],m=c[0],S=t+s,C=i+l,v=this._tile.data,y=this._tile.width,T=i;T<C;T++)for(var A=t;A<S;A++){var p=(A+T*y)*4;v[p]=d,v[p+1]=w,v[p+2]=m,v[p+3]=255}}},{key:"finishTile",value:function(){this._drawCtx.putImageData(this._tile,this._tileX,this._tileY),this._damage(this._tileX,this._tileY,this._tile.width,this._tile.height)}},{key:"blitImage",value:function(t,i,s,l,c,d,w){if(this._renderQ.length!==0&&!w){var m=new Uint8Array(s*l*4);m.set(new Uint8Array(c.buffer,0,m.length)),this._renderQPush({type:"blit",data:m,x:t,y:i,width:s,height:l})}else this._bgrxImageData(t,i,s,l,c,d)}},{key:"blitRgbImage",value:function(t,i,s,l,c,d,w){if(this._renderQ.length!==0&&!w){var m=new Uint8Array(s*l*3);m.set(new Uint8Array(c.buffer,0,m.length)),this._renderQPush({type:"blitRgb",data:m,x:t,y:i,width:s,height:l})}else this._rgbImageData(t,i,s,l,c,d)}},{key:"blitRgbxImage",value:function(t,i,s,l,c,d,w){if(this._renderQ.length!==0&&!w){var m=new Uint8Array(s*l*4);m.set(new Uint8Array(c.buffer,0,m.length)),this._renderQPush({type:"blitRgbx",data:m,x:t,y:i,width:s,height:l})}else this._rgbxImageData(t,i,s,l,c,d)}},{key:"drawImage",value:function(t,i,s){this._drawCtx.drawImage(t,i,s),this._damage(i,s,t.width,t.height)}},{key:"autoscale",value:function(t,i){var s;if(t===0||i===0)s=0;else{var l=this._viewportLoc,c=t/i,d=l.w/l.h;d>=c?s=t/l.w:s=i/l.h}this._rescale(s)}},{key:"_rescale",value:function(t){this._scale=t;var i=this._viewportLoc,s=t*i.w+"px",l=t*i.h+"px";(this._target.style.width!==s||this._target.style.height!==l)&&(this._target.style.width=s,this._target.style.height=l)}},{key:"_setFillColor",value:function(t){var i="rgb("+t[2]+","+t[1]+","+t[0]+")";i!==this._prevDrawStyle&&(this._drawCtx.fillStyle=i,this._prevDrawStyle=i)}},{key:"_rgbImageData",value:function(t,i,s,l,c,d){for(var w=this._drawCtx.createImageData(s,l),m=w.data,S=0,C=d;S<s*l*4;S+=4,C+=3)m[S]=c[C],m[S+1]=c[C+1],m[S+2]=c[C+2],m[S+3]=255;this._drawCtx.putImageData(w,t,i),this._damage(t,i,w.width,w.height)}},{key:"_bgrxImageData",value:function(t,i,s,l,c,d){for(var w=this._drawCtx.createImageData(s,l),m=w.data,S=0,C=d;S<s*l*4;S+=4,C+=4)m[S]=c[C+2],m[S+1]=c[C+1],m[S+2]=c[C],m[S+3]=255;this._drawCtx.putImageData(w,t,i),this._damage(t,i,w.width,w.height)}},{key:"_rgbxImageData",value:function(t,i,s,l,c,d){var w;k.supportsImageMetadata?w=new ImageData(new Uint8ClampedArray(c.buffer,c.byteOffset,s*l*4),s,l):(w=this._drawCtx.createImageData(s,l),w.data.set(new Uint8ClampedArray(c.buffer,c.byteOffset,s*l*4))),this._drawCtx.putImageData(w,t,i),this._damage(t,i,w.width,w.height)}},{key:"_renderQPush",value:function(t){this._renderQ.push(t),this._renderQ.length===1&&this._scanRenderQ()}},{key:"_resumeRenderQ",value:function(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}},{key:"_scanRenderQ",value:function(){for(var t=!0;t&&this._renderQ.length>0;){var i=this._renderQ[0];switch(i.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(i.oldX,i.oldY,i.x,i.y,i.width,i.height,!0);break;case"fill":this.fillRect(i.x,i.y,i.width,i.height,i.color,!0);break;case"blit":this.blitImage(i.x,i.y,i.width,i.height,i.data,0,!0);break;case"blitRgb":this.blitRgbImage(i.x,i.y,i.width,i.height,i.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(i.x,i.y,i.width,i.height,i.data,0,!0);break;case"img":if(i.img.complete&&i.img.width!==0&&i.img.height!==0){if(i.img.width!==i.width||i.img.height!==i.height){L.Error("Decoded image has incorrect dimensions. Got "+i.img.width+"x"+i.img.height+". Expected "+i.width+"x"+i.height+".");return}this.drawImage(i.img,i.x,i.y)}else i.img._noVNCDisplay=this,i.img.addEventListener("load",this._resumeRenderQ),t=!1;break}t&&this._renderQ.shift()}this._renderQ.length===0&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(t){this._rescale(t)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(t){this._clipViewport=t;var i=this._viewportLoc;this.viewportChangeSize(i.w,i.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),r}();fe.default=u},Mmt2:function(at,fe,oe){"use strict";function V(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(r){return typeof r}:V=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},V(o)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return I=function(){return o},o}function k(o){if(o&&o.__esModule)return o;if(o===null||V(o)!=="object"&&typeof o!="function")return{default:o};var u=I();if(u&&u.has(o))return u.get(o);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var i=n?Object.getOwnPropertyDescriptor(o,t):null;i&&(i.get||i.set)?Object.defineProperty(r,t,i):r[t]=o[t]}return r.default=o,u&&u.set(o,r),r}function M(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}function f(o,u){for(var r=0;r<u.length;r++){var n=u[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}function E(o,u,r){return u&&f(o.prototype,u),r&&f(o,r),o}var x=!1,g=40*1024*1024,h=function(){function o(){M(this,o),this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=1024*1024*4,this._rQ=null,this._sQbufferSize=1024*10,this._sQlen=0,this._sQ=null,this._eventHandlers={message:function(){},open:function(){},close:function(){},error:function(){}}}return E(o,[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(r){this._rQi+=r}},{key:"rQshift8",value:function(){return this._rQshift(1)}},{key:"rQshift16",value:function(){return this._rQshift(2)}},{key:"rQshift32",value:function(){return this._rQshift(4)}},{key:"_rQshift",value:function(r){for(var n=0,t=r-1;t>=0;t--)n+=this._rQ[this._rQi++]<<t*8;return n}},{key:"rQshiftStr",value:function(r){typeof r=="undefined"&&(r=this.rQlen);for(var n="",t=0;t<r;t+=4096){var i=this.rQshiftBytes(Math.min(4096,r-t));n+=String.fromCharCode.apply(null,i)}return n}},{key:"rQshiftBytes",value:function(r){return typeof r=="undefined"&&(r=this.rQlen),this._rQi+=r,new Uint8Array(this._rQ.buffer,this._rQi-r,r)}},{key:"rQshiftTo",value:function(r,n){n===void 0&&(n=this.rQlen),r.set(new Uint8Array(this._rQ.buffer,this._rQi,n)),this._rQi+=n}},{key:"rQslice",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+r,n-r)}},{key:"rQwait",value:function(r,n,t){if(this.rQlen<n){if(t){if(this._rQi<t)throw new Error("rQwait cannot backup "+t+" bytes");this._rQi-=t}return!0}return!1}},{key:"flush",value:function(){this._sQlen>0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}},{key:"send",value:function(r){this._sQ.set(r,this._sQlen),this._sQlen+=r.length,this.flush()}},{key:"sendString",value:function(r){this.send(r.split("").map(function(n){return n.charCodeAt(0)}))}},{key:"off",value:function(r){this._eventHandlers[r]=function(){}}},{key:"on",value:function(r,n){this._eventHandlers[r]=n}},{key:"_allocateBuffers",value:function(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}},{key:"init",value:function(){this._allocateBuffers(),this._rQi=0,this._websocket=null}},{key:"open",value:function(r,n){var t=this;this.init(),this._websocket=new WebSocket(r,n),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){L.Debug(">> WebSock.onopen"),t._websocket.protocol&&L.Info("Server choose sub-protocol: "+t._websocket.protocol),t._eventHandlers.open(),L.Debug("<< WebSock.onopen")},this._websocket.onclose=function(i){L.Debug(">> WebSock.onclose"),t._eventHandlers.close(i),L.Debug("<< WebSock.onclose")},this._websocket.onerror=function(i){L.Debug(">> WebSock.onerror: "+i),t._eventHandlers.error(i),L.Debug("<< WebSock.onerror: "+i)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(L.Info("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=function(){})}},{key:"_encodeMessage",value:function(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}},{key:"_expandCompactRQ",value:function(r){var n=(this._rQlen-this._rQi+r)*8,t=this._rQbufferSize<n;if(t&&(this._rQbufferSize=Math.max(this._rQbufferSize*2,n)),this._rQbufferSize>g&&(this._rQbufferSize=g,this._rQbufferSize-this.rQlen<r))throw new Error("Receive Queue buffer exceeded "+g+" bytes, and the new message could not fit");if(t){var i=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(i,this._rQi,this._rQlen-this._rQi))}else x?this._rQ.copyWithin(0,this._rQi,this._rQlen):this._rQ.set(new Uint8Array(this._rQ.buffer,this._rQi,this._rQlen-this._rQi));this._rQlen=this._rQlen-this._rQi,this._rQi=0}},{key:"_DecodeMessage",value:function(r){var n=new Uint8Array(r);n.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(n.length),this._rQ.set(n,this._rQlen),this._rQlen+=n.length}},{key:"_recvMessage",value:function(r){this._DecodeMessage(r.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):L.Debug("Ignoring empty message")}},{key:"sQ",get:function(){return this._sQ}},{key:"rQ",get:function(){return this._rQ}},{key:"rQi",get:function(){return this._rQi},set:function(r){this._rQi=r}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),o}();fe.default=h},"N/zr":function(at,fe,oe){"use strict";function V(f){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(x){return typeof x}:V=function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},V(f)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var L=k(oe("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var f=new WeakMap;return I=function(){return f},f}function k(f){if(f&&f.__esModule)return f;if(f===null||V(f)!=="object"&&typeof f!="function")return{default:f};var E=I();if(E&&E.has(f))return E.get(f);var x={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in f)if(Object.prototype.hasOwnProperty.call(f,h)){var o=g?Object.getOwnPropertyDescriptor(f,h):null;o&&(o.get||o.set)?Object.defineProperty(x,h,o):x[h]=f[h]}return x.default=f,E&&E.set(f,x),x}var M={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var x="",g=E.length,h=g%3,o=0;o<g-2;o+=3)x+=this.toBase64Table[E[o]>>2],x+=this.toBase64Table[((E[o]&3)<<4)+(E[o+1]>>4)],x+=this.toBase64Table[((E[o+1]&15)<<2)+(E[o+2]>>6)],x+=this.toBase64Table[E[o+2]&63];var u=g-h;return h===2?(x+=this.toBase64Table[E[u]>>2],x+=this.toBase64Table[((E[u]&3)<<4)+(E[u+1]>>4)],x+=this.toBase64Table[(E[u+1]&15)<<2],x+=this.toBase64Table[64]):h===1&&(x+=this.toBase64Table[E[u]>>2],x+=this.toBase64Table[(E[u]&3)<<4],x+=this.toBase64Table[64],x+=this.toBase64Table[64]),x},toBinaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode:function(E){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,g=E.indexOf("=")-x;g<0&&(g=E.length-x);for(var h=(g>>2)*3+Math.floor(g%4/1.5),o=new Array(h),u=0,r=0,n=0,t=x;t<E.length;t++){var i=this.toBinaryTable[E.charCodeAt(t)&127],s=E.charAt(t)===this.base64Pad;if(i===-1){L.Error("Illegal character code "+E.charCodeAt(t)+" at position "+t);continue}r=r<<6|i,u+=6,u>=8&&(u-=8,s||(o[n++]=r>>u&255),r&=(1<<u)-1)}if(u){var l=new Error("Corrupted base64 string");throw l.name="Base64-Error",l}return o}};fe.default=M},NBmB:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.encodingName=L,fe.encodings=void 0;var V={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingTightPNG:-260,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};fe.encodings=V;function L(I){switch(I){case V.encodingRaw:return"Raw";case V.encodingCopyRect:return"CopyRect";case V.encodingRRE:return"RRE";case V.encodingHextile:return"Hextile";case V.encodingTight:return"Tight";case V.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+I+"]"}}},OLES:function(at,fe,oe){"use strict";var V=oe("U8pU"),L=oe("VTBJ"),I=oe("Ff2n"),k=oe("q1tI"),M=oe("uciX"),f=oe("7ixt"),E=function(r){var n=r.overlay,t=r.prefixCls,i=r.id,s=r.overlayInnerStyle;return k.createElement("div",{className:"".concat(t,"-inner"),id:i,role:"tooltip",style:s},typeof n=="function"?n():n)},x=E,g=function(r,n){var t=r.overlayClassName,i=r.trigger,s=i===void 0?["hover"]:i,l=r.mouseEnterDelay,c=l===void 0?0:l,d=r.mouseLeaveDelay,w=d===void 0?.1:d,m=r.overlayStyle,S=r.prefixCls,C=S===void 0?"rc-tooltip":S,v=r.children,y=r.onVisibleChange,T=r.afterVisibleChange,A=r.transitionName,p=r.animation,D=r.placement,O=D===void 0?"right":D,P=r.align,j=P===void 0?{}:P,K=r.destroyTooltipOnHide,U=K===void 0?!1:K,X=r.defaultVisible,B=r.getTooltipContainer,N=r.overlayInnerStyle,z=Object(I.a)(r,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(k.useRef)(null);Object(k.useImperativeHandle)(n,function(){return te.current});var ce=Object(L.a)({},z);"visible"in r&&(ce.popupVisible=r.visible);var be=function(){var Ke=r.arrowContent,Ae=Ke===void 0?null:Ke,_e=r.overlay,le=r.id;return[k.createElement("div",{className:"".concat(C,"-arrow"),key:"arrow"},Ae),k.createElement(x,{key:"content",prefixCls:C,id:le,overlay:_e,overlayInnerStyle:N})]},Fe=!1,Oe=!1;if(typeof U=="boolean")Fe=U;else if(U&&Object(V.a)(U)==="object"){var Re=U.keepParent;Fe=Re===!0,Oe=Re===!1}return k.createElement(M.a,Object.assign({popupClassName:t,prefixCls:C,popup:be,action:s,builtinPlacements:f.a,popupPlacement:O,ref:te,popupAlign:j,getPopupContainer:B,onPopupVisibleChange:y,afterPopupVisibleChange:T,popupTransitionName:A,popupAnimation:p,defaultPopupVisible:X,destroyPopupOnHide:Fe,autoDestroy:Oe,mouseLeaveDelay:w,popupStyle:m,mouseEnterDelay:c},ce),v)},h=Object(k.forwardRef)(g),o=fe.a=h},Ot1p:function(at,fe,oe){"use strict";var V=oe("2qtc"),L=oe("kLXV"),I=oe("rAM+"),k=oe("miYZ"),M=oe("tsqr"),f=oe("9og8"),E=oe("tJVT"),x=oe("jrin"),g=oe("WmNS"),h=oe.n(g),o=oe("q1tI"),u=oe.n(o),r=oe("VrN/"),n=oe.n(r),t=oe("bdgK"),i=oe("p77/"),s=oe("Bd2K"),l=oe("ELLl"),c=oe("19Vz"),d=oe("lZu9"),w=oe("+NIl"),m=oe("kSUc"),S=oe("9Bee"),C=function(Ce){var G=Ce.value,we=G===void 0?"":G,Ne=Ce.className,de=Ce.showTextOnly,Se=Ce.showLines,Xe=Ce.style,lt=Xe===void 0?{}:Xe,tt=Object(o.useMemo)(function(){return""},[we]);return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},v=oe("0Owb"),y=oe("dejd"),T=oe("C+DQ"),A=oe("1vsH"),p=oe("m3rI"),D=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function O(Ce){var G=Ce.onActionCallback,we=Ce.title,Ne=Ce.icon,de=Ce.actionName,Se=Ce.className,Xe=Se===void 0?"":Se,lt=Ce.children;function tt(){G(de)}return u.a.createElement("a",{title:we,className:Xe,onClick:tt},u.a.createElement("i",{className:"md-iconfont ".concat(Ne)}),lt)}var P=function(Ce){var G=Ce.watch,we=Ce.showNullButton,Ne=Ce.onActionCallback,de=Ce.fullScreen,Se=Ce.insertTemp,Xe=Ce.hidetoolBar,lt=Ce.uuid,tt=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(A.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(A.F)("_educoder_session"),"&key=").concat(lt,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var st=[].concat(D,[{title:"".concat(G?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(G?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return u.a.createElement("ul",{className:"markdown-toolbar-container"},!Xe&&st.map(function(mt,Ct){return u.a.createElement("li",{key:Ct},mt.actionName?u.a.createElement(O,Object(v.a)({},mt,{onActionCallback:Ne})):u.a.createElement("span",{className:"v-line"}))}),we?u.a.createElement("li",null,u.a.createElement(O,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ne},u.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Se&&u.a.createElement("li",null,u.a.createElement(O,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Se),onActionCallback:Ne},u.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),u.a.createElement("li",{className:"btn-full-screen"},u.a.createElement(O,{icon:"".concat(de?"icon-shrink":"icon-enlarge"),title:de?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ne})))},j=oe("M8RZ"),K=oe("+L6B"),U=oe("2/Rp"),X=oe("y8nQ"),B=oe("Vl3Y"),N=oe("5NDa"),z=oe("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},ce=function(Ce){var G=Ce.callback,we=Ce.onCancel;function Ne(de){G(de)}return u.a.createElement(B.a,Object(v.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ne}),u.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},u.a.createElement(z.a,null)),u.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},u.a.createElement(z.a,null)),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),u.a.createElement(U.a,{type:"ghost",onClick:we},"\u53D6\u6D88")))},be=oe("7ahc"),Fe=oe("HmJG"),Oe=oe("BjJ7"),Re=B.a.useForm,Be={width:280,marginRight:10},Ke={labelCol:{span:5},wrapperCol:{span:19}},Ae=function(Ce){var G=Ce.callback,we=Ce.onCancel,Ne=Re(),de=Object(E.a)(Ne,1),Se=de[0];function Xe(st){G(st)}function lt(st,mt){if(st.status===-1){M.b.error(st.message);return}Se.setFieldsValue({src:"/api/attachments/".concat(st.id),type:mt.type})}function tt(st){var mt=st.target.files[0];le(mt,lt)}return u.a.createElement(B.a,Object(v.a)({form:Se},Ke,{className:"upload-image-panel",onFinish:Xe}),u.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},u.a.createElement("div",{className:"flex-container"},u.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},u.a.createElement(z.a,{style:Be})),u.a.createElement(_e,{onFileChange:tt}))),u.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},u.a.createElement(z.a,{style:{width:264}})),u.a.createElement(B.a.Item,{style:{textAlign:"right"}},u.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),u.a.createElement(U.a,{type:"ghost",onClick:we},"\u53D6\u6D88")))};function _e(Ce){var G=Ce.onFileChange;return u.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",u.a.createElement("input",{type:"file",onChange:G}))}function le(Ce,G){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var we=new FormData;we.append("editormd-image-file",Ce),we.append("file_param_name","editormd-image-file"),we.append("byxhr","true");var Ne=new window.XMLHttpRequest;Ne.withCredentials=!0,Ne.addEventListener("load",function(de){G(JSON.parse(de.target.responseText),Ce)},!1),Ne.addEventListener("error",function(de){console.error(de)},!1),Ne.open("POST","".concat(Oe.a,"/api/attachments.json")),Ne.send(we)}var Ee=oe("giR+"),pe=oe("fyUT"),Ge=oe("7Kak"),Ye=oe("9yH6"),ze=Ye.a.Group,Ze={margin:"0 8px"},Je=function(Ce){var G=Ce.callback,we=Ce.onCancel;function Ne(de){G(de)}return u.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ne},u.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},u.a.createElement("span",{style:Ze},"\u5355\u5143\u683C\u6570\uFF1A"),u.a.createElement("span",{style:Ze},"\u884C\u6570"),u.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},u.a.createElement(pe.a,null)),u.a.createElement("span",{style:Ze},"\u5217\u6570"),u.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},u.a.createElement(pe.a,null))),u.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},u.a.createElement("span",{style:Ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),u.a.createElement(B.a.Item,{name:"align"},u.a.createElement(ze,null,u.a.createElement(Ye.a,{value:"default"},u.a.createElement("i",{className:"fa fa-align-justify"})),u.a.createElement(Ye.a,{value:"left"},u.a.createElement("i",{className:"fa fa-align-left"})),u.a.createElement(Ye.a,{value:"center"},u.a.createElement("i",{className:"fa fa-align-center"})),u.a.createElement(Ye.a,{value:"right"},u.a.createElement("i",{className:"fa fa-align-right"}))))),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),u.a.createElement(U.a,{type:"ghost",onClick:we},"\u53D6\u6D88")))},$e=oe("ErOA"),He=oe("7Cbv"),Ue="link",Pe="upload-image",ke="code-block",re="add-table",ve="------------",ae={default:ve,left:":".concat(ve),center:":".concat(ve,":"),right:"".concat(ve,":")},De=oe("9VGf"),qe,et;function je(){}var ct=0,he=1e4,Te="\u2581",We=`
**\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 xe(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var ge=navigator.platform.toUpperCase().indexOf("MAC")>=0,ye=ge?"Cmd":"Ctrl",J=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ne=(qe={},Object(x.a)(qe,ye+"-B","bold"),Object(x.a)(qe,ye+"-I","italic"),qe),q=(et={},Object(x.a)(et,Ue,"\u6DFB\u52A0\u94FE\u63A5"),Object(x.a)(et,ke,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(x.a)(et,Pe,"\u6DFB\u52A0\u6587\u4EF6"),Object(x.a)(et,re,"\u6DFB\u52A0\u8868\u683C"),et),me=fe.a=function(Ce){var G=Ce.defaultValue,we=G===void 0?"":G,Ne=Ce.onChange,de=Ce.width,Se=de===void 0?"100%":de,Xe=Ce.height,lt=Xe===void 0?400:Xe,tt=Ce.miniToolbar,st=tt===void 0?!1:tt,mt=Ce.isFocus,Ct=mt===void 0?!1:mt,_t=Ce.watch,ft=Ce.insertTemp,kt=Ce.mode,Nt=kt===void 0?"markdown":kt,nt=Ce.id,Tt=nt===void 0?"markdown-editor-id":nt,It=Ce.showResizeBar,wt=It===void 0?!1:It,Ft=Ce.noStorage,zt=Ft===void 0?!1:Ft,ui=Ce.showNullButton,Pt=ui===void 0?!1:ui,xt=Ce.hidetoolBar,zi=xt===void 0?!1:xt,tr=Ce.fullScreen,xi=tr===void 0?!1:tr,Ht=Ce.onBlur,Ki=Ce.onCMBeforeChange,Yi=Ce.onFullScreen,fr=Ce.className,ht=fr===void 0?"":fr,Dt=Ce.disablePaste,pr=Dt===void 0?!1:Dt,mr=Ce.placeholder,gr=mr===void 0?"":mr,vr=Ce.values,$=vr===void 0?"":vr,F=Object(o.useState)(null),H=Object(E.a)(F,2),Y=H[0],se=H[1],Z=Object(o.useState)(we),Me=Object(E.a)(Z,2),rt=Me[0],pt=Me[1],Et=Object(o.useState)(_t),ot=Object(E.a)(Et,2),Rt=ot[0],Gt=ot[1],ei=Object(o.useState)(xi),Fi=Object(E.a)(ei,2),Ei=Fi[0],wi=Fi[1],Qi=Object(o.useState)(""),Or=Object(E.a)(Qi,2),di=Or[0],Wi=Or[1],or=Object(o.useState)(0),lr=Object(E.a)(or,2),Ui=lr[0],Ir=lr[1],_r=Object(o.useState)(lt),Xr=Object(E.a)(_r,2),zr=Xr[0],qi=Xr[1],Gi=Object(o.useState)(!1),yr=Object(E.a)(Gi,2),cn=yr[0],br=yr[1],ni=Object(o.useRef)(Object(He.a)()),Vt=Object(o.useRef)(!1),_i=Object(o.useRef)(),Kt=Object(o.useRef)(),si=Object(o.useRef)(),qt=Object(o.useRef)(),ir=Object(o.useRef)(),fi=function(){var St=Object(f.a)(h.a.mark(function Mt(){var Lt,Bt;return h.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object($e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ni.current}});case 2:Bt=$t.sent,Bt!=null&&(Lt=Bt.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Y,Kt),Bt.attachments.map(function(jt){jt.content_type.indexOf("image")>-1?Y.replaceSelection("![,](/api/attachments/".concat(jt.id,"?type=").concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?Y.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):jt.content_type.indexOf("pdf")>-1?Y.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,'&disposition=inline" target="_blank">').concat(jt.name,"</a>")):Y.replaceSelection("[".concat(jt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}));case 4:case"end":return $t.stop()}},Mt)}));return function(){return St.apply(this,arguments)}}();Object(o.useEffect)(function(){pt($),Y==null||Y.setValue($)},[$]),Object(o.useEffect)(function(){Yi==null||Yi(Ei)},[Ei]),Object(o.useEffect)(function(){if(Kt.current){var St=n.a.fromTextArea(Kt.current,{mode:Nt,lineNumbers:!st,lineWrapping:!0,value:we,autoCloseTags:!0,autoCloseBrackets:!0});Ct&&St.focus();function Mt(Lt,Bt){if(pr){Bt.preventDefault();return}var Xt=Bt.clipboardData;if(Xt){var $t=Xt.types.toString(),jt=Xt.items;if($t==="Files"||Xt.types.indexOf("Files")>-1){if(Bt.preventDefault(),Nt=="stex")return;try{var hi,ki=jt[1];((hi=jt[0])===null||hi===void 0?void 0:hi.kind)==="file"&&(ki=jt[0]);var Wt=ki.getAsFile(),ur=Wt.name.split(".").pop();le(Wt,function(Yt){if(Yt.id){var Oi,Si,Vi;(Wt==null||((Oi=Wt.type)===null||Oi===void 0)?void 0:Oi.indexOf("image"))>-1?St.replaceSelection("![,](/api/attachments/".concat(Yt.id,"?type=").concat(Yt.content_type,")")):(Wt==null||((Si=Wt.type)===null||Si===void 0)?void 0:Si.indexOf("video"))>-1?St.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,'"></video>')):(Wt==null||((Vi=Wt.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?St.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Wt.type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):J.includes(ur)?St.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,'?type=office&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):St.replaceSelection("[".concat(Wt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})}catch(Yt){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return St.on("paste",Mt),St.on("dragleave",function(Lt,Bt){si.current.classList.remove("mouse-hover-md")}),St.on("dragover",function(Lt,Bt){si.current.classList.add("mouse-hover-md")}),St.on("drop",function(Lt,Bt){si.current.classList.add("mouse-hover-md");var Xt;if(Xt=Bt.dataTransfer.files,Xt.length>0){Bt.preventDefault(),Bt.stopPropagation();for(var $t=function(ki){var Wt=Xt[ki],ur=Wt.name.split(".").pop();le(Wt,function(Yt){if(Yt.id){var Oi,Si,Vi;(Wt==null||((Oi=Wt.type)===null||Oi===void 0)?void 0:Oi.indexOf("image"))>-1?St.replaceSelection("![,](/api/attachments/".concat(Yt.id,"?type=").concat(Yt.content_type,")")):(Wt==null||((Si=Wt.type)===null||Si===void 0)?void 0:Si.indexOf("video"))>-1?St.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,'"></video>')):(Wt==null||((Vi=Wt.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?St.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Wt.type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):J.includes(ur)?St.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,'?type=office&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):St.replaceSelection("[".concat(Wt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})},jt=0;jt<Xt.length;jt++)$t(jt)}}),se(St),function(){St.off("paste",Mt)}}},[]);var Ai=Object(o.useCallback)(function(){if(si.current)try{}catch(St){console.log(St,"---- to set md editor body height")}},[zr,si,Ei]);Object(o.useEffect)(function(){function St(){var Lt=new t.default(function(Bt){var Xt=Object(I.a)(Bt),$t;try{for(Xt.s();!($t=Xt.n()).done;){var jt=$t.value;(jt.target.offsetHeight>0||jt.target.offsetWidth>0)&&(Ai(),Y.setSize("100%","100%"),Y.refresh())}}catch(hi){Xt.e(hi)}finally{Xt.f()}});return Lt.observe(Kt.current.parentElement),Lt}if(Y){var Mt=St();return function(){Mt.unobserve(Kt.current.parentElement)}}},[Y,Ai]),Object(o.useEffect)(function(){if(Y){for(var St=[],Mt=function(){var jt=Bt[Lt];Xt=Object(E.a)(jt,2);var hi=Xt[0],ki=Xt[1],Wt=Object(x.a)({},hi,function(){Gr(ki)});St.push(Wt),Y.addKeyMap(Wt)},Lt=0,Bt=Object.entries(ne);Lt<Bt.length;Lt++){var Xt;Mt()}return _i.current=setInterval(function(){Vt.current&&fi()},4e3),function(){clearInterval(_i.current);var $t=Object(I.a)(St),jt;try{for($t.s();!(jt=$t.n()).done;){var hi=jt.value;Y.removeKeyMap(hi)}}catch(ki){$t.e(ki)}finally{$t.f()}}}},[Y]),Object(o.useEffect)(function(){xi!==Ei&&wi(xi)},[xi]),Object(De.a)(function(){if(!zt&&Ui>0){var St=new Date().getTime(),Mt=window.sessionStorage.getItem(Tt);St>=Ui+he&&(!Mt||Mt!==rt)&&(window.sessionStorage.setItem(Tt,rt),br(!0))}},he),Object(o.useEffect)(function(){Gt(_t)},[Y,_t]),Object(o.useEffect)(function(){Y&&(Ct&&Y.focus())},[Y,Ct]),Object(o.useEffect)(function(){if(Rt&&Y){var St=Y.getScrollerElement();function Mt(Lt){var Bt=Lt.target;if(ir.current){var Xt=Bt.scrollTop/Bt.scrollHeight;ir.current.scrollTop=ir.current.scrollHeight*Xt}}return St.addEventListener("scroll",Mt),function(){St.removeEventListener("scroll",Mt)}}},[Y,Rt]),Object(o.useEffect)(function(){if(Y&&Ki){function St(Mt,Lt){Ki(Mt,Lt)}return Y.on("beforeChange",St),function(){Y.off("beforeChange",St)}}},[Y,Ki]),Object(o.useEffect)(function(){if(Y&&Ht){function St(){Ht(Y.getValue())}return Y.on("blur",St),function(){Y.off("blur",St)}}},[Y,Ht]),Object(o.useEffect)(function(){if(Y){function St(Mt){var Lt=Mt.getValue();pt(Lt),Ir(new Date().getTime()),Mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ne&&Ne(Lt)}return Y.on("change",St),function(){Y.off("change",St)}}},[Y,Ne]),Object(o.useEffect)(function(){Y&&(we==null?(Y.setValue(""),pt("")):we!==Y.getValue()&&(Y.setValue(we),pt(we),Y.setCursor(Y.lineCount(),0)))},[Y,we]);var Gr=Object(o.useCallback)(function(St){var Mt=Y.getCursor(),Lt=Y.getSelection(),Bt=Lt.split(`
`);switch(St){case"bold":return Y.replaceSelection("**"+Lt+"**"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+Lt+"*"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+Lt+"`"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&Y.setCursor(Mt.line,Mt.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+Lt+"\n```"),Y.setCursor(Mt.line+1,Lt.length+1),Y.focus();case"line-break":return Y.replaceSelection(`<br/>
`),Y.focus();case"list-ul":return Lt===""?Y.replaceSelection("- "+Lt):Y.replaceSelection(Bt.map(function(Xt){return Xt===""?"":"- ".concat(Xt)}).join(`
`)),Y.focus();case"list-ol":return Lt===""?Y.replaceSelection("1. "+Lt):Y.replaceSelection(Bt.map(function(Xt,$t){return Xt===""?"":"".concat($t+1,". ").concat(Xt)}).join(`
`)),Y.focus();case"add-null-ch":return Lt===""&&Y.setCursor(Mt.line,Mt.ch+1),Y.replaceSelection(Te),Y.focus();case"inster-template-1":return Lt===""&&Y.setCursor(Mt.line,Mt.ch),Y.replaceSelection(We),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return Gt(!Rt),Y.focus();case"trigger-full-screen":return wi(!Ei),Y.focus();case Ue:Wi(Ue);return;case ke:Wi(ke);return;case Pe:Wi(Pe);return;case re:Wi(re);return;default:throw new Error}},[Y,Rt,Ei]),xr=Object(o.useCallback)(function(St){Wi("");switch(di){case Ue:var Mt=St.title,Lt=St.link;return Y.replaceSelection("[".concat(Mt,"](").concat(Lt,")")),Y.focus();case ke:var Bt=St.language,Xt=St.content;return Y.replaceSelection(["```"+Bt,Xt,"```"].join(`
`)),Y.focus();case Pe:var $t=St.src,jt=St.alt;return jt?Y.replaceSelection("![ ".concat(jt," ]( ").concat($t,' "').concat(jt,'" )')):Y.replaceSelection("![,](".concat($t,")")),Y.focus();case re:for(var hi=St.row,ki=St.col,Wt=St.align,ur=`
`,Yt=0;Yt<hi;Yt++){for(var Oi=[],Si=[],Vi=0;Vi<ki;Vi++)Yt===1&&Si.push(ae[Wt]),Oi.push(" ");Yt===1&&(ur+="| ".concat(Si.join(" | "),` |
`)),ur+="| ".concat(Oi.join(ki===1?"":" | "),` |
`)}return Y.replaceSelection(ur+`
`),Y.focus();default:throw new Error}},[Y,di]),dn=Object(o.useMemo)(function(){switch(di){case Ue:return u.a.createElement(ce,{callback:xr,onCancel:Er});case ke:return u.a.createElement(be.b,{callback:xr,onCancel:Er});case Pe:return u.a.createElement(Ae,{callback:xr,onCancel:Er});case re:return u.a.createElement(Je,{callback:xr,onCancel:Er});default:return null}},[di]);function Er(){Wi("")}Object(o.useEffect)(function(){if(qt.current){var St=qt.current,Mt=!1,Lt=0;function Bt(jt){Mt=!0,Lt=jt.pageY}function Xt(){Mt=!1}function $t(jt){if(Mt){var hi=jt.pageY-Lt;hi<0&&(hi=0),hi>300&&(hi=300);var ki=lt+hi+"px";qi(ki)}}return St.addEventListener("mousedown",Bt),document.addEventListener("mousemove",$t),document.addEventListener("mouseup",Xt),function(){St.removeEventListener("mousedown",Bt),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",Xt)}}},[Y,qt]),Object(o.useEffect)(function(){qi(lt)},[lt]);var rr=xe(Se),fn=xe(zr),Zi={width:rr,height:fn},pn=Object(o.useMemo)(function(){if(Ui){var St=new Date(Ui),Mt=St.getHours(),Lt=St.getMinutes(),Bt=St.getSeconds();return Mt=Mt<10?"0"+Mt:Mt,Lt=Lt<10?"0"+Lt:Lt,Bt=Bt<10?"0"+Bt:Bt,"".concat(Mt,":").concat(Lt,":").concat(Bt)}return 0},[Ui]);function Hn(){window.sessionStorage.removeItem(Tt),br(!1),Ir(0)}function Dr(){br(!1),Ir(0),Y.setValue(window.sessionStorage.getItem(Tt))}function ua(St,Mt){var Lt=Y.getValue();Lt=Lt.replace(St,Mt),pt(Lt),Y==null||Y.setValue(Lt)}return u.a.createElement(o.Fragment,null,u.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},u.a.createElement("div",{className:"markdown-editor-container ".concat(ht," ").concat(Rt?"on-preview":""," ").concat(st?"mini":""," ").concat(Ei?"full-screen":""),style:Zi},u.a.createElement(P,{insertTemp:ft,watch:Rt,fullScreen:Ei,showNullButton:Pt,onActionCallback:Gr,hidetoolBar:zi,uuid:ni.current,setOpenPhones:function(){Vt.current=!0}}),u.a.createElement("div",{className:"markdown-editor-body"},u.a.createElement("div",{className:"codemirror-container"},u.a.createElement("textarea",{ref:Kt,placeholder:gr})),Rt?u.a.createElement("div",{ref:ir,className:"preview-container"},Nt==="stex"&&u.a.createElement(C,{value:rt}),Nt!=="stex"&&u.a.createElement(S.a,{edit:!0,value:rt,replaces:ua})):null))),wt?u.a.createElement("a",{ref:qt,className:"editor-resize"}):null,u.a.createElement(j.a,null,q[di]?u.a.createElement(L.a,{centered:!0,title:q[di],visible:!0,onCancel:Er,footer:null,className:"markdown-popup-form"},dn):null))}},P2ho:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443};fe.default=V},QV2g:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=V;function V(){for(var k,M=[],f=0;f<256;f++){k=f;for(var E=0;E<8;E++)k=k&1?3988292384^k>>>1:k>>>1;M[f]=k}return M}var L=V();function I(k,M,f,E){var x=L,g=E+f;k^=-1;for(var h=E;h<g;h++)k=k>>>8^x[(k^M[h])&255];return k^-1}},SJMd:function(at,fe){/**
* @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 oe,V,L,I=!1,k,M;window.PR_SHOULD_USE_CONTINUATION=!0;var f,E;(function(){var x=window,g=["break,continue,do,else,for,if,return,while"],h=[g,"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"],o=[h,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],u=[o,"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"],r=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[o,"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"],t="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",i=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="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",l=[g,"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"],c=[g,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[g,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[u,n,r,i,s,l,c,d],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",C="kwd",v="com",y="typ",T="lit",A="pun",p="pln",D="tag",O="dec",P="src",j="atn",K="atv",U="nocode",X="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(ze){for(var Ze=0,Je=!1,$e=!1,He=0,Ue=ze.length;He<Ue;++He){var Pe=ze[He];if(Pe.ignoreCase)$e=!0;else if(/[a-z]/i.test(Pe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Je=!0,$e=!1;break}}var ke={b:8,t:9,n:10,v:11,f:12,r:13};function re(et){var je=et.charCodeAt(0);if(je!==92)return je;var ct=et.charAt(1);return je=ke[ct],je||("0"<=ct&&ct<="7"?parseInt(et.substring(1),8):ct==="u"||ct==="x"?parseInt(et.substring(2),16):et.charCodeAt(1))}function ve(et){if(et<32)return(et<16?"\\x0":"\\x")+et.toString(16);var je=String.fromCharCode(et);return je==="\\"||je==="-"||je==="]"||je==="^"?"\\"+je:je}function ae(et){var je=et.substring(1,et.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")),ct=[],he=je[0]==="^",Te=["["];he&&Te.push("^");for(var We=he?1:0,xe=je.length;We<xe;++We){var ge=je[We];if(/\\[bdsw]/i.test(ge))Te.push(ge);else{var ye=re(ge),J;We+2<xe&&je[We+1]==="-"?(J=re(je[We+2]),We+=2):J=ye,ct.push([ye,J]),J<65||ye>122||(J<65||ye>90||ct.push([Math.max(65,ye)|32,Math.min(J,90)|32]),J<97||ye>122||ct.push([Math.max(97,ye)&~32,Math.min(J,122)&~32]))}}ct.sort(function(Ce,G){return Ce[0]-G[0]||G[1]-Ce[1]});for(var ne=[],q=[],We=0;We<ct.length;++We){var me=ct[We];me[0]<=q[1]+1?q[1]=Math.max(q[1],me[1]):ne.push(q=me)}for(var We=0;We<ne.length;++We){var me=ne[We];Te.push(ve(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Te.push("-"),Te.push(ve(me[1])))}return Te.push("]"),Te.join("")}function De(et){for(var je=et.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")),ct=je.length,he=[],Te=0,We=0;Te<ct;++Te){var xe=je[Te];if(xe==="(")++We;else if(xe.charAt(0)==="\\"){var ge=+xe.substring(1);ge&&(ge<=We?he[ge]=-1:je[Te]=ve(ge))}}for(var Te=1;Te<he.length;++Te)he[Te]===-1&&(he[Te]=++Ze);for(var Te=0,We=0;Te<ct;++Te){var xe=je[Te];if(xe==="(")++We,he[We]||(je[Te]="(?:");else if(xe.charAt(0)==="\\"){var ge=+xe.substring(1);ge&&ge<=We&&(je[Te]="\\"+he[ge])}}for(var Te=0;Te<ct;++Te)je[Te]==="^"&&je[Te+1]!=="^"&&(je[Te]="");if(et.ignoreCase&&Je)for(var Te=0;Te<ct;++Te){var xe=je[Te],ye=xe.charAt(0);xe.length>=2&&ye==="["?je[Te]=ae(xe):ye!=="\\"&&(je[Te]=xe.replace(/[a-zA-Z]/g,function(q){var me=q.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return je.join("")}for(var qe=[],He=0,Ue=ze.length;He<Ue;++He){var Pe=ze[He];if(Pe.global||Pe.multiline)throw new Error(""+Pe);qe.push("(?:"+De(Pe)+")")}return new RegExp(qe.join("|"),$e?"gi":"g")}function N(ze,Ze){var Je=/(?:^|\s)nocode(?:\s|$)/,$e=[],He=0,Ue=[],Pe=0;function ke(re){var ve=re.nodeType;if(ve==1){if(Je.test(re.className))return;for(var ae=re.firstChild;ae;ae=ae.nextSibling)ke(ae);var De=re.nodeName.toLowerCase();(De==="br"||De==="li")&&($e[Pe]=`
`,Ue[Pe<<1]=He++,Ue[Pe++<<1|1]=re)}else if(ve==3||ve==4){var qe=re.nodeValue;qe.length&&(Ze?qe=qe.replace(/\r\n?/g,`
`):qe=qe.replace(/[ \t\r\n]+/g," "),$e[Pe]=qe,Ue[Pe<<1]=He,He+=qe.length,Ue[Pe++<<1|1]=re)}}return ke(ze),{sourceCode:$e.join("").replace(/\n$/,""),spans:Ue}}function z(ze,Ze,Je,$e,He){if(!Je)return;var Ue={sourceNode:ze,pre:1,langExtension:null,numberLines:null,sourceCode:Je,spans:null,basePos:Ze,decorations:null};$e(Ue),He.push.apply(He,Ue.decorations)}var te=/\S/;function ce(ze){for(var Ze=void 0,Je=ze.firstChild;Je;Je=Je.nextSibling){var $e=Je.nodeType;Ze=$e===1?Ze?ze:Je:$e===3&&te.test(Je.nodeValue)?ze:Ze}return Ze===ze?void 0:Ze}function be(ze,Ze){var Je={},$e;(function(){for(var Pe=ze.concat(Ze),ke=[],re={},ve=0,ae=Pe.length;ve<ae;++ve){var De=Pe[ve],qe=De[3];if(qe)for(var et=qe.length;--et>=0;)Je[qe.charAt(et)]=De;var je=De[1],ct=""+je;re.hasOwnProperty(ct)||(ke.push(je),re[ct]=null)}ke.push(/[\0-\uffff]/),$e=B(ke)})();var He=Ze.length,Ue=function(Pe){for(var ke=Pe.sourceCode,re=Pe.basePos,ve=Pe.sourceNode,ae=[re,p],De=0,qe=ke.match($e)||[],et={},je=0,ct=qe.length;je<ct;++je){var he=qe[je],Te=et[he],We=void 0,xe;if(typeof Te=="string")xe=!1;else{var ge=Je[he.charAt(0)];if(ge)We=he.match(ge[1]),Te=ge[0];else{for(var ye=0;ye<He;++ye)if(ge=Ze[ye],We=he.match(ge[1]),We){Te=ge[0];break}We||(Te=p)}xe=Te.length>=5&&Te.substring(0,5)==="lang-",xe&&!(We&&typeof We[1]=="string")&&(xe=!1,Te=P),xe||(et[he]=Te)}var J=De;if(De+=he.length,!xe)ae.push(re+J,Te);else{var ne=We[1],q=he.indexOf(ne),me=q+ne.length;We[2]&&(me=he.length-We[2].length,q=me-ne.length);var Ce=Te.substring(5);z(ve,re+J,he.substring(0,q),Ue,ae),z(ve,re+J+q,ne,_e(Ce,ne),ae),z(ve,re+J+me,he.substring(me),Ue,ae)}}Pe.decorations=ae};return Ue}function Fe(ze){var Ze=[],Je=[];ze.tripleQuotedStrings?Ze.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ze.multiLineStrings?Ze.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ze.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ze.verbatimStrings&&Je.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $e=ze.hashComments;$e&&(ze.cStyleComments?($e>1?Ze.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ze.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Je.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ze.push([v,/^#[^\r\n]*/,null,"#"])),ze.cStyleComments&&(Je.push([v,/^\/\/[^\r\n]*/,null]),Je.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=ze.regexLiterals;if(He){var Ue=He>1?"":`
\r`,Pe=Ue?".":"[\\S\\s]",ke="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";Je.push(["lang-regex",RegExp("^"+X+"("+ke+")")])}var re=ze.types;re&&Je.push([y,re]);var ve=(""+ze.keywords).replace(/^ | $/g,"");ve.length&&Je.push([C,new RegExp("^(?:"+ve.replace(/[\s,]+/g,"|")+")\\b"),null]),Ze.push([p,/^\s+/,null,` \r
\xA0`]);var ae="^.[^\\s\\w.$@'\"`/\\\\]*";return ze.regexLiterals&&(ae+="(?!s*/)"),Je.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[A,new RegExp(ae),null]),be(Ze,Je)}var Oe=Fe({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(ze,Ze,Je){for(var $e=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,Ue=ze.ownerDocument,Pe=Ue.createElement("li");ze.firstChild;)Pe.appendChild(ze.firstChild);var ke=[Pe];function re(je){var ct=je.nodeType;if(ct==1&&!$e.test(je.className))if(je.nodeName==="br")ve(je),je.parentNode&&je.parentNode.removeChild(je);else for(var he=je.firstChild;he;he=he.nextSibling)re(he);else if((ct==3||ct==4)&&Je){var Te=je.nodeValue,We=Te.match(He);if(We){var xe=Te.substring(0,We.index);je.nodeValue=xe;var ge=Te.substring(We.index+We[0].length);if(ge){var ye=je.parentNode;ye.insertBefore(Ue.createTextNode(ge),je.nextSibling)}ve(je),xe||je.parentNode.removeChild(je)}}}function ve(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function ct(We,xe){var ge=xe?We.cloneNode(!1):We,ye=We.parentNode;if(ye){var J=ct(ye,1),ne=We.nextSibling;J.appendChild(ge);for(var q=ne;q;q=ne)ne=q.nextSibling,J.appendChild(q)}return ge}for(var he=ct(je.nextSibling,0),Te;(Te=he.parentNode)&&Te.nodeType===1;)he=Te;ke.push(he)}for(var ae=0;ae<ke.length;++ae)re(ke[ae]);Ze===(Ze|0)&&ke[0].setAttribute("value",Ze);var De=Ue.createElement("ol");De.className="linenums";for(var qe=Math.max(0,Ze-1|0)||0,ae=0,et=ke.length;ae<et;++ae)Pe=ke[ae],Pe.className="L"+(ae+qe)%10,Pe.firstChild||Pe.appendChild(Ue.createTextNode("\xA0")),De.appendChild(Pe);ze.appendChild(De)}function Be(ze){var Ze=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ze=Ze&&+Ze[1]<=8;var Je=/\n/g,$e=ze.sourceCode,He=$e.length,Ue=0,Pe=ze.spans,ke=Pe.length,re=0,ve=ze.decorations,ae=ve.length,De=0;ve[ae]=He;var qe,et;for(et=qe=0;et<ae;)ve[et]!==ve[et+2]?(ve[qe++]=ve[et++],ve[qe++]=ve[et++]):et+=2;for(ae=qe,et=qe=0;et<ae;){for(var je=ve[et],ct=ve[et+1],he=et+2;he+2<=ae&&ve[he+1]===ct;)he+=2;ve[qe++]=je,ve[qe++]=ct,et=he}ae=ve.length=qe;var Te=ze.sourceNode,We="";Te&&(We=Te.style.display,Te.style.display="none");try{for(var xe=null;re<ke;){var ge=Pe[re],ye=Pe[re+2]||He,J=ve[De+2]||He,he=Math.min(ye,J),ne=Pe[re+1],q;if(ne.nodeType!==1&&(q=$e.substring(Ue,he))){Ze&&(q=q.replace(Je,"\r")),ne.nodeValue=q;var me=ne.ownerDocument,Ce=me.createElement("span");Ce.className=ve[De+1];var G=ne.parentNode;G.replaceChild(Ce,ne),Ce.appendChild(ne),Ue<ye&&(Pe[re+1]=ne=me.createTextNode($e.substring(he,ye)),G.insertBefore(ne,Ce.nextSibling))}Ue=he,Ue>=ye&&(re+=2),Ue>=J&&(De+=2)}}finally{Te&&(Te.style.display=We)}}var Ke={};function Ae(ze,Ze){for(var Je=Ze.length;--Je>=0;){var $e=Ze[Je];Ke.hasOwnProperty($e)?x.console&&console.warn("cannot override language handler %s",$e):Ke[$e]=ze}}function _e(ze,Ze){return ze&&Ke.hasOwnProperty(ze)||(ze=/^\s*</.test(Ze)?"default-markup":"default-code"),Ke[ze]}Ae(Oe,["default-code"]),Ae(be([],[[p,/^[^<?]+/],[O,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[A,/^(?:<[%?]|[%?]>)/],["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"]),Ae(be([[p,/^[\s]+/,null,` \r
`],[K,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[D,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[A,/^[=<>\/]+/],["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"]),Ae(be([],[[K,/^[\s\S]+/]]),["uq.val"]),Ae(Fe({keywords:u,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),Ae(Fe({keywords:"null,true,false"}),["json"]),Ae(Fe({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),Ae(Fe({keywords:r,cStyleComments:!0}),["java"]),Ae(Fe({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ae(Fe({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ae(Fe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ae(Fe({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ae(Fe({keywords:i,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ae(Fe({keywords:t,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ae(be([],[[S,/^[\s\S]+/]]),["regex"]);function le(ze){var Ze=ze.langExtension;try{var Je=N(ze.sourceNode,ze.pre),$e=Je.sourceCode;ze.sourceCode=$e,ze.spans=Je.spans,ze.basePos=0,_e(Ze,$e)(ze),Be(ze)}catch(He){x.console&&console.log(He&&He.stack||He)}}function Ee(ze,Ze,Je){var $e=Je||!1,He=Ze||null,Ue=document.createElement("div");Ue.innerHTML="<pre>"+ze+"</pre>",Ue=Ue.firstChild,$e&&Re(Ue,$e,!0);var Pe={langExtension:He,numberLines:$e,sourceNode:Ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return le(Pe),Ue.innerHTML}function pe(ze,Ze){var Je=Ze||document.body,$e=Je.ownerDocument||document;function He(ge){return Je.getElementsByTagName(ge)}for(var Ue=[He("pre"),He("code"),He("xmp")],Pe=[],ke=0;ke<Ue.length;++ke)for(var re=0,ve=Ue[ke].length;re<ve;++re)Pe.push(Ue[ke][re]);Ue=null;var ae=Date;ae.now||(ae={now:function(){return+new Date}});var De=0,qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,et=/\bprettyprint\b/,je=/\bprettyprinted\b/,ct=/pre|xmp/i,he=/^code$/i,Te=/^(?:pre|code|xmp)$/i,We={};function xe(){for(var ge=x.PR_SHOULD_USE_CONTINUATION?ae.now()+250:Infinity;De<Pe.length&&ae.now()<ge;De++){for(var ye=Pe[De],J=We,ne=ye;ne=ne.previousSibling;){var q=ne.nodeType,me=(q===7||q===8)&&ne.nodeValue;if(me?!/^\??prettify\b/.test(me):q!==3||/\S/.test(ne.nodeValue))break;if(me){J={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(_t,ft,kt){J[ft]=kt});break}}var Ce=ye.className;if((J!==We||et.test(Ce))&&!je.test(Ce)){for(var G=!1,we=ye.parentNode;we;we=we.parentNode){var Ne=we.tagName;if(Te.test(Ne)&&we.className&&et.test(we.className)){G=!0;break}}if(!G){ye.className+=" prettyprinted";var de=J.lang;if(!de){de=Ce.match(qe);var Se;!de&&(Se=ce(ye))&&he.test(Se.tagName)&&(de=Se.className.match(qe)),de&&(de=de[1])}var Xe;if(ct.test(ye.tagName))Xe=1;else{var lt=ye.currentStyle,tt=$e.defaultView,st=lt?lt.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(ye,null).getPropertyValue("white-space"):0;Xe=st&&st.substring(0,3)==="pre"}var mt=J.linenums;(mt=mt==="true"||+mt)||(mt=Ce.match(/\blinenums\b(?::(\d+))?/),mt=mt?mt[1]&&mt[1].length?+mt[1]:!0:!1),mt&&Re(ye,mt,Xe);var Ct={langExtension:de,sourceNode:ye,numberLines:mt,pre:Xe,sourceCode:null,basePos:null,spans:null,decorations:null};le(Ct)}}}De<Pe.length?x.setTimeout(xe,250):typeof ze=="function"&&ze()}xe()}var Ge=x.PR={createSimpleLexer:be,registerLangHandler:Ae,sourceDecorator:Fe,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:K,PR_COMMENT:v,PR_DECLARATION:O,PR_KEYWORD:C,PR_LITERAL:T,PR_NOCODE:U,PR_PLAIN:p,PR_PUNCTUATION:A,PR_SOURCE:P,PR_STRING:S,PR_TAG:D,PR_TYPE:y,prettyPrintOne:I?x.prettyPrintOne=Ee:f=Ee,prettyPrint:E=I?x.prettyPrint=pe:E=pe},Ye=x.define;typeof Ye=="function"&&Ye.amd&&Ye("google-code-prettify",[],function(){return Ge})})()},SZEN:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.clientToElement=V;function V(L,I,k){var M=k.getBoundingClientRect(),f={x:0,y:0};return L<M.left?f.x=0:L>=M.right?f.x=M.width-1:f.x=L-M.left,I<M.top?f.y=0:I>=M.bottom?f.y=M.height-1:f.y=I-M.top,f}},SgaC:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E<f.length;E++){var x=f[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(M,x.key,x)}}function I(M,f,E){return f&&L(M.prototype,f),E&&L(M,E),M}var k=function(){function M(){V(this,M),this._subrects=0}return I(M,[{key:"decodeRect",value:function(E,x,g,h,o,u,r){if(this._subrects===0){if(o.rQwait("RRE",4+4))return!1;this._subrects=o.rQshift32();var n=o.rQshiftBytes(4);u.fillRect(E,x,g,h,n)}for(;this._subrects>0;){if(o.rQwait("RRE",4+8))return!1;var t=o.rQshiftBytes(4),i=o.rQshift16(),s=o.rQshift16(),l=o.rQshift16(),c=o.rQshift16();u.fillRect(E+i,x+s,l,c,t),this._subrects--}return!0}}]),M}();fe.default=k},TXwP:function(at,fe,oe){var V,L;(function(){var I;(function(){"use strict";var M=[,,function(g){function h(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}h.prototype.clone_empty=function(){var r=new h(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},h.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},h.prototype.has_match=function(r){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(r))return!0;return!1},h.prototype.set_indent=function(r,n){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},h.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(r){this.__items.push(r);var n=r.lastIndexOf(`
`);n!==-1?this.__character_count=r.length-n:this.__character_count+=r.length},h.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function o(r,n){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),n=n||"",r.indent_level>0&&(n=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}o.prototype.get_indent_size=function(r,n){var t=this.__base_string_length;return n=n||0,r<0&&(t=0),t+=r*this.__indent_size,t+=n,t},o.prototype.get_indent_string=function(r,n){var t=this.__base_string;return n=n||0,r<0&&(r=0,t=""),n+=r*this.__indent_size,this.__ensure_cache(n),t+=this.__cache[n],t},o.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var r=this.__cache.length,n=0,t="";this.__indent_size&&r>=this.__indent_size&&(n=Math.floor(r/this.__indent_size),r-=n*this.__indent_size,t=new Array(n+1).join(this.__indent_string)),r&&(t+=new Array(r+1).join(" ")),this.__cache.push(t)};function u(r,n){this.__indent_cache=new o(r,n),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(r,n){return this.__indent_cache.get_indent_string(r,n)},u.prototype.get_indent_size=function(r,n){return this.__indent_cache.get_indent_size(r,n)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(r){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
`);return r!==`
`&&(t=t.replace(/[\n]/g,r)),t},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(r,n){return r=r||0,n=n||0,this.next_line.set_indent(r,n),this.__lines.length>1?(this.current_line.set_indent(r,n),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(r){for(var n=0;n<r.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(r){for(var n=this.__lines.length;r<n;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(r,n){for(var t=this.__lines.length-2;t>=0;){var i=this.__lines[t];if(i.is_empty())break;if(i.item(0).indexOf(r)!==0&&i.item(-1)!==n){this.__lines.splice(t+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},g.exports.Output=u},,,,function(g){function h(r,n){this.raw_options=o(r,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(r,n){var t=this.raw_options[r],i=n||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(i=t.concat()):typeof t=="string"&&(i=t.split(/[^a-zA-Z0-9_\/\-]+/)),i},h.prototype._get_boolean=function(r,n){var t=this.raw_options[r],i=t===void 0?!!n:!!t;return i},h.prototype._get_characters=function(r,n){var t=this.raw_options[r],i=n||"";return typeof t=="string"&&(i=t.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),i},h.prototype._get_number=function(r,n){var t=this.raw_options[r];n=parseInt(n,10),isNaN(n)&&(n=0);var i=parseInt(t,10);return isNaN(i)&&(i=n),i},h.prototype._get_selection=function(r,n,t){var i=this._get_selection_list(r,n,t);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[r]+"'");return i[0]},h.prototype._get_selection_list=function(r,n,t){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[n[0]],!this._is_valid_selection(t,n))throw new Error("Invalid Default Value!");var i=this._get_array(r,t);if(!this._is_valid_selection(i,n))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[r]+"'");return i},h.prototype._is_valid_selection=function(r,n){return r.length&&n.length&&!r.some(function(t){return n.indexOf(t)===-1})};function o(r,n){var t={};r=u(r);var i;for(i in r)i!==n&&(t[i]=r[i]);if(n&&r[n])for(i in r[n])t[i]=r[n][i];return t}function u(r){var n={},t;for(t in r){var i=t.replace(/-/g,"_");n[i]=r[t]}return n}g.exports.Options=h,g.exports.normalizeOpts=u,g.exports.mergeOpts=o},,function(g){var h=RegExp.prototype.hasOwnProperty("sticky");function o(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},o.prototype.peek=function(u){var r=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(r=this.__input.charAt(u)),r},o.prototype.__match=function(u,r){u.lastIndex=r;var n=u.exec(this.__input);return n&&!(h&&u.sticky)&&(n.index!==r&&(n=null)),n},o.prototype.test=function(u,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(u,r):!1},o.prototype.testChar=function(u,r){var n=this.peek(r);return u.lastIndex=0,n!==null&&u.test(n)},o.prototype.match=function(u){var r=this.__match(u,this.__position);return r?this.__position+=r[0].length:r=null,r},o.prototype.read=function(u,r,n){var t="",i;return u&&(i=this.match(u),i&&(t+=i[0])),r&&(i||!u)&&(t+=this.readUntil(r,n)),t},o.prototype.readUntil=function(u,r){var n="",t=this.__position;u.lastIndex=this.__position;var i=u.exec(this.__input);return i?(t=i.index,r&&(t+=i[0].length)):t=this.__input_length,n=this.__input.substring(this.__position,t),this.__position=t,n},o.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},o.prototype.get_regexp=function(u,r){var n=null,t="g";return r&&h&&(t="y"),typeof u=="string"&&u!==""?n=new RegExp(u,t):u&&(n=new RegExp(u.source,t)),n},o.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(u){var r=this.__position,n=this.readUntilAfter(u);return this.__position=r,n},o.prototype.lookBack=function(u){var r=this.__position-1;return r>=u.length&&this.__input.substring(r-u.length,r).toLowerCase()===u},g.exports.InputScanner=o},,,,,function(g){function h(o,u){o=typeof o=="string"?o:o.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+u,"g")}h.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(o);r;)u[r[1]]=r[2],r=this.__directive_pattern.exec(o);return u},h.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=h},,function(g,h,o){var u=o(16).Beautifier,r=o(17).Options;function n(t,i){var s=new u(t,i);return s.beautify()}g.exports=n,g.exports.defaultOptions=function(){return new r}},function(g,h,o){var u=o(17).Options,r=o(2).Output,n=o(8).InputScanner,t=o(13).Directives,i=new t(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,c=/\s/,d=/(?:\s|\n)+/g,w=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(C,v){this._source_text=C||"",this._options=new u(v),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}S.prototype.eatString=function(C){var v="";for(this._ch=this._input.next();this._ch;){if(v+=this._ch,this._ch==="\\")v+=this._input.next();else if(C.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return v},S.prototype.eatWhitespace=function(C){for(var v=c.test(this._input.peek()),y=0;c.test(this._input.peek());)this._ch=this._input.next(),C&&this._ch===`
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return v},S.prototype.foundNestedPseudoClass=function(){for(var C=0,v=1,y=this._input.peek(v);y;){if(y==="{")return!0;if(y==="(")C+=1;else if(y===")"){if(C===0)return!1;C-=1}else if(y===";"||y==="}")return!1;v++,y=this._input.peek(v)}return!1},S.prototype.print_string=function(C){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(C)},S.prototype.preserveSingleSpace=function(C){C&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,v=this._options.eol;v==="auto"&&(v=`
`,C&&s.test(C||"")&&(v=C.match(s)[0])),C=C.replace(l,`
`);var y=C.match(/^[\t ]*/)[0];this._output=new r(this._options,y),this._input=new n(C),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,A=!1,p=!1,D=!1,O=!1,P=!1,j=!1,K=this._ch,U=!1,X,B,N;X=this._input.read(d),B=X!=="",N=K,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),K=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(w),te=i.get_directives(z);te&&te.ignore==="start"&&(z+=i.readIgnored(this._input)),this.print_string(z),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(m)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ce=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ce.match(/[ :]$/)&&(ce=this.eatString(": ").replace(/\s$/,""),this.print_string(ce),this._output.space_before_token=!0),ce=ce.replace(/\s$/,""),ce==="extend"?O=!0:ce==="import"&&(P=!0),ce in this.NESTED_AT_RULE?(this._nestedLevel+=1,ce in this.CONDITIONAL_GROUP_RULE&&(D=!0)):!A&&T===0&&ce.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),D?(D=!1,A=this._indentLevel>=this._nestedLevel):A=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&A&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(N==="("?this._output.space_before_token=!1:N!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),N==="{"&&this._output.trim(!0),P=!1,O=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),A=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var be=0;be<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;be++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[be])){U=!0;break}(A||D)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!O&&T===0?(this.print_string(":"),p||(p=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Fe=N==='"'||N==="'";this.preserveSingleSpace(Fe||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")U=!1,T===0?(p&&(this.outdent(),p=!1),O=!1,P=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),T++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),T&&(T--,this.outdent()));else{var Oe=!1;this._input.lookBack("with")&&(Oe=!0),this.preserveSingleSpace(B||Oe),this.print_string(this._ch),p&&N==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),T++,this.indent())}else if(this._ch===")")T&&(T--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!p||j)&&T===0&&!P&&!O?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!p&&T===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&c.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),c.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Re=N==='"'||N==="'";this.preserveSingleSpace(Re||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&U&&this._output.add_new_line()}var Be=this._output.get_code(v);return Be},g.exports.Beautifier=S},function(g,h,o){var u=o(6).Options;function r(n){u.call(this,n,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<i.length;s++)i[s]!=="expand"?this.brace_style="collapse":this.brace_style=i[s]}r.prototype=new u,g.exports.Options=r}],f={};function E(g){var h=f[g];if(h!==void 0)return h.exports;var o=f[g]={exports:{}};return M[g](o,o.exports,E),o.exports}var x=E(15);I=x})();var k=I;!(V=[],L=function(){return{css_beautify:k}}.apply(fe,V),L!==void 0&&(at.exports=L))})()},VSMT:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.decodeUTF8=V,fe.encodeUTF8=L;function V(I){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;try{return decodeURIComponent(escape(I))}catch(M){if(M instanceof URIError&&k)return I;throw M}}function L(I){return unescape(encodeURIComponent(I))}},"VaU+":function(at,fe,oe){at.exports={wrp:"wrp___1lJPu",header:"header___2p05v",cuttDown:"cuttDown___1-ls7",container:"container___1Nx55",info:"info___2lI6e",buttons:"buttons___3Q0yr",fullBtn:"fullBtn___18HVx",shrink:"shrink___367DS",elseShrink:"elseShrink___3Anw7",spin:"spin___3h9s3"}},"VrN/":function(at,fe,oe){(function(V,L){at.exports=L()})(this,function(){"use strict";var V=navigator.userAgent,L=navigator.platform,I=/gecko\/\d/i.test(V),k=/MSIE \d/.test(V),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(V),f=/Edge\/(\d+)/.exec(V),E=k||M||f,x=E&&(k?document.documentMode||6:+(f||M)[1]),g=!f&&/WebKit\//.test(V),h=g&&/Qt\/\d+\.\d+/.test(V),o=!f&&/Chrome\//.test(V),u=/Opera\//.test(V),r=/Apple Computer/.test(navigator.vendor),n=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(V),t=/PhantomJS/.test(V),i=!f&&/AppleWebKit/.test(V)&&/Mobile\/\w+/.test(V),s=/Android/.test(V),l=i||s||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(V),c=i||/Mac/.test(L),d=/\bCrOS\b/.test(V),w=/win/i.test(L),m=u&&V.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(u=!1,g=!0);var S=c&&(h||u&&(m==null||m<12.11)),C=I||E&&x>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var y=function(e,a){var b=e.className,_=v(a).exec(b);if(_){var R=b.slice(_.index+_[0].length);e.className=b.slice(0,_.index)+(R?_[1]+R:"")}};function T(e){for(var a=e.childNodes.length;a>0;--a)e.removeChild(e.firstChild);return e}function A(e,a){return T(e).appendChild(a)}function p(e,a,b,_){var R=document.createElement(e);if(b&&(R.className=b),_&&(R.style.cssText=_),typeof a=="string")R.appendChild(document.createTextNode(a));else if(a)for(var W=0;W<a.length;++W)R.appendChild(a[W]);return R}function D(e,a,b,_){var R=p(e,a,b,_);return R.setAttribute("role","presentation"),R}var O;document.createRange?O=function(e,a,b,_){var R=document.createRange();return R.setEnd(_||e,b),R.setStart(e,a),R}:O=function(e,a,b){var _=document.body.createTextRange();try{_.moveToElementText(e.parentNode)}catch(R){return _}return _.collapse(!0),_.moveEnd("character",b),_.moveStart("character",a),_};function P(e,a){if(a.nodeType==3&&(a=a.parentNode),e.contains)return e.contains(a);do if(a.nodeType==11&&(a=a.host),a==e)return!0;while(a=a.parentNode)}function j(){var e;try{e=document.activeElement}catch(a){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function K(e,a){var b=e.className;v(a).test(b)||(e.className+=(b?" ":"")+a)}function U(e,a){for(var b=e.split(" "),_=0;_<b.length;_++)b[_]&&!v(b[_]).test(a)&&(a+=" "+b[_]);return a}var X=function(e){e.select()};i?X=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(X=function(e){try{e.select()}catch(a){}});function B(e){var a=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,a)}}function N(e,a,b){a||(a={});for(var _ in e)e.hasOwnProperty(_)&&(b!==!1||!a.hasOwnProperty(_))&&(a[_]=e[_]);return a}function z(e,a,b,_,R){a==null&&(a=e.search(/[^\s\u00a0]/),a==-1&&(a=e.length));for(var W=_||0,Q=R||0;;){var ee=e.indexOf(" ",W);if(ee<0||ee>=a)return Q+(a-W);Q+=ee-W,Q+=b-Q%b,W=ee+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,a){this.f=a;var b=+new Date+e;(!this.id||b<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=b)};function ce(e,a){for(var b=0;b<e.length;++b)if(e[b]==a)return b;return-1}var be=50,Fe={toString:function(){return"CodeMirror.Pass"}},Oe={scroll:!1},Re={origin:"*mouse"},Be={origin:"+move"};function Ke(e,a,b){for(var _=0,R=0;;){var W=e.indexOf(" ",_);W==-1&&(W=e.length);var Q=W-_;if(W==e.length||R+Q>=a)return _+Math.min(Q,a-R);if(R+=W-_,R+=b-R%b,_=W+1,R>=a)return _}}var Ae=[""];function _e(e){for(;Ae.length<=e;)Ae.push(le(Ae)+" ");return Ae[e]}function le(e){return e[e.length-1]}function Ee(e,a){for(var b=[],_=0;_<e.length;_++)b[_]=a(e[_],_);return b}function pe(e,a,b){for(var _=0,R=b(a);_<e.length&&b(e[_])<=R;)_++;e.splice(_,0,a)}function Ge(){}function Ye(e,a){var b;return Object.create?b=Object.create(e):(Ge.prototype=e,b=new Ge),a&&N(a,b),b}var ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ze.test(e))}function Je(e,a){return a?a.source.indexOf("\\w")>-1&&Ze(e)?!0:a.test(e):Ze(e)}function $e(e){for(var a in e)if(e.hasOwnProperty(a)&&e[a])return!1;return!0}var He=/[\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 Ue(e){return e.charCodeAt(0)>=768&&He.test(e)}function Pe(e,a,b){for(;(b<0?a>0:a<e.length)&&Ue(e.charAt(a));)a+=b;return a}function ke(e,a,b){for(var _=a>b?-1:1;;){if(a==b)return a;var R=(a+b)/2,W=_<0?Math.ceil(R):Math.floor(R);if(W==a)return e(W)?a:b;e(W)?b=W:a=W+_}}function re(e,a,b,_){if(!e)return _(a,b,"ltr",0);for(var R=!1,W=0;W<e.length;++W){var Q=e[W];(Q.from<b&&Q.to>a||a==b&&Q.to==a)&&(_(Math.max(Q.from,a),Math.min(Q.to,b),Q.level==1?"rtl":"ltr",W),R=!0)}R||_(a,b,"ltr")}var ve=null;function ae(e,a,b){var _;ve=null;for(var R=0;R<e.length;++R){var W=e[R];if(W.from<a&&W.to>a)return R;W.to==a&&(W.from!=W.to&&b=="before"?_=R:ve=R),W.from==a&&(W.from!=W.to&&b!="before"?_=R:ve=R)}return _!=null?_:ve}var De=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",a="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function b(ue){return ue<=247?e.charAt(ue):1424<=ue&&ue<=1524?"R":1536<=ue&&ue<=1785?a.charAt(ue-1536):1774<=ue&&ue<=2220?"r":8192<=ue&&ue<=8203?"w":ue==8204?"b":"L"}var _=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,R=/[stwN]/,W=/[LRr]/,Q=/[Lb1n]/,ee=/[1n]/;function ie(ue,Le,Ie){this.level=ue,this.from=Le,this.to=Ie}return function(ue,Le){var Ie=Le=="ltr"?"L":"R";if(ue.length==0||Le=="ltr"&&!_.test(ue))return!1;for(var Qe=ue.length,Ve=[],it=0;it<Qe;++it)Ve.push(b(ue.charCodeAt(it)));for(var ut=0,dt=Ie;ut<Qe;++ut){var gt=Ve[ut];gt=="m"?Ve[ut]=dt:dt=gt}for(var yt=0,vt=Ie;yt<Qe;++yt){var bt=Ve[yt];bt=="1"&&vt=="r"?Ve[yt]="n":W.test(bt)&&(vt=bt,bt=="r"&&(Ve[yt]="R"))}for(var Ot=1,At=Ve[0];Ot<Qe-1;++Ot){var Ut=Ve[Ot];Ut=="+"&&At=="1"&&Ve[Ot+1]=="1"?Ve[Ot]="1":Ut==","&&At==Ve[Ot+1]&&(At=="1"||At=="n")&&(Ve[Ot]=At),At=Ut}for(var Jt=0;Jt<Qe;++Jt){var gi=Ve[Jt];if(gi==",")Ve[Jt]="N";else if(gi=="%"){var ii=void 0;for(ii=Jt+1;ii<Qe&&Ve[ii]=="%";++ii);for(var Hi=Jt&&Ve[Jt-1]=="!"||ii<Qe&&Ve[ii]=="1"?"1":"N",Mi=Jt;Mi<ii;++Mi)Ve[Mi]=Hi;Jt=ii-1}}for(var oi=0,Pi=Ie;oi<Qe;++oi){var bi=Ve[oi];Pi=="L"&&bi=="1"?Ve[oi]="L":W.test(bi)&&(Pi=bi)}for(var ci=0;ci<Qe;++ci)if(R.test(Ve[ci])){var li=void 0;for(li=ci+1;li<Qe&&R.test(Ve[li]);++li);for(var ri=(ci?Ve[ci-1]:Ie)=="L",Ni=(li<Qe?Ve[li]:Ie)=="L",un=ri==Ni?ri?"L":"R":Ie,kr=ci;kr<li;++kr)Ve[kr]=un;ci=li-1}for(var Ci=[],sr,vi=0;vi<Qe;)if(Q.test(Ve[vi])){var Ga=vi;for(++vi;vi<Qe&&Q.test(Ve[vi]);++vi);Ci.push(new ie(0,Ga,vi))}else{var dr=vi,Wr=Ci.length,jr=Le=="rtl"?1:0;for(++vi;vi<Qe&&Ve[vi]!="L";++vi);for(var Li=dr;Li<vi;)if(ee.test(Ve[Li])){dr<Li&&(Ci.splice(Wr,0,new ie(1,dr,Li)),Wr+=jr);var hn=Li;for(++Li;Li<vi&&ee.test(Ve[Li]);++Li);Ci.splice(Wr,0,new ie(2,hn,Li)),Wr+=jr,dr=Li}else++Li;dr<vi&&Ci.splice(Wr,0,new ie(1,dr,vi))}return Le=="ltr"&&(Ci[0].level==1&&(sr=ue.match(/^\s+/))&&(Ci[0].from=sr[0].length,Ci.unshift(new ie(0,0,sr[0].length))),le(Ci).level==1&&(sr=ue.match(/\s+$/))&&(le(Ci).to-=sr[0].length,Ci.push(new ie(0,Qe-sr[0].length,Qe)))),Le=="rtl"?Ci.reverse():Ci}}();function qe(e,a){var b=e.order;return b==null&&(b=e.order=De(e.text,a)),b}var et=[],je=function(e,a,b){if(e.addEventListener)e.addEventListener(a,b,!1);else if(e.attachEvent)e.attachEvent("on"+a,b);else{var _=e._handlers||(e._handlers={});_[a]=(_[a]||et).concat(b)}};function ct(e,a){return e._handlers&&e._handlers[a]||et}function he(e,a,b){if(e.removeEventListener)e.removeEventListener(a,b,!1);else if(e.detachEvent)e.detachEvent("on"+a,b);else{var _=e._handlers,R=_&&_[a];if(R){var W=ce(R,b);W>-1&&(_[a]=R.slice(0,W).concat(R.slice(W+1)))}}}function Te(e,a){var b=ct(e,a);if(!b.length)return;for(var _=Array.prototype.slice.call(arguments,2),R=0;R<b.length;++R)b[R].apply(null,_)}function We(e,a,b){return typeof a=="string"&&(a={type:a,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,b||a.type,e,a),q(a)||a.codemirrorIgnore}function xe(e){var a=e._handlers&&e._handlers.cursorActivity;if(!a)return;for(var b=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),_=0;_<a.length;++_)ce(b,a[_])==-1&&b.push(a[_])}function ge(e,a){return ct(e,a).length>0}function ye(e){e.prototype.on=function(a,b){je(this,a,b)},e.prototype.off=function(a,b){he(this,a,b)}}function J(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ne(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function q(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){J(e),ne(e)}function Ce(e){return e.target||e.srcElement}function G(e){var a=e.which;return a==null&&(e.button&1?a=1:e.button&2?a=3:e.button&4&&(a=2)),c&&e.ctrlKey&&a==1&&(a=3),a}var we=function(){if(E&&x<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),Ne;function de(e){if(Ne==null){var a=p("span","\u200B");A(e,p("span",[a,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ne=a.offsetWidth<=1&&a.offsetHeight>2&&!(E&&x<8))}var b=Ne?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return b.setAttribute("cm-text",""),b}var Se;function Xe(e){if(Se!=null)return Se;var a=A(e,document.createTextNode("A\u062EA")),b=O(a,0,1).getBoundingClientRect(),_=O(a,1,2).getBoundingClientRect();return T(e),!b||b.left==b.right?!1:Se=_.right-b.right<3}var lt=`
b`.split(/\n/).length!=3?function(e){for(var a=0,b=[],_=e.length;a<=_;){var R=e.indexOf(`
`,a);R==-1&&(R=e.length);var W=e.slice(a,e.charAt(R-1)=="\r"?R-1:R),Q=W.indexOf("\r");Q!=-1?(b.push(W.slice(0,Q)),a+=Q+1):(b.push(W),a=R+1)}return b}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(a){return!1}}:function(e){var a;try{a=e.ownerDocument.selection.createRange()}catch(b){}return!a||a.parentElement()!=e?!1:a.compareEndPoints("StartToEnd",a)!=0},st=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),mt=null;function Ct(e){if(mt!=null)return mt;var a=A(e,p("span","x")),b=a.getBoundingClientRect(),_=O(a,0,1).getBoundingClientRect();return mt=Math.abs(b.left-_.left)>1}var _t={},ft={};function kt(e,a){arguments.length>2&&(a.dependencies=Array.prototype.slice.call(arguments,2)),_t[e]=a}function Nt(e,a){ft[e]=a}function nt(e){if(typeof e=="string"&&ft.hasOwnProperty(e))e=ft[e];else if(e&&typeof e.name=="string"&&ft.hasOwnProperty(e.name)){var a=ft[e.name];typeof a=="string"&&(a={name:a}),e=Ye(a,e),e.name=a.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return nt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return nt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Tt(e,a){a=nt(a);var b=_t[a.name];if(!b)return Tt(e,"text/plain");var _=b(e,a);if(It.hasOwnProperty(a.name)){var R=It[a.name];for(var W in R){if(!R.hasOwnProperty(W))continue;_.hasOwnProperty(W)&&(_["_"+W]=_[W]),_[W]=R[W]}}if(_.name=a.name,a.helperType&&(_.helperType=a.helperType),a.modeProps)for(var Q in a.modeProps)_[Q]=a.modeProps[Q];return _}var It={};function wt(e,a){var b=It.hasOwnProperty(e)?It[e]:It[e]={};N(a,b)}function Ft(e,a){if(a===!0)return a;if(e.copyState)return e.copyState(a);var b={};for(var _ in a){var R=a[_];R instanceof Array&&(R=R.concat([])),b[_]=R}return b}function zt(e,a){for(var b;e.innerMode&&!(b=e.innerMode(a),!b||b.mode==e);)a=b.state,e=b.mode;return b||{mode:e,state:a}}function ui(e,a,b){return e.startState?e.startState(a,b):!0}var Pt=function(e,a,b){this.pos=this.start=0,this.string=e,this.tabSize=a||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=b};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var a=this.string.charAt(this.pos),b;if(typeof e=="string"?b=a==e:b=a&&(e.test?e.test(a):e(a)),b)return++this.pos,a},Pt.prototype.eatWhile=function(e){for(var a=this.pos;this.eat(e););return this.pos>a},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var a=this.string.indexOf(e,this.pos);if(a>-1)return this.pos=a,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,a,b){if(typeof e=="string"){var _=function(Q){return b?Q.toLowerCase():Q},R=this.string.substr(this.pos,e.length);if(_(R)==_(e))return a!==!1&&(this.pos+=e.length),!0}else{var W=this.string.slice(this.pos).match(e);return W&&W.index>0?null:(W&&a!==!1&&(this.pos+=W[0].length),W)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,a){this.lineStart+=e;try{return a()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var a=this.lineOracle;return a&&a.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function xt(e,a){if(a-=e.first,a<0||a>=e.size)throw new Error("There is no line "+(a+e.first)+" in the document.");for(var b=e;!b.lines;)for(var _=0;;++_){var R=b.children[_],W=R.chunkSize();if(a<W){b=R;break}a-=W}return b.lines[a]}function zi(e,a,b){var _=[],R=a.line;return e.iter(a.line,b.line+1,function(W){var Q=W.text;R==b.line&&(Q=Q.slice(0,b.ch)),R==a.line&&(Q=Q.slice(a.ch)),_.push(Q),++R}),_}function tr(e,a,b){var _=[];return e.iter(a,b,function(R){_.push(R.text)}),_}function xi(e,a){var b=a-e.height;if(b)for(var _=e;_;_=_.parent)_.height+=b}function Ht(e){if(e.parent==null)return null;for(var a=e.parent,b=ce(a.lines,e),_=a.parent;_;a=_,_=_.parent)for(var R=0;!(_.children[R]==a);++R)b+=_.children[R].chunkSize();return b+a.first}function Ki(e,a){var b=e.first;e:do{for(var _=0;_<e.children.length;++_){var R=e.children[_],W=R.height;if(a<W){e=R;continue e}a-=W,b+=R.chunkSize()}return b}while(!e.lines);for(var Q=0;Q<e.lines.length;++Q){var ee=e.lines[Q],ie=ee.height;if(a<ie)break;a-=ie}return b+Q}function Yi(e,a){return a>=e.first&&a<e.first+e.size}function fr(e,a){return String(e.lineNumberFormatter(a+e.firstLineNumber))}function ht(e,a,b){if(b===void 0&&(b=null),!(this instanceof ht))return new ht(e,a,b);this.line=e,this.ch=a,this.sticky=b}function Dt(e,a){return e.line-a.line||e.ch-a.ch}function pr(e,a){return e.sticky==a.sticky&&Dt(e,a)==0}function mr(e){return ht(e.line,e.ch)}function gr(e,a){return Dt(e,a)<0?a:e}function vr(e,a){return Dt(e,a)<0?e:a}function $(e,a){return Math.max(e.first,Math.min(a,e.first+e.size-1))}function F(e,a){if(a.line<e.first)return ht(e.first,0);var b=e.first+e.size-1;return a.line>b?ht(b,xt(e,b).text.length):H(a,xt(e,a.line).text.length)}function H(e,a){var b=e.ch;return b==null||b>a?ht(e.line,a):b<0?ht(e.line,0):e}function Y(e,a){for(var b=[],_=0;_<a.length;_++)b[_]=F(e,a[_]);return b}var se=function(e,a){this.state=e,this.lookAhead=a},Z=function(e,a,b,_){this.state=a,this.doc=e,this.line=b,this.maxLookAhead=_||0,this.baseTokens=null,this.baseTokenPos=1};Z.prototype.lookAhead=function(e){var a=this.doc.getLine(this.line+e);return a!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),a},Z.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var a=this.baseTokens[this.baseTokenPos+1];return{type:a&&a.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Z.fromSaved=function(e,a,b){return a instanceof se?new Z(e,Ft(e.mode,a.state),b,a.lookAhead):new Z(e,Ft(e.mode,a),b)},Z.prototype.save=function(e){var a=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new se(a,this.maxLookAhead):a};function Me(e,a,b,_){var R=[e.state.modeGen],W={};Ei(e,a.text,e.doc.mode,b,function(ue,Le){return R.push(ue,Le)},W,_);for(var Q=b.state,ee=function(ue){b.baseTokens=R;var Le=e.state.overlays[ue],Ie=1,Qe=0;b.state=!0,Ei(e,a.text,Le.mode,b,function(Ve,it){for(var ut=Ie;Qe<Ve;){var dt=R[Ie];dt>Ve&&R.splice(Ie,1,Ve,R[Ie+1],dt),Ie+=2,Qe=Math.min(Ve,dt)}if(!it)return;if(Le.opaque)R.splice(ut,Ie-ut,Ve,"overlay "+it),Ie=ut+2;else for(;ut<Ie;ut+=2){var gt=R[ut+1];R[ut+1]=(gt?gt+" ":"")+"overlay "+it}},W),b.state=Q,b.baseTokens=null,b.baseTokenPos=1},ie=0;ie<e.state.overlays.length;++ie)ee(ie);return{styles:R,classes:W.bgClass||W.textClass?W:null}}function rt(e,a,b){if(!a.styles||a.styles[0]!=e.state.modeGen){var _=pt(e,Ht(a)),R=a.text.length>e.options.maxHighlightLength&&Ft(e.doc.mode,_.state),W=Me(e,a,_);R&&(_.state=R),a.stateAfter=_.save(!R),a.styles=W.styles,W.classes?a.styleClasses=W.classes:a.styleClasses&&(a.styleClasses=null),b===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return a.styles}function pt(e,a,b){var _=e.doc,R=e.display;if(!_.mode.startState)return new Z(_,!0,a);var W=wi(e,a,b),Q=W>_.first&&xt(_,W-1).stateAfter,ee=Q?Z.fromSaved(_,Q,W):new Z(_,ui(_.mode),W);return _.iter(W,a,function(ie){Et(e,ie.text,ee);var ue=ee.line;ie.stateAfter=ue==a-1||ue%5==0||ue>=R.viewFrom&&ue<R.viewTo?ee.save():null,ee.nextLine()}),b&&(_.modeFrontier=ee.line),ee}function Et(e,a,b,_){var R=e.doc.mode,W=new Pt(a,e.options.tabSize,b);for(W.start=W.pos=_||0,a==""&&ot(R,b.state);!W.eol();)Rt(R,W,b.state),W.start=W.pos}function ot(e,a){if(e.blankLine)return e.blankLine(a);if(!e.innerMode)return;var b=zt(e,a);if(b.mode.blankLine)return b.mode.blankLine(b.state)}function Rt(e,a,b,_){for(var R=0;R<10;R++){_&&(_[0]=zt(e,b).mode);var W=e.token(a,b);if(a.pos>a.start)return W}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gt=function(e,a,b){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=a||null,this.state=b};function ei(e,a,b,_){var R=e.doc,W=R.mode,Q;a=F(R,a);var ee=xt(R,a.line),ie=pt(e,a.line,b),ue=new Pt(ee.text,e.options.tabSize,ie),Le;for(_&&(Le=[]);(_||ue.pos<a.ch)&&!ue.eol();)ue.start=ue.pos,Q=Rt(W,ue,ie.state),_&&Le.push(new Gt(ue,Q,Ft(R.mode,ie.state)));return _?Le:new Gt(ue,Q,ie.state)}function Fi(e,a){if(e)for(;;){var b=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!b)break;e=e.slice(0,b.index)+e.slice(b.index+b[0].length);var _=b[1]?"bgClass":"textClass";a[_]==null?a[_]=b[2]:new RegExp("(?:^|\\s)"+b[2]+"(?:$|\\s)").test(a[_])||(a[_]+=" "+b[2])}return e}function Ei(e,a,b,_,R,W,Q){var ee=b.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var ie=0,ue=null,Le=new Pt(a,e.options.tabSize,_),Ie,Qe=e.options.addModeClass&&[null];for(a==""&&Fi(ot(b,_.state),W);!Le.eol();){if(Le.pos>e.options.maxHighlightLength?(ee=!1,Q&&Et(e,a,_,Le.pos),Le.pos=a.length,Ie=null):Ie=Fi(Rt(b,Le,_.state,Qe),W),Qe){var Ve=Qe[0].name;Ve&&(Ie="m-"+(Ie?Ve+" "+Ie:Ve))}if(!ee||ue!=Ie){for(;ie<Le.start;)ie=Math.min(Le.start,ie+5e3),R(ie,ue);ue=Ie}Le.start=Le.pos}for(;ie<Le.pos;){var it=Math.min(Le.pos,ie+5e3);R(it,ue),ie=it}}function wi(e,a,b){for(var _,R,W=e.doc,Q=b?-1:a-(e.doc.mode.innerMode?1e3:100),ee=a;ee>Q;--ee){if(ee<=W.first)return W.first;var ie=xt(W,ee-1),ue=ie.stateAfter;if(ue&&(!b||ee+(ue instanceof se?ue.lookAhead:0)<=W.modeFrontier))return ee;var Le=z(ie.text,null,e.options.tabSize);(R==null||_>Le)&&(R=ee-1,_=Le)}return R}function Qi(e,a){if(e.modeFrontier=Math.min(e.modeFrontier,a),e.highlightFrontier<a-10)return;for(var b=e.first,_=a-1;_>b;_--){var R=xt(e,_).stateAfter;if(R&&(!(R instanceof se)||_+R.lookAhead<a)){b=_+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,b)}var Or=!1,di=!1;function Wi(){Or=!0}function or(){di=!0}function lr(e,a,b){this.marker=e,this.from=a,this.to=b}function Ui(e,a){if(e)for(var b=0;b<e.length;++b){var _=e[b];if(_.marker==a)return _}}function Ir(e,a){for(var b,_=0;_<e.length;++_)e[_]!=a&&(b||(b=[])).push(e[_]);return b}function _r(e,a){e.markedSpans=e.markedSpans?e.markedSpans.concat([a]):[a],a.marker.attachLine(e)}function Xr(e,a,b){var _;if(e)for(var R=0;R<e.length;++R){var W=e[R],Q=W.marker,ee=W.from==null||(Q.inclusiveLeft?W.from<=a:W.from<a);if(ee||W.from==a&&Q.type=="bookmark"&&(!b||!W.marker.insertLeft)){var ie=W.to==null||(Q.inclusiveRight?W.to>=a:W.to>a);(_||(_=[])).push(new lr(Q,W.from,ie?null:W.to))}}return _}function zr(e,a,b){var _;if(e)for(var R=0;R<e.length;++R){var W=e[R],Q=W.marker,ee=W.to==null||(Q.inclusiveRight?W.to>=a:W.to>a);if(ee||W.from==a&&Q.type=="bookmark"&&(!b||W.marker.insertLeft)){var ie=W.from==null||(Q.inclusiveLeft?W.from<=a:W.from<a);(_||(_=[])).push(new lr(Q,ie?null:W.from-a,W.to==null?null:W.to-a))}}return _}function qi(e,a){if(a.full)return null;var b=Yi(e,a.from.line)&&xt(e,a.from.line).markedSpans,_=Yi(e,a.to.line)&&xt(e,a.to.line).markedSpans;if(!b&&!_)return null;var R=a.from.ch,W=a.to.ch,Q=Dt(a.from,a.to)==0,ee=Xr(b,R,Q),ie=zr(_,W,Q),ue=a.text.length==1,Le=le(a.text).length+(ue?R:0);if(ee)for(var Ie=0;Ie<ee.length;++Ie){var Qe=ee[Ie];if(Qe.to==null){var Ve=Ui(ie,Qe.marker);Ve?ue&&(Qe.to=Ve.to==null?null:Ve.to+Le):Qe.to=R}}if(ie)for(var it=0;it<ie.length;++it){var ut=ie[it];if(ut.to!=null&&(ut.to+=Le),ut.from==null){var dt=Ui(ee,ut.marker);dt||(ut.from=Le,ue&&(ee||(ee=[])).push(ut))}else ut.from+=Le,ue&&(ee||(ee=[])).push(ut)}ee&&(ee=Gi(ee)),ie&&ie!=ee&&(ie=Gi(ie));var gt=[ee];if(!ue){var yt=a.text.length-2,vt;if(yt>0&&ee)for(var bt=0;bt<ee.length;++bt)ee[bt].to==null&&(vt||(vt=[])).push(new lr(ee[bt].marker,null,null));for(var Ot=0;Ot<yt;++Ot)gt.push(vt);gt.push(ie)}return gt}function Gi(e){for(var a=0;a<e.length;++a){var b=e[a];b.from!=null&&b.from==b.to&&b.marker.clearWhenEmpty!==!1&&e.splice(a--,1)}return e.length?e:null}function yr(e,a,b){var _=null;if(e.iter(a.line,b.line+1,function(Ve){if(Ve.markedSpans)for(var it=0;it<Ve.markedSpans.length;++it){var ut=Ve.markedSpans[it].marker;ut.readOnly&&(!_||ce(_,ut)==-1)&&(_||(_=[])).push(ut)}}),!_)return null;for(var R=[{from:a,to:b}],W=0;W<_.length;++W)for(var Q=_[W],ee=Q.find(0),ie=0;ie<R.length;++ie){var ue=R[ie];if(Dt(ue.to,ee.from)<0||Dt(ue.from,ee.to)>0)continue;var Le=[ie,1],Ie=Dt(ue.from,ee.from),Qe=Dt(ue.to,ee.to);(Ie<0||!Q.inclusiveLeft&&!Ie)&&Le.push({from:ue.from,to:ee.from}),(Qe>0||!Q.inclusiveRight&&!Qe)&&Le.push({from:ee.to,to:ue.to}),R.splice.apply(R,Le),ie+=Le.length-3}return R}function cn(e){var a=e.markedSpans;if(!a)return;for(var b=0;b<a.length;++b)a[b].marker.detachLine(e);e.markedSpans=null}function br(e,a){if(!a)return;for(var b=0;b<a.length;++b)a[b].marker.attachLine(e);e.markedSpans=a}function ni(e){return e.inclusiveLeft?-1:0}function Vt(e){return e.inclusiveRight?1:0}function _i(e,a){var b=e.lines.length-a.lines.length;if(b!=0)return b;var _=e.find(),R=a.find(),W=Dt(_.from,R.from)||ni(e)-ni(a);if(W)return-W;var Q=Dt(_.to,R.to)||Vt(e)-Vt(a);return Q||a.id-e.id}function Kt(e,a){var b=di&&e.markedSpans,_;if(b)for(var R=void 0,W=0;W<b.length;++W)R=b[W],R.marker.collapsed&&(a?R.from:R.to)==null&&(!_||_i(_,R.marker)<0)&&(_=R.marker);return _}function si(e){return Kt(e,!0)}function qt(e){return Kt(e,!1)}function ir(e,a){var b=di&&e.markedSpans,_;if(b)for(var R=0;R<b.length;++R){var W=b[R];W.marker.collapsed&&(W.from==null||W.from<a)&&(W.to==null||W.to>a)&&(!_||_i(_,W.marker)<0)&&(_=W.marker)}return _}function fi(e,a,b,_,R){var W=xt(e,a),Q=di&&W.markedSpans;if(Q)for(var ee=0;ee<Q.length;++ee){var ie=Q[ee];if(!ie.marker.collapsed)continue;var ue=ie.marker.find(0),Le=Dt(ue.from,b)||ni(ie.marker)-ni(R),Ie=Dt(ue.to,_)||Vt(ie.marker)-Vt(R);if(Le>=0&&Ie<=0||Le<=0&&Ie>=0)continue;if(Le<=0&&(ie.marker.inclusiveRight&&R.inclusiveLeft?Dt(ue.to,b)>=0:Dt(ue.to,b)>0)||Le>=0&&(ie.marker.inclusiveRight&&R.inclusiveLeft?Dt(ue.from,_)<=0:Dt(ue.from,_)<0))return!0}}function Ai(e){for(var a;a=si(e);)e=a.find(-1,!0).line;return e}function Gr(e){for(var a;a=qt(e);)e=a.find(1,!0).line;return e}function xr(e){for(var a,b;a=qt(e);)e=a.find(1,!0).line,(b||(b=[])).push(e);return b}function dn(e,a){var b=xt(e,a),_=Ai(b);return b==_?a:Ht(_)}function Er(e,a){if(a>e.lastLine())return a;var b=xt(e,a),_;if(!rr(e,b))return a;for(;_=qt(b);)b=_.find(1,!0).line;return Ht(b)+1}function rr(e,a){var b=di&&a.markedSpans;if(b)for(var _=void 0,R=0;R<b.length;++R){if(_=b[R],!_.marker.collapsed)continue;if(_.from==null)return!0;if(_.marker.widgetNode)continue;if(_.from==0&&_.marker.inclusiveLeft&&fn(e,a,_))return!0}}function fn(e,a,b){if(b.to==null){var _=b.marker.find(1,!0);return fn(e,_.line,Ui(_.line.markedSpans,b.marker))}if(b.marker.inclusiveRight&&b.to==a.text.length)return!0;for(var R=void 0,W=0;W<a.markedSpans.length;++W)if(R=a.markedSpans[W],R.marker.collapsed&&!R.marker.widgetNode&&R.from==b.to&&(R.to==null||R.to!=b.from)&&(R.marker.inclusiveLeft||b.marker.inclusiveRight)&&fn(e,a,R))return!0}function Zi(e){e=Ai(e);for(var a=0,b=e.parent,_=0;_<b.lines.length;++_){var R=b.lines[_];if(R==e)break;a+=R.height}for(var W=b.parent;W;b=W,W=b.parent)for(var Q=0;Q<W.children.length;++Q){var ee=W.children[Q];if(ee==b)break;a+=ee.height}return a}function pn(e){if(e.height==0)return 0;for(var a=e.text.length,b,_=e;b=si(_);){var R=b.find(0,!0);_=R.from.line,a+=R.from.ch-R.to.ch}for(_=e;b=qt(_);){var W=b.find(0,!0);a-=_.text.length-W.from.ch,_=W.to.line,a+=_.text.length-W.to.ch}return a}function Hn(e){var a=e.display,b=e.doc;a.maxLine=xt(b,b.first),a.maxLineLength=pn(a.maxLine),a.maxLineChanged=!0,b.iter(function(_){var R=pn(_);R>a.maxLineLength&&(a.maxLineLength=R,a.maxLine=_)})}var Dr=function(e,a,b){this.text=e,br(this,a),this.height=b?b(this):1};Dr.prototype.lineNo=function(){return Ht(this)},ye(Dr);function ua(e,a,b,_){e.text=a,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cn(e),br(e,b);var R=_?_(e):1;R!=e.height&&xi(e,R)}function St(e){e.parent=null,cn(e)}var Mt={},Lt={};function Bt(e,a){if(!e||/^\s*$/.test(e))return null;var b=a.addModeClass?Lt:Mt;return b[e]||(b[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,a){var b=D("span",null,null,g?"padding-right: .1px":null),_={pre:D("pre",[b],"CodeMirror-line"),content:b,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};a.measure={};for(var R=0;R<=(a.rest?a.rest.length:0);R++){var W=R?a.rest[R-1]:a.line,Q=void 0;_.pos=0,_.addToken=jt,Xe(e.display.measure)&&(Q=qe(W,e.doc.direction))&&(_.addToken=ki(_.addToken,Q)),_.map=[];var ee=a!=e.display.externalMeasured&&Ht(W);ur(W,_,rt(e,W,ee)),W.styleClasses&&(W.styleClasses.bgClass&&(_.bgClass=U(W.styleClasses.bgClass,_.bgClass||"")),W.styleClasses.textClass&&(_.textClass=U(W.styleClasses.textClass,_.textClass||""))),_.map.length==0&&_.map.push(0,0,_.content.appendChild(de(e.display.measure))),R==0?(a.measure.map=_.map,a.measure.cache={}):((a.measure.maps||(a.measure.maps=[])).push(_.map),(a.measure.caches||(a.measure.caches=[])).push({}))}if(g){var ie=_.content.lastChild;(/\bcm-tab\b/.test(ie.className)||ie.querySelector&&ie.querySelector(".cm-tab"))&&(_.content.className="cm-tab-wrap-hack")}return Te(e,"renderLine",e,a.line,_.pre),_.pre.className&&(_.textClass=U(_.pre.className,_.textClass||"")),_}function $t(e){var a=p("span","\u2022","cm-invalidchar");return a.title="\\u"+e.charCodeAt(0).toString(16),a.setAttribute("aria-label",a.title),a}function jt(e,a,b,_,R,W,Q){if(!a)return;var ee=e.splitSpaces?hi(a,e.trailingSpace):a,ie=e.cm.state.specialChars,ue=!1,Le;if(!ie.test(a))e.col+=a.length,Le=document.createTextNode(ee),e.map.push(e.pos,e.pos+a.length,Le),E&&x<9&&(ue=!0),e.pos+=a.length;else{Le=document.createDocumentFragment();for(var Ie=0;;){ie.lastIndex=Ie;var Qe=ie.exec(a),Ve=Qe?Qe.index-Ie:a.length-Ie;if(Ve){var it=document.createTextNode(ee.slice(Ie,Ie+Ve));E&&x<9?Le.appendChild(p("span",[it])):Le.appendChild(it),e.map.push(e.pos,e.pos+Ve,it),e.col+=Ve,e.pos+=Ve}if(!Qe)break;Ie+=Ve+1;var ut=void 0;if(Qe[0]==" "){var dt=e.cm.options.tabSize,gt=dt-e.col%dt;ut=Le.appendChild(p("span",_e(gt),"cm-tab")),ut.setAttribute("role","presentation"),ut.setAttribute("cm-text"," "),e.col+=gt}else Qe[0]=="\r"||Qe[0]==`
`?(ut=Le.appendChild(p("span",Qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ut.setAttribute("cm-text",Qe[0]),e.col+=1):(ut=e.cm.options.specialCharPlaceholder(Qe[0]),ut.setAttribute("cm-text",Qe[0]),E&&x<9?Le.appendChild(p("span",[ut])):Le.appendChild(ut),e.col+=1);e.map.push(e.pos,e.pos+1,ut),e.pos++}}if(e.trailingSpace=ee.charCodeAt(a.length-1)==32,b||_||R||ue||W||Q){var yt=b||"";_&&(yt+=_),R&&(yt+=R);var vt=p("span",[Le],yt,W);if(Q)for(var bt in Q)Q.hasOwnProperty(bt)&&bt!="style"&&bt!="class"&&vt.setAttribute(bt,Q[bt]);return e.content.appendChild(vt)}e.content.appendChild(Le)}function hi(e,a){if(e.length>1&&!/ /.test(e))return e;for(var b=a,_="",R=0;R<e.length;R++){var W=e.charAt(R);W==" "&&b&&(R==e.length-1||e.charCodeAt(R+1)==32)&&(W="\xA0"),_+=W,b=W==" "}return _}function ki(e,a){return function(b,_,R,W,Q,ee,ie){R=R?R+" cm-force-border":"cm-force-border";for(var ue=b.pos,Le=ue+_.length;;){for(var Ie=void 0,Qe=0;Qe<a.length&&!(Ie=a[Qe],Ie.to>ue&&Ie.from<=ue);Qe++);if(Ie.to>=Le)return e(b,_,R,W,Q,ee,ie);e(b,_.slice(0,Ie.to-ue),R,W,null,ee,ie),W=null,_=_.slice(Ie.to-ue),ue=Ie.to}}}function Wt(e,a,b,_){var R=!_&&b.widgetNode;R&&e.map.push(e.pos,e.pos+a,R),!_&&e.cm.display.input.needsContentAttribute&&(R||(R=e.content.appendChild(document.createElement("span"))),R.setAttribute("cm-marker",b.id)),R&&(e.cm.display.input.setUneditable(R),e.content.appendChild(R)),e.pos+=a,e.trailingSpace=!1}function ur(e,a,b){var _=e.markedSpans,R=e.text,W=0;if(!_){for(var Q=1;Q<b.length;Q+=2)a.addToken(a,R.slice(W,W=b[Q]),Bt(b[Q+1],a.cm.options));return}for(var ee=R.length,ie=0,ue=1,Le="",Ie,Qe,Ve=0,it,ut,dt,gt,yt;;){if(Ve==ie){it=ut=dt=Qe="",yt=null,gt=null,Ve=Infinity;for(var vt=[],bt=void 0,Ot=0;Ot<_.length;++Ot){var At=_[Ot],Ut=At.marker;if(Ut.type=="bookmark"&&At.from==ie&&Ut.widgetNode)vt.push(Ut);else if(At.from<=ie&&(At.to==null||At.to>ie||Ut.collapsed&&At.to==ie&&At.from==ie)){if(At.to!=null&&At.to!=ie&&Ve>At.to&&(Ve=At.to,ut=""),Ut.className&&(it+=" "+Ut.className),Ut.css&&(Qe=(Qe?Qe+";":"")+Ut.css),Ut.startStyle&&At.from==ie&&(dt+=" "+Ut.startStyle),Ut.endStyle&&At.to==Ve&&(bt||(bt=[])).push(Ut.endStyle,At.to),Ut.title&&((yt||(yt={})).title=Ut.title),Ut.attributes)for(var Jt in Ut.attributes)(yt||(yt={}))[Jt]=Ut.attributes[Jt];Ut.collapsed&&(!gt||_i(gt.marker,Ut)<0)&&(gt=At)}else At.from>ie&&Ve>At.from&&(Ve=At.from)}if(bt)for(var gi=0;gi<bt.length;gi+=2)bt[gi+1]==Ve&&(ut+=" "+bt[gi]);if(!gt||gt.from==ie)for(var ii=0;ii<vt.length;++ii)Wt(a,0,vt[ii]);if(gt&&(gt.from||0)==ie){if(Wt(a,(gt.to==null?ee+1:gt.to)-ie,gt.marker,gt.from==null),gt.to==null)return;gt.to==ie&&(gt=!1)}}if(ie>=ee)break;for(var Hi=Math.min(ee,Ve);;){if(Le){var Mi=ie+Le.length;if(!gt){var oi=Mi>Hi?Le.slice(0,Hi-ie):Le;a.addToken(a,oi,Ie?Ie+it:it,dt,ie+oi.length==Ve?ut:"",Qe,yt)}if(Mi>=Hi){Le=Le.slice(Hi-ie),ie=Hi;break}ie=Mi,dt=""}Le=R.slice(W,W=b[ue++]),Ie=Bt(b[ue++],a.cm.options)}}}function Yt(e,a,b){this.line=a,this.rest=xr(a),this.size=this.rest?Ht(le(this.rest))-b+1:1,this.node=this.text=null,this.hidden=rr(e,a)}function Oi(e,a,b){for(var _=[],R,W=a;W<b;W=R){var Q=new Yt(e.doc,xt(e.doc,W),W);R=W+Q.size,_.push(Q)}return _}var Si=null;function Vi(e){Si?Si.ops.push(e):e.ownsGroup=Si={ops:[e],delayedCallbacks:[]}}function ko(e){var a=e.delayedCallbacks,b=0;do{for(;b<a.length;b++)a[b].call(null);for(var _=0;_<e.ops.length;_++){var R=e.ops[_];if(R.cursorActivityHandlers)for(;R.cursorActivityCalled<R.cursorActivityHandlers.length;)R.cursorActivityHandlers[R.cursorActivityCalled++].call(null,R.cm)}}while(b<a.length)}function Oo(e,a){var b=e.ownsGroup;if(!b)return;try{ko(b)}finally{Si=null,a(b)}}var mn=null;function yi(e,a){var b=ct(e,a);if(!b.length)return;var _=Array.prototype.slice.call(arguments,2),R;Si?R=Si.delayedCallbacks:mn?R=mn:(R=mn=[],setTimeout(Io,0));for(var W=function(ee){R.push(function(){return b[ee].apply(null,_)})},Q=0;Q<b.length;++Q)W(Q)}function Io(){var e=mn;mn=null;for(var a=0;a<e.length;++a)e[a]()}function Ya(e,a,b,_){for(var R=0;R<a.changes.length;R++){var W=a.changes[R];W=="text"?Mo(e,a):W=="gutter"?qa(e,a,b,_):W=="class"?ha(e,a):W=="widget"&&Po(e,a,_)}a.changes=null}function gn(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&x<8&&(e.node.style.zIndex=2)),e.node}function Do(e,a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var _=gn(a);a.background=_.insertBefore(p("div",null,b),_.firstChild),e.display.input.setUneditable(a.background)}}function Qa(e,a){var b=e.display.externalMeasured;return b&&b.line==a.line?(e.display.externalMeasured=null,a.measure=b.measure,b.built):Xt(e,a)}function Mo(e,a){var b=a.text.className,_=Qa(e,a);a.text==a.node&&(a.node=_.pre),a.text.parentNode.replaceChild(_.pre,a.text),a.text=_.pre,_.bgClass!=a.bgClass||_.textClass!=a.textClass?(a.bgClass=_.bgClass,a.textClass=_.textClass,ha(e,a)):b&&(a.text.className=b)}function ha(e,a){Do(e,a),a.line.wrapClass?gn(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function qa(e,a,b,_){if(a.gutter&&(a.node.removeChild(a.gutter),a.gutter=null),a.gutterBackground&&(a.node.removeChild(a.gutterBackground),a.gutterBackground=null),a.line.gutterClass){var R=gn(a);a.gutterBackground=p("div",null,"CodeMirror-gutter-background "+a.line.gutterClass,"left: "+(e.options.fixedGutter?_.fixedPos:-_.gutterTotalWidth)+"px; width: "+_.gutterTotalWidth+"px"),e.display.input.setUneditable(a.gutterBackground),R.insertBefore(a.gutterBackground,a.text)}var W=a.line.gutterMarkers;if(e.options.lineNumbers||W){var Q=gn(a),ee=a.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?_.fixedPos:-_.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),Q.insertBefore(ee,a.text),a.line.gutterClass&&(ee.className+=" "+a.line.gutterClass),e.options.lineNumbers&&(!W||!W["CodeMirror-linenumbers"])&&(a.lineNumber=ee.appendChild(p("div",fr(e.options,b),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+_.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),W)for(var ie=0;ie<e.display.gutterSpecs.length;++ie){var ue=e.display.gutterSpecs[ie].className,Le=W.hasOwnProperty(ue)&&W[ue];Le&&ee.appendChild(p("div",[Le],"CodeMirror-gutter-elt","left: "+_.gutterLeft[ue]+"px; width: "+_.gutterWidth[ue]+"px"))}}}function Po(e,a,b){a.alignable&&(a.alignable=null);for(var _=v("CodeMirror-linewidget"),R=a.node.firstChild,W=void 0;R;R=W)W=R.nextSibling,_.test(R.className)&&a.node.removeChild(R);Za(e,a,b)}function No(e,a,b,_){var R=Qa(e,a);return a.text=a.node=R.pre,R.bgClass&&(a.bgClass=R.bgClass),R.textClass&&(a.textClass=R.textClass),ha(e,a),qa(e,a,b,_),Za(e,a,_),a.node}function Za(e,a,b){if($a(e,a.line,a,b,!0),a.rest)for(var _=0;_<a.rest.length;_++)$a(e,a.rest[_],a,b,!1)}function $a(e,a,b,_,R){if(!a.widgets)return;for(var W=gn(b),Q=0,ee=a.widgets;Q<ee.length;++Q){var ie=ee[Q],ue=p("div",[ie.node],"CodeMirror-linewidget"+(ie.className?" "+ie.className:""));ie.handleMouseEvents||ue.setAttribute("cm-ignore-events","true"),Fo(ie,ue,b,_),e.display.input.setUneditable(ue),R&&ie.above?W.insertBefore(ue,b.gutter||b.text):W.appendChild(ue),yi(ie,"redraw")}}function Fo(e,a,b,_){if(e.noHScroll){(b.alignable||(b.alignable=[])).push(a);var R=_.wrapperWidth;a.style.left=_.fixedPos+"px",e.coverGutter||(R-=_.gutterTotalWidth,a.style.paddingLeft=_.gutterTotalWidth+"px"),a.style.width=R+"px"}e.coverGutter&&(a.style.zIndex=5,a.style.position="relative",e.noHScroll||(a.style.marginLeft=-_.gutterTotalWidth+"px"))}function vn(e){if(e.height!=null)return e.height;var a=e.doc.cm;if(!a)return 0;if(!P(document.body,e.node)){var b="position: relative;";e.coverGutter&&(b+="margin-left: -"+a.display.gutters.offsetWidth+"px;"),e.noHScroll&&(b+="width: "+a.display.wrapper.clientWidth+"px;"),A(a.display.measure,p("div",[e.node],null,b))}return e.height=e.node.parentNode.offsetHeight}function hr(e,a){for(var b=Ce(a);b!=e.wrapper;b=b.parentNode)if(!b||b.nodeType==1&&b.getAttribute("cm-ignore-events")=="true"||b.parentNode==e.sizer&&b!=e.mover)return!0}function Kn(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ja(e){if(e.cachedPaddingH)return e.cachedPaddingH;var a=A(e.measure,p("pre","x","CodeMirror-line-like")),b=window.getComputedStyle?window.getComputedStyle(a):a.currentStyle,_={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};return!isNaN(_.left)&&!isNaN(_.right)&&(e.cachedPaddingH=_),_}function nr(e){return be-e.display.nativeBarWidth}function Mr(e){return e.display.scroller.clientWidth-nr(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-nr(e)-e.display.barHeight}function Uo(e,a,b){var _=e.options.lineWrapping,R=_&&Mr(e);if(!a.measure.heights||_&&a.measure.width!=R){var W=a.measure.heights=[];if(_){a.measure.width=R;for(var Q=a.text.firstChild.getClientRects(),ee=0;ee<Q.length-1;ee++){var ie=Q[ee],ue=Q[ee+1];Math.abs(ie.bottom-ue.bottom)>2&&W.push((ie.bottom+ue.top)/2-b.top)}}W.push(b.bottom-b.top)}}function es(e,a,b){if(e.line==a)return{map:e.measure.map,cache:e.measure.cache};for(var _=0;_<e.rest.length;_++)if(e.rest[_]==a)return{map:e.measure.maps[_],cache:e.measure.caches[_]};for(var R=0;R<e.rest.length;R++)if(Ht(e.rest[R])>b)return{map:e.measure.maps[R],cache:e.measure.caches[R],before:!0}}function Bo(e,a){a=Ai(a);var b=Ht(a),_=e.display.externalMeasured=new Yt(e.doc,a,b);_.lineN=b;var R=_.built=Xt(e,_);return _.text=R.pre,A(e.display.lineMeasure,R.pre),_}function ts(e,a,b,_){return ar(e,Vr(e,a),b,_)}function fa(e,a){if(a>=e.display.viewFrom&&a<e.display.viewTo)return e.display.view[Fr(e,a)];var b=e.display.externalMeasured;if(b&&a>=b.lineN&&a<b.lineN+b.size)return b}function Vr(e,a){var b=Ht(a),_=fa(e,b);_&&!_.text?_=null:_&&_.changes&&(Ya(e,_,b,ya(e)),e.curOp.forceUpdate=!0),_||(_=Bo(e,a));var R=es(_,a,b);return{line:a,view:_,rect:null,map:R.map,cache:R.cache,before:R.before,hasHeights:!1}}function ar(e,a,b,_,R){a.before&&(b=-1);var W=b+(_||""),Q;return a.cache.hasOwnProperty(W)?Q=a.cache[W]:(a.rect||(a.rect=a.view.text.getBoundingClientRect()),a.hasHeights||(Uo(e,a.view,a.rect),a.hasHeights=!0),Q=Ko(e,a,b,_),Q.bogus||(a.cache[W]=Q)),{left:Q.left,right:Q.right,top:R?Q.rtop:Q.top,bottom:R?Q.rbottom:Q.bottom}}var is={left:0,right:0,top:0,bottom:0};function rs(e,a,b){for(var _,R,W,Q,ee,ie,ue=0;ue<e.length;ue+=3)if(ee=e[ue],ie=e[ue+1],a<ee?(R=0,W=1,Q="left"):a<ie?(R=a-ee,W=R+1):(ue==e.length-3||a==ie&&e[ue+3]>a)&&(W=ie-ee,R=W-1,a>=ie&&(Q="right")),R!=null){if(_=e[ue+2],ee==ie&&b==(_.insertLeft?"left":"right")&&(Q=b),b=="left"&&R==0)for(;ue&&e[ue-2]==e[ue-3]&&e[ue-1].insertLeft;)_=e[(ue-=3)+2],Q="left";if(b=="right"&&R==ie-ee)for(;ue<e.length-3&&e[ue+3]==e[ue+4]&&!e[ue+5].insertLeft;)_=e[(ue+=3)+2],Q="right";break}return{node:_,start:R,end:W,collapse:Q,coverStart:ee,coverEnd:ie}}function Ho(e,a){var b=is;if(a=="left")for(var _=0;_<e.length&&!((b=e[_]).left!=b.right);_++);else for(var R=e.length-1;R>=0&&!((b=e[R]).left!=b.right);R--);return b}function Ko(e,a,b,_){var R=rs(a.map,b,_),W=R.node,Q=R.start,ee=R.end,ie=R.collapse,ue;if(W.nodeType==3){for(var Le=0;Le<4;Le++){for(;Q&&Ue(a.line.text.charAt(R.coverStart+Q));)--Q;for(;R.coverStart+ee<R.coverEnd&&Ue(a.line.text.charAt(R.coverStart+ee));)++ee;if(E&&x<9&&Q==0&&ee==R.coverEnd-R.coverStart?ue=W.parentNode.getBoundingClientRect():ue=Ho(O(W,Q,ee).getClientRects(),_),ue.left||ue.right||Q==0)break;ee=Q,Q=Q-1,ie="right"}E&&x<11&&(ue=Wo(e.display.measure,ue))}else{Q>0&&(ie=_="right");var Ie;e.options.lineWrapping&&(Ie=W.getClientRects()).length>1?ue=Ie[_=="right"?Ie.length-1:0]:ue=W.getBoundingClientRect()}if(E&&x<9&&!Q&&(!ue||!ue.left&&!ue.right)){var Qe=W.parentNode.getClientRects()[0];Qe?ue={left:Qe.left,right:Qe.left+Qr(e.display),top:Qe.top,bottom:Qe.bottom}:ue=is}for(var Ve=ue.top-a.rect.top,it=ue.bottom-a.rect.top,ut=(Ve+it)/2,dt=a.view.measure.heights,gt=0;gt<dt.length-1&&!(ut<dt[gt]);gt++);var yt=gt?dt[gt-1]:0,vt=dt[gt],bt={left:(ie=="right"?ue.right:ue.left)-a.rect.left,right:(ie=="left"?ue.left:ue.right)-a.rect.left,top:yt,bottom:vt};return!ue.left&&!ue.right&&(bt.bogus=!0),e.options.singleCursorHeightPerLine||(bt.rtop=Ve,bt.rbottom=it),bt}function Wo(e,a){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ct(e))return a;var b=screen.logicalXDPI/screen.deviceXDPI,_=screen.logicalYDPI/screen.deviceYDPI;return{left:a.left*b,right:a.right*b,top:a.top*_,bottom:a.bottom*_}}function ns(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var a=0;a<e.rest.length;a++)e.measure.caches[a]={}}function as(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var a=0;a<e.display.view.length;a++)ns(e.display.view[a])}function _n(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return o&&s?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return o&&s?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var a=0;if(e.widgets)for(var b=0;b<e.widgets.length;++b)e.widgets[b].above&&(a+=vn(e.widgets[b]));return a}function Wn(e,a,b,_,R){if(!R){var W=pa(a);b.top+=W,b.bottom+=W}if(_=="line")return b;_||(_="local");var Q=Zi(a);if(_=="local"?Q+=Kn(e.display):Q-=e.display.viewOffset,_=="page"||_=="window"){var ee=e.display.lineSpace.getBoundingClientRect();Q+=ee.top+(_=="window"?0:os());var ie=ee.left+(_=="window"?0:ss());b.left+=ie,b.right+=ie}return b.top+=Q,b.bottom+=Q,b}function ls(e,a,b){if(b=="div")return a;var _=a.left,R=a.top;if(b=="page")_-=ss(),R-=os();else if(b=="local"||!b){var W=e.display.sizer.getBoundingClientRect();_+=W.left,R+=W.top}var Q=e.display.lineSpace.getBoundingClientRect();return{left:_-Q.left,top:R-Q.top}}function ma(e,a,b,_,R){return _||(_=xt(e.doc,a.line)),Wn(e,_,ts(e,_,a.ch,R),b)}function $i(e,a,b,_,R,W){_=_||xt(e.doc,a.line),R||(R=Vr(e,_));function Q(it,ut){var dt=ar(e,R,it,ut?"right":"left",W);return ut?dt.left=dt.right:dt.right=dt.left,Wn(e,_,dt,b)}var ee=qe(_,e.doc.direction),ie=a.ch,ue=a.sticky;if(ie>=_.text.length?(ie=_.text.length,ue="before"):ie<=0&&(ie=0,ue="after"),!ee)return Q(ue=="before"?ie-1:ie,ue=="before");function Le(it,ut,dt){var gt=ee[ut],yt=gt.level==1;return Q(dt?it-1:it,yt!=dt)}var Ie=ae(ee,ie,ue),Qe=ve,Ve=Le(ie,Ie,ue=="before");return Qe!=null&&(Ve.other=Le(ie,Qe,ue!="before")),Ve}function us(e,a){var b=0;a=F(e.doc,a),e.options.lineWrapping||(b=Qr(e.display)*a.ch);var _=xt(e.doc,a.line),R=Zi(_)+Kn(e.display);return{left:b,right:b,top:R,bottom:R+_.height}}function ga(e,a,b,_,R){var W=ht(e,a,b);return W.xRel=R,_&&(W.outside=_),W}function va(e,a,b){var _=e.doc;if(b+=e.display.viewOffset,b<0)return ga(_.first,0,null,-1,-1);var R=Ki(_,b),W=_.first+_.size-1;if(R>W)return ga(_.first+_.size-1,xt(_,W).text.length,null,1,1);a<0&&(a=0);for(var Q=xt(_,R);;){var ee=jo(e,Q,R,a,b),ie=ir(Q,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!ie)return ee;var ue=ie.find(1);if(ue.line==R)return ue;Q=xt(_,R=ue.line)}}function hs(e,a,b,_){_-=pa(a);var R=a.text.length,W=ke(function(Q){return ar(e,b,Q-1).bottom<=_},R,0);return R=ke(function(Q){return ar(e,b,Q).top>_},W,R),{begin:W,end:R}}function cs(e,a,b,_){b||(b=Vr(e,a));var R=Wn(e,a,ar(e,b,_),"line").top;return hs(e,a,b,R)}function _a(e,a,b,_){return e.bottom<=b?!1:e.top>b?!0:(_?e.left:e.right)>a}function jo(e,a,b,_,R){R-=Zi(a);var W=Vr(e,a),Q=pa(a),ee=0,ie=a.text.length,ue=!0,Le=qe(a,e.doc.direction);if(Le){var Ie=(e.options.lineWrapping?zo:Xo)(e,a,b,W,Le,_,R);ue=Ie.level!=1,ee=ue?Ie.from:Ie.to-1,ie=ue?Ie.to:Ie.from-1}var Qe=null,Ve=null,it=ke(function(Ot){var At=ar(e,W,Ot);return At.top+=Q,At.bottom+=Q,_a(At,_,R,!1)?(At.top<=R&&At.left<=_&&(Qe=Ot,Ve=At),!0):!1},ee,ie),ut,dt,gt=!1;if(Ve){var yt=_-Ve.left<Ve.right-_,vt=yt==ue;it=Qe+(vt?0:1),dt=vt?"after":"before",ut=yt?Ve.left:Ve.right}else{!ue&&(it==ie||it==ee)&&it++,dt=it==0?"after":it==a.text.length?"before":ar(e,W,it-(ue?1:0)).bottom+Q<=R==ue?"after":"before";var bt=$i(e,ht(b,it,dt),"line",a,W);ut=bt.left,gt=R<bt.top?-1:R>=bt.bottom?1:0}return it=Pe(a.text,it,1),ga(b,it,dt,gt,_-ut)}function Xo(e,a,b,_,R,W,Q){var ee=ke(function(Ie){var Qe=R[Ie],Ve=Qe.level!=1;return _a($i(e,ht(b,Ve?Qe.to:Qe.from,Ve?"before":"after"),"line",a,_),W,Q,!0)},0,R.length-1),ie=R[ee];if(ee>0){var ue=ie.level!=1,Le=$i(e,ht(b,ue?ie.from:ie.to,ue?"after":"before"),"line",a,_);_a(Le,W,Q,!0)&&Le.top>Q&&(ie=R[ee-1])}return ie}function zo(e,a,b,_,R,W,Q){var ee=hs(e,a,_,Q),ie=ee.begin,ue=ee.end;/\s/.test(a.text.charAt(ue-1))&&ue--;for(var Le=null,Ie=null,Qe=0;Qe<R.length;Qe++){var Ve=R[Qe];if(Ve.from>=ue||Ve.to<=ie)continue;var it=Ve.level!=1,ut=ar(e,_,it?Math.min(ue,Ve.to)-1:Math.max(ie,Ve.from)).right,dt=ut<W?W-ut+1e9:ut-W;(!Le||Ie>dt)&&(Le=Ve,Ie=dt)}return Le||(Le=R[R.length-1]),Le.from<ie&&(Le={from:ie,to:Le.to,level:Le.level}),Le.to>ue&&(Le={from:Le.from,to:ue,level:Le.level}),Le}var Pr;function Yr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pr==null){Pr=p("pre",null,"CodeMirror-line-like");for(var a=0;a<49;++a)Pr.appendChild(document.createTextNode("x")),Pr.appendChild(p("br"));Pr.appendChild(document.createTextNode("x"))}A(e.measure,Pr);var b=Pr.offsetHeight/50;return b>3&&(e.cachedTextHeight=b),T(e.measure),b||1}function Qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var a=p("span","xxxxxxxxxx"),b=p("pre",[a],"CodeMirror-line-like");A(e.measure,b);var _=a.getBoundingClientRect(),R=(_.right-_.left)/10;return R>2&&(e.cachedCharWidth=R),R||10}function ya(e){for(var a=e.display,b={},_={},R=a.gutters.clientLeft,W=a.gutters.firstChild,Q=0;W;W=W.nextSibling,++Q){var ee=e.display.gutterSpecs[Q].className;b[ee]=W.offsetLeft+W.clientLeft+R,_[ee]=W.clientWidth}return{fixedPos:ba(a),gutterTotalWidth:a.gutters.offsetWidth,gutterLeft:b,gutterWidth:_,wrapperWidth:a.wrapper.clientWidth}}function ba(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var a=Yr(e.display),b=e.options.lineWrapping,_=b&&Math.max(5,e.display.scroller.clientWidth/Qr(e.display)-3);return function(R){if(rr(e.doc,R))return 0;var W=0;if(R.widgets)for(var Q=0;Q<R.widgets.length;Q++)R.widgets[Q].height&&(W+=R.widgets[Q].height);return b?W+(Math.ceil(R.text.length/_)||1)*a:W+a}}function xa(e){var a=e.doc,b=ds(e);a.iter(function(_){var R=b(_);R!=_.height&&xi(_,R)})}function Nr(e,a,b,_){var R=e.display;if(!b&&Ce(a).getAttribute("cm-not-content")=="true")return null;var W,Q,ee=R.lineSpace.getBoundingClientRect();try{W=a.clientX-ee.left,Q=a.clientY-ee.top}catch(Ie){return null}var ie=va(e,W,Q),ue;if(_&&ie.xRel>0&&(ue=xt(e.doc,ie.line).text).length==ie.ch){var Le=z(ue,ue.length,e.options.tabSize)-ue.length;ie=ht(ie.line,Math.max(0,Math.round((W-Ja(e.display).left)/Qr(e.display))-Le))}return ie}function Fr(e,a){if(a>=e.display.viewTo)return null;if(a-=e.display.viewFrom,a<0)return null;for(var b=e.display.view,_=0;_<b.length;_++)if(a-=b[_].size,a<0)return _}function Ii(e,a,b,_){a==null&&(a=e.doc.first),b==null&&(b=e.doc.first+e.doc.size),_||(_=0);var R=e.display;if(_&&b<R.viewTo&&(R.updateLineNumbers==null||R.updateLineNumbers>a)&&(R.updateLineNumbers=a),e.curOp.viewChanged=!0,a>=R.viewTo)di&&dn(e.doc,a)<R.viewTo&&Sr(e);else if(b<=R.viewFrom)di&&Er(e.doc,b+_)>R.viewFrom?Sr(e):(R.viewFrom+=_,R.viewTo+=_);else if(a<=R.viewFrom&&b>=R.viewTo)Sr(e);else if(a<=R.viewFrom){var W=jn(e,b,b+_,1);W?(R.view=R.view.slice(W.index),R.viewFrom=W.lineN,R.viewTo+=_):Sr(e)}else if(b>=R.viewTo){var Q=jn(e,a,a,-1);Q?(R.view=R.view.slice(0,Q.index),R.viewTo=Q.lineN):Sr(e)}else{var ee=jn(e,a,a,-1),ie=jn(e,b,b+_,1);ee&&ie?(R.view=R.view.slice(0,ee.index).concat(Oi(e,ee.lineN,ie.lineN)).concat(R.view.slice(ie.index)),R.viewTo+=_):Sr(e)}var ue=R.externalMeasured;ue&&(b<ue.lineN?ue.lineN+=_:a<ue.lineN+ue.size&&(R.externalMeasured=null))}function wr(e,a,b){e.curOp.viewChanged=!0;var _=e.display,R=e.display.externalMeasured;if(R&&a>=R.lineN&&a<R.lineN+R.size&&(_.externalMeasured=null),a<_.viewFrom||a>=_.viewTo)return;var W=_.view[Fr(e,a)];if(W.node==null)return;var Q=W.changes||(W.changes=[]);ce(Q,b)==-1&&Q.push(b)}function Sr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jn(e,a,b,_){var R=Fr(e,a),W,Q=e.display.view;if(!di||b==e.doc.first+e.doc.size)return{index:R,lineN:b};for(var ee=e.display.viewFrom,ie=0;ie<R;ie++)ee+=Q[ie].size;if(ee!=a){if(_>0){if(R==Q.length-1)return null;W=ee+Q[R].size-a,R++}else W=ee-a;a+=W,b+=W}for(;dn(e.doc,b)!=b;){if(R==(_<0?0:Q.length-1))return null;b+=_*Q[R-(_<0?1:0)].size,R+=_}return{index:R,lineN:b}}function Go(e,a,b){var _=e.display,R=_.view;R.length==0||a>=_.viewTo||b<=_.viewFrom?(_.view=Oi(e,a,b),_.viewFrom=a):(_.viewFrom>a?_.view=Oi(e,a,_.viewFrom).concat(_.view):_.viewFrom<a&&(_.view=_.view.slice(Fr(e,a))),_.viewFrom=a,_.viewTo<b?_.view=_.view.concat(Oi(e,_.viewTo,b)):_.viewTo>b&&(_.view=_.view.slice(0,Fr(e,b)))),_.viewTo=b}function fs(e){for(var a=e.display.view,b=0,_=0;_<a.length;_++){var R=a[_];!R.hidden&&(!R.node||R.changes)&&++b}return b}function yn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,a){a===void 0&&(a=!0);for(var b=e.doc,_={},R=_.cursors=document.createDocumentFragment(),W=_.selection=document.createDocumentFragment(),Q=0;Q<b.sel.ranges.length;Q++){if(!a&&Q==b.sel.primIndex)continue;var ee=b.sel.ranges[Q];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var ie=ee.empty();(ie||e.options.showCursorWhenSelecting)&&ms(e,ee.head,R),ie||Vo(e,ee,W)}return _}function ms(e,a,b){var _=$i(e,a,"div",null,null,!e.options.singleCursorHeightPerLine),R=b.appendChild(p("div","\xA0","CodeMirror-cursor"));if(R.style.left=_.left+"px",R.style.top=_.top+"px",R.style.height=Math.max(0,_.bottom-_.top)*e.options.cursorHeight+"px",_.other){var W=b.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));W.style.display="",W.style.left=_.other.left+"px",W.style.top=_.other.top+"px",W.style.height=(_.other.bottom-_.other.top)*.85+"px"}}function Xn(e,a){return e.top-a.top||e.left-a.left}function Vo(e,a,b){var _=e.display,R=e.doc,W=document.createDocumentFragment(),Q=Ja(e.display),ee=Q.left,ie=Math.max(_.sizerWidth,Mr(e)-_.sizer.offsetLeft)-Q.right,ue=R.direction=="ltr";function Le(vt,bt,Ot,At){bt<0&&(bt=0),bt=Math.round(bt),At=Math.round(At),W.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+vt+`px;
top: `+bt+"px; width: "+(Ot==null?ie-vt:Ot)+`px;
height: `+(At-bt)+"px"))}function Ie(vt,bt,Ot){var At=xt(R,vt),Ut=At.text.length,Jt,gi;function ii(oi,Pi){return ma(e,ht(vt,oi),"div",At,Pi)}function Hi(oi,Pi,bi){var ci=cs(e,At,null,oi),li=Pi=="ltr"==(bi=="after")?"left":"right",ri=bi=="after"?ci.begin:ci.end-(/\s/.test(At.text.charAt(ci.end-1))?2:1);return ii(ri,li)[li]}var Mi=qe(At,R.direction);return re(Mi,bt||0,Ot==null?Ut:Ot,function(oi,Pi,bi,ci){var li=bi=="ltr",ri=ii(oi,li?"left":"right"),Ni=ii(Pi-1,li?"right":"left"),un=bt==null&&oi==0,kr=Ot==null&&Pi==Ut,Ci=ci==0,sr=!Mi||ci==Mi.length-1;if(Ni.top-ri.top<=3){var vi=(ue?un:kr)&&Ci,Ga=(ue?kr:un)&&sr,dr=vi?ee:(li?ri:Ni).left,Wr=Ga?ie:(li?Ni:ri).right;Le(dr,ri.top,Wr-dr,ri.bottom)}else{var jr,Li,hn,Va;li?(jr=ue&&un&&Ci?ee:ri.left,Li=ue?ie:Hi(oi,bi,"before"),hn=ue?ee:Hi(Pi,bi,"after"),Va=ue&&kr&&sr?ie:Ni.right):(jr=ue?Hi(oi,bi,"before"):ee,Li=!ue&&un&&Ci?ie:ri.right,hn=!ue&&kr&&sr?ee:Ni.left,Va=ue?Hi(Pi,bi,"after"):ie),Le(jr,ri.top,Li-jr,ri.bottom),ri.bottom<Ni.top&&Le(ee,ri.bottom,null,Ni.top),Le(hn,Ni.top,Va-hn,Ni.bottom)}(!Jt||Xn(ri,Jt)<0)&&(Jt=ri),Xn(Ni,Jt)<0&&(Jt=Ni),(!gi||Xn(ri,gi)<0)&&(gi=ri),Xn(Ni,gi)<0&&(gi=Ni)}),{start:Jt,end:gi}}var Qe=a.from(),Ve=a.to();if(Qe.line==Ve.line)Ie(Qe.line,Qe.ch,Ve.ch);else{var it=xt(R,Qe.line),ut=xt(R,Ve.line),dt=Ai(it)==Ai(ut),gt=Ie(Qe.line,Qe.ch,dt?it.text.length+1:null).end,yt=Ie(Ve.line,dt?0:null,Ve.ch).start;dt&&(gt.top<yt.top-2?(Le(gt.right,gt.top,null,gt.bottom),Le(ee,yt.top,yt.left,yt.bottom)):Le(gt.right,gt.top,yt.left-gt.right,gt.bottom)),gt.bottom<yt.top&&Le(ee,gt.bottom,null,yt.top)}b.appendChild(W)}function Ea(e){if(!e.state.focused)return;var a=e.display;clearInterval(a.blinker);var b=!0;a.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?a.blinker=setInterval(function(){e.hasFocus()||qr(e),a.cursorDiv.style.visibility=(b=!b)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(a.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),wa(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qr(e))},100)}function wa(e,a){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Te(e,"focus",e,a),e.state.focused=!0,K(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ea(e)}function qr(e,a){if(e.state.delayingBlurEvent)return;e.state.focused&&(Te(e,"blur",e,a),e.state.focused=!1,y(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zn(e){for(var a=e.display,b=a.lineDiv.offsetTop,_=0;_<a.view.length;_++){var R=a.view[_],W=e.options.lineWrapping,Q=void 0,ee=0;if(R.hidden)continue;if(E&&x<8){var ie=R.node.offsetTop+R.node.offsetHeight;Q=ie-b,b=ie}else{var ue=R.node.getBoundingClientRect();Q=ue.bottom-ue.top,!W&&R.text.firstChild&&(ee=R.text.firstChild.getBoundingClientRect().right-ue.left-1)}var Le=R.line.height-Q;if((Le>.005||Le<-.005)&&(xi(R.line,Q),_s(R.line),R.rest))for(var Ie=0;Ie<R.rest.length;Ie++)_s(R.rest[Ie]);if(ee>e.display.sizerWidth){var Qe=Math.ceil(ee/Qr(e.display));Qe>e.display.maxLineLength&&(e.display.maxLineLength=Qe,e.display.maxLine=R.line,e.display.maxLineChanged=!0)}}}function _s(e){if(e.widgets)for(var a=0;a<e.widgets.length;++a){var b=e.widgets[a],_=b.node.parentNode;_&&(b.height=_.offsetHeight)}}function Gn(e,a,b){var _=b&&b.top!=null?Math.max(0,b.top):e.scroller.scrollTop;_=Math.floor(_-Kn(e));var R=b&&b.bottom!=null?b.bottom:_+e.wrapper.clientHeight,W=Ki(a,_),Q=Ki(a,R);if(b&&b.ensure){var ee=b.ensure.from.line,ie=b.ensure.to.line;ee<W?(W=ee,Q=Ki(a,Zi(xt(a,ee))+e.wrapper.clientHeight)):Math.min(ie,a.lastLine())>=Q&&(W=Ki(a,Zi(xt(a,ie))-e.wrapper.clientHeight),Q=ie)}return{from:W,to:Math.max(Q,W+1)}}function Yo(e,a){if(We(e,"scrollCursorIntoView"))return;var b=e.display,_=b.sizer.getBoundingClientRect(),R=null;if(a.top+_.top<0?R=!0:a.bottom+_.top>(window.innerHeight||document.documentElement.clientHeight)&&(R=!1),R!=null&&!t){var W=p("div","\u200B",null,`position: absolute;
top: `+(a.top-b.viewOffset-Kn(e.display))+`px;
height: `+(a.bottom-a.top+nr(e)+b.barHeight)+`px;
left: `+a.left+"px; width: "+Math.max(2,a.right-a.left)+"px;");e.display.lineSpace.appendChild(W),W.scrollIntoView(R),e.display.lineSpace.removeChild(W)}}function Qo(e,a,b,_){_==null&&(_=0);var R;!e.options.lineWrapping&&a==b&&(a=a.ch?ht(a.line,a.sticky=="before"?a.ch-1:a.ch,"after"):a,b=a.sticky=="before"?ht(a.line,a.ch+1,"before"):a);for(var W=0;W<5;W++){var Q=!1,ee=$i(e,a),ie=!b||b==a?ee:$i(e,b);R={left:Math.min(ee.left,ie.left),top:Math.min(ee.top,ie.top)-_,right:Math.max(ee.left,ie.left),bottom:Math.max(ee.bottom,ie.bottom)+_};var ue=Sa(e,R),Le=e.doc.scrollTop,Ie=e.doc.scrollLeft;if(ue.scrollTop!=null&&(xn(e,ue.scrollTop),Math.abs(e.doc.scrollTop-Le)>1&&(Q=!0)),ue.scrollLeft!=null&&(Ur(e,ue.scrollLeft),Math.abs(e.doc.scrollLeft-Ie)>1&&(Q=!0)),!Q)break}return R}function qo(e,a){var b=Sa(e,a);b.scrollTop!=null&&xn(e,b.scrollTop),b.scrollLeft!=null&&Ur(e,b.scrollLeft)}function Sa(e,a){var b=e.display,_=Yr(e.display);a.top<0&&(a.top=0);var R=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:b.scroller.scrollTop,W=da(e),Q={};a.bottom-a.top>W&&(a.bottom=a.top+W);var ee=e.doc.height+ca(b),ie=a.top<_,ue=a.bottom>ee-_;if(a.top<R)Q.scrollTop=ie?0:a.top;else if(a.bottom>R+W){var Le=Math.min(a.top,(ue?ee:a.bottom)-W);Le!=R&&(Q.scrollTop=Le)}var Ie=e.options.fixedGutter?0:b.gutters.offsetWidth,Qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:b.scroller.scrollLeft-Ie,Ve=Mr(e)-b.gutters.offsetWidth,it=a.right-a.left>Ve;return it&&(a.right=a.left+Ve),a.left<10?Q.scrollLeft=0:a.left<Qe?Q.scrollLeft=Math.max(0,a.left+Ie-(it?0:10)):a.right>Ve+Qe-3&&(Q.scrollLeft=a.right+(it?0:10)-Ve),Q}function Ta(e,a){if(a==null)return;Vn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+a}function Zr(e){Vn(e);var a=e.getCursor();e.curOp.scrollToPos={from:a,to:a,margin:e.options.cursorScrollMargin}}function bn(e,a,b){(a!=null||b!=null)&&Vn(e),a!=null&&(e.curOp.scrollLeft=a),b!=null&&(e.curOp.scrollTop=b)}function Zo(e,a){Vn(e),e.curOp.scrollToPos=a}function Vn(e){var a=e.curOp.scrollToPos;if(a){e.curOp.scrollToPos=null;var b=us(e,a.from),_=us(e,a.to);ys(e,b,_,a.margin)}}function ys(e,a,b,_){var R=Sa(e,{left:Math.min(a.left,b.left),top:Math.min(a.top,b.top)-_,right:Math.max(a.right,b.right),bottom:Math.max(a.bottom,b.bottom)+_});bn(e,R.scrollLeft,R.scrollTop)}function xn(e,a){if(Math.abs(e.doc.scrollTop-a)<2)return;I||Aa(e,{top:a}),bs(e,a,!0),I&&Aa(e),Sn(e,100)}function bs(e,a,b){if(a=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,a)),e.display.scroller.scrollTop==a&&!b)return;e.doc.scrollTop=a,e.display.scrollbars.setScrollTop(a),e.display.scroller.scrollTop!=a&&(e.display.scroller.scrollTop=a)}function Ur(e,a,b,_){if(a=Math.max(0,Math.min(a,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(b?a==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-a)<2)&&!_)return;e.doc.scrollLeft=a,Ts(e),e.display.scroller.scrollLeft!=a&&(e.display.scroller.scrollLeft=a),e.display.scrollbars.setScrollLeft(a)}function En(e){var a=e.display,b=a.gutters.offsetWidth,_=Math.round(e.doc.height+ca(e.display));return{clientHeight:a.scroller.clientHeight,viewHeight:a.wrapper.clientHeight,scrollWidth:a.scroller.scrollWidth,clientWidth:a.scroller.clientWidth,viewWidth:a.wrapper.clientWidth,barLeft:e.options.fixedGutter?b:0,docHeight:_,scrollHeight:_+nr(e)+a.barHeight,nativeBarWidth:a.nativeBarWidth,gutterWidth:b}}var Br=function(e,a,b){this.cm=b;var _=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),R=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");_.tabIndex=R.tabIndex=-1,e(_),e(R),je(_,"scroll",function(){_.clientHeight&&a(_.scrollTop,"vertical")}),je(R,"scroll",function(){R.clientWidth&&a(R.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var a=e.scrollWidth>e.clientWidth+1,b=e.scrollHeight>e.clientHeight+1,_=e.nativeBarWidth;if(b){this.vert.style.display="block",this.vert.style.bottom=a?_+"px":"0";var R=e.viewHeight-(a?_:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+R)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(a){this.horiz.style.display="block",this.horiz.style.right=b?_+"px":"0",this.horiz.style.left=e.barLeft+"px";var W=e.viewWidth-e.barLeft-(b?_:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+W)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(_==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:b?_:0,bottom:a?_:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=c&&!n?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},Br.prototype.enableZeroWidthBar=function(e,a,b){e.style.pointerEvents="auto";function _(){var R=e.getBoundingClientRect(),W=b=="vert"?document.elementFromPoint(R.right-1,(R.top+R.bottom)/2):document.elementFromPoint((R.right+R.left)/2,R.bottom-1);W!=e?e.style.pointerEvents="none":a.set(1e3,_)}a.set(1e3,_)},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}},wn.prototype.setScrollLeft=function(){},wn.prototype.setScrollTop=function(){},wn.prototype.clear=function(){};function $r(e,a){a||(a=En(e));var b=e.display.barWidth,_=e.display.barHeight;xs(e,a);for(var R=0;R<4&&b!=e.display.barWidth||_!=e.display.barHeight;R++)b!=e.display.barWidth&&e.options.lineWrapping&&zn(e),xs(e,En(e)),b=e.display.barWidth,_=e.display.barHeight}function xs(e,a){var b=e.display,_=b.scrollbars.update(a);b.sizer.style.paddingRight=(b.barWidth=_.right)+"px",b.sizer.style.paddingBottom=(b.barHeight=_.bottom)+"px",b.heightForcer.style.borderBottom=_.bottom+"px solid transparent",_.right&&_.bottom?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=_.bottom+"px",b.scrollbarFiller.style.width=_.right+"px"):b.scrollbarFiller.style.display="",_.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=_.bottom+"px",b.gutterFiller.style.width=a.gutterWidth+"px"):b.gutterFiller.style.display=""}var Es={native:Br,null:wn};function ws(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&y(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Es[e.options.scrollbarStyle](function(a){e.display.wrapper.insertBefore(a,e.display.scrollbarFiller),je(a,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,b){b=="horizontal"?Ur(e,a):xn(e,a)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var $o=0;function Hr(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:++$o},Vi(e.curOp)}function Kr(e){var a=e.curOp;a&&Oo(a,function(b){for(var _=0;_<b.ops.length;_++)b.ops[_].cm.curOp=null;Jo(b)})}function Jo(e){for(var a=e.ops,b=0;b<a.length;b++)el(a[b]);for(var _=0;_<a.length;_++)tl(a[_]);for(var R=0;R<a.length;R++)il(a[R]);for(var W=0;W<a.length;W++)rl(a[W]);for(var Q=0;Q<a.length;Q++)nl(a[Q])}function el(e){var a=e.cm,b=a.display;sl(a),e.updateMaxLine&&Hn(a),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<b.viewFrom||e.scrollToPos.to.line>=b.viewTo)||b.maxLineChanged&&a.options.lineWrapping,e.update=e.mustUpdate&&new Yn(a,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function il(e){var a=e.cm,b=a.display;e.updatedDisplay&&zn(a),e.barMeasure=En(a),b.maxLineChanged&&!a.options.lineWrapping&&(e.adjustWidthTo=ts(a,b.maxLine,b.maxLine.text.length).left+3,a.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(b.scroller.clientWidth,b.sizer.offsetLeft+e.adjustWidthTo+nr(a)+a.display.barWidth),e.maxScrollLeft=Math.max(0,b.sizer.offsetLeft+e.adjustWidthTo-Mr(a))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=b.input.prepareSelection())}function rl(e){var a=e.cm;e.adjustWidthTo!=null&&(a.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<a.doc.scrollLeft&&Ur(a,Math.min(a.display.scroller.scrollLeft,e.maxScrollLeft),!0),a.display.maxLineChanged=!1);var b=e.focus&&e.focus==j();e.preparedSelection&&a.display.input.showSelection(e.preparedSelection,b),(e.updatedDisplay||e.startHeight!=a.doc.height)&&$r(a,e.barMeasure),e.updatedDisplay&&La(a,e.barMeasure),e.selectionChanged&&Ea(a),a.state.focused&&e.updateInput&&a.display.input.reset(e.typing),b&&gs(e.cm)}function nl(e){var a=e.cm,b=a.display,_=a.doc;if(e.updatedDisplay&&Ss(a,e.update),b.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(b.wheelStartX=b.wheelStartY=null),e.scrollTop!=null&&bs(a,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ur(a,e.scrollLeft,!0,!0),e.scrollToPos){var R=Qo(a,F(_,e.scrollToPos.from),F(_,e.scrollToPos.to),e.scrollToPos.margin);Yo(a,R)}var W=e.maybeHiddenMarkers,Q=e.maybeUnhiddenMarkers;if(W)for(var ee=0;ee<W.length;++ee)W[ee].lines.length||Te(W[ee],"hide");if(Q)for(var ie=0;ie<Q.length;++ie)Q[ie].lines.length&&Te(Q[ie],"unhide");b.wrapper.offsetHeight&&(_.scrollTop=a.display.scroller.scrollTop),e.changeObjs&&Te(a,"changes",a,e.changeObjs),e.update&&e.update.finish()}function Bi(e,a){if(e.curOp)return a();Hr(e);try{return a()}finally{Kr(e)}}function pi(e,a){return function(){if(e.curOp)return a.apply(e,arguments);Hr(e);try{return a.apply(e,arguments)}finally{Kr(e)}}}function Ri(e){return function(){if(this.curOp)return e.apply(this,arguments);Hr(this);try{return e.apply(this,arguments)}finally{Kr(this)}}}function mi(e){return function(){var a=this.cm;if(!a||a.curOp)return e.apply(this,arguments);Hr(a);try{return e.apply(this,arguments)}finally{Kr(a)}}}function Sn(e,a){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(a,B(al,e))}function al(e){var a=e.doc;if(a.highlightFrontier>=e.display.viewTo)return;var b=+new Date+e.options.workTime,_=pt(e,a.highlightFrontier),R=[];a.iter(_.line,Math.min(a.first+a.size,e.display.viewTo+500),function(W){if(_.line>=e.display.viewFrom){var Q=W.styles,ee=W.text.length>e.options.maxHighlightLength?Ft(a.mode,_.state):null,ie=Me(e,W,_,!0);ee&&(_.state=ee),W.styles=ie.styles;var ue=W.styleClasses,Le=ie.classes;Le?W.styleClasses=Le:ue&&(W.styleClasses=null);for(var Ie=!Q||Q.length!=W.styles.length||ue!=Le&&(!ue||!Le||ue.bgClass!=Le.bgClass||ue.textClass!=Le.textClass),Qe=0;!Ie&&Qe<Q.length;++Qe)Ie=Q[Qe]!=W.styles[Qe];Ie&&R.push(_.line),W.stateAfter=_.save(),_.nextLine()}else W.text.length<=e.options.maxHighlightLength&&Et(e,W.text,_),W.stateAfter=_.line%5==0?_.save():null,_.nextLine();if(+new Date>b)return Sn(e,e.options.workDelay),!0}),a.highlightFrontier=_.line,a.modeFrontier=Math.max(a.modeFrontier,_.line),R.length&&Bi(e,function(){for(var W=0;W<R.length;W++)wr(e,R[W],"text")})}var Yn=function(e,a,b){var _=e.display;this.viewport=a,this.visible=Gn(_,e.doc,a),this.editorIsHidden=!_.wrapper.offsetWidth,this.wrapperHeight=_.wrapper.clientHeight,this.wrapperWidth=_.wrapper.clientWidth,this.oldDisplayWidth=Mr(e),this.force=b,this.dims=ya(e),this.events=[]};Yn.prototype.signal=function(e,a){ge(e,a)&&this.events.push(arguments)},Yn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Te.apply(null,this.events[e])};function sl(e){var a=e.display;!a.scrollbarsClipped&&a.scroller.offsetWidth&&(a.nativeBarWidth=a.scroller.offsetWidth-a.scroller.clientWidth,a.heightForcer.style.height=nr(e)+"px",a.sizer.style.marginBottom=-a.nativeBarWidth+"px",a.sizer.style.borderRightWidth=nr(e)+"px",a.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var a=j();if(!a||!P(e.display.lineDiv,a))return null;var b={activeElt:a};if(window.getSelection){var _=window.getSelection();_.anchorNode&&_.extend&&P(e.display.lineDiv,_.anchorNode)&&(b.anchorNode=_.anchorNode,b.anchorOffset=_.anchorOffset,b.focusNode=_.focusNode,b.focusOffset=_.focusOffset)}return b}function ll(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var a=window.getSelection(),b=document.createRange();b.setEnd(e.anchorNode,e.anchorOffset),b.collapse(!1),a.removeAllRanges(),a.addRange(b),a.extend(e.focusNode,e.focusOffset)}}function Ca(e,a){var b=e.display,_=e.doc;if(a.editorIsHidden)return Sr(e),!1;if(!a.force&&a.visible.from>=b.viewFrom&&a.visible.to<=b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo)&&b.renderedView==b.view&&fs(e)==0)return!1;Cs(e)&&(Sr(e),a.dims=ya(e));var R=_.first+_.size,W=Math.max(a.visible.from-e.options.viewportMargin,_.first),Q=Math.min(R,a.visible.to+e.options.viewportMargin);b.viewFrom<W&&W-b.viewFrom<20&&(W=Math.max(_.first,b.viewFrom)),b.viewTo>Q&&b.viewTo-Q<20&&(Q=Math.min(R,b.viewTo)),di&&(W=dn(e.doc,W),Q=Er(e.doc,Q));var ee=W!=b.viewFrom||Q!=b.viewTo||b.lastWrapHeight!=a.wrapperHeight||b.lastWrapWidth!=a.wrapperWidth;Go(e,W,Q),b.viewOffset=Zi(xt(e.doc,b.viewFrom)),e.display.mover.style.top=b.viewOffset+"px";var ie=fs(e);if(!ee&&ie==0&&!a.force&&b.renderedView==b.view&&(b.updateLineNumbers==null||b.updateLineNumbers>=b.viewTo))return!1;var ue=ol(e);return ie>4&&(b.lineDiv.style.display="none"),ul(e,b.updateLineNumbers,a.dims),ie>4&&(b.lineDiv.style.display=""),b.renderedView=b.view,ll(ue),T(b.cursorDiv),T(b.selectionDiv),b.gutters.style.height=b.sizer.style.minHeight=0,ee&&(b.lastWrapHeight=a.wrapperHeight,b.lastWrapWidth=a.wrapperWidth,Sn(e,400)),b.updateLineNumbers=null,!0}function Ss(e,a){for(var b=a.viewport,_=!0;;_=!1){if(!_||!e.options.lineWrapping||a.oldDisplayWidth==Mr(e)){if(b&&b.top!=null&&(b={top:Math.min(e.doc.height+ca(e.display)-da(e),b.top)}),a.visible=Gn(e.display,e.doc,b),a.visible.from>=e.display.viewFrom&&a.visible.to<=e.display.viewTo)break}else _&&(a.visible=Gn(e.display,e.doc,b));if(!Ca(e,a))break;zn(e);var R=En(e);yn(e),$r(e,R),La(e,R),a.force=!1}a.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(a.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,a){var b=new Yn(e,a);if(Ca(e,b)){zn(e),Ss(e,b);var _=En(e);yn(e),$r(e,_),La(e,_),b.finish()}}function ul(e,a,b){var _=e.display,R=e.options.lineNumbers,W=_.lineDiv,Q=W.firstChild;function ee(it){var ut=it.nextSibling;return g&&c&&e.display.currentWheelTarget==it?it.style.display="none":it.parentNode.removeChild(it),ut}for(var ie=_.view,ue=_.viewFrom,Le=0;Le<ie.length;Le++){var Ie=ie[Le];if(!Ie.hidden)if(!Ie.node||Ie.node.parentNode!=W){var Qe=No(e,Ie,ue,b);W.insertBefore(Qe,Q)}else{for(;Q!=Ie.node;)Q=ee(Q);var Ve=R&&a!=null&&a<=ue&&Ie.lineNumber;Ie.changes&&(ce(Ie.changes,"gutter")>-1&&(Ve=!1),Ya(e,Ie,ue,b)),Ve&&(T(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(fr(e.options,ue)))),Q=Ie.node.nextSibling}ue+=Ie.size}for(;Q;)Q=ee(Q)}function Ra(e){var a=e.gutters.offsetWidth;e.sizer.style.marginLeft=a+"px"}function La(e,a){e.display.sizer.style.minHeight=a.docHeight+"px",e.display.heightForcer.style.top=a.docHeight+"px",e.display.gutters.style.height=a.docHeight+e.display.barHeight+nr(e)+"px"}function Ts(e){var a=e.display,b=a.view;if(!a.alignWidgets&&(!a.gutters.firstChild||!e.options.fixedGutter))return;for(var _=ba(a)-a.scroller.scrollLeft+e.doc.scrollLeft,R=a.gutters.offsetWidth,W=_+"px",Q=0;Q<b.length;Q++)if(!b[Q].hidden){e.options.fixedGutter&&(b[Q].gutter&&(b[Q].gutter.style.left=W),b[Q].gutterBackground&&(b[Q].gutterBackground.style.left=W));var ee=b[Q].alignable;if(ee)for(var ie=0;ie<ee.length;ie++)ee[ie].style.left=W}e.options.fixedGutter&&(a.gutters.style.left=_+R+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var a=e.doc,b=fr(e.options,a.first+a.size-1),_=e.display;if(b.length!=_.lineNumChars){var R=_.measure.appendChild(p("div",[p("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),W=R.firstChild.offsetWidth,Q=R.offsetWidth-W;return _.lineGutter.style.width="",_.lineNumInnerWidth=Math.max(W,_.lineGutter.offsetWidth-Q)+1,_.lineNumWidth=_.lineNumInnerWidth+Q,_.lineNumChars=_.lineNumInnerWidth?b.length:-1,_.lineGutter.style.width=_.lineNumWidth+"px",Ra(e.display),!0}return!1}function ka(e,a){for(var b=[],_=!1,R=0;R<e.length;R++){var W=e[R],Q=null;if(typeof W!="string"&&(Q=W.style,W=W.className),W=="CodeMirror-linenumbers")if(a)_=!0;else continue;b.push({className:W,style:Q})}return a&&!_&&b.push({className:"CodeMirror-linenumbers",style:null}),b}function As(e){var a=e.gutters,b=e.gutterSpecs;T(a),e.lineGutter=null;for(var _=0;_<b.length;++_){var R=b[_],W=R.className,Q=R.style,ee=a.appendChild(p("div",null,"CodeMirror-gutter "+W));Q&&(ee.style.cssText=Q),W=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}a.style.display=b.length?"":"none",Ra(e)}function Tn(e){As(e.display),Ii(e),Ts(e)}function hl(e,a,b,_){var R=this;this.input=b,R.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),R.scrollbarFiller.setAttribute("cm-not-content","true"),R.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),R.gutterFiller.setAttribute("cm-not-content","true"),R.lineDiv=D("div",null,"CodeMirror-code"),R.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),R.cursorDiv=p("div",null,"CodeMirror-cursors"),R.measure=p("div",null,"CodeMirror-measure"),R.lineMeasure=p("div",null,"CodeMirror-measure"),R.lineSpace=D("div",[R.measure,R.lineMeasure,R.selectionDiv,R.cursorDiv,R.lineDiv],null,"position: relative; outline: none");var W=D("div",[R.lineSpace],"CodeMirror-lines");R.mover=p("div",[W],null,"position: relative"),R.sizer=p("div",[R.mover],"CodeMirror-sizer"),R.sizerWidth=null,R.heightForcer=p("div",null,null,"position: absolute; height: "+be+"px; width: 1px;"),R.gutters=p("div",null,"CodeMirror-gutters"),R.lineGutter=null,R.scroller=p("div",[R.sizer,R.heightForcer,R.gutters],"CodeMirror-scroll"),R.scroller.setAttribute("tabIndex","-1"),R.wrapper=p("div",[R.scrollbarFiller,R.gutterFiller,R.scroller],"CodeMirror"),E&&x<8&&(R.gutters.style.zIndex=-1,R.scroller.style.paddingRight=0),!g&&!(I&&l)&&(R.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(R.wrapper):e(R.wrapper)),R.viewFrom=R.viewTo=a.first,R.reportedViewFrom=R.reportedViewTo=a.first,R.view=[],R.renderedView=null,R.externalMeasured=null,R.viewOffset=0,R.lastWrapHeight=R.lastWrapWidth=0,R.updateLineNumbers=null,R.nativeBarWidth=R.barHeight=R.barWidth=0,R.scrollbarsClipped=!1,R.lineNumWidth=R.lineNumInnerWidth=R.lineNumChars=null,R.alignWidgets=!1,R.cachedCharWidth=R.cachedTextHeight=R.cachedPaddingH=null,R.maxLine=null,R.maxLineLength=0,R.maxLineChanged=!1,R.wheelDX=R.wheelDY=R.wheelStartX=R.wheelStartY=null,R.shift=!1,R.selForContextMenu=null,R.activeTouch=null,R.gutterSpecs=ka(_.gutters,_.lineNumbers),As(R),b.init(R)}var Qn=0,ji=null;E?ji=-.53:I?ji=15:o?ji=-.7:r&&(ji=-1/3);function Rs(e){var a=e.wheelDeltaX,b=e.wheelDeltaY;return a==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(a=e.detail),b==null&&e.detail&&e.axis==e.VERTICAL_AXIS?b=e.detail:b==null&&(b=e.wheelDelta),{x:a,y:b}}function cl(e){var a=Rs(e);return a.x*=ji,a.y*=ji,a}function Ls(e,a){var b=Rs(a),_=b.x,R=b.y,W=e.display,Q=W.scroller,ee=Q.scrollWidth>Q.clientWidth,ie=Q.scrollHeight>Q.clientHeight;if(!(_&&ee||R&&ie))return;if(R&&c&&g){e:for(var ue=a.target,Le=W.view;ue!=Q;ue=ue.parentNode)for(var Ie=0;Ie<Le.length;Ie++)if(Le[Ie].node==ue){e.display.currentWheelTarget=ue;break e}}if(_&&!I&&!u&&ji!=null){R&&ie&&xn(e,Math.max(0,Q.scrollTop+R*ji)),Ur(e,Math.max(0,Q.scrollLeft+_*ji)),(!R||R&&ie)&&J(a),W.wheelStartX=null;return}if(R&&ji!=null){var Qe=R*ji,Ve=e.doc.scrollTop,it=Ve+W.wrapper.clientHeight;Qe<0?Ve=Math.max(0,Ve+Qe-50):it=Math.min(e.doc.height,it+Qe+50),Aa(e,{top:Ve,bottom:it})}Qn<20&&(W.wheelStartX==null?(W.wheelStartX=Q.scrollLeft,W.wheelStartY=Q.scrollTop,W.wheelDX=_,W.wheelDY=R,setTimeout(function(){if(W.wheelStartX==null)return;var ut=Q.scrollLeft-W.wheelStartX,dt=Q.scrollTop-W.wheelStartY,gt=dt&&W.wheelDY&&dt/W.wheelDY||ut&&W.wheelDX&&ut/W.wheelDX;if(W.wheelStartX=W.wheelStartY=null,!gt)return;ji=(ji*Qn+gt)/(Qn+1),++Qn},200)):(W.wheelDX+=_,W.wheelDY+=R))}var Xi=function(e,a){this.ranges=e,this.primIndex=a};Xi.prototype.primary=function(){return this.ranges[this.primIndex]},Xi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var a=0;a<this.ranges.length;a++){var b=this.ranges[a],_=e.ranges[a];if(!pr(b.anchor,_.anchor)||!pr(b.head,_.head))return!1}return!0},Xi.prototype.deepCopy=function(){for(var e=[],a=0;a<this.ranges.length;a++)e[a]=new Qt(mr(this.ranges[a].anchor),mr(this.ranges[a].head));return new Xi(e,this.primIndex)},Xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xi.prototype.contains=function(e,a){a||(a=e);for(var b=0;b<this.ranges.length;b++){var _=this.ranges[b];if(Dt(a,_.from())>=0&&Dt(e,_.to())<=0)return b}return-1};var Qt=function(e,a){this.anchor=e,this.head=a};Qt.prototype.from=function(){return vr(this.anchor,this.head)},Qt.prototype.to=function(){return gr(this.anchor,this.head)},Qt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ji(e,a,b){var _=e&&e.options.selectionsMayTouch,R=a[b];a.sort(function(Qe,Ve){return Dt(Qe.from(),Ve.from())}),b=ce(a,R);for(var W=1;W<a.length;W++){var Q=a[W],ee=a[W-1],ie=Dt(ee.to(),Q.from());if(_&&!Q.empty()?ie>0:ie>=0){var ue=vr(ee.from(),Q.from()),Le=gr(ee.to(),Q.to()),Ie=ee.empty()?Q.from()==Q.head:ee.from()==ee.head;W<=b&&--b,a.splice(--W,2,new Qt(Ie?Le:ue,Ie?ue:Le))}}return new Xi(a,b)}function Tr(e,a){return new Xi([new Qt(e,a||e)],0)}function Cr(e){return e.text?ht(e.from.line+e.text.length-1,le(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ks(e,a){if(Dt(e,a.from)<0)return e;if(Dt(e,a.to)<=0)return Cr(a);var b=e.line+a.text.length-(a.to.line-a.from.line)-1,_=e.ch;return e.line==a.to.line&&(_+=Cr(a).ch-a.to.ch),ht(b,_)}function Oa(e,a){for(var b=[],_=0;_<e.sel.ranges.length;_++){var R=e.sel.ranges[_];b.push(new Qt(ks(R.anchor,a),ks(R.head,a)))}return Ji(e.cm,b,e.sel.primIndex)}function Os(e,a,b){return e.line==a.line?ht(b.line,e.ch-a.ch+b.ch):ht(b.line+(e.line-a.line),e.ch)}function dl(e,a,b){for(var _=[],R=ht(e.first,0),W=R,Q=0;Q<a.length;Q++){var ee=a[Q],ie=Os(ee.from,R,W),ue=Os(Cr(ee),R,W);if(R=ee.to,W=ue,b=="around"){var Le=e.sel.ranges[Q],Ie=Dt(Le.head,Le.anchor)<0;_[Q]=new Qt(Ie?ue:ie,Ie?ie:ue)}else _[Q]=new Qt(ie,ie)}return new Xi(_,e.sel.primIndex)}function Ia(e){e.doc.mode=Tt(e.options,e.doc.modeOption),Cn(e)}function Cn(e){e.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Sn(e,100),e.state.modeGen++,e.curOp&&Ii(e)}function Is(e,a){return a.from.ch==0&&a.to.ch==0&&le(a.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Da(e,a,b,_){function R(yt){return b?b[yt]:null}function W(yt,vt,bt){ua(yt,vt,bt,_),yi(yt,"change",yt,a)}function Q(yt,vt){for(var bt=[],Ot=yt;Ot<vt;++Ot)bt.push(new Dr(ue[Ot],R(Ot),_));return bt}var ee=a.from,ie=a.to,ue=a.text,Le=xt(e,ee.line),Ie=xt(e,ie.line),Qe=le(ue),Ve=R(ue.length-1),it=ie.line-ee.line;if(a.full)e.insert(0,Q(0,ue.length)),e.remove(ue.length,e.size-ue.length);else if(Is(e,a)){var ut=Q(0,ue.length-1);W(Ie,Ie.text,Ve),it&&e.remove(ee.line,it),ut.length&&e.insert(ee.line,ut)}else if(Le==Ie)if(ue.length==1)W(Le,Le.text.slice(0,ee.ch)+Qe+Le.text.slice(ie.ch),Ve);else{var dt=Q(1,ue.length-1);dt.push(new Dr(Qe+Le.text.slice(ie.ch),Ve,_)),W(Le,Le.text.slice(0,ee.ch)+ue[0],R(0)),e.insert(ee.line+1,dt)}else if(ue.length==1)W(Le,Le.text.slice(0,ee.ch)+ue[0]+Ie.text.slice(ie.ch),R(0)),e.remove(ee.line+1,it);else{W(Le,Le.text.slice(0,ee.ch)+ue[0],R(0)),W(Ie,Qe+Ie.text.slice(ie.ch),Ve);var gt=Q(1,ue.length-1);it>1&&e.remove(ee.line+1,it-1),e.insert(ee.line+1,gt)}yi(e,"change",e,a)}function Ar(e,a,b){function _(R,W,Q){if(R.linked)for(var ee=0;ee<R.linked.length;++ee){var ie=R.linked[ee];if(ie.doc==W)continue;var ue=Q&&ie.sharedHist;if(b&&!ue)continue;a(ie.doc,ue),_(ie.doc,R,ue)}}_(e,null,!0)}function Ds(e,a){if(a.cm)throw new Error("This document is already in use.");e.doc=a,a.cm=e,xa(e),Ia(e),Ms(e),e.options.lineWrapping||Hn(e),e.options.mode=a.modeOption,Ii(e)}function Ms(e){(e.doc.direction=="rtl"?K:y)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Bi(e,function(){Ms(e),Ii(e)})}function qn(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 Ma(e,a){var b={from:mr(a.from),to:Cr(a),text:zi(e,a.from,a.to)};return Fs(e,b,a.from.line,a.to.line+1),Ar(e,function(_){return Fs(_,b,a.from.line,a.to.line+1)},!0),b}function Ps(e){for(;e.length;){var a=le(e);if(a.ranges)e.pop();else break}}function pl(e,a){if(a)return Ps(e.done),le(e.done);if(e.done.length&&!le(e.done).ranges)return le(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),le(e.done)}function Ns(e,a,b,_){var R=e.history;R.undone.length=0;var W=+new Date,Q,ee;if((R.lastOp==_||R.lastOrigin==a.origin&&a.origin&&(a.origin.charAt(0)=="+"&&R.lastModTime>W-(e.cm?e.cm.options.historyEventDelay:500)||a.origin.charAt(0)=="*"))&&(Q=pl(R,R.lastOp==_)))ee=le(Q.changes),Dt(a.from,a.to)==0&&Dt(a.from,ee.to)==0?ee.to=Cr(a):Q.changes.push(Ma(e,a));else{var ie=le(R.done);for((!ie||!ie.ranges)&&Zn(e.sel,R.done),Q={changes:[Ma(e,a)],generation:R.generation},R.done.push(Q);R.done.length>R.undoDepth;)R.done.shift(),R.done[0].ranges||R.done.shift()}R.done.push(b),R.generation=++R.maxGeneration,R.lastModTime=R.lastSelTime=W,R.lastOp=R.lastSelOp=_,R.lastOrigin=R.lastSelOrigin=a.origin,ee||Te(e,"historyAdded")}function ml(e,a,b,_){var R=a.charAt(0);return R=="*"||R=="+"&&b.ranges.length==_.ranges.length&&b.somethingSelected()==_.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,a,b,_){var R=e.history,W=_&&_.origin;b==R.lastSelOp||W&&R.lastSelOrigin==W&&(R.lastModTime==R.lastSelTime&&R.lastOrigin==W||ml(e,W,le(R.done),a))?R.done[R.done.length-1]=a:Zn(a,R.done),R.lastSelTime=+new Date,R.lastSelOrigin=W,R.lastSelOp=b,_&&_.clearRedo!==!1&&Ps(R.undone)}function Zn(e,a){var b=le(a);b&&b.ranges&&b.equals(e)||a.push(e)}function Fs(e,a,b,_){var R=a["spans_"+e.id],W=0;e.iter(Math.max(e.first,b),Math.min(e.first+e.size,_),function(Q){Q.markedSpans&&((R||(R=a["spans_"+e.id]={}))[W]=Q.markedSpans),++W})}function vl(e){if(!e)return null;for(var a,b=0;b<e.length;++b)e[b].marker.explicitlyCleared?a||(a=e.slice(0,b)):a&&a.push(e[b]);return a?a.length?a:null:e}function _l(e,a){var b=a["spans_"+e.id];if(!b)return null;for(var _=[],R=0;R<a.text.length;++R)_.push(vl(b[R]));return _}function Us(e,a){var b=_l(e,a),_=qi(e,a);if(!b)return _;if(!_)return b;for(var R=0;R<b.length;++R){var W=b[R],Q=_[R];if(W&&Q){e:for(var ee=0;ee<Q.length;++ee){for(var ie=Q[ee],ue=0;ue<W.length;++ue)if(W[ue].marker==ie.marker)continue e;W.push(ie)}}else Q&&(b[R]=Q)}return b}function Jr(e,a,b){for(var _=[],R=0;R<e.length;++R){var W=e[R];if(W.ranges){_.push(b?Xi.prototype.deepCopy.call(W):W);continue}var Q=W.changes,ee=[];_.push({changes:ee});for(var ie=0;ie<Q.length;++ie){var ue=Q[ie],Le=void 0;if(ee.push({from:ue.from,to:ue.to,text:ue.text}),a)for(var Ie in ue)(Le=Ie.match(/^spans_(\d+)$/))&&(ce(a,Number(Le[1]))>-1&&(le(ee)[Ie]=ue[Ie],delete ue[Ie]))}}return _}function Pa(e,a,b,_){if(_){var R=e.anchor;if(b){var W=Dt(a,R)<0;W!=Dt(b,R)<0?(R=a,a=b):W!=Dt(a,b)<0&&(a=b)}return new Qt(R,a)}else return new Qt(b||a,a)}function $n(e,a,b,_,R){R==null&&(R=e.cm&&(e.cm.display.shift||e.extend)),Ti(e,new Xi([Pa(e.sel.primary(),a,b,R)],0),_)}function Bs(e,a,b){for(var _=[],R=e.cm&&(e.cm.display.shift||e.extend),W=0;W<e.sel.ranges.length;W++)_[W]=Pa(e.sel.ranges[W],a[W],null,R);var Q=Ji(e.cm,_,e.sel.primIndex);Ti(e,Q,b)}function Na(e,a,b,_){var R=e.sel.ranges.slice(0);R[a]=b,Ti(e,Ji(e.cm,R,e.sel.primIndex),_)}function Hs(e,a,b,_){Ti(e,Tr(a,b),_)}function yl(e,a,b){var _={ranges:a.ranges,update:function(R){this.ranges=[];for(var W=0;W<R.length;W++)this.ranges[W]=new Qt(F(e,R[W].anchor),F(e,R[W].head))},origin:b&&b.origin};return Te(e,"beforeSelectionChange",e,_),e.cm&&Te(e.cm,"beforeSelectionChange",e.cm,_),_.ranges!=a.ranges?Ji(e.cm,_.ranges,_.ranges.length-1):a}function Ks(e,a,b){var _=e.history.done,R=le(_);R&&R.ranges?(_[_.length-1]=a,Jn(e,a,b)):Ti(e,a,b)}function Ti(e,a,b){Jn(e,a,b),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,b)}function Jn(e,a,b){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(a=yl(e,a,b));var _=b&&b.bias||(Dt(a.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,Xs(e,a,_,!0)),!(b&&b.scroll===!1)&&e.cm&&Zr(e.cm)}function Ws(e,a){if(a.equals(e.sel))return;e.sel=a,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),yi(e,"cursorActivity",e)}function js(e){Ws(e,Xs(e,e.sel,null,!1))}function Xs(e,a,b,_){for(var R,W=0;W<a.ranges.length;W++){var Q=a.ranges[W],ee=a.ranges.length==e.sel.ranges.length&&e.sel.ranges[W],ie=ea(e,Q.anchor,ee&&ee.anchor,b,_),ue=ea(e,Q.head,ee&&ee.head,b,_);(R||ie!=Q.anchor||ue!=Q.head)&&(R||(R=a.ranges.slice(0,W)),R[W]=new Qt(ie,ue))}return R?Ji(e.cm,R,a.primIndex):a}function en(e,a,b,_,R){var W=xt(e,a.line);if(W.markedSpans)for(var Q=0;Q<W.markedSpans.length;++Q){var ee=W.markedSpans[Q],ie=ee.marker,ue="selectLeft"in ie?!ie.selectLeft:ie.inclusiveLeft,Le="selectRight"in ie?!ie.selectRight:ie.inclusiveRight;if((ee.from==null||(ue?ee.from<=a.ch:ee.from<a.ch))&&(ee.to==null||(Le?ee.to>=a.ch:ee.to>a.ch))){if(R&&(Te(ie,"beforeCursorEnter"),ie.explicitlyCleared))if(W.markedSpans){--Q;continue}else break;if(!ie.atomic)continue;if(b){var Ie=ie.find(_<0?1:-1),Qe=void 0;if((_<0?Le:ue)&&(Ie=zs(e,Ie,-_,Ie&&Ie.line==a.line?W:null)),Ie&&Ie.line==a.line&&(Qe=Dt(Ie,b))&&(_<0?Qe<0:Qe>0))return en(e,Ie,a,_,R)}var Ve=ie.find(_<0?-1:1);return(_<0?ue:Le)&&(Ve=zs(e,Ve,_,Ve.line==a.line?W:null)),Ve?en(e,Ve,a,_,R):null}}return a}function ea(e,a,b,_,R){var W=_||1,Q=en(e,a,b,W,R)||!R&&en(e,a,b,W,!0)||en(e,a,b,-W,R)||!R&&en(e,a,b,-W,!0);return Q||(e.cantEdit=!0,ht(e.first,0))}function zs(e,a,b,_){return b<0&&a.ch==0?a.line>e.first?F(e,ht(a.line-1)):null:b>0&&a.ch==(_||xt(e,a.line)).text.length?a.line<e.first+e.size-1?ht(a.line+1,0):null:new ht(a.line,a.ch+b)}function Gs(e){e.setSelection(ht(e.firstLine(),0),ht(e.lastLine()),Oe)}function Vs(e,a,b){var _={canceled:!1,from:a.from,to:a.to,text:a.text,origin:a.origin,cancel:function(){return _.canceled=!0}};return b&&(_.update=function(R,W,Q,ee){R&&(_.from=F(e,R)),W&&(_.to=F(e,W)),Q&&(_.text=Q),ee!==void 0&&(_.origin=ee)}),Te(e,"beforeChange",e,_),e.cm&&Te(e.cm,"beforeChange",e.cm,_),_.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:_.from,to:_.to,text:_.text,origin:_.origin}}function tn(e,a,b){if(e.cm){if(!e.cm.curOp)return pi(e.cm,tn)(e,a,b);if(e.cm.state.suppressEdits)return}if((ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))&&(a=Vs(e,a,!0),!a))return;var _=Or&&!b&&yr(e,a.from,a.to);if(_)for(var R=_.length-1;R>=0;--R)Ys(e,{from:_[R].from,to:_[R].to,text:R?[""]:a.text,origin:a.origin});else Ys(e,a)}function Ys(e,a){if(a.text.length==1&&a.text[0]==""&&Dt(a.from,a.to)==0)return;var b=Oa(e,a);Ns(e,a,b,e.cm?e.cm.curOp.id:NaN),An(e,a,b,qi(e,a));var _=[];Ar(e,function(R,W){!W&&ce(_,R.history)==-1&&($s(R.history,a),_.push(R.history)),An(R,a,null,qi(R,a))})}function ta(e,a,b){var _=e.cm&&e.cm.state.suppressEdits;if(_&&!b)return;for(var R=e.history,W,Q=e.sel,ee=a=="undo"?R.done:R.undone,ie=a=="undo"?R.undone:R.done,ue=0;ue<ee.length&&!(W=ee[ue],b?W.ranges&&!W.equals(e.sel):!W.ranges);ue++);if(ue==ee.length)return;for(R.lastOrigin=R.lastSelOrigin=null;;)if(W=ee.pop(),W.ranges){if(Zn(W,ie),b&&!W.equals(e.sel)){Ti(e,W,{clearRedo:!1});return}Q=W}else if(_){ee.push(W);return}else break;var Le=[];Zn(Q,ie),ie.push({changes:Le,generation:R.generation}),R.generation=W.generation||++R.maxGeneration;for(var Ie=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),Qe=function(ut){var dt=W.changes[ut];if(dt.origin=a,Ie&&!Vs(e,dt,!1))return ee.length=0,{};Le.push(Ma(e,dt));var gt=ut?Oa(e,dt):le(ee);An(e,dt,gt,Us(e,dt)),!ut&&e.cm&&e.cm.scrollIntoView({from:dt.from,to:Cr(dt)});var yt=[];Ar(e,function(vt,bt){!bt&&ce(yt,vt.history)==-1&&($s(vt.history,dt),yt.push(vt.history)),An(vt,dt,null,Us(vt,dt))})},Ve=W.changes.length-1;Ve>=0;--Ve){var it=Qe(Ve);if(it)return it.v}}function Qs(e,a){if(a==0)return;if(e.first+=a,e.sel=new Xi(Ee(e.sel.ranges,function(R){return new Qt(ht(R.anchor.line+a,R.anchor.ch),ht(R.head.line+a,R.head.ch))}),e.sel.primIndex),e.cm){Ii(e.cm,e.first,e.first-a,a);for(var b=e.cm.display,_=b.viewFrom;_<b.viewTo;_++)wr(e.cm,_,"gutter")}}function An(e,a,b,_){if(e.cm&&!e.cm.curOp)return pi(e.cm,An)(e,a,b,_);if(a.to.line<e.first){Qs(e,a.text.length-1-(a.to.line-a.from.line));return}if(a.from.line>e.lastLine())return;if(a.from.line<e.first){var R=a.text.length-1-(e.first-a.from.line);Qs(e,R),a={from:ht(e.first,0),to:ht(a.to.line+R,a.to.ch),text:[le(a.text)],origin:a.origin}}var W=e.lastLine();a.to.line>W&&(a={from:a.from,to:ht(W,xt(e,W).text.length),text:[a.text[0]],origin:a.origin}),a.removed=zi(e,a.from,a.to),b||(b=Oa(e,a)),e.cm?bl(e.cm,a,_):Da(e,a,_),Jn(e,b,Oe),e.cantEdit&&ea(e,ht(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,a,b){var _=e.doc,R=e.display,W=a.from,Q=a.to,ee=!1,ie=W.line;e.options.lineWrapping||(ie=Ht(Ai(xt(_,W.line))),_.iter(ie,Q.line+1,function(Ve){if(Ve==R.maxLine)return ee=!0,!0})),_.sel.contains(a.from,a.to)>-1&&xe(e),Da(_,a,b,ds(e)),e.options.lineWrapping||(_.iter(ie,W.line+a.text.length,function(Ve){var it=pn(Ve);it>R.maxLineLength&&(R.maxLine=Ve,R.maxLineLength=it,R.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),Qi(_,W.line),Sn(e,400);var ue=a.text.length-(Q.line-W.line)-1;a.full?Ii(e):W.line==Q.line&&a.text.length==1&&!Is(e.doc,a)?wr(e,W.line,"text"):Ii(e,W.line,Q.line+1,ue);var Le=ge(e,"changes"),Ie=ge(e,"change");if(Ie||Le){var Qe={from:W,to:Q,text:a.text,removed:a.removed,origin:a.origin};Ie&&yi(e,"change",e,Qe),Le&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Qe)}e.display.selForContextMenu=null}function rn(e,a,b,_,R){var W;_||(_=b),Dt(_,b)<0&&(W=[_,b],b=W[0],_=W[1]),typeof a=="string"&&(a=e.splitLines(a)),tn(e,{from:b,to:_,text:a,origin:R})}function qs(e,a,b,_){b<e.line?e.line+=_:a<e.line&&(e.line=a,e.ch=0)}function Zs(e,a,b,_){for(var R=0;R<e.length;++R){var W=e[R],Q=!0;if(W.ranges){W.copied||(W=e[R]=W.deepCopy(),W.copied=!0);for(var ee=0;ee<W.ranges.length;ee++)qs(W.ranges[ee].anchor,a,b,_),qs(W.ranges[ee].head,a,b,_);continue}for(var ie=0;ie<W.changes.length;++ie){var ue=W.changes[ie];if(b<ue.from.line)ue.from=ht(ue.from.line+_,ue.from.ch),ue.to=ht(ue.to.line+_,ue.to.ch);else if(a<=ue.to.line){Q=!1;break}}Q||(e.splice(0,R+1),R=0)}}function $s(e,a){var b=a.from.line,_=a.to.line,R=a.text.length-(_-b)-1;Zs(e.done,b,_,R),Zs(e.undone,b,_,R)}function Rn(e,a,b,_){var R=a,W=a;return typeof a=="number"?W=xt(e,$(e,a)):R=Ht(a),R==null?null:(_(W,R)&&e.cm&&wr(e.cm,R,b),W)}function Ln(e){this.lines=e,this.parent=null;for(var a=0,b=0;b<e.length;++b)e[b].parent=this,a+=e[b].height;this.height=a}Ln.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,a){for(var b=e,_=e+a;b<_;++b){var R=this.lines[b];this.height-=R.height,St(R),yi(R,"delete")}this.lines.splice(e,a)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,a,b){this.height+=b,this.lines=this.lines.slice(0,e).concat(a).concat(this.lines.slice(e));for(var _=0;_<a.length;++_)a[_].parent=this},iterN:function(e,a,b){for(var _=e+a;e<_;++e)if(b(this.lines[e]))return!0}};function kn(e){this.children=e;for(var a=0,b=0,_=0;_<e.length;++_){var R=e[_];a+=R.chunkSize(),b+=R.height,R.parent=this}this.size=a,this.height=b,this.parent=null}kn.prototype={chunkSize:function(){return this.size},removeInner:function(e,a){this.size-=a;for(var b=0;b<this.children.length;++b){var _=this.children[b],R=_.chunkSize();if(e<R){var W=Math.min(a,R-e),Q=_.height;if(_.removeInner(e,W),this.height-=Q-_.height,R==W&&(this.children.splice(b--,1),_.parent=null),(a-=W)==0)break;e=0}else e-=R}if(this.size-a<25&&(this.children.length>1||!(this.children[0]instanceof Ln))){var ee=[];this.collapse(ee),this.children=[new Ln(ee)],this.children[0].parent=this}},collapse:function(e){for(var a=0;a<this.children.length;++a)this.children[a].collapse(e)},insertInner:function(e,a,b){this.size+=a.length,this.height+=b;for(var _=0;_<this.children.length;++_){var R=this.children[_],W=R.chunkSize();if(e<=W){if(R.insertInner(e,a,b),R.lines&&R.lines.length>50){for(var Q=R.lines.length%25+25,ee=Q;ee<R.lines.length;){var ie=new Ln(R.lines.slice(ee,ee+=25));R.height-=ie.height,this.children.splice(++_,0,ie),ie.parent=this}R.lines=R.lines.slice(0,Q),this.maybeSpill()}break}e-=W}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var a=e.children.splice(e.children.length-5,5),b=new kn(a);if(e.parent){e.size-=b.size,e.height-=b.height;var R=ce(e.parent.children,e);e.parent.children.splice(R+1,0,b)}else{var _=new kn(e.children);_.parent=e,e.children=[_,b],e=_}b.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,a,b){for(var _=0;_<this.children.length;++_){var R=this.children[_],W=R.chunkSize();if(e<W){var Q=Math.min(a,W-e);if(R.iterN(e,Q,b))return!0;if((a-=Q)==0)break;e=0}else e-=W}}};var On=function(e,a,b){if(b)for(var _ in b)b.hasOwnProperty(_)&&(this[_]=b[_]);this.doc=e,this.node=a};On.prototype.clear=function(){var e=this.doc.cm,a=this.line.widgets,b=this.line,_=Ht(b);if(_==null||!a)return;for(var R=0;R<a.length;++R)a[R]==this&&a.splice(R--,1);a.length||(b.widgets=null);var W=vn(this);xi(b,Math.max(0,b.height-W)),e&&(Bi(e,function(){Js(e,b,-W),wr(e,_,"widget")}),yi(e,"lineWidgetCleared",e,this,_))},On.prototype.changed=function(){var e=this,a=this.height,b=this.doc.cm,_=this.line;this.height=null;var R=vn(this)-a;if(!R)return;rr(this.doc,_)||xi(_,_.height+R),b&&Bi(b,function(){b.curOp.forceUpdate=!0,Js(b,_,R),yi(b,"lineWidgetChanged",b,e,Ht(_))})},ye(On);function Js(e,a,b){Zi(a)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ta(e,b)}function xl(e,a,b,_){var R=new On(e,b,_),W=e.cm;return W&&R.noHScroll&&(W.display.alignWidgets=!0),Rn(e,a,"widget",function(Q){var ee=Q.widgets||(Q.widgets=[]);if(R.insertAt==null?ee.push(R):ee.splice(Math.min(ee.length-1,Math.max(0,R.insertAt)),0,R),R.line=Q,W&&!rr(e,Q)){var ie=Zi(Q)<e.scrollTop;xi(Q,Q.height+vn(R)),ie&&Ta(W,R.height),W.curOp.forceUpdate=!0}return!0}),W&&yi(W,"lineWidgetAdded",W,R,typeof a=="number"?a:Ht(a)),R}var eo=0,Rr=function(e,a){this.lines=[],this.type=a,this.doc=e,this.id=++eo};Rr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,a=e&&!e.curOp;if(a&&Hr(e),ge(this,"clear")){var b=this.find();b&&yi(this,"clear",b.from,b.to)}for(var _=null,R=null,W=0;W<this.lines.length;++W){var Q=this.lines[W],ee=Ui(Q.markedSpans,this);e&&!this.collapsed?wr(e,Ht(Q),"text"):e&&(ee.to!=null&&(R=Ht(Q)),ee.from!=null&&(_=Ht(Q))),Q.markedSpans=Ir(Q.markedSpans,ee),ee.from==null&&this.collapsed&&!rr(this.doc,Q)&&e&&xi(Q,Yr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ie=0;ie<this.lines.length;++ie){var ue=Ai(this.lines[ie]),Le=pn(ue);Le>e.display.maxLineLength&&(e.display.maxLine=ue,e.display.maxLineLength=Le,e.display.maxLineChanged=!0)}_!=null&&e&&this.collapsed&&Ii(e,_,R+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&js(e.doc)),e&&yi(e,"markerCleared",e,this,_,R),a&&Kr(e),this.parent&&this.parent.clear()},Rr.prototype.find=function(e,a){e==null&&this.type=="bookmark"&&(e=1);for(var b,_,R=0;R<this.lines.length;++R){var W=this.lines[R],Q=Ui(W.markedSpans,this);if(Q.from!=null&&(b=ht(a?W:Ht(W),Q.from),e==-1))return b;if(Q.to!=null&&(_=ht(a?W:Ht(W),Q.to),e==1))return _}return b&&{from:b,to:_}},Rr.prototype.changed=function(){var e=this,a=this.find(-1,!0),b=this,_=this.doc.cm;if(!a||!_)return;Bi(_,function(){var R=a.line,W=Ht(a.line),Q=fa(_,W);if(Q&&(ns(Q),_.curOp.selectionChanged=_.curOp.forceUpdate=!0),_.curOp.updateMaxLine=!0,!rr(b.doc,R)&&b.height!=null){var ee=b.height;b.height=null;var ie=vn(b)-ee;ie&&xi(R,R.height+ie)}yi(_,"markerChanged",_,e)})},Rr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var a=this.doc.cm.curOp;(!a.maybeHiddenMarkers||ce(a.maybeHiddenMarkers,this)==-1)&&(a.maybeUnhiddenMarkers||(a.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Rr.prototype.detachLine=function(e){if(this.lines.splice(ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var a=this.doc.cm.curOp;(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this)}},ye(Rr);function nn(e,a,b,_,R){if(_&&_.shared)return El(e,a,b,_,R);if(e.cm&&!e.cm.curOp)return pi(e.cm,nn)(e,a,b,_,R);var W=new Rr(e,R),Q=Dt(a,b);if(_&&N(_,W,!1),Q>0||Q==0&&W.clearWhenEmpty!==!1)return W;if(W.replacedWith&&(W.collapsed=!0,W.widgetNode=D("span",[W.replacedWith],"CodeMirror-widget"),_.handleMouseEvents||W.widgetNode.setAttribute("cm-ignore-events","true"),_.insertLeft&&(W.widgetNode.insertLeft=!0)),W.collapsed){if(fi(e,a.line,a,b,W)||a.line!=b.line&&fi(e,b.line,a,b,W))throw new Error("Inserting collapsed marker partially overlapping an existing one");or()}W.addToHistory&&Ns(e,{from:a,to:b,origin:"markText"},e.sel,NaN);var ee=a.line,ie=e.cm,ue;if(e.iter(ee,b.line+1,function(Ie){ie&&W.collapsed&&!ie.options.lineWrapping&&Ai(Ie)==ie.display.maxLine&&(ue=!0),W.collapsed&&ee!=a.line&&xi(Ie,0),_r(Ie,new lr(W,ee==a.line?a.ch:null,ee==b.line?b.ch:null)),++ee}),W.collapsed&&e.iter(a.line,b.line+1,function(Ie){rr(e,Ie)&&xi(Ie,0)}),W.clearOnEnter&&je(W,"beforeCursorEnter",function(){return W.clear()}),W.readOnly&&(Wi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),W.collapsed&&(W.id=++eo,W.atomic=!0),ie){if(ue&&(ie.curOp.updateMaxLine=!0),W.collapsed)Ii(ie,a.line,b.line+1);else if(W.className||W.startStyle||W.endStyle||W.css||W.attributes||W.title)for(var Le=a.line;Le<=b.line;Le++)wr(ie,Le,"text");W.atomic&&js(ie.doc),yi(ie,"markerAdded",ie,W)}return W}var In=function(e,a){this.markers=e,this.primary=a;for(var b=0;b<e.length;++b)e[b].parent=this};In.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();yi(this,"clear")},In.prototype.find=function(e,a){return this.primary.find(e,a)},ye(In);function El(e,a,b,_,R){_=N(_),_.shared=!1;var W=[nn(e,a,b,_,R)],Q=W[0],ee=_.widgetNode;return Ar(e,function(ie){ee&&(_.widgetNode=ee.cloneNode(!0)),W.push(nn(ie,F(ie,a),F(ie,b),_,R));for(var ue=0;ue<ie.linked.length;++ue)if(ie.linked[ue].isParent)return;Q=le(W)}),new In(W,Q)}function to(e){return e.findMarks(ht(e.first,0),e.clipPos(ht(e.lastLine())),function(a){return a.parent})}function wl(e,a){for(var b=0;b<a.length;b++){var _=a[b],R=_.find(),W=e.clipPos(R.from),Q=e.clipPos(R.to);if(Dt(W,Q)){var ee=nn(e,W,Q,_.primary,_.primary.type);_.markers.push(ee),ee.parent=_}}}function Sl(e){for(var a=function(_){var R=e[_],W=[R.primary.doc];Ar(R.primary.doc,function(ie){return W.push(ie)});for(var Q=0;Q<R.markers.length;Q++){var ee=R.markers[Q];ce(W,ee.doc)==-1&&(ee.parent=null,R.markers.splice(Q--,1))}},b=0;b<e.length;b++)a(b)}var Tl=0,Di=function(e,a,b,_,R){if(!(this instanceof Di))return new Di(e,a,b,_,R);b==null&&(b=0),kn.call(this,[new Ln([new Dr("",null)])]),this.first=b,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=b;var W=ht(b,0);this.sel=Tr(W),this.history=new qn(null),this.id=++Tl,this.modeOption=a,this.lineSep=_,this.direction=R=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Da(this,{from:W,to:W,text:e}),Ti(this,Tr(W),Oe)};Di.prototype=Ye(kn.prototype,{constructor:Di,iter:function(e,a,b){b?this.iterN(e-this.first,a-e,b):this.iterN(this.first,this.first+this.size,e)},insert:function(e,a){for(var b=0,_=0;_<a.length;++_)b+=a[_].height;this.insertInner(e-this.first,a,b)},remove:function(e,a){this.removeInner(e-this.first,a)},getValue:function(e){var a=tr(this,this.first,this.first+this.size);return e===!1?a:a.join(e||this.lineSeparator())},setValue:mi(function(e){var a=ht(this.first,0),b=this.first+this.size-1;tn(this,{from:a,to:ht(b,xt(this,b).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bn(this.cm,0,0),Ti(this,Tr(a),Oe)}),replaceRange:function(e,a,b,_){a=F(this,a),b=b?F(this,b):a,rn(this,e,a,b,_)},getRange:function(e,a,b){var _=zi(this,F(this,e),F(this,a));return b===!1?_:_.join(b||this.lineSeparator())},getLine:function(e){var a=this.getLineHandle(e);return a&&a.text},getLineHandle:function(e){if(Yi(this,e))return xt(this,e)},getLineNumber:function(e){return Ht(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=xt(this,e)),Ai(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return F(this,e)},getCursor:function(e){var a=this.sel.primary(),b;return e==null||e=="head"?b=a.head:e=="anchor"?b=a.anchor:e=="end"||e=="to"||e===!1?b=a.to():b=a.from(),b},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:mi(function(e,a,b){Hs(this,F(this,typeof e=="number"?ht(e,a||0):e),null,b)}),setSelection:mi(function(e,a,b){Hs(this,F(this,e),F(this,a||e),b)}),extendSelection:mi(function(e,a,b){$n(this,F(this,e),a&&F(this,a),b)}),extendSelections:mi(function(e,a){Bs(this,Y(this,e),a)}),extendSelectionsBy:mi(function(e,a){var b=Ee(this.sel.ranges,e);Bs(this,Y(this,b),a)}),setSelections:mi(function(e,a,b){if(!e.length)return;for(var _=[],R=0;R<e.length;R++)_[R]=new Qt(F(this,e[R].anchor),F(this,e[R].head));a==null&&(a=Math.min(e.length-1,this.sel.primIndex)),Ti(this,Ji(this.cm,_,a),b)}),addSelection:mi(function(e,a,b){var _=this.sel.ranges.slice(0);_.push(new Qt(F(this,e),F(this,a||e))),Ti(this,Ji(this.cm,_,_.length-1),b)}),getSelection:function(e){for(var a=this.sel.ranges,b,_=0;_<a.length;_++){var R=zi(this,a[_].from(),a[_].to());b=b?b.concat(R):R}return e===!1?b:b.join(e||this.lineSeparator())},getSelections:function(e){for(var a=[],b=this.sel.ranges,_=0;_<b.length;_++){var R=zi(this,b[_].from(),b[_].to());e!==!1&&(R=R.join(e||this.lineSeparator())),a[_]=R}return a},replaceSelection:function(e,a,b){for(var _=[],R=0;R<this.sel.ranges.length;R++)_[R]=e;this.replaceSelections(_,a,b||"+input")},replaceSelections:mi(function(e,a,b){for(var _=[],R=this.sel,W=0;W<R.ranges.length;W++){var Q=R.ranges[W];_[W]={from:Q.from(),to:Q.to(),text:this.splitLines(e[W]),origin:b}}for(var ee=a&&a!="end"&&dl(this,_,a),ie=_.length-1;ie>=0;ie--)tn(this,_[ie]);ee?Ks(this,ee):this.cm&&Zr(this.cm)}),undo:mi(function(){ta(this,"undo")}),redo:mi(function(){ta(this,"redo")}),undoSelection:mi(function(){ta(this,"undo",!0)}),redoSelection:mi(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,a=0,b=0,_=0;_<e.done.length;_++)e.done[_].ranges||++a;for(var R=0;R<e.undone.length;R++)e.undone[R].ranges||++b;return{undo:a,redo:b}},clearHistory:function(){var e=this;this.history=new qn(this.history.maxGeneration),Ar(this,function(a){return a.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:Jr(this.history.done),undone:Jr(this.history.undone)}},setHistory:function(e){var a=this.history=new qn(this.history.maxGeneration);a.done=Jr(e.done.slice(0),null,!0),a.undone=Jr(e.undone.slice(0),null,!0)},setGutterMarker:mi(function(e,a,b){return Rn(this,e,"gutter",function(_){var R=_.gutterMarkers||(_.gutterMarkers={});return R[a]=b,!b&&$e(R)&&(_.gutterMarkers=null),!0})}),clearGutter:mi(function(e){var a=this;this.iter(function(b){b.gutterMarkers&&b.gutterMarkers[e]&&Rn(a,b,"gutter",function(){return b.gutterMarkers[e]=null,$e(b.gutterMarkers)&&(b.gutterMarkers=null),!0})})}),lineInfo:function(e){var a;if(typeof e=="number"){if(!Yi(this,e))return null;if(a=e,e=xt(this,e),!e)return null}else if(a=Ht(e),a==null)return null;return{line:a,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:mi(function(e,a,b){return Rn(this,e,a=="gutter"?"gutter":"class",function(_){var R=a=="text"?"textClass":a=="background"?"bgClass":a=="gutter"?"gutterClass":"wrapClass";if(!_[R])_[R]=b;else{if(v(b).test(_[R]))return!1;_[R]+=" "+b}return!0})}),removeLineClass:mi(function(e,a,b){return Rn(this,e,a=="gutter"?"gutter":"class",function(_){var R=a=="text"?"textClass":a=="background"?"bgClass":a=="gutter"?"gutterClass":"wrapClass",W=_[R];if(W)if(b==null)_[R]=null;else{var Q=W.match(v(b));if(!Q)return!1;var ee=Q.index+Q[0].length;_[R]=W.slice(0,Q.index)+(!Q.index||ee==W.length?"":" ")+W.slice(ee)||null}else return!1;return!0})}),addLineWidget:mi(function(e,a,b){return xl(this,e,a,b)}),removeLineWidget:function(e){e.clear()},markText:function(e,a,b){return nn(this,F(this,e),F(this,a),b,b&&b.type||"range")},setBookmark:function(e,a){var b={replacedWith:a&&(a.nodeType==null?a.widget:a),insertLeft:a&&a.insertLeft,clearWhenEmpty:!1,shared:a&&a.shared,handleMouseEvents:a&&a.handleMouseEvents};return e=F(this,e),nn(this,e,e,b,"bookmark")},findMarksAt:function(e){e=F(this,e);var a=[],b=xt(this,e.line).markedSpans;if(b)for(var _=0;_<b.length;++_){var R=b[_];(R.from==null||R.from<=e.ch)&&(R.to==null||R.to>=e.ch)&&a.push(R.marker.parent||R.marker)}return a},findMarks:function(e,a,b){e=F(this,e),a=F(this,a);var _=[],R=e.line;return this.iter(e.line,a.line+1,function(W){var Q=W.markedSpans;if(Q)for(var ee=0;ee<Q.length;ee++){var ie=Q[ee];!(ie.to!=null&&R==e.line&&e.ch>=ie.to||ie.from==null&&R!=e.line||ie.from!=null&&R==a.line&&ie.from>=a.ch)&&(!b||b(ie.marker))&&_.push(ie.marker.parent||ie.marker)}++R}),_},getAllMarks:function(){var e=[];return this.iter(function(a){var b=a.markedSpans;if(b)for(var _=0;_<b.length;++_)b[_].from!=null&&e.push(b[_].marker)}),e},posFromIndex:function(e){var a,b=this.first,_=this.lineSeparator().length;return this.iter(function(R){var W=R.text.length+_;if(W>e)return a=e,!0;e-=W,++b}),F(this,ht(b,a))},indexFromPos:function(e){e=F(this,e);var a=e.ch;if(e.line<this.first||e.ch<0)return 0;var b=this.lineSeparator().length;return this.iter(this.first,e.line,function(_){a+=_.text.length+b}),a},copy:function(e){var a=new Di(tr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return a.scrollTop=this.scrollTop,a.scrollLeft=this.scrollLeft,a.sel=this.sel,a.extend=!1,e&&(a.history.undoDepth=this.history.undoDepth,a.setHistory(this.getHistory())),a},linkedDoc:function(e){e||(e={});var a=this.first,b=this.first+this.size;e.from!=null&&e.from>a&&(a=e.from),e.to!=null&&e.to<b&&(b=e.to);var _=new Di(tr(this,a,b),e.mode||this.modeOption,a,this.lineSep,this.direction);return e.sharedHist&&(_.history=this.history),(this.linked||(this.linked=[])).push({doc:_,sharedHist:e.sharedHist}),_.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(_,to(this)),_},unlinkDoc:function(e){if(e instanceof ti&&(e=e.doc),this.linked)for(var a=0;a<this.linked.length;++a){var b=this.linked[a];if(b.doc!=e)continue;this.linked.splice(a,1),e.unlinkDoc(this),Sl(to(this));break}if(e.history==this.history){var _=[e.id];Ar(e,function(R){return _.push(R.id)},!0),e.history=new qn(null),e.history.done=Jr(this.history.done,_),e.history.undone=Jr(this.history.undone,_)}},iterLinkedDocs:function(e){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):lt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:mi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(a){return a.order=null}),this.cm&&fl(this.cm)})}),Di.prototype.eachLine=Di.prototype.iter;var io=0;function Cl(e){var a=this;if(ro(a),We(a,e)||hr(a.display,e))return;J(e),E&&(io=+new Date);var b=Nr(a,e,!0),_=e.dataTransfer.files;if(!b||a.isReadOnly())return;if(_&&_.length&&window.FileReader&&window.File)for(var R=_.length,W=Array(R),Q=0,ee=function(){++Q==R&&pi(a,function(){b=F(a.doc,b);var Ve={from:b,to:b,text:a.doc.splitLines(W.filter(function(it){return it!=null}).join(a.doc.lineSeparator())),origin:"paste"};tn(a.doc,Ve),Ks(a.doc,Tr(F(a.doc,b),F(a.doc,Cr(Ve))))})()},ie=function(Ve,it){if(a.options.allowDropFileTypes&&ce(a.options.allowDropFileTypes,Ve.type)==-1){ee();return}var ut=new FileReader;ut.onerror=function(){return ee()},ut.onload=function(){var dt=ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(dt)){ee();return}W[it]=dt,ee()},ut.readAsText(Ve)},ue=0;ue<_.length;ue++)ie(_[ue],ue);else{if(a.state.draggingText&&a.doc.sel.contains(b)>-1){a.state.draggingText(e),setTimeout(function(){return a.display.input.focus()},20);return}try{var Le=e.dataTransfer.getData("Text");if(Le){var Ie;if(a.state.draggingText&&!a.state.draggingText.copy&&(Ie=a.listSelections()),Jn(a.doc,Tr(b,b)),Ie)for(var Qe=0;Qe<Ie.length;++Qe)rn(a.doc,"",Ie[Qe].anchor,Ie[Qe].head,"drag");a.replaceSelection(Le,"around","paste"),a.display.input.focus()}}catch(Ve){}}}function Al(e,a){if(E&&(!e.state.draggingText||+new Date-io<100)){me(a);return}if(We(e,a)||hr(e.display,a))return;if(a.dataTransfer.setData("Text",e.getSelection()),a.dataTransfer.effectAllowed="copyMove",a.dataTransfer.setDragImage&&!r){var b=p("img",null,null,"position: fixed; left: 0; top: 0;");b.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",u&&(b.width=b.height=1,e.display.wrapper.appendChild(b),b._top=b.offsetTop),a.dataTransfer.setDragImage(b,0,0),u&&b.parentNode.removeChild(b)}}function Rl(e,a){var b=Nr(e,a);if(!b)return;var _=document.createDocumentFragment();ms(e,b,_),e.display.dragCursor||(e.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,_)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function no(e){if(!document.getElementsByClassName)return;for(var a=document.getElementsByClassName("CodeMirror"),b=[],_=0;_<a.length;_++){var R=a[_].CodeMirror;R&&b.push(R)}b.length&&b[0].operation(function(){for(var W=0;W<b.length;W++)e(b[W])})}var ao=!1;function Ll(){if(ao)return;kl(),ao=!0}function kl(){var e;je(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,no(Ol)},100))}),je(window,"blur",function(){return no(qr)})}function Ol(e){var a=e.display;a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.scrollbarsClipped=!1,e.setSize()}for(var Lr={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"},Dn=0;Dn<10;Dn++)Lr[Dn+48]=Lr[Dn+96]=String(Dn);for(var ia=65;ia<=90;ia++)Lr[ia]=String.fromCharCode(ia);for(var Mn=1;Mn<=12;Mn++)Lr[Mn+111]=Lr[Mn+63235]="F"+Mn;var cr={};cr.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"},cr.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"},cr.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"},cr.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"]},cr.default=c?cr.macDefault:cr.pcDefault;function Il(e){var a=e.split(/-(?!$)/);e=a[a.length-1];for(var b,_,R,W,Q=0;Q<a.length-1;Q++){var ee=a[Q];if(/^(cmd|meta|m)$/i.test(ee))W=!0;else if(/^a(lt)?$/i.test(ee))b=!0;else if(/^(c|ctrl|control)$/i.test(ee))_=!0;else if(/^s(hift)?$/i.test(ee))R=!0;else throw new Error("Unrecognized modifier name: "+ee)}return b&&(e="Alt-"+e),_&&(e="Ctrl-"+e),W&&(e="Cmd-"+e),R&&(e="Shift-"+e),e}function Dl(e){var a={};for(var b in e)if(e.hasOwnProperty(b)){var _=e[b];if(/^(name|fallthrough|(de|at)tach)$/.test(b))continue;if(_=="..."){delete e[b];continue}for(var R=Ee(b.split(" "),Il),W=0;W<R.length;W++){var Q=void 0,ee=void 0;W==R.length-1?(ee=R.join(" "),Q=_):(ee=R.slice(0,W+1).join(" "),Q="...");var ie=a[ee];if(!ie)a[ee]=Q;else if(ie!=Q)throw new Error("Inconsistent bindings for "+ee)}delete e[b]}for(var ue in a)e[ue]=a[ue];return e}function an(e,a,b,_){a=ra(a);var R=a.call?a.call(e,_):a[e];if(R===!1)return"nothing";if(R==="...")return"multi";if(R!=null&&b(R))return"handled";if(a.fallthrough){if(Object.prototype.toString.call(a.fallthrough)!="[object Array]")return an(e,a.fallthrough,b,_);for(var W=0;W<a.fallthrough.length;W++){var Q=an(e,a.fallthrough[W],b,_);if(Q)return Q}}}function so(e){var a=typeof e=="string"?e:Lr[e.keyCode];return a=="Ctrl"||a=="Alt"||a=="Shift"||a=="Mod"}function oo(e,a,b){var _=e;return a.altKey&&_!="Alt"&&(e="Alt-"+e),(S?a.metaKey:a.ctrlKey)&&_!="Ctrl"&&(e="Ctrl-"+e),(S?a.ctrlKey:a.metaKey)&&_!="Mod"&&(e="Cmd-"+e),!b&&a.shiftKey&&_!="Shift"&&(e="Shift-"+e),e}function lo(e,a){if(u&&e.keyCode==34&&e.char)return!1;var b=Lr[e.keyCode];return b==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(b=e.code),oo(b,e,a))}function ra(e){return typeof e=="string"?cr[e]:e}function sn(e,a){for(var b=e.doc.sel.ranges,_=[],R=0;R<b.length;R++){for(var W=a(b[R]);_.length&&Dt(W.from,le(_).to)<=0;){var Q=_.pop();if(Dt(Q.from,W.from)<0){W.from=Q.from;break}}_.push(W)}Bi(e,function(){for(var ee=_.length-1;ee>=0;ee--)rn(e.doc,"",_[ee].from,_[ee].to,"+delete");Zr(e)})}function Fa(e,a,b){var _=Pe(e.text,a+b,b);return _<0||_>e.text.length?null:_}function Ua(e,a,b){var _=Fa(e,a.ch,b);return _==null?null:new ht(a.line,_,b<0?"after":"before")}function Ba(e,a,b,_,R){if(e){a.doc.direction=="rtl"&&(R=-R);var W=qe(b,a.doc.direction);if(W){var Q=R<0?le(W):W[0],ee=R<0==(Q.level==1),ie=ee?"after":"before",ue;if(Q.level>0||a.doc.direction=="rtl"){var Le=Vr(a,b);ue=R<0?b.text.length-1:0;var Ie=ar(a,Le,ue).top;ue=ke(function(Qe){return ar(a,Le,Qe).top==Ie},R<0==(Q.level==1)?Q.from:Q.to-1,ue),ie=="before"&&(ue=Fa(b,ue,1))}else ue=R<0?Q.to:Q.from;return new ht(_,ue,ie)}}return new ht(_,R<0?b.text.length:0,R<0?"before":"after")}function Ml(e,a,b,_){var R=qe(a,e.doc.direction);if(!R)return Ua(a,b,_);b.ch>=a.text.length?(b.ch=a.text.length,b.sticky="before"):b.ch<=0&&(b.ch=0,b.sticky="after");var W=ae(R,b.ch,b.sticky),Q=R[W];if(e.doc.direction=="ltr"&&Q.level%2==0&&(_>0?Q.to>b.ch:Q.from<b.ch))return Ua(a,b,_);var ee=function(gt,yt){return Fa(a,gt instanceof ht?gt.ch:gt,yt)},ie,ue=function(gt){return e.options.lineWrapping?(ie=ie||Vr(e,a),cs(e,a,ie,gt)):{begin:0,end:a.text.length}},Le=ue(b.sticky=="before"?ee(b,-1):b.ch);if(e.doc.direction=="rtl"||Q.level==1){var Ie=Q.level==1==_<0,Qe=ee(b,Ie?1:-1);if(Qe!=null&&(Ie?Qe<=Q.to&&Qe<=Le.end:Qe>=Q.from&&Qe>=Le.begin)){var Ve=Ie?"before":"after";return new ht(b.line,Qe,Ve)}}var it=function(gt,yt,vt){for(var bt=function(Jt,gi){return gi?new ht(b.line,ee(Jt,1),"before"):new ht(b.line,Jt,"after")};gt>=0&&gt<R.length;gt+=yt){var Ot=R[gt],At=yt>0==(Ot.level!=1),Ut=At?vt.begin:ee(vt.end,-1);if(Ot.from<=Ut&&Ut<Ot.to)return bt(Ut,At);if(Ut=At?Ot.from:ee(Ot.to,-1),vt.begin<=Ut&&Ut<vt.end)return bt(Ut,At)}},ut=it(W+_,_,Le);if(ut)return ut;var dt=_>0?Le.end:ee(Le.begin,-1);return dt!=null&&!(_>0&&dt==a.text.length)&&(ut=it(_>0?0:R.length-1,_,ue(dt)),ut)?ut:null}var Pn={selectAll:Gs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oe)},killLine:function(e){return sn(e,function(a){if(a.empty()){var b=xt(e.doc,a.head.line).text.length;return a.head.ch==b&&a.head.line<e.lastLine()?{from:a.head,to:ht(a.head.line+1,0)}:{from:a.head,to:ht(a.head.line,b)}}else return{from:a.from(),to:a.to()}})},deleteLine:function(e){return sn(e,function(a){return{from:ht(a.from().line,0),to:F(e.doc,ht(a.to().line+1,0))}})},delLineLeft:function(e){return sn(e,function(a){return{from:ht(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(e){return sn(e,function(a){var b=e.charCoords(a.head,"div").top+5,_=e.coordsChar({left:0,top:b},"div");return{from:_,to:a.from()}})},delWrappedLineRight:function(e){return sn(e,function(a){var b=e.charCoords(a.head,"div").top+5,_=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:b},"div");return{from:a.from(),to:_}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ht(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ht(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(a){return uo(e,a.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(a){return ho(e,a.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(a){return Pl(e,a.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(a){var b=e.cursorCoords(a.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:b},"div")},Be)},goLineLeft:function(e){return e.extendSelectionsBy(function(a){var b=e.cursorCoords(a.head,"div").top+5;return e.coordsChar({left:0,top:b},"div")},Be)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(a){var b=e.cursorCoords(a.head,"div").top+5,_=e.coordsChar({left:0,top:b},"div");return _.ch<e.getLine(_.line).search(/\S/)?ho(e,a.head):_},Be)},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 a=[],b=e.listSelections(),_=e.options.tabSize,R=0;R<b.length;R++){var W=b[R].from(),Q=z(e.getLine(W.line),W.ch,_);a.push(_e(_-Q%_))}e.replaceSelections(a)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bi(e,function(){for(var a=e.listSelections(),b=[],_=0;_<a.length;_++){if(!a[_].empty())continue;var R=a[_].head,W=xt(e.doc,R.line).text;if(W){if(R.ch==W.length&&(R=new ht(R.line,R.ch-1)),R.ch>0)R=new ht(R.line,R.ch+1),e.replaceRange(W.charAt(R.ch-1)+W.charAt(R.ch-2),ht(R.line,R.ch-2),R,"+transpose");else if(R.line>e.doc.first){var Q=xt(e.doc,R.line-1).text;Q&&(R=new ht(R.line,1),e.replaceRange(W.charAt(0)+e.doc.lineSeparator()+Q.charAt(Q.length-1),ht(R.line-1,Q.length-1),R,"+transpose"))}}b.push(new Qt(R,R))}e.setSelections(b)})},newlineAndIndent:function(e){return Bi(e,function(){for(var a=e.listSelections(),b=a.length-1;b>=0;b--)e.replaceRange(e.doc.lineSeparator(),a[b].anchor,a[b].head,"+input");a=e.listSelections();for(var _=0;_<a.length;_++)e.indentLine(a[_].from().line,null,!0);Zr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,a){var b=xt(e.doc,a),_=Ai(b);return _!=b&&(a=Ht(_)),Ba(!0,e,_,a,1)}function Pl(e,a){var b=xt(e.doc,a),_=Gr(b);return _!=b&&(a=Ht(_)),Ba(!0,e,b,a,-1)}function ho(e,a){var b=uo(e,a.line),_=xt(e.doc,b.line),R=qe(_,e.doc.direction);if(!R||R[0].level==0){var W=Math.max(b.ch,_.text.search(/\S/)),Q=a.line==b.line&&a.ch<=W&&a.ch;return ht(b.line,Q?0:W,b.sticky)}return b}function na(e,a,b){if(typeof a=="string"&&(a=Pn[a],!a))return!1;e.display.input.ensurePolled();var _=e.display.shift,R=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),b&&(e.display.shift=!1),R=a(e)!=Fe}finally{e.display.shift=_,e.state.suppressEdits=!1}return R}function Nl(e,a,b){for(var _=0;_<e.state.keyMaps.length;_++){var R=an(a,e.state.keyMaps[_],b,e);if(R)return R}return e.options.extraKeys&&an(a,e.options.extraKeys,b,e)||an(a,e.options.keyMap,b,e)}var Fl=new te;function Nn(e,a,b,_){var R=e.state.keySeq;if(R){if(so(a))return"handled";if(/\'$/.test(a)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==R&&(e.state.keySeq=null,e.display.input.reset())}),co(e,R+" "+a,b,_))return!0}return co(e,a,b,_)}function co(e,a,b,_){var R=Nl(e,a,_);return R=="multi"&&(e.state.keySeq=a),R=="handled"&&yi(e,"keyHandled",e,a,b),(R=="handled"||R=="multi")&&(J(b),Ea(e)),!!R}function fo(e,a){var b=lo(a,!0);return b?a.shiftKey&&!e.state.keySeq?Nn(e,"Shift-"+b,a,function(_){return na(e,_,!0)})||Nn(e,b,a,function(_){if(typeof _=="string"?/^go[A-Z]/.test(_):_.motion)return na(e,_)}):Nn(e,b,a,function(_){return na(e,_)}):!1}function Ul(e,a,b){return Nn(e,"'"+b+"'",a,function(_){return na(e,_,!0)})}var Ha=null;function po(e){var a=this;if(e.target&&e.target!=a.display.input.getField())return;if(a.curOp.focus=j(),We(a,e))return;E&&x<11&&e.keyCode==27&&(e.returnValue=!1);var b=e.keyCode;a.display.shift=b==16||e.shiftKey;var _=fo(a,e);u&&(Ha=_?b:null,!_&&b==88&&!st&&(c?e.metaKey:e.ctrlKey)&&a.replaceSelection("",null,"cut")),I&&!c&&!_&&b==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),b==18&&!/\bCodeMirror-crosshair\b/.test(a.display.lineDiv.className)&&Bl(a)}function Bl(e){var a=e.display.lineDiv;K(a,"CodeMirror-crosshair");function b(_){(_.keyCode==18||!_.altKey)&&(y(a,"CodeMirror-crosshair"),he(document,"keyup",b),he(document,"mouseover",b))}je(document,"keyup",b),je(document,"mouseover",b)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function go(e){var a=this;if(e.target&&e.target!=a.display.input.getField())return;if(hr(a.display,e)||We(a,e)||e.ctrlKey&&!e.altKey||c&&e.metaKey)return;var b=e.keyCode,_=e.charCode;if(u&&b==Ha){Ha=null,J(e);return}if(u&&(!e.which||e.which<10)&&fo(a,e))return;var R=String.fromCharCode(_==null?b:_);if(R=="\b")return;if(Ul(a,e,R))return;a.display.input.onKeyPress(e)}var Hl=400,Ka=function(e,a,b){this.time=e,this.pos=a,this.button=b};Ka.prototype.compare=function(e,a,b){return this.time+Hl>e&&Dt(a,this.pos)==0&&b==this.button};var Fn,Un;function Kl(e,a){var b=+new Date;return Un&&Un.compare(b,e,a)?(Fn=Un=null,"triple"):Fn&&Fn.compare(b,e,a)?(Un=new Ka(b,e,a),Fn=null,"double"):(Fn=new Ka(b,e,a),Un=null,"single")}function vo(e){var a=this,b=a.display;if(We(a,e)||b.activeTouch&&b.input.supportsTouch())return;if(b.input.ensurePolled(),b.shift=e.shiftKey,hr(b,e)){g||(b.scroller.draggable=!1,setTimeout(function(){return b.scroller.draggable=!0},100));return}if(Wa(a,e))return;var _=Nr(a,e),R=G(e),W=_?Kl(_,R):"single";if(window.focus(),R==1&&a.state.selectingText&&a.state.selectingText(e),_&&Wl(a,R,_,W,e))return;R==1?_?Xl(a,_,W,e):Ce(e)==b.scroller&&J(e):R==2?(_&&$n(a.doc,_),setTimeout(function(){return b.input.focus()},20)):R==3&&(C?a.display.input.onContextMenu(e):vs(a))}function Wl(e,a,b,_,R){var W="Click";return _=="double"?W="Double"+W:_=="triple"&&(W="Triple"+W),W=(a==1?"Left":a==2?"Middle":"Right")+W,Nn(e,oo(W,R),R,function(Q){if(typeof Q=="string"&&(Q=Pn[Q]),!Q)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=Q(e,b)!=Fe}finally{e.state.suppressEdits=!1}return ee})}function jl(e,a,b){var _=e.getOption("configureMouse"),R=_?_(e,a,b):{};if(R.unit==null){var W=d?b.shiftKey&&b.metaKey:b.altKey;R.unit=W?"rectangle":a=="single"?"char":a=="double"?"word":"line"}return(R.extend==null||e.doc.extend)&&(R.extend=e.doc.extend||b.shiftKey),R.addNew==null&&(R.addNew=c?b.metaKey:b.ctrlKey),R.moveOnDrag==null&&(R.moveOnDrag=!(c?b.altKey:b.ctrlKey)),R}function Xl(e,a,b,_){E?setTimeout(B(gs,e),0):e.curOp.focus=j();var R=jl(e,b,_),W=e.doc.sel,Q;e.options.dragDrop&&we&&!e.isReadOnly()&&b=="single"&&(Q=W.contains(a))>-1&&(Dt((Q=W.ranges[Q]).from(),a)<0||a.xRel>0)&&(Dt(Q.to(),a)>0||a.xRel<0)?zl(e,_,a,R):Gl(e,_,a,R)}function zl(e,a,b,_){var R=e.display,W=!1,Q=pi(e,function(ue){g&&(R.scroller.draggable=!1),e.state.draggingText=!1,he(R.wrapper.ownerDocument,"mouseup",Q),he(R.wrapper.ownerDocument,"mousemove",ee),he(R.scroller,"dragstart",ie),he(R.scroller,"drop",Q),W||(J(ue),_.addNew||$n(e.doc,b,null,null,_.extend),g&&!r||E&&x==9?setTimeout(function(){R.wrapper.ownerDocument.body.focus({preventScroll:!0}),R.input.focus()},20):R.input.focus())}),ee=function(ue){W=W||Math.abs(a.clientX-ue.clientX)+Math.abs(a.clientY-ue.clientY)>=10},ie=function(){return W=!0};g&&(R.scroller.draggable=!0),e.state.draggingText=Q,Q.copy=!_.moveOnDrag,R.scroller.dragDrop&&R.scroller.dragDrop(),je(R.wrapper.ownerDocument,"mouseup",Q),je(R.wrapper.ownerDocument,"mousemove",ee),je(R.scroller,"dragstart",ie),je(R.scroller,"drop",Q),vs(e),setTimeout(function(){return R.input.focus()},20)}function _o(e,a,b){if(b=="char")return new Qt(a,a);if(b=="word")return e.findWordAt(a);if(b=="line")return new Qt(ht(a.line,0),F(e.doc,ht(a.line+1,0)));var _=b(e,a);return new Qt(_.from,_.to)}function Gl(e,a,b,_){var R=e.display,W=e.doc;J(a);var Q,ee,ie=W.sel,ue=ie.ranges;if(_.addNew&&!_.extend?(ee=W.sel.contains(b),ee>-1?Q=ue[ee]:Q=new Qt(b,b)):(Q=W.sel.primary(),ee=W.sel.primIndex),_.unit=="rectangle")_.addNew||(Q=new Qt(b,b)),b=Nr(e,a,!0,!0),ee=-1;else{var Le=_o(e,b,_.unit);_.extend?Q=Pa(Q,Le.anchor,Le.head,_.extend):Q=Le}_.addNew?ee==-1?(ee=ue.length,Ti(W,Ji(e,ue.concat([Q]),ee),{scroll:!1,origin:"*mouse"})):ue.length>1&&ue[ee].empty()&&_.unit=="char"&&!_.extend?(Ti(W,Ji(e,ue.slice(0,ee).concat(ue.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),ie=W.sel):Na(W,ee,Q,Re):(ee=0,Ti(W,new Xi([Q],0),Re),ie=W.sel);var Ie=b;function Qe(vt){if(Dt(Ie,vt)==0)return;if(Ie=vt,_.unit=="rectangle"){for(var bt=[],Ot=e.options.tabSize,At=z(xt(W,b.line).text,b.ch,Ot),Ut=z(xt(W,vt.line).text,vt.ch,Ot),Jt=Math.min(At,Ut),gi=Math.max(At,Ut),ii=Math.min(b.line,vt.line),Hi=Math.min(e.lastLine(),Math.max(b.line,vt.line));ii<=Hi;ii++){var Mi=xt(W,ii).text,oi=Ke(Mi,Jt,Ot);Jt==gi?bt.push(new Qt(ht(ii,oi),ht(ii,oi))):Mi.length>oi&&bt.push(new Qt(ht(ii,oi),ht(ii,Ke(Mi,gi,Ot))))}bt.length||bt.push(new Qt(b,b)),Ti(W,Ji(e,ie.ranges.slice(0,ee).concat(bt),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(vt)}else{var Pi=Q,bi=_o(e,vt,_.unit),ci=Pi.anchor,li;Dt(bi.anchor,ci)>0?(li=bi.head,ci=vr(Pi.from(),bi.anchor)):(li=bi.anchor,ci=gr(Pi.to(),bi.head));var ri=ie.ranges.slice(0);ri[ee]=Vl(e,new Qt(F(W,ci),li)),Ti(W,Ji(e,ri,ee),Re)}}var Ve=R.wrapper.getBoundingClientRect(),it=0;function ut(vt){var bt=++it,Ot=Nr(e,vt,!0,_.unit=="rectangle");if(!Ot)return;if(Dt(Ot,Ie)!=0){e.curOp.focus=j(),Qe(Ot);var At=Gn(R,W);(Ot.line>=At.to||Ot.line<At.from)&&setTimeout(pi(e,function(){it==bt&&ut(vt)}),150)}else{var Ut=vt.clientY<Ve.top?-20:vt.clientY>Ve.bottom?20:0;Ut&&setTimeout(pi(e,function(){if(it!=bt)return;R.scroller.scrollTop+=Ut,ut(vt)}),50)}}function dt(vt){e.state.selectingText=!1,it=Infinity,vt&&(J(vt),R.input.focus()),he(R.wrapper.ownerDocument,"mousemove",gt),he(R.wrapper.ownerDocument,"mouseup",yt),W.history.lastSelOrigin=null}var gt=pi(e,function(vt){vt.buttons===0||!G(vt)?dt(vt):ut(vt)}),yt=pi(e,dt);e.state.selectingText=yt,je(R.wrapper.ownerDocument,"mousemove",gt),je(R.wrapper.ownerDocument,"mouseup",yt)}function Vl(e,a){var b=a.anchor,_=a.head,R=xt(e.doc,b.line);if(Dt(b,_)==0&&b.sticky==_.sticky)return a;var W=qe(R);if(!W)return a;var Q=ae(W,b.ch,b.sticky),ee=W[Q];if(ee.from!=b.ch&&ee.to!=b.ch)return a;var ie=Q+(ee.from==b.ch==(ee.level!=1)?0:1);if(ie==0||ie==W.length)return a;var ue;if(_.line!=b.line)ue=(_.line-b.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Le=ae(W,_.ch,_.sticky),Ie=Le-Q||(_.ch-b.ch)*(ee.level==1?-1:1);Le==ie-1||Le==ie?ue=Ie<0:ue=Ie>0}var Qe=W[ie+(ue?-1:0)],Ve=ue==(Qe.level==1),it=Ve?Qe.from:Qe.to,ut=Ve?"after":"before";return b.ch==it&&b.sticky==ut?a:new Qt(new ht(b.line,it,ut),_)}function yo(e,a,b,_){var R,W;if(a.touches)R=a.touches[0].clientX,W=a.touches[0].clientY;else try{R=a.clientX,W=a.clientY}catch(Qe){return!1}if(R>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;_&&J(a);var Q=e.display,ee=Q.lineDiv.getBoundingClientRect();if(W>ee.bottom||!ge(e,b))return q(a);W-=ee.top-Q.viewOffset;for(var ie=0;ie<e.display.gutterSpecs.length;++ie){var ue=Q.gutters.childNodes[ie];if(ue&&ue.getBoundingClientRect().right>=R){var Le=Ki(e.doc,W),Ie=e.display.gutterSpecs[ie];return Te(e,b,e,Le,Ie.className,a),q(a)}}}function Wa(e,a){return yo(e,a,"gutterClick",!0)}function bo(e,a){if(hr(e.display,a)||Yl(e,a))return;if(We(e,a,"contextmenu"))return;C||e.display.input.onContextMenu(a)}function Yl(e,a){return ge(e,"gutterContextMenu")?yo(e,a,"gutterContextMenu",!1):!1}function xo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_n(e)}var on={toString:function(){return"CodeMirror.Init"}},Eo={},aa={};function Ql(e){var a=e.optionHandlers;function b(_,R,W,Q){e.defaults[_]=R,W&&(a[_]=Q?function(ee,ie,ue){ue!=on&&W(ee,ie,ue)}:W)}e.defineOption=b,e.Init=on,b("value","",function(_,R){return _.setValue(R)},!0),b("mode",null,function(_,R){_.doc.modeOption=R,Ia(_)},!0),b("indentUnit",2,Ia,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,function(_){Cn(_),_n(_),Ii(_)},!0),b("lineSeparator",null,function(_,R){if(_.doc.lineSep=R,!R)return;var W=[],Q=_.doc.first;_.doc.iter(function(ie){for(var ue=0;;){var Le=ie.text.indexOf(R,ue);if(Le==-1)break;ue=Le+R.length,W.push(ht(Q,Le))}Q++});for(var ee=W.length-1;ee>=0;ee--)rn(_.doc,R,W[ee],ht(W[ee].line,W[ee].ch+R.length))}),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(_,R,W){_.state.specialChars=new RegExp(R.source+(R.test(" ")?"":"| "),"g"),W!=on&&_.refresh()}),b("specialCharPlaceholder",$t,function(_){return _.refresh()},!0),b("electricChars",!0),b("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),b("spellcheck",!1,function(_,R){return _.getInputField().spellcheck=R},!0),b("autocorrect",!1,function(_,R){return _.getInputField().autocorrect=R},!0),b("autocapitalize",!1,function(_,R){return _.getInputField().autocapitalize=R},!0),b("rtlMoveVisually",!w),b("wholeLineUpdateBefore",!0),b("theme","default",function(_){xo(_),Tn(_)},!0),b("keyMap","default",function(_,R,W){var Q=ra(R),ee=W!=on&&ra(W);ee&&ee.detach&&ee.detach(_,Q),Q.attach&&Q.attach(_,ee||null)}),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,Zl,!0),b("gutters",[],function(_,R){_.display.gutterSpecs=ka(R,_.options.lineNumbers),Tn(_)},!0),b("fixedGutter",!0,function(_,R){_.display.gutters.style.left=R?ba(_.display)+"px":"0",_.refresh()},!0),b("coverGutterNextToScrollbar",!1,function(_){return $r(_)},!0),b("scrollbarStyle","native",function(_){ws(_),$r(_),_.display.scrollbars.setScrollTop(_.doc.scrollTop),_.display.scrollbars.setScrollLeft(_.doc.scrollLeft)},!0),b("lineNumbers",!1,function(_,R){_.display.gutterSpecs=ka(_.options.gutters,R),Tn(_)},!0),b("firstLineNumber",1,Tn,!0),b("lineNumberFormatter",function(_){return _},Tn,!0),b("showCursorWhenSelecting",!1,yn,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("selectionsMayTouch",!1),b("readOnly",!1,function(_,R){R=="nocursor"&&(qr(_),_.display.input.blur()),_.display.input.readOnlyChanged(R)}),b("screenReaderLabel",null,function(_,R){R=R===""?null:R,_.display.input.screenReaderLabelChanged(R)}),b("disableInput",!1,function(_,R){R||_.display.input.reset()},!0),b("dragDrop",!0,ql),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,yn,!0),b("singleCursorHeightPerLine",!0,yn,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,Cn,!0),b("addModeClass",!1,Cn,!0),b("pollInterval",100),b("undoDepth",200,function(_,R){return _.doc.history.undoDepth=R}),b("historyEventDelay",1250),b("viewportMargin",10,function(_){return _.refresh()},!0),b("maxHighlightLength",1e4,Cn,!0),b("moveInputWithCursor",!0,function(_,R){R||_.display.input.resetPosition()}),b("tabindex",null,function(_,R){return _.display.input.getField().tabIndex=R||""}),b("autofocus",null),b("direction","ltr",function(_,R){return _.doc.setDirection(R)},!0),b("phrases",null)}function ql(e,a,b){var _=b&&b!=on;if(!a!=!_){var R=e.display.dragFunctions,W=a?je:he;W(e.display.scroller,"dragstart",R.start),W(e.display.scroller,"dragenter",R.enter),W(e.display.scroller,"dragover",R.over),W(e.display.scroller,"dragleave",R.leave),W(e.display.scroller,"drop",R.drop)}}function Zl(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(y(e.display.wrapper,"CodeMirror-wrap"),Hn(e)),xa(e),Ii(e),_n(e),setTimeout(function(){return $r(e)},100)}function ti(e,a){var b=this;if(!(this instanceof ti))return new ti(e,a);this.options=a=a?N(a):{},N(Eo,a,!1);var _=a.value;typeof _=="string"?_=new Di(_,a.mode,null,a.lineSeparator,a.direction):a.mode&&(_.modeOption=a.mode),this.doc=_;var R=new ti.inputStyles[a.inputStyle](this),W=this.display=new hl(e,_,R,a);W.wrapper.CodeMirror=this,xo(this),a.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ws(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 te,keySeq:null,specialChars:null},a.autofocus&&!l&&W.input.focus(),E&&x<11&&setTimeout(function(){return b.display.input.reset(!0)},20),$l(this),Ll(),Hr(this),this.curOp.forceUpdate=!0,Ds(this,_),a.autofocus&&!l||this.hasFocus()?setTimeout(function(){b.hasFocus()&&!b.state.focused&&wa(b)},20):qr(this);for(var Q in aa)aa.hasOwnProperty(Q)&&aa[Q](this,a[Q],on);Cs(this),a.finishInit&&a.finishInit(this);for(var ee=0;ee<ja.length;++ee)ja[ee](this);Kr(this),g&&a.lineWrapping&&getComputedStyle(W.lineDiv).textRendering=="optimizelegibility"&&(W.lineDiv.style.textRendering="auto")}ti.defaults=Eo,ti.optionHandlers=aa;function $l(e){var a=e.display;je(a.scroller,"mousedown",pi(e,vo)),E&&x<11?je(a.scroller,"dblclick",pi(e,function(ie){if(We(e,ie))return;var ue=Nr(e,ie);if(!ue||Wa(e,ie)||hr(e.display,ie))return;J(ie);var Le=e.findWordAt(ue);$n(e.doc,Le.anchor,Le.head)})):je(a.scroller,"dblclick",function(ie){return We(e,ie)||J(ie)}),je(a.scroller,"contextmenu",function(ie){return bo(e,ie)}),je(a.input.getField(),"contextmenu",function(ie){a.scroller.contains(ie.target)||bo(e,ie)});var b,_={end:0};function R(){a.activeTouch&&(b=setTimeout(function(){return a.activeTouch=null},1e3),_=a.activeTouch,_.end=+new Date)}function W(ie){if(ie.touches.length!=1)return!1;var ue=ie.touches[0];return ue.radiusX<=1&&ue.radiusY<=1}function Q(ie,ue){if(ue.left==null)return!0;var Le=ue.left-ie.left,Ie=ue.top-ie.top;return Le*Le+Ie*Ie>20*20}je(a.scroller,"touchstart",function(ie){if(!We(e,ie)&&!W(ie)&&!Wa(e,ie)){a.input.ensurePolled(),clearTimeout(b);var ue=+new Date;a.activeTouch={start:ue,moved:!1,prev:ue-_.end<=300?_:null},ie.touches.length==1&&(a.activeTouch.left=ie.touches[0].pageX,a.activeTouch.top=ie.touches[0].pageY)}}),je(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),je(a.scroller,"touchend",function(ie){var ue=a.activeTouch;if(ue&&!hr(a,ie)&&ue.left!=null&&!ue.moved&&new Date-ue.start<300){var Le=e.coordsChar(a.activeTouch,"page"),Ie;!ue.prev||Q(ue,ue.prev)?Ie=new Qt(Le,Le):!ue.prev.prev||Q(ue,ue.prev.prev)?Ie=e.findWordAt(Le):Ie=new Qt(ht(Le.line,0),F(e.doc,ht(Le.line+1,0))),e.setSelection(Ie.anchor,Ie.head),e.focus(),J(ie)}R()}),je(a.scroller,"touchcancel",R),je(a.scroller,"scroll",function(){a.scroller.clientHeight&&(xn(e,a.scroller.scrollTop),Ur(e,a.scroller.scrollLeft,!0),Te(e,"scroll",e))}),je(a.scroller,"mousewheel",function(ie){return Ls(e,ie)}),je(a.scroller,"DOMMouseScroll",function(ie){return Ls(e,ie)}),je(a.wrapper,"scroll",function(){return a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(ie){We(e,ie)||me(ie)},over:function(ie){We(e,ie)||(Rl(e,ie),me(ie))},start:function(ie){return Al(e,ie)},drop:pi(e,Cl),leave:function(ie){We(e,ie)||ro(e)}};var ee=a.input.getField();je(ee,"keyup",function(ie){return mo.call(e,ie)}),je(ee,"keydown",pi(e,po)),je(ee,"keypress",pi(e,go)),je(ee,"focus",function(ie){return wa(e,ie)}),je(ee,"blur",function(ie){return qr(e,ie)})}var ja=[];ti.defineInitHook=function(e){return ja.push(e)};function Bn(e,a,b,_){var R=e.doc,W;b==null&&(b="add"),b=="smart"&&(R.mode.indent?W=pt(e,a).state:b="prev");var Q=e.options.tabSize,ee=xt(R,a),ie=z(ee.text,null,Q);ee.stateAfter&&(ee.stateAfter=null);var ue=ee.text.match(/^\s*/)[0],Le;if(!_&&!/\S/.test(ee.text))Le=0,b="not";else if(b=="smart"&&(Le=R.mode.indent(W,ee.text.slice(ue.length),ee.text),Le==Fe||Le>150)){if(!_)return;b="prev"}b=="prev"?a>R.first?Le=z(xt(R,a-1).text,null,Q):Le=0:b=="add"?Le=ie+e.options.indentUnit:b=="subtract"?Le=ie-e.options.indentUnit:typeof b=="number"&&(Le=ie+b),Le=Math.max(0,Le);var Ie="",Qe=0;if(e.options.indentWithTabs)for(var Ve=Math.floor(Le/Q);Ve;--Ve)Qe+=Q,Ie+=" ";if(Qe<Le&&(Ie+=_e(Le-Qe)),Ie!=ue)return rn(R,Ie,ht(a,0),ht(a,ue.length),"+input"),ee.stateAfter=null,!0;for(var it=0;it<R.sel.ranges.length;it++){var ut=R.sel.ranges[it];if(ut.head.line==a&&ut.head.ch<ue.length){var dt=ht(a,ue.length);Na(R,it,new Qt(dt,dt));break}}}var er=null;function sa(e){er=e}function Xa(e,a,b,_,R){var W=e.doc;e.display.shift=!1,_||(_=W.sel);var Q=+new Date-200,ee=R=="paste"||e.state.pasteIncoming>Q,ie=lt(a),ue=null;if(ee&&_.ranges.length>1)if(er&&er.text.join(`
`)==a){if(_.ranges.length%er.text.length==0){ue=[];for(var Le=0;Le<er.text.length;Le++)ue.push(W.splitLines(er.text[Le]))}}else ie.length==_.ranges.length&&e.options.pasteLinesPerSelection&&(ue=Ee(ie,function(gt){return[gt]}));for(var Ie=e.curOp.updateInput,Qe=_.ranges.length-1;Qe>=0;Qe--){var Ve=_.ranges[Qe],it=Ve.from(),ut=Ve.to();Ve.empty()&&(b&&b>0?it=ht(it.line,it.ch-b):e.state.overwrite&&!ee?ut=ht(ut.line,Math.min(xt(W,ut.line).text.length,ut.ch+le(ie).length)):ee&&er&&er.lineWise&&er.text.join(`
`)==ie.join(`
`)&&(it=ut=ht(it.line,0)));var dt={from:it,to:ut,text:ue?ue[Qe%ue.length]:ie,origin:R||(ee?"paste":e.state.cutIncoming>Q?"cut":"+input")};tn(e.doc,dt),yi(e,"inputRead",e,dt)}a&&!ee&&So(e,a),Zr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wo(e,a){var b=e.clipboardData&&e.clipboardData.getData("Text");if(b)return e.preventDefault(),!a.isReadOnly()&&!a.options.disableInput&&Bi(a,function(){return Xa(a,b,0,null,"paste")}),!0}function So(e,a){if(!e.options.electricChars||!e.options.smartIndent)return;for(var b=e.doc.sel,_=b.ranges.length-1;_>=0;_--){var R=b.ranges[_];if(R.head.ch>100||_&&b.ranges[_-1].head.line==R.head.line)continue;var W=e.getModeAt(R.head),Q=!1;if(W.electricChars){for(var ee=0;ee<W.electricChars.length;ee++)if(a.indexOf(W.electricChars.charAt(ee))>-1){Q=Bn(e,R.head.line,"smart");break}}else W.electricInput&&(W.electricInput.test(xt(e.doc,R.head.line).text.slice(0,R.head.ch))&&(Q=Bn(e,R.head.line,"smart")));Q&&yi(e,"electricInput",e,R.head.line)}}function To(e){for(var a=[],b=[],_=0;_<e.doc.sel.ranges.length;_++){var R=e.doc.sel.ranges[_].head.line,W={anchor:ht(R,0),head:ht(R+1,0)};b.push(W),a.push(e.getRange(W.anchor,W.head))}return{text:a,ranges:b}}function Co(e,a,b,_){e.setAttribute("autocorrect",b?"":"off"),e.setAttribute("autocapitalize",_?"":"off"),e.setAttribute("spellcheck",!!a)}function Ao(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),a=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),i&&(e.style.border="1px solid black"),Co(e),a}function Jl(e){var a=e.optionHandlers,b=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(_,R){var W=this.options,Q=W[_];if(W[_]==R&&_!="mode")return;W[_]=R,a.hasOwnProperty(_)&&pi(this,a[_])(this,R,Q),Te(this,"optionChange",this,_)},getOption:function(_){return this.options[_]},getDoc:function(){return this.doc},addKeyMap:function(_,R){this.state.keyMaps[R?"push":"unshift"](ra(_))},removeKeyMap:function(_){for(var R=this.state.keyMaps,W=0;W<R.length;++W)if(R[W]==_||R[W].name==_)return R.splice(W,1),!0},addOverlay:Ri(function(_,R){var W=_.token?_:e.getMode(this.options,_);if(W.startState)throw new Error("Overlays may not be stateful.");pe(this.state.overlays,{mode:W,modeSpec:_,opaque:R&&R.opaque,priority:R&&R.priority||0},function(Q){return Q.priority}),this.state.modeGen++,Ii(this)}),removeOverlay:Ri(function(_){for(var R=this.state.overlays,W=0;W<R.length;++W){var Q=R[W].modeSpec;if(Q==_||typeof _=="string"&&Q.name==_){R.splice(W,1),this.state.modeGen++,Ii(this);return}}}),indentLine:Ri(function(_,R,W){typeof R!="string"&&typeof R!="number"&&(R==null?R=this.options.smartIndent?"smart":"prev":R=R?"add":"subtract"),Yi(this.doc,_)&&Bn(this,_,R,W)}),indentSelection:Ri(function(_){for(var R=this.doc.sel.ranges,W=-1,Q=0;Q<R.length;Q++){var ee=R[Q];if(ee.empty())ee.head.line>W&&(Bn(this,ee.head.line,_,!0),W=ee.head.line,Q==this.doc.sel.primIndex&&Zr(this));else{var ie=ee.from(),ue=ee.to(),Le=Math.max(W,ie.line);W=Math.min(this.lastLine(),ue.line-(ue.ch?0:1))+1;for(var Ie=Le;Ie<W;++Ie)Bn(this,Ie,_);var Qe=this.doc.sel.ranges;ie.ch==0&&R.length==Qe.length&&Qe[Q].from().ch>0&&Na(this.doc,Q,new Qt(ie,Qe[Q].to()),Oe)}}}),getTokenAt:function(_,R){return ei(this,_,R)},getLineTokens:function(_,R){return ei(this,ht(_),R,!0)},getTokenTypeAt:function(_){_=F(this.doc,_);var R=rt(this,xt(this.doc,_.line)),W=0,Q=(R.length-1)/2,ee=_.ch,ie;if(ee==0)ie=R[2];else for(;;){var ue=W+Q>>1;if((ue?R[ue*2-1]:0)>=ee)Q=ue;else if(R[ue*2+1]<ee)W=ue+1;else{ie=R[ue*2+2];break}}var Le=ie?ie.indexOf("overlay "):-1;return Le<0?ie:Le==0?null:ie.slice(0,Le-1)},getModeAt:function(_){var R=this.doc.mode;return R.innerMode?e.innerMode(R,this.getTokenAt(_).state).mode:R},getHelper:function(_,R){return this.getHelpers(_,R)[0]},getHelpers:function(_,R){var W=[];if(!b.hasOwnProperty(R))return W;var Q=b[R],ee=this.getModeAt(_);if(typeof ee[R]=="string")Q[ee[R]]&&W.push(Q[ee[R]]);else if(ee[R])for(var ie=0;ie<ee[R].length;ie++){var ue=Q[ee[R][ie]];ue&&W.push(ue)}else ee.helperType&&Q[ee.helperType]?W.push(Q[ee.helperType]):Q[ee.name]&&W.push(Q[ee.name]);for(var Le=0;Le<Q._global.length;Le++){var Ie=Q._global[Le];Ie.pred(ee,this)&&ce(W,Ie.val)==-1&&W.push(Ie.val)}return W},getStateAfter:function(_,R){var W=this.doc;return _=$(W,_==null?W.first+W.size-1:_),pt(this,_+1,R).state},cursorCoords:function(_,R){var W,Q=this.doc.sel.primary();return _==null?W=Q.head:typeof _=="object"?W=F(this.doc,_):W=_?Q.from():Q.to(),$i(this,W,R||"page")},charCoords:function(_,R){return ma(this,F(this.doc,_),R||"page")},coordsChar:function(_,R){return _=ls(this,_,R||"page"),va(this,_.left,_.top)},lineAtHeight:function(_,R){return _=ls(this,{top:_,left:0},R||"page").top,Ki(this.doc,_+this.display.viewOffset)},heightAtLine:function(_,R,W){var Q=!1,ee;if(typeof _=="number"){var ie=this.doc.first+this.doc.size-1;_<this.doc.first?_=this.doc.first:_>ie&&(_=ie,Q=!0),ee=xt(this.doc,_)}else ee=_;return Wn(this,ee,{top:0,left:0},R||"page",W||Q).top+(Q?this.doc.height-Zi(ee):0)},defaultTextHeight:function(){return Yr(this.display)},defaultCharWidth:function(){return Qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(_,R,W,Q,ee){var ie=this.display;_=$i(this,F(this.doc,_));var ue=_.bottom,Le=_.left;if(R.style.position="absolute",R.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(R),ie.sizer.appendChild(R),Q=="over")ue=_.top;else if(Q=="above"||Q=="near"){var Ie=Math.max(ie.wrapper.clientHeight,this.doc.height),Qe=Math.max(ie.sizer.clientWidth,ie.lineSpace.clientWidth);(Q=="above"||_.bottom+R.offsetHeight>Ie)&&_.top>R.offsetHeight?ue=_.top-R.offsetHeight:_.bottom+R.offsetHeight<=Ie&&(ue=_.bottom),Le+R.offsetWidth>Qe&&(Le=Qe-R.offsetWidth)}R.style.top=ue+"px",R.style.left=R.style.right="",ee=="right"?(Le=ie.sizer.clientWidth-R.offsetWidth,R.style.right="0px"):(ee=="left"?Le=0:ee=="middle"&&(Le=(ie.sizer.clientWidth-R.offsetWidth)/2),R.style.left=Le+"px"),W&&qo(this,{left:Le,top:ue,right:Le+R.offsetWidth,bottom:ue+R.offsetHeight})},triggerOnKeyDown:Ri(po),triggerOnKeyPress:Ri(go),triggerOnKeyUp:mo,triggerOnMouseDown:Ri(vo),execCommand:function(_){if(Pn.hasOwnProperty(_))return Pn[_].call(null,this)},triggerElectric:Ri(function(_){So(this,_)}),findPosH:function(_,R,W,Q){var ee=1;R<0&&(ee=-1,R=-R);for(var ie=F(this.doc,_),ue=0;ue<R&&!(ie=za(this.doc,ie,ee,W,Q),ie.hitSide);++ue);return ie},moveH:Ri(function(_,R){var W=this;this.extendSelectionsBy(function(Q){return W.display.shift||W.doc.extend||Q.empty()?za(W.doc,Q.head,_,R,W.options.rtlMoveVisually):_<0?Q.from():Q.to()},Be)}),deleteH:Ri(function(_,R){var W=this.doc.sel,Q=this.doc;W.somethingSelected()?Q.replaceSelection("",null,"+delete"):sn(this,function(ee){var ie=za(Q,ee.head,_,R,!1);return _<0?{from:ie,to:ee.head}:{from:ee.head,to:ie}})}),findPosV:function(_,R,W,Q){var ee=1,ie=Q;R<0&&(ee=-1,R=-R);for(var ue=F(this.doc,_),Le=0;Le<R;++Le){var Ie=$i(this,ue,"div");if(ie==null?ie=Ie.left:Ie.left=ie,ue=Ro(this,Ie,ee,W),ue.hitSide)break}return ue},moveV:Ri(function(_,R){var W=this,Q=this.doc,ee=[],ie=!this.display.shift&&!Q.extend&&Q.sel.somethingSelected();if(Q.extendSelectionsBy(function(Le){if(ie)return _<0?Le.from():Le.to();var Ie=$i(W,Le.head,"div");Le.goalColumn!=null&&(Ie.left=Le.goalColumn),ee.push(Ie.left);var Qe=Ro(W,Ie,_,R);return R=="page"&&Le==Q.sel.primary()&&Ta(W,ma(W,Qe,"div").top-Ie.top),Qe},Be),ee.length)for(var ue=0;ue<Q.sel.ranges.length;ue++)Q.sel.ranges[ue].goalColumn=ee[ue]}),findWordAt:function(_){var R=this.doc,W=xt(R,_.line).text,Q=_.ch,ee=_.ch;if(W){var ie=this.getHelper(_,"wordChars");(_.sticky=="before"||ee==W.length)&&Q?--Q:++ee;for(var ue=W.charAt(Q),Le=Je(ue,ie)?function(Ie){return Je(Ie,ie)}:/\s/.test(ue)?function(Ie){return/\s/.test(Ie)}:function(Ie){return!/\s/.test(Ie)&&!Je(Ie)};Q>0&&Le(W.charAt(Q-1));)--Q;for(;ee<W.length&&Le(W.charAt(ee));)++ee}return new Qt(ht(_.line,Q),ht(_.line,ee))},toggleOverwrite:function(_){if(_!=null&&_==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):y(this.display.cursorDiv,"CodeMirror-overwrite"),Te(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ri(function(_,R){bn(this,_,R)}),getScrollInfo:function(){var _=this.display.scroller;return{left:_.scrollLeft,top:_.scrollTop,height:_.scrollHeight-nr(this)-this.display.barHeight,width:_.scrollWidth-nr(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Mr(this)}},scrollIntoView:Ri(function(_,R){_==null?(_={from:this.doc.sel.primary().head,to:null},R==null&&(R=this.options.cursorScrollMargin)):typeof _=="number"?_={from:ht(_,0),to:null}:_.from==null&&(_={from:_,to:null}),_.to||(_.to=_.from),_.margin=R||0,_.from.line!=null?Zo(this,_):ys(this,_.from,_.to,_.margin)}),setSize:Ri(function(_,R){var W=this,Q=function(ie){return typeof ie=="number"||/^\d+$/.test(String(ie))?ie+"px":ie};_!=null&&(this.display.wrapper.style.width=Q(_)),R!=null&&(this.display.wrapper.style.height=Q(R)),this.options.lineWrapping&&as(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(ie){if(ie.widgets){for(var ue=0;ue<ie.widgets.length;ue++)if(ie.widgets[ue].noHScroll){wr(W,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,Te(this,"refresh",this)}),operation:function(_){return Bi(this,_)},startOperation:function(){return Hr(this)},endOperation:function(){return Kr(this)},refresh:Ri(function(){var _=this.display.cachedTextHeight;Ii(this),this.curOp.forceUpdate=!0,_n(this),bn(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(_==null||Math.abs(_-Yr(this.display))>.5||this.options.lineWrapping)&&xa(this),Te(this,"refresh",this)}),swapDoc:Ri(function(_){var R=this.doc;return R.cm=null,this.state.selectingText&&this.state.selectingText(),Ds(this,_),_n(this),this.display.input.reset(),bn(this,_.scrollLeft,_.scrollTop),this.curOp.forceScroll=!0,yi(this,"swapDoc",this,R),R}),phrase:function(_){var R=this.options.phrases;return R&&Object.prototype.hasOwnProperty.call(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}},ye(e),e.registerHelper=function(_,R,W){b.hasOwnProperty(_)||(b[_]=e[_]={_global:[]}),b[_][R]=W},e.registerGlobalHelper=function(_,R,W,Q){e.registerHelper(_,R,Q),b[_]._global.push({pred:W,val:Q})}}function za(e,a,b,_,R){var W=a,Q=b,ee=xt(e,a.line),ie=R&&e.direction=="rtl"?-b:b;function ue(){var yt=a.line+ie;return yt<e.first||yt>=e.first+e.size?!1:(a=new ht(yt,a.ch,a.sticky),ee=xt(e,yt))}function Le(yt){var vt;if(_=="codepoint"){var bt=ee.text.charCodeAt(a.ch+(_>0?0:-1));isNaN(bt)?vt=null:vt=new ht(a.line,Math.max(0,Math.min(ee.text.length,a.ch+b*(bt>=55296&&bt<56320?2:1))),-b)}else R?vt=Ml(e.cm,ee,a,b):vt=Ua(ee,a,b);if(vt==null)if(!yt&&ue())a=Ba(R,e.cm,ee,a.line,ie);else return!1;else a=vt;return!0}if(_=="char"||_=="codepoint")Le();else if(_=="column")Le(!0);else if(_=="word"||_=="group")for(var Ie=null,Qe=_=="group",Ve=e.cm&&e.cm.getHelper(a,"wordChars"),it=!0;!(b<0&&!Le(!it));it=!1){var ut=ee.text.charAt(a.ch)||`
`,dt=Je(ut,Ve)?"w":Qe&&ut==`
`?"n":!Qe||/\s/.test(ut)?null:"p";if(Qe&&!it&&!dt&&(dt="s"),Ie&&Ie!=dt){b<0&&(b=1,Le(),a.sticky="after");break}if(dt&&(Ie=dt),b>0&&!Le(!it))break}var gt=ea(e,a,W,Q,!0);return pr(W,gt)&&(gt.hitSide=!0),gt}function Ro(e,a,b,_){var R=e.doc,W=a.left,Q;if(_=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ie=Math.max(ee-.5*Yr(e.display),3);Q=(b>0?a.bottom:a.top)+b*ie}else _=="line"&&(Q=b>0?a.bottom+3:a.top-3);for(var ue;!(ue=va(e,W,Q),!ue.outside);){if(b<0?Q<=0:Q>=R.height){ue.hitSide=!0;break}Q+=b*5}return ue}var Zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Zt.prototype.init=function(e){var a=this,b=this,_=b.cm,R=b.div=e.lineDiv;Co(R,_.options.spellcheck,_.options.autocorrect,_.options.autocapitalize);function W(ee){for(var ie=ee.target;ie;ie=ie.parentNode){if(ie==R)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ie.className))break}return!1}je(R,"paste",function(ee){if(!W(ee)||We(_,ee)||wo(ee,_))return;x<=11&&setTimeout(pi(_,function(){return a.updateFromDOM()}),20)}),je(R,"compositionstart",function(ee){a.composing={data:ee.data,done:!1}}),je(R,"compositionupdate",function(ee){a.composing||(a.composing={data:ee.data,done:!1})}),je(R,"compositionend",function(ee){a.composing&&(ee.data!=a.composing.data&&a.readFromDOMSoon(),a.composing.done=!0)}),je(R,"touchstart",function(){return b.forceCompositionEnd()}),je(R,"input",function(){a.composing||a.readFromDOMSoon()});function Q(ee){if(!W(ee)||We(_,ee))return;if(_.somethingSelected())sa({lineWise:!1,text:_.getSelections()}),ee.type=="cut"&&_.replaceSelection("",null,"cut");else if(_.options.lineWiseCopyCut){var ie=To(_);sa({lineWise:!0,text:ie.text}),ee.type=="cut"&&_.operation(function(){_.setSelections(ie.ranges,0,Oe),_.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var ue=er.text.join(`
`);if(ee.clipboardData.setData("Text",ue),ee.clipboardData.getData("Text")==ue){ee.preventDefault();return}}var Le=Ao(),Ie=Le.firstChild;_.display.lineSpace.insertBefore(Le,_.display.lineSpace.firstChild),Ie.value=er.text.join(`
`);var Qe=document.activeElement;X(Ie),setTimeout(function(){_.display.lineSpace.removeChild(Le),Qe.focus(),Qe==R&&b.showPrimarySelection()},50)}je(R,"copy",Q),je(R,"cut",Q)},Zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Zt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Zt.prototype.showSelection=function(e,a){if(!e||!this.cm.display.view.length)return;(e.focus||a)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),a=this.cm,b=a.doc.sel.primary(),_=b.from(),R=b.to();if(a.display.viewTo==a.display.viewFrom||_.line>=a.display.viewTo||R.line<a.display.viewFrom){e.removeAllRanges();return}var W=oa(a,e.anchorNode,e.anchorOffset),Q=oa(a,e.focusNode,e.focusOffset);if(W&&!W.bad&&Q&&!Q.bad&&Dt(vr(W,Q),_)==0&&Dt(gr(W,Q),R)==0)return;var ee=a.display.view,ie=_.line>=a.display.viewFrom&&Lo(a,_)||{node:ee[0].measure.map[2],offset:0},ue=R.line<a.display.viewTo&&Lo(a,R);if(!ue){var Le=ee[ee.length-1].measure,Ie=Le.maps?Le.maps[Le.maps.length-1]:Le.map;ue={node:Ie[Ie.length-1],offset:Ie[Ie.length-2]-Ie[Ie.length-3]}}if(!ie||!ue){e.removeAllRanges();return}var Qe=e.rangeCount&&e.getRangeAt(0),Ve;try{Ve=O(ie.node,ie.offset,ue.offset,ue.node)}catch(it){}Ve&&(!I&&a.state.focused?(e.collapse(ie.node,ie.offset),Ve.collapsed||(e.removeAllRanges(),e.addRange(Ve))):(e.removeAllRanges(),e.addRange(Ve)),Qe&&e.anchorNode==null?e.addRange(Qe):I&&this.startGracePeriod()),this.rememberSelection()},Zt.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)},Zt.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},Zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var a=e.getRangeAt(0).commonAncestorContainer;return P(this.div,a)},Zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Zt.prototype.blur=function(){this.div.blur()},Zt.prototype.getField=function(){return this.div},Zt.prototype.supportsTouch=function(){return!0},Zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Bi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function a(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,a))}this.polling.set(this.cm.options.pollInterval,a)},Zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),a=this.cm;if(s&&o&&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 b=oa(a,e.anchorNode,e.anchorOffset),_=oa(a,e.focusNode,e.focusOffset);b&&_&&Bi(a,function(){Ti(a.doc,Tr(b,_),Oe),(b.bad||_.bad)&&(a.curOp.selectionChanged=!0)})},Zt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,a=e.display,b=e.doc.sel.primary(),_=b.from(),R=b.to();if(_.ch==0&&_.line>e.firstLine()&&(_=ht(_.line-1,xt(e.doc,_.line-1).length)),R.ch==xt(e.doc,R.line).text.length&&R.line<e.lastLine()&&(R=ht(R.line+1,0)),_.line<a.viewFrom||R.line>a.viewTo-1)return!1;var W,Q,ee;_.line==a.viewFrom||(W=Fr(e,_.line))==0?(Q=Ht(a.view[0].line),ee=a.view[0].node):(Q=Ht(a.view[W].line),ee=a.view[W-1].node.nextSibling);var ie=Fr(e,R.line),ue,Le;if(ie==a.view.length-1?(ue=a.viewTo-1,Le=a.lineDiv.lastChild):(ue=Ht(a.view[ie+1].line)-1,Le=a.view[ie+1].node.previousSibling),!ee)return!1;for(var Ie=e.doc.splitLines(tu(e,ee,Le,Q,ue)),Qe=zi(e.doc,ht(Q,0),ht(ue,xt(e.doc,ue).text.length));Ie.length>1&&Qe.length>1;)if(le(Ie)==le(Qe))Ie.pop(),Qe.pop(),ue--;else if(Ie[0]==Qe[0])Ie.shift(),Qe.shift(),Q++;else break;for(var Ve=0,it=0,ut=Ie[0],dt=Qe[0],gt=Math.min(ut.length,dt.length);Ve<gt&&ut.charCodeAt(Ve)==dt.charCodeAt(Ve);)++Ve;for(var yt=le(Ie),vt=le(Qe),bt=Math.min(yt.length-(Ie.length==1?Ve:0),vt.length-(Qe.length==1?Ve:0));it<bt&&yt.charCodeAt(yt.length-it-1)==vt.charCodeAt(vt.length-it-1);)++it;if(Ie.length==1&&Qe.length==1&&Q==_.line)for(;Ve&&Ve>_.ch&&yt.charCodeAt(yt.length-it-1)==vt.charCodeAt(vt.length-it-1);)Ve--,it++;Ie[Ie.length-1]=yt.slice(0,yt.length-it).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice(Ve).replace(/\u200b+$/,"");var Ot=ht(Q,Ve),At=ht(ue,Qe.length?le(Qe).length-it:0);if(Ie.length>1||Ie[0]||Dt(Ot,At))return rn(e.doc,Ie,Ot,At,"+input"),!0},Zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zt.prototype.reset=function(){this.forceCompositionEnd()},Zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Zt.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)},Zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bi(this.cm,function(){return Ii(e.cm)})},Zt.prototype.setUneditable=function(e){e.contentEditable="false"},Zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pi(this.cm,Xa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Zt.prototype.onContextMenu=function(){},Zt.prototype.resetPosition=function(){},Zt.prototype.needsContentAttribute=!0;function Lo(e,a){var b=fa(e,a.line);if(!b||b.hidden)return null;var _=xt(e.doc,a.line),R=es(b,_,a.line),W=qe(_,e.doc.direction),Q="left";if(W){var ee=ae(W,a.ch);Q=ee%2?"right":"left"}var ie=rs(R.map,a.ch,Q);return ie.offset=ie.collapse=="right"?ie.end:ie.start,ie}function eu(e){for(var a=e;a;a=a.parentNode)if(/CodeMirror-gutter-wrapper/.test(a.className))return!0;return!1}function ln(e,a){return a&&(e.bad=!0),e}function tu(e,a,b,_,R){var W="",Q=!1,ee=e.doc.lineSeparator(),ie=!1;function ue(Ve){return function(it){return it.id==Ve}}function Le(){Q&&(W+=ee,ie&&(W+=ee),Q=ie=!1)}function Ie(Ve){Ve&&(Le(),W+=Ve)}function Qe(Ve){if(Ve.nodeType==1){var it=Ve.getAttribute("cm-text");if(it){Ie(it);return}var ut=Ve.getAttribute("cm-marker"),dt;if(ut){var gt=e.findMarks(ht(_,0),ht(R+1,0),ue(+ut));gt.length&&(dt=gt[0].find(0))&&Ie(zi(e.doc,dt.from,dt.to).join(ee));return}if(Ve.getAttribute("contenteditable")=="false")return;var yt=/^(pre|div|p|li|table|br)$/i.test(Ve.nodeName);if(!/^br$/i.test(Ve.nodeName)&&Ve.textContent.length==0)return;yt&&Le();for(var vt=0;vt<Ve.childNodes.length;vt++)Qe(Ve.childNodes[vt]);/^(pre|p)$/i.test(Ve.nodeName)&&(ie=!0),yt&&(Q=!0)}else Ve.nodeType==3&&Ie(Ve.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Qe(a),a==b);)a=a.nextSibling,ie=!1;return W}function oa(e,a,b){var _;if(a==e.display.lineDiv){if(_=e.display.lineDiv.childNodes[b],!_)return ln(e.clipPos(ht(e.display.viewTo-1)),!0);a=null,b=0}else for(_=a;;_=_.parentNode){if(!_||_==e.display.lineDiv)return null;if(_.parentNode&&_.parentNode==e.display.lineDiv)break}for(var R=0;R<e.display.view.length;R++){var W=e.display.view[R];if(W.node==_)return iu(W,a,b)}}function iu(e,a,b){var _=e.text.firstChild,R=!1;if(!a||!P(_,a))return ln(ht(Ht(e.line),0),!0);if(a==_&&(R=!0,a=_.childNodes[b],b=0,!a)){var W=e.rest?le(e.rest):e.line;return ln(ht(Ht(W),W.text.length),R)}var Q=a.nodeType==3?a:null,ee=a;for(!Q&&a.childNodes.length==1&&a.firstChild.nodeType==3&&(Q=a.firstChild,b&&(b=Q.nodeValue.length));ee.parentNode!=_;)ee=ee.parentNode;var ie=e.measure,ue=ie.maps;function Le(dt,gt,yt){for(var vt=-1;vt<(ue?ue.length:0);vt++)for(var bt=vt<0?ie.map:ue[vt],Ot=0;Ot<bt.length;Ot+=3){var At=bt[Ot+2];if(At==dt||At==gt){var Ut=Ht(vt<0?e.line:e.rest[vt]),Jt=bt[Ot]+yt;return(yt<0||At!=dt)&&(Jt=bt[Ot+(yt?1:0)]),ht(Ut,Jt)}}}var Ie=Le(Q,ee,b);if(Ie)return ln(Ie,R);for(var Qe=ee.nextSibling,Ve=Q?Q.nodeValue.length-b:0;Qe;Qe=Qe.nextSibling){if(Ie=Le(Qe,Qe.firstChild,0),Ie)return ln(ht(Ie.line,Ie.ch-Ve),R);Ve+=Qe.textContent.length}for(var it=ee.previousSibling,ut=b;it;it=it.previousSibling){if(Ie=Le(it,it.firstChild,-1),Ie)return ln(ht(Ie.line,Ie.ch+ut),R);ut+=it.textContent.length}}var ai=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new te,this.hasSelection=!1,this.composing=null};ai.prototype.init=function(e){var a=this,b=this,_=this.cm;this.createField(e);var R=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),i&&(R.style.width="0px"),je(R,"input",function(){E&&x>=9&&a.hasSelection&&(a.hasSelection=null),b.poll()}),je(R,"paste",function(Q){if(We(_,Q)||wo(Q,_))return;_.state.pasteIncoming=+new Date,b.fastPoll()});function W(Q){if(We(_,Q))return;if(_.somethingSelected())sa({lineWise:!1,text:_.getSelections()});else if(_.options.lineWiseCopyCut){var ee=To(_);sa({lineWise:!0,text:ee.text}),Q.type=="cut"?_.setSelections(ee.ranges,null,Oe):(b.prevInput="",R.value=ee.text.join(`
`),X(R))}else return;Q.type=="cut"&&(_.state.cutIncoming=+new Date)}je(R,"cut",W),je(R,"copy",W),je(e.scroller,"paste",function(Q){if(hr(e,Q)||We(_,Q))return;if(!R.dispatchEvent){_.state.pasteIncoming=+new Date,b.focus();return}var ee=new Event("paste");ee.clipboardData=Q.clipboardData,R.dispatchEvent(ee)}),je(e.lineSpace,"selectstart",function(Q){hr(e,Q)||J(Q)}),je(R,"compositionstart",function(){var Q=_.getCursor("from");b.composing&&b.composing.range.clear(),b.composing={start:Q,range:_.markText(Q,_.getCursor("to"),{className:"CodeMirror-composing"})}}),je(R,"compositionend",function(){b.composing&&(b.poll(),b.composing.range.clear(),b.composing=null)})},ai.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ai.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ai.prototype.prepareSelection=function(){var e=this.cm,a=e.display,b=e.doc,_=ps(e);if(e.options.moveInputWithCursor){var R=$i(e,b.sel.primary().head,"div"),W=a.wrapper.getBoundingClientRect(),Q=a.lineDiv.getBoundingClientRect();_.teTop=Math.max(0,Math.min(a.wrapper.clientHeight-10,R.top+Q.top-W.top)),_.teLeft=Math.max(0,Math.min(a.wrapper.clientWidth-10,R.left+Q.left-W.left))}return _},ai.prototype.showSelection=function(e){var a=this.cm,b=a.display;A(b.cursorDiv,e.cursors),A(b.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ai.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var a=this.cm;if(a.somethingSelected()){this.prevInput="";var b=a.getSelection();this.textarea.value=b,a.state.focused&&X(this.textarea),E&&x>=9&&(this.hasSelection=b)}else e||(this.prevInput=this.textarea.value="",E&&x>=9&&(this.hasSelection=null))},ai.prototype.getField=function(){return this.textarea},ai.prototype.supportsTouch=function(){return!1},ai.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},ai.prototype.blur=function(){this.textarea.blur()},ai.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ai.prototype.receivedFocus=function(){this.slowPoll()},ai.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()})},ai.prototype.fastPoll=function(){var e=!1,a=this;a.pollingFast=!0;function b(){var _=a.poll();!_&&!e?(e=!0,a.polling.set(60,b)):(a.pollingFast=!1,a.slowPoll())}a.polling.set(20,b)},ai.prototype.poll=function(){var e=this,a=this.cm,b=this.textarea,_=this.prevInput;if(this.contextMenuPending||!a.state.focused||tt(b)&&!_&&!this.composing||a.isReadOnly()||a.options.disableInput||a.state.keySeq)return!1;var R=b.value;if(R==_&&!a.somethingSelected())return!1;if(E&&x>=9&&this.hasSelection===R||c&&/[\uf700-\uf7ff]/.test(R))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var W=R.charCodeAt(0);if(W==8203&&!_&&(_="\u200B"),W==8666)return this.reset(),this.cm.execCommand("undo")}for(var Q=0,ee=Math.min(_.length,R.length);Q<ee&&_.charCodeAt(Q)==R.charCodeAt(Q);)++Q;return Bi(a,function(){Xa(a,R.slice(Q),_.length-Q,null,e.composing?"*compose":null),R.length>1e3||R.indexOf(`
`)>-1?b.value=e.prevInput="":e.prevInput=R,e.composing&&(e.composing.range.clear(),e.composing.range=a.markText(e.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ai.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ai.prototype.onKeyPress=function(){E&&x>=9&&(this.hasSelection=null),this.fastPoll()},ai.prototype.onContextMenu=function(e){var a=this,b=a.cm,_=b.display,R=a.textarea;a.contextMenuPending&&a.contextMenuPending();var W=Nr(b,e),Q=_.scroller.scrollTop;if(!W||u)return;var ee=b.options.resetSelectionOnContextMenu;ee&&b.doc.sel.contains(W)==-1&&pi(b,Ti)(b.doc,Tr(W),Oe);var ie=R.style.cssText,ue=a.wrapper.style.cssText,Le=a.wrapper.offsetParent.getBoundingClientRect();a.wrapper.style.cssText="position: static",R.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Le.top-5)+"px; left: "+(e.clientX-Le.left-5)+`px;
z-index: 1000; background: `+(E?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;g&&(Ie=window.scrollY),_.input.focus(),g&&window.scrollTo(null,Ie),_.input.reset(),b.somethingSelected()||(R.value=a.prevInput=" "),a.contextMenuPending=Ve,_.selForContextMenu=b.doc.sel,clearTimeout(_.detectingSelectAll);function Qe(){if(R.selectionStart!=null){var ut=b.somethingSelected(),dt="\u200B"+(ut?R.value:"");R.value="\u21DA",R.value=dt,a.prevInput=ut?"":"\u200B",R.selectionStart=1,R.selectionEnd=dt.length,_.selForContextMenu=b.doc.sel}}function Ve(){if(a.contextMenuPending!=Ve)return;if(a.contextMenuPending=!1,a.wrapper.style.cssText=ue,R.style.cssText=ie,E&&x<9&&_.scrollbars.setScrollTop(_.scroller.scrollTop=Q),R.selectionStart!=null){(!E||E&&x<9)&&Qe();var ut=0,dt=function(){_.selForContextMenu==b.doc.sel&&R.selectionStart==0&&R.selectionEnd>0&&a.prevInput=="\u200B"?pi(b,Gs)(b):ut++<10?_.detectingSelectAll=setTimeout(dt,500):(_.selForContextMenu=null,_.input.reset())};_.detectingSelectAll=setTimeout(dt,200)}}if(E&&x>=9&&Qe(),C){me(e);var it=function(){he(window,"mouseup",it),setTimeout(Ve,20)};je(window,"mouseup",it)}else setTimeout(Ve,50)},ai.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ai.prototype.setUneditable=function(){},ai.prototype.needsContentAttribute=!1;function ru(e,a){if(a=a?N(a):{},a.value=e.value,!a.tabindex&&e.tabIndex&&(a.tabindex=e.tabIndex),!a.placeholder&&e.placeholder&&(a.placeholder=e.placeholder),a.autofocus==null){var b=j();a.autofocus=b==e||e.getAttribute("autofocus")!=null&&b==document.body}function _(){e.value=ee.getValue()}var R;if(e.form&&(je(e.form,"submit",_),!a.leaveSubmitMethodAlone)){var W=e.form;R=W.submit;try{var Q=W.submit=function(){_(),W.submit=R,W.submit(),W.submit=Q}}catch(ie){}}a.finishInit=function(ie){ie.save=_,ie.getTextArea=function(){return e},ie.toTextArea=function(){ie.toTextArea=isNaN,_(),e.parentNode.removeChild(ie.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",_),!a.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=R))}},e.style.display="none";var ee=ti(function(ie){return e.parentNode.insertBefore(ie,e.nextSibling)},a);return ee}function nu(e){e.off=he,e.on=je,e.wheelEventPixels=cl,e.Doc=Di,e.splitLines=lt,e.countColumn=z,e.findColumn=Ke,e.isWordChar=Ze,e.Pass=Fe,e.signal=Te,e.Line=Dr,e.changeEnd=Cr,e.scrollbarModel=Es,e.Pos=ht,e.cmpPos=Dt,e.modes=_t,e.mimeModes=ft,e.resolveMode=nt,e.getMode=Tt,e.modeExtensions=It,e.extendMode=wt,e.copyState=Ft,e.startState=ui,e.innerMode=zt,e.commands=Pn,e.keyMap=cr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=Dl,e.StringStream=Pt,e.SharedTextMarker=In,e.TextMarker=Rr,e.LineWidget=On,e.e_preventDefault=J,e.e_stopPropagation=ne,e.e_stop=me,e.addClass=K,e.contains=P,e.rmClass=y,e.keyNames=Lr}Ql(ti),Jl(ti);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Di.prototype)Di.prototype.hasOwnProperty(la)&&ce(au,la)<0&&(ti.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Di.prototype[la]));return ye(Di),ti.inputStyles={textarea:ai,contenteditable:Zt},ti.defineMode=function(e){!ti.defaults.mode&&e!="null"&&(ti.defaults.mode=e),kt.apply(this,arguments)},ti.defineMIME=Nt,ti.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ti.defineMIME("text/plain","null"),ti.defineExtension=function(e,a){ti.prototype[e]=a},ti.defineDocExtension=function(e,a){Di.prototype[e]=a},ti.fromTextArea=ru,nu(ti),ti.version="5.58.2",ti})},Y1PL:function(at,fe,oe){"use strict";oe.r(fe),oe.d(fe,"ResizableTextArea",function(){return ce});var V=oe("wx14"),L=oe("1OyB"),I=oe("vuIU"),k=oe("Ji7U"),M=oe("LK+K"),f=oe("q1tI"),E=oe("VTBJ"),x=oe("rePB"),g=oe("Zm9Q"),h=oe("Kwbf"),o=oe("c+Xe"),u=oe("m+aA"),r=oe("bdgK"),n=new Map;function t(Oe){Oe.forEach(function(Re){var Be,Ke=Re.target;(Be=n.get(Ke))===null||Be===void 0||Be.forEach(function(Ae){return Ae(Ke)})})}var i=new r.default(t),s=null,l=null;function c(Oe,Re){n.has(Oe)||(n.set(Oe,new Set),i.observe(Oe)),n.get(Oe).add(Re)}function d(Oe,Re){n.has(Oe)&&(n.get(Oe).delete(Re),n.get(Oe).size||(i.unobserve(Oe),n.delete(Oe)))}var w=function(Oe){Object(k.a)(Be,Oe);var Re=Object(M.a)(Be);function Be(){return Object(L.a)(this,Be),Re.apply(this,arguments)}return Object(I.a)(Be,[{key:"render",value:function(){return this.props.children}}]),Be}(f.Component),m=f.createContext(null);function S(Oe){var Re=Oe.children,Be=Oe.onBatchResize,Ke=f.useRef(0),Ae=f.useRef([]),_e=f.useContext(m),le=f.useCallback(function(Ee,pe,Ge){Ke.current+=1;var Ye=Ke.current;Ae.current.push({size:Ee,element:pe,data:Ge}),Promise.resolve().then(function(){Ye===Ke.current&&(Be==null||Be(Ae.current),Ae.current=[])}),_e==null||_e(Ee,pe,Ge)},[Be,_e]);return f.createElement(m.Provider,{value:le},Re)}function C(Oe){var Re=Oe.children,Be=Oe.disabled,Ke=f.useRef(null),Ae=f.useRef(null),_e=f.useContext(m),le=f.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ee=f.isValidElement(Re)&&Object(o.c)(Re),pe=Ee?Re.ref:null,Ge=f.useMemo(function(){return Object(o.a)(pe,Ke)},[pe,Ke]),Ye=f.useRef(Oe);Ye.current=Oe;var ze=f.useCallback(function(Ze){var Je=Ye.current,$e=Je.onResize,He=Je.data,Ue=Ze.getBoundingClientRect(),Pe=Ue.width,ke=Ue.height,re=Ze.offsetWidth,ve=Ze.offsetHeight,ae=Math.floor(Pe),De=Math.floor(ke);if(le.current.width!==ae||le.current.height!==De||le.current.offsetWidth!==re||le.current.offsetHeight!==ve){var qe={width:ae,height:De,offsetWidth:re,offsetHeight:ve};le.current=qe;var et=re===Math.round(Pe)?Pe:re,je=ve===Math.round(ke)?ke:ve,ct=Object(E.a)(Object(E.a)({},qe),{},{offsetWidth:et,offsetHeight:je});_e==null||_e(ct,Ze,He),$e&&Promise.resolve().then(function(){$e(ct,Ze)})}},[]);return f.useEffect(function(){var Ze=Object(u.a)(Ke.current)||Object(u.a)(Ae.current);return Ze&&!Be&&c(Ze,ze),function(){return d(Ze,ze)}},[Ke.current,Be]),f.createElement(w,{ref:Ae},Ee?f.cloneElement(Re,{ref:Ge}):Re)}var v="rc-observer-key";function y(Oe){var Re=Oe.children,Be=Object(g.a)(Re);return Be.map(function(Ke,Ae){var _e=(Ke==null?void 0:Ke.key)||"".concat(v,"-").concat(Ae);return f.createElement(C,Object(V.a)({},Oe,{key:_e}),Ke)})}y.Collection=S;var T=y,A=oe("bT9E"),p=oe("TSYQ"),D=oe.n(p),O=`
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
`,P=["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"],j={},K;function U(Oe){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Be=Oe.getAttribute("id")||Oe.getAttribute("data-reactid")||Oe.getAttribute("name");if(Re&&j[Be])return j[Be];var Ke=window.getComputedStyle(Oe),Ae=Ke.getPropertyValue("box-sizing")||Ke.getPropertyValue("-moz-box-sizing")||Ke.getPropertyValue("-webkit-box-sizing"),_e=parseFloat(Ke.getPropertyValue("padding-bottom"))+parseFloat(Ke.getPropertyValue("padding-top")),le=parseFloat(Ke.getPropertyValue("border-bottom-width"))+parseFloat(Ke.getPropertyValue("border-top-width")),Ee=P.map(function(Ge){return"".concat(Ge,":").concat(Ke.getPropertyValue(Ge))}).join(";"),pe={sizingStyle:Ee,paddingSize:_e,borderSize:le,boxSizing:Ae};return Re&&Be&&(j[Be]=pe),pe}function X(Oe){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;K||(K=document.createElement("textarea"),K.setAttribute("tab-index","-1"),K.setAttribute("aria-hidden","true"),document.body.appendChild(K)),Oe.getAttribute("wrap")?K.setAttribute("wrap",Oe.getAttribute("wrap")):K.removeAttribute("wrap");var Ae=U(Oe,Re),_e=Ae.paddingSize,le=Ae.borderSize,Ee=Ae.boxSizing,pe=Ae.sizingStyle;K.setAttribute("style","".concat(pe,";").concat(O)),K.value=Oe.value||Oe.placeholder||"";var Ge=Number.MIN_SAFE_INTEGER,Ye=Number.MAX_SAFE_INTEGER,ze=K.scrollHeight,Ze;if(Ee==="border-box"?ze+=le:Ee==="content-box"&&(ze-=_e),Be!==null||Ke!==null){K.value=" ";var Je=K.scrollHeight-_e;Be!==null&&(Ge=Je*Be,Ee==="border-box"&&(Ge=Ge+_e+le),ze=Math.max(Ge,ze)),Ke!==null&&(Ye=Je*Ke,Ee==="border-box"&&(Ye=Ye+_e+le),Ze=ze>Ye?"":"hidden",ze=Math.min(Ye,ze))}return{height:ze,minHeight:Ge,maxHeight:Ye,overflowY:Ze,resize:"none"}}var B=oe("Gytx"),N=oe.n(B),z;(function(Oe){Oe[Oe.NONE=0]="NONE",Oe[Oe.RESIZING=1]="RESIZING",Oe[Oe.RESIZED=2]="RESIZED"})(z||(z={}));var te=function(Oe){Object(k.a)(Be,Oe);var Re=Object(M.a)(Be);function Be(Ke){var Ae;return Object(L.a)(this,Be),Ae=Re.call(this,Ke),Ae.nextFrameActionId=void 0,Ae.resizeFrameId=void 0,Ae.textArea=void 0,Ae.saveTextArea=function(_e){Ae.textArea=_e},Ae.handleResize=function(_e){var le=Ae.state.resizeStatus,Ee=Ae.props,pe=Ee.autoSize,Ge=Ee.onResize;if(le!==z.NONE)return;typeof Ge=="function"&&Ge(_e),pe&&Ae.resizeOnNextFrame()},Ae.resizeOnNextFrame=function(){cancelAnimationFrame(Ae.nextFrameActionId),Ae.nextFrameActionId=requestAnimationFrame(Ae.resizeTextarea)},Ae.resizeTextarea=function(){var _e=Ae.props.autoSize;if(!_e||!Ae.textArea)return;var le=_e.minRows,Ee=_e.maxRows,pe=X(Ae.textArea,!1,le,Ee);Ae.setState({textareaStyles:pe,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(Ae.resizeFrameId),Ae.resizeFrameId=requestAnimationFrame(function(){Ae.setState({resizeStatus:z.RESIZED},function(){Ae.resizeFrameId=requestAnimationFrame(function(){Ae.setState({resizeStatus:z.NONE}),Ae.fixFirefoxAutoScroll()})})})})},Ae.renderTextArea=function(){var _e=Ae.props,le=_e.prefixCls,Ee=le===void 0?"rc-textarea":le,pe=_e.autoSize,Ge=_e.onResize,Ye=_e.className,ze=_e.disabled,Ze=Ae.state,Je=Ze.textareaStyles,$e=Ze.resizeStatus,He=Object(A.a)(Ae.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ue=D()(Ee,Ye,Object(x.a)({},"".concat(Ee,"-disabled"),ze));"value"in He&&(He.value=He.value||"");var Pe=Object(E.a)(Object(E.a)(Object(E.a)({},Ae.props.style),Je),$e===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return f.createElement(T,{onResize:Ae.handleResize,disabled:!(pe||Ge)},f.createElement("textarea",Object(V.a)({},He,{className:Ue,style:Pe,ref:Ae.saveTextArea})))},Ae.state={textareaStyles:{},resizeStatus:z.NONE},Ae}return Object(I.a)(Be,[{key:"componentDidUpdate",value:function(Ae){(Ae.value!==this.props.value||!N()(Ae.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 Ae=this.textArea.selectionStart,_e=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ae,_e)}}catch(le){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Be}(f.Component),ce=te,be=function(Oe){Object(k.a)(Be,Oe);var Re=Object(M.a)(Be);function Be(Ke){var Ae;Object(L.a)(this,Be),Ae=Re.call(this,Ke),Ae.resizableTextArea=void 0,Ae.focus=function(){Ae.resizableTextArea.textArea.focus()},Ae.saveTextArea=function(le){Ae.resizableTextArea=le},Ae.handleChange=function(le){var Ee=Ae.props.onChange;Ae.setValue(le.target.value,function(){Ae.resizableTextArea.resizeTextarea()}),Ee&&Ee(le)},Ae.handleKeyDown=function(le){var Ee=Ae.props,pe=Ee.onPressEnter,Ge=Ee.onKeyDown;le.keyCode===13&&pe&&pe(le),Ge&&Ge(le)};var _e=typeof Ke.value=="undefined"||Ke.value===null?Ke.defaultValue:Ke.value;return Ae.state={value:_e},Ae}return Object(I.a)(Be,[{key:"setValue",value:function(Ae,_e){"value"in this.props||this.setState({value:Ae},_e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return f.createElement(ce,Object(V.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ae){return"value"in Ae?{value:Ae.value}:null}}]),Be}(f.Component),Fe=fe.default=be},YJ9k:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E<f.length;E++){var x=f[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(M,x.key,x)}}function I(M,f,E){return f&&L(M.prototype,f),E&&L(M,E),M}var k=function(){function M(){V(this,M),this._listeners=new Map}return I(M,[{key:"addEventListener",value:function(E,x){this._listeners.has(E)||this._listeners.set(E,new Set),this._listeners.get(E).add(x)}},{key:"removeEventListener",value:function(E,x){this._listeners.has(E)&&this._listeners.get(E).delete(x)}},{key:"dispatchEvent",value:function(E){var x=this;return this._listeners.has(E.type)?(this._listeners.get(E.type).forEach(function(g){return g.call(x,E)}),!E.defaultPrevented):!0}}]),M}();fe.default=k},ZW9T:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return X});var V=oe("k1fw"),L=oe("miYZ"),I=oe("tsqr"),k=oe("rAM+"),M=oe("tJVT"),f=oe("PpiC"),E=oe("q1tI"),x=oe.n(E),g=oe("bdgK"),h=oe("oBTY"),o=oe("9og8"),u=oe("WmNS"),r=oe.n(u),n={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},t={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},i={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},l=oe("5VLF"),c=oe.n(l),d={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},w=function(N,z){return z.map(function(te){return{label:te,kind:N.languages.CompletionItemKind.Keyword,insertText:te}})},m=function(N){return Object.keys(d.tables).map(function(z){return{label:z,kind:N.languages.CompletionItemKind.Variable,insertText:z}})},S=function(N,z){var te=d.tables[N];return te?te.map(function(ce){return{label:ce,kind:z.languages.CompletionItemKind.Field,insertText:ce}}):[]};function C(B,N,z,te,ce){var be=N.getWordUntilPosition(z),Fe={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:be.startColumn,endColumn:be.endColumn},Oe=te.map(function(Re){return{label:Re,kind:B.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}});return ce.map(function(Re){Oe.push(Object(V.a)(Object(V.a)({},Re),{},{range:Fe}))}),Oe}var v=function(B){d.languages.map(function(ce){return B.languages.registerDocumentFormattingEditProvider(ce,{provideDocumentFormattingEdits:function(Fe,Oe,Re){return Object(o.a)(r.a.mark(function Be(){var Ke;return r.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return Ke=c()(Fe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),_e.abrupt("return",[{range:Fe.getFullModelRange(),text:Ke}]);case 2:case"end":return _e.stop()}},Be)}))()}}),ce});var N=i.quickKey.map(function(ce){return{label:ce.label,kind:B.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=s.quickKey.map(function(ce){return{label:ce.label,kind:B.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=t.quickKey.map(function(ce){return{label:ce.label,kind:B.languages.CompletionItemKind.Method,insertText:ce.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(h.a)(i.keywords),Object(h.a)(i.quickKey.map(function(ce){return ce.label}))),provideCompletionItems:function(be,Fe){var Oe=be.getValueInRange({startLineNumber:Fe.lineNumber,startColumn:1,endLineNumber:Fe.lineNumber,endColumn:Fe.column}),Re=Oe.match(/cu/gim);console.log("match:",Re,Fe,Oe,be);var Be=[],Ke=Fe.lineNumber,Ae=Fe.column,_e=be.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:Ae}),le=_e.trim().split(/\s+/),Ee=le[le.length-1];if(Ee.endsWith(".")){var pe=Ee.slice(0,Ee.length-1);Object.keys(d.tables).includes(pe)&&(Be=Object(h.a)(S(pe,B)))}else Ee==="."?Be=[]:Be=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,i.keywords)),Object(h.a)(N));return{suggestions:Be}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(h.a)(n.keywords)),provideCompletionItems:function(be,Fe){var Oe=be.getValueInRange({startLineNumber:Fe.lineNumber,startColumn:1,endLineNumber:Fe.lineNumber,endColumn:Fe.column}),Re=Oe.match(/cu/gim);console.log("match:",Re,Fe,Oe,be);var Be=[],Ke=Fe.lineNumber,Ae=Fe.column,_e=be.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:Ae}),le=_e.trim().split(/\s+/),Ee=le[le.length-1];if(Ee.endsWith(".")){var pe=Ee.slice(0,Ee.length-1);Object.keys(d.tables).includes(pe)&&(Be=Object(h.a)(S(pe,B)))}else Ee==="."?Be=[]:Be=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,n.keywords)));return{suggestions:Be}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(h.a)(t.keywords)),provideCompletionItems:function(be,Fe){var Oe=[],Re=Fe.lineNumber,Be=Fe.column,Ke=be.getValueInRange({startLineNumber:Re,startColumn:0,endLineNumber:Re,endColumn:Be}),Ae=Ke.trim().split(/\s+/),_e=Ae[Ae.length-1];if(_e.endsWith(".")){var le=_e.slice(0,_e.length-1);Object.keys(d.tables).includes(le)&&(Oe=Object(h.a)(S(le,B)))}else _e==="."?Oe=[]:Oe=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,t.keywords)),Object(h.a)(te));return{suggestions:Oe}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(h.a)(s.keywords)),provideCompletionItems:function(be,Fe){var Oe=[],Re=Fe.lineNumber,Be=Fe.column,Ke=be.getValueInRange({startLineNumber:Re,startColumn:0,endLineNumber:Re,endColumn:Be}),Ae=Ke.trim().split(/\s+/),_e=Ae[Ae.length-1];if(_e.endsWith(".")){var le=_e.slice(0,_e.length-1);Object.keys(d.tables).includes(le)&&(Oe=Object(h.a)(S(le,B)))}else _e==="."?Oe=[]:Oe=[].concat(Object(h.a)(m(B)),Object(h.a)(w(B,s.keywords)),Object(h.a)(z));return{suggestions:Oe}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=oe("LvDl"),A=oe("+ua5");function p(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function D(){}var O=!1,P={"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 j(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],N=B;if(Array.isArray(B)){for(var z=0;z<B.length;z++){var te=P[B[z]];if(te)return te}return N[0]}return P[N]||N}var K=null,U=fe.b=function(B){var N=B.width,z=N===void 0?"100%":N,te=B.height,ce=te===void 0?"100%":te,be=B.value,Fe=B.language,Oe=Fe===void 0?"javascript":Fe,Re=B.style,Be=Re===void 0?{}:Re,Ke=B.options,Ae=Ke===void 0?{}:Ke,_e=B.overrideServices,le=_e===void 0?{}:_e,Ee=B.theme,pe=Ee===void 0?"vs-dark":Ee,Ge=B.onEditBlur,Ye=B.onSave,ze=B.autoHeight,Ze=ze===void 0?!1:ze,Je=B.forbidCopy,$e=Je===void 0?!1:Je,He=B.onChange,Ue=He===void 0?D:He,Pe=B.editorDidMount,ke=Pe===void 0?D:Pe,re=B.onFocus,ve=re===void 0?D:re,ae=B.filename,De=ae===void 0?"educoder.txt":ae,qe=B.errorLine,et=B.errorContent,je=et===void 0?"":et,ct=Object(f.a)(B,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),he=Object(E.useRef)(),Te=Object(E.useRef)({}),We=Object(E.useRef)(),xe=Object(E.useRef)(!1),ge=Object(E.useRef)(),ye=Object(E.useState)(!1),J=Object(M.a)(ye,2),ne=J[0],q=J[1];function me(){var nt;return he.current&&(nt=new g.default(function(Tt){var It=Object(k.a)(Tt),wt;try{for(It.s();!(wt=It.n()).done;){var Ft=wt.value;(Ft.target.offsetHeight>0||Ft.target.offsetWidth>0)&&Te.current.instance.layout()}}catch(zt){It.e(zt)}finally{It.f()}}),nt.observe(he.current)),nt}function Ce(){I.b.warn(decodeURIComponent(y))}var G=function(){var Tt=Te.current.instance;if(be!=null&&Tt&&ne){var It=Tt.getModel();It&&be!==It.getValue()&&(O=!0,It.setValue(be),Tt.layout(),O=!1)}};Object(E.useEffect)(function(){We.current&&clearTimeout(We.current),We.current=setTimeout(function(){G()},500)},[be,ne,Te.current]),Object(E.useEffect)(function(){if(qe&&Te.current&&Te.current.instance){var nt=Te.current.instance;nt.changeViewZones(function(It){var wt=document.createElement("div");wt.style.padding="10px 20px",wt.style.width="calc(100% - 20px)",wt.className="my-error-line-wrp",wt.innerHTML=je,It.addZone({afterLineNumber:qe||11,heightInLines:3,domNode:wt})});var Tt={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}};nt.addOverlayWidget(Tt),nt.revealPositionInCenter({lineNumber:20,column:1})}},[qe,Te.current,ne]);function we(){var nt=Te.current.instance;if(nt){var Tt=nt.getSelection(),It=Te.current.pastePos||{},wt=new K.Range(It.startLineNumber||Tt.endLineNumber,It.startColumn||Tt.endColumn,It.endLineNumber||Tt.endLineNumber,It.endColumn||Tt.endColumn);setTimeout(function(){nt.executeEdits("",[{range:wt,text:""}])},300)}}function Ne(nt){(window.navigator.platform.match("Mac")?nt.metaKey:nt.ctrlKey)&&nt.keyCode==83&&(nt.preventDefault(),Ye())}var de=function(){if(Ze&&Te.current.instance){var Tt=Te.current.instance.getContentHeight();kt(Tt<ce?ce:Tt)}else kt(ce)};function Se(nt){var Tt=document.createEvent("MouseEvents");Tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),nt.dispatchEvent(Tt)}function Xe(nt,Tt){var It=window.URL||window.webkitURL||window,wt=new Blob([Tt]),Ft=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ft.href=It.createObjectURL(wt),Ft.download=nt,Se(Ft)}Object(E.useEffect)(function(){de()},[de]),Object(E.useEffect)(function(){he.current&&!ne&&oe.e(27).then(oe.t.bind(null,"M/lh",7)).then(function(nt){try{K=nt,Te.current.instance=K.editor.create(he.current,{value:be,language:j(Oe),theme:pe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},le);var Tt=Te.current.instance;if(ke(Tt,K),setTimeout(function(){de(),Te.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Xe(De||"educoder.txt",Tt.getValue())}})},500),Te.current.subscription=Tt.onDidChangeModelContent(function(wt){xe.current?clearTimeout(ge.current):(de(),Ue(Tt.getValue(),wt)),ge.current=setTimeout(function(){xe.current=!1},500)}),window.Monaco||v(K),$e&&(Tt.addCommand(K.KeyMod.CtrlCmd|K.KeyMod.Shift|K.KeyCode.KEY_V,function(){return Ce(),null}),Tt.addCommand(K.KeyMod.CtrlCmd|K.KeyCode.KEY_C,function(){return Ce(),null})),window.Monaco=K,Ge&&Tt.onDidBlurEditorWidget(function(){Ge(Tt.getValue())}),ve&&Tt.onDidFocusEditorText(function(){ve(Tt.getValue())}),$e){Tt.addCommand(K.KeyMod.CtrlCmd|K.KeyCode.KEY_V,function(){return Ce(),null}),Tt.onDidPaste(function(wt){Te.current.pastePos=wt});try{window.addEventListener("paste",we)}catch(wt){}}var It=me();return q(!0),function(){var wt=Te.current.instance;wt.dispose();var Ft=wt.getModel();Ft&&Ft.dispose(),Te.current.subscription&&Te.current.subscription.dispose(),$e&&window.removeEventListener("paste",we),It.unobserve(he.current)}}catch(wt){}})},[]),Object(E.useEffect)(function(){var nt=Te.current.instance;if(nt&&ne)return document.addEventListener("keydown",Ne,!1),function(){document.removeEventListener("keydown",Ne)}},[Ye,ne]),Object(E.useEffect)(function(){var nt=Te.current.instance;if(nt&&ne){var Tt=j(Oe);K.editor.setModelLanguage(nt.getModel(),Tt),console.log("language:",Oe,nt.getModel(),Tt)}},[Oe,ne]),Object(E.useEffect)(function(){var nt=Te.current.instance;nt&&ne&&K.editor.setTheme(pe)},[pe,ne]),Object(E.useEffect)(function(){var nt=Te.current.instance;nt&&ne&&(nt.updateOptions(Object(V.a)({},Ae)),setTimeout(function(){nt.getModel().updateOptions(Object(V.a)({},Ae))},200))},[JSON.stringify(Ae),ne]),Object(E.useEffect)(function(){var nt=Te.current.instance;nt&&ne&&nt.layout()},[z,ce,ne]);var lt=Object(E.useState)(p(z)),tt=Object(M.a)(lt,2),st=tt[0],mt=tt[1],Ct=Object(E.useState)(p(ce)),_t=Object(M.a)(Ct,2),ft=_t[0],kt=_t[1],Nt=Object(V.a)(Object(V.a)({},Be),{},{width:st,height:ft});return x.a.createElement("div",{className:"my-monaco-editor",ref:he,style:Nt})};function X(B){var N=B.width,z=N===void 0?"100%":N,te=B.height,ce=te===void 0?"100%":te,be=B.original,Fe=B.modified,Oe=B.language,Re=B.options,Be=Re===void 0?{}:Re,Ke=Object(E.useRef)(),Ae=Object(E.useState)(null),_e=Object(M.a)(Ae,2),le=_e[0],Ee=_e[1];function pe(Ze){var Je;return Ke.current&&(Je=new g.default(function($e){var He=Object(k.a)($e),Ue;try{for(He.s();!(Ue=He.n()).done;){var Pe=Ue.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&Ze.layout()}}catch(ke){He.e(ke)}finally{He.f()}}),Je.observe(Ke.current)),Je}Object(E.useEffect)(function(){Ke.current&&oe.e(27).then(oe.t.bind(null,"M/lh",7)).then(function(Ze){K=Ze;var Je=K.editor.createDiffEditor(Ke.current,Object(V.a)(Object(V.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},Be),{},{wordWrap:!0}));Ee(Je);var $e=pe(Je);return function(){Je.dispose();var He=Je.getModel();He&&He.dispose(),$e.unobserve(Ke.current)}})},[]),Object(E.useEffect)(function(){le&&le.setModel({original:K.editor.createModel(be,Oe),modified:K.editor.createModel(Fe,Oe)})},[be,Fe,Oe,le]);var Ge=p(z),Ye=p(ce),ze={width:Ge,height:Ye};return x.a.createElement("div",{className:"my-diff-editor",ref:Ke,style:ze})}},ZpRC:function(at,fe,oe){"use strict";function V(o){return typeof o=="object"&&o!=null&&o.nodeType===1}function L(o,u){return(!u||o!=="hidden")&&o!=="visible"&&o!=="clip"}function I(o,u){if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){var r=getComputedStyle(o,null);return L(r.overflowY,u)||L(r.overflowX,u)||function(n){var t=function(i){if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch(s){return null}}(n);return!!t&&(t.clientHeight<n.scrollHeight||t.clientWidth<n.scrollWidth)}(o)}return!1}function k(o,u,r,n,t,i,s,l){return i<o&&s>u||i>o&&s<u?0:i<=o&&l<=r||s>=u&&l>=r?i-o-n:s>u&&l<r||i<o&&l>r?s-u+t:0}var M=function(o,u){var r=window,n=u.scrollMode,t=u.block,i=u.inline,s=u.boundary,l=u.skipOverflowHiddenElements,c=typeof s=="function"?s:function(Je){return Je!==s};if(!V(o))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,w=[],m=o;V(m)&&c(m);){if((m=m.parentElement)===d){w.push(m);break}m!=null&&m===document.body&&I(m)&&!I(document.documentElement)||m!=null&&I(m,l)&&w.push(m)}for(var S=r.visualViewport?r.visualViewport.width:innerWidth,C=r.visualViewport?r.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,T=o.getBoundingClientRect(),A=T.height,p=T.width,D=T.top,O=T.right,P=T.bottom,j=T.left,K=t==="start"||t==="nearest"?D:t==="end"?P:D+A/2,U=i==="center"?j+p/2:i==="end"?O:j,X=[],B=0;B<w.length;B++){var N=w[B],z=N.getBoundingClientRect(),te=z.height,ce=z.width,be=z.top,Fe=z.right,Oe=z.bottom,Re=z.left;if(n==="if-needed"&&D>=0&&j>=0&&P<=C&&O<=S&&D>=be&&P<=Oe&&j>=Re&&O<=Fe)return X;var Be=getComputedStyle(N),Ke=parseInt(Be.borderLeftWidth,10),Ae=parseInt(Be.borderTopWidth,10),_e=parseInt(Be.borderRightWidth,10),le=parseInt(Be.borderBottomWidth,10),Ee=0,pe=0,Ge="offsetWidth"in N?N.offsetWidth-N.clientWidth-Ke-_e:0,Ye="offsetHeight"in N?N.offsetHeight-N.clientHeight-Ae-le:0;if(d===N)Ee=t==="start"?K:t==="end"?K-C:t==="nearest"?k(y,y+C,C,Ae,le,y+K,y+K+A,A):K-C/2,pe=i==="start"?U:i==="center"?U-S/2:i==="end"?U-S:k(v,v+S,S,Ke,_e,v+U,v+U+p,p),Ee=Math.max(0,Ee+y),pe=Math.max(0,pe+v);else{Ee=t==="start"?K-be-Ae:t==="end"?K-Oe+le+Ye:t==="nearest"?k(be,Oe,te,Ae,le+Ye,K,K+A,A):K-(be+te/2)+Ye/2,pe=i==="start"?U-Re-Ke:i==="center"?U-(Re+ce/2)+Ge/2:i==="end"?U-Fe+_e+Ge:k(Re,Fe,ce,Ke,_e+Ge,U,U+p,p);var ze=N.scrollLeft,Ze=N.scrollTop;K+=Ze-(Ee=Math.max(0,Math.min(Ze+Ee,N.scrollHeight-te+Ye))),U+=ze-(pe=Math.max(0,Math.min(ze+pe,N.scrollWidth-ce+Ge)))}X.push({el:N,top:Ee,left:pe})}return X};function f(o){return o===Object(o)&&Object.keys(o).length!==0}function E(o,u){u===void 0&&(u="auto");var r="scrollBehavior"in document.body.style;o.forEach(function(n){var t=n.el,i=n.top,s=n.left;t.scroll&&r?t.scroll({top:i,left:s,behavior:u}):(t.scrollTop=i,t.scrollLeft=s)})}function x(o){return o===!1?{block:"end",inline:"nearest"}:f(o)?o:{block:"start",inline:"nearest"}}function g(o,u){var r=!o.ownerDocument.documentElement.contains(o);if(f(u)&&typeof u.behavior=="function")return u.behavior(r?[]:M(o,u));if(r)return;var n=x(u);return E(M(o,n),n.behavior)}var h=fe.a=g},Zss7:function(at,fe,oe){var V;(function(L){var I=/^\s+/,k=/\s+$/,M=0,f=L.round,E=L.min,x=L.max,g=L.random;function h(le,Ee){if(le=le||"",Ee=Ee||{},le instanceof h)return le;if(!(this instanceof h))return new h(le,Ee);var pe=o(le);this._originalInput=le,this._r=pe.r,this._g=pe.g,this._b=pe.b,this._a=pe.a,this._roundA=f(100*this._a)/100,this._format=Ee.format||pe.format,this._gradientType=Ee.gradientType,this._r<1&&(this._r=f(this._r)),this._g<1&&(this._g=f(this._g)),this._b<1&&(this._b=f(this._b)),this._ok=pe.ok,this._tc_id=M++}h.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 le=this.toRgb();return(le.r*299+le.g*587+le.b*114)/1e3},getLuminance:function(){var le=this.toRgb(),Ee,pe,Ge,Ye,ze,Ze;return Ee=le.r/255,pe=le.g/255,Ge=le.b/255,Ee<=.03928?Ye=Ee/12.92:Ye=L.pow((Ee+.055)/1.055,2.4),pe<=.03928?ze=pe/12.92:ze=L.pow((pe+.055)/1.055,2.4),Ge<=.03928?Ze=Ge/12.92:Ze=L.pow((Ge+.055)/1.055,2.4),.2126*Ye+.7152*ze+.0722*Ze},setAlpha:function(le){return this._a=X(le),this._roundA=f(100*this._a)/100,this},toHsv:function(){var le=t(this._r,this._g,this._b);return{h:le.h*360,s:le.s,v:le.v,a:this._a}},toHsvString:function(){var le=t(this._r,this._g,this._b),Ee=f(le.h*360),pe=f(le.s*100),Ge=f(le.v*100);return this._a==1?"hsv("+Ee+", "+pe+"%, "+Ge+"%)":"hsva("+Ee+", "+pe+"%, "+Ge+"%, "+this._roundA+")"},toHsl:function(){var le=r(this._r,this._g,this._b);return{h:le.h*360,s:le.s,l:le.l,a:this._a}},toHslString:function(){var le=r(this._r,this._g,this._b),Ee=f(le.h*360),pe=f(le.s*100),Ge=f(le.l*100);return this._a==1?"hsl("+Ee+", "+pe+"%, "+Ge+"%)":"hsla("+Ee+", "+pe+"%, "+Ge+"%, "+this._roundA+")"},toHex:function(le){return s(this._r,this._g,this._b,le)},toHexString:function(le){return"#"+this.toHex(le)},toHex8:function(le){return l(this._r,this._g,this._b,this._a,le)},toHex8String:function(le){return"#"+this.toHex8(le)},toRgb:function(){return{r:f(this._r),g:f(this._g),b:f(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+f(this._r)+", "+f(this._g)+", "+f(this._b)+")":"rgba("+f(this._r)+", "+f(this._g)+", "+f(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:f(B(this._r,255)*100)+"%",g:f(B(this._g,255)*100)+"%",b:f(B(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+f(B(this._r,255)*100)+"%, "+f(B(this._g,255)*100)+"%, "+f(B(this._b,255)*100)+"%)":"rgba("+f(B(this._r,255)*100)+"%, "+f(B(this._g,255)*100)+"%, "+f(B(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:K[s(this._r,this._g,this._b,!0)]||!1},toFilter:function(le){var Ee="#"+c(this._r,this._g,this._b,this._a),pe=Ee,Ge=this._gradientType?"GradientType = 1, ":"";if(le){var Ye=h(le);pe="#"+c(Ye._r,Ye._g,Ye._b,Ye._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ge+"startColorstr="+Ee+",endColorstr="+pe+")"},toString:function(le){var Ee=!!le;le=le||this._format;var pe=!1,Ge=this._a<1&&this._a>=0,Ye=!Ee&&Ge&&(le==="hex"||le==="hex6"||le==="hex3"||le==="hex4"||le==="hex8"||le==="name");return Ye?le==="name"&&this._a===0?this.toName():this.toRgbString():(le==="rgb"&&(pe=this.toRgbString()),le==="prgb"&&(pe=this.toPercentageRgbString()),(le==="hex"||le==="hex6")&&(pe=this.toHexString()),le==="hex3"&&(pe=this.toHexString(!0)),le==="hex4"&&(pe=this.toHex8String(!0)),le==="hex8"&&(pe=this.toHex8String()),le==="name"&&(pe=this.toName()),le==="hsl"&&(pe=this.toHslString()),le==="hsv"&&(pe=this.toHsvString()),pe||this.toHexString())},clone:function(){return h(this.toString())},_applyModification:function(le,Ee){var pe=le.apply(null,[this].concat([].slice.call(Ee)));return this._r=pe._r,this._g=pe._g,this._b=pe._b,this.setAlpha(pe._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(C,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(le,Ee){return le.apply(null,[this].concat([].slice.call(Ee)))},analogous:function(){return this._applyCombination(O,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(D,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(p,arguments)}},h.fromRatio=function(le,Ee){if(typeof le=="object"){var pe={};for(var Ge in le)le.hasOwnProperty(Ge)&&(Ge==="a"?pe[Ge]=le[Ge]:pe[Ge]=Fe(le[Ge]));le=pe}return h(le,Ee)};function o(le){var Ee={r:0,g:0,b:0},pe=1,Ge=null,Ye=null,ze=null,Ze=!1,Je=!1;return typeof le=="string"&&(le=Ae(le)),typeof le=="object"&&(Ke(le.r)&&Ke(le.g)&&Ke(le.b)?(Ee=u(le.r,le.g,le.b),Ze=!0,Je=String(le.r).substr(-1)==="%"?"prgb":"rgb"):Ke(le.h)&&Ke(le.s)&&Ke(le.v)?(Ge=Fe(le.s),Ye=Fe(le.v),Ee=i(le.h,Ge,Ye),Ze=!0,Je="hsv"):Ke(le.h)&&Ke(le.s)&&Ke(le.l)&&(Ge=Fe(le.s),ze=Fe(le.l),Ee=n(le.h,Ge,ze),Ze=!0,Je="hsl"),le.hasOwnProperty("a")&&(pe=le.a)),pe=X(pe),{ok:Ze,format:le.format||Je,r:E(255,x(Ee.r,0)),g:E(255,x(Ee.g,0)),b:E(255,x(Ee.b,0)),a:pe}}function u(le,Ee,pe){return{r:B(le,255)*255,g:B(Ee,255)*255,b:B(pe,255)*255}}function r(le,Ee,pe){le=B(le,255),Ee=B(Ee,255),pe=B(pe,255);var Ge=x(le,Ee,pe),Ye=E(le,Ee,pe),ze,Ze,Je=(Ge+Ye)/2;if(Ge==Ye)ze=Ze=0;else{var $e=Ge-Ye;Ze=Je>.5?$e/(2-Ge-Ye):$e/(Ge+Ye);switch(Ge){case le:ze=(Ee-pe)/$e+(Ee<pe?6:0);break;case Ee:ze=(pe-le)/$e+2;break;case pe:ze=(le-Ee)/$e+4;break}ze/=6}return{h:ze,s:Ze,l:Je}}function n(le,Ee,pe){var Ge,Ye,ze;le=B(le,360),Ee=B(Ee,100),pe=B(pe,100);function Ze(He,Ue,Pe){return Pe<0&&(Pe+=1),Pe>1&&(Pe-=1),Pe<1/6?He+(Ue-He)*6*Pe:Pe<1/2?Ue:Pe<2/3?He+(Ue-He)*(2/3-Pe)*6:He}if(Ee===0)Ge=Ye=ze=pe;else{var Je=pe<.5?pe*(1+Ee):pe+Ee-pe*Ee,$e=2*pe-Je;Ge=Ze($e,Je,le+1/3),Ye=Ze($e,Je,le),ze=Ze($e,Je,le-1/3)}return{r:Ge*255,g:Ye*255,b:ze*255}}function t(le,Ee,pe){le=B(le,255),Ee=B(Ee,255),pe=B(pe,255);var Ge=x(le,Ee,pe),Ye=E(le,Ee,pe),ze,Ze,Je=Ge,$e=Ge-Ye;if(Ze=Ge===0?0:$e/Ge,Ge==Ye)ze=0;else{switch(Ge){case le:ze=(Ee-pe)/$e+(Ee<pe?6:0);break;case Ee:ze=(pe-le)/$e+2;break;case pe:ze=(le-Ee)/$e+4;break}ze/=6}return{h:ze,s:Ze,v:Je}}function i(le,Ee,pe){le=B(le,360)*6,Ee=B(Ee,100),pe=B(pe,100);var Ge=L.floor(le),Ye=le-Ge,ze=pe*(1-Ee),Ze=pe*(1-Ye*Ee),Je=pe*(1-(1-Ye)*Ee),$e=Ge%6,He=[pe,Ze,ze,ze,Je,pe][$e],Ue=[Je,pe,pe,Ze,ze,ze][$e],Pe=[ze,ze,Je,pe,pe,Ze][$e];return{r:He*255,g:Ue*255,b:Pe*255}}function s(le,Ee,pe,Ge){var Ye=[be(f(le).toString(16)),be(f(Ee).toString(16)),be(f(pe).toString(16))];return Ge&&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[0].charAt(0)+Ye[1].charAt(0)+Ye[2].charAt(0):Ye.join("")}function l(le,Ee,pe,Ge,Ye){var ze=[be(f(le).toString(16)),be(f(Ee).toString(16)),be(f(pe).toString(16)),be(Oe(Ge))];return Ye&&ze[0].charAt(0)==ze[0].charAt(1)&&ze[1].charAt(0)==ze[1].charAt(1)&&ze[2].charAt(0)==ze[2].charAt(1)&&ze[3].charAt(0)==ze[3].charAt(1)?ze[0].charAt(0)+ze[1].charAt(0)+ze[2].charAt(0)+ze[3].charAt(0):ze.join("")}function c(le,Ee,pe,Ge){var Ye=[be(Oe(Ge)),be(f(le).toString(16)),be(f(Ee).toString(16)),be(f(pe).toString(16))];return Ye.join("")}h.equals=function(le,Ee){return!le||!Ee?!1:h(le).toRgbString()==h(Ee).toRgbString()},h.random=function(){return h.fromRatio({r:g(),g:g(),b:g()})};function d(le,Ee){Ee=Ee===0?0:Ee||10;var pe=h(le).toHsl();return pe.s-=Ee/100,pe.s=N(pe.s),h(pe)}function w(le,Ee){Ee=Ee===0?0:Ee||10;var pe=h(le).toHsl();return pe.s+=Ee/100,pe.s=N(pe.s),h(pe)}function m(le){return h(le).desaturate(100)}function S(le,Ee){Ee=Ee===0?0:Ee||10;var pe=h(le).toHsl();return pe.l+=Ee/100,pe.l=N(pe.l),h(pe)}function C(le,Ee){Ee=Ee===0?0:Ee||10;var pe=h(le).toRgb();return pe.r=x(0,E(255,pe.r-f(255*-(Ee/100)))),pe.g=x(0,E(255,pe.g-f(255*-(Ee/100)))),pe.b=x(0,E(255,pe.b-f(255*-(Ee/100)))),h(pe)}function v(le,Ee){Ee=Ee===0?0:Ee||10;var pe=h(le).toHsl();return pe.l-=Ee/100,pe.l=N(pe.l),h(pe)}function y(le,Ee){var pe=h(le).toHsl(),Ge=(pe.h+Ee)%360;return pe.h=Ge<0?360+Ge:Ge,h(pe)}function T(le){var Ee=h(le).toHsl();return Ee.h=(Ee.h+180)%360,h(Ee)}function A(le){var Ee=h(le).toHsl(),pe=Ee.h;return[h(le),h({h:(pe+120)%360,s:Ee.s,l:Ee.l}),h({h:(pe+240)%360,s:Ee.s,l:Ee.l})]}function p(le){var Ee=h(le).toHsl(),pe=Ee.h;return[h(le),h({h:(pe+90)%360,s:Ee.s,l:Ee.l}),h({h:(pe+180)%360,s:Ee.s,l:Ee.l}),h({h:(pe+270)%360,s:Ee.s,l:Ee.l})]}function D(le){var Ee=h(le).toHsl(),pe=Ee.h;return[h(le),h({h:(pe+72)%360,s:Ee.s,l:Ee.l}),h({h:(pe+216)%360,s:Ee.s,l:Ee.l})]}function O(le,Ee,pe){Ee=Ee||6,pe=pe||30;var Ge=h(le).toHsl(),Ye=360/pe,ze=[h(le)];for(Ge.h=(Ge.h-(Ye*Ee>>1)+720)%360;--Ee;)Ge.h=(Ge.h+Ye)%360,ze.push(h(Ge));return ze}function P(le,Ee){Ee=Ee||6;for(var pe=h(le).toHsv(),Ge=pe.h,Ye=pe.s,ze=pe.v,Ze=[],Je=1/Ee;Ee--;)Ze.push(h({h:Ge,s:Ye,v:ze})),ze=(ze+Je)%1;return Ze}h.mix=function(le,Ee,pe){pe=pe===0?0:pe||50;var Ge=h(le).toRgb(),Ye=h(Ee).toRgb(),ze=pe/100,Ze={r:(Ye.r-Ge.r)*ze+Ge.r,g:(Ye.g-Ge.g)*ze+Ge.g,b:(Ye.b-Ge.b)*ze+Ge.b,a:(Ye.a-Ge.a)*ze+Ge.a};return h(Ze)},h.readability=function(le,Ee){var pe=h(le),Ge=h(Ee);return(L.max(pe.getLuminance(),Ge.getLuminance())+.05)/(L.min(pe.getLuminance(),Ge.getLuminance())+.05)},h.isReadable=function(le,Ee,pe){var Ge=h.readability(le,Ee),Ye,ze;ze=!1,Ye=_e(pe);switch(Ye.level+Ye.size){case"AAsmall":case"AAAlarge":ze=Ge>=4.5;break;case"AAlarge":ze=Ge>=3;break;case"AAAsmall":ze=Ge>=7;break}return ze},h.mostReadable=function(le,Ee,pe){var Ge=null,Ye=0,ze,Ze,Je,$e;pe=pe||{},Ze=pe.includeFallbackColors,Je=pe.level,$e=pe.size;for(var He=0;He<Ee.length;He++)ze=h.readability(le,Ee[He]),ze>Ye&&(Ye=ze,Ge=h(Ee[He]));return h.isReadable(le,Ge,{level:Je,size:$e})||!Ze?Ge:(pe.includeFallbackColors=!1,h.mostReadable(le,["#fff","#000"],pe))};var j=h.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"},K=h.hexNames=U(j);function U(le){var Ee={};for(var pe in le)le.hasOwnProperty(pe)&&(Ee[le[pe]]=pe);return Ee}function X(le){return le=parseFloat(le),(isNaN(le)||le<0||le>1)&&(le=1),le}function B(le,Ee){te(le)&&(le="100%");var pe=ce(le);return le=E(Ee,x(0,parseFloat(le))),pe&&(le=parseInt(le*Ee,10)/100),L.abs(le-Ee)<1e-6?1:le%Ee/parseFloat(Ee)}function N(le){return E(1,x(0,le))}function z(le){return parseInt(le,16)}function te(le){return typeof le=="string"&&le.indexOf(".")!=-1&&parseFloat(le)===1}function ce(le){return typeof le=="string"&&le.indexOf("%")!=-1}function be(le){return le.length==1?"0"+le:""+le}function Fe(le){return le<=1&&(le=le*100+"%"),le}function Oe(le){return L.round(parseFloat(le)*255).toString(16)}function Re(le){return z(le)/255}var Be=function(){var le="[-\\+]?\\d+%?",Ee="[-\\+]?\\d*\\.\\d+%?",pe="(?:"+Ee+")|(?:"+le+")",Ge="[\\s|\\(]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")\\s*\\)?",Ye="[\\s|\\(]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")[,|\\s]+("+pe+")\\s*\\)?";return{CSS_UNIT:new RegExp(pe),rgb:new RegExp("rgb"+Ge),rgba:new RegExp("rgba"+Ye),hsl:new RegExp("hsl"+Ge),hsla:new RegExp("hsla"+Ye),hsv:new RegExp("hsv"+Ge),hsva:new RegExp("hsva"+Ye),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 Ke(le){return!!Be.CSS_UNIT.exec(le)}function Ae(le){le=le.replace(I,"").replace(k,"").toLowerCase();var Ee=!1;if(j[le])le=j[le],Ee=!0;else if(le=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var pe;return(pe=Be.rgb.exec(le))?{r:pe[1],g:pe[2],b:pe[3]}:(pe=Be.rgba.exec(le))?{r:pe[1],g:pe[2],b:pe[3],a:pe[4]}:(pe=Be.hsl.exec(le))?{h:pe[1],s:pe[2],l:pe[3]}:(pe=Be.hsla.exec(le))?{h:pe[1],s:pe[2],l:pe[3],a:pe[4]}:(pe=Be.hsv.exec(le))?{h:pe[1],s:pe[2],v:pe[3]}:(pe=Be.hsva.exec(le))?{h:pe[1],s:pe[2],v:pe[3],a:pe[4]}:(pe=Be.hex8.exec(le))?{r:z(pe[1]),g:z(pe[2]),b:z(pe[3]),a:Re(pe[4]),format:Ee?"name":"hex8"}:(pe=Be.hex6.exec(le))?{r:z(pe[1]),g:z(pe[2]),b:z(pe[3]),format:Ee?"name":"hex"}:(pe=Be.hex4.exec(le))?{r:z(pe[1]+""+pe[1]),g:z(pe[2]+""+pe[2]),b:z(pe[3]+""+pe[3]),a:Re(pe[4]+""+pe[4]),format:Ee?"name":"hex8"}:(pe=Be.hex3.exec(le))?{r:z(pe[1]+""+pe[1]),g:z(pe[2]+""+pe[2]),b:z(pe[3]+""+pe[3]),format:Ee?"name":"hex"}:!1}function _e(le){var Ee,pe;return le=le||{level:"AA",size:"small"},Ee=(le.level||"AA").toUpperCase(),pe=(le.size||"small").toLowerCase(),Ee!=="AA"&&Ee!=="AAA"&&(Ee="AA"),pe!=="small"&&pe!=="large"&&(pe="small"),{level:Ee,size:pe}}at.exports?at.exports=h:!(V=function(){return h}.call(fe,oe,fe,at),V!==void 0&&(at.exports=V))})(Math)},bT9E:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return L});var V=oe("VTBJ");function L(I,k){var M=Object(V.a)({},I);return Array.isArray(k)&&k.forEach(function(f){delete M[f]}),M}},c5Ni:function(at,fe,oe){},c5fP:function(at,fe,oe){"use strict";function V(he){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(We){return typeof We}:V=function(We){return We&&typeof Symbol=="function"&&We.constructor===Symbol&&We!==Symbol.prototype?"symbol":typeof We},V(he)}Object.defineProperty(fe,"__esModule",{value:!0}),fe._tr_init=De,fe._tr_stored_block=qe,fe._tr_flush_block=je,fe._tr_tally=ct,fe._tr_align=et;var L=k(oe("6BzB"));function I(){if(typeof WeakMap!="function")return null;var he=new WeakMap;return I=function(){return he},he}function k(he){if(he&&he.__esModule)return he;if(he===null||V(he)!=="object"&&typeof he!="function")return{default:he};var Te=I();if(Te&&Te.has(he))return Te.get(he);var We={},xe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ge in he)if(Object.prototype.hasOwnProperty.call(he,ge)){var ye=xe?Object.getOwnPropertyDescriptor(he,ge):null;ye&&(ye.get||ye.set)?Object.defineProperty(We,ge,ye):We[ge]=he[ge]}return We.default=he,Te&&Te.set(he,We),We}var M=4,f=0,E=1,x=2;function g(he){for(var Te=he.length;--Te>=0;)he[Te]=0}var h=0,o=1,u=2,r=3,n=258,t=29,i=256,s=i+1+t,l=30,c=19,d=2*s+1,w=15,m=16,S=7,C=256,v=16,y=17,T=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],p=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=512,j=new Array((s+2)*2);g(j);var K=new Array(l*2);g(K);var U=new Array(P);g(U);var X=new Array(n-r+1);g(X);var B=new Array(t);g(B);var N=new Array(l);g(N);function z(he,Te,We,xe,ge){this.static_tree=he,this.extra_bits=Te,this.extra_base=We,this.elems=xe,this.max_length=ge,this.has_stree=he&&he.length}var te,ce,be;function Fe(he,Te){this.dyn_tree=he,this.max_code=0,this.stat_desc=Te}function Oe(he){return he<256?U[he]:U[256+(he>>>7)]}function Re(he,Te){he.pending_buf[he.pending++]=Te&255,he.pending_buf[he.pending++]=Te>>>8&255}function Be(he,Te,We){he.bi_valid>m-We?(he.bi_buf|=Te<<he.bi_valid&65535,Re(he,he.bi_buf),he.bi_buf=Te>>m-he.bi_valid,he.bi_valid+=We-m):(he.bi_buf|=Te<<he.bi_valid&65535,he.bi_valid+=We)}function Ke(he,Te,We){Be(he,We[Te*2],We[Te*2+1])}function Ae(he,Te){var We=0;do We|=he&1,he>>>=1,We<<=1;while(--Te>0);return We>>>1}function _e(he){he.bi_valid===16?(Re(he,he.bi_buf),he.bi_buf=0,he.bi_valid=0):he.bi_valid>=8&&(he.pending_buf[he.pending++]=he.bi_buf&255,he.bi_buf>>=8,he.bi_valid-=8)}function le(he,Te){var We=Te.dyn_tree,xe=Te.max_code,ge=Te.stat_desc.static_tree,ye=Te.stat_desc.has_stree,J=Te.stat_desc.extra_bits,ne=Te.stat_desc.extra_base,q=Te.stat_desc.max_length,me,Ce,G,we,Ne,de,Se=0;for(we=0;we<=w;we++)he.bl_count[we]=0;for(We[he.heap[he.heap_max]*2+1]=0,me=he.heap_max+1;me<d;me++){if(Ce=he.heap[me],we=We[We[Ce*2+1]*2+1]+1,we>q&&(we=q,Se++),We[Ce*2+1]=we,Ce>xe)continue;he.bl_count[we]++,Ne=0,Ce>=ne&&(Ne=J[Ce-ne]),de=We[Ce*2],he.opt_len+=de*(we+Ne),ye&&(he.static_len+=de*(ge[Ce*2+1]+Ne))}if(Se===0)return;do{for(we=q-1;he.bl_count[we]===0;)we--;he.bl_count[we]--,he.bl_count[we+1]+=2,he.bl_count[q]--,Se-=2}while(Se>0);for(we=q;we!==0;we--)for(Ce=he.bl_count[we];Ce!==0;){if(G=he.heap[--me],G>xe)continue;We[G*2+1]!==we&&(he.opt_len+=(we-We[G*2+1])*We[G*2],We[G*2+1]=we),Ce--}}function Ee(he,Te,We){var xe=new Array(w+1),ge=0,ye,J;for(ye=1;ye<=w;ye++)xe[ye]=ge=ge+We[ye-1]<<1;for(J=0;J<=Te;J++){var ne=he[J*2+1];if(ne===0)continue;he[J*2]=Ae(xe[ne]++,ne)}}function pe(){var he,Te,We,xe,ge,ye=new Array(w+1);for(We=0,xe=0;xe<t-1;xe++)for(B[xe]=We,he=0;he<1<<A[xe];he++)X[We++]=xe;for(X[We-1]=xe,ge=0,xe=0;xe<16;xe++)for(N[xe]=ge,he=0;he<1<<p[xe];he++)U[ge++]=xe;for(ge>>=7;xe<l;xe++)for(N[xe]=ge<<7,he=0;he<1<<p[xe]-7;he++)U[256+ge++]=xe;for(Te=0;Te<=w;Te++)ye[Te]=0;for(he=0;he<=143;)j[he*2+1]=8,he++,ye[8]++;for(;he<=255;)j[he*2+1]=9,he++,ye[9]++;for(;he<=279;)j[he*2+1]=7,he++,ye[7]++;for(;he<=287;)j[he*2+1]=8,he++,ye[8]++;for(Ee(j,s+1,ye),he=0;he<l;he++)K[he*2+1]=5,K[he*2]=Ae(he,5);te=new z(j,A,i+1,s,w),ce=new z(K,p,0,l,w),be=new z(new Array(0),D,0,c,S)}function Ge(he){var Te;for(Te=0;Te<s;Te++)he.dyn_ltree[Te*2]=0;for(Te=0;Te<l;Te++)he.dyn_dtree[Te*2]=0;for(Te=0;Te<c;Te++)he.bl_tree[Te*2]=0;he.dyn_ltree[C*2]=1,he.opt_len=he.static_len=0,he.last_lit=he.matches=0}function Ye(he){he.bi_valid>8?Re(he,he.bi_buf):he.bi_valid>0&&(he.pending_buf[he.pending++]=he.bi_buf),he.bi_buf=0,he.bi_valid=0}function ze(he,Te,We,xe){Ye(he),xe&&(Re(he,We),Re(he,~We)),L.arraySet(he.pending_buf,he.window,Te,We,he.pending),he.pending+=We}function Ze(he,Te,We,xe){var ge=Te*2,ye=We*2;return he[ge]<he[ye]||he[ge]===he[ye]&&xe[Te]<=xe[We]}function Je(he,Te,We){for(var xe=he.heap[We],ge=We<<1;ge<=he.heap_len&&!(ge<he.heap_len&&Ze(Te,he.heap[ge+1],he.heap[ge],he.depth)&&ge++,Ze(Te,xe,he.heap[ge],he.depth));)he.heap[We]=he.heap[ge],We=ge,ge<<=1;he.heap[We]=xe}function $e(he,Te,We){var xe,ge,ye=0,J,ne;if(he.last_lit!==0)do xe=he.pending_buf[he.d_buf+ye*2]<<8|he.pending_buf[he.d_buf+ye*2+1],ge=he.pending_buf[he.l_buf+ye],ye++,xe===0?Ke(he,ge,Te):(J=X[ge],Ke(he,J+i+1,Te),ne=A[J],ne!==0&&(ge-=B[J],Be(he,ge,ne)),xe--,J=Oe(xe),Ke(he,J,We),ne=p[J],ne!==0&&(xe-=N[J],Be(he,xe,ne)));while(ye<he.last_lit);Ke(he,C,Te)}function He(he,Te){var We=Te.dyn_tree,xe=Te.stat_desc.static_tree,ge=Te.stat_desc.has_stree,ye=Te.stat_desc.elems,J,ne,q=-1,me;for(he.heap_len=0,he.heap_max=d,J=0;J<ye;J++)We[J*2]!==0?(he.heap[++he.heap_len]=q=J,he.depth[J]=0):We[J*2+1]=0;for(;he.heap_len<2;)me=he.heap[++he.heap_len]=q<2?++q:0,We[me*2]=1,he.depth[me]=0,he.opt_len--,ge&&(he.static_len-=xe[me*2+1]);for(Te.max_code=q,J=he.heap_len>>1;J>=1;J--)Je(he,We,J);me=ye;do J=he.heap[1],he.heap[1]=he.heap[he.heap_len--],Je(he,We,1),ne=he.heap[1],he.heap[--he.heap_max]=J,he.heap[--he.heap_max]=ne,We[me*2]=We[J*2]+We[ne*2],he.depth[me]=(he.depth[J]>=he.depth[ne]?he.depth[J]:he.depth[ne])+1,We[J*2+1]=We[ne*2+1]=me,he.heap[1]=me++,Je(he,We,1);while(he.heap_len>=2);he.heap[--he.heap_max]=he.heap[1],le(he,Te),Ee(We,q,he.bl_count)}function Ue(he,Te,We){var xe,ge=-1,ye,J=Te[0*2+1],ne=0,q=7,me=4;for(J===0&&(q=138,me=3),Te[(We+1)*2+1]=65535,xe=0;xe<=We;xe++){if(ye=J,J=Te[(xe+1)*2+1],++ne<q&&ye===J)continue;ne<me?he.bl_tree[ye*2]+=ne:ye!==0?(ye!==ge&&he.bl_tree[ye*2]++,he.bl_tree[v*2]++):ne<=10?he.bl_tree[y*2]++:he.bl_tree[T*2]++,ne=0,ge=ye,J===0?(q=138,me=3):ye===J?(q=6,me=3):(q=7,me=4)}}function Pe(he,Te,We){var xe,ge=-1,ye,J=Te[0*2+1],ne=0,q=7,me=4;for(J===0&&(q=138,me=3),xe=0;xe<=We;xe++){if(ye=J,J=Te[(xe+1)*2+1],++ne<q&&ye===J)continue;if(ne<me)do Ke(he,ye,he.bl_tree);while(--ne!==0);else ye!==0?(ye!==ge&&(Ke(he,ye,he.bl_tree),ne--),Ke(he,v,he.bl_tree),Be(he,ne-3,2)):ne<=10?(Ke(he,y,he.bl_tree),Be(he,ne-3,3)):(Ke(he,T,he.bl_tree),Be(he,ne-11,7));ne=0,ge=ye,J===0?(q=138,me=3):ye===J?(q=6,me=3):(q=7,me=4)}}function ke(he){var Te;for(Ue(he,he.dyn_ltree,he.l_desc.max_code),Ue(he,he.dyn_dtree,he.d_desc.max_code),He(he,he.bl_desc),Te=c-1;Te>=3&&!(he.bl_tree[O[Te]*2+1]!==0);Te--);return he.opt_len+=3*(Te+1)+5+5+4,Te}function re(he,Te,We,xe){var ge;for(Be(he,Te-257,5),Be(he,We-1,5),Be(he,xe-4,4),ge=0;ge<xe;ge++)Be(he,he.bl_tree[O[ge]*2+1],3);Pe(he,he.dyn_ltree,Te-1),Pe(he,he.dyn_dtree,We-1)}function ve(he){var Te=4093624447,We;for(We=0;We<=31;We++,Te>>>=1)if(Te&1&&he.dyn_ltree[We*2]!==0)return f;if(he.dyn_ltree[9*2]!==0||he.dyn_ltree[10*2]!==0||he.dyn_ltree[13*2]!==0)return E;for(We=32;We<i;We++)if(he.dyn_ltree[We*2]!==0)return E;return f}var ae=!1;function De(he){ae||(pe(),ae=!0),he.l_desc=new Fe(he.dyn_ltree,te),he.d_desc=new Fe(he.dyn_dtree,ce),he.bl_desc=new Fe(he.bl_tree,be),he.bi_buf=0,he.bi_valid=0,Ge(he)}function qe(he,Te,We,xe){Be(he,(h<<1)+(xe?1:0),3),ze(he,Te,We,!0)}function et(he){Be(he,o<<1,3),Ke(he,C,j),_e(he)}function je(he,Te,We,xe){var ge,ye,J=0;he.level>0?(he.strm.data_type===x&&(he.strm.data_type=ve(he)),He(he,he.l_desc),He(he,he.d_desc),J=ke(he),ge=he.opt_len+3+7>>>3,ye=he.static_len+3+7>>>3,ye<=ge&&(ge=ye)):ge=ye=We+5,We+4<=ge&&Te!==-1?qe(he,Te,We,xe):he.strategy===M||ye===ge?(Be(he,(o<<1)+(xe?1:0),3),$e(he,j,K)):(Be(he,(u<<1)+(xe?1:0),3),re(he,he.l_desc.max_code+1,he.d_desc.max_code+1,J+1),$e(he,he.dyn_ltree,he.dyn_dtree)),Ge(he),xe&&Ye(he)}function ct(he,Te,We){return he.pending_buf[he.d_buf+he.last_lit*2]=Te>>>8&255,he.pending_buf[he.d_buf+he.last_lit*2+1]=Te&255,he.pending_buf[he.l_buf+he.last_lit]=We&255,he.last_lit++,Te===0?he.dyn_ltree[We*2]++:(he.matches++,Te--,he.dyn_ltree[(X[We]+i+1)*2]++,he.dyn_dtree[Oe(Te)*2]++),he.last_lit===he.lit_bufsize-1}},dejd:function(at,fe,oe){},dmUQ:function(at,fe,oe){"use strict";var V=oe("Ff2n"),L=oe("rePB"),I=oe("1OyB"),k=oe("vuIU"),M=oe("Ji7U"),f=oe("md7G"),E=oe("foSv"),x=oe("q1tI"),g=oe.n(x),h=oe("TSYQ"),o=oe.n(h),u=oe("4IlW");function r(A,p){var D=Object.keys(A);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(A);p&&(O=O.filter(function(P){return Object.getOwnPropertyDescriptor(A,P).enumerable})),D.push.apply(D,O)}return D}function n(A){for(var p=1;p<arguments.length;p++){var D=arguments[p]!=null?arguments[p]:{};p%2?r(Object(D),!0).forEach(function(O){Object(L.a)(A,O,D[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(D)):r(Object(D)).forEach(function(O){Object.defineProperty(A,O,Object.getOwnPropertyDescriptor(D,O))})}return A}function t(A){var p=i();return function(){var O=Object(E.a)(A),P;if(p){var j=Object(E.a)(this).constructor;P=Reflect.construct(O,arguments,j)}else P=O.apply(this,arguments);return Object(f.a)(this,P)}}function i(){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(A){return!1}}function s(){}function l(A){A.preventDefault()}var c=function(p){return p.replace(/[^\w.-]+/g,"")},d=200,w=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(p){return p!=null},C=function(p,D){return D===p||typeof D=="number"&&typeof p=="number"&&isNaN(D)&&isNaN(p)},v=function(A){Object(M.a)(D,A);var p=t(D);function D(O){var P;Object(I.a)(this,D),P=p.call(this,O),P.onKeyDown=function(U){var X=P.props,B=X.onKeyDown,N=X.onPressEnter;if(U.keyCode===u.a.UP){var z=P.getRatio(U);P.up(U,z,null),P.stop()}else if(U.keyCode===u.a.DOWN){var te=P.getRatio(U);P.down(U,te,null),P.stop()}else U.keyCode===u.a.ENTER&&N&&N(U);if(P.recordCursorPosition(),P.lastKeyCode=U.keyCode,B){for(var ce=arguments.length,be=new Array(ce>1?ce-1:0),Fe=1;Fe<ce;Fe++)be[Fe-1]=arguments[Fe];B.apply(void 0,[U].concat(be))}},P.onKeyUp=function(U){var X=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),X){for(var B=arguments.length,N=new Array(B>1?B-1:0),z=1;z<B;z++)N[z-1]=arguments[z];X.apply(void 0,[U].concat(N))}},P.onChange=function(U){var X=P.props.onChange;P.state.focused&&(P.inputting=!0),P.rawInput=P.props.parser(P.getValueFromEvent(U)),P.setState({inputValue:P.rawInput}),X(P.toNumber(P.rawInput))},P.onMouseUp=function(){var U=P.props.onMouseUp;P.recordCursorPosition(),U&&U.apply(void 0,arguments)},P.onFocus=function(){var U;P.setState({focused:!0}),(U=P.props).onFocus.apply(U,arguments)},P.onBlur=function(){var U=P.props.onBlur;P.inputting=!1,P.setState({focused:!1});var X=P.getCurrentValidValue(P.state.inputValue),B=P.setValue(X,s);if(U){var N=P.input.value,z=P.getInputDisplayValue({focus:!1,value:B});P.input.value=z&&Number(z),U.apply(void 0,arguments),P.input.value=N}},P.getRatio=function(U){var X=1;return U.metaKey||U.ctrlKey?X=.1:U.shiftKey&&(X=10),X},P.getFullNum=function(U){return isNaN(U)?U:/e/i.test(String(U))?Number(U).toFixed(18).replace(/\.?0+$/,""):U},P.getPrecision=function(U){if(S(P.props.precision))return P.props.precision;var X=String(U);if(X.indexOf("e-")>=0)return parseInt(X.slice(X.indexOf("e-")+2),10);var B=0;return X.indexOf(".")>=0&&(B=X.length-X.indexOf(".")-1),B},P.getInputDisplayValue=function(U){var X=U||P.state,B=X.focused,N=X.inputValue,z=X.value,te;B?te=N:te=P.toPrecisionAsStep(z),te==null&&(te="");var ce=P.formatWrapper(te);return S(P.props.decimalSeparator)&&(ce=ce.toString().replace(".",P.props.decimalSeparator)),ce},P.recordCursorPosition=function(){try{P.cursorStart=P.input.selectionStart,P.cursorEnd=P.input.selectionEnd,P.currentValue=P.input.value,P.cursorBefore=P.input.value.substring(0,P.cursorStart),P.cursorAfter=P.input.value.substring(P.cursorEnd)}catch(U){}},P.restoreByAfter=function(U){if(U===void 0)return!1;var X=P.input.value,B=X.lastIndexOf(U);if(B===-1)return!1;var N=P.cursorBefore.length;return P.lastKeyCode===u.a.DELETE&&P.cursorBefore.charAt(N-1)===U[0]?(P.fixCaret(N,N),!0):B+U.length===X.length?(P.fixCaret(B,B),!0):!1},P.partRestoreByAfter=function(U){return U===void 0?!1:Array.prototype.some.call(U,function(X,B){var N=U.substring(B);return P.restoreByAfter(N)})},P.isNotCompleteNumber=function(U){return isNaN(U)||U===""||U===null||U&&U.toString().indexOf(".")===U.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(U,X,B){P.pressingUpOrDown=!0,P.step("down",U,X,B)},P.up=function(U,X,B){P.pressingUpOrDown=!0,P.step("up",U,X,B)},P.saveInput=function(U){P.input=U};var j=O.value;j===void 0&&(j=O.defaultValue),P.state={focused:O.autoFocus};var K=P.getValidValue(P.toNumber(j));return P.state=n(n({},P.state),{},{inputValue:P.toPrecisionAsStep(K),value:K}),P}return Object(k.a)(D,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var j=this.props,K=j.value,U=j.onChange,X=j.max,B=j.min,N=this.state.focused;if(P){if(!C(P.value,K)||!C(P.max,X)||!C(P.min,B)){var z=N?K:this.getValidValue(K),te;this.pressingUpOrDown?te=z:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:te})}var ce="value"in this.props?K:this.state.value;"max"in this.props&&P.max!==X&&typeof ce=="number"&&ce>X&&U&&U(X),"min"in this.props&&P.min!==B&&typeof ce=="number"&&ce<B&&U&&U(B)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var be=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===u.a.BACKSPACE?be=this.cursorStart-1:this.lastKeyCode===u.a.DELETE&&(be=this.cursorStart):be=this.input.value.length,this.fixCaret(be,be)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case u.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case u.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Fe){}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(P){var j=P;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(P){var j=P.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(P){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,U=parseFloat(P);return isNaN(U)?P:(U<j&&(U=j),U>K&&(U=K),U)}},{key:"setValue",value:function(P,j){var K=this.props.precision,U=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),X=this.state.value,B=X===void 0?null:X,N=this.state.inputValue,z=N===void 0?null:N,te=typeof U=="number"?U.toFixed(K):"".concat(U),ce=U!==B||te!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},j)):this.setState({value:U,inputValue:this.toPrecisionAsStep(P)},j),ce&&this.props.onChange(U),U}},{key:"getMaxPrecision",value:function(P){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.props,U=K.precision,X=K.step;if(S(U))return U;var B=this.getPrecision(j),N=this.getPrecision(X),z=this.getPrecision(P);return P?Math.max(z,B+N):B+N}},{key:"getPrecisionFactor",value:function(P){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,K=this.getMaxPrecision(P,j);return Math.pow(10,K)}},{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(P){return this.props.formatter?this.props.formatter(P):P}},{key:"toPrecisionAsStep",value:function(P){if(this.isNotCompleteNumber(P)||P==="")return P;var j=Math.abs(this.getMaxPrecision(P));return isNaN(j)?P.toString():Number(P).toFixed(j)}},{key:"toNumber",value:function(P){var j=this.props.precision,K=this.state.focused,U=P&&P.length>16&&K;return this.isNotCompleteNumber(P)||U?P:S(j)?Math.round(P*Math.pow(10,j))/Math.pow(10,j):Number(P)}},{key:"upStep",value:function(P,j){var K=this.props.step,U=this.getPrecisionFactor(P,j),X=Math.abs(this.getMaxPrecision(P,j)),B=((U*P+U*K*j)/U).toFixed(X);return this.toNumber(B)}},{key:"downStep",value:function(P,j){var K=this.props.step,U=this.getPrecisionFactor(P,j),X=Math.abs(this.getMaxPrecision(P,j)),B=((U*P-U*K*j)/U).toFixed(X);return this.toNumber(B)}},{key:"step",value:function(P,j){var K=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,X=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var B=this.props;if(B.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var z=this["".concat(P,"Step")](N,U),te=z>B.max||z<B.min;if(z>B.max?z=B.max:z<B.min&&(z=B.min),this.setValue(z,null),this.setState({focused:!0},function(){K.pressingUpOrDown=!1}),te)return;this.autoStepTimer=setTimeout(function(){K[P](j,U,!0)},X?d:w)}},{key:"fixCaret",value:function(P,j){if(P===void 0||j===void 0||!this.input||!this.input.value)return;try{var K=this.input.selectionStart,U=this.input.selectionEnd;(P!==K||j!==U)&&this.input.setSelectionRange(P,j)}catch(X){}}},{key:"render",value:function(){var P,j=this.props,K=j.prefixCls,U=j.disabled,X=j.readOnly,B=j.useTouch,N=j.autoComplete,z=j.upHandler,te=j.downHandler,ce=j.className,be=j.max,Fe=j.min,Oe=j.style,Re=j.title,Be=j.onMouseEnter,Ke=j.onMouseLeave,Ae=j.onMouseOver,_e=j.onMouseOut,le=j.required,Ee=j.onClick,pe=j.tabIndex,Ge=j.type,Ye=j.placeholder,ze=j.id,Ze=j.inputMode,Je=j.pattern,$e=j.step,He=j.maxLength,Ue=j.autoFocus,Pe=j.name,ke=j.onPaste,re=j.onInput,ve=Object(V.a)(j,["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"]),ae=this.state,De=ae.value,qe=ae.focused,et=o()(K,(P={},Object(L.a)(P,ce,!!ce),Object(L.a)(P,"".concat(K,"-disabled"),U),Object(L.a)(P,"".concat(K,"-focused"),qe),P)),je={};Object.keys(ve).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(je[me]=ve[me])});var ct=!X&&!U,he=this.getInputDisplayValue(null),Te=(De||De===0)&&(isNaN(De)||Number(De)>=be),We=(De||De===0)&&(isNaN(De)||Number(De)<=Fe),xe=Te||U||X,ge=We||U||X,ye=o()("".concat(K,"-handler"),"".concat(K,"-handler-up"),Object(L.a)({},"".concat(K,"-handler-up-disabled"),xe)),J=o()("".concat(K,"-handler"),"".concat(K,"-handler-down"),Object(L.a)({},"".concat(K,"-handler-down-disabled"),ge)),ne=B?{onTouchStart:xe?s:this.up,onTouchEnd:this.stop}:{onMouseDown:xe?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},q=B?{onTouchStart:ge?s:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return g.a.createElement("div",{className:et,style:Oe,title:Re,onMouseEnter:Be,onMouseLeave:Ke,onMouseOver:Ae,onMouseOut:_e,onFocus:function(){return null},onBlur:function(){return null}},g.a.createElement("div",{className:"".concat(K,"-handler-wrap")},g.a.createElement("span",Object.assign({unselectable:"on"},ne,{role:"button","aria-label":"Increase Value","aria-disabled":xe,className:ye}),z||g.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-up-inner"),onClick:l})),g.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:J}),te||g.a.createElement("span",{unselectable:"on",className:"".concat(K,"-handler-down-inner"),onClick:l}))),g.a.createElement("div",{className:"".concat(K,"-input-wrap")},g.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":be,"aria-valuenow":De,required:le,type:Ge,placeholder:Ye,onPaste:ke,onClick:Ee,onMouseUp:this.onMouseUp,className:"".concat(K,"-input"),tabIndex:pe,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ct?this.onKeyDown:s,onKeyUp:ct?this.onKeyUp:s,autoFocus:Ue,maxLength:He,readOnly:X,disabled:U,max:be,min:Fe,step:$e,name:Pe,title:Re,id:ze,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(he),pattern:Je,inputMode:Ze,onInput:re},je))))}}]),D}(g.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:c,required:!1,autoComplete:"off"};var y=v,T=fe.a=y},eP3c:function(at,fe,oe){"use strict";function V(J){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(q){return typeof q}:V=function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},V(J)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.inflateReset=re,fe.inflateReset2=ve,fe.inflateResetKeep=ke,fe.inflateInit=De,fe.inflateInit2=ae,fe.inflate=Te,fe.inflateEnd=We,fe.inflateGetHeader=xe,fe.inflateSetDictionary=ge,fe.inflateInfo=fe.Z_DEFLATED=fe.Z_BUF_ERROR=fe.Z_MEM_ERROR=fe.Z_DATA_ERROR=fe.Z_STREAM_ERROR=fe.Z_NEED_DICT=fe.Z_STREAM_END=fe.Z_OK=fe.Z_TREES=fe.Z_BLOCK=fe.Z_FINISH=void 0;var L=g(oe("6BzB")),I=E(oe("xlC8")),k=E(oe("QV2g")),M=E(oe("sjKO")),f=E(oe("JSwD"));function E(J){return J&&J.__esModule?J:{default:J}}function x(){if(typeof WeakMap!="function")return null;var J=new WeakMap;return x=function(){return J},J}function g(J){if(J&&J.__esModule)return J;if(J===null||V(J)!=="object"&&typeof J!="function")return{default:J};var ne=x();if(ne&&ne.has(J))return ne.get(J);var q={},me=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ce in J)if(Object.prototype.hasOwnProperty.call(J,Ce)){var G=me?Object.getOwnPropertyDescriptor(J,Ce):null;G&&(G.get||G.set)?Object.defineProperty(q,Ce,G):q[Ce]=J[Ce]}return q.default=J,ne&&ne.set(J,q),q}var h=0,o=1,u=2,r=4;fe.Z_FINISH=r;var n=5;fe.Z_BLOCK=n;var t=6;fe.Z_TREES=t;var i=0;fe.Z_OK=i;var s=1;fe.Z_STREAM_END=s;var l=2;fe.Z_NEED_DICT=l;var c=-2;fe.Z_STREAM_ERROR=c;var d=-3;fe.Z_DATA_ERROR=d;var w=-4;fe.Z_MEM_ERROR=w;var m=-5;fe.Z_BUF_ERROR=m;var S=8;fe.Z_DEFLATED=S;var C=1,v=2,y=3,T=4,A=5,p=6,D=7,O=8,P=9,j=10,K=11,U=12,X=13,B=14,N=15,z=16,te=17,ce=18,be=19,Fe=20,Oe=21,Re=22,Be=23,Ke=24,Ae=25,_e=26,le=27,Ee=28,pe=29,Ge=30,Ye=31,ze=32,Ze=852,Je=592,$e=15,He=$e;function Ue(J){return(J>>>24&255)+(J>>>8&65280)+((J&65280)<<8)+((J&255)<<24)}function Pe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new L.Buf16(320),this.work=new L.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ke(J){var ne;return!J||!J.state?c:(ne=J.state,J.total_in=J.total_out=ne.total=0,J.msg="",ne.wrap&&(J.adler=ne.wrap&1),ne.mode=C,ne.last=0,ne.havedict=0,ne.dmax=32768,ne.head=null,ne.hold=0,ne.bits=0,ne.lencode=ne.lendyn=new L.Buf32(Ze),ne.distcode=ne.distdyn=new L.Buf32(Je),ne.sane=1,ne.back=-1,i)}function re(J){var ne;return!J||!J.state?c:(ne=J.state,ne.wsize=0,ne.whave=0,ne.wnext=0,ke(J))}function ve(J,ne){var q,me;return!J||!J.state?c:(me=J.state,ne<0?(q=0,ne=-ne):(q=(ne>>4)+1,ne<48&&(ne&=15)),ne&&(ne<8||ne>15)?c:(me.window!==null&&me.wbits!==ne&&(me.window=null),me.wrap=q,me.wbits=ne,re(J)))}function ae(J,ne){var q,me;return J?(me=new Pe,J.state=me,me.window=null,q=ve(J,ne),q!==i&&(J.state=null),q):c}function De(J){return ae(J,He)}var qe=!0,et,je;function ct(J){if(qe){var ne;for(et=new L.Buf32(512),je=new L.Buf32(32),ne=0;ne<144;)J.lens[ne++]=8;for(;ne<256;)J.lens[ne++]=9;for(;ne<280;)J.lens[ne++]=7;for(;ne<288;)J.lens[ne++]=8;for((0,f.default)(o,J.lens,0,288,et,0,J.work,{bits:9}),ne=0;ne<32;)J.lens[ne++]=5;(0,f.default)(u,J.lens,0,32,je,0,J.work,{bits:5}),qe=!1}J.lencode=et,J.lenbits=9,J.distcode=je,J.distbits=5}function he(J,ne,q,me){var Ce,G=J.state;return G.window===null&&(G.wsize=1<<G.wbits,G.wnext=0,G.whave=0,G.window=new L.Buf8(G.wsize)),me>=G.wsize?(L.arraySet(G.window,ne,q-G.wsize,G.wsize,0),G.wnext=0,G.whave=G.wsize):(Ce=G.wsize-G.wnext,Ce>me&&(Ce=me),L.arraySet(G.window,ne,q-me,Ce,G.wnext),me-=Ce,me?(L.arraySet(G.window,ne,q-me,me,0),G.wnext=me,G.whave=G.wsize):(G.wnext+=Ce,G.wnext===G.wsize&&(G.wnext=0),G.whave<G.wsize&&(G.whave+=Ce))),0}function Te(J,ne){var q,me,Ce,G,we,Ne,de,Se,Xe,lt,tt,st,mt,Ct,_t=0,ft,kt,Nt,nt,Tt,It,wt,Ft,zt=new L.Buf8(4),ui,Pt,xt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!J||!J.state||!J.output||!J.input&&J.avail_in!==0)return c;q=J.state,q.mode===U&&(q.mode=X),we=J.next_out,Ce=J.output,de=J.avail_out,G=J.next_in,me=J.input,Ne=J.avail_in,Se=q.hold,Xe=q.bits,lt=Ne,tt=de,Ft=i;e:for(;;)switch(q.mode){case C:if(q.wrap===0){q.mode=X;break}for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(q.wrap&2&&Se===35615){q.check=0,zt[0]=Se&255,zt[1]=Se>>>8&255,q.check=(0,k.default)(q.check,zt,2,0),Se=0,Xe=0,q.mode=v;break}if(q.flags=0,q.head&&(q.head.done=!1),!(q.wrap&1)||(((Se&255)<<8)+(Se>>8))%31){J.msg="incorrect header check",q.mode=Ge;break}if((Se&15)!==S){J.msg="unknown compression method",q.mode=Ge;break}if(Se>>>=4,Xe-=4,wt=(Se&15)+8,q.wbits===0)q.wbits=wt;else if(wt>q.wbits){J.msg="invalid window size",q.mode=Ge;break}q.dmax=1<<wt,J.adler=q.check=1,q.mode=Se&512?j:U,Se=0,Xe=0;break;case v:for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(q.flags=Se,(q.flags&255)!==S){J.msg="unknown compression method",q.mode=Ge;break}if(q.flags&57344){J.msg="unknown header flags set",q.mode=Ge;break}q.head&&(q.head.text=Se>>8&1),q.flags&512&&(zt[0]=Se&255,zt[1]=Se>>>8&255,q.check=(0,k.default)(q.check,zt,2,0)),Se=0,Xe=0,q.mode=y;case y:for(;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.head&&(q.head.time=Se),q.flags&512&&(zt[0]=Se&255,zt[1]=Se>>>8&255,zt[2]=Se>>>16&255,zt[3]=Se>>>24&255,q.check=(0,k.default)(q.check,zt,4,0)),Se=0,Xe=0,q.mode=T;case T:for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.head&&(q.head.xflags=Se&255,q.head.os=Se>>8),q.flags&512&&(zt[0]=Se&255,zt[1]=Se>>>8&255,q.check=(0,k.default)(q.check,zt,2,0)),Se=0,Xe=0,q.mode=A;case A:if(q.flags&1024){for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.length=Se,q.head&&(q.head.extra_len=Se),q.flags&512&&(zt[0]=Se&255,zt[1]=Se>>>8&255,q.check=(0,k.default)(q.check,zt,2,0)),Se=0,Xe=0}else q.head&&(q.head.extra=null);q.mode=p;case p:if(q.flags&1024&&(st=q.length,st>Ne&&(st=Ne),st&&(q.head&&(wt=q.head.extra_len-q.length,q.head.extra||(q.head.extra=new Array(q.head.extra_len)),L.arraySet(q.head.extra,me,G,st,wt)),q.flags&512&&(q.check=(0,k.default)(q.check,me,st,G)),Ne-=st,G+=st,q.length-=st),q.length))break e;q.length=0,q.mode=D;case D:if(q.flags&2048){if(Ne===0)break e;st=0;do wt=me[G+st++],q.head&&wt&&q.length<65536&&(q.head.name+=String.fromCharCode(wt));while(wt&&st<Ne);if(q.flags&512&&(q.check=(0,k.default)(q.check,me,st,G)),Ne-=st,G+=st,wt)break e}else q.head&&(q.head.name=null);q.length=0,q.mode=O;case O:if(q.flags&4096){if(Ne===0)break e;st=0;do wt=me[G+st++],q.head&&wt&&q.length<65536&&(q.head.comment+=String.fromCharCode(wt));while(wt&&st<Ne);if(q.flags&512&&(q.check=(0,k.default)(q.check,me,st,G)),Ne-=st,G+=st,wt)break e}else q.head&&(q.head.comment=null);q.mode=P;case P:if(q.flags&512){for(;Xe<16;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(Se!==(q.check&65535)){J.msg="header crc mismatch",q.mode=Ge;break}Se=0,Xe=0}q.head&&(q.head.hcrc=q.flags>>9&1,q.head.done=!0),J.adler=q.check=0,q.mode=U;break;case j:for(;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}J.adler=q.check=Ue(Se),Se=0,Xe=0,q.mode=K;case K:if(q.havedict===0)return J.next_out=we,J.avail_out=de,J.next_in=G,J.avail_in=Ne,q.hold=Se,q.bits=Xe,l;J.adler=q.check=1,q.mode=U;case U:if(ne===n||ne===t)break e;case X:if(q.last){Se>>>=Xe&7,Xe-=Xe&7,q.mode=le;break}for(;Xe<3;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.last=Se&1,Se>>>=1,Xe-=1;switch(Se&3){case 0:q.mode=B;break;case 1:if(ct(q),q.mode=Fe,ne===t){Se>>>=2,Xe-=2;break e}break;case 2:q.mode=te;break;case 3:J.msg="invalid block type",q.mode=Ge}Se>>>=2,Xe-=2;break;case B:for(Se>>>=Xe&7,Xe-=Xe&7;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if((Se&65535)!==(Se>>>16^65535)){J.msg="invalid stored block lengths",q.mode=Ge;break}if(q.length=Se&65535,Se=0,Xe=0,q.mode=N,ne===t)break e;case N:q.mode=z;case z:if(st=q.length,st){if(st>Ne&&(st=Ne),st>de&&(st=de),st===0)break e;L.arraySet(Ce,me,G,st,we),Ne-=st,G+=st,de-=st,we+=st,q.length-=st;break}q.mode=U;break;case te:for(;Xe<14;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(q.nlen=(Se&31)+257,Se>>>=5,Xe-=5,q.ndist=(Se&31)+1,Se>>>=5,Xe-=5,q.ncode=(Se&15)+4,Se>>>=4,Xe-=4,q.nlen>286||q.ndist>30){J.msg="too many length or distance symbols",q.mode=Ge;break}q.have=0,q.mode=ce;case ce:for(;q.have<q.ncode;){for(;Xe<3;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.lens[xt[q.have++]]=Se&7,Se>>>=3,Xe-=3}for(;q.have<19;)q.lens[xt[q.have++]]=0;if(q.lencode=q.lendyn,q.lenbits=7,ui={bits:q.lenbits},Ft=(0,f.default)(h,q.lens,0,19,q.lencode,0,q.work,ui),q.lenbits=ui.bits,Ft){J.msg="invalid code lengths set",q.mode=Ge;break}q.have=0,q.mode=be;case be:for(;q.have<q.nlen+q.ndist;){for(;!(_t=q.lencode[Se&(1<<q.lenbits)-1],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(Nt<16)Se>>>=ft,Xe-=ft,q.lens[q.have++]=Nt;else{if(Nt===16){for(Pt=ft+2;Xe<Pt;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(Se>>>=ft,Xe-=ft,q.have===0){J.msg="invalid bit length repeat",q.mode=Ge;break}wt=q.lens[q.have-1],st=3+(Se&3),Se>>>=2,Xe-=2}else if(Nt===17){for(Pt=ft+3;Xe<Pt;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}Se>>>=ft,Xe-=ft,wt=0,st=3+(Se&7),Se>>>=3,Xe-=3}else{for(Pt=ft+7;Xe<Pt;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}Se>>>=ft,Xe-=ft,wt=0,st=11+(Se&127),Se>>>=7,Xe-=7}if(q.have+st>q.nlen+q.ndist){J.msg="invalid bit length repeat",q.mode=Ge;break}for(;st--;)q.lens[q.have++]=wt}}if(q.mode===Ge)break;if(q.lens[256]===0){J.msg="invalid code -- missing end-of-block",q.mode=Ge;break}if(q.lenbits=9,ui={bits:q.lenbits},Ft=(0,f.default)(o,q.lens,0,q.nlen,q.lencode,0,q.work,ui),q.lenbits=ui.bits,Ft){J.msg="invalid literal/lengths set",q.mode=Ge;break}if(q.distbits=6,q.distcode=q.distdyn,ui={bits:q.distbits},Ft=(0,f.default)(u,q.lens,q.nlen,q.ndist,q.distcode,0,q.work,ui),q.distbits=ui.bits,Ft){J.msg="invalid distances set",q.mode=Ge;break}if(q.mode=Fe,ne===t)break e;case Fe:q.mode=Oe;case Oe:if(Ne>=6&&de>=258){J.next_out=we,J.avail_out=de,J.next_in=G,J.avail_in=Ne,q.hold=Se,q.bits=Xe,(0,M.default)(J,tt),we=J.next_out,Ce=J.output,de=J.avail_out,G=J.next_in,me=J.input,Ne=J.avail_in,Se=q.hold,Xe=q.bits,q.mode===U&&(q.back=-1);break}for(q.back=0;!(_t=q.lencode[Se&(1<<q.lenbits)-1],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(kt&&(kt&240)===0){for(nt=ft,Tt=kt,It=Nt;!(_t=q.lencode[It+((Se&(1<<nt+Tt)-1)>>nt)],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,nt+ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}Se>>>=nt,Xe-=nt,q.back+=nt}if(Se>>>=ft,Xe-=ft,q.back+=ft,q.length=Nt,kt===0){q.mode=_e;break}if(kt&32){q.back=-1,q.mode=U;break}if(kt&64){J.msg="invalid literal/length code",q.mode=Ge;break}q.extra=kt&15,q.mode=Re;case Re:if(q.extra){for(Pt=q.extra;Xe<Pt;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.length+=Se&(1<<q.extra)-1,Se>>>=q.extra,Xe-=q.extra,q.back+=q.extra}q.was=q.length,q.mode=Be;case Be:for(;!(_t=q.distcode[Se&(1<<q.distbits)-1],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if((kt&240)===0){for(nt=ft,Tt=kt,It=Nt;!(_t=q.distcode[It+((Se&(1<<nt+Tt)-1)>>nt)],ft=_t>>>24,kt=_t>>>16&255,Nt=_t&65535,nt+ft<=Xe);){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}Se>>>=nt,Xe-=nt,q.back+=nt}if(Se>>>=ft,Xe-=ft,q.back+=ft,kt&64){J.msg="invalid distance code",q.mode=Ge;break}q.offset=Nt,q.extra=kt&15,q.mode=Ke;case Ke:if(q.extra){for(Pt=q.extra;Xe<Pt;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}q.offset+=Se&(1<<q.extra)-1,Se>>>=q.extra,Xe-=q.extra,q.back+=q.extra}if(q.offset>q.dmax){J.msg="invalid distance too far back",q.mode=Ge;break}q.mode=Ae;case Ae:if(de===0)break e;if(st=tt-de,q.offset>st){if(st=q.offset-st,st>q.whave&&q.sane){J.msg="invalid distance too far back",q.mode=Ge;break}st>q.wnext?(st-=q.wnext,mt=q.wsize-st):mt=q.wnext-st,st>q.length&&(st=q.length),Ct=q.window}else Ct=Ce,mt=we-q.offset,st=q.length;st>de&&(st=de),de-=st,q.length-=st;do Ce[we++]=Ct[mt++];while(--st);q.length===0&&(q.mode=Oe);break;case _e:if(de===0)break e;Ce[we++]=q.length,de--,q.mode=Oe;break;case le:if(q.wrap){for(;Xe<32;){if(Ne===0)break e;Ne--,Se|=me[G++]<<Xe,Xe+=8}if(tt-=de,J.total_out+=tt,q.total+=tt,tt&&(J.adler=q.check=q.flags?(0,k.default)(q.check,Ce,tt,we-tt):(0,I.default)(q.check,Ce,tt,we-tt)),tt=de,(q.flags?Se:Ue(Se))!==q.check){J.msg="incorrect data check",q.mode=Ge;break}Se=0,Xe=0}q.mode=Ee;case Ee:if(q.wrap&&q.flags){for(;Xe<32;){if(Ne===0)break e;Ne--,Se+=me[G++]<<Xe,Xe+=8}if(Se!==(q.total&4294967295)){J.msg="incorrect length check",q.mode=Ge;break}Se=0,Xe=0}q.mode=pe;case pe:Ft=s;break e;case Ge:Ft=d;break e;case Ye:return w;case ze:default:return c}return J.next_out=we,J.avail_out=de,J.next_in=G,J.avail_in=Ne,q.hold=Se,q.bits=Xe,(q.wsize||tt!==J.avail_out&&q.mode<Ge&&(q.mode<le||ne!==r))&&he(J,J.output,J.next_out,tt-J.avail_out)?(q.mode=Ye,w):(lt-=J.avail_in,tt-=J.avail_out,J.total_in+=lt,J.total_out+=tt,q.total+=tt,q.wrap&&tt&&(J.adler=q.check=q.flags?(0,k.default)(q.check,Ce,tt,J.next_out-tt):(0,I.default)(q.check,Ce,tt,J.next_out-tt)),J.data_type=q.bits+(q.last?64:0)+(q.mode===U?128:0)+(q.mode===Fe||q.mode===N?256:0),(lt===0&&tt===0||ne===r)&&Ft===i&&(Ft=m),Ft)}function We(J){if(!J||!J.state)return c;var ne=J.state;return ne.window&&(ne.window=null),J.state=null,i}function xe(J,ne){var q;return!J||!J.state?c:(q=J.state,(q.wrap&2)===0?c:(q.head=ne,ne.done=!1,i))}function ge(J,ne){var q=ne.length,me,Ce,G;return!J||!J.state?c:(me=J.state,me.wrap!==0&&me.mode!==K?c:me.mode===K&&(Ce=1,Ce=(0,I.default)(Ce,ne,q,0),Ce!==me.check)?d:(G=he(J,ne,q,q),G?(me.mode=Ye,w):(me.havedict=1,i)))}var ye="pako inflate (from Nodeca project)";fe.inflateInfo=ye},gIYZ:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={Backspace:"Backspace",AltLeft:"Alt",AltRight:"Alt",CapsLock:"CapsLock",ContextMenu:"ContextMenu",ControlLeft:"Control",ControlRight:"Control",Enter:"Enter",MetaLeft:"Meta",MetaRight:"Meta",ShiftLeft:"Shift",ShiftRight:"Shift",Tab:"Tab",Delete:"Delete",End:"End",Help:"Help",Home:"Home",Insert:"Insert",PageDown:"PageDown",PageUp:"PageUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",NumLock:"NumLock",NumpadBackspace:"Backspace",NumpadClear:"Clear",Escape:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",F13:"F13",F14:"F14",F15:"F15",F16:"F16",F17:"F17",F18:"F18",F19:"F19",F20:"F20",F21:"F21",F22:"F22",F23:"F23",F24:"F24",F25:"F25",F26:"F26",F27:"F27",F28:"F28",F29:"F29",F30:"F30",F31:"F31",F32:"F32",F33:"F33",F34:"F34",F35:"F35",PrintScreen:"PrintScreen",ScrollLock:"ScrollLock",Pause:"Pause",BrowserBack:"BrowserBack",BrowserFavorites:"BrowserFavorites",BrowserForward:"BrowserForward",BrowserHome:"BrowserHome",BrowserRefresh:"BrowserRefresh",BrowserSearch:"BrowserSearch",BrowserStop:"BrowserStop",Eject:"Eject",LaunchApp1:"LaunchMyComputer",LaunchApp2:"LaunchCalendar",LaunchMail:"LaunchMail",MediaPlayPause:"MediaPlay",MediaStop:"MediaStop",MediaTrackNext:"MediaTrackNext",MediaTrackPrevious:"MediaTrackPrevious",Power:"Power",Sleep:"Sleep",AudioVolumeDown:"AudioVolumeDown",AudioVolumeMute:"AudioVolumeMute",AudioVolumeUp:"AudioVolumeUp",WakeUp:"WakeUp"};fe.default=V},h78n:function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return P});var V=oe("q1tI"),L=oe.n(V),I=oe("TSYQ"),k=oe.n(I),M={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},f=function(U){var X=U.map(function(){return Object(V.useRef)()}),B=Object(V.useRef)();return Object(V.useEffect)(function(){var N=Date.now(),z=!1;Object.keys(X).forEach(function(te){var ce=X[te].current;if(!ce)return;z=!0;var be=ce.style;be.transitionDuration=".3s, .3s, .3s, .06s",B.current&&N-B.current<100&&(be.transitionDuration="0s, 0s")}),z&&(B.current=Date.now())}),[X]};function E(){return E=Object.assign||function(K){for(var U=1;U<arguments.length;U++){var X=arguments[U];for(var B in X)Object.prototype.hasOwnProperty.call(X,B)&&(K[B]=X[B])}return K},E.apply(this,arguments)}function x(K,U){return r(K)||u(K,U)||h(K,U)||g()}function g(){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 h(K,U){if(!K)return;if(typeof K=="string")return o(K,U);var X=Object.prototype.toString.call(K).slice(8,-1);if(X==="Object"&&K.constructor&&(X=K.constructor.name),X==="Map"||X==="Set")return Array.from(K);if(X==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(X))return o(K,U)}function o(K,U){(U==null||U>K.length)&&(U=K.length);for(var X=0,B=new Array(U);X<U;X++)B[X]=K[X];return B}function u(K,U){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(K)))return;var X=[],B=!0,N=!1,z=void 0;try{for(var te=K[Symbol.iterator](),ce;!(B=(ce=te.next()).done)&&!(X.push(ce.value),U&&X.length===U);B=!0);}catch(be){N=!0,z=be}finally{try{!B&&te.return!=null&&te.return()}finally{if(N)throw z}}return X}function r(K){if(Array.isArray(K))return K}function n(K,U){if(K==null)return{};var X=t(K,U),B,N;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(K);for(N=0;N<z.length;N++){if(B=z[N],U.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,B))continue;X[B]=K[B]}}return X}function t(K,U){if(K==null)return{};var X={},B=Object.keys(K),N,z;for(z=0;z<B.length;z++){if(N=B[z],U.indexOf(N)>=0)continue;X[N]=K[N]}return X}var i=function(U){var X=U.className,B=U.percent,N=U.prefixCls,z=U.strokeColor,te=U.strokeLinecap,ce=U.strokeWidth,be=U.style,Fe=U.trailColor,Oe=U.trailWidth,Re=U.transition,Be=n(U,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Be.gapPosition;var Ke=Array.isArray(B)?B:[B],Ae=Array.isArray(z)?z:[z],_e=f(Ke),le=x(_e,1),Ee=le[0],pe=ce/2,Ge=100-ce/2,Ye="M ".concat(te==="round"?pe:0,",").concat(pe,`
L `).concat(te==="round"?Ge:100,",").concat(pe),ze="0 0 100 ".concat(ce),Ze=0;return L.a.createElement("svg",E({className:k()("".concat(N,"-line"),X),viewBox:ze,preserveAspectRatio:"none",style:be},Be),L.a.createElement("path",{className:"".concat(N,"-line-trail"),d:Ye,strokeLinecap:te,stroke:Fe,strokeWidth:Oe||ce,fillOpacity:"0"}),Ke.map(function(Je,$e){var He={strokeDasharray:"".concat(Je,"px, 100px"),strokeDashoffset:"-".concat(Ze,"px"),transition:Re||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ue=Ae[$e]||Ae[Ae.length-1];return Ze+=Je,L.a.createElement("path",{key:$e,className:"".concat(N,"-line-path"),d:Ye,strokeLinecap:te,stroke:Ue,strokeWidth:ce,fillOpacity:"0",ref:Ee[$e],style:He})}))};i.defaultProps=M;var s=i;function l(){return l=Object.assign||function(K){for(var U=1;U<arguments.length;U++){var X=arguments[U];for(var B in X)Object.prototype.hasOwnProperty.call(X,B)&&(K[B]=X[B])}return K},l.apply(this,arguments)}function c(K,U){return C(K)||S(K,U)||w(K,U)||d()}function d(){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 w(K,U){if(!K)return;if(typeof K=="string")return m(K,U);var X=Object.prototype.toString.call(K).slice(8,-1);if(X==="Object"&&K.constructor&&(X=K.constructor.name),X==="Map"||X==="Set")return Array.from(K);if(X==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(X))return m(K,U)}function m(K,U){(U==null||U>K.length)&&(U=K.length);for(var X=0,B=new Array(U);X<U;X++)B[X]=K[X];return B}function S(K,U){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(K)))return;var X=[],B=!0,N=!1,z=void 0;try{for(var te=K[Symbol.iterator](),ce;!(B=(ce=te.next()).done)&&!(X.push(ce.value),U&&X.length===U);B=!0);}catch(be){N=!0,z=be}finally{try{!B&&te.return!=null&&te.return()}finally{if(N)throw z}}return X}function C(K){if(Array.isArray(K))return K}function v(K,U){if(K==null)return{};var X=y(K,U),B,N;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(K);for(N=0;N<z.length;N++){if(B=z[N],U.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(K,B))continue;X[B]=K[B]}}return X}function y(K,U){if(K==null)return{};var X={},B=Object.keys(K),N,z;for(z=0;z<B.length;z++){if(N=B[z],U.indexOf(N)>=0)continue;X[N]=K[N]}return X}var T=0;function A(K){return+K.replace("%","")}function p(K){return Array.isArray(K)?K:[K]}function D(K,U,X,B){var N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,z=arguments.length>5?arguments[5]:void 0,te=50-B/2,ce=0,be=-te,Fe=0,Oe=-2*te;switch(z){case"left":ce=-te,be=0,Fe=2*te,Oe=0;break;case"right":ce=te,be=0,Fe=-2*te,Oe=0;break;case"bottom":be=te,Oe=2*te;break;default:}var Re="M 50,50 m ".concat(ce,",").concat(be,`
a `).concat(te,",").concat(te," 0 1 1 ").concat(Fe,",").concat(-Oe,`
a `).concat(te,",").concat(te," 0 1 1 ").concat(-Fe,",").concat(Oe),Be=Math.PI*2*te,Ke={stroke:X,strokeDasharray:"".concat(U/100*(Be-N),"px ").concat(Be,"px"),strokeDashoffset:"-".concat(N/2+K/100*(Be-N),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Re,pathStyle:Ke}}var O=function(U){var X=U.prefixCls,B=U.strokeWidth,N=U.trailWidth,z=U.gapDegree,te=U.gapPosition,ce=U.trailColor,be=U.strokeLinecap,Fe=U.style,Oe=U.className,Re=U.strokeColor,Be=U.percent,Ke=v(U,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Ae=Object(V.useMemo)(function(){return T+=1,T},[]),_e=D(0,100,ce,B,z,te),le=_e.pathString,Ee=_e.pathStyle,pe=p(Be),Ge=p(Re),Ye=Ge.find(function(He){return Object.prototype.toString.call(He)==="[object Object]"}),ze=f(pe),Ze=c(ze,1),Je=Ze[0],$e=function(){var Ue=0;return pe.map(function(Pe,ke){var re=Ge[ke]||Ge[Ge.length-1],ve=Object.prototype.toString.call(re)==="[object Object]"?"url(#".concat(X,"-gradient-").concat(Ae,")"):"",ae=D(Ue,Pe,re,B,z,te);return Ue+=Pe,L.a.createElement("path",{key:ke,className:"".concat(X,"-circle-path"),d:ae.pathString,stroke:ve,strokeLinecap:be,strokeWidth:B,opacity:Pe===0?0:1,fillOpacity:"0",style:ae.pathStyle,ref:Je[ke]})})};return L.a.createElement("svg",l({className:k()("".concat(X,"-circle"),Oe),viewBox:"0 0 100 100",style:Fe},Ke),Ye&&L.a.createElement("defs",null,L.a.createElement("linearGradient",{id:"".concat(X,"-gradient-").concat(Ae),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ye).sort(function(He,Ue){return A(He)-A(Ue)}).map(function(He,Ue){return L.a.createElement("stop",{key:Ue,offset:He,stopColor:Ye[He]})}))),L.a.createElement("path",{className:"".concat(X,"-circle-trail"),d:le,stroke:ce,strokeLinecap:be,strokeWidth:N||B,fillOpacity:"0",style:Ee}),$e().reverse())};O.defaultProps=M;var P=O,j={Line:s,Circle:P}},hXwI:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(M,f){if(!(M instanceof f))throw new TypeError("Cannot call a class as a function")}function L(M,f){for(var E=0;E<f.length;E++){var x=f[E];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(M,x.key,x)}}function I(M,f,E){return f&&L(M.prototype,f),E&&L(M,E),M}var k=function(){function M(){V(this,M)}return I(M,[{key:"decodeRect",value:function(E,x,g,h,o,u,r){if(o.rQwait("COPYRECT",4))return!1;var n=o.rQshift16(),t=o.rQshift16();return u.copyImage(n,t,E,x,g,h),!0}}]),M}();fe.default=k},iJb0:function(at,fe,oe){"use strict";oe.r(fe);var V=oe("+L6B"),L=oe("2/Rp"),I=oe("miYZ"),k=oe("tsqr"),M=oe("14J3"),f=oe("BMrR"),E=oe("jCWc"),x=oe("kPKH"),g=oe("k1fw"),h=oe("9og8"),o=oe("2qtc"),u=oe("kLXV"),r=oe("tJVT"),n=oe("PpiC"),t=oe("aHsQ"),i=oe("sGsY"),s=oe("WmNS"),l=oe.n(s),c=oe("q1tI"),d=oe.n(c),w=oe("9kvl"),m=oe("Lmeb"),S=oe("Ot1p"),C=oe("Dqnf"),v=oe("dhSg"),y=oe("MXD1"),T=oe("CFYs"),A=oe("rAM+"),p=oe("IxHN"),D=oe("bdgK"),O=oe("M8RZ"),P=oe("Ty5D"),j=oe("1dTM"),K=oe.n(j),U=oe("HBuW"),X=oe("VaU+"),B=oe.n(X),N=oe("ye1Q"),z=d.a.createElement(N.a,{style:{fontSize:24},spin:!0});function te(le){return le.replace(/\\u([\dA-Za-z]{4})/g,function(Ee,pe){return String.fromCharCode(parseInt("0x"+pe))})}function ce(le){le||(le=window.location.search);var Ee=le.substr(1),pe={};return Ee.split("&").forEach(function(Ge){var Ye=Ge.split("=");pe[Ye[0]]=decodeURIComponent(Ye[1])}),pe}var be={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"},Fe;(function(le){le[le.SET_LOADING=0]="SET_LOADING",le[le.SET_IS_LARGE=1]="SET_IS_LARGE",le[le.SET_MES=2]="SET_MES",le[le.SET_STATE=3]="SET_STATE",le[le.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",le[le.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"})(Fe||(Fe={}));function Oe(le,Ee){switch(Ee.type){case Fe.SET_LOADING:return Object(g.a)(Object(g.a)({},le),{},{loading:Ee.payload});case Fe.SET_IS_LARGE:return Object(g.a)(Object(g.a)({},le),{},{isLarge:Ee.payload});case Fe.SET_MES:return Object(g.a)(Object(g.a)({},le),{},{mes:Ee.payload});case Fe.SET_STATE:return Object(g.a)(Object(g.a)({},le),Ee.payload);case Fe.SET_TRANSFER_CONTENT:return Object(g.a)(Object(g.a)({},le),{},{transferContent:Ee.payload});case Fe.SHOW_CLIPBOARD_BOX:return Object(g.a)(Object(g.a)({},le),{},{showClipBoardBox:Ee.payload});default:throw new Error}}var Re=function(le){var Ee=le.vnc_url,pe=le.window_vnc_url,Ge=le.taskId,Ye=Object(c.useRef)(),ze=Object(c.useRef)(),Ze=Object(c.useReducer)(Oe,be),Je=Object(r.a)(Ze,2),$e=Je[0],He=Je[1],Ue=Object(c.useState)(0),Pe=Object(r.a)(Ue,2),ke=Pe[0],re=Pe[1],ve=$e.mes,ae=$e.loading,De=$e.showClipBoardBox,qe=$e.isLarge,et=$e.transferContent,je=Object(c.useState)(0),ct=Object(r.a)(je,2),he=ct[0],Te=ct[1],We,xe=Object(c.useRef)(),ge=Object(P.i)();function ye(){He({type:Fe.SHOW_CLIPBOARD_BOX,payload:!1})}function J(){He({type:Fe.SET_IS_LARGE,payload:!qe})}function ne(G){var we;return Ye.current&&(we=new D.default(function(Ne){var de=Object(A.a)(Ne),Se;try{for(de.s();!(Se=de.n()).done;){var Xe=Se.value;(Xe.target.offsetHeight>0||Xe.target.offsetWidth>0)&&G._eventHandlers.windowResize()}}catch(lt){de.e(lt)}finally{de.f()}}),we.observe(Ye.current)),we}var q=function(){var G=Object(h.a)(l.a.mark(function we(){var Ne;return l.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(U.sb)(Object(g.a)({},ge));case 2:if(Ne=Se.sent,!((Ne==null?void 0:Ne.status)===-3)){Se.next=5;break}return Se.abrupt("return",new Promise(function(){var Xe=Object(h.a)(l.a.mark(function lt(tt,st){return l.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:u.a.confirm({content:"\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6windows\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",okText:"\u7ACB\u5373\u5173\u95ED",cancelText:"\u7A0D\u540E\u5173\u95ED",onOk:function(){var _t=Object(h.a)(l.a.mark(function kt(){return l.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return clearTimeout(We),Te(0),q(),nt.abrupt("return");case 4:case"end":return nt.stop()}},kt)}));function ft(){return _t.apply(this,arguments)}return ft}()});case 1:case"end":return Ct.stop()}},lt)}));return function(lt,tt){return Xe.apply(this,arguments)}}()));case 5:if(!((Ne==null?void 0:Ne.status)===-1)){Se.next=7;break}throw new String(Ne==null?void 0:Ne.message);case 7:return v.a.publish("update-windows-time",Ne==null?void 0:Ne.data),Se.abrupt("return",Ne);case 9:case"end":return Se.stop()}},we)}));return function(){return G.apply(this,arguments)}}();Object(c.useEffect)(function(){return xe.current=setTimeout(function(){u.a.confirm({title:d.a.createElement(d.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 5 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){v.a.publish("delayed-time",1),re(ke+1)}})},1e3*60*60),function(){clearTimeout(xe.current)}},[]),Object(c.useEffect)(function(){var G,we;function Ne(st){pe&&(k.b.warn("\u7531\u4E8E\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\uFF0C\u8FDE\u63A5\u5931\u6548\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5Windows VNC\u670D\u52A1"),He({type:Fe.SET_LOADING,payload:!0}),re(ke+1))}function de(){clearTimeout(We),Te(100),setTimeout(function(){He({type:Fe.SET_LOADING,payload:!1})},1300),v.a.subscribe("send-ctrl-alt-delete",function(){var st;(st=G)===null||st===void 0||st.sendCtrlAltDel()})}function Se(st){var mt=te(st.detail.text);He({type:Fe.SET_TRANSFER_CONTENT,payload:mt})}if((pe||Ee)&&Ye.current){new Promise(Object(h.a)(l.a.mark(function st(){var mt,Ct,_t,ft,kt,Nt,nt,Tt,It,wt;return l.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return mt=ce(),Ct="",zt.next=4,q();case 4:ft=zt.sent,pe?(_t="Edu123",Ct=decodeURIComponent(ft==null||((kt=ft.data)===null||kt===void 0)?void 0:kt.vnc_url)):(nt=new URL(ft==null||((Nt=ft.data)===null||Nt===void 0)?void 0:Nt.vnc_url),Tt=nt.protocol,It=nt.searchParams,wt=nt.host,_t=It.get("password"),Ct="".concat(Tt==="https:"?"wss":"ws","://").concat(wt,"/").concat(mt.path||"websockify")),G=new K.a(Ye.current,Ct,{credentials:{password:_t},wsProtocols:["binary"]}),we=ne(G),G.viewOnly=mt.view_only||!1,pe?G.scaleViewport=!0:G.scaleViewport=mt.scale||!1,G.scaleViewport=mt.scale||!0,G.resizeSession=!0,ze.current=G,G.addEventListener("disconnect",Ne),G.addEventListener("connect",de),G.addEventListener("clipboard",Se);case 16:case"end":return zt.stop()}},st)})));var Xe=v.a.subscribe("vnc-reseting",function(){He({type:Fe.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),lt=v.a.subscribe("vnc-enlarge",function(){He({type:Fe.SET_IS_LARGE,payload:!0})}),tt=v.a.subscribe("show-clipboard-box",function(){He({type:Fe.SHOW_CLIPBOARD_BOX,payload:!0})});return Te(0),function(){var st,mt,Ct,_t;(st=G)===null||st===void 0||st.removeEventListener("disconnect",Ne),(mt=G)===null||mt===void 0||mt.removeEventListener("connect",de),(Ct=G)===null||Ct===void 0||Ct.removeEventListener("clipboard",Se),Xe(),lt(),tt(),(_t=we)===null||_t===void 0||_t.unobserve(Ye.current)}}},[Ee,pe,ke]);function me(G){var we;(we=ze.current)===null||we===void 0||we.clipboardPasteFrom(G),He({type:Fe.SET_TRANSFER_CONTENT,payload:G}),k.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),ye()}Object(c.useEffect)(function(){he==0&&Ce()},[he]);var Ce=function G(){he>99?he=99:(he=he+1,We=setTimeout(function(){G()},1500)),he<100&&Te(he)};return d.a.createElement(c.Fragment,null,d.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(pe?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(qe?"full-screen":"")},d.a.createElement("a",{className:"btn-vnc-resize",onClick:J},d.a.createElement("i",{className:"iconfont ".concat(qe?"icon-tuichuquanping1":"icon-quanping1")})),ae?d.a.createElement(p.a,{className:B.a.spin,message:ve,style:{color:"#0152d9"}},d.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},d.a.createElement(T.a,{percent:he,format:function(we){return d.a.createElement("span",{className:"c-white"},we,"%")}}))):null,d.a.createElement("div",{ref:Ye,className:"vnc-panel ".concat(ae?"hide":"animated fadeIn")})),d.a.createElement(O.a,null))},Be=oe("m3rI"),Ke=i.a.Countdown,Ae=function(Ee){var pe,Ge,Ye=Ee.shixunsDetail,ze=Ee.globalSetting,Ze=Ee.loading,Je=Ee.dispatch,$e=Ee.user,He=Ee.history,Ue=Object(n.a)(Ee,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),Pe=Object(c.useState)({}),ke=Object(r.a)(Pe,2),re=ke[0],ve=ke[1],ae=Object(c.useState)(400),De=Object(r.a)(ae,2),qe=De[0],et=De[1],je=Object(c.useState)(!1),ct=Object(r.a)(je,2),he=ct[0],Te=ct[1],We=Object(c.useState)(""),xe=Object(r.a)(We,2),ge=xe[0],ye=xe[1],J=Object(c.useState)(Date.now()+1e3*60*60),ne=Object(r.a)(J,2),q=ne[0],me=ne[1],Ce=Ue.match.params,G=Ue.location.query,we=Object(c.useState)(!1),Ne=Object(r.a)(we,2),de=Ne[0],Se=Ne[1],Xe=Ye.mirrorApplies,lt=Object(c.useRef)();Object(c.useEffect)(function(){return Je({type:"globalSetting/headerFooterToggle",payload:!1}),st(),mt(),window.addEventListener("resize",st),v.a.subscribe("delayed-time",function(){me(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",st),clearTimeout(lt.current),Je({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(c.useEffect)(function(){re.host&&setTimeout(function(){v.a.publish("create-socket",1)},1500)},[re]),Object(c.useEffect)(function(){Xe.webssh&&(tt(),lt.current=setTimeout(function(){u.a.confirm({title:d.a.createElement(d.a.Fragment,null,"\u5B9E\u9A8C\u73AF\u5883\u5EF6\u65F6\u63D0\u9192"),content:"\u5F53\u524D\u5B9E\u9A8C\u73AF\u5883\u5C06\u4E8E 15 \u5206\u949F\u540E\u5173\u95ED\uFF0C\u9700\u8981\u5EF6\u957F\u4F7F\u7528\u65F6\u95F4\u5417\uFF1F",okText:"\u7ACB\u5373\u5EF6\u957F",cancelText:"\u4E0D\u9700\u8981",onOk:function(){v.a.publish("ssh-add-connect-time",{}),v.a.publish("delayed-time",1)}})},1e3*60*60)),Xe.id&&st()},[Xe]);var tt=function(){var Ct=Object(h.a)(l.a.mark(function _t(){var ft;return l.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(U.tb)(Object(g.a)({},Ce));case 2:ft=Nt.sent,ve(Object(g.a)({},ft));case 4:case"end":return Nt.stop()}},_t)}));return function(){return Ct.apply(this,arguments)}}(),st=function(){var _t=window.innerHeight;et(_t-(Xe.audit_remark?400:270))},mt=function(){var Ct=Object(h.a)(l.a.mark(function _t(){return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:Je({type:"shixunsDetail/getMirrorApplies",payload:Object(g.a)({},Ce)});case 1:case"end":return kt.stop()}},_t)}));return function(){return Ct.apply(this,arguments)}}();return console.log($e==null?void 0:$e.userInfo),d.a.createElement("section",{className:B.a.wrp},d.a.createElement("header",{className:B.a.header},d.a.createElement(f.a,{align:"middle"},d.a.createElement(x.a,{flex:"1"},d.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat(Be.a.IMG_SERVER,"/images/").concat($e==null||((pe=$e.userInfo)===null||pe===void 0)?void 0:pe.image_url),width:"40",style:{borderRadius:"50%"}}),d.a.createElement("span",{className:"ml10"},$e==null||((Ge=$e.userInfo)===null||Ge===void 0)?void 0:Ge.real_name)),d.a.createElement(x.a,{flex:"1"},d.a.createElement("span",{className:"mr10 font18"},Xe.name)),d.a.createElement(x.a,null,d.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",d.a.createElement(Ke,{className:B.a.cuttDown,value:q,format:"mm:ss",valueStyle:{color:"#FFF"}})),d.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){u.a.confirm({title:"\u9000\u51FA\u955C\u50CF",content:"\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u955C\u50CF\u5417\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var ft;He.push("/users/".concat((ft=$e.userInfo)===null||ft===void 0?void 0:ft.login,"/experiment-img"))}})}})))),d.a.createElement("aside",{className:B.a.container},d.a.createElement(f.a,null,d.a.createElement(x.a,{style:{position:"relative",width:de?"0%":"40%"}},d.a.createElement("section",{className:"".concat(B.a.info," ml40 mr40"),style:{display:de?"none":"flex"}},d.a.createElement("aside",null,d.a.createElement(f.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},d.a.createElement(x.a,{className:"font18"},"\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E ",d.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8BF7\u6309\u6A21\u677F\u586B\u5199\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E"))),d.a.createElement("aside",{className:"mt30 flex1"},d.a.createElement(S.a,{height:qe,defaultValue:Xe.description||"",onChange:function(_t){return ye(_t)}}),Xe.audit_remark&&d.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\uFF1A",d.a.createElement("span",{className:"c-red"},Xe.audit_remark))),d.a.createElement("aside",{className:"mb20"},d.a.createElement(f.a,{justify:"center",gutter:[20,20],className:B.a.buttons},d.a.createElement(x.a,null,d.a.createElement(L.a,{type:"primary",size:"large",loading:he,onClick:Object(h.a)(l.a.mark(function Ct(){var _t;return l.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return Te(!0),u.a.info({title:"\u4FDD\u5B58\u955C\u50CF",centered:!0,content:"\u4E34\u65F6\u955C\u50CF\u7CFB\u7EDF\u9ED8\u8BA4\u53EA\u4FDD\u5B5830\u5929\uFF0C\u8FC7\u671F\u5C06\u4F1A\u81EA\u52A8\u6E05\u7406\u3002\u8BF7\u5C3D\u5FEB\u7533\u8BF7\u53D1\u5E03\u3002",okText:"\u6211\u77E5\u9053\u4E86",onOk:function(){}}),kt.next=4,Object(U.vb)(Object(g.a)(Object(g.a)({},Ce),{},{description:ge}));case 4:_t=kt.sent,(_t==null?void 0:_t.status)===0&&k.b.success("\u4FDD\u5B58\u6210\u529F"),Te(!1);case 7:case"end":return kt.stop()}},Ct)}))},"\u4FDD\u5B58")),d.a.createElement(x.a,null,d.a.createElement(L.a,{type:"primary",ghost:!0,size:"large",onClick:Object(h.a)(l.a.mark(function Ct(){return l.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:u.a.confirm({title:"\u7533\u8BF7\u53D1\u5E03",centered:!0,content:"\u4F60\u786E\u5B9A\u8981\u7533\u8BF7\u53D1\u5E03\u8BE5\u955C\u50CF\uFF1F",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var kt=Object(h.a)(l.a.mark(function nt(){var Tt,It;return l.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:return Ft.next=2,Object(U.ub)(Object(g.a)(Object(g.a)({},Ce),{},{description:ge}));case 2:Tt=Ft.sent,(Tt==null?void 0:Tt.status)===0&&(He.push("/users/".concat((It=$e.userInfo)===null||It===void 0?void 0:It.login,"/experiment-img")),k.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return Ft.stop()}},nt)}));function Nt(){return kt.apply(this,arguments)}return Nt}()});case 1:case"end":return ft.stop()}},Ct)}))},"\u7533\u8BF7\u53D1\u5E03")))))),d.a.createElement("div",{className:de?B.a.elseShrink:B.a.shrink,onClick:function(){return Se(!de)}},d.a.createElement("i",{className:"iconfont icon-cela"}))),d.a.createElement(x.a,{style:{background:"#000",width:de?"100%":"60%"}},d.a.createElement("div",null,d.a.createElement("aside",{className:B.a.fullBtn},d.a.createElement("span",{className:"icon-quanping"})),Xe.webssh&&d.a.createElement(C.a,{sshConfigData:re,sid:1}),((Xe==null?void 0:Xe.vnc)||(Xe==null?void 0:Xe.windows))&&d.a.createElement(Re,{taskId:Xe.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:Xe.vnc,window_vnc_url:Xe.windows}))))))},_e=fe.default=Object(w.a)(function(le){var Ee=le.shixunsDetail,pe=le.loading,Ge=le.user,Ye=le.globalSetting;return{shixunsDetail:Ee,globalSetting:Ye,user:Ge,loading:pe.models.shixunsDetail}})(Ae)},iUHT:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;function V(m,S){if(!(m instanceof S))throw new TypeError("Cannot call a class as a function")}function L(m,S){for(var C=0;C<S.length;C++){var v=S[C];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}function I(m,S,C){return S&&L(m.prototype,S),C&&L(m,C),m}var k=[13,16,10,23,0,4,2,27,14,5,20,9,22,18,11,3,25,7,15,6,26,19,12,1,40,51,30,36,46,54,29,39,50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31],M=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],f=0,E,x,g,h,o,u;E=1<<16,x=1<<24,g=E|x,h=1<<2,o=1<<10,u=h|o;var r=[g|o,f|f,E|f,g|u,g|h,E|u,f|h,E|f,f|o,g|o,g|u,f|o,x|u,g|h,x|f,f|h,f|u,x|o,x|o,E|o,E|o,g|f,g|f,x|u,E|h,x|h,x|h,E|h,f|f,f|u,E|u,x|f,E|f,g|u,f|h,g|f,g|o,x|f,x|f,f|o,g|h,E|f,E|o,x|h,f|o,f|h,x|u,E|u,g|u,E|h,g|f,x|u,x|h,f|u,E|u,g|o,f|u,x|o,x|o,f|f,E|h,E|o,f|f,g|h];E=1<<20,x=1<<31,g=E|x,h=1<<5,o=1<<15,u=h|o;var n=[g|u,x|o,f|o,E|u,E|f,f|h,g|h,x|u,x|h,g|u,g|o,x|f,x|o,E|f,f|h,g|h,E|o,E|h,x|u,f|f,x|f,f|o,E|u,g|f,E|h,x|h,f|f,E|o,f|u,g|o,g|f,f|u,f|f,E|u,g|h,E|f,x|u,g|f,g|o,f|o,g|f,x|o,f|h,g|u,E|u,f|h,f|o,x|f,f|u,g|o,E|f,x|h,E|h,x|u,x|h,E|h,E|o,f|f,x|o,f|u,x|f,g|h,g|u,E|o];E=1<<17,x=1<<27,g=E|x,h=1<<3,o=1<<9,u=h|o;var t=[f|u,g|o,f|f,g|h,x|o,f|f,E|u,x|o,E|h,x|h,x|h,E|f,g|u,E|h,g|f,f|u,x|f,f|h,g|o,f|o,E|o,g|f,g|h,E|u,x|u,E|o,E|f,x|u,f|h,g|u,f|o,x|f,g|o,x|f,E|h,f|u,E|f,g|o,x|o,f|f,f|o,E|h,g|u,x|o,x|h,f|o,f|f,g|h,x|u,E|f,x|f,g|u,f|h,E|u,E|o,x|h,g|f,x|u,f|u,g|f,E|u,f|h,g|h,E|o];E=1<<13,x=1<<23,g=E|x,h=1<<0,o=1<<7,u=h|o;var i=[g|h,E|u,E|u,f|o,g|o,x|u,x|h,E|h,f|f,g|f,g|f,g|u,f|u,f|f,x|o,x|h,f|h,E|f,x|f,g|h,f|o,x|f,E|h,E|o,x|u,f|h,E|o,x|o,E|f,g|o,g|u,f|u,x|o,x|h,g|f,g|u,f|u,f|f,f|f,g|f,E|o,x|o,x|u,f|h,g|h,E|u,E|u,f|o,g|u,f|u,f|h,E|f,x|h,E|h,g|o,x|u,E|h,E|o,x|f,g|h,f|o,x|f,E|f,g|o];E=1<<25,x=1<<30,g=E|x,h=1<<8,o=1<<19,u=h|o;var s=[f|h,E|u,E|o,g|h,f|o,f|h,x|f,E|o,x|u,f|o,E|h,x|u,g|h,g|o,f|u,x|f,E|f,x|o,x|o,f|f,x|h,g|u,g|u,E|h,g|o,x|h,f|f,g|f,E|u,E|f,g|f,f|u,f|o,g|h,f|h,E|f,x|f,E|o,g|h,x|u,E|h,x|f,g|o,E|u,x|u,f|h,E|f,g|o,g|u,f|u,g|f,g|u,E|o,f|f,x|o,g|f,f|u,E|h,x|h,f|o,f|f,x|o,E|u,x|h];E=1<<22,x=1<<29,g=E|x,h=1<<4,o=1<<14,u=h|o;var l=[x|h,g|f,f|o,g|u,g|f,f|h,g|u,E|f,x|o,E|u,E|f,x|h,E|h,x|o,x|f,f|u,f|f,E|h,x|u,f|o,E|o,x|u,f|h,g|h,g|h,f|f,E|u,g|o,f|u,E|o,g|o,x|f,x|o,f|h,g|h,E|o,g|u,E|f,f|u,x|h,E|f,x|o,x|f,f|u,x|h,g|u,E|o,g|f,E|u,g|o,f|f,g|h,f|h,f|o,g|f,E|u,f|o,E|h,x|u,f|f,g|o,x|f,E|h,x|u];E=1<<21,x=1<<26,g=E|x,h=1<<1,o=1<<11,u=h|o;var c=[E|f,g|h,x|u,f|f,f|o,x|u,E|u,g|o,g|u,E|f,f|f,x|h,f|h,x|f,g|h,f|u,x|o,E|u,E|h,x|o,x|h,g|f,g|o,E|h,g|f,f|o,f|u,g|u,E|o,f|h,x|f,E|o,x|f,E|o,E|f,x|u,x|u,g|h,g|h,f|h,E|h,x|f,x|o,E|f,g|o,f|u,E|u,g|o,f|u,x|h,g|u,g|f,E|o,f|f,f|h,g|u,f|f,E|u,g|f,f|o,x|h,x|o,f|o,E|h];E=1<<18,x=1<<28,g=E|x,h=1<<6,o=1<<12,u=h|o;var d=[x|u,f|o,E|f,g|u,x|f,x|u,f|h,x|f,E|h,g|f,g|u,E|o,g|o,E|u,f|o,f|h,g|f,x|h,x|o,f|u,E|o,E|h,g|h,g|o,f|u,f|f,f|f,g|h,x|h,x|o,E|u,E|f,E|u,E|f,g|o,f|o,f|h,g|h,f|o,E|u,x|o,f|h,x|h,g|f,g|h,x|f,E|f,x|u,f|f,g|u,E|h,x|h,g|f,x|o,x|u,f|f,g|u,E|o,E|o,f|u,f|u,E|h,x|f,g|o],w=function(){function m(S){V(this,m),this.keys=[];for(var C=[],v=[],y=[],T=0,A=56;T<56;++T,A-=8){A+=A<-5?65:A<-3?31:A<-1?63:A===27?35:0;var p=A&7;C[T]=(S[A>>>3]&1<<p)!==0?1:0}for(var D=0;D<16;++D){var O=D<<1,P=O+1;y[O]=y[P]=0;for(var j=28;j<59;j+=28)for(var K=j-28;K<j;++K){var U=K+M[D];v[K]=U<j?C[U]:C[U-28]}for(var X=0;X<24;++X)v[k[X]]!==0&&(y[O]|=1<<23-X),v[k[X+24]]!==0&&(y[P]|=1<<23-X)}for(var B=0,N=0,z=0;B<16;++B){var te=y[N++],ce=y[N++];this.keys[z]=(te&16515072)<<6,this.keys[z]|=(te&4032)<<10,this.keys[z]|=(ce&16515072)>>>10,this.keys[z]|=(ce&4032)>>>6,++z,this.keys[z]=(te&258048)<<12,this.keys[z]|=(te&63)<<16,this.keys[z]|=(ce&258048)>>>4,this.keys[z]|=ce&63,++z}}return I(m,[{key:"enc8",value:function(C){var v=C.slice(),y=0,T,A,p;T=v[y++]<<24|v[y++]<<16|v[y++]<<8|v[y++],A=v[y++]<<24|v[y++]<<16|v[y++]<<8|v[y++],p=(T>>>4^A)&252645135,A^=p,T^=p<<4,p=(T>>>16^A)&65535,A^=p,T^=p<<16,p=(A>>>2^T)&858993459,T^=p,A^=p<<2,p=(A>>>8^T)&16711935,T^=p,A^=p<<8,A=A<<1|A>>>31&1,p=(T^A)&2863311530,T^=p,A^=p,T=T<<1|T>>>31&1;for(var D=0,O=0;D<8;++D){p=A<<28|A>>>4,p^=this.keys[O++];var P=c[p&63];P|=s[p>>>8&63],P|=t[p>>>16&63],P|=r[p>>>24&63],p=A^this.keys[O++],P|=d[p&63],P|=l[p>>>8&63],P|=i[p>>>16&63],P|=n[p>>>24&63],T^=P,p=T<<28|T>>>4,p^=this.keys[O++],P=c[p&63],P|=s[p>>>8&63],P|=t[p>>>16&63],P|=r[p>>>24&63],p=T^this.keys[O++],P|=d[p&63],P|=l[p>>>8&63],P|=i[p>>>16&63],P|=n[p>>>24&63],A^=P}for(A=A<<31|A>>>1,p=(T^A)&2863311530,T^=p,A^=p,T=T<<31|T>>>1,p=(T>>>8^A)&16711935,A^=p,T^=p<<8,p=(T>>>2^A)&858993459,A^=p,T^=p<<2,p=(A>>>16^T)&65535,T^=p,A^=p<<16,p=(A>>>4^T)&252645135,T^=p,A^=p<<4,p=[A,T],y=0;y<8;y++)v[y]=(p[y>>>2]>>>8*(3-y%4))%256,v[y]<0&&(v[y]+=256);return v}},{key:"encrypt",value:function(C){return this.enc8(C.slice(0,8)).concat(this.enc8(C.slice(8,16)))}}]),m}();fe.default=w},kSUc:function(at,fe,oe){},lNSK:function(at,fe,oe){"use strict";function V(G){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(Ne){return typeof Ne}:V=function(Ne){return Ne&&typeof Symbol=="function"&&Ne.constructor===Symbol&&Ne!==Symbol.prototype?"symbol":typeof Ne},V(G)}Object.defineProperty(fe,"__esModule",{value:!0}),fe.deflateInit=J,fe.deflateInit2=ye,fe.deflateReset=xe,fe.deflateResetKeep=We,fe.deflateSetHeader=ge,fe.deflate=ne,fe.deflateEnd=q,fe.deflateSetDictionary=me,fe.deflateInfo=fe.Z_DEFLATED=fe.Z_UNKNOWN=fe.Z_DEFAULT_STRATEGY=fe.Z_FIXED=fe.Z_RLE=fe.Z_HUFFMAN_ONLY=fe.Z_FILTERED=fe.Z_DEFAULT_COMPRESSION=fe.Z_BUF_ERROR=fe.Z_DATA_ERROR=fe.Z_STREAM_ERROR=fe.Z_STREAM_END=fe.Z_OK=fe.Z_BLOCK=fe.Z_FINISH=fe.Z_FULL_FLUSH=fe.Z_PARTIAL_FLUSH=fe.Z_NO_FLUSH=void 0;var L=g(oe("6BzB")),I=g(oe("c5fP")),k=E(oe("xlC8")),M=E(oe("QV2g")),f=E(oe("xSIq"));function E(G){return G&&G.__esModule?G:{default:G}}function x(){if(typeof WeakMap!="function")return null;var G=new WeakMap;return x=function(){return G},G}function g(G){if(G&&G.__esModule)return G;if(G===null||V(G)!=="object"&&typeof G!="function")return{default:G};var we=x();if(we&&we.has(G))return we.get(G);var Ne={},de=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Se in G)if(Object.prototype.hasOwnProperty.call(G,Se)){var Xe=de?Object.getOwnPropertyDescriptor(G,Se):null;Xe&&(Xe.get||Xe.set)?Object.defineProperty(Ne,Se,Xe):Ne[Se]=G[Se]}return Ne.default=G,we&&we.set(G,Ne),Ne}var h=0;fe.Z_NO_FLUSH=h;var o=1;fe.Z_PARTIAL_FLUSH=o;var u=3;fe.Z_FULL_FLUSH=u;var r=4;fe.Z_FINISH=r;var n=5;fe.Z_BLOCK=n;var t=0;fe.Z_OK=t;var i=1;fe.Z_STREAM_END=i;var s=-2;fe.Z_STREAM_ERROR=s;var l=-3;fe.Z_DATA_ERROR=l;var c=-5;fe.Z_BUF_ERROR=c;var d=-1;fe.Z_DEFAULT_COMPRESSION=d;var w=1;fe.Z_FILTERED=w;var m=2;fe.Z_HUFFMAN_ONLY=m;var S=3;fe.Z_RLE=S;var C=4;fe.Z_FIXED=C;var v=0;fe.Z_DEFAULT_STRATEGY=v;var y=2;fe.Z_UNKNOWN=y;var T=8;fe.Z_DEFLATED=T;var A=9,p=15,D=8,O=29,P=256,j=P+1+O,K=30,U=19,X=2*j+1,B=15,N=3,z=258,te=z+N+1,ce=32,be=42,Fe=69,Oe=73,Re=91,Be=103,Ke=113,Ae=666,_e=1,le=2,Ee=3,pe=4,Ge=3;function Ye(G,we){return G.msg=f.default[we],we}function ze(G){return(G<<1)-(G>4?9:0)}function Ze(G){for(var we=G.length;--we>=0;)G[we]=0}function Je(G){var we=G.state,Ne=we.pending;if(Ne>G.avail_out&&(Ne=G.avail_out),Ne===0)return;L.arraySet(G.output,we.pending_buf,we.pending_out,Ne,G.next_out),G.next_out+=Ne,we.pending_out+=Ne,G.total_out+=Ne,G.avail_out-=Ne,we.pending-=Ne,we.pending===0&&(we.pending_out=0)}function $e(G,we){I._tr_flush_block(G,G.block_start>=0?G.block_start:-1,G.strstart-G.block_start,we),G.block_start=G.strstart,Je(G.strm)}function He(G,we){G.pending_buf[G.pending++]=we}function Ue(G,we){G.pending_buf[G.pending++]=we>>>8&255,G.pending_buf[G.pending++]=we&255}function Pe(G,we,Ne,de){var Se=G.avail_in;return Se>de&&(Se=de),Se===0?0:(G.avail_in-=Se,L.arraySet(we,G.input,G.next_in,Se,Ne),G.state.wrap===1?G.adler=(0,k.default)(G.adler,we,Se,Ne):G.state.wrap===2&&(G.adler=(0,M.default)(G.adler,we,Se,Ne)),G.next_in+=Se,G.total_in+=Se,Se)}function ke(G,we){var Ne=G.max_chain_length,de=G.strstart,Se,Xe,lt=G.prev_length,tt=G.nice_match,st=G.strstart>G.w_size-te?G.strstart-(G.w_size-te):0,mt=G.window,Ct=G.w_mask,_t=G.prev,ft=G.strstart+z,kt=mt[de+lt-1],Nt=mt[de+lt];G.prev_length>=G.good_match&&(Ne>>=2),tt>G.lookahead&&(tt=G.lookahead);do{if(Se=we,mt[Se+lt]!==Nt||mt[Se+lt-1]!==kt||mt[Se]!==mt[de]||mt[++Se]!==mt[de+1])continue;de+=2,Se++;do;while(mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&mt[++de]===mt[++Se]&&de<ft);if(Xe=z-(ft-de),de=ft-z,Xe>lt){if(G.match_start=we,lt=Xe,Xe>=tt)break;kt=mt[de+lt-1],Nt=mt[de+lt]}}while((we=_t[we&Ct])>st&&--Ne!==0);return lt<=G.lookahead?lt:G.lookahead}function re(G){var we=G.w_size,Ne,de,Se,Xe,lt;do{if(Xe=G.window_size-G.lookahead-G.strstart,G.strstart>=we+(we-te)){L.arraySet(G.window,G.window,we,we,0),G.match_start-=we,G.strstart-=we,G.block_start-=we,de=G.hash_size,Ne=de;do Se=G.head[--Ne],G.head[Ne]=Se>=we?Se-we:0;while(--de);de=we,Ne=de;do Se=G.prev[--Ne],G.prev[Ne]=Se>=we?Se-we:0;while(--de);Xe+=we}if(G.strm.avail_in===0)break;if(de=Pe(G.strm,G.window,G.strstart+G.lookahead,Xe),G.lookahead+=de,G.lookahead+G.insert>=N)for(lt=G.strstart-G.insert,G.ins_h=G.window[lt],G.ins_h=(G.ins_h<<G.hash_shift^G.window[lt+1])&G.hash_mask;G.insert&&!(G.ins_h=(G.ins_h<<G.hash_shift^G.window[lt+N-1])&G.hash_mask,G.prev[lt&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=lt,lt++,G.insert--,G.lookahead+G.insert<N););}while(G.lookahead<te&&G.strm.avail_in!==0)}function ve(G,we){var Ne=65535;for(Ne>G.pending_buf_size-5&&(Ne=G.pending_buf_size-5);;){if(G.lookahead<=1){if(re(G),G.lookahead===0&&we===h)return _e;if(G.lookahead===0)break}G.strstart+=G.lookahead,G.lookahead=0;var de=G.block_start+Ne;if((G.strstart===0||G.strstart>=de)&&(G.lookahead=G.strstart-de,G.strstart=de,$e(G,!1),G.strm.avail_out===0))return _e;if(G.strstart-G.block_start>=G.w_size-te&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=0,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):(G.strstart>G.block_start&&($e(G,!1),G.strm.avail_out===0),_e)}function ae(G,we){for(var Ne,de;;){if(G.lookahead<te){if(re(G),G.lookahead<te&&we===h)return _e;if(G.lookahead===0)break}if(Ne=0,G.lookahead>=N&&(G.ins_h=(G.ins_h<<G.hash_shift^G.window[G.strstart+N-1])&G.hash_mask,Ne=G.prev[G.strstart&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=G.strstart),Ne!==0&&G.strstart-Ne<=G.w_size-te&&(G.match_length=ke(G,Ne)),G.match_length>=N)if(de=I._tr_tally(G,G.strstart-G.match_start,G.match_length-N),G.lookahead-=G.match_length,G.match_length<=G.max_lazy_match&&G.lookahead>=N){G.match_length--;do G.strstart++,G.ins_h=(G.ins_h<<G.hash_shift^G.window[G.strstart+N-1])&G.hash_mask,Ne=G.prev[G.strstart&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=G.strstart;while(--G.match_length!==0);G.strstart++}else G.strstart+=G.match_length,G.match_length=0,G.ins_h=G.window[G.strstart],G.ins_h=(G.ins_h<<G.hash_shift^G.window[G.strstart+1])&G.hash_mask;else de=I._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++;if(de&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=G.strstart<N-1?G.strstart:N-1,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):G.last_lit&&($e(G,!1),G.strm.avail_out===0)?_e:le}function De(G,we){for(var Ne,de,Se;;){if(G.lookahead<te){if(re(G),G.lookahead<te&&we===h)return _e;if(G.lookahead===0)break}if(Ne=0,G.lookahead>=N&&(G.ins_h=(G.ins_h<<G.hash_shift^G.window[G.strstart+N-1])&G.hash_mask,Ne=G.prev[G.strstart&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=G.strstart),G.prev_length=G.match_length,G.prev_match=G.match_start,G.match_length=N-1,Ne!==0&&G.prev_length<G.max_lazy_match&&G.strstart-Ne<=G.w_size-te&&(G.match_length=ke(G,Ne),G.match_length<=5&&(G.strategy===w||G.match_length===N&&G.strstart-G.match_start>4096)&&(G.match_length=N-1)),G.prev_length>=N&&G.match_length<=G.prev_length){Se=G.strstart+G.lookahead-N,de=I._tr_tally(G,G.strstart-1-G.prev_match,G.prev_length-N),G.lookahead-=G.prev_length-1,G.prev_length-=2;do++G.strstart<=Se&&(G.ins_h=(G.ins_h<<G.hash_shift^G.window[G.strstart+N-1])&G.hash_mask,Ne=G.prev[G.strstart&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=G.strstart);while(--G.prev_length!==0);if(G.match_available=0,G.match_length=N-1,G.strstart++,de&&($e(G,!1),G.strm.avail_out===0))return _e}else if(G.match_available){if(de=I._tr_tally(G,0,G.window[G.strstart-1]),de&&$e(G,!1),G.strstart++,G.lookahead--,G.strm.avail_out===0)return _e}else G.match_available=1,G.strstart++,G.lookahead--}return G.match_available&&(de=I._tr_tally(G,0,G.window[G.strstart-1]),G.match_available=0),G.insert=G.strstart<N-1?G.strstart:N-1,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):G.last_lit&&($e(G,!1),G.strm.avail_out===0)?_e:le}function qe(G,we){for(var Ne,de,Se,Xe,lt=G.window;;){if(G.lookahead<=z){if(re(G),G.lookahead<=z&&we===h)return _e;if(G.lookahead===0)break}if(G.match_length=0,G.lookahead>=N&&G.strstart>0&&(Se=G.strstart-1,de=lt[Se],de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se])){Xe=G.strstart+z;do;while(de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&de===lt[++Se]&&Se<Xe);G.match_length=z-(Xe-Se),G.match_length>G.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=N?(Ne=I._tr_tally(G,1,G.match_length-N),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(Ne=I._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),Ne&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=0,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):G.last_lit&&($e(G,!1),G.strm.avail_out===0)?_e:le}function et(G,we){for(var Ne;;){if(G.lookahead===0&&(re(G),G.lookahead===0)){if(we===h)return _e;break}if(G.match_length=0,Ne=I._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,Ne&&($e(G,!1),G.strm.avail_out===0))return _e}return G.insert=0,we===r?($e(G,!0),G.strm.avail_out===0?Ee:pe):G.last_lit&&($e(G,!1),G.strm.avail_out===0)?_e:le}function je(G,we,Ne,de,Se){this.good_length=G,this.max_lazy=we,this.nice_length=Ne,this.max_chain=de,this.func=Se}var ct;ct=[new je(0,0,0,0,ve),new je(4,4,8,4,ae),new je(4,5,16,8,ae),new je(4,6,32,32,ae),new je(4,4,16,16,De),new je(8,16,32,32,De),new je(8,16,128,128,De),new je(8,32,128,256,De),new je(32,128,258,1024,De),new je(32,258,258,4096,De)];function he(G){G.window_size=2*G.w_size,Ze(G.head),G.max_lazy_match=ct[G.level].max_lazy,G.good_match=ct[G.level].good_length,G.nice_match=ct[G.level].nice_length,G.max_chain_length=ct[G.level].max_chain,G.strstart=0,G.block_start=0,G.lookahead=0,G.insert=0,G.match_length=G.prev_length=N-1,G.match_available=0,G.ins_h=0}function Te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new L.Buf16(X*2),this.dyn_dtree=new L.Buf16((2*K+1)*2),this.bl_tree=new L.Buf16((2*U+1)*2),Ze(this.dyn_ltree),Ze(this.dyn_dtree),Ze(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new L.Buf16(B+1),this.heap=new L.Buf16(2*j+1),Ze(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new L.Buf16(2*j+1),Ze(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function We(G){var we;return!G||!G.state?Ye(G,s):(G.total_in=G.total_out=0,G.data_type=y,we=G.state,we.pending=0,we.pending_out=0,we.wrap<0&&(we.wrap=-we.wrap),we.status=we.wrap?be:Ke,G.adler=we.wrap===2?0:1,we.last_flush=h,I._tr_init(we),t)}function xe(G){var we=We(G);return we===t&&he(G.state),we}function ge(G,we){return!G||!G.state||G.state.wrap!==2?s:(G.state.gzhead=we,t)}function ye(G,we,Ne,de,Se,Xe){if(!G)return s;var lt=1;if(we===d&&(we=6),de<0?(lt=0,de=-de):de>15&&(lt=2,de-=16),Se<1||Se>A||Ne!==T||de<8||de>15||we<0||we>9||Xe<0||Xe>C)return Ye(G,s);de===8&&(de=9);var tt=new Te;return G.state=tt,tt.strm=G,tt.wrap=lt,tt.gzhead=null,tt.w_bits=de,tt.w_size=1<<tt.w_bits,tt.w_mask=tt.w_size-1,tt.hash_bits=Se+7,tt.hash_size=1<<tt.hash_bits,tt.hash_mask=tt.hash_size-1,tt.hash_shift=~~((tt.hash_bits+N-1)/N),tt.window=new L.Buf8(tt.w_size*2),tt.head=new L.Buf16(tt.hash_size),tt.prev=new L.Buf16(tt.w_size),tt.lit_bufsize=1<<Se+6,tt.pending_buf_size=tt.lit_bufsize*4,tt.pending_buf=new L.Buf8(tt.pending_buf_size),tt.d_buf=1*tt.lit_bufsize,tt.l_buf=(1+2)*tt.lit_bufsize,tt.level=we,tt.strategy=Xe,tt.method=Ne,xe(G)}function J(G,we){return ye(G,we,T,p,D,v)}function ne(G,we){var Ne,de,Se,Xe;if(!G||!G.state||we>n||we<0)return G?Ye(G,s):s;if(de=G.state,!G.output||!G.input&&G.avail_in!==0||de.status===Ae&&we!==r)return Ye(G,G.avail_out===0?c:s);if(de.strm=G,Ne=de.last_flush,de.last_flush=we,de.status===be)if(de.wrap===2)G.adler=0,He(de,31),He(de,139),He(de,8),de.gzhead?(He(de,(de.gzhead.text?1:0)+(de.gzhead.hcrc?2:0)+(de.gzhead.extra?4:0)+(de.gzhead.name?8:0)+(de.gzhead.comment?16:0)),He(de,de.gzhead.time&255),He(de,de.gzhead.time>>8&255),He(de,de.gzhead.time>>16&255),He(de,de.gzhead.time>>24&255),He(de,de.level===9?2:de.strategy>=m||de.level<2?4:0),He(de,de.gzhead.os&255),de.gzhead.extra&&de.gzhead.extra.length&&(He(de,de.gzhead.extra.length&255),He(de,de.gzhead.extra.length>>8&255)),de.gzhead.hcrc&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending,0)),de.gzindex=0,de.status=Fe):(He(de,0),He(de,0),He(de,0),He(de,0),He(de,0),He(de,de.level===9?2:de.strategy>=m||de.level<2?4:0),He(de,Ge),de.status=Ke);else{var lt=T+(de.w_bits-8<<4)<<8,tt=-1;de.strategy>=m||de.level<2?tt=0:de.level<6?tt=1:de.level===6?tt=2:tt=3,lt|=tt<<6,de.strstart!==0&&(lt|=ce),lt+=31-lt%31,de.status=Ke,Ue(de,lt),de.strstart!==0&&(Ue(de,G.adler>>>16),Ue(de,G.adler&65535)),G.adler=1}if(de.status===Fe)if(de.gzhead.extra){for(Se=de.pending;de.gzindex<(de.gzhead.extra.length&65535)&&!(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Je(G),Se=de.pending,de.pending===de.pending_buf_size));)He(de,de.gzhead.extra[de.gzindex]&255),de.gzindex++;de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),de.gzindex===de.gzhead.extra.length&&(de.gzindex=0,de.status=Oe)}else de.status=Oe;if(de.status===Oe)if(de.gzhead.name){Se=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Je(G),Se=de.pending,de.pending===de.pending_buf_size)){Xe=1;break}de.gzindex<de.gzhead.name.length?Xe=de.gzhead.name.charCodeAt(de.gzindex++)&255:Xe=0,He(de,Xe)}while(Xe!==0);de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Xe===0&&(de.gzindex=0,de.status=Re)}else de.status=Re;if(de.status===Re)if(de.gzhead.comment){Se=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Je(G),Se=de.pending,de.pending===de.pending_buf_size)){Xe=1;break}de.gzindex<de.gzhead.comment.length?Xe=de.gzhead.comment.charCodeAt(de.gzindex++)&255:Xe=0,He(de,Xe)}while(Xe!==0);de.gzhead.hcrc&&de.pending>Se&&(G.adler=(0,M.default)(G.adler,de.pending_buf,de.pending-Se,Se)),Xe===0&&(de.status=Be)}else de.status=Be;if(de.status===Be&&(de.gzhead.hcrc?(de.pending+2>de.pending_buf_size&&Je(G),de.pending+2<=de.pending_buf_size&&(He(de,G.adler&255),He(de,G.adler>>8&255),G.adler=0,de.status=Ke)):de.status=Ke),de.pending!==0){if(Je(G),G.avail_out===0)return de.last_flush=-1,t}else if(G.avail_in===0&&ze(we)<=ze(Ne)&&we!==r)return Ye(G,c);if(de.status===Ae&&G.avail_in!==0)return Ye(G,c);if(G.avail_in!==0||de.lookahead!==0||we!==h&&de.status!==Ae){var st=de.strategy===m?et(de,we):de.strategy===S?qe(de,we):ct[de.level].func(de,we);if((st===Ee||st===pe)&&(de.status=Ae),st===_e||st===Ee)return G.avail_out===0&&(de.last_flush=-1),t;if(st===le&&(we===o?I._tr_align(de):we!==n&&(I._tr_stored_block(de,0,0,!1),we===u&&(Ze(de.head),de.lookahead===0&&(de.strstart=0,de.block_start=0,de.insert=0))),Je(G),G.avail_out===0))return de.last_flush=-1,t}return we!==r?t:de.wrap<=0?i:(de.wrap===2?(He(de,G.adler&255),He(de,G.adler>>8&255),He(de,G.adler>>16&255),He(de,G.adler>>24&255),He(de,G.total_in&255),He(de,G.total_in>>8&255),He(de,G.total_in>>16&255),He(de,G.total_in>>24&255)):(Ue(de,G.adler>>>16),Ue(de,G.adler&65535)),Je(G),de.wrap>0&&(de.wrap=-de.wrap),de.pending!==0?t:i)}function q(G){var we;return!G||!G.state?s:(we=G.state.status,we!==be&&we!==Fe&&we!==Oe&&we!==Re&&we!==Be&&we!==Ke&&we!==Ae?Ye(G,s):(G.state=null,we===Ke?Ye(G,l):t))}function me(G,we){var Ne=we.length,de,Se,Xe,lt,tt,st,mt,Ct;if(!G||!G.state)return s;if(de=G.state,lt=de.wrap,lt===2||lt===1&&de.status!==be||de.lookahead)return s;for(lt===1&&(G.adler=(0,k.default)(G.adler,we,Ne,0)),de.wrap=0,Ne>=de.w_size&&(lt===0&&(Ze(de.head),de.strstart=0,de.block_start=0,de.insert=0),Ct=new L.Buf8(de.w_size),L.arraySet(Ct,we,Ne-de.w_size,de.w_size,0),we=Ct,Ne=de.w_size),tt=G.avail_in,st=G.next_in,mt=G.input,G.avail_in=Ne,G.next_in=0,G.input=we,re(de);de.lookahead>=N;){Se=de.strstart,Xe=de.lookahead-(N-1);do de.ins_h=(de.ins_h<<de.hash_shift^de.window[Se+N-1])&de.hash_mask,de.prev[Se&de.w_mask]=de.head[de.ins_h],de.head[de.ins_h]=Se,Se++;while(--Xe);de.strstart=Se,de.lookahead=N-1,re(de)}return de.strstart+=de.lookahead,de.block_start=de.strstart,de.insert=de.lookahead,de.lookahead=0,de.match_length=de.prev_length=N-1,de.match_available=0,G.next_in=st,G.input=mt,G.avail_in=tt,de.wrap=lt,t}var Ce="pako deflate (from Nodeca project)";fe.deflateInfo=Ce},lZu9:function(at,fe,oe){(function(V){V(oe("VrN/"),oe("1eCo"),oe("8EBN"))})(function(V){"use strict";V.defineMode("markdown",function(L,I){var k=V.getMode(L,"text/html"),M=k.name=="null";function f(B){if(V.findModeByName){var N=V.findModeByName(B);N&&(B=N.mime||N.mimes[0])}var z=V.getMode(L,B);return z.name=="null"?null:z}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var E={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 x in E)E.hasOwnProperty(x)&&I.tokenTypeOverrides[x]&&(E[x]=I.tokenTypeOverrides[x]);var g=/^([*\-_])(?:\s*\1){2,}\s*$/,h=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,o=/^\[(x| )\](?=\s)/i,u=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,r=/^ {0,3}(?:\={1,}|-{2,})\s*$/,n=/^[^#!\[\]*_\\<>` "'(~:]+/,t=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,i=/^\s*\[[^\]]+?\]:.*$/,s=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,l=" ";function c(B,N,z){return N.f=N.inline=z,z(B,N)}function d(B,N,z){return N.f=N.block=z,z(B,N)}function w(B){return!B||!/\S/.test(B.string)}function m(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==C){var N=M;if(!N){var z=V.innerMode(k,B.htmlState);N=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}N&&(B.f=A,B.block=S,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function S(B,N){var z=B.column()===N.indentation,te=w(N.prevLine.stream),ce=N.indentedCode,be=N.prevLine.hr,Fe=N.list!==!1,Oe=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var Re=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,Fe)){for(N.list=null;Re<N.listStack[N.listStack.length-1];)N.listStack.pop(),N.listStack.length?N.indentation=N.listStack[N.listStack.length-1]:N.list=!1;N.list!==!1&&(N.indentationDiff=Re-N.listStack[N.listStack.length-1])}var Be=!te&&!be&&!N.prevLine.header&&(!Fe||!ce)&&!N.prevLine.fencedCodeEnd,Ke=(N.list===!1||be||te)&&N.indentation<=Oe&&B.match(g),Ae=null;if(N.indentationDiff>=4&&(ce||N.prevLine.fencedCodeEnd||N.prevLine.header||te))return B.skipToEnd(),N.indentedCode=!0,E.code;if(B.eatSpace())return null;if(z&&N.indentation<=Oe&&(Ae=B.match(u))&&Ae[1].length<=6)return N.quote=0,N.header=Ae[1].length,N.thisLine.header=!0,I.highlightFormatting&&(N.formatting="header"),N.f=N.inline,y(N);if(N.indentation<=Oe&&B.eat(">"))return N.quote=z?1:N.quote+1,I.highlightFormatting&&(N.formatting="quote"),B.eatSpace(),y(N);if(!Ke&&!N.setext&&z&&N.indentation<=Oe&&(Ae=B.match(h))){var _e=Ae[1]?"ol":"ul";return N.indentation=Re+B.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,I.taskLists&&B.match(o,!1)&&(N.taskList=!0),N.f=N.inline,I.highlightFormatting&&(N.formatting=["list","list-"+_e]),y(N)}else{if(z&&N.indentation<=Oe&&(Ae=B.match(t,!0)))return N.quote=0,N.fencedEndRE=new RegExp(Ae[1]+"+ *$"),N.localMode=I.fencedCodeBlockHighlighting&&f(Ae[2]||I.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=V.startState(N.localMode)),N.f=N.block=v,I.highlightFormatting&&(N.formatting="code-block"),N.code=-1,y(N);if(N.setext||(!Be||!Fe)&&!N.quote&&N.list===!1&&!N.code&&!Ke&&!i.test(B.string)&&(Ae=B.lookAhead(1))&&(Ae=Ae.match(r)))return N.setext?(N.header=N.setext,N.setext=0,B.skipToEnd(),I.highlightFormatting&&(N.formatting="header")):(N.header=Ae[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,y(N);if(Ke)return B.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,E.hr;if(B.peek()==="[")return c(B,N,j)}return c(B,N,N.inline)}function C(B,N){var z=k.token(B,N.htmlState);if(!M){var te=V.innerMode(k,N.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||N.md_inside&&B.current().indexOf(">")>-1)&&(N.f=A,N.block=S,N.htmlState=null)}return z}function v(B,N){var z=N.listStack[N.listStack.length-1]||0,te=N.indentation<z,ce=z+3;if(N.fencedEndRE&&N.indentation<=ce&&(te||B.match(N.fencedEndRE))){I.highlightFormatting&&(N.formatting="code-block");var be;return te||(be=y(N)),N.localMode=N.localState=null,N.block=S,N.f=A,N.fencedEndRE=null,N.code=0,N.thisLine.fencedCodeEnd=!0,te?d(B,N,N.block):be}else return N.localMode?N.localMode.token(B,N.localState):(B.skipToEnd(),E.code)}function y(B){var N=[];if(B.formatting){N.push(E.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var z=0;z<B.formatting.length;z++)N.push(E.formatting+"-"+B.formatting[z]),B.formatting[z]==="header"&&N.push(E.formatting+"-"+B.formatting[z]+"-"+B.header),B.formatting[z]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=B.quote?N.push(E.formatting+"-"+B.formatting[z]+"-"+B.quote):N.push("error"))}if(B.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(B.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(B.linkHref?N.push(E.linkHref,"url"):(B.strong&&N.push(E.strong),B.em&&N.push(E.em),B.strikethrough&&N.push(E.strikethrough),B.emoji&&N.push(E.emoji),B.linkText&&N.push(E.linkText),B.code&&N.push(E.code),B.image&&N.push(E.image),B.imageAltText&&N.push(E.imageAltText,"link"),B.imageMarker&&N.push(E.imageMarker)),B.header&&N.push(E.header,E.header+"-"+B.header),B.quote&&(N.push(E.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=B.quote?N.push(E.quote+"-"+B.quote):N.push(E.quote+"-"+I.maxBlockquoteDepth)),B.list!==!1){var te=(B.listStack.length-1)%3;te?te===1?N.push(E.list2):N.push(E.list3):N.push(E.list1)}return B.trailingSpaceNewLine?N.push("trailing-space-new-line"):B.trailingSpace&&N.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function T(B,N){return B.match(n,!0)?y(N):void 0}function A(B,N){var z=N.text(B,N);if(typeof z!="undefined")return z;if(N.list)return N.list=null,y(N);if(N.taskList){var te=B.match(o,!0)[1]===" ";return te?N.taskOpen=!0:N.taskClosed=!0,I.highlightFormatting&&(N.formatting="task"),N.taskList=!1,y(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&B.match(/^#+$/,!0))return I.highlightFormatting&&(N.formatting="header"),y(N);var ce=B.next();if(N.linkTitle){N.linkTitle=!1;var be=ce;ce==="("&&(be=")"),be=(be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fe="^\\s*(?:[^"+be+"\\\\]+|\\\\\\\\|\\\\.)"+be;if(B.match(new RegExp(Fe),!0))return E.linkHref}if(ce==="`"){var Oe=N.formatting;I.highlightFormatting&&(N.formatting="code"),B.eatWhile("`");var Re=B.current().length;if(N.code==0&&(!N.quote||Re==1))return N.code=Re,y(N);if(Re==N.code){var Be=y(N);return N.code=0,Be}else return N.formatting=Oe,y(N)}else if(N.code)return y(N);if(ce==="\\"&&(B.next(),I.highlightFormatting)){var Ke=y(N),Ae=E.formatting+"-escape";return Ke?Ke+" "+Ae:Ae}if(ce==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,I.highlightFormatting&&(N.formatting="image"),y(N);if(ce==="["&&N.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,I.highlightFormatting&&(N.formatting="image"),y(N);if(ce==="]"&&N.imageAltText){I.highlightFormatting&&(N.formatting="image");var Ke=y(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=D,Ke}if(ce==="["&&!N.image)return N.linkText&&B.match(/^.*?\]/)||(N.linkText=!0,I.highlightFormatting&&(N.formatting="link")),y(N);if(ce==="]"&&N.linkText){I.highlightFormatting&&(N.formatting="link");var Ke=y(N);return N.linkText=!1,N.inline=N.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?D:A,Ke}if(ce==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=p,I.highlightFormatting&&(N.formatting="link");var Ke=y(N);return Ke?Ke+=" ":Ke="",Ke+E.linkInline}if(ce==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=p,I.highlightFormatting&&(N.formatting="link");var Ke=y(N);return Ke?Ke+=" ":Ke="",Ke+E.linkEmail}if(I.xml&&ce==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _e=B.string.indexOf(">",B.pos);if(_e!=-1){var le=B.string.substring(B.start,_e);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(le)&&(N.md_inside=!0)}return B.backUp(1),N.htmlState=V.startState(k),d(B,N,C)}if(I.xml&&ce==="<"&&B.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var Ee=1,pe=B.pos==1?" ":B.string.charAt(B.pos-2);Ee<3&&B.eat(ce);)Ee++;var Ge=B.peek()||" ",Ye=!/\s/.test(Ge)&&(!s.test(Ge)||/\s/.test(pe)||s.test(pe)),ze=!/\s/.test(pe)&&(!s.test(pe)||/\s/.test(Ge)||s.test(Ge)),Ze=null,Je=null;if(Ee%2&&(!N.em&&Ye&&(ce==="*"||!ze||s.test(pe))?Ze=!0:N.em==ce&&ze&&(ce==="*"||!Ye||s.test(Ge))&&(Ze=!1)),Ee>1&&(!N.strong&&Ye&&(ce==="*"||!ze||s.test(pe))?Je=!0:N.strong==ce&&ze&&(ce==="*"||!Ye||s.test(Ge))&&(Je=!1)),Je!=null||Ze!=null){I.highlightFormatting&&(N.formatting=Ze==null?"strong":Je==null?"em":"strong em"),Ze===!0&&(N.em=ce),Je===!0&&(N.strong=ce);var Be=y(N);return Ze===!1&&(N.em=!1),Je===!1&&(N.strong=!1),Be}}else if(ce===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return y(N);B.backUp(1)}if(I.strikethrough){if(ce==="~"&&B.eatWhile(ce)){if(N.strikethrough){I.highlightFormatting&&(N.formatting="strikethrough");var Be=y(N);return N.strikethrough=!1,Be}else if(B.match(/^[^\s]/,!1))return N.strikethrough=!0,I.highlightFormatting&&(N.formatting="strikethrough"),y(N)}else if(ce===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return y(N);B.backUp(2)}}if(I.emoji&&ce===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,I.highlightFormatting&&(N.formatting="emoji");var $e=y(N);return N.emoji=!1,$e}return ce===" "&&(B.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),y(N)}function p(B,N){var z=B.next();if(z===">"){N.f=N.inline=A,I.highlightFormatting&&(N.formatting="link");var te=y(N);return te?te+=" ":te="",te+E.linkInline}return B.match(/^[^>]+/,!0),E.linkInline}function D(B,N){if(B.eatSpace())return null;var z=B.next();return z==="("||z==="["?(N.f=N.inline=P(z==="("?")":"]"),I.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,y(N)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(B){return function(N,z){var te=N.next();if(te===B){z.f=z.inline=A,I.highlightFormatting&&(z.formatting="link-string");var ce=y(z);return z.linkHref=!1,ce}return N.match(O[B]),z.linkHref=!0,y(z)}}function j(B,N){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=K,B.next(),I.highlightFormatting&&(N.formatting="link"),N.linkText=!0,y(N)):c(B,N,A)}function K(B,N){if(B.match(/^\]:/,!0)){N.f=N.inline=U,I.highlightFormatting&&(N.formatting="link");var z=y(N);return N.linkText=!1,z}return B.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function U(B,N){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?N.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=A,E.linkHref+" url")}var X={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:A,text:T,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&V.copyState(k,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?V.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,N){if(N.formatting=!1,B!=N.thisLine.stream){if(N.header=0,N.hr=!1,B.match(/^\s*$/,!0))return m(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:B},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=C)){var z=B.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(N.indentation=z,N.indentationDiff=null,z>0)return null}}return N.f(B,N)},innerMode:function(B){return B.block==C?{state:B.htmlState,mode:k}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:X}},indent:function(B,N,z){return B.block==C&&k.indent?k.indent(B.htmlState,N,z):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,N,z):V.Pass},blankLine:m,getType:y,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return X},"xml"),V.defineMIME("text/markdown","markdown"),V.defineMIME("text/x-markdown","markdown")})},mHUz:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={XK_VoidSymbol:16777215,XK_BackSpace:65288,XK_Tab:65289,XK_Linefeed:65290,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Sys_Req:65301,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan_Mode:65315,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Touroku:65323,XK_Massyo:65324,XK_Kana_Lock:65325,XK_Kana_Shift:65326,XK_Eisu_Shift:65327,XK_Eisu_toggle:65328,XK_Kanji_Bangou:65335,XK_Zen_Koho:65341,XK_Mae_Koho:65342,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Page_Up:65365,XK_Next:65366,XK_Page_Down:65366,XK_End:65367,XK_Begin:65368,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Break:65387,XK_Mode_switch:65406,XK_script_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Tab:65417,XK_KP_Enter:65421,XK_KP_F1:65425,XK_KP_F2:65426,XK_KP_F3:65427,XK_KP_F4:65428,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Page_Up:65434,XK_KP_Next:65435,XK_KP_Page_Down:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_L1:65480,XK_F12:65481,XK_L2:65481,XK_F13:65482,XK_L3:65482,XK_F14:65483,XK_L4:65483,XK_F15:65484,XK_L5:65484,XK_F16:65485,XK_L6:65485,XK_F17:65486,XK_L7:65486,XK_F18:65487,XK_L8:65487,XK_F19:65488,XK_L9:65488,XK_F20:65489,XK_L10:65489,XK_F21:65490,XK_R1:65490,XK_F22:65491,XK_R2:65491,XK_F23:65492,XK_R3:65492,XK_F24:65493,XK_R4:65493,XK_F25:65494,XK_R5:65494,XK_F26:65495,XK_R6:65495,XK_F27:65496,XK_R7:65496,XK_F28:65497,XK_R8:65497,XK_F29:65498,XK_R9:65498,XK_F30:65499,XK_R10:65499,XK_F31:65500,XK_R11:65500,XK_F32:65501,XK_R12:65501,XK_F33:65502,XK_R13:65502,XK_F34:65503,XK_R14:65503,XK_F35:65504,XK_R15:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Shift_Lock:65510,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_Hyper_L:65517,XK_Hyper_R:65518,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_exclam:33,XK_quotedbl:34,XK_numbersign:35,XK_dollar:36,XK_percent:37,XK_ampersand:38,XK_apostrophe:39,XK_quoteright:39,XK_parenleft:40,XK_parenright:41,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_colon:58,XK_semicolon:59,XK_less:60,XK_equal:61,XK_greater:62,XK_question:63,XK_at:64,XK_A:65,XK_B:66,XK_C:67,XK_D:68,XK_E:69,XK_F:70,XK_G:71,XK_H:72,XK_I:73,XK_J:74,XK_K:75,XK_L:76,XK_M:77,XK_N:78,XK_O:79,XK_P:80,XK_Q:81,XK_R:82,XK_S:83,XK_T:84,XK_U:85,XK_V:86,XK_W:87,XK_X:88,XK_Y:89,XK_Z:90,XK_bracketleft:91,XK_backslash:92,XK_bracketright:93,XK_asciicircum:94,XK_underscore:95,XK_grave:96,XK_quoteleft:96,XK_a:97,XK_b:98,XK_c:99,XK_d:100,XK_e:101,XK_f:102,XK_g:103,XK_h:104,XK_i:105,XK_j:106,XK_k:107,XK_l:108,XK_m:109,XK_n:110,XK_o:111,XK_p:112,XK_q:113,XK_r:114,XK_s:115,XK_t:116,XK_u:117,XK_v:118,XK_w:119,XK_x:120,XK_y:121,XK_z:122,XK_braceleft:123,XK_bar:124,XK_braceright:125,XK_asciitilde:126,XK_nobreakspace:160,XK_exclamdown:161,XK_cent:162,XK_sterling:163,XK_currency:164,XK_yen:165,XK_brokenbar:166,XK_section:167,XK_diaeresis:168,XK_copyright:169,XK_ordfeminine:170,XK_guillemotleft:171,XK_notsign:172,XK_hyphen:173,XK_registered:174,XK_macron:175,XK_degree:176,XK_plusminus:177,XK_twosuperior:178,XK_threesuperior:179,XK_acute:180,XK_mu:181,XK_paragraph:182,XK_periodcentered:183,XK_cedilla:184,XK_onesuperior:185,XK_masculine:186,XK_guillemotright:187,XK_onequarter:188,XK_onehalf:189,XK_threequarters:190,XK_questiondown:191,XK_Agrave:192,XK_Aacute:193,XK_Acircumflex:194,XK_Atilde:195,XK_Adiaeresis:196,XK_Aring:197,XK_AE:198,XK_Ccedilla:199,XK_Egrave:200,XK_Eacute:201,XK_Ecircumflex:202,XK_Ediaeresis:203,XK_Igrave:204,XK_Iacute:205,XK_Icircumflex:206,XK_Idiaeresis:207,XK_ETH:208,XK_Eth:208,XK_Ntilde:209,XK_Ograve:210,XK_Oacute:211,XK_Ocircumflex:212,XK_Otilde:213,XK_Odiaeresis:214,XK_multiply:215,XK_Oslash:216,XK_Ooblique:216,XK_Ugrave:217,XK_Uacute:218,XK_Ucircumflex:219,XK_Udiaeresis:220,XK_Yacute:221,XK_THORN:222,XK_Thorn:222,XK_ssharp:223,XK_agrave:224,XK_aacute:225,XK_acircumflex:226,XK_atilde:227,XK_adiaeresis:228,XK_aring:229,XK_ae:230,XK_ccedilla:231,XK_egrave:232,XK_eacute:233,XK_ecircumflex:234,XK_ediaeresis:235,XK_igrave:236,XK_iacute:237,XK_icircumflex:238,XK_idiaeresis:239,XK_eth:240,XK_ntilde:241,XK_ograve:242,XK_oacute:243,XK_ocircumflex:244,XK_otilde:245,XK_odiaeresis:246,XK_division:247,XK_oslash:248,XK_ooblique:248,XK_ugrave:249,XK_uacute:250,XK_ucircumflex:251,XK_udiaeresis:252,XK_yacute:253,XK_thorn:254,XK_ydiaeresis:255,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_ModeLock:269025025,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_KbdLightOnOff:269025028,XF86XK_KbdBrightnessUp:269025029,XF86XK_KbdBrightnessDown:269025030,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Start:269025050,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Memo:269025054,XF86XK_ToDoList:269025055,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_ContrastAdjust:269025058,XF86XK_RockerUp:269025059,XF86XK_RockerDown:269025060,XF86XK_RockerEnter:269025061,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Sleep:269025071,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_VendorHome:269025076,XF86XK_LightBulb:269025077,XF86XK_Shop:269025078,XF86XK_History:269025079,XF86XK_OpenURL:269025080,XF86XK_AddFavorite:269025081,XF86XK_HotLinks:269025082,XF86XK_BrightnessAdjust:269025083,XF86XK_Finance:269025084,XF86XK_Community:269025085,XF86XK_AudioRewind:269025086,XF86XK_BackForward:269025087,XF86XK_Launch0:269025088,XF86XK_Launch1:269025089,XF86XK_Launch2:269025090,XF86XK_Launch3:269025091,XF86XK_Launch4:269025092,XF86XK_Launch5:269025093,XF86XK_Launch6:269025094,XF86XK_Launch7:269025095,XF86XK_Launch8:269025096,XF86XK_Launch9:269025097,XF86XK_LaunchA:269025098,XF86XK_LaunchB:269025099,XF86XK_LaunchC:269025100,XF86XK_LaunchD:269025101,XF86XK_LaunchE:269025102,XF86XK_LaunchF:269025103,XF86XK_ApplicationLeft:269025104,XF86XK_ApplicationRight:269025105,XF86XK_Book:269025106,XF86XK_CD:269025107,XF86XK_Calculater:269025108,XF86XK_Clear:269025109,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Display:269025113,XF86XK_DOS:269025114,XF86XK_Documents:269025115,XF86XK_Excel:269025116,XF86XK_Explorer:269025117,XF86XK_Game:269025118,XF86XK_Go:269025119,XF86XK_iTouch:269025120,XF86XK_LogOff:269025121,XF86XK_Market:269025122,XF86XK_Meeting:269025123,XF86XK_MenuKB:269025125,XF86XK_MenuPB:269025126,XF86XK_MySites:269025127,XF86XK_New:269025128,XF86XK_News:269025129,XF86XK_OfficeHome:269025130,XF86XK_Open:269025131,XF86XK_Option:269025132,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Q:269025136,XF86XK_Reply:269025138,XF86XK_Reload:269025139,XF86XK_RotateWindows:269025140,XF86XK_RotationPB:269025141,XF86XK_RotationKB:269025142,XF86XK_Save:269025143,XF86XK_ScrollUp:269025144,XF86XK_ScrollDown:269025145,XF86XK_ScrollClick:269025146,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Support:269025150,XF86XK_TaskPane:269025151,XF86XK_Terminal:269025152,XF86XK_Tools:269025153,XF86XK_Travel:269025154,XF86XK_UserPB:269025156,XF86XK_User1KB:269025157,XF86XK_User2KB:269025158,XF86XK_Video:269025159,XF86XK_WheelButton:269025160,XF86XK_Word:269025161,XF86XK_Xfer:269025162,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_Away:269025165,XF86XK_Messenger:269025166,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Pictures:269025169,XF86XK_Music:269025170,XF86XK_Battery:269025171,XF86XK_Bluetooth:269025172,XF86XK_WLAN:269025173,XF86XK_UWB:269025174,XF86XK_AudioForward:269025175,XF86XK_AudioRepeat:269025176,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_CycleAngle:269025180,XF86XK_FrameBack:269025181,XF86XK_FrameForward:269025182,XF86XK_Time:269025183,XF86XK_Select:269025184,XF86XK_View:269025185,XF86XK_TopMenu:269025186,XF86XK_Red:269025187,XF86XK_Green:269025188,XF86XK_Yellow:269025189,XF86XK_Blue:269025190,XF86XK_Suspend:269025191,XF86XK_Hibernate:269025192,XF86XK_TouchpadToggle:269025193,XF86XK_TouchpadOn:269025200,XF86XK_TouchpadOff:269025201,XF86XK_AudioMicMute:269025202,XF86XK_Switch_VT_1:269024769,XF86XK_Switch_VT_2:269024770,XF86XK_Switch_VT_3:269024771,XF86XK_Switch_VT_4:269024772,XF86XK_Switch_VT_5:269024773,XF86XK_Switch_VT_6:269024774,XF86XK_Switch_VT_7:269024775,XF86XK_Switch_VT_8:269024776,XF86XK_Switch_VT_9:269024777,XF86XK_Switch_VT_10:269024778,XF86XK_Switch_VT_11:269024779,XF86XK_Switch_VT_12:269024780,XF86XK_Ungrab:269024800,XF86XK_ClearGrab:269024801,XF86XK_Next_VMode:269024802,XF86XK_Prev_VMode:269024803,XF86XK_LogWindowTree:269024804,XF86XK_LogGrabInfo:269024805};fe.default=V},mTgk:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=L(oe("mHUz"));function L(x){return x&&x.__esModule?x:{default:x}}var I={};function k(x,g){if(g===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(x in I)throw new Error('Duplicate entry for key "'+x+'"');I[x]=[g,g,g,g]}function M(x,g,h){if(g===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(h===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(x in I)throw new Error('Duplicate entry for key "'+x+'"');I[x]=[g,g,h,g]}function f(x,g,h){if(g===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(h===void 0)throw new Error('Undefined keysym for key "'+x+'"');if(x in I)throw new Error('Duplicate entry for key "'+x+'"');I[x]=[g,g,g,h]}M("Alt",V.default.XK_Alt_L,V.default.XK_Alt_R),k("AltGraph",V.default.XK_ISO_Level3_Shift),k("CapsLock",V.default.XK_Caps_Lock),M("Control",V.default.XK_Control_L,V.default.XK_Control_R),M("Meta",V.default.XK_Super_L,V.default.XK_Super_R),k("NumLock",V.default.XK_Num_Lock),k("ScrollLock",V.default.XK_Scroll_Lock),M("Shift",V.default.XK_Shift_L,V.default.XK_Shift_R),f("Enter",V.default.XK_Return,V.default.XK_KP_Enter),k("Tab",V.default.XK_Tab),f(" ",V.default.XK_space,V.default.XK_KP_Space),f("ArrowDown",V.default.XK_Down,V.default.XK_KP_Down),f("ArrowUp",V.default.XK_Up,V.default.XK_KP_Up),f("ArrowLeft",V.default.XK_Left,V.default.XK_KP_Left),f("ArrowRight",V.default.XK_Right,V.default.XK_KP_Right),f("End",V.default.XK_End,V.default.XK_KP_End),f("Home",V.default.XK_Home,V.default.XK_KP_Home),f("PageDown",V.default.XK_Next,V.default.XK_KP_Next),f("PageUp",V.default.XK_Prior,V.default.XK_KP_Prior),k("Backspace",V.default.XK_BackSpace),f("Clear",V.default.XK_Clear,V.default.XK_KP_Begin),k("Copy",V.default.XF86XK_Copy),k("Cut",V.default.XF86XK_Cut),f("Delete",V.default.XK_Delete,V.default.XK_KP_Delete),f("Insert",V.default.XK_Insert,V.default.XK_KP_Insert),k("Paste",V.default.XF86XK_Paste),k("Redo",V.default.XK_Redo),k("Undo",V.default.XK_Undo),k("Cancel",V.default.XK_Cancel),k("ContextMenu",V.default.XK_Menu),k("Escape",V.default.XK_Escape),k("Execute",V.default.XK_Execute),k("Find",V.default.XK_Find),k("Help",V.default.XK_Help),k("Pause",V.default.XK_Pause),k("Select",V.default.XK_Select),k("ZoomIn",V.default.XF86XK_ZoomIn),k("ZoomOut",V.default.XF86XK_ZoomOut),k("BrightnessDown",V.default.XF86XK_MonBrightnessDown),k("BrightnessUp",V.default.XF86XK_MonBrightnessUp),k("Eject",V.default.XF86XK_Eject),k("LogOff",V.default.XF86XK_LogOff),k("Power",V.default.XF86XK_PowerOff),k("PowerOff",V.default.XF86XK_PowerDown),k("PrintScreen",V.default.XK_Print),k("Hibernate",V.default.XF86XK_Hibernate),k("Standby",V.default.XF86XK_Standby),k("WakeUp",V.default.XF86XK_WakeUp),k("AllCandidates",V.default.XK_MultipleCandidate),k("Alphanumeric",V.default.XK_Eisu_Shift),k("CodeInput",V.default.XK_Codeinput),k("Compose",V.default.XK_Multi_key),k("Convert",V.default.XK_Henkan),k("GroupFirst",V.default.XK_ISO_First_Group),k("GroupLast",V.default.XK_ISO_Last_Group),k("GroupNext",V.default.XK_ISO_Next_Group),k("GroupPrevious",V.default.XK_ISO_Prev_Group),k("NonConvert",V.default.XK_Muhenkan),k("PreviousCandidate",V.default.XK_PreviousCandidate),k("SingleCandidate",V.default.XK_SingleCandidate),k("HangulMode",V.default.XK_Hangul),k("HanjaMode",V.default.XK_Hangul_Hanja),k("JunjuaMode",V.default.XK_Hangul_Jeonja),k("Eisu",V.default.XK_Eisu_toggle),k("Hankaku",V.default.XK_Hankaku),k("Hiragana",V.default.XK_Hiragana),k("HiraganaKatakana",V.default.XK_Hiragana_Katakana),k("KanaMode",V.default.XK_Kana_Shift),k("KanjiMode",V.default.XK_Kanji),k("Katakana",V.default.XK_Katakana),k("Romaji",V.default.XK_Romaji),k("Zenkaku",V.default.XK_Zenkaku),k("ZenkakuHanaku",V.default.XK_Zenkaku_Hankaku),k("F1",V.default.XK_F1),k("F2",V.default.XK_F2),k("F3",V.default.XK_F3),k("F4",V.default.XK_F4),k("F5",V.default.XK_F5),k("F6",V.default.XK_F6),k("F7",V.default.XK_F7),k("F8",V.default.XK_F8),k("F9",V.default.XK_F9),k("F10",V.default.XK_F10),k("F11",V.default.XK_F11),k("F12",V.default.XK_F12),k("F13",V.default.XK_F13),k("F14",V.default.XK_F14),k("F15",V.default.XK_F15),k("F16",V.default.XK_F16),k("F17",V.default.XK_F17),k("F18",V.default.XK_F18),k("F19",V.default.XK_F19),k("F20",V.default.XK_F20),k("F21",V.default.XK_F21),k("F22",V.default.XK_F22),k("F23",V.default.XK_F23),k("F24",V.default.XK_F24),k("F25",V.default.XK_F25),k("F26",V.default.XK_F26),k("F27",V.default.XK_F27),k("F28",V.default.XK_F28),k("F29",V.default.XK_F29),k("F30",V.default.XK_F30),k("F31",V.default.XK_F31),k("F32",V.default.XK_F32),k("F33",V.default.XK_F33),k("F34",V.default.XK_F34),k("F35",V.default.XK_F35),k("Close",V.default.XF86XK_Close),k("MailForward",V.default.XF86XK_MailForward),k("MailReply",V.default.XF86XK_Reply),k("MailSend",V.default.XF86XK_Send),k("MediaFastForward",V.default.XF86XK_AudioForward),k("MediaPause",V.default.XF86XK_AudioPause),k("MediaPlay",V.default.XF86XK_AudioPlay),k("MediaRecord",V.default.XF86XK_AudioRecord),k("MediaRewind",V.default.XF86XK_AudioRewind),k("MediaStop",V.default.XF86XK_AudioStop),k("MediaTrackNext",V.default.XF86XK_AudioNext),k("MediaTrackPrevious",V.default.XF86XK_AudioPrev),k("New",V.default.XF86XK_New),k("Open",V.default.XF86XK_Open),k("Print",V.default.XK_Print),k("Save",V.default.XF86XK_Save),k("SpellCheck",V.default.XF86XK_Spell),k("AudioVolumeDown",V.default.XF86XK_AudioLowerVolume),k("AudioVolumeUp",V.default.XF86XK_AudioRaiseVolume),k("AudioVolumeMute",V.default.XF86XK_AudioMute),k("MicrophoneVolumeMute",V.default.XF86XK_AudioMicMute),k("LaunchApplication1",V.default.XF86XK_MyComputer),k("LaunchApplication2",V.default.XF86XK_Calculator),k("LaunchCalendar",V.default.XF86XK_Calendar),k("LaunchMail",V.default.XF86XK_Mail),k("LaunchMediaPlayer",V.default.XF86XK_AudioMedia),k("LaunchMusicPlayer",V.default.XF86XK_Music),k("LaunchPhone",V.default.XF86XK_Phone),k("LaunchScreenSaver",V.default.XF86XK_ScreenSaver),k("LaunchSpreadsheet",V.default.XF86XK_Excel),k("LaunchWebBrowser",V.default.XF86XK_WWW),k("LaunchWebCam",V.default.XF86XK_WebCam),k("LaunchWordProcessor",V.default.XF86XK_Word),k("BrowserBack",V.default.XF86XK_Back),k("BrowserFavorites",V.default.XF86XK_Favorites),k("BrowserForward",V.default.XF86XK_Forward),k("BrowserHome",V.default.XF86XK_HomePage),k("BrowserRefresh",V.default.XF86XK_Refresh),k("BrowserSearch",V.default.XF86XK_Search),k("BrowserStop",V.default.XF86XK_Stop),k("Dimmer",V.default.XF86XK_BrightnessAdjust),k("MediaAudioTrack",V.default.XF86XK_AudioCycleTrack),k("RandomToggle",V.default.XF86XK_AudioRandomPlay),k("SplitScreenToggle",V.default.XF86XK_SplitScreen),k("Subtitle",V.default.XF86XK_Subtitle),k("VideoModeNext",V.default.XF86XK_Next_VMode),f("=",V.default.XK_equal,V.default.XK_KP_Equal),f("+",V.default.XK_plus,V.default.XK_KP_Add),f("-",V.default.XK_minus,V.default.XK_KP_Subtract),f("*",V.default.XK_asterisk,V.default.XK_KP_Multiply),f("/",V.default.XK_slash,V.default.XK_KP_Divide),f(".",V.default.XK_period,V.default.XK_KP_Decimal),f(",",V.default.XK_comma,V.default.XK_KP_Separator),f("0",V.default.XK_0,V.default.XK_KP_0),f("1",V.default.XK_1,V.default.XK_KP_1),f("2",V.default.XK_2,V.default.XK_KP_2),f("3",V.default.XK_3,V.default.XK_KP_3),f("4",V.default.XK_4,V.default.XK_KP_4),f("5",V.default.XK_5,V.default.XK_KP_5),f("6",V.default.XK_6,V.default.XK_KP_6),f("7",V.default.XK_7,V.default.XK_KP_7),f("8",V.default.XK_8,V.default.XK_KP_8),f("9",V.default.XK_9,V.default.XK_KP_9);var E=I;fe.default=E},mdZa:function(at,fe,oe){"use strict";typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(L,I){"use strict";if(L==null)throw new TypeError("Cannot convert undefined or null to object");for(var k=Object(L),M=1;M<arguments.length;M++){var f=arguments[M];if(f!=null)for(var E in f)Object.prototype.hasOwnProperty.call(f,E)&&(k[E]=f[E])}return k},writable:!0,configurable:!0}),function(){function V(L,I){I=I||{bubbles:!1,cancelable:!1,detail:void 0};var k=document.createEvent("CustomEvent");return k.initCustomEvent(L,I.bubbles,I.cancelable,I.detail),k}V.prototype=window.Event.prototype,typeof window.CustomEvent!="function"&&(window.CustomEvent=V)}(),Number.isInteger=Number.isInteger||function(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}},osHv:function(at,fe,oe){(function(V){V(oe("VrN/"))})(function(V){"use strict";var L=V.Pos;function I(s,l){return s.line-l.line||s.ch-l.ch}var k="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",M=k+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",f=new RegExp("<(/?)(["+k+"]["+M+"]*)","g");function E(s,l,c,d){this.line=l,this.ch=c,this.cm=s,this.text=s.getLine(l),this.min=d?Math.max(d.from,s.firstLine()):s.firstLine(),this.max=d?Math.min(d.to-1,s.lastLine()):s.lastLine()}function x(s,l){var c=s.cm.getTokenTypeAt(L(s.line,l));return c&&/\btag\b/.test(c)}function g(s){return s.line>=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function h(s){return s.line<=s.min?void 0:(s.text=s.cm.getLine(--s.line),s.ch=s.text.length,!0)}function o(s){for(;;){var l=s.text.indexOf(">",s.ch);if(l==-1){if(g(s))continue;return}if(!x(s,l+1)){s.ch=l+1;continue}var c=s.text.lastIndexOf("/",l),d=c>-1&&!/\S/.test(s.text.slice(c+1,l));return s.ch=l+1,d?"selfClose":"regular"}}function u(s){for(;;){var l=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(l==-1){if(h(s))continue;return}if(!x(s,l+1)){s.ch=l;continue}f.lastIndex=l,s.ch=l;var c=f.exec(s.text);if(c&&c.index==l)return c}}function r(s){for(;;){f.lastIndex=s.ch;var l=f.exec(s.text);if(!l){if(g(s))continue;return}if(!x(s,l.index+1)){s.ch=l.index+1;continue}return s.ch=l.index+l[0].length,l}}function n(s){for(;;){var l=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(l==-1){if(h(s))continue;return}if(!x(s,l+1)){s.ch=l;continue}var c=s.text.lastIndexOf("/",l),d=c>-1&&!/\S/.test(s.text.slice(c+1,l));return s.ch=l+1,d?"selfClose":"regular"}}function t(s,l){for(var c=[];;){var d=r(s),w,m=s.line,S=s.ch-(d?d[0].length:0);if(!d||!(w=o(s)))return;if(w=="selfClose")continue;if(d[1]){for(var C=c.length-1;C>=0;--C)if(c[C]==d[2]){c.length=C;break}if(C<0&&(!l||l==d[2]))return{tag:d[2],from:L(m,S),to:L(s.line,s.ch)}}else c.push(d[2])}}function i(s,l){for(var c=[];;){var d=n(s);if(!d)return;if(d=="selfClose"){u(s);continue}var w=s.line,m=s.ch,S=u(s);if(!S)return;if(S[1])c.push(S[2]);else{for(var C=c.length-1;C>=0;--C)if(c[C]==S[2]){c.length=C;break}if(C<0&&(!l||l==S[2]))return{tag:S[2],from:L(s.line,s.ch),to:L(w,m)}}}}V.registerHelper("fold","xml",function(s,l){for(var c=new E(s,l.line,0);;){var d=r(c);if(!d||c.line!=l.line)return;var w=o(c);if(!w)return;if(!d[1]&&w!="selfClose"){var m=L(c.line,c.ch),S=t(c,d[2]);return S&&I(S.from,m)>0?{from:m,to:S.from}:null}}}),V.findMatchingTag=function(s,l,c){var d=new E(s,l.line,l.ch,c);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var w=o(d),m=w&&L(d.line,d.ch),S=w&&u(d);if(!w||!S||I(d,l)>0)return;var C={from:L(d.line,d.ch),to:m,tag:S[2]};return w=="selfClose"?{open:C,close:null,at:"open"}:S[1]?{open:i(d,S[2]),close:C,at:"close"}:(d=new E(s,m.line,m.ch,c),{open:C,close:t(d,S[2]),at:"open"})},V.findEnclosingTag=function(s,l,c,d){for(var w=new E(s,l.line,l.ch,c);;){var m=i(w,d);if(!m)break;var S=new E(s,l.line,l.ch,c),C=t(S,m.tag);if(C)return{open:m,close:C}}},V.scanForClosingTag=function(s,l,c,d){var w=new E(s,l.line,l.ch,d?{from:0,to:d}:null);return t(w,c)}})},p5ED:function(at,fe,oe){"use strict";var V=oe("+L6B"),L=oe("2/Rp"),I=oe("5Dmo"),k=oe("3S7+"),M=oe("k1fw"),f=oe("tJVT"),E=oe("q1tI"),x=oe.n(E),g=oe("vHTk"),h=oe.n(g),o=oe("yEEn"),u=oe("ZW9T"),r=oe("1vsH");fe.a=function(n){var t=n.name,i=n.data,s=n.theme,l=n.type,c=n.filename,d=n.monacoEditor,w=n.className,m=n.style,S=n.close,C=n.onClose,v=n.hasMask,y=Object(E.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=Object(f.a)(y,2),A=T[0],p=T[1],D=Object(E.useState)(""),O=Object(f.a)(D,2),P=O[0],j=O[1],K,U=1024*1024,X=10*U,B=Object(E.useRef)();l==="office"&&(K=Object(r.T)(i).filesize,K>X&&(l="other")),c&&(d.filename=c),Object(E.useEffect)(function(){var te,ce,be=(te=document.cookie)===null||te===void 0||((ce=te.replace(/\s/g,""))===null||ce===void 0)?void 0:ce.split(";");be==null||be.map(function(Fe){var Oe=Fe.split("=");Oe[0]==="_educoder_session"&&j(Oe[1])})},[]);var N=function(){if(i.startsWith("http")||i.startsWith("/")){z();return}Object(r.z)(c||"educoder",i,c)},z=function(){Object(r.x)(c||t,i)};return console.log("data:",i,"fileanme:",c," name:",t),x.a.createElement("div",{style:Object(M.a)({},m||{}),className:"".concat(v&&h.a.bgBlack," ").concat(l?h.a.wrp:"hide")},S&&x.a.createElement("div",{className:h.a.close,ref:B},x.a.createElement(k.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},x.a.createElement("span",{onClick:z},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(k.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},x.a.createElement("span",{className:"",onClick:C},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(h.a[w]," ").concat(w," ").concat(h.a.monaco," ").concat(l==="txt"?"show":"hide")},l==="txt"&&x.a.createElement(u.b,d)),l==="audio"&&x.a.createElement("audio",{src:"".concat(i!=null&&i.startsWith("/")||(i==null?void 0:i.indexOf("https://"))>-1?i:"data:audio/mp3;base64,").concat(i),autoPlay:!0}),l==="video"&&x.a.createElement(x.a.Fragment,null,i!=null&&i.startsWith("/")?x.a.createElement("video",{controls:!0,src:"".concat(i),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(i),autoPlay:!0})),l==="html"&&x.a.createElement("iframe",{src:i+"&disposition=inline"}),l==="pdf"&&x.a.createElement("embed",{className:h.a.embed,src:i}),l==="image"&&x.a.createElement(x.a.Fragment,null,x.a.createElement("img",{src:"".concat(i!=null&&i.startsWith("/")||(i==null?void 0:i.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(i)})),l==="other"&&x.a.createElement("div",null,x.a.createElement(L.a,{type:"primary",size:"large",onClick:N},x.a.createElement(o.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(l==="download"||l==="office")&&x.a.createElement(L.a,{type:"primary",size:"large",onClick:N},x.a.createElement(o.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(at,fe,oe){},psGv:function(at,fe,oe){var V,L;(function(){var I;(function(){"use strict";var E=[,,function(o){function u(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}u.prototype.clone_empty=function(){var t=new u(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},u.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},u.prototype.has_match=function(t){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(t))return!0;return!1},u.prototype.set_indent=function(t,i){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},u.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,t.__items[0]===" "&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(t){this.__items.push(t);var i=t.lastIndexOf(`
`);i!==-1?this.__character_count=t.length-i:this.__character_count+=t.length},u.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t};function r(t,i){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),i=i||"",t.indent_level>0&&(i=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}r.prototype.get_indent_size=function(t,i){var s=this.__base_string_length;return i=i||0,t<0&&(s=0),s+=t*this.__indent_size,s+=i,s},r.prototype.get_indent_string=function(t,i){var s=this.__base_string;return i=i||0,t<0&&(t=0,s=""),i+=t*this.__indent_size,this.__ensure_cache(i),s+=this.__cache[i],s},r.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},r.prototype.__add_column=function(){var t=this.__cache.length,i=0,s="";this.__indent_size&&t>=this.__indent_size&&(i=Math.floor(t/this.__indent_size),t-=i*this.__indent_size,s=new Array(i+1).join(this.__indent_string)),t&&(s+=new Array(t+1).join(" ")),this.__cache.push(s)};function n(t,i){this.__indent_cache=new r(t,i),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(t,i){return this.__indent_cache.get_indent_string(t,i)},n.prototype.get_indent_size=function(t,i){return this.__indent_cache.get_indent_size(t,i)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(t){return this.is_empty()||!t&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(t){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===`
`&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return t!==`
`&&(s=s.replace(/[\n]/g,t)),s},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(t,i){return t=t||0,i=i||0,this.next_line.set_indent(t,i),this.__lines.length>1?(this.current_line.set_indent(t,i),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(t){for(var i=0;i<t.newlines;i++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(t){for(var i=this.__lines.length;t<i;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(t){for(t=t===void 0?!1:t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,i){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(t)!==0&&l.item(-1)!==i){this.__lines.splice(s+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},o.exports.Output=n},function(o){function u(r,n,t,i){this.type=r,this.text=n,this.comments_before=null,this.newlines=t||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}o.exports.Token=u},,,function(o){function u(t,i){this.raw_options=r(t,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}u.prototype._get_array=function(t,i){var s=this.raw_options[t],l=i||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},u.prototype._get_boolean=function(t,i){var s=this.raw_options[t],l=s===void 0?!!i:!!s;return l},u.prototype._get_characters=function(t,i){var s=this.raw_options[t],l=i||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},u.prototype._get_number=function(t,i){var s=this.raw_options[t];i=parseInt(i,10),isNaN(i)&&(i=0);var l=parseInt(s,10);return isNaN(l)&&(l=i),l},u.prototype._get_selection=function(t,i,s){var l=this._get_selection_list(t,i,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+t+`' can only be one of the following values:
`+i+`
You passed in: '`+this.raw_options[t]+"'");return l[0]},u.prototype._get_selection_list=function(t,i,s){if(!i||i.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[i[0]],!this._is_valid_selection(s,i))throw new Error("Invalid Default Value!");var l=this._get_array(t,s);if(!this._is_valid_selection(l,i))throw new Error("Invalid Option Value: The option '"+t+`' can contain only the following values:
`+i+`
You passed in: '`+this.raw_options[t]+"'");return l},u.prototype._is_valid_selection=function(t,i){return t.length&&i.length&&!t.some(function(s){return i.indexOf(s)===-1})};function r(t,i){var s={};t=n(t);var l;for(l in t)l!==i&&(s[l]=t[l]);if(i&&t[i])for(l in t[i])s[l]=t[i][l];return s}function n(t){var i={},s;for(s in t){var l=s.replace(/-/g,"_");i[l]=t[s]}return i}o.exports.Options=u,o.exports.normalizeOpts=n,o.exports.mergeOpts=r},,function(o){var u=RegExp.prototype.hasOwnProperty("sticky");function r(n){this.__input=n||"",this.__input_length=this.__input.length,this.__position=0}r.prototype.restart=function(){this.__position=0},r.prototype.back=function(){this.__position>0&&(this.__position-=1)},r.prototype.hasNext=function(){return this.__position<this.__input_length},r.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__input.charAt(this.__position),this.__position+=1),n},r.prototype.peek=function(n){var t=null;return n=n||0,n+=this.__position,n>=0&&n<this.__input_length&&(t=this.__input.charAt(n)),t},r.prototype.__match=function(n,t){n.lastIndex=t;var i=n.exec(this.__input);return i&&!(u&&n.sticky)&&(i.index!==t&&(i=null)),i},r.prototype.test=function(n,t){return t=t||0,t+=this.__position,t>=0&&t<this.__input_length?!!this.__match(n,t):!1},r.prototype.testChar=function(n,t){var i=this.peek(t);return n.lastIndex=0,i!==null&&n.test(i)},r.prototype.match=function(n){var t=this.__match(n,this.__position);return t?this.__position+=t[0].length:t=null,t},r.prototype.read=function(n,t,i){var s="",l;return n&&(l=this.match(n),l&&(s+=l[0])),t&&(l||!n)&&(s+=this.readUntil(t,i)),s},r.prototype.readUntil=function(n,t){var i="",s=this.__position;n.lastIndex=this.__position;var l=n.exec(this.__input);return l?(s=l.index,t&&(s+=l[0].length)):s=this.__input_length,i=this.__input.substring(this.__position,s),this.__position=s,i},r.prototype.readUntilAfter=function(n){return this.readUntil(n,!0)},r.prototype.get_regexp=function(n,t){var i=null,s="g";return t&&u&&(s="y"),typeof n=="string"&&n!==""?i=new RegExp(n,s):n&&(i=new RegExp(n.source,s)),i},r.prototype.get_literal_regexp=function(n){return RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},r.prototype.peekUntilAfter=function(n){var t=this.__position,i=this.readUntilAfter(n);return this.__position=t,i},r.prototype.lookBack=function(n){var t=this.__position-1;return t>=n.length&&this.__input.substring(t-n.length,t).toLowerCase()===n},o.exports.InputScanner=r},function(o,u,r){var n=r(8).InputScanner,t=r(3).Token,i=r(10).TokenStream,s=r(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(d,w){this._input=new n(d),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new i,this._reset();for(var d,w=new t(l.START,""),m=null,S=[],C=new i;w.type!==l.EOF;){for(d=this._get_next_token(w,m);this._is_comment(d);)C.add(d),d=this._get_next_token(w,m);C.isEmpty()||(d.comments_before=C,C=new i),d.parent=m,this._is_opening(d)?(S.push(m),m=d):m&&this._is_closing(d,m)&&(d.opened=m,m.closed=d,m=S.pop(),d.parent=m),d.previous=w,w.next=d,this.__tokens.add(d),w=d}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(d,w){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(l.RAW,m):this._create_token(l.EOF,"")},c.prototype._is_comment=function(d){return!1},c.prototype._is_opening=function(d){return!1},c.prototype._is_closing=function(d,w){return!1},c.prototype._create_token=function(d,w){var m=new t(d,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},o.exports.Tokenizer=c,o.exports.TOKEN=l},function(o){function u(r){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=r}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__tokens[this.__position],this.__position+=1),r},u.prototype.peek=function(r){var n=null;return r=r||0,r+=this.__position,r>=0&&r<this.__tokens_length&&(n=this.__tokens[r]),n},u.prototype.add=function(r){this.__parent_token&&(r.parent=this.__parent_token),this.__tokens.push(r),this.__tokens_length+=1},o.exports.TokenStream=u},function(o,u,r){var n=r(12).Pattern;function t(i,s){n.call(this,i,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}t.prototype=new n,t.prototype.__set_whitespace_patterns=function(i,s){i+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+i+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var i=this._input.read(this._match_pattern);if(i===" ")this.whitespace_before_token=" ";else if(i){var s=this.__split(this._newline_regexp,i);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return i},t.prototype.matching=function(i,s){var l=this._create();return l.__set_whitespace_patterns(i,s),l._update(),l},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(i,s){i.lastIndex=0;for(var l=0,c=[],d=i.exec(s);d;)c.push(s.substring(l,d.index)),l=d.index+d[0].length,d=i.exec(s);return l<s.length?c.push(s.substring(l,s.length)):c.push(""),c},o.exports.WhitespacePattern=t},function(o){function u(r,n){this._input=r,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,n&&(this._starting_pattern=this._input.get_regexp(n._starting_pattern,!0),this._match_pattern=this._input.get_regexp(n._match_pattern,!0),this._until_pattern=this._input.get_regexp(n._until_pattern),this._until_after=n._until_after)}u.prototype.read=function(){var r=this._input.read(this._starting_pattern);return(!this._starting_pattern||r)&&(r+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),r},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(r){var n=this._create();return n._until_after=!0,n._until_pattern=this._input.get_regexp(r),n._update(),n},u.prototype.until=function(r){var n=this._create();return n._until_after=!1,n._until_pattern=this._input.get_regexp(r),n._update(),n},u.prototype.starting_with=function(r){var n=this._create();return n._starting_pattern=this._input.get_regexp(r,!0),n._update(),n},u.prototype.matching=function(r){var n=this._create();return n._match_pattern=this._input.get_regexp(r,!0),n._update(),n},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},o.exports.Pattern=u},function(o){function u(r,n){r=typeof r=="string"?r:r.source,n=typeof n=="string"?n:n.source,this.__directives_block_pattern=new RegExp(r+/ beautify( \w+[:]\w+)+ /.source+n,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(r+/\sbeautify\signore:end\s/.source+n,"g")}u.prototype.get_directives=function(r){if(!r.match(this.__directives_block_pattern))return null;var n={};this.__directive_pattern.lastIndex=0;for(var t=this.__directive_pattern.exec(r);t;)n[t[1]]=t[2],t=this.__directive_pattern.exec(r);return n},u.prototype.readIgnored=function(r){return r.readUntilAfter(this.__directives_end_ignore_pattern)},o.exports.Directives=u},function(o,u,r){var n=r(12).Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function i(s,l){n.call(this,s,l),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var c=new n(s);this.__patterns={handlebars_comment:c.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:c.starting_with(/{{{/).until_after(/}}}/),handlebars:c.starting_with(/{{/).until_after(/}}/),php:c.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}i.prototype=new n,i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){this.__set_templated_pattern()},i.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},i.prototype.read_options=function(s){var l=this._create();for(var c in t)l._disabled[c]=s.templating.indexOf(c)===-1;return l._update(),l},i.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},i.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),s+=l,l=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},i.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},i.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(s=s||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},o.exports.TemplatablePattern=i},,,,function(o,u,r){var n=r(19).Beautifier,t=r(20).Options;function i(s,l,c,d){var w=new n(s,l,c,d);return w.beautify()}o.exports=i,o.exports.defaultOptions=function(){return new t}},function(o,u,r){var n=r(20).Options,t=r(2).Output,i=r(21).Tokenizer,s=r(21).TOKEN,l=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,d=function(D,O){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=D.max_preserve_newlines,this.preserve_newlines=D.preserve_newlines,this._output=new t(D,O)};d.prototype.current_line_has_match=function(D){return this._output.current_line.has_match(D)},d.prototype.set_space_before_token=function(D,O){this._output.space_before_token=D,this._output.non_breaking_space=O},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(D){this._output.add_raw_token(D)},d.prototype.print_preserved_newlines=function(D){var O=0;D.type!==s.TEXT&&D.previous.type!==s.TEXT&&(O=D.newlines?1:0),this.preserve_newlines&&(O=D.newlines<this.max_preserve_newlines+1?D.newlines:this.max_preserve_newlines+1);for(var P=0;P<O;P++)this.print_newline(P>0);return O!==0},d.prototype.traverse_whitespace=function(D){return D.whitespace_before||D.newlines?(this.print_preserved_newlines(D)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(D){this._output.add_new_line(D)},d.prototype.print_token=function(D){D.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(D.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(D){return D=this.indent_level+(D||0),D<1?"":this._output.get_indent_string(D)};var w=function(D){for(var O=null,P=D.next;P.type!==s.EOF&&D.closed!==P;){if(P.type===s.ATTRIBUTE&&P.text==="type"){P.next&&P.next.type===s.EQUALS&&P.next.next&&P.next.next.type===s.VALUE&&(O=P.next.next.text);break}P=P.next}return O},m=function(D,O){var P=null,j=null;return O.closed?(D==="script"?P="text/javascript":D==="style"&&(P="text/css"),P=w(O)||P,P.search("text/css")>-1?j="css":P.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":P.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":P.search(/test\/null/)>-1&&(j="null"),j):null};function S(D,O){return O.indexOf(D)!==-1}function C(D,O,P){this.parent=D||null,this.tag=O?O.tag_name:"",this.indent_level=P||0,this.parser_token=O||null}function v(D){this._printer=D,this._current_frame=null}v.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},v.prototype.record_tag=function(D){var O=new C(this._current_frame,D,this._printer.indent_level);this._current_frame=O},v.prototype._try_pop_frame=function(D){var O=null;return D&&(O=D.parser_token,this._printer.indent_level=D.indent_level,this._current_frame=D.parent),O},v.prototype._get_frame=function(D,O){for(var P=this._current_frame;P&&!(D.indexOf(P.tag)!==-1);){if(O&&O.indexOf(P.tag)!==-1){P=null;break}P=P.parent}return P},v.prototype.try_pop=function(D,O){var P=this._get_frame([D],O);return this._try_pop_frame(P)},v.prototype.indent_to_tag=function(D){var O=this._get_frame(D);O&&(this._printer.indent_level=O.indent_level)};function y(D,O,P,j){this._source_text=D||"",O=O||{},this._js_beautify=P,this._css_beautify=j,this._tag_stack=null;var K=new n(O,"html");this._options=K,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,O=this._options.eol;this._options.eol==="auto"&&(O=`
`,D&&l.test(D)&&(O=D.match(l)[0])),D=D.replace(c,`
`);var P=D.match(/^[\t ]*/)[0],j={text:"",type:""},K=new T,U=new d(this._options,P),X=new i(D,this._options).tokenize();this._tag_stack=new v(U);for(var B=null,N=X.next();N.type!==s.EOF;)N.type===s.TAG_OPEN||N.type===s.COMMENT?(B=this._handle_tag_open(U,N,K,j),K=B):N.type===s.ATTRIBUTE||N.type===s.EQUALS||N.type===s.VALUE||N.type===s.TEXT&&!K.tag_complete?B=this._handle_inside_tag(U,N,K,X):N.type===s.TAG_CLOSE?B=this._handle_tag_close(U,N,K):N.type===s.TEXT?B=this._handle_text(U,N,K):U.add_raw_token(N),j=B,N=X.next();var z=U._output.get_code(O);return z},y.prototype._handle_tag_close=function(D,O,P){var j={text:O.text,type:O.type};return D.alignment_size=0,P.tag_complete=!0,D.set_space_before_token(O.newlines||O.whitespace_before!=="",!0),P.is_unformatted?D.add_raw_token(O):(P.tag_start_char==="<"&&(D.set_space_before_token(O.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&P.has_wrapped_attrs&&D.print_newline(!1)),D.print_token(O)),P.indent_content&&!(P.is_unformatted||P.is_content_unformatted)&&(D.indent(),P.indent_content=!1),!P.is_inline_element&&!(P.is_unformatted||P.is_content_unformatted)&&D.set_wrap_point(),j},y.prototype._handle_inside_tag=function(D,O,P,j){var K=P.has_wrapped_attrs,U={text:O.text,type:O.type};if(D.set_space_before_token(O.newlines||O.whitespace_before!=="",!0),P.is_unformatted)D.add_raw_token(O);else if(P.tag_start_char==="{"&&O.type===s.TEXT)D.print_preserved_newlines(O)?(O.newlines=0,D.add_raw_token(O)):D.print_token(O);else{if(O.type===s.ATTRIBUTE?(D.set_space_before_token(!0),P.attr_count+=1):(O.type===s.EQUALS||O.type===s.VALUE&&O.previous.type===s.EQUALS)&&D.set_space_before_token(!1),O.type===s.ATTRIBUTE&&P.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(D.traverse_whitespace(O),K=K||O.newlines!==0),this._is_wrap_attributes_force)){var X=P.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&P.attr_count===1){var B=!0,N=0,z;do{if(z=j.peek(N),z.type===s.ATTRIBUTE){B=!1;break}N+=1}while(N<4&&z.type!==s.EOF&&z.type!==s.TAG_CLOSE);X=!B}X&&(D.print_newline(!1),K=!0)}D.print_token(O),K=K||D.previous_token_wrapped(),P.has_wrapped_attrs=K}return U},y.prototype._handle_text=function(D,O,P){var j={text:O.text,type:"TK_CONTENT"};return P.custom_beautifier_name?this._print_custom_beatifier_text(D,O,P):P.is_unformatted||P.is_content_unformatted?D.add_raw_token(O):(D.traverse_whitespace(O),D.print_token(O)),j},y.prototype._print_custom_beatifier_text=function(D,O,P){var j=this;if(O.text!==""){var K=O.text,U,X=1,B="",N="";P.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:P.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:P.custom_beautifier_name==="html"&&(U=function(Oe,Re){var Be=new y(Oe,Re,j._js_beautify,j._css_beautify);return Be.beautify()}),this._options.indent_scripts==="keep"?X=0:this._options.indent_scripts==="separate"&&(X=-D.indent_level);var z=D.get_full_indent(X);if(K=K.replace(/\n[ \t]*$/,""),P.custom_beautifier_name!=="html"&&K[0]==="<"&&K.match(/^(<!--|<!\[CDATA\[)/)){var te=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(K);if(!te){D.add_raw_token(O);return}B=z+te[1]+`
`,K=te[4],te[5]&&(N=z+te[5]),K=K.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(`
`)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(O.whitespace_before=te[0]))}if(K)if(U){var ce=function(){this.eol=`
`};ce.prototype=this._options.raw_options;var be=new ce;K=U(z+K,be)}else{var Fe=O.whitespace_before;Fe&&(K=K.replace(new RegExp(`
(`+Fe+")?","g"),`
`)),K=z+K.replace(/\n/g,`
`+z)}B&&(K?K=B+K+`
`+N:K=B+N),D.print_newline(!1),K&&(O.text=K,O.whitespace_before="",O.newlines=0,D.add_raw_token(O),D.print_newline(!0))}},y.prototype._handle_tag_open=function(D,O,P,j){var K=this._get_tag_open_token(O);return(P.is_unformatted||P.is_content_unformatted)&&!P.is_empty_element&&O.type===s.TAG_OPEN&&O.text.indexOf("</")===0?(D.add_raw_token(O),K.start_tag_token=this._tag_stack.try_pop(K.tag_name)):(D.traverse_whitespace(O),this._set_tag_position(D,O,K,P,j),K.is_inline_element||D.set_wrap_point(),D.print_token(O)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(K.alignment_size=O.text.length+1),!K.tag_complete&&!K.is_unformatted&&(D.alignment_size=K.alignment_size),K};var T=function(D,O){if(this.parent=D||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!O)this.tag_complete=!0;else{var P;this.tag_start_char=O.text[0],this.text=O.text,this.tag_start_char==="<"?(P=O.text.match(/^<([^\s>]*)/),this.tag_check=P?P[1]:""):(P=O.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=P?P[1]:"",(O.text.startsWith("{{#>")||O.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&O.next!==null?this.tag_check=O.next.text.split(" ")[0]:this.tag_check=O.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),O.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||O.closed&&O.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};y.prototype._get_tag_open_token=function(D){var O=new T(this._tag_stack.get_parser_token(),D);return O.alignment_size=this._options.wrap_attributes_indent_size,O.is_end_tag=O.is_end_tag||S(O.tag_check,this._options.void_elements),O.is_empty_element=O.tag_complete||O.is_start_tag&&O.is_end_tag,O.is_unformatted=!O.tag_complete&&S(O.tag_check,this._options.unformatted),O.is_content_unformatted=!O.is_empty_element&&S(O.tag_check,this._options.content_unformatted),O.is_inline_element=S(O.tag_name,this._options.inline)||O.tag_name.includes("-")||O.tag_start_char==="{",O},y.prototype._set_tag_position=function(D,O,P,j,K){if(P.is_empty_element||(P.is_end_tag?P.start_tag_token=this._tag_stack.try_pop(P.tag_name):(this._do_optional_end_element(P)&&(P.is_inline_element||D.print_newline(!1)),this._tag_stack.record_tag(P),(P.tag_name==="script"||P.tag_name==="style")&&!(P.is_unformatted||P.is_content_unformatted)&&(P.custom_beautifier_name=m(P.tag_check,O)))),S(P.tag_check,this._options.extra_liners)&&(D.print_newline(!1),D._output.just_added_blankline()||D.print_newline(!0)),P.is_empty_element){if(P.tag_start_char==="{"&&P.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),P.indent_content=!0;var U=D.current_line_has_match(/{{#if/);U||D.print_newline(!1)}P.tag_name==="!--"&&K.type===s.TAG_CLOSE&&j.is_end_tag&&P.text.indexOf(`
`)===-1||(P.is_inline_element||P.is_unformatted||D.print_newline(!1),this._calcluate_parent_multiline(D,P))}else if(P.is_end_tag){var X=!1;X=P.start_tag_token&&P.start_tag_token.multiline_content,X=X||!P.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(K.type===s.TAG_CLOSE&&P.start_tag_token===j)&&K.type!=="TK_CONTENT",(P.is_content_unformatted||P.is_unformatted)&&(X=!1),X&&D.print_newline(!1)}else P.indent_content=!P.custom_beautifier_name,P.tag_start_char==="<"&&(P.tag_name==="html"?P.indent_content=this._options.indent_inner_html:P.tag_name==="head"?P.indent_content=this._options.indent_head_inner_html:P.tag_name==="body"&&(P.indent_content=this._options.indent_body_inner_html)),!(P.is_inline_element||P.is_unformatted)&&(K.type!=="TK_CONTENT"||P.is_content_unformatted)&&D.print_newline(!1),this._calcluate_parent_multiline(D,P)},y.prototype._calcluate_parent_multiline=function(D,O){O.parent&&D._output.just_added_newline()&&!((O.is_inline_element||O.is_unformatted)&&O.parent.is_inline_element)&&(O.parent.multiline_content=!0)};var A=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(D){var O=null;if(D.is_empty_element||!D.is_start_tag||!D.parent)return;if(D.tag_name==="body")O=O||this._tag_stack.try_pop("head");else if(D.tag_name==="li")O=O||this._tag_stack.try_pop("li",["ol","ul"]);else if(D.tag_name==="dd"||D.tag_name==="dt")O=O||this._tag_stack.try_pop("dt",["dl"]),O=O||this._tag_stack.try_pop("dd",["dl"]);else if(D.parent.tag_name==="p"&&A.indexOf(D.tag_name)!==-1){var P=D.parent.parent;(!P||p.indexOf(P.tag_name)===-1)&&(O=O||this._tag_stack.try_pop("p"))}else D.tag_name==="rp"||D.tag_name==="rt"?(O=O||this._tag_stack.try_pop("rt",["ruby","rtc"]),O=O||this._tag_stack.try_pop("rp",["ruby","rtc"])):D.tag_name==="optgroup"?O=O||this._tag_stack.try_pop("optgroup",["select"]):D.tag_name==="option"?O=O||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):D.tag_name==="colgroup"?O=O||this._tag_stack.try_pop("caption",["table"]):D.tag_name==="thead"?(O=O||this._tag_stack.try_pop("caption",["table"]),O=O||this._tag_stack.try_pop("colgroup",["table"])):D.tag_name==="tbody"||D.tag_name==="tfoot"?(O=O||this._tag_stack.try_pop("caption",["table"]),O=O||this._tag_stack.try_pop("colgroup",["table"]),O=O||this._tag_stack.try_pop("thead",["table"]),O=O||this._tag_stack.try_pop("tbody",["table"])):D.tag_name==="tr"?(O=O||this._tag_stack.try_pop("caption",["table"]),O=O||this._tag_stack.try_pop("colgroup",["table"]),O=O||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(D.tag_name==="th"||D.tag_name==="td")&&(O=O||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),O=O||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return D.parent=this._tag_stack.get_parser_token(),O},o.exports.Beautifier=y},function(o,u,r){var n=r(6).Options;function t(i){n.call(this,i,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}t.prototype=new n,o.exports.Options=t},function(o,u,r){var n=r(9).Tokenizer,t=r(9).TOKEN,i=r(13).Directives,s=r(14).TemplatablePattern,l=r(12).Pattern,c={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},d=new i(/<\!--/,/-->/),w=function(m,S){n.call(this,m,S),this._current_tag_name="";var C=new s(this._input).read_options(this._options),v=new l(this._input);if(this.__patterns={word:C.until(/[\n\r\t <]/),single_quote:C.until_after(/'/),double_quote:C.until_after(/"/),attribute:C.until(/[\n\r\t =>]|\/>/),element_name:C.until(/[\n\r\t >\/]/),handlebars_comment:v.starting_with(/{{!--/).until_after(/--}}/),handlebars:v.starting_with(/{{/).until_after(/}}/),handlebars_open:v.until(/[\n\r\t }]/),handlebars_raw_close:v.until(/}}/),comment:v.starting_with(/<!--/).until_after(/-->/),cdata:v.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:v.starting_with(/<!\[/).until_after(/]>/),processing:v.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=v.matching(y).until_after(y)}};w.prototype=new n,w.prototype._is_comment=function(m){return!1},w.prototype._is_opening=function(m){return m.type===c.TAG_OPEN},w.prototype._is_closing=function(m,S){return m.type===c.TAG_CLOSE&&S&&((m.text===">"||m.text==="/>")&&S.text[0]==="<"||m.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},w.prototype._reset=function(){this._current_tag_name=""},w.prototype._get_next_token=function(m,S){var C=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(c.EOF,""):(C=C||this._read_open_handlebars(v,S),C=C||this._read_attribute(v,m,S),C=C||this._read_close(v,S),C=C||this._read_raw_content(v,m,S),C=C||this._read_content_word(v),C=C||this._read_comment_or_cdata(v),C=C||this._read_processing(v),C=C||this._read_open(v,S),C=C||this._create_token(c.UNKNOWN,this._input.next()),C)},w.prototype._read_comment_or_cdata=function(m){var S=null,C=null,v=null;if(m==="<"){var y=this._input.peek(1);y==="!"&&(C=this.__patterns.comment.read(),C?(v=d.get_directives(C),v&&v.ignore==="start"&&(C+=d.readIgnored(this._input))):C=this.__patterns.cdata.read()),C&&(S=this._create_token(c.COMMENT,C),S.directives=v)}return S},w.prototype._read_processing=function(m){var S=null,C=null,v=null;if(m==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(C=this.__patterns.conditional_comment.read(),C=C||this.__patterns.processing.read()),C&&(S=this._create_token(c.COMMENT,C),S.directives=v)}return S},w.prototype._read_open=function(m,S){var C=null,v=null;return S||m==="<"&&(C=this._input.next(),this._input.peek()==="/"&&(C+=this._input.next()),C+=this.__patterns.element_name.read(),v=this._create_token(c.TAG_OPEN,C)),v},w.prototype._read_open_handlebars=function(m,S){var C=null,v=null;return S||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(C=this.__patterns.handlebars_comment.read(),C=C||this.__patterns.handlebars.read(),v=this._create_token(c.COMMENT,C)):(C=this.__patterns.handlebars_open.read(),v=this._create_token(c.TAG_OPEN,C))),v},w.prototype._read_close=function(m,S){var C=null,v=null;return S&&(S.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(C=this._input.next(),m==="/"&&(C+=this._input.next()),v=this._create_token(c.TAG_CLOSE,C)):S.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),v=this._create_token(c.TAG_CLOSE,"}}"))),v},w.prototype._read_attribute=function(m,S,C){var v=null,y="";if(C&&C.text[0]==="<")if(m==="=")v=this._create_token(c.EQUALS,this._input.next());else if(m==='"'||m==="'"){var T=this._input.next();m==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),v=this._create_token(c.VALUE,T)}else y=this.__patterns.attribute.read(),y&&(S.type===c.EQUALS?v=this._create_token(c.VALUE,y):v=this._create_token(c.ATTRIBUTE,y));return v},w.prototype._is_content_unformatted=function(m){return this._options.void_elements.indexOf(m)===-1&&(this._options.content_unformatted.indexOf(m)!==-1||this._options.unformatted.indexOf(m)!==-1)},w.prototype._read_raw_content=function(m,S,C){var v="";if(C&&C.text[0]==="{")v=this.__patterns.handlebars_raw_close.read();else if(S.type===c.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var y=S.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var T=this._read_comment_or_cdata(m);if(T)return T.type=c.TEXT,T;v=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(v=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return v?this._create_token(c.TEXT,v):null},w.prototype._read_content_word=function(m){var S="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(c.TEXT,S)},o.exports.Tokenizer=w,o.exports.TOKEN=c}],x={};function g(o){var u=x[o];if(u!==void 0)return u.exports;var r=x[o]={exports:{}};return E[o](r,r.exports,g),r.exports}var h=g(18);I=h})();var k=I;if(!0)!(V=[oe,oe("6UM0"),oe("TXwP")],L=function(E){var x=oe("6UM0"),g=oe("TXwP");return{html_beautify:function(h,o){return k(h,o,x.js_beautify,g.css_beautify)}}}.apply(fe,V),L!==void 0&&(at.exports=L));else var M,f})()},q7KB:function(at,fe,oe){},"rAM+":function(at,fe,oe){"use strict";oe.d(fe,"a",function(){return L});var V=oe("Qw5x");function L(I,k){var M;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(M=Object(V.a)(I))||k&&I&&typeof I.length=="number"){M&&(I=M);var f=0,E=function(){};return{s:E,n:function(){return f>=I.length?{done:!0}:{done:!1,value:I[f++]}},e:function(u){throw u},f:E}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,g=!1,h;return{s:function(){M=I[Symbol.iterator]()},n:function(){var u=M.next();return x=u.done,u},e:function(u){g=!0,h=u},f:function(){try{!x&&M.return!=null&&M.return()}finally{if(g)throw h}}}}},rUJ1:function(at,fe){const oe=/[&<>"']/,V=/[&<>"']/g,L=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M=v=>k[v];function f(v,y){if(y){if(oe.test(v))return v.replace(V,M)}else if(L.test(v))return v.replace(I,M);return v}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function x(v){return v.replace(E,(y,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const g=/(^|[^\[])\^/g;function h(v,y){v=v.source||v,y=y||"";const T={replace:(A,p)=>(p=p.source||p,p=p.replace(g,"$1"),v=v.replace(A,p),T),getRegex:()=>new RegExp(v,y)};return T}const o=/[^\w:]/g,u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function r(v,y,T){if(v){let A;try{A=decodeURIComponent(x(T)).replace(o,"").toLowerCase()}catch(p){return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}y&&!u.test(T)&&(T=l(y,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(A){return null}return T}const n={},t=/^[^:]+:\/*[^/]*$/,i=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(v,y){n[" "+v]||(t.test(v)?n[" "+v]=v+"/":n[" "+v]=m(v,"/",!0)),v=n[" "+v];const T=v.indexOf(":")===-1;return y.substring(0,2)==="//"?T?y:v.replace(i,"$1")+y:y.charAt(0)==="/"?T?y:v.replace(s,"$1")+y:v+y}const c={exec:function(){}};function d(v){let y=1,T,A;for(;y<arguments.length;y++){T=arguments[y];for(A in T)Object.prototype.hasOwnProperty.call(T,A)&&(v[A]=T[A])}return v}function w(v,y){const T=v.replace(/\|/g,(D,O,P)=>{let j=!1,K=O;for(;--K>=0&&P[K]==="\\";)j=!j;return j?"|":" |"}),A=T.split(/ \|/);let p=0;if(A.length>y)A.splice(y);else for(;A.length<y;)A.push("");for(;p<A.length;p++)A[p]=A[p].trim().replace(/\\\|/g,"|");return A}function m(v,y,T){const A=v.length;if(A===0)return"";let p=0;for(;p<A;){const D=v.charAt(A-p-1);if(D===y&&!T)p++;else if(D!==y&&T)p++;else break}return v.substr(0,A-p)}function S(v,y){if(v.indexOf(y[1])===-1)return-1;const T=v.length;let A=0,p=0;for(;p<T;p++)if(v[p]==="\\")p++;else if(v[p]===y[0])A++;else if(v[p]===y[1]&&(A--,A<0))return p;return-1}function C(v){v&&v.sanitize&&!v.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")}at.exports={escape:f,unescape:x,edit:h,cleanUrl:r,resolveUrl:l,noopTest:c,merge:d,splitCells:w,rtrim:m,findClosingBracket:S,checkSanitizeDeprecation:C}},rwxt:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=oe("GdRQ");function L(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function I(E,x){for(var g=0;g<x.length;g++){var h=x[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(E,h.key,h)}}function k(E,x,g){return x&&I(E.prototype,x),g&&I(E,g),E}var M=!V.supportsCursorURIs||V.isTouchDevice,f=function(){function E(){L(this,E),this._target=null,this._canvas=document.createElement("canvas"),M&&(this._canvas.style.position="fixed",this._canvas.style.zIndex="65535",this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden"),this._position={x:0,y:0},this._hotSpot={x:0,y:0},this._eventHandlers={mouseover:this._handleMouseOver.bind(this),mouseleave:this._handleMouseLeave.bind(this),mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)}}return k(E,[{key:"attach",value:function(g){if(this._target&&this.detach(),this._target=g,M){document.body.appendChild(this._canvas);var h={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,h),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,h),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,h),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,h)}this.clear()}},{key:"detach",value:function(){if(!this._target)return;if(M){var g={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,g),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,g),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,g),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,g),document.body.removeChild(this._canvas)}this._target=null}},{key:"change",value:function(g,h,o,u,r){if(u===0||r===0){this.clear();return}this._position.x=this._position.x+this._hotSpot.x-h,this._position.y=this._position.y+this._hotSpot.y-o,this._hotSpot.x=h,this._hotSpot.y=o;var n=this._canvas.getContext("2d");this._canvas.width=u,this._canvas.height=r;var t;try{t=new ImageData(new Uint8ClampedArray(g),u,r)}catch(s){t=n.createImageData(u,r),t.data.set(new Uint8ClampedArray(g))}if(n.clearRect(0,0,u,r),n.putImageData(t,0,0),M)this._updatePosition();else{var i=this._canvas.toDataURL();this._target.style.cursor="url("+i+")"+h+" "+o+", default"}}},{key:"clear",value:function(){this._target.style.cursor="none",this._canvas.width=0,this._canvas.height=0,this._position.x=this._position.x+this._hotSpot.x,this._position.y=this._position.y+this._hotSpot.y,this._hotSpot.x=0,this._hotSpot.y=0}},{key:"move",value:function(g,h){if(!M)return;window.visualViewport?(this._position.x=g+window.visualViewport.offsetLeft,this._position.y=h+window.visualViewport.offsetTop):(this._position.x=g,this._position.y=h),this._updatePosition();var o=document.elementFromPoint(g,h);this._updateVisibility(o)}},{key:"_handleMouseOver",value:function(g){this._handleMouseMove(g)}},{key:"_handleMouseLeave",value:function(g){this._updateVisibility(g.relatedTarget)}},{key:"_handleMouseMove",value:function(g){this._updateVisibility(g.target),this._position.x=g.clientX-this._hotSpot.x,this._position.y=g.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(g){var h=this,o=document.elementFromPoint(g.clientX,g.clientY);this._updateVisibility(o),this._captureIsActive()&&window.setTimeout(function(){if(!h._target)return;o=document.elementFromPoint(g.clientX,g.clientY),h._updateVisibility(o)},0)}},{key:"_showCursor",value:function(){this._canvas.style.visibility==="hidden"&&(this._canvas.style.visibility="")}},{key:"_hideCursor",value:function(){this._canvas.style.visibility!=="hidden"&&(this._canvas.style.visibility="hidden")}},{key:"_shouldShowCursor",value:function(g){return g?g===this._target?!0:this._target.contains(g)?!(window.getComputedStyle(g).cursor!=="none"):!1:!1}},{key:"_updateVisibility",value:function(g){this._captureIsActive()&&(g=document.captureElement),this._shouldShowCursor(g)?this._showCursor():this._hideCursor()}},{key:"_updatePosition",value:function(){this._canvas.style.left=this._position.x+"px",this._canvas.style.top=this._position.y+"px"}},{key:"_captureIsActive",value:function(){return document.captureElement&&document.documentElement.contains(document.captureElement)}}]),E}();fe.default=f},sjKO:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=I;var V=30,L=12;function I(k,M){var f,E,x,g,h,o,u,r,n,t,i,s,l,c,d,w,m,S,C,v,y,T,A,p,D;f=k.state,E=k.next_in,p=k.input,x=E+(k.avail_in-5),g=k.next_out,D=k.output,h=g-(M-k.avail_out),o=g+(k.avail_out-257),u=f.dmax,r=f.wsize,n=f.whave,t=f.wnext,i=f.window,s=f.hold,l=f.bits,c=f.lencode,d=f.distcode,w=(1<<f.lenbits)-1,m=(1<<f.distbits)-1;e:do{l<15&&(s+=p[E++]<<l,l+=8,s+=p[E++]<<l,l+=8),S=c[s&w];t:for(;;){if(C=S>>>24,s>>>=C,l-=C,C=S>>>16&255,C===0)D[g++]=S&65535;else if(C&16){v=S&65535,C&=15,C&&(l<C&&(s+=p[E++]<<l,l+=8),v+=s&(1<<C)-1,s>>>=C,l-=C),l<15&&(s+=p[E++]<<l,l+=8,s+=p[E++]<<l,l+=8),S=d[s&m];i:for(;;){if(C=S>>>24,s>>>=C,l-=C,C=S>>>16&255,C&16){if(y=S&65535,C&=15,l<C&&(s+=p[E++]<<l,l+=8,l<C&&(s+=p[E++]<<l,l+=8)),y+=s&(1<<C)-1,y>u){k.msg="invalid distance too far back",f.mode=V;break e}if(s>>>=C,l-=C,C=g-h,y>C){if(C=y-C,C>n&&f.sane){k.msg="invalid distance too far back",f.mode=V;break e}if(T=0,A=i,t===0){if(T+=r-C,C<v){v-=C;do D[g++]=i[T++];while(--C);T=g-y,A=D}}else if(t<C){if(T+=r+t-C,C-=t,C<v){v-=C;do D[g++]=i[T++];while(--C);if(T=0,t<v){C=t,v-=C;do D[g++]=i[T++];while(--C);T=g-y,A=D}}}else if(T+=t-C,C<v){v-=C;do D[g++]=i[T++];while(--C);T=g-y,A=D}for(;v>2;)D[g++]=A[T++],D[g++]=A[T++],D[g++]=A[T++],v-=3;v&&(D[g++]=A[T++],v>1&&(D[g++]=A[T++]))}else{T=g-y;do D[g++]=D[T++],D[g++]=D[T++],D[g++]=D[T++],v-=3;while(v>2);v&&(D[g++]=D[T++],v>1&&(D[g++]=D[T++]))}}else if((C&64)===0){S=d[(S&65535)+(s&(1<<C)-1)];continue i}else{k.msg="invalid distance code",f.mode=V;break e}break}}else if((C&64)===0){S=c[(S&65535)+(s&(1<<C)-1)];continue t}else if(C&32){f.mode=L;break e}else{k.msg="invalid literal/length code",f.mode=V;break e}break}}while(E<x&&g<o);v=l>>3,E-=v,l-=v<<3,s&=(1<<l)-1,k.next_in=E,k.next_out=g,k.avail_in=E<x?5+(x-E):5-(E-x),k.avail_out=g<o?257+(o-g):257-(g-o),f.hold=s,f.bits=l;return}},ulZh:function(at,fe,oe){typeof window!="undefined"&&function(L,I){at.exports=I()}(this,function(){return function(V){var L={};function I(k){if(L[k])return L[k].exports;var M=L[k]={i:k,l:!1,exports:{}};return V[k].call(M.exports,M,M.exports,I),M.l=!0,M.exports}return I.m=V,I.c=L,I.d=function(k,M,f){I.o(k,M)||Object.defineProperty(k,M,{enumerable:!0,get:f})},I.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},I.t=function(k,M){if(M&1&&(k=I(k)),M&8)return k;if(M&4&&typeof k=="object"&&k&&k.__esModule)return k;var f=Object.create(null);if(I.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:k}),M&2&&typeof k!="string")for(var E in k)I.d(f,E,function(x){return k[x]}.bind(null,E));return f},I.n=function(k){var M=k&&k.__esModule?function(){return k.default}:function(){return k};return I.d(M,"a",M),M},I.o=function(k,M){return Object.prototype.hasOwnProperty.call(k,M)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(V,L,I){"use strict";var k=Object.prototype.hasOwnProperty,M="~";function f(){}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(M=!1));function E(o,u,r){this.fn=o,this.context=u,this.once=r||!1}function x(o,u,r,n,t){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new E(r,n||o,t),s=M?M+u:u;return o._events[s]?o._events[s].fn?o._events[s]=[o._events[s],i]:o._events[s].push(i):(o._events[s]=i,o._eventsCount++),o}function g(o,u){--o._eventsCount===0?o._events=new f:delete o._events[u]}function h(){this._events=new f,this._eventsCount=0}h.prototype.eventNames=function(){var u=[],r,n;if(this._eventsCount===0)return u;for(n in r=this._events)k.call(r,n)&&u.push(M?n.slice(1):n);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(r)):u},h.prototype.listeners=function(u){var r=M?M+u:u,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var t=0,i=n.length,s=new Array(i);t<i;t++)s[t]=n[t].fn;return s},h.prototype.listenerCount=function(u){var r=M?M+u:u,n=this._events[r];return n?n.fn?1:n.length:0},h.prototype.emit=function(u,r,n,t,i,s){var l=M?M+u:u;if(!this._events[l])return!1;var c=this._events[l],d=arguments.length,w,m;if(c.fn){c.once&&this.removeListener(u,c.fn,void 0,!0);switch(d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,t),!0;case 5:return c.fn.call(c.context,r,n,t,i),!0;case 6:return c.fn.call(c.context,r,n,t,i,s),!0}for(m=1,w=new Array(d-1);m<d;m++)w[m-1]=arguments[m];c.fn.apply(c.context,w)}else{var S=c.length,C;for(m=0;m<S;m++){c[m].once&&this.removeListener(u,c[m].fn,void 0,!0);switch(d){case 1:c[m].fn.call(c[m].context);break;case 2:c[m].fn.call(c[m].context,r);break;case 3:c[m].fn.call(c[m].context,r,n);break;case 4:c[m].fn.call(c[m].context,r,n,t);break;default:if(!w)for(C=1,w=new Array(d-1);C<d;C++)w[C-1]=arguments[C];c[m].fn.apply(c[m].context,w)}}}return!0},h.prototype.on=function(u,r,n){return x(this,u,r,n,!1)},h.prototype.once=function(u,r,n){return x(this,u,r,n,!0)},h.prototype.removeListener=function(u,r,n,t){var i=M?M+u:u;if(!this._events[i])return this;if(!r)return g(this,i),this;var s=this._events[i];if(s.fn)s.fn===r&&(!t||s.once)&&(!n||s.context===n)&&g(this,i);else{for(var l=0,c=[],d=s.length;l<d;l++)(s[l].fn!==r||t&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[i]=c.length===1?c[0]:c:g(this,i)}return this},h.prototype.removeAllListeners=function(u){var r;return u?(r=M?M+u:u,this._events[r]&&g(this,r)):(this._events=new f,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=M,h.EventEmitter=h,V.exports=h},"./node_modules/url-toolkit/src/url-toolkit.js":function(V,L,I){(function(k){var M=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,f=/^([^\/?#]*)([^]*)$/,E=/(?:\/|^)\.(?=\/)/g,x=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,g={buildAbsoluteURL:function(h,o,u){if(u=u||{},h=h.trim(),o=o.trim(),!o){if(!u.alwaysNormalize)return h;var r=g.parseURL(h);if(!r)throw new Error("Error trying to parse base URL.");return r.path=g.normalizePath(r.path),g.buildURLFromParts(r)}var n=g.parseURL(o);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return u.alwaysNormalize?(n.path=g.normalizePath(n.path),g.buildURLFromParts(n)):o;var t=g.parseURL(h);if(!t)throw new Error("Error trying to parse base URL.");if(!t.netLoc&&t.path&&t.path[0]!=="/"){var i=f.exec(t.path);t.netLoc=i[1],t.path=i[2]}t.netLoc&&!t.path&&(t.path="/");var s={scheme:t.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(s.netLoc=t.netLoc,n.path[0]!=="/"))if(!n.path)s.path=t.path,n.params||(s.params=t.params,n.query||(s.query=t.query));else{var l=t.path,c=l.substring(0,l.lastIndexOf("/")+1)+n.path;s.path=g.normalizePath(c)}return s.path===null&&(s.path=u.alwaysNormalize?g.normalizePath(n.path):n.path),g.buildURLFromParts(s)},parseURL:function(h){var o=M.exec(h);return o?{scheme:o[1]||"",netLoc:o[2]||"",path:o[3]||"",params:o[4]||"",query:o[5]||"",fragment:o[6]||""}:null},normalizePath:function(h){for(h=h.split("").reverse().join("").replace(E,"");h.length!==(h=h.replace(x,"")).length;);return h.split("").reverse().join("")},buildURLFromParts:function(h){return h.scheme+h.netLoc+h.path+h.params+h.query+h.fragment}};V.exports=g})(this)},"./node_modules/webworkify-webpack/index.js":function(V,L,I){function k(u){var r={};function n(i){if(r[i])return r[i].exports;var s=r[i]={i,l:!1,exports:{}};return u[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=u,n.c=r,n.i=function(i){return i},n.d=function(i,s,l){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:l})},n.r=function(i){Object.defineProperty(i,"__esModule",{value:!0})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="/",n.oe=function(i){throw console.error(i),i};var t=n(n.s=ENTRY_MODULE);return t.default||t}var M="[\\.|\\-|\\+|\\w|/|@]+",f="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function E(u){return(u+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function x(u){return!isNaN(1*u)}function g(u,r,n){var t={};t[n]=[];var i=r.toString(),s=i.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return t;for(var l=s[1],c=new RegExp("(\\\\n|\\W)"+E(l)+f,"g"),d;d=c.exec(i);){if(d[3]==="dll-reference")continue;t[n].push(d[3])}for(c=new RegExp("\\("+E(l)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+f,"g");d=c.exec(i);)u[d[2]]||(t[n].push(d[1]),u[d[2]]=I(d[1]).m),t[d[2]]=t[d[2]]||[],t[d[2]].push(d[4]);for(var w=Object.keys(t),m=0;m<w.length;m++)for(var S=0;S<t[w[m]].length;S++)x(t[w[m]][S])&&(t[w[m]][S]=1*t[w[m]][S]);return t}function h(u){var r=Object.keys(u);return r.reduce(function(n,t){return n||u[t].length>0},!1)}function o(u,r){for(var n={main:[r]},t={main:[]},i={main:{}};h(n);)for(var s=Object.keys(n),l=0;l<s.length;l++){var c=s[l],d=n[c],w=d.pop();if(i[c]=i[c]||{},i[c][w]||!u[c][w])continue;i[c][w]=!0,t[c]=t[c]||[],t[c].push(w);for(var m=g(u,u[c][w],c),S=Object.keys(m),C=0;C<S.length;C++)n[S[C]]=n[S[C]]||[],n[S[C]]=n[S[C]].concat(m[S[C]])}return t}V.exports=function(u,r){r=r||{};var n={main:I.m},t=r.all?{main:Object.keys(n.main)}:o(n,u),i="";Object.keys(t).filter(function(w){return w!=="main"}).forEach(function(w){for(var m=0;t[w][m];)m++;t[w].push(m),n[w][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",i=i+"var "+w+" = ("+k.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+t[w].map(function(S){return""+JSON.stringify(S)+": "+n[w][S].toString()}).join(",")+`});
`}),i=i+"new (("+k.toString().replace("ENTRY_MODULE",JSON.stringify(u))+")({"+t.main.map(function(w){return""+JSON.stringify(w)+": "+n.main[w].toString()}).join(",")+"}))(self);";var s=new window.Blob([i],{type:"text/javascript"});if(r.bare)return s;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,c=l.createObjectURL(s),d=new window.Worker(c);return d.objectURL=c,d}},"./src/config.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"hlsDefaultConfig",function(){return C}),I.d(L,"mergeConfig",function(){return y}),I.d(L,"enableStreamingMode",function(){return T});var k=I("./src/controller/abr-controller.ts"),M=I("./src/controller/audio-stream-controller.ts"),f=I("./src/controller/audio-track-controller.ts"),E=I("./src/controller/subtitle-stream-controller.ts"),x=I("./src/controller/subtitle-track-controller.ts"),g=I("./src/controller/buffer-controller.ts"),h=I("./src/controller/timeline-controller.ts"),o=I("./src/controller/cap-level-controller.ts"),u=I("./src/controller/fps-controller.ts"),r=I("./src/controller/eme-controller.ts"),n=I("./src/controller/cmcd-controller.ts"),t=I("./src/utils/xhr-loader.ts"),i=I("./src/utils/fetch-loader.ts"),s=I("./src/utils/cues.ts"),l=I("./src/utils/mediakeys-helper.ts"),c=I("./src/utils/logger.ts");function d(){return d=Object.assign||function(A){for(var p=1;p<arguments.length;p++){var D=arguments[p];for(var O in D)Object.prototype.hasOwnProperty.call(D,O)&&(A[O]=D[O])}return A},d.apply(this,arguments)}function w(A,p){var D=Object.keys(A);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(A);p&&(O=O.filter(function(P){return Object.getOwnPropertyDescriptor(A,P).enumerable})),D.push.apply(D,O)}return D}function m(A){for(var p=1;p<arguments.length;p++){var D=arguments[p]!=null?arguments[p]:{};p%2?w(Object(D),!0).forEach(function(O){S(A,O,D[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(D)):w(Object(D)).forEach(function(O){Object.defineProperty(A,O,Object.getOwnPropertyDescriptor(D,O))})}return A}function S(A,p,D){return p in A?Object.defineProperty(A,p,{value:D,enumerable:!0,configurable:!0,writable:!0}):A[p]=D,A}var C=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:t.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:k.default,bufferController:g.default,capLevelController:o.default,fpsController:u.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:l.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},v()),{},{subtitleStreamController:E.SubtitleStreamController,subtitleTrackController:x.default,timelineController:h.TimelineController,audioStreamController:M.default,audioTrackController:f.default,emeController:r.default,cmcdController:n.default});function v(){return{cueHandler:s.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 y(A,p){if((p.liveSyncDurationCount||p.liveMaxLatencyDurationCount)&&(p.liveSyncDuration||p.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(p.liveMaxLatencyDurationCount!==void 0&&(p.liveSyncDurationCount===void 0||p.liveMaxLatencyDurationCount<=p.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(p.liveMaxLatencyDuration!==void 0&&(p.liveSyncDuration===void 0||p.liveMaxLatencyDuration<=p.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},A,p)}function T(A){var p=A.loader;if(p!==i.default&&p!==t.default)c.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),A.progressive=!1;else{var D=Object(i.fetchSupported)();D&&(A.loader=i.default,A.progressive=!0,A.enableSoftwareAES=!0,c.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/polyfills/number.ts"),M=I("./src/utils/ewma-bandwidth-estimator.ts"),f=I("./src/events.ts"),E=I("./src/utils/buffer-helper.ts"),x=I("./src/errors.ts"),g=I("./src/types/loader.ts"),h=I("./src/utils/logger.ts");function o(n,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function u(n,t,i){return t&&o(n.prototype,t),i&&o(n,i),n}var r=function(){function n(i){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=i;var s=i.config;this.bwEstimator=new M.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var t=n.prototype;return t.registerListeners=function(){var s=this.hls;s.on(f.Events.FRAG_LOADING,this.onFragLoading,this),s.on(f.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(f.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(f.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(f.Events.FRAG_LOADING,this.onFragLoading,this),s.off(f.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(f.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(f.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(f.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},t.onFragLoading=function(s,l){var c=l.frag;if(c.type===g.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=c,this.partCurrent=(d=l.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},t.onLevelLoaded=function(s,l){var c=this.hls.config;l.details.live?this.bwEstimator.update(c.abrEwmaSlowLive,c.abrEwmaFastLive):this.bwEstimator.update(c.abrEwmaSlowVoD,c.abrEwmaFastVoD)},t._abandonRulesCheck=function(){var s=this.fragCurrent,l=this.partCurrent,c=this.hls,d=c.autoLevelEnabled,w=c.config,m=c.media;if(!s||!m)return;var S=l?l.stats:s.stats,C=l?l.duration:s.duration;if(S.aborted){h.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||m.paused||!m.playbackRate||!m.readyState)return;var v=performance.now()-S.loading.start,y=Math.abs(m.playbackRate);if(v<=500*C/y)return;var T=c.levels,A=c.minAutoLevel,p=T[s.level],D=S.total||Math.max(S.loaded,Math.round(C*p.maxBitrate/8)),O=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/v),P=(D-S.loaded)/O,j=m.currentTime,K=(E.BufferHelper.bufferInfo(m,j,w.maxBufferHole).end-j)/y;if(K>=2*C/y||P<=K)return;var U=Number.POSITIVE_INFINITY,X;for(X=s.level-1;X>A;X--){var B=T[X].maxBitrate;if(U=C*B/(8*.8*O),U<K)break}if(U>=P)return;var N=this.bwEstimator.getEstimate();h.logger.warn("Fragment "+s.sn+(l?" part "+l.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+X+`
Current BW estimate: `+(Object(k.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+P.toFixed(3)+` s
Estimated load time for the next fragment: `+U.toFixed(3)+` s
Time to underbuffer: `+K.toFixed(3)+" s"),c.nextLoadLevel=X,this.bwEstimator.sample(v,S.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),c.trigger(f.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:l,stats:S})},t.onFragLoaded=function(s,l){var c=l.frag,d=l.part;if(c.type===g.PlaylistLevelType.MAIN&&Object(k.isFiniteNumber)(c.sn)){var w=d?d.stats:c.stats,m=d?d.duration:c.duration;if(this.clearTimer(),this.lastLoadedFragLevel=c.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[c.level],C=(S.loaded?S.loaded.bytes:0)+w.loaded,v=(S.loaded?S.loaded.duration:0)+m;S.loaded={bytes:C,duration:v},S.realBitrate=Math.round(8*C/v)}if(c.bitrateTest){var y={stats:w,frag:c,part:d,id:c.type};this.onFragBuffered(f.Events.FRAG_BUFFERED,y),c.bitrateTest=!1}}},t.onFragBuffered=function(s,l){var c=l.frag,d=l.part,w=d?d.stats:c.stats;if(w.aborted)return;if(c.type!==g.PlaylistLevelType.MAIN||c.sn==="initSegment")return;var m=w.parsing.end-w.loading.start;this.bwEstimator.sample(m,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),c.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},t.onError=function(s,l){switch(l.details){case x.ErrorDetails.FRAG_LOAD_ERROR:case x.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},t.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},t.getNextABRAutoLevel=function(){var s=this.fragCurrent,l=this.partCurrent,c=this.hls,d=c.maxAutoLevel,w=c.config,m=c.minAutoLevel,S=c.media,C=l?l.duration:s?s.duration:0,v=S?S.currentTime:0,y=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,A=(E.BufferHelper.bufferInfo(S,v,w.maxBufferHole).end-v)/y,p=this.findBestLevel(T,m,d,A,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(p>=0)return p;h.logger.trace((A?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var D=C?Math.min(C,w.maxStarvationDelay):w.maxStarvationDelay,O=w.abrBandWidthFactor,P=w.abrBandWidthUpFactor;if(!A){var j=this.bitrateTestDelay;if(j){var K=C?Math.min(C,w.maxLoadingDelay):w.maxLoadingDelay;D=K-j,h.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*D)+" ms"),O=P=1}}return p=this.findBestLevel(T,m,d,A+D,O,P),Math.max(p,0)},t.findBestLevel=function(s,l,c,d,w,m){for(var S,C=this.fragCurrent,v=this.partCurrent,y=this.lastLoadedFragLevel,T=this.hls.levels,A=T[y],p=!!(A!=null&&(S=A.details)!==null&&S!==void 0&&S.live),D=A==null?void 0:A.codecSet,O=v?v.duration:C?C.duration:0,P=c;P>=l;P--){var j=T[P];if(!j||D&&j.codecSet!==D)continue;var K=j.details,U=(v?K==null?void 0:K.partTarget:K==null?void 0:K.averagetargetduration)||O,X=void 0;P<=y?X=w*s:X=m*s;var B=T[P].maxBitrate,N=B*U/X;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(X)+"/"+B+"/"+U+"/"+d+"/"+N),X>B&&(!N||p&&!this.bitrateTestDelay||N<d))return P}return-1},u(n,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,l=this.bwEstimator;if(s!==-1&&(!l||!l.canEstimate()))return s;var c=this.getNextABRAutoLevel();return s!==-1&&(c=Math.min(s,c)),c},set:function(s){this._nextAutoLevel=s}}]),n}();L.default=r},"./src/controller/audio-stream-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/polyfills/number.ts"),M=I("./src/controller/base-stream-controller.ts"),f=I("./src/events.ts"),E=I("./src/utils/buffer-helper.ts"),x=I("./src/controller/fragment-tracker.ts"),g=I("./src/types/level.ts"),h=I("./src/types/loader.ts"),o=I("./src/loader/fragment.ts"),u=I("./src/demux/chunk-cache.ts"),r=I("./src/demux/transmuxer-interface.ts"),n=I("./src/types/transmuxer.ts"),t=I("./src/controller/fragment-finders.ts"),i=I("./src/utils/discontinuities.ts"),s=I("./src/errors.ts"),l=I("./src/utils/logger.ts");function c(){return c=Object.assign||function(C){for(var v=1;v<arguments.length;v++){var y=arguments[v];for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&(C[T]=y[T])}return C},c.apply(this,arguments)}function d(C,v){C.prototype=Object.create(v.prototype),C.prototype.constructor=C,w(C,v)}function w(C,v){return w=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},w(C,v)}var m=100,S=function(C){d(v,C);function v(T,A){var p;return p=C.call(this,T,A,"[audio-stream-controller]")||this,p.videoBuffer=null,p.videoTrackCC=-1,p.waitingVideoCC=-1,p.audioSwitch=!1,p.trackId=-1,p.waitingData=null,p.mainDetails=null,p.bufferFlushed=!1,p._registerListeners(),p}var y=v.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._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.LEVEL_LOADED,this.onLevelLoaded,this),A.on(f.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),A.on(f.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),A.on(f.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),A.on(f.Events.ERROR,this.onError,this),A.on(f.Events.BUFFER_RESET,this.onBufferReset,this),A.on(f.Events.BUFFER_CREATED,this.onBufferCreated,this),A.on(f.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),A.on(f.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),A.on(f.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._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.LEVEL_LOADED,this.onLevelLoaded,this),A.off(f.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),A.off(f.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),A.off(f.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),A.off(f.Events.ERROR,this.onError,this),A.off(f.Events.BUFFER_RESET,this.onBufferReset,this),A.off(f.Events.BUFFER_CREATED,this.onBufferCreated,this),A.off(f.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),A.off(f.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),A.off(f.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(A,p){var D=p.frag,O=p.id,P=p.initPTS;if(O==="main"){var j=D.cc;this.initPTS[D.cc]=P,this.log("InitPTS for cc: "+j+" found from main: "+P),this.videoTrackCC=j,this.state===M.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(A){if(!this.levels){this.startPosition=A,this.state=M.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,p>0&&A===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=A,this.tick()},y.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var A,p=this.levels,D=this.trackId,O=p==null||((A=p[D])===null||A===void 0)?void 0:A.details;if(O){if(this.waitForCdnTuneIn(O))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var P,j=performance.now(),K=this.retryDate;(!K||j>=K||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var U=this.waitingData;if(U){var X=U.frag,B=U.part,N=U.cache,z=U.complete;if(this.initPTS[X.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var te=N.flush(),ce={frag:X,part:B,payload:te,networkDetails:null};this._handleFragmentLoadProgress(ce),z&&C.prototype._handleFragmentLoadComplete.call(this,ce)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+X.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var be=this.getLoadPosition(),Fe=E.BufferHelper.bufferInfo(this.mediaBuffer,be,this.config.maxBufferHole),Oe=Object(t.fragmentWithinToleranceTest)(Fe.end,this.config.maxFragLookUpTolerance,X);Oe<0&&(l.logger.log("Waiting fragment cc ("+X.cc+") @ "+X.start+" cancelled because another fragment at "+Fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var A=this.waitingData;A&&(this.fragmentTracker.removeFragment(A.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},y.onTickEnd=function(){var A=this.media;if(!A||!A.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:A,D=p.buffered;!this.loadedmetadata&&D.length&&(this.loadedmetadata=!0),this.lastCurrentTime=A.currentTime},y.doTickIdle=function(){var A,p,D=this.hls,O=this.levels,P=this.media,j=this.trackId,K=D.config;if(!O||!O[j])return;if(!P&&(this.startFragRequested||!K.startFragPrefetch))return;var U=O[j],X=U.details;if(!X||X.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(X)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,o.ElementaryStreamTypes.AUDIO,h.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,h.PlaylistLevelType.AUDIO);if(B===null)return;var N=B.len,z=this.getMaxBufferLength(),te=this.audioSwitch;if(N>=z&&!te)return;if(!te&&this._streamEnded(B,X)){D.trigger(f.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var ce=X.fragments,be=ce[0].start,Fe=B.end;if(te){var Oe=this.getLoadPosition();Fe=Oe,X.PTSKnown&&Oe<be&&((B.end>be||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=be+.05))}var Re=this.getNextFragment(Fe,X);if(!Re){this.bufferFlushed=!0;return}((A=Re.decryptdata)===null||A===void 0?void 0:A.keyFormat)==="identity"&&!((p=Re.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(Re,X):this.loadFragment(Re,X,Fe)},y.getMaxBufferLength=function(){var A=C.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,h.PlaylistLevelType.MAIN);return p===null?A:Math.max(A,p.len)},y.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(A,p){var D=p.audioTracks;this.resetTransmuxer(),this.levels=D.map(function(O){return new g.Level(O)})},y.onAudioTrackSwitching=function(A,p){var D=!!p.url;this.trackId=p.id;var O=this.fragCurrent;O!=null&&O.loader&&O.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),D?this.setInterval(m):this.resetTransmuxer(),D?(this.audioSwitch=!0,this.state=M.State.IDLE):this.state=M.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(A,p){this.mainDetails=p.details},y.onAudioTrackLoaded=function(A,p){var D,O=this.levels,P=p.details,j=p.id;if(!O){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var K=O[j],U=0;if(P.live||(D=K.details)!==null&&D!==void 0&&D.live){var X=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!X)return;!K.details&&P.hasProgramDateTime&&X.hasProgramDateTime?(Object(i.alignMediaPlaylistByPDT)(P,X),U=P.fragments[0].start):U=this.alignPlaylists(P,K.details)}K.details=P,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(K.details,U),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=M.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(A){var p,D=A.frag,O=A.part,P=A.payload,j=this.config,K=this.trackId,U=this.levels;if(!U){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+D.sn+" of level "+D.level+" will not be buffered");return}var X=U[K];console.assert(X,"Audio track is defined on fragment load progress");var B=X.details;console.assert(B,"Audio track details are defined on fragment load progress");var N=j.defaultAudioCodec||X.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new r.default(this.hls,h.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[D.cc],ce=(p=D.initSegment)===null||p===void 0?void 0:p.data;if(te!==void 0){var be=!1,Fe=O?O.index:-1,Oe=Fe!==-1,Re=new n.ChunkMetadata(D.level,D.sn,D.stats.chunkCount,P.byteLength,Fe,Oe);z.push(P,ce,N,"",D,O,B.totalduration,be,Re,te)}else{l.logger.log("Unknown video PTS for cc "+D.cc+", waiting for video PTS before demuxing audio frag "+D.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+K);var Be=this.waitingData=this.waitingData||{frag:D,part:O,cache:new u.default,complete:!1},Ke=Be.cache;Ke.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(A){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,A)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(A,p){var D=p.tracks.audio;D&&(this.mediaBuffer=D.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},y.onFragBuffered=function(A,p){var D=p.frag,O=p.part;if(D.type!==h.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(D)){this.warn("Fragment "+D.sn+(O?" p: "+O.index:"")+" of level "+D.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}D.sn!=="initSegment"&&(this.fragPrevious=D,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(f.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(D,O)},y.onError=function(A,p){switch(p.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(h.PlaylistLevelType.AUDIO,p);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==M.State.ERROR&&this.state!==M.State.STOPPED&&(this.state=p.fatal?M.State.ERROR:M.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var D=!0,O=this.getFwdBufferInfo(this.mediaBuffer,h.PlaylistLevelType.AUDIO);O&&O.len>.5&&(D=!this.reduceMaxBufferLength(O.len)),D&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(A,p){var D=p.type;D===o.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(A){var p,D="audio",O=this.hls,P=A.remuxResult,j=A.chunkMeta,K=this.getCurrentContext(j);if(!K){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var U=K.frag,X=K.part,B=P.audio,N=P.text,z=P.id3,te=P.initSegment;if(this.fragContextChanged(U))return;if(this.state=M.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,U,j),O.trigger(f.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:D,tracks:te.tracks})),B){var ce=B.startPTS,be=B.endPTS,Fe=B.startDTS,Oe=B.endDTS;X&&(X.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:be,startDTS:Fe,endDTS:Oe}),U.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,ce,be,Fe,Oe),this.bufferFragmentData(B,U,X,j)}if(z!=null&&(p=z.samples)!==null&&p!==void 0&&p.length){var Re=c({frag:U,id:D},z);O.trigger(f.Events.FRAG_PARSING_METADATA,Re)}if(N){var Be=c({frag:U,id:D},N);O.trigger(f.Events.FRAG_PARSING_USERDATA,Be)}},y._bufferInitSegment=function(A,p,D){if(this.state!==M.State.PARSING)return;A.video&&delete A.video;var O=A.audio;if(!O)return;O.levelCodec=O.codec,O.id="audio",this.log("Init audio buffer, container:"+O.container+", codecs[parsed]=["+O.codec+"]"),this.hls.trigger(f.Events.BUFFER_CODECS,A);var P=O.initSegment;if(P!=null&&P.byteLength){var j={type:"audio",frag:p,part:null,chunkMeta:D,parent:p.type,data:P};this.hls.trigger(f.Events.BUFFER_APPENDING,j)}this.tick()},y.loadFragment=function(A,p,D){var O=this.fragmentTracker.getState(A);this.fragCurrent=A,(this.audioSwitch||O===x.FragmentState.NOT_LOADED||O===x.FragmentState.PARTIAL)&&(A.sn==="initSegment"?this._loadInitSegment(A):p.live&&!Object(k.isFiniteNumber)(this.initPTS[A.cc])?(this.log("Waiting for video PTS in continuity counter "+A.cc+" of live stream before loading audio fragment "+A.sn+" of level "+this.trackId),this.state=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,A,p,D)))},y.completeAudioSwitch=function(){var A=this.hls,p=this.media,D=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,A.trigger(f.Events.AUDIO_TRACK_SWITCHED,{id:D})},v}(M.default);L.default=S},"./src/controller/audio-track-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function x(r,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function g(r,n,t){return n&&x(r.prototype,n),t&&x(r,t),r}function h(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,o(r,n)}function o(r,n){return o=Object.setPrototypeOf||function(i,s){return i.__proto__=s,i},o(r,n)}var u=function(r){h(n,r);function n(i){var s;return s=r.call(this,i,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var t=n.prototype;return t.registerListeners=function(){var s=this.hls;s.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(k.Events.ERROR,this.onError,this)},t.unregisterListeners=function(){var s=this.hls;s.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(k.Events.ERROR,this.onError,this)},t.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,r.prototype.destroy.call(this)},t.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},t.onManifestParsed=function(s,l){this.tracks=l.audioTracks||[]},t.onAudioTrackLoaded=function(s,l){var c=l.id,d=l.details,w=this.tracksInGroup[c];if(!w){this.warn("Invalid audio track id "+c);return}var m=w.details;w.details=l.details,this.log("audioTrack "+c+" loaded ["+d.startSN+"-"+d.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,l,m))},t.onLevelLoading=function(s,l){this.switchLevel(l.level)},t.onLevelSwitching=function(s,l){this.switchLevel(l.level)},t.switchLevel=function(s){var l=this.hls.levels[s];if(!(l!=null&&l.audioGroupIds))return;var c=l.audioGroupIds[l.urlId];if(this.groupId!==c){this.groupId=c;var d=this.tracks.filter(function(m){return!c||m.groupId===c});this.selectDefaultTrack&&!d.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var w={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(k.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},t.onError=function(s,l){if(r.prototype.onError.call(this,s,l),l.fatal||!l.context)return;l.context.type===E.PlaylistContextType.AUDIO_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},t.setAudioTrack=function(s){var l=this.tracksInGroup;if(s<0||s>=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var c=l[this.trackId];this.log("Now switching to audio-track index "+s);var d=l[s],w=d.id,m=d.groupId,S=m===void 0?"":m,C=d.name,v=d.type,y=d.url;if(this.trackId=s,this.trackName=C,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:S,name:C,type:v,url:y}),d.details&&!d.details.live)return;var T=this.switchParams(d.url,c==null?void 0:c.details);this.loadPlaylist(T)},t.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,c=this.findTrackId(l)||this.findTrackId();c!==-1?this.setAudioTrack(c):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},t.findTrackId=function(s){for(var l=this.tracksInGroup,c=0;c<l.length;c++){var d=l[c];if((!this.selectDefaultTrack||d.default)&&(!s||s===d.name))return d.id}return-1},t.loadPlaylist=function(s){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var c=l.id,d=l.groupId,w=l.url;if(s)try{w=s.addDirectives(w)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+c),this.clearTimer(),this.hls.trigger(k.Events.AUDIO_TRACK_LOADING,{url:w,id:c,groupId:d,deliveryDirectives:s||null})}},g(n,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),n}(f.default);L.default=u},"./src/controller/base-playlist-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return g});var k=I("./src/polyfills/number.ts"),M=I("./src/types/level.ts"),f=I("./src/controller/level-helper.ts"),E=I("./src/utils/logger.ts"),x=I("./src/errors.ts"),g=function(){function h(u,r){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=E.logger.log.bind(E.logger,r+":"),this.warn=E.logger.warn.bind(E.logger,r+":"),this.hls=u}var o=h.prototype;return o.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},o.onError=function(r,n){n.fatal&&n.type===x.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},o.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},o.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},o.stopLoad=function(){this.canLoad=!1,this.clearTimer()},o.switchParams=function(r,n){var t=n==null?void 0:n.renditionReports;if(t)for(var i=0;i<t.length;i++){var s=t[i],l=""+s.URI;if(l===r.substr(-l.length)){var c=parseInt(s["LAST-MSN"]),d=parseInt(s["LAST-PART"]);if(n&&this.hls.config.lowLatencyMode){var w=Math.min(n.age-n.partTarget,n.targetduration);d!==void 0&&w>n.partTarget&&(d+=1)}if(Object(k.isFiniteNumber)(c))return new M.HlsUrlParameters(c,Object(k.isFiniteNumber)(d)?d:void 0,M.HlsSkip.No)}}},o.loadPlaylist=function(r){},o.shouldLoadTrack=function(r){return this.canLoad&&r&&!!r.url&&(!r.details||r.details.live)},o.playlistLoaded=function(r,n,t){var i=this,s=n.details,l=n.stats,c=l.loading.end?Math.max(0,self.performance.now()-l.loading.end):0;if(s.advancedDateTime=Date.now()-c,s.live||t!=null&&t.live){if(s.reloaded(t),t&&this.log("live playlist "+r+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),t&&s.fragments.length>0&&Object(f.mergeDetails)(t,s),!this.canLoad||!s.live)return;var d,w=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var S=this.hls.config.lowLatencyMode,C=s.lastPartSn,v=s.endSN,y=s.lastPartIndex,T=y!==-1,A=C===v,p=S?0:y;T?(w=A?v+1:C,m=A?p:y+1):w=v+1;var D=s.age,O=D+s.ageHeader,P=Math.min(O-s.partTarget,s.targetduration*1.5);if(P>0){if(t&&P>t.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+t.tuneInGoal+" to: "+P+" with playlist age: "+s.age),P=0;else{var j=Math.floor(P/s.targetduration);if(w+=j,m!==void 0){var K=Math.round(P%s.targetduration/s.partTarget);m+=K}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+D.toFixed(2)+"s goal: "+P+" skip sn "+j+" to part "+m)}s.tuneInGoal=P}if(d=this.getDeliveryDirectives(s,n.deliveryDirectives,w,m),S||!A){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(s,n.deliveryDirectives,w,m);var U=Object(f.computeReloadInterval)(s,l);w!==void 0&&s.canBlockReload&&(U-=s.partTarget||1),this.log("reload live playlist "+r+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return i.loadPlaylist(d)},U)}else this.clearTimer()},o.getDeliveryDirectives=function(r,n,t,i){var s=Object(M.getSkipValue)(r,t);return n!=null&&n.skip&&r.deltaUpdateFailed&&(t=n.msn,i=n.part,s=M.HlsSkip.No),new M.HlsUrlParameters(t,i,s)},o.retryLoadingOrFail=function(r){var n=this,t=this.hls.config,i=this.retryCount<t.levelLoadingMaxRetry;if(i){var s;if(this.retryCount++,r.details.indexOf("LoadTimeOut")>-1&&(s=r.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+r.details+'"'),this.loadPlaylist();else{var l=Math.min(Math.pow(2,this.retryCount)*t.levelLoadingRetryDelay,t.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return n.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+r.details+'"')}}else this.warn('cannot recover from error "'+r.details+'"'),this.clearTimer(),r.fatal=!0;return i},h}()},"./src/controller/base-stream-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"State",function(){return v}),I.d(L,"default",function(){return y});var k=I("./src/polyfills/number.ts"),M=I("./src/task-loop.ts"),f=I("./src/controller/fragment-tracker.ts"),E=I("./src/utils/buffer-helper.ts"),x=I("./src/utils/logger.ts"),g=I("./src/events.ts"),h=I("./src/errors.ts"),o=I("./src/types/transmuxer.ts"),u=I("./src/utils/mp4-tools.ts"),r=I("./src/utils/discontinuities.ts"),n=I("./src/controller/fragment-finders.ts"),t=I("./src/controller/level-helper.ts"),i=I("./src/loader/fragment-loader.ts"),s=I("./src/crypt/decrypter.ts"),l=I("./src/utils/time-ranges.ts"),c=I("./src/types/loader.ts");function d(T,A){for(var p=0;p<A.length;p++){var D=A[p];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}function w(T,A,p){return A&&d(T.prototype,A),p&&d(T,p),T}function m(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function S(T,A){T.prototype=Object.create(A.prototype),T.prototype.constructor=T,C(T,A)}function C(T,A){return C=Object.setPrototypeOf||function(D,O){return D.__proto__=O,D},C(T,A)}var v={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"},y=function(T){S(A,T);function A(D,O,P){var j;return j=T.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=v.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=P,j.log=x.logger.log.bind(x.logger,P+":"),j.warn=x.logger.warn.bind(x.logger,P+":"),j.hls=D,j.fragmentLoader=new i.default(D.config),j.fragmentTracker=O,j.config=D.config,j.decrypter=new s.default(D,D.config),D.on(g.Events.KEY_LOADED,j.onKeyLoaded,m(j)),j}var p=A.prototype;return p.doTick=function(){this.onTickEnd()},p.onTickEnd=function(){},p.startLoad=function(O){},p.stopLoad=function(){this.fragmentLoader.abort();var O=this.fragCurrent;O&&this.fragmentTracker.removeFragment(O),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=v.STOPPED},p._streamEnded=function(O,P){var j=this.fragCurrent,K=this.fragmentTracker;if(!P.live&&j&&j.sn===P.endSN&&!O.nextStart){var U=K.getState(j);return U===f.FragmentState.PARTIAL||U===f.FragmentState.OK}return!1},p.onMediaAttached=function(O,P){var j=this.media=this.mediaBuffer=P.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var K=this.config;this.levels&&K.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(K.startPosition)},p.onMediaDetaching=function(){var O=this.media;O!=null&&O.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),O&&(O.removeEventListener("seeking",this.onvseeking),O.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},p.onMediaSeeking=function(){var O=this.config,P=this.fragCurrent,j=this.media,K=this.mediaBuffer,U=this.state,X=j?j.currentTime:0,B=E.BufferHelper.bufferInfo(K||j,X,O.maxBufferHole);if(this.log("media seeking to "+(Object(k.isFiniteNumber)(X)?X.toFixed(3):X)+", state: "+U),U===v.ENDED)this.resetLoadingState();else if(P&&!B.len){var N=O.maxFragLookUpTolerance,z=P.start-N,te=P.start+P.duration+N,ce=X>te;(X<z||ce)&&(ce&&P.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),P.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=X),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=X),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(O,P){if(this.state!==v.KEY_LOADING||P.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var j=this.levels[P.frag.level].details;j&&this.loadFragment(P.frag,j,P.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),T.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(g.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,T.prototype.onHandlerDestroyed.call(this)},p.loadKey=function(O,P){this.log("Loading key for "+O.sn+" of ["+P.startSN+"-"+P.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level),this.state=v.KEY_LOADING,this.fragCurrent=O,this.hls.trigger(g.Events.KEY_LOADING,{frag:O})},p.loadFragment=function(O,P,j){this._loadFragForPlayback(O,P,j)},p._loadFragForPlayback=function(O,P,j){var K=this,U=function(B){if(K.fragContextChanged(O)){K.warn("Fragment "+O.sn+(B.part?" p: "+B.part.index:"")+" of level "+O.level+" was dropped during download."),K.fragmentTracker.removeFragment(O);return}O.stats.chunkCount++,K._handleFragmentLoadProgress(B)};this._doFragLoad(O,P,j,U).then(function(X){if(!X)return;K.fragLoadError=0;var B=K.state;if(K.fragContextChanged(O)){(B===v.FRAG_LOADING||B===v.BACKTRACKING||!K.fragCurrent&&B===v.PARSING)&&(K.fragmentTracker.removeFragment(O),K.state=v.IDLE);return}if("payload"in X&&(K.log("Loaded fragment "+O.sn+" of level "+O.level),K.hls.trigger(g.Events.FRAG_LOADED,X),K.state===v.BACKTRACKING)){K.fragmentTracker.backtrack(O,X),K.resetFragmentLoading(O);return}K._handleFragmentLoadComplete(X)}).catch(function(X){K.warn(X),K.resetFragmentLoading(O)})},p.flushMainBuffer=function(O,P,j){if(j===void 0&&(j=null),!(O-P))return;var K={startOffset:O,endOffset:P,type:j};this.fragLoadError=0,this.hls.trigger(g.Events.BUFFER_FLUSHING,K)},p._loadInitSegment=function(O){var P=this;this._doFragLoad(O).then(function(j){if(!j||P.fragContextChanged(O)||!P.levels)throw new Error("init load aborted");return j}).then(function(j){var K=P.hls,U=j.payload,X=O.decryptdata;if(U&&U.byteLength>0&&X&&X.key&&X.iv&&X.method==="AES-128"){var B=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(U),X.key.buffer,X.iv.buffer).then(function(N){var z=self.performance.now();return K.trigger(g.Events.FRAG_DECRYPTED,{frag:O,payload:N,stats:{tstart:B,tdecrypt:z}}),j.payload=N,j})}return j}).then(function(j){var K=P.fragCurrent,U=P.hls,X=P.levels;if(!X)throw new Error("init load aborted, missing levels");var B=X[O.level].details;console.assert(B,"Level details are defined when init segment is loaded");var N=O.stats;P.state=v.IDLE,P.fragLoadError=0,O.data=new Uint8Array(j.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),j.frag===K&&U.trigger(g.Events.FRAG_BUFFERED,{stats:N,frag:K,part:null,id:O.type}),P.tick()}).catch(function(j){P.warn(j),P.resetFragmentLoading(O)})},p.fragContextChanged=function(O){var P=this.fragCurrent;return!O||!P||O.level!==P.level||O.sn!==P.sn||O.urlId!==P.urlId},p.fragBufferedComplete=function(O,P){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+O.type+" sn: "+O.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+O.level+" "+l.default.toString(E.BufferHelper.getBuffered(j))),this.state=v.IDLE,this.tick()},p._handleFragmentLoadComplete=function(O){var P=this.transmuxer;if(!P)return;var j=O.frag,K=O.part,U=O.partsLoaded,X=!U||U.length===0||U.some(function(N){return!N}),B=new o.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,K?K.index:-1,!X);P.flush(B)},p._handleFragmentLoadProgress=function(O){},p._doFragLoad=function(O,P,j,K){var U=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(O.start,j||0),this.config.lowLatencyMode&&P){var X=P.partList;if(X&&K){j>O.end&&P.fragmentHint&&(O=P.fragmentHint);var B=this.getNextPart(X,O,j);if(B>-1){var N=X[B];return this.log("Loading part sn: "+O.sn+" p: "+N.index+" cc: "+O.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+B+"-"+(X.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=v.FRAG_LOADING,this.hls.trigger(g.Events.FRAG_LOADING,{frag:O,part:X[B],targetBufferTime:j}),this.doFragPartsLoad(O,X,B,K).catch(function(z){return U.handleFragLoadError(z)})}else if(!O.url||this.loadedEndOfParts(X,j))return Promise.resolve(null)}}return this.log("Loading fragment "+O.sn+" cc: "+O.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+O.level+", target: "+parseFloat(j.toFixed(3))),Object(k.isFiniteNumber)(O.sn)&&!this.bitrateTest&&(this.nextLoadPosition=O.start+O.duration),this.state=v.FRAG_LOADING,this.hls.trigger(g.Events.FRAG_LOADING,{frag:O,targetBufferTime:j}),this.fragmentLoader.load(O,K).catch(function(z){return U.handleFragLoadError(z)})},p.doFragPartsLoad=function(O,P,j,K){var U=this;return new Promise(function(X,B){var N=[],z=function te(ce){var be=P[ce];U.fragmentLoader.loadPart(O,be,K).then(function(Fe){N[be.index]=Fe;var Oe=Fe.part;U.hls.trigger(g.Events.FRAG_LOADED,Fe);var Re=P[ce+1];if(Re&&Re.fragment===O)te(ce+1);else return X({frag:O,part:Oe,partsLoaded:N})}).catch(B)};z(j)})},p.handleFragLoadError=function(O){var P=O.data;return P&&P.details===h.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(g.Events.ERROR,P),null},p._handleTransmuxerFlush=function(O){var P=this.getCurrentContext(O);if(!P||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var j=P.frag,K=P.part,U=P.level,X=self.performance.now();j.stats.parsing.end=X,K&&(K.stats.parsing.end=X),this.updateLevelTiming(j,K,U,O.partial)},p.getCurrentContext=function(O){var P=this.levels,j=O.level,K=O.sn,U=O.part;if(!P||!P[j])return this.warn("Levels object was unset while buffering fragment "+K+" of level "+j+". The current chunk will not be buffered."),null;var X=P[j],B=U>-1?Object(t.getPartWith)(X,K,U):null,N=B?B.fragment:Object(t.getFragmentWithSN)(X,K,this.fragCurrent);return N?{frag:N,part:B,level:X}:null},p.bufferFragmentData=function(O,P,j,K){if(!O||this.state!==v.PARSING)return;var U=O.data1,X=O.data2,B=U;if(U&&X&&(B=Object(u.appendUint8Array)(U,X)),!B||!B.length)return;var N={type:O.type,frag:P,part:j,chunkMeta:K,parent:P.type,data:B};this.hls.trigger(g.Events.BUFFER_APPENDING,N),O.dropped&&O.independent&&!j&&this.flushBufferGap(P)},p.flushBufferGap=function(O){var P=this.media;if(!P)return;if(!E.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,O.start);return}var j=P.currentTime,K=E.BufferHelper.bufferInfo(P,j,0),U=O.duration,X=Math.min(this.config.maxFragLookUpTolerance*2,U*.25),B=Math.max(Math.min(O.start-X,K.end-X),j+X);O.start-B>X&&this.flushMainBuffer(B,O.start)},p.getFwdBufferInfo=function(O,P){var j=this.config,K=this.getLoadPosition();if(!Object(k.isFiniteNumber)(K))return null;var U=E.BufferHelper.bufferInfo(O,K,j.maxBufferHole);if(U.len===0&&U.nextStart!==void 0){var X=this.fragmentTracker.getBufferedFrag(K,P);if(X&&U.nextStart<X.end)return E.BufferHelper.bufferInfo(O,K,Math.max(U.nextStart,j.maxBufferHole))}return U},p.getMaxBufferLength=function(O){var P=this.config,j;return O?j=Math.max(8*P.maxBufferSize/O,P.maxBufferLength):j=P.maxBufferLength,Math.min(j,P.maxMaxBufferLength)},p.reduceMaxBufferLength=function(O){var P=this.config,j=O||P.maxBufferLength;return P.maxMaxBufferLength>=j?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(O,P){var j,K,U=P.fragments,X=U.length;if(!X)return null;var B=this.config,N=U[0].start,z;if(P.live){var te=B.initialLiveManifestSize;if(X<te)return this.warn("Not enough fragments to start playback (have: "+X+", need: "+te+")"),null;!P.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(P,U),this.startPosition=z?this.hls.liveSyncPosition||z.start:O)}else O<=N&&(z=U[0]);if(!z){var ce=B.lowLatencyMode?P.partEnd:P.fragmentEnd;z=this.getFragmentAtPosition(O,ce,P)}return(j=z)!==null&&j!==void 0&&j.initSegment&&!((K=z)!==null&&K!==void 0&&K.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},p.getNextPart=function(O,P,j){for(var K=-1,U=!1,X=!0,B=0,N=O.length;B<N;B++){var z=O[B];if(X=X&&!z.independent,K>-1&&j<z.start)break;var te=z.loaded;!te&&(U||z.independent||X)&&z.fragment===P&&(K=B),U=te}return K},p.loadedEndOfParts=function(O,P){var j=O[O.length-1];return j&&P>j.start&&j.loaded},p.getInitialLiveFragment=function(O,P){var j=this.fragPrevious,K=null;if(j){if(O.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),K=Object(n.findFragmentByPDT)(P,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!K){var U=j.sn+1;if(U>=O.startSN&&U<=O.endSN){var X=P[U-O.startSN];j.cc===X.cc&&(K=X,this.log("Live playlist, switching playlist, load frag with next SN: "+K.sn))}K||(K=Object(n.findFragWithCC)(P,j.cc),K&&this.log("Live playlist, switching playlist, load frag with same CC: "+K.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(K=this.getFragmentAtPosition(B,this.bitrateTest?O.fragmentEnd:O.edge,O))}return K},p.getFragmentAtPosition=function(O,P,j){var K=this.config,U=this.fragPrevious,X=j.fragments,B=j.endSN,N=j.fragmentHint,z=K.maxFragLookUpTolerance,te=!!(K.lowLatencyMode&&j.partList&&N);te&&N&&!this.bitrateTest&&(X=X.concat(N),B=N.sn);var ce;if(O<P){var be=O>P-z?0:z;ce=Object(n.findFragmentByPTS)(U,X,O,be)}else ce=X[X.length-1];if(ce){var Fe=ce.sn-j.startSN,Oe=U&&ce.level===U.level,Re=X[Fe+1],Be=this.fragmentTracker.getState(ce);if(Be===f.FragmentState.BACKTRACKED){ce=null;for(var Ke=Fe;X[Ke]&&this.fragmentTracker.getState(X[Ke])===f.FragmentState.BACKTRACKED;)U?ce=X[Ke--]:ce=X[--Ke];ce||(ce=Re)}else U&&ce.sn===U.sn&&!te&&(Oe&&(ce.sn<B&&this.fragmentTracker.getState(Re)!==f.FragmentState.OK?(this.log("SN "+ce.sn+" just loaded, load next one: "+Re.sn),ce=Re):ce=null))}return ce},p.synchronizeToLiveEdge=function(O){var P=this.config,j=this.media;if(!j)return;var K=this.hls.liveSyncPosition,U=j.currentTime,X=O.fragments[0].start,B=O.edge,N=U>=X-P.maxFragLookUpTolerance&&U<=B;if(K!==null&&j.duration>K&&(U<K||!N)){var z=P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:P.liveMaxLatencyDurationCount*O.targetduration;(!N&&j.readyState<4||U<B-z)&&(this.loadedmetadata||(this.nextLoadPosition=K),j.readyState&&(this.warn("Playback: "+U.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+K.toFixed(3)),j.currentTime=K))}},p.alignPlaylists=function(O,P){var j=this.levels,K=this.levelLastLoaded,U=this.fragPrevious,X=K!==null?j[K]:null,B=O.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var N=O.fragments[0].start,z=!P,te=O.alignedSliding&&Object(k.isFiniteNumber)(N);if(z||!te&&!N){Object(r.alignStream)(U,X,O);var ce=O.fragments[0].start;return this.log("Live playlist sliding: "+ce.toFixed(2)+" start-sn: "+(P?P.startSN:"na")+"->"+O.startSN+" prev-sn: "+(U?U.sn:"na")+" fragments: "+B),ce}return N},p.waitForCdnTuneIn=function(O){var P=3;return O.live&&O.canBlockReload&&O.tuneInGoal>Math.max(O.partHoldBack,O.partTarget*P)},p.setStartPosition=function(O,P){var j=this.startPosition;if(j<P&&(j=-1),j===-1||this.lastCurrentTime===-1){var K=O.startTimeOffset;Object(k.isFiniteNumber)(K)?(j=P+K,K<0&&(j+=O.totalduration),j=Math.min(Math.max(P,j),P+O.totalduration),this.log("Start time offset "+K+" found in playlist, adjust startPosition to "+j),this.startPosition=j):O.live?j=this.hls.liveSyncPosition||P:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},p.getLoadPosition=function(){var O=this.media,P=0;return this.loadedmetadata&&O?P=O.currentTime:this.nextLoadPosition&&(P=this.nextLoadPosition),P},p.handleFragLoadAborted=function(O,P){this.transmuxer&&O.sn!=="initSegment"&&O.stats.aborted&&(this.warn("Fragment "+O.sn+(P?" part"+P.index:"")+" of level "+O.level+" was aborted"),this.resetFragmentLoading(O))},p.resetFragmentLoading=function(O){(!this.fragCurrent||!this.fragContextChanged(O))&&(this.state=v.IDLE)},p.onFragmentOrKeyLoadError=function(O,P){if(P.fatal)return;var j=P.frag;if(!j||j.type!==O)return;var K=this.fragCurrent;console.assert(K&&j.sn===K.sn&&j.level===K.level&&j.urlId===K.urlId,"Frag load error must match current frag to retry");var U=this.config;if(this.fragLoadError+1<=U.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var X=Math.min(Math.pow(2,this.fragLoadError)*U.fragLoadingRetryDelay,U.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+O+" "+j.level+" failed to load, retrying in "+X+"ms"),this.retryDate=self.performance.now()+X,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else P.levelRetry?(O===c.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(x.logger.error(P.details+" reaches max retry, redispatch as fatal ..."),P.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},p.afterBufferFlushed=function(O,P,j){if(!O)return;var K=E.BufferHelper.getBuffered(O);this.fragmentTracker.detectEvictedFragments(P,K,j),this.state===v.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},p.resetLiveStartWhenNotLoaded=function(O){if(!this.loadedmetadata){this.startFragRequested=!1;var P=this.levels?this.levels[O].details:null;if(P!=null&&P.live)return this.startPosition=-1,this.setStartPosition(P,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},p.updateLevelTiming=function(O,P,j,K){var U=this,X=j.details;console.assert(!!X,"level.details must be defined");var B=Object.keys(O.elementaryStreams).reduce(function(N,z){var te=O.elementaryStreams[z];if(te){var ce=te.endPTS-te.startPTS;if(ce<=0)return U.warn("Could not parse fragment "+O.sn+" "+z+" duration reliably ("+ce+") resetting transmuxer to fallback to playlist timing"),U.resetTransmuxer(),N||!1;var be=K?0:Object(t.updateFragPTSDTS)(X,O,te.startPTS,te.endPTS,te.startDTS,te.endDTS);return U.hls.trigger(g.Events.LEVEL_PTS_UPDATED,{details:X,level:j,drift:be,type:z,frag:O,start:te.startPTS,end:te.endPTS}),!0}return N},!1);B?(this.state=v.PARSED,this.hls.trigger(g.Events.FRAG_PARSED,{frag:O,part:P})):this.resetLoadingState()},p.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(A,[{key:"state",get:function(){return this._state},set:function(O){var P=this._state;P!==O&&(this._state=O,this.log(P+"->"+O))}}]),A}(M.default)},"./src/controller/buffer-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n});var k=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),f=I("./src/utils/logger.ts"),E=I("./src/errors.ts"),x=I("./src/utils/buffer-helper.ts"),g=I("./src/utils/mediasource-helper.ts"),h=I("./src/loader/fragment.ts"),o=I("./src/controller/buffer-operation-queue.ts"),u=Object(g.getMediaSource)(),r=/([ha]vc.)(?:\.[^.,]+)+/,n=function(){function t(s){var l=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 c=l.hls,d=l.media,w=l.mediaSource;f.logger.log("[buffer-controller]: Media source opened"),d&&(l.updateMediaElementDuration(),c.trigger(M.Events.MEDIA_ATTACHED,{media:d})),w&&w.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){f.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){f.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var i=t.prototype;return i.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},i.destroy=function(){this.unregisterListeners(),this.details=null},i.registerListeners=function(){var l=this.hls;l.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(M.Events.BUFFER_RESET,this.onBufferReset,this),l.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(M.Events.BUFFER_EOS,this.onBufferEos,this),l.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(M.Events.FRAG_PARSED,this.onFragParsed,this),l.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},i.unregisterListeners=function(){var l=this.hls;l.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(M.Events.BUFFER_RESET,this.onBufferReset,this),l.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(M.Events.BUFFER_EOS,this.onBufferEos,this),l.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(M.Events.FRAG_PARSED,this.onFragParsed,this),l.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},i._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new o.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},i.onManifestParsed=function(l,c){var d=2;(c.audio&&!c.video||!c.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,f.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},i.onMediaAttaching=function(l,c){var d=this.media=c.media;if(d&&u){var w=this.mediaSource=new u;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(w),this._objectUrl=d.src}},i.onMediaDetaching=function(){var l=this.media,c=this.mediaSource,d=this._objectUrl;if(c){if(f.logger.log("[buffer-controller]: media source detaching"),c.readyState==="open")try{c.endOfStream()}catch(w){f.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),c.removeEventListener("sourceopen",this._onMediaSourceOpen),c.removeEventListener("sourceended",this._onMediaSourceEnded),c.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(d&&self.URL.revokeObjectURL(d),l.src===d?(l.removeAttribute("src"),l.load()):f.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(M.Events.MEDIA_DETACHED,void 0)},i.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(c){var d=l.sourceBuffer[c];try{d&&(l.removeBufferListeners(c),l.mediaSource&&l.mediaSource.removeSourceBuffer(d),l.sourceBuffer[c]=void 0)}catch(w){f.logger.warn("[buffer-controller]: Failed to reset the "+c+" buffer",w)}}),this._initSourceBuffer()},i.onBufferCodecs=function(l,c){var d=this,w=this.getSourceBufferTypes().length;if(Object.keys(c).forEach(function(m){if(w){var S=d.tracks[m];if(S&&typeof S.buffer.changeType=="function"){var C=c[m],v=C.codec,y=C.levelCodec,T=C.container,A=(S.levelCodec||S.codec).replace(r,"$1"),p=(y||v).replace(r,"$1");if(A!==p){var D=T+";codecs="+(y||v);d.appendChangeType(m,D)}}}else d.pendingTracks[m]=c[m]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},i.appendChangeType=function(l,c){var d=this,w=this.operationQueue,m={execute:function(){var C=d.sourceBuffer[l];C&&(f.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+c),C.changeType(c)),w.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(C){f.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",C)}};w.append(m,l)},i.onBufferAppending=function(l,c){var d=this,w=this.hls,m=this.operationQueue,S=this.tracks,C=c.data,v=c.type,y=c.frag,T=c.part,A=c.chunkMeta,p=A.buffering[v],D=self.performance.now();p.start=D;var O=y.stats.buffering,P=T?T.stats.buffering:null;O.start===0&&(O.start=D),P&&P.start===0&&(P.start=D);var j=S.audio,K=v==="audio"&&A.id===1&&(j==null?void 0:j.container)==="audio/mpeg",U={execute:function(){if(p.executeStart=self.performance.now(),K){var B=d.sourceBuffer[v];if(B){var N=y.start-B.timestampOffset;Math.abs(N)>=.1&&(f.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+N+") sn: "+y.sn+")"),B.timestampOffset=y.start)}}d.appendExecutor(C,v)},onStart:function(){},onComplete:function(){var B=self.performance.now();p.executeEnd=p.end=B,O.first===0&&(O.first=B),P&&P.first===0&&(P.first=B);var N=d.sourceBuffer,z={};for(var te in N)z[te]=x.BufferHelper.getBuffered(N[te]);d.appendError=0,d.hls.trigger(M.Events.BUFFER_APPENDED,{type:v,frag:y,part:T,chunkMeta:A,parent:y.type,timeRanges:z})},onError:function(B){f.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",B);var N={type:E.ErrorTypes.MEDIA_ERROR,parent:y.type,details:E.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=E.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,N.details=E.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>w.config.appendErrorMaxRetry&&(f.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),w.trigger(M.Events.ERROR,N)}};m.append(U,v)},i.onBufferFlushing=function(l,c){var d=this,w=this.operationQueue,m=function(C){return{execute:d.removeExecutor.bind(d,C,c.startOffset,c.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(M.Events.BUFFER_FLUSHED,{type:C})},onError:function(y){f.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",y)}}};c.type?w.append(m(c.type),c.type):this.getSourceBufferTypes().forEach(function(S){w.append(m(S),S)})},i.onFragParsed=function(l,c){var d=this,w=c.frag,m=c.part,S=[],C=m?m.elementaryStreams:w.elementaryStreams;C[h.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(C[h.ElementaryStreamTypes.AUDIO]&&S.push("audio"),C[h.ElementaryStreamTypes.VIDEO]&&S.push("video"));var v=function(){var T=self.performance.now();w.stats.buffering.end=T,m&&(m.stats.buffering.end=T);var A=m?m.stats:w.stats;d.hls.trigger(M.Events.FRAG_BUFFERED,{frag:w,part:m,stats:A,id:w.type})};S.length===0&&f.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(v,S)},i.onFragChanged=function(l,c){this.flushBackBuffer()},i.onBufferEos=function(l,c){var d=this,w=this.getSourceBufferTypes().reduce(function(m,S){var C=d.sourceBuffer[S];return(!c.type||c.type===S)&&(C&&!C.ended&&(C.ended=!0,f.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),m&&!!(!C||C.ended)},!0);w&&this.blockBuffers(function(){var m=d.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},i.onLevelUpdated=function(l,c){var d=c.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},i.flushBackBuffer=function(){var l=this.hls,c=this.details,d=this.media,w=this.sourceBuffer;if(!d||c===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var S=c.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(k.isFiniteNumber)(S)||S<0)return;var C=d.currentTime,v=c.levelTargetDuration,y=Math.max(S,v),T=Math.floor(C/v)*v-y;m.forEach(function(A){var p=w[A];if(p){var D=x.BufferHelper.getBuffered(p);D.length>0&&T>D.start(0)&&(l.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),c.live&&l.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),l.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:A}))}})},i.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var l=this.details,c=this.hls,d=this.media,w=this.mediaSource,m=l.fragments[0].start+l.totalduration,S=d.duration,C=Object(k.isFiniteNumber)(w.duration)?w.duration:0;l.live&&c.config.liveDurationInfinity?(f.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(l)):(m>C&&m>S||!Object(k.isFiniteNumber)(S))&&(f.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),w.duration=m)},i.updateSeekableRange=function(l){var c=this.mediaSource,d=l.fragments,w=d.length;if(w&&l.live&&c!==null&&c!==void 0&&c.setLiveSeekableRange){var m=Math.max(0,d[0].start),S=Math.max(m,m+l.totalduration);c.setLiveSeekableRange(m,S)}},i.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,c=this.operationQueue,d=this.pendingTracks,w=Object.keys(d).length;if(w&&!l||w===2){this.createSourceBuffers(d),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(S){c.executeNext(S)})}},i.createSourceBuffers=function(l){var c=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var m in l)if(!c[m]){var S=l[m];if(!S)throw Error("source buffer exists for track "+m+", however track does not");var C=S.levelCodec||S.codec,v=S.container+";codecs="+C;f.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var y=c[m]=d.addSourceBuffer(v),T=m;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[m]={buffer:y,codec:C,container:S.container,levelCodec:S.levelCodec,id:S.id},w++}catch(A){f.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+A.message),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:A,mimeType:v})}}w&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},i._onSBUpdateStart=function(l){var c=this.operationQueue,d=c.current(l);d.onStart()},i._onSBUpdateEnd=function(l){var c=this.operationQueue,d=c.current(l);d.onComplete(),c.shiftAndExecuteNext(l)},i._onSBUpdateError=function(l,c){f.logger.error("[buffer-controller]: "+l+" SourceBuffer error",c),this.hls.trigger(M.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(l);d&&d.onError(c)},i.removeExecutor=function(l,c,d){var w=this.media,m=this.mediaSource,S=this.operationQueue,C=this.sourceBuffer,v=C[l];if(!w||!m||!v){f.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(l);return}var y=Object(k.isFiniteNumber)(w.duration)?w.duration:Infinity,T=Object(k.isFiniteNumber)(m.duration)?m.duration:Infinity,A=Math.max(0,c),p=Math.min(d,y,T);p>A?(f.logger.log("[buffer-controller]: Removing ["+A+","+p+"] from the "+l+" SourceBuffer"),console.assert(!v.updating,l+" sourceBuffer must not be updating"),v.remove(A,p)):S.shiftAndExecuteNext(l)},i.appendExecutor=function(l,c){var d=this.operationQueue,w=this.sourceBuffer,m=w[c];if(!m){f.logger.warn("[buffer-controller]: Attempting to append to the "+c+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(c);return}m.ended=!1,console.assert(!m.updating,c+" sourceBuffer must not be updating"),m.appendBuffer(l)},i.blockBuffers=function(l,c){var d=this;if(c===void 0&&(c=this.getSourceBufferTypes()),!c.length){f.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var w=this.operationQueue,m=c.map(function(S){return w.appendBlocker(S)});Promise.all(m).then(function(){l(),c.forEach(function(S){var C=d.sourceBuffer[S];(!C||!C.updating)&&w.shiftAndExecuteNext(S)})})},i.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},i.addBufferListener=function(l,c,d){var w=this.sourceBuffer[l];if(!w)return;var m=d.bind(this,l);this.listeners[l].push({event:c,listener:m}),w.addEventListener(c,m)},i.removeBufferListeners=function(l){var c=this.sourceBuffer[l];if(!c)return;this.listeners[l].forEach(function(d){c.removeEventListener(d.event,d.listener)})},t}()},"./src/controller/buffer-operation-queue.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return M});var k=I("./src/utils/logger.ts"),M=function(){function f(x){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=x}var E=f.prototype;return E.append=function(g,h){var o=this.queues[h];o.push(g),o.length===1&&this.buffers[h]&&this.executeNext(h)},E.insertAbort=function(g,h){var o=this.queues[h];o.unshift(g),this.executeNext(h)},E.appendBlocker=function(g){var h,o=new Promise(function(r){h=r}),u={execute:h,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(u,g),o},E.executeNext=function(g){var h=this.buffers,o=this.queues,u=h[g],r=o[g];if(r.length){var n=r[0];try{n.execute()}catch(t){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(t),(!u||!u.updating)&&(r.shift(),this.executeNext(g))}}},E.shiftAndExecuteNext=function(g){this.queues[g].shift(),this.executeNext(g)},E.current=function(g){return this.queues[g][0]},f}()},"./src/controller/cap-level-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts");function M(x,g){for(var h=0;h<g.length;h++){var o=g[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(x,o.key,o)}}function f(x,g,h){return g&&M(x.prototype,g),h&&M(x,h),x}var E=function(){function x(h){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=h,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var g=x.prototype;return g.setStreamController=function(o){this.streamController=o},g.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},g.registerListeners=function(){var o=this.hls;o.on(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},g.unregisterListener=function(){var o=this.hls;o.off(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},g.onFpsDropLevelCapping=function(o,u){x.isLevelAllowed(u.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(u.droppedLevel)},g.onMediaAttaching=function(o,u){this.media=u.media instanceof HTMLVideoElement?u.media:null},g.onManifestParsed=function(o,u){var r=this.hls;this.restrictedLevels=[],this.firstLevel=u.firstLevel,r.config.capLevelToPlayerSize&&u.video&&this.startCapping()},g.onBufferCodecs=function(o,u){var r=this.hls;r.config.capLevelToPlayerSize&&u.video&&this.startCapping()},g.onMediaDetaching=function(){this.stopCapping()},g.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var o=this.hls.levels;if(o.length){var u=this.hls;u.autoLevelCapping=this.getMaxLevel(o.length-1),u.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=u.autoLevelCapping}}},g.getMaxLevel=function(o){var u=this,r=this.hls.levels;if(!r.length)return-1;var n=r.filter(function(t,i){return x.isLevelAllowed(i,u.restrictedLevels)&&i<=o});return this.clientRect=null,x.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},g.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()},g.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},g.getDimensions=function(){if(this.clientRect)return this.clientRect;var o=this.media,u={width:0,height:0};if(o){var r=o.getBoundingClientRect();u.width=r.width,u.height=r.height,!u.width&&!u.height&&(u.width=r.right-r.left||o.width||0,u.height=r.bottom-r.top||o.height||0)}return this.clientRect=u,u},x.isLevelAllowed=function(o,u){return u===void 0&&(u=[]),u.indexOf(o)===-1},x.getMaxLevelByMediaSize=function(o,u,r){if(!o||!o.length)return-1;for(var n=function(c,d){return d?c.width!==d.width||c.height!==d.height:!0},t=o.length-1,i=0;i<o.length;i+=1){var s=o[i];if((s.width>=u||s.height>=r)&&n(s,o[i+1])){t=i;break}}return t},f(x,[{key:"mediaWidth",get:function(){return this.getDimensions().width*x.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*x.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var o=1;try{o=self.devicePixelRatio}catch(u){}return o}}]),x}();L.default=E},"./src/controller/cmcd-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n});var k=I("./src/events.ts"),M=I("./src/types/cmcd.ts"),f=I("./src/utils/buffer-helper.ts"),E=I("./src/utils/logger.ts");function x(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function g(t,i,s){return i&&x(t.prototype,i),s&&x(t,s),t}function h(t,i){var s=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(s)return(s=s.call(t)).next.bind(s);if(Array.isArray(t)||(s=o(t))||i&&t&&typeof t.length=="number"){s&&(t=s);var l=0;return function(){return l>=t.length?{done:!0}:{done:!1,value:t[l++]}}}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 o(t,i){if(!t)return;if(typeof t=="string")return u(t,i);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return u(t,i)}function u(t,i){(i==null||i>t.length)&&(i=t.length);for(var s=0,l=new Array(i);s<i;s++)l[s]=t[s];return l}function r(){return r=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(t[l]=s[l])}return t},r.apply(this,arguments)}var n=function(){function t(s){var l=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(){l.initialized&&(l.starved=!0),l.buffering=!0},this.onPlaying=function(){l.initialized||(l.initialized=!0),l.buffering=!1},this.applyPlaylistData=function(w){try{l.apply(w,{ot:M.CMCDObjectType.MANIFEST,su:!l.initialized})}catch(m){E.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(w){try{var m=w.frag,S=l.hls.levels[m.level],C=l.getObjectType(m),v={d:m.duration*1e3,ot:C};(C===M.CMCDObjectType.VIDEO||C===M.CMCDObjectType.AUDIO||C==M.CMCDObjectType.MUXED)&&(v.br=S.bitrate/1e3,v.tb=l.getTopBandwidth(C),v.bl=l.getBufferLength(C)),l.apply(w,v)}catch(y){E.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=s;var c=this.config=s.config,d=c.cmcd;d!=null&&(c.pLoader=this.createPlaylistLoader(),c.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||t.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var i=t.prototype;return i.registerListeners=function(){var l=this.hls;l.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this)},i.unregisterListeners=function(){var l=this.hls;l.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},i.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},i.onMediaAttached=function(l,c){this.media=c.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},i.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},i.onBufferCreated=function(l,c){var d,w;this.audioBuffer=(d=c.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(w=c.tracks.video)===null||w===void 0?void 0:w.buffer},i.createData=function(){var l;return{v:M.CMCDVersion,sf:M.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(l=this.media)===null||l===void 0?void 0:l.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},i.apply=function(l,c){c===void 0&&(c={}),r(c,this.createData());var d=c.ot===M.CMCDObjectType.INIT||c.ot===M.CMCDObjectType.VIDEO||c.ot===M.CMCDObjectType.MUXED;if(this.starved&&d&&(c.bs=!0,c.su=!0,this.starved=!1),c.su==null&&(c.su=this.buffering),this.useHeaders){var w=t.toHeaders(c);if(!Object.keys(w).length)return;l.headers||(l.headers={}),r(l.headers,w)}else{var m=t.toQuery(c);if(!m)return;l.url=t.appendQueryToUri(l.url,m)}},i.getObjectType=function(l){var c=l.type;return c==="subtitle"?M.CMCDObjectType.TIMED_TEXT:l.sn==="initSegment"?M.CMCDObjectType.INIT:c==="audio"?M.CMCDObjectType.AUDIO:c==="main"?this.hls.audioTracks.length?M.CMCDObjectType.VIDEO:M.CMCDObjectType.MUXED:void 0},i.getTopBandwidth=function(l){for(var c=0,d=l===M.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=h(d),m;!(m=w()).done;){var S=m.value;S.bitrate>c&&(c=S.bitrate)}return c>0?c:NaN},i.getBufferLength=function(l){var c=this.hls.media,d=l===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!c)return NaN;var w=f.BufferHelper.bufferInfo(d,c.currentTime,this.config.maxBufferHole);return w.len*1e3},i.createPlaylistLoader=function(){var l=this.config.pLoader,c=this.applyPlaylistData,d=l||this.config.loader;return function(){function w(S){this.loader=void 0,this.loader=new d(S)}var m=w.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,v,y){c(C),this.loader.load(C,v,y)},g(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},i.createFragmentLoader=function(){var l=this.config.fLoader,c=this.applyFragmentData,d=l||this.config.loader;return function(){function w(S){this.loader=void 0,this.loader=new d(S)}var m=w.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(C,v,y){c(C),this.loader.load(C,v,y)},g(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},t.uuid=function(){var l=URL.createObjectURL(new Blob),c=l.toString();return URL.revokeObjectURL(l),c.substr(c.lastIndexOf("/")+1)},t.serialize=function(l){for(var c=[],d=function(K){return!Number.isNaN(K)&&K!=null&&K!==""&&K!==!1},w=function(K){return Math.round(K)},m=function(K){return w(K/100)*100},S=function(K){return encodeURIComponent(K)},C={br:w,d:w,bl:m,dl:m,mtp:m,nor:S,rtp:m,tb:w},v=Object.keys(l||{}).sort(),y=h(v),T;!(T=y()).done;){var A=T.value,p=l[A];if(!d(p))continue;if(A==="v"&&p===1)continue;if(A=="pr"&&p===1)continue;var D=C[A];D&&(p=D(p));var O=typeof p,P=void 0;A==="ot"||A==="sf"||A==="st"?P=A+"="+p:O==="boolean"?P=A:O==="number"?P=A+"="+p:P=A+"="+JSON.stringify(p),c.push(P)}return c.join(",")},t.toHeaders=function(l){for(var c=Object.keys(l),d={},w=["Object","Request","Session","Status"],m=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},C=0,v=c;C<v.length;C++){var y=v[C],T=S[y]!=null?S[y]:1;m[T][y]=l[y]}for(var A=0;A<m.length;A++){var p=t.serialize(m[A]);p&&(d["CMCD-"+w[A]]=p)}return d},t.toQuery=function(l){return"CMCD="+encodeURIComponent(t.serialize(l))},t.appendQueryToUri=function(l,c){if(!c)return l;var d=l.includes("?")?"&":"?";return""+l+d+c},t}()},"./src/controller/eme-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/utils/logger.ts"),E=I("./src/utils/mediakeys-helper.ts");function x(n,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function g(n,t,i){return t&&x(n.prototype,t),i&&x(n,i),n}var h=3,o=function(t,i,s){var l={audioCapabilities:[],videoCapabilities:[]};return t.forEach(function(c){l.audioCapabilities.push({contentType:'audio/mp4; codecs="'+c+'"',robustness:s.audioRobustness||""})}),i.forEach(function(c){l.videoCapabilities.push({contentType:'video/mp4; codecs="'+c+'"',robustness:s.videoRobustness||""})}),[l]},u=function(t,i,s,l){switch(t){case E.KeySystems.WIDEVINE:return o(i,s,l);default:throw new Error("Unknown key-system: "+t)}},r=function(){function n(i){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=i,this._config=i.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 t=n.prototype;return t.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},t._registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t._unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},t.getLicenseServerUrl=function(s){switch(s){case E.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},t._attemptKeySystemAccess=function(s,l,c){var d=this,w=u(s,l,c,this._drmSystemOptions);f.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,w);this.mediaKeysPromise=m.then(function(S){return d._onMediaKeySystemAccessObtained(s,S)}),m.catch(function(S){f.logger.error('Failed to obtain key-system "'+s+'" access:',S)})},t._onMediaKeySystemAccessObtained=function(s,l){var c=this;f.logger.log('Access for key-system "'+s+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:l,mediaKeySystemDomain:s};this._mediaKeysList.push(d);var w=Promise.resolve().then(function(){return l.createMediaKeys()}).then(function(m){return d.mediaKeys=m,f.logger.log('Media-keys created for key-system "'+s+'"'),c._onMediaKeysCreated(),m});return w.catch(function(m){f.logger.error("Failed to create media-keys:",m)}),w},t._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(l){l.mediaKeysSession||(l.mediaKeysSession=l.mediaKeys.createSession(),s._onNewMediaKeySession(l.mediaKeysSession))})},t._onNewMediaKeySession=function(s){var l=this;f.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(c){l._onKeySessionMessage(s,c.message)},!1)},t._onKeySessionMessage=function(s,l){f.logger.log("Got EME message event, creating license request"),this._requestLicense(l,function(c){f.logger.log("Received license data (length: "+(c&&c.byteLength)+"), updating key-session"),s.update(c)})},t.onMediaEncrypted=function(s){var l=this;if(f.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){f.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var c=function(w){if(!l._media)return;l._attemptSetMediaKeys(w),l._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(c).catch(c)},t._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var l=this._mediaKeysList[0];if(!l||!l.mediaKeys){f.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}f.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(l.mediaKeys),this._hasSetMediaKeys=!0}},t._generateRequestWithPreferredKeySession=function(s,l){var c=this,d=this._mediaKeysList[0];if(!d){f.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){f.logger.warn("Key-Session already initialized but requested again");return}var w=d.mediaKeysSession;if(!w){f.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!l){f.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}f.logger.log('Generating key-session request for "'+s+'" init data type'),d.mediaKeysSessionInitialized=!0,w.generateRequest(s,l).then(function(){f.logger.debug("Key-session generation succeeded")}).catch(function(m){f.logger.error("Error generating key-session request:",m),c.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},t._createLicenseXhr=function(s,l,c){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,s,l,c);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,d,s),w=void 0}catch(m){f.logger.error(m)}try{d.readyState||d.open("POST",s,!0),w&&w.call(this.hls,d,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return d},t._onLicenseRequestReadyStageChange=function(s,l,c,d){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,f.logger.log("License request succeeded");var w=s.response,m=this._licenseResponseCallback;if(m)try{w=m.call(this.hls,s,l)}catch(C){f.logger.error(C)}d(w)}else{if(f.logger.error("License Request XHR failed ("+l+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h){this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=h-this._requestLicenseFailureCount+1;f.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(c,d)}break}},t._generateLicenseRequestChallenge=function(s,l){switch(s.mediaKeySystemDomain){case E.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},t._requestLicense=function(s,l){f.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){f.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(c.mediaKeySystemDomain),w=this._createLicenseXhr(d,s,l);f.logger.log("Sending license request to URL: "+d);var m=this._generateLicenseRequestChallenge(c,s);w.send(m)}catch(S){f.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},t.onMediaAttached=function(s,l){if(!this._emeEnabled)return;var c=l.media;this._media=c,c.addEventListener("encrypted",this._onMediaEncrypted)},t.onMediaDetached=function(){var s=this._media,l=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(c){if(c.mediaKeysSession)return c.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},t.onManifestParsed=function(s,l){if(!this._emeEnabled)return;var c=l.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),d=l.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(E.KeySystems.WIDEVINE,c,d)},g(n,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),n}();L.default=r},"./src/controller/fps-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/utils/logger.ts"),f=function(){function E(g){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=g,this.registerListeners()}var x=E.prototype;return x.setStreamController=function(h){this.streamController=h},x.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},x.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},x.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},x.onMediaAttaching=function(h,o){var u=this.hls.config;if(u.capLevelOnFPSDrop){var r=o.media instanceof self.HTMLVideoElement?o.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),u.fpsDroppedMonitoringPeriod)}},x.checkFPS=function(h,o,u){var r=performance.now();if(o){if(this.lastTime){var n=r-this.lastTime,t=u-this.lastDroppedFrames,i=o-this.lastDecodedFrames,s=1e3*t/n,l=this.hls;if(l.trigger(k.Events.FPS_DROP,{currentDropped:t,currentDecoded:i,totalDroppedFrames:u}),s>0&&t>l.config.fpsDroppedMonitoringThreshold*i){var c=l.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=c)&&(c=c-1,l.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=u,this.lastDecodedFrames=o}},x.checkFPSInterval=function(){var h=this.media;if(h)if(this.isVideoPlaybackQualityAvailable){var o=h.getVideoPlaybackQuality();this.checkFPS(h,o.totalVideoFrames,o.droppedVideoFrames)}else this.checkFPS(h,h.webkitDecodedFrameCount,h.webkitDroppedFrameCount)},E}();L.default=f},"./src/controller/fragment-finders.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"findFragmentByPDT",function(){return f}),I.d(L,"findFragmentByPTS",function(){return E}),I.d(L,"fragmentWithinToleranceTest",function(){return x}),I.d(L,"pdtWithinToleranceTest",function(){return g}),I.d(L,"findFragWithCC",function(){return h});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/binary-search.ts");function f(o,u,r){if(u===null||!Array.isArray(o)||!o.length||!Object(k.isFiniteNumber)(u))return null;var n=o[0].programDateTime;if(u<(n||0))return null;var t=o[o.length-1].endProgramDateTime;if(u>=(t||0))return null;r=r||0;for(var i=0;i<o.length;++i){var s=o[i];if(g(u,r,s))return s}return null}function E(o,u,r,n){r===void 0&&(r=0),n===void 0&&(n=0);var t=null;if(o?t=u[o.sn-u[0].sn+1]||null:r===0&&u[0].start===0&&(t=u[0]),t&&x(r,n,t)===0)return t;var i=M.default.search(u,x.bind(null,r,n));return i||t}function x(o,u,r){o===void 0&&(o=0),u===void 0&&(u=0);var n=Math.min(u,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=o?1:r.start-n>o&&r.start?-1:0}function g(o,u,r){var n=Math.min(u,r.duration+(r.deltaPTS?r.deltaPTS:0))*1e3,t=r.endProgramDateTime||0;return t-n>o}function h(o,u){return M.default.search(o,function(r){return r.cc<u?1:r.cc>u?-1:0})}},"./src/controller/fragment-tracker.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"FragmentState",function(){return f}),I.d(L,"FragmentTracker",function(){return E});var k=I("./src/events.ts"),M=I("./src/types/loader.ts"),f;(function(h){h.NOT_LOADED="NOT_LOADED",h.BACKTRACKED="BACKTRACKED",h.APPENDING="APPENDING",h.PARTIAL="PARTIAL",h.OK="OK"})(f||(f={}));var E=function(){function h(u){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=u,this._registerListeners()}var o=h.prototype;return o._registerListeners=function(){var r=this.hls;r.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),r.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},o._unregisterListeners=function(){var r=this.hls;r.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),r.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},o.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},o.getAppendedFrag=function(r,n){if(n===M.PlaylistLevelType.MAIN){var t=this.activeFragment,i=this.activeParts;if(!t)return null;if(i)for(var s=i.length;s--;){var l=i[s],c=l?l.end:t.appendedPTS;if(l.start<=r&&c!==void 0&&r<=c)return s>9&&(this.activeParts=i.slice(s-9)),l}else if(t.start<=r&&t.appendedPTS!==void 0&&r<=t.appendedPTS)return t}return this.getBufferedFrag(r,n)},o.getBufferedFrag=function(r,n){for(var t=this.fragments,i=Object.keys(t),s=i.length;s--;){var l=t[i[s]];if((l==null?void 0:l.body.type)===n&&l.buffered){var c=l.body;if(c.start<=r&&r<=c.end)return c}}return null},o.detectEvictedFragments=function(r,n,t){var i=this;Object.keys(this.fragments).forEach(function(s){var l=i.fragments[s];if(!l)return;if(!l.buffered){l.body.type===t&&i.removeFragment(l.body);return}var c=l.range[r];if(!c)return;c.time.some(function(d){var w=!i.isTimeBuffered(d.startPTS,d.endPTS,n);return w&&i.removeFragment(l.body),w})})},o.detectPartialFragments=function(r){var n=this,t=this.timeRanges,i=r.frag,s=r.part;if(!t||i.sn==="initSegment")return;var l=g(i),c=this.fragments[l];if(!c)return;Object.keys(t).forEach(function(d){var w=i.elementaryStreams[d];if(!w)return;var m=t[d],S=s!==null||w.partial===!0;c.range[d]=n.getBufferedTimes(i,s,S,m)}),c.backtrack=c.loaded=null,Object.keys(c.range).length?c.buffered=!0:this.removeFragment(c.body)},o.fragBuffered=function(r){var n=g(r),t=this.fragments[n];t&&(t.backtrack=t.loaded=null,t.buffered=!0)},o.getBufferedTimes=function(r,n,t,i){for(var s={time:[],partial:t},l=n?n.start:r.start,c=n?n.end:r.end,d=r.minEndPTS||c,w=r.maxStartPTS||l,m=0;m<i.length;m++){var S=i.start(m)-this.bufferPadding,C=i.end(m)+this.bufferPadding;if(w>=S&&d<=C){s.time.push({startPTS:Math.max(l,i.start(m)),endPTS:Math.min(c,i.end(m))});break}else if(l<C&&c>S)s.partial=!0,s.time.push({startPTS:Math.max(l,i.start(m)),endPTS:Math.min(c,i.end(m))});else if(c<=S)break}return s},o.getPartialFragment=function(r){var n=null,t,i,s,l=0,c=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(w){var m=d[w];if(!m)return;x(m)&&(i=m.body.start-c,s=m.body.end+c,r>=i&&r<=s&&(t=Math.min(r-i,s-r),l<=t&&(n=m.body,l=t)))}),n},o.getState=function(r){var n=g(r),t=this.fragments[n];return t?t.buffered?x(t)?f.PARTIAL:f.OK:t.backtrack?f.BACKTRACKED:f.APPENDING:f.NOT_LOADED},o.backtrack=function(r,n){var t=g(r),i=this.fragments[t];if(!i||i.backtrack)return null;var s=i.backtrack=n||i.loaded;return i.loaded=null,s},o.getBacktrackData=function(r){var n=g(r),t=this.fragments[n];if(t){var i,s=t.backtrack;if(s!=null&&(i=s.payload)!==null&&i!==void 0&&i.byteLength)return s;this.removeFragment(r)}return null},o.isTimeBuffered=function(r,n,t){for(var i,s,l=0;l<t.length;l++){if(i=t.start(l)-this.bufferPadding,s=t.end(l)+this.bufferPadding,r>=i&&n<=s)return!0;if(n<=i)return!1}return!1},o.onFragLoaded=function(r,n){var t=n.frag,i=n.part;if(t.sn==="initSegment"||t.bitrateTest||i)return;var s=g(t);this.fragments[s]={body:t,loaded:n,backtrack:null,buffered:!1,range:Object.create(null)}},o.onBufferAppended=function(r,n){var t=this,i=n.frag,s=n.part,l=n.timeRanges;if(i.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=i,s){var c=this.activeParts;c||(this.activeParts=c=[]),c.push(s)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(d){var w=l[d];if(t.detectEvictedFragments(d,w),!s)for(var m=0;m<w.length;m++)i.appendedPTS=Math.max(w.end(m),i.appendedPTS||0)})},o.onFragBuffered=function(r,n){this.detectPartialFragments(n)},o.hasFragment=function(r){var n=g(r);return!!this.fragments[n]},o.removeFragmentsInRange=function(r,n,t){var i=this;Object.keys(this.fragments).forEach(function(s){var l=i.fragments[s];if(!l)return;if(l.buffered){var c=l.body;c.type===t&&c.start<n&&c.end>r&&i.removeFragment(c)}})},o.removeFragment=function(r){var n=g(r);r.stats.loaded=0,r.clearElementaryStreamInfo(),delete this.fragments[n]},o.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},h}();function x(h){var o,u;return h.buffered&&(((o=h.range.video)===null||o===void 0?void 0:o.partial)||((u=h.range.audio)===null||u===void 0?void 0:u.partial))}function g(h){return h.type+"_"+h.level+"_"+h.urlId+"_"+h.sn}},"./src/controller/gap-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"STALL_MINIMUM_DURATION_MS",function(){return x}),I.d(L,"MAX_START_GAP_JUMP",function(){return g}),I.d(L,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return h}),I.d(L,"SKIP_BUFFER_RANGE_START",function(){return o}),I.d(L,"default",function(){return u});var k=I("./src/utils/buffer-helper.ts"),M=I("./src/errors.ts"),f=I("./src/events.ts"),E=I("./src/utils/logger.ts"),x=250,g=2,h=.1,o=.05,u=function(){function r(t,i,s,l){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=t,this.media=i,this.fragmentTracker=s,this.hls=l}var n=r.prototype;return n.destroy=function(){this.hls=this.fragmentTracker=this.media=null},n.poll=function(i){var s=this.config,l=this.media,c=this.stalled,d=l.currentTime,w=l.seeking,m=this.seeking&&!w,S=!this.seeking&&w;if(this.seeking=w,d!==i){if(this.moved=!0,c!==null){if(this.stallReported){var C=self.performance.now()-c;E.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(C)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||m)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!k.BufferHelper.getBuffered(l).length)return;var v=k.BufferHelper.bufferInfo(l,d,0),y=v.len>0,T=v.nextStart||0;if(!y&&!T)return;if(w){var A=v.len>g,p=!T||T-d>g&&!this.fragmentTracker.getPartialFragment(d);if(A||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var D,O=Math.max(T,v.start||0)-d,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=P==null||((D=P.details)===null||D===void 0)?void 0:D.live,K=j?P.details.targetduration*2:g;if(O>0&&O<=K){this._trySkipBufferHole(null);return}}var U=self.performance.now();if(c===null){this.stalled=U;return}var X=U-c;!w&&X>=x&&this._reportStall(v.len);var B=k.BufferHelper.bufferInfo(l,d,s.maxBufferHole);this._tryFixBufferStall(B,X)},n._tryFixBufferStall=function(i,s){var l=this.config,c=this.fragmentTracker,d=this.media,w=d.currentTime,m=c.getPartialFragment(w);if(m){var S=this._trySkipBufferHole(m);if(S)return}i.len>l.maxBufferHole&&s>l.highBufferWatchdogPeriod*1e3&&(E.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},n._reportStall=function(i){var s=this.hls,l=this.media,c=this.stallReported;c||(this.stallReported=!0,E.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+i+")"),s.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:i}))},n._trySkipBufferHole=function(i){for(var s=this.config,l=this.hls,c=this.media,d=c.currentTime,w=0,m=k.BufferHelper.getBuffered(c),S=0;S<m.length;S++){var C=m.start(S);if(d+s.maxBufferHole>=w&&d<C){var v=Math.max(C+o,c.currentTime+h);return E.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+v),this.moved=!0,this.stalled=null,c.currentTime=v,i&&l.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+v,frag:i}),v}w=m.end(S)}return 0},n._tryNudgeBuffer=function(){var i=this.config,s=this.hls,l=this.media,c=l.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<i.nudgeMaxRetry){var w=c+d*i.nudgeOffset;E.logger.warn("Nudging 'currentTime' from "+c+" to "+w),l.currentTime=w,s.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else E.logger.error("Playhead still not moving while enough data buffered @"+c+" after "+i.nudgeMaxRetry+" nudges"),s.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},r}()},"./src/controller/id3-track-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/utils/texttrack-utils.ts"),f=I("./src/demux/id3.ts"),E=.25,x=function(){function g(o){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=o,this._registerListeners()}var h=g.prototype;return h.destroy=function(){this._unregisterListeners()},h._registerListeners=function(){var u=this.hls;u.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),u.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},h._unregisterListeners=function(){var u=this.hls;u.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),u.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},h.onMediaAttached=function(u,r){this.media=r.media},h.onMediaDetaching=function(){if(!this.id3Track)return;Object(M.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},h.getID3Track=function(u){if(!this.media)return;for(var r=0;r<u.length;r++){var n=u[r];if(n.kind==="metadata"&&n.label==="id3")return Object(M.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")},h.onFragParsingMetadata=function(u,r){if(!this.media)return;var n=r.frag,t=r.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var i=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<t.length;s++){var l=f.getID3Frames(t[s].data);if(l){var c=t[s].pts,d=s<t.length-1?t[s+1].pts:n.end,w=d-c;w<=0&&(d=c+E);for(var m=0;m<l.length;m++){var S=l[m];if(!f.isTimeStampFrame(S)){var C=new i(c,d,"");C.value=S,this.id3Track.addCue(C)}}}}},h.onBufferFlushing=function(u,r){var n=r.startOffset,t=r.endOffset,i=r.type;if(!i||i==="audio"){var s=this.id3Track;s&&Object(M.removeCuesInRange)(s,n,t)}},g}();L.default=x},"./src/controller/latency-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return g});var k=I("./src/errors.ts"),M=I("./src/events.ts"),f=I("./src/utils/logger.ts");function E(h,o){for(var u=0;u<o.length;u++){var r=o[u];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(h,r.key,r)}}function x(h,o,u){return o&&E(h.prototype,o),u&&E(h,u),h}var g=function(){function h(u){var r=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 r.timeupdate()},this.hls=u,this.config=u.config,this.registerListeners()}var o=h.prototype;return o.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},o.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(M.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(M.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(M.Events.ERROR,this.onError)},o.onMediaAttached=function(r,n){this.media=n.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},o.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},o.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},o.onLevelUpdated=function(r,n){var t=n.details;this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},o.onError=function(r,n){if(n.details!==k.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,f.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},o.timeupdate=function(){var r=this.media,n=this.levelDetails;if(!r||!n)return;this.currentTime=r.currentTime;var t=this.computeLatency();if(t===null)return;this._latency=t;var i=this.config,s=i.lowLatencyMode,l=i.maxLiveSyncPlaybackRate;if(!s||l===1)return;var c=this.targetLatency;if(c===null)return;var d=t-c,w=Math.min(this.maxLatency,c+n.targetduration),m=d<w;if(n.live&&m&&d>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,l)),C=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;r.playbackRate=Math.min(S,Math.max(1,C))}else r.playbackRate!==1&&r.playbackRate!==0&&(r.playbackRate=1)},o.estimateLiveEdge=function(){var r=this.levelDetails;return r===null?null:r.edge+r.age},o.computeLatency=function(){var r=this.estimateLiveEdge();return r===null?null:r-this.currentTime},x(h,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var r=this.config,n=this.levelDetails;return r.liveMaxLatencyDuration!==void 0?r.liveMaxLatencyDuration:n?r.liveMaxLatencyDurationCount*n.targetduration:0}},{key:"targetLatency",get:function(){var r=this.levelDetails;if(r===null)return null;var n=r.holdBack,t=r.partHoldBack,i=r.targetduration,s=this.config,l=s.liveSyncDuration,c=s.liveSyncDurationCount,d=s.lowLatencyMode,w=this.hls.userConfig,m=d&&t||n;(w.liveSyncDuration||w.liveSyncDurationCount||m===0)&&(m=l!==void 0?l:c*i);var S=i,C=1;return m+Math.min(this.stallCount*C,S)}},{key:"liveSyncPosition",get:function(){var r=this.estimateLiveEdge(),n=this.targetLatency,t=this.levelDetails;if(r===null||n===null||t===null)return null;var i=t.edge,s=r-n-this.edgeStalled,l=i-t.totalduration,c=i-(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.min(Math.max(l,s),c)}},{key:"drift",get:function(){var r=this.levelDetails;return r===null?1:r.drift}},{key:"edgeStalled",get:function(){var r=this.levelDetails;if(r===null)return 0;var n=(this.config.lowLatencyMode&&r.partTarget||r.targetduration)*3;return Math.max(r.age-n,0)}},{key:"forwardBufferLength",get:function(){var r=this.media,n=this.levelDetails;if(!r||!n)return 0;var t=r.buffered.length;return t?r.buffered.end(t-1):n.edge-this.currentTime}}]),h}()},"./src/controller/level-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return s});var k=I("./src/types/level.ts"),M=I("./src/events.ts"),f=I("./src/errors.ts"),E=I("./src/utils/codecs.ts"),x=I("./src/controller/level-helper.ts"),g=I("./src/controller/base-playlist-controller.ts"),h=I("./src/types/loader.ts");function o(){return o=Object.assign||function(l){for(var c=1;c<arguments.length;c++){var d=arguments[c];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(l[w]=d[w])}return l},o.apply(this,arguments)}function u(l,c){for(var d=0;d<c.length;d++){var w=c[d];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(l,w.key,w)}}function r(l,c,d){return c&&u(l.prototype,c),d&&u(l,d),l}function n(l,c){l.prototype=Object.create(c.prototype),l.prototype.constructor=l,t(l,c)}function t(l,c){return t=Object.setPrototypeOf||function(w,m){return w.__proto__=m,w},t(l,c)}var i=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(l){n(c,l);function c(w){var m;return m=l.call(this,w,"[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 d=c.prototype;return d._registerListeners=function(){var m=this.hls;m.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(M.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var m=this.hls;m.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(M.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,l.prototype.destroy.call(this)},d.startLoad=function(){var m=this._levels;m.forEach(function(S){S.loadError=0}),l.prototype.startLoad.call(this)},d.onManifestLoaded=function(m,S){var C=[],v=[],y=[],T,A={},p,D=!1,O=!1,P=!1;if(S.levels.forEach(function(X){var B=X.attrs;D=D||!!(X.width&&X.height),O=O||!!X.videoCodec,P=P||!!X.audioCodec,i&&X.audioCodec&&X.audioCodec.indexOf("mp4a.40.34")!==-1&&(X.audioCodec=void 0);var N=X.bitrate+"-"+X.attrs.RESOLUTION+"-"+X.attrs.CODECS;p=A[N],p?p.url.push(X.url):(p=new k.Level(X),A[N]=p,C.push(p)),B&&(B.AUDIO&&Object(x.addGroupId)(p,"audio",B.AUDIO),B.SUBTITLES&&Object(x.addGroupId)(p,"text",B.SUBTITLES))}),(D||O)&&P&&(C=C.filter(function(X){var B=X.videoCodec,N=X.width,z=X.height;return!!B||!!(N&&z)})),C=C.filter(function(X){var B=X.audioCodec,N=X.videoCodec;return(!B||Object(E.isCodecSupportedInMp4)(B,"audio"))&&(!N||Object(E.isCodecSupportedInMp4)(N,"video"))}),S.audioTracks&&(v=S.audioTracks.filter(function(X){return!X.audioCodec||Object(E.isCodecSupportedInMp4)(X.audioCodec,"audio")}),Object(x.assignTrackIdsByGroup)(v)),S.subtitles&&(y=S.subtitles,Object(x.assignTrackIdsByGroup)(y)),C.length>0){T=C[0].bitrate,C.sort(function(X,B){return X.bitrate-B.bitrate}),this._levels=C;for(var j=0;j<C.length;j++)if(C[j].bitrate===T){this._firstLevel=j,this.log("manifest loaded, "+C.length+" level(s) found, first bitrate: "+T);break}var K=P&&!O,U={levels:C,audioTracks:v,subtitleTracks:y,firstLevel:this._firstLevel,stats:S.stats,audio:P,video:O,altAudio:!K&&v.some(function(X){return!!X.url})};this.hls.trigger(M.Events.MANIFEST_PARSED,U),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(M.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(m,S){if(l.prototype.onError.call(this,m,S),S.fatal)return;var C=S.context,v=this._levels[this.currentLevelIndex];if(C&&(C.type===h.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&C.groupId===v.audioGroupIds[v.urlId]||C.type===h.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&C.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,T=!0,A;switch(S.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var p=this._levels[S.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(A=S.frag.level)):A=S.frag.level}break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:C&&(C.deliveryDirectives&&(T=!1),A=C.level),y=!0;break;case f.ErrorDetails.REMUX_ALLOC_ERROR:A=S.level,y=!0;break}A!==void 0&&this.recoverLevel(S,A,y,T)},d.recoverLevel=function(m,S,C,v){var y=m.details,T=this._levels[S];if(T.loadError++,C){var A=this.retryLoadingOrFail(m);if(A)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var p=T.url.length;if(p>1&&T.loadError<p)m.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var D=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==D&&this._levels[D].loadError===0&&(this.warn(y+": switch to "+D),m.levelRetry=!0,this.hls.nextAutoLevel=D)}}},d.redundantFailover=function(m){var S=this._levels[m],C=S.url.length;if(C>1){var v=(S.urlId+1)%C;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(y){y.urlId=v}),this.level=m}},d.onFragLoaded=function(m,S){var C=S.frag;if(C!==void 0&&C.type===h.PlaylistLevelType.MAIN){var v=this._levels[C.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},d.onLevelLoaded=function(m,S){var C,v=S.level,y=S.details,T=this._levels[v];if(!T){var A;this.warn("Invalid level index "+v),(A=S.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(y.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(v,S,T.details)):(C=S.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(y.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(m,S){var C=this.hls.levels[this.currentLevelIndex];if(!C)return;if(C.audioGroupIds){for(var v=-1,y=this.hls.audioTracks[S.id].groupId,T=0;T<C.audioGroupIds.length;T++)if(C.audioGroupIds[T]===y){v=T;break}v!==C.urlId&&(C.urlId=v,this.startLoad())}},d.loadPlaylist=function(m){var S=this.currentLevelIndex,C=this._levels[S];if(this.canLoad&&C&&C.url.length>0){var v=C.urlId,y=C.url[v];if(m)try{y=m.addDirectives(y)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+S+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+v+" "+y),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:y,level:S,id:v,deliveryDirectives:m||null})}},d.removeLevel=function(m,S){var C=function(T,A){return A!==S},v=this._levels.filter(function(y,T){return T!==m?!0:y.url.length>1&&S!==void 0?(y.url=y.url.filter(C),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(C)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(C)),y.urlId=0,!0):!1}).map(function(y,T){var A=y.details;return A!=null&&A.fragments&&A.fragments.forEach(function(p){p.level=T}),y});this._levels=v,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:v})},r(c,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var S,C=this._levels;if(C.length===0)return;if(this.currentLevelIndex===m&&(S=C[m])!==null&&S!==void 0&&S.details)return;if(m<0||m>=C.length){var v=m<0;if(this.hls.trigger(M.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:v,reason:"invalid level idx"}),v)return;m=Math.min(m,C.length-1)}this.clearTimer();var y=this.currentLevelIndex,T=C[y],A=C[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var p=o({},A,{level:m,maxBitrate:A.maxBitrate,uri:A.uri,urlId:A.urlId});delete p._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,p);var D=A.details;if(!D||D.live){var O=this.switchParams(A.uri,T==null?void 0:T.details);this.loadPlaylist(O)}}},{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)}}]),c}(g.default)},"./src/controller/level-helper.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"addGroupId",function(){return f}),I.d(L,"assignTrackIdsByGroup",function(){return E}),I.d(L,"updatePTS",function(){return x}),I.d(L,"updateFragPTSDTS",function(){return h}),I.d(L,"mergeDetails",function(){return o}),I.d(L,"mapPartIntersection",function(){return u}),I.d(L,"mapFragmentIntersection",function(){return r}),I.d(L,"adjustSliding",function(){return n}),I.d(L,"addSliding",function(){return t}),I.d(L,"computeReloadInterval",function(){return i}),I.d(L,"getFragmentWithSN",function(){return s}),I.d(L,"getPartWith",function(){return l});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts");function f(c,d,w){switch(d){case"audio":c.audioGroupIds||(c.audioGroupIds=[]),c.audioGroupIds.push(w);break;case"text":c.textGroupIds||(c.textGroupIds=[]),c.textGroupIds.push(w);break}}function E(c){var d={};c.forEach(function(w){var m=w.groupId||"";w.id=d[m]=d[m]||0,d[m]++})}function x(c,d,w){var m=c[d],S=c[w];g(m,S)}function g(c,d){var w=d.startPTS;if(Object(k.isFiniteNumber)(w)){var m=0,S;d.sn>c.sn?(m=w-c.start,S=c):(m=c.start-w,S=d),S.duration!==m&&(S.duration=m)}else if(d.sn>c.sn){var C=c.cc===d.cc;C&&c.minEndPTS?d.start=c.start+(c.minEndPTS-c.start):d.start=c.start+c.duration}else d.start=Math.max(c.start-d.duration,0)}function h(c,d,w,m,S,C){var v=m-w;v<=0&&(M.logger.warn("Fragment should have a positive duration",d),m=w+d.duration,C=S+d.duration);var y=w,T=m,A=d.startPTS,p=d.endPTS;if(Object(k.isFiniteNumber)(A)){var D=Math.abs(A-w);Object(k.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(D,d.deltaPTS):d.deltaPTS=D,y=Math.max(w,A),w=Math.min(w,A),S=Math.min(S,d.startDTS),T=Math.min(m,p),m=Math.max(m,p),C=Math.max(C,d.endDTS)}d.duration=m-w;var O=w-d.start;d.appendedPTS=m,d.start=d.startPTS=w,d.maxStartPTS=y,d.startDTS=S,d.endPTS=m,d.minEndPTS=T,d.endDTS=C;var P=d.sn;if(!c||P<c.startSN||P>c.endSN)return 0;var j,K=P-c.startSN,U=c.fragments;for(U[K]=d,j=K;j>0;j--)g(U[j],U[j-1]);for(j=K;j<U.length-1;j++)g(U[j],U[j+1]);return c.fragmentHint&&g(U[U.length-1],c.fragmentHint),c.PTSKnown=c.alignedSliding=!0,O}function o(c,d){for(var w=null,m=c.fragments,S=m.length-1;S>=0;S--){var C=m[S].initSegment;if(C){w=C;break}}c.fragmentHint&&delete c.fragmentHint.endPTS;var v=0,y;if(r(c,d,function(j,K){j.relurl&&(v=j.cc-K.cc),Object(k.isFiniteNumber)(j.startPTS)&&Object(k.isFiniteNumber)(j.endPTS)&&(K.start=K.startPTS=j.startPTS,K.startDTS=j.startDTS,K.appendedPTS=j.appendedPTS,K.maxStartPTS=j.maxStartPTS,K.endPTS=j.endPTS,K.endDTS=j.endDTS,K.minEndPTS=j.minEndPTS,K.duration=j.endPTS-j.startPTS,K.duration&&(y=K),d.PTSKnown=d.alignedSliding=!0),K.elementaryStreams=j.elementaryStreams,K.loader=j.loader,K.stats=j.stats,K.urlId=j.urlId,j.initSegment&&(K.initSegment=j.initSegment,w=j.initSegment)}),w){var T=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;T.forEach(function(j){var K;(!j.initSegment||j.initSegment.relurl===((K=w)===null||K===void 0?void 0:K.relurl))&&(j.initSegment=w)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(j){return!j}),d.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var A=d.skippedSegments;A--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var p=d.fragments;if(v){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var D=0;D<p.length;D++)p[D].cc+=v}d.skippedSegments&&(d.startCC=d.fragments[0].cc),u(c.partList,d.partList,function(j,K){K.elementaryStreams=j.elementaryStreams,K.stats=j.stats}),y?h(d,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):n(c,d),p.length&&(d.totalduration=d.edge-p[0].start),d.driftStartTime=c.driftStartTime,d.driftStart=c.driftStart;var O=d.advancedDateTime;if(d.advanced&&O){var P=d.edge;d.driftStart||(d.driftStartTime=O,d.driftStart=P),d.driftEndTime=O,d.driftEnd=P}else d.driftEndTime=c.driftEndTime,d.driftEnd=c.driftEnd,d.advancedDateTime=c.advancedDateTime}function u(c,d,w){if(c&&d)for(var m=0,S=0,C=c.length;S<=C;S++){var v=c[S],y=d[S+m];v&&y&&v.index===y.index&&v.fragment.sn===y.fragment.sn?w(v,y):m--}}function r(c,d,w){for(var m=d.skippedSegments,S=Math.max(c.startSN,d.startSN)-d.startSN,C=(c.fragmentHint?1:0)+(m?d.endSN:Math.min(c.endSN,d.endSN))-d.startSN,v=d.startSN-c.startSN,y=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,T=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,A=S;A<=C;A++){var p=T[v+A],D=y[A];m&&!D&&A<m&&(D=d.fragments[A]=p),p&&D&&w(p,D)}}function n(c,d){var w=d.startSN+d.skippedSegments-c.startSN,m=c.fragments;if(w<0||w>=m.length)return;t(d,m[w].start)}function t(c,d){if(d){for(var w=c.fragments,m=c.skippedSegments;m<w.length;m++)w[m].start+=d;c.fragmentHint&&(c.fragmentHint.start+=d)}}function i(c,d){var w=1e3*c.levelTargetDuration,m=w/2,S=c.age,C=S>0&&S<w*3,v=d.loading.end-d.loading.start,y,T=c.availabilityDelay;if(c.updated===!1)if(C){var A=333*c.misses;y=Math.max(Math.min(m,v*2),A),c.availabilityDelay=(c.availabilityDelay||0)+y}else y=m;else C?(T=Math.min(T||w/2,S),c.availabilityDelay=T,y=T+w-S):y=w-v;return Math.round(y)}function s(c,d,w){if(!c||!c.details)return null;var m=c.details,S=m.fragments[d-m.startSN];return S||(S=m.fragmentHint,S&&S.sn===d?S:d<m.startSN&&w&&w.sn===d?w:null)}function l(c,d,w){if(!c||!c.details)return null;var m=c.details.partList;if(m)for(var S=m.length;S--;){var C=m[S];if(C.index===w&&C.fragment.sn===d)return C}return null}},"./src/controller/stream-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return m});var k=I("./src/polyfills/number.ts"),M=I("./src/controller/base-stream-controller.ts"),f=I("./src/is-supported.ts"),E=I("./src/events.ts"),x=I("./src/utils/buffer-helper.ts"),g=I("./src/controller/fragment-tracker.ts"),h=I("./src/types/loader.ts"),o=I("./src/loader/fragment.ts"),u=I("./src/demux/transmuxer-interface.ts"),r=I("./src/types/transmuxer.ts"),n=I("./src/controller/gap-controller.ts"),t=I("./src/errors.ts"),i=I("./src/utils/logger.ts");function s(S,C){for(var v=0;v<C.length;v++){var y=C[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}function l(S,C,v){return C&&s(S.prototype,C),v&&s(S,v),S}function c(S,C){S.prototype=Object.create(C.prototype),S.prototype.constructor=S,d(S,C)}function d(S,C){return d=Object.setPrototypeOf||function(y,T){return y.__proto__=T,y},d(S,C)}var w=100,m=function(S){c(C,S);function C(y,T){var A;return A=S.call(this,y,T,"[stream-controller]")||this,A.audioCodecSwap=!1,A.gapController=null,A.level=-1,A._forceStartLoad=!1,A.altAudio=!1,A.audioOnly=!1,A.fragPlaying=null,A.onvplaying=null,A.onvseeked=null,A.fragLastKbps=0,A.stalled=!1,A.couldBacktrack=!1,A.audioCodecSwitch=!1,A.videoBuffer=null,A._registerListeners(),A}var v=C.prototype;return v._registerListeners=function(){var T=this.hls;T.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.on(E.Events.LEVEL_LOADING,this.onLevelLoading,this),T.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.on(E.Events.ERROR,this.onError,this),T.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var T=this.hls;T.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),T.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),T.off(E.Events.ERROR,this.onError,this),T.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),T.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(T){if(this.levels){var A=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var D=p.startLevel;D===-1&&(p.config.testBandwidth?(D=0,this.bitrateTest=!0):D=p.nextAutoLevel),this.level=p.nextLoadLevel=D,this.loadedmetadata=!1}A>0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+A.toFixed(3)),T=A),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var T,A=this.levels,p=this.level,D=A==null||((T=A[p])===null||T===void 0)?void 0:T.details;if(D&&(!D.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(D))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var O,P=self.performance.now(),j=this.retryDate;(!j||P>=j||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var T,A,p=this.hls,D=this.levelLastLoaded,O=this.levels,P=this.media,j=p.config,K=p.nextLoadLevel;if(D===null||!P&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!O||!O[K])return;var U=O[K];this.level=p.nextLoadLevel=K;var X=U.details;if(!X||this.state===M.State.WAITING_LEVEL||X.live&&this.levelLastLoaded!==K){this.state=M.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,h.PlaylistLevelType.MAIN);if(B===null)return;var N=B.len,z=this.getMaxBufferLength(U.maxBitrate);if(N>=z)return;if(this._streamEnded(B,X)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(E.Events.BUFFER_EOS,te),this.state=M.State.ENDED;return}var ce=B.end,be=this.getNextFragment(ce,X);if(this.couldBacktrack&&!this.fragPrevious&&be&&be.sn!=="initSegment"){var Fe=be.sn-X.startSN;Fe>1&&(be=X.fragments[Fe-1],this.fragmentTracker.removeFragment(be))}if(be&&this.fragmentTracker.getState(be)===g.FragmentState.OK&&this.nextLoadPosition>ce){var Oe=this.audioOnly&&!this.altAudio?o.ElementaryStreamTypes.AUDIO:o.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,Oe,h.PlaylistLevelType.MAIN),be=this.getNextFragment(this.nextLoadPosition,X)}if(!be)return;be.initSegment&&!be.initSegment.data&&!this.bitrateTest&&(be=be.initSegment),((T=be.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((A=be.decryptdata)!==null&&A!==void 0&&A.key)?this.loadKey(be,X):this.loadFragment(be,X,ce)},v.loadFragment=function(T,A,p){var D,O=this.fragmentTracker.getState(T);if(this.fragCurrent=T,O===g.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(T);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else O=g.FragmentState.NOT_LOADED}O===g.FragmentState.NOT_LOADED||O===g.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,T,A,p)):O===g.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((D=this.media)===null||D===void 0?void 0:D.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(T){var A=this.fragmentTracker.getAppendedFrag(T,h.PlaylistLevelType.MAIN);return A&&"fragment"in A?A.fragment:A},v.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,h.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var T=this.levels,A=this.media;if(A!=null&&A.readyState){var p,D=this.getAppendedFrag(A.currentTime);if(D&&D.start>1&&this.flushMainBuffer(0,D.start-1),!A.paused&&T){var O=this.hls.nextLoadLevel,P=T[O],j=this.fragLastKbps;j&&this.fragCurrent?p=this.fragCurrent.duration*P.maxBitrate/(1e3*j)+1:p=0}else p=0;var K=this.getBufferedFrag(A.currentTime+p);if(K){var U=this.followingBufferedFrag(K);if(U){this.abortCurrentFrag();var X=U.maxStartPTS?U.maxStartPTS:U.start,B=U.duration,N=Math.max(K.end,X+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===M.State.KEY_LOADING&&(this.state=M.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(T,A){S.prototype.flushMainBuffer.call(this,T,A,this.altAudio?"video":null)},v.onMediaAttached=function(T,A){S.prototype.onMediaAttached.call(this,T,A);var p=A.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new n.default(this.config,p,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var T=this.media,A=T?T.currentTime:null;Object(k.isFiniteNumber)(A)&&this.log("Media seeked to "+A.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(E.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(T,A){var p=!1,D=!1,O;A.levels.forEach(function(P){O=P.audioCodec,O&&(O.indexOf("mp4a.40.2")!==-1&&(p=!0),O.indexOf("mp4a.40.5")!==-1&&(D=!0))}),this.audioCodecSwitch=p&&D&&!Object(f.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=A.levels,this.startFragRequested=!1},v.onLevelLoading=function(T,A){var p=this.levels;if(!p||this.state!==M.State.IDLE)return;var D=p[A.level];(!D.details||D.details.live&&this.levelLastLoaded!==A.level||this.waitForCdnTuneIn(D.details))&&(this.state=M.State.WAITING_LEVEL)},v.onLevelLoaded=function(T,A){var p,D=this.levels,O=A.level,P=A.details,j=P.totalduration;if(!D){this.warn("Levels were reset while loading level "+O);return}this.log("Level "+O+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+j);var K=this.fragCurrent;K&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(K.level!==A.level&&K.loader&&(this.state=M.State.IDLE,K.loader.abort()));var U=D[O],X=0;if(P.live||(p=U.details)!==null&&p!==void 0&&p.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;X=this.alignPlaylists(P,U.details)}if(U.details=P,this.levelLastLoaded=O,this.hls.trigger(E.Events.LEVEL_UPDATED,{details:P,level:O}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=M.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,X),this.tick()},v._handleFragmentLoadProgress=function(T){var A,p=T.frag,D=T.part,O=T.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var j=P[p.level],K=j.details;if(!K){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var U=j.videoCodec,X=K.PTSKnown||!K.live,B=(A=p.initSegment)===null||A===void 0?void 0:A.data,N=this._getAudioCodec(j),z=this.transmuxer=this.transmuxer||new u.default(this.hls,h.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=D?D.index:-1,ce=te!==-1,be=new r.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,O.byteLength,te,ce),Fe=this.initPTS[p.cc];z.push(O,B,N,U,p,D,K.totalduration,X,be,Fe)},v.onAudioTrackSwitching=function(T,A){var p=this.altAudio,D=!!A.url,O=A.id;if(!D){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var P=this.fragCurrent;P!=null&&P.loader&&(this.log("Switching to main audio track, cancel main fragment load"),P.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;p&&j.trigger(E.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:O})}},v.onAudioTrackSwitched=function(T,A){var p=A.id,D=!!this.hls.audioTracks[p].url;if(D){var O=this.videoBuffer;O&&this.mediaBuffer!==O&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=O)}this.altAudio=D,this.tick()},v.onBufferCreated=function(T,A){var p=A.tracks,D,O,P=!1;for(var j in p){var K=p[j];if(K.id==="main"){if(O=j,D=K,j==="video"){var U=p[j];U&&(this.videoBuffer=U.buffer)}}else P=!0}P&&D?(this.log("Alternate track found, use "+O+".buffered to schedule main fragment loading"),this.mediaBuffer=D.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(T,A){var p=A.frag,D=A.part;if(p&&p.type!==h.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(D?" p: "+D.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var O=D?D.stats:p.stats;this.fragLastKbps=Math.round(8*O.total/(O.buffering.end-O.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,D)},v.onError=function(T,A){switch(A.details){case t.ErrorDetails.FRAG_LOAD_ERROR:case t.ErrorDetails.FRAG_LOAD_TIMEOUT:case t.ErrorDetails.KEY_LOAD_ERROR:case t.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(h.PlaylistLevelType.MAIN,A);break;case t.ErrorDetails.LEVEL_LOAD_ERROR:case t.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(A.fatal?(this.warn(""+A.details),this.state=M.State.ERROR):!A.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case t.ErrorDetails.BUFFER_FULL_ERROR:if(A.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var p=!0,D=this.getFwdBufferInfo(this.media,h.PlaylistLevelType.MAIN);D&&D.len>.5&&(p=!this.reduceMaxBufferLength(D.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var T=this.media,A=this.gapController;if(!T||!A||!T.readyState)return;var p=x.BufferHelper.getBuffered(T);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):A.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(T,A){var p=A.type;if(p!==o.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var D=(p===o.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(D,p,h.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(T,A){this.levels=A.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var T=this.media,A=T.currentTime,p=this.startPosition;if(p>=0&&A<p){if(T.seeking){i.logger.log("could not seek to "+p+", already seeking at "+A);return}var D=x.BufferHelper.getBuffered(T),O=D.length?D.start(0):0,P=O-p;P>0&&(P<this.config.maxBufferHole||P<this.config.maxFragLookUpTolerance)&&(i.logger.log("adjusting start position by "+P+" to match buffer start"),p+=P,this.startPosition=p),this.log("seek to target start position "+p+" from current time "+A),T.currentTime=p}},v._getAudioCodec=function(T){var A=this.config.defaultAudioCodec||T.audioCodec;return this.audioCodecSwap&&A&&(this.log("Swapping audio codec"),A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),A},v._loadBitrateTestFrag=function(T){var A=this;this._doFragLoad(T).then(function(p){var D=A.hls;if(!p||D.nextLoadLevel||A.fragContextChanged(T))return;A.fragLoadError=0,A.state=M.State.IDLE,A.startFragRequested=!1,A.bitrateTest=!1;var O=T.stats;O.parsing.start=O.parsing.end=O.buffering.start=O.buffering.end=self.performance.now(),D.trigger(E.Events.FRAG_LOADED,p)})},v._handleTransmuxComplete=function(T){var A,p="main",D=this.hls,O=T.remuxResult,P=T.chunkMeta,j=this.getCurrentContext(P);if(!j){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var K=j.frag,U=j.part,X=j.level,B=O.video,N=O.text,z=O.id3,te=O.initSegment,ce=this.altAudio?void 0:O.audio;if(this.fragContextChanged(K))return;if(this.state=M.State.PARSING,te){te.tracks&&(this._bufferInitSegment(X,te.tracks,K,P),D.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:p,tracks:te.tracks}));var be=te.initPTS,Fe=te.timescale;Object(k.isFiniteNumber)(be)&&(this.initPTS[K.cc]=be,D.trigger(E.Events.INIT_PTS_FOUND,{frag:K,id:p,initPTS:be,timescale:Fe}))}if(B&&O.independent!==!1){if(X.details){var Oe=B.startPTS,Re=B.endPTS,Be=B.startDTS,Ke=B.endDTS;if(U)U.elementaryStreams[B.type]={startPTS:Oe,endPTS:Re,startDTS:Be,endDTS:Ke};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var Ae=this.getLoadPosition()+this.config.maxBufferHole;if(Ae<Oe){this.backtrack(K);return}K.setElementaryStreamInfo(B.type,K.start,Re,K.start,Ke,!0)}K.setElementaryStreamInfo(B.type,Oe,Re,Be,Ke),this.bufferFragmentData(B,K,U,P)}}else if(O.independent===!1){this.backtrack(K);return}if(ce){var _e=ce.startPTS,le=ce.endPTS,Ee=ce.startDTS,pe=ce.endDTS;U&&(U.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:_e,endPTS:le,startDTS:Ee,endDTS:pe}),K.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,_e,le,Ee,pe),this.bufferFragmentData(ce,K,U,P)}if(z!=null&&(A=z.samples)!==null&&A!==void 0&&A.length){var Ge={frag:K,id:p,samples:z.samples};D.trigger(E.Events.FRAG_PARSING_METADATA,Ge)}if(N){var Ye={frag:K,id:p,samples:N.samples};D.trigger(E.Events.FRAG_PARSING_USERDATA,Ye)}},v._bufferInitSegment=function(T,A,p,D){var O=this;if(this.state!==M.State.PARSING)return;this.audioOnly=!!A.audio&&!A.video,this.altAudio&&!this.audioOnly&&delete A.audio;var P=A.audio,j=A.video,K=A.audiovideo;if(P){var U=T.audioCodec,X=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(U&&(U.indexOf("mp4a.40.5")!==-1?U="mp4a.40.2":U="mp4a.40.5"),P.metadata.channelCount!==1&&X.indexOf("firefox")===-1&&(U="mp4a.40.5")),X.indexOf("android")!==-1&&P.container!=="audio/mpeg"&&(U="mp4a.40.2",this.log("Android: force audio codec to "+U)),T.audioCodec&&T.audioCodec!==U&&this.log('Swapping manifest audio codec "'+T.audioCodec+'" for "'+U+'"'),P.levelCodec=U,P.id="main",this.log("Init audio buffer, container:"+P.container+", codecs[selected/level/parsed]=["+(U||"")+"/"+(T.audioCodec||"")+"/"+P.codec+"]")}j&&(j.levelCodec=T.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(T.videoCodec||"")+"/"+j.codec+"]")),K&&this.log("Init audiovideo buffer, container:"+K.container+", codecs[level/parsed]=["+(T.attrs.CODECS||"")+"/"+K.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,A),Object.keys(A).forEach(function(B){var N=A[B],z=N.initSegment;z!=null&&z.byteLength&&O.hls.trigger(E.Events.BUFFER_APPENDING,{type:B,data:z,frag:p,part:null,chunkMeta:D,parent:p.type})}),this.tick()},v.backtrack=function(T){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(T);var A=this.fragmentTracker.backtrack(T);this.fragPrevious=null,this.nextLoadPosition=T.start,A?this.resetFragmentLoading(T):this.state=M.State.BACKTRACKING},v.checkFragmentChanged=function(){var T=this.media,A=null;if(T&&T.readyState>1&&T.seeking===!1){var p=T.currentTime;if(x.BufferHelper.isBuffered(T,p)?A=this.getAppendedFrag(p):x.BufferHelper.isBuffered(T,p+.1)&&(A=this.getAppendedFrag(p+.1)),A){var D=this.fragPlaying,O=A.level;(!D||A.sn!==D.sn||D.level!==O||A.urlId!==D.urlId)&&(this.hls.trigger(E.Events.FRAG_CHANGED,{frag:A}),(!D||D.level!==O)&&this.hls.trigger(E.Events.LEVEL_SWITCHED,{level:O}),this.fragPlaying=A)}}},l(C,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var A=this.getAppendedFrag(T.currentTime);if(A)return A.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var A=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(A)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),C}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"SubtitleStreamController",function(){return c});var k=I("./src/events.ts"),M=I("./src/utils/logger.ts"),f=I("./src/utils/buffer-helper.ts"),E=I("./src/controller/fragment-finders.ts"),x=I("./src/utils/discontinuities.ts"),g=I("./src/controller/level-helper.ts"),h=I("./src/controller/fragment-tracker.ts"),o=I("./src/controller/base-stream-controller.ts"),u=I("./src/types/loader.ts"),r=I("./src/types/level.ts");function n(d,w){for(var m=0;m<w.length;m++){var S=w[m];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(d,S.key,S)}}function t(d,w,m){return w&&n(d.prototype,w),m&&n(d,m),d}function i(d,w){d.prototype=Object.create(w.prototype),d.prototype.constructor=d,s(d,w)}function s(d,w){return s=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},s(d,w)}var l=500,c=function(d){i(w,d);function w(S,C){var v;return v=d.call(this,S,C,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var m=w.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var C=this.hls;C.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(k.Events.ERROR,this.onError,this),C.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.on(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.on(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var C=this.hls;C.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(k.Events.ERROR,this.onError,this),C.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),C.off(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),C.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),C.off(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),C.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=o.State.IDLE,this.setInterval(l),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(C,v){this.mainDetails=v.details},m.onSubtitleFragProcessed=function(C,v){var y=v.frag,T=v.success;if(this.fragPrevious=y,this.state=o.State.IDLE,!T)return;var A=this.tracksBuffered[this.currentTrackId];if(!A)return;for(var p,D=y.start,O=0;O<A.length;O++)if(D>=A[O].start&&D<=A[O].end){p=A[O];break}var P=y.start+y.duration;p?p.end=P:(p={start:D,end:P},A.push(p)),this.fragmentTracker.fragBuffered(y)},m.onBufferFlushing=function(C,v){var y=v.startOffset,T=v.endOffset;if(y===0&&T!==Number.POSITIVE_INFINITY){var A=this.currentTrackId,p=this.levels;if(!p.length||!p[A]||!p[A].details)return;var D=p[A].details,O=D.targetduration,P=T-O;if(P<=0)return;v.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(j){for(var K=0;K<j.length;){if(j[K].end<=P){j.shift();continue}else if(j[K].start<P)j[K].start=P;else break;K++}}),this.fragmentTracker.removeFragmentsInRange(y,P,u.PlaylistLevelType.SUBTITLE)}},m.onError=function(C,v){var y,T=v.frag;if(!T||T.type!==u.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=o.State.IDLE},m.onSubtitleTracksUpdated=function(C,v){var y=this,T=v.subtitleTracks;this.tracksBuffered=[],this.levels=T.map(function(A){return new r.Level(A)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(A){y.tracksBuffered[A.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(C,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(l)},m.onSubtitleTrackLoaded=function(C,v){var y,T=v.details,A=v.id,p=this.currentTrackId,D=this.levels;if(!D.length)return;var O=D[p];if(A>=D.length||A!==p||!O)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(y=O.details)!==null&&y!==void 0&&y.live){var P=this.mainDetails;if(T.deltaUpdateFailed||!P)return;var j=P.fragments[0];if(!O.details)T.hasProgramDateTime&&P.hasProgramDateTime?Object(x.alignMediaPlaylistByPDT)(T,P):j&&Object(g.addSliding)(T,j.start);else{var K=this.alignPlaylists(T,O.details);K===0&&j&&Object(g.addSliding)(T,j.start)}}if(O.details=T,this.levelLastLoaded=A,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===o.State.IDLE){var U=Object(E.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);U||(this.warn("Subtitle playlist not aligned with playback"),O.details=void 0)}},m._handleFragmentLoadComplete=function(C){var v=C.frag,y=C.payload,T=v.decryptdata,A=this.hls;if(this.fragContextChanged(v))return;if(y&&y.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),T.key.buffer,T.iv.buffer).then(function(D){var O=performance.now();A.trigger(k.Events.FRAG_DECRYPTED,{frag:v,payload:D,stats:{tstart:p,tdecrypt:O}})})}},m.doTick=function(){if(!this.media){this.state=o.State.IDLE;return}if(this.state===o.State.IDLE){var C,v=this.currentTrackId,y=this.levels;if(!y.length||!y[v]||!y[v].details)return;var T=y[v].details,A=T.targetduration,p=this.config,D=this.media,O=f.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,D.currentTime-A,p.maxBufferHole),P=O.end,j=O.len,K=this.getMaxBufferLength()+A;if(j>K)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var U=T.fragments,X=U.length,B=T.edge,N,z=this.fragPrevious;if(P<B){var te=p.maxFragLookUpTolerance;z&&T.hasProgramDateTime&&(N=Object(E.findFragmentByPDT)(U,z.endProgramDateTime,te)),N||(N=Object(E.findFragmentByPTS)(z,U,P,te),!N&&z&&z.start<U[0].start&&(N=U[0]))}else N=U[X-1];(C=N)!==null&&C!==void 0&&C.encrypted?(M.logger.log("Loading key for "+N.sn),this.state=o.State.KEY_LOADING,this.hls.trigger(k.Events.KEY_LOADING,{frag:N})):N&&this.fragmentTracker.getState(N)===h.FragmentState.NOT_LOADED&&this.loadFragment(N,T,P)}},m.loadFragment=function(C,v,y){this.fragCurrent=C,d.prototype.loadFragment.call(this,C,v,y)},t(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(o.default)},"./src/controller/subtitle-track-controller.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/events.ts"),M=I("./src/utils/texttrack-utils.ts"),f=I("./src/controller/base-playlist-controller.ts"),E=I("./src/types/loader.ts");function x(n,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function g(n,t,i){return t&&x(n.prototype,t),i&&x(n,i),n}function h(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,o(n,t)}function o(n,t){return o=Object.setPrototypeOf||function(s,l){return s.__proto__=l,s},o(n,t)}var u=function(n){h(t,n);function t(s){var l;return l=n.call(this,s,"[subtitle-track-controller]")||this,l.media=null,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.selectDefaultTrack=!0,l.queuedDefaultTrack=-1,l.trackChangeListener=function(){return l.onTextTracksChanged()},l.asyncPollTrackChange=function(){return l.pollTrackChange(0)},l.useTextTrackPolling=!1,l.subtitlePollingInterval=-1,l.subtitleDisplay=!0,l.registerListeners(),l}var i=t.prototype;return i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,n.prototype.destroy.call(this)},i.registerListeners=function(){var l=this.hls;l.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.on(k.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var l=this.hls;l.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.off(k.Events.ERROR,this.onError,this)},i.onMediaAttached=function(l,c){if(this.media=c.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)},i.pollTrackChange=function(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},i.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 l=r(this.media.textTracks);l.forEach(function(c){Object(M.clearCurrentCues)(c)}),this.subtitleTrack=-1,this.media=null},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},i.onManifestParsed=function(l,c){this.tracks=c.subtitleTracks},i.onSubtitleTrackLoaded=function(l,c){var d=c.id,w=c.details,m=this.trackId,S=this.tracksInGroup[m];if(!S){this.warn("Invalid subtitle track id "+d);return}var C=S.details;S.details=c.details,this.log("subtitle track "+d+" loaded ["+w.startSN+"-"+w.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,c,C))},i.onLevelLoading=function(l,c){this.switchLevel(c.level)},i.onLevelSwitching=function(l,c){this.switchLevel(c.level)},i.switchLevel=function(l){var c=this.hls.levels[l];if(!(c!=null&&c.textGroupIds))return;var d=c.textGroupIds[c.urlId];if(this.groupId!==d){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(v){return!d||v.groupId===d});this.tracksInGroup=m;var S=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=d;var C={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,C),S!==-1&&this.setSubtitleTrack(S,w)}},i.findTrackId=function(l){for(var c=this.tracksInGroup,d=0;d<c.length;d++){var w=c[d];if((!this.selectDefaultTrack||w.default)&&(!l||l===w.name))return w.id}return-1},i.onError=function(l,c){if(n.prototype.onError.call(this,l,c),c.fatal||!c.context)return;c.context.type===E.PlaylistContextType.SUBTITLE_TRACK&&c.context.id===this.trackId&&c.context.groupId===this.groupId&&this.retryLoadingOrFail(c)},i.loadPlaylist=function(l){var c=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(c)){var d=c.id,w=c.groupId,m=c.url;if(l)try{m=l.addDirectives(m)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADING,{url:m,id:d,groupId:w,deliveryDirectives:l||null})}},i.toggleTrackModes=function(l){var c=this,d=this.media,w=this.subtitleDisplay,m=this.trackId;if(!d)return;var S=r(d.textTracks),C=S.filter(function(T){return T.groupId===c.groupId});if(l===-1)[].slice.call(S).forEach(function(T){T.mode="disabled"});else{var v=C[m];v&&(v.mode="disabled")}var y=C[l];y&&(y.mode=w?"showing":"hidden")},i.setSubtitleTrack=function(l,c){var d,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=l;return}if(this.trackId!==l&&this.toggleTrackModes(l),this.trackId===l&&(l===-1||(d=w[l])!==null&&d!==void 0&&d.details)||l<-1||l>=w.length)return;this.clearTimer();var m=w[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,m){var S=m.id,C=m.groupId,v=C===void 0?"":C,y=m.name,T=m.type,A=m.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:v,name:y,type:T,url:A});var p=this.switchParams(m.url,c==null?void 0:c.details);this.loadPlaylist(p)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:l})},i.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,c=r(this.media.textTracks),d=0;d<c.length;d++)if(c[d].mode==="hidden")l=d;else if(c[d].mode==="showing"){l=d;break}this.subtitleTrack!==l&&(this.subtitleTrack=l)},g(t,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1;var c=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(l,c)}}]),t}(f.default);function r(n){for(var t=[],i=0;i<n.length;i++){var s=n[i];s.kind==="subtitles"&&s.label&&t.push(n[i])}return t}L.default=u},"./src/controller/timeline-controller.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"TimelineController",function(){return r});var k=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),f=I("./src/utils/cea-608-parser.ts"),E=I("./src/utils/output-filter.ts"),x=I("./src/utils/webvtt-parser.ts"),g=I("./src/utils/texttrack-utils.ts"),h=I("./src/utils/imsc1-ttml-parser.ts"),o=I("./src/types/loader.ts"),u=I("./src/utils/logger.ts"),r=function(){function s(c){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=i(),this.captionsProperties=void 0,this.hls=c,this.config=c.config,this.Cues=c.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new E.default(this,"textTrack1"),w=new E.default(this,"textTrack2"),m=new E.default(this,"textTrack3"),S=new E.default(this,"textTrack4");this.cea608Parser1=new f.default(1,d,w),this.cea608Parser2=new f.default(3,m,S)}c.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.on(M.Events.FRAG_LOADING,this.onFragLoading,this),c.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.on(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var l=s.prototype;return l.destroy=function(){var d=this.hls;d.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(M.Events.FRAG_LOADING,this.onFragLoading,this),d.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},l.addCues=function(d,w,m,S,C){for(var v=!1,y=C.length;y--;){var T=C[y],A=t(T[0],T[1],w,m);if(A>=0&&(T[0]=Math.min(T[0],w),T[1]=Math.max(T[1],m),v=!0,A/(m-w)>.5))return}if(v||C.push([w,m]),this.config.renderTextTracksNatively){var p=this.captionsTracks[d];this.Cues.newCue(p,w,m,S)}else{var D=this.Cues.newCue(null,w,m,S);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:D,track:d})}},l.onInitPtsFound=function(d,w){var m=this,S=w.frag,C=w.id,v=w.initPTS,y=w.timescale,T=this.unparsedVttFrags;C==="main"&&(this.initPTS[S.cc]=v,this.timescale[S.cc]=y),T.length&&(this.unparsedVttFrags=[],T.forEach(function(A){m.onFragLoaded(M.Events.FRAG_LOADED,A)}))},l.getExistingTrack=function(d){var w=this.media;if(w)for(var m=0;m<w.textTracks.length;m++){var S=w.textTracks[m];if(S[d])return S}return null},l.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},l.createNativeTrack=function(d){if(this.captionsTracks[d])return;var w=this.captionsProperties,m=this.captionsTracks,S=this.media,C=w[d],v=C.label,y=C.languageCode,T=this.getExistingTrack(d);if(T)m[d]=T,Object(g.clearCurrentCues)(m[d]),Object(g.sendAddTrackEvent)(m[d],S);else{var A=this.createTextTrack("captions",v,y);A&&(A[d]=!0,m[d]=A)}},l.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var w=this.captionsProperties[d];if(!w)return;var m=w.label,S={_id:d,label:m,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[d]=S,this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},l.createTextTrack=function(d,w,m){var S=this.media;return S?S.addTextTrack(d,w,m):void 0},l.onMediaAttaching=function(d,w){this.media=w.media,this._cleanTracks()},l.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(w){Object(g.clearCurrentCues)(d[w]),delete d[w]}),this.nonNativeCaptionsTracks={}},l.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=i(),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())},l._cleanTracks=function(){var d=this.media;if(!d)return;var w=d.textTracks;if(w)for(var m=0;m<w.length;m++)Object(g.clearCurrentCues)(w[m])},l.onSubtitleTracksUpdated=function(d,w){var m=this;this.textTracks=[];var S=w.subtitleTracks||[],C=S.some(function(A){return A.textCodec===h.IMSC1_CODEC});if(this.config.enableWebVTT||C&&this.config.enableIMSC1){var v=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(A,p){var D;if(p<y.length){for(var O=null,P=0;P<y.length;P++)if(n(y[P],A)){O=y[P];break}O&&(D=O)}D?Object(g.clearCurrentCues)(D):(D=m.createTextTrack("subtitles",A.name,A.lang),D&&(D.mode="disabled")),D&&(D.groupId=A.groupId,m.textTracks.push(D))})}else if(!v&&this.tracks&&this.tracks.length){var T=this.tracks.map(function(A){return{label:A.name,kind:A.type.toLowerCase(),default:A.default,subtitleTrack:A}});this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}},l.onManifestLoaded=function(d,w){var m=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(S){var C=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!C)return;var v="textTrack"+C[1],y=m.captionsProperties[v];if(!y)return;y.label=S.name,S.lang&&(y.languageCode=S.lang),y.media=S})},l.onFragLoading=function(d,w){var m=this.cea608Parser1,S=this.cea608Parser2,C=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(m&&S))return;if(w.frag.type===o.PlaylistLevelType.MAIN){var y,T,A=w.frag.sn,p=(y=w==null||((T=w.part)===null||T===void 0)?void 0:T.index)!=null?y:-1;A===C+1||A===C&&p===v+1||(m.reset(),S.reset()),this.lastSn=A,this.lastPartIndex=p}},l.onFragLoaded=function(d,w){var m=w.frag,S=w.payload,C=this.initPTS,v=this.unparsedVttFrags;if(m.type===o.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(k.isFiniteNumber)(C[m.cc])){v.push(w),C.length&&this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var y=m.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var T=this.tracks[m.level],A=this.vttCCs;A[m.cc]||(A[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),T&&T.textCodec===h.IMSC1_CODEC?this._parseIMSC1(m,S):this._parseVTTs(m,S,A)}}else this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},l._parseIMSC1=function(d,w){var m=this,S=this.hls;Object(h.parseIMSC1)(w,this.initPTS[d.cc],this.timescale[d.cc],function(C){m._appendCues(C,d.level),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(C){u.logger.log("Failed to parse IMSC1: "+C),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:C})})},l._parseVTTs=function(d,w,m){var S=this,C=this.hls;Object(x.parseWebVTT)(w,this.initPTS[d.cc],this.timescale[d.cc],m,d.cc,d.start,function(v){S._appendCues(v,d.level),C.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(v){S._fallbackToIMSC1(d,w),u.logger.log("Failed to parse VTT cue: "+v),C.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:v})})},l._fallbackToIMSC1=function(d,w){var m=this,S=this.tracks[d.level];S.textCodec||Object(h.parseIMSC1)(w,this.initPTS[d.cc],this.timescale[d.cc],function(){S.textCodec=h.IMSC1_CODEC,m._parseIMSC1(d,w)},function(){S.textCodec="wvtt"})},l._appendCues=function(d,w){var m=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[w];if(S.mode==="disabled")return;d.forEach(function(y){return Object(g.addCueToTrack)(S,y)})}else{var C=this.tracks[w],v=C.default?"default":"subtitles"+w;m.trigger(M.Events.CUES_PARSED,{type:"subtitles",cues:d,track:v})}},l.onFragDecrypted=function(d,w){var m=w.frag;if(m.type===o.PlaylistLevelType.SUBTITLE){if(!Object(k.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(M.Events.FRAG_LOADED,w)}},l.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},l.onFragParsingUserdata=function(d,w){var m=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(m&&S))return;for(var C=0;C<w.samples.length;C++){var v=w.samples[C].bytes;if(v){var y=this.extractCea608Data(v);m.addData(w.samples[C].pts,y[0]),S.addData(w.samples[C].pts,y[1])}}},l.onBufferFlushing=function(d,w){var m=w.startOffset,S=w.endOffset,C=w.endOffsetSubtitles,v=w.type,y=this.media;if(!y||y.currentTime<S)return;if(!v||v==="video"){var T=this.captionsTracks;Object.keys(T).forEach(function(p){return Object(g.removeCuesInRange)(T[p],m,S)})}if(this.config.renderTextTracksNatively&&(m===0&&C!==void 0)){var A=this.textTracks;Object.keys(A).forEach(function(p){return Object(g.removeCuesInRange)(A[p],m,C)})}},l.extractCea608Data=function(d){for(var w=d[0]&31,m=2,S=[[],[]],C=0;C<w;C++){var v=d[m++],y=127&d[m++],T=127&d[m++],A=(4&v)!==0,p=3&v;if(y===0&&T===0)continue;A&&((p===0||p===1)&&(S[p].push(y),S[p].push(T)))}return S},s}();function n(s,l){return s&&s.label===l.name&&!(s.textTrack1||s.textTrack2)}function t(s,l,c,d){return Math.min(l,d)-Math.max(s,c)}function i(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return k});var k=function(){function M(E,x){this.subtle=void 0,this.aesIV=void 0,this.subtle=E,this.aesIV=x}var f=M.prototype;return f.decrypt=function(x,g){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},g,x)},M}()},"./src/crypt/aes-decryptor.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"removePadding",function(){return M}),I.d(L,"default",function(){return f});var k=I("./src/utils/typed-array.ts");function M(E){var x=E.byteLength,g=x&&new DataView(E.buffer).getUint8(x-1);return g?Object(k.sliceUint8)(E,0,x-g):E}var f=function(){function E(){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 x=E.prototype;return x.uint8ArrayToUint32Array_=function(h){for(var o=new DataView(h),u=new Uint32Array(4),r=0;r<4;r++)u[r]=o.getUint32(r*4);return u},x.initTable=function(){var h=this.sBox,o=this.invSBox,u=this.subMix,r=u[0],n=u[1],t=u[2],i=u[3],s=this.invSubMix,l=s[0],c=s[1],d=s[2],w=s[3],m=new Uint32Array(256),S=0,C=0,v=0;for(v=0;v<256;v++)v<128?m[v]=v<<1:m[v]=v<<1^283;for(v=0;v<256;v++){var y=C^C<<1^C<<2^C<<3^C<<4;y=y>>>8^y&255^99,h[S]=y,o[y]=S;var T=m[S],A=m[T],p=m[A],D=m[y]*257^y*16843008;r[S]=D<<24|D>>>8,n[S]=D<<16|D>>>16,t[S]=D<<8|D>>>24,i[S]=D,D=p*16843009^A*65537^T*257^S*16843008,l[y]=D<<24|D>>>8,c[y]=D<<16|D>>>16,d[y]=D<<8|D>>>24,w[y]=D,S?(S=T^m[m[m[p^T]]],C^=m[m[C]]):S=C=1}},x.expandKey=function(h){for(var o=this.uint8ArrayToUint32Array_(h),u=!0,r=0;r<o.length&&u;)u=o[r]===this.key[r],r++;if(u)return;this.key=o;var n=this.keySize=o.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);var t=this.ksRows=(n+6+1)*4,i,s,l=this.keySchedule=new Uint32Array(t),c=this.invKeySchedule=new Uint32Array(t),d=this.sBox,w=this.rcon,m=this.invSubMix,S=m[0],C=m[1],v=m[2],y=m[3],T,A;for(i=0;i<t;i++){if(i<n){T=l[i]=o[i];continue}A=T,i%n===0?(A=A<<8|A>>>24,A=d[A>>>24]<<24|d[A>>>16&255]<<16|d[A>>>8&255]<<8|d[A&255],A^=w[i/n|0]<<24):n>6&&i%n===4&&(A=d[A>>>24]<<24|d[A>>>16&255]<<16|d[A>>>8&255]<<8|d[A&255]),l[i]=T=(l[i-n]^A)>>>0}for(s=0;s<t;s++)i=t-s,s&3?A=l[i]:A=l[i-4],s<4||i<=4?c[s]=A:c[s]=S[d[A>>>24]]^C[d[A>>>16&255]]^v[d[A>>>8&255]]^y[d[A&255]],c[s]=c[s]>>>0},x.networkToHostOrderSwap=function(h){return h<<24|(h&65280)<<8|(h&16711680)>>8|h>>>24},x.decrypt=function(h,o,u){for(var r=this.keySize+6,n=this.invKeySchedule,t=this.invSBox,i=this.invSubMix,s=i[0],l=i[1],c=i[2],d=i[3],w=this.uint8ArrayToUint32Array_(u),m=w[0],S=w[1],C=w[2],v=w[3],y=new Int32Array(h),T=new Int32Array(y.length),A,p,D,O,P,j,K,U,X,B,N,z,te,ce,be=this.networkToHostOrderSwap;o<y.length;){for(X=be(y[o]),B=be(y[o+1]),N=be(y[o+2]),z=be(y[o+3]),P=X^n[0],j=z^n[1],K=N^n[2],U=B^n[3],te=4,ce=1;ce<r;ce++)A=s[P>>>24]^l[j>>16&255]^c[K>>8&255]^d[U&255]^n[te],p=s[j>>>24]^l[K>>16&255]^c[U>>8&255]^d[P&255]^n[te+1],D=s[K>>>24]^l[U>>16&255]^c[P>>8&255]^d[j&255]^n[te+2],O=s[U>>>24]^l[P>>16&255]^c[j>>8&255]^d[K&255]^n[te+3],P=A,j=p,K=D,U=O,te=te+4;A=t[P>>>24]<<24^t[j>>16&255]<<16^t[K>>8&255]<<8^t[U&255]^n[te],p=t[j>>>24]<<24^t[K>>16&255]<<16^t[U>>8&255]<<8^t[P&255]^n[te+1],D=t[K>>>24]<<24^t[U>>16&255]<<16^t[P>>8&255]<<8^t[j&255]^n[te+2],O=t[U>>>24]<<24^t[P>>16&255]<<16^t[j>>8&255]<<8^t[K&255]^n[te+3],T[o]=be(A^m),T[o+1]=be(O^S),T[o+2]=be(D^C),T[o+3]=be(p^v),m=X,S=B,C=N,v=z,o=o+4}return T.buffer},E}()},"./src/crypt/decrypter.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return o});var k=I("./src/crypt/aes-crypto.ts"),M=I("./src/crypt/fast-aes-key.ts"),f=I("./src/crypt/aes-decryptor.ts"),E=I("./src/utils/logger.ts"),x=I("./src/utils/mp4-tools.ts"),g=I("./src/utils/typed-array.ts"),h=16,o=function(){function u(n,t,i){var s=i===void 0?{}:i,l=s.removePKCS7Padding,c=l===void 0?!0:l;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=n,this.config=t,this.removePKCS7Padding=c,c)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var r=u.prototype;return r.destroy=function(){this.observer=null},r.isSync=function(){return this.config.enableSoftwareAES},r.flush=function(){var t=this.currentResult;if(!t){this.reset();return}var i=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?Object(f.removePadding)(i):i},r.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},r.decrypt=function(t,i,s,l){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),i,s);var c=this.flush();c&&l(c.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),i,s).then(l)},r.softwareDecrypt=function(t,i,s){var l=this.currentIV,c=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(t=Object(x.appendUint8Array)(d,t),this.remainderData=null);var w=this.getValidChunk(t);if(!w.length)return null;l&&(s=l);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new f.default),m.expandKey(i);var S=c;return this.currentResult=m.decrypt(w.buffer,0,s),this.currentIV=Object(g.sliceUint8)(w,-16).buffer,S||null},r.webCryptoDecrypt=function(t,i,s){var l=this,c=this.subtle;return(this.key!==i||!this.fastAesKey)&&(this.key=i,this.fastAesKey=new M.default(c,i)),this.fastAesKey.expandKey().then(function(d){if(!c)return Promise.reject(new Error("web crypto not initialized"));var w=new k.default(c,s);return w.decrypt(t.buffer,d)}).catch(function(d){return l.onWebCryptoError(d,t,i,s)})},r.onWebCryptoError=function(t,i,s,l){return E.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(i,s,l)},r.getValidChunk=function(t){var i=t,s=t.length-t.length%h;return s!==t.length&&(i=Object(g.sliceUint8)(t,0,s),this.remainderData=Object(g.sliceUint8)(t,s)),i},r.logOnce=function(t){if(!this.logEnabled)return;E.logger.log("[decrypter.ts]: "+t),this.logEnabled=!1},u}()},"./src/crypt/fast-aes-key.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return k});var k=function(){function M(E,x){this.subtle=void 0,this.key=void 0,this.subtle=E,this.key=x}var f=M.prototype;return f.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},M}()},"./src/demux/aacdemuxer.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/adts.ts"),f=I("./src/utils/logger.ts"),E=I("./src/demux/id3.ts");function x(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,g(o,u)}function g(o,u){return g=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},g(o,u)}var h=function(o){x(u,o);function u(n,t){var i;return i=o.call(this)||this,i.observer=void 0,i.config=void 0,i.observer=n,i.config=t,i}var r=u.prototype;return r.resetInitSegment=function(t,i,s){o.prototype.resetInitSegment.call(this,t,i,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},u.probe=function(t){if(!t)return!1;for(var i=E.getID3Data(t,0)||[],s=i.length,l=t.length;s<l;s++)if(M.probe(t,s))return f.logger.log("ADTS sync word found !"),!0;return!1},r.canParse=function(t,i){return M.canParse(t,i)},r.appendFrame=function(t,i,s){M.initTrackConfig(t,this.observer,i,s,t.manifestCodec);var l=M.appendFrame(t,i,s,this.initPTS,this.frameIndex);if(l&&l.missing===0)return l},u}(k.default);h.minProbeByteLength=9,L.default=h},"./src/demux/adts.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"getAudioConfig",function(){return E}),I.d(L,"isHeaderPattern",function(){return x}),I.d(L,"getHeaderLength",function(){return g}),I.d(L,"getFullFrameLength",function(){return h}),I.d(L,"canGetFrameLength",function(){return o}),I.d(L,"isHeader",function(){return u}),I.d(L,"canParse",function(){return r}),I.d(L,"probe",function(){return n}),I.d(L,"initTrackConfig",function(){return t}),I.d(L,"getFrameDuration",function(){return i}),I.d(L,"parseFrameHeader",function(){return s}),I.d(L,"appendFrame",function(){return l});var k=I("./src/utils/logger.ts"),M=I("./src/errors.ts"),f=I("./src/events.ts");function E(c,d,w,m){var S,C,v,y,T=navigator.userAgent.toLowerCase(),A=m,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((d[w+2]&192)>>>6)+1;var D=(d[w+2]&60)>>>2;if(D>p.length-1){c.trigger(f.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+D});return}return v=(d[w+2]&1)<<2,v|=(d[w+3]&192)>>>6,k.logger.log("manifest codec:"+m+", ADTS type:"+S+", samplingIndex:"+D),/firefox/i.test(T)?D>=6?(S=5,y=new Array(4),C=D-3):(S=2,y=new Array(2),C=D):T.indexOf("android")!==-1?(S=2,y=new Array(2),C=D):(S=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&D>=6?C=D-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(D>=6&&v===1||/vivaldi/i.test(T))||!m&&v===1)&&(S=2,y=new Array(2)),C=D)),y[0]=S<<3,y[0]|=(D&14)>>1,y[1]|=(D&1)<<7,y[1]|=v<<3,S===5&&(y[1]|=(C&14)>>1,y[2]=(C&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:p[D],channelCount:v,codec:"mp4a.40."+S,manifestCodec:A}}function x(c,d){return c[d]===255&&(c[d+1]&246)===240}function g(c,d){return c[d+1]&1?7:9}function h(c,d){return(c[d+3]&3)<<11|c[d+4]<<3|(c[d+5]&224)>>>5}function o(c,d){return d+5<c.length}function u(c,d){return d+1<c.length&&x(c,d)}function r(c,d){return o(c,d)&&x(c,d)&&h(c,d)<=c.length-d}function n(c,d){if(u(c,d)){var w=g(c,d);if(d+w>=c.length)return!1;var m=h(c,d);if(m<=w)return!1;var S=d+m;return S===c.length||u(c,S)}return!1}function t(c,d,w,m,S){if(!c.samplerate){var C=E(d,w,m,S);if(!C)return;c.config=C.config,c.samplerate=C.samplerate,c.channelCount=C.channelCount,c.codec=C.codec,c.manifestCodec=C.manifestCodec,k.logger.log("parsed codec:"+c.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function i(c){return 1024*9e4/c}function s(c,d,w,m,S){var C=g(c,d),v=h(c,d);if(v-=C,v>0){var y=w+m*S;return{headerLength:C,frameLength:v,stamp:y}}}function l(c,d,w,m,S){var C=i(c.samplerate),v=s(d,w,m,S,C);if(v){var y=v.frameLength,T=v.headerLength,A=v.stamp,p=T+y,D=Math.max(0,w+p-d.length),O;D?(O=new Uint8Array(p-T),O.set(d.subarray(w+T,d.length),0)):O=d.subarray(w+T,w+p);var P={unit:O,pts:A};return D||c.samples.push(P),{sample:P,length:p,missing:D}}}},"./src/demux/base-audio-demuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"initPTSFn",function(){return h});var k=I("./src/polyfills/number.ts"),M=I("./src/demux/id3.ts"),f=I("./src/demux/dummy-demuxed-track.ts"),E=I("./src/utils/mp4-tools.ts"),x=I("./src/utils/typed-array.ts"),g=function(){function o(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var u=o.prototype;return u.resetInitSegment=function(n,t,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},u.resetTimeStamp=function(){},u.resetContiguity=function(){},u.canParse=function(n,t){return!1},u.appendFrame=function(n,t,i){},u.demux=function(n,t){this.cachedData&&(n=Object(E.appendUint8Array)(this.cachedData,n),this.cachedData=null);var i=M.getID3Data(n,0),s=i?i.length:0,l,c,d=this._audioTrack,w=this._id3Track,m=i?M.getTimeStamp(i):void 0,S=n.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=h(m,t)),i&&i.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:i}),c=this.initPTS;s<S;){if(this.canParse(n,s)){var C=this.appendFrame(d,n,s);C?(this.frameIndex++,c=C.sample.pts,s+=C.length,l=s):s=S}else M.canParse(n,s)?(i=M.getID3Data(n,s),w.samples.push({pts:c,dts:c,data:i}),s+=i.length,l=s):s++;if(s===S&&l!==S){var v=Object(x.sliceUint8)(n,l);this.cachedData?this.cachedData=Object(E.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:d,avcTrack:Object(f.dummyTrack)(),id3Track:w,textTrack:Object(f.dummyTrack)()}},u.demuxSampleAes=function(n,t,i){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},u.flush=function(n){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(f.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(f.dummyTrack)()}},u.destroy=function(){},o}(),h=function(u,r){return Object(k.isFiniteNumber)(u)?u*90:r*9e4};L.default=g},"./src/demux/chunk-cache.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return k});var k=function(){function f(){this.chunks=[],this.dataLength=0}var E=f.prototype;return E.push=function(g){this.chunks.push(g),this.dataLength+=g.length},E.flush=function(){var g=this.chunks,h=this.dataLength,o;if(g.length)g.length===1?o=g[0]:o=M(g,h);else return new Uint8Array(0);return this.reset(),o},E.reset=function(){this.chunks.length=0,this.dataLength=0},f}();function M(f,E){for(var x=new Uint8Array(E),g=0,h=0;h<f.length;h++){var o=f[h];x.set(o,g),g+=o.length}return x}},"./src/demux/dummy-demuxed-track.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"dummyTrack",function(){return k});function k(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/utils/logger.ts"),M=function(){function f(x){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=x,this.bytesAvailable=x.byteLength,this.word=0,this.bitsAvailable=0}var E=f.prototype;return E.loadWord=function(){var g=this.data,h=this.bytesAvailable,o=g.byteLength-h,u=new Uint8Array(4),r=Math.min(4,h);if(r===0)throw new Error("no bytes available");u.set(g.subarray(o,o+r)),this.word=new DataView(u.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r},E.skipBits=function(g){var h;this.bitsAvailable>g?(this.word<<=g,this.bitsAvailable-=g):(g-=this.bitsAvailable,h=g>>3,g-=h>>3,this.bytesAvailable-=h,this.loadWord(),this.word<<=g,this.bitsAvailable-=g)},E.readBits=function(g){var h=Math.min(this.bitsAvailable,g),o=this.word>>>32-h;return g>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=h,this.bitsAvailable>0?this.word<<=h:this.bytesAvailable>0&&this.loadWord(),h=g-h,h>0&&this.bitsAvailable?o<<h|this.readBits(h):o},E.skipLZ=function(){var g;for(g=0;g<this.bitsAvailable;++g)if((this.word&2147483648>>>g)!==0)return this.word<<=g,this.bitsAvailable-=g,g;return this.loadWord(),g+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var g=this.skipLZ();return this.readBits(g+1)-1},E.readEG=function(){var g=this.readUEG();return 1&g?1+g>>>1:-1*(g>>>1)},E.readBoolean=function(){return this.readBits(1)===1},E.readUByte=function(){return this.readBits(8)},E.readUShort=function(){return this.readBits(16)},E.readUInt=function(){return this.readBits(32)},E.skipScalingList=function(g){for(var h=8,o=8,u,r=0;r<g;r++)o!==0&&(u=this.readEG(),o=(h+u+256)%256),h=o===0?h:o},E.readSPS=function(){var g=0,h=0,o=0,u=0,r,n,t,i=this.readUByte.bind(this),s=this.readBits.bind(this),l=this.readUEG.bind(this),c=this.readBoolean.bind(this),d=this.skipBits.bind(this),w=this.skipEG.bind(this),m=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);i();var C=i();if(s(5),d(3),i(),m(),C===100||C===110||C===122||C===244||C===44||C===83||C===86||C===118||C===128){var v=l();if(v===3&&d(1),m(),m(),d(1),c())for(n=v!==3?8:12,t=0;t<n;t++)c()&&(t<6?S(16):S(64))}m();var y=l();if(y===0)l();else if(y===1)for(d(1),w(),w(),r=l(),t=0;t<r;t++)w();m(),d(1);var T=l(),A=l(),p=s(1);p===0&&d(1),d(1),c()&&(g=l(),h=l(),o=l(),u=l());var D=[1,1];if(c()&&c()){var O=i();switch(O){case 1:D=[1,1];break;case 2:D=[12,11];break;case 3:D=[10,11];break;case 4:D=[16,11];break;case 5:D=[40,33];break;case 6:D=[24,11];break;case 7:D=[20,11];break;case 8:D=[32,11];break;case 9:D=[80,33];break;case 10:D=[18,11];break;case 11:D=[15,11];break;case 12:D=[64,33];break;case 13:D=[160,99];break;case 14:D=[4,3];break;case 15:D=[3,2];break;case 16:D=[2,1];break;case 255:{D=[i()<<8|i(),i()<<8|i()];break}}}return{width:Math.ceil((T+1)*16-g*2-h*2),height:(2-p)*(A+1)*16-(p?2:4)*(o+u),pixelRatio:D}},E.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},f}();L.default=M},"./src/demux/id3.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"isHeader",function(){return k}),I.d(L,"isFooter",function(){return M}),I.d(L,"getID3Data",function(){return f}),I.d(L,"canParse",function(){return x}),I.d(L,"getTimeStamp",function(){return g}),I.d(L,"isTimeStampFrame",function(){return h}),I.d(L,"getID3Frames",function(){return u}),I.d(L,"decodeFrame",function(){return r}),I.d(L,"utf8ArrayToStr",function(){return l}),I.d(L,"testables",function(){return c});var k=function(S,C){return C+10<=S.length&&(S[C]===73&&S[C+1]===68&&S[C+2]===51&&(S[C+3]<255&&S[C+4]<255&&(S[C+6]<128&&S[C+7]<128&&S[C+8]<128&&S[C+9]<128)))},M=function(S,C){return C+10<=S.length&&(S[C]===51&&S[C+1]===68&&S[C+2]===73&&(S[C+3]<255&&S[C+4]<255&&(S[C+6]<128&&S[C+7]<128&&S[C+8]<128&&S[C+9]<128)))},f=function(S,C){for(var v=C,y=0;k(S,C);){y+=10;var T=E(S,C+6);y+=T,M(S,C+10)&&(y+=10),C+=y}return y>0?S.subarray(v,v+y):void 0},E=function(S,C){var v=0;return v=(S[C]&127)<<21,v|=(S[C+1]&127)<<14,v|=(S[C+2]&127)<<7,v|=S[C+3]&127,v},x=function(S,C){return k(S,C)&&E(S,C+6)+10<=S.length-C},g=function(S){for(var C=u(S),v=0;v<C.length;v++){var y=C[v];if(h(y))return s(y)}return},h=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},o=function(S){var C=String.fromCharCode(S[0],S[1],S[2],S[3]),v=E(S,4),y=10;return{type:C,size:v,data:S.subarray(y,y+v)}},u=function(S){for(var C=0,v=[];k(S,C);){var y=E(S,C+6);C+=10;for(var T=C+y;C+8<T;){var A=o(S.subarray(C)),p=r(A);p&&v.push(p),C+=A.size+10}M(S,C)&&(C+=10)}return v},r=function(S){return S.type==="PRIV"?n(S):S.type[0]==="W"?i(S):t(S)},n=function(S){if(S.size<2)return;var C=l(S.data,!0),v=new Uint8Array(S.data.subarray(C.length+1));return{key:S.type,info:C,data:v.buffer}},t=function(S){if(S.size<2)return;if(S.type==="TXXX"){var C=1,v=l(S.data.subarray(C),!0);C+=v.length+1;var y=l(S.data.subarray(C));return{key:S.type,info:v,data:y}}var T=l(S.data.subarray(1));return{key:S.type,data:T}},i=function(S){if(S.type==="WXXX"){if(S.size<2)return;var C=1,v=l(S.data.subarray(C),!0);C+=v.length+1;var y=l(S.data.subarray(C));return{key:S.type,info:v,data:y}}var T=l(S.data);return{key:S.type,data:T}},s=function(S){if(S.data.byteLength===8){var C=new Uint8Array(S.data),v=C[3]&1,y=(C[4]<<23)+(C[5]<<15)+(C[6]<<7)+C[7];return y/=45,v&&(y+=4772185884e-2),Math.round(y)}return},l=function(S,C){C===void 0&&(C=!1);var v=w();if(v){var y=v.decode(S);if(C){var T=y.indexOf("\0");return T!==-1?y.substring(0,T):y}return y.replace(/\0/g,"")}for(var A=S.length,p,D,O,P="",j=0;j<A;){if(p=S[j++],p===0&&C)return P;if(p===0||p===3)continue;switch(p>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(p);break;case 12:case 13:D=S[j++],P+=String.fromCharCode((p&31)<<6|D&63);break;case 14:D=S[j++],O=S[j++],P+=String.fromCharCode((p&15)<<12|(D&63)<<6|(O&63)<<0);break;default:}}return P},c={decodeTextFrame:t},d;function w(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/demux/base-audio-demuxer.ts"),M=I("./src/demux/id3.ts"),f=I("./src/utils/logger.ts"),E=I("./src/demux/mpegaudio.ts");function x(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,g(o,u)}function g(o,u){return g=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n},g(o,u)}var h=function(o){x(u,o);function u(){return o.apply(this,arguments)||this}var r=u.prototype;return r.resetInitSegment=function(t,i,s){o.prototype.resetInitSegment.call(this,t,i,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}},u.probe=function(t){if(!t)return!1;for(var i=M.getID3Data(t,0)||[],s=i.length,l=t.length;s<l;s++)if(E.probe(t,s))return f.logger.log("MPEG Audio sync word found !"),!0;return!1},r.canParse=function(t,i){return E.canParse(t,i)},r.appendFrame=function(t,i,s){return this.initPTS===null?void 0:E.appendFrame(t,i,s,this.initPTS,this.frameIndex)},u}(k.default);h.minProbeByteLength=4,L.default=h},"./src/demux/mp4demuxer.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/utils/mp4-tools.ts"),M=I("./src/demux/dummy-demuxed-track.ts"),f=function(){function E(g,h){this.remainderData=null,this.config=void 0,this.config=h}var x=E.prototype;return x.resetTimeStamp=function(){},x.resetInitSegment=function(){},x.resetContiguity=function(){},E.probe=function(h){return Object(k.findBox)({data:h,start:0,end:Math.min(h.length,16384)},["moof"]).length>0},x.demux=function(h){var o=h,u=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(o=Object(k.appendUint8Array)(this.remainderData,h));var r=Object(k.segmentValidRange)(o);this.remainderData=r.remainder,u.samples=r.valid||new Uint8Array}else u.samples=o;return{audioTrack:Object(M.dummyTrack)(),avcTrack:u,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},x.flush=function(){var h=Object(M.dummyTrack)();return h.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:h,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},x.demuxSampleAes=function(h,o,u){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},x.destroy=function(){},E}();f.minProbeByteLength=1024,L.default=f},"./src/demux/mpegaudio.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"appendFrame",function(){return g}),I.d(L,"parseHeader",function(){return h}),I.d(L,"isHeaderPattern",function(){return o}),I.d(L,"isHeader",function(){return u}),I.d(L,"canParse",function(){return r}),I.d(L,"probe",function(){return n});var k=null,M=[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],f=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],E=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],x=[0,1,1,4];function g(t,i,s,l,c){if(s+24>i.length)return;var d=h(i,s);if(d&&s+d.frameLength<=i.length){var w=d.samplesPerFrame*9e4/d.sampleRate,m=l+c*w,S={unit:i.subarray(s,s+d.frameLength),pts:m,dts:m};return t.config=[],t.channelCount=d.channelCount,t.samplerate=d.sampleRate,t.samples.push(S),{sample:S,length:d.frameLength,missing:0}}}function h(t,i){var s=t[i+1]>>3&3,l=t[i+1]>>1&3,c=t[i+2]>>4&15,d=t[i+2]>>2&3;if(s!==1&&c!==0&&c!==15&&d!==3){var w=t[i+2]>>1&1,m=t[i+3]>>6,S=s===3?3-l:l===3?3:4,C=M[S*14+c-1]*1e3,v=s===3?0:s===2?1:2,y=f[v*3+d],T=m===3?1:2,A=E[s][l],p=x[l],D=A*8*p,O=Math.floor(A*C/y+w)*p;if(k===null){var P=navigator.userAgent||"",j=P.match(/Chrome\/(\d+)/i);k=j?parseInt(j[1]):0}var K=!!k&&k<=87;return K&&l===2&&C>=224e3&&m===0&&(t[i+3]=t[i+3]|128),{sampleRate:y,channelCount:T,frameLength:O,samplesPerFrame:D}}}function o(t,i){return t[i]===255&&(t[i+1]&224)===224&&(t[i+1]&6)!==0}function u(t,i){return i+1<t.length&&o(t,i)}function r(t,i){var s=4;return o(t,i)&&s<=t.length-i}function n(t,i){if(i+1<t.length&&o(t,i)){var s=4,l=h(t,i),c=s;l!=null&&l.frameLength&&(c=l.frameLength);var d=i+c;return d===t.length||u(t,d)}return!1}},"./src/demux/sample-aes.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/crypt/decrypter.ts"),M=I("./src/demux/tsdemuxer.ts"),f=function(){function E(g,h,o){this.keyData=void 0,this.decrypter=void 0,this.keyData=o,this.decrypter=new k.default(g,h,{removePKCS7Padding:!1})}var x=E.prototype;return x.decryptBuffer=function(h,o){this.decrypter.decrypt(h,this.keyData.key.buffer,this.keyData.iv.buffer,o)},x.decryptAacSample=function(h,o,u,r){var n=h[o].unit,t=n.subarray(16,n.length-n.length%16),i=t.buffer.slice(t.byteOffset,t.byteOffset+t.length),s=this;this.decryptBuffer(i,function(l){var c=new Uint8Array(l);n.set(c,16),r||s.decryptAacSamples(h,o+1,u)})},x.decryptAacSamples=function(h,o,u){for(;;o++){if(o>=h.length){u();return}if(h[o].unit.length<32)continue;var r=this.decrypter.isSync();if(this.decryptAacSample(h,o,u,r),!r)return}},x.getAvcEncryptedData=function(h){for(var o=Math.floor((h.length-48)/160)*16+16,u=new Int8Array(o),r=0,n=32;n<=h.length-16;n+=160,r+=16)u.set(h.subarray(n,n+16),r);return u},x.getAvcDecryptedUnit=function(h,o){for(var u=new Uint8Array(o),r=0,n=32;n<=h.length-16;n+=160,r+=16)h.set(u.subarray(r,r+16),n);return h},x.decryptAvcSample=function(h,o,u,r,n,t){var i=Object(M.discardEPB)(n.data),s=this.getAvcEncryptedData(i),l=this;this.decryptBuffer(s.buffer,function(c){n.data=l.getAvcDecryptedUnit(i,c),t||l.decryptAvcSamples(h,o,u+1,r)})},x.decryptAvcSamples=function(h,o,u,r){if(h instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;o++,u=0){if(o>=h.length){r();return}for(var n=h[o].units;!(u>=n.length);u++){var t=n[u];if(t.data.length<=48||t.type!==1&&t.type!==5)continue;var i=this.decrypter.isSync();if(this.decryptAvcSample(h,o,u,r,t,i),!i)return}}},E}();L.default=f},"./src/demux/transmuxer-interface.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n});var k=I("./node_modules/webworkify-webpack/index.js"),M=I.n(k),f=I("./src/events.ts"),E=I("./src/demux/transmuxer.ts"),x=I("./src/utils/logger.ts"),g=I("./src/errors.ts"),h=I("./src/utils/mediasource-helper.ts"),o=I("./node_modules/eventemitter3/index.js"),u=I.n(o),r=Object(h.getMediaSource)()||{isTypeSupported:function(){return!1}},n=function(){function t(s,l,c,d){var w=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=s,this.id=l,this.onTransmuxComplete=c,this.onFlush=d;var m=s.config,S=function(A,p){p=p||{},p.frag=w.frag,p.id=w.id,s.trigger(A,p)};this.observer=new o.EventEmitter,this.observer.on(f.Events.FRAG_DECRYPTED,S),this.observer.on(f.Events.ERROR,S);var C={mp4:r.isTypeSupported("video/mp4"),mpeg:r.isTypeSupported("audio/mpeg"),mp3:r.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){x.logger.log("demuxing in webworker");var y;try{y=this.worker=k("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(T){s.trigger(f.Events.ERROR,{type:g.ErrorTypes.OTHER_ERROR,details:g.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},y.postMessage({cmd:"init",typeSupported:C,vendor:v,id:l,config:JSON.stringify(m)})}catch(T){x.logger.warn("Error in worker:",T),x.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new E.default(this.observer,C,m,v,l),this.worker=null}}else this.transmuxer=new E.default(this.observer,C,m,v,l)}var i=t.prototype;return i.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.terminate(),this.worker=null;else{var c=this.transmuxer;c&&(c.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},i.push=function(l,c,d,w,m,S,C,v,y,T){var A=this;y.transmuxing.start=self.performance.now();var p=this.transmuxer,D=this.worker,O=S?S.start:m.start,P=m.decryptdata,j=this.frag,K=!(j&&m.cc===j.cc),U=!(j&&y.level===j.level),X=j?y.sn-j.sn:-1,B=this.part?y.part-this.part.index:1,N=!U&&(X===1||X===0&&B===1),z=self.performance.now();(U||X||m.stats.parsing.start===0)&&(m.stats.parsing.start=z),S&&(B||!N)&&(S.stats.parsing.start=z);var te=new E.TransmuxState(K,N,v,U,O);if(!N||K){x.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
discontinuity: `+K+`
trackSwitch: `+U+`
contiguous: `+N+`
accurateTimeOffset: `+v+`
timeOffset: `+O);var ce=new E.TransmuxConfig(d,w,c,C,T);this.configureTransmuxer(ce)}if(this.frag=m,this.part=S,D)D.postMessage({cmd:"demux",data:l,decryptdata:P,chunkMeta:y,state:te},l instanceof ArrayBuffer?[l]:[]);else if(p){var be=p.push(l,P,y,te);Object(E.isPromise)(be)?be.then(function(Fe){A.handleTransmuxComplete(Fe)}):this.handleTransmuxComplete(be)}},i.flush=function(l){var c=this;l.transmuxing.start=self.performance.now();var d=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:l});else if(d){var m=d.flush(l);Object(E.isPromise)(m)?m.then(function(S){c.handleFlushResult(S,l)}):this.handleFlushResult(m,l)}},i.handleFlushResult=function(l,c){var d=this;l.forEach(function(w){d.handleTransmuxComplete(w)}),this.onFlush(c)},i.onWorkerMessage=function(l){var c=l.data,d=this.hls;switch(c.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(c.data);break}case"flush":{this.onFlush(c.data);break}default:{c.data=c.data||{},c.data.frag=this.frag,c.data.id=this.id,d.trigger(c.event,c.data);break}}},i.configureTransmuxer=function(l){var c=this.worker,d=this.transmuxer;c?c.postMessage({cmd:"configure",config:l}):d&&d.configure(l)},i.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},t}()},"./src/demux/transmuxer-worker.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return g});var k=I("./src/demux/transmuxer.ts"),M=I("./src/events.ts"),f=I("./src/utils/logger.ts"),E=I("./node_modules/eventemitter3/index.js"),x=I.n(E);function g(n){var t=new E.EventEmitter,i=function(l,c){n.postMessage({event:l,data:c})};t.on(M.Events.FRAG_DECRYPTED,i),t.on(M.Events.ERROR,i),n.addEventListener("message",function(s){var l=s.data;switch(l.cmd){case"init":{var c=JSON.parse(l.config);n.transmuxer=new k.default(t,l.typeSupported,c,l.vendor,l.id),Object(f.enableLogs)(c.debug),i("init",null);break}case"configure":{n.transmuxer.configure(l.config);break}case"demux":{var d=n.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(k.isPromise)(d)?d.then(function(S){h(n,S)}):h(n,d);break}case"flush":{var w=l.chunkMeta,m=n.transmuxer.flush(w);Object(k.isPromise)(m)?m.then(function(S){u(n,S,w)}):u(n,m,w);break}default:break}})}function h(n,t){if(r(t.remuxResult))return;var i=[],s=t.remuxResult,l=s.audio,c=s.video;l&&o(i,l),c&&o(i,c),n.postMessage({event:"transmuxComplete",data:t},i)}function o(n,t){t.data1&&n.push(t.data1.buffer),t.data2&&n.push(t.data2.buffer)}function u(n,t,i){t.forEach(function(s){h(n,s)}),n.postMessage({event:"flush",data:i})}function r(n){return!n.audio&&!n.video&&!n.text&&!n.id3&&!n.initSegment}},"./src/demux/transmuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return c}),I.d(L,"isPromise",function(){return m}),I.d(L,"TransmuxConfig",function(){return S}),I.d(L,"TransmuxState",function(){return C});var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/crypt/decrypter.ts"),E=I("./src/demux/aacdemuxer.ts"),x=I("./src/demux/mp4demuxer.ts"),g=I("./src/demux/tsdemuxer.ts"),h=I("./src/demux/mp3demuxer.ts"),o=I("./src/remux/mp4-remuxer.ts"),u=I("./src/remux/passthrough-remuxer.ts"),r=I("./src/demux/chunk-cache.ts"),n=I("./src/utils/mp4-tools.ts"),t=I("./src/utils/logger.ts"),i;try{i=self.performance.now.bind(self.performance)}catch(v){t.logger.debug("Unable to use Performance API on this environment"),i=self.Date.now}var s=[{demux:g.default,remux:o.default},{demux:x.default,remux:u.default},{demux:E.default,remux:o.default},{demux:h.default,remux:o.default}],l=1024;s.forEach(function(v){var y=v.demux;l=Math.max(l,y.minProbeByteLength)});var c=function(){function v(T,A,p,D,O){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new r.default,this.observer=T,this.typeSupported=A,this.config=p,this.vendor=D,this.id=O}var y=v.prototype;return y.configure=function(A){this.transmuxConfig=A,this.decrypter&&this.decrypter.reset()},y.push=function(A,p,D,O){var P=this,j=D.transmuxing;j.executeStart=i();var K=new Uint8Array(A),U=this.cache,X=this.config,B=this.currentTransmuxState,N=this.transmuxConfig;O&&(this.currentTransmuxState=O);var z=d(K,p);if(z&&z.method==="AES-128"){var te=this.getDecrypter();if(X.enableSoftwareAES){var ce=te.softwareDecrypt(K,z.key.buffer,z.iv.buffer);if(!ce)return j.executeEnd=i(),w(D);K=new Uint8Array(ce)}else return this.decryptionPromise=te.webCryptoDecrypt(K,z.key.buffer,z.iv.buffer).then(function(Ze){var Je=P.push(Ze,null,D);return P.decryptionPromise=null,Je}),this.decryptionPromise}var be=O||B,Fe=be.contiguous,Oe=be.discontinuity,Re=be.trackSwitch,Be=be.accurateTimeOffset,Ke=be.timeOffset,Ae=N.audioCodec,_e=N.videoCodec,le=N.defaultInitPts,Ee=N.duration,pe=N.initSegmentData;if((Oe||Re)&&this.resetInitSegment(pe,Ae,_e,Ee),Oe&&this.resetInitialTimestamp(le),Fe||this.resetContiguity(),this.needsProbing(K,Oe,Re)){if(U.dataLength){var Ge=U.flush();K=Object(n.appendUint8Array)(Ge,K)}this.configureTransmuxer(K,N)}var Ye=this.transmux(K,z,Ke,Be,D),ze=this.currentTransmuxState;return ze.contiguous=!0,ze.discontinuity=!1,ze.trackSwitch=!1,j.executeEnd=i(),Ye},y.flush=function(A){var p=this,D=A.transmuxing;D.executeStart=i();var O=this.decrypter,P=this.cache,j=this.currentTransmuxState,K=this.decryptionPromise;if(K)return K.then(function(){return p.flush(A)});var U=[],X=j.timeOffset;if(O){var B=O.flush();B&&U.push(this.push(B,null,A))}var N=P.dataLength;P.reset();var z=this.demuxer,te=this.remuxer;if(!z||!te)return N>=l&&this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),D.executeEnd=i(),[w(A)];var ce=z.flush(X);return m(ce)?ce.then(function(be){return p.flushRemux(U,be,A),U}):(this.flushRemux(U,ce,A),U)},y.flushRemux=function(A,p,D){var O=p.audioTrack,P=p.avcTrack,j=p.id3Track,K=p.textTrack,U=this.currentTransmuxState,X=U.accurateTimeOffset,B=U.timeOffset;t.logger.log("[transmuxer.ts]: Flushed fragment "+D.sn+(D.part>-1?" p: "+D.part:"")+" of level "+D.level);var N=this.remuxer.remux(O,P,j,K,B,X,!0,this.id);A.push({remuxResult:N,chunkMeta:D}),D.transmuxing.executeEnd=i()},y.resetInitialTimestamp=function(A){var p=this.demuxer,D=this.remuxer;if(!p||!D)return;p.resetTimeStamp(A),D.resetTimeStamp(A)},y.resetContiguity=function(){var A=this.demuxer,p=this.remuxer;if(!A||!p)return;A.resetContiguity(),p.resetNextTimestamp()},y.resetInitSegment=function(A,p,D,O){var P=this.demuxer,j=this.remuxer;if(!P||!j)return;P.resetInitSegment(p,D,O),j.resetInitSegment(A,p,D)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(A,p,D,O,P){var j;return p&&p.method==="SAMPLE-AES"?j=this.transmuxSampleAes(A,p,D,O,P):j=this.transmuxUnencrypted(A,D,O,P),j},y.transmuxUnencrypted=function(A,p,D,O){var P=this.demuxer.demux(A,p,!1,!this.config.progressive),j=P.audioTrack,K=P.avcTrack,U=P.id3Track,X=P.textTrack,B=this.remuxer.remux(j,K,U,X,p,D,!1,this.id);return{remuxResult:B,chunkMeta:O}},y.transmuxSampleAes=function(A,p,D,O,P){var j=this;return this.demuxer.demuxSampleAes(A,p,D).then(function(K){var U=j.remuxer.remux(K.audioTrack,K.avcTrack,K.id3Track,K.textTrack,D,O,!1,j.id);return{remuxResult:U,chunkMeta:P}})},y.configureTransmuxer=function(A,p){for(var D=this.config,O=this.observer,P=this.typeSupported,j=this.vendor,K=p.audioCodec,U=p.defaultInitPts,X=p.duration,B=p.initSegmentData,N=p.videoCodec,z,te=0,ce=s.length;te<ce;te++)if(s[te].demux.probe(A)){z=s[te];break}z||(t.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:x.default,remux:u.default});var be=this.demuxer,Fe=this.remuxer,Oe=z.remux,Re=z.demux;(!Fe||!(Fe instanceof Oe))&&(this.remuxer=new Oe(O,D,P,j)),(!be||!(be instanceof Re))&&(this.demuxer=new Re(O,D,P),this.probe=Re.probe),this.resetInitSegment(B,K,N,X),this.resetInitialTimestamp(U)},y.needsProbing=function(A,p,D){return!this.demuxer||!this.remuxer||p||D},y.getDecrypter=function(){var A=this.decrypter;return A||(A=this.decrypter=new f.default(this.observer,this.config)),A},v}();function d(v,y){var T=null;return v.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(T=y),T}var w=function(y){return{remuxResult:{},chunkMeta:y}};function m(v){return"then"in v&&v.then instanceof Function}var S=function(y,T,A,p,D){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=T,this.initSegmentData=A,this.duration=p,this.defaultInitPts=D},C=function(y,T,A,p,D){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=T,this.accurateTimeOffset=A,this.trackSwitch=p,this.timeOffset=D}},"./src/demux/tsdemuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"discardEPB",function(){return w});var k=I("./src/demux/adts.ts"),M=I("./src/demux/mpegaudio.ts"),f=I("./src/demux/exp-golomb.ts"),E=I("./src/demux/id3.ts"),x=I("./src/demux/sample-aes.ts"),g=I("./src/events.ts"),h=I("./src/utils/mp4-tools.ts"),o=I("./src/utils/logger.ts"),u=I("./src/errors.ts"),r={video:1,audio:2,id3:3,text:4},n=function(){function m(C,v,y){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=C,this.config=v,this.typeSupported=y}m.probe=function(v){var y=m.syncOffset(v);return y<0?!1:(y&&o.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(v){for(var y=Math.min(1e3,v.length-3*188),T=0;T<y;){if(v[T]===71&&v[T+188]===71&&v[T+2*188]===71)return T;T++}return-1},m.createTrack=function(v,y){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:r[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?y:void 0}};var S=m.prototype;return S.resetInitSegment=function(v,y,T){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",T),this._audioTrack=m.createTrack("audio",T),this._id3Track=m.createTrack("id3",T),this._txtTrack=m.createTrack("text",T),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=y,this._duration=T},S.resetTimeStamp=function(){},S.resetContiguity=function(){var v=this._audioTrack,y=this._avcTrack,T=this._id3Track;v&&(v.pesData=null),y&&(y.pesData=null),T&&(T.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(v,y,T,A){T===void 0&&(T=!1),A===void 0&&(A=!1),T||(this.sampleAes=null);var p,D=this._avcTrack,O=this._audioTrack,P=this._id3Track,j=D.pid,K=D.pesData,U=O.pid,X=P.pid,B=O.pesData,N=P.pesData,z=!1,te=this.pmtParsed,ce=this._pmtId,be=v.length;if(this.remainderData&&(v=Object(h.appendUint8Array)(this.remainderData,v),be=v.length,this.remainderData=null),be<188&&!A)return this.remainderData=v,{audioTrack:O,avcTrack:D,id3Track:P,textTrack:this._txtTrack};var Fe=Math.max(0,m.syncOffset(v));be-=(be+Fe)%188,be<v.byteLength&&!A&&(this.remainderData=new Uint8Array(v.buffer,be,v.buffer.byteLength-be));for(var Oe=Fe;Oe<be;Oe+=188)if(v[Oe]===71){var Re=!!(v[Oe+1]&64),Be=((v[Oe+1]&31)<<8)+v[Oe+2],Ke=(v[Oe+3]&48)>>4,Ae=void 0;if(Ke>1){if(Ae=Oe+5+v[Oe+4],Ae===Oe+188)continue}else Ae=Oe+4;switch(Be){case j:Re&&(K&&(p=l(K))&&this.parseAVCPES(p,!1),K={data:[],size:0}),K&&(K.data.push(v.subarray(Ae,Oe+188)),K.size+=Oe+188-Ae);break;case U:Re&&(B&&(p=l(B))&&(O.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),B={data:[],size:0}),B&&(B.data.push(v.subarray(Ae,Oe+188)),B.size+=Oe+188-Ae);break;case X:Re&&(N&&(p=l(N))&&this.parseID3PES(p),N={data:[],size:0}),N&&(N.data.push(v.subarray(Ae,Oe+188)),N.size+=Oe+188-Ae);break;case 0:Re&&(Ae+=v[Ae]+1),ce=this._pmtId=i(v,Ae);break;case ce:{Re&&(Ae+=v[Ae]+1);var _e=s(v,Ae,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);j=_e.avc,j>0&&(D.pid=j),U=_e.audio,U>0&&(O.pid=U,O.isAAC=_e.isAAC),X=_e.id3,X>0&&(P.pid=X),z&&!te&&(o.logger.log("reparse from beginning"),z=!1,Oe=Fe-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(g.Events.ERROR,g.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});D.pesData=K,O.pesData=B,P.pesData=N;var le={audioTrack:O,avcTrack:D,id3Track:P,textTrack:this._txtTrack};return A&&this.extractRemainingSamples(le),le},S.flush=function(){var v=this.remainderData;this.remainderData=null;var y;return v?y=this.demux(v,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},S.extractRemainingSamples=function(v){var y=v.audioTrack,T=v.avcTrack,A=v.id3Track,p=T.pesData,D=y.pesData,O=A.pesData,P;p&&(P=l(p))?(this.parseAVCPES(P,!0),T.pesData=null):T.pesData=p,D&&(P=l(D))?(y.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),y.pesData=null):(D!=null&&D.size&&o.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=D),O&&(P=l(O))?(this.parseID3PES(P),A.pesData=null):A.pesData=O},S.demuxSampleAes=function(v,y,T){var A=this.demux(v,T,!0,!this.config.progressive),p=this.sampleAes=new x.default(this.observer,this.config,y);return this.decrypt(A,p)},S.decrypt=function(v,y){return new Promise(function(T){var A=v.audioTrack,p=v.avcTrack;A.samples&&A.isAAC?y.decryptAacSamples(A.samples,0,function(){p.samples?y.decryptAvcSamples(p.samples,0,0,function(){T(v)}):T(v)}):p.samples&&y.decryptAvcSamples(p.samples,0,0,function(){T(v)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(v,y){var T=this,A=this._avcTrack,p=this.parseAVCNALu(v.data),D=!1,O=this.avcSample,P,j=!1;v.data=null,O&&p.length&&!A.audFound&&(c(O,A),O=this.avcSample=t(!1,v.pts,v.dts,"")),p.forEach(function(K){switch(K.type){case 1:{P=!0,O||(O=T.avcSample=t(!0,v.pts,v.dts,"")),D&&(O.debug+="NDR "),O.frame=!0;var U=K.data;if(j&&U.length>4){var X=new f.default(U).readSliceType();(X===2||X===4||X===7||X===9)&&(O.key=!0)}break}case 5:P=!0,O||(O=T.avcSample=t(!0,v.pts,v.dts,"")),D&&(O.debug+="IDR "),O.key=!0,O.frame=!0;break;case 6:{P=!0,D&&O&&(O.debug+="SEI ");var B=new f.default(w(K.data));B.readUByte();for(var N=0,z=0,te=!1,ce=0;!te&&B.bytesAvailable>1;){N=0;do ce=B.readUByte(),N+=ce;while(ce===255);z=0;do ce=B.readUByte(),z+=ce;while(ce===255);if(N===4&&B.bytesAvailable!==0){te=!0;var be=B.readUByte();if(be===181){var Fe=B.readUShort();if(Fe===49){var Oe=B.readUInt();if(Oe===1195456820){var Re=B.readUByte();if(Re===3){for(var Be=B.readUByte(),Ke=B.readUByte(),Ae=31&Be,_e=[Be,Ke],le=0;le<Ae;le++)_e.push(B.readUByte()),_e.push(B.readUByte()),_e.push(B.readUByte());d(T._txtTrack.samples,{type:3,pts:v.pts,bytes:_e})}}}}}else if(N===5&&B.bytesAvailable!==0){if(te=!0,z>16){for(var Ee=[],pe=0;pe<16;pe++)Ee.push(B.readUByte().toString(16)),(pe===3||pe===5||pe===7||pe===9)&&Ee.push("-");for(var Ge=z-16,Ye=new Uint8Array(Ge),ze=0;ze<Ge;ze++)Ye[ze]=B.readUByte();d(T._txtTrack.samples,{pts:v.pts,payloadType:N,uuid:Ee.join(""),userData:Object(E.utf8ArrayToStr)(Ye),userDataBytes:Ye})}}else if(z<B.bytesAvailable)for(var Ze=0;Ze<z;Ze++)B.readUByte()}break}case 7:if(P=!0,j=!0,D&&O&&(O.debug+="SPS "),!A.sps){var Je=new f.default(K.data),$e=Je.readSPS();A.width=$e.width,A.height=$e.height,A.pixelRatio=$e.pixelRatio,A.sps=[K.data],A.duration=T._duration;for(var He=K.data.subarray(1,4),Ue="avc1.",Pe=0;Pe<3;Pe++){var ke=He[Pe].toString(16);ke.length<2&&(ke="0"+ke),Ue+=ke}A.codec=Ue}break;case 8:P=!0,D&&O&&(O.debug+="PPS "),A.pps||(A.pps=[K.data]);break;case 9:P=!1,A.audFound=!0,O&&c(O,A),O=T.avcSample=t(!1,v.pts,v.dts,D?"AUD ":"");break;case 12:P=!1;break;default:P=!1,O&&(O.debug+="unknown NAL "+K.type+" ");break}if(O&&P){var re=O.units;re.push(K)}}),y&&O&&(c(O,A),this.avcSample=null)},S.getLastNalUnit=function(){var v,y=this.avcSample,T;if(!y||y.units.length===0){var A=this._avcTrack.samples;y=A[A.length-1]}if((v=y)!==null&&v!==void 0&&v.units){var p=y.units;T=p[p.length-1]}return T},S.parseAVCNALu=function(v){var y=v.byteLength,T=this._avcTrack,A=T.naluState||0,p=A,D=[],O=0,P,j,K,U=-1,X=0;for(A===-1&&(U=0,X=v[0]&31,A=0,O=1);O<y;){if(P=v[O++],!A){A=P?0:1;continue}if(A===1){A=P?0:2;continue}if(!P)A=3;else if(P===1){if(U>=0){var B={data:v.subarray(U,O-A-1),type:X};D.push(B)}else{var N=this.getLastNalUnit();if(N&&(p&&O<=4-p&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-p))),j=O-A-1,j>0)){var z=new Uint8Array(N.data.byteLength+j);z.set(N.data,0),z.set(v.subarray(0,j),N.data.byteLength),N.data=z,N.state=0}}O<y?(K=v[O]&31,U=O,X=K,A=0):A=-1}else A=0}if(U>=0&&A>=0){var te={data:v.subarray(U,y),type:X,state:A};D.push(te)}if(D.length===0){var ce=this.getLastNalUnit();if(ce){var be=new Uint8Array(ce.data.byteLength+v.byteLength);be.set(ce.data,0),be.set(v,ce.data.byteLength),ce.data=be}}return T.naluState=A,D},S.parseAACPES=function(v){var y=0,T=this._audioTrack,A=this.aacOverFlow,p=v.data;if(A){this.aacOverFlow=null;var D=A.sample.unit.byteLength,O=Math.min(A.missing,D),P=D-O;A.sample.unit.set(p.subarray(0,O),P),T.samples.push(A.sample),y=A.missing}var j,K;for(j=y,K=p.length;j<K-1&&!k.isHeader(p,j);j++);if(j!==y){var U,X;if(j<K-1?(U="AAC PES did not start with ADTS header,offset:"+j,X=!1):(U="no ADTS header found in AAC PES",X=!0),o.logger.warn("parsing error:"+U),this.observer.emit(g.Events.ERROR,g.Events.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:X,reason:U}),X)return}k.initTrackConfig(T,this.observer,p,j,this.audioCodec);var B;if(v.pts!==void 0)B=v.pts;else if(A){var N=k.getFrameDuration(T.samplerate);B=A.sample.pts+N}else{o.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;j<K;)if(k.isHeader(p,j)){if(j+5<K){var te=k.appendFrame(T,p,j,B,z);if(te)if(te.missing)this.aacOverFlow=te;else{j+=te.length,z++;continue}}break}else j++},S.parseMPEGPES=function(v){var y=v.data,T=y.length,A=0,p=0,D=v.pts;if(D===void 0){o.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<T;)if(M.isHeader(y,p)){var O=M.appendFrame(this._audioTrack,y,p,D,A);if(O)p+=O.length,A++;else break}else p++},S.parseID3PES=function(v){if(v.pts===void 0){o.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},m}();n.minProbeByteLength=188;function t(m,S,C,v){return{key:m,frame:!1,pts:S,dts:C,units:[],debug:v,length:0}}function i(m,S){return(m[S+10]&31)<<8|m[S+11]}function s(m,S,C,v){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},T=(m[S+1]&15)<<8|m[S+2],A=S+3+T-4,p=(m[S+10]&15)<<8|m[S+11];for(S+=12+p;S<A;){var D=(m[S+1]&31)<<8|m[S+2];switch(m[S]){case 207:if(!v){o.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=D);break;case 21:y.id3===-1&&(y.id3=D);break;case 219:if(!v){o.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=D);break;case 3:case 4:C?y.audio===-1&&(y.audio=D,y.isAAC=!1):o.logger.log("MPEG audio found, not supported in this browser");break;case 36:o.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((m[S+3]&15)<<8|m[S+4])+5}return y}function l(m){var S=0,C,v,y,T,A,p=m.data;if(!m||m.size===0)return null;for(;p[0].length<19&&p.length>1;){var D=new Uint8Array(p[0].length+p[1].length);D.set(p[0]),D.set(p[1],p[0].length),p[0]=D,p.splice(1,1)}C=p[0];var O=(C[0]<<16)+(C[1]<<8)+C[2];if(O===1){if(v=(C[4]<<8)+C[5],v&&v>m.size-6)return null;var P=C[7];P&192&&(T=(C[9]&14)*536870912+(C[10]&255)*4194304+(C[11]&254)*16384+(C[12]&255)*128+(C[13]&254)/2,P&64?(A=(C[14]&14)*536870912+(C[15]&255)*4194304+(C[16]&254)*16384+(C[17]&255)*128+(C[18]&254)/2,T-A>60*9e4&&(o.logger.warn(Math.round((T-A)/9e4)+"s delta between PTS and DTS, align them"),T=A)):A=T),y=C[8];var j=y+9;if(m.size<=j)return null;m.size-=j;for(var K=new Uint8Array(m.size),U=0,X=p.length;U<X;U++){C=p[U];var B=C.byteLength;if(j)if(j>B){j-=B;continue}else C=C.subarray(j),B-=j,j=0;K.set(C,S),S+=B}return v&&(v-=y+3),{data:K,pts:T,dts:A,len:v}}return null}function c(m,S){if(m.units.length&&m.frame){if(m.pts===void 0){var C=S.samples,v=C.length;if(v){var y=C[v-1];m.pts=y.pts,m.dts=y.dts}else{S.dropped++;return}}S.samples.push(m)}m.debug.length&&o.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function d(m,S){var C=m.length;if(C>0){if(S.pts>=m[C-1].pts)m.push(S);else for(var v=C-1;v>=0;v--)if(S.pts<m[v].pts){m.splice(v,0,S);break}}else m.push(S)}function w(m){for(var S=m.byteLength,C=[],v=1;v<S-2;)m[v]===0&&m[v+1]===0&&m[v+2]===3?(C.push(v+2),v+=2):v++;if(C.length===0)return m;var y=S-C.length,T=new Uint8Array(y),A=0;for(v=0;v<y;A++,v++)A===C[0]&&(A++,C.shift()),T[v]=m[A];return T}L.default=n},"./src/errors.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"ErrorTypes",function(){return k}),I.d(L,"ErrorDetails",function(){return M});var k;(function(f){f.NETWORK_ERROR="networkError",f.MEDIA_ERROR="mediaError",f.KEY_SYSTEM_ERROR="keySystemError",f.MUX_ERROR="muxError",f.OTHER_ERROR="otherError"})(k||(k={}));var M;(function(f){f.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",f.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",f.KEY_SYSTEM_NO_SESSION="keySystemNoSession",f.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",f.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",f.MANIFEST_LOAD_ERROR="manifestLoadError",f.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",f.MANIFEST_PARSING_ERROR="manifestParsingError",f.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",f.LEVEL_EMPTY_ERROR="levelEmptyError",f.LEVEL_LOAD_ERROR="levelLoadError",f.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",f.LEVEL_SWITCH_ERROR="levelSwitchError",f.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",f.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",f.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",f.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",f.FRAG_LOAD_ERROR="fragLoadError",f.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",f.FRAG_DECRYPT_ERROR="fragDecryptError",f.FRAG_PARSING_ERROR="fragParsingError",f.REMUX_ALLOC_ERROR="remuxAllocError",f.KEY_LOAD_ERROR="keyLoadError",f.KEY_LOAD_TIMEOUT="keyLoadTimeOut",f.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",f.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",f.BUFFER_APPEND_ERROR="bufferAppendError",f.BUFFER_APPENDING_ERROR="bufferAppendingError",f.BUFFER_STALLED_ERROR="bufferStalledError",f.BUFFER_FULL_ERROR="bufferFullError",f.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",f.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",f.INTERNAL_EXCEPTION="internalException",f.INTERNAL_ABORTED="aborted",f.UNKNOWN="unknown"})(M||(M={}))},"./src/events.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"Events",function(){return k});var k;(function(M){M.MEDIA_ATTACHING="hlsMediaAttaching",M.MEDIA_ATTACHED="hlsMediaAttached",M.MEDIA_DETACHING="hlsMediaDetaching",M.MEDIA_DETACHED="hlsMediaDetached",M.BUFFER_RESET="hlsBufferReset",M.BUFFER_CODECS="hlsBufferCodecs",M.BUFFER_CREATED="hlsBufferCreated",M.BUFFER_APPENDING="hlsBufferAppending",M.BUFFER_APPENDED="hlsBufferAppended",M.BUFFER_EOS="hlsBufferEos",M.BUFFER_FLUSHING="hlsBufferFlushing",M.BUFFER_FLUSHED="hlsBufferFlushed",M.MANIFEST_LOADING="hlsManifestLoading",M.MANIFEST_LOADED="hlsManifestLoaded",M.MANIFEST_PARSED="hlsManifestParsed",M.LEVEL_SWITCHING="hlsLevelSwitching",M.LEVEL_SWITCHED="hlsLevelSwitched",M.LEVEL_LOADING="hlsLevelLoading",M.LEVEL_LOADED="hlsLevelLoaded",M.LEVEL_UPDATED="hlsLevelUpdated",M.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",M.LEVELS_UPDATED="hlsLevelsUpdated",M.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",M.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",M.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",M.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",M.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",M.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",M.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",M.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",M.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",M.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",M.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",M.CUES_PARSED="hlsCuesParsed",M.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",M.INIT_PTS_FOUND="hlsInitPtsFound",M.FRAG_LOADING="hlsFragLoading",M.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",M.FRAG_LOADED="hlsFragLoaded",M.FRAG_DECRYPTED="hlsFragDecrypted",M.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",M.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",M.FRAG_PARSING_METADATA="hlsFragParsingMetadata",M.FRAG_PARSED="hlsFragParsed",M.FRAG_BUFFERED="hlsFragBuffered",M.FRAG_CHANGED="hlsFragChanged",M.FPS_DROP="hlsFpsDrop",M.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",M.ERROR="hlsError",M.DESTROYING="hlsDestroying",M.KEY_LOADING="hlsKeyLoading",M.KEY_LOADED="hlsKeyLoaded",M.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",M.BACK_BUFFER_REACHED="hlsBackBufferReached"})(k||(k={}))},"./src/hls.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return m});var k=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(k),f=I("./src/loader/playlist-loader.ts"),E=I("./src/loader/key-loader.ts"),x=I("./src/controller/id3-track-controller.ts"),g=I("./src/controller/latency-controller.ts"),h=I("./src/controller/level-controller.ts"),o=I("./src/controller/fragment-tracker.ts"),u=I("./src/controller/stream-controller.ts"),r=I("./src/is-supported.ts"),n=I("./src/utils/logger.ts"),t=I("./src/config.ts"),i=I("./node_modules/eventemitter3/index.js"),s=I.n(i),l=I("./src/events.ts"),c=I("./src/errors.ts");function d(S,C){for(var v=0;v<C.length;v++){var y=C[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(S,y.key,y)}}function w(S,C,v){return C&&d(S.prototype,C),v&&d(S,v),S}var m=function(){S.isSupported=function(){return Object(r.isSupported)()};function S(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new i.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 y=this.config=Object(t.mergeConfig)(S.DefaultConfig,v);this.userConfig=v,Object(n.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(t.enableStreamingMode)(y);var T=y.abrController,A=y.bufferController,p=y.capLevelController,D=y.fpsController,O=this.abrController=new T(this),P=this.bufferController=new A(this),j=this.capLevelController=new p(this),K=new D(this),U=new f.default(this),X=new E.default(this),B=new x.default(this),N=this.levelController=new h.default(this),z=new o.FragmentTracker(this),te=this.streamController=new u.default(this,z);j.setStreamController(te),K.setStreamController(te);var ce=[N,te];this.networkControllers=ce;var be=[U,X,O,P,j,K,B,z];this.audioTrackController=this.createController(y.audioTrackController,null,ce),this.createController(y.audioStreamController,z,ce),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,ce),this.createController(y.subtitleStreamController,z,ce),this.createController(y.timelineController,null,be),this.emeController=this.createController(y.emeController,null,be),this.cmcdController=this.createController(y.cmcdController,null,be),this.latencyController=this.createController(g.default,null,be),this.coreComponents=be}var C=S.prototype;return C.createController=function(y,T,A){if(y){var p=T?new y(this,T):new y(this);return A&&A.push(p),p}return null},C.on=function(y,T,A){A===void 0&&(A=this),this._emitter.on(y,T,A)},C.once=function(y,T,A){A===void 0&&(A=this),this._emitter.once(y,T,A)},C.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},C.off=function(y,T,A,p){A===void 0&&(A=this),this._emitter.off(y,T,A,p)},C.listeners=function(y){return this._emitter.listeners(y)},C.emit=function(y,T,A){return this._emitter.emit(y,T,A)},C.trigger=function(y,T){if(this.config.debug)return this.emit(y,y,T);try{return this.emit(y,y,T)}catch(A){n.logger.error("An internal error happened while handling event "+y+'. Error message: "'+A.message+'". Here is a stacktrace:',A),this.trigger(l.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:A})}return!1},C.listenerCount=function(y){return this._emitter.listenerCount(y)},C.destroy=function(){n.logger.log("destroy"),this.trigger(l.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},C.attachMedia=function(y){n.logger.log("attachMedia"),this._media=y,this.trigger(l.Events.MEDIA_ATTACHING,{media:y})},C.detachMedia=function(){n.logger.log("detachMedia"),this.trigger(l.Events.MEDIA_DETACHING,void 0),this._media=null},C.loadSource=function(y){this.stopLoad();var T=this.media,A=this.url,p=this.url=k.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});n.logger.log("loadSource:"+p),T&&A&&A!==p&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(T)),this.trigger(l.Events.MANIFEST_LOADING,{url:y})},C.startLoad=function(y){y===void 0&&(y=-1),n.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(T){T.startLoad(y)})},C.stopLoad=function(){n.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},C.swapAudioCodec=function(){n.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},C.recoverMediaError=function(){n.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},C.removeLevel=function(y,T){T===void 0&&(T=0),this.levelController.removeLevel(y,T)},w(S,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){n.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){n.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){n.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){n.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){n.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var T=!!y;T!==this.config.capLevelToPlayerSize&&(T?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=T)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(n.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,T=this.config.minAutoBitrate;if(!y)return 0;for(var A=y.length,p=0;p<A;p++)if(y[p].maxBitrate>T)return p;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,T=this.autoLevelCapping,A;return T===-1&&y&&y.length?A=y.length-1:A=T,A}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var T=this.audioTrackController;T&&(T.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var T=this.subtitleTrackController;T&&(T.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{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 l.Events}},{key:"ErrorTypes",get:function(){return c.ErrorTypes}},{key:"ErrorDetails",get:function(){return c.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:t.hlsDefaultConfig},set:function(y){S.defaultConfig=y}}]),S}();m.defaultConfig=void 0},"./src/is-supported.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"isSupported",function(){return f}),I.d(L,"changeTypeSupported",function(){return E});var k=I("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function f(){var x=Object(k.getMediaSource)();if(!x)return!1;var g=M(),h=x&&typeof x.isTypeSupported=="function"&&x.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!g||g.prototype&&typeof g.prototype.appendBuffer=="function"&&typeof g.prototype.remove=="function";return!!h&&!!o}function E(){var x,g=M();return typeof(g==null||((x=g.prototype)===null||x===void 0)?void 0:x.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return n}),I.d(L,"LoadError",function(){return i});var k=I("./src/polyfills/number.ts"),M=I("./src/errors.ts");function f(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,o(s,l)}function E(s){var l=typeof Map=="function"?new Map:void 0;return E=function(d){if(d===null||!h(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(d))return l.get(d);l.set(d,w)}function w(){return x(d,arguments,u(this).constructor)}return w.prototype=Object.create(d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),o(w,d)},E(s)}function x(s,l,c){return g()?x=Reflect.construct:x=function(w,m,S){var C=[null];C.push.apply(C,m);var v=Function.bind.apply(w,C),y=new v;return S&&o(y,S.prototype),y},x.apply(null,arguments)}function g(){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(s){return!1}}function h(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function o(s,l){return o=Object.setPrototypeOf||function(d,w){return d.__proto__=w,d},o(s,l)}function u(s){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},u(s)}var r=Math.pow(2,17),n=function(){function s(c){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=c}var l=s.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(d,w){var m=this,S=d.url;if(!S)return Promise.reject(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var C=this.config,v=C.fLoader,y=C.loader;return new Promise(function(T,A){m.loader&&m.loader.destroy();var p=m.loader=d.loader=v?new v(C):new y(C),D=t(d),O={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:r};d.stats=p.stats,p.load(D,O,{onSuccess:function(j,K,U,X){m.resetLoader(d,p),T({frag:d,part:null,payload:j.data,networkDetails:X})},onError:function(j,K,U){m.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:j,networkDetails:U}))},onAbort:function(j,K,U){m.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:U}))},onTimeout:function(j,K,U){m.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:U}))},onProgress:function(j,K,U,X){w&&w({frag:d,part:null,payload:U,networkDetails:X})}})})},l.loadPart=function(d,w,m){var S=this;this.abort();var C=this.config,v=C.fLoader,y=C.loader;return new Promise(function(T,A){S.loader&&S.loader.destroy();var p=S.loader=d.loader=v?new v(C):new y(C),D=t(d,w),O={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:r};w.stats=p.stats,p.load(D,O,{onSuccess:function(j,K,U,X){S.resetLoader(d,p),S.updateStatsFromPart(d,w);var B={frag:d,part:w,payload:j.data,networkDetails:X};m(B),T(B)},onError:function(j,K,U){S.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:w,response:j,networkDetails:U}))},onAbort:function(j,K,U){d.stats.aborted=w.stats.aborted,S.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:w,networkDetails:U}))},onTimeout:function(j,K,U){S.resetLoader(d,p),A(new i({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:w,networkDetails:U}))}})})},l.updateStatsFromPart=function(d,w){var m=d.stats,S=w.stats,C=S.total;if(m.loaded+=S.loaded,C){var v=Math.round(d.duration/w.duration),y=Math.min(Math.round(m.loaded/C),v),T=v-y,A=T*Math.round(m.loaded/y);m.total=m.loaded+A}else m.total=Math.max(m.loaded,m.total);var p=m.loading,D=S.loading;p.start?p.first+=D.first-D.start:(p.start=D.start,p.first=D.first),p.end=D.end},l.resetLoader=function(d,w){d.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},s}();function t(s,l){l===void 0&&(l=null);var c=l||s,d={frag:s,part:l,responseType:"arraybuffer",url:c.url,headers:{},rangeStart:0,rangeEnd:0},w=c.byteRangeStartOffset,m=c.byteRangeEndOffset;return Object(k.isFiniteNumber)(w)&&Object(k.isFiniteNumber)(m)&&(d.rangeStart=w,d.rangeEnd=m),d}var i=function(s){f(l,s);function l(c){for(var d,w=arguments.length,m=new Array(w>1?w-1:0),S=1;S<w;S++)m[S-1]=arguments[S];return d=s.call.apply(s,[this].concat(m))||this,d.data=void 0,d.data=c,d}return l}(E(Error))},"./src/loader/fragment.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"ElementaryStreamTypes",function(){return n}),I.d(L,"BaseSegment",function(){return t}),I.d(L,"Fragment",function(){return i}),I.d(L,"Part",function(){return s});var k=I("./src/polyfills/number.ts"),M=I("./node_modules/url-toolkit/src/url-toolkit.js"),f=I.n(M),E=I("./src/utils/logger.ts"),x=I("./src/loader/level-key.ts"),g=I("./src/loader/load-stats.ts");function h(l,c){l.prototype=Object.create(c.prototype),l.prototype.constructor=l,o(l,c)}function o(l,c){return o=Object.setPrototypeOf||function(w,m){return w.__proto__=m,w},o(l,c)}function u(l,c){for(var d=0;d<c.length;d++){var w=c[d];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(l,w.key,w)}}function r(l,c,d){return c&&u(l.prototype,c),d&&u(l,d),l}var n;(function(l){l.AUDIO="audio",l.VIDEO="video",l.AUDIOVIDEO="audiovideo"})(n||(n={}));var t=function(){function l(d){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[n.AUDIO]=null,w[n.VIDEO]=null,w[n.AUDIOVIDEO]=null,w),this.baseurl=d}var c=l.prototype;return c.setByteRange=function(w,m){var S=w.split("@",2),C=[];S.length===1?C[0]=m?m.byteRangeEndOffset:0:C[0]=parseInt(S[1]),C[1]=parseInt(S[0])+C[0],this._byteRange=C},r(l,[{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(M.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),l}(),i=function(l){h(c,l);function c(w,m){var S;return S=l.call(this,m)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new g.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=w,S}var d=c.prototype;return d.createInitializationVector=function(m){for(var S=new Uint8Array(16),C=12;C<16;C++)S[C]=m>>8*(15-C)&255;return S},d.setDecryptDataFromLevelKey=function(m,S){var C=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(C=x.LevelKey.fromURI(m.uri),C.method=m.method,C.iv=this.createInitializationVector(S),C.keyFormat="identity"),C},d.setElementaryStreamInfo=function(m,S,C,v,y,T){T===void 0&&(T=!1);var A=this.elementaryStreams,p=A[m];if(!p){A[m]={startPTS:S,endPTS:C,startDTS:v,endDTS:y,partial:T};return}p.startPTS=Math.min(p.startPTS,S),p.endPTS=Math.max(p.endPTS,C),p.startDTS=Math.min(p.startDTS,v),p.endDTS=Math.max(p.endDTS,y)},d.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[n.AUDIO]=null,m[n.VIDEO]=null,m[n.AUDIOVIDEO]=null},r(c,[{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&&E.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(k.isFiniteNumber)(this.programDateTime))return null;var m=Object(k.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)}}]),c}(t),s=function(l){h(c,l);function c(d,w,m,S,C){var v;v=l.call(this,m)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new g.LoadStats,v.duration=d.decimalFloatingPoint("DURATION"),v.gap=d.bool("GAP"),v.independent=d.bool("INDEPENDENT"),v.relurl=d.enumeratedString("URI"),v.fragment=w,v.index=S;var y=d.enumeratedString("BYTERANGE");return y&&v.setByteRange(y,C),C&&(v.fragOffset=C.fragOffset+C.duration),v}return r(c,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),c}(t)},"./src/loader/key-loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return E});var k=I("./src/events.ts"),M=I("./src/errors.ts"),f=I("./src/utils/logger.ts"),E=function(){function x(h){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=h,this._registerListeners()}var g=x.prototype;return g._registerListeners=function(){this.hls.on(k.Events.KEY_LOADING,this.onKeyLoading,this)},g._unregisterListeners=function(){this.hls.off(k.Events.KEY_LOADING,this.onKeyLoading)},g.destroy=function(){this._unregisterListeners();for(var o in this.loaders){var u=this.loaders[o];u&&u.destroy()}this.loaders={}},g.onKeyLoading=function(o,u){var r=u.frag,n=r.type,t=this.loaders[n];if(!r.decryptdata){f.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var i=r.decryptdata.uri;if(i!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(t&&(f.logger.warn("abort previous key loader for type:"+n),t.abort()),!i){f.logger.warn("key uri is falsy");return}var l=s.loader,c=r.loader=this.loaders[n]=new l(s);this.decrypturl=i,this.decryptkey=null;var d={url:i,frag:r,responseType:"arraybuffer"},w={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(d,w,m)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(k.Events.KEY_LOADED,{frag:r}))},g.loadsuccess=function(o,u,r){var n=r.frag;if(!n.decryptdata){f.logger.error("after key load, decryptdata unset");return}this.decryptkey=n.decryptdata.key=new Uint8Array(o.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(k.Events.KEY_LOADED,{frag:n})},g.loaderror=function(o,u){var r=u.frag,n=r.loader;n&&n.abort(),delete this.loaders[r.type],this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:o})},g.loadtimeout=function(o,u){var r=u.frag,n=r.loader;n&&n.abort(),delete this.loaders[r.type],this.hls.trigger(k.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},x}()},"./src/loader/level-details.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"LevelDetails",function(){return x});var k=I("./src/polyfills/number.ts");function M(g,h){for(var o=0;o<h.length;o++){var u=h[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}function f(g,h,o){return h&&M(g.prototype,h),o&&M(g,o),g}var E=10,x=function(){function g(o){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=o}var h=g.prototype;return h.reloaded=function(u){if(!u){this.advanced=!0,this.updated=!0;return}var r=this.lastPartSn-u.lastPartSn,n=this.lastPartIndex-u.lastPartIndex;this.updated=this.endSN!==u.endSN||!!n||!!r,this.advanced=this.endSN>u.endSN||r>0||r===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(u.misses*.6):this.misses=u.misses+1,this.availabilityDelay=u.availabilityDelay},f(g,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||E}},{key:"drift",get:function(){var u=this.driftEndTime-this.driftStartTime;if(u>0){var r=this.driftEnd-this.driftStart;return r*1e3/u}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var u;return(u=this.fragments)!==null&&u!==void 0&&u.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 u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var u;return(u=this.partList)!==null&&u!==void 0&&u.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),g}()},"./src/loader/level-key.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"LevelKey",function(){return x});var k=I("./node_modules/url-toolkit/src/url-toolkit.js"),M=I.n(k);function f(g,h){for(var o=0;o<h.length;o++){var u=h[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}function E(g,h,o){return h&&f(g.prototype,h),o&&f(g,o),g}var x=function(){g.fromURL=function(o,u){return new g(o,u)},g.fromURI=function(o){return new g(o)};function g(h,o){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,o?this._uri=Object(k.buildAbsoluteURL)(h,o,{alwaysNormalize:!0}):this._uri=h}return E(g,[{key:"uri",get:function(){return this._uri}}]),g}()},"./src/loader/load-stats.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"LoadStats",function(){return k});var k=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(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return c});var k=I("./src/polyfills/number.ts"),M=I("./node_modules/url-toolkit/src/url-toolkit.js"),f=I.n(M),E=I("./src/loader/fragment.ts"),x=I("./src/loader/level-details.ts"),g=I("./src/loader/level-key.ts"),h=I("./src/utils/attr-list.ts"),o=I("./src/utils/logger.ts"),u=I("./src/utils/codecs.ts"),r=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,n=/#EXT-X-MEDIA:(.*)/g,t=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),i=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("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function l(C){var v,y;return s.test((v=(y=M.parseURL(C))===null||y===void 0?void 0:y.path)!=null?v:"")}var c=function(){function C(){}return C.findGroup=function(y,T){for(var A=0;A<y.length;A++){var p=y[A];if(p.id===T)return p}},C.convertAVC1ToAVCOTI=function(y){var T=y.split(".");if(T.length>2){var A=T.shift()+".";return A+=parseInt(T.shift()).toString(16),A+=("000"+parseInt(T.shift()).toString(16)).substr(-4),A}return y},C.resolve=function(y,T){return M.buildAbsoluteURL(T,y,{alwaysNormalize:!0})},C.parseMasterPlaylist=function(y,T){var A=[],p={},D=!1;r.lastIndex=0;for(var O;(O=r.exec(y))!=null;)if(O[1]){var P=new h.AttrList(O[1]),j={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:C.resolve(O[2],T)},K=P.decimalResolution("RESOLUTION");K&&(j.width=K.width,j.height=K.height),d((P.CODECS||"").split(/[ ,]+/).filter(function(X){return X}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=C.convertAVC1ToAVCOTI(j.videoCodec)),A.push(j)}else if(O[3]){var U=new h.AttrList(O[3]);U["DATA-ID"]&&(D=!0,p[U["DATA-ID"]]=U)}return{levels:A,sessionData:D?p:null}},C.parseMasterPlaylistMedia=function(y,T,A,p){p===void 0&&(p=[]);var D,O=[],P=0;for(n.lastIndex=0;(D=n.exec(y))!==null;){var j=new h.AttrList(D[1]);if(j.TYPE===A){var K={attrs:j,bitrate:0,id:P++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:A,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?C.resolve(j.URI,T):""};if(p.length){var U=C.findGroup(p,K.groupId)||p[0];w(K,U,"audioCodec"),w(K,U,"textCodec")}O.push(K)}}return O},C.parseLevelPlaylist=function(y,T,A,p,D){var O=new x.LevelDetails(T),P=O.fragments,j=null,K=0,U=0,X=0,B=0,N=null,z=new E.Fragment(p,T),te,ce,be,Fe=-1,Oe=!1;for(t.lastIndex=0,O.m3u8=y;(te=t.exec(y))!==null;){Oe&&(Oe=!1,z=new E.Fragment(p,T),z.start=X,z.sn=K,z.cc=B,z.level=A,j&&(z.initSegment=j,z.rawProgramDateTime=j.rawProgramDateTime));var Re=te[1];if(Re){z.duration=parseFloat(Re);var Be=(" "+te[2]).slice(1);z.title=Be||null,z.tagList.push(Be?["INF",Re,Be]:["INF",Re])}else if(te[3])Object(k.isFiniteNumber)(z.duration)&&(z.start=X,be&&(z.levelkey=be),z.sn=K,z.level=A,z.cc=B,z.urlId=D,P.push(z),z.relurl=(" "+te[3]).slice(1),S(z,N),N=z,X+=z.duration,K++,U=0,Oe=!0);else if(te[4]){var Ke=(" "+te[4]).slice(1);N?z.setByteRange(Ke,N):z.setByteRange(Ke)}else if(te[5])z.rawProgramDateTime=(" "+te[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),Fe===-1&&(Fe=P.length);else{if(te=te[0].match(i),!te){o.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce<te.length&&!(typeof te[ce]!="undefined");ce++);var Ae=(" "+te[ce]).slice(1),_e=(" "+te[ce+1]).slice(1),le=te[ce+2]?(" "+te[ce+2]).slice(1):"";switch(Ae){case"PLAYLIST-TYPE":O.type=_e.toUpperCase();break;case"MEDIA-SEQUENCE":K=O.startSN=parseInt(_e);break;case"SKIP":{var Ee=new h.AttrList(_e),pe=Ee.decimalInteger("SKIPPED-SEGMENTS");if(Object(k.isFiniteNumber)(pe)){O.skippedSegments=pe;for(var Ge=pe;Ge--;)P.unshift(null);K+=pe}var Ye=Ee.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ye&&(O.recentlyRemovedDateranges=Ye.split(" "));break}case"TARGETDURATION":O.targetduration=parseFloat(_e);break;case"VERSION":O.version=parseInt(_e);break;case"EXTM3U":break;case"ENDLIST":O.live=!1;break;case"#":(_e||le)&&z.tagList.push(le?[_e,le]:[_e]);break;case"DIS":B++;case"GAP":z.tagList.push([Ae]);break;case"BITRATE":z.tagList.push([Ae,_e]);break;case"DISCONTINUITY-SEQ":B=parseInt(_e);break;case"KEY":{var ze,Ze=new h.AttrList(_e),Je=Ze.enumeratedString("METHOD"),$e=Ze.URI,He=Ze.hexadecimalInteger("IV"),Ue=Ze.enumeratedString("KEYFORMATVERSIONS"),Pe=Ze.enumeratedString("KEYID"),ke=(ze=Ze.enumeratedString("KEYFORMAT"))!=null?ze:"identity",re=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(re.indexOf(ke)>-1){o.logger.warn("Keyformat "+ke+" is not supported from the manifest");continue}else if(ke!=="identity")continue;Je&&(be=g.LevelKey.fromURL(T,$e),$e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Je)>=0&&(be.method=Je,be.keyFormat=ke,Pe&&(be.keyID=Pe),Ue&&(be.keyFormatVersions=Ue),be.iv=He));break}case"START":{var ve=new h.AttrList(_e),ae=ve.decimalFloatingPoint("TIME-OFFSET");Object(k.isFiniteNumber)(ae)&&(O.startTimeOffset=ae);break}case"MAP":{var De=new h.AttrList(_e);z.relurl=De.URI,De.BYTERANGE&&z.setByteRange(De.BYTERANGE),z.level=A,z.sn="initSegment",be&&(z.levelkey=be),z.initSegment=null,j=z,Oe=!0;break}case"SERVER-CONTROL":{var qe=new h.AttrList(_e);O.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),O.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),O.canSkipDateRanges=O.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),O.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),O.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var et=new h.AttrList(_e);O.partTarget=et.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=O.partList;je||(je=O.partList=[]);var ct=U>0?je[je.length-1]:void 0,he=U++,Te=new E.Part(new h.AttrList(_e),z,T,he,ct);je.push(Te),z.duration+=Te.duration;break}case"PRELOAD-HINT":{var We=new h.AttrList(_e);O.preloadHint=We;break}case"RENDITION-REPORT":{var xe=new h.AttrList(_e);O.renditionReports=O.renditionReports||[],O.renditionReports.push(xe);break}default:o.logger.warn("line parsed but not handled: "+te);break}}}N&&!N.relurl?(P.pop(),X-=N.duration,O.partList&&(O.fragmentHint=N)):O.partList&&(S(z,N),z.cc=B,O.fragmentHint=z);var ge=P.length,ye=P[0],J=P[ge-1];if(X+=O.skippedSegments*O.targetduration,X>0&&ge&&J){O.averagetargetduration=X/ge;var ne=J.sn;O.endSN=ne!=="initSegment"?ne:0,ye&&(O.startCC=ye.cc,ye.initSegment||O.fragments.every(function(q){return q.relurl&&l(q.relurl)})&&(o.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new E.Fragment(p,T),z.relurl=J.relurl,z.level=A,z.sn="initSegment",ye.initSegment=z,O.needSidxRanges=!0))}else O.endSN=0,O.startCC=0;return O.fragmentHint&&(X+=O.fragmentHint.duration),O.totalduration=X,O.endCC=B,Fe>0&&m(P,Fe),O},C}();function d(C,v){["video","audio","text"].forEach(function(y){var T=C.filter(function(p){return Object(u.isCodecType)(p,y)});if(T.length){var A=T.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});v[y+"Codec"]=A.length>0?A[0]:T[0],C=C.filter(function(p){return T.indexOf(p)===-1})}}),v.unknownCodecs=C}function w(C,v,y){var T=v[y];T&&(C[y]=T)}function m(C,v){for(var y=C[v],T=v;T--;){var A=C[T];if(!A)return;A.programDateTime=y.programDateTime-A.duration*1e3,y=A}}function S(C,v){C.rawProgramDateTime?C.programDateTime=Date.parse(C.rawProgramDateTime):v!=null&&v.programDateTime&&(C.programDateTime=v.endProgramDateTime),Object(k.isFiniteNumber)(C.programDateTime)||(C.programDateTime=null,C.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/polyfills/number.ts"),M=I("./src/events.ts"),f=I("./src/errors.ts"),E=I("./src/utils/logger.ts"),x=I("./src/utils/mp4-tools.ts"),g=I("./src/loader/m3u8-parser.ts"),h=I("./src/types/loader.ts"),o=I("./src/utils/attr-list.ts");function u(t){var i=t.type;switch(i){case h.PlaylistContextType.AUDIO_TRACK:return h.PlaylistLevelType.AUDIO;case h.PlaylistContextType.SUBTITLE_TRACK:return h.PlaylistLevelType.SUBTITLE;default:return h.PlaylistLevelType.MAIN}}function r(t,i){var s=t.url;return(s===void 0||s.indexOf("data:")===0)&&(s=i.url),s}var n=function(){function t(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var i=t.prototype;return i.registerListeners=function(){var l=this.hls;l.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},i.unregisterListeners=function(){var l=this.hls;l.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},i.createInternalLoader=function(l){var c=this.hls.config,d=c.pLoader,w=c.loader,m=d||w,S=new m(c);return l.loader=S,this.loaders[l.type]=S,S},i.getInternalLoader=function(l){return this.loaders[l.type]},i.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},i.destroyInternalLoaders=function(){for(var l in this.loaders){var c=this.loaders[l];c&&c.destroy(),this.resetInternalLoader(l)}},i.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},i.onManifestLoading=function(l,c){var d=c.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:h.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},i.onLevelLoading=function(l,c){var d=c.id,w=c.level,m=c.url,S=c.deliveryDirectives;this.load({id:d,groupId:null,level:w,responseType:"text",type:h.PlaylistContextType.LEVEL,url:m,deliveryDirectives:S})},i.onAudioTrackLoading=function(l,c){var d=c.id,w=c.groupId,m=c.url,S=c.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:h.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:S})},i.onSubtitleTrackLoading=function(l,c){var d=c.id,w=c.groupId,m=c.url,S=c.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:h.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:S})},i.load=function(l){var c,d=this.hls.config,w=this.getInternalLoader(l);if(w){var m=w.context;if(m&&m.url===l.url){E.logger.trace("[playlist-loader]: playlist request ongoing");return}E.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),w.abort()}var S,C,v,y;switch(l.type){case h.PlaylistContextType.MANIFEST:S=d.manifestLoadingMaxRetry,C=d.manifestLoadingTimeOut,v=d.manifestLoadingRetryDelay,y=d.manifestLoadingMaxRetryTimeout;break;case h.PlaylistContextType.LEVEL:case h.PlaylistContextType.AUDIO_TRACK:case h.PlaylistContextType.SUBTITLE_TRACK:S=0,C=d.levelLoadingTimeOut;break;default:S=d.levelLoadingMaxRetry,C=d.levelLoadingTimeOut,v=d.levelLoadingRetryDelay,y=d.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(l),(c=l.deliveryDirectives)!==null&&c!==void 0&&c.part){var T;if(l.type===h.PlaylistContextType.LEVEL&&l.level!==null?T=this.hls.levels[l.level].details:l.type===h.PlaylistContextType.AUDIO_TRACK&&l.id!==null?T=this.hls.audioTracks[l.id].details:l.type===h.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(T=this.hls.subtitleTracks[l.id].details),T){var A=T.partTarget,p=T.targetduration;A&&p&&(C=Math.min(Math.max(A*3,p*.8)*1e3,C))}}var D={timeout:C,maxRetry:S,retryDelay:v,maxRetryDelay:y,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(l,D,O)},i.loadsuccess=function(l,c,d,w){if(w===void 0&&(w=null),d.isSidxRequest){this.handleSidxRequest(l,d),this.handlePlaylistLoaded(l,c,d,w);return}this.resetInternalLoader(d.type);var m=l.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,d,"no EXTM3U delimiter",w);return}c.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,c,d,w):this.handleMasterPlaylist(l,c,d,w)},i.loaderror=function(l,c,d){d===void 0&&(d=null),this.handleNetworkError(c,d,!1,l)},i.loadtimeout=function(l,c,d){d===void 0&&(d=null),this.handleNetworkError(c,d,!0)},i.handleMasterPlaylist=function(l,c,d,w){var m=this.hls,S=l.data,C=r(l,d),v=g.default.parseMasterPlaylist(S,C),y=v.levels,T=v.sessionData;if(!y.length){this.handleManifestParsingError(l,d,"no level found in manifest",w);return}var A=y.map(function(K){return{id:K.attrs.AUDIO,audioCodec:K.audioCodec}}),p=y.map(function(K){return{id:K.attrs.SUBTITLES,textCodec:K.textCodec}}),D=g.default.parseMasterPlaylistMedia(S,C,"AUDIO",A),O=g.default.parseMasterPlaylistMedia(S,C,"SUBTITLES",p),P=g.default.parseMasterPlaylistMedia(S,C,"CLOSED-CAPTIONS");if(D.length){var j=D.some(function(K){return!K.url});!j&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(E.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),D.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new o.AttrList({}),bitrate:0,url:""}))}m.trigger(M.Events.MANIFEST_LOADED,{levels:y,audioTracks:D,subtitles:O,captions:P,url:C,stats:c,networkDetails:w,sessionData:T})},i.handleTrackOrLevelPlaylist=function(l,c,d,w){var m=this.hls,S=d.id,C=d.level,v=d.type,y=r(l,d),T=Object(k.isFiniteNumber)(S)?S:0,A=Object(k.isFiniteNumber)(C)?C:T,p=u(d),D=g.default.parseLevelPlaylist(l.data,y,A,p,T);if(!D.fragments.length){m.trigger(M.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(v===h.PlaylistContextType.MANIFEST){var O={attrs:new o.AttrList({}),bitrate:0,details:D,name:"",url:y};m.trigger(M.Events.MANIFEST_LOADED,{levels:[O],audioTracks:[],url:y,stats:c,networkDetails:w,sessionData:null})}if(c.parsing.end=performance.now(),D.needSidxRanges){var P,j=(P=D.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:j,isSidxRequest:!0,type:v,level:C,levelDetails:D,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=D,this.handlePlaylistLoaded(l,c,d,w)},i.handleSidxRequest=function(l,c){var d=Object(x.parseSegmentIndex)(new Uint8Array(l.data));if(!d)return;var w=d.references,m=c.levelDetails;w.forEach(function(S,C){var v=S.info,y=m.fragments[C];y.byteRange.length===0&&y.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),y.initSegment&&y.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},i.handleManifestParsingError=function(l,c,d,w){this.hls.trigger(M.Events.ERROR,{type:f.ErrorTypes.NETWORK_ERROR,details:f.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:c.type===h.PlaylistContextType.MANIFEST,url:l.url,reason:d,response:l,context:c,networkDetails:w})},i.handleNetworkError=function(l,c,d,w){d===void 0&&(d=!1),E.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var m=f.ErrorDetails.UNKNOWN,S=!1,C=this.getInternalLoader(l);switch(l.type){case h.PlaylistContextType.MANIFEST:m=d?f.ErrorDetails.MANIFEST_LOAD_TIMEOUT:f.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case h.PlaylistContextType.LEVEL:m=d?f.ErrorDetails.LEVEL_LOAD_TIMEOUT:f.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case h.PlaylistContextType.AUDIO_TRACK:m=d?f.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case h.PlaylistContextType.SUBTITLE_TRACK:m=d?f.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:f.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}C&&this.resetInternalLoader(l.type);var v={type:f.ErrorTypes.NETWORK_ERROR,details:m,fatal:S,url:l.url,loader:C,context:l,networkDetails:c};w&&(v.response=w),this.hls.trigger(M.Events.ERROR,v)},i.handlePlaylistLoaded=function(l,c,d,w){var m=d.type,S=d.level,C=d.id,v=d.groupId,y=d.loader,T=d.levelDetails,A=d.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(l,d,"invalid target duration",w);return}if(!y)return;T.live&&(y.getCacheAge&&(T.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(m){case h.PlaylistContextType.MANIFEST:case h.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:T,level:S||0,id:C||0,stats:c,networkDetails:w,deliveryDirectives:A});break;case h.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:T,id:C||0,groupId:v||"",stats:c,networkDetails:w,deliveryDirectives:A});break;case h.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:T,id:C||0,groupId:v||"",stats:c,networkDetails:w,deliveryDirectives:A});break}},t}();L.default=n},"./src/polyfills/number.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"isFiniteNumber",function(){return k}),I.d(L,"MAX_SAFE_INTEGER",function(){return M});var k=Number.isFinite||function(f){return typeof f=="number"&&isFinite(f)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(V,L,I){"use strict";I.r(L);var k=function(){function M(){}return M.getSilentFrame=function(E,x){switch(E){case"mp4a.40.2":if(x===1)return new Uint8Array([0,200,0,128,35,128]);if(x===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(x===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(x===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(x===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(x===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(x===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(x===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(x===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},M}();L.default=k},"./src/remux/mp4-generator.ts":function(V,L,I){"use strict";I.r(L);var k=Math.pow(2,32)-1,M=function(){function f(){}return f.init=function(){f.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 x;for(x in f.types)f.types.hasOwnProperty(x)&&(f.types[x]=[x.charCodeAt(0),x.charCodeAt(1),x.charCodeAt(2),x.charCodeAt(3)]);var g=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]),h=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]);f.HDLR_TYPES={video:g,audio:h};var o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),u=new Uint8Array([0,0,0,0,0,0,0,0]);f.STTS=f.STSC=f.STCO=u,f.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),f.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),f.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),f.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var r=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),t=new Uint8Array([0,0,0,1]);f.FTYP=f.box(f.types.ftyp,r,t,r,n),f.DINF=f.box(f.types.dinf,f.box(f.types.dref,o))},f.box=function(x){for(var g=8,h=arguments.length,o=new Array(h>1?h-1:0),u=1;u<h;u++)o[u-1]=arguments[u];for(var r=o.length,n=r;r--;)g+=o[r].byteLength;var t=new Uint8Array(g);for(t[0]=g>>24&255,t[1]=g>>16&255,t[2]=g>>8&255,t[3]=g&255,t.set(x,4),r=0,g=8;r<n;r++)t.set(o[r],g),g+=o[r].byteLength;return t},f.hdlr=function(x){return f.box(f.types.hdlr,f.HDLR_TYPES[x])},f.mdat=function(x){return f.box(f.types.mdat,x)},f.mdhd=function(x,g){g*=x;var h=Math.floor(g/(k+1)),o=Math.floor(g%(k+1));return f.box(f.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,x>>24&255,x>>16&255,x>>8&255,x&255,h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))},f.mdia=function(x){return f.box(f.types.mdia,f.mdhd(x.timescale,x.duration),f.hdlr(x.type),f.minf(x))},f.mfhd=function(x){return f.box(f.types.mfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255]))},f.minf=function(x){return x.type==="audio"?f.box(f.types.minf,f.box(f.types.smhd,f.SMHD),f.DINF,f.stbl(x)):f.box(f.types.minf,f.box(f.types.vmhd,f.VMHD),f.DINF,f.stbl(x))},f.moof=function(x,g,h){return f.box(f.types.moof,f.mfhd(x),f.traf(h,g))},f.moov=function(x){for(var g=x.length,h=[];g--;)h[g]=f.trak(x[g]);return f.box.apply(null,[f.types.moov,f.mvhd(x[0].timescale,x[0].duration)].concat(h).concat(f.mvex(x)))},f.mvex=function(x){for(var g=x.length,h=[];g--;)h[g]=f.trex(x[g]);return f.box.apply(null,[f.types.mvex].concat(h))},f.mvhd=function(x,g){g*=x;var h=Math.floor(g/(k+1)),o=Math.floor(g%(k+1)),u=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,x>>24&255,x>>16&255,x>>8&255,x&255,h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&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 f.box(f.types.mvhd,u)},f.sdtp=function(x){var g=x.samples||[],h=new Uint8Array(4+g.length),o,u;for(o=0;o<g.length;o++)u=g[o].flags,h[o+4]=u.dependsOn<<4|u.isDependedOn<<2|u.hasRedundancy;return f.box(f.types.sdtp,h)},f.stbl=function(x){return f.box(f.types.stbl,f.stsd(x),f.box(f.types.stts,f.STTS),f.box(f.types.stsc,f.STSC),f.box(f.types.stsz,f.STSZ),f.box(f.types.stco,f.STCO))},f.avc1=function(x){var g=[],h=[],o,u,r;for(o=0;o<x.sps.length;o++)u=x.sps[o],r=u.byteLength,g.push(r>>>8&255),g.push(r&255),g=g.concat(Array.prototype.slice.call(u));for(o=0;o<x.pps.length;o++)u=x.pps[o],r=u.byteLength,h.push(r>>>8&255),h.push(r&255),h=h.concat(Array.prototype.slice.call(u));var n=f.box(f.types.avcC,new Uint8Array([1,g[3],g[4],g[5],252|3,224|x.sps.length].concat(g).concat([x.pps.length]).concat(h))),t=x.width,i=x.height,s=x.pixelRatio[0],l=x.pixelRatio[1];return f.box(f.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,t>>8&255,t&255,i>>8&255,i&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]),n,f.box(f.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),f.box(f.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255])))},f.esds=function(x){var g=x.config.length;return new Uint8Array([0,0,0,0,3,23+g,0,1,0,4,15+g,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([g]).concat(x.config).concat([6,1,2]))},f.mp4a=function(x){var g=x.samplerate;return f.box(f.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,x.channelCount,0,16,0,0,0,0,g>>8&255,g&255,0,0]),f.box(f.types.esds,f.esds(x)))},f.mp3=function(x){var g=x.samplerate;return f.box(f.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,x.channelCount,0,16,0,0,0,0,g>>8&255,g&255,0,0]))},f.stsd=function(x){return x.type==="audio"?!x.isAAC&&x.codec==="mp3"?f.box(f.types.stsd,f.STSD,f.mp3(x)):f.box(f.types.stsd,f.STSD,f.mp4a(x)):f.box(f.types.stsd,f.STSD,f.avc1(x))},f.tkhd=function(x){var g=x.id,h=x.duration*x.timescale,o=x.width,u=x.height,r=Math.floor(h/(k+1)),n=Math.floor(h%(k+1));return f.box(f.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,g>>24&255,g>>16&255,g>>8&255,g&255,0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&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,o>>8&255,o&255,0,0,u>>8&255,u&255,0,0]))},f.traf=function(x,g){var h=f.sdtp(x),o=x.id,u=Math.floor(g/(k+1)),r=Math.floor(g%(k+1));return f.box(f.types.traf,f.box(f.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),f.box(f.types.tfdt,new Uint8Array([1,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,r>>24,r>>16&255,r>>8&255,r&255])),f.trun(x,h.length+16+20+8+16+8+8),h)},f.trak=function(x){return x.duration=x.duration||4294967295,f.box(f.types.trak,f.tkhd(x),f.mdia(x))},f.trex=function(x){var g=x.id;return f.box(f.types.trex,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},f.trun=function(x,g){var h=x.samples||[],o=h.length,u=12+16*o,r=new Uint8Array(u),n,t,i,s,l,c;for(g+=8+u,r.set([0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,g>>>24&255,g>>>16&255,g>>>8&255,g&255],0),n=0;n<o;n++)t=h[n],i=t.duration,s=t.size,l=t.flags,c=t.cts,r.set([i>>>24&255,i>>>16&255,i>>>8&255,i&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,c>>>24&255,c>>>16&255,c>>>8&255,c&255],12+16*n);return f.box(f.types.trun,r)},f.initSegment=function(x){f.types||f.init();var g=f.moov(x),h=new Uint8Array(f.FTYP.byteLength+g.byteLength);return h.set(f.FTYP),h.set(g,f.FTYP.byteLength),h},f}();M.types=void 0,M.HDLR_TYPES=void 0,M.STTS=void 0,M.STSC=void 0,M.STCO=void 0,M.STSZ=void 0,M.VMHD=void 0,M.SMHD=void 0,M.STSD=void 0,M.FTYP=void 0,M.DINF=void 0,L.default=M},"./src/remux/mp4-remuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return c}),I.d(L,"normalizePts",function(){return d});var k=I("./src/polyfills/number.ts"),M=I("./src/remux/aac-helper.ts"),f=I("./src/remux/mp4-generator.ts"),E=I("./src/events.ts"),x=I("./src/errors.ts"),g=I("./src/utils/logger.ts"),h=I("./src/types/loader.ts"),o=I("./src/utils/timescale-conversion.ts");function u(){return u=Object.assign||function(C){for(var v=1;v<arguments.length;v++){var y=arguments[v];for(var T in y)Object.prototype.hasOwnProperty.call(y,T)&&(C[T]=y[T])}return C},u.apply(this,arguments)}var r=10*1e3,n=1024,t=1152,i=null,s=null,l=!1,c=function(){function C(y,T,A,p){if(p===void 0&&(p=""),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=y,this.config=T,this.typeSupported=A,this.ISGenerated=!1,i===null){var D=navigator.userAgent||"",O=D.match(/Chrome\/(\d+)/i);i=O?parseInt(O[1]):0}if(s===null){var P=navigator.userAgent.match(/Safari\/(\d+)/i);s=P?parseInt(P[1]):0}l=!!i&&i<75||!!s&&s<600}var v=C.prototype;return v.destroy=function(){},v.resetTimeStamp=function(T){g.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=T},v.resetNextTimestamp=function(){g.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){g.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(T){var A=!1,p=T.reduce(function(D,O){var P=O.pts-D;return P<-4294967296?(A=!0,d(D,O.pts)):P>0?D:O.pts},T[0].pts);return A&&g.logger.debug("PTS rollover detected"),p},v.remux=function(T,A,p,D,O,P,j,K){var U,X,B,N,z,te,ce=O,be=O,Fe=T.pid>-1,Oe=A.pid>-1,Re=A.samples.length,Be=T.samples.length>0,Ke=Re>1,Ae=(!Fe||Be)&&(!Oe||Ke)||this.ISGenerated||j;if(Ae){this.ISGenerated||(B=this.generateIS(T,A,O));var _e=this.isVideoContiguous,le=-1;if(Ke&&(le=w(A.samples),!_e&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,le>0){g.logger.warn("[mp4-remuxer]: Dropped "+le+" out of "+Re+" video samples due to a missing keyframe");var Ee=this.getVideoStartPts(A.samples);A.samples=A.samples.slice(le),A.dropped+=le,be+=(A.samples[0].pts-Ee)/(A.timescale||9e4)}else le===-1&&(g.logger.warn("[mp4-remuxer]: No keyframe found out of "+Re+" video samples"),te=!1);if(this.ISGenerated){if(Be&&Ke){var pe=this.getVideoStartPts(A.samples),Ge=d(T.samples[0].pts,pe)-pe,Ye=Ge/A.inputTimeScale;ce+=Math.max(0,Ye),be+=Math.max(0,-Ye)}if(Be){if(T.samplerate||(g.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(T,A,O)),X=this.remuxAudio(T,ce,this.isAudioContiguous,P,Oe||Ke||K===h.PlaylistLevelType.AUDIO?be:void 0),Ke){var ze=X?X.endPTS-X.startPTS:0;A.inputTimeScale||(g.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(T,A,O)),U=this.remuxVideo(A,be,_e,ze)}}else Ke&&(U=this.remuxVideo(A,be,_e,0));U&&(U.firstKeyFrame=le,U.independent=le!==-1)}}return this.ISGenerated&&(p.samples.length&&(z=this.remuxID3(p,O)),D.samples.length&&(N=this.remuxText(D,O))),{audio:X,video:U,initSegment:B,independent:te,text:N,id3:z}},v.generateIS=function(T,A,p){var D=T.samples,O=A.samples,P=this.typeSupported,j={},K=!Object(k.isFiniteNumber)(this._initPTS),U="audio/mp4",X,B,N;if(K&&(X=B=Infinity),T.config&&D.length&&(T.timescale=T.samplerate,T.isAAC||(P.mpeg?(U="audio/mpeg",T.codec=""):P.mp3&&(T.codec="mp3")),j.audio={id:"audio",container:U,codec:T.codec,initSegment:!T.isAAC&&P.mpeg?new Uint8Array(0):f.default.initSegment([T]),metadata:{channelCount:T.channelCount}},K&&(N=T.inputTimeScale,X=B=D[0].pts-Math.round(N*p))),A.sps&&A.pps&&O.length&&(A.timescale=A.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:A.codec,initSegment:f.default.initSegment([A]),metadata:{width:A.width,height:A.height}},K)){N=A.inputTimeScale;var z=this.getVideoStartPts(O),te=Math.round(N*p);B=Math.min(B,d(O[0].dts,z)-te),X=Math.min(X,z-te)}if(Object.keys(j).length)return this.ISGenerated=!0,K&&(this._initPTS=X,this._initDTS=B),{tracks:j,initPTS:X,timescale:N}},v.remuxVideo=function(T,A,p,D){var O=T.inputTimeScale,P=T.samples,j=[],K=P.length,U=this._initPTS,X=this.nextAvcDts,B=8,N,z,te,ce=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,Fe=0,Oe=!1;if(!p||X===null){var Re=A*O,Be=P[0].pts-d(P[0].dts,P[0].pts);X=Re-Be}for(var Ke=0;Ke<K;Ke++){var Ae=P[Ke];if(Ae.pts=d(Ae.pts-U,X),Ae.dts=d(Ae.dts-U,X),Ae.dts>Ae.pts){var _e=9e4*.2;Fe=Math.max(Math.min(Fe,Ae.pts-Ae.dts),-1*_e)}Ae.dts<P[Ke>0?Ke-1:Ke].dts&&(Oe=!0)}Oe&&P.sort(function(Xe,lt){var tt=Xe.dts-lt.dts,st=Xe.pts-lt.pts;return tt||st}),z=P[0].dts,te=P[P.length-1].dts;var le=Math.round((te-z)/(K-1));if(Fe<0){if(Fe<le*-2){g.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(o.toMsFromMpegTsClock)(-le,!0)+" ms");for(var Ee=Fe,pe=0;pe<K;pe++)P[pe].dts=Ee=Math.max(Ee,P[pe].pts-le),P[pe].pts=Math.max(Ee,P[pe].pts)}else{g.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(o.toMsFromMpegTsClock)(Fe,!0)+" ms to overcome this issue");for(var Ge=0;Ge<K;Ge++)P[Ge].dts=P[Ge].dts+Fe}z=P[0].dts}if(p){var Ye=z-X,ze=Ye>le,Ze=Ye<-1;if(ze||Ze){ze?g.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(Ye,!0)+" ms ("+Ye+"dts) hole between fragments detected, filling it"):g.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(-Ye,!0)+" ms ("+Ye+"dts) overlapping between fragments detected"),z=X;var Je=P[0].pts-Ye;P[0].dts=z,P[0].pts=Je,g.logger.log("Video: First PTS/DTS adjusted: "+Object(o.toMsFromMpegTsClock)(Je,!0)+"/"+Object(o.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(o.toMsFromMpegTsClock)(Ye,!0)+" ms")}}l&&(z=Math.max(0,z));for(var $e=0,He=0,Ue=0;Ue<K;Ue++){for(var Pe=P[Ue],ke=Pe.units,re=ke.length,ve=0,ae=0;ae<re;ae++)ve+=ke[ae].data.length;He+=ve,$e+=re,Pe.length=ve,Pe.dts=Math.max(Pe.dts,z),Pe.pts=Math.max(Pe.pts,Pe.dts,0),ce=Math.min(Pe.pts,ce),be=Math.max(Pe.pts,be)}te=P[K-1].dts;var De=He+4*$e+8,qe;try{qe=new Uint8Array(De)}catch(Xe){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:x.ErrorTypes.MUX_ERROR,details:x.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:De,reason:"fail allocating video mdat "+De});return}var et=new DataView(qe.buffer);et.setUint32(0,De),qe.set(f.default.types.mdat,4);for(var je=0;je<K;je++){for(var ct=P[je],he=ct.units,Te=0,We=0,xe=he.length;We<xe;We++){var ge=he[We],ye=ge.data,J=ge.data.byteLength;et.setUint32(B,J),B+=4,qe.set(ye,B),B+=J,Te+=4+J}if(je<K-1)N=P[je+1].dts-ct.dts;else{var ne=this.config,q=ct.dts-P[je>0?je-1:je].dts;if(ne.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(ne.maxBufferHole*O),Ce=(D?ce+D*O:this.nextAudioPts)-ct.pts;Ce>me?(N=Ce-q,N<0&&(N=q),g.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=q}else N=q}var G=Math.round(ct.pts-ct.dts);j.push(new m(ct.key,N,Te,G))}if(j.length&&i&&i<70){var we=j[0].flags;we.dependsOn=2,we.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=X=te+N,this.isVideoContiguous=!0;var Ne=f.default.moof(T.sequenceNumber++,z,u({},T,{samples:j})),de="video",Se={data1:Ne,data2:qe,startPTS:ce/O,endPTS:(be+N)/O,startDTS:z/O,endDTS:X/O,type:de,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),Se},v.remuxAudio=function(T,A,p,D,O){var P=T.inputTimeScale,j=T.samplerate?T.samplerate:P,K=P/j,U=T.isAAC?n:t,X=U*K,B=this._initPTS,N=!T.isAAC&&this.typeSupported.mpeg,z=[],te=T.samples,ce=N?0:8,be=this.nextAudioPts||-1,Fe=A*P;if(this.isAudioContiguous=p=p||te.length&&be>0&&(D&&Math.abs(Fe-be)<9e3||Math.abs(d(te[0].pts-B,Fe)-be)<20*X),te.forEach(function(ye){ye.pts=d(ye.pts-B,Fe)}),!p||be<0){if(te=te.filter(function(ye){return ye.pts>=0}),!te.length)return;O===0?be=0:D?be=Math.max(0,Fe):be=te[0].pts}if(T.isAAC)for(var Oe=O!==void 0,Re=this.config.maxAudioFramesDrift,Be=0,Ke=be;Be<te.length;Be++){var Ae=te[Be],_e=Ae.pts,le=_e-Ke,Ee=Math.abs(1e3*le/P);if(le<=-Re*X&&Oe)Be===0&&(g.logger.warn("Audio frame @ "+(_e/P).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*le/P)+" ms."),this.nextAudioPts=be=Ke=_e);else if(le>=Re*X&&Ee<r&&Oe){var pe=Math.round(le/X);Ke=_e-pe*X,Ke<0&&(pe--,Ke+=X),Be===0&&(this.nextAudioPts=be=Ke),g.logger.warn("[mp4-remuxer]: Injecting "+pe+" audio frame @ "+(Ke/P).toFixed(3)+"s due to "+Math.round(1e3*le/P)+" ms gap.");for(var Ge=0;Ge<pe;Ge++){var Ye=Math.max(Ke,0),ze=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);ze||(g.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ze=Ae.unit.subarray()),te.splice(Be,0,{unit:ze,pts:Ye}),Ke+=X,Be++}}Ae.pts=Ke,Ke+=X}for(var Ze=null,Je=null,$e,He=0,Ue=te.length;Ue--;)He+=te[Ue].unit.byteLength;for(var Pe=0,ke=te.length;Pe<ke;Pe++){var re=te[Pe],ve=re.unit,ae=re.pts;if(Je!==null){var De=z[Pe-1];De.duration=Math.round((ae-Je)/K)}else if(p&&T.isAAC&&(ae=be),Ze=ae,He>0){He+=ce;try{$e=new Uint8Array(He)}catch(ye){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:x.ErrorTypes.MUX_ERROR,details:x.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating audio mdat "+He});return}if(!N){var qe=new DataView($e.buffer);qe.setUint32(0,He),$e.set(f.default.types.mdat,4)}}else return;$e.set(ve,ce);var et=ve.byteLength;ce+=et,z.push(new m(!0,U,et,0)),Je=ae}var je=z.length;if(!je)return;var ct=z[z.length-1];this.nextAudioPts=be=Je+K*ct.duration;var he=N?new Uint8Array(0):f.default.moof(T.sequenceNumber++,Ze/K,u({},T,{samples:z}));T.samples=[];var Te=Ze/P,We=be/P,xe="audio",ge={data1:he,data2:$e,startPTS:Te,endPTS:We,startDTS:Te,endDTS:We,type:xe,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert($e.length,"MDAT length must not be zero"),ge},v.remuxEmptyAudio=function(T,A,p,D){var O=T.inputTimeScale,P=T.samplerate?T.samplerate:O,j=O/P,K=this.nextAudioPts,U=(K!==null?K:D.startDTS*O)+this._initDTS,X=D.endDTS*O+this._initDTS,B=j*n,N=Math.ceil((X-U)/B),z=M.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(g.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){g.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],ce=0;ce<N;ce++){var be=U+ce*B;te.push({unit:z,pts:be,dts:be})}return T.samples=te,this.remuxAudio(T,A,p,!1)},v.remuxID3=function(T,A){var p=T.samples.length;if(!p)return;for(var D=T.inputTimeScale,O=this._initPTS,P=this._initDTS,j=0;j<p;j++){var K=T.samples[j];K.pts=d(K.pts-O,A*D)/D,K.dts=d(K.dts-P,A*D)/D}var U=T.samples;return T.samples=[],{samples:U}},v.remuxText=function(T,A){var p=T.samples.length;if(!p)return;for(var D=T.inputTimeScale,O=this._initPTS,P=0;P<p;P++){var j=T.samples[P];j.pts=d(j.pts-O,A*D)/D}T.samples.sort(function(U,X){return U.pts-X.pts});var K=T.samples;return T.samples=[],{samples:K}},C}();function d(C,v){var y;if(v===null)return C;for(v<C?y=-8589934592:y=8589934592;Math.abs(C-v)>4294967296;)C+=y;return C}function w(C){for(var v=0;v<C.length;v++)if(C[v].key)return v;return-1}var m=function(v,y,T,A){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=T,this.cts=A,this.flags=new S(v)},S=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/polyfills/number.ts"),M=I("./src/utils/mp4-tools.ts"),f=I("./src/loader/fragment.ts"),E=I("./src/utils/logger.ts"),x=function(){function o(){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 u=o.prototype;return u.destroy=function(){},u.resetTimeStamp=function(n){this.initPTS=n,this.lastEndDTS=null},u.resetNextTimestamp=function(){this.lastEndDTS=null},u.resetInitSegment=function(n,t,i){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(n),this.emitInitSegment=!0},u.generateInitSegment=function(n){var t=this.audioCodec,i=this.videoCodec;if(!n||!n.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(M.parseInitSegment)(n);t||(t=h(s.audio,f.ElementaryStreamTypes.AUDIO)),i||(i=h(s.video,f.ElementaryStreamTypes.VIDEO));var l={};s.audio&&s.video?l.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:n,id:"main"}:s.audio?l.audio={container:"audio/mp4",codec:t,initSegment:n,id:"audio"}:s.video?l.video={container:"video/mp4",codec:i,initSegment:n,id:"main"}:E.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=l},u.remux=function(n,t,i,s,l){var c=this.initPTS,d=this.lastEndDTS,w={audio:void 0,video:void 0,text:s,id3:i,initSegment:void 0};Object(k.isFiniteNumber)(d)||(d=this.lastEndDTS=l||0);var m=t.samples;if(!m||!m.length)return w;var S={initPTS:void 0,timescale:1},C=this.initData;if((!C||!C.length)&&(this.generateInitSegment(m),C=this.initData),!C||!C.length)return E.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(k.isFiniteNumber)(c)||(this.initPTS=S.initPTS=c=g(C,m,d));var v=Object(M.getDuration)(m,C),y=d,T=v+y;Object(M.offsetStartDTS)(C,m,c),v>0?this.lastEndDTS=T:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var A=!!C.audio,p=!!C.video,D="";A&&(D+="audio"),p&&(D+="video");var O={data1:m,startPTS:y,startDTS:y,endPTS:T,endDTS:T,type:D,hasAudio:A,hasVideo:p,nb:1,dropped:0};return w.audio=O.type==="audio"?O:void 0,w.video=O.type!=="audio"?O:void 0,w.text=s,w.id3=i,w.initSegment=S,w},o}(),g=function(u,r,n){return Object(M.getStartDTS)(u,r)-n};function h(o,u){var r=o==null?void 0:o.codec;return r&&r.length>4?r:r==="hvc1"?"hvc1.1.c.L120.90":r==="av01"?"av01.0.04M.08":r==="avc1"||u===f.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}L.default=x},"./src/task-loop.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return k});var k=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var f=M.prototype;return f.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},f.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},f.onHandlerDestroyed=function(){},f.hasInterval=function(){return!!this._tickInterval},f.hasNextTick=function(){return!!this._tickTimer},f.setInterval=function(x){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,x),!0)},f.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},f.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},f.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},f.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},f.doTick=function(){},M}()},"./src/types/cmcd.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"CMCDVersion",function(){return k}),I.d(L,"CMCDObjectType",function(){return M}),I.d(L,"CMCDStreamingFormat",function(){return f}),I.d(L,"CMCDStreamType",function(){return E});var k=1,M;(function(x){x.MANIFEST="m",x.AUDIO="a",x.VIDEO="v",x.MUXED="av",x.INIT="i",x.CAPTION="c",x.TIMED_TEXT="tt",x.KEY="k",x.OTHER="o"})(M||(M={}));var f;(function(x){x.DASH="d",x.HLS="h",x.SMOOTH="s",x.OTHER="o"})(f||(f={}));var E;(function(x){x.VOD="v",x.LIVE="l"})(E||(E={}))},"./src/types/level.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"HlsSkip",function(){return f}),I.d(L,"getSkipValue",function(){return E}),I.d(L,"HlsUrlParameters",function(){return x}),I.d(L,"Level",function(){return g});function k(h,o){for(var u=0;u<o.length;u++){var r=o[u];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(h,r.key,r)}}function M(h,o,u){return o&&k(h.prototype,o),u&&k(h,u),h}var f;(function(h){h.No="",h.Yes="YES",h.v2="v2"})(f||(f={}));function E(h,o){var u=h.canSkipUntil,r=h.canSkipDateRanges,n=h.endSN,t=o!==void 0?o-n:0;return u&&t<u?r?f.v2:f.Yes:f.No}var x=function(){function h(u,r,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=u,this.part=r,this.skip=n}var o=h.prototype;return o.addDirectives=function(r){var n=new self.URL(r);return this.msn!==void 0&&n.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&n.searchParams.set("_HLS_part",this.part.toString()),this.skip&&n.searchParams.set("_HLS_skip",this.skip),n.toString()},h}(),g=function(){function h(o){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=[o.url],this.attrs=o.attrs,this.bitrate=o.bitrate,o.details&&(this.details=o.details),this.id=o.id||0,this.name=o.name,this.width=o.width||0,this.height=o.height||0,this.audioCodec=o.audioCodec,this.videoCodec=o.videoCodec,this.unknownCodecs=o.unknownCodecs,this.codecSet=[o.videoCodec,o.audioCodec].filter(function(u){return u}).join(",").replace(/\.[^.,]+/g,"")}return M(h,[{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(u){var r=u%this.url.length;this._urlId!==r&&(this.details=void 0,this._urlId=r)}}]),h}()},"./src/types/loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"PlaylistContextType",function(){return k}),I.d(L,"PlaylistLevelType",function(){return M});var k;(function(f){f.MANIFEST="manifest",f.LEVEL="level",f.AUDIO_TRACK="audioTrack",f.SUBTITLE_TRACK="subtitleTrack"})(k||(k={}));var M;(function(f){f.MAIN="main",f.AUDIO="audio",f.SUBTITLE="subtitle"})(M||(M={}))},"./src/types/transmuxer.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"ChunkMetadata",function(){return k});var k=function(E,x,g,h,o,u){h===void 0&&(h=0),o===void 0&&(o=-1),u===void 0&&(u=!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=M(),this.buffering={audio:M(),video:M(),audiovideo:M()},this.level=E,this.sn=x,this.id=g,this.size=h,this.part=o,this.partial=u};function M(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"AttrList",function(){return f});var k=/^(\d+)x(\d+)$/,M=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,f=function(){function E(g){typeof g=="string"&&(g=E.parseAttrList(g));for(var h in g)g.hasOwnProperty(h)&&(this[h]=g[h])}var x=E.prototype;return x.decimalInteger=function(h){var o=parseInt(this[h],10);return o>Number.MAX_SAFE_INTEGER?Infinity:o},x.hexadecimalInteger=function(h){if(this[h]){var o=(this[h]||"0x").slice(2);o=(o.length&1?"0":"")+o;for(var u=new Uint8Array(o.length/2),r=0;r<o.length/2;r++)u[r]=parseInt(o.slice(r*2,r*2+2),16);return u}else return null},x.hexadecimalIntegerAsNumber=function(h){var o=parseInt(this[h],16);return o>Number.MAX_SAFE_INTEGER?Infinity:o},x.decimalFloatingPoint=function(h){return parseFloat(this[h])},x.optionalFloat=function(h,o){var u=this[h];return u?parseFloat(u):o},x.enumeratedString=function(h){return this[h]},x.bool=function(h){return this[h]==="YES"},x.decimalResolution=function(h){var o=k.exec(this[h]);return o===null?void 0:{width:parseInt(o[1],10),height:parseInt(o[2],10)}},E.parseAttrList=function(h){var o,u={},r='"';for(M.lastIndex=0;(o=M.exec(h))!==null;){var n=o[2];n.indexOf(r)===0&&n.lastIndexOf(r)===n.length-1&&(n=n.slice(1,-1)),u[o[1]]=n}return u},E}()},"./src/utils/binary-search.ts":function(V,L,I){"use strict";I.r(L);var k={search:function(f,E){for(var x=0,g=f.length-1,h=null,o=null;x<=g;){h=(x+g)/2|0,o=f[h];var u=E(o);if(u>0)x=h+1;else if(u<0)g=h-1;else return o}return null}};L.default=k},"./src/utils/buffer-helper.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"BufferHelper",function(){return f});var k=I("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},f=function(){function E(){}return E.isBuffered=function(g,h){try{if(g){for(var o=E.getBuffered(g),u=0;u<o.length;u++)if(h>=o.start(u)&&h<=o.end(u))return!0}}catch(r){}return!1},E.bufferInfo=function(g,h,o){try{if(g){var u=E.getBuffered(g),r=[],n;for(n=0;n<u.length;n++)r.push({start:u.start(n),end:u.end(n)});return this.bufferedInfo(r,h,o)}}catch(t){}return{len:0,start:h,end:h,nextStart:void 0}},E.bufferedInfo=function(g,h,o){h=Math.max(0,h),g.sort(function(S,C){var v=S.start-C.start;return v||C.end-S.end});var u=[];if(o)for(var r=0;r<g.length;r++){var n=u.length;if(n){var t=u[n-1].end;g[r].start-t<o?g[r].end>t&&(u[n-1].end=g[r].end):u.push(g[r])}else u.push(g[r])}else u=g;for(var i=0,s,l=h,c=h,d=0;d<u.length;d++){var w=u[d].start,m=u[d].end;if(h+o>=w&&h<m)l=w,c=m,i=c-h;else if(h+o<w){s=w;break}}return{len:i,start:l||0,end:c||0,nextStart:s}},E.getBuffered=function(g){try{return g.buffered}catch(h){return k.logger.log("failed to get media.buffered",h),M}},E}()},"./src/utils/cea-608-parser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"Row",function(){return c}),I.d(L,"CaptionScreen",function(){return d});var k=I("./src/utils/logger.ts"),M={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},f=function(T){var A=T;return M.hasOwnProperty(T)&&(A=M[T]),String.fromCharCode(A)},E=15,x=100,g={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},h={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},r=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],n;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(n||(n={}));var t=function(){function y(){this.time=null,this.verboseLevel=n.ERROR}var T=y.prototype;return T.log=function(p,D){this.verboseLevel>=p&&k.logger.log(this.time+" ["+p+"] "+D)},y}(),i=function(T){for(var A=[],p=0;p<T.length;p++)A.push(T[p].toString(16));return A},s=function(){function y(A,p,D,O,P){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=A||"white",this.underline=p||!1,this.italics=D||!1,this.background=O||"black",this.flash=P||!1}var T=y.prototype;return T.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},T.setStyles=function(p){for(var D=["foreground","underline","italics","background","flash"],O=0;O<D.length;O++){var P=D[O];p.hasOwnProperty(P)&&(this[P]=p[P])}},T.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},T.equals=function(p){return this.foreground===p.foreground&&this.underline===p.underline&&this.italics===p.italics&&this.background===p.background&&this.flash===p.flash},T.copy=function(p){this.foreground=p.foreground,this.underline=p.underline,this.italics=p.italics,this.background=p.background,this.flash=p.flash},T.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),l=function(){function y(A,p,D,O,P,j){this.uchar=void 0,this.penState=void 0,this.uchar=A||" ",this.penState=new s(p,D,O,P,j)}var T=y.prototype;return T.reset=function(){this.uchar=" ",this.penState.reset()},T.setChar=function(p,D){this.uchar=p,this.penState.copy(D)},T.setPenState=function(p){this.penState.copy(p)},T.equals=function(p){return this.uchar===p.uchar&&this.penState.equals(p.penState)},T.copy=function(p){this.uchar=p.uchar,this.penState.copy(p.penState)},T.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),c=function(){function y(A){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var p=0;p<x;p++)this.chars.push(new l);this.logger=A,this.pos=0,this.currPenState=new s}var T=y.prototype;return T.equals=function(p){for(var D=!0,O=0;O<x;O++)if(!this.chars[O].equals(p.chars[O])){D=!1;break}return D},T.copy=function(p){for(var D=0;D<x;D++)this.chars[D].copy(p.chars[D])},T.isEmpty=function(){for(var p=!0,D=0;D<x;D++)if(!this.chars[D].isEmpty()){p=!1;break}return p},T.setCursor=function(p){this.pos!==p&&(this.pos=p),this.pos<0?(this.logger.log(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>x&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=x)},T.moveCursor=function(p){var D=this.pos+p;if(p>1)for(var O=this.pos+1;O<D+1;O++)this.chars[O].setPenState(this.currPenState);this.setCursor(D)},T.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},T.insertChar=function(p){p>=144&&this.backSpace();var D=f(p);if(this.pos>=x){this.logger.log(n.ERROR,"Cannot insert "+p.toString(16)+" ("+D+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(D,this.currPenState),this.moveCursor(1)},T.clearFromPos=function(p){var D;for(D=p;D<x;D++)this.chars[D].reset()},T.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},T.clearToEndOfRow=function(){this.clearFromPos(this.pos)},T.getTextString=function(){for(var p=[],D=!0,O=0;O<x;O++){var P=this.chars[O].uchar;P!==" "&&(D=!1),p.push(P)}return D?"":p.join("")},T.setPenStyles=function(p){this.currPenState.setStyles(p);var D=this.chars[this.pos];D.setPenState(this.currPenState)},y}(),d=function(){function y(A){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var p=0;p<E;p++)this.rows.push(new c(A));this.logger=A,this.currRow=E-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var T=y.prototype;return T.reset=function(){for(var p=0;p<E;p++)this.rows[p].clear();this.currRow=E-1},T.equals=function(p){for(var D=!0,O=0;O<E;O++)if(!this.rows[O].equals(p.rows[O])){D=!1;break}return D},T.copy=function(p){for(var D=0;D<E;D++)this.rows[D].copy(p.rows[D])},T.isEmpty=function(){for(var p=!0,D=0;D<E;D++)if(!this.rows[D].isEmpty()){p=!1;break}return p},T.backSpace=function(){var p=this.rows[this.currRow];p.backSpace()},T.clearToEndOfRow=function(){var p=this.rows[this.currRow];p.clearToEndOfRow()},T.insertChar=function(p){var D=this.rows[this.currRow];D.insertChar(p)},T.setPen=function(p){var D=this.rows[this.currRow];D.setPenStyles(p)},T.moveCursor=function(p){var D=this.rows[this.currRow];D.moveCursor(p)},T.setCursor=function(p){this.logger.log(n.INFO,"setCursor: "+p);var D=this.rows[this.currRow];D.setCursor(p)},T.setPAC=function(p){this.logger.log(n.INFO,"pacData = "+JSON.stringify(p));var D=p.row-1;if(this.nrRollUpRows&&D<this.nrRollUpRows-1&&(D=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==D){for(var O=0;O<E;O++)this.rows[O].clear();var P=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var K=j.rows[P].cueStartTime,U=this.logger.time;if(K&&U!==null&&K<U)for(var X=0;X<this.nrRollUpRows;X++)this.rows[D-this.nrRollUpRows+X+1].copy(j.rows[P+X])}}this.currRow=D;var B=this.rows[this.currRow];if(p.indent!==null){var N=p.indent,z=Math.max(N-1,0);B.setCursor(p.indent),p.color=B.chars[z].penState.foreground}var te={foreground:p.color,underline:p.underline,italics:p.italics,background:"black",flash:!1};this.setPen(te)},T.setBkgData=function(p){this.logger.log(n.INFO,"bkgData = "+JSON.stringify(p)),this.backSpace(),this.setPen(p),this.insertChar(32)},T.setRollUpRows=function(p){this.nrRollUpRows=p},T.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(n.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(n.TEXT,this.getDisplayText());var p=this.currRow+1-this.nrRollUpRows,D=this.rows.splice(p,1)[0];D.clear(),this.rows.splice(this.currRow,0,D),this.logger.log(n.INFO,"Rolling up")},T.getDisplayText=function(p){p=p||!1;for(var D=[],O="",P=-1,j=0;j<E;j++){var K=this.rows[j].getTextString();K&&(P=j+1,p?D.push("Row "+P+": '"+K+"'"):D.push(K.trim()))}return D.length>0&&(p?O="["+D.join(" | ")+"]":O=D.join(`
`)),O},T.getTextAndFormat=function(){return this.rows},y}(),w=function(){function y(A,p,D){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=A,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new d(D),this.nonDisplayedMemory=new d(D),this.lastOutputScreen=new d(D),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=D}var T=y.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(p){this.outputFilter=p},T.setPAC=function(p){this.writeScreen.setPAC(p)},T.setBkgData=function(p){this.writeScreen.setBkgData(p)},T.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(n.INFO,"MODE="+p),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=p},T.insertChars=function(p){for(var D=0;D<p.length;D++)this.writeScreen.insertChar(p[D]);var O=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,O+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(n.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},T.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},T.ccBS=function(){if(this.logger.log(n.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},T.ccAOF=function(){},T.ccAON=function(){},T.ccDER=function(){this.logger.log(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},T.ccRU=function(p){this.logger.log(n.INFO,"RU("+p+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(p)},T.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},T.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},T.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},T.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},T.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},T.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},T.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},T.ccEOC=function(){if(this.logger.log(n.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var p=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=p,this.writeScreen=this.nonDisplayedMemory,this.logger.log(n.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},T.ccTO=function(p){this.logger.log(n.INFO,"TO("+p+") - Tab Offset"),this.writeScreen.moveCursor(p)},T.ccMIDROW=function(p){var D={flash:!1};if(D.underline=p%2===1,D.italics=p>=46,D.italics)D.foreground="white";else{var O=Math.floor(p/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];D.foreground=P[O]}this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(D)),this.writeScreen.setPen(D)},T.outputDataUpdate=function(p){p===void 0&&(p=!1);var D=this.logger.time;if(D===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=D:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,D,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:D),this.lastOutputScreen.copy(this.displayedMemory))},T.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},y}(),m=function(){function y(A,p,D){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var O=new t;this.channels=[null,new w(A,p,O),new w(A+1,D,O)],this.cmdHistory=v(),this.logger=O}var T=y.prototype;return T.getHandler=function(p){return this.channels[p].getHandler()},T.setHandler=function(p,D){this.channels[p].setHandler(D)},T.addData=function(p,D){var O,P,j,K=!1;this.logger.time=p;for(var U=0;U<D.length;U+=2){if(P=D[U]&127,j=D[U+1]&127,P===0&&j===0)continue;if(this.logger.log(n.DATA,"["+i([D[U],D[U+1]])+"] -> ("+i([P,j])+")"),O=this.parseCmd(P,j),O||(O=this.parseMidrow(P,j)),O||(O=this.parsePAC(P,j)),O||(O=this.parseBackgroundAttributes(P,j)),!O&&(K=this.parseChars(P,j),K)){var X=this.currentChannel;if(X&&X>0){var B=this.channels[X];B.insertChars(K)}else this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}!O&&!K&&this.logger.log(n.WARNING,"Couldn't parse cleaned data "+i([P,j])+" orig: "+i([D[U],D[U+1]]))}},T.parseCmd=function(p,D){var O=this.cmdHistory,P=(p===20||p===28||p===21||p===29)&&D>=32&&D<=47,j=(p===23||p===31)&&D>=33&&D<=35;if(!(P||j))return!1;if(C(p,D,O))return S(null,null,O),this.logger.log(n.DEBUG,"Repeated command ("+i([p,D])+") is dropped"),!0;var K=p===20||p===21||p===23?1:2,U=this.channels[K];return p===20||p===21||p===28||p===29?D===32?U.ccRCL():D===33?U.ccBS():D===34?U.ccAOF():D===35?U.ccAON():D===36?U.ccDER():D===37?U.ccRU(2):D===38?U.ccRU(3):D===39?U.ccRU(4):D===40?U.ccFON():D===41?U.ccRDC():D===42?U.ccTR():D===43?U.ccRTD():D===44?U.ccEDM():D===45?U.ccCR():D===46?U.ccENM():D===47&&U.ccEOC():U.ccTO(D-32),S(p,D,O),this.currentChannel=K,!0},T.parseMidrow=function(p,D){var O=0;if((p===17||p===25)&&D>=32&&D<=47){if(p===17?O=1:O=2,O!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[O];return P?(P.ccMIDROW(D),this.logger.log(n.DEBUG,"MIDROW ("+i([p,D])+")"),!0):!1}return!1},T.parsePAC=function(p,D){var O,P=this.cmdHistory,j=(p>=17&&p<=23||p>=25&&p<=31)&&D>=64&&D<=127,K=(p===16||p===24)&&D>=64&&D<=95;if(!(j||K))return!1;if(C(p,D,P))return S(null,null,P),!0;var U=p<=23?1:2;D>=64&&D<=95?O=U===1?g[p]:o[p]:O=U===1?h[p]:u[p];var X=this.channels[U];return X?(X.setPAC(this.interpretPAC(O,D)),S(p,D,P),this.currentChannel=U,!0):!1},T.interpretPAC=function(p,D){var O,P={color:null,italics:!1,indent:null,underline:!1,row:p};return D>95?O=D-96:O=D-64,P.underline=(O&1)===1,O<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(O/2)]:O<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((O-16)/2)*4,P},T.parseChars=function(p,D){var O,P=null,j=null;if(p>=25?(O=2,j=p-8):(O=1,j=p),j>=17&&j<=19){var K;j===17?K=D+80:j===18?K=D+112:K=D+144,this.logger.log(n.INFO,"Special char '"+f(K)+"' in channel "+O),P=[K]}else p>=32&&p<=127&&(P=D===0?[p]:[p,D]);if(P){var U=i(P);this.logger.log(n.DEBUG,"Char codes = "+U.join(",")),S(p,D,this.cmdHistory)}return P},T.parseBackgroundAttributes=function(p,D){var O=(p===16||p===24)&&D>=32&&D<=47,P=(p===23||p===31)&&D>=45&&D<=47;if(!(O||P))return!1;var j,K={};p===16||p===24?(j=Math.floor((D-32)/2),K.background=r[j],D%2===1&&(K.background=K.background+"_semi")):D===45?K.background="transparent":(K.foreground="black",D===47&&(K.underline=!0));var U=p<=23?1:2,X=this.channels[U];return X.setBkgData(K),S(p,D,this.cmdHistory),!0},T.reset=function(){for(var p=0;p<Object.keys(this.channels).length;p++){var D=this.channels[p];D&&D.reset()}this.cmdHistory=v()},T.cueSplitAtTime=function(p){for(var D=0;D<this.channels.length;D++){var O=this.channels[D];O&&O.cueSplitAtTime(p)}},y}();function S(y,T,A){A.a=y,A.b=T}function C(y,T,A){return A.a===y&&A.b===T}function v(){return{a:null,b:null}}L.default=m},"./src/utils/codecs.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"isCodecType",function(){return M}),I.d(L,"isCodecSupportedInMp4",function(){return f});var k={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 M(E,x){var g=k[x];return!!g&&g[E.slice(0,4)]===!0}function f(E,x){return MediaSource.isTypeSupported((x||"video")+'/mp4;codecs="'+E+'"')}},"./src/utils/cues.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/utils/vttparser.ts"),M=I("./src/utils/webvtt-parser.ts"),f=I("./src/utils/texttrack-utils.ts"),E=/\s/,x={newCue:function(h,o,u,r){for(var n=[],t,i,s,l,c,d=self.VTTCue||self.TextTrackCue,w=0;w<r.rows.length;w++)if(t=r.rows[w],s=!0,l=0,c="",!t.isEmpty()){for(var m=0;m<t.chars.length;m++)E.test(t.chars[m].uchar)&&s?l++:(c+=t.chars[m].uchar,s=!1);t.cueStartTime=o,o===u&&(u+=1e-4),l>=16?l--:l++;var S=Object(k.fixLineBreaks)(c.trim()),C=Object(M.generateCueId)(o,u,S);(!h||!h.cues||!h.cues.getCueById(C))&&(i=new d(o,u,S),i.id=C,i.line=w+1,i.align="left",i.position=10+Math.min(80,Math.floor(l*8/32)*10),n.push(i))}return h&&n.length&&(n.sort(function(v,y){return v.line==="auto"||y.line==="auto"?0:v.line>8&&y.line>8?y.line-v.line:v.line-y.line}),n.forEach(function(v){return Object(f.addCueToTrack)(h,v)})),n}};L.default=x},"./src/utils/discontinuities.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"findFirstFragWithCC",function(){return E}),I.d(L,"shouldAlignOnDiscontinuities",function(){return x}),I.d(L,"findDiscontinuousReferenceFrag",function(){return g}),I.d(L,"adjustSlidingStart",function(){return o}),I.d(L,"alignStream",function(){return u}),I.d(L,"alignPDT",function(){return n}),I.d(L,"alignFragmentByPDTDelta",function(){return t}),I.d(L,"alignMediaPlaylistByPDT",function(){return i});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/logger.ts"),f=I("./src/controller/level-helper.ts");function E(s,l){for(var c=null,d=0,w=s.length;d<w;d++){var m=s[d];if(m&&m.cc===l){c=m;break}}return c}function x(s,l,c){return!!(l.details&&(c.endCC>c.startCC||s&&s.cc<c.startCC))}function g(s,l){var c=s.fragments,d=l.fragments;if(!d.length||!c.length){M.logger.log("No fragments to align");return}var w=E(c,d[0].cc);if(!w||w&&!w.startPTS){M.logger.log("No frag in previous level to align on");return}return w}function h(s,l){if(s){var c=s.start+l;s.start=s.startPTS=c,s.endPTS=c+s.duration}}function o(s,l){for(var c=l.fragments,d=0,w=c.length;d<w;d++)h(c[d],s);l.fragmentHint&&h(l.fragmentHint,s),l.alignedSliding=!0}function u(s,l,c){if(!l)return;r(s,c,l),!c.alignedSliding&&l.details&&n(c,l.details),!c.alignedSliding&&l.details&&!c.skippedSegments&&Object(f.adjustSliding)(l.details,c)}function r(s,l,c){if(x(s,c,l)){var d=g(c.details,l);d&&Object(k.isFiniteNumber)(d.start)&&(M.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),o(d.start,l))}}function n(s,l){if(!l.fragments.length||!s.hasProgramDateTime||!l.hasProgramDateTime)return;var c=l.fragments[0].programDateTime,d=s.fragments[0].programDateTime,w=(d-c)/1e3+l.fragments[0].start;w&&Object(k.isFiniteNumber)(w)&&(M.logger.log("Adjusting PTS using programDateTime delta "+(d-c)+"ms, sliding:"+w.toFixed(3)+" "+s.url+" "),o(w,s))}function t(s,l){var c=s.programDateTime;if(!c)return;var d=(c-l)/1e3;s.start=s.startPTS=d,s.endPTS=d+s.duration}function i(s,l){if(!l.fragments.length||!s.hasProgramDateTime||!l.hasProgramDateTime)return;var c=l.fragments[0].programDateTime,d=l.fragments[0].start,w=c-d*1e3;s.fragments.forEach(function(m){t(m,w)}),s.fragmentHint&&t(s.fragmentHint,w),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/utils/ewma.ts"),M=function(){function f(x,g,h){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=h,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new k.default(x),this.fast_=new k.default(g)}var E=f.prototype;return E.update=function(g,h){var o=this.slow_,u=this.fast_;this.slow_.halfLife!==g&&(this.slow_=new k.default(g,o.getEstimate(),o.getTotalWeight())),this.fast_.halfLife!==h&&(this.fast_=new k.default(h,u.getEstimate(),u.getTotalWeight()))},E.sample=function(g,h){g=Math.max(g,this.minDelayMs_);var o=8*h,u=g/1e3,r=o/u;this.fast_.sample(u,r),this.slow_.sample(u,r)},E.canEstimate=function(){var g=this.fast_;return g&&g.getTotalWeight()>=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},f}();L.default=M},"./src/utils/ewma.ts":function(V,L,I){"use strict";I.r(L);var k=function(){function M(E,x,g){x===void 0&&(x=0),g===void 0&&(g=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=E,this.alpha_=E?Math.exp(Math.log(.5)/E):0,this.estimate_=x,this.totalWeight_=g}var f=M.prototype;return f.sample=function(x,g){var h=Math.pow(this.alpha_,x);this.estimate_=g*(1-h)+h*this.estimate_,this.totalWeight_+=x},f.getTotalWeight=function(){return this.totalWeight_},f.getEstimate=function(){if(this.alpha_){var x=1-Math.pow(this.alpha_,this.totalWeight_);if(x)return this.estimate_/x}return this.estimate_},M}();L.default=k},"./src/utils/fetch-loader.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"fetchSupported",function(){return t});var k=I("./src/polyfills/number.ts"),M=I("./src/loader/load-stats.ts"),f=I("./src/demux/chunk-cache.ts");function E(d,w){d.prototype=Object.create(w.prototype),d.prototype.constructor=d,u(d,w)}function x(d){var w=typeof Map=="function"?new Map:void 0;return x=function(S){if(S===null||!o(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(S))return w.get(S);w.set(S,C)}function C(){return g(S,arguments,r(this).constructor)}return C.prototype=Object.create(S.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),u(C,S)},x(d)}function g(d,w,m){return h()?g=Reflect.construct:g=function(C,v,y){var T=[null];T.push.apply(T,v);var A=Function.bind.apply(C,T),p=new A;return y&&u(p,y.prototype),p},g.apply(null,arguments)}function h(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function o(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function u(d,w){return u=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},u(d,w)}function r(d){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},r(d)}function n(){return n=Object.assign||function(d){for(var w=1;w<arguments.length;w++){var m=arguments[w];for(var S in m)Object.prototype.hasOwnProperty.call(m,S)&&(d[S]=m[S])}return d},n.apply(this,arguments)}function t(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var i=function(){function d(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||l,this.controller=new self.AbortController,this.stats=new M.LoadStats}var w=d.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(S,C,v){var y=this,T=this.stats;if(T.loading.start)throw new Error("Loader can only be used once.");T.loading.start=self.performance.now();var A=s(S,this.controller.signal),p=v.onProgress,D=S.responseType==="arraybuffer",O=D?"byteLength":"length";this.context=S,this.config=C,this.callbacks=v,this.request=this.fetchSetup(S,A),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),v.onTimeout(T,S,y.response)},C.timeout),self.fetch(this.request).then(function(P){if(y.response=y.loader=P,!P.ok){var j=P.status,K=P.statusText;throw new c(K||"fetch, bad network response",j,P)}return T.loading.first=Math.max(self.performance.now(),T.loading.start),T.total=parseInt(P.headers.get("Content-Length")||"0"),p&&Object(k.isFiniteNumber)(C.highWaterMark)?y.loadProgressively(P,T,S,C.highWaterMark,p):D?P.arrayBuffer():P.text()}).then(function(P){var j=y.response;self.clearTimeout(y.requestTimeout),T.loading.end=Math.max(self.performance.now(),T.loading.first),T.loaded=T.total=P[O];var K={url:j.url,data:P};p&&!Object(k.isFiniteNumber)(C.highWaterMark)&&p(T,S,P,j),v.onSuccess(K,T,S,j)}).catch(function(P){if(self.clearTimeout(y.requestTimeout),T.aborted)return;var j=P.code||0;v.onError({code:j,text:P.message},S,P.details)})},w.getCacheAge=function(){var S=null;if(this.response){var C=this.response.headers.get("age");S=C?parseFloat(C):null}return S},w.loadProgressively=function(S,C,v,y,T){y===void 0&&(y=0);var A=new f.default,p=S.body.getReader(),D=function O(){return p.read().then(function(P){if(P.done)return A.dataLength&&T(C,v,A.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=P.value,K=j.length;return C.loaded+=K,K<y||A.dataLength?(A.push(j),A.dataLength>=y&&T(C,v,A.flush(),S)):T(C,v,j,S),O()}).catch(function(){return Promise.reject()})};return D()},d}();function s(d,w){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(n({},d.headers))};return d.rangeEnd&&m.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),m}function l(d,w){return new self.Request(d.url,w)}var c=function(d){E(w,d);function w(m,S,C){var v;return v=d.call(this,m)||this,v.code=void 0,v.details=void 0,v.code=S,v.details=C,v}return w}(x(Error));L.default=i},"./src/utils/imsc1-ttml-parser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"IMSC1_CODEC",function(){return o}),I.d(L,"parseIMSC1",function(){return t});var k=I("./src/utils/mp4-tools.ts"),M=I("./src/utils/vttparser.ts"),f=I("./src/utils/vttcue.ts"),E=I("./src/demux/id3.ts"),x=I("./src/utils/timescale-conversion.ts"),g=I("./src/utils/webvtt-parser.ts");function h(){return h=Object.assign||function(y){for(var T=1;T<arguments.length;T++){var A=arguments[T];for(var p in A)Object.prototype.hasOwnProperty.call(A,p)&&(y[p]=A[p])}return y},h.apply(this,arguments)}var o="stpp.ttml.im1t",u=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,r=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,n={left:"start",center:"center",right:"end",start:"start",end:"end"};function t(y,T,A,p,D){var O=Object(k.findBox)(new Uint8Array(y),["mdat"]);if(O.length===0){D(new Error("Could not parse IMSC1 mdat"));return}var P=O[0],j=Object(E.utf8ArrayToStr)(new Uint8Array(y,P.start,P.end-P.start)),K=Object(x.toTimescaleFromScale)(T,1,A);try{p(i(j,K))}catch(U){D(U)}}function i(y,T){var A=new DOMParser,p=A.parseFromString(y,"text/xml"),D=p.getElementsByTagName("tt")[0];if(!D)throw new Error("Invalid ttml");var O={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},P=Object.keys(O).reduce(function(B,N){return B[N]=D.getAttribute("ttp:"+N)||O[N],B},{}),j=D.getAttribute("xml:space")!=="preserve",K=l(s(D,"styling","style")),U=l(s(D,"layout","region")),X=s(D,"body","[begin]");return[].map.call(X,function(B){var N=c(B,j);if(!N||!B.hasAttribute("begin"))return null;var z=S(B.getAttribute("begin"),P),te=S(B.getAttribute("dur"),P),ce=S(B.getAttribute("end"),P);if(z===null)throw m(B);if(ce===null){if(te===null)throw m(B);ce=z+te}var be=new f.default(z-T,ce-T,N);be.id=Object(g.generateCueId)(be.startTime,be.endTime,be.text);var Fe=U[B.getAttribute("region")],Oe=K[B.getAttribute("style")];be.position=10,be.size=80;var Re=d(Fe,Oe),Be=Re.textAlign;if(Be){var Ke=n[Be];Ke&&(be.lineAlign=Ke),be.align=Be}return h(be,Re),be}).filter(function(B){return B!==null})}function s(y,T,A){var p=y.getElementsByTagName(T)[0];return p?[].slice.call(p.querySelectorAll(A)):[]}function l(y){return y.reduce(function(T,A){var p=A.getAttribute("xml:id");return p&&(T[p]=A),T},{})}function c(y,T){return[].slice.call(y.childNodes).reduce(function(A,p,D){var O;return p.nodeName==="br"&&D?A+`
`:(O=p.childNodes)!==null&&O!==void 0&&O.length?c(p,T):T?A+p.textContent.trim().replace(/\s+/g," "):A+p.textContent},"")}function d(y,T){var A="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(D,O){var P=w(T,A,O)||w(y,A,O);return P&&(D[O]=P),D},{})}function w(y,T,A){return y.hasAttributeNS(T,A)?y.getAttributeNS(T,A):null}function m(y){return new Error("Could not parse ttml timestamp "+y)}function S(y,T){if(!y)return null;var A=Object(M.parseTimeStamp)(y);return A===null&&(u.test(y)?A=C(y,T):r.test(y)&&(A=v(y,T))),A}function C(y,T){var A=u.exec(y),p=(A[4]|0)+(A[5]|0)/T.subFrameRate;return(A[1]|0)*3600+(A[2]|0)*60+(A[3]|0)+p/T.frameRate}function v(y,T){var A=r.exec(y),p=Number(A[1]),D=A[2];switch(D){case"h":return p*3600;case"m":return p*60;case"ms":return p*1e3;case"f":return p/T.frameRate;case"t":return p/T.tickRate}return p}},"./src/utils/logger.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"enableLogs",function(){return g}),I.d(L,"logger",function(){return h});var k=function(){},M={trace:k,debug:k,log:k,warn:k,info:k,error:k},f=M;function E(o){var u=self.console[o];return u?u.bind(self.console,"["+o+"] >"):k}function x(o){for(var u=arguments.length,r=new Array(u>1?u-1:0),n=1;n<u;n++)r[n-1]=arguments[n];r.forEach(function(t){f[t]=o[t]?o[t].bind(o):E(t)})}function g(o){if(self.console&&o===!0||typeof o=="object"){x(o,"debug","log","info","warn","error");try{f.log()}catch(u){f=M}}else f=M}var h=f},"./src/utils/mediakeys-helper.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"KeySystems",function(){return k}),I.d(L,"requestMediaKeySystemAccess",function(){return M});var k;(function(f){f.WIDEVINE="com.widevine.alpha",f.PLAYREADY="com.microsoft.playready"})(k||(k={}));var M=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"getMediaSource",function(){return k});function k(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"bin2str",function(){return x}),I.d(L,"readUint16",function(){return g}),I.d(L,"readUint32",function(){return h}),I.d(L,"writeUint32",function(){return o}),I.d(L,"findBox",function(){return u}),I.d(L,"parseSegmentIndex",function(){return r}),I.d(L,"parseInitSegment",function(){return n}),I.d(L,"getStartDTS",function(){return t}),I.d(L,"getDuration",function(){return i}),I.d(L,"computeRawDurationFromSamples",function(){return s}),I.d(L,"offsetStartDTS",function(){return l}),I.d(L,"segmentValidRange",function(){return c}),I.d(L,"appendUint8Array",function(){return d});var k=I("./src/utils/typed-array.ts"),M=I("./src/loader/fragment.ts"),f=Math.pow(2,32)-1,E=[].push;function x(w){return String.fromCharCode.apply(null,w)}function g(w,m){"data"in w&&(m+=w.start,w=w.data);var S=w[m]<<8|w[m+1];return S<0?65536+S:S}function h(w,m){"data"in w&&(m+=w.start,w=w.data);var S=w[m]<<24|w[m+1]<<16|w[m+2]<<8|w[m+3];return S<0?4294967296+S:S}function o(w,m,S){"data"in w&&(m+=w.start,w=w.data),w[m]=S>>24,w[m+1]=S>>16&255,w[m+2]=S>>8&255,w[m+3]=S&255}function u(w,m){var S=[];if(!m.length)return S;var C,v,y;"data"in w?(C=w.data,v=w.start,y=w.end):(C=w,v=0,y=C.byteLength);for(var T=v;T<y;){var A=h(C,T),p=x(C.subarray(T+4,T+8)),D=A>1?T+A:y;if(p===m[0])if(m.length===1)S.push({data:C,start:T+8,end:D});else{var O=u({data:C,start:T+8,end:D},m.slice(1));O.length&&E.apply(S,O)}T=D}return S}function r(w){var m=u(w,["moov"]),S=m[0],C=S?S.end:null,v=u(w,["sidx"]);if(!v||!v[0])return null;var y=[],T=v[0],A=T.data[0],p=A===0?8:16,D=h(T,p);p+=4;var O=0,P=0;A===0?p+=8:p+=16,p+=2;var j=T.end+P,K=g(T,p);p+=2;for(var U=0;U<K;U++){var X=p,B=h(T,X);X+=4;var N=B&2147483647,z=(B&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=h(T,X);X+=4,y.push({referenceSize:N,subsegmentDuration:te,info:{duration:te/D,start:j,end:j+N-1}}),j+=N,X+=4,p=X}return{earliestPresentationTime:O,timescale:D,version:A,referencesCount:K,references:y,moovEndOffset:C}}function n(w){for(var m=[],S=u(w,["moov","trak"]),C=0;C<S.length;C++){var v=S[C],y=u(v,["tkhd"])[0];if(y){var T=y.data[y.start],A=T===0?12:20,p=h(y,A),D=u(v,["mdia","mdhd"])[0];if(D){T=D.data[D.start],A=T===0?12:20;var O=h(D,A),P=u(v,["mdia","hdlr"])[0];if(P){var j=x(P.data.subarray(P.start+8,P.start+12)),K={soun:M.ElementaryStreamTypes.AUDIO,vide:M.ElementaryStreamTypes.VIDEO}[j];if(K){var U=u(v,["mdia","minf","stbl","stsd"])[0],X=void 0;U&&(X=x(U.data.subarray(U.start+12,U.start+16))),m[p]={timescale:O,type:K},m[K]={timescale:O,id:p,codec:X}}}}}}var B=u(w,["moov","mvex","trex"]);return B.forEach(function(N){var z=h(N,4),te=m[z];te&&(te.default={duration:h(N,12),flags:h(N,20)})}),m}function t(w,m){return u(m,["moof","traf"]).reduce(function(S,C){var v=u(C,["tfdt"])[0],y=v.data[v.start],T=u(C,["tfhd"]).reduce(function(A,p){var D=h(p,4),O=w[D];if(O){var P=h(v,4);y===1&&(P*=Math.pow(2,32),P+=h(v,8));var j=O.timescale||9e4,K=P/j;if(isFinite(K)&&(A===null||K<A))return K}return A},null);return T!==null&&isFinite(T)&&(S===null||T<S)?T:S},null)||0}function i(w,m){for(var S=0,C=0,v=0,y=u(w,["moof","traf"]),T=0;T<y.length;T++){var A=y[T],p=u(A,["tfhd"])[0],D=h(p,4),O=m[D];if(!O)continue;var P=O.default,j=h(p,0)|(P==null?void 0:P.flags),K=P==null?void 0:P.duration;j&8&&(j&2?K=h(p,12):K=h(p,8));for(var U=O.timescale||9e4,X=u(A,["trun"]),B=0;B<X.length;B++){if(K){var N=h(X[B],4);S=K*N}else S=s(X[B]);O.type===M.ElementaryStreamTypes.VIDEO?C+=S/U:O.type===M.ElementaryStreamTypes.AUDIO&&(v+=S/U)}}if(C===0&&v===0){var z=r(w);if(z!=null&&z.references)return z.references.reduce(function(te,ce){return te+ce.info.duration||0},0)}return C||v}function s(w){var m=h(w,0),S=8;m&1&&(S+=4),m&4&&(S+=4);for(var C=0,v=h(w,4),y=0;y<v;y++){if(m&256){var T=h(w,S);C+=T,S+=4}m&512&&(S+=4),m&1024&&(S+=4),m&2048&&(S+=4)}return C}function l(w,m,S){u(m,["moof","traf"]).forEach(function(C){u(C,["tfhd"]).forEach(function(v){var y=h(v,4),T=w[y];if(!T)return;var A=T.timescale||9e4;u(C,["tfdt"]).forEach(function(p){var D=p.data[p.start],O=h(p,4);if(D===0)o(p,4,O-S*A);else{O*=Math.pow(2,32),O+=h(p,8),O-=S*A,O=Math.max(O,0);var P=Math.floor(O/(f+1)),j=Math.floor(O%(f+1));o(p,4,P),o(p,8,j)}})})})}function c(w){var m={valid:null,remainder:null},S=u(w,["moof"]);if(S){if(S.length<2)return m.remainder=w,m}else return m;var C=S[S.length-1];return m.valid=Object(k.sliceUint8)(w,0,C.start-8),m.remainder=Object(k.sliceUint8)(w,C.start-8),m}function d(w,m){var S=new Uint8Array(w.length+m.length);return S.set(w),S.set(m,w.length),S}},"./src/utils/output-filter.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"default",function(){return k});var k=function(){function M(E,x){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=E,this.trackName=x}var f=M.prototype;return f.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},f.newCue=function(x,g,h){(this.startTime===null||this.startTime>x)&&(this.startTime=x),this.endTime=g,this.screen=h,this.timelineController.createCaptionsTrack(this.trackName)},f.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"sendAddTrackEvent",function(){return M}),I.d(L,"addCueToTrack",function(){return f}),I.d(L,"clearCurrentCues",function(){return E}),I.d(L,"removeCuesInRange",function(){return x}),I.d(L,"getCuesInRange",function(){return h});var k=I("./src/utils/logger.ts");function M(o,u){var r;try{r=new Event("addtrack")}catch(n){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=o,u.dispatchEvent(r)}function f(o,u){var r=o.mode;if(r==="disabled"&&(o.mode="hidden"),o.cues&&!o.cues.getCueById(u.id))try{if(o.addCue(u),!o.cues.getCueById(u.id))throw new Error("addCue is failed for: "+u)}catch(t){k.logger.debug("[texttrack-utils]: "+t);var n=new self.TextTrackCue(u.startTime,u.endTime,u.text);n.id=u.id,o.addCue(n)}r==="disabled"&&(o.mode=r)}function E(o){var u=o.mode;if(u==="disabled"&&(o.mode="hidden"),o.cues)for(var r=o.cues.length;r--;)o.removeCue(o.cues[r]);u==="disabled"&&(o.mode=u)}function x(o,u,r){var n=o.mode;if(n==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0)for(var t=h(o.cues,u,r),i=0;i<t.length;i++)o.removeCue(t[i]);n==="disabled"&&(o.mode=n)}function g(o,u){if(u<o[0].startTime)return 0;var r=o.length-1;if(u>o[r].endTime)return-1;for(var n=0,t=r;n<=t;){var i=Math.floor((t+n)/2);if(u<o[i].startTime)t=i-1;else if(u>o[i].startTime&&n<r)n=i+1;else return i}return o[n].startTime-u<u-o[t].startTime?n:t}function h(o,u,r){var n=[],t=g(o,u);if(t>-1)for(var i=t,s=o.length;i<s;i++){var l=o[i];if(l.startTime>=u&&l.endTime<=r)n.push(l);else if(l.startTime>r)return n}return n}},"./src/utils/time-ranges.ts":function(V,L,I){"use strict";I.r(L);var k={toString:function(f){for(var E="",x=f.length,g=0;g<x;g++)E+="["+f.start(g).toFixed(3)+","+f.end(g).toFixed(3)+"]";return E}};L.default=k},"./src/utils/timescale-conversion.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"toTimescaleFromBase",function(){return M}),I.d(L,"toTimescaleFromScale",function(){return f}),I.d(L,"toMsFromMpegTsClock",function(){return E}),I.d(L,"toMpegTsClockFromTimescale",function(){return x});var k=9e4;function M(g,h,o,u){o===void 0&&(o=1),u===void 0&&(u=!1);var r=g*h*o;return u?Math.round(r):r}function f(g,h,o,u){return o===void 0&&(o=1),u===void 0&&(u=!1),M(g,h,1/o,u)}function E(g,h){return h===void 0&&(h=!1),M(g,1e3,1/k,h)}function x(g,h){return h===void 0&&(h=1),M(g,k,1/h)}},"./src/utils/typed-array.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"sliceUint8",function(){return k});function k(M,f,E){return Uint8Array.prototype.slice?M.slice(f,E):new Uint8Array(Array.prototype.slice.call(M,f,E))}},"./src/utils/vttcue.ts":function(V,L,I){"use strict";I.r(L),L.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var k=["","lr","rl"],M=["start","middle","end","left","right"];function f(o,u){if(typeof u!="string")return!1;if(!Array.isArray(o))return!1;var r=u.toLowerCase();return~o.indexOf(r)?r:!1}function E(o){return f(k,o)}function x(o){return f(M,o)}function g(o){for(var u=arguments.length,r=new Array(u>1?u-1:0),n=1;n<u;n++)r[n-1]=arguments[n];for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)o[s]=i[s]}return o}function h(o,u,r){var n=this,t={enumerable:!0};n.hasBeenReset=!1;var i="",s=!1,l=o,c=u,d=r,w=null,m="",S=!0,C="auto",v="start",y=50,T="middle",A=50,p="middle";Object.defineProperty(n,"id",g({},t,{get:function(){return i},set:function(O){i=""+O}})),Object.defineProperty(n,"pauseOnExit",g({},t,{get:function(){return s},set:function(O){s=!!O}})),Object.defineProperty(n,"startTime",g({},t,{get:function(){return l},set:function(O){if(typeof O!="number")throw new TypeError("Start time must be set to a number.");l=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"endTime",g({},t,{get:function(){return c},set:function(O){if(typeof O!="number")throw new TypeError("End time must be set to a number.");c=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"text",g({},t,{get:function(){return d},set:function(O){d=""+O,this.hasBeenReset=!0}})),Object.defineProperty(n,"region",g({},t,{get:function(){return w},set:function(O){w=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"vertical",g({},t,{get:function(){return m},set:function(O){var P=E(O);if(P===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=P,this.hasBeenReset=!0}})),Object.defineProperty(n,"snapToLines",g({},t,{get:function(){return S},set:function(O){S=!!O,this.hasBeenReset=!0}})),Object.defineProperty(n,"line",g({},t,{get:function(){return C},set:function(O){if(typeof O!="number"&&O!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");C=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"lineAlign",g({},t,{get:function(){return v},set:function(O){var P=x(O);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");v=P,this.hasBeenReset=!0}})),Object.defineProperty(n,"position",g({},t,{get:function(){return y},set:function(O){if(O<0||O>100)throw new Error("Position must be between 0 and 100.");y=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",g({},t,{get:function(){return T},set:function(O){var P=x(O);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");T=P,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",g({},t,{get:function(){return A},set:function(O){if(O<0||O>100)throw new Error("Size must be between 0 and 100.");A=O,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",g({},t,{get:function(){return p},set:function(O){var P=x(O);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");p=P,this.hasBeenReset=!0}})),n.displayState=void 0}return h.prototype.getCueAsHTML=function(){var o=self.WebVTT;return o.convertCueToDOMTree(self,this.text)},h}()},"./src/utils/vttparser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"parseTimeStamp",function(){return f}),I.d(L,"fixLineBreaks",function(){return u}),I.d(L,"VTTParser",function(){return r});var k=I("./src/utils/vttcue.ts"),M=function(){function n(){}var t=n.prototype;return t.decode=function(s,l){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},n}();function f(n){function t(s,l,c,d){return(s|0)*3600+(l|0)*60+(c|0)+parseFloat(d||0)}var i=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}var E=function(){function n(){this.values=Object.create(null)}var t=n.prototype;return t.set=function(s,l){!this.get(s)&&l!==""&&(this.values[s]=l)},t.get=function(s,l,c){return c?this.has(s)?this.values[s]:l[c]:this.has(s)?this.values[s]:l},t.has=function(s){return s in this.values},t.alt=function(s,l,c){for(var d=0;d<c.length;++d)if(l===c[d]){this.set(s,l);break}},t.integer=function(s,l){/^-?\d+$/.test(l)&&this.set(s,parseInt(l,10))},t.percent=function(s,l){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(l)){var c=parseFloat(l);if(c>=0&&c<=100)return this.set(s,c),!0}return!1},n}();function x(n,t,i,s){var l=s?n.split(s):[n];for(var c in l){if(typeof l[c]!="string")continue;var d=l[c].split(i);if(d.length!==2)continue;var w=d[0],m=d[1];t(w,m)}}var g=new k.default(0,0,""),h=g.align==="middle"?"middle":"center";function o(n,t,i){var s=n;function l(){var w=f(n);if(w===null)throw new Error("Malformed timestamp: "+s);return n=n.replace(/^[^\sa-zA-Z-]+/,""),w}function c(w,m){var S=new E;x(w,function(y,T){var A;switch(y){case"region":for(var p=i.length-1;p>=0;p--)if(i[p].id===T){S.set(y,i[p].region);break}break;case"vertical":S.alt(y,T,["rl","lr"]);break;case"line":A=T.split(","),S.integer(y,A[0]),S.percent(y,A[0])&&S.set("snapToLines",!1),S.alt(y,A[0],["auto"]),A.length===2&&S.alt("lineAlign",A[1],["start",h,"end"]);break;case"position":A=T.split(","),S.percent(y,A[0]),A.length===2&&S.alt("positionAlign",A[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":S.percent(y,T);break;case"align":S.alt(y,T,["start",h,"end","left","right"]);break}},/:/,/\s/),m.region=S.get("region",null),m.vertical=S.get("vertical","");var C=S.get("line","auto");C==="auto"&&g.line===-1&&(C=-1),m.line=C,m.lineAlign=S.get("lineAlign","start"),m.snapToLines=S.get("snapToLines",!0),m.size=S.get("size",100),m.align=S.get("align",h);var v=S.get("position","auto");v==="auto"&&g.position===50&&(v=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=v}function d(){n=n.replace(/^\s+/,"")}if(d(),t.startTime=l(),d(),n.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);n=n.substr(3),d(),t.endTime=l(),d(),c(n,t)}function u(n){return n.replace(/<br(?: \/)?>/gi,`
`)}var r=function(){function n(){this.state="INITIAL",this.buffer="",this.decoder=new M,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=n.prototype;return t.parse=function(s){var l=this;s&&(l.buffer+=l.decoder.decode(s,{stream:!0}));function c(){var v=l.buffer,y=0;for(v=u(v);y<v.length&&v[y]!=="\r"&&v[y]!==`
`;)++y;var T=v.substr(0,y);return v[y]==="\r"&&++y,v[y]===`
`&&++y,l.buffer=v.substr(y),T}function d(v){x(v,function(y,T){},/:/)}try{var w="";if(l.state==="INITIAL"){if(!/\r\n|\n/.test(l.buffer))return this;w=c();var m=w.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");l.state="HEADER"}for(var S=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;S?S=!1:w=c();switch(l.state){case"HEADER":/:/.test(w)?d(w):w||(l.state="ID");continue;case"NOTE":w||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){l.state="NOTE";break}if(!w)continue;if(l.cue=new k.default(0,0,""),l.state="CUE",w.indexOf("-->")===-1){l.cue.id=w;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{o(w,l.cue,l.regionList)}catch(v){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var C=w.indexOf("-->")!==-1;if(!w||C&&(S=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=`
`),l.cue.text+=w}continue;case"BADCUE":w||(l.state="ID")}}}catch(v){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(l){s.onparsingerror&&s.onparsingerror(l)}return s.onflush&&s.onflush(),this},n}()},"./src/utils/webvtt-parser.ts":function(V,L,I){"use strict";I.r(L),I.d(L,"generateCueId",function(){return r}),I.d(L,"parseWebVTT",function(){return t});var k=I("./src/polyfills/number.ts"),M=I("./src/utils/vttparser.ts"),f=I("./src/demux/id3.ts"),E=I("./src/utils/timescale-conversion.ts"),x=I("./src/remux/mp4-remuxer.ts"),g=/\r\n|\n\r|\n|\r/g,h=function(s,l,c){return c===void 0&&(c=0),s.substr(c,l.length)===l},o=function(s){var l=parseInt(s.substr(-3)),c=parseInt(s.substr(-6,2)),d=parseInt(s.substr(-9,2)),w=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(k.isFiniteNumber)(l)||!Object(k.isFiniteNumber)(c)||!Object(k.isFiniteNumber)(d)||!Object(k.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return l+=1e3*c,l+=60*1e3*d,l+=60*60*1e3*w,l},u=function(s){for(var l=5381,c=s.length;c;)l=l*33^s.charCodeAt(--c);return(l>>>0).toString()};function r(i,s,l){return u(i.toString())+u(s.toString())+u(l)}var n=function(s,l,c){var d=s[l],w=s[d.prevCC];if(!w||!w.new&&d.new){s.ccOffset=s.presentationOffset=d.start,d.new=!1;return}for(;(m=w)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=d.start-w.start,d.new=!1,d=w,w=s[d.prevCC]}s.presentationOffset=c};function t(i,s,l,c,d,w,m,S){var C=new M.VTTParser,v=Object(f.utf8ArrayToStr)(new Uint8Array(i)).trim().replace(g,`
`).split(`
`),y=[],T=Object(E.toMpegTsClockFromTimescale)(s,l),A="00:00.000",p=0,D=0,O,P=!0,j=!1;C.oncue=function(K){var U=c[d],X=c.ccOffset,B=(p-T)/9e4;if(U!=null&&U.new&&(D!==void 0?X=c.ccOffset=U.start:n(c,d,B)),B&&(X=B-c.presentationOffset),j){var N=K.endTime-K.startTime,z=Object(x.normalizePts)((K.startTime+X-D)*9e4,w*9e4)/9e4;K.startTime=z,K.endTime=z+N}var te=K.text.trim();K.text=decodeURIComponent(encodeURIComponent(te)),K.id||(K.id=r(K.startTime,K.endTime,te)),K.endTime>0&&y.push(K)},C.onparsingerror=function(K){O=K},C.onflush=function(){if(O){S(O);return}m(y)},v.forEach(function(K){if(P)if(h(K,"X-TIMESTAMP-MAP=")){P=!1,j=!0,K.substr(16).split(",").forEach(function(U){h(U,"LOCAL:")?A=U.substr(6):h(U,"MPEGTS:")&&(p=parseInt(U.substr(7)))});try{D=o(A)/1e3}catch(U){j=!1,O=U}return}else K===""&&(P=!1);C.parse(K+`
`)}),C.flush()}},"./src/utils/xhr-loader.ts":function(V,L,I){"use strict";I.r(L);var k=I("./src/utils/logger.ts"),M=I("./src/loader/load-stats.ts"),f=/^age:\s*[\d.]+\s*$/m,E=function(){function x(h){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=h?h.xhrSetup:null,this.stats=new M.LoadStats,this.retryDelay=0}var g=x.prototype;return g.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},g.abortInternal=function(){var o=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),o&&(o.onreadystatechange=null,o.onprogress=null,o.readyState!==4&&(this.stats.aborted=!0,o.abort()))},g.abort=function(){var o;this.abortInternal(),(o=this.callbacks)!==null&&o!==void 0&&o.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},g.load=function(o,u,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=o,this.config=u,this.callbacks=r,this.retryDelay=u.retryDelay,this.loadInternal()},g.loadInternal=function(){var o=this.config,u=this.context;if(!o)return;var r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var t=this.xhrSetup;try{if(t)try{t(r,u.url)}catch(l){r.open("GET",u.url,!0),t(r,u.url)}r.readyState||r.open("GET",u.url,!0);var i=this.context.headers;if(i)for(var s in i)r.setRequestHeader(s,i[s])}catch(l){this.callbacks.onError({code:r.status,text:l.message},u,r);return}u.rangeEnd&&r.setRequestHeader("Range","bytes="+u.rangeStart+"-"+(u.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=u.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout),r.send()},g.readystatechange=function(){var o=this.context,u=this.loader,r=this.stats;if(!o||!u)return;var n=u.readyState,t=this.config;if(r.aborted)return;if(n>=2)if(self.clearTimeout(this.requestTimeout),r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),n===4){u.onreadystatechange=null,u.onprogress=null;var i=u.status;if(i>=200&&i<300){r.loading.end=Math.max(self.performance.now(),r.loading.first);var s,l;if(o.responseType==="arraybuffer"?(s=u.response,l=s.byteLength):(s=u.responseText,l=s.length),r.loaded=r.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(r,o,s,u),!this.callbacks)return;var d={url:u.responseURL,data:s};this.callbacks.onSuccess(d,r,o,u)}else r.retry>=t.maxRetry||i>=400&&i<499?(k.logger.error(i+" while loading "+o.url),this.callbacks.onError({code:i,text:u.statusText},o,u)):(k.logger.warn(i+" while loading "+o.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,t.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout)},g.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))},g.loadprogress=function(o){var u=this.stats;u.loaded=o.loaded,o.lengthComputable&&(u.total=o.total)},g.getCacheAge=function(){var o=null;if(this.loader&&f.test(this.loader.getAllResponseHeaders())){var u=this.loader.getResponseHeader("age");o=u?parseFloat(u):null}return o},x}();L.default=E}}).default})},vHTk:function(at,fe,oe){at.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.getPointerEvent=V,fe.stopEvent=L,fe.setCapture=x,fe.releaseCapture=g;function V(h){return h.changedTouches?h.changedTouches[0]:h.touches?h.touches[0]:h}function L(h){h.stopPropagation(),h.preventDefault()}var I=!1,k=null;document.captureElement=null;function M(h){if(I)return;var o=new h.constructor(h.type,h);I=!0,document.captureElement?document.captureElement.dispatchEvent(o):k.dispatchEvent(o),I=!1,h.stopPropagation(),o.defaultPrevented&&h.preventDefault(),h.type==="mouseup"&&g()}function f(){var h=document.getElementById("noVNC_mouse_capture_elem");h.style.cursor=window.getComputedStyle(document.captureElement).cursor}var E=new MutationObserver(f);function x(h){if(h.setCapture)h.setCapture(),document.captureElement=h,h.addEventListener("mouseup",g);else{g();var o=document.getElementById("noVNC_mouse_capture_elem");o===null&&(o=document.createElement("div"),o.id="noVNC_mouse_capture_elem",o.style.position="fixed",o.style.top="0px",o.style.left="0px",o.style.width="100%",o.style.height="100%",o.style.zIndex=1e4,o.style.display="none",document.body.appendChild(o),o.addEventListener("contextmenu",M),o.addEventListener("mousemove",M),o.addEventListener("mouseup",M)),document.captureElement=h,E.observe(h,{attributes:!0}),f(),o.style.display="",window.addEventListener("mousemove",M),window.addEventListener("mouseup",M)}}function g(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;k=document.captureElement,document.captureElement=null,E.disconnect();var h=document.getElementById("noVNC_mouse_capture_elem");h.style.display="none",window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",M)}}},whVF:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=oe("lNSK"),L=I(oe("1q3G"));function I(x){return x&&x.__esModule?x:{default:x}}function k(x,g){if(!(x instanceof g))throw new TypeError("Cannot call a class as a function")}function M(x,g){for(var h=0;h<g.length;h++){var o=g[h];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(x,o.key,o)}}function f(x,g,h){return g&&M(x.prototype,g),h&&M(x,h),x}var E=function(){function x(){k(this,x),this.strm=new L.default,this.chunkSize=1024*10*10,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,V.deflateInit)(this.strm,this.windowBits)}return f(x,[{key:"deflate",value:function(h){this.strm.input=h,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0,this.strm.output=this.outputBuffer,this.strm.avail_out=this.chunkSize,this.strm.next_out=0;var o=(0,V.deflate)(this.strm,V.Z_FULL_FLUSH),u=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(o<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var r=[u],n=u.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,o=(0,V.deflate)(this.strm,V.Z_FULL_FLUSH),o<0)throw new Error("zlib deflate failed");var t=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);n+=t.length,r.push(t)}while(this.strm.avail_in>0);for(var i=new Uint8Array(n),s=0,l=0;l<r.length;l++)i.set(r[l],s),s+=r[l].length;u=i}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,u}}]),x}();fe.default=E},xO64:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V=L(oe("8K/p"));function L(t){return t&&t.__esModule?t:{default:t}}function I(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(s){return typeof s}:I=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},I(t)}function k(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function M(t,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,l.key,l)}}function f(t,i,s){return i&&M(t.prototype,i),s&&M(t,s),t}function E(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&x(t,i)}function x(t,i){return x=Object.setPrototypeOf||function(l,c){return l.__proto__=c,l},x(t,i)}function g(t){var i=u();return function(){var l=r(t),c;if(i){var d=r(this).constructor;c=Reflect.construct(l,arguments,d)}else c=l.apply(this,arguments);return h(this,c)}}function h(t,i){return i&&(I(i)==="object"||typeof i=="function")?i:o(t)}function o(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(){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(t){return!1}}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},r(t)}var n=function(t){E(s,t);var i=g(s);function s(){return k(this,s),i.apply(this,arguments)}return f(s,[{key:"_pngRect",value:function(c,d,w,m,S,C,v){var y=this._readData(S);return y===null?!1:(C.imageRect(c,d,w,m,"image/png",y),!0)}},{key:"_basicRect",value:function(c,d,w,m,S,C,v,y){throw new Error("BasicCompression received in TightPNG rect")}}]),s}(V.default);fe.default=n},xSIq:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var V={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};fe.default=V},xlC8:function(at,fe,oe){"use strict";Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=V;function V(L,I,k,M){for(var f=L&65535|0,E=L>>>16&65535|0,x=0;k!==0;){x=k>2e3?2e3:k,k-=x;do f=f+I[M++]|0,E=E+f|0;while(--x);f%=65521,E%=65521}return f|E<<16|0}}}]);